|
|
|
@ -234,40 +234,6 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
|
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(); |
|
|
|
|
//角色不为空
|
|
|
|
@ -490,31 +456,45 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//再次循环,拼接数据
|
|
|
|
|
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); |
|
|
|
|
}); |
|
|
|
|
//遍历map,key值为业务id
|
|
|
|
|
for (Integer key : hashMap.keySet()) { |
|
|
|
|
PersonalEfficiencyListResponse efficiencyListResponse = new PersonalEfficiencyListResponse(); |
|
|
|
|
efficiencyListResponse.setBusinessId(key); |
|
|
|
|
StatusPO po = (StatusPO)hashMap.get(key); |
|
|
|
|
Integer businessStatus = po.getBusinessStatus(); |
|
|
|
|
Integer operatingStatus = po.getOperatingStatus(); |
|
|
|
|
Integer processId = po.getProcessId(); |
|
|
|
|
Integer status = po.getStatus(); |
|
|
|
|
String name = po.getName(); |
|
|
|
|
//根据业务id查询业务
|
|
|
|
|
DgApplyAmountInfo dgApplyAmountInfo = applyAmountInfoMapper.selectById(key); |
|
|
|
|
//业务申请日期
|
|
|
|
|
Date createTime = dgApplyAmountInfo.getCreateTime(); |
|
|
|
|
//客户公司id
|
|
|
|
|
Integer companyId = dgApplyAmountInfo.getCompanyId(); |
|
|
|
|
//提单人id
|
|
|
|
|
Integer presenterId = dgApplyAmountInfo.getPresenterId(); |
|
|
|
|
efficiencyListResponse.setOperatingStatus(operatingStatus); |
|
|
|
|
efficiencyListResponse.setApproveStatus(status); |
|
|
|
|
efficiencyListResponse.setBusinessStatus(businessStatus); |
|
|
|
|
efficiencyListResponse.setTaskNode(String.valueOf(processId)); |
|
|
|
|
efficiencyListResponse.setClientName(name); |
|
|
|
|
efficiencyListResponse.setApplicantId(presenterId); |
|
|
|
|
efficiencyListResponse.setApplicationDate(new SimpleDateFormat("yyyy-MM-dd").format(createTime)); |
|
|
|
|
efficiencyListResponse.setClientName(String.valueOf(companyId)); |
|
|
|
|
//用户处理过业务,统计耗时
|
|
|
|
|
QueryWrapper<DgAuditProcess> wrapper = new QueryWrapper<>(); |
|
|
|
|
wrapper.eq("user_id", currentUser).eq("business_id",key); |
|
|
|
|
List<DgAuditProcess> auditProcessList = dgAuditProcessMapper.selectList(wrapper); |
|
|
|
|
if (auditProcessList != null && auditProcessList.size() != 0) { |
|
|
|
|
//获取累计耗时,完成时间
|
|
|
|
|
HashMap<String, Object> hashMapTime = getTime(key, currentUser); |
|
|
|
|
Object countTime = hashMapTime.get("countTime"); |
|
|
|
|
Object endTime = hashMapTime.get("endTime"); |
|
|
|
|
efficiencyListResponse.setTimeConsuming(countTime(String.valueOf(countTime))); |
|
|
|
|
efficiencyListResponse.setCompleteTime(String.valueOf(endTime)); |
|
|
|
|
} |
|
|
|
|
efficiencyList.add(efficiencyListResponse); |
|
|
|
|
} |
|
|
|
|
return efficiencyList; |
|
|
|
|
} |
|
|
|
|