From 63e3d8394884a38355608af072aa045c4b4851bc Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Thu, 1 Apr 2021 11:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgCopyUserController.java | 5 +++++ .../controller/DgEfficiencyController.java | 21 ++++++++++++++++++- .../model/response/CopyForMeResponse.java | 12 +++++------ .../service/impl/DgCopyUserServiceImpl.java | 10 ++++----- .../mapper/guarantee/DgCopyUserMapper.xml | 1 + 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java index c8cc196a..de1b72a2 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgCopyUserController.java @@ -12,6 +12,7 @@ import com.daqing.framework.enums.OperationUnit; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -44,6 +45,10 @@ public class DgCopyUserController { List copyForMeList = copyUserService.queryCopyForMe(copyForMeRequest); //转换任务节点 copyForMeList.forEach(copyForMeResponse -> { + //提单人为空,默认赋值客户 + if (StringUtils.isEmpty(copyForMeResponse.getApplicant())){ + copyForMeResponse.setApplicant("客户"); + } String taskNode = copyForMeResponse.getTaskNode(); if (taskNode != null) { String converter = TaskNodeUtil.converter(taskNode); diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java index 754524f6..c35a7c14 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgEfficiencyController.java @@ -19,6 +19,7 @@ import com.daqing.framework.enums.OperationUnit; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.excel.EasyExcelUtil; +import com.daqing.framework.xss.SQLFilter; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -34,6 +35,7 @@ import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * 流程效率 @@ -155,6 +157,10 @@ public class DgEfficiencyController { numResponse.setCopySendNum(size); //转换任务节点,并统计操作状态个数 responseList.forEach(personalEfficiencyListResponse -> { + //耗时为空,默认为0 + if (StringUtils.isEmpty(personalEfficiencyListResponse.getTimeConsuming())){ + personalEfficiencyListResponse.setTimeConsuming("0天0小时0分钟"); + } //提单人为空,默认赋值客户 if (StringUtils.isEmpty(personalEfficiencyListResponse.getApplicant())){ personalEfficiencyListResponse.setApplicant("客户"); @@ -234,7 +240,20 @@ public class DgEfficiencyController { } } } - return R.ok().data("responseList", responseList).data("statistics", numResponse); + //按时间降序排列 + List collect = responseList.stream().sorted((o1, o2) -> { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + try { + Date dt1 = format.parse(o1.getApplicationDate()); + Date dt2 = format.parse(o2.getApplicationDate()); + // 默认降序 + return Long.compare(dt2.getTime(), dt1.getTime()); + } catch (Exception e) { + e.printStackTrace(); + } + return 0; + }).collect(Collectors.toList()); + return R.ok().data("responseList", collect).data("statistics", numResponse); } public static long getLongDate(String stringDate) { diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CopyForMeResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CopyForMeResponse.java index f5a2d200..2bfa65eb 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CopyForMeResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/CopyForMeResponse.java @@ -41,17 +41,17 @@ public class CopyForMeResponse { @ExcelProperty(value = "任务节点",index = 3,converter = TaskNodeConverter.class) private String taskNode; - @ApiModelProperty("审批人") - @ExcelProperty(value = "审批人",index = 4) - private String approve; + // @ApiModelProperty("审批人") + // @ExcelProperty(value = "审批人",index = 4) + // private String approve; - @ApiModelProperty("审批时间") - @ExcelProperty(value = "审批时间",index = 5) + @ApiModelProperty("完成时间") + @ExcelProperty(value = "完成时间",index = 4) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private String approveDate; @ApiModelProperty("业务状态") - @ExcelProperty(value = "业务状态",index = 6,converter = BusinessStatusConverter.class) + @ExcelProperty(value = "业务状态",index = 5,converter = BusinessStatusConverter.class) private Integer businessStatus; @ExcelIgnore diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyUserServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyUserServiceImpl.java index a2527fab..1ad6e695 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyUserServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgCopyUserServiceImpl.java @@ -101,11 +101,11 @@ public class DgCopyUserServiceImpl extends ServiceImpl AND cc.name LIKE '%' #{clientName} '%' + order by aai.create_time desc