Browse Source

1.资产业务-我的订单接口返回内容新增
2.新增接口产品退回流程发起、退产品申请分页查询与导出
3.新增产品退回流程
4.调整文件上传大小限制到100MB

GouGengquan 3 months ago
parent
commit
36c5031d03

+ 29 - 8
biz-base/src/main/java/com/dayou/controller/ProductionReturnController.java

@@ -1,5 +1,8 @@
 package com.dayou.controller;
 package com.dayou.controller;
 
 
+import com.dayou.dto.ProductionReturnSelectDTO;
+import com.dayou.dto.WorkNodeCommit;
+import com.dayou.vo.ProductionReturnVO;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -16,11 +19,16 @@ import com.dayou.common.PullDownModel;
 import com.dayou.utils.ConvertUtil;
 import com.dayou.utils.ConvertUtil;
 import com.dayou.utils.HttpKit;
 import com.dayou.utils.HttpKit;
 import com.dayou.exception.ErrorCode;
 import com.dayou.exception.ErrorCode;
+
+import java.io.IOException;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+
 /**
 /**
  * 产品退回申请表
  * 产品退回申请表
  *
  *
@@ -35,15 +43,28 @@ public class ProductionReturnController extends BaseController {
     private IProductionReturnService productionReturnService;
     private IProductionReturnService productionReturnService;
 
 
     /**
     /**
-    * 产品退回申请表列表
-    */
-    @GetMapping("")
-    public RestResponse<Page<ProductionReturn>> page(ProductionReturn productionReturn, Page page){
-        Page<ProductionReturn> pages=productionReturnService.selectPage(page,productionReturn);
+     * 分页查询产品退回申请
+     * @param page 分页
+     * @param dto 查询条件
+     * @return Page<ProductionReturnVO>
+     */
+    @GetMapping("/page")
+    public RestResponse<Page<ProductionReturnVO>> page(Page page, ProductionReturnSelectDTO dto){
+        Page<ProductionReturnVO> pages=productionReturnService.selectPage(page,dto);
         return RestResponse.data(pages);
         return RestResponse.data(pages);
     }
     }
 
 
     /**
     /**
+     * 导出产品退回申请
+     * @param dto 查询条件
+     */
+    @GetMapping("/export")
+    public void exportList(ProductionReturnSelectDTO dto, HttpServletResponse response) throws IOException {
+        List<ProductionReturnVO> productionReturnVOList = productionReturnService.exportList(dto);
+        exportPlus(response, "产品退回申请",productionReturnVOList, ProductionReturnVO.class);
+    }
+
+    /**
      * 产品退回申请表详情
      * 产品退回申请表详情
      */
      */
     @GetMapping("/{id}")
     @GetMapping("/{id}")
@@ -55,9 +76,9 @@ public class ProductionReturnController extends BaseController {
     /**
     /**
      * 产品退回申请表新增
      * 产品退回申请表新增
      */
      */
-    @PostMapping("")
-    public RestResponse<Boolean> save(@RequestBody ProductionReturn productionReturn) {
-        Boolean ret = productionReturnService.add(productionReturn);
+    @PostMapping("/save")
+    public RestResponse<WorkNodeCommit> save(@RequestBody ProductionReturn productionReturn) {
+        WorkNodeCommit ret = productionReturnService.add(productionReturn);
         return RestResponse.data(ret);
         return RestResponse.data(ret);
     }
     }
 
 

+ 1 - 1
biz-base/src/main/resources/application.yml

@@ -22,7 +22,7 @@ spring:
 
 
   servlet:
   servlet:
     multipart:
     multipart:
-      maxFileSize: 50MB  #单位必须大写MB或不写(即为B)
+      maxFileSize: 100MB  #单位必须大写MB或不写(即为B)
       maxRequestSize: 100MB
       maxRequestSize: 100MB
 
 
 
 

+ 22 - 0
dao/src/main/java/com/dayou/mapper/ProductionReturnMapper.java

@@ -1,7 +1,13 @@
 package com.dayou.mapper;
 package com.dayou.mapper;
 
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.dayou.dto.ProductionReturnSelectDTO;
 import com.dayou.entity.ProductionReturn;
 import com.dayou.entity.ProductionReturn;
 import com.dayou.dao.CustomBaseMapper;
 import com.dayou.dao.CustomBaseMapper;
+import com.dayou.vo.ProductionReturnVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
  * <p>
  * <p>
@@ -13,4 +19,20 @@ import com.dayou.dao.CustomBaseMapper;
  */
  */
 public interface ProductionReturnMapper extends CustomBaseMapper<ProductionReturn> {
 public interface ProductionReturnMapper extends CustomBaseMapper<ProductionReturn> {
 
 
+    /**
+     * 分页查询产品申请
+     * @param page 分页
+     * @param dto 查询条件
+     * @return Page<ProductionReturnVO>
+     */
+    Page<ProductionReturnVO> selectPage(@Param("page") Page page, @Param("dto") ProductionReturnSelectDTO dto);
+
+
+    /**
+     * 导出产品申请
+     * @param dto 查询条件
+     * @return Page<ProductionReturnVO>
+     */
+    List<ProductionReturnVO> exportList(@Param("dto") ProductionReturnSelectDTO dto);
+
 }
 }

+ 3 - 1
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -211,6 +211,8 @@
         reportInfo.repertory_state AS reportRepertoryState,
         reportInfo.repertory_state AS reportRepertoryState,
         reportInfo.delivery AS reportDelivery,
         reportInfo.delivery AS reportDelivery,
         reportInfo.assets_name AS reportName,
         reportInfo.assets_name AS reportName,
+        reportInfo.production_type AS reportType,
+        reportInfo.id AS reportId,
         clientele_id,
         clientele_id,
         customer.name AS customerName,
         customer.name AS customerName,
         bailor,
         bailor,
@@ -268,7 +270,7 @@
         AND nodeInstance.business_type = 'ASSET_BUSINESS'
         AND nodeInstance.business_type = 'ASSET_BUSINESS'
         ) AS nodeInfo ON nodeInfo.businessId = assets.id
         ) AS nodeInfo ON nodeInfo.businessId = assets.id
         # 2025年1月1日之前下的订单都是老OA系统订单,查询方式不一样
         # 2025年1月1日之前下的订单都是老OA系统订单,查询方式不一样
-        LEFT JOIN(SELECT business_id, production_no,repertory_state,production_type,delivery,assets_name FROM assets_production) AS reportInfo ON IF(assets.created &lt; '2025-01-01', reportInfo.business_id = assets.id AND reportInfo.production_type != 'STATEMENT',reportInfo.production_no = nodeInfo.business_min_id)
+        LEFT JOIN(SELECT id, business_id, production_no,repertory_state,production_type,delivery,assets_name FROM assets_production) AS reportInfo ON IF(assets.created &lt; '2025-01-01', reportInfo.business_id = assets.id AND reportInfo.production_type != 'STATEMENT',reportInfo.production_no = nodeInfo.business_min_id)
         LEFT JOIN production_fund AS pFund ON pFund.order_fund_id = fund.id AND pFund.production_no = reportInfo.production_no
         LEFT JOIN production_fund AS pFund ON pFund.order_fund_id = fund.id AND pFund.production_no = reportInfo.production_no
         WHERE assets.deleted = 0
         WHERE assets.deleted = 0
         AND assets.client_manager_id = #{assetsSelectDTO.clientManagerId}
         AND assets.client_manager_id = #{assetsSelectDTO.clientManagerId}

+ 41 - 0
dao/src/main/resources/mapper/ProductionReturnMapper.xml

@@ -32,4 +32,45 @@
         business_type, business_id, production_id, clinet_manager_id, name, order_id, production_no, production_type, client_name, client_sub_name, bailor, return_reason, status
         business_type, business_id, production_id, clinet_manager_id, name, order_id, production_no, production_type, client_name, client_sub_name, bailor, return_reason, status
     </sql>
     </sql>
 
 
+    <sql id="productionReturnVOSql">
+        SELECT production_return.id AS id,
+               business_type AS businessType,
+               production_return.name AS name,
+               order_id AS orderId,
+               production_no AS productionNo,
+               production_type AS productionType,
+               user.name AS clientManager,
+               client_name AS clientName,
+               client_sub_name AS clientSubName,
+               bailor AS bailor,
+               return_reason AS returnReason,
+               return_invoice AS returnInvoice,
+               status
+        FROM production_return
+        LEFT JOIN user ON user.id = clinet_manager_id
+        WHERE production_return.deleted = 0
+        <if test="dto != null and dto.businessType != null and dto.businessType != ''">
+            AND production_return.business_type = #{dto.businessType}
+        </if>
+        <if test="dto != null and dto.keyWord != null and dto.keyWord != ''">
+            AND (`order`.order_id LIKE CONCAT('%', #{dto.keyWord},'%') OR pFund.production_no LIKE CONCAT('%', #{dto.keyWord},'%'))
+        </if>
+        <if test="dto != null and dto.clientManagerName != null and dto.clientManagerName != ''">
+            AND user.name = #{dto.clientManagerName}
+        </if>
+        <if test="dto != null and dto.bailor != null and dto.bailor != ''">
+            AND bailor = #{dto.bailor}
+        </if>
+    </sql>
+
+    <!--分页查询产品申请-->
+    <select id="selectPage" resultType="com.dayou.vo.ProductionReturnVO">
+        <include refid="productionReturnVOSql" />
+    </select>
+
+    <!--导出产品申请-->
+    <select id="exportList" resultType="com.dayou.vo.ProductionReturnVO">
+        <include refid="productionReturnVOSql" />
+    </select>
+
 </mapper>
 </mapper>

+ 28 - 0
domain/src/main/java/com/dayou/dto/ProductionReturnSelectDTO.java

@@ -0,0 +1,28 @@
+package com.dayou.dto;
+
+import lombok.Data;
+
+@Data
+public class ProductionReturnSelectDTO {
+
+    /**
+     * 业务类型
+     */
+    private String businessType;
+
+    /**
+     * 关键字(项⽬编号或产品号)
+     */
+    private String keyWord;
+
+    /**
+     * 客户经理
+     */
+    private String clientManagerName;
+
+    /**
+     * 委托方
+     */
+    private String bailor;
+
+}

+ 2 - 1
domain/src/main/java/com/dayou/enums/MainBusinessEnum.java

@@ -41,7 +41,8 @@ public enum MainBusinessEnum implements CodeMsgEnumInterface<String,String> {
 
 
     ASSETS_ORDER("ASSETS_ORDER","资产订单"),
     ASSETS_ORDER("ASSETS_ORDER","资产订单"),
 
 
-    FINANCE_INVOICE("FINANCE_INVOICE","财务开票")
+    FINANCE_INVOICE("FINANCE_INVOICE","财务开票"),
+    PRODUCTION_RETURN("PRODUCTION_RETURN","产品退回")
     ;
     ;
 
 
    MainBusinessEnum(String code, String name) {
    MainBusinessEnum(String code, String name) {

+ 30 - 0
domain/src/main/java/com/dayou/enums/ProductionReturnStatus.java

@@ -0,0 +1,30 @@
+package com.dayou.enums;
+
+/**
+ * 产品退回流程审核状态
+ */
+public enum ProductionReturnStatus {
+
+    REVIEWING("审核中","REVIEWING"),
+    APPROVE("审核通过","APPROVE"),
+    REJECTION("审核拒绝","REJECTION"),
+    ;
+
+    private String name;
+
+    private String code;
+
+    ProductionReturnStatus(String name, String code) {
+        this.name = name;
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+}

+ 4 - 1
domain/src/main/java/com/dayou/enums/workflow/WorkflowNodeEnum.java

@@ -81,7 +81,10 @@ public enum WorkflowNodeEnum implements CodeMsgEnumInterface<String,String>{
 
 
         COMMIT_ARCHIVING("提交归档","COMMIT_ARCHIVING"),
         COMMIT_ARCHIVING("提交归档","COMMIT_ARCHIVING"),
 
 
-        LEADER_ALLOCATION("分管领导分单","LEADER_ALLOCATION")
+        LEADER_ALLOCATION("分管领导分单","LEADER_ALLOCATION"),
+
+        FINANCIAL_CONFIRM("财务确认", "FINANCIAL_CONFIRM"),
+        TERMINATE_BUSINESS_WORKFLOW("终止业务流程", "TERMINATE_BUSINESS_WORKFLOW")
 
 
         ;
         ;
 
 

+ 10 - 0
domain/src/main/java/com/dayou/vo/AssetsVO.java

@@ -165,6 +165,16 @@ public class AssetsVO extends Assets {
     private String productionType;
     private String productionType;
 
 
     /**
     /**
+     * 报告类型(不包含预评产品)
+     */
+    private String reportType;
+
+    /**
+     * 报告主键id(不包含预评产品)
+     */
+    private Long reportId;
+
+    /**
      * 订单收款id
      * 订单收款id
      */
      */
     private Long orderFundId;
     private Long orderFundId;

+ 86 - 0
domain/src/main/java/com/dayou/vo/ProductionReturnVO.java

@@ -0,0 +1,86 @@
+package com.dayou.vo;
+
+import com.dayou.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class ProductionReturnVO {
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 业务类型
+     */
+    @Excel(name = "业务类型", readConverterExp = "MAJOR_BUSINESS=大中型业务,PERSONAL_BUSINESS=个贷业务,ASSET_BUSINESS=资产业务")
+    private String businessType;
+
+    /**
+     * 项目名称
+     */
+    @Excel(name = "项目名称")
+    private String name;
+
+    /**
+     * 项目编号
+     */
+    @Excel(name = "项目编号")
+    private String orderId;
+
+    /**
+     * 产品编号
+     */
+    @Excel(name = "产品编号")
+    private String productionNo;
+
+    /**
+     * 产品类型
+     */
+    @Excel(name = "产品类型")
+    private String productionType;
+
+    /**
+     * 客户经理
+     */
+    @Excel(name = "客户经理")
+    private String clientManager;
+
+    /**
+     * 客户名称
+     */
+    @Excel(name = "客户名称")
+    private String clientName;
+
+    /**
+     * 业务来源
+     */
+    @Excel(name = "业务来源")
+    private String clientSubName;
+
+    /**
+     * 委托人
+     */
+    @Excel(name = "委托人")
+    private String bailor;
+
+    /**
+     * 退产品原因
+     */
+    @Excel(name = "退产品原因")
+    private String returnReason;
+
+    /**
+     * 是否包含退发票
+     */
+    @Excel(name = "是否包含退发票")
+    private Boolean returnInvoice;
+
+    /**
+     * 审核中、审核通过、审核拒绝 (用代码中的枚举code)
+     */
+    @Excel(name = "审核状态", readConverterExp = "REVIEWING=审核中,APPROVE=审核通过,REJECTION=审核拒绝")
+    private String status;
+
+}

+ 26 - 2
service/src/main/java/com/dayou/service/IProductionReturnService.java

@@ -1,10 +1,16 @@
 package com.dayou.service;
 package com.dayou.service;
+import com.dayou.dto.ProductionReturnSelectDTO;
+import com.dayou.dto.WorkNodeCommit;
 import com.dayou.entity.ProductionReturn;
 import com.dayou.entity.ProductionReturn;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.dayou.vo.ProductionReturnVO;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
 /**
 /**
  * <p>
  * <p>
  * 产品退回申请表 服务类
  * 产品退回申请表 服务类
@@ -15,11 +21,29 @@ import org.springframework.web.multipart.MultipartFile;
  */
  */
 public interface IProductionReturnService extends IService<ProductionReturn> {
 public interface IProductionReturnService extends IService<ProductionReturn> {
 
 
-        Page<ProductionReturn> selectPage(Page page,ProductionReturn productionReturn);
+        /**
+         * 分页查询产品退回申请
+         * @param page 分页
+         * @param dto 查询条件
+         * @return Page<ProductionReturnVO>
+         */
+        Page<ProductionReturnVO> selectPage(Page page, ProductionReturnSelectDTO dto);
+
+        /**
+         * 导出产品退回申请
+         * @param dto 查询条件
+         * @return Page<ProductionReturnVO>
+         */
+        List<ProductionReturnVO> exportList(ProductionReturnSelectDTO dto);
 
 
         ProductionReturn detail(Long id);
         ProductionReturn detail(Long id);
 
 
-        Boolean add(ProductionReturn productionReturn);
+        /**
+         * 发起产品退回流程
+         * @param productionReturn 产品退回信息
+         * @return WorkNodeCommit
+         */
+        WorkNodeCommit add(ProductionReturn productionReturn);
 
 
         Boolean update(ProductionReturn productionReturn);
         Boolean update(ProductionReturn productionReturn);
 
 

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

@@ -242,7 +242,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
         this.save(assets);
         this.save(assets);
         //新增订单收款信息
         //新增订单收款信息
         OrderFund orderFund = new OrderFund();
         OrderFund orderFund = new OrderFund();
-        orderFund.setBusinessType("ASSET_BUSINESS");
+        orderFund.setBusinessType(ASSET_BUSINESS.getCode());
         orderFund.setBusinessId(assets.getId());
         orderFund.setBusinessId(assets.getId());
         orderFund.setOrderName(assets.getName());
         orderFund.setOrderName(assets.getName());
         orderFund.setOrderId(assets.getOrderId());
         orderFund.setOrderId(assets.getOrderId());

+ 42 - 5
service/src/main/java/com/dayou/service/impl/ProductionReturnServiceImpl.java

@@ -1,9 +1,16 @@
 package com.dayou.service.impl;
 package com.dayou.service.impl;
 
 
+import com.dayou.dto.ProductionReturnSelectDTO;
+import com.dayou.dto.WorkNodeCommit;
 import com.dayou.entity.ProductionReturn;
 import com.dayou.entity.ProductionReturn;
+import com.dayou.enums.workflow.NodeLogEnum;
 import com.dayou.mapper.ProductionReturnMapper;
 import com.dayou.mapper.ProductionReturnMapper;
 import com.dayou.service.IProductionReturnService;
 import com.dayou.service.IProductionReturnService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dayou.service.workflow.IWorkFlowService;
+import com.dayou.utils.LoginContext;
+import com.dayou.vo.ProductionReturnVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -24,6 +31,10 @@ import java.util.ArrayList;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 import com.dayou.enums.BatchTaskTypeEnum;
 import com.dayou.enums.BatchTaskTypeEnum;
 
 
+import static com.dayou.enums.MainBusinessEnum.ASSET_BUSINESS;
+import static com.dayou.enums.MainBusinessEnum.PRODUCTION_RETURN;
+import static com.dayou.enums.ProductionReturnStatus.REVIEWING;
+
 /**
 /**
  * <p>
  * <p>
  * 产品退回申请表 服务实现类
  * 产品退回申请表 服务实现类
@@ -35,11 +46,31 @@ import com.dayou.enums.BatchTaskTypeEnum;
 @Service
 @Service
 public class ProductionReturnServiceImpl extends ServiceImpl<ProductionReturnMapper, ProductionReturn> implements IProductionReturnService {
 public class ProductionReturnServiceImpl extends ServiceImpl<ProductionReturnMapper, ProductionReturn> implements IProductionReturnService {
 
 
+    @Autowired
+    private ProductionReturnMapper productionReturnMapper;
+
+    @Autowired
+    private IWorkFlowService workFlowService;
+
+    /**
+     * 分页查询产品退回申请
+     * @param page 分页
+     * @param dto 查询条件
+     * @return Page<ProductionReturnVO>
+     */
+    @Override
+    public Page<ProductionReturnVO> selectPage(Page page, ProductionReturnSelectDTO dto){
+        return productionReturnMapper.selectPage(page, dto);
+    }
 
 
+    /**
+     * 导出产品退回申请
+     * @param dto 查询条件
+     * @return Page<ProductionReturnVO>
+     */
     @Override
     @Override
-    @SuppressWarnings("unchecked")
-    public Page<ProductionReturn> selectPage(Page page,ProductionReturn productionReturn){
-        return this.page(page, new QueryWrapper<ProductionReturn>(productionReturn));
+    public List<ProductionReturnVO> exportList(ProductionReturnSelectDTO dto) {
+        return productionReturnMapper.exportList(dto);
     }
     }
 
 
 
 
@@ -49,8 +80,14 @@ public class ProductionReturnServiceImpl extends ServiceImpl<ProductionReturnMap
     }
     }
 
 
     @Override
     @Override
-    public Boolean add(ProductionReturn productionReturn){
-        return  this.save(productionReturn);
+    @Transactional(rollbackFor = Exception.class)
+    public WorkNodeCommit add(ProductionReturn productionReturn){
+        productionReturn.setBusinessType(ASSET_BUSINESS.getCode());
+        productionReturn.setClinetManagerId(LoginContext.getCurrentUserId());
+        productionReturn.setStatus(REVIEWING.getCode());
+        this.save(productionReturn);
+        // 发起退回流程
+        return workFlowService.openingOrder(PRODUCTION_RETURN, productionReturn.getId(), null, null);
     }
     }
 
 
     @Override
     @Override