|
|
@ -1,34 +1,26 @@ |
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
package com.daqing.financial.guarantee.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
import com.daqing.financial.guarantee.controller.DgApplyAmountInfoController; |
|
|
|
import com.daqing.financial.guarantee.mapper.*; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgAuditProcessMapper; |
|
|
|
import com.daqing.financial.guarantee.model.request.DgComplianceInvestigationRequest; |
|
|
|
import com.daqing.financial.guarantee.mapper.DgEfficiencyMapper; |
|
|
|
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest; |
|
|
|
import com.daqing.financial.guarantee.model.request.DgEfficiencyTeamRequest; |
|
|
|
import com.daqing.financial.guarantee.model.response.*; |
|
|
|
import com.daqing.financial.guarantee.model.response.EfficiencyApprovalResponse; |
|
|
|
import com.daqing.financial.guarantee.service.IDgEfficiencyService; |
|
|
|
import com.daqing.financial.guarantee.service.IDgEfficiencyService; |
|
|
|
import com.daqing.financial.guarantee.util.DateUtils; |
|
|
|
import com.daqing.financial.guarantee.util.DateUtils; |
|
|
|
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; |
|
|
|
import com.daqing.framework.domain.guarantee.DgApplyAmountInfo; |
|
|
|
import com.daqing.framework.domain.guarantee.DgAuditProcess; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.po.DgWorkConferencePO; |
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.po.StatusPO; |
|
|
|
|
|
|
|
import com.daqing.framework.model.response.PromptSuccess; |
|
|
|
|
|
|
|
import com.daqing.framework.util.RedisUtil; |
|
|
|
|
|
|
|
import com.google.common.collect.Maps; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
|
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
|
|
|
|
|
|
import com.daqing.framework.domain.guarantee.po.DgTeamEfficiencyPO; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @auther River |
|
|
|
* @auther River |
|
|
|
* @date 2020/11/10 11:34 |
|
|
|
* @date 2020/11/10 11:34 |
|
|
@ -39,43 +31,9 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private DgApplyAmountInfoController dgApplyAmountInfoController; |
|
|
|
private DgApplyAmountInfoController dgApplyAmountInfoController; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgApplyAmountInfoMapper applyAmountInfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private DgAuditProcessMapper dgAuditProcessMapper; |
|
|
|
private DgAuditProcessMapper dgAuditProcessMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgApplyAmountListMapper applyAmountListMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgGuaranteeAssignUserMapper guaranteeAssignUserMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgAssetsInvestigationMapper assetsInvestigationMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgMessageInvestigationMapper messageInvestigationMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgComplianceInvestigationMapper complianceInvestigationMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgWorkConferenceConsiderMapper workConferenceConsiderMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgLoanCommitteeConsiderMapper loanCommitteeConsiderMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgGuaranteeLetterAssignUserMapper guaranteeLetterAssignUserMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgPaymentConfirmationConsiderMapper paymentConfirmationConsiderMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private DgLoanNoticeMapper loanNoticeMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 团队效率 |
|
|
|
* 团队效率 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -83,8 +41,9 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
public HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest) { |
|
|
|
public HashMap<Integer, HashMap<Integer, String>> queryList(DgEfficiencyTeamRequest dgEfficiencyTeamRequest) { |
|
|
|
|
|
|
|
|
|
|
|
// 时间筛选(固定时间)
|
|
|
|
// 时间筛选(固定时间)
|
|
|
|
if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && dgEfficiencyTeamRequest.getStartTime() == null && |
|
|
|
if (dgEfficiencyTeamRequest.getCreateFixedTime() != null && (dgEfficiencyTeamRequest.getStartTime() == null || |
|
|
|
dgEfficiencyTeamRequest.getEndTime() == null) { |
|
|
|
dgEfficiencyTeamRequest.getStartTime().length() == 0) && (dgEfficiencyTeamRequest.getEndTime() == null || |
|
|
|
|
|
|
|
dgEfficiencyTeamRequest.getEndTime().length() == 0)) { |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
switch (dgEfficiencyTeamRequest.getCreateFixedTime()) { |
|
|
|
switch (dgEfficiencyTeamRequest.getCreateFixedTime()) { |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
@ -143,7 +102,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
time = DateUtils.dateDiff(dgTeamEfficiencyList.get(i - 1).getCreateTime(), dgTeamEfficiencyList.get(i).getCreateTime()) + ""; |
|
|
|
time = DateUtils.dateDiff(dgTeamEfficiencyList.get(i - 1).getCreateTime(), dgTeamEfficiencyList.get(i).getCreateTime()) + ""; |
|
|
|
processId = dgTeamEfficiencyList.get(i).getProcessId(); |
|
|
|
processId = dgTeamEfficiencyList.get(i).getProcessId(); |
|
|
|
departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId(); |
|
|
|
departmentIdList = dgTeamEfficiencyList.get(i).getDepartmentId(); |
|
|
|
map.put(processId, time + "(1)"); |
|
|
|
map.put(processId, time + ",1"); |
|
|
|
String[] departmentIds = departmentIdList.split(","); |
|
|
|
String[] departmentIds = departmentIdList.split(","); |
|
|
|
for (String departmentId : departmentIds) { |
|
|
|
for (String departmentId : departmentIds) { |
|
|
|
// 没有当前部门的数据,直接新建一个
|
|
|
|
// 没有当前部门的数据,直接新建一个
|
|
|
@ -153,15 +112,14 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
// 有当前部门数据,则再判断是否有当前节点数据
|
|
|
|
// 有当前部门数据,则再判断是否有当前节点数据
|
|
|
|
HashMap<Integer, String> existMap = hashMap.get(Integer.parseInt(departmentId)); |
|
|
|
HashMap<Integer, String> existMap = hashMap.get(Integer.parseInt(departmentId)); |
|
|
|
if (existMap.get(processId) == null) { |
|
|
|
if (existMap.get(processId) == null) { |
|
|
|
existMap.put(processId, time + "(1)"); |
|
|
|
existMap.put(processId, time + ",1"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 计算当前部门在当前节点的操作次数
|
|
|
|
// 计算当前部门在当前节点的操作次数
|
|
|
|
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf("(") + 1, |
|
|
|
int count = Integer.parseInt(existMap.get(processId).substring(existMap.get(processId).indexOf(",") + 1)) + 1; |
|
|
|
existMap.get(processId).indexOf(")"))) + 1; |
|
|
|
|
|
|
|
// 计算当前部门在当前节点的累计时间
|
|
|
|
// 计算当前部门在当前节点的累计时间
|
|
|
|
String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf("(")); |
|
|
|
String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf(",")); |
|
|
|
// 累计时间加上本次时间
|
|
|
|
// 累计时间加上本次时间
|
|
|
|
existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "(" + count + ")"); |
|
|
|
existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count); |
|
|
|
} |
|
|
|
} |
|
|
|
hashMap.put(Integer.parseInt(departmentId), existMap); |
|
|
|
hashMap.put(Integer.parseInt(departmentId), existMap); |
|
|
|
} |
|
|
|
} |
|
|
@ -178,9 +136,17 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 统计不同业务状态下业务数量 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Map<String, Integer> getBusinessCount() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return this.getBaseMapper().getBusinessCount(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 查询审批数目的值的数组 |
|
|
|
* 查询审批数目的值的数组 |
|
|
|
* |
|
|
|
|
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -189,373 +155,12 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
//String userId = dgApplyAmountInfoController.getUserId();
|
|
|
|
//String userId = dgApplyAmountInfoController.getUserId();
|
|
|
|
String userId = "5"; |
|
|
|
String userId = "5"; |
|
|
|
//近十天的日期数组
|
|
|
|
//近十天的日期数组
|
|
|
|
List<String> timeList = dgAuditProcessMapper.selectTenDays(Integer.parseInt(userId)); |
|
|
|
List<String>timeList = dgAuditProcessMapper.selectTenDays(Integer.parseInt(userId)); |
|
|
|
//近十天审批数目的值的数组
|
|
|
|
//近十天审批数目的值的数组
|
|
|
|
List<Integer> approvalList = dgAuditProcessMapper.selectApprovalNum(Integer.parseInt(userId)); |
|
|
|
List<Integer>approvalList = dgAuditProcessMapper.selectApprovalNum(Integer.parseInt(userId)); |
|
|
|
Map map = new HashMap(); |
|
|
|
Map map = new HashMap(); |
|
|
|
map.put("timeArr", timeList); |
|
|
|
map.put("timeArr",timeList); |
|
|
|
map.put("approvalNumArr", approvalList); |
|
|
|
map.put("approvalNumArr",approvalList); |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public List<PersonalEfficiencyListResponse> queryPersonalEfficiencyList() { |
|
|
|
|
|
|
|
int size = 100; |
|
|
|
|
|
|
|
List<PersonalEfficiencyListResponse> efficiencyList = new ArrayList<>(); |
|
|
|
|
|
|
|
//获取当前登录用户id
|
|
|
|
|
|
|
|
int currentUser = Integer.parseInt(this.getUserId()); |
|
|
|
|
|
|
|
//获取当前用户拥有的角色ids
|
|
|
|
|
|
|
|
String roleIds = RedisUtil.get("dq:userRole:" + currentUser); |
|
|
|
|
|
|
|
//字符串格式
|
|
|
|
|
|
|
|
List<String> roleIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
if (roleIds != null) { |
|
|
|
|
|
|
|
String[] ids = roleIds.split(","); |
|
|
|
|
|
|
|
roleIdList = Arrays.asList(ids); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//数字格式
|
|
|
|
|
|
|
|
List<Integer> roleList = new ArrayList<>(); |
|
|
|
|
|
|
|
if (roleIds != null) { |
|
|
|
|
|
|
|
String[] roleId = roleIds.split(","); |
|
|
|
|
|
|
|
for (String id : roleId) { |
|
|
|
|
|
|
|
roleList.add(Integer.parseInt(id)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//查询用户处理过的业务
|
|
|
|
|
|
|
|
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
wrapper.eq("user_id", currentUser).groupBy("business_id").select("business_id"); |
|
|
|
|
|
|
|
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper); |
|
|
|
|
|
|
|
if (auditProcessList != null && auditProcessList.size() != 0) { |
|
|
|
|
|
|
|
List<Integer> businessIdList = new ArrayList<>(); |
|
|
|
|
|
|
|
auditProcessList.forEach(dgAuditProcess -> { |
|
|
|
|
|
|
|
businessIdList.add(dgAuditProcess.getBusinessId()); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据业务id查询业务流程,统计耗时,完成时间
|
|
|
|
|
|
|
|
businessIdList.forEach(businessId -> { |
|
|
|
|
|
|
|
//new返回对象
|
|
|
|
|
|
|
|
PersonalEfficiencyListResponse efficiencyListResponse = new PersonalEfficiencyListResponse(); |
|
|
|
|
|
|
|
efficiencyListResponse.setBusinessId(businessId); |
|
|
|
|
|
|
|
//根据业务id查询业务
|
|
|
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = applyAmountInfoMapper.selectById(businessId); |
|
|
|
|
|
|
|
//业务申请日期
|
|
|
|
|
|
|
|
Date createTime = dgApplyAmountInfo.getCreateTime(); |
|
|
|
|
|
|
|
//客户公司id
|
|
|
|
|
|
|
|
Integer companyId = dgApplyAmountInfo.getCompanyId(); |
|
|
|
|
|
|
|
//提单人id
|
|
|
|
|
|
|
|
Integer presenterId = dgApplyAmountInfo.getPresenterId(); |
|
|
|
|
|
|
|
efficiencyListResponse.setApplicantId(presenterId); |
|
|
|
|
|
|
|
efficiencyListResponse.setApplicationDate(new SimpleDateFormat("yyyy-MM-dd").format(createTime)); |
|
|
|
|
|
|
|
efficiencyListResponse.setClientName(String.valueOf(companyId)); |
|
|
|
|
|
|
|
//获取累计耗时,完成时间,任务节点
|
|
|
|
|
|
|
|
HashMap<String, Object> hashMap = getTime(businessId, currentUser); |
|
|
|
|
|
|
|
Object countTime = hashMap.get("countTime"); |
|
|
|
|
|
|
|
Object endTime = hashMap.get("endTime"); |
|
|
|
|
|
|
|
efficiencyListResponse.setTimeConsuming(String.valueOf(countTime)); |
|
|
|
|
|
|
|
efficiencyListResponse.setCompleteTime(String.valueOf(endTime)); |
|
|
|
|
|
|
|
efficiencyList.add(efficiencyListResponse); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
//获取每个业务id的三种状态
|
|
|
|
|
|
|
|
HashMap<Integer, Object> hashMap = Maps.newHashMap(); |
|
|
|
|
|
|
|
//角色不为空
|
|
|
|
|
|
|
|
//担保业务员角色、担保经理角色
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_YWY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_JL_ID))) { |
|
|
|
|
|
|
|
//业务申请列表查询
|
|
|
|
|
|
|
|
IPage<BusinessApplicationListResponse> positionVO = applyAmountListMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId()); |
|
|
|
|
|
|
|
List<BusinessApplicationListResponse> records = positionVO.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0){ |
|
|
|
|
|
|
|
records.forEach(businessApplicationListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = businessApplicationListResponse.getBusinessId(); |
|
|
|
|
|
|
|
String name = businessApplicationListResponse.getName(); |
|
|
|
|
|
|
|
Integer status = businessApplicationListResponse.getStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = businessApplicationListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = businessApplicationListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(1); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//担保经理角色、担保A角角色、担保B角角色、担保领导角色
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.DB_LD_ID))) { |
|
|
|
|
|
|
|
// 担保部调查列表
|
|
|
|
|
|
|
|
IPage<GuaranteeListResponse> positionVO = guaranteeAssignUserMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null); |
|
|
|
|
|
|
|
List<GuaranteeListResponse> records = positionVO.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(guaranteeListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = guaranteeListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = guaranteeListResponse.getStatus(); |
|
|
|
|
|
|
|
String name = guaranteeListResponse.getName(); |
|
|
|
|
|
|
|
Integer operatingStatus = guaranteeListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = guaranteeListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(2); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//资产经理角色、资产专员角色、资产领导角色
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.ZC_ZY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.ZC_LD_ID))) { |
|
|
|
|
|
|
|
// 资产部调查列表
|
|
|
|
|
|
|
|
IPage<AssetsInvestigationListResponse> positionVO = assetsInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null); |
|
|
|
|
|
|
|
List<AssetsInvestigationListResponse> records = positionVO.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(assetsInvestigationListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = assetsInvestigationListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = assetsInvestigationListResponse.getStatus(); |
|
|
|
|
|
|
|
String name = assetsInvestigationListResponse.getName(); |
|
|
|
|
|
|
|
Integer operatingStatus = assetsInvestigationListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = assetsInvestigationListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(3); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//信息经理角色、信息专员角色、信息领导角色
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.XX_JL_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.XX_ZY_ID)) | roleIdList.contains(String.valueOf(PromptSuccess.XX_LD_ID))) { |
|
|
|
|
|
|
|
// 信息部调查列表
|
|
|
|
|
|
|
|
IPage<MessageInvestigationListResponse> positionVO = messageInvestigationMapper.pageByCondition(new Page(1, size), "", roleIdList, this.getUserId(), null); |
|
|
|
|
|
|
|
List<MessageInvestigationListResponse> records = positionVO.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(messageInvestigationListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = messageInvestigationListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = messageInvestigationListResponse.getStatus(); |
|
|
|
|
|
|
|
String name = messageInvestigationListResponse.getName(); |
|
|
|
|
|
|
|
Integer operatingStatus = messageInvestigationListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = messageInvestigationListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(4); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//担保部A/B角、法规经理角色、法规部C角、法规部分管领导
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_C_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_LD_ID))) { |
|
|
|
|
|
|
|
// 合规调查列表
|
|
|
|
|
|
|
|
DgComplianceInvestigationRequest dgComplianceInvestigationRequest = new DgComplianceInvestigationRequest(); |
|
|
|
|
|
|
|
IPage<DgComplianceInvestigationResponse> list = complianceInvestigationMapper.list(new Page(1, size), dgComplianceInvestigationRequest, roleList, currentUser); |
|
|
|
|
|
|
|
List<DgComplianceInvestigationResponse> records = list.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(dgComplianceInvestigationResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = dgComplianceInvestigationResponse.getBusinessId(); |
|
|
|
|
|
|
|
String name = dgComplianceInvestigationResponse.getName(); |
|
|
|
|
|
|
|
Integer status = dgComplianceInvestigationResponse.getAuditStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = dgComplianceInvestigationResponse.getOperationStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = dgComplianceInvestigationResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(5); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//工作会
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.GZU_ID))) { |
|
|
|
|
|
|
|
IPage<DgWorkConferencePO> list = workConferenceConsiderMapper.list(new Page(1, size), "", roleList, currentUser); |
|
|
|
|
|
|
|
List<DgWorkConferencePO> records = list.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(dgWorkConferencePO -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = dgWorkConferencePO.getBusinessId(); |
|
|
|
|
|
|
|
String name = dgWorkConferencePO.getName(); |
|
|
|
|
|
|
|
Integer status = dgWorkConferencePO.getAuditStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = dgWorkConferencePO.getOperationStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = dgWorkConferencePO.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(6); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//担保部A/B角、贷审会
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DSH_ID))) { |
|
|
|
|
|
|
|
IPage<DgLoanCommitteeConsiderResponse> list = loanCommitteeConsiderMapper.list(new Page(1, size), "", roleList, currentUser); |
|
|
|
|
|
|
|
List<DgLoanCommitteeConsiderResponse> records = list.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(dgLoanCommitteeConsiderResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
Integer businessId = dgLoanCommitteeConsiderResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = dgLoanCommitteeConsiderResponse.getStatus(); |
|
|
|
|
|
|
|
String name = dgLoanCommitteeConsiderResponse.getName(); |
|
|
|
|
|
|
|
Integer operatingStatus = dgLoanCommitteeConsiderResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = dgLoanCommitteeConsiderResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(7); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//法规经理、担保部A/B角、资产部经理
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_A_ID))|roleIdList.contains(String.valueOf(PromptSuccess.DB_B_ID))|roleIdList.contains(String.valueOf(PromptSuccess.ZC_JL_ID)) ) { |
|
|
|
|
|
|
|
//担保函
|
|
|
|
|
|
|
|
IPage<GuaranteeLetterListResponse> iPage = guaranteeLetterAssignUserMapper.pageByCondition(new Page(1, size), currentUser, roleIdList, null, null); |
|
|
|
|
|
|
|
List<GuaranteeLetterListResponse> records = iPage.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(guaranteeLetterListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
String name = guaranteeLetterListResponse.getName(); |
|
|
|
|
|
|
|
Integer businessId = guaranteeLetterListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = guaranteeLetterListResponse.getStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = guaranteeLetterListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = guaranteeLetterListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(8); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//财务部、法规经理
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.CWB_ID))|roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) { |
|
|
|
|
|
|
|
//回款确认
|
|
|
|
|
|
|
|
IPage<PaymentConfirmationListResponse> iPage = paymentConfirmationConsiderMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null); |
|
|
|
|
|
|
|
List<PaymentConfirmationListResponse> records = iPage.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(paymentConfirmationListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
String name = paymentConfirmationListResponse.getName(); |
|
|
|
|
|
|
|
Integer businessId = paymentConfirmationListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = paymentConfirmationListResponse.getStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = paymentConfirmationListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = paymentConfirmationListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(9); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//法规经理
|
|
|
|
|
|
|
|
if (roleIdList.contains(String.valueOf(PromptSuccess.FG_JL_ID))) { |
|
|
|
|
|
|
|
//放款通知
|
|
|
|
|
|
|
|
IPage<LoanNoticeListResponse> iPage = loanNoticeMapper.pageByCondition(new Page(1, size), roleIdList, currentUser, null, null); |
|
|
|
|
|
|
|
List<LoanNoticeListResponse> records = iPage.getRecords(); |
|
|
|
|
|
|
|
if (records!=null && records.size()!=0) { |
|
|
|
|
|
|
|
records.forEach(loanNoticeListResponse -> { |
|
|
|
|
|
|
|
StatusPO statusPO = new StatusPO(); |
|
|
|
|
|
|
|
String name = loanNoticeListResponse.getName(); |
|
|
|
|
|
|
|
Integer businessId = loanNoticeListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Integer status = loanNoticeListResponse.getStatus(); |
|
|
|
|
|
|
|
Integer operatingStatus = loanNoticeListResponse.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = loanNoticeListResponse.getBusinessStatus(); |
|
|
|
|
|
|
|
statusPO.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
statusPO.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
statusPO.setProcessId(10); |
|
|
|
|
|
|
|
statusPO.setName(name); |
|
|
|
|
|
|
|
statusPO.setStatus(status); |
|
|
|
|
|
|
|
hashMap.put(businessId, statusPO); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//再次循环,拼接数据
|
|
|
|
|
|
|
|
efficiencyList.forEach(personalEfficiencyListResponse -> { |
|
|
|
|
|
|
|
Integer businessId = personalEfficiencyListResponse.getBusinessId(); |
|
|
|
|
|
|
|
Object o = hashMap.get(businessId); |
|
|
|
|
|
|
|
//有数据
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotNull(o)){ |
|
|
|
|
|
|
|
//强制转换
|
|
|
|
|
|
|
|
if (o instanceof StatusPO){ |
|
|
|
|
|
|
|
StatusPO statusPO = (StatusPO)o; |
|
|
|
|
|
|
|
String name = statusPO.getName(); |
|
|
|
|
|
|
|
Integer operatingStatus = statusPO.getOperatingStatus(); |
|
|
|
|
|
|
|
Integer processId = statusPO.getProcessId(); |
|
|
|
|
|
|
|
Integer status = statusPO.getStatus(); |
|
|
|
|
|
|
|
Integer businessStatus = statusPO.getBusinessStatus(); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setTaskNode(String.valueOf(processId)); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setBusinessStatus(businessStatus); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setOperatingStatus(operatingStatus); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setApproveStatus(status); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setClientName(name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String timeConsuming = personalEfficiencyListResponse.getTimeConsuming(); |
|
|
|
|
|
|
|
String totalTimeConsuming = countTime(timeConsuming); |
|
|
|
|
|
|
|
personalEfficiencyListResponse.setTimeConsuming(totalTimeConsuming); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return efficiencyList; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据业务id和用户id统计耗时
|
|
|
|
|
|
|
|
private HashMap<String, Object> getTime(Integer businessId, Integer userId) { |
|
|
|
|
|
|
|
HashMap<String, Object> hashMap = Maps.newHashMap(); |
|
|
|
|
|
|
|
//根据业务id查询业务流程表
|
|
|
|
|
|
|
|
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
wrapper.eq("business_id", businessId).orderByAsc("create_time"); |
|
|
|
|
|
|
|
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper); |
|
|
|
|
|
|
|
long countTime = 0L; |
|
|
|
|
|
|
|
if (auditProcessList.size()>1){ |
|
|
|
|
|
|
|
//遍历业务流程数据,统计该用户的耗时
|
|
|
|
|
|
|
|
for (int i = 1; i <= auditProcessList.size() - 1; i++) { |
|
|
|
|
|
|
|
//从第二条数据开始,获取该数据
|
|
|
|
|
|
|
|
DgAuditProcess auditProcess = auditProcessList.get(i); |
|
|
|
|
|
|
|
//该数据是当前用户处理的
|
|
|
|
|
|
|
|
if (auditProcess.getUserId().equals(userId)) { |
|
|
|
|
|
|
|
//获取上一流程的时间节点
|
|
|
|
|
|
|
|
DgAuditProcess previousProcess = auditProcessList.get(i - 1); |
|
|
|
|
|
|
|
Date previousTime = previousProcess.getCreateTime(); |
|
|
|
|
|
|
|
Date currentTime = auditProcess.getCreateTime(); |
|
|
|
|
|
|
|
long currentTimeTime = currentTime.getTime(); |
|
|
|
|
|
|
|
long previousTimeTime = previousTime.getTime(); |
|
|
|
|
|
|
|
//累计耗时,毫秒
|
|
|
|
|
|
|
|
countTime = currentTimeTime - previousTimeTime; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//查询结束时间
|
|
|
|
|
|
|
|
QueryWrapper<DgAuditProcess> wrapperTime = new QueryWrapper<>(); |
|
|
|
|
|
|
|
wrapperTime.eq("business_id", businessId).eq("user_id", userId).orderByDesc("create_time").last("limit 1"); |
|
|
|
|
|
|
|
DgAuditProcess auditProcess = dgAuditProcessMapper.selectOne(wrapperTime); |
|
|
|
|
|
|
|
Date endTime = auditProcess.getCreateTime(); |
|
|
|
|
|
|
|
hashMap.put("countTime", countTime); |
|
|
|
|
|
|
|
hashMap.put("endTime", new SimpleDateFormat("yyyy-MM-dd").format(endTime)); |
|
|
|
|
|
|
|
return hashMap; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String countTime(String totalTime) { |
|
|
|
|
|
|
|
long time = Long.parseLong(totalTime); |
|
|
|
|
|
|
|
long days = time/ (1000 * 60 * 60 * 24); |
|
|
|
|
|
|
|
long hours = (time% (1000 * 60 * 60 * 24)) / (1000 * 60 * 60); |
|
|
|
|
|
|
|
long minutes = (time% (1000 * 60 * 60)) / (1000 * 60); |
|
|
|
|
|
|
|
long seconds = (time% (1000 * 60)) / 1000; |
|
|
|
|
|
|
|
return days + "天" + hours + "小时"+ minutes +"分钟"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当前登录用户信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private String getUserId() { |
|
|
|
|
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
|
|
|
|
String token = request.getHeader("token"); |
|
|
|
|
|
|
|
return RedisUtil.get("dq:token:" + token); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |