From b5dba4b13f70d1cdefc9108227723b7d5d17d707 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Mon, 4 Jan 2021 10:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=95=88=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DgEfficiencyController.java | 22 +++++++++-- .../PersonalEfficiencyListResponse.java | 2 +- .../service/impl/DgEfficiencyServiceImpl.java | 2 +- .../guarantee/util/TaskNodeUtil.java | 37 +++++++++++++++++++ 4 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/util/TaskNodeUtil.java 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 4296eb83..139e1147 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 @@ -7,6 +7,7 @@ import com.daqing.financial.guarantee.model.request.PersonalEfficiencyListReques import com.daqing.financial.guarantee.model.response.PersonalEfficiencyListResponse; import com.daqing.financial.guarantee.service.IDgEfficiencyService; import com.daqing.financial.guarantee.util.DateUtils; +import com.daqing.financial.guarantee.util.TaskNodeUtil; import com.daqing.framework.model.StatusCode; import com.daqing.framework.model.response.ResponseResult; import com.daqing.framework.utils.excel.EasyExcelUtil; @@ -22,7 +23,6 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * 流程效率 @@ -132,8 +132,25 @@ public class DgEfficiencyController { //获取毫秒数 long longStart = getLongDate(personalEfficiencyListRequest.getStartTime()); long longEnd = getLongDate(personalEfficiencyListRequest.getEndTime()); - Stream booleanStream = responseList.stream().map(p -> getLongDate(p.getApplicationDate()) > longStart && getLongDate(p.getApplicationDate()) < longEnd); + //迭代器进行筛选 + Iterator iterator = responseList.iterator(); + while (iterator.hasNext()){ + PersonalEfficiencyListResponse next = iterator.next(); + String applicationDate = next.getApplicationDate(); + long longDate = getLongDate(applicationDate); + //当前日期小于开始日期或当前日期大于结束日期,删除该元素 + if (longDatelongEnd){ + iterator.remove(); + } + } } + //转换任务节点 + responseList.forEach(personalEfficiencyListResponse -> { + String taskNode = personalEfficiencyListResponse.getTaskNode(); + String converter = TaskNodeUtil.converter(taskNode); + personalEfficiencyListResponse.setTaskNode(converter); + }); + return ResponseResult.SUCCESS(responseList); } @@ -180,5 +197,4 @@ public class DgEfficiencyController { } - } diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java index 81b245ab..bddd6151 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/model/response/PersonalEfficiencyListResponse.java @@ -47,7 +47,7 @@ public class PersonalEfficiencyListResponse { @ApiModelProperty("任务节点") @ExcelProperty(value = "任务节点",index = 6,converter = TaskNodeConverter.class) - private Integer taskNode; + private String taskNode; @ApiModelProperty("审批状态") @ExcelProperty(value = "审核状态",index = 7,converter = ApprovalStatusConverter.class) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java index 8f8753fb..4a14c634 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java @@ -490,7 +490,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl