瀏覽代碼

20241224 bug修改

lrj 9 月之前
父節點
當前提交
e2fbf69abf

+ 1 - 1
src/main/java/cn/cslg/pas/factorys/getOrderFactory/GetProductOrCategoryOrder.java

@@ -31,7 +31,7 @@ private ProductMapper productMapper;
          StringBuilder stringBuilder =new StringBuilder("(case ");
         for (int i=0;i<productOrCategoryVOS.size();i++){
 
-            stringBuilder.append("when aspt.tree_type="+productOrCategoryVOS.get(i).getType()+" and aspt.field_id="+productOrCategoryVOS.get(i).getId()+" then "+i+" ");
+            stringBuilder.append("when t.treeType="+productOrCategoryVOS.get(i).getType()+" and t.fieldId="+productOrCategoryVOS.get(i).getId()+" then "+i+" ");
         }
          stringBuilder.append("else "+(productOrCategoryVOS.size()+1)+" end)");
 

+ 9 - 7
src/main/java/cn/cslg/pas/service/ReportExportService.java

@@ -322,8 +322,7 @@ public class ReportExportService {
     }
 
     private XWPFTemplate avoidDesignTemplate(Integer projectId, String path) throws IOException {
-        String filePath = fileUtils.getPath(path);
-        log.info("开始处理导出规避设计报告,参数为:{}, {}", projectId, filePath);
+        log.info("开始处理导出规避设计报告,参数为:{}, {}", projectId, path);
         LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(ReportProject::getProjectId, projectId);
 
@@ -356,7 +355,7 @@ public class ReportExportService {
                 .bind("littleDirection", htmlRenderPolicy)
                 .bind("wholeDirection", htmlRenderPolicy)
                 .build();
-        XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(new HashMap<>());
+        XWPFTemplate template = XWPFTemplate.compile(path, configure).render(new HashMap<>());
         return template;
     }
 
@@ -1293,9 +1292,12 @@ public class ReportExportService {
                     if (recordIds != null && recordIds.size() != 0) {
                         compareRecords1 = evidenceReasons.stream().filter(item -> recordIds.contains(item.getId())).collect(Collectors.toList());
                     }
-
+                    String common1 =item1.getCommon1();
+                    if(common1==null){
+                        common1="";
+                    }
                     //判断方案是否具有创造性或者新颖性字眼
-                    if (item1.getDescription() != null && (item1.getDescription().contains("创造性") || item1.getDescription().contains("新颖性"))) {
+                    if (common1!= null && (common1.contains("创造性") || common1.contains("新颖性"))) {
                         //装载对比记录
                         List<Map<String, Object>> maps = new ArrayList<>();
 
@@ -1334,13 +1336,13 @@ public class ReportExportService {
                             maps.add(map);
                         }
 
-                        if (item1.getDescription().contains("创造性")) {
+                        if (common1.contains("创造性")) {
                             creativeIds.add(Integer.parseInt(right.get("sort").toString()) + 1);
 
                             right.put("records", maps);
                             right.put("text", "第3款的创造性的规定。\n" + text + right.get("rightNameLong") + "的附加技术特征为:");
                             rightMaps.add(right);
-                        } else if (item1.getDescription().contains("新颖性")) {
+                        } else if (common1.contains("新颖性")) {
                             noveltyIds.add(Integer.parseInt(right.get("sort").toString()) + 1);
                             right.put("text", "第2款的新颖性的规定。\n" + text + right.get("rightNameLong") + "保护的主体,具体:");
                             right.put("records", compareRecords1);

+ 21 - 14
src/main/java/cn/cslg/pas/service/business/CustomFieldService.java

@@ -163,7 +163,7 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
         }
         //获取登录人信息
         PersonnelVO personnelVO = new PersonnelVO();
-            personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
+        personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
 
         CustomField customField = new CustomField();
         BeanUtils.copyProperties(customFieldDTO, customField);
@@ -242,17 +242,18 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
 
 
     public List<AllCustomFieldVO> getAllProjectCustomField(Integer projectId) {
-
         List<AllCustomFieldVO> allCustomFieldVOS = cacheUtils.getPatentCustomField(projectId);
         if (CollectionUtils.isEmpty(allCustomFieldVOS)) {
             allCustomFieldVOS = new ArrayList<>();
         }
+        List<AllCustomFieldVO> reAllCustomFieldVOs = new ArrayList<>();
         Integer order = allCustomFieldVOS.size();
         //根据 project获得栏位值
         List<CustomField> customFields = new ArrayList<>();
         LambdaQueryWrapper<CustomField> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(CustomField::getProjectId, projectId);
         customFields = this.list(queryWrapper);
+
         //
         LambdaQueryWrapper<AssoProjectTreeNode> assoQueryWrapper = new LambdaQueryWrapper<>();
         assoQueryWrapper.eq(AssoProjectTreeNode::getProjectId, projectId);
@@ -266,9 +267,12 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
                 allCustomFieldVO.setName(item.getName());
                 allCustomFieldVO.setType(item.getType());
                 allCustomFieldVO.setSysOrder(order);
-                allCustomFieldVOS.add(allCustomFieldVO);
                 order += 1;
             }
+            AllCustomFieldVO re = reAllCustomFieldVOs.stream().filter(i -> i.getId().equals(item.getId()) && i.getType().equals(item.getType())).findFirst().orElse(null);
+            if (re == null) {
+                reAllCustomFieldVOs.add(allCustomFieldVO);
+            }
         }
 
         for (AssoProjectTreeNode item : projectTreeNodes) {
@@ -297,9 +301,14 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
                 allCustomFieldVOS.add(allCustomFieldVO);
                 order += 1;
             }
+            AllCustomFieldVO re = reAllCustomFieldVOs.stream().filter(i -> i.getId().equals(item.getId()) && i.getType().equals(item.getTreeType())).findFirst().orElse(null);
+            if (re == null) {
+                reAllCustomFieldVOs.add(allCustomFieldVO);
+            }
+            reAllCustomFieldVOs.add(allCustomFieldVO);
         }
 
-        return allCustomFieldVOS;
+        return reAllCustomFieldVOs;
     }
 
     /**
@@ -776,16 +785,15 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
     }
 
 
-
     /**
      * @param customerFieldList
      */
-    public  List<EsCustomFieldDTO> getFieldDTOByStrings(List<UploadParamsVO.Field> customerFieldList, Integer projectId,Integer contionId) {
-      List<EsCustomFieldDTO>  esCustomFieldDTOs =new ArrayList<>();
+    public List<EsCustomFieldDTO> getFieldDTOByStrings(List<UploadParamsVO.Field> customerFieldList, Integer projectId, Integer contionId) {
+        List<EsCustomFieldDTO> esCustomFieldDTOs = new ArrayList<>();
         if (customerFieldList != null && customerFieldList.size() != 0) {
 
             for (UploadParamsVO.Field field : customerFieldList) {
-                EsCustomFieldDTO esCustomFieldDTO =new EsCustomFieldDTO();
+                EsCustomFieldDTO esCustomFieldDTO = new EsCustomFieldDTO();
                 String key = field.getKey();
                 List<String> fieldList = field.getFieldList();
                 String[] keys = key.split(":");
@@ -797,22 +805,22 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
                 Integer typeInt = Integer.parseInt(type);
                 Integer fieldId = this.GetIdByName(fieldName, projectId, typeInt);
                 esCustomFieldDTO.setFieldId(fieldId.toString());
-                List<String> values =new ArrayList<>();
+                List<String> values = new ArrayList<>();
                 switch (type) {
                     case "0":
                     case "1":
                     case "2":
                         esCustomFieldDTO.setFieldType(Integer.parseInt(type));
-                        values =fieldList;
+                        values = fieldList;
                         break;
                     case "4":
                     case "5":
                         esCustomFieldDTO.setFieldType(Integer.parseInt(type));
-                        values = customOptionService.getIdsByNames(fieldList,fieldId);
+                        values = customOptionService.getIdsByNames(fieldList, fieldId);
                         break;
                     case "6":
                         esCustomFieldDTO.setFieldType(Integer.parseInt(type));
-                       values =treeNodeService.getIdByNames(fieldList,fieldId,contionId);
+                        values = treeNodeService.getIdByNames(fieldList, fieldId, contionId);
                         break;
                 }
                 esCustomFieldDTO.setFieldValue(values);
@@ -822,11 +830,10 @@ public class CustomFieldService extends ServiceImpl<CustomFieldMapper, CustomFie
             }
 
         }
-     return esCustomFieldDTOs;
+        return esCustomFieldDTOs;
     }
 
 
-
     public Integer addCustomField(CustomFieldDTO customFieldDTO) {
 
 

+ 2 - 0
src/main/java/cn/cslg/pas/service/common/PersonFieldService.java

@@ -429,6 +429,7 @@ public class PersonFieldService {
                                 break;
                             case 6:
                                 getAllPatentCountVO.setType("tree");
+                                break;
                         }
                     } else {
                         getAllPatentCountVO.setFiledKind(allCustomFieldVO.getType());
@@ -529,6 +530,7 @@ if(customField!=null){
 
         Boolean flag = true;
         List<GetAllPatentCountVO> fieldVOS = addPatentCountDTO.getValue();
+
         redisUtil.set(RedisConf.FIELD_COUNT + RedisConf.SYMBOL_COLON + key, JsonUtils.objectToJson(fieldVOS));
         return fieldVOS;
     }

+ 4 - 4
src/main/resources/application-dev.yml

@@ -60,14 +60,14 @@ spring:
     job-store-type: memory
     #初始化表结构
 
-authorUrl: http://localhost:8871
-PCSUrl: http://localhost:8871
+authorUrl: http://192.168.2.24:8871
+PCSUrl: http://192.168.2.24:8871
 #OPSUrl: http://192.168.2.24:5001
 OPSUrl: http://139.224.24.90:5001
 PASUrl: http://localhost:8879
-FMSUrl: http://localhost:8803
+FMSUrl: http://192.168.2.24:8803
 WDUrl: http://1.116.113.26:81
-PythonUrl: http://localhost:8001
+PythonUrl: http://192.168.2.24:8001
 FileSource: 1
 ES:
   patentVector: patent_vector

+ 1 - 1
src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
       max-file-size: 1000MB
       max-request-size: 1000MB
   profiles:
-    active: testNetIn
+    active: dev
   jackson:
     default-property-inclusion: non_null
     serialization:

+ 2 - 2
src/main/resources/jsons/patentProject.json

@@ -160,8 +160,8 @@
   {
     "name": "产品/技术类别",
     "type": "Object",
-    "value": "productOrCategory",
-    "field": "productOrCategory",
+    "value": "technicalCategoryName",
+    "field": "technicalCategoryName",
     "sqlField": "t.scenarioId",
     "sqlClass": "getComSql",
     "orderClass": "getProductOrCategoryOrder",

+ 25 - 0
src/test/java/cn/cslg/pas/test/PersonFiledTests.java

@@ -0,0 +1,25 @@
+package cn.cslg.pas.test;
+
+import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
+import cn.cslg.pas.service.business.CustomFieldService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class PersonFiledTests {
+@Autowired
+    private CustomFieldService customFieldService;
+
+@Test
+    public  void tet1(){
+
+    List<AllCustomFieldVO> allCustomFieldVOS = customFieldService.getAllProjectCustomField(5495);
+System.out.println(allCustomFieldVOS);
+}
+}

+ 2 - 2
src/test/java/cn/cslg/pas/test/TempServiceTests.java

@@ -41,10 +41,10 @@ public class TempServiceTests {
         EncryptionLoginDTO encryptionLoginDTO = new EncryptionLoginDTO();
         encryptionLoginDTO.setAppKey(appKey);
         //登录账号
-        encryptionLoginDTO.setUsername("admin");
+        encryptionLoginDTO.setUsername("lirenjie@china-wispro.com");
 //        encryptionLoginDTO.setUsername("zhuhao");
         //登录密码
-        encryptionLoginDTO.setPassword("123456");
+        encryptionLoginDTO.setPassword("xiaoshi221101");
 //        encryptionLoginDTO.setPassword("xiaoshi221101");
         //本机器的机器码,此处为伪造
         encryptionLoginDTO.setMachineCode("BFEBFBFF000A0654");