hanqingsong 3 mesi fa
parent
commit
ce8d12d2ed

+ 21 - 16
unis-plugin/unis-plugin-biz/src/main/java/com/unis/lawEnforcementSupervision/modular/lesJointInspectionTask/service/impl/LesJointInspectionTaskServiceImpl.java

@@ -179,23 +179,28 @@ public class LesJointInspectionTaskServiceImpl extends ServiceImpl<LesJointInspe
179 179
     private void audit(LesJointInspectionTask lesJointInspectionTask) {
180 180
         // 状态 0:保存状态;1:发布(申请中);2:审核通过;3:驳回
181 181
         Integer status = lesJointInspectionTask.getStatus();
182
-        if (1 == status) {
183
-            // 判断驳回在提交
184
-            QueryWrapper<AuditRequest> wrapper = new QueryWrapper<>();
185
-            wrapper.lambda().eq(AuditRequest::getRequestId, lesJointInspectionTask.getId());
186
-            AuditRequest request1 = auditRequestMapper.selectOne(wrapper);
187
-            if (ObjectUtils.isEmpty(request1)) {
188
-                // 添加审批(状态 0:待审核;1:已审核;2:驳回)
189
-                AuditRequest request = this.addAuditRequest(lesJointInspectionTask);
190
-                // 添加审批流程记录
191
-                this.addAuditRecord(lesJointInspectionTask, request.getId(), 0);
192
-            } else {
193
-                this.editAuditRequest(lesJointInspectionTask, 0);
182
+        // 直接提交
183
+        if (StringUtils.isEmpty(lesJointInspectionTask.getId()) && 1 == status) {
184
+            // 添加审批(状态 0:待审核;1:已审核;2:驳回)
185
+            AuditRequest request = this.addAuditRequest(lesJointInspectionTask);
186
+            // 添加审批流程记录
187
+            this.addAuditRecord(lesJointInspectionTask, request.getId(), 0);
188
+        } else {
189
+            if (1 == status) {
190
+                // 判断驳回在提交
191
+                if (StringUtils.isEmpty(lesJointInspectionTask.getId())) {
192
+                    // 添加审批(状态 0:待审核;1:已审核;2:驳回)
193
+                    AuditRequest request = this.addAuditRequest(lesJointInspectionTask);
194
+                    // 添加审批流程记录
195
+                    this.addAuditRecord(lesJointInspectionTask, request.getId(), 0);
196
+                } else {
197
+                    this.editAuditRequest(lesJointInspectionTask, 0);
198
+                }
199
+            } else if (2 == status) {
200
+                this.editAuditRequest(lesJointInspectionTask, 1);
201
+            } else if (3 == status) {
202
+                this.editAuditRequest(lesJointInspectionTask, 2);
194 203
             }
195
-        } else if (2 == status) {
196
-            this.editAuditRequest(lesJointInspectionTask, 1);
197
-        } else if (3 == status) {
198
-            this.editAuditRequest(lesJointInspectionTask, 2);
199 204
         }
200 205
     }
201 206