master
shijie 4 years ago
parent 7f65d16695
commit eb5edc18bf
  1. 11
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgEfficiencyServiceImpl.java

@ -170,6 +170,7 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
Integer processId; // 业务节点id
String departmentIdList; // 部门id集合
// 将数据归类
for (List<DgTeamEfficiencyPO> dgTeamEfficiencyList : list) {
if (dgTeamEfficiencyList.size() < 2) {
continue;
@ -183,13 +184,14 @@ 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();
Map<String,String> timeSumByDepId = new HashMap<String,String>();
for (String departmentId : departmentIds) {
if (departmentId.equals("0")) {
continue;
}
int pd = processId+Integer.parseInt(departmentId);
String dl = dgTeamEfficiencyList.size()+"*"+i+"*"+departmentId;
// 没有当前部门的数据,直接新建一个
if (hashMap.get(Integer.parseInt(departmentId)) == null) {
hashMap.put(Integer.parseInt(departmentId), map);
@ -204,12 +206,11 @@ public class DgEfficiencyServiceImpl extends ServiceImpl<DgEfficiencyMapper, DgA
// 计算当前部门在当前节点的累计时间
String existTime = existMap.get(processId).substring(0, existMap.get(processId).indexOf(","));
//int sumTime = Integer.parseInt(existTime) + Integer.parseInt(time);
//timeSumByDepId 这个map只用于记录遍历部门多少次数
timeSumByDepId.put(Integer.parseInt(departmentId),time);
timeSumByDepId.put(dl,time);
if(timeSumByDepId.size()>1){
// 累计时间加上本次时间
existMap.put(processId, (Integer.parseInt(time)) + "," + count);
existMap.put(processId, (Integer.parseInt(existTime)) + "," + count);
}else{
existMap.put(processId, (Integer.parseInt(existTime) + Integer.parseInt(time)) + "," + count);
}

Loading…
Cancel
Save