Browse Source

update .gitignore

Cyangbin 2 năm trước cách đây
mục cha
commit
4b90f1e577
27 tập tin đã thay đổi với 1 bổ sung3572 xóa
  1. 1 1
      .gitignore
  2. 0 13
      src/test/java/com/galaxis/manatee/ManateeApplicationTests.java
  3. 0 39
      src/test/java/com/galaxis/manatee/Test/askLeave/askLeaveTest.java
  4. 0 184
      src/test/java/com/galaxis/manatee/Test/buildProjectTest/BuildProjectTest.java
  5. 0 370
      src/test/java/com/galaxis/manatee/Test/fixStandard/fixStandardWorkHour.java
  6. 0 853
      src/test/java/com/galaxis/manatee/Test/implCost/WorkGroupImplCostTest.java
  7. 0 22
      src/test/java/com/galaxis/manatee/Test/payRoll/payRollTest.java
  8. 0 152
      src/test/java/com/galaxis/manatee/Test/project/CleanZhong.java
  9. 0 159
      src/test/java/com/galaxis/manatee/Test/project/ClosePDTest.java
  10. 0 231
      src/test/java/com/galaxis/manatee/Test/project/GetRepeatProject.java
  11. 0 61
      src/test/java/com/galaxis/manatee/Test/project/GetRepeatUser.java
  12. 0 95
      src/test/java/com/galaxis/manatee/Test/project/GroupProjectTest.java
  13. 0 19
      src/test/java/com/galaxis/manatee/Test/project/PushProjectChange.java
  14. 0 208
      src/test/java/com/galaxis/manatee/Test/reimbursement/ProjectImplTest.java
  15. 0 173
      src/test/java/com/galaxis/manatee/Test/reimbursement/ReimbursementTest.java
  16. 0 19
      src/test/java/com/galaxis/manatee/Test/reimbursement/SyncReimTest.java
  17. 0 160
      src/test/java/com/galaxis/manatee/Test/salaProjectTest/UpdateProjectName.java
  18. 0 32
      src/test/java/com/galaxis/manatee/Test/user/UserIdTest.java
  19. 0 61
      src/test/java/com/galaxis/manatee/Test/workHour/ChangeHistoryWorkHourTest.java
  20. 0 7
      src/test/java/com/galaxis/manatee/Test/workHour/ChangeWorkProjectTest.java
  21. 0 30
      src/test/java/com/galaxis/manatee/Test/workHour/LogTest.java
  22. 0 228
      src/test/java/com/galaxis/manatee/Test/workHour/SaveLog.java
  23. 0 35
      src/test/java/com/galaxis/manatee/Test/workHour/StandarSelfCostLogTest.java
  24. 0 171
      src/test/java/com/galaxis/manatee/Test/workHour/Standard.java
  25. 0 50
      src/test/java/com/galaxis/manatee/Test/workHour/clearErrorWorkHour.java
  26. 0 128
      src/test/java/com/galaxis/manatee/Test/workHour/fixBug.java
  27. 0 71
      src/test/java/com/galaxis/manatee/Test/workHour/updateDayWorkHour.java

+ 1 - 1
.gitignore

@@ -34,4 +34,4 @@ build/
 log/**
 /logs/**.**
 
-#/src/test/**
+/src/test/**

+ 0 - 13
src/test/java/com/galaxis/manatee/ManateeApplicationTests.java

@@ -1,13 +0,0 @@
-package com.galaxis.manatee;
-
-import org.junit.jupiter.api.Test;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-class ManateeApplicationTests {
-
-    @Test
-    void contextLoads() {
-    }
-
-}

+ 0 - 39
src/test/java/com/galaxis/manatee/Test/askLeave/askLeaveTest.java

@@ -1,39 +0,0 @@
-package com.galaxis.manatee.Test.askLeave;
-
-import com.galaxis.manatee.dao.ChuanyunAskForLeaveDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunAskForLeaveDO;
-import com.galaxis.manatee.service.DingTalkScheduledTask;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-
-@SpringBootTest
-public class askLeaveTest {
-
-    private DingTalkScheduledTask dingTalkScheduledTask;
-
-    private ChuanyunAskForLeaveDao askForLeaveDao;
-
-    @Autowired
-    public void setDingTalkScheduledTask(DingTalkScheduledTask dingTalkScheduledTask) {
-        this.dingTalkScheduledTask = dingTalkScheduledTask;
-    }
-
-    @Autowired
-    public void setAskForLeaveDao(ChuanyunAskForLeaveDao askForLeaveDao) {
-        this.askForLeaveDao = askForLeaveDao;
-    }
-
-    @Test
-    void test(){
-        dingTalkScheduledTask.manuallyAskForLeave();
-    }
-
-    @Test
-    void test2(){
-        List<ChuanyunAskForLeaveDO> byTitleSQL = askForLeaveDao.findByTitleSQL("2022-09-09 上午张学炳提交的请假");
-        System.out.println(byTitleSQL);
-    }
-}

+ 0 - 184
src/test/java/com/galaxis/manatee/Test/buildProjectTest/BuildProjectTest.java

@@ -1,184 +0,0 @@
-package com.galaxis.manatee.Test.buildProjectTest;
-
-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.galaxis.manatee.entity.chuanyun.data.object.ChuanyunBuildProject;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.WorkGroupService;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class BuildProjectTest {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    private WorkGroupService workGroupService;
-
-    @Test
-    void test1() {
-
-        //从氚云查询数据
-        // 由于存在两条不正常的数据需要排除在外
-        List<String> m = List.of("F0000003_2,AS21149");
-        var filter = Filter.instance(0, 10, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-
-        //保存
-        List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-        });
-        log.info("bpList: {}", bpList);
-
-    }
-
-    @Test
-    void test2() {
-//        workGroupService.findAll();
-
-    }
-
-
-    @Test
-    void test3() {
-
-        int start = 525;
-        long totalCount = 0L;
-        boolean flag = true;
-        int pageSize = 25;
-        int max = 530;
-        while (flag) {
-            try {
-                //从氚云查询数据
-                // 由于存在两条不正常的数据需要排除在外
-                List<String> m = List.of("status_2,1");
-                var filter = Filter.instance(start, max, true, Filter.AND, m);
-                var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-                if (chuanyunFindAllResponse.getReturnData() == null || chuanyunFindAllResponse.getReturnData().getBizObjectArray() == null) {
-                    flag = false;
-                    continue;
-                }
-                if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                    start += pageSize;
-                } else {
-                    flag = false;
-                }
-                //获取项目总数
-                totalCount = chuanyunFindAllResponse.getReturnData().getTotalCount();
-                //保存
-                List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-                ObjectMapper objectMapper = new ObjectMapper();
-                List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                });
-
-            } catch (Exception e) {
-                log.error(e.getMessage());
-                e.printStackTrace();
-            }
-
-        }
-
-
-    }
-
-    @Test
-    void test4() {
-
-        // 从氚云查询数据
-        // 由于存在两条不正常的数据需要排除在外
-        List<String> m = List.of("status_2,1");
-        var filter = Filter.instance(800, 900, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (chuanyunFindAllResponse.getReturnData() == null || chuanyunFindAllResponse.getReturnData().getBizObjectArray() == null) {
-            return;
-        }
-        //保存
-        List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-        });
-
-    }
-
-
-    @Test
-    void syncBuildProjectToSubTable() {
-        List<String> m = List.of("F0000016_2,实施");
-        var filter = Filter.instance(0, 400, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (chuanyunFindAllResponse.getReturnData() == null || chuanyunFindAllResponse.getReturnData().getBizObjectArray() == null) {
-            return;
-        }
-        //保存
-        List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-        });
-
-
-    }
-
-    @Data
-    static class ProjectSubAccount {
-        @JsonProperty("F0000102")
-        private String projectType;
-        @JsonProperty("F0000075")
-        private String implProjectName;
-        @JsonProperty("F0000001")
-        private String implProjectCode;
-        @JsonProperty("F0000007")
-        private String signingCompany;
-        @JsonProperty("F0000008")
-        private String customerName;
-        @JsonProperty("F0000034")
-        private String nameOfOwner;
-        @JsonProperty("F0000035")
-        private String projectManager;
-        @JsonProperty("F0000027")
-        private String SalesDirector;
-        @JsonProperty("F0000071")
-        private Integer systemWarranty;
-        @JsonProperty("F0000072")
-        private Integer deviceWarranty;
-
-    }
-
-    @Data
-    static class SaleToImpl {
-        @JsonProperty("F0000102")
-        private String SalesProjectCode;
-
-
-    }
-
-
-}
-

+ 0 - 370
src/test/java/com/galaxis/manatee/Test/fixStandard/fixStandardWorkHour.java

@@ -1,370 +0,0 @@
-package com.galaxis.manatee.Test.fixStandard;
-
-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.galaxis.manatee.constant.ChuanYunConstant;
-import com.galaxis.manatee.dao.*;
-import com.galaxis.manatee.entity.chuanyun.data.object.*;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunMonthLaborCostWgDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.WorkGroupService;
-import com.galaxis.manatee.util.CollectionsUtils;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.time.LocalDate;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Slf4j
-@SpringBootTest
-public class fixStandardWorkHour {
-
-    private ChuanYunManager chuanYunManager;
-    private ChuanyunGroupProjectDao groupProjectDao;
-    private ChuanyunProjectDao projectDao;
-    private ChuanyunSelfWorkHourDao selfWorkHourDao;
-    private ChuanyunReimbursementDao reimbursementDao;
-    private ChuanyunMonthLaborCostWgDao chuanyunMonthLaborCostWgDao;
-    private ChuanyunImplCostDao implCostDao;
-    private WorkGroupService workGroupService;
-
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Autowired
-    public void setGroupProjectDao(ChuanyunGroupProjectDao groupProjectDao) {
-        this.groupProjectDao = groupProjectDao;
-    }
-
-    @Autowired
-    public void setProjectDao(ChuanyunProjectDao projectDao) {
-        this.projectDao = projectDao;
-    }
-
-    @Autowired
-    public void setSelfWorkHourDao(ChuanyunSelfWorkHourDao selfWorkHourDao) {
-        this.selfWorkHourDao = selfWorkHourDao;
-    }
-
-    @Autowired
-    public void setReimbursementDao(ChuanyunReimbursementDao reimbursementDao) {
-        this.reimbursementDao = reimbursementDao;
-    }
-
-    @Autowired
-    public void setWorkGroupService(WorkGroupService workGroupService) {
-        this.workGroupService = workGroupService;
-    }
-
-    @Autowired
-    public void setChuanyunMonthLaborCostWgDao(ChuanyunMonthLaborCostWgDao chuanyunMonthLaborCostWgDao) {
-        this.chuanyunMonthLaborCostWgDao = chuanyunMonthLaborCostWgDao;
-    }
-
-    @Autowired
-    public void setImplCostDao(ChuanyunImplCostDao implCostDao) {
-        this.implCostDao = implCostDao;
-    }
-
-    @Test
-    void fix() {
-
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 500;
-        List<String> m = List.of("F0000005_5,生产项目", "F0000004_5,0", "F0000002_2,8352d30b-1d44-4c70-be3f-4cef2ace2dd5");
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true, Filter.AND, m);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMemberHourDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-            totalCount = chuanyunFindAllResponse.getReturnData().getTotalCount();
-            //转化为POJO
-            List<ChuanyunMemberHourDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            result.parallelStream().forEach(chuanyunMemberHourDO -> {
-                try {
-                    if (Objects.isNull(chuanyunMemberHourDO.getProjectCode()) || !StringUtils.hasLength(chuanyunMemberHourDO.getProjectCode())) {
-                        log.info("{}", chuanyunMemberHourDO);
-                        if (!Objects.isNull(chuanyunMemberHourDO.getProjectId()) && StringUtils.hasLength(chuanyunMemberHourDO.getProjectId())) {
-                            String projectCode = "";
-                            Optional<ChuanyunGroupProjectDO> groupProjectDO = groupProjectDao.findById(chuanyunMemberHourDO.getProjectId());
-                            if (groupProjectDO.isPresent()) {
-                                projectCode = groupProjectDO.get().getProjectCode();
-                            } else {
-                                Optional<ChuanyunProjectDO> projectDO = projectDao.findById(chuanyunMemberHourDO.getProjectId());
-                                if (projectDO.isPresent()) {
-                                    projectCode = projectDO.get().getProjectCode();
-                                }
-                            }
-                            if (StringUtils.hasLength(projectCode)) {
-                                UpdateProjectCodeDTO updateProjectCodeDTO = new UpdateProjectCodeDTO(projectCode);
-                                String s = objectMapper.writeValueAsString(updateProjectCodeDTO);
-                                log.info("更新项目编号: {}", s);
-                                chuanYunManager.update(ChuanyunMemberHourDO.SCHEMA_CODE, chuanyunMemberHourDO.getObjectId(), s);
-                            }
-
-                        }
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-            log.info("start: {},total: {}", start, totalCount);
-
-
-        }
-
-
-    }
-
-    @Data
-    class UpdateProjectCodeDTO {
-
-        @JsonProperty("F0000011")
-        private String projectCode;
-
-        public UpdateProjectCodeDTO(String projectCode) {
-            this.projectCode = projectCode;
-        }
-    }
-
-    @Test
-    void fixImplCost() {
-        Optional<ChuanyunGroupProjectDO> groupProjectDOOptional = groupProjectDao.findById("2e3018f9-8ab7-11ea-8ae9-7cd30ab711fe");
-        ChuanyunGroupProjectDO chuanyunGroupProjectDO = groupProjectDOOptional.get();
-        String groupProjectObjectId = chuanyunGroupProjectDO.getObjectId();
-        String groupProjectCode = chuanyunGroupProjectDO.getProjectCode();
-        // 查询项目报销单
-        Map<LocalDate, List<ChuanyunReimbursementDO>> reimbursementMap = new HashMap<>();
-        Map<LocalDate, List<ChuanyunSelfWorkHourDO>> workHoursMap = new HashMap<>();
-        Map<LocalDate, List<ChuanyunMonthLaborCostWgDTO>> laborCostMap = new HashMap<>();
-        List<ChuanyunReimbursementDO> reimbursements = reimbursementDao.findAllByGroupProjectIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), List.of(1, 2));
-        // 查询用户在该项目的报销单
-        // 报销单按日期分组
-        Map<LocalDate, List<ChuanyunReimbursementDO>> map1 = reimbursements.stream().collect(Collectors.groupingBy(chuanyunReimbursementDO -> {
-            if (!Objects.isNull(chuanyunReimbursementDO.getBusinessDate())) {
-                return LocalDate.of(chuanyunReimbursementDO.getBusinessDate().getYear(), chuanyunReimbursementDO.getBusinessDate().getMonthValue(), 1);
-            } else {
-                return LocalDate.of(2015, 1, 1);
-            }
-        }));
-
-        map1.forEach((localDate, chuanyunReimbursementDOS) -> {
-            boolean containsKey = reimbursementMap.containsKey(localDate);
-            if (containsKey) {
-                // 表示已经存在该key
-                List<ChuanyunReimbursementDO> reimbursementDOList = reimbursementMap.get(localDate);
-                reimbursementDOList.addAll(chuanyunReimbursementDOS);
-                reimbursementMap.put(localDate, reimbursementDOList);
-            } else {
-                reimbursementMap.put(localDate, chuanyunReimbursementDOS);
-            }
-        });
-
-        List<ChuanyunSelfWorkHourDO> workHours = selfWorkHourDao.findAllByProjectIdAndStatusIn(groupProjectObjectId, List.of("1", "2"));
-        Map<LocalDate, List<ChuanyunSelfWorkHourDO>> map2 = workHours.stream().collect(Collectors.groupingBy(chuanyunSelfWorkHourDO -> {
-            if (!Objects.isNull(chuanyunSelfWorkHourDO.getDayLogDate())) {
-                return LocalDate.of(chuanyunSelfWorkHourDO.getDayLogDate().getYear(), chuanyunSelfWorkHourDO.getDayLogDate().getMonthValue(), 1);
-            } else {
-                return LocalDate.of(2015, 1, 1);
-            }
-        }));
-        map2.forEach((localDate, chuanyunSelfWorkHourDOS) -> {
-            boolean containsKey = workHoursMap.containsKey(localDate);
-            if (containsKey) {
-                // 表示已经存在该key
-                List<ChuanyunSelfWorkHourDO> selfWorkHours = workHoursMap.get(localDate);
-                selfWorkHours.addAll(chuanyunSelfWorkHourDOS);
-                workHoursMap.put(localDate, selfWorkHours);
-            } else {
-                workHoursMap.put(localDate, chuanyunSelfWorkHourDOS);
-            }
-        });
-
-        // todo 修改为根据项目id来查
-        List<ChuanyunMonthLaborCostWgDTO> laborCostWgs = chuanyunMonthLaborCostWgDao.findAllByProjectCodeAndProjectId(groupProjectCode, groupProjectObjectId);
-        Map<LocalDate, List<ChuanyunMonthLaborCostWgDTO>> map3 = laborCostWgs.stream().collect(Collectors.groupingBy(chuanyunMonthLaborCostWgDTO -> {
-            if (!Objects.isNull(chuanyunMonthLaborCostWgDTO.getLogDate())) {
-                return LocalDate.of(chuanyunMonthLaborCostWgDTO.getLogDate().getYear(), chuanyunMonthLaborCostWgDTO.getLogDate().getMonthValue(), 1);
-            } else {
-                return LocalDate.of(2015, 1, 1);
-            }
-
-        }));
-        map3.forEach((localDate, chuanyunMonthLaborCostWgDTOS) -> {
-            boolean containsKey = laborCostMap.containsKey(localDate);
-            if (containsKey) {
-                // 表示已经存在该key
-                List<ChuanyunMonthLaborCostWgDTO> monthLaborCostWgs = laborCostMap.get(localDate);
-                monthLaborCostWgs.addAll(chuanyunMonthLaborCostWgDTOS);
-                laborCostMap.put(localDate, monthLaborCostWgs);
-            } else {
-                laborCostMap.put(localDate, chuanyunMonthLaborCostWgDTOS);
-            }
-        });
-
-        Set<LocalDate> localDates1 = reimbursementMap.keySet();
-        Set<LocalDate> localDates2 = workHoursMap.keySet();
-        Set<LocalDate> localDates3 = laborCostMap.keySet();
-
-        Set<LocalDate> collections = CollectionsUtils.mergeCollections(localDates1, localDates2);
-        Set<LocalDate> mergeCollections = CollectionsUtils.mergeCollections(collections, localDates3);
-
-        mergeCollections.forEach(localDate -> {
-            List<ChuanyunReimbursementDO> reimbursementList = reimbursementMap.getOrDefault(localDate, Collections.emptyList());
-            List<ChuanyunSelfWorkHourDO> selfWorkHourList = workHoursMap.getOrDefault(localDate, Collections.emptyList());
-            List<ChuanyunMonthLaborCostWgDTO> laborCostWgList = laborCostMap.getOrDefault(localDate, Collections.emptyList());
-
-            Map<String, List<ChuanyunReimbursementDO>> workGroupIdReimbursementMap = reimbursementList.stream().collect(Collectors.groupingBy(chuanyunReimbursementDO -> {
-                if (Objects.isNull(chuanyunReimbursementDO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunReimbursementDO.getWorkGroupId())) {
-                    return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                } else {
-                    return chuanyunReimbursementDO.getWorkGroupId();
-                }
-            }));
-            Map<String, List<ChuanyunSelfWorkHourDO>> workGroupIdSelfWorkHourMap = selfWorkHourList.stream().collect(Collectors.groupingBy(chuanyunSelfWorkHourDO -> {
-                if (Objects.isNull(chuanyunSelfWorkHourDO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunSelfWorkHourDO.getWorkGroupId())) {
-                    return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                } else {
-                    return chuanyunSelfWorkHourDO.getWorkGroupId();
-                }
-            }));
-            Map<String, List<ChuanyunMonthLaborCostWgDTO>> workGroupIdLaborCostMap = laborCostWgList.stream().collect(Collectors.groupingBy(chuanyunMonthLaborCostWgDTO -> {
-                if (Objects.isNull(chuanyunMonthLaborCostWgDTO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunMonthLaborCostWgDTO.getWorkGroupId())) {
-                    return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                } else {
-                    return chuanyunMonthLaborCostWgDTO.getWorkGroupId();
-                }
-            }));
-
-            Set<String> workGroup1 = workGroupIdReimbursementMap.keySet();
-            Set<String> workGroup2 = workGroupIdSelfWorkHourMap.keySet();
-            Set<String> workGroup3 = workGroupIdLaborCostMap.keySet();
-
-
-            Set<String> workGroupMergeCollections = CollectionsUtils.mergeStringCollections(workGroup1, workGroup2, workGroup3);
-            // 避免默认工作与实际工作组数据重复,可能会存在历史数据没有工作组,后面标准化的时候又补充了工作组信息。
-            workGroupMergeCollections.add(ChuanYunConstant.DEFAULT_WORK_GROUP);
-
-            workGroupMergeCollections.forEach(workGroupId -> {
-                List<ChuanyunReimbursementDO> reimbursementDOList = workGroupIdReimbursementMap.getOrDefault(workGroupId, Collections.emptyList());
-                List<ChuanyunSelfWorkHourDO> selfWorkHourDOS = workGroupIdSelfWorkHourMap.getOrDefault(workGroupId, Collections.emptyList());
-                List<ChuanyunMonthLaborCostWgDTO> monthLaborCostWgDTOS = workGroupIdLaborCostMap.getOrDefault(workGroupId, Collections.emptyList());
-
-                BigDecimal totalReimbursement;
-                BigDecimal totalManDay;
-                BigDecimal totalLaborCost;
-
-                if (reimbursementDOList.isEmpty()) {
-                    totalReimbursement = new BigDecimal("0.00");
-                } else {
-                    totalReimbursement = reimbursementDOList.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                }
-
-                if (selfWorkHourDOS.isEmpty()) {
-                    totalManDay = new BigDecimal("0.00");
-                } else {
-                    BigDecimal totalWorkHours = selfWorkHourDOS.stream().map(ChuanyunSelfWorkHourDO::getStandardWorkHour).reduce(BigDecimal.ZERO, BigDecimal::add);
-                    totalManDay = totalWorkHours.divide(BigDecimal.valueOf(8), 3, RoundingMode.UP);
-                }
-
-                if (monthLaborCostWgDTOS.isEmpty()) {
-                    totalLaborCost = new BigDecimal("0.00");
-                } else {
-                    totalLaborCost = monthLaborCostWgDTOS.stream().map(ChuanyunMonthLaborCostWgDTO::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-                }
-                // todo 变更
-                ChuanyunImplCostDO old = implCostDao.findByProjectIdAndProjectCodeAndWorkGroupAndLocalDate(groupProjectObjectId, groupProjectCode, workGroupId, localDate.atStartOfDay());
-                if (!Objects.isNull(old)) {
-                    BigDecimal oldImplCost = old.getImplCost();
-                    BigDecimal oldManDay = old.getManDay();
-                    BigDecimal oldLaborCost = old.getLaborCost();
-                    if (Objects.isNull(old.getLocalDate()) ||
-                            Objects.isNull(oldImplCost) ||
-                            Objects.isNull(oldManDay) ||
-                            Objects.isNull(oldLaborCost) ||
-                            oldImplCost.compareTo(totalReimbursement) != 0 ||
-                            oldManDay.compareTo(totalManDay) != 0 || oldLaborCost.compareTo(totalLaborCost) != 0) {
-                        old.setImplCost(totalReimbursement);
-                        old.setManDay(totalManDay);
-                        old.setLaborCost(totalLaborCost);
-                        if (!StringUtils.hasLength(old.getOwnerId()) && !Objects.isNull(chuanyunGroupProjectDO.getEbgProjectManagerObject())) {
-                            old.setOwnerId(chuanyunGroupProjectDO.getEbgProjectManagerObject().getObjectId());
-                        }
-                        implCostDao.saveAndFlush(old);
-                    }
-                } else {
-                    // 判断默认工作组数据
-                    String defaultWorkGroupName = ChuanYunConstant.DEFAULT_WORK_GROUP_NAME;
-                    ChuanyunWorkGroupDO workGroupDO = workGroupService.findByObjectId(workGroupId);
-                    if (!Objects.isNull(workGroupDO)) {
-                        defaultWorkGroupName = workGroupDO.getWorkGroupName();
-                    } else {
-                        ChuanyunHistoryWorkGroupDO historyWorkGroupDO = workGroupService.findInHistoryByObjectId(workGroupId);
-                        if (!Objects.isNull(historyWorkGroupDO)) {
-                            defaultWorkGroupName = historyWorkGroupDO.getWorkGroupName();
-                        }
-                    }
-                    ChuanyunImplCostDO chuanyunImplCostDO = new ChuanyunImplCostDO();
-                    chuanyunImplCostDO.setProjectId(chuanyunGroupProjectDO.getObjectId());
-                    chuanyunImplCostDO.setProjectCode(groupProjectCode);
-                    chuanyunImplCostDO.setLocalDate(localDate.atStartOfDay());
-                    chuanyunImplCostDO.setWorkGroup(workGroupId);
-                    chuanyunImplCostDO.setWorkGroupName(defaultWorkGroupName);
-                    chuanyunImplCostDO.setImplCost(totalReimbursement);
-                    chuanyunImplCostDO.setManDay(totalManDay);
-                    chuanyunImplCostDO.setLaborCost(totalLaborCost);
-                    if (!Objects.isNull(chuanyunGroupProjectDO.getEbgProjectManagerObject())) {
-
-                        chuanyunImplCostDO.setOwnerId(chuanyunGroupProjectDO.getEbgProjectManagerObject().getObjectId());
-                    }
-                    implCostDao.saveAndFlush(chuanyunImplCostDO);
-                }
-
-            });
-
-        });
-
-    }
-
-    @Test
-    void allSelfWork() {
-        List<ChuanyunSelfWorkHourDO> workHours = selfWorkHourDao.findAllByProjectIdAndStatusIn("1f48d45f-10bf-4b26-ad5a-9f0e41ad02ef", List.of("1", "2"));
-        List<ChuanyunSelfWorkHourDO> selfWorkHourDOS = workHours.stream().sorted(Comparator.comparing(ChuanyunSelfWorkHourDO::getDayLogDate)).toList();
-        selfWorkHourDOS.forEach(System.out::println);
-    }
-
-
-}

+ 0 - 853
src/test/java/com/galaxis/manatee/Test/implCost/WorkGroupImplCostTest.java

@@ -1,853 +0,0 @@
-package com.galaxis.manatee.Test.implCost;
-
-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.galaxis.manatee.constant.ChuanYunConstant;
-import com.galaxis.manatee.dao.ChuanyunImplCostDao;
-import com.galaxis.manatee.dao.ChuanyunMonthLaborCostWgDao;
-import com.galaxis.manatee.dao.ChuanyunReimbursementDao;
-import com.galaxis.manatee.dao.ChuanyunSelfWorkHourDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.*;
-import com.galaxis.manatee.entity.chuanyun.dto.*;
-import com.galaxis.manatee.exception.BigSizeException;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.manager.ClawFeign;
-import com.galaxis.manatee.service.GroupProjectService;
-import com.galaxis.manatee.service.ImplCostService;
-import com.galaxis.manatee.service.WorkGroupService;
-import com.galaxis.manatee.task.U9InfoTask;
-import com.galaxis.manatee.util.CollectionsUtils;
-import com.galaxis.manatee.util.TimeUtil;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Slf4j
-@SpringBootTest
-public class WorkGroupImplCostTest {
-
-    private WorkGroupService workGroupService;
-    private GroupProjectService groupProjectService;
-    private ChuanyunImplCostDao implCostDao;
-    private ChuanyunReimbursementDao reimbursementDao;
-    private ChuanyunSelfWorkHourDao selfWorkHourDao;
-    private ChuanyunMonthLaborCostWgDao chuanyunMonthLaborCostWgDao;
-    private ImplCostService implCostService;
-    private ChuanYunManager chuanYunManager;
-    private ClawFeign clawFeign;
-    private U9InfoTask infoTask;
-
-    @Autowired
-    public void setWorkGroupService(WorkGroupService workGroupService, GroupProjectService groupProjectService, ChuanyunImplCostDao implCostDao, ChuanyunReimbursementDao reimbursementDao, ChuanyunSelfWorkHourDao selfWorkHourDao, ChuanyunMonthLaborCostWgDao chuanyunMonthLaborCostWgDao) {
-        this.workGroupService = workGroupService;
-        this.groupProjectService = groupProjectService;
-        this.implCostDao = implCostDao;
-        this.reimbursementDao = reimbursementDao;
-        this.selfWorkHourDao = selfWorkHourDao;
-        this.chuanyunMonthLaborCostWgDao = chuanyunMonthLaborCostWgDao;
-    }
-
-    @Autowired
-    public void setImplCostService(ImplCostService implCostService) {
-        this.implCostService = implCostService;
-    }
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Autowired
-    public void setClawFeign(ClawFeign clawFeign) {
-        this.clawFeign = clawFeign;
-    }
-
-    @Autowired
-    public void setInfoTask(U9InfoTask infoTask) {
-        this.infoTask = infoTask;
-    }
-
-    @Test
-    public void saveU9LaborCostWg() {
-        infoTask.saveLaborCostWgTest();
-    }
-
-    @Test
-    void test1() {
-        List<ChuanyunGroupProjectDO> groupProjects = groupProjectService.findByProjectCode("D18002");
-        if (Objects.isNull(groupProjects)) {
-            return;
-        }
-        groupProjects.forEach(chuanyunGroupProjectDO -> {
-
-            String groupProjectObjectId = chuanyunGroupProjectDO.getObjectId();
-            String groupProjectCode = chuanyunGroupProjectDO.getProjectCode();
-            // 查询项目报销单
-            Map<LocalDate, List<ChuanyunReimbursementDO>> reimbursementMap = new HashMap<>();
-            Map<LocalDate, List<ChuanyunSelfWorkHourDO>> workHoursMap = new HashMap<>();
-            Map<LocalDate, List<ChuanyunMonthLaborCostWgDTO>> laborCostMap = new HashMap<>();
-            List<ChuanyunReimbursementDO> reimbursements = reimbursementDao.findAllByGroupProjectIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), List.of(1, 2));
-            // 查询用户在该项目的报销单
-            // 报销单按日期分组
-            Map<LocalDate, List<ChuanyunReimbursementDO>> map1 = reimbursements.stream().collect(Collectors.groupingBy(chuanyunReimbursementDO -> {
-                if (!Objects.isNull(chuanyunReimbursementDO.getBusinessDate())) {
-                    return LocalDate.of(chuanyunReimbursementDO.getBusinessDate().getYear(), chuanyunReimbursementDO.getBusinessDate().getMonthValue(), 1);
-                } else {
-                    return LocalDate.of(2015, 1, 1);
-                }
-            }));
-
-            map1.forEach((localDate, chuanyunReimbursementDOS) -> {
-                boolean containsKey = reimbursementMap.containsKey(localDate);
-                if (containsKey) {
-                    // 表示已经存在该key
-                    List<ChuanyunReimbursementDO> reimbursementDOList = reimbursementMap.get(localDate);
-                    reimbursementDOList.addAll(chuanyunReimbursementDOS);
-                    reimbursementMap.put(localDate, reimbursementDOList);
-                } else {
-                    reimbursementMap.put(localDate, chuanyunReimbursementDOS);
-                }
-            });
-
-            List<ChuanyunSelfWorkHourDO> workHours = selfWorkHourDao.findAllByProjectIdAndStatusIn(groupProjectObjectId, List.of("1", "2"));
-            Map<LocalDate, List<ChuanyunSelfWorkHourDO>> map2 = workHours.stream().collect(Collectors.groupingBy(chuanyunSelfWorkHourDO -> {
-                if (!Objects.isNull(chuanyunSelfWorkHourDO.getDayLogDate())) {
-                    return LocalDate.of(chuanyunSelfWorkHourDO.getDayLogDate().getYear(), chuanyunSelfWorkHourDO.getDayLogDate().getMonthValue(), 1);
-                } else {
-                    return LocalDate.of(2015, 1, 1);
-                }
-            }));
-            map2.forEach((localDate, chuanyunSelfWorkHourDOS) -> {
-                boolean containsKey = workHoursMap.containsKey(localDate);
-                if (containsKey) {
-                    // 表示已经存在该key
-                    List<ChuanyunSelfWorkHourDO> selfWorkHours = workHoursMap.get(localDate);
-                    selfWorkHours.addAll(chuanyunSelfWorkHourDOS);
-                    workHoursMap.put(localDate, selfWorkHours);
-                } else {
-                    workHoursMap.put(localDate, chuanyunSelfWorkHourDOS);
-                }
-            });
-            // todo 修改为根据项目id来查
-            List<ChuanyunMonthLaborCostWgDTO> laborCostWgs = chuanyunMonthLaborCostWgDao.findAllByProjectCodeAndProjectId(groupProjectCode, groupProjectObjectId);
-            Map<LocalDate, List<ChuanyunMonthLaborCostWgDTO>> map3 = laborCostWgs.stream().collect(Collectors.groupingBy(chuanyunMonthLaborCostWgDTO -> {
-                if (!Objects.isNull(chuanyunMonthLaborCostWgDTO.getLogDate())) {
-                    return LocalDate.of(chuanyunMonthLaborCostWgDTO.getLogDate().getYear(), chuanyunMonthLaborCostWgDTO.getLogDate().getMonthValue(), 1);
-                } else {
-                    return LocalDate.of(2015, 1, 1);
-                }
-
-            }));
-            map3.forEach((localDate, chuanyunMonthLaborCostWgDTOS) -> {
-                boolean containsKey = laborCostMap.containsKey(localDate);
-                if (containsKey) {
-                    // 表示已经存在该key
-                    List<ChuanyunMonthLaborCostWgDTO> monthLaborCostWgs = laborCostMap.get(localDate);
-                    monthLaborCostWgs.addAll(chuanyunMonthLaborCostWgDTOS);
-                    laborCostMap.put(localDate, monthLaborCostWgs);
-                } else {
-                    laborCostMap.put(localDate, chuanyunMonthLaborCostWgDTOS);
-                }
-            });
-
-            Set<LocalDate> localDates1 = reimbursementMap.keySet();
-            Set<LocalDate> localDates2 = workHoursMap.keySet();
-            Set<LocalDate> localDates3 = laborCostMap.keySet();
-
-            Set<LocalDate> collections = CollectionsUtils.mergeCollections(localDates1, localDates2);
-            Set<LocalDate> mergeCollections = CollectionsUtils.mergeCollections(collections, localDates3);
-
-            List<LocalDate> localDates = mergeCollections.stream().filter(localDate -> localDate.isAfter(LocalDate.of(2022, 7, 1))).toList();
-
-//            mergeCollections.forEach(localDate -> {
-            localDates.forEach(localDate -> {
-                List<ChuanyunReimbursementDO> reimbursementList = reimbursementMap.getOrDefault(localDate, Collections.emptyList());
-                List<ChuanyunSelfWorkHourDO> selfWorkHourList = workHoursMap.getOrDefault(localDate, Collections.emptyList());
-                List<ChuanyunMonthLaborCostWgDTO> laborCostWgList = laborCostMap.getOrDefault(localDate, Collections.emptyList());
-
-                Map<String, List<ChuanyunReimbursementDO>> workGroupIdReimbursementMap = reimbursementList.stream().collect(Collectors.groupingBy(chuanyunReimbursementDO -> {
-                    if (Objects.isNull(chuanyunReimbursementDO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunReimbursementDO.getWorkGroupId())) {
-                        return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                    } else {
-                        return chuanyunReimbursementDO.getWorkGroupId();
-                    }
-                }));
-                Map<String, List<ChuanyunSelfWorkHourDO>> workGroupIdSelfWorkHourMap = selfWorkHourList.stream().collect(Collectors.groupingBy(chuanyunSelfWorkHourDO -> {
-                    if (Objects.isNull(chuanyunSelfWorkHourDO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunSelfWorkHourDO.getWorkGroupId())) {
-                        return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                    } else {
-                        return chuanyunSelfWorkHourDO.getWorkGroupId();
-                    }
-                }));
-                Map<String, List<ChuanyunMonthLaborCostWgDTO>> workGroupIdLaborCostMap = laborCostWgList.stream().collect(Collectors.groupingBy(chuanyunMonthLaborCostWgDTO -> {
-                    if (Objects.isNull(chuanyunMonthLaborCostWgDTO.getWorkGroupId()) || !StringUtils.hasLength(chuanyunMonthLaborCostWgDTO.getWorkGroupId())) {
-                        return ChuanYunConstant.DEFAULT_WORK_GROUP;
-                    } else {
-                        return chuanyunMonthLaborCostWgDTO.getWorkGroupId();
-                    }
-                }));
-
-                Set<String> workGroup1 = workGroupIdReimbursementMap.keySet();
-                Set<String> workGroup2 = workGroupIdSelfWorkHourMap.keySet();
-                Set<String> workGroup3 = workGroupIdLaborCostMap.keySet();
-
-
-                Set<String> workGroupMergeCollections = CollectionsUtils.mergeStringCollections(workGroup1, workGroup2, workGroup3);
-                workGroupMergeCollections.add(ChuanYunConstant.DEFAULT_WORK_GROUP);
-
-                workGroupMergeCollections.forEach(workGroupId -> {
-                    List<ChuanyunReimbursementDO> reimbursementDOList = workGroupIdReimbursementMap.getOrDefault(workGroupId, Collections.emptyList());
-                    List<ChuanyunSelfWorkHourDO> selfWorkHourDOS = workGroupIdSelfWorkHourMap.getOrDefault(workGroupId, Collections.emptyList());
-                    List<ChuanyunMonthLaborCostWgDTO> monthLaborCostWgDTOS = workGroupIdLaborCostMap.getOrDefault(workGroupId, Collections.emptyList());
-
-                    BigDecimal totalReimbursement;
-                    BigDecimal totalManDay;
-                    BigDecimal totalLaborCost;
-
-                    if (reimbursementDOList.isEmpty()) {
-                        totalReimbursement = new BigDecimal("0.00");
-                    } else {
-                        totalReimbursement = reimbursementDOList.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                    }
-
-                    if (selfWorkHourDOS.isEmpty()) {
-                        totalManDay = new BigDecimal("0.00");
-                    } else {
-                        BigDecimal totalWorkHours = selfWorkHourDOS.stream().map(ChuanyunSelfWorkHourDO::getStandardWorkHour).reduce(BigDecimal.ZERO, BigDecimal::add);
-                        totalManDay = totalWorkHours.divide(BigDecimal.valueOf(8), 3, RoundingMode.UP);
-                    }
-
-                    if (monthLaborCostWgDTOS.isEmpty()) {
-                        totalLaborCost = new BigDecimal("0.00");
-                    } else {
-                        totalLaborCost = monthLaborCostWgDTOS.stream().map(ChuanyunMonthLaborCostWgDTO::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-                    }
-
-                    ChuanyunImplCostDO old = implCostDao.findByProjectIdAndProjectCodeAndWorkGroupAndLocalDate(groupProjectObjectId, groupProjectCode, workGroupId, localDate.atStartOfDay());
-                    if (!Objects.isNull(old)) {
-                        BigDecimal oldImplCost = old.getImplCost();
-                        BigDecimal oldManDay = old.getManDay();
-                        BigDecimal oldLaborCost = old.getLaborCost();
-                        if (Objects.isNull(old.getLocalDate()) ||
-                                Objects.isNull(oldImplCost) ||
-                                Objects.isNull(oldManDay) ||
-                                Objects.isNull(oldLaborCost) ||
-                                oldImplCost.compareTo(totalReimbursement) != 0 ||
-                                oldManDay.compareTo(totalManDay) != 0 || oldLaborCost.compareTo(totalLaborCost) != 0) {
-                            old.setImplCost(totalReimbursement);
-                            old.setManDay(totalManDay);
-                            old.setLaborCost(totalLaborCost);
-                            implCostDao.saveAndFlush(old);
-                        }
-                    } else {
-                        String defaultWorkGroupName = ChuanYunConstant.DEFAULT_WORK_GROUP_NAME;
-                        ChuanyunWorkGroupDO workGroupDO = workGroupService.findByObjectId(workGroupId);
-                        if (!Objects.isNull(workGroupDO)) {
-                            defaultWorkGroupName = workGroupDO.getWorkGroupName();
-                        } else {
-                            ChuanyunHistoryWorkGroupDO historyWorkGroupDO = workGroupService.findInHistoryByObjectId(workGroupId);
-                            if (!Objects.isNull(historyWorkGroupDO)) {
-                                defaultWorkGroupName = historyWorkGroupDO.getWorkGroupName();
-                            }
-                        }
-                        ChuanyunImplCostDO chuanyunImplCostDO = new ChuanyunImplCostDO();
-                        chuanyunImplCostDO.setProjectId(chuanyunGroupProjectDO.getObjectId());
-                        chuanyunImplCostDO.setProjectCode(groupProjectCode);
-                        chuanyunImplCostDO.setLocalDate(localDate.atStartOfDay());
-                        chuanyunImplCostDO.setWorkGroup(workGroupId);
-                        chuanyunImplCostDO.setWorkGroupName(defaultWorkGroupName);
-                        chuanyunImplCostDO.setImplCost(totalReimbursement);
-                        chuanyunImplCostDO.setManDay(totalManDay);
-                        chuanyunImplCostDO.setLaborCost(totalLaborCost);
-                        implCostDao.saveAndFlush(chuanyunImplCostDO);
-                    }
-
-                });
-            });
-
-        });
-
-    }
-
-
-    @Test
-    void test2() {
-        List<ChuanyunImplCostDO> all = implCostService.findAllInChuanyun();
-        all.forEach(chuanyunImplCostDO -> {
-            chuanYunManager.delete(ChuanyunImplCostDO.SCHEMA_CODE, chuanyunImplCostDO.getObjectId());
-            log.info("删除: {}", chuanyunImplCostDO);
-        });
-
-    }
-
-    @Test
-    void test3() {
-        ChuanyunImplCostDO old = implCostDao.findByProjectCodeAndWorkGroupAndLocalDate("D19411-1", "defaultWorkgroup", LocalDate.of(2022, 7, 1).atStartOfDay());
-        System.out.println(old);
-
-
-    }
-
-
-    @Test
-    void test7(){
-        workGroupService.implAllCost();
-    }
-
-    @Test
-    public void findTest() {
-        boolean flag = true;
-        List<String> m = List.of("status_2,1", "F0000003_2,D21389");
-        Filter filter = Filter.instance(0, 10, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<ChuanyunBuildProject> buildResponse = null;
-        try {
-            buildResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-
-        if (buildResponse == null || !buildResponse.getSuccessful()) {
-            flag = false;
-        }
-        ChuanyunFindAllBizReturnData<ChuanyunBuildProject> returnData = buildResponse.getReturnData();
-        if (returnData == null) {
-            flag = false;
-
-        }
-
-        List<ChuanyunBuildProject> bizObjectArray = returnData.getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-        });
-    }
-
-    @Test
-    public void findTest1() {
-        List<String> m = List.of("status_2,1", "F0000003_2,D21389");
-        Filter f = Filter.instance(0, 10, true, Filter.AND, m);
-
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, f);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        //保存
-        List<Object> buildBizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunBuildProject> bpList = objectMapper.convertValue(buildBizObjectArray, new TypeReference<>() {
-        });
-        final Object monitor = new Object();
-        bpList.forEach(chuanyunBuildProject -> {
-            synchronized (monitor) {
-                String buildProjectId = chuanyunBuildProject.getObjectId();
-                List<String> m1 = List.of("F0000001_2," + buildProjectId);
-                Filter filter = Filter.instance(0, 10, true, Filter.AND, m1);
-                ChuanyunFindAllBizDTO<Object> projectList = null;
-                try {
-                    projectList = chuanYunManager.findAll(ChuanyunProjectOrganizationStructureDO.SCHEMA_CODE, filter);
-                } catch (JsonProcessingException e) {
-                    e.printStackTrace();
-                }
-                if (projectList == null || projectList.getReturnData() == null) {
-                    return;
-                }
-                List<ChuanyunProjectOrganizationStructureDO> projectOrganizationStructureList = objectMapper.convertValue(projectList.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                List<String> parentIdList = projectOrganizationStructureList.stream().map(BasicDO::getObjectId).toList();
-                parentIdList.forEach(parentId -> {
-                    // 查询工作组信息
-                    List<String> m2 = List.of("parentObjectId_2," + parentId);
-                    ChuanyunFindAllBizDTO<Object> workGroupResponse = null;
-                    try {
-                        workGroupResponse = chuanYunManager.findAll(ChuanyunWorkGroupDO.SCHEMA_CODE, Filter.instance(0, 30, true, Filter.AND, m2));
-                    } catch (JsonProcessingException e) {
-                        e.printStackTrace();
-                    }
-                    if (workGroupResponse == null || !workGroupResponse.getSuccessful()) {
-                        return;
-                    }
-                    if (workGroupResponse.getReturnData() == null) {
-                        return;
-                    }
-                    List<ChuanyunWorkGroupDO> workGroupList = objectMapper.convertValue(workGroupResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                    });
-                    workGroupList.forEach(chuanyunWorkGroupDO -> {
-                        // 查询该项目在总表中的记录
-                        List<String> m3 = List.of("F0000075_5,异常", "F0000002_2," + chuanyunBuildProject.getProjectCode());
-                        Filter instance = Filter.instance(0, 50, true, Filter.AND, m3);
-                        ChuanyunFindAllBizDTO<Object> groupProjectResponse = null;
-                        try {
-                            groupProjectResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, instance);
-                        } catch (JsonProcessingException e) {
-                            e.printStackTrace();
-                        }
-                        if (!groupProjectResponse.getSuccessful() || groupProjectResponse.getReturnData() == null) {
-                            return;
-                        }
-                        List<Object> bizObjectArray = groupProjectResponse.getReturnData().getBizObjectArray();
-                        List<ChuanyunGroupProjectDO> groupProjectDOList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                        });
-                        Optional<ChuanyunGroupProjectDO> groupProjectDO = groupProjectDOList.stream().findFirst();
-                        if (groupProjectDO.isPresent()) {
-                            ChuanyunGroupProjectDO chuanyunGroupProjectDO = groupProjectDO.get();
-                            List<String> userIdList = chuanyunWorkGroupDO.getSubWorkGroupMemberObject().stream().map(BasicSubDO::getObjectId).toList();
-                            // 查询报销单
-                            BigDecimal total = new BigDecimal("0.00");
-                            BigDecimal totalManDay = new BigDecimal("0.000");
-                            // 查询项目工作组人天
-                            for (String userId : userIdList) {
-                                // 查询用户在该项目的报销单
-                                List<ChuanyunReimbursementDO> reimbursements = reimbursementDao.findAllByGroupProjectIdAndReimburseUserIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), userId, List.of(1, 2));
-                                BigDecimal totalReimburse = reimbursements.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                total = total.add(totalReimburse);
-                                List<ChuanyunSelfWorkHourDO> workHours = selfWorkHourDao.findAllByProjectIdAndUserIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), userId, List.of("1", "2"));
-                                BigDecimal totalWorkHour = workHours.stream().map(ChuanyunSelfWorkHourDO::getStandardWorkHour).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                // 人天
-                                BigDecimal manDay = totalWorkHour.divide(BigDecimal.valueOf(8), 3, RoundingMode.UP);
-                                totalManDay = totalManDay.add(manDay);
-
-                            }
-                            // 统计工作组所有的工时
-                            String projectObjectId = chuanyunGroupProjectDO.getObjectId();
-                            String projectCode = chuanyunGroupProjectDO.getProjectCode();
-                            String workGroupId = chuanyunWorkGroupDO.getObjectId();
-
-                            ChuanyunImplCostDO old = implCostDao.findByProjectIdAndProjectCodeAndWorkGroup(projectObjectId, projectCode, workGroupId);
-                            if (!Objects.isNull(old)) {
-                                BigDecimal oldImplCost = old.getImplCost();
-                                BigDecimal oldManDay = old.getManDay();
-                                if (Objects.isNull(oldImplCost) || Objects.isNull(oldManDay) || oldImplCost.compareTo(total) != 0 || oldManDay.compareTo(totalManDay) != 0) {
-                                    old.setImplCost(total);
-                                    old.setManDay(totalManDay);
-                                    implCostDao.save(old);
-                                }
-                            } else {
-                                ChuanyunImplCostDO chuanyunImplCostDO = new ChuanyunImplCostDO();
-                                chuanyunImplCostDO.setProjectId(projectObjectId);
-                                chuanyunImplCostDO.setProjectCode(projectCode);
-                                chuanyunImplCostDO.setWorkGroup(workGroupId);
-                                chuanyunImplCostDO.setWorkGroupName(chuanyunWorkGroupDO.getWorkGroupName());
-                                chuanyunImplCostDO.setImplCost(total);
-                                chuanyunImplCostDO.setManDay(totalManDay);
-                                implCostDao.saveAndFlush(chuanyunImplCostDO);
-                            }
-                        }
-                    });
-
-                });
-            }
-        });
-
-
-    }
-
-    @Test
-    public void findOneTest() {
-
-        ChuanyunFindBizDTO<Object> buildResponse = null;
-
-        buildResponse = chuanYunManager.find(ChuanyunBuildProject.SCHEMA_CODE, "9cdcf0d7-c8db-41b5-a03c-4caf2a2eb1f8");
-
-        if (buildResponse == null || !buildResponse.getSuccessful()) {
-            return;
-        }
-        ChuanyunFindBizReturnData<Object> returnData = buildResponse.getReturnData();
-
-        Object bizObject = returnData.getBizObject();
-        ObjectMapper objectMapper = new ObjectMapper();
-        ChuanyunBuildProject chuanyunBuildProject = objectMapper.convertValue(bizObject, new TypeReference<>() {
-        });
-    }
-
-    @Test
-    public void reimburseTest() {
-        workGroupService.implCost();
-    }
-
-    @Test
-    public void pushToChuanyun() {
-        workGroupService.pushToChuanyun();
-    }
-
-
-    @Test
-    public void workGroupMonthTest() {
-        // 查询立项表中数据
-        List<ChuanyunBuildProject> buildProjectList = findAll();
-        ObjectMapper objectMapper = new ObjectMapper();
-        // 查询组织架构录入
-        final Object monitor = new Object();
-        buildProjectList.parallelStream().forEach(chuanyunBuildProject -> {
-            synchronized (monitor) {
-                String buildProjectId = chuanyunBuildProject.getObjectId();
-                List<String> m1 = List.of("F0000001_2," + buildProjectId);
-                Filter filter = Filter.instance(0, 10, true, Filter.AND, m1);
-                ChuanyunFindAllBizDTO<Object> projectList = null;
-                try {
-                    projectList = chuanYunManager.findAll(ChuanyunProjectOrganizationStructureDO.SCHEMA_CODE, filter);
-                } catch (JsonProcessingException e) {
-                    e.printStackTrace();
-                }
-                if (projectList == null || projectList.getReturnData() == null) {
-                    return;
-                }
-                List<ChuanyunProjectOrganizationStructureDO> projectOrganizationStructureList = objectMapper.convertValue(projectList.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                List<String> parentIdList = projectOrganizationStructureList.stream().map(BasicDO::getObjectId).toList();
-                parentIdList.forEach(parentId -> {
-                    // 查询工作组信息
-                    List<String> m2 = List.of("parentObjectId_2," + parentId);
-                    ChuanyunFindAllBizDTO<Object> workGroupResponse = null;
-                    try {
-                        workGroupResponse = chuanYunManager.findAll(ChuanyunWorkGroupDO.SCHEMA_CODE, Filter.instance(0, 30, true, Filter.AND, m2));
-                    } catch (JsonProcessingException e) {
-                        e.printStackTrace();
-                    }
-                    if (workGroupResponse == null || !workGroupResponse.getSuccessful()) {
-                        return;
-                    }
-                    if (workGroupResponse.getReturnData() == null) {
-                        return;
-                    }
-                    List<ChuanyunWorkGroupDO> workGroupList = objectMapper.convertValue(workGroupResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                    });
-                    workGroupList.forEach(chuanyunWorkGroupDO -> {
-                        // 查询该项目在总表中的记录
-                        List<String> m3 = List.of("F0000075_5,异常", "F0000002_2," + chuanyunBuildProject.getProjectCode());
-                        Filter instance = Filter.instance(0, 50, true, Filter.AND, m3);
-                        ChuanyunFindAllBizDTO<Object> groupProjectResponse = null;
-                        try {
-                            groupProjectResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, instance);
-                        } catch (JsonProcessingException e) {
-                            e.printStackTrace();
-                        }
-                        if (!groupProjectResponse.getSuccessful() || groupProjectResponse.getReturnData() == null) {
-                            return;
-                        }
-                        List<Object> bizObjectArray = groupProjectResponse.getReturnData().getBizObjectArray();
-                        List<ChuanyunGroupProjectDO> groupProjectDOList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                        });
-                        Optional<ChuanyunGroupProjectDO> groupProjectDO = groupProjectDOList.stream().findFirst();
-                        if (groupProjectDO.isPresent()) {
-                            ChuanyunGroupProjectDO chuanyunGroupProjectDO = groupProjectDO.get();
-                            List<String> userIdList = chuanyunWorkGroupDO.getSubWorkGroupMemberObject().stream().map(BasicSubDO::getObjectId).toList();
-                            // 查询报销单
-                            // 查询项目工作组人天
-                            Map<LocalDate, List<ChuanyunReimbursementDO>> reimbursementMap = new HashMap<>();
-                            Map<LocalDate, List<ChuanyunSelfWorkHourDO>> workHoursMap = new HashMap<>();
-
-                            for (String userId : userIdList) {
-                                // 查询用户在该项目的报销单
-                                List<ChuanyunReimbursementDO> reimbursements = reimbursementDao.findAllByGroupProjectIdAndReimburseUserIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), userId, List.of(1, 2));
-                                // 报销单按日期分组
-                                Map<LocalDate, List<ChuanyunReimbursementDO>> map1 = reimbursements.stream().collect(Collectors.groupingBy(chuanyunReimbursementDO -> LocalDate.of(chuanyunReimbursementDO.getBusinessDate().getYear(), chuanyunReimbursementDO.getBusinessDate().getMonthValue(), 1)));
-                                map1.forEach((localDate, chuanyunReimbursementDOS) -> {
-                                    boolean containsKey = reimbursementMap.containsKey(localDate);
-                                    if (containsKey) {
-                                        // 表示已经存在该key
-                                        List<ChuanyunReimbursementDO> reimbursementDOList = reimbursementMap.get(localDate);
-                                        reimbursementDOList.addAll(chuanyunReimbursementDOS);
-                                        reimbursementMap.put(localDate, reimbursementDOList);
-                                    } else {
-                                        reimbursementMap.put(localDate, chuanyunReimbursementDOS);
-                                    }
-                                });
-                                List<ChuanyunSelfWorkHourDO> workHours = selfWorkHourDao.findAllByProjectIdAndUserIdAndStatusIn(chuanyunGroupProjectDO.getObjectId(), userId, List.of("1", "2"));
-                                Map<LocalDate, List<ChuanyunSelfWorkHourDO>> map2 = workHours.stream().collect(Collectors.groupingBy(chuanyunSelfWorkHourDO -> LocalDate.of(chuanyunSelfWorkHourDO.getDayLogDate().getYear(), chuanyunSelfWorkHourDO.getDayLogDate().getMonthValue(), 1)));
-                                map2.forEach((localDate, chuanyunSelfWorkHourDOS) -> {
-                                    boolean containsKey = workHoursMap.containsKey(localDate);
-                                    if (containsKey) {
-                                        // 表示已经存在该key
-                                        List<ChuanyunSelfWorkHourDO> selfWorkHours = workHoursMap.get(localDate);
-                                        selfWorkHours.addAll(chuanyunSelfWorkHourDOS);
-                                        workHoursMap.put(localDate, selfWorkHours);
-                                    } else {
-                                        workHoursMap.put(localDate, chuanyunSelfWorkHourDOS);
-                                    }
-                                });
-                            }
-
-                            Set<LocalDate> localDates = reimbursementMap.keySet();
-                            Set<LocalDate> localDates1 = workHoursMap.keySet();
-                            Set<LocalDate> mergeCollections = CollectionsUtils.mergeCollections(localDates, localDates1);
-
-                            mergeCollections.forEach(localDate -> {
-                                BigDecimal totalReimbursement;
-                                BigDecimal totalManDay;
-                                List<ChuanyunReimbursementDO> reimbursements = reimbursementMap.getOrDefault(localDate, Collections.emptyList());
-                                if (reimbursements.isEmpty()) {
-                                    totalReimbursement = new BigDecimal("0.00");
-                                } else {
-                                    totalReimbursement = reimbursements.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                }
-                                List<ChuanyunSelfWorkHourDO> selfWorkHours = workHoursMap.getOrDefault(localDate, Collections.emptyList());
-                                if (selfWorkHours.isEmpty()) {
-                                    totalManDay = new BigDecimal("0.00");
-                                } else {
-                                    BigDecimal totalWorkHours = selfWorkHours.stream().map(ChuanyunSelfWorkHourDO::getStandardWorkHour).reduce(BigDecimal.ZERO, BigDecimal::add);
-                                    totalManDay = totalWorkHours.divide(BigDecimal.valueOf(8), 3, RoundingMode.UP);
-                                }
-                                // 统计工作组所有的工时
-                                String projectObjectId = chuanyunGroupProjectDO.getObjectId();
-                                String projectCode = chuanyunGroupProjectDO.getProjectCode();
-                                String workGroupId = chuanyunWorkGroupDO.getObjectId();
-
-                                ChuanyunImplCostDO old = implCostDao.findByProjectIdAndProjectCodeAndWorkGroupAndLocalDate(projectObjectId, projectCode, workGroupId, localDate.atStartOfDay());
-                                if (!Objects.isNull(old)) {
-                                    BigDecimal oldImplCost = old.getImplCost();
-                                    BigDecimal oldManDay = old.getManDay();
-                                    if (Objects.isNull(old.getLocalDate())) {
-                                        old.setLocalDate(localDate.atStartOfDay());
-                                    }
-                                    if (Objects.isNull(oldImplCost) || Objects.isNull(oldManDay) || oldImplCost.compareTo(totalReimbursement) != 0 || oldManDay.compareTo(totalManDay) != 0) {
-                                        old.setImplCost(totalReimbursement);
-                                        old.setManDay(totalManDay);
-                                        implCostDao.saveAndFlush(old);
-                                    }
-                                } else {
-                                    ChuanyunImplCostDO chuanyunImplCostDO = new ChuanyunImplCostDO();
-                                    chuanyunImplCostDO.setProjectId(projectObjectId);
-                                    chuanyunImplCostDO.setProjectCode(projectCode);
-                                    chuanyunImplCostDO.setLocalDate(localDate.atStartOfDay());
-                                    chuanyunImplCostDO.setWorkGroup(workGroupId);
-                                    chuanyunImplCostDO.setWorkGroupName(chuanyunWorkGroupDO.getWorkGroupName());
-                                    chuanyunImplCostDO.setImplCost(totalReimbursement);
-                                    chuanyunImplCostDO.setManDay(totalManDay);
-                                    implCostDao.saveAndFlush(chuanyunImplCostDO);
-                                }
-
-                            });
-
-
-                        }
-                    });
-
-                });
-            }
-        });
-    }
-
-    @Test
-    public void pushToChuanyunTest() {
-        List<ChuanyunImplCostDO> all = implCostDao.findAll();
-        ObjectMapper objectMapper = new ObjectMapper();
-        all.forEach(implCostDO -> {
-            String projectId = implCostDO.getProjectId();
-            String projectCode = implCostDO.getProjectCode();
-            String workGroup = implCostDO.getWorkGroup();
-            LocalDateTime localDate = implCostDO.getLocalDate();
-            List<String> m = List.of("F0000001_2," + projectId, "F0000002_2," + projectCode, "F0000006_2," + workGroup, "F0000008_2," + localDate);
-            Filter filter = Filter.instance(0, 10, true, Filter.AND, m);
-            ChuanyunFindAllBizDTO<Object> implCostResponse = null;
-            try {
-                implCostResponse = chuanYunManager.findAll(ChuanyunImplCostDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                log.error(e.getMessage());
-            }
-            assert implCostResponse != null;
-            if (implCostResponse.getSuccessful()) {
-                ChuanyunFindAllBizReturnData<Object> returnData = implCostResponse.getReturnData();
-                if (returnData != null && returnData.getBizObjectArray() != null) {
-                    List<ChuanyunImplCostDO> chuanyunImplCostDOList = objectMapper.convertValue(returnData.getBizObjectArray(), new TypeReference<>() {
-                    });
-                    Optional<ChuanyunImplCostDO> implCostOptional = chuanyunImplCostDOList.stream().findFirst();
-                    if (implCostOptional.isPresent()) {
-                        ChuanyunImplCostDO chuanyunImplCostDO = implCostOptional.get();
-                        if (Objects.isNull(chuanyunImplCostDO.getImplCost()) || Objects.isNull(chuanyunImplCostDO.getManDay()) ||
-                                chuanyunImplCostDO.getImplCost().compareTo(implCostDO.getImplCost()) != 0 ||
-                                chuanyunImplCostDO.getManDay().compareTo(implCostDO.getManDay()) != 0) {
-                            // 工作组实施费用发生变化
-                            log.info("更新项目工作组实施费用");
-                            ImplCostUpdateDTO implCostUpdateDTO = new ImplCostUpdateDTO(implCostDO.getImplCost(), implCostDO.getManDay());
-                            try {
-                                String updateStr = objectMapper.writeValueAsString(implCostUpdateDTO);
-                                chuanYunManager.update(ChuanyunImplCostDO.SCHEMA_CODE, chuanyunImplCostDO.getObjectId(), updateStr);
-                            } catch (JsonProcessingException | BigSizeException e) {
-                                log.error(e.getMessage());
-                            }
-                        }
-                    }
-
-                } else {
-                    // 直接保存
-                    try {
-                        String implCostStr = objectMapper.writeValueAsString(implCostDO);
-                        chuanYunManager.save(ChuanyunImplCostDO.SCHEMA_CODE, implCostStr, true);
-                    } catch (JsonProcessingException | BigSizeException e) {
-                        log.error(e.getMessage());
-                    }
-
-                }
-
-            }
-
-
-        });
-        log.info("上传项目工作组实施费用完成");
-    }
-
-    @Test
-    public void delImplCostTest() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        boolean flag = true;
-        int start = 0;
-        int pageSize = 200;
-        while (flag) {
-            Filter filter = Filter.instance(start, start + pageSize, true);
-            ChuanyunFindAllBizDTO<Object> delAll = null;
-            try {
-                delAll = chuanYunManager.findAll(ChuanyunImplCostDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (Objects.isNull(delAll) || delAll.getReturnData() == null || delAll.getReturnData().getBizObjectArray() == null) {
-                flag = false;
-                continue;
-            }
-            if (delAll.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-            List<Object> bizObjectArray = delAll.getReturnData().getBizObjectArray();
-            List<ChuanyunImplCostDO> ic = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-            });
-            ic.forEach(chuanyunImplCostDO -> {
-                ChuanyunSaveDTO delete = chuanYunManager.delete(ChuanyunImplCostDO.SCHEMA_CODE, chuanyunImplCostDO.getObjectId());
-                log.info("删除: {}", delete.getSuccessful());
-            });
-
-        }
-    }
-
-    @Data
-    static class ImplCostUpdateDTO {
-        @JsonProperty("F0000004")
-        private BigDecimal implCost;
-
-        @JsonProperty("F0000007")
-        private BigDecimal manDay;
-
-        public ImplCostUpdateDTO(BigDecimal implCost, BigDecimal manDay) {
-            this.implCost = implCost;
-            this.manDay = manDay;
-
-        }
-    }
-
-
-    private List<ChuanyunBuildProject> findAll() {
-        ArrayList<ChuanyunBuildProject> buildProjects = new ArrayList<>();
-        ObjectMapper objectMapper = new ObjectMapper();
-        int start = 0;
-        long totalCount = 0L;
-        boolean flag = true;
-        int pageSize = 100;
-        while (flag) {
-            try {
-                //从氚云查询数据
-                List<String> m = List.of("status_2,1");
-                var filter = Filter.instance(start, start + pageSize, true, Filter.AND, m);
-                var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
-                if (chuanyunFindAllResponse.getReturnData() == null || chuanyunFindAllResponse.getReturnData().getBizObjectArray() == null) {
-                    flag = false;
-                    continue;
-                }
-                if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                    start += pageSize;
-                } else {
-                    flag = false;
-                }
-                //获取项目总数
-                totalCount = chuanyunFindAllResponse.getReturnData().getTotalCount();
-                //保存
-                List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
-                List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                });
-                buildProjects.addAll(bpList);
-            } catch (Exception e) {
-                log.error(e.getMessage());
-                e.printStackTrace();
-            }
-
-        }
-        return buildProjects;
-    }
-
-
-    @Test
-    public void LocalDateTimeTest() {
-        LocalDateTime localDateTime = LocalDate.now().atStartOfDay();
-
-    }
-
-    @Test
-    public void testFind() throws JsonProcessingException {
-        List<String> matchers = new ArrayList<>();
-        matchers.add("F0000005_2," + "AS20042");
-        matchers.add("F0000002_2," + TimeUtil.formatDateTime(LocalDateTime.of(2020, 5, 1, 0, 0, 0)));
-        matchers.add("F0000018_2," + "浙江凯乐士科技有限公司/项目交付/项目实施(集成项目交付)/项目实施/系统售后");
-        var filter = Filter.instance(0, 1, true, "And", matchers);
-        var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMonthLaborCostWgDO.SCHEMA_CODE, filter);
-
-    }
-
-    @Test
-    public void deleteAll() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 100;
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMonthLaborCostWgDO.SCHEMA_CODE, filter);
-                if (chuanyunFindAllResponse.getReturnData() == null) {
-                    flag = false;
-                    continue;
-                }
-                if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                    start += pageSize;
-                } else {
-                    flag = false;
-                }
-
-                List<ChuanyunMonthLaborCostWgDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                if (result.size() > 0) {
-                    result.forEach(chuanyunMonthLaborCostWgDO -> chuanYunManager.delete(ChuanyunMonthLaborCostWgDO.SCHEMA_CODE, chuanyunMonthLaborCostWgDO.getObjectId()));
-                }
-                log.info("完成");
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-
-    @Test
-    public void push() {
-        workGroupService.pushToChuanyun();
-    }
-
-
-}

+ 0 - 22
src/test/java/com/galaxis/manatee/Test/payRoll/payRollTest.java

@@ -1,22 +0,0 @@
-package com.galaxis.manatee.Test.payRoll;
-
-import com.galaxis.manatee.task.ChuanyunHumanResourceScheduledTask;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class payRollTest {
-
-    private ChuanyunHumanResourceScheduledTask humanResourceScheduledTask;
-
-    @Autowired
-    public void setHumanResourceScheduledTask(ChuanyunHumanResourceScheduledTask humanResourceScheduledTask) {
-        this.humanResourceScheduledTask = humanResourceScheduledTask;
-    }
-
-    @Test
-    void getAll(){
-        humanResourceScheduledTask.getPayrollManually();
-    }
-}

+ 0 - 152
src/test/java/com/galaxis/manatee/Test/project/CleanZhong.java

@@ -1,152 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-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.galaxis.manatee.constant.StringConstant;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunSaveDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class CleanZhong {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-
-    @Test
-    public void getData() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 200;
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            //获取项目总数
-            result.forEach(chuanyunGroupProjectDO -> {
-                try {
-                    String[] projectMemberList = chuanyunGroupProjectDO.getProjectMemberList();
-                    if (projectMemberList != null && projectMemberList.length > 0) {
-                        boolean b = updateProject(chuanyunGroupProjectDO.getObjectId(), chuanyunGroupProjectDO);
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-
-        }
-        log.info("完成");
-
-    }
-
-    /**
-     * 查询是否被填写了工时
-     */
-    private boolean updateProject(String objectId, ChuanyunGroupProjectDO chuanyunGroupProjectDO) throws Exception {
-        ObjectMapper objectMapper = new ObjectMapper();
-        GroupProjectMemberListUpdateDTO groupProjectMemberListUpdateDTO = new GroupProjectMemberListUpdateDTO(chuanyunGroupProjectDO);
-        String[] projectMemberList = groupProjectMemberListUpdateDTO.getProjectMemberList();
-        String[] array1 = Arrays.stream(projectMemberList).filter(s -> !s.equals("8bbb21c4-1140-4bfa-8713-6ee50ea34df0")).toArray(String[]::new);
-        groupProjectMemberListUpdateDTO.setProjectMemberList(array1);
-        StringBuilder memberString = new StringBuilder();
-        for (int i = 0; i < chuanyunGroupProjectDO.getProjectMemberList().length; i++) {
-            memberString.append(chuanyunGroupProjectDO.getProjectMemberList()[i]).append(StringConstant.SEMICOLON);
-        }
-        groupProjectMemberListUpdateDTO.setProjectMemberString(memberString.toString());
-        String jsonStr = objectMapper.writeValueAsString(groupProjectMemberListUpdateDTO);
-        ChuanyunSaveDTO update = chuanYunManager.update(ChuanyunGroupProjectDO.SCHEMA_CODE, objectId, jsonStr);
-
-
-        return update.getSuccessful();
-    }
-
-    @Test
-    public void test1() {
-        String objectId = "2e3018f9-8ab7-11ea-8ae9-7cd30ab711fe";
-        ChuanyunFindBizDTO<Object> objectChuanyunFindBizDTO = chuanYunManager.find(ChuanyunGroupProjectDO.SCHEMA_CODE, objectId);
-        Object bizObject = objectChuanyunFindBizDTO.getReturnData().getBizObject();
-        ObjectMapper objectMapper = new ObjectMapper();
-        ChuanyunGroupProjectDO chuanyunGroupProjectDO = objectMapper.convertValue(bizObject, ChuanyunGroupProjectDO.class);
-        try {
-            if (null != chuanyunGroupProjectDO.getProjectMemberList()) {
-                boolean b = updateProject(objectId, chuanyunGroupProjectDO);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-    }
-
-    @Data
-    static class GroupProjectMemberListUpdateDTO {
-        /**
-         * 项目组成员(前端传数据用)
-         */
-        @JsonProperty("F0000034")
-        private String[] projectMemberList;
-
-        @JsonProperty("F0000052")
-        private String projectMemberString;
-
-        public void add() {
-            String[] newProjectMemberList = new String[projectMemberList.length + 1];
-            System.arraycopy(projectMemberList, 0, newProjectMemberList, 0, projectMemberList.length);
-            projectMemberList = newProjectMemberList;
-        }
-
-        public void delete() {
-            String[] newProjectMemberList = new String[projectMemberList.length - 1];
-            System.arraycopy(projectMemberList, 0, newProjectMemberList, 0, projectMemberList.length - 1);
-            projectMemberList = newProjectMemberList;
-        }
-
-        public GroupProjectMemberListUpdateDTO(ChuanyunGroupProjectDO chuanyunGroupProjectDO) {
-            if (null != chuanyunGroupProjectDO) {
-                if (null != chuanyunGroupProjectDO.getProjectMemberList()) {
-                    List<String> memberList = new ArrayList<>();
-                    chuanyunGroupProjectDO.getProjectMemberObject().forEach(chuanyunObject -> memberList.add(chuanyunObject.getObjectId()));
-                    this.projectMemberList = memberList.toArray(new String[0]);
-                }
-            }
-        }
-    }
-}

+ 0 - 159
src/test/java/com/galaxis/manatee/Test/project/ClosePDTest.java

@@ -1,159 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-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.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunSaveDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class ClosePDTest {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    void closePD() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var flag = true;
-        var pageSize = 100;
-        List<String> m = List.of("F0000005_2,研发二开", "F0000075_5,异常", "F0000075_5,已结项", "F0000075_5,已关闭");
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true, Filter.AND, m);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            result.forEach(chuanyunGroupProjectDO -> {
-                log.info("项目号: {}, 项目名称: {}, 项目状态: {}", chuanyunGroupProjectDO.getProjectCode(), chuanyunGroupProjectDO.getProjectName(), chuanyunGroupProjectDO.getProjectState());
-                try {
-//                    boolean b = updateProject(chuanyunGroupProjectDO.getObjectId());
-//                    if (b){
-//                        log.info("success");
-//                    }else {
-//                        log.info("fail");
-//                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-
-        }
-        log.info("完成");
-    }
-
-    /**
-     * 更新项目
-     */
-    private boolean updateProject(String objectId) throws Exception {
-        ObjectMapper objectMapper = new ObjectMapper();
-        GroupProjectStateUpdateDTO groupProjectStateUpdateDTO = new GroupProjectStateUpdateDTO();
-        groupProjectStateUpdateDTO.setProjectState("未维护");
-        String jsonStr = objectMapper.writeValueAsString(groupProjectStateUpdateDTO);
-        ChuanyunSaveDTO update = chuanYunManager.update(ChuanyunGroupProjectDO.SCHEMA_CODE, objectId, jsonStr);
-        return update.getSuccessful();
-    }
-
-
-    @Data
-    static class GroupProjectStateUpdateDTO {
-        /**
-         * 字符串表示
-         * 未进场
-         * 已进场
-         * 已上线
-         * 进行中
-         * 已初验
-         * 已终验
-         * 已结项
-         * 已暂停
-         * 已关闭
-         * 异常(新增隐藏状态,主要处理重复项目号的问题)
-         */
-        @JsonProperty("F0000075")
-        private String projectState;
-    }
-
-
-    @Test
-    void emptyProjectState() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var flag = true;
-        var pageSize = 100;
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            result.forEach(chuanyunGroupProjectDO -> {
-                if (!StringUtils.hasLength(chuanyunGroupProjectDO.getProjectState())) {
-                    log.info("项目号: {}, 项目名称: {}, 项目状态: {}", chuanyunGroupProjectDO.getProjectCode(), chuanyunGroupProjectDO.getProjectName(), chuanyunGroupProjectDO.getProjectState());
-                    try {
-                        boolean b = updateProject(chuanyunGroupProjectDO.getObjectId());
-                        if (b) {
-                            log.info("success");
-                        } else {
-                            log.info("fail");
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-
-            });
-
-        }
-        log.info("完成");
-    }
-
-}

+ 0 - 231
src/test/java/com/galaxis/manatee/Test/project/GetRepeatProject.java

@@ -1,231 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-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.galaxis.manatee.dao.ChuanyunGroupProjectDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunSaveDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Slf4j
-@SpringBootTest
-public class GetRepeatProject {
-
-    @Autowired
-    private ChuanyunGroupProjectDao chuanyunGroupProjectDao;
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    public void getData() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 200;
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            //获取项目总数
-            result.parallelStream().forEach(chuanyunGroupProjectDO -> {
-                try {
-                    // 查询项目号是否在总表中重复
-                    findByProjectCode(chuanyunGroupProjectDO.getProjectCode());
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-
-        }
-        log.info("完成");
-
-    }
-
-
-    @Test
-    public void getDataInMysql() {
-        List<ChuanyunGroupProjectDO> all = chuanyunGroupProjectDao.findAll();
-        List<String> projectCodeList = all.stream().map(ChuanyunGroupProjectDO::getProjectCode).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
-        projectCodeList.forEach(projectCode -> {
-            try {
-                findByProjectCode(projectCode);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        });
-
-    }
-
-    // 已经操作了
-    private final Vector<String> operated = new Vector<String>();
-
-    private void findByProjectCode(String projectCode) throws Exception {
-        //从氚云查询数据
-        if (Objects.isNull(projectCode) || projectCode.isBlank()) {
-            log.info("projectCode 为空");
-            return;
-        }
-        ArrayList<String> matchers = new ArrayList<>();
-        matchers.add("F0000002_2," + projectCode);
-
-        var filter = Filter.instance(0, 10, true, Filter.AND, matchers);
-        var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-        if (chuanyunFindAllResponse.getReturnData() != null) {
-            //转化为POJO
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() > 1) {
-                ObjectMapper objectMapper = new ObjectMapper();
-                List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-
-                for (ChuanyunGroupProjectDO chuanyunGroupProjectDO : result) {
-                    if (chuanyunGroupProjectDO.getProjectMemberList() == null || chuanyunGroupProjectDO.getProjectMemberList().length == 0) {
-//                        if (Objects.equals(chuanyunGroupProjectDO.getProjectState(), "异常")) {
-//                            break;
-//                        }
-//                        if (!Objects.equals(chuanyunGroupProjectDO.getProjectState(), "已关闭") && !Objects.equals(chuanyunGroupProjectDO.getProjectState(), "异常")) {
-//                            String objectId = chuanyunGroupProjectDO.getObjectId();
-//                            if (operated.contains(objectId)) {
-//                                continue;
-//                            }
-//                            log.info("objectId: {}, projectName: {}, projectCode: {}", objectId, chuanyunGroupProjectDO.getProjectName(), chuanyunGroupProjectDO.getProjectCode());
-//                            log.info("更新项目状态为异常 objectId: {} 之前状态: {}", objectId, chuanyunGroupProjectDO.getProjectState());
-//                            boolean b = updateProject(objectId);
-//                            if (b) {
-//                                operated.add(objectId);
-//                            }
-//                            break;
-//
-//                        }
-                    }
-                }
-            }
-
-        }
-    }
-
-    /**
-     * 更新项目
-     */
-    private boolean updateProject(String objectId) throws Exception {
-        ObjectMapper objectMapper = new ObjectMapper();
-        GroupProjectStateUpdateDTO groupProjectStateUpdateDTO = new GroupProjectStateUpdateDTO();
-        groupProjectStateUpdateDTO.setProjectState("异常");
-        String jsonStr = objectMapper.writeValueAsString(groupProjectStateUpdateDTO);
-        ChuanyunSaveDTO update = chuanYunManager.update(ChuanyunGroupProjectDO.SCHEMA_CODE, objectId, jsonStr);
-        return update.getSuccessful();
-    }
-
-
-    @Data
-    static class GroupProjectStateUpdateDTO {
-        /**
-         * 字符串表示
-         * 未进场
-         * 已进场
-         * 已上线
-         * 进行中
-         * 已初验
-         * 已终验
-         * 已结项
-         * 已暂停
-         * 已关闭
-         * 异常(新增隐藏状态,主要处理重复项目号的问题)
-         */
-        @JsonProperty("F0000075")
-        private String projectState;
-    }
-
-    @Test
-    public void test1() {
-
-        List<String> objectIdList = Arrays.asList("3785411d-a0c2-11ea-8ae9-7cd30ab711fe",
-                "6e948b84-a0c2-11ea-8ae9-7cd30ab711fe",
-                "3f7a16d7-a0c2-11ea-8ae9-7cd30ab711fe",
-                "d70b2327-54c1-11ec-8d00-7cd30adfe3be",
-                "ebe19b1e-85fa-11eb-addb-b8599f3790a4",
-                "68758e46-606a-11eb-addb-b8599f3790a4",
-                "e8d12167-1410-11eb-addb-b8599f3790a4",
-                "dc125f0f-5703-11eb-addb-b8599f3790a4",
-                "d65c129f-a632-11ea-9caa-7cd30ae01184",
-                "1a1a409d-a637-11ea-9caa-7cd30ae01184",
-                "de33d1ef-e122-11ea-addb-b8599f3790a4",
-                "fa1eb1e8-e76a-11ea-addb-b8599f3790a4",
-                "3f922d1b-8aac-11eb-addb-b8599f3790a4",
-                "7807b8f1-cd88-11ea-addb-b8599f3790a4",
-                "b0946b54-cd88-11ea-addb-b8599f3790a4",
-                "2ee87133-d784-11ea-addb-b8599f3790a4",
-                "4ff4aa31-c7f3-11ea-addb-b8599f3790a4",
-                "d360b578-a481-11ea-8ae9-7cd30ab711fe",
-                "f6182f3a-b70a-11ec-8d00-7cd30adfe3be",
-                "c34578d7-9dc5-11ec-8d00-7cd30adfe3be",
-                "b8b9fdcf-9b6a-11ec-8d00-7cd30adfe3be",
-                "6f94742b-8ab7-11ea-8ae9-7cd30ab711fe",
-                "6c2f0329-8ab7-11ea-8ae9-7cd30ab711fe",
-                "7f04d493-91bc-11ea-8ae9-7cd30ab711fe",
-                "53da5a8a-8ab7-11ea-8ae9-7cd30ab711fe",
-                "7ad359aa-1b60-4e34-9be1-0a90a4251701",
-                "401a495a-8ab7-11ea-8ae9-7cd30ab711fe",
-                "363d5943-8ab7-11ea-8ae9-7cd30ab711fe",
-                "31d3908b-8ab7-11ea-8ae9-7cd30ab711fe",
-                "2e3018f9-8ab7-11ea-8ae9-7cd30ab711fe");
-        objectIdList.forEach(s -> {
-            try {
-                boolean b = updateProject(s);
-                System.out.println(b);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        });
-    }
-
-    @Test
-    public void test2() {
-        try {
-            findByProjectCode("nullnull");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-    @Test
-    public void test3() {
-        try {
-            updateProject("2e3018f9-8ab7-11ea-8ae9-7cd30ab711fe");
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 61
src/test/java/com/galaxis/manatee/Test/project/GetRepeatUser.java

@@ -1,61 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunProjectOrganizationStructureDO;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunWorkGroupDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.ArrayList;
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class GetRepeatUser {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    public void getData() {
-
-
-        //从氚云查询数据
-        var filter = Filter.instance(0, 500, true);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunProjectOrganizationStructureDO.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        ObjectMapper objectMapper = new ObjectMapper();
-        //转化为POJO
-        List<ChuanyunProjectOrganizationStructureDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-
-
-        for (ChuanyunProjectOrganizationStructureDO chuanyunProjectOrganizationStructureDO : result) {
-            List<ChuanyunWorkGroupDO> workGroup = chuanyunProjectOrganizationStructureDO.getWorkGroup();
-            ArrayList<String> list = new ArrayList<>();
-//            for (ChuanyunWorkGroupDO chuanyunWorkGroupDO : workGroup) {
-//                List<String> subWorkGroupMember = chuanyunWorkGroupDO.getSubWorkGroupMember();
-//                for (String name : subWorkGroupMember) {
-//                    if (list.contains(name)) {
-//                        System.out.println(chuanyunProjectOrganizationStructureDO.getProjectCode()+ "---" + chuanyunProjectOrganizationStructureDO.getProjectName() + "---" + chuanyunProjectOrganizationStructureDO.getProjectType());
-//                    }
-//                    list.add(name);
-//                }
-//            }
-        }
-
-
-        log.info("完成");
-    }
-}

+ 0 - 95
src/test/java/com/galaxis/manatee/Test/project/GroupProjectTest.java

@@ -1,95 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.dao.ChuanyunGroupProjectDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.task.ChuanyunBasicDataScheduledTask;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-import java.util.Objects;
-
-@SpringBootTest
-public class GroupProjectTest {
-
-    private ChuanYunManager chuanYunManager;
-    private ChuanyunGroupProjectDao chuanyunGroupProjectDao;
-    private ChuanyunBasicDataScheduledTask basicDataScheduledTask;
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Autowired
-    public void setChuanyunGroupProjectDao(ChuanyunGroupProjectDao chuanyunGroupProjectDao) {
-        this.chuanyunGroupProjectDao = chuanyunGroupProjectDao;
-    }
-
-    @Autowired
-    public void setBasicDataScheduledTask(ChuanyunBasicDataScheduledTask basicDataScheduledTask) {
-        this.basicDataScheduledTask = basicDataScheduledTask;
-    }
-
-    @Test
-    void test1() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<String> m = List.of("F0000002_2,D22460");
-        //从氚云查询数据
-        var filter = Filter.instance(0, 10, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        //转化为POJO
-        List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-        //保存
-        result.forEach(chuanyunGroupProjectDO -> {
-
-        });
-    }
-
-    @Test
-    void syncGroupProject(){
-        basicDataScheduledTask.getGroupProjectManually();
-    }
-
-    @Test
-    public void getGroupProject() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        //从氚云查询数据
-        var filter = Filter.instance(0, 20, true);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (!Objects.isNull(chuanyunFindAllResponse)) {
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            //保存
-            result.forEach(chuanyunGroupProjectDO -> {
-                var tmpGroupProjectDO = chuanyunGroupProjectDao.findById(chuanyunGroupProjectDO.getObjectId());
-                tmpGroupProjectDO.ifPresent(projectDO -> {
-                    chuanyunGroupProjectDO.setIsCreate(projectDO.getIsCreate());
-                    chuanyunGroupProjectDao.delete(tmpGroupProjectDO.get());
-                });
-                chuanyunGroupProjectDao.save(chuanyunGroupProjectDO);
-            });
-        }
-
-
-    }
-}

+ 0 - 19
src/test/java/com/galaxis/manatee/Test/project/PushProjectChange.java

@@ -1,19 +0,0 @@
-package com.galaxis.manatee.Test.project;
-
-import com.galaxis.manatee.task.ChuanyunBasicDataScheduledTask;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class PushProjectChange {
-
-    @Autowired
-    private ChuanyunBasicDataScheduledTask chuanyunBasicDataScheduledTask;
-
-    @Test
-    public void push(){
-        chuanyunBasicDataScheduledTask.push();
-    }
-
-}

+ 0 - 208
src/test/java/com/galaxis/manatee/Test/reimbursement/ProjectImplTest.java

@@ -1,208 +0,0 @@
-package com.galaxis.manatee.Test.reimbursement;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.entity.chuanyun.data.object.*;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizReturnData;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@SpringBootTest
-public class ProjectImplTest {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    public void saveGroupProject() throws Exception {
-        List<String> m1 = List.of("F0000075_5,异常");
-        Filter instance = Filter.instance(0, 50, true, Filter.AND, m1);
-        ChuanyunFindAllBizDTO<Object> objectChuanyunFindBizDTO = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, instance);
-
-        // 拿到所有项目
-        ChuanyunFindAllBizReturnData<Object> returnData = objectChuanyunFindBizDTO.getReturnData();
-        List<Object> bizObjectArray = returnData.getBizObjectArray();
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<ChuanyunGroupProjectDO> groupProjectDOList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-        });
-        List<String> disProjectCodeList = groupProjectDOList.stream().map(ChuanyunGroupProjectDO::getProjectCode).toList().stream().distinct().toList();
-        disProjectCodeList.forEach(code -> {
-            List<String> m2 = List.of("F0000003_2," + code);
-            Filter f1 = Filter.instance(0, 10, true, Filter.AND, m2);
-            ChuanyunFindAllBizDTO<ChuanyunGroupProjectDO> buildResponse = null;
-            try {
-                buildResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, f1);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (buildResponse.getReturnData() == null) {
-                return;
-            }
-            List<ChuanyunBuildProject> result = objectMapper.convertValue(buildResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            List<String> buildProjectIdList = result.stream().map(ChuanyunBuildProject::getObjectId).toList();
-            buildProjectIdList.forEach(buildProjectId -> {
-                List<String> m3 = List.of("F0000001_2," + buildProjectId);
-                Filter filter = Filter.instance(0, 10, true, Filter.AND, m3);
-                ChuanyunFindAllBizDTO<Object> projectList = null;
-                try {
-                    projectList = chuanYunManager.findAll(ChuanyunProjectOrganizationStructureDO.SCHEMA_CODE, filter);
-                } catch (JsonProcessingException e) {
-                    e.printStackTrace();
-                }
-                if (projectList == null || projectList.getReturnData() == null) {
-                    return;
-                }
-                List<ChuanyunProjectOrganizationStructureDO> projectOrganizationStructureList = objectMapper.convertValue(projectList.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                List<String> parentIdList = projectOrganizationStructureList.stream().map(BasicDO::getObjectId).toList();
-                parentIdList.forEach(parentId -> {
-                    ChuanyunFindBizDTO<Object> workGroupResponse = chuanYunManager.find(ChuanyunWorkGroupDO.SCHEMA_CODE, parentId);
-                    if (workGroupResponse == null || !workGroupResponse.getSuccessful()) {
-                        return;
-                    }
-                    if (workGroupResponse.getReturnData() == null) {
-                        return;
-                    }
-                    List<ChuanyunWorkGroupDO> workGroupList = objectMapper.convertValue(workGroupResponse.getReturnData().getBizObject(), new TypeReference<>() {
-                    });
-                    workGroupList.forEach(chuanyunWorkGroupDO -> {
-                        BigDecimal total = new BigDecimal("0.00");
-                        Map<String, BigDecimal> workGroupAmount = new HashMap<>();
-                        List<String> userIdList = chuanyunWorkGroupDO.getSubWorkGroupMemberObject().stream().map(BasicSubDO::getObjectId).toList();
-                        // 查询报销单
-
-                        for (String userId : userIdList) {
-                            // 查询用户在该项目的报销单
-                            Filter f = Filter.instance(0, 10, true, Filter.AND, List.of("F0000093_2," + buildProjectId, "F0000001_2," + userId));
-                            ChuanyunFindAllBizDTO<Object> reimbursementResponse = null;
-                            try {
-                                reimbursementResponse = chuanYunManager.findAll(ChuanyunReimbursementDO.SCHEMA_CODE, f);
-                            } catch (JsonProcessingException e) {
-                                e.printStackTrace();
-                            }
-                            List<ChuanyunReimbursementDO> reimbursementDOList = objectMapper.convertValue(reimbursementResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                            });
-                            BigDecimal totalReim = reimbursementDOList.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                            total = total.add(totalReim);
-                        }
-                        // 统计工作组所有的工时
-                        workGroupAmount.put(chuanyunWorkGroupDO.getObjectId(), total);
-                        System.out.println(workGroupAmount);
-                    });
-                });
-            });
-        });
-
-    }
-
-    @Test
-    public void buildProjectTest() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<String> m2 = List.of("F0000003_2,D20084");
-        Filter f1 = Filter.instance(0, 10, true, Filter.AND, m2);
-        ChuanyunFindAllBizDTO<ChuanyunGroupProjectDO> buildResponse = null;
-        try {
-            buildResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, f1);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (buildResponse.getReturnData() == null) {
-            return;
-        }
-        List<ChuanyunBuildProject> result = objectMapper.convertValue(buildResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-        List<String> buildProjectIdList = result.stream().map(ChuanyunBuildProject::getObjectId).toList();
-        buildProjectIdList.forEach(buildProjectId -> {
-            List<String> m3 = List.of("F0000001_2," + buildProjectId);
-            Filter filter = Filter.instance(0, 10, true, Filter.AND, m3);
-            ChuanyunFindAllBizDTO<Object> projectList = null;
-            try {
-                projectList = chuanYunManager.findAll(ChuanyunProjectOrganizationStructureDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (projectList == null || projectList.getReturnData() == null) {
-                return;
-            }
-            List<ChuanyunProjectOrganizationStructureDO> projectOrganizationStructureList = objectMapper.convertValue(projectList.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            List<String> parentIdList = projectOrganizationStructureList.stream().map(BasicDO::getObjectId).toList();
-            parentIdList.forEach(parentId -> {
-                List<String> m4 = List.of("parentObjectId_2," + parentId);
-                ChuanyunFindAllBizDTO<Object> workGroupResponse = null;
-                try {
-                    workGroupResponse = chuanYunManager.findAll(ChuanyunWorkGroupDO.SCHEMA_CODE, Filter.instance(0, 30, true, Filter.AND, m4));
-                } catch (JsonProcessingException e) {
-                    e.printStackTrace();
-                }
-                if (workGroupResponse == null || !workGroupResponse.getSuccessful()) {
-                    return;
-                }
-                if (workGroupResponse.getReturnData() == null) {
-                    return;
-                }
-                List<ChuanyunWorkGroupDO> workGroupList = objectMapper.convertValue(workGroupResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                workGroupList.forEach(chuanyunWorkGroupDO -> {
-
-                    Map<String, BigDecimal> workGroupAmount = new HashMap<>();
-                    List<String> userIdList = chuanyunWorkGroupDO.getSubWorkGroupMemberObject().stream().map(BasicSubDO::getObjectId).toList();
-                    // 查询报销单
-                    BigDecimal total = new BigDecimal("0.00");
-                    for (String userId : userIdList) {
-                        // 查询用户在该项目的报销单
-                        List<String> m1 = List.of("F0000075_5,异常", "F0000002_2,D20084");
-                        Filter instance = Filter.instance(0, 50, true, Filter.AND, m1);
-                        ChuanyunFindAllBizDTO<Object> groupProjectResponse = null;
-                        try {
-                            groupProjectResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, instance);
-                        } catch (JsonProcessingException e) {
-                            e.printStackTrace();
-                        }
-                        if (!groupProjectResponse.getSuccessful() || groupProjectResponse.getReturnData() == null) {
-                            continue;
-                        }
-                        List<Object> bizObjectArray = groupProjectResponse.getReturnData().getBizObjectArray();
-                        List<ChuanyunGroupProjectDO> groupProjectDOList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                        });
-
-                        for (ChuanyunGroupProjectDO chuanyunGroupProjectDO : groupProjectDOList) {
-                            Filter f = Filter.instance(0, 10, true, Filter.AND, List.of("F0000093_2," + chuanyunGroupProjectDO.getObjectId(), "F0000001_2," + userId));
-                            ChuanyunFindAllBizDTO<Object> reimbursementResponse = null;
-                            try {
-                                reimbursementResponse = chuanYunManager.findAll(ChuanyunReimbursementDO.SCHEMA_CODE, f);
-                            } catch (JsonProcessingException e) {
-                                e.printStackTrace();
-                            }
-                            if (!reimbursementResponse.getSuccessful() || reimbursementResponse.getReturnData() == null) {
-                                continue;
-                            }
-                            List<ChuanyunReimbursementDO> reimbursementDOList = objectMapper.convertValue(reimbursementResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                            });
-                            BigDecimal totalReim = reimbursementDOList.stream().map(ChuanyunReimbursementDO::getTotalAmountNotTaxed).reduce(BigDecimal.ZERO, BigDecimal::add);
-                            total = total.add(totalReim);
-                        }
-                    }
-                    // 统计工作组所有的工时
-                    workGroupAmount.put(chuanyunWorkGroupDO.getObjectId(), total);
-                    System.out.println(workGroupAmount);
-                });
-            });
-        });
-
-
-    }
-
-}

+ 0 - 173
src/test/java/com/galaxis/manatee/Test/reimbursement/ReimbursementTest.java

@@ -1,173 +0,0 @@
-package com.galaxis.manatee.Test.reimbursement;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.constant.ChuanYunConstant;
-import com.galaxis.manatee.dao.*;
-import com.galaxis.manatee.entity.chuanyun.data.object.*;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.BuildProjectService;
-import com.galaxis.manatee.service.ProjectOrganizationStructureService;
-import com.galaxis.manatee.service.WorkGroupService;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.Objects;
-
-@SpringBootTest
-@Slf4j
-public class ReimbursementTest {
-
-    @Autowired
-    private ChuanyunReimbursementDao chuanyunReimbursementDao;
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-    @Autowired
-    private ChuanyunCompanyDao chuanyunCompanyDao;
-    @Autowired
-    private ChuanyunUserCompanyDao chuanyunUserCompanyDao;
-    @Autowired
-    private ChuanyunSupplierDao chuanyunSupplierDao;
-    @Autowired
-    private ChuanyunGroupProjectDao chuanyunGroupProjectDao;
-    @Autowired
-    private ChuanyunUserDao chuanyunUserDao;
-    @Autowired
-    private ChuanyunReimbursementSubjectDao chuanyunReimbursementSubjectDao;
-    @Autowired
-    private WorkGroupService workGroupService;
-    @Autowired
-    private BuildProjectService buildProjectService;
-    @Autowired
-    private ProjectOrganizationStructureService projectOrganizationStructureService;
-
-    @Test
-    public void findTest() {
-        List<String> matchersString = new ArrayList<>();
-        matchersString.add("Status_6,[1;2;3]");
-        matchersString.add("seqNo_2,BX2022050500031");
-        //从氚云查询数据
-        var filter = Filter.instance(0, 100, true, Filter.AND, matchersString);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunReimbursementDO.SCHEMA_CODE, filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (chuanyunFindAllResponse.getReturnData() == null) {
-            return;
-        }
-        ObjectMapper objectMapper = new ObjectMapper();
-        //转化为POJO
-        List<ChuanyunReimbursementDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-        //保存
-        result.forEach(chuanyunReimbursementDO -> {
-            try {
-                //找到以前的数据的话就删除
-                chuanyunReimbursementDao.delete(chuanyunReimbursementDao.findById(chuanyunReimbursementDO.getObjectId()).orElseThrow());
-            } catch (NoSuchElementException e) {
-                //没有之前的数据不做处理
-            }
-
-            //将报销单中关联信息的id转化为具体的数据
-            try {
-                ChuanyunCompanyDO chuanyunCompanyDO = chuanyunCompanyDao.findById(chuanyunReimbursementDO.getBeneficiaryId()).orElseThrow();
-                if ("对公".equals(chuanyunReimbursementDO.getPrivateOrPublic()) && !StringUtils.isEmpty(chuanyunReimbursementDO.getSupplierId())) {
-                    ChuanyunSupplierDO chuanyunSupplierDO = chuanyunSupplierDao.findById(chuanyunReimbursementDO.getSupplierId()).orElseThrow();
-                    chuanyunReimbursementDO.setSupplierCode(chuanyunSupplierDO.getSupplierCode());
-                }
-                StringBuilder chuanyunGroupProjectCode = new StringBuilder();
-                if (!StringUtils.isEmpty(chuanyunReimbursementDO.getGroupProjectId())) {
-                    ChuanyunGroupProjectDO chuanyunGroupProjectDO = chuanyunGroupProjectDao.findById(chuanyunReimbursementDO.getGroupProjectId()).orElseThrow();
-                    chuanyunReimbursementDO.setGroupProjectCode(chuanyunGroupProjectDO.getProjectCode());
-                    chuanyunGroupProjectCode.append(chuanyunGroupProjectDO.getProjectCode());
-                }
-                chuanyunReimbursementDO.setReimburseUserId(chuanyunReimbursementDO.getReimburseUserObject().getObjectId());
-                ChuanyunUserDO chuanyunUserDO = chuanyunUserDao.findById(chuanyunReimbursementDO.getReimburseUserId()).orElseThrow();
-                List<ChuanyunUserCompanyDO> userCompanyList = chuanyunUserCompanyDao.findAllByUserId(chuanyunReimbursementDO.getReimburseUserId());
-                if (userCompanyList.size() != 1) {
-                    log.error(chuanyunUserDO.getName() + chuanyunReimbursementDO.getReimburseUserId());
-                } else {
-                    ChuanyunUserCompanyDO chuanyunUserCompany = userCompanyList.get(0);
-                    chuanyunReimbursementDO.setReimburseUserCostCode(chuanyunUserCompany.getCostCode());
-                }
-//                        ChuanyunCostDO chuanyunCostDO=chuanyunCostDao.findById(chuanyunReimbursementDO.getBeneficiaryCostId()).orElseThrow();
-                chuanyunReimbursementDO.setBusinessDate(chuanyunReimbursementDO.getCreatedTime());
-                chuanyunReimbursementDO.setReimburseUserCompanyCode(chuanyunCompanyDO.getErpCode());
-                chuanyunReimbursementDO.setReimburseUserCode(chuanyunUserDO.getEmployeeNumber());
-                chuanyunReimbursementDO.setBeneficiaryBankCode(chuanyunCompanyDO.getBankCode());
-                chuanyunReimbursementDO.setBeneficiaryBankAccount(chuanyunCompanyDO.getBankAccount());
-//                        chuanyunReimbursementDO.setBeneficiaryCostCode(chuanyunCostDO.getCostCode());
-                chuanyunReimbursementDO.setCurrency("C001");
-                chuanyunReimbursementDO.setExchangeRate(new BigDecimal("1"));
-                chuanyunReimbursementDO.setSettlementMethod("101");
-                chuanyunReimbursementDO.setErpFlag(0);
-                chuanyunReimbursementDO.getDetailList().forEach(chuanyunReimbursementDetailDO -> {
-                    ChuanyunReimbursementSubjectDO chuanyunReimbursementSubjectDO = chuanyunReimbursementSubjectDao.findById(chuanyunReimbursementDetailDO.getReimburseSubjectId()).orElseThrow();
-                    chuanyunReimbursementDetailDO.setReimburseSubjectCode(chuanyunReimbursementSubjectDO.getSubjectCode());
-                    chuanyunReimbursementDetailDO.setReimburseSubjectName(chuanyunReimbursementSubjectDO.getSubjectName());
-                    chuanyunReimbursementDetailDO.setReimburseUserCompanyCode(chuanyunCompanyDO.getErpCode());
-                    chuanyunReimbursementDetailDO.setGroupProjectCode(chuanyunGroupProjectCode.toString());
-//                            chuanyunReimbursementDetailDO.setReimburseUserCostCode(chuanyunCostDO.getCostCode());
-                });
-                if (ChuanYunConstant.NEED_WORK_GROUP_PROJECT_TYPE.contains(chuanyunReimbursementDO.getPrintingProjectType())) {
-                    // 设置工作组名称
-                    String workGroupId = chuanyunReimbursementDO.getWorkGroupId();
-                    if (!Objects.isNull(workGroupId) && StringUtils.hasLength(workGroupId)) {
-                        ChuanyunWorkGroupDO workGroupDO = workGroupService.findByObjectId(workGroupId);
-                        if (workGroupDO != null) {
-                            chuanyunReimbursementDO.setWorkGroupName(workGroupDO.getWorkGroupName());
-                        } else {
-                            // 查询历史数据中是否存在工作组
-                            ChuanyunHistoryWorkGroupDO inHistoryWorkGroup = workGroupService.findInHistoryByObjectId(workGroupId);
-                            chuanyunReimbursementDO.setWorkGroupName(inHistoryWorkGroup.getWorkGroupName());
-                        }
-                    } else {
-                        // 没有填写工作组信息则任意选择该成员所在工作组
-                        // 通过项目号查询组织架构中的工作组
-                        List<ChuanyunBuildProject> allBuildProjectList = buildProjectService.findAllByProjectCode(chuanyunReimbursementDO.getGroupProjectCode());
-                        if (!Objects.isNull(allBuildProjectList)) {
-                            allBuildProjectList.forEach(chuanyunBuildProject -> {
-                                List<ChuanyunProjectOrganizationStructureDO> posList = projectOrganizationStructureService.findAllByProjectId(chuanyunBuildProject.getObjectId());
-                                if (!posList.isEmpty()) {
-                                    for (ChuanyunProjectOrganizationStructureDO chuanyunProjectOrganizationStructureDO : posList) {
-                                        // 查询工作组
-                                        List<ChuanyunWorkGroupDO> workGroupList = workGroupService.findByParentObjectId(chuanyunProjectOrganizationStructureDO.getObjectId());
-                                        if (!Objects.isNull(workGroupList)) {
-                                            for (ChuanyunWorkGroupDO workGroupDO : workGroupList) {
-                                                List<String> workGroupMamberUserIdList = workGroupDO.getSubWorkGroupMemberObject().stream().map(ChuanyunWorkGroupMemberDO::getUserId).toList();
-                                                if (workGroupMamberUserIdList.contains(chuanyunReimbursementDO.getReimburseUserId())) {
-                                                    chuanyunReimbursementDO.setWorkGroupName(workGroupDO.getWorkGroupName());
-                                                    chuanyunReimbursementDO.setWorkGroupId(workGroupDO.getObjectId());
-                                                    break;
-                                                }
-
-                                            }
-                                        }
-                                    }
-                                }
-                            });
-                        }
-                    }
-                }
-
-            } catch (Exception e) {
-                log.warn(e.getMessage());
-                e.printStackTrace();
-            }
-
-        });
-        chuanyunReimbursementDao.saveAll(result);
-    }
-}

+ 0 - 19
src/test/java/com/galaxis/manatee/Test/reimbursement/SyncReimTest.java

@@ -1,19 +0,0 @@
-package com.galaxis.manatee.Test.reimbursement;
-
-import com.galaxis.manatee.task.ChuanyunFinancialScheduledTask;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class SyncReimTest {
-
-    @Autowired
-    private ChuanyunFinancialScheduledTask chuanyunFinancialScheduledTask;
-
-    @Test
-    void syncTest(){
-        chuanyunFinancialScheduledTask.syncReimbursement();
-    }
-
-}

+ 0 - 160
src/test/java/com/galaxis/manatee/Test/salaProjectTest/UpdateProjectName.java

@@ -1,160 +0,0 @@
-package com.galaxis.manatee.Test.salaProjectTest;
-
-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.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunSaleProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunSaveDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class UpdateProjectName {
-
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Test
-    void changeSaleName() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 200;
-        List<String> m = List.of("F0000005_2,销售项目");
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true, Filter.AND, m);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            //获取项目总数
-            result.forEach(chuanyunGroupProjectDO -> {
-                try {
-                    log.info("{}", chuanyunGroupProjectDO);
-                    List<String> m2 = List.of("F0000034_2," + chuanyunGroupProjectDO.getProjectCode());
-                    var filter2 = Filter.instance(0, 10, true, Filter.AND, m2);
-                    ChuanyunFindAllBizDTO<Object> all = chuanYunManager.findAll(ChuanyunSaleProjectDO.SCHEMA_CODE, filter2);
-                    if (all.getReturnData() == null) {
-                        return;
-                    }
-
-
-                    //转化为POJO
-                    List<ChuanyunSaleProjectDO> res = objectMapper.convertValue(all.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                    });
-
-                    if (!res.isEmpty()) {
-                        ChuanyunSaleProjectDO chuanyunSaleProjectDO = res.get(0);
-                        GroupProjectSaleNameUpdateDTO groupProjectStateUpdateDTO = new GroupProjectSaleNameUpdateDTO();
-                        groupProjectStateUpdateDTO.setProjectName(chuanyunSaleProjectDO.getProjectName());
-                        String jsonStr = objectMapper.writeValueAsString(groupProjectStateUpdateDTO);
-                        ChuanyunSaveDTO update = chuanYunManager.update(ChuanyunGroupProjectDO.SCHEMA_CODE, chuanyunGroupProjectDO.getObjectId(), jsonStr);
-                        log.info("{}", update.getSuccessful());
-                    }
-
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-
-        }
-    }
-
-    @Data
-    static class GroupProjectSaleNameUpdateDTO {
-        @JsonProperty("F0000003")
-        private String projectName;
-    }
-
-    @Data
-    static class GroupProjectUpdateDTO {
-        @JsonProperty("F0000011")
-        private String projectManager;
-    }
-
-    @Test
-    void changeProjectManager() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 200;
-        List<String> m = List.of("F0000005_2,销售项目", "F0000005_2,研发项目", "F0000005_2,管理项目");
-
-        while (flag) {
-
-            //从氚云查询数据
-            var filter = Filter.instance(start, start + pageSize, true, Filter.OR, m);
-            ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-            try {
-                chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunGroupProjectDO.SCHEMA_CODE, filter);
-            } catch (JsonProcessingException e) {
-                e.printStackTrace();
-            }
-            if (chuanyunFindAllResponse.getReturnData() == null) {
-                flag = false;
-                continue;
-            }
-            if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                start += pageSize;
-            } else {
-                flag = false;
-            }
-
-
-            //转化为POJO
-            List<ChuanyunGroupProjectDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-            });
-            //获取项目总数
-            result.forEach(chuanyunGroupProjectDO -> {
-                try {
-                    GroupProjectUpdateDTO groupProjectUpdateDTO = new GroupProjectUpdateDTO();
-                    groupProjectUpdateDTO.setProjectManager(chuanyunGroupProjectDO.getProjectOwnerObject().getObjectId());
-                    String jsonStr = objectMapper.writeValueAsString(groupProjectUpdateDTO);
-                    ChuanyunSaveDTO update = chuanYunManager.update(ChuanyunGroupProjectDO.SCHEMA_CODE, chuanyunGroupProjectDO.getObjectId(), jsonStr);
-                    log.info("{}", update.getSuccessful());
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-
-        }
-    }
-}

+ 0 - 32
src/test/java/com/galaxis/manatee/Test/user/UserIdTest.java

@@ -1,32 +0,0 @@
-package com.galaxis.manatee.Test.user;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunUserDO;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-
-@SpringBootTest
-public class UserIdTest {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    void userTest(){
-        var objectMapper = new ObjectMapper();
-        var chuanyunFindAllDTO = chuanYunManager.findAll(ChuanyunUserDO.APP_CODE, ChuanyunUserDO.ACTION_NAME, ChuanyunUserDO.CONTROLLER);
-        var totalCount = 0;
-        try {
-            List<ChuanyunUserDO> userList = objectMapper.readValue(chuanyunFindAllDTO.getReturnData().getData(), new TypeReference<>() {
-            });
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-}

+ 0 - 61
src/test/java/com/galaxis/manatee/Test/workHour/ChangeHistoryWorkHourTest.java

@@ -1,61 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunProjectDO;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-import java.util.Objects;
-
-@SpringBootTest
-public class ChangeHistoryWorkHourTest {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Test
-    public void changeTest() {
-
-        // 查询总表表objectId
-        List<ChuanyunProjectDO> chuanyunProjectDOS = findByProjectCode("D18045");
-
-        System.out.println(chuanyunProjectDOS);
-
-
-    }
-
-    private List<ChuanyunProjectDO> findByProjectCode(String projectCode) {
-        List<String> m = List.of("F0000002_2," + projectCode);
-        Filter instance = Filter.instance(0, 10, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanYunManagerAll = null;
-        try {
-            chuanYunManagerAll = chuanYunManager.findAll(ChuanyunProjectDO.SCHEMA_CODE, instance);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (!Objects.isNull(chuanYunManagerAll)) {
-            if (chuanYunManagerAll.getSuccessful() && !Objects.isNull(chuanYunManagerAll.getReturnData())) {
-                List<Object> bizObjectArray = chuanYunManagerAll.getReturnData().getBizObjectArray();
-                ObjectMapper objectMapper = new ObjectMapper();
-                List<ChuanyunProjectDO> projectDOList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
-                });
-
-                if (!Objects.isNull(projectDOList)) {
-                    return projectDOList;
-                }
-            }
-
-        }
-
-        return null;
-
-    }
-}

+ 0 - 7
src/test/java/com/galaxis/manatee/Test/workHour/ChangeWorkProjectTest.java

@@ -1,7 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class ChangeWorkProjectTest {
-}

+ 0 - 30
src/test/java/com/galaxis/manatee/Test/workHour/LogTest.java

@@ -1,30 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.galaxis.manatee.service.LogService;
-import com.galaxis.manatee.service.LogStandardService;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest
-public class LogTest {
-
-    @Autowired
-    private LogStandardService logStandardService;
-
-    @Autowired
-    private LogService logService;
-    @Test
-    public void logTest(){
-//        logStandardService.standardHalfYearWorkHourByUserId("ec6f41e7-7b6e-4a89-8c21-c92e05249139");
-        String userId = "58e63736-6e05-4c37-b180-4fc03adecaae";
-        logStandardService.standardHalfYearWorkHourByUserId(userId);
-    }
-
-    @Test
-    public void downloadLogByUserId(){
-
-        logService.downloadLogByUserId("f24ae788-8c3f-4cae-99ca-955ea684e373");
-    }
-
-}

+ 0 - 228
src/test/java/com/galaxis/manatee/Test/workHour/SaveLog.java

@@ -1,228 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.constant.ChuanYunConstant;
-import com.galaxis.manatee.dao.*;
-import com.galaxis.manatee.entity.chuanyun.data.object.*;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.LogDownloadService;
-import com.galaxis.manatee.util.StringUtil;
-import com.galaxis.manatee.util.TimeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.time.Instant;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
-
-@Slf4j
-@SpringBootTest
-public class SaveLog {
-
-    @Autowired
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    private ChuanyunLogDao chuanyunLogDao;
-    @Autowired
-    private ChuanyunUserDepartmentNameDao chuanyunUserDepartmentNameDao;
-    @Autowired
-    private ChuanyunGroupProjectDao chuanyunGroupProjectDao;
-    @Autowired
-    private ChuanyunUserCompanyDao userCompanyDao;
-    @Autowired
-    private LogDownloadService logDownloadService;
-    private ChuanyunFactoryLocationDao factoryLocationDao;
-    private ChuanyunEquipmentProcessDao equipmentProcessDao;
-
-    @Autowired
-    public void setFactoryLocationDao(ChuanyunFactoryLocationDao factoryLocationDao) {
-        this.factoryLocationDao = factoryLocationDao;
-    }
-
-    @Autowired
-    public void setEquipmentProcessDao(ChuanyunEquipmentProcessDao equipmentProcessDao) {
-        this.equipmentProcessDao = equipmentProcessDao;
-    }
-
-    @Test
-    public void saveLog() {
-        var objectMapper = new ObjectMapper();
-        var start = 0;
-        var totalCount = 0L;
-        var flag = true;
-        var pageSize = 100;
-        List<String> matchersString = new ArrayList<>();
-        //由于需要统计流程中的日志,在日志数据同步时将状态为2的数据一并统计
-        matchersString.add("Status_6,[1;2;3]");
-        LocalDateTime localDateTimeStart = LocalDateTime.of(2022, 5, 1, 0, 0, 0);
-        LocalDateTime localDateTimeEnd = LocalDateTime.of(2022, 5, 30, 23, 59, 59);
-        matchersString.add("logDate_1," + TimeUtil.formatDateTime(localDateTimeStart));
-        matchersString.add("logDate_3," + TimeUtil.formatDateTime(localDateTimeEnd));
-        while (flag) {
-            long startTime = Instant.now().getEpochSecond();
-            try {
-                //从氚云查询数据
-                var filter = Filter.instance(start, start + pageSize, true, Filter.AND, matchersString);
-                var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunLogDO.SCHEMA_CODE, filter);
-                if (chuanyunFindAllResponse.getReturnData() == null) {
-                    flag = false;
-                    continue;
-                }
-                if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                    start += pageSize;
-                } else {
-                    flag = false;
-                }
-
-                //转化为POJO
-                List<ChuanyunLogDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-                //处理日志数据
-                result.forEach(this::updateChuanyunLogData);
-                //获取项目总数
-                totalCount = chuanyunFindAllResponse.getReturnData().getTotalCount();
-                //保存
-                chuanyunLogDao.saveAll(result);
-            } catch (Exception e) {
-                log.error(e.getMessage());
-                e.printStackTrace();
-            }
-            log.info("日志100条保存时间" + (Instant.now().getEpochSecond() - startTime) + "秒");
-        }
-        log.info("最近一月历史日志信息保存" + totalCount);
-    }
-
-    /**
-     * 更新氚云日志数据
-     *
-     * @param chuanyunLogDO 待处理数据
-     */
-    private void updateChuanyunLogData(ChuanyunLogDO chuanyunLogDO) {
-        //处理项目userId
-        if (chuanyunLogDO.getUserObject() != null) {
-            chuanyunLogDO.setUserId(chuanyunLogDO.getUserObject().getObjectId());
-        }
-        //日志人员所属部门名称
-        if (!StringUtils.isEmpty(chuanyunLogDO.getDepartment())) {
-            chuanyunLogDO.setDepartmentName(chuanyunLogDO.getDepartment());
-        } else {
-            chuanyunLogDao.findById(chuanyunLogDO.getObjectId()).ifPresent(oldLogDO -> {
-                chuanyunLogDO.setDepartmentName(oldLogDO.getDepartmentName());
-            });
-        }
-
-        if (Objects.isNull(chuanyunLogDO.getDepartmentName()) || chuanyunLogDO.getDepartmentName().isBlank()) {
-            // 任没有部门,查询该用户所属公司获取部门
-            Optional<ChuanyunUserCompanyDO> first = userCompanyDao.findAllByUserIdOrderByModifiedTimeDesc(chuanyunLogDO.getUserId()).stream().findFirst();
-            first.ifPresent(chuanyunUserCompanyDO -> {
-                String[] split = chuanyunUserCompanyDO.getDepartment().split("/");
-                int length = split.length;
-                chuanyunLogDO.setDepartmentName(split[length - 1]);
-            });
-        }
-        //处理数据
-        if (chuanyunLogDO.getDayLogList() == null || chuanyunLogDO.getDayLogList().size() == 0) {
-            chuanyunLogDO.setDayLogList(new ArrayList<>());
-            log.warn(chuanyunLogDO + "");
-            log.warn("异常数据");
-        } else {
-            //如果有重复就删除
-            chuanyunLogDao.findById(chuanyunLogDO.getObjectId()).ifPresent(chuanyunLogDao::delete);
-            //根据projectId获取code,如果是生产项目,则不用处理
-            //针对前期测试数据,可能出现日志为空的情况,跳过不处理
-            // fixme 每周工时没有工作组id
-            chuanyunLogDO.getDayLogList().forEach(chuanyunDayLog -> {
-                // 补全工作组
-                if (ChuanYunConstant.LOG_WEEK_TYPE.contains(chuanyunLogDO.getDayOrWeek()) && ChuanYunConstant.NEED_WORK_GROUP_PROJECT_TYPE.contains(chuanyunDayLog.getProjectType())) {
-                    List<ChuanyunWeekLogDO> weekLogList = chuanyunLogDO.getWeekLogList();
-                    for (ChuanyunWeekLogDO chuanyunWeekLogDO : weekLogList) {
-                        if (Objects.equals(chuanyunDayLog.getProjectId(), chuanyunWeekLogDO.getProjectId())) {
-                            chuanyunDayLog.setWorkGroupId(chuanyunWeekLogDO.getWorkGroupId());
-                            break;
-                        }
-                    }
-                }
-
-                //离职人员补全用户Id及部门ID
-                if (StringUtils.isEmpty(chuanyunLogDO.getUserId())) {
-                    var name = "";
-                    if (StringUtils.isEmpty(chuanyunDayLog.getContent())) {
-                        name = chuanyunLogDO.getName();
-                    } else {
-                        name = chuanyunDayLog.getContent();
-                    }
-                    chuanyunLogDO.setUserId(StringUtil.getCharacters(name));
-                    ChuanyunUserDepartmentNameDO chuanyunUserDepartmentNameDO = chuanyunUserDepartmentNameDao.findByUserName(chuanyunLogDO.getUserId());
-                    if (chuanyunUserDepartmentNameDO != null) {
-                        chuanyunLogDO.setDepartmentName(chuanyunUserDepartmentNameDO.getDepartmentName());
-                    }
-                }
-                try {
-                    if (!ChuanYunConstant.PRODUCTION_PROJECT.equals(chuanyunDayLog.getProjectType()) && StringUtils.isEmpty(chuanyunDayLog.getProjectId())) {
-                        log.info(chuanyunLogDO + "");
-                    } else if (!ChuanYunConstant.PRODUCTION_PROJECT.equals(chuanyunDayLog.getProjectType())) {
-                        ChuanyunGroupProjectDO chuanyunGroupProjectDO = chuanyunGroupProjectDao.findById(chuanyunDayLog.getProjectId()).orElseThrow();
-                        chuanyunDayLog.setProjectCode(chuanyunGroupProjectDO.getProjectCode());
-                    }
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    log.warn(chuanyunDayLog + "");
-                }
-            });
-        }
-    }
-
-    @Test
-    public void saveLog2() {
-        logDownloadService.saveDayLog();
-    }
-
-    @Test
-    public void saveFactoryLocation() {
-        //从氚云查询数据
-        var filter = Filter.instance(0, 20, true);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll("D0017896651391eded64eabb0e41ce458c4192d", filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        ObjectMapper objectMapper = new ObjectMapper();
-        //转化为POJO
-        List<ChuanyunFactoryLocation> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-        //保存
-        factoryLocationDao.saveAll(result);
-    }
-
-    @Test
-    public void saveEquipmentProcess() {
-        //从氚云查询数据
-        var filter = Filter.instance(0, 100, true);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll("D0017896b29261f8b404521b0a404d79ea4db04", filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        ObjectMapper objectMapper = new ObjectMapper();
-        //转化为POJO
-        List<ChuanyunEquipmentProcess> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-        //保存
-        equipmentProcessDao.saveAll(result);
-    }
-
-
-}

+ 0 - 35
src/test/java/com/galaxis/manatee/Test/workHour/StandarSelfCostLogTest.java

@@ -1,35 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.galaxis.manatee.service.LogStandardService;
-import com.galaxis.manatee.service.LogUpdateService;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@Slf4j
-@SpringBootTest
-public class StandarSelfCostLogTest {
-
-    @Autowired
-    private LogStandardService logStandardService;
-    @Autowired
-    private LogUpdateService logUpdateService;
-
-    @Test
-    public void saveLog() {
-        logStandardService.standardSelfCostByUserId("ec6f41e7-7b6e-4a89-8c21-c92e05249139");
-    }
-
-    @Test
-    public void pullLog() {
-        logUpdateService.pushOneYearSelfCostListByUserId("ec6f41e7-7b6e-4a89-8c21-c92e05249139");
-    }
-
-
-    @Test
-    public void standardWorkHour(){
-        logStandardService.standardHalfYearWorkHourByUserId("ec6f41e7-7b6e-4a89-8c21-c92e05249139");
-    }
-
-}

+ 0 - 171
src/test/java/com/galaxis/manatee/Test/workHour/Standard.java

@@ -1,171 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.dao.ChuanyunSelfWorkHourDao;
-import com.galaxis.manatee.dao.ChuanyunUserCompanyDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMemberHourDO;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunSelfWorkHourDO;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunUserCompanyDO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.LogService;
-import com.galaxis.manatee.service.LogStandardService;
-import com.galaxis.manatee.service.LogUpdateService;
-import com.galaxis.manatee.task.WorkHourStatistics;
-import com.galaxis.manatee.util.TimeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-@Slf4j
-@SpringBootTest
-public class Standard {
-
-    @Autowired
-    private LogService logService;
-
-    @Autowired
-    private LogStandardService logStandardService;
-
-    @Autowired
-    private ChuanyunSelfWorkHourDao chuanyunSelfWorkHourDao;
-
-    @Autowired
-    private ChuanyunUserCompanyDao chuanyunUserCompanyDao;
-
-    @Autowired
-    private WorkHourStatistics workHourStatistics;
-
-    private LogUpdateService logUpdateService;
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    public void setLogUpdateService(LogUpdateService logUpdateService) {
-        this.logUpdateService = logUpdateService;
-    }
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Test
-    void standard() {
-        logService.standardAllSelfCost();
-    }
-
-    @Test
-    void updateAll() {
-        logService.updateAllChuanyunSelfCost();
-    }
-
-    @Test
-    void updateAllDay() {
-        logService.updateAllChuanyunSelfCost();
-    }
-
-    @Test
-    void standardByUserId() {
-
-        List<ChuanyunSelfWorkHourDO> userAllSelfWorkHours = chuanyunSelfWorkHourDao.findByUserId("28f1291d-b322-4983-9893-cc7f1742fcc2");
-        Map<LocalDate, Map<String, Map<String, Map<String, BigDecimal>>>> map = userAllSelfWorkHours.stream().filter(selfWorkHourDO ->
-                StringUtils.hasLength(selfWorkHourDO.getProjectId()) &&
-                        StringUtils.hasLength(selfWorkHourDO.getProjectType()) &&
-                        StringUtils.hasLength(selfWorkHourDO.getStatus()) &&
-                        selfWorkHourDO.getStandardWorkHour() != null &&
-                        selfWorkHourDO.getDayLogDate() != null).collect(
-                Collectors.groupingBy(chuanyunSelfWorkHourDO -> LocalDate.of(chuanyunSelfWorkHourDO.getDayLogDate().getYear(), chuanyunSelfWorkHourDO.getDayLogDate().getMonth(), 1),
-                        Collectors.groupingBy(ChuanyunSelfWorkHourDO::getProjectId,
-                                Collectors.groupingBy(ChuanyunSelfWorkHourDO::getProjectType,
-                                        Collectors.groupingBy(ChuanyunSelfWorkHourDO::getStatus, Collectors.reducing(BigDecimal.ZERO, ChuanyunSelfWorkHourDO::getStandardWorkHour, BigDecimal::add)
-                                        )))));
-
-
-    }
-
-    @Test
-    void user() {
-        List<String> userIdList = chuanyunUserCompanyDao.findAll().stream().map(ChuanyunUserCompanyDO::getUserId).filter(StringUtils::hasLength).collect(Collectors.toList());
-        int i = userIdList.indexOf("28f1291d-b322-4983-9893-cc7f1742fcc2");
-        ArrayList<String> userId2 = new ArrayList<>();
-        for (int j = i; j < userIdList.size(); j++) {
-            String s = userIdList.get(j);
-            userId2.add(s);
-        }
-        userId2.parallelStream().forEach(s -> {
-                    logStandardService.standardSelfCostByUserId(s);
-                    log.info("标准化用户工时完成userId: {}", s);
-                }
-        );
-    }
-
-    @Test
-    void standardSelfWorkHour() {
-        List<String> userIdList = chuanyunUserCompanyDao.findAll().stream().map(ChuanyunUserCompanyDO::getUserId).filter(StringUtils::hasLength).toList();
-        List<String> userIdList2 = userIdList.stream().distinct().toList();
-        userIdList2.forEach(logStandardService::standardHalfYearWorkHourByUserId);
-    }
-
-
-
-    @Test
-    void standardAll() {
-        workHourStatistics.standardAllWorkHour();
-    }
-
-    @Test
-    void pushAll() {
-        workHourStatistics.pushAllWorkHour();
-    }
-
-    @Test
-    public void downloadLogByUserId(){
-
-        logService.downloadLogByUserId("12264c19-12b2-44cf-8e63-ab2937605882");
-    }
-
-    @Test
-    void standardSelfWorkHourOne() {
-        // 3d94c30e-66f1-46e8-a2a3-fe32aa9a071d
-        logStandardService.standardSelfWorkHourByUserId("a4a1e5f8-f3a5-449f-8a1c-bdb63bbc4f6b");
-    }
-
-    @Test
-    void pushOne() {
-        logUpdateService.updateChuanyunSelfWorkHourListByUserId("a4a1e5f8-f3a5-449f-8a1c-bdb63bbc4f6b");
-    }
-
-    @Test
-    void saveOne() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        try {
-            List<String> matchers = new ArrayList<>();
-            matchers.add("F0000001_2,ef3e45e8-006f-4a25-8f40-d5832d6898ad");
-            matchers.add("F0000002_2,be8724e2-169e-49a1-8806-bd7b3631894c");
-            matchers.add("F0000003_2," + TimeUtil.formatDateTime(LocalDateTime.of(2022, 1, 15, 8, 0, 0)));
-            matchers.add("F0000005_2,实施");
-            var filter = Filter.instance(0, Integer.MAX_VALUE, true, "And", matchers);
-            var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMemberHourDO.SCHEMA_CODE, filter);
-            if (chuanyunFindAllResponse.getReturnData() != null) {
-                List<ChuanyunMemberHourDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-            }
-
-        } catch (Exception e) {
-            log.error(e.getMessage());
-        }
-    }
-
-
-}

+ 0 - 50
src/test/java/com/galaxis/manatee/Test/workHour/clearErrorWorkHour.java

@@ -1,50 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMemberHourDO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.util.TimeUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class clearErrorWorkHour {
-
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Test
-    void clear() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        try {
-            List<String> matchers = new ArrayList<>();
-            matchers.add("F0000001_2,ef3e45e8-006f-4a25-8f40-d5832d6898ad");
-            matchers.add("F0000002_2,be8724e2-169e-49a1-8806-bd7b3631894c");
-            matchers.add("F0000003_2," + TimeUtil.formatDateTime(LocalDateTime.of(2022, 1, 15, 8, 0, 0)));
-            matchers.add("F0000005_2,实施");
-            var filter = Filter.instance(0, Integer.MAX_VALUE, true, "And", matchers);
-            var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMemberHourDO.SCHEMA_CODE, filter);
-            if (chuanyunFindAllResponse.getReturnData() != null) {
-                List<ChuanyunMemberHourDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                });
-            }
-
-        } catch (Exception e) {
-            log.error(e.getMessage());
-        }
-
-    }
-}

+ 0 - 128
src/test/java/com/galaxis/manatee/Test/workHour/fixBug.java

@@ -1,128 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.galaxis.manatee.dao.ChuanyunGroupProjectDao;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunGroupProjectDO;
-import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMemberHourDO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import com.galaxis.manatee.service.LogService;
-import com.galaxis.manatee.service.LogStandardService;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.util.StringUtils;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-
-@Slf4j
-@SpringBootTest
-public class fixBug {
-
-    private LogService logService;
-
-    private LogStandardService logStandardService;
-
-    private ChuanYunManager chuanYunManager;
-
-    private ChuanyunGroupProjectDao groupProjectDao;
-
-    @Autowired
-    public void setLogService(LogService logService) {
-        this.logService = logService;
-    }
-
-    @Autowired
-    public void setLogStandardService(LogStandardService logStandardService) {
-        this.logStandardService = logStandardService;
-    }
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Autowired
-    public void setGroupProjectDao(ChuanyunGroupProjectDao groupProjectDao) {
-        this.groupProjectDao = groupProjectDao;
-    }
-
-    @Test
-    void fix() {
-        List<String> userIdList = List.of(
-                "27f10a28-e3b2-4381-bb50-6dfe94143a37");
-        for (String userId : userIdList) {
-            logService.downloadLogByUserId(userId);
-            log.info("下载完成 userId: {}", userId);
-            logStandardService.standardSelfWorkHourByUserId(userId);
-            log.info("标准化完成 userId: {}", userId);
-        }
-
-
-    }
-
-    @Test
-    void fixProjectCode() {
-
-        ObjectMapper objectMapper = new ObjectMapper();
-        var start = 5500;
-        var totalCount = 0L;
-        var pageSize = 100;
-        var flag = true;
-
-        while (flag) {
-            try {
-                List<String> matchers = new ArrayList<>();
-                matchers.add("F0000001_2,1f48d45f-10bf-4b26-ad5a-9f0e41ad02ef");
-                var filter = Filter.instance(start, start + pageSize, true, Filter.AND, matchers);
-                var chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunMemberHourDO.SCHEMA_CODE, filter);
-                if (chuanyunFindAllResponse.getReturnData() == null) {
-                    flag = false;
-                    continue;
-                }
-                if (chuanyunFindAllResponse.getReturnData().getTotalCount() >= start + pageSize) {
-                    start += pageSize;
-                } else {
-                    flag = false;
-                }
-                if (chuanyunFindAllResponse.getReturnData() != null) {
-                    List<ChuanyunMemberHourDO> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-                    });
-                    result.forEach(chuanyunMemberHourDO -> {
-                        if (chuanyunMemberHourDO.getStandardWorkHour().compareTo(new BigDecimal(0)) != 0 && !StringUtils.hasLength(chuanyunMemberHourDO.getProjectCode())) {
-                            ChuanyunGroupProjectDO groupProjectDO = groupProjectDao.findByObjectId(chuanyunMemberHourDO.getProjectId());
-                            MemberWorkHourDTO memberWorkHourDTO = new MemberWorkHourDTO();
-                            memberWorkHourDTO.setProjectCode(groupProjectDO.getProjectCode());
-                            String s = null;
-                            try {
-                                s = objectMapper.writeValueAsString(memberWorkHourDTO);
-                                chuanYunManager.update(ChuanyunMemberHourDO.SCHEMA_CODE, s, chuanyunMemberHourDO.getObjectId());
-                            } catch (Exception e) {
-                                e.printStackTrace();
-                            }
-                        }
-                    });
-                }
-
-
-            } catch (Exception e) {
-                log.warn("更新标准工时异常");
-            }
-        }
-
-        log.info("更新完成");
-    }
-
-    @Data
-    static class MemberWorkHourDTO {
-
-        @JsonProperty("F0000011")
-        private String projectCode;
-    }
-}

+ 0 - 71
src/test/java/com/galaxis/manatee/Test/workHour/updateDayWorkHour.java

@@ -1,71 +0,0 @@
-package com.galaxis.manatee.Test.workHour;
-
-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.galaxis.manatee.entity.chuanyun.data.object.ChuanyunDayLog;
-import com.galaxis.manatee.entity.chuanyun.dto.ChuanyunFindAllBizDTO;
-import com.galaxis.manatee.entity.chuanyun.dto.Filter;
-import com.galaxis.manatee.manager.ChuanYunManager;
-import lombok.Data;
-import org.junit.jupiter.api.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-
-import java.util.List;
-
-@SpringBootTest
-public class updateDayWorkHour {
-
-    private ChuanYunManager chuanYunManager;
-
-    @Autowired
-    public void setChuanYunManager(ChuanYunManager chuanYunManager) {
-        this.chuanYunManager = chuanYunManager;
-    }
-
-    @Test
-    void updateDayWorkHourProjectId() {
-        ObjectMapper objectMapper = new ObjectMapper();
-        List<String> m = List.of("project_2,2e3018f9-8ab7-11ea-8ae9-7cd30ab711fe", "projecttype_2,实施");
-        //从氚云查询数据
-        var filter = Filter.instance(0, 100, true, Filter.AND, m);
-        ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
-        try {
-            chuanyunFindAllResponse = chuanYunManager.findAll("D001789DayLog", filter);
-        } catch (JsonProcessingException e) {
-            e.printStackTrace();
-        }
-        if (chuanyunFindAllResponse.getReturnData() == null) {
-            return;
-        }
-        //转化为POJO
-        List<ChuanyunDayLog> result = objectMapper.convertValue(chuanyunFindAllResponse.getReturnData().getBizObjectArray(), new TypeReference<>() {
-        });
-
-        result.forEach(chuanyunDayLog -> {
-            UpdateProjectIdDTO updateProjectIdDTO = new UpdateProjectIdDTO("1f48d45f-10bf-4b26-ad5a-9f0e41ad02ef");
-            try {
-                String jsonStr = objectMapper.writeValueAsString(updateProjectIdDTO);
-                chuanYunManager.update("D001789DayLog",chuanyunDayLog.getObjectId(),jsonStr);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        });
-
-
-    }
-
-    @Data
-    class UpdateProjectIdDTO {
-
-        @JsonProperty("project")
-        private String project;
-
-        public UpdateProjectIdDTO(String project) {
-            this.project = project;
-        }
-    }
-
-}