|
|
@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.constant.ProjectConstant; |
|
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; |
|
|
|
import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; |
|
|
|
import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; |
|
|
@ -436,16 +437,33 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO |
|
|
|
ifBeforeYesterday = false; |
|
|
|
} |
|
|
|
List<ScreenProjectDataDTO> projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId); |
|
|
|
//如果不是昨天立项
|
|
|
|
if(!CollectionUtils.isEmpty(projects) && !ifBeforeYesterday) |
|
|
|
computerIfExceed(projects,exceedLimit,about2exceedLimit); |
|
|
|
projects.forEach(project -> { |
|
|
|
if (ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())) { |
|
|
|
//绿灯事件-结案项目
|
|
|
|
project.setProjectLevel(NumConstant.THREE); |
|
|
|
} else { |
|
|
|
if (NumConstant.ZERO == project.getResponseCount()) { |
|
|
|
//红灯事件-未做任何响应处理未结案的项目
|
|
|
|
project.setProjectLevel(NumConstant.ONE); |
|
|
|
} else { |
|
|
|
//黄灯事件-至少做过一次响应处理答复但未结案的项目
|
|
|
|
project.setProjectLevel(NumConstant.TWO); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
// //如果不是昨天立项
|
|
|
|
// if(!CollectionUtils.isEmpty(projects) && !ifBeforeYesterday) {
|
|
|
|
// computerIfExceed(projects,exceedLimit,about2exceedLimit);
|
|
|
|
// }
|
|
|
|
|
|
|
|
return projects; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void computerIfExceed(List<ScreenProjectDataDTO> list,Integer exceedLimit,Integer about2exceedLimit){ |
|
|
|
if(CollectionUtils.isEmpty(list)) return; |
|
|
|
if(CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Result<List<CostDayResultDTO>> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); |
|
|
|
if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ |
|
|
|
//key : projectId
|
|
|
@ -456,11 +474,12 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO |
|
|
|
if(!CollectionUtils.isEmpty(days)){ |
|
|
|
Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); |
|
|
|
//事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期
|
|
|
|
if(max > exceedLimit) |
|
|
|
if(max > exceedLimit) { |
|
|
|
o.setProjectLevel(NumConstant.ONE); |
|
|
|
else if(max >= about2exceedLimit) |
|
|
|
} else if(max >= about2exceedLimit) { |
|
|
|
o.setProjectLevel(NumConstant.TWO); |
|
|
|
} |
|
|
|
} |
|
|
|
return o; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
@ -476,5 +495,38 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO |
|
|
|
return baseDao.getProjectPeriodForDiff(param.getCustomerId(),param.getDateId()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 计算项目事件级别 |
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param customerId |
|
|
|
* @return void |
|
|
|
* @author zhaoqifeng |
|
|
|
* @date 2021/4/28 14:47 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void setProjectLevel(List<ScreenProjectDataDTO> list, String customerId) { |
|
|
|
if(CollectionUtils.isEmpty(list)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
List<ScreenProjectDataDTO> projects = baseDao.selectResponseCount(customerId); |
|
|
|
Map<String, ScreenProjectDataDTO> map = projects.stream().collect(Collectors.toMap(ScreenProjectDataDTO :: getParentId, v -> v, (v1, v2) -> v1)); |
|
|
|
|
|
|
|
list.forEach(item -> { |
|
|
|
ScreenProjectDataDTO dto = map.get(item.getProjectId()); |
|
|
|
if (ProjectConstant.CLOSED.equals(dto.getProjectStatusCode())) { |
|
|
|
item.setProjectLevel(NumConstant.THREE); |
|
|
|
} else { |
|
|
|
if (NumConstant.ZERO == dto.getResponseCount()) { |
|
|
|
//红灯事件-未做任何响应处理未结案的项目
|
|
|
|
item.setProjectLevel(NumConstant.ONE); |
|
|
|
} else { |
|
|
|
//黄灯事件-至少做过一次响应处理答复但未结案的项目
|
|
|
|
item.setProjectLevel(NumConstant.TWO); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|