|
@@ -14,6 +14,7 @@ import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunWeekMemberHourDTO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
@@ -44,33 +45,6 @@ public class LogUpdateService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 更新所有日工时
|
|
|
- */
|
|
|
- public void updateAllChuanyunSelfWorkHour() {
|
|
|
- long startTime = Instant.now().getEpochSecond();
|
|
|
- chuanyunUserCompanyDao.findAll().forEach(chuanyunUserCompanyDO -> this.updateChuanyunSelfWorkHourListByUserId(chuanyunUserCompanyDO.getUserId()));
|
|
|
- log.info("更新所有每日工时花费" + (Instant.now().getEpochSecond() - startTime) + "秒");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新所有周工时
|
|
|
- */
|
|
|
- public void updateAllChuanyunWeekMemberHour() {
|
|
|
- long startTime = Instant.now().getEpochSecond();
|
|
|
- chuanyunUserCompanyDao.findAll().forEach(chuanyunUserCompanyDO -> this.updateChuanyunWeekMemberHourListByUserId(chuanyunUserCompanyDO.getUserId()));
|
|
|
- log.info("更新所有每周工时花费" + (Instant.now().getEpochSecond() - startTime) + "秒");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 更新所有月工时
|
|
|
- */
|
|
|
- public void updateAllChuanyunSelfCost() {
|
|
|
- long startTime = Instant.now().getEpochSecond();
|
|
|
- chuanyunUserCompanyDao.findAll().forEach(chuanyunUserCompanyDO -> this.updateChuanyunSelfCostListByUserId(chuanyunUserCompanyDO.getUserId()));
|
|
|
- log.info("更新所有每月工时花费" + (Instant.now().getEpochSecond() - startTime) + "秒");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* 更新最近一个月的标准每日工时
|
|
|
*/
|
|
|
public void updateRecentChuanyunSelfWorkHour() {
|
|
@@ -95,6 +69,7 @@ public class LogUpdateService {
|
|
|
*
|
|
|
* @param userId 用户ID
|
|
|
*/
|
|
|
+ @Async
|
|
|
public void updateChuanyunSelfWorkHourListByUserId(String userId) {
|
|
|
List<ChuanyunSelfWorkHourDO> updateList = chuanyunSelfWorkHourDao.findByUserId(userId);
|
|
|
this.updateChuanyunSelfWorkHourList(updateList);
|
|
@@ -105,6 +80,7 @@ public class LogUpdateService {
|
|
|
*
|
|
|
* @param userId 用户ID
|
|
|
*/
|
|
|
+ @Async
|
|
|
public void updateChuanyunWeekMemberHourListByUserId(String userId) {
|
|
|
List<ChuanyunWeekMemberHourDO> updateList = chuanyunWeekMemberHourDao.findByUserId(userId);
|
|
|
this.updateChuanyunWeekMemberHourList(updateList);
|
|
@@ -115,6 +91,7 @@ public class LogUpdateService {
|
|
|
*
|
|
|
* @param userId 用户ID
|
|
|
*/
|
|
|
+ @Async
|
|
|
public void updateChuanyunSelfCostListByUserId(String userId) {
|
|
|
List<ChuanyunSelfCostDO> updateList = chuanyunSelfCostDao.findByUserId(userId);
|
|
|
this.updateChuanyunSelfCostList(updateList);
|