Sfoglia il codice sorgente

委托单废除后无法上报

lvy 3 mesi fa
parent
commit
1391a5bd59

+ 9 - 8
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -276,7 +276,8 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
             if(formDataIds.size()>0){
                 for (String formDataId : formDataIds) {
                     String sql="Select * from u_task where form_data_id="+formDataId +" and status!=3 and is_deleted=0";
-                    Task task = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Task.class));
+					List<Task> tasks = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(Task.class));
+					Task task = tasks.isEmpty() ? null : tasks.get(0);
                     if(task!=null){
                         String updateTaskParallel="update u_task_parallel set status=3 , e_visa_content = '撤回成功' where process_instance_id='" + task.getProcessInstanceId() + "'";
                         String updateTask="update u_task set status=3 where id="+task.getId()+" and status!=3 and is_deleted=0";
@@ -284,16 +285,16 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
                         jdbcTemplate.update(updateTaskParallel);
                         jdbcTemplate.update(updateTask);
                         jdbcTemplate.execute(deleted);
+						JSONObject json = new JSONObject();
+						json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
+						json.put("operationObjName", "批量废除");
+						json.put("projectId", task.getProjectId());
+						json.put("contractId", task.getContractId());
+						//保存操作记录
+						this.operationLogClient.saveUserOperationLog(62, "资料撤回废除", "委托单", json);
                     }
                     String updateinformationQuery="update u_information_query set status=3,e_visa_pdf_url= null where id="+formDataId;
                     jdbcTemplate.update(updateinformationQuery);
-					JSONObject json = new JSONObject();
-					json.put("operationObjIds", Func.toStrList(task.getFormDataId()));
-					json.put("operationObjName", "批量废除");
-					json.put("projectId", task.getProjectId());
-					json.put("contractId", task.getContractId());
-					//保存操作记录
-					this.operationLogClient.saveUserOperationLog(62, "资料撤回废除", "委托单", json);
 				}
 			}