Преглед на файлове

1.修改资产列表与我的订单表格查询语句
2.新增查询资产业务订单详情接口
3.新增获取资产业务评估对象接口
4.新增获取资产业务产品接口

GouGengquan преди 1 година
родител
ревизия
cd511d9755

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

@@ -62,10 +62,9 @@ public class AssetsController extends BaseController {
     /**
      * 资产业务订单表详情
      */
-    @GetMapping("/{id}")
-    public RestResponse<Assets> detail(@PathVariable Long id){
-        Assets xAssets =assetsService.detail(id);
-        return RestResponse.data(xAssets);
+    @GetMapping("getAssetsDetailById/{id}")
+    public RestResponse<AssetsVO> getAssetsDetailById(@PathVariable Long id){
+        return RestResponse.data(assetsService.getAssetsDetailById(id));
      }
 
     /**

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

@@ -34,6 +34,16 @@ public class AssetsEvaluationTargetController extends BaseController {
     private IAssetsEvaluationTargetService assetsEvaluationTargetService;
 
     /**
+     * 根据资产业务id获取资产业务评估对象集合
+     * @param id 资产业务id
+     * @return RestResponse<List<AssetsEvaluationTarget>>
+     */
+    @GetMapping("/getAETargetListByAssetsId/{id}")
+    public RestResponse<List<AssetsEvaluationTarget>> getAETargetListByAssetsId(@PathVariable Long id) {
+        return RestResponse.data(assetsEvaluationTargetService.getAETargetListByAssetsId(id));
+    }
+
+    /**
     * 资产评估对象表列表
     */
     @GetMapping("")

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

@@ -34,6 +34,16 @@ public class AssetsProductionController extends BaseController {
     private IAssetsProductionService assetsProductionService;
 
     /**
+     * 根据资产业务id查询资产业务产品
+     * @param id 资产业务id
+     * @return RestResponse<List<AssetsProduction>>
+     */
+    @GetMapping("getAroductionByAssetsId/{id}")
+    public RestResponse<List<AssetsProduction>> getAroductionByAssetsId(@PathVariable Long id) {
+        return RestResponse.data(assetsProductionService.getAroductionByAssetsId(id));
+    }
+
+    /**
     * 资产产品表列表
     */
     @GetMapping("")

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

@@ -32,4 +32,11 @@ public interface AssetsMapper extends CustomBaseMapper<Assets> {
      * @return Page<AssetsVO>
      */
     Page<AssetsVO> selectMyOrderPage(@Param("page") Page page, @Param("assetsSelectDTO") AssetsSelectDTO assetsSelectDTO);
+
+    /**
+     * 根据业务id获取资产业务详情
+     * @param id 业务id
+     * @return AssetsVO
+     */
+    AssetsVO getAssetsDetailById(@Param("id") Long id);
 }

+ 70 - 32
dao/src/main/resources/mapper/AssetsMapper.xml

@@ -51,6 +51,7 @@
         SELECT assets.id,
         assets.name,
         order_id,
+        assets_business_gener,
         allot_type,
         production_no,
         clientele_id,
@@ -65,13 +66,13 @@
         #查询业务来源(即子级客户)
         (SELECT customer_company.name
         FROM customer_company
-        WHERE customer_company.parent_id = clientele_id) AS customerSubName
-        FROM assets,
-        assets_production AS production,
-        user,
-        customer_company AS customer,
-        #查询当前进行的节点信息
-        (SELECT nodeInstance.id AS currentNodeId,
+        WHERE customer_company.id = clientele_sub_id) AS customerSubName
+        FROM assets
+        LEFT JOIN assets_production AS production ON production.business_id = assets.id
+        LEFT JOIN user ON user.id = assets.principal_id
+        LEFT JOIN customer_company AS customer ON customer.id = assets.clientele_id
+        #查询当前进行的节点信息(并使用左连接)
+        LEFT JOIN (SELECT nodeInstance.id AS currentNodeId,
         user.name AS handlerName,
         node.name AS currentNodeName,
         node.code AS currentNodeCode,
@@ -89,12 +90,8 @@
         <if test="assetsSelectDTO != null and assetsSelectDTO.nodeCode != null and assetsSelectDTO.nodeCode != '' ">
             AND node.`code` = #{assetsSelectDTO.nodeCode}
         </if>
-        ) AS nodeInfo
+        ) AS nodeInfo ON nodeInfo.businessId = assets.id
         WHERE assets.deleted = 0
-        AND nodeInfo.businessId = assets.id
-        AND production.business_id = assets.id
-        AND user.id = assets.principal_id
-        AND customer.id = assets.clientele_id
         #评估业务类别(业务类型)查询
         <if test="assetsSelectDTO != null and assetsSelectDTO.assetsBusinessGener != null and assetsSelectDTO.assetsBusinessGener != '' ">
             AND assets.assets_business_gener = #{assetsSelectDTO.assetsBusinessGener}
@@ -124,6 +121,7 @@
         SELECT assets.id,
         assets.name,
         assets.order_id,
+        assets_business_gener,
         allot_type,
         production.production_no,
         clientele_id,
@@ -145,17 +143,17 @@
         #查询业务来源(即子级客户)
         (SELECT customer_company.name
         FROM customer_company
-        WHERE customer_company.parent_id = clientele_id) AS customerSubName
-        FROM assets,
-        assets_production AS production,
-        user,
-        customer_company AS customer,
-        assets_evaluation_target AS target,
-        order_fund AS fund,
-        production_fund AS pFund,
-        finance_invoice AS invoice,
+        WHERE customer_company.id = clientele_sub_id) AS customerSubName
+        FROM assets
+        LEFT JOIN assets_production AS production ON production.business_id = assets.id
+        LEFT JOIN user ON user.id = assets.principal_id
+        LEFT JOIN customer_company AS customer ON customer.id = assets.clientele_id
+        LEFT JOIN assets_evaluation_target AS target ON target.assets_id = assets.id
+        LEFT JOIN order_fund AS fund ON fund.business_id = assets.id
+        LEFT JOIN production_fund AS pFund ON pFund.business_id = assets.id
+        LEFT JOIN finance_invoice AS invoice ON pFund.order_fund_id = fund.id
         #查询当前进行的节点信息
-        (SELECT nodeInstance.id AS currentNodeId,
+        LEFT JOIN (SELECT nodeInstance.id AS currentNodeId,
         user.name AS handlerName,
         node.name AS currentNodeName,
         node.code AS currentNodeCode,
@@ -169,17 +167,8 @@
         AND record.handler_id = user.id
         AND nodeInstance.deleted = 0
         AND record.instance_id = nodeInstance.id
-        ) AS nodeInfo
+        ) AS nodeInfo ON nodeInfo.businessId = assets.id
         WHERE assets.deleted = 0
-        AND nodeInfo.businessId = assets.id
-        AND production.business_id = assets.id
-        AND user.id = assets.principal_id
-        AND customer.id = assets.clientele_id
-        AND target.assets_id = assets.id
-        AND fund.business_id = assets.id
-        AND pFund.business_id = assets.id
-        AND pFund.order_fund_id = fund.id
-        AND invoice.order_fund_id = fund.id
         #送达状态查询
         <if test="assetsSelectDTO != null and assetsSelectDTO.delivery != null">
             AND production.delivery = #{assetsSelectDTO.delivery}
@@ -200,4 +189,53 @@
         ORDER BY assets.created DESC
     </select>
 
+    <!--根据业务id获取资产业务详情-->
+    <select id="getAssetsDetailById" resultType="com.dayou.vo.AssetsVO">
+        SELECT assets.id,
+               #查询客户经理
+               (SELECT name FROM user WHERE id = assets.client_manager_id) AS clientManagerName,
+               user.name AS principalName,
+               assets.department_id,
+               department.name,
+               assets.order_id,
+               assets.name,
+               assets.assets_business_gener,
+               assets.entrust_again,
+               assets.clientele_type,
+               customer.id AS customerId,
+               customer.name AS customerName,
+               linkman.id,
+               linkman.name,
+               linkman.department,
+               linkman.duty,
+               linkman.mobile,
+               assets.security,
+               assets.significant_assets_reorganization,
+               assets.state_assets,
+               assets.foreign_assets_involved,
+               assets.dispense_benefit,
+               assets.bailor,
+               assets.bailor_address,
+               assets.bailor_contact_name,
+               assets.bailor_contact_tel,
+               assets.terminal_clientele_id,
+               assets.remark,
+               tLinkman.id AS tLinkmanId,
+               tLinkman.name AS tLinkmanName,
+               tLinkman.mobile AS tLinkmanMobile,
+               assets.members AS members,
+               #查询终端客户名称
+               (SELECT customer_company.name FROM customer_company WHERE customer_company.id = assets.terminal_clientele_id) AS terminalClienteleName,
+               #查询业务来源(即子级客户)
+               (SELECT customer_company.name
+                FROM customer_company
+                WHERE customer_company.id = clientele_sub_id) AS customerSubName
+        FROM assets
+        LEFT JOIN user ON user.id = assets.principal_id
+        LEFT JOIN department ON department.id = assets.department_id
+        LEFT JOIN customer_company AS customer ON customer.id = assets.clientele_id
+        LEFT JOIN customer_linkman AS linkman ON linkman.id = assets.clientele_contact_id
+        LEFT JOIN (SELECT tLinkman.id, tLinkman.name, tLinkman.mobile FROM customer_linkman AS tLinkman) AS tLinkman ON tLinkman.id = assets.terminal_clientele_contact_id
+    </select>
+
 </mapper>

+ 12 - 0
domain/src/main/java/com/dayou/entity/AssetsEvaluationTarget.java

@@ -120,5 +120,17 @@ public class AssetsEvaluationTarget extends BaseEntity {
     @ExportCell(columnName = "资料路由信息")
     private String filePath;
 
+    /**
+     * 资产业务id
+     */
+    private Long assetsId;
+
+    /**
+     * 审核价格
+     */
+    @ImportCell
+    @ExportCell(columnName = "审核价格")
+    private Double checkValue;
+
 
 }

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

@@ -1,8 +1,11 @@
 package com.dayou.vo;
 
 import com.dayou.entity.Assets;
+import com.dayou.entity.User;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class AssetsVO extends Assets {
 
@@ -43,6 +46,11 @@ public class AssetsVO extends Assets {
     private String principalName;
 
     /**
+     * 客户id
+     */
+    private Long customerId;
+
+    /**
      * 客户名称
      */
     private String customerName;
@@ -82,5 +90,28 @@ public class AssetsVO extends Assets {
      */
     private Double invoiceRealAmount;
 
+    /**
+     * 终端客户联系人id
+     */
+    private Long tLinkmanId;
+
+    /**
+     * 终端客户联系人名
+     */
+    private String tLinkmanName;
 
+    /**
+     * 终端客户联系人联系方式
+     */
+    private String tLinkmanMobile;
+
+    /**
+     * 项目参与人(json数组)
+     */
+    private String members;
+
+    /**
+     * 项目参与人信息集合
+     */
+    private List<User> membersDetail;
 }

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

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
 /**
  * <p>
  * 资产评估对象表 服务类
@@ -15,6 +18,13 @@ import org.springframework.web.multipart.MultipartFile;
  */
 public interface IAssetsEvaluationTargetService extends IService<AssetsEvaluationTarget> {
 
+        /**
+         * 根据资产业务id获取资产业务评估对象集合
+         * @param id 资产业务id
+         * @return List<AssetsEvaluationTarget>
+         */
+        List<AssetsEvaluationTarget> getAETargetListByAssetsId(Long id);
+
         Page<AssetsEvaluationTarget> selectPage(Page page,AssetsEvaluationTarget assetsEvaluationTarget);
 
         AssetsEvaluationTarget detail(Long id);

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

@@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
 /**
  * <p>
  * 资产产品表 服务类
@@ -15,6 +18,13 @@ import org.springframework.web.multipart.MultipartFile;
  */
 public interface IAssetsProductionService extends IService<AssetsProduction> {
 
+        /**
+         * 根据资产业务id查询资产业务产品
+         * @param id 资产业务id
+         * @return List<AssetsProduction>
+         */
+        List<AssetsProduction> getAroductionByAssetsId(Long id);
+
         Page<AssetsProduction> selectPage(Page page,AssetsProduction assetsProduction);
 
         AssetsProduction detail(Long id);

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

@@ -34,7 +34,12 @@ public interface IAssetsService extends IService<Assets> {
          */
         Page<AssetsVO> selectMyOrderPage(Page page, AssetsSelectDTO assetsSelectDTO);
 
-        Assets detail(Long id);
+        /**
+         * 根据业务id获取资产业务详情
+         * @param id 业务id
+         * @return AssetsVO
+         */
+        AssetsVO getAssetsDetailById(Long id);
 
         /**
          * 新增资产业务订单

+ 11 - 14
service/src/main/java/com/dayou/service/impl/AssetsEvaluationTargetServiceImpl.java

@@ -1,28 +1,15 @@
 package com.dayou.service.impl;
 
+import com.dayou.common.BaseEntity;
 import com.dayou.entity.AssetsEvaluationTarget;
 import com.dayou.mapper.AssetsEvaluationTargetMapper;
 import com.dayou.service.IAssetsEvaluationTargetService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.dayou.utils.ExcelUtil;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.web.multipart.MultipartFile;
 import java.util.List;
-import java.util.ArrayList;
-import org.springframework.transaction.annotation.Transactional;
-import com.dayou.enums.BatchTaskTypeEnum;
 
 /**
  * <p>
@@ -36,6 +23,16 @@ import com.dayou.enums.BatchTaskTypeEnum;
 public class AssetsEvaluationTargetServiceImpl extends ServiceImpl<AssetsEvaluationTargetMapper, AssetsEvaluationTarget> implements IAssetsEvaluationTargetService {
 
 
+    /**
+     * 根据资产业务id获取资产业务评估对象集合
+     * @param id 资产业务id
+     * @return List<AssetsEvaluationTarget>
+     */
+    @Override
+    public List<AssetsEvaluationTarget> getAETargetListByAssetsId(Long id) {
+        return this.list((new LambdaQueryWrapper<AssetsEvaluationTarget>().eq(AssetsEvaluationTarget::getAssetsId,id)).orderByDesc(BaseEntity::getCreated));
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public Page<AssetsEvaluationTarget> selectPage(Page page,AssetsEvaluationTarget assetsEvaluationTarget){

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

@@ -36,6 +36,16 @@ import com.dayou.enums.BatchTaskTypeEnum;
 public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMapper, AssetsProduction> implements IAssetsProductionService {
 
 
+    /**
+     * 根据资产业务id查询资产业务产品
+     * @param id 资产业务id
+     * @return List<AssetsProduction>
+     */
+    @Override
+    public List<AssetsProduction> getAroductionByAssetsId(Long id) {
+        return this.list(new LambdaQueryWrapper<AssetsProduction>().eq(AssetsProduction::getBusinessId, id));
+    }
+
     @Override
     @SuppressWarnings("unchecked")
     public Page<AssetsProduction> selectPage(Page page,AssetsProduction assetsProduction){

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

@@ -1,5 +1,8 @@
 package com.dayou.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONArray;
 import com.dayou.dto.AssetsSelectDTO;
 import com.dayou.dto.WorkNodeCommit;
 import com.dayou.entity.Assets;
@@ -73,12 +76,20 @@ public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> impleme
         return assetsMapper.selectMyOrderPage(page, assetsSelectDTO);
     }
 
-
+    /**
+     * 根据业务id获取资产业务详情
+     * @param id 业务id
+     * @return AssetsVO
+     */
     @Override
-    public Assets detail(Long id){
-        return this.getById(id);
+    public AssetsVO getAssetsDetailById(Long id) {
+        AssetsVO assetsVO = assetsMapper.getAssetsDetailById(id);
+        //Json字符串转Long集合
+        JSONObject.parseArray(assetsVO.getMembers()).toJavaList(Long.class);
+        return assetsVO;
     }
 
+
     /**
      * 新增资产业务订单
      * @param assets 资产订单信息