| | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | int count = tAgentService.selectCount(new EntityWrapper<TAgent>().eq("provinceName", split1[0]).eq("cityName",split1[1])); |
| | | if(count>0){ |
| | | return new SuccessTip(500,"该代理商已存在!"); |
| | | |
| | | } |
| | | |
| | | tAgent.setPrincipal(tAgent.getPrincipal().replace(" ","")); |
| | | |
| | | |
| | | String[] split = tAgent.getAreaId().split("/"); |
| | | // 查询省市 |
| | |
| | | tAgent.setStatus(1); |
| | | } |
| | | tAgentService.updateById(tAgent); |
| | | // 冻结下面所有的司机 |
| | | List<TDriver> list = tDriverService.selectList(new EntityWrapper<TDriver>() |
| | | .eq("agentId", id)); |
| | | for (TDriver tDriver : list) { |
| | | if(1 == status){ |
| | | tDriver.setStatus(2); |
| | | } |
| | | if(2 == status){ |
| | | tDriver.setStatus(1); |
| | | } |
| | | } |
| | | tDriverService.updateBatchById(list); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TAgent tAgent) { |
| | | tAgent.setPrincipal(tAgent.getPrincipal().replace(" ","")); |
| | | tAgentService.updateById(tAgent); |
| | | return SUCCESS_TIP; |
| | | } |