|
@@ -1,6 +1,8 @@
|
|
|
package com.galaxis.manatee.entity.chuanyun.data.object;
|
|
|
|
|
|
+import com.dingtalk.api.response.OapiProcessinstanceGetResponse;
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
+import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
|
import com.galaxis.manatee.util.ChuanyunLocalDateTimeDeserializer;
|
|
@@ -12,6 +14,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import javax.persistence.Entity;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
|
@EqualsAndHashCode(callSuper = true)
|
|
@@ -20,24 +24,30 @@ import java.time.LocalDateTime;
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
|
public class ChuanyunBusinessEntertainmentDO extends BasicDO{
|
|
|
|
|
|
+ public static final String SCHEMA_CODE ="D001789c6ce232ed7ce475bba798026820c8991";
|
|
|
+
|
|
|
/**
|
|
|
* 劳动合同所属公司
|
|
|
*/
|
|
|
+ @JsonProperty("F0000001")
|
|
|
private String company;
|
|
|
|
|
|
/**
|
|
|
* 申请人
|
|
|
*/
|
|
|
+ @JsonProperty("F0000002")
|
|
|
private String applicant;
|
|
|
|
|
|
/**
|
|
|
* 部门
|
|
|
*/
|
|
|
+ @JsonProperty("F0000003")
|
|
|
private String department;
|
|
|
|
|
|
/**
|
|
|
* 日期
|
|
|
*/
|
|
|
+ @JsonProperty("F0000004")
|
|
|
@JsonSerialize(using = ChuanyunLocalDateTimeSerializer.class)
|
|
|
@JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
private LocalDateTime datetime;
|
|
@@ -45,25 +55,52 @@ public class ChuanyunBusinessEntertainmentDO extends BasicDO{
|
|
|
/**
|
|
|
* 招待事由
|
|
|
*/
|
|
|
+ @JsonProperty("F0000005")
|
|
|
private String reason;
|
|
|
|
|
|
/**
|
|
|
* 招待总金额(元)
|
|
|
*/
|
|
|
+ @JsonProperty("F0000006")
|
|
|
private BigDecimal totalamount;
|
|
|
|
|
|
/**
|
|
|
* 招待人数(含接待人员)
|
|
|
*/
|
|
|
+ @JsonProperty("F0000007")
|
|
|
private String personcount;
|
|
|
|
|
|
/**
|
|
|
* 人均餐费
|
|
|
*/
|
|
|
+ @JsonProperty("F0000008")
|
|
|
private BigDecimal averageamount;
|
|
|
|
|
|
/**
|
|
|
* 备注
|
|
|
*/
|
|
|
+ @JsonProperty("F0000009")
|
|
|
private String remark;
|
|
|
+
|
|
|
+ @JsonProperty("F0000010")
|
|
|
+ private String businessId;
|
|
|
+
|
|
|
+ public static ChuanyunBusinessEntertainmentDO formBusinessEntertainmentDTO(List<OapiProcessinstanceGetResponse.FormComponentValueVo> list) {
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+ ChuanyunBusinessEntertainmentDO chuanyunBusinessEntertainmentDO = new ChuanyunBusinessEntertainmentDO();
|
|
|
+ for (OapiProcessinstanceGetResponse.FormComponentValueVo formComponentValueVo : list){
|
|
|
+ switch (formComponentValueVo.getName()){
|
|
|
+ case "劳动合同所属公司" ->chuanyunBusinessEntertainmentDO.setCompany(formComponentValueVo.getValue());
|
|
|
+ case "申请人"->chuanyunBusinessEntertainmentDO.setApplicant(formComponentValueVo.getValue());
|
|
|
+ case "部门"->chuanyunBusinessEntertainmentDO.setDepartment(formComponentValueVo.getValue());
|
|
|
+ case "日期"->chuanyunBusinessEntertainmentDO.setDatetime(LocalDateTime.parse(formComponentValueVo.getValue()+":00", df));
|
|
|
+ case "招待事由"->chuanyunBusinessEntertainmentDO.setReason(formComponentValueVo.getValue());
|
|
|
+ case "招待总金额(元)"->chuanyunBusinessEntertainmentDO.setTotalamount(new BigDecimal(formComponentValueVo.getValue()));
|
|
|
+ case "招待人数(含接待人员)"->chuanyunBusinessEntertainmentDO.setPersoncount(formComponentValueVo.getValue());
|
|
|
+ case "人均餐费"->chuanyunBusinessEntertainmentDO.setAverageamount(new BigDecimal(formComponentValueVo.getValue()));
|
|
|
+ case "备注"->chuanyunBusinessEntertainmentDO.setRemark(formComponentValueVo.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return chuanyunBusinessEntertainmentDO;
|
|
|
+ }
|
|
|
}
|