Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

chenyi 2 lat temu
rodzic
commit
f2250a5d8d

+ 1 - 0
RMS/src/main/java/cn/cslg/report/controller/CompareRecordsController.java

@@ -26,6 +26,7 @@ public class CompareRecordsController {
     @PostMapping(value = "/addCompareRecords")
     @Operation(summary = "增加对比记录数据")
     public String addCompareRecords(@RequestBody CompareRecords compareRecords)throws IOException{
+
        compareRecords.setPersonId(loginUtils.getId());
         return compareRecordsService.addCompareRecord(compareRecords);
     }

+ 9 - 5
RMS/src/main/java/cn/cslg/report/controller/PatentFiledController.java

@@ -51,11 +51,15 @@ public class PatentFiledController {
 
     @GetMapping("option/list")
     @Operation(summary = "选项列表")
-    public String getList(Integer fieldId,Integer type) {
-        if (type == 6) {
-            return Response.success(reportFieldTreeService.getReportFieldTreeNodeByFieldId(fieldId));
-        } else {
-            return Response.success(reportFieldOptionService.getListByFieldId(fieldId));
+    public String getList(Integer fieldId,Integer type ,Integer reportId)throws IOException {
+        if(reportId!=null){
+            return reportFieldService.getReportField(reportId);
+        }else {
+            if (type == 6) {
+                return Response.success(reportFieldTreeService.getReportFieldTreeNodeByFieldId(fieldId));
+            } else {
+                return Response.success(reportFieldOptionService.getListByFieldId(fieldId));
+            }
         }
     }
     @PostMapping("update")

+ 0 - 2
RMS/src/main/java/cn/cslg/report/entity/ReportField.java

@@ -22,8 +22,6 @@ import java.util.List;
 @Data
 @TableName("OS_PATENT_FIELD")
 public class ReportField extends BaseEntity<ReportField> {
-
-
     /**
      * 自定义字段名称
      */

+ 1 - 0
RMS/src/main/java/cn/cslg/report/mapper/CompareRecordsMapper.java

@@ -15,4 +15,5 @@ public interface CompareRecordsMapper  extends BaseMapper<CompareRecords> {
      List<CompareRecords> find(@Param("reportId") int reportId,@Param("patentNo") String  patentNo,@Param("personId") int personId);
      CompareRecords getCompareRecords(@Param("reportId") int reportId);
      List<CompareRecords> findCompareRecords(@Param("personId") int personId);
+     int updateCompareRecords(@Param("featuresId")String featuresId,@Param("id")int id);
 }

+ 15 - 3
RMS/src/main/java/cn/cslg/report/service/business/CompareRecordsService.java

@@ -42,9 +42,11 @@ public class CompareRecordsService extends ServiceImpl<CompareRecordsMapper, Com
           this.removeById(id);
           return Response.success();
     }
+    @Transactional
     public String updateCompareRecords(CompareRecords compareRecord)throws IOException{
-        compareRecord.setFeaturesId(StringUtils.join(compareRecord.getFeaturesIdList(),","));
-        compareRecord.updateById();
+        String str = StringUtils.join(compareRecord.getFeaturesIdList(), ",");
+        Integer id = compareRecord.getId();
+        compareRecordsMapper.updateCompareRecords(str,id);
         return Response.success();
     }
     public String getCompareRecords(int reportId,String  patentNo,int personId)throws IOException{
@@ -52,6 +54,9 @@ public class CompareRecordsService extends ServiceImpl<CompareRecordsMapper, Com
         List<CompareRecords> list=new ArrayList<>();
         for(CompareRecords c:compareRecords){
             String featuresId = c.getFeaturesId();
+            if(featuresId==null){
+                return Response.success(compareRecords);
+            }
             List<CompareRecords.CY> list1=new ArrayList<>();
             String[] split = featuresId.split(",");
             for(String str :split){
@@ -80,6 +85,9 @@ public class CompareRecordsService extends ServiceImpl<CompareRecordsMapper, Com
             for(CompareRecords a:compareRecords1){
                 CompareRecords compareRecords2=new CompareRecords();
                 String featuresId = a.getFeaturesId();
+                if(featuresId==null){
+                    return Response.success(compareRecords);
+                }
                 String[] split = featuresId.split(",");
                 List<CompareRecords.CY> list=new ArrayList<>();
                 for(String str :split){
@@ -97,7 +105,11 @@ public class CompareRecordsService extends ServiceImpl<CompareRecordsMapper, Com
             return Response.success(list2);
         }
         List<CompareRecords.CY> list=new ArrayList<>();
-        String[] split = compareRecords.getFeaturesId().split(",");
+        String str3=compareRecords.getFeaturesId();
+        if(str3==null){
+            return Response.success(compareRecords);
+        }
+        String[] split = str3.split(",");
         for(String str :split){
             int i=Integer.parseInt(str);
             Features features = featureMapper.find(i);

+ 1 - 1
RMS/src/main/java/cn/cslg/report/service/business/ReportFieldService.java

@@ -47,7 +47,7 @@ public class ReportFieldService extends ServiceImpl<ReportFieldMapper, ReportFie
             return Response.error("字段名称已存在");
         }
         reportField.setPtype(reportField.getType() == 6 ? 2 : 1);
-//        reportField.setCreateBy(loginUtils.getId());
+        reportField.setCreateBy(loginUtils.getId());
         reportField.insert();
         return Response.success(reportField.getId());
     }

+ 3 - 1
RMS/src/main/resources/mapper/CompareRecordsMapper.xml

@@ -10,5 +10,7 @@
     <select id="findCompareRecords" resultType="cn.cslg.report.entity.CompareRecords">
         select * from COMPARE_RECORDS where PERSON_ID=#{personId}
     </select>
-
+    <update id="updateCompareRecords">
+        update COMPARE_RECORDS set FEATURES_ID=#{featuresId} where ID=#{id}
+    </update>
 </mapper>