提交 a3f3a874 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 daa0e6ee
......@@ -85,6 +85,14 @@ public class PS implements Serializable {
@JsonIgnore
private boolean ngridDirtyFlag;
/**
* 重要事项状态
*/
private String imstate;
@JsonIgnore
private boolean imstateDirtyFlag;
/**
* 获取 [更新时间]
......@@ -286,6 +294,31 @@ public class PS implements Serializable {
return this.ngridDirtyFlag ;
}
/**
* 获取 [重要事项状态]
*/
@JsonProperty("imstate")
public String getImstate(){
return this.imstate ;
}
/**
* 设置 [重要事项状态]
*/
@JsonProperty("imstate")
public void setImstate(String imstate){
this.imstate = imstate ;
this.imstateDirtyFlag = true ;
}
/**
* 获取 [重要事项状态]脏标记
*/
@JsonIgnore
public boolean getImstateDirtyFlag(){
return this.imstateDirtyFlag ;
}
}
......@@ -94,6 +94,15 @@ public class PS implements Serializable {
@JSONField(serialize=false)
private boolean ngridDirtyFlag;
/**
* 重要事项状态
*/
private String imstate;
@JsonIgnore
@JSONField(serialize=false)
private boolean imstateDirtyFlag;
/**
* 获取 [更新时间]
......@@ -311,6 +320,33 @@ public class PS implements Serializable {
public boolean getNgridDirtyFlag(){
return this.ngridDirtyFlag ;
}
/**
* 获取 [重要事项状态]
*/
@JsonProperty("imstate")
@JSONField(name="imstate")
public String getImstate(){
return this.imstate ;
}
/**
* 设置 [重要事项状态]
*/
@JsonProperty("imstate")
@JSONField(name="imstate")
public void setImstate(String imstate){
this.imstate = imstate ;
this.imstateDirtyFlag = true ;
}
/**
* 获取 [重要事项状态]脏标记
*/
@JsonIgnore
@JSONField(serialize=false)
public boolean getImstateDirtyFlag(){
return this.imstateDirtyFlag ;
}
}
package com.ibiz.core.module.valuerule.anno.ps;
import com.ibiz.core.module.valuerule.validator.ps.PSImstateDefaultValidator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
/**
* 值规则注解
* 实体:PS
* 属性:Imstate
* 值规则:Default
*/
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {PSImstateDefaultValidator.class})
public @interface PSImstateDefault {
//是否默认检查
boolean flag() default true;
//值规则名称
String info() default "默认规则";
//值规则信息,如果为空,使用值规则名称。
String message() default "内容长度必须小于等于[100]";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
package com.ibiz.core.module.valuerule.validator.ps;
import lombok.extern.slf4j.Slf4j;
import com.ibiz.util.valuerule.DefaultValueRule;
import com.ibiz.util.valuerule.VRCondition;
import com.ibiz.util.valuerule.condition.*;
import com.ibiz.core.module.valuerule.anno.ps.PSImstateDefault;
import org.springframework.stereotype.Component;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
/**
* 值规则注解解析类
* 实体:PS
* 属性:Imstate
* 值规则:Default
* 值规则信息:内容长度必须小于等于[100]
*/
@Slf4j
@Component("PSImstateDefaultValidator")
public class PSImstateDefaultValidator implements ConstraintValidator<PSImstateDefault, String>,Validator {
private static final String MESSAGE = "值规则校验失败:【内容长度必须小于等于[100]】";
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
boolean isValid = doValidate(value);
if(!isValid) {
context.disableDefaultConstraintViolation();
context.buildConstraintViolationWithTemplate(MESSAGE)
.addConstraintViolation();
}
return doValidate(value);
}
@Override
public boolean supports(Class<?> aClass) {
return true;
}
@Override
public void validate(Object o, Errors errors) {
if( o!=null && supports(o.getClass())){
if (!doValidate((String) o)){
errors.reject(MESSAGE);
}
}
}
public boolean doValidate(String value) {
DefaultValueRule<String> valueRule = new DefaultValueRule<>("默认值规则",MESSAGE,"Imstate",value)
//字符串长度,重复检查模式,重复值范围,基础值规则,是否递归检查。
.init(100,"NONE",null,null,false);
return valueRule.isValid();
}
}
......@@ -107,4 +107,16 @@ public interface PS{
*/
boolean getNgridDirtyFlag();
/**
* 重要事项状态
*/
String getImstate();
void setImstate(String imstate);
/**
* 获取 [重要事项状态]脏标记
*/
boolean getImstateDirtyFlag();
}
......@@ -130,6 +130,8 @@ public class T_PSRepositoryImpl extends ServiceImpl<T_PSMapper, T_PSImpl> implem
domain.setPSId(po.getPSId());
//if(po.getNgridDirtyFlag())
domain.setNgrid(po.getNgrid());
//if(po.getImstateDirtyFlag())
domain.setImstate(po.getImstate());
return domain ;
}
......@@ -161,6 +163,8 @@ public class T_PSRepositoryImpl extends ServiceImpl<T_PSMapper, T_PSImpl> implem
po.setPSId(domain.getPSId());
if(domain.getNgridDirtyFlag())
po.setNgrid(domain.getNgrid());
if(domain.getImstateDirtyFlag())
po.setImstate(domain.getImstate());
return po ;
}
......
......@@ -114,6 +114,17 @@ public class T_PSImpl implements PS,Serializable {
@TableField(exist = false)
private boolean ngridDirtyFlag;
/**
* [重要事项状态]
*/
private String imstate;
/**
* [重要事项状态]脏标记
*/
@JsonIgnore
@TableField(exist = false)
private boolean imstateDirtyFlag;
/**
* 获取 [更新时间]
*/
......@@ -290,4 +301,26 @@ public class T_PSImpl implements PS,Serializable {
public boolean getNgridDirtyFlag(){
return this.ngridDirtyFlag ;
}
/**
* 获取 [重要事项状态]
*/
public String getImstate(){
return this.imstate ;
}
/**
* 设置 [重要事项状态]
*/
public void setImstate(String imstate){
this.imstate = imstate ;
this.imstateDirtyFlag = true ;
}
/**
* 获取 [重要事项状态]脏标记
*/
@JsonIgnore
public boolean getImstateDirtyFlag(){
return this.imstateDirtyFlag ;
}
}
\ No newline at end of file
......@@ -16,6 +16,7 @@
<if test="true == et.createManDirtyFlag"> createman = #{et.createMan}, </if>
<if test="true == et.pSIdDirtyFlag"> psid = #{et.pSId}, </if>
<if test="true == et.ngridDirtyFlag"> ngrid = #{et.ngrid}, </if>
<if test="true == et.imstateDirtyFlag"> imstate = #{et.imstate}, </if>
</trim>
where t.psid = #{et.pSId}
</update>
......@@ -33,7 +34,7 @@
<!--输出平台内配置的数据查询[DEFAULT]-->
<select id="searchDefault" parameterType="com.ibiz.core.module.filter.PSSearchContext" resultMap="T_PSResultMap" databaseId="mysql">
select t1.* from (
<![CDATA[ SELECT t1.`BZ`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`NGRID`, t1.`PSID`, t1.`PSNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_PS` t1 ]]>
<![CDATA[ SELECT t1.`BZ`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`IMSTATE`, t1.`NGRID`, t1.`PSID`, t1.`PSNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `T_PS` t1 ]]>
<![CDATA[ ]]>
)t1
<where><if test="ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere">${ew.sqlSegment}</if></where>
......
......@@ -106,6 +106,16 @@ public class PSDTO implements Serializable {
@JsonIgnore
private boolean ngridDirtyFlag;
/**
* 属性 [IMSTATE]
*
*/
@PSImstateDefault(info = "默认规则")
private String imstate;
@JsonIgnore
private boolean imstateDirtyFlag;
/**
* 获取 [UPDATEDATE]
......@@ -307,6 +317,31 @@ public class PSDTO implements Serializable {
return ngridDirtyFlag ;
}
/**
* 获取 [IMSTATE]
*/
@JsonProperty("imstate")
public String getImstate(){
return imstate ;
}
/**
* 设置 [IMSTATE]
*/
@JsonProperty("imstate")
public void setImstate(String imstate){
this.imstate = imstate ;
this.imstateDirtyFlag = true ;
}
/**
* 获取 [IMSTATE]脏标记
*/
@JsonIgnore
public boolean getImstateDirtyFlag(){
return imstateDirtyFlag ;
}
public PS toDO() {
......@@ -327,6 +362,8 @@ public class PSDTO implements Serializable {
srfdomain.setPSId(pSId);
if(getNgridDirtyFlag())
srfdomain.setNgrid(ngrid);
if(getImstateDirtyFlag())
srfdomain.setImstate(imstate);
return srfdomain;
}
......@@ -350,6 +387,8 @@ public class PSDTO implements Serializable {
this.setPSId(srfdomain.getPSId());
if(srfdomain.getNgridDirtyFlag())
this.setNgrid(srfdomain.getNgrid());
if(srfdomain.getImstateDirtyFlag())
this.setImstate(srfdomain.getImstate());
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册