| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api("不合格处理管理") |
| | |
| | | private static final String REQUESTID = "requestId"; |
| | | private static final String CHECKRESULT = "CHECKRESULT"; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "提交OA") |
| | | @PostMapping("/pushOA") |
| | | public Result pushOA(@RequestBody PushOADto pushOADto){ |
| | | return unqualifiedHandlerService.pushOA(pushOADto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询") |
| | | @GetMapping("/page") |
| | |
| | | return Result.success(unqualifiedHandlerService.pageList(page, unqualifiedHandlerDto)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "附件上传") |
| | | @PostMapping("/uploadFileByUnqualified") |
| | | public Result<?> uploadFileByUnqualified(Long handlerId, MultipartFile file) { |
| | | return Result.success(unqualifiedHandlerFileService.uploadFile(handlerId, file)); |
| | | } |
| | | |
| | | |
| | | @Anonymous |
| | | @ApiOperation(value = "不合格处理OA回调") |
| | |
| | | public String unqualifiedHandlerOACallback(String data){ |
| | | String msg = OAProcess.oaReturnMsg(0, "success"); |
| | | JSONObject json = JSONObject.parseObject(data); |
| | | System.out.println("========>" + json); |
| | | log.info("oa回调参数========>" + json); |
| | | try { |
| | | Long oaWorkId = json.getLong(REQUESTID); |
| | | String checkResult = json.getString(CHECKRESULT); |
| | |
| | | log.error("oa回调失败: " + e.getMessage()); |
| | | msg = OAProcess.oaReturnMsg(1, "oa回调失败: " + e.getMessage()); |
| | | } |
| | | System.out.println("oa回调返回结果========>" + msg); |
| | | log.info("oa回调返回结果========>" + msg); |
| | | return msg; |
| | | } |
| | | |
| | |
| | | unqualifiedHandlerFileService.downloadOAFile(handlerFileId,response); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "新增不合格处理") |
| | | @PostMapping("/addUnqualifiedHandler") |
| | | public Result addUnqualifiedHandler(@RequestBody UnqualifiedHandlerDto unqualifiedHandlerDto){ |
| | | return Result.success(unqualifiedHandlerService.addUnqualifiedHandler(unqualifiedHandlerDto)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "编辑不合格处理") |
| | | @PostMapping("/updateUnqualifiedHandler") |
| | | @ApiOperation(value = "编辑不合格处理并且推送OA") |
| | | @PostMapping("/reSubmitPushOa") |
| | | public Result updateUnqualifiedHandler(@RequestBody UnqualifiedHandlerDto unqualifiedHandlerDto){ |
| | | return Result.success(unqualifiedHandlerService.updateUnqualifiedHandler(unqualifiedHandlerDto)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查看oa流程") |
| | | @GetMapping("/getOaFlow") |
| | |
| | | return Result.success(unqualifiedHandlerService.getOaFlow(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "查看不合格处理界面") |
| | | @GetMapping("/getUnqualifiedHandler") |
| | | public Result getUnqualifiedHandler(Integer id){ |
| | | return Result.success(unqualifiedHandlerService.getUnqualifiedHandler(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除不合格处理") |
| | | @DeleteMapping("/deleteUnqualifiedHandler") |
| | | public Result deleteUnqualifiedHandler(Integer id) { |
| | | return Result.success(unqualifiedHandlerService.deleteUnqualifiedHandler(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "下载附件") |
| | | @GetMapping("/downFile") |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出不合格处理记录") |
| | | @GetMapping("/exportUnqualifiedHandler") |
| | | public void exportUnqualifiedHandler(UnqualifiedHandlerDto unqualifiedHandlerDto,HttpServletResponse response) { |
| | | unqualifiedHandlerService.exportUnqualifiedHandler(unqualifiedHandlerDto,response); |
| | | } |
| | | |
| | | |
| | | } |