|
|
@@ -1209,7 +1209,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
if (StringUtils.isBlank(user.getMaOpenId())){
|
|
|
return R.error("用户未绑定微信!");
|
|
|
}
|
|
|
- payParam.setCompanyId(302L);
|
|
|
+ payParam.setCompanyId(300L);
|
|
|
Company company = companyService.selectCompanyById(payParam.getCompanyId());
|
|
|
if (company==null || company.getStatus()==0){
|
|
|
return R.error("服务商不存在,或已被停用!");
|
|
|
@@ -1217,7 +1217,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
if(payParam.getPayMoney().compareTo(new BigDecimal(0.0))<1){
|
|
|
return R.error("支付金额必须大于0");
|
|
|
}
|
|
|
- payParam.setCompanyUserId(9590L);
|
|
|
+ payParam.setCompanyUserId(9587L);
|
|
|
if (payParam.getCompanyUserId()!=null){
|
|
|
CompanyUser companyUser = companyUserService.selectCompanyUserById(payParam.getCompanyUserId());
|
|
|
if(companyUser == null || companyUser.getStatus().equals("1")){
|
|
|
@@ -1232,7 +1232,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
}
|
|
|
storePayment.setStatus(0);
|
|
|
storePayment.setPayCode(IdUtil.getSnowflake(0, 0).nextIdStr());
|
|
|
- storePayment.setPayMoney(payParam.getPayMoney());
|
|
|
+ storePayment.setPayMoney(payParam.getCouponPrice());
|
|
|
storePayment.setCreateTime(new Date());
|
|
|
storePayment.setPayTypeCode("weixin");
|
|
|
storePayment.setBusinessType(3);
|
|
|
@@ -1243,7 +1243,29 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
if (fsStorePaymentScrmMapper.insertFsStorePayment(storePayment) <= 0) {
|
|
|
throw new CustomException("支付订单创建失败");
|
|
|
}
|
|
|
- return R.ok();
|
|
|
+
|
|
|
+ //汇付支付
|
|
|
+ HuiFuCreateOrder o = new HuiFuCreateOrder();
|
|
|
+ o.setTradeType("T_MINIAPP");
|
|
|
+ o.setOpenid(user.getMaOpenId());
|
|
|
+ o.setReqSeqId("payment-"+storePayment.getPayCode());
|
|
|
+ // 使用立减金面值作为支付金额
|
|
|
+ o.setTransAmt(storePayment.getPayMoney().toString());
|
|
|
+ o.setGoodsDesc("立减金购买");
|
|
|
+ HuifuCreateOrderResult result = huiFuService.createOrder(o);
|
|
|
+ if(result.getResp_code()!=null&&(result.getResp_code().equals("00000000")||result.getResp_code().equals("00000100"))){
|
|
|
+ FsStorePayment mt=new FsStorePayment();
|
|
|
+ mt.setPaymentId(storePayment.getPaymentId());
|
|
|
+ mt.setTradeNo(result.getHf_seq_id());
|
|
|
+ fsStorePaymentMapper.updateFsStorePayment(mt);
|
|
|
+ Map<String, Object> resultMap = com.alibaba.fastjson.JSON.parseObject(result.getPay_info(), new TypeReference<Map<String, Object>>() {});
|
|
|
+ String s = (String) resultMap.get("package");
|
|
|
+ resultMap.put("packageValue",s);
|
|
|
+ return R.ok().put("result",resultMap);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return R.error(result.getResp_desc());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1310,4 +1332,4 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|