Forráskód Böngészése

个贷正在进行列表查询优化

wucl 5 napja
szülő
commit
35637b9cf2

+ 12 - 0
biz-base/src/main/java/com/dayou/controller/WorkFlowLogController.java

@@ -1,5 +1,6 @@
 package com.dayou.controller;
 
+import com.dayou.vo.PersonalCommentsVO;
 import com.dayou.vo.WorkLogVO;
 import com.dayou.vo.WorkflowLogVO;
 import lombok.extern.slf4j.Slf4j;
@@ -57,5 +58,16 @@ public class WorkFlowLogController extends BaseController {
          return RestResponse.data(log);
      }
 
+    /**
+     * 个贷查询最新备注
+     * @param queryParam
+     * @return
+     */
+    @PostMapping("/comments")
+    public RestResponse<List<PersonalCommentsVO>> queryLastComments(@RequestBody PersonalCommentsVO queryParam){
+        List<PersonalCommentsVO> personalCommentsVOS = workFlowLogService.queryComments(queryParam.getBusinessIds());
+        return RestResponse.data(personalCommentsVOS);
+    }
+
 }
 

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

@@ -2,6 +2,7 @@ package com.dayou.mapper;
 
 import com.dayou.entity.WorkFlowLog;
 import com.dayou.dao.CustomBaseMapper;
+import com.dayou.vo.PersonalCommentsVO;
 import com.dayou.vo.WorkLogVO;
 import com.dayou.vo.WorkflowLogVO;
 import org.apache.ibatis.annotations.Param;
@@ -25,4 +26,5 @@ public interface WorkFlowLogMapper extends CustomBaseMapper<WorkFlowLog> {
 
     void updateBusinessMinId(@Param("ids") List<Long> logIds, @Param("minId") String minId);
 
+    List<PersonalCommentsVO> queryComments(@Param("businessIds") List<Long> businessIds);
 }

+ 1 - 7
dao/src/main/resources/mapper/PersonalMapper.xml

@@ -81,8 +81,7 @@
             u3.NAME AS pricingStaffName,
             u4.name as handlerName,
             u4.id as handlerId,
-            p.created,
-            c.comments
+            p.created
         FROM
             work_flow_node_instance wf
                 LEFT JOIN work_node wn ON wn.id = wf.node_id
@@ -97,11 +96,6 @@
                 LEFT JOIN user u1 ON u1.id = p.outward_staff
                 LEFT JOIN user u2 ON u2.id = p.inward_staff
                 LEFT JOIN user u3 ON u3.id = p.pricing_staff
-                left join (
-                select business_id,comments from work_flow_log where concat(business_id,modified) in (
-                    select concat(business_id,max(modified)) from work_flow_log where business_type = 'PERSONAL_BUSINESS' and comments is not null  group BY business_id
-                )
-            ) c on p.id = c.business_id
         WHERE
             wf.business_type = "PERSONAL_BUSINESS"
           AND wf.state = 'PENDING'

+ 32 - 0
dao/src/main/resources/mapper/WorkFlowLogMapper.xml

@@ -80,4 +80,36 @@
         )
     </update>
 
+    <select id="queryComments" parameterType="java.util.List" resultType="com.dayou.vo.PersonalCommentsVO">
+        SELECT
+            business_id as id,
+            comments
+        FROM
+            work_flow_log
+        WHERE
+            concat( business_id, modified ) IN (
+                SELECT
+                    concat(
+                            business_id,
+                            max( modified ))
+                FROM
+                    work_flow_log
+                WHERE
+                    business_type = 'PERSONAL_BUSINESS'
+                  AND comments IS NOT NULL
+                  and business_id in (
+                      <foreach collection="businessIds" index="index" item="item" separator=",">
+                          #{item}
+                      </foreach>
+                    )
+                GROUP BY
+                    business_id
+            )
+        and business_id in (
+        <foreach collection="businessIds" index="index" item="item" separator=",">
+            #{item}
+        </foreach>
+        )
+    </select>
+
 </mapper>

+ 7 - 1
domain/src/main/java/com/dayou/vo/FinanceInvoiceRealExportVo.java

@@ -24,7 +24,7 @@ public class FinanceInvoiceRealExportVo {
     /**
      * 发票类型
      */
-    @ExportCell(columnName = "发票类型")
+    @Excel(name = "发票类型")
     private String type;
 
     /**
@@ -34,6 +34,12 @@ public class FinanceInvoiceRealExportVo {
     private String taxNo;
 
     /**
+     * 发票号
+     */
+    @Excel(name = "发票号")
+    private String ticketNo;
+
+    /**
      * 计划开票金额
      */
     @Excel(name = "计划开票金额")

+ 23 - 0
domain/src/main/java/com/dayou/vo/PersonalCommentsVO.java

@@ -0,0 +1,23 @@
+package com.dayou.vo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import lombok.Data;
+
+import java.util.List;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Data
+public class PersonalCommentsVO {
+
+    /**
+     * 个贷订单id
+     */
+    private Long id;
+
+    /**
+     * 最新备注
+     */
+    private String comments;
+
+    private List<Long> businessIds;
+}

+ 3 - 0
service/src/main/java/com/dayou/service/workflow/IWorkFlowLogService.java

@@ -3,6 +3,7 @@ import com.dayou.entity.WorkFlowLog;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.dayou.vo.PersonalCommentsVO;
 import com.dayou.vo.WorkLogVO;
 import com.dayou.vo.WorkflowLogVO;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -29,4 +30,6 @@ public interface IWorkFlowLogService extends IService<WorkFlowLog> {
     List<WorkflowLogVO> getList(WorkFlowLog workFlowLog);
 
     WorkFlowLog getRefuse(Long businessId, String businessType);
+
+    List<PersonalCommentsVO> queryComments(List<Long> businessIds);
 }

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

@@ -4,6 +4,7 @@ import com.dayou.entity.WorkFlowLog;
 import com.dayou.mapper.WorkFlowLogMapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.dayou.utils.DateUtils;
+import com.dayou.vo.PersonalCommentsVO;
 import com.dayou.vo.WorkLogVO;
 import com.dayou.vo.WorkflowLogVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +12,7 @@ import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -58,5 +60,10 @@ public class WorkFlowLogServiceImpl extends ServiceImpl<WorkFlowLogMapper, WorkF
         return workFlowLogMapper.getRefuse(businessId,businessType);
     }
 
+    @Override
+    public List<PersonalCommentsVO> queryComments(List<Long> businessIds) {
+        return workFlowLogMapper.queryComments(businessIds);
+    }
+
 
 }