| | |
| | | Dispatcher dispatcher1 = dispatcherService.getById(dispatcher.getId()); |
| | | if (!dispatcher1.getUserIds().equals(dispatcher.getUserIds())){ |
| | | //修改原保安人员的派遣状态 |
| | | //查询原保安人员的派遣记录,是否存在多条未结束派遣的 |
| | | Dispatcher dispatcher2 = new Dispatcher(); |
| | | dispatcher2.setUserIds(dispatcher1.getUserIds()); |
| | | dispatcher2.setStatus(0); |
| | | List<Dispatcher> dispatcherList = dispatcherService.list(Condition.getQueryWrapper(dispatcher2)); |
| | | User user = new User(); |
| | | user.setId(Long.parseLong(dispatcher1.getUserIds())); |
| | | user.setDispatch("1"); |
| | | if (dispatcherList.size()<1){ |
| | | //用户状态改变 |
| | | user.setDispatch("1"); |
| | | }else { |
| | | user.setDispatch("0"); |
| | | } |
| | | //修改原保安人员用户信息 |
| | | userService.updateById(user); |
| | | |
| | | //修改当前保安人员的派遣状态 |
| | |
| | | //内网同步 |
| | | String s1 = |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " +"where id = " + "'" + user.getId() + "';"+ |
| | | " " +"where id = " + "'" + user.getId() + "';" + |
| | | "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + |
| | | ",dispatcher_unit_id = " + "'" + dispatcher.getDispatcherUnitId() + "'" + |
| | | ",user_ids = " + "'" + dispatcher.getUserIds() + "'" + |