|
@@ -1,11 +1,13 @@
|
|
|
package com.galaxis.manatee.Test.zzx;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
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.capsule.bo.ChuanyunObject;
|
|
|
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;
|
|
@@ -25,6 +27,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|
|
import javax.persistence.CascadeType;
|
|
|
import javax.persistence.FetchType;
|
|
|
import javax.persistence.OneToMany;
|
|
|
+import javax.persistence.Transient;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -79,20 +82,36 @@ public class ProjectTest1 {
|
|
|
aftermarket.setMaintenanceSaleChargeMan(chuanyunBuildProject.getSalesDirector().getObjectId());
|
|
|
aftermarket.setImplProManager(chuanyunBuildProject.getImplementationManager().getObjectId());
|
|
|
|
|
|
-// Object[] maintenanceProList = new String[]{};
|
|
|
-// int index = 0;
|
|
|
-// if(chuanyunBuildProject.getMaintenanceProList().size() > 0){
|
|
|
-// for (int j = 0; j < chuanyunBuildProject.getMaintenanceProList().size(); j++) {
|
|
|
-// maintenanceProList[index] = chuanyunBuildProject.getMaintenanceProList().get(j);
|
|
|
-// index++;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
- Object[] maintenanceProList = chuanyunBuildProject.getMaintenanceProList().toArray(new Object[chuanyunBuildProject.getMaintenanceProList().size()]);
|
|
|
-
|
|
|
+ //维保交付内容(子表)
|
|
|
+ List<AftermarketMaintenance> maintenanceProList = new ArrayList<>();
|
|
|
+ if (chuanyunBuildProject.getMaintenanceProList().size() > 0) {
|
|
|
+ for (int j = 0; j < chuanyunBuildProject.getMaintenanceProList().size(); j++) {
|
|
|
+ ChuanyunMaintenanceProDO maintenanceProDO = chuanyunBuildProject.getMaintenanceProList().get(j);
|
|
|
+ AftermarketMaintenance aftermarketMaintenance = new AftermarketMaintenance();
|
|
|
+ aftermarketMaintenance.setProProperty(maintenanceProDO.getProProperty());
|
|
|
+ aftermarketMaintenance.setProProperty(maintenanceProDO.getProContent());
|
|
|
+ aftermarketMaintenance.setProVersion(maintenanceProDO.getProVersion());
|
|
|
+ aftermarketMaintenance.setMaintenanceChargeMan(maintenanceProDO.getMaintenanceChargeMan().getObjectId());
|
|
|
+ aftermarketMaintenance.setRemark(maintenanceProDO.getRemark());
|
|
|
+ maintenanceProList.add(aftermarketMaintenance);
|
|
|
+ }
|
|
|
+ }
|
|
|
aftermarket.setMaintenanceProList(maintenanceProList);
|
|
|
|
|
|
-// aftermarket.setMaintenanceCycleList(chuanyunBuildProject.getMaintenanceCycleList());
|
|
|
+ //维保周期(子表)
|
|
|
+ List<AftermarketCycle> marketCycleList = new ArrayList<>();
|
|
|
+ if (chuanyunBuildProject.getMaintenanceCycleList().size() > 0) {
|
|
|
+ for (int k = 0; k < chuanyunBuildProject.getMaintenanceCycleList().size(); k++) {
|
|
|
+ ChuanyunMaintenanceCycleDO cycleDO = chuanyunBuildProject.getMaintenanceCycleList().get(k);
|
|
|
+ AftermarketCycle aftermarketCycle = new AftermarketCycle();
|
|
|
+ aftermarketCycle.setProProperty(cycleDO.getProProperty());
|
|
|
+ aftermarketCycle.setFreeMaintenanceMonth(cycleDO.getFreeMaintenanceMonth());
|
|
|
+ aftermarketCycle.setFreeMaintenanceStartDate(cycleDO.getFreeMaintenanceStartDate());
|
|
|
+ aftermarketCycle.setFreeMaintenanceEndDate(cycleDO.getFreeMaintenanceEndDate());
|
|
|
+ marketCycleList.add(aftermarketCycle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ aftermarket.setMaintenanceCycleList(marketCycleList);
|
|
|
} else { //AS(售后)
|
|
|
aftermarket.setAfterSaleManager(chuanyunBuildProject.getProjectManager().getObjectId());
|
|
|
aftermarket.setAfterSaleDirector(chuanyunBuildProject.getProjectDirector().getObjectId());
|
|
@@ -121,7 +140,8 @@ public class ProjectTest1 {
|
|
|
}
|
|
|
|
|
|
@Data
|
|
|
- static class Aftermarket { //售后项目资料的实体类
|
|
|
+ //售后项目资料的实体类
|
|
|
+ static class Aftermarket {
|
|
|
@JsonProperty("F0000001")
|
|
|
private String projectName; //项目名称
|
|
|
|
|
@@ -155,12 +175,11 @@ public class ProjectTest1 {
|
|
|
@JsonProperty("F0000107")
|
|
|
private String implProManager; //实施项目经理(仅维保项目有)
|
|
|
|
|
|
- @JsonProperty("D001789F28649f6f044a4224b5c68aa821918f50")
|
|
|
- private Object[] maintenanceProList;
|
|
|
- //private List<ChuanyunMaintenanceProDO> maintenanceProList; //维保交付内容(子表)(仅维保项目有)
|
|
|
+ @JsonProperty("D001789Fe8e95bd67f06467fb2e0d792a0555619")
|
|
|
+ private List<AftermarketMaintenance> maintenanceProList; //维保交付内容(子表)(仅维保项目有)
|
|
|
|
|
|
@JsonProperty("D001789Fe75a894fabe3490ab47812cb7d79fd25")
|
|
|
- private List<ChuanyunMaintenanceCycleDO> maintenanceCycleList; //维保周期(子表)(仅维保项目有)
|
|
|
+ private List<AftermarketCycle> maintenanceCycleList; //维保周期(子表)(仅维保项目有)
|
|
|
|
|
|
@JsonProperty("F0000123")
|
|
|
private String deliverManager; //主要交付内容(仅售后项目有)
|
|
@@ -186,5 +205,59 @@ public class ProjectTest1 {
|
|
|
@JsonProperty("F0000128")
|
|
|
private Integer deviceMaintenanceMonth; //设备免费维保期(仅针对售后项目)
|
|
|
}
|
|
|
+
|
|
|
+ @Data
|
|
|
+ //维保交付内容(子表)(仅维保项目有)
|
|
|
+ static class AftermarketMaintenance {
|
|
|
+ //属性
|
|
|
+ @JsonProperty("F0000080")
|
|
|
+ private String proProperty;
|
|
|
+
|
|
|
+ //交付内容
|
|
|
+ @JsonProperty("F0000044")
|
|
|
+ private String proContent;
|
|
|
+
|
|
|
+ //系统版本
|
|
|
+ @JsonProperty("F0000134")
|
|
|
+ private String proVersion;
|
|
|
+
|
|
|
+ //维保承接负责人
|
|
|
+ @JsonProperty("F0000081")
|
|
|
+ private String maintenanceChargeMan;
|
|
|
+
|
|
|
+ //备注
|
|
|
+ @JsonProperty("F0000046")
|
|
|
+ private String remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Data
|
|
|
+ //维保周期(子表)(仅维保项目有)
|
|
|
+ static class AftermarketCycle {
|
|
|
+ //属性
|
|
|
+ @JsonProperty("F0000100")
|
|
|
+ private String proProperty;
|
|
|
+
|
|
|
+ //免费维保月
|
|
|
+ @JsonProperty("F0000101")
|
|
|
+ private String freeMaintenanceMonth;
|
|
|
+
|
|
|
+ //免费维保开始日期
|
|
|
+ @JsonProperty("F0000102")
|
|
|
+ @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
+ @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
+ @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
|
|
|
+ private LocalDateTime freeMaintenanceStartDate;
|
|
|
+
|
|
|
+ //免费维保结束日期
|
|
|
+ @JsonProperty("F0000103")
|
|
|
+ @JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
+ @JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
+ @DateTimeFormat(pattern = "yyyy/MM/dd HH:mm:ss")
|
|
|
+ private LocalDateTime freeMaintenanceEndDate;
|
|
|
+
|
|
|
+ //备注
|
|
|
+ // @JsonProperty("F0000093")
|
|
|
+ // private String remark;
|
|
|
+ }
|
|
|
}
|
|
|
|