Эх сурвалжийг харах

Merge branch 'test-merge' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

lvy 1 долоо хоног өмнө
parent
commit
a5ecf5d26e

+ 12 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/SaveBatchWbsTreeDTO.java

@@ -0,0 +1,12 @@
+package org.springblade.manager.dto;
+
+import lombok.Data;
+import org.springblade.manager.vo.ExcelTabVO2;
+
+import java.util.List;
+@Data
+public class SaveBatchWbsTreeDTO {
+    private List<ExcelTabVO2> list;
+    private Long nodeId;
+    private Long wbsId;
+}

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreeController.java

@@ -23,6 +23,7 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.dto.FormElementDTO;
+import org.springblade.manager.dto.SaveBatchWbsTreeDTO;
 import org.springblade.manager.dto.WbsTreeDTO;
 import org.springblade.manager.dto.WbsTreeDTO2;
 import org.springblade.manager.entity.*;
@@ -590,8 +591,8 @@ public class WbsTreeController extends BladeController {
 
     @PostMapping("/saveBatchWbsTree")
     @ApiOperation("批量保存系统wbs表单")
-    public R saveBatchWbsTree(@RequestBody List<ExcelTabVO2> list,Long nodeId,Long wbsId){
-        return wbsTreeService.saveBatchWbsTree(list,nodeId,wbsId);
+    public R saveBatchWbsTree(@RequestBody SaveBatchWbsTreeDTO dto){
+        return wbsTreeService.saveBatchWbsTree(dto);
     }
 
 }

+ 0 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -214,7 +214,6 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
      */
     List<Map<String, Object>> getBussDataInfoTrialentrust(Long id, Long pkeyId, Long contractId, Long sampleId, JSONObject jsonObject,Boolean isremove);
 
-    void synchronizedPdf(List<TableInfo> tableInfoList, String nodeId, String classify, String contractId, String projectId) throws Exception;
 
     void cancelSample(Long groupId, Long pkeyId, Long contractId, Long sampleId1) throws Exception;
 
@@ -224,8 +223,6 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
 
     ExcelTabVO templateDetail(Long id);
 
-    R getExcelUrl(ExcelEditCallback callback);
-
     Boolean saveExcel(ExcelEditCallback callback);
 
     R getExcelPdf(ExcelEditCallback callback) throws Exception;

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreeService.java

@@ -4,6 +4,7 @@ import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.dto.FormElementDTO;
+import org.springblade.manager.dto.SaveBatchWbsTreeDTO;
 import org.springblade.manager.dto.WbsTreeContractDTO;
 import org.springblade.manager.dto.WbsTreeDTO2;
 import org.springblade.manager.entity.WbsTree;
@@ -84,5 +85,5 @@ public interface IWbsTreeService extends BaseService<WbsTree> {
 
     boolean copyNode(List<Long> leftIds, List<Long> rightIds);
 
-    R saveBatchWbsTree(List<ExcelTabVO2> list,Long nodeId,Long wbsId);
+    R saveBatchWbsTree(SaveBatchWbsTreeDTO dto);
 }

+ 2 - 88
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -108,7 +108,6 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
-import java.util.function.Predicate;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
@@ -258,7 +257,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
         return excelTabVOs;
     }
-
     @Override
     public List<ExceTabTreVO> tabLazyTree(String tenantId, Long modeId, Long parentId) {
         if (AuthUtil.isAdministrator()) {
@@ -2250,9 +2248,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 vo2.setInitTableName(tableInfo.getTabEnName());
                 vo2.setInitTabId(tableInfo.getId());
                 //判断同级其他节点 是否存在相同元素表
-                List<WbsNodeTableVO> wbsNodeTableVOS = wbsTreeService.selectByNodeTable(id+"");
+                List<WbsNodeTableVO> wbsNodeTableVOS = wbsTreeService.selectByNodeTable(nodeId+"");
                 if(!wbsNodeTableVOS.isEmpty()){
-                    Set<String> initTabIds = wbsNodeTableVOS.stream().filter(w -> StringUtils.isNotEmpty(w.getInitTableId())).map(w -> w.getInitTableId()).collect(Collectors.toSet());
+                    Set<String> initTabIds = wbsNodeTableVOS.stream().map(WbsNodeTableVO::getInitTableId).filter(StringUtils::isNotEmpty).collect(Collectors.toSet());
                     if(!initTabIds.isEmpty()){
                         if(initTabIds.contains(tableInfo.getId()+"")){
                             vo2.setIsCreate(1);
@@ -6405,7 +6403,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         list.add(reData);
         return list;
     }
-
     private static List<String> setBasicFormData(Document doc, Map<String, Object> reData, TrialSampleInfo sampleInfo ,TrialMaterialMobilization trialMaterialMobilization, EntrustInfo entrustInfo) {
         List<String> isCancelList=new ArrayList<>();
         if(sampleInfo==null){
@@ -6590,48 +6587,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
     }
 
-    @Override
-    @Async("taskExecutor1")
-    public void synchronizedPdf(List<TableInfo> tableInfoList, String nodeId, String classify, String contractId, String projectId) {
-        try {
-            List<String> errorPKeyIds = new ArrayList<>();
-            //单个pdf加载
-            if (tableInfoList != null) {
-                tableInfoList.parallelStream().forEach(tableInfo -> {
-                    R bussPdfInfo = null;
-                    try {
-                        bussPdfInfo = this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
-                        //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
-                        errorPKeyIds.add(tableInfo.getPkeyId());
-                    }
-                });
-            }
-
-            //发生异常后直接返回,不进行合并
-//        if (errorPKeyIds.size() > 0) {
-//            List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
-//            for (AppWbsTreeContractVO appWbsTreeContractVO : tableAll) {
-//                if (errorPKeyIds.contains(appWbsTreeContractVO.getPKeyId().toString())) {
-//                    errorTabs.add(appWbsTreeContractVO);
-//                }
-//            }
-//            if (errorTabs.size() > 0) {
-//                List<String> names = errorTabs.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
-//                return R.fail("以下的表在生成pdf文件时发生了异常【" + StringUtils.join(names, "、") + "】");
-//            }
-//        }
 
-            //合并pdf加载
-            this.getBussPdfs(nodeId, classify, contractId, projectId);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new ServiceException("问题");
-        }
-    }
 
     @Override
     public void cancelSample(Long groupId, Long pkeyId, Long contractId, Long sampleId1) throws Exception {
@@ -6824,48 +6780,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         jdbcTemplate.update(sql);
     }
 
-    @Override
-    @Async("taskExecutor1")
-    public void synchronizedPdf(List<TableInfo> tableInfoList, String nodeId, String classify, String contractId, String projectId) {
-        try {
-            List<String> errorPKeyIds = new ArrayList<>();
-            //单个pdf加载
-            if (tableInfoList != null) {
-                tableInfoList.parallelStream().forEach(tableInfo -> {
-                    R bussPdfInfo = null;
-                    try {
-                        bussPdfInfo = this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
-                        //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
-                        errorPKeyIds.add(tableInfo.getPkeyId());
-                    }
-                });
-            }
-
-            //发生异常后直接返回,不进行合并
-//        if (errorPKeyIds.size() > 0) {
-//            List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
-//            for (AppWbsTreeContractVO appWbsTreeContractVO : tableAll) {
-//                if (errorPKeyIds.contains(appWbsTreeContractVO.getPKeyId().toString())) {
-//                    errorTabs.add(appWbsTreeContractVO);
-//                }
-//            }
-//            if (errorTabs.size() > 0) {
-//                List<String> names = errorTabs.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
-//                return R.fail("以下的表在生成pdf文件时发生了异常【" + StringUtils.join(names, "、") + "】");
-//            }
-//        }
-
-            //合并pdf加载
-            this.getBussPdfs(nodeId, classify, contractId, projectId);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new ServiceException("问题");
-        }
-    }
     @Override
     public void synPdfKeyInfo(String nodeId, String classify, String contractId, String projectId) throws Exception {
         // 获取有权限的节点信息

+ 10 - 6
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeServiceImpl.java

@@ -657,20 +657,20 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
     }
 
     @Override
-    public R saveBatchWbsTree(List<ExcelTabVO2> list,Long nodeId,Long wbsId) {
+    public R saveBatchWbsTree(SaveBatchWbsTreeDTO dto) {
         List<WbsTree>insertList=new ArrayList<>();
-        WbsTree parentNode = this.getById(nodeId);
+        WbsTree parentNode = this.getById(dto.getNodeId());
         String tenantId = AuthUtil.getTenantId();
         if(parentNode==null){
             return R.fail(201, "父节点不存在");
         }
-        Integer maxSort=this.baseMapper.getMaxSort(nodeId);
-        for (ExcelTabVO2 vo2 : list) {
+        Integer maxSort=this.baseMapper.getMaxSort(dto.getNodeId());
+        for (ExcelTabVO2 vo2 : dto.getList()) {
             WbsTree wbsTree = new WbsTree();
             wbsTree.setId(SnowFlakeUtil.getId());
-            wbsTree.setWbsId(wbsId+"");
+            wbsTree.setWbsId(dto.getWbsId()+"");
             wbsTree.setTenantId(tenantId);
-            wbsTree.setParentId(nodeId);
+            wbsTree.setParentId(dto.getNodeId());
             wbsTree.setAncestors(parentNode.getAncestors()+","+parentNode.getId());
             wbsTree.setNodeType(1);
             wbsTree.setNodeName(vo2.getElementTableName());
@@ -688,6 +688,10 @@ public class WbsTreeServiceImpl extends BaseServiceImpl<WbsTreeMapper, WbsTree>
         if(!insertList.isEmpty()){
             this.saveBatch(insertList);
         }
+        if(parentNode.getIsExistForm()==null||parentNode.getIsExistForm()==0){
+            parentNode.setIsExistForm(1);
+            this.updateById(parentNode);
+        }
         return R.success("保存成功");
     }
 

+ 13 - 13
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -3716,7 +3716,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getContractDept())) {
                 if(xcount<=1){ //合同部意见
-                    opinion.setContractDept("同意");
+                    opinion.setContractDept("同意");
                 }else{
                     opinion.setContractDept(null);
                 }
@@ -3736,7 +3736,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getProjectBuild())) {
                 if(xcount<=1){ //工程建设意见
-                    opinion.setProjectBuild("同意");
+                    opinion.setProjectBuild("同意");
                 }else{
                     opinion.setProjectBuild(null);
                 }
@@ -3756,7 +3756,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getGeneralManager())) {
                 if(xcount<=1){ //总经理意见
-                    opinion.setGeneralManager("同意");
+                    opinion.setGeneralManager("同意");
                 }else{
                     opinion.setGeneralManager(null);
                 }
@@ -3776,7 +3776,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getChiefSupervisor())) {
                 if(xcount<=1){//总监理工程师意见
-                    opinion.setChiefSupervisor("同意");
+                    opinion.setChiefSupervisor("同意");
                 }else{
                     opinion.setChiefSupervisor(null);
                 }
@@ -3796,7 +3796,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getSafetyManager())) {
                 if(xcount<=1){//安全管理部意见
-                    opinion.setSafetyManager("同意");
+                    opinion.setSafetyManager("同意");
                 }else{
                     opinion.setSafetyManager(null);
                 }
@@ -3816,7 +3816,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getContractDeptLeader())) {
                 if(xcount<=1){ //合同部主管意见
-                    opinion.setContractDeptLeader("同意");
+                    opinion.setContractDeptLeader("同意");
                 }else{
                     opinion.setContractDeptLeader(null);
                 }
@@ -3836,7 +3836,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getProjectBuildLeader())) {
                 if(xcount<=1){//项目施工部主管意见
-                    opinion.setProjectBuildLeader("同意");
+                    opinion.setProjectBuildLeader("同意");
                 }else{
                     opinion.setProjectBuildLeader(null);
                 }
@@ -3856,7 +3856,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getSafetyManagerLeader())) {
                 if(xcount<=1){ //安全管理部主管意见
-                    opinion.setSafetyManagerLeader("同意");
+                    opinion.setSafetyManagerLeader("同意");
                 }else{
                     opinion.setSafetyManagerLeader(null);
                 }
@@ -3876,7 +3876,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getSupervisorAudit())) {
                 if(xcount<=1){ //监理工程师意见
-                    opinion.setSupervisorAudit("同意");
+                    opinion.setSupervisorAudit("同意");
                 }else{
                     opinion.setSupervisorAudit(null);
                 }
@@ -3896,7 +3896,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getMeterEngineer())) {
                 if(xcount<=1){//计量工程师意见
-                    opinion.setMeterEngineer("同意");
+                    opinion.setMeterEngineer("同意");
                 }else{
                     opinion.setMeterEngineer(null);
                 }
@@ -3916,7 +3916,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getProjectManager())) {
                 if(xcount<=1){ //项目经理意见
-                    opinion.setProjectManager("同意");
+                    opinion.setProjectManager("同意");
                 }else{
                     opinion.setProjectManager(null);
                 }
@@ -3936,7 +3936,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getContractSupervisorEngineer())) {
                 if(xcount<=1){//合同监理工程师意见
-                    opinion.setContractSupervisorEngineer("同意");
+                    opinion.setContractSupervisorEngineer("同意");
                 }else{
                     opinion.setContractSupervisorEngineer(null);
                 }
@@ -3956,7 +3956,7 @@ public class TaskController extends BladeController {
 
             if (StringUtils.isBlank(opinion.getOwnerDelegate())) {
                 if(xcount<=1){ //业主代表意见
-                    opinion.setOwnerDelegate("同意");
+                    opinion.setOwnerDelegate("同意");
                 }else{
                     opinion.setOwnerDelegate(null);
                 }

+ 19 - 6
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/InterimPayCertificateItemServiceImpl.java

@@ -18,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
+import java.util.stream.Collectors;
 
 /**
  * @author yangyj
@@ -127,13 +129,24 @@ public class InterimPayCertificateItemServiceImpl extends BaseServiceImpl<Interi
 
     @Override
     public void saveOrUpdateBatchList(List<InterimPayCertificateItem> items,Long reportId) {
-        List<InterimPayCertificateItem> list = baseMapper.selectList(new QueryWrapper<InterimPayCertificateItem>().eq("certificate_id", reportId).ne("chapter_seq","施工单位送审金额"));
-        if(list.size()>0){
-            for (InterimPayCertificateItem item : items) {
-                baseMapper.updateById(item);
+        if(!items.isEmpty()){
+            items = items.stream()
+                    .collect(Collectors.toMap(
+                            item -> item.getChapterSeq() == null ? UUID.randomUUID().toString() : item.getChapterSeq(),
+                            item -> item,
+                            (existing, replacement) -> existing
+                    ))
+                    .values()
+                    .stream()
+                    .collect(Collectors.toList());
+            List<InterimPayCertificateItem> list = baseMapper.selectList(new QueryWrapper<InterimPayCertificateItem>().eq("certificate_id", reportId).ne("chapter_seq","施工单位送审金额"));
+            if(list.size()>0){
+                for (InterimPayCertificateItem item : items) {
+                    baseMapper.updateById(item);
+                }
+            }else {
+                saveBatch(items);
             }
-        }else {
-            saveBatch(items);
         }
     }