| | |
| | | import org.springblade.modules.directive.entity.DirectiveFile; |
| | | import org.springblade.modules.directive.service.DirectiveService; |
| | | import org.springblade.modules.directive.vo.DirectiveVo; |
| | | import org.springblade.modules.workreport.vo.WorkReportVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页--接收到的指令 |
| | | * @param query page,size |
| | | * @param directive 指令对象 |
| | | */ |
| | | @GetMapping("/pageReply") |
| | | public R<IPage<DirectiveVo>> pageReply(DirectiveVo directive, Query query) { |
| | | IPage<DirectiveVo> pages = directiveService.selectDirectiveReplyPage(Condition.getPage(query), directive); |
| | | // List<WorkReportVo> records = pages.getRecords(); |
| | | // for (WorkReportVo record : records) { |
| | | // record.setReplyRealName(getReplyRealName(record)); |
| | | // record.setReplyDeptName(getReplyDeptName(record)); |
| | | // } |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param directive 指令信息对象 |
| | | */ |
| | |
| | | @PostMapping("/saveDirectiveAndFile") |
| | | public R saveDirectiveAndFile(@RequestBody DirectiveVo directive) { |
| | | //新增指令信息 |
| | | boolean save = directiveService.save(directive); |
| | | boolean status = false; |
| | | if (save){ |
| | | status = directiveService.save(directive); |
| | | if (status){ |
| | | //新增图片 |
| | | if (null!=directive.getUrl() && directive.getUrl()!=""){ |
| | | String[] directiveUrl = directive.getUrl().split(","); |
| | |
| | | directiveFile.setUrl(url); |
| | | status = directiveService.saveDirectiveFile(directiveFile); |
| | | if (!status){ |
| | | R.status(false); |
| | | return R.status(false); |
| | | } |
| | | } |
| | | } |