puzhibing
2023-06-09 79e8abf8fb0e451fe151af6350d655f9c92727fd
driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/DriverServiceImpl.java
@@ -156,6 +156,29 @@
            }
            driver.setCreateTime(new Date());
            this.insert(driver);
            //司机邀请注册奖励
            if(null != driver.getInviterId()){
                Driver driver1 = this.selectById(driver.getInviterId());
                SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 4));
                if(null != systemConfig){
                    Integer num7 = JSON.parseObject(systemConfig.getContent()).getInteger("num7");
                    if(num7 > 0){
                        AccountChangeDetail accountChangeDetail = new AccountChangeDetail();
                        accountChangeDetail.setCode(System.currentTimeMillis() + UUIDUtil.getNumberRandom(3));
                        accountChangeDetail.setUserType(2);
                        accountChangeDetail.setUserId(driver1.getId());
                        accountChangeDetail.setType(2);
                        accountChangeDetail.setChangeType(5);
                        accountChangeDetail.setOldData(driver1.getIntegral().doubleValue());
                        driver1.setIntegral(driver1.getIntegral() + num7);
                        accountChangeDetail.setNewData(driver1.getIntegral().doubleValue());
                        accountChangeDetail.setExplain("邀请司机注册奖励");
                        accountChangeDetailService.saveData(accountChangeDetail);
                        this.updateById(driver1);
                    }
                }
            }
        }
        return ResultUtil.success();
    }
@@ -175,6 +198,10 @@
        driver.setIdcardBack(driverRegisterWarpper.getIdcardBack());
        driver.setIdcardFront(driverRegisterWarpper.getIdcardFront());
        driver.setDriverLicense(driverRegisterWarpper.getDriverLicense());
        if(ToolUtil.isNotEmpty(driverRegisterWarpper.getFirstCertificateTime())){
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            driver.setFirstCertificateTime(sdf.parse(driverRegisterWarpper.getFirstCertificateTime()));
        }
        //注册地
        String code = driverRegisterWarpper.getCode();
        BranchOffice branchOffice = branchOfficeService.selectOne(new EntityWrapper<BranchOffice>().eq("districtCode", code).eq("status", 1));
@@ -574,7 +601,8 @@
        DriverInfoWarpper driverInfo = new DriverInfoWarpper();
        BeanUtils.copyProperties(driver, driverInfo);
        driverInfo.setWithdrawBalance(driver.getBalance());
        driverInfo.setBalance(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission());
        driverInfo.setBalance(driver.getBalance() + driver.getBackgroundBalance());//司机充值+平台充值
        driverInfo.setCommission(driver.getCommission() + driver.getCouponBalance());//司机订单收入+司机佣金收入+司机优惠券收入+司机折扣收入
        YouTuiDriver youTuiDriver = youTuiDriverService.selectOne(new EntityWrapper<YouTuiDriver>().eq("driverId", uid)
                .eq("state", 2).last(" and failureTime > now() order by failureTime limit 0, 1"));
        if(null != youTuiDriver){
@@ -704,7 +732,7 @@
        paymentOrderGood.setGoodsName("充值");
        goodsDetail.add(paymentOrderGood);
        paymentOrder.setGoodsDetail(goodsDetail);
        paymentOrder.setFrontUrl("http://www.baidu.com");//前端回调地址
        paymentOrder.setFrontUrl(callbackPath + "/base/driver/balanceRechargeCallback");//前端回调地址
        paymentOrder.setNotifyUrl(callbackPath + "/base/driver/balanceRechargeCallback");
        paymentOrder.setParameter1(out_trade_no);
@@ -757,9 +785,9 @@
                                    accountChangeDetail.setType(1);
                                    accountChangeDetail.setCreateTime(new Date());
                                    accountChangeDetail.setExplain("账户充值");
                                    accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission());
                                    accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance());
                                    driver1.setBalance(driver1.getBalance() + rechargeRecord1.getAmount());
                                    accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission());
                                    accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance());
                                    DriverServiceImpl.this.updateById(driver1);
                                    accountChangeDetailService.saveData(accountChangeDetail);
@@ -830,9 +858,9 @@
        accountChangeDetail.setType(1);
        accountChangeDetail.setCreateTime(new Date());
        accountChangeDetail.setExplain("账户充值");
        accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission());
        accountChangeDetail.setOldData(driver1.getBalance() + driver1.getBackgroundBalance());
        driver1.setBalance(driver1.getBalance() + rechargeRecord1.getAmount());
        accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance() + driver1.getCouponBalance() + driver1.getCommission());
        accountChangeDetail.setNewData(driver1.getBalance() + driver1.getBackgroundBalance());
        this.updateById(driver1);
        accountChangeDetailService.saveData(accountChangeDetail);