瀏覽代碼

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

# Conflicts:
#	blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsParamClient.java
#	blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsParamClientImpl.java
LHB 2 月之前
父節點
當前提交
446abd9407

+ 3 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/WbsParamClient.java

@@ -2,6 +2,7 @@ package org.springblade.manager.feign;
 
 
 import org.springblade.manager.entity.WbsParam;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -27,4 +28,6 @@ public interface WbsParamClient {
 
     @PostMapping(API_PREFIX + "/saveWbsParams")
     void saveWbsParams(@RequestBody List<WbsParam> wbsParamList);
+    @PostMapping(API_PREFIX + "/createFileTitle")
+    String createFileTitle(@RequestBody WbsTreeContract contract);
 }

+ 11 - 5
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -150,6 +150,7 @@ public class InformationWriteQueryController extends BladeController {
 
     private final IRecycleBinService recycleBinService;
 
+
     @Autowired
     StringRedisTemplate RedisTemplate;
 
@@ -200,7 +201,7 @@ public class InformationWriteQueryController extends BladeController {
             .map(Long::valueOf)
             .collect(Collectors.toList());
         List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery()
-            .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus).in(InformationQuery::getId, idList));
+            .select(InformationQuery::getId, InformationQuery::getName,InformationQuery::getProjectId,InformationQuery::getClassify,InformationQuery::getStatus,InformationQuery::getWbsId).in(InformationQuery::getId, idList));
         String sgSuffix="";
         String jlSuffix="";
         if(queryList.size()>0){
@@ -211,13 +212,18 @@ public class InformationWriteQueryController extends BladeController {
                 jlSuffix=projectInfos.get(0).getJlSuffix()==null?"":projectInfos.get(0).getJlSuffix();
             }
             for (InformationQuery query : queryList) {
+                String sql="select * from m_wbs_tree_contract where p_key_id="+query.getWbsId()+" and is_deleted=0";
+                WbsTreeContract contract = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(WbsTreeContract.class));
+                  String result=wbsParamClient.createFileTitle(contract);
                 if(query.getClassify()!=null&&query.getClassify()==1&&StringUtils.isNotEmpty(sgSuffix)){
-                   if(!query.getName().endsWith(sgSuffix)){
-                       query.setName(query.getName()+sgSuffix);
+                    result=result+sgSuffix;
+                   if(!query.getName().equals(result)){
+                       query.setName(result);
                    }
                 }else if(query.getClassify()!=null&&query.getClassify()==2&&StringUtils.isNotEmpty(jlSuffix)){
-                    if(!query.getName().endsWith(jlSuffix)){
-                        query.setName(query.getName()+jlSuffix);
+                    result=result+jlSuffix;
+                    if(!query.getName().equals(result)){
+                        query.setName(result);
                     }
                 }
             }

+ 2 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ArchiveTreeController.java

@@ -17,11 +17,13 @@ import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.dto.ArchiveTreeContractAutoRuleMapDTO;
 import org.springblade.manager.dto.ArchiveTreeDTO;
 import org.springblade.manager.dto.ArchiveTreeSortDTO;
+import org.springblade.manager.entity.WbsTree;
 import org.springblade.manager.service.IArchiveTreeContractService;
 import org.springblade.manager.vo.ArchiveTreeVO2;
 import org.springblade.manager.vo.ArchiveTreeVO3;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springblade.manager.entity.ArchiveTree;

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -980,8 +980,8 @@ public class WbsTreePrivateController extends BladeController {
     public String getNameRuleV(String string){
         // 定义工程名称到C格式的映射
         Map<String, String> mapping = new HashMap<>();
-        mapping.put("单位工程", "C0");
-        mapping.put("单位工程", "C1");
+        mapping.put("单位工程类型", "C0");
+        mapping.put("单位工程", "C1");
         mapping.put("分部工程", "C2");
         mapping.put("子分部工程", "C3");
         mapping.put("分项工程", "C4");
@@ -1002,8 +1002,8 @@ public class WbsTreePrivateController extends BladeController {
     public String getNameRuleV1(String string){
         // 定义工程名称到C格式的映射
         Map<String, String> mapping = new HashMap<>();
-        mapping.put("C0", "单位工程");
-        mapping.put("C1", "单位工程");
+        mapping.put("C0", "单位工程类型");
+        mapping.put("C1", "单位工程");
         mapping.put("C2", "分部工程");
         mapping.put("C3", "子分部工程");
         mapping.put("C4", "分项工程");

+ 6 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsParamClientImpl.java

@@ -3,6 +3,7 @@ package org.springblade.manager.feign;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.springblade.manager.entity.WbsParam;
+import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.service.IWbsParamService;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -28,4 +29,9 @@ public class WbsParamClientImpl implements WbsParamClient{
     public void saveWbsParams(List<WbsParam> wbsParamList) {
         iWbsParamService.saveBatch(wbsParamList);
     }
+
+    @Override
+    public String createFileTitle(WbsTreeContract contract) {
+        return iWbsParamService.createFileTitle(contract);
+    }
 }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ArchiveTreeContractMapper.xml

@@ -235,7 +235,7 @@
                         inner join u_archive_file b on b.node_id = a.id and b.is_deleted = a.is_deleted and b.project_id = a.project_id and (b.is_auto_file is null or b.is_auto_file != 1)
                            WHERE  a.is_deleted = 0
                              and a.project_id = #{projectId}
-                             and a.ancestors like CONCAT('%',d.id,'%')
+                             and (FIND_IN_SET(d.id,a.ancestors) or a.id = d.id)
         <if test="code!=null and code!=''">
             AND (a.tree_code = #{code} or a.tree_code = #{contractId} or a.parent_id = 0)
         </if>

+ 4 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -2295,6 +2295,9 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
                         Cell cell = row.getCell(x1 - 1, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
+                        if (cell == null) {
+                            cell = row.createCell(x1 - 1);
+                        }
                         if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                              // 获取单元格的现有值
                             String existingValue = cell.getStringCellValue();
@@ -4157,7 +4160,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                     Row row = sheet.getRow(y1 - 1);
                     if (row != null) {
-                        Cell cell = row.getCell(x1 - 1);
+                        Cell cell = row.getCell(x1 - 1,  Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
                         if (cell != null || ObjectUtils.isNotEmpty(cell)) {
                             short fontIndex = cell.getCellStyle().getFontIndex();
                             Font oldfontAt = workbook.getFontAt(fontIndex);

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -2493,7 +2493,7 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     }
                 }
                 //wbs节点和分部工程的名称类型能对应上,并且编号不一样,并且祖级节点也都能对应上,就修改编号
-                if(vo.getNodeName().equals(dto.getDivisionName())&&vo.getNodeType()==2&&!vo.getPartitionCode().equals(dto.getDivisionCode())){
+                if(vo.getNodeName().equals(dto.getDivisionName())&&vo.getNodeType()==2&&(vo.getPartitionCode()==null||vo.getPartitionCode().equals(dto.getDivisionCode()))){
                     Boolean exist = this.isExist(dto, WbsTreeContractListupdate, 3, wbsTreeContractRoot);
                     if(exist){
                         if(isTrueNode(Arrays.asList(dto.getUnitName(),dto.getSubUnitName(),dto.getDivisionName()),vo)){

+ 3 - 6
blade-service/blade-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java

@@ -1432,9 +1432,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
             long startTime = System.currentTimeMillis();
 
             /*重新计算,进行递归获取父节点计数统计*/
-//            this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
-            Map<Long, List<WbsTreeContractLazyVO>> map = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getId));
-            recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, map);
+            this.recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, nodesAll);
+//            Map<Long, List<WbsTreeContractLazyVO>> map = nodesAll.stream().collect(Collectors.groupingBy(WbsTreeContractLazyVO::getId));
+//            recursiveGetParentNodes(resultParentNodesTB, lowestNodeParentIdsTB, map);
             long endTime = System.currentTimeMillis();
             long executionTime = endTime - startTime;
             _logger.info("合同段 " + contractId + " wbs节点树 数量计算 执行时间:" + executionTime + " ms");
@@ -1511,9 +1511,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
                     return nodes.stream();
                 })
                 .collect(Collectors.toList());
-        if (collectedNodes.isEmpty()) {
-            return;
-        }
         List<Long> collect = collectedNodes.stream()
                 .map(WbsTreeContractLazyVO::getParentId).filter(Objects::nonNull).distinct()
                 .collect(Collectors.toList());