Bladeren bron

1.资产列表查询返回收款信息
2.资产详情-款项信息优化

GouGengquan 2 maanden geleden
bovenliggende
commit
d28ad78b0b

+ 3 - 3
biz-base/src/main/java/com/dayou/controller/AssetsController.java

@@ -206,9 +206,9 @@ public class AssetsController extends BaseController {
      * @param id 业务id
      * @return RestResponse<AssetsOrderFundInvoiceVO>
      */
-    @GetMapping("/getOrderFundInvoiceById/{id}")
-    public RestResponse<AssetsOrderFundInvoiceVO> getOrderFundInvoiceById(@PathVariable Long id) {
-        return RestResponse.data(assetsService.getOrderFundInvoiceById(id));
+    @GetMapping("/getOrderFundInvoiceById/{id}/{productionNo}")
+    public RestResponse<AssetsOrderFundInvoiceVO> getOrderFundInvoiceById(@PathVariable Long id, @PathVariable String productionNo) {
+        return RestResponse.data(assetsService.getOrderFundInvoiceById(id, productionNo));
     }
 
     /**

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

@@ -95,11 +95,11 @@ public interface AssetsMapper extends CustomBaseMapper<Assets> {
     AssetsVO getAssetsDetailById(@Param("id") Long id);
 
     /**
-     * 根据业务id获取资产业务款项信息
+     * 根据业务id与产品号获取资产业务款项信息
      * @param id 业务id
      * @return AssetsOrderFundInvoiceVO
      */
-    AssetsOrderFundInvoiceVO getOrderFundInvoiceById(@Param("id") Long id);
+    AssetsOrderFundInvoiceVO getOrderFundInvoiceById(@Param("id") Long id, @Param("productionNo") String productionNo);
 
     /**
      * 根据业务类型与取号类型获取业务取号信息

+ 22 - 11
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -52,7 +52,7 @@
         nodeInfo.recordId AS id,
         assets.id AS assetsId,
         assets.name,
-        order_id,
+        assets.order_id,
         assets_business_gener,
         allot_type,
         statement.production_no AS statementNo,
@@ -77,7 +77,11 @@
         nodeInfo.handlerName,
         nodeInfo.currentNodeId,
         nodeInfo.recordId,
-        nodeInfo.handlerId
+        nodeInfo.handlerId,
+        pFund.id AS productionFundId,
+        pFund.standard_amount,
+        pFund.production_should_amount,
+        pFund.real_amount AS productionRealAmount
         FROM assets
         LEFT JOIN user ON user.id = assets.principal_id
         LEFT JOIN customer_company AS customer ON customer.id = assets.clientele_id
@@ -106,6 +110,8 @@
         ) AS nodeInfo ON nodeInfo.businessId = assets.id
         LEFT JOIN assets_production AS statement ON statement.deleted = 0 AND statement.production_no = nodeInfo.business_sub_id AND statement.business_id = nodeInfo.businessId
         LEFT JOIN assets_production AS report ON report.deleted = 0 AND report.production_no = nodeInfo.business_min_id AND report.business_id = nodeInfo.businessId
+        LEFT JOIN order_fund AS fund ON fund.business_id = assets.id AND business_type = 'ASSET_BUSINESS'
+        LEFT JOIN production_fund AS pFund ON pFund.order_fund_id = fund.id AND pFund.production_no = report.production_no
         <if test="assetsSelectDTO != null and assetsSelectDTO.selectByDepartment">
             INNER JOIN (
             SELECT DISTINCT
@@ -717,16 +723,21 @@
         </where>
     </select>
 
-    <!--根据业务id获取资产业务款项信息-->
+    <!--根据业务id与产品号获取资产业务款项信息-->
     <select id="getOrderFundInvoiceById" resultType="com.dayou.vo.AssetsOrderFundInvoiceVO">
-        SELECT order_fund.id,
-               business_id,
-               should_amount,
-               order_fund.real_amount
-        FROM order_fund
-        WHERE order_fund.business_id = #{id}
-          AND order_fund.deleted = 0
-          AND business_type = 'ASSET_BUSINESS'
+        SELECT fund.id AS orderFundId,
+               pFund.id AS productionFundId,
+               fund.business_id,
+               pFund.production_should_amount AS productionShouldAmount,
+               pFund.real_amount AS productionRealAmount,
+               pFund.standard_amount AS standardAmount
+        FROM order_fund AS fund, production_fund AS pFund
+        WHERE fund.id = pFund.order_fund_id
+          AND fund.business_id = #{id}
+          AND pFund.production_no = #{productionNo}
+          AND fund.deleted = 0
+          AND pFund.deleted = 0
+          AND fund.business_type = 'ASSET_BUSINESS'
     </select>
 
     <!--根据业务类型与取号类型获取业务取号信息-->

+ 20 - 5
domain/src/main/java/com/dayou/vo/AssetsOrderFundInvoiceVO.java

@@ -8,7 +8,7 @@ import java.math.BigDecimal;
 import java.util.List;
 
 @Data
-public class AssetsOrderFundInvoiceVO extends BaseEntity {
+public class AssetsOrderFundInvoiceVO {
 
     /**
      * 业务id
@@ -16,14 +16,29 @@ public class AssetsOrderFundInvoiceVO extends BaseEntity {
     private Long businessId;
 
     /**
-     * 订单收款
+     * 订单收款id
      */
-    private BigDecimal shouldAmount;
+    private Long orderFundId;
 
     /**
-     * 订单实收款
+     * 产品收款id
      */
-    private BigDecimal realAmount;
+    private Long productionFundId;
+
+    /**
+     * 产品应收款
+     */
+    private BigDecimal productionShouldAmount;
+
+    /**
+     * 产品实收款
+     */
+    private BigDecimal productionRealAmount;
+
+    /**
+     * 产品标准收费
+     */
+    private BigDecimal standardAmount;
 
     /**
      * 开票信息

+ 1 - 1
service/src/main/java/com/dayou/service/IAssetsService.java

@@ -118,7 +118,7 @@ public interface IAssetsService extends IService<Assets> {
          * @param id 业务id
          * @return AssetsOrderFundInvoiceVO
          */
-        AssetsOrderFundInvoiceVO getOrderFundInvoiceById(Long id);
+        AssetsOrderFundInvoiceVO getOrderFundInvoiceById(Long id, String productionNo);
 
         Boolean update(Assets assets);
 

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

@@ -105,7 +105,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
     @Override
     public Page<AssetsVO> selectPage(Page page, AssetsSelectDTO assetsSelectDTO) {
         // 判断是否要根据部门id集合查询(部门待办查询)
-        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByDepartment()) && assetsSelectDTO.getSelectByDepartment()){
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByDepartment()) && assetsSelectDTO.getSelectByDepartment()) {
             List<Long> depIds = new ArrayList<>();
             for (SimpleParentModel postModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
                 // 根据部门id获取部门及其下属部门的id
@@ -115,7 +115,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
             assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
         }
         // 判断是否要查询资产列表,资产列表只能查询包含本人及其所在部门的人员为项目负责人或客户经理的流程(资产列表查询)
-        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByAll()) && assetsSelectDTO.getSelectByAll()){
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByAll()) && assetsSelectDTO.getSelectByAll()) {
             List<Long> depIds = new ArrayList<>();
             for (SimpleParentModel depModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
                 // 根据部门id获取部门及其下属部门的id
@@ -132,7 +132,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
             assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
         }
         // 此处判断handlerId是否为空只是为了确保前端查询条件有handlerId,并不直接信任
-        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getHandlerId())){
+        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getHandlerId())) {
             assetsSelectDTO.setHandlerId(LoginContext.getCurrentUserId());
         }
         return assetsMapper.selectPage(page, assetsSelectDTO);
@@ -140,13 +140,14 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     /**
      * 条件导出资产任务列表
+     *
      * @param assetsSelectDTO 查询条件
      * @return Page<AssetsVO>
      */
     @Override
     public List<AssetsVO> exportPage(AssetsSelectDTO assetsSelectDTO) {
         // 判断是否要根据部门id集合查询(部门待办查询)
-        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByDepartment()) && assetsSelectDTO.getSelectByDepartment()){
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByDepartment()) && assetsSelectDTO.getSelectByDepartment()) {
             List<Long> depIds = new ArrayList<>();
             for (SimpleParentModel postModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
                 // 根据部门id获取部门及其下属部门的id
@@ -156,7 +157,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
             assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
         }
         // 判断是否要查询资产列表,资产列表只能查询包含本人及其所在部门的人员为项目负责人或项目经理的流程(资产列表查询)
-        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByAll()) && assetsSelectDTO.getSelectByAll()){
+        if (ObjectUtil.isNotNull(assetsSelectDTO.getSelectByAll()) && assetsSelectDTO.getSelectByAll()) {
             List<Long> depIds = new ArrayList<>();
             for (SimpleParentModel postModel : LoginContext.getLoginCacheUserBO().getDepartmentList()) {
                 // 根据部门id获取部门及其下属部门的id
@@ -166,7 +167,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
             assetsSelectDTO.setDepartmentIdList(depIds.stream().distinct().collect(Collectors.toList()));
         }
         // 此处判断handlerId是否为空只是为了确保前端查询条件有handlerId,并不直接信任
-        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getHandlerId())){
+        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getHandlerId())) {
             assetsSelectDTO.setHandlerId(LoginContext.getCurrentUserId());
         }
         return assetsMapper.exportPage(assetsSelectDTO);
@@ -182,7 +183,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
     @Override
     public Page<AssetsVO> selectMyOrderPage(Page page, AssetsSelectDTO assetsSelectDTO) {
         // 此处判断managerId是否为空只是为了确保前端查询条件有managerId,并不直接信任
-        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getClientManagerId())){
+        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getClientManagerId())) {
             assetsSelectDTO.setClientManagerId(LoginContext.getCurrentUserId());
         }
         return assetsMapper.selectMyOrderPage(page, assetsSelectDTO);
@@ -190,13 +191,14 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     /**
      * 导出我的任务订单列表
+     *
      * @param assetsSelectDTO 查询条件
      * @return Page<AssetsVO>
      */
     @Override
     public List<AssetsVO> exportMyOrder(AssetsSelectDTO assetsSelectDTO) {
         // 此处判断managerId是否为空只是为了确保前端查询条件有managerId,并不直接信任
-        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getClientManagerId())){
+        if (ObjectUtil.isNotNull(assetsSelectDTO) && ObjectUtil.isNotNull(assetsSelectDTO.getClientManagerId())) {
             assetsSelectDTO.setClientManagerId(LoginContext.getCurrentUserId());
         }
         return assetsMapper.exportMyOrder(assetsSelectDTO);
@@ -317,6 +319,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     /**
      * 修改资产业务订单项目成员
+     *
      * @param membersDTO 修改dto
      * @return Boolean
      */
@@ -330,16 +333,17 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
     }
 
     /**
-     * 根据业务id获取资产业务款项信息
+     * 根据业务id与产品号获取资产业务款项信息
      *
      * @param id 业务id
      * @return AssetsOrderFundInvoiceVO
      */
     @Override
-    public AssetsOrderFundInvoiceVO getOrderFundInvoiceById(Long id) {
-        AssetsOrderFundInvoiceVO assetsOrderFundInvoiceVO = assetsMapper.getOrderFundInvoiceById(id);
+    public AssetsOrderFundInvoiceVO getOrderFundInvoiceById(Long id, String productionNo) {
+        AssetsOrderFundInvoiceVO assetsOrderFundInvoiceVO = assetsMapper.getOrderFundInvoiceById(id, productionNo);
         assetsOrderFundInvoiceVO.setFinanceInvoiceVoList(financeInvoiceService.list(new LambdaQueryWrapper<FinanceInvoice>()
-                .eq(ObjectUtil.isNotNull(assetsOrderFundInvoiceVO.getId()),FinanceInvoice::getOrderFundId, assetsOrderFundInvoiceVO.getId())
+                .eq(FinanceInvoice::getOrderFundId, assetsOrderFundInvoiceVO.getOrderFundId())
+                .eq(FinanceInvoice::getProductionFundId, assetsOrderFundInvoiceVO.getProductionFundId())
                 .eq(BaseEntity::getDeleted, 0)));
         return assetsOrderFundInvoiceVO;
     }
@@ -420,7 +424,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
                             .eq(BusinessProductionChoiceLog::getBusinessId, dto.getBusinessId())
                             .eq(BusinessProductionChoiceLog::getTakeNoStatus, 0));
                     // 将未取号的评估对象对应的产品选择记录的产品id改为新的
-                    if (ObjectUtil.isNotNull(choiceLog)){
+                    if (ObjectUtil.isNotNull(choiceLog)) {
                         choiceLog.setProductionId(copyProductionInfo.getId());
                         // 获取后将选择记录对应的产品id改为前面新添加的产品信息
                         choiceLogList.add(choiceLog);
@@ -452,7 +456,8 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     /**
      * 生成资产产品号
-     *  资产Month没有特殊含义,就是进位,比如现在是0199,不管月份,下一位就是0200
+     * 资产Month没有特殊含义,就是进位,比如现在是0199,不管月份,下一位就是0200
+     *
      * @param takeAssetsProductionNoDTO 取号dto
      * @return String
      */
@@ -759,6 +764,7 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     /**
      * 获取资产市场下单部门
+     *
      * @return List<Department>
      */
     @Override
@@ -768,12 +774,12 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
 
     @Override
     public List<Assets> getMembersIsNull() {
-        return assetsMapper.selectList(new LambdaQueryWrapper<Assets>().select(BaseEntity::getId,Assets::getOrderId));
+        return assetsMapper.selectList(new LambdaQueryWrapper<Assets>().select(BaseEntity::getId, Assets::getOrderId));
     }
 
     @Override
     public void updateMembers(Assets assets) {
-        this.update(new LambdaUpdateWrapper<Assets>().eq(BaseEntity::getId,assets.getId()).set(Assets::getMembers,assets.getMembers()));
+        this.update(new LambdaUpdateWrapper<Assets>().eq(BaseEntity::getId, assets.getId()).set(Assets::getMembers, assets.getMembers()));
     }
 
     /**