Преглед на файлове

getone 改写2022/10/20

lwhhszx преди 3 години
родител
ревизия
432fa07ad3

+ 6 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentSimpleFamilyLinkService.java

@@ -67,7 +67,12 @@ public class PatentSimpleFamilyLinkService extends ServiceImpl<PatentSimpleFamil
         LambdaQueryWrapper<PatentSimpleFamilyLink> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(PatentSimpleFamilyLink::getPatentNo, patentNo);
         queryWrapper.eq(PatentSimpleFamilyLink::getFamilyId, familyId);
-        return this.getOne(queryWrapper);
+        PatentSimpleFamilyLink patentSimpleFamilyLink =new PatentSimpleFamilyLink();
+       List<PatentSimpleFamilyLink> patentSimpleFamilyLinks =this.list(queryWrapper);
+       if(patentSimpleFamilyLinks!=null&&patentSimpleFamilyLinks.size()!=0){
+           patentSimpleFamilyLink =patentSimpleFamilyLinks.get(0);
+       }
+        return patentSimpleFamilyLink;
     }
 
     public List<PatentSimpleFamilyLink> getPatentSimpleFamilyLinkByFamilyIds(List<Integer> familyIds) {

+ 6 - 1
PAS/src/main/java/cn/cslg/pas/service/PatentSimpleFamilyService.java

@@ -39,7 +39,12 @@ public class PatentSimpleFamilyService extends ServiceImpl<PatentSimpleFamilyMap
         LambdaQueryWrapper<PatentSimpleFamily> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(PatentSimpleFamily::getId, ids);
         queryWrapper.eq(PatentSimpleFamily::getType, type);
-        return this.getOne(queryWrapper);
+        PatentSimpleFamily  patentSimpleFamily =new PatentSimpleFamily();
+        List<PatentSimpleFamily> patentSimpleFamilies =this.list(queryWrapper);
+        if(patentSimpleFamilies!=null&&patentSimpleFamilies.size()!=0){
+             patentSimpleFamily =patentSimpleFamilies.get(0);
+        }
+        return patentSimpleFamily;
     }
 
     public List<PatentSimpleFamily> getPatentSimpleFamilyByIds(List<Integer> ids) {

+ 3 - 0
PAS/src/main/java/cn/cslg/pas/service/ProjectService.java

@@ -444,11 +444,14 @@ public class ProjectService extends ServiceImpl<ProjectMapper, Project> {
     }
 
     public TaskParams getImportPatentTaskParams(MultipartFile file, Integer projectId) {
+        // 上传文件并返回文件信息
         UploadFileDTO fileDTO = fileUtils.uploadFile(file);
+        // 获得文件路径
         String path = fileUtils.getPath(fileDTO.getPath());
         List<List<Object>> rowList = new ArrayList<>();
         List<Map<Object, Object>> mapList = new ArrayList<>();
         ExcelUtil.readBySax(path, -1, (sheetIndex, rowIndex, row) -> rowList.add(row));
+        //遍历保存excel文件里每行每列的值
         for (int i = 1; i < rowList.size(); i++) {
             mapList.add(IterUtil.toMap(rowList.get(0), rowList.get(i)));
         }

+ 1 - 0
PAS/src/main/java/cn/cslg/pas/service/UploadPatentBatchService.java

@@ -136,6 +136,7 @@ public class UploadPatentBatchService {
         try {
             //专利信息 OS_PATENT
             if (uploadParamsVO.getPatent() != null) {
+                //TODO 字典能提出去
                 List<SystemDict> systemDictList = systemDictService.getSystemDictListByType(Collections.singletonList(Constants.PATENT_SIMPLE_STATUS));
                 Integer simpleStatus = Integer.parseInt(systemDictList.stream()
                         .filter(systemDict -> systemDict.getType().equals(Constants.PATENT_SIMPLE_STATUS) && systemDict.getLabel().equals(uploadParamsVO.getPatentSimpleStatus()))

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

@@ -6,7 +6,7 @@ spring:
     password: Xx0GWxdWQJxx6Swe
     timeout: 1000
   datasource:
-    url: jdbc:mysql://172.27.247.174:3306/pas-prod?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+    url: jdbc:mysql://172.27.247.174/pas-prod?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
     username: root
     password: TU5x6IeBi7rl
     driver-class-name: com.mysql.cj.jdbc.Driver

+ 2 - 2
PAS/src/main/resources/application.yml

@@ -1,7 +1,7 @@
 server:
   servlet:
     context-path: /
-  port: 8879
+  port: 8878
 sa-token:
   activity-timeout: 18000
   token-name: token
@@ -20,7 +20,7 @@ spring:
       max-file-size: 1000MB
       max-request-size: 1000MB
   profiles:
-    active: test
+    active: prod
   jackson:
     default-property-inclusion: non_null
     serialization: