liujie
6 天以前 729a5a0592cac7750e8b476c5fcb25bfc3ff8d25
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/impl/OrderCallServiceImpl.java
@@ -2,17 +2,14 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar;
import com.stylefeng.guns.modular.account.controller.AppOrderController;
import com.stylefeng.guns.modular.call.dao.OrderCallMapper;
import com.stylefeng.guns.modular.call.model.OrderCall;
import com.stylefeng.guns.modular.call.server.IOrderCallService;
import com.stylefeng.guns.modular.system.model.OpenCity;
import com.stylefeng.guns.modular.system.model.SysIntegral;
import com.stylefeng.guns.modular.system.model.UserInfo;
import com.stylefeng.guns.modular.system.service.IIncomeService;
import com.stylefeng.guns.modular.system.service.ISysIntegralService;
import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
import com.stylefeng.guns.modular.system.service.IUserInfoService;
import com.stylefeng.guns.modular.system.service.*;
import com.stylefeng.guns.modular.system.util.PayMoneyUtil;
import com.stylefeng.guns.modular.system.util.ResultUtil;
import com.stylefeng.guns.modular.system.util.UUIDUtil;
@@ -40,6 +37,8 @@
    @Autowired
    private ISysIntegralService sysIntegralService;
    @Autowired
    private IOpenCityService openCityService;
    @Autowired
    private IIncomeService incomeService;
@@ -68,23 +67,24 @@
            paymentRecordService.saveData(1, uid, 1, orderId, 7, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
            if (userInfo.getBalance() == null || userInfo.getBalance() < money) {
                return ResultUtil.error("余额不足,无法完成支付");
            }
            resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money);
            if(resultUtil.getCode()==500){
                return ResultUtil.error("电子余额不足,无法完成支付");
            }
//            resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money);
//            if(resultUtil.getCode()==500){
//                return ResultUtil.error("电子余额不足,无法完成支付");
//            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCall.getCompanyId()));
            OpenCity openCity = openCityService.openCity1(orderCall.getStartLon().toString(), orderCall.getStartLat().toString());
            SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId()));
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "助老模式-感谢费", money, 2, 1, 1, 7, orderId);
            userInfoService.updateById(userInfo);
            orderCall.setThankYouFee(money);
            this.updateById(orderCall);
@@ -113,7 +113,8 @@
        paymentRecordService.updateById(query);
        UserInfo userInfo = userInfoService.selectById(orderCall.getUserId());
        SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("companyId", orderCall.getCompanyId()));
        OpenCity openCity = openCityService.openCity1(orderCall.getStartLon().toString(), orderCall.getStartLat().toString());
        SysIntegral query1 = sysIntegralService.selectOne(new EntityWrapper<SysIntegral>().eq("openCityId", openCity.getId()));
        userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分
        //添加交易明细
        transactionDetailsService.saveData(userInfo.getId(), "助老模式-感谢费", query.getAmount(), 2, 1, 1, 7, orderId);