|
@@ -2,16 +2,29 @@ package com.galaxis.manatee.Test.zzx;
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
|
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
|
+import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunBuildProject;
|
|
|
+import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMaintenanceCycleDO;
|
|
|
+import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMaintenanceProDO;
|
|
|
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.util.ChuanyunLocalDateTimeDeserializer;
|
|
|
+import com.galaxis.manatee.util.ChuanyunLocalDateTimeSerializer;
|
|
|
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.format.annotation.DateTimeFormat;
|
|
|
|
|
|
+import javax.persistence.CascadeType;
|
|
|
+import javax.persistence.FetchType;
|
|
|
+import javax.persistence.OneToMany;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@@ -21,12 +34,12 @@ public class ProjectTest1 {
|
|
|
private ChuanYunManager chuanYunManager;
|
|
|
|
|
|
@Test
|
|
|
- void test1() {
|
|
|
- List<String> m = List.of("F0000035_2,维保", "F0000035_2,售后");
|
|
|
+ void test1() { //将项目立项的数据同步到售后项目资料
|
|
|
+ List<String> m = List.of("F0000016_2,维保", "F0000016_2,售后");
|
|
|
var filter = Filter.instance(0, 400, true, Filter.OR, m);
|
|
|
ChuanyunFindAllBizDTO<Object> chuanyunFindAllResponse = null;
|
|
|
try {
|
|
|
- chuanyunFindAllResponse = chuanYunManager.findAll("D001789Srquo86tpfq1iuuqww4heu2w73", filter);
|
|
|
+ chuanyunFindAllResponse = chuanYunManager.findAll(ChuanyunBuildProject.SCHEMA_CODE, filter);
|
|
|
} catch (JsonProcessingException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -37,18 +50,103 @@ public class ProjectTest1 {
|
|
|
|
|
|
List<Object> bizObjectArray = chuanyunFindAllResponse.getReturnData().getBizObjectArray();
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
- }
|
|
|
+ List<ChuanyunBuildProject> bpList = objectMapper.convertValue(bizObjectArray, new TypeReference<>() {
|
|
|
+ });
|
|
|
+
|
|
|
+ bpList.forEach(chuanyunBuildProject -> {
|
|
|
+ try {
|
|
|
+ Thread.sleep(200); //避免同步数据时因为氚云的限制而导致失败
|
|
|
|
|
|
+ Aftermarket aftermarket = new Aftermarket();
|
|
|
+ if (chuanyunBuildProject.getProjectType() == "维保") {
|
|
|
|
|
|
+ } else { //售后
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
@Data
|
|
|
static class Aftermarket { //售后项目资料的实体类
|
|
|
@JsonProperty("F0000001")
|
|
|
- private String projectName; //项目名称
|
|
|
+ private String projectName; //项目名称
|
|
|
+
|
|
|
@JsonProperty("F0000078")
|
|
|
- private String projectNo; //项目编号
|
|
|
+ private String projectNo; //项目编号
|
|
|
+
|
|
|
@JsonProperty("F0000121")
|
|
|
- private String customName; //客户名称
|
|
|
+ private String customName; //客户名称
|
|
|
+
|
|
|
+ @JsonProperty("F0000035")
|
|
|
+ private String afterProType; //售后项目类型
|
|
|
+
|
|
|
+ @JsonProperty("F0000036")
|
|
|
+ private String proClassify; //项目分类
|
|
|
+
|
|
|
+ @JsonProperty("F0000108")
|
|
|
+ private String isDevOps; //是否运维(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000124")
|
|
|
+ private String afterProCutoffDate; //转售后工作移交日期(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000104")
|
|
|
+ private String maintenanceProManager; //维保项目经理(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000105")
|
|
|
+ private String maintenanceProDirector; //维保项目总监(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000106")
|
|
|
+ private String maintenanceSaleChargeMan; //销售负责人(仅针对维保项目)
|
|
|
+
|
|
|
+ @JsonProperty("F0000107")
|
|
|
+ private String implProManager; //实施项目经理(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("D001789F28649f6f044a4224b5c68aa821918f50")
|
|
|
+ @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
|
|
|
+ private List<ChuanyunMaintenanceProDO> maintenanceProList; //维保交付内容(子表)(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("D001789Fe75a894fabe3490ab47812cb7d79fd25")
|
|
|
+ @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER)
|
|
|
+ private List<ChuanyunMaintenanceCycleDO> MaintenanceCycleList; //维保周期(子表)(仅维保项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000123")
|
|
|
+ private String deliverManager; //主要交付内容(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000087")
|
|
|
+ @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
+ @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
+ @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
|
|
|
+ private LocalDateTime setUpDate; //立项日期(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000110")
|
|
|
+ private String afterSaleManager; //售后项目经理(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000111")
|
|
|
+ private String afterSaleDirector; //售后项目总监(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000112")
|
|
|
+ private String afterSaleChargeMan; //销售负责人(仅针对售后项目)
|
|
|
+
|
|
|
+ @JsonProperty("F0000088")
|
|
|
+ @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
+ @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
+ @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
|
|
|
+ private LocalDateTime startProDate; //项目启动实际日期(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000089")
|
|
|
+ @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
+ @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
+ @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
|
|
|
+ private LocalDateTime endProDate; //终验收实际日期(仅售后项目有)
|
|
|
+
|
|
|
+ @JsonProperty("F0000125")
|
|
|
+ private String sysMaintenanceMonth; //系统免费维保期(仅针对售后项目)
|
|
|
+
|
|
|
+ @JsonProperty("F0000128")
|
|
|
+ private String deviceMaintenanceMonth; //设备免费维保期(仅针对售后项目)
|
|
|
}
|
|
|
}
|
|
|
|