| | |
| | | Driver driver = this.selectById(uid); |
| | | DriverInfoWarpper driverInfo = new DriverInfoWarpper(); |
| | | BeanUtils.copyProperties(driver, driverInfo); |
| | | driverInfo.setBalance(driver.getBalance() + driver.getBackgroundBalance() + driver.getCouponBalance() + driver.getCommission()); |
| | | |
| | | YouTuiDriver youTuiDriver = youTuiDriverService.selectOne(new EntityWrapper<YouTuiDriver>().eq("driverId", uid).last(" and failureTime > now() order by failureTime limit 0, 1")); |
| | | if(null != youTuiDriver){ |
| | | driverInfo.setYouTuiStart(youTuiDriver.getCreateTime().getTime()); |
| | |
| | | if(ToolUtil.isNotEmpty(driverInfo.getEmergencyPhone())){ |
| | | driver.setEmergencyPhone(driverInfo.getEmergencyPhone()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(driverInfo.getWxCollectionCode())){ |
| | | driver.setWxCollectionCode(driverInfo.getWxCollectionCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(driverInfo.getZfbCollectionCode())){ |
| | | driver.setZfbCollectionCode(driverInfo.getZfbCollectionCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(driverInfo.getPhone()) && ToolUtil.isNotEmpty(driverInfo.getCode())){ |
| | | String value = redisUtil.getValue(driverInfo.getPhone()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public void emptyIntegral() { |
| | | List<Driver> drivers = this.selectList(new EntityWrapper<Driver>().eq("approvalStatus", 2).eq("status", 1)); |
| | | List<AccountChangeDetail> list = new ArrayList<>(); |
| | | for (Driver driver : drivers) { |
| | | AccountChangeDetail accountChangeDetail = new AccountChangeDetail(); |
| | | accountChangeDetail.setUserType(2); |
| | | accountChangeDetail.setUserId(driver.getId()); |
| | | accountChangeDetail.setCreateTime(new Date()); |
| | | accountChangeDetail.setOldData(driver.getIntegral().doubleValue()); |
| | | accountChangeDetail.setType(2); |
| | | accountChangeDetail.setExplain("定时清空积分"); |
| | | driver.setIntegral(0); |
| | | accountChangeDetail.setNewData(driver.getIntegral().doubleValue()); |
| | | list.add(accountChangeDetail); |
| | | } |
| | | if(drivers.size() > 0){ |
| | | this.updateBatchById(drivers); |
| | | accountChangeDetailService.insertBatch(list); |
| | | } |
| | | |
| | | } |
| | | } |