团队效率个人效率,保后修改处理

master
shijie 4 years ago
parent b37b7d61c0
commit f02933e027
  1. 26
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/AlRepaymentEntryServiceImpl.java
  2. 76
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.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 ServiceImpl<AlRepaymentEntryMap
Integer userId = Integer.parseInt(map.get("userId").toString());
entry.setSubmitterId(userId);
entry.setSubmitterName(name);
return this.baseMapper.updateById(entry);
//插入或更新的字段有 空字符串 或者 null
return this.baseMapper.update(
null,
Wrappers.<AlRepaymentEntry>lambdaUpdate()
.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

@ -174,6 +174,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
if (dgTeamEfficiencyList.size() < 2) {
continue;
}
for (int i = dgTeamEfficiencyList.size() - 1; i > 0; i--) {
HashMap<Integer, String> map = new HashMap<>();
// 计算时间差
@ -182,10 +183,13 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId();
map.put(processId, time + ",1");
String[] departmentIds = departmentIdList.split(",");
Map timeSumByDepId = new HashMap();
for (String departmentId : departmentIds) {
if (departmentId.equals("0")) {
continue;
}
int pd = processId+Integer.parseInt(departmentId);
// 没有当前部门的数据,直接新建一个
if (hashMap.get(Integer.parseInt(departmentId)) == null) {
hashMap.put(Integer.parseInt(departmentId), map);
@ -199,11 +203,19 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf(",") + 1)) + 1;
// 计算当前部门在当前节点的累计时间
String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf(","));
int sumTime = Integer.parseInt(existTime) + Integer.parseInt(time);
timeSumByDepId.put(Integer.parseInt(departmentId),sumTime);
if(timeSumByDepId.size()>1){
// 累计时间加上本次时间
//existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count);
existMap.put(processId, (Math.abs(Long.parseLong(existTime) + Long.parseLong(time))) + "," + count);
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<DgEfficiencyMapper, DgA
//查询用户处理的开始时间
QueryWrapper<DgAuditProcess> 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<DgEfficiencyMapper, DgA
hashMap.put("endTime", "");
return hashMap;
}
Date beginTime = beginAuditProcess.getCreateTime();
Date beginTime = null;
if(beginAuditProcess !=null){
beginTime = beginAuditProcess.getCreateTime();
}
//查询用户处理的结束时间
QueryWrapper<DgAuditProcess> 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();
//累计耗时,毫秒
if(currentTimeTime > previousTimeTime){
totalTime = currentTimeTime - previousTimeTime;
}else{
QueryWrapper<DgAuditProcess> 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;

Loading…
Cancel
Save