From f02933e02770e3ad716467a5160d4e8aca625426 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Mon, 17 May 2021 16:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E6=95=88=E7=8E=87=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E6=95=88=E7=8E=87=EF=BC=8C=E4=BF=9D=E5=90=8E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AlRepaymentEntryServiceImpl.java | 26 +++++- .../service/impl/DgEfficiencyServiceImpl.java | 80 +++++++++++++++++-- 2 files changed, 98 insertions(+), 8 deletions(-) diff --git a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java index 1b475d8b..4f393f59 100644 --- a/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java +++ b/dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java @@ -2,6 +2,7 @@ package com.daqing.financial.guarantee.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; @@ -15,7 +16,9 @@ import com.daqing.financial.guarantee.service.IAlRepaymentEntryService; import com.daqing.framework.domain.crms.response.CrmsCode; import com.daqing.framework.domain.guarantee.AlInsuranceList; import com.daqing.framework.domain.guarantee.AlRepaymentEntry; +import com.daqing.framework.domain.guarantee.DgGuaranteeAssignUser; import com.daqing.framework.exception.ExceptionCast; +import com.daqing.framework.model.StatusCode; import com.daqing.framework.utils.PageUtils; import com.daqing.framework.utils.excel.ExcelUtil; import io.swagger.models.auth.In; @@ -102,7 +105,28 @@ public class AlRepaymentEntryServiceImpl extends ServiceImpllambdaUpdate() + .set(AlRepaymentEntry::getActualRepaymentDate, entry.getActualRepaymentDate()) //把email设置成null + .set(AlRepaymentEntry::getCurrentRepayment, entry.getCurrentRepayment()) + .set(AlRepaymentEntry::getInterest, entry.getInterest()) + .set(AlRepaymentEntry::getInsuranceId, entry.getInsuranceId()) + .set(AlRepaymentEntry::getOtherExpenses, entry.getOtherExpenses()) + .set(AlRepaymentEntry::getRepaymentDate, entry.getRepaymentDate()) + .set(AlRepaymentEntry::getDeductionAmount, entry.getDeductionAmount()) + .set(AlRepaymentEntry::getOverdueDays, entry.getOverdueDays()) + .set(AlRepaymentEntry::getRepaymentNotes, entry.getRepaymentNotes()) + .set(AlRepaymentEntry::getTotalRepayment, entry.getTotalRepayment()) + .set(AlRepaymentEntry::getSubmitterId, entry.getSubmitterId()) + .set(AlRepaymentEntry::getSubmitterName, entry.getSubmitterName()) + .set(AlRepaymentEntry::getRepaymentStatus, entry.getRepaymentStatus()) + .set(AlRepaymentEntry::getCreateTime, entry.getCreateTime()) + .set(AlRepaymentEntry::getUpdateTime, entry.getUpdateTime()) + .eq(AlRepaymentEntry::getId, entry.getId()) + ); + //return this.baseMapper.updateById(entry); } @Override 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 1474fcc1..140f2583 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 @@ -174,6 +174,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl 0; i--) { HashMap map = new HashMap<>(); // 计算时间差 @@ -182,10 +183,13 @@ public class DgEfficiencyServiceImpl extends ServiceImpl1){ + // 累计时间加上本次时间 + existMap.put(processId, (Integer.parseInt(time)) + "," + count); + }else{ + existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count); + } +// existMap.put(processId, (Math.abs(Long.parseLong(existTime) + Long.parseLong(time))) + "," + count); } hashMap.put(Integer.parseInt(departmentId), existMap); + } } } @@ -672,7 +684,21 @@ public class DgEfficiencyServiceImpl extends ServiceImpl beginWrapperTime = new QueryWrapper<>(); - beginWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",processId).eq("user_id", userId).orderByAsc("create_time").last("limit 1"); + + //查询上个流程的结束时间 + Integer newProId=0; + if(processId==2 || processId ==3 || processId==4){ + newProId=1; + beginWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).orderByDesc("create_time").last("limit 1"); + }else if(processId==1){ + newProId=processId; + beginWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).eq("user_id", userId).orderByAsc("create_time").last("limit 1"); + }else{ + newProId=processId-1; + beginWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).orderByDesc("create_time").last("limit 1"); + } + +// beginWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",processId).eq("user_id",userId).orderByAsc("create_time").last("limit 1"); DgAuditProcess beginAuditProcess = dgAuditProcessMapper.selectOne(beginWrapperTime); //如果改流程数据为空直接返回默认值 if (ObjectUtil.isNull(beginAuditProcess)){ @@ -680,19 +706,59 @@ public class DgEfficiencyServiceImpl extends ServiceImpl endWrapperTime = new QueryWrapper<>(); endWrapperTime.select("create_time","id").eq("business_id", businessId).eq("process_id",processId).eq("user_id", userId).orderByDesc("create_time").last("limit 1"); DgAuditProcess endAuditProcess = dgAuditProcessMapper.selectOne(endWrapperTime); - Date endTime = endAuditProcess.getCreateTime(); + + Date endTime = null; + if(endAuditProcess !=null){ + endTime = endAuditProcess.getCreateTime(); + }else{ + endTime = new Date(); + } //转换成毫秒统计时间差 long currentTimeTime = endTime.getTime(); long previousTimeTime = beginTime.getTime(); //累计耗时,毫秒 - totalTime = currentTimeTime - previousTimeTime; + if(currentTimeTime > previousTimeTime){ + totalTime = currentTimeTime - previousTimeTime; + }else{ + QueryWrapper beginWrapperTime2 = new QueryWrapper<>(); + //属于被驳回的数据 + //查询上个流程的结束时间 + if(processId==2 || processId ==3 || processId==4){ + newProId=1; + beginWrapperTime2.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).eq("status",StatusCode.CZ_PROCESSED).orderByAsc("create_time").last("limit 1"); + }else if(processId==1){ + newProId=processId; + beginWrapperTime2.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).eq("user_id", userId).eq("status",StatusCode.CZ_PROCESSED).orderByAsc("create_time").last("limit 1"); + }else{ + newProId=processId-1; + beginWrapperTime2.select("create_time","id").eq("business_id", businessId).eq("process_id",newProId).eq("status",StatusCode.CZ_PROCESSED).orderByAsc("create_time").last("limit 1"); + } + DgAuditProcess beginAuditProcess2 = dgAuditProcessMapper.selectOne(beginWrapperTime2); + //如果改流程数据为空直接返回默认值 + if (ObjectUtil.isNull(beginAuditProcess2)){ + hashMap.put("countTime", "0天0小时0分钟"); + hashMap.put("endTime", ""); + return hashMap; + } + Date beginTime2 = null; + if(beginAuditProcess !=null){ + beginTime2 = beginAuditProcess2.getCreateTime(); + } + long previousTimeTime2 = beginTime2.getTime(); + totalTime = currentTimeTime - previousTimeTime2; + } + hashMap.put("countTime", countTime(String.valueOf(totalTime))); hashMap.put("endTime", new SimpleDateFormat("yyyy-MM-dd").format(endTime)); return hashMap;