Quellcode durchsuchen

1.修复意见书出库时间异常
2.修改了getProductionList接口,使其在撰写报告节点可以通过评估对象id集合查询,以修复当存在两个取了不同报告号的对象时无法查询出来所有的对象的报告从而导致提交节点时将两个不同的报告提交到一条流程
3.修改了getReportNoList方法,使其可以通过评估对象id集合查询,以修复当一条流程存在两种报告类型时,无法正确取号的问题
4.修复撰写的产品没有项目名称的问题
5.新增接口getChoiceLog
6.选择记录表新增字段
7.修复报告取号时获取不到同一订单对象已取号的产品号

GouGengquan vor 1 Jahr
Ursprung
Commit
c437429095

+ 2 - 2
biz-base/src/main/java/com/dayou/controller/AssetsProductionController.java

@@ -148,8 +148,8 @@ public class AssetsProductionController extends BaseController {
      * @param aProListSelectDTO 查询dto
      * @return List<AssetsProduction>
      */
-    @GetMapping("/getProductionList")
-    public RestResponse<List<AssetsProduction>> getProductionList(AProListSelectDTO aProListSelectDTO) {
+    @PostMapping("/getProductionList")
+    public RestResponse<List<AssetsProduction>> getProductionList(@RequestBody AProListSelectDTO aProListSelectDTO) {
         return RestResponse.data(assetsProductionService.getProductionList(aProListSelectDTO));
     }
 

+ 10 - 0
biz-base/src/main/java/com/dayou/controller/BusinessProductionChoiceLogController.java

@@ -78,6 +78,16 @@ public class BusinessProductionChoiceLogController extends BaseController {
         return RestResponse.data(ret);
     }
 
+    /**
+     * 查询产品选择记录
+     * @param selectDto 查询条件
+     * @return BusinessProductionChoiceLog
+     */
+    @GetMapping("/getChoiceLog")
+    public RestResponse<BusinessProductionChoiceLog> getChoiceLog(BusinessProductionChoiceLog selectDto) {
+        return RestResponse.data(businessProductionChoiceLogService.getChoiceLog(selectDto));
+    }
+
 
 }
 

+ 1 - 1
dao/src/main/java/com/dayou/mapper/AssetsEvaluationTargetMapper.java

@@ -52,7 +52,7 @@ public interface AssetsEvaluationTargetMapper extends CustomBaseMapper<AssetsEva
      * @param businessId 资产业务id
      * @return List<String>
      */
-    List<String> getReportNoList(@Param("businessId") Long businessId);
+    List<String> getReportNoList(@Param("businessId") Long businessId, @Param("targetIdList") List<Long> targetIdList);
 
     /**
      * 评估对象审核定价

+ 4 - 0
dao/src/main/resources/mapper/AssetsEvaluationTargetMapper.xml

@@ -105,6 +105,10 @@
           AND deleted = 0
           AND report_no IS NOT NULL
           AND report_no != ''
+        AND assets_evaluation_target.id IN
+        <foreach collection="targetIdList" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
     </select>
 
     <!--评估对象审核定价-->

+ 11 - 3
dao/src/main/resources/mapper/AssetsProductionMapper.xml

@@ -75,6 +75,7 @@
           AND business_id = #{businessId}
           AND production_type = #{productionType}
           AND (production_no IS NULL OR production_no = '')
+        LIMIT 1
     </update>
 
     <!--取子号情况下,再复制一份产品信息并添加-->
@@ -97,7 +98,8 @@
             print_count = #{printCount},
             create_production_date = #{createProductionDate},
             comment = #{comment},
-            file_path = #{filePath}
+            file_path = #{filePath},
+            assets_name = #{assetsName}
         WHERE production_no = #{productionNo}
           AND business_id = #{businessId}
     </update>
@@ -128,8 +130,14 @@
         qr_code
         FROM assets_production
         WHERE business_id = #{businessId}
-        <if test="(statementNo != null and statementNo != '') or (reportNo != null and reportNo != '') ">
-            AND production_no = #{statementNo} OR production_no = #{reportNo}
+        <if test="statementNo != null and statementNo != ''">
+            AND production_no = #{statementNo}
+        </if>
+        <if test="reportNos != null">
+            OR production_no IN
+            <foreach collection="reportNos" index="index" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         AND create_production_date IS NOT NULL
         AND deleted = 0

+ 13 - 0
domain/src/main/java/com/dayou/dto/AProListSelectDTO.java

@@ -26,5 +26,18 @@ public class AProListSelectDTO {
      */
     private String reportNo;
 
+    /**
+     * 产品类型
+     */
+    private String productionType;
+
+    /**
+     * 产品号集合
+     */
     List<String> productionNos;
+
+    /**
+     * 产品号集合
+     */
+    List<String> reportNos;
 }

+ 6 - 1
domain/src/main/java/com/dayou/dto/TakeAssetsProductionNoDTO.java

@@ -33,8 +33,13 @@ public class TakeAssetsProductionNoDTO {
     private Integer printCount;
 
     /**
-     * 评估对象id集合
+     * 取号的评估对象id集合
      */
     private List<Long> targetIdList;
 
+    /**
+     * 所有的评估对象id集合
+     */
+    private List<Long> allTargetIdList;
+
 }

+ 3 - 0
domain/src/main/java/com/dayou/entity/AssetsProduction.java

@@ -1,5 +1,7 @@
 package com.dayou.entity;
 import java.math.BigDecimal;
+
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.dayou.common.BaseEntity;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
@@ -176,6 +178,7 @@ public class AssetsProduction extends BaseEntity {
     /**
      * 评估对象id集合
      */
+    @TableField(exist = false)
     private List<Long> targetIdList;
 
 

+ 5 - 0
domain/src/main/java/com/dayou/entity/BusinessProductionChoiceLog.java

@@ -38,6 +38,11 @@ public class BusinessProductionChoiceLog extends BaseEntity {
     private Long targetId;
 
     /**
+     * 产品id
+     */
+    private Long productionId;
+
+    /**
      * 产品选择的类型
      */
     @ImportCell

+ 7 - 0
service/src/main/java/com/dayou/service/IBusinessProductionChoiceLogService.java

@@ -25,4 +25,11 @@ public interface IBusinessProductionChoiceLogService extends IService<BusinessPr
 
         Boolean delete(Long id);
 
+        /**
+         * 查询产品选择记录
+         * @param selectDto 查询条件
+         * @return BusinessProductionChoiceLog
+         */
+        BusinessProductionChoiceLog getChoiceLog(BusinessProductionChoiceLog selectDto);
+
 }

+ 22 - 3
service/src/main/java/com/dayou/service/impl/AssetsProductionServiceImpl.java

@@ -84,7 +84,9 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean add(AssetsProduction assetsProduction) {
+        this.save(assetsProduction);
         // 选择产品时给当前选择产品的评估对象添加选择产品记录
         List<BusinessProductionChoiceLog> choiceLogList = new ArrayList<>();
         for (Long targetId : assetsProduction.getTargetIdList()){
@@ -93,14 +95,31 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
             choiceLog.setProductionType(assetsProduction.getProductionType());
             choiceLog.setBusinessId(assetsProduction.getBusinessId());
             choiceLog.setTargetId(targetId);
+            choiceLog.setPrintCount(assetsProduction.getPrintCount());
+            choiceLog.setProductionId(assetsProduction.getId());
             choiceLogList.add(choiceLog);
         }
-        choiceLogService.saveBatch(choiceLogList);
-        return this.save(assetsProduction);
+        return choiceLogService.saveBatch(choiceLogList);
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean update(AssetsProduction assetsProduction) {
+        // 更新选择产品时给当前选择产品的评估对象更新选择产品记录
+        List<BusinessProductionChoiceLog> choiceLogList = new ArrayList<>();
+        for (Long targetId : assetsProduction.getTargetIdList()){
+            BusinessProductionChoiceLog choiceLog = choiceLogService.getOne(new LambdaQueryWrapper<BusinessProductionChoiceLog>()
+                    .eq(BusinessProductionChoiceLog::getBusinessType, "ASSET_BUSINESS")
+                    .eq(BusinessProductionChoiceLog::getBusinessId, assetsProduction.getBusinessId())
+                    .eq(BusinessProductionChoiceLog::getTargetId, targetId)
+                    .eq(BaseEntity::getDeleted, 0)
+                    .eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
+            choiceLog.setProductionId(assetsProduction.getId());
+            choiceLog.setProductionType(assetsProduction.getProductionType());
+            choiceLog.setPrintCount(assetsProduction.getPrintCount());
+            choiceLogList.add(choiceLog);
+        }
+        choiceLogService.updateBatchById(choiceLogList);
         return this.updateById(assetsProduction);
     }
 
@@ -253,7 +272,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
                 } else { // 意见书可以直接出库
                     return this.update(new LambdaUpdateWrapper<AssetsProduction>()
                             .set(AssetsProduction::getRepertoryState, 1)
-                            .set(AssetsProduction::getRepertoryInTime, new Date())
+                            .set(AssetsProduction::getRepertoryOutTime, new Date())
                             .eq(BaseEntity::getId, wareHouseDTO.getProductionId())
                             .eq(AssetsProduction::getProductionNo, wareHouseDTO.getProductionNo()));
                 }

+ 1 - 1
service/src/main/java/com/dayou/service/impl/AssetsServiceImpl.java

@@ -288,7 +288,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
         if (takeAssetsProductionNoDTO.getProductionType().equals(STATEMENT.getCode())){ //意见书
             productionNoList = assetsEvaluationTargetMapper.getStatementNoList(takeAssetsProductionNoDTO.getBusinessId());
         }else { //报告
-            productionNoList = assetsEvaluationTargetMapper.getReportNoList(takeAssetsProductionNoDTO.getBusinessId());
+            productionNoList = assetsEvaluationTargetMapper.getReportNoList(takeAssetsProductionNoDTO.getBusinessId(), takeAssetsProductionNoDTO.getAllTargetIdList());
         }
         //判断该资产业务订单是否有取过号
         if (ObjectUtil.isNull(productionNoList) || productionNoList.isEmpty()) {

+ 16 - 0
service/src/main/java/com/dayou/service/impl/BusinessProductionChoiceLogServiceImpl.java

@@ -1,5 +1,6 @@
 package com.dayou.service.impl;
 
+import com.dayou.common.BaseEntity;
 import com.dayou.entity.BusinessProductionChoiceLog;
 import com.dayou.mapper.BusinessProductionChoiceLogMapper;
 import com.dayou.service.IBusinessProductionChoiceLogService;
@@ -63,4 +64,19 @@ public class BusinessProductionChoiceLogServiceImpl extends ServiceImpl<Business
         //逻辑删除
         return this.removeById(id);
     }
+
+    /**
+     * 查询产品选择记录
+     * @param selectDto 查询条件
+     * @return BusinessProductionChoiceLog
+     */
+    @Override
+    public BusinessProductionChoiceLog getChoiceLog(BusinessProductionChoiceLog selectDto) {
+        return this.getOne(new LambdaQueryWrapper<BusinessProductionChoiceLog>()
+                .eq(BusinessProductionChoiceLog::getBusinessType, selectDto.getBusinessType())
+                .eq(BusinessProductionChoiceLog::getBusinessId, selectDto.getBusinessId())
+                .eq(BusinessProductionChoiceLog::getTargetId, selectDto.getTargetId())
+                .eq(BaseEntity::getDeleted, 0)
+                .eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
+    }
 }

+ 8 - 1
sql/update_sql.sql

@@ -427,4 +427,11 @@ CREATE TABLE `business_production_choice_log`
   AUTO_INCREMENT = 3
   CHARACTER SET = utf8mb4
   COLLATE = utf8mb4_general_ci COMMENT = '产品选择记录'
-  ROW_FORMAT = Dynamic;
+  ROW_FORMAT = Dynamic;
+
+/**
+  日期:2024-05-16
+  修改人:苟耕铨
+ */
+# 选择记录表新增字段
+ALTER TABLE business_production_choice_log ADD COLUMN production_id bigint(20) NULL COMMENT '产品id';