| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springblade.modules.dispatcher.service.IDispatcherUnitService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | private final IDispatcherUnitService dispatcherUnitService; |
| | | |
| | | private final IUserService userService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | |
| | | /** |
| | | * 结束派遣 |
| | | * |
| | | * @param dispatcher |
| | | */ |
| | | @PostMapping("/over-dispatcher") |
| | |
| | | userService.updateById(user); |
| | | |
| | | |
| | | |
| | | //内网同步 |
| | | String s1 = |
| | | "update sys_dispatcher set status = " + "'" + dispatcher.getStatus() + "'" + |
| | |
| | | " " +"where id = " + "'" + dispatcher.getId() + "';"+ |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " +"where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | return R.status(status); |
| | | } |
| | | |
| | |
| | | |
| | | //新增派遣记录 |
| | | status = dispatcherService.save(dispatcher); |
| | | |
| | | if (status) { |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_dispatcher(id,dispatcherTime,dispatcherAddress,dispatcher_unit_id,user_ids,end_time,dept_id,jurisdiction,create_time,status) " + |
| | |
| | | "'" + dispatcher.getStatus() + "'" + ");" + |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | } else { |
| | | dispatcher.setUpdateTime(new Date()); |
| | | //查询当前派遣记录 |
| | |
| | | |
| | | //修改 |
| | | status = dispatcherService.updateById(dispatcher); |
| | | |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | |
| | | " " + "where id = " + "'" + dispatcher.getId() + "';" + |
| | | "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //没有修改保安员,只修改了派遣时间等信息 |
| | | //修改 |
| | | status = dispatcherService.updateById(dispatcher); |
| | | |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update sys_dispatcher set dispatcherTime = " + "'" + new SimpleDateFormat("yyyy-MM-dd").format(dispatcher.getDispatchertime()) + "'" + |
| | |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | } |
| | | return R.status(status); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | "'" + dispatcher.getStatus() + "'" + ");" + |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | User user = new User(); |
| | |
| | | "'" + dispatcher.getStatus() + "'" + ");" + |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | User user = new User(); |
| | |
| | | "'" + dispatcher.getStatus() + "'" + ");" + |
| | | "update blade_user set dispatch = " + "'" + user.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | |
| | | }); |
| | |
| | | " " + "where id = " + "'" + dispatcher.getId() + "';" + |
| | | "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //修改原保安人员的派遣状态 |
| | |
| | | " " + "where id = " + "'" + dispatcher.getId() + "';" + |
| | | "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //修改原保安人员的派遣状态 |
| | |
| | | " " + "where id = " + "'" + dispatcher.getId() + "';" + |
| | | "update blade_user set dispatch = " + "'" + user1.getDispatch() + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | if (null!=dispatcherUnit.getDistrict() && !dispatcherUnit.getDistrict().equals("") && !dispatcherUnit.getDistrict().equals(-1)) { |
| | |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //没有修改保安员,只修改了派遣时间等信息 |
| | |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | //没有修改保安员,只修改了派遣时间等信息 |
| | |
| | | ",dept_id = " + "'" + dispatcher.getDeptId() + "'" + |
| | | ",jurisdiction = " + "'" + dispatcher.getJurisdiction() + "'" + |
| | | " " + "where id = " + "'" + dispatcher.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | return R.status(status); |
| | |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from sys_dispatcher where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | return R.status(dispatcherService.removeByIds(Func.toLongList(ids))); |
| | | } |