| | |
| | | package com.ruoyi.inspect.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.annotation.Anonymous; |
| | |
| | | |
| | | 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 = "查询不合格处理记录") |
| | | @GetMapping("/getList") |
| | | public Result getList(){ |
| | | return Result.success(unqualifiedHandlerService.getList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "附件上传") |
| | | @PostMapping("/uploadFileByUnqualified") |
| | |
| | | return Result.success(unqualifiedHandlerFileService.uploadFile(handlerId, file)); |
| | | } |
| | | |
| | | |
| | | @Anonymous |
| | | @ApiOperation(value = "不合格处理OA回调") |
| | | @RequestMapping(value = "/callback", produces = "text/plain") |
| | | public String unqualifiedHandlerOACallback(String data){ |
| | | String msg = OAProcess.oaReturnMsg(0, "success"); |
| | | JSONObject json = JSONObject.parseObject(data); |
| | | log.info("oa回调参数========>" + json); |
| | | JSONObject response = JSONObject.parseObject(data); |
| | | log.info("oa回调参数========>" + response); |
| | | try { |
| | | Long oaWorkId = json.getLong(REQUESTID); |
| | | String checkResult = json.getString(CHECKRESULT); |
| | | Object o = json.get("workflowRequestLogs"); |
| | | JSONArray objects = JSONArray.parseArray(JSONObject.toJSONString(o)); |
| | | unqualifiedHandlerService.unqualifiedHandlerOACallback(oaWorkId, checkResult,objects); |
| | | Long oaWorkId = response.getLong(REQUESTID); |
| | | String checkResult = response.getString(CHECKRESULT); |
| | | unqualifiedHandlerService.unqualifiedHandlerOACallback(oaWorkId, checkResult,response); |
| | | } catch (Exception e) { |
| | | log.error("oa回调失败: " + e.getMessage()); |
| | | msg = OAProcess.oaReturnMsg(1, "oa回调失败: " + e.getMessage()); |
| | |
| | | |
| | | @ApiOperation(value = "删除不合格处理") |
| | | @DeleteMapping("/deleteUnqualifiedHandler") |
| | | public Result deleteUnqualifiedHandler(Integer id) { |
| | | return Result.success(unqualifiedHandlerService.deleteUnqualifiedHandler(id)); |
| | | public Result deleteUnqualifiedHandler(String groupId) { |
| | | return Result.success(unqualifiedHandlerService.deleteUnqualifiedHandler(groupId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载附件") |