Parcourir la source

2/21 修改回避设计相关代码

chendayu il y a 2 ans
Parent
commit
9d3cc5dcc0

+ 2 - 2
RMS/src/main/java/cn/cslg/report/controller/ProductController.java

@@ -47,7 +47,7 @@ public class ProductController {
             }
             return Response.success("新增产品完成");
         }
-        return Response.error("新增产品失败,请求参数为null");
+        return Response.error("请求参数为null");
     }
 
     @Operation(summary = "修改产品")
@@ -63,7 +63,7 @@ public class ProductController {
             }
             return Response.success("修改产品完成");
         }
-        return Response.error("修改产品失败,请求参数为null");
+        return Response.error("请求参数为null");
     }
 
     @Operation(summary = "根据报告id查询产品数据信息")

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

@@ -86,7 +86,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
             PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
             report.setCreatePersonId(personnelVO.getId());
             //如果报告类型是4(侵权分析报告)则将状态设为2(处理中)
-            if (report.getType().equals(4)) {
+            if (report.getType().equals(4) || report.getType().equals(5)) {
                 report.setStatus(2);
             }
             boolean addFlag = this.save(report);

+ 1 - 2
RMS/src/main/java/cn/cslg/report/service/impl/AvoidDesignDirectionServiceImpl.java

@@ -168,8 +168,7 @@ public class AvoidDesignDirectionServiceImpl implements IAvoidDesignDirectionSer
         try {
             resBody = outInterfaceService.getPatentRightFromPAS(signPatentNo);
         } catch (IOException e) {
-            //e.printStackTrace();
-            log.info("根据专利号查询权要列表时发生IO异常");
+            log.info("发生IO异常");
         }
         JSONObject jsonObject = JSONObject.parseObject(resBody);
         //解析jason获得标的专利的权要

+ 8 - 2
RMS/src/main/java/cn/cslg/report/service/impl/ProductServiceImpl.java

@@ -117,12 +117,18 @@ public class ProductServiceImpl implements IProductService {
     public void updateProduct(ProductIncludeFilesDTO productIncludeFilesDTO, List<MultipartFile> files) {
         log.info("开始处理【修改产品】的业务,参数为:{}, {}", productIncludeFilesDTO, files);
 
-        //产品关联附件的前端传输DTO赋值给产品实体类
+        //DTO赋值给产品实体类
         Product product = new Product();
         BeanUtils.copyProperties(productIncludeFilesDTO, product);
 
         //1.根据id修改产品表数据
-        productMapper.update(product);
+        log.info("根据id修改产品表数据");
+        int rows = productMapper.update(product);
+        if (rows != 1) {
+            String message = "修改产品失败,服务器忙请稍后再试";
+            log.info("根据id修改产品表数据失败,{}", message);
+            throw new XiaoShiException(message);
+        }
 
         //2.根据reportId(报告id)关联查询出产品关联附件的数据信息
         Integer reportId = product.getReportId();

+ 5 - 5
RMS/src/main/resources/mapper/AvoidDesignLittleDirectionMapper.xml

@@ -6,7 +6,7 @@
     <!--批量插入回避设计方向表数据-->
     <!--int insertBatch(List<AvoidDesignLittleDirection> avoidDesignLittleDirections);-->
     <insert id="insertBatch" useGeneratedKeys="true" keyProperty="id">
-        insert into AVOIDDESIGN_LITTLE_DIRECTION (REPORT_ID, FEATURE_ID, LITTLE_DIRECTION)
+        insert into avoiddesign_little_direction (REPORT_ID, FEATURE_ID, LITTLE_DIRECTION)
         VALUES
         <foreach collection="list" item="n" separator=",">
             (#{n.reportId}, #{n.featureId}, #{n.littleDirection})
@@ -17,7 +17,7 @@
     <!--int deleteByReportId(Integer reportId);-->
     <delete id="deleteByReportId">
         delete
-        from AVOIDDESIGN_LITTLE_DIRECTION
+        from avoiddesign_little_direction
         where REPORT_ID = #{reportId}
     </delete>
 
@@ -25,7 +25,7 @@
     <!--String selectSignPatentNoByReportId(Integer reportId);-->
     <select id="selectSignPatentNoByReportId" resultType="String">
         select SIGN_PATENT_NO
-        from REPORT
+        from report
         where ID = #{reportId}
     </select>
 
@@ -48,8 +48,8 @@
                SPLIT_TYPE,
                TASK_ID,
                LITTLE_DIRECTION
-        from FEATURES f
-                 left join AVOIDDESIGN_LITTLE_DIRECTION l on f.ID = l.FEATURE_ID
+        from features f
+                 left join avoiddesign_little_direction l on f.ID = l.FEATURE_ID
         where RIGHT_ID = #{rightId}
           and f.REPORT_ID = #{reportId}
         order by f.ID