liujie
2025-11-22 bfbb651d3e15563ccfa53b860a88f990fdfedad6
UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -12,6 +12,8 @@
import com.stylefeng.guns.core.util.JwtTokenUtil;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.account.controller.AppOrderController;
import com.stylefeng.guns.modular.account.dao.UserWithdrawalMapper;
import com.stylefeng.guns.modular.account.server.UserWithdrawalService;
import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil;
import com.stylefeng.guns.modular.system.dao.*;
import com.stylefeng.guns.modular.system.model.*;
@@ -124,6 +126,8 @@
    private boolean pushMinistryOfTransport;
    private String salt = "&a.s";
    @Autowired
    private UserWithdrawalService userWithdrawalService;
    /**
@@ -1072,6 +1076,7 @@
     */
    @Override
    public void payCancelUserBalance(Integer id, String order_id, Integer paymentRecordId, Integer type) throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
        UserInfo userInfo = this.selectById(id);
        System.out.println("用户信息"+userInfo);
        PaymentRecord query = paymentRecordService.selectById(paymentRecordId);
@@ -1090,6 +1095,15 @@
                paymentRecordService.updateById(query);
                this.addCoupon(userInfo.getId(), query.getAmount(), userInfo.getCompanyId(), query.getId());//添加优惠券
                String date = simpleDateFormat.format(new Date());
                UserWithdrawal userWithdrawal1 = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>()
                        .eq("phone", userInfo.getPhone()).eq("type", 1)
                        .last("LIMIT 1"));
                if(userWithdrawal1.getHuifuId()!=null){
                    DouGongPayUtil.payFromUser(order_id,date,  query.getAmount().toString(), userWithdrawal1.getHuifuId());
                }
            } else {
                System.err.println("预支付数据异常(userId = " + id + ")");