Ver Fonte

解决试验委托单重签pdf时没有区分监理也业主的问题

lvy há 1 dia atrás
pai
commit
1a5977803b

+ 8 - 4
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1829,16 +1829,20 @@ public R<Object> batchTask(@RequestBody StartTaskVO startTaskVO) {
             Map<String, InformationQuery> queryTempMap = new HashMap<>();
             queryList.forEach(query -> {
                 if (query.getStatus() != 0) {
-                    long count = this.informationQueryService.count(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, query.getWbsId()).eq(InformationQuery::getClassify, query.getClassify())
-                            .eq(InformationQuery::getContractId, query.getContractId()).in(InformationQuery::getStatus, 0,1, 2));
-                    if (count == 0) {
+                    List<InformationQuery> queries = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, query.getWbsId()).eq(InformationQuery::getClassify, query.getClassify())
+                            .eq(InformationQuery::getContractId, query.getContractId()).in(InformationQuery::getStatus, 0, 1, 2));
+                    if (queries == null || queries.isEmpty()) {
                         if (query.getStatus() != null && query.getStatus() == 3) {
                             query.setId(SnowFlakeUtil.getId());
                             query.setStatus(0);
                             this.informationQueryService.save(query);
                         }
                     } else {
-                        return;
+                        if (queries.stream().allMatch(item -> item.getStatus() == 0)) {
+                            query = queries.get(0);
+                        } else {
+                            return;
+                        }
                     }
                 }
                 if (query.getType() == 3) {

+ 15 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -20,6 +20,7 @@ import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.EntrustInfoServiceClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.common.utils.CommonUtil;
+import org.springblade.core.log.exception.ServiceException;
 import org.springblade.manager.util.DataStructureFormatUtils;
 import org.springblade.common.utils.SnowFlakeUtil;
 import org.springblade.core.oss.model.BladeFile;
@@ -476,8 +477,21 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         if(!map.containsKey("contractId")){
             map.put("contractId",dto.getContractId());
         }
+        // 合同段信息
+        ContractInfo contractInfo = contractInfoService.getById(dto.getContractId());
+        if (contractInfo == null) {
+            throw new ServiceException("合同段信息为null");
+        }
+        String pkeyId = "";
+        if (contractInfo.getContractType() == 2) { //3 监理
+            pkeyId = wbsTreePrivate.getJlerTreeId() + "";
+        } else if (contractInfo.getContractType() == 3 || contractInfo.getContractType() == 8) { //业主
+            pkeyId = wbsTreePrivate.getYzerTreeId() + "";
+        } else {
+            return R.fail("该合同段没有委托单权限业务");
+        }
         if(!map.containsKey("nodeErTreeId")){
-            map.put("nodeErTreeId",wbsTreePrivate.getJlerTreeId());
+            map.put("nodeErTreeId",pkeyId);
         }
         if(!map.containsKey("nodeId")){
             map.put("nodeId",dto.getNodeId());