Prechádzať zdrojové kódy

修改bug:资料填报无法预览资料和已审批完毕的资料在wbs树上显示未上报

lvy 3 mesiacov pred
rodič
commit
ff76fcb02c

+ 34 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -677,6 +677,13 @@ public class InformationWriteQueryController extends BladeController {
             return R.data(status);
         }
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
+        if (businessData != null && businessData.getStatus() == 3) {
+            this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
+            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by id desc limit 1"));
+            if (businessData1 != null) {
+                businessData = businessData1;
+            }
+        }
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -743,6 +750,13 @@ public class InformationWriteQueryController extends BladeController {
             return R.data(status);
         }
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).last("order by id desc limit 1"));
+        if (businessData != null && businessData.getStatus() == 3) {
+            this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
+            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getContractId, obj.getContractId()).eq(InformationQuery::getType, 1).in(InformationQuery::getStatus, 0,1,2).last("order by id desc limit 1"));
+            if (businessData1 != null) {
+                businessData = businessData1;
+            }
+        }
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -814,6 +828,17 @@ public class InformationWriteQueryController extends BladeController {
                 .eq(InformationQuery::getContractId, obj.getContractId())
                 .eq(InformationQuery::getType, 3).last("order by id desc limit 1")
         );
+        if (businessData != null && businessData.getStatus() == 3) {
+            this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
+            InformationQuery businessData1 = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery()
+                    .eq(InformationQuery::getId, id)
+                    .eq(InformationQuery::getContractId, obj.getContractId()).in(InformationQuery::getStatus, 0,1,2)
+                    .eq(InformationQuery::getType, 3).last("order by id desc limit 1")
+            );
+            if (businessData1 != null) {
+                businessData = businessData1;
+            }
+        }
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -878,6 +903,14 @@ public class InformationWriteQueryController extends BladeController {
         //查询填报状态,type=2试验
         InformationQuery businessData = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery()
                 .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by id desc limit 1")).stream().findAny().orElse(null);
+        if (businessData != null && businessData.getStatus() == 3) {
+            this.informationQueryService.createNewInformationQueriesByStatusForLock(Collections.singletonList(businessData.getId() + ""));
+            InformationQuery businessData1 = this.informationQueryService.getBaseMapper().selectList(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getStatus, 0, 1, 2)
+                    .eq(InformationQuery::getWbsId, id).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 2).last("order by id desc limit 1")).stream().findAny().orElse(null);
+            if (businessData1 != null) {
+                businessData = businessData1;
+            }
+        }
         if (businessData != null) {
             switch (businessData.getStatus()) {
                 case 0:
@@ -1238,6 +1271,7 @@ public R<String> batchDownloadFileToZip(String ids, HttpServletResponse response
                         if (collect.size() > 0) {
                             context = "撤回成功".equals(context) ? context : "废除成功";
                             jdbcTemplate.execute("UPDATE u_task_parallel SET status = 3,e_visa_content = '" + context + "' WHERE id in(" + StringUtils.join(collect, ",") + ")");
+                            this.jdbcTemplate.execute("delete from u_task_batch where JSON_UNQUOTE(JSON_EXTRACT(json_data, '$.taskId'))="+task.getId());
                         }
 
                         for (InformationQuery query : queries) {