Explorar o código

1.资产业务-新增接口-根据业务id获取已选择产品
2.资产业务-修改接口-资产产品表更新
3.资产业务-流程-新增CONSULT
4.资产业务-产品-取号开发(进行中)

GouGengquan hai 1 ano
pai
achega
02e9e294db

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

@@ -76,7 +76,7 @@ public class AssetsProductionController extends BaseController {
     /**
      * 资产产品表更新
      */
-    @PutMapping("")
+    @PutMapping("/update")
     public RestResponse<Boolean> update(@RequestBody AssetsProduction assetsProduction) {
         Boolean ret = assetsProductionService.update(assetsProduction);
         return RestResponse.data(ret);
@@ -101,5 +101,15 @@ public class AssetsProductionController extends BaseController {
         return RestResponse.data(assetsProductionService.getProductionTypes(id));
     }
 
+    /**
+     * 根据业务id获取已选择产品
+     * @param businessId 资产业务id
+     * @return AssetsProduction
+     */
+    @GetMapping("/getProductionByBusinessId/{businessId}")
+    public RestResponse<AssetsProduction> getProductionByBusinessId(@PathVariable Long businessId) {
+        return RestResponse.data(assetsProductionService.getProductionByBusinessId(businessId));
+    }
+
 }
 

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

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.AssetsSelectDTO;
 import com.dayou.entity.Assets;
 import com.dayou.dao.CustomBaseMapper;
-import com.dayou.entity.User;
+import com.dayou.entity.BusinessNumber;
 import com.dayou.vo.AssetsOrderFundInvoiceVO;
 import com.dayou.vo.AssetsVO;
 import org.apache.ibatis.annotations.Param;
@@ -48,4 +48,12 @@ public interface AssetsMapper extends CustomBaseMapper<Assets> {
      * @return AssetsOrderFundInvoiceVO
      */
     AssetsOrderFundInvoiceVO getOrderFundInvoiceById(@Param("id") Long id);
+
+    /**
+     * 根据业务类型与取号类型获取业务取号信息
+     * @param takeType 取号类型
+     * @param businessType 业务类型
+     * @return BusinessNumber
+     */
+    BusinessNumber getBusinessNum(@Param("takeType") String takeType, @Param("businessType") String businessType, @Param("year") Integer year);
 }

+ 7 - 0
dao/src/main/java/com/dayou/mapper/AssetsProductionMapper.java

@@ -23,4 +23,11 @@ public interface AssetsProductionMapper extends CustomBaseMapper<AssetsProductio
      */
     List<String> getProductionTypes(@Param("businessId") Long businessId);
 
+    /**
+     * 根据业务id获取已选择产品
+     * @param businessId 资产业务id
+     * @return AssetsProduction
+     */
+    AssetsProduction getProductionByBusinessId(@Param("businessId") Long businessId);
+
 }

+ 10 - 0
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -267,4 +267,14 @@
         AND order_fund.deleted = 0
     </select>
 
+    <!--根据业务类型与取号类型获取业务取号信息-->
+    <select id="getBusinessNum" resultType="com.dayou.entity.BusinessNumber">
+        SELECT year, month, next_no
+        FROM business_number
+        WHERE take_type = #{takeType}
+        AND business_type = #{businessType}
+        AND year = #{year}
+        AND deleted = 0
+    </select>
+
 </mapper>

+ 9 - 0
dao/src/main/resources/mapper/AssetsProductionMapper.xml

@@ -44,6 +44,15 @@
         SELECT production_type
         FROM assets_production
         WHERE business_id = #{businessId}
+        AND deleted = 0
+    </select>
+
+    <!--根据业务id获取已选择产品-->
+    <select id="getProductionByBusinessId" resultType="com.dayou.entity.AssetsProduction">
+        SELECT id, production_type, print_count
+        FROM assets_production
+        WHERE business_id = #{businessId}
+          AND deleted = 0
     </select>
 
 </mapper>

+ 23 - 0
domain/src/main/java/com/dayou/dto/TakeAssetsProductionNoDTO.java

@@ -0,0 +1,23 @@
+package com.dayou.dto;
+
+import lombok.Data;
+
+@Data
+public class TakeAssetsProductionNoDTO {
+
+    /**
+     * 资产业务id
+     */
+    private Long businessId;
+
+    /**
+     * 产品类型
+     */
+    private String productionType;
+
+    /**
+     * 选择全部评估对象
+     */
+    private Boolean selectAll;
+
+}

+ 2 - 0
domain/src/main/java/com/dayou/enums/ProductionEnum.java

@@ -17,6 +17,8 @@ public enum ProductionEnum implements CodeMsgEnumInterface<String,String>{
 
     FINAL("FINAL","结果报告"),
 
+    CONSULT("CONSULT","咨询报告"),
+
     NONE("NONE","NONE")
     ;
 

+ 9 - 2
domain/src/main/java/com/dayou/enums/workflow/CallbackEnum.java

@@ -121,11 +121,18 @@ public enum CallbackEnum {
             report.setNecessaryNodes(workflowNodeEnums1);
             this.necessaryNodes.add(report);
 
+            //报告在校验产品类型时节点
+            NecessaryNode consult = new NecessaryNode();
+            report.setProduction(ProductionEnum.CONSULT);
+            WorkflowNodeEnum[] workflowNodeEnums2 = {WRITE_REPORT, CHECK_REPORT,RECHECK_REPORT,FOURTH_CHECK_REPORT,REPORT_BOOKBINDING_STAMP,REPORT_IN,REPORT_OUT,CHECK_ARCHIVING,RECHECK_ARCHIVING,BUSINESS_ARCHIVING};
+            report.setNecessaryNodes(workflowNodeEnums1);
+            this.necessaryNodes.add(consult);
+
             //意见函在校验产品类型时的节点
             NecessaryNode letter = new NecessaryNode();
             letter.setProduction(ProductionEnum.LETTER);
-            WorkflowNodeEnum[] workflowNodeEnums2 = {WRITE_REPORT, CHECK_REPORT,RECHECK_REPORT,FOURTH_CHECK_REPORT,REPORT_BOOKBINDING_STAMP,REPORT_IN,REPORT_OUT,CHECK_ARCHIVING,RECHECK_ARCHIVING,BUSINESS_ARCHIVING};
-            letter.setNecessaryNodes(workflowNodeEnums2);
+            WorkflowNodeEnum[] workflowNodeEnums3 = {WRITE_REPORT, CHECK_REPORT,RECHECK_REPORT,FOURTH_CHECK_REPORT,REPORT_BOOKBINDING_STAMP,REPORT_IN,REPORT_OUT,CHECK_ARCHIVING,RECHECK_ARCHIVING,BUSINESS_ARCHIVING};
+            letter.setNecessaryNodes(workflowNodeEnums3);
             this.necessaryNodes.add(letter);
         }
     }

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

@@ -43,4 +43,11 @@ public interface IAssetsProductionService extends IService<AssetsProduction> {
          */
         List<String> getProductionTypes(Long businessId);
 
+        /**
+         * 根据业务id获取已选择产品
+         * @param businessId 资产业务id
+         * @return AssetsProduction
+         */
+        AssetsProduction getProductionByBusinessId(Long businessId);
+
 }

+ 8 - 4
service/src/main/java/com/dayou/service/IAssetsService.java

@@ -1,8 +1,5 @@
 package com.dayou.service;
-import com.dayou.dto.AssetsPrincipalMembersDTO;
-import com.dayou.dto.AssetsSelectDTO;
-import com.dayou.dto.TaskRecordDTO;
-import com.dayou.dto.WorkNodeCommit;
+import com.dayou.dto.*;
 import com.dayou.entity.Assets;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -67,4 +64,11 @@ public interface IAssetsService extends IService<Assets> {
 
         Boolean delete(Long id);
 
+        /**
+         * 资产业务产品取号
+         * @param takeAssetsProductionNoDTO 取号dto
+         * @return String
+         */
+        String takeAssetsProductionNo(TakeAssetsProductionNoDTO takeAssetsProductionNoDTO);
+
 }

+ 10 - 0
service/src/main/java/com/dayou/service/impl/AssetsProductionServiceImpl.java

@@ -90,4 +90,14 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
     public List<String> getProductionTypes(Long businessId) {
         return assetsProductionMapper.getProductionTypes(businessId);
     }
+
+    /**
+     * 根据业务id获取已选择产品
+     * @param businessId 资产业务id
+     * @return AssetsProduction
+     */
+    @Override
+    public AssetsProduction getProductionByBusinessId(Long businessId) {
+        return assetsProductionMapper.getProductionByBusinessId(businessId);
+    }
 }

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

@@ -2,26 +2,28 @@ package com.dayou.service.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.dayou.common.BaseEntity;
-import com.dayou.dto.AssetsPrincipalMembersDTO;
-import com.dayou.dto.AssetsSelectDTO;
-import com.dayou.dto.TaskRecordDTO;
-import com.dayou.dto.WorkNodeCommit;
+import com.dayou.dto.*;
 import com.dayou.entity.Assets;
-import com.dayou.enums.MainBusinessEnum;
+import com.dayou.entity.BusinessNumber;
 import com.dayou.exception.ErrorCode;
 import com.dayou.mapper.AssetsMapper;
+import com.dayou.mapper.BusinessNumberMapper;
 import com.dayou.service.IAssetsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.service.IBusinessNumberService;
 import com.dayou.service.workflow.IWorkFlowService;
 import com.dayou.vo.AssetsOrderFundInvoiceVO;
 import com.dayou.vo.AssetsVO;
-import com.dayou.workflow.annotation.FinishTask;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 
+import java.util.Calendar;
+
+import static com.dayou.enums.MainBusinessEnum.ASSET_BUSINESS;
+import static com.dayou.enums.ProductionEnum.*;
+
 /**
  * <p>
  * 资产业务订单表 服务实现类
@@ -42,6 +44,9 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
     @Autowired
     private AssetsMapper assetsMapper;
 
+    @Autowired
+    private BusinessNumberMapper businessNumberMapper;
+
     /**
      * 条件查询资产任务列表
      * @param page 分页条件
@@ -88,7 +93,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
         //新增订单信息
         this.save(assets);
         //发起流程
-        return workFlowService.openingOrder(MainBusinessEnum.ASSET_BUSINESS,assets.getId(),null,assets.getRemark());
+        return workFlowService.openingOrder(ASSET_BUSINESS,assets.getId(),null,assets.getRemark());
     }
 
     /**
@@ -126,4 +131,37 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
         //逻辑删除
         return this.removeById(id);
     }
+
+    /**
+     * 资产业务产品取号
+     * @param takeAssetsProductionNoDTO 取号dto
+     * @return String
+     */
+    @Override
+    public String takeAssetsProductionNo(TakeAssetsProductionNoDTO takeAssetsProductionNoDTO) {
+        Calendar calendar = Calendar.getInstance();
+        int nowYear = calendar.get(Calendar.YEAR);
+        String productionNo = "(" + nowYear +")";;
+        //取号产品为意见书
+        if (takeAssetsProductionNoDTO.getProductionType().equals(STATEMENT.getCode())){
+            //获取取号信息
+            BusinessNumber businessNumber = assetsMapper.getBusinessNum(STATEMENT.getCode() + "_NUMBER", ASSET_BUSINESS.getCode(), nowYear);
+            productionNo = "川友预报字" + productionNo;
+        } else if (takeAssetsProductionNoDTO.getProductionType().equals(REPORT.getCode())) { //取号产品为评估报告
+            productionNo = "川友评报字" + productionNo;;
+        } else if (takeAssetsProductionNoDTO.getProductionType().equals(CONSULT.getCode())) { //取号产品为咨询报告
+            productionNo = "川友咨报字" + productionNo;;
+        }else if (takeAssetsProductionNoDTO.getProductionType().equals(LETTER.getCode())) { //取号产品为意见函
+            productionNo = "川友字" + productionNo;;
+        }
+        return productionNo;
+    }
+
+    public BusinessNumber addBusinessNumber(String takeType, String businessType, Integer year){
+        BusinessNumber businessNumber = new BusinessNumber();
+        businessNumber.setTakeType(takeType);
+        businessNumber.setBusinessType(businessType);
+        businessNumber.setYear(year);
+        return null;
+    }
 }

+ 8 - 1
sql/update_sql.sql

@@ -257,4 +257,11 @@ ALTER TABLE assets_production MODIFY COLUMN create_production_date date NULL com
   日期:2024-04-11
   修改人:苟耕铨
  */
-ALTER TABLE assets_production MODIFY COLUMN production_no VARCHAR(128) NULL comment '产品出具日期';
+ALTER TABLE assets_production MODIFY COLUMN production_no VARCHAR(128) NULL comment '产品出具日期';
+
+/**
+  日期:2024-04-12
+  修改人:苟耕铨
+ */
+ # 修改注释
+ALTER TABLE assets_production MODIFY COLUMN production_no VARCHAR(128) NULL comment '产品号';