Przeglądaj źródła

1.新增效率值相关个贷订单列表查询与导出接口
2.资产统计报表SQL与业务代码优化等

GouGengquan 11 miesięcy temu
rodzic
commit
42525d8705

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

@@ -159,7 +159,7 @@ public class AssetsStatisticalStatementController extends BaseController{
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
     @GetMapping("/evaluate/getAssetsEvaEffDetailVO")
-    public RestResponse<Page<AssetsEvaluateEfficiencyDetailVO>> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto) {
+    public RestResponse<Page<AssetsEfficiencyDetailVO>> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto) {
         return RestResponse.data(assetsStatisticalStatementService.getAssetsEvaEffDetailVO(page, dto));
     }
 
@@ -169,8 +169,8 @@ public class AssetsStatisticalStatementController extends BaseController{
      */
     @GetMapping("/evaluate/getAssetsEvaEffDetailVO/export")
     public void assetsEvaEffDetailVOExport(AssetsStatisticalSelectDTO dto, HttpServletResponse response) throws IOException {
-        List<AssetsEvaluateEfficiencyDetailVO> result = assetsStatisticalStatementService.assetsEvaEffDetailVOExport(dto);
-        exportPlus(response, "资产订单列表", result, AssetsEvaluateEfficiencyDetailVO.class);
+        List<AssetsEfficiencyDetailVO> result = assetsStatisticalStatementService.assetsEvaEffDetailVOExport(dto);
+        exportPlus(response, "资产订单列表", result, AssetsEfficiencyDetailVO.class);
     }
 
     /**

+ 26 - 1
biz-base/src/main/java/com/dayou/controller/PersonalStatisticalStatementController.java

@@ -1,19 +1,23 @@
 package com.dayou.controller;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.common.RestResponse;
 import com.dayou.dto.PersonalStatisticalSelectDTO;
 import com.dayou.service.IPersonalStatisticalStatementService;
 import com.dayou.vo.PersonalDepEfficiencyVO;
+import com.dayou.vo.PersonalEfficiencyDetailVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 import java.util.List;
 
 @RestController
 @RequestMapping("personal/statisticalStatement")
-public class PersonalStatisticalStatementController {
+public class PersonalStatisticalStatementController extends BaseController{
 
     @Autowired
     private IPersonalStatisticalStatementService personalStatisticalStatementService;
@@ -28,4 +32,25 @@ public class PersonalStatisticalStatementController {
         return RestResponse.data(personalStatisticalStatementService.getPersonalDepEfficiencyVO(dto));
     }
 
+    /**
+     * 获取效率值相关个贷订单列表
+     * @param page 分页
+     * @param dto 查询dto
+     * @return Page<PersonalEfficiencyDetailVO>
+     */
+    @GetMapping("/getPersonalEfficiencyDetailVO")
+    public RestResponse<Page<PersonalEfficiencyDetailVO>> getPersonalEfficiencyDetailVO(Page page, PersonalStatisticalSelectDTO dto) {
+        return RestResponse.data(personalStatisticalStatementService.getPersonalEfficiencyDetailVO(page, dto));
+    }
+
+    /**
+     * 导出效率值相关个贷订单列表
+     * @param dto 查询dto
+     */
+    @GetMapping("/getPersonalEfficiencyDetailVO/export")
+    public void exportPersonalEfficiencyDetailVO(PersonalStatisticalSelectDTO dto, HttpServletResponse response) throws IOException {
+        List<PersonalEfficiencyDetailVO> result = personalStatisticalStatementService.exportPersonalEfficiencyDetailVO(dto);
+        exportPlus(response, "个贷订单列表", result,PersonalEfficiencyDetailVO.class);
+    }
+
 }

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

@@ -86,14 +86,14 @@ public interface AssetsStatisticalStatementMapper {
      * @param dto 查询dto
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
-    Page<AssetsEvaluateEfficiencyDetailVO> getAssetsEvaEffDetailVO(@Param("page") Page page, @Param("dto") AssetsStatisticalSelectDTO dto);
+    Page<AssetsEfficiencyDetailVO> getAssetsEvaEffDetailVO(@Param("page") Page page, @Param("dto") AssetsStatisticalSelectDTO dto);
 
     /**
      * 效率详情列表导出
      * @param dto 查询dto
      * @return List<AssetsEvaluateEfficiencyDetailVO>
      */
-    List<AssetsEvaluateEfficiencyDetailVO> assetsEvaEffDetailVOExport(@Param("dto") AssetsStatisticalSelectDTO dto);
+    List<AssetsEfficiencyDetailVO> assetsEvaEffDetailVOExport(@Param("dto") AssetsStatisticalSelectDTO dto);
 
     /**
      * 市场部效率查询

+ 17 - 0
dao/src/main/java/com/dayou/mapper/PersonalStatisticalStatementMapper.java

@@ -1,6 +1,8 @@
 package com.dayou.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.PersonalStatisticalSelectDTO;
+import com.dayou.vo.PersonalEfficiencyDetailVO;
 import com.dayou.vo.PersonalDepEfficiencyVO;
 import org.apache.ibatis.annotations.Param;
 
@@ -15,4 +17,19 @@ public interface PersonalStatisticalStatementMapper {
      */
     List<PersonalDepEfficiencyVO> getPersonalDepEfficiencyVO(@Param("dto") PersonalStatisticalSelectDTO dto);
 
+    /**
+     * 获取效率值相关个贷订单列表
+     * @param page 分页
+     * @param dto 查询dto
+     * @return Page<PersonalEfficiencyDetailVO>
+     */
+    Page<PersonalEfficiencyDetailVO> getPersonalEfficiencyDetailVO(@Param("page") Page page, @Param("dto") PersonalStatisticalSelectDTO dto);
+
+    /**
+     * 导出效率值相关个贷订单列表
+     * @param dto 查询dto
+     * @return List<PersonalEfficiencyDetailVO>
+     */
+    List<PersonalEfficiencyDetailVO> exportPersonalEfficiencyDetailVO(@Param("dto") PersonalStatisticalSelectDTO dto);
+
 }

+ 5 - 2
dao/src/main/resources/mapper/AssetsStatisticalStatementMapper.xml

@@ -582,12 +582,12 @@
     </sql>
 
     <!--效率详情列表查询-->
-    <select id="getAssetsEvaEffDetailVO" resultType="com.dayou.vo.AssetsEvaluateEfficiencyDetailVO">
+    <select id="getAssetsEvaEffDetailVO" resultType="com.dayou.vo.AssetsEfficiencyDetailVO">
         <include refid="assetsEvaEffDetailQuery" />
     </select>
 
     <!--效率详情列表导出-->
-    <select id="assetsEvaEffDetailVOExport" resultType="com.dayou.vo.AssetsEvaluateEfficiencyDetailVO">
+    <select id="assetsEvaEffDetailVOExport" resultType="com.dayou.vo.AssetsEfficiencyDetailVO">
         <include refid="assetsEvaEffDetailQuery" />
     </select>
 
@@ -757,6 +757,9 @@
             <if test="dto != null and dto.customerId != null">
                 AND customer.id = #{dto.customerId}
             </if>
+            <if test="dto != null and dto.userName != null">
+                AND customer.userName LIKE CONCAT('%',#{dto.userName},'%')
+            </if>
         </where>
         GROUP BY customer.clientele_contact_id
     </select>

+ 73 - 0
dao/src/main/resources/mapper/PersonalStatisticalStatementMapper.xml

@@ -34,4 +34,77 @@
                  SELECT '总计'
              ) AS eva
     </select>
+
+    <sql id="personalEfficiencyDetailQuery">
+        SELECT personal.id,
+        personal.order_id,
+        personal.location,
+        (SELECT name FROM customer_company WHERE id = personal.clientele_id) AS customerName,
+        (SELECT name FROM customer_company WHERE id = personal.clientele_sub_id) AS customerSubName,
+        personal.agent,
+        personal.bailorA AS bailor,
+        target.acreage,
+        target.price,
+        target.amount,
+        statement.created AS writeStatementDate,
+        report.created AS writeReportDate,
+        JSON_EXTRACT(selling_ability, '$.sceneDateD') AS valuationDate,
+        personal.purpose,
+        fund.should_amount,
+        fund.real_amount,
+        (SELECT name FROM user WHERE user.id = personal.client_manager_id) AS clientManagerName,
+        nodeInfo.currentNodeName,
+        nodeInfo.handlerName
+        FROM personal
+        LEFT JOIN personal_target AS target ON personal.id = target.personal_id
+        LEFT JOIN order_fund AS fund ON fund.business_id = personal.id AND fund.business_type = 'PERSONAL_BUSINESS'
+        LEFT JOIN personal_production AS statement ON statement.target_id = target.id AND statement.production = 'STATEMENT' AND statement.deleted = 0
+        LEFT JOIN personal_production AS report ON report.target_id = target.id AND report.production != 'STATEMENT' AND report.deleted = 0
+        LEFT JOIN (
+        SELECT node.name AS currentNodeName,
+        instance.business_id AS businessId,
+        user.name AS handlerName
+        FROM work_node AS node,
+        work_flow_node_instance AS instance,
+        work_task_record AS record,
+        user
+        WHERE node.id = instance.node_id
+        AND instance.id = record.instance_id
+        AND record.handler_id = user.id
+        AND business_type = 'PERSONAL_BUSINESS'
+        AND instance.state = 'PENDING'
+        AND instance.deleted = 0
+        ) AS nodeInfo ON personal.id = nodeInfo.businessId
+        WHERE personal.deleted = 0
+        <if test="dto != null and dto.evaluateAim != '总计'">
+            AND evaluate_aim = #{dto.evaluateAim}
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'order'">
+            AND personal.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'statement'">
+            AND statement.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'report'">
+            AND report.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'should'">
+            AND fund.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+            AND fund.should_amount IS NOT NULL
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'real'">
+            AND fund.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+            AND fund.real_amount IS NOT NULL
+        </if>
+    </sql>
+
+    <!--获取效率值相关个贷订单列表-->
+    <select id="getPersonalEfficiencyDetailVO" resultType="com.dayou.vo.PersonalEfficiencyDetailVO">
+        <include refid="personalEfficiencyDetailQuery" />
+    </select>
+
+    <!--导出效率值相关个贷订单列表-->
+    <select id="exportPersonalEfficiencyDetailVO" resultType="com.dayou.vo.PersonalEfficiencyDetailVO">
+        <include refid="personalEfficiencyDetailQuery" />
+    </select>
 </mapper>

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

@@ -21,7 +21,12 @@ public class PersonalStatisticalSelectDTO {
     private Date endTime;
 
     /**
-     * 效率类型(接单:order、预评:statement、报告:report、应收款:should、实收款:real)
+     * 评估目的(咨询、抵押、按揭、合计)
+     */
+    private String evaluateAim;
+
+    /**
+     * 效率类型(订单:order、预评:statement、报告:report、应收款:should、实收款:real)
      */
     private String efficiencyType;
 

+ 2 - 2
domain/src/main/java/com/dayou/vo/AssetsEvaluateEfficiencyDetailVO.java

@@ -7,7 +7,7 @@ import java.math.BigDecimal;
 import java.time.LocalDate;
 
 @Data
-public class AssetsEvaluateEfficiencyDetailVO {
+public class AssetsEfficiencyDetailVO {
 
     private Integer id;
 
@@ -68,7 +68,7 @@ public class AssetsEvaluateEfficiencyDetailVO {
     /**
      * 客户经理名
      */
-    @Excel(name = "客户经理")
+    @Excel(name = "客户经理")
     private String clientManagerName;
 
     /**

+ 0 - 90
domain/src/main/java/com/dayou/vo/PersonalDepEfficiencyDetailVO.java

@@ -1,90 +0,0 @@
-package com.dayou.vo;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.dayou.annotation.Excel;
-import com.dayou.annotation.ExportCell;
-import com.dayou.annotation.ImportCell;
-import com.dayou.annotation.LuceneSearchable;
-
-import java.math.BigDecimal;
-import java.time.LocalDate;
-
-public class PersonalDepEfficiencyDetailVO {
-
-    /**
-     * 订单编号
-     */
-    private String orderId;
-
-    /**
-     * 坐落
-     */
-    private String location;
-
-    /**
-     * 客户名称
-     */
-    @Excel(name = "客户名称")
-    private String customerName;
-
-    /**
-     * 业务来源(客户子级名称)
-     */
-    @Excel(name = "业务来源")
-    private String customerSubName;
-
-    /**
-     * 中介
-     */
-    @ImportCell
-    @ExportCell(columnName = "中介")
-    private String agent;
-
-    /**
-     * 委托人1
-     */
-    @TableField("bailorA")
-    @ImportCell
-    @ExportCell(columnName = "委托人1")
-    @LuceneSearchable("bailorA")
-    private String bailorA;
-
-    /**
-     * 面积
-     */
-    private BigDecimal acreage;
-
-    /**
-     * 单价
-     */
-    @ImportCell
-    @ExportCell(columnName = "单价")
-    private BigDecimal price;
-
-
-    /**
-     * 总价
-     */
-    @ImportCell
-    @ExportCell(columnName = "总价")
-    private BigDecimal amount;
-
-    /**
-     * 出意见书时间
-     */
-    @Excel(name = "出意见书时间")
-    private LocalDate writeStatementDate;
-
-    /**
-     * 出报告时间
-     */
-    @Excel(name = "出报告时间")
-    private LocalDate writeReportDate;
-
-    /**
-     * 价值时点(对应实地查勘日)
-     */
-    @Excel(name = "价值时点")
-    private LocalDate valuationDate;
-
-}

+ 121 - 0
domain/src/main/java/com/dayou/vo/PersonalEfficiencyDetailVO.java

@@ -0,0 +1,121 @@
+package com.dayou.vo;
+
+import com.dayou.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+@Data
+public class PersonalEfficiencyDetailVO {
+
+    /**
+     * 订单编号
+     */
+    @Excel(name = "订单编号")
+    private String orderId;
+
+    /**
+     * 项目名称(坐落)
+     */
+    @Excel(name = "项目名称")
+    private String location;
+
+    /**
+     * 客户名称
+     */
+    @Excel(name = "客户名称")
+    private String customerName;
+
+    /**
+     * 业务来源(客户子级名称)
+     */
+    @Excel(name = "业务来源")
+    private String customerSubName;
+
+    /**
+     * 中介
+     */
+    @Excel(name = "中介")
+    private String agent;
+
+    /**
+     * 委托人
+     */
+    @Excel(name = "委托人")
+    private String bailor;
+
+    /**
+     * 面积
+     */
+    @Excel(name = "面积")
+    private BigDecimal acreage;
+
+    /**
+     * 单价
+     */
+    @Excel(name = "单价")
+    private BigDecimal price;
+
+
+    /**
+     * 总价
+     */
+    @Excel(name = "总价")
+    private BigDecimal amount;
+
+    /**
+     * 出意见书时间
+     */
+    @Excel(name = "出意见书时间")
+    private LocalDate writeStatementDate;
+
+    /**
+     * 出报告时间
+     */
+    @Excel(name = "出报告时间")
+    private LocalDate writeReportDate;
+
+    /**
+     * 价值时点(对应实地查勘日)
+     */
+    @Excel(name = "价值时点")
+    private String valuationDate;
+
+    /**
+     * 用途
+     */
+    @Excel(name = "用途")
+    private String purpose;
+
+    /**
+     * 订单应收款(元)
+     */
+    @Excel(name = "订单应收款(元)")
+    private Double shouldAmount;
+
+    /**
+     * 订单实收款(元)
+     */
+    @Excel(name = "订单实收款(元)")
+    private Double realAmount;
+
+    /**
+     * 客户经理名
+     */
+    @Excel(name = "客户经理")
+    private String clientManagerName;
+
+    /**
+     * 当前实例节点名称
+     */
+    @Excel(name = "当前实例节点名称")
+    private String currentNodeName;
+
+    /**
+     * 当前节点处理人
+     */
+    @Excel(name = "当前节点处理人")
+    private String handlerName;
+
+}

+ 2 - 2
service/src/main/java/com/dayou/service/IAssetsStatisticalStatementService.java

@@ -93,14 +93,14 @@ public interface IAssetsStatisticalStatementService {
      * @param dto 查询dto
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
-    Page<AssetsEvaluateEfficiencyDetailVO> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto);
+    Page<AssetsEfficiencyDetailVO> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto);
 
     /**
      * 效率详情列表查询
      * @param dto 查询dto
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
-    List<AssetsEvaluateEfficiencyDetailVO> assetsEvaEffDetailVOExport(AssetsStatisticalSelectDTO dto);
+    List<AssetsEfficiencyDetailVO> assetsEvaEffDetailVOExport(AssetsStatisticalSelectDTO dto);
 
     /**
      * 市场部效率查询

+ 17 - 0
service/src/main/java/com/dayou/service/IPersonalStatisticalStatementService.java

@@ -1,7 +1,9 @@
 package com.dayou.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.PersonalStatisticalSelectDTO;
 import com.dayou.vo.PersonalDepEfficiencyVO;
+import com.dayou.vo.PersonalEfficiencyDetailVO;
 
 import java.util.List;
 
@@ -14,4 +16,19 @@ public interface IPersonalStatisticalStatementService {
      */
     List<PersonalDepEfficiencyVO> getPersonalDepEfficiencyVO(PersonalStatisticalSelectDTO dto);
 
+    /**
+     * 获取效率值相关个贷订单列表
+     * @param page 分页
+     * @param dto 查询dto
+     * @return Page<PersonalEfficiencyDetailVO>
+     */
+    Page<PersonalEfficiencyDetailVO> getPersonalEfficiencyDetailVO(Page page, PersonalStatisticalSelectDTO dto);
+
+    /**
+     * 导出效率值相关个贷订单列表
+     * @param dto 查询dto
+     * @return List<PersonalEfficiencyDetailVO>
+     */
+    List<PersonalEfficiencyDetailVO> exportPersonalEfficiencyDetailVO(PersonalStatisticalSelectDTO dto);
+
 }

+ 4 - 6
service/src/main/java/com/dayou/service/impl/AssetsStatisticalStatementServiceImpl.java

@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.AssetsStatisticalSelectDTO;
 import com.dayou.entity.AssetsEvaluationMethod;
-import com.dayou.entity.Department;
 import com.dayou.entity.User;
 import com.dayou.mapper.AssetsEvaluationMethodMapper;
 import com.dayou.mapper.AssetsStatisticalStatementMapper;
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -339,9 +337,9 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
     @Override
-    public Page<AssetsEvaluateEfficiencyDetailVO> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto) {
-        Page<AssetsEvaluateEfficiencyDetailVO> detailVOPage = assetsStatisticalStatementMapper.getAssetsEvaEffDetailVO(page, dto);
-        for (AssetsEvaluateEfficiencyDetailVO detailVO : detailVOPage.getRecords()) {
+    public Page<AssetsEfficiencyDetailVO> getAssetsEvaEffDetailVO(Page page, AssetsStatisticalSelectDTO dto) {
+        Page<AssetsEfficiencyDetailVO> detailVOPage = assetsStatisticalStatementMapper.getAssetsEvaEffDetailVO(page, dto);
+        for (AssetsEfficiencyDetailVO detailVO : detailVOPage.getRecords()) {
             if (ObjectUtil.isNotNull(detailVO.getMembers())) {
                 JSONArray jsonArray = JSONArray.parseArray(detailVO.getMembers());
                 List<Long> membersId = jsonArray.toJavaList(Long.class);
@@ -365,7 +363,7 @@ public class AssetsStatisticalStatementServiceImpl implements IAssetsStatistical
      * @return Page<AssetsEvaluateEfficiencyDetailVO>
      */
     @Override
-    public List<AssetsEvaluateEfficiencyDetailVO> assetsEvaEffDetailVOExport(AssetsStatisticalSelectDTO dto) {
+    public List<AssetsEfficiencyDetailVO> assetsEvaEffDetailVOExport(AssetsStatisticalSelectDTO dto) {
         return assetsStatisticalStatementMapper.assetsEvaEffDetailVOExport(dto);
     }
 

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

@@ -1,11 +1,14 @@
 package com.dayou.service.impl;
 
 import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.dayou.dto.PersonalStatisticalSelectDTO;
 import com.dayou.mapper.PersonalStatisticalStatementMapper;
 import com.dayou.service.IPersonalStatisticalStatementService;
-import com.dayou.vo.AssetsMarketEfficiencyVO;
 import com.dayou.vo.PersonalDepEfficiencyVO;
+import com.dayou.vo.PersonalEfficiencyDetailVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -120,4 +123,67 @@ public class PersonalStatisticalStatementServiceImpl implements IPersonalStatist
         }
         return efficiencyVOList;
     }
+
+    /**
+     * 获取效率值相关个贷订单列表
+     * @param page 分页
+     * @param dto 查询dto
+     * @return Page<PersonalEfficiencyDetailVO>
+     */
+    @Override
+    public Page<PersonalEfficiencyDetailVO> getPersonalEfficiencyDetailVO(Page page, PersonalStatisticalSelectDTO dto) {
+        Page<PersonalEfficiencyDetailVO> efficiencyDetailVOPage = personalStatisticalStatementMapper.getPersonalEfficiencyDetailVO(page, dto);
+        efficiencyDetailVOPage.setRecords(setPurpose(efficiencyDetailVOPage.getRecords()));
+        return efficiencyDetailVOPage;
+    }
+
+    /**
+     * 导出效率值相关个贷订单列表
+     * @param dto 查询dto
+     * @return List<PersonalEfficiencyDetailVO>
+     */
+    @Override
+    public List<PersonalEfficiencyDetailVO> exportPersonalEfficiencyDetailVO(PersonalStatisticalSelectDTO dto) {
+        List<PersonalEfficiencyDetailVO> efficiencyDetailVOList = personalStatisticalStatementMapper.exportPersonalEfficiencyDetailVO(dto);
+        return setPurpose(efficiencyDetailVOList);
+    }
+
+    /**
+     * 设置个贷的用途
+     * @param detailVOList 订单集合
+     * @return List<PersonalEfficiencyDetailVO>
+     */
+    public List<PersonalEfficiencyDetailVO> setPurpose(List<PersonalEfficiencyDetailVO> detailVOList){
+        for (PersonalEfficiencyDetailVO efficiencyVO : detailVOList){
+            JSONArray jsonArray = JSONArray.parseArray(efficiencyVO.getPurpose());
+            List<String> purposeCodeList = jsonArray.toJavaList(String.class);
+            StringBuilder purpose = new StringBuilder();
+            int index = 0;
+            for (String purposeCode : purposeCodeList){
+                switch (purposeCode) {
+                    case "HOUSE":
+                        purpose.append("住宅");
+                        break;
+                    case "BUSINESS":
+                        purpose.append("商业");
+                        break;
+                    case "OFFICE":
+                        purpose.append("办公");
+                        break;
+                    case "OTHER":
+                        purpose.append("工业");
+                        break;
+                    default:
+                        purpose.append("其他");
+                        break;
+                }
+                index++;
+                if (index < purposeCodeList.size()) {
+                    purpose.append(",");
+                }
+            }
+            efficiencyVO.setPurpose(String.valueOf(purpose));
+        }
+        return detailVOList;
+    }
 }