| | |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springblade.modules.workreport.entity.WorkReport; |
| | | import org.springblade.modules.workreport.service.WorkReportService; |
| | | import org.springblade.modules.workreport.vo.WorkReportVo; |
| | |
| | | private final IUserService userService; |
| | | |
| | | private final IDeptService deptService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param query page,size |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 自定义分页--接收到的汇报信息page |
| | | * |
| | | * @param query page,size |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | | @PostMapping("/save") |
| | |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | | @PostMapping("/update") |
| | |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | | @PostMapping("/submit") |
| | |
| | | workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds())); |
| | | //新增 |
| | | status = workReportService.save(workReport); |
| | | |
| | | if (status) { |
| | | //数据同步 |
| | | String s1 = |
| | | "insert into sys_work_report(id,type,content,work_desc,report_time,received_ids,dept_id,reply_dept_ids,category,user_id) " + |
| | |
| | | "'" + workReport.getReplyDeptIds() + "'" + "," + |
| | | "'" + workReport.getCategory() + "'" + "," + |
| | | "'" +workReport.getUserId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }else { |
| | | workReport.setReplyDeptIds(getReplyDeptIds(workReport.getReceivedIds())); |
| | | if (null==workReport.getReplyTime()){ |
| | |
| | | |
| | | //修改 |
| | | status = workReportService.updateById(workReport); |
| | | |
| | | if (status) { |
| | | //内网同步 |
| | | String s1 = |
| | | "update sys_work_report set type = " + "'" + workReport.getType() + "'" + |
| | |
| | | ",category = " + "'" + workReport.getCategory() + "'" + |
| | | ",user_id = " + "'" + workReport.getUserId() + "'" + |
| | | " " +"where id = " + "'" + workReport.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | return R.status(status); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids 工作汇报信息ids 数组 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from sys_work_report where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | return R.status(workReportService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param workReport 工作汇报信息对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | |
| | | |
| | | /** |
| | | * 获取接收人的单位信息 |
| | | * |
| | | * @param detail 汇报详情 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取接收人的单位id(dept)信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |