|
|
@@ -1,6 +1,7 @@
|
|
|
package com.fs.company.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.fs.common.utils.IpUtil;
|
|
|
import com.fs.company.constant.PaymentStatus;
|
|
|
import com.fs.company.domain.CompanyRechargeOrder;
|
|
|
@@ -8,6 +9,8 @@ import com.fs.company.mapper.CompanyRechargeOrderMapper;
|
|
|
import com.fs.company.util.OrderUtils;
|
|
|
import com.fs.company.service.CompanyRechargeOrderService;
|
|
|
import com.fs.core.config.WxPayProperties;
|
|
|
+import com.fs.his.domain.FsUser;
|
|
|
+import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
|
|
|
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
|
|
import com.github.binarywang.wxpay.config.WxPayConfig;
|
|
|
@@ -33,6 +36,9 @@ public class CompanyRechargeOrderServiceImpl implements CompanyRechargeOrderServ
|
|
|
|
|
|
@Autowired
|
|
|
private WxPayService wxPayService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FsUserMapper fsUserMapper;
|
|
|
@Override
|
|
|
public List<CompanyRechargeOrder> queryOverdueOrder() {
|
|
|
return companyRechargeOrderMapper.queryOverdueOrder();
|
|
|
@@ -50,6 +56,8 @@ public class CompanyRechargeOrderServiceImpl implements CompanyRechargeOrderServ
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Throwable.class,propagation = Propagation.REQUIRED)
|
|
|
public CompanyRechargeOrder createOrder(CompanyRechargeOrder order) throws Exception{
|
|
|
@@ -97,5 +105,22 @@ public class CompanyRechargeOrderServiceImpl implements CompanyRechargeOrderServ
|
|
|
return companyRechargeOrderMapper.selectByOrderNo(orderNo);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String payConfirm(String payCode, String tradeNo, String bankTransactionId, String bankSerialNo,String content) {
|
|
|
+ CompanyRechargeOrder order = companyRechargeOrderMapper.selectByOrderNo(payCode);
|
|
|
+ order.setPayStatus(2);
|
|
|
+ order.setTransactionId(bankTransactionId);
|
|
|
+ order.setCallbackContent(content);
|
|
|
+ companyRechargeOrderMapper.updateByOrderNo(order);
|
|
|
+ FsUser user = fsUserMapper.selectFsUserByUserIdForUpdate(order.getUserId());
|
|
|
+ BigDecimal money = user.getMoney();
|
|
|
+ if(ObjectUtils.isNull(money)) {
|
|
|
+ money = BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ user.setMoney(money.add(order.getPayAmount()));
|
|
|
+ fsUserMapper.updateFsUser(user);
|
|
|
+ return "SUCCESS";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|