|
@@ -4,10 +4,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
|
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
|
import com.galaxis.manatee.constant.ChuanYunConstant;
|
|
|
-import com.galaxis.manatee.dao.*;
|
|
|
+import com.galaxis.manatee.dao.ChuanyunMemberCostDao;
|
|
|
+import com.galaxis.manatee.dao.ChuanyunSelfWorkHourDao;
|
|
|
+import com.galaxis.manatee.dao.ChuanyunUserCompanyDao;
|
|
|
+import com.galaxis.manatee.dao.ChuanyunWorkHourDao;
|
|
|
import com.galaxis.manatee.entity.chuanyun.data.object.*;
|
|
|
import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunSaveDTO;
|
|
|
import com.galaxis.manatee.entity.chuanyun.dto.Filter;
|
|
@@ -15,11 +16,8 @@ import com.galaxis.manatee.exception.BigSizeException;
|
|
|
import com.galaxis.manatee.manager.ChuanYunManager;
|
|
|
import com.galaxis.manatee.service.LogService;
|
|
|
import com.galaxis.manatee.service.LogStandardService;
|
|
|
-import com.galaxis.manatee.util.ChuanyunLocalDateTimeDeserializer;
|
|
|
-import com.galaxis.manatee.util.ChuanyunLocalDateTimeSerializer;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -27,7 +25,6 @@ import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -87,21 +84,7 @@ public class WorkHourStatistics {
|
|
|
* 每日工时标准化
|
|
|
*/
|
|
|
private void standardWorkHour() {
|
|
|
- var pageSize = 20;
|
|
|
- var page = 0;
|
|
|
- while (true) {
|
|
|
- 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(chuanyunUserCompanyDO -> logStandardService.standardHourByUserCompanyAndIsRecent(chuanyunUserCompanyDO, false));
|
|
|
- } else {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ chuanyunUserCompanyDao.findAll().forEach(chuanyunUserCompanyDO -> logStandardService.standardHourByUserCompanyAndIsRecent(chuanyunUserCompanyDO, false));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -295,148 +278,4 @@ public class WorkHourStatistics {
|
|
|
@JsonProperty("F0000007")
|
|
|
private String status;
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 人员项目周度工时
|
|
|
- */
|
|
|
- @Data
|
|
|
- static class ChuanyunProjectMemberWeekHourDTO {
|
|
|
-
|
|
|
- @JsonProperty("F0000001")
|
|
|
- private String projectId;
|
|
|
-
|
|
|
- @JsonProperty("F0000002")
|
|
|
- private String userId;
|
|
|
-
|
|
|
- @JsonProperty("F0000003")
|
|
|
- private String projectType;
|
|
|
-
|
|
|
- @JsonProperty("F0000004")
|
|
|
- private BigDecimal totalHour;
|
|
|
-
|
|
|
- @JsonProperty("F0000005")
|
|
|
- private BigDecimal personDays;
|
|
|
-
|
|
|
- @JsonProperty("F0000008")
|
|
|
- private String year;
|
|
|
-
|
|
|
- @JsonProperty("F0000006")
|
|
|
- private String week;
|
|
|
-
|
|
|
- @JsonProperty("F0000007")
|
|
|
- private String hourStatus;
|
|
|
-
|
|
|
- /**
|
|
|
- * 部门信息
|
|
|
- */
|
|
|
- @JsonProperty("F0000009")
|
|
|
- private String departmentId;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 工时标准化更新数据
|
|
|
- */
|
|
|
- @Data
|
|
|
- static class ChuanyunSelfWorkHourDTO {
|
|
|
-
|
|
|
- @JsonProperty("F0000002")
|
|
|
- private String userId;
|
|
|
-
|
|
|
- @JsonProperty("F0000001")
|
|
|
- private String projectId;
|
|
|
-
|
|
|
- /**
|
|
|
- * 项目类型
|
|
|
- */
|
|
|
- @JsonProperty("F0000005")
|
|
|
- private String projectType;
|
|
|
-
|
|
|
- @JsonProperty("F0000009")
|
|
|
- private String departmentName;
|
|
|
-
|
|
|
- /**
|
|
|
- * 流程状态
|
|
|
- */
|
|
|
- @JsonProperty("F0000006")
|
|
|
- private String status;
|
|
|
-
|
|
|
- @JsonProperty("F0000003")
|
|
|
- @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
- @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
- private LocalDateTime dayLogDate;
|
|
|
-
|
|
|
- @JsonProperty("F0000004")
|
|
|
- private BigDecimal standardWorkHour;
|
|
|
-
|
|
|
- /**
|
|
|
- * 部门Id
|
|
|
- */
|
|
|
- @JsonProperty("F0000007")
|
|
|
- private String departmentId;
|
|
|
-
|
|
|
- @JsonProperty("F0000008")
|
|
|
- private String userName;
|
|
|
-
|
|
|
- @JsonProperty("F0000010")
|
|
|
- private String bg;
|
|
|
- }
|
|
|
-
|
|
|
- @Data
|
|
|
- static class ChuanyunMemberMonthCostDTO {
|
|
|
- /**
|
|
|
- * 项目ID
|
|
|
- */
|
|
|
- @JsonProperty("F0000003")
|
|
|
- private String projectId;
|
|
|
-
|
|
|
- /**
|
|
|
- * 项目类型
|
|
|
- */
|
|
|
- @JsonProperty("F0000008")
|
|
|
- private String projectType;
|
|
|
-
|
|
|
- /**
|
|
|
- * 日志流程状态
|
|
|
- */
|
|
|
- @JsonProperty("F0000009")
|
|
|
- private String status;
|
|
|
-
|
|
|
- /**
|
|
|
- * 用户ID
|
|
|
- */
|
|
|
- @JsonProperty("F0000002")
|
|
|
- private String userId;
|
|
|
-
|
|
|
- /**
|
|
|
- * 日期
|
|
|
- */
|
|
|
- @JsonProperty("F0000004")
|
|
|
- @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
- @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
- private LocalDateTime dayLogDate;
|
|
|
-
|
|
|
- /**
|
|
|
- * 工时
|
|
|
- */
|
|
|
- @JsonProperty("F0000005")
|
|
|
- private BigDecimal workHour;
|
|
|
-
|
|
|
- /**
|
|
|
- * 成本
|
|
|
- */
|
|
|
- @JsonProperty("F0000006")
|
|
|
- private BigDecimal cost;
|
|
|
-
|
|
|
- /**
|
|
|
- * 月度工时汇总
|
|
|
- */
|
|
|
- @JsonProperty("F0000007")
|
|
|
- private BigDecimal monthWorkHour;
|
|
|
-
|
|
|
- /**
|
|
|
- * 部门Id
|
|
|
- */
|
|
|
- @JsonProperty("F0000010")
|
|
|
- private String departmentId;
|
|
|
- }
|
|
|
}
|