Merge branch 'dev' into test
commit
8e19f4dde3
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.bean;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.common.BeanRelation;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.enums.RULE_TYPE;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.holders.ERuleDetail;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :规则组合下的规则明细
|
||||||
|
* @Reference :
|
||||||
|
* @Author : jason.niu
|
||||||
|
* @CreateDate : 2019-11-05
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "APS_RULE_DETAIL")
|
||||||
|
@Api("规则明细")
|
||||||
|
public class RuleDetail extends BaseAPS {
|
||||||
|
|
||||||
|
@Column(name="TYPE")
|
||||||
|
@ApiParam(value ="规则类型")
|
||||||
|
private RULE_TYPE type;
|
||||||
|
|
||||||
|
@Column(name="RULE_GROUP_ID")
|
||||||
|
@ApiParam(value ="规则组合ID")
|
||||||
|
@FieldAnnotation(property = false)
|
||||||
|
private Long ruleGroupId;
|
||||||
|
|
||||||
|
@Column(name="RULE_ID")
|
||||||
|
@ApiParam(value ="规则配置ID")
|
||||||
|
@FieldAnnotation(property = false)
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
public RuleGroup getRuleGroup() { return BeanRelation.get(this, ERuleDetail.RuleGroup); }
|
||||||
|
|
||||||
|
public void setRuleGroup(RuleGroup ruleGroup) {
|
||||||
|
this.ruleGroupId = ruleGroup != null ? ruleGroup.getId() : 0;
|
||||||
|
BeanRelation.set(this, ERuleDetail.RuleGroup, ruleGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseRule getRule() { return BeanRelation.get(this, ERuleDetail.Rule); }
|
||||||
|
|
||||||
|
public void setRule(BaseRule rule) {
|
||||||
|
this.ruleId = rule != null ? rule.getId() : 0;
|
||||||
|
BeanRelation.set(this, ERuleDetail.Rule, rule);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.converter;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class CustomDateDeserializer extends JsonDeserializer<Date> {
|
||||||
|
public static SimpleDateFormat DATETIME_FORMATOR = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
|
||||||
|
try {
|
||||||
|
return DATETIME_FORMATOR.parse(jsonParser.getText());
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.converter;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class CustomDateSerializer extends JsonSerializer<Date> {
|
||||||
|
public static SimpleDateFormat DATETIME_FORMATOR = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
||||||
|
jsonGenerator.writeString(DATETIME_FORMATOR.format(date));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
public enum CALENDAR_WEEK {
|
||||||
|
MONDAY(1), // 星期一
|
||||||
|
TUESDAY(2), // 星期二
|
||||||
|
WEDNESDAY(4), // 星期三
|
||||||
|
THURSDAY(8), // 星期四
|
||||||
|
FRIDAY(16), // 星期五
|
||||||
|
SATURDAY(32), // 星期六
|
||||||
|
SUNDAY(64); // 星期天
|
||||||
|
|
||||||
|
private int _value;
|
||||||
|
|
||||||
|
CALENDAR_WEEK(int value) {
|
||||||
|
_value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int value() {
|
||||||
|
return this._value;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.enums;
|
||||||
|
|
||||||
|
public enum RULE_TYPE {
|
||||||
|
CANCEL_PLAN,
|
||||||
|
MAT_CALC,
|
||||||
|
HEURISTIC,
|
||||||
|
FIELD_SET
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum EBaseRule {
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum ERuleDetail {
|
||||||
|
RuleGroup,
|
||||||
|
Rule
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.holders;
|
||||||
|
|
||||||
|
public enum ERuleGroup {
|
||||||
|
Details
|
||||||
|
}
|
@ -1,25 +1,23 @@
|
|||||||
package cn.estsh.i3plus.pojo.aps.model;
|
package cn.estsh.i3plus.pojo.aps.model;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import cn.estsh.i3plus.pojo.aps.converter.CustomDateDeserializer;
|
||||||
|
import cn.estsh.i3plus.pojo.aps.converter.CustomDateSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class GanttCalendarModel {
|
public class GanttCalendarModel {
|
||||||
@Data
|
private Long parent;
|
||||||
public static class Block {
|
@JsonSerialize(using = CustomDateSerializer.class)
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonDeserialize(using = CustomDateDeserializer.class)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private Date start_date;
|
||||||
private Date beginTime;
|
@JsonSerialize(using = CustomDateSerializer.class)
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonDeserialize(using = CustomDateDeserializer.class)
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
private Date end_date;
|
||||||
private Date endTime;
|
private String color;
|
||||||
private Boolean onDuty;
|
private Long id;
|
||||||
}
|
private String text;
|
||||||
private Long resourceId;
|
|
||||||
private List<Block> timeBlocks = new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.aps.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.aps.bean.RuleDetail;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface RuleDetailRepository extends CrudRepository<RuleDetail, Long> {
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Class name="RuleDetail">
|
||||||
|
<Relation field="Rule" name="BaseRule" type="MULTI_TO_ONE" owner="false">
|
||||||
|
</Relation>
|
||||||
|
</Class>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Class name="RuleGroup">
|
||||||
|
<Relation field="Details" name="RuleDetail" reverse="RuleGroup" type="ONE_TO_MULTI" owner="true">
|
||||||
|
</Relation>
|
||||||
|
</Class>
|
Loading…
Reference in New Issue