|
@@ -409,6 +409,7 @@ public class ChuanyunProjectScheduledTask {
|
|
|
*/
|
|
|
@Scheduled(fixedDelay = 3600000L)
|
|
|
private void standardWeeklyWorkHour() {
|
|
|
+ long start=Instant.now().getEpochSecond();
|
|
|
//删除数据库中审批中的数据,防止重复记录工时
|
|
|
chuanyunWeekMemberHourDao.deleteAllByStatus("2");
|
|
|
//更新数据库
|
|
@@ -429,10 +430,11 @@ public class ChuanyunProjectScheduledTask {
|
|
|
chuanyunWeekMemberHourDao.save(weekMemberHourDO);
|
|
|
}
|
|
|
});
|
|
|
+ log.info("周工时标准化"+(Instant.now().getEpochSecond()-start)+"秒");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 人力成本
|
|
|
+ * 单月工时汇总
|
|
|
*/
|
|
|
@Scheduled(fixedDelay = 3600000L)
|
|
|
private void standardMonthlyWorkHour() {
|
|
@@ -440,11 +442,11 @@ public class ChuanyunProjectScheduledTask {
|
|
|
var pageSize = 20;
|
|
|
var page = 0;
|
|
|
while(flag) {
|
|
|
+ long start=Instant.now().getEpochSecond();
|
|
|
var pageable= PageRequest.of(page,pageSize);
|
|
|
var chuanyunUserCompanyList = chuanyunUserCompanyDao.findAllByStatus(1,pageable);
|
|
|
if (page<=chuanyunUserCompanyList.getTotalPages()){
|
|
|
page += 1;
|
|
|
- //逐个将员工每天工时进行统计汇总
|
|
|
List<ChuanyunUserCompanyDO> userCompanyDOList = chuanyunUserCompanyList.getContent();
|
|
|
//单项目单人单月成本
|
|
|
userCompanyDOList.forEach(this::standardMonthlyHour);
|
|
@@ -459,6 +461,7 @@ public class ChuanyunProjectScheduledTask {
|
|
|
* @param chuanyunUserCompanyDO 员工信息
|
|
|
*/
|
|
|
private void standardMonthlyHour(ChuanyunUserCompanyDO chuanyunUserCompanyDO) {
|
|
|
+ long start=Instant.now().getEpochSecond();
|
|
|
var objectMapper=new ObjectMapper();
|
|
|
//每月每项目工时,按月-项目-用户分组统计标准工时
|
|
|
List<ChuanyunSelfWorkHourDO> list = chuanyunSelfWorkHourDao.getMonthProjectHour(chuanyunUserCompanyDO.getUserId());
|
|
@@ -490,6 +493,7 @@ public class ChuanyunProjectScheduledTask {
|
|
|
}
|
|
|
chuanyunSelfCostDao.save(chuanyunSelfCostDO);
|
|
|
});
|
|
|
+ log.info("月工时标准化"+(Instant.now().getEpochSecond()-start)+"秒");
|
|
|
}
|
|
|
|
|
|
/**
|