| | |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TDriverWork; |
| | | import com.stylefeng.guns.modular.system.model.TRechargeRecord; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private HttpUtils httpUtils; |
| | | @Autowired |
| | | private TokenUtils tokenUtils; |
| | | @Autowired |
| | | private ITDriverWorkService tDriverWorkService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private ITRechargeRecordService tRechargeRecordService; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @RequestMapping("/auditPage") |
| | | public String auditPage( Integer id, |
| | | Model model) { |
| | | public String auditPage( Integer id,Model model) { |
| | | tDriverService.auditPage(id,model); |
| | | return PREFIX + "tDriverAudit.html"; |
| | | } |
| | |
| | | return o; |
| | | } |
| | | // 默认值板块 |
| | | tDriver.setName(tDriver.getName().replace(" ","")); |
| | | tDriver.setEmergencyContact(tDriver.getEmergencyContact().replace(" ","")); |
| | | tDriver.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tDriver.setBalance(BigDecimal.ZERO); |
| | | tDriver.setBackgroundBalance(BigDecimal.ZERO); |
| | |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | if(1 == status){ |
| | | tDriver.setStatus(2); |
| | | String value = redisUtil.getValue("DRIVER_" + tDriver.getPhone()); |
| | | redisUtil.remove(value); |
| | | redisUtil.remove("DRIVER_" + tDriver.getPhone()); |
| | | TDriverWork tDriverWork = tDriverWorkService.selectOne(new EntityWrapper<TDriverWork>() |
| | | .eq("driverId", tDriver.getId()) |
| | | .eq("status", 1) |
| | | .orderBy("workTime", false) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(tDriverWork)){ |
| | | tDriverWork.setStatus(2); |
| | | tDriverWork.setOffWorkTime(new Date()); |
| | | tDriverWorkService.updateById(tDriverWork); |
| | | } |
| | | } |
| | | if(2 == status){ |
| | | tDriver.setStatus(1); |
| | |
| | | if(Objects.nonNull(o)){ |
| | | return o; |
| | | } |
| | | tDriver.setName(tDriver.getName().replace(" ","")); |
| | | tDriver.setEmergencyContact(tDriver.getEmergencyContact().replace(" ","")); |
| | | tDriverService.updateById(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |