Browse Source

审核通过或驳回时,添加审批意见

lizhenhao 2 years atrás
parent
commit
3c3721d749

+ 1 - 1
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/ReimbursementInfoService.java

@@ -740,7 +740,7 @@ public class ReimbursementInfoService {
                             upStatusParam.setType("4"); // 审核状态设置为审核驳回
                         }
                         this.updateStatusById(upStatusParam); // 修改数据的审核状态
-                        flowTaskService.auditByProcInsIdAndFlag(reim.getProcInsId(), flag, null); // 审核操作
+                        flowTaskService.auditByProcInsIdAndFlag(reim.getProcInsId(), flag, null, saveInfoDto.getComment()); // 审核操作
                         result.put("success", "false");
                         result.put("message", "操作成功");
                     }catch (Exception e) {

+ 2 - 0
jeeplus-module/jeeplus-test/src/main/java/com/jeeplus/test/reimbursement/reimbursementInfo/service/dto/SaveInfoDto.java

@@ -89,4 +89,6 @@ public class SaveInfoDto extends BaseEntity {
 
     private String flag; // yes通过  no驳回
 
+    private String comment; // 审核意见
+
 }

+ 4 - 3
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/controller/ccpm/ReimbursementController.java

@@ -33,11 +33,12 @@ public class ReimbursementController {
      * 报销审核
      * @param id
      * @param flag yes 审核通过 no 审核失败
+     * @param comment 审批意见
      * @return
      */
     @GetMapping("reimAudit")
-    public ResponseEntity reimAudit(String id, String flag) {
-        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, flag, "bmzr");
+    public ResponseEntity reimAudit(String id, String flag, String comment) {
+        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, flag, "bmzr", comment);
         return ResponseEntity.ok (resultMap);
     }
 
@@ -48,7 +49,7 @@ public class ReimbursementController {
      */
     @GetMapping("reimReapply")
     public ResponseEntity reimReapply(String id) {
-        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, "yes", "modifyApply");
+        Map<String, Object> resultMap = this.reimbursementService.reimAudit(id, "yes", "modifyApply", null);
         return ResponseEntity.ok (resultMap);
     }
 

+ 2 - 1
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementRequest.java

@@ -35,13 +35,14 @@ public class ReimbursementRequest {
      * @param flag
      * @return
      */
-    public Object saveAuditFunc(Map<String, Object> resp, String taskDefKey, String flag) {
+    public Object saveAuditFunc(Map<String, Object> resp, String taskDefKey, String flag, String comment) {
         String token = "";
         Map<String, Object> createBy = new HashMap<>();
         createBy.put("id", resp.get("handleId").toString());
         Map<String, Object> act = new HashMap<>();
         act.put("taskDefKey", taskDefKey);
         act.put("flag", flag);
+        act.put("comment", comment);
         resp.put("act", act);
         resp.put("createBy", createBy);
         Object res = restTemplateService.postCCPM("/a/workreimbursement/workReimbursement/saveAuditFunc", token, null, resp);

+ 2 - 2
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/centerservice/service/ccpm/reimbursement/ReimbursementService.java

@@ -55,11 +55,11 @@ public class ReimbursementService {
      * @param taskDefKey
      * @return
      */
-    public Map<String, Object> reimAudit(String id, String flag, String taskDefKey) {
+    public Map<String, Object> reimAudit(String id, String flag, String taskDefKey, String comment) {
         Map<String, Object> resultMap = new HashMap<>();
         Object response = reimbursementRequest.getById(id); // 报销详情
         Map<String, Object> resp = JSONObject.parseObject(JSON.toJSONString(response));
-        Object result = reimbursementRequest.saveAuditFunc(resp, taskDefKey, flag); // 审核通过、审核驳回
+        Object result = reimbursementRequest.saveAuditFunc(resp, taskDefKey, flag, comment); // 审核通过、审核驳回
         resultMap = JSONObject.parseObject(JSON.toJSONString(result));
         return resultMap;
 

+ 3 - 1
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/service/FlowTaskService.java

@@ -1015,8 +1015,9 @@ public class FlowTaskService {
      * @param procInsId
      * @param flag “yes”通过  “no”驳回
      * @param assignee 设置下一步处理人
+     * @param comm 审核意见
      */
-    public void auditByProcInsIdAndFlag(String procInsId,String flag,String assignee) throws Exception {
+    public void auditByProcInsIdAndFlag(String procInsId,String flag,String assignee,String comm) throws Exception {
         // 获取审核操作需要的参数
         List<Flow> flows = this.historicTaskList(procInsId);
         Flow flow = flows.get(flows.size() - 1);
@@ -1028,6 +1029,7 @@ public class FlowTaskService {
         saveParam.setProcDefId(histIns.getProcessDefinitionId());
         Map<String, Object> vars = Maps.newHashMap();
         TaskComment comment = new TaskComment();
+        comment.setMessage(comm);
         if ("yes".equals(flag)) {
             vars.put("agree", true); // 审核通过
             comment.setType(ActionType.AGREE.getType());