@@ -1,5 +1,9 @@ | |||
package cn.com.taiji.core.entity.dict; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
//import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import org.springframework.util.StringUtils; | |||
/** | |||
* 停用启用 | |||
*/ | |||
@@ -9,11 +13,11 @@ public enum EnableStatus { | |||
DISABLE("停用", 0), | |||
; | |||
private String value; | |||
private String name; | |||
private Integer code; | |||
EnableStatus(String value, Integer code) { | |||
this.value = value; | |||
this.name = value; | |||
this.code = code; | |||
} | |||
@@ -26,11 +30,35 @@ public enum EnableStatus { | |||
} | |||
public String getValue() { | |||
return value; | |||
return name; | |||
} | |||
public void setValue(String name) { | |||
this.name = name; | |||
} | |||
public static EnableStatus findByCode(Integer code) throws ServiceHandleException { | |||
if (null == code) { | |||
return null; | |||
} | |||
for (EnableStatus value : EnableStatus.values()) { | |||
if (code.equals(value.getCode())) { | |||
return value; | |||
} | |||
} | |||
return null; | |||
} | |||
public void setValue(String value) { | |||
this.value = value; | |||
public static EnableStatus findByName(String name) throws ServiceHandleException { | |||
if (!StringUtils.hasText(name)) { | |||
return null; | |||
} | |||
for (EnableStatus value : EnableStatus.values()) { | |||
if (name.equals(value.name())) { | |||
return value; | |||
} | |||
} | |||
return null; | |||
} | |||
} |
@@ -1,65 +1,65 @@ | |||
package cn.com.taiji.core.entity.dict.user; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import org.springframework.util.StringUtils; | |||
/** | |||
* 启用/停用 | |||
**/ | |||
public enum IsEnable { | |||
ENABLE("启用", 1) {}, | |||
DISABLE("禁用", 2) {}, | |||
; | |||
private String name; | |||
private Integer code; | |||
private IsEnable(String name, Integer code) { | |||
this.name = name; | |||
this.code = code; | |||
} | |||
public String getName() { | |||
return name; | |||
} | |||
public void setName(String name) { | |||
this.name = name; | |||
} | |||
public Integer getCode() { | |||
return code; | |||
} | |||
public void setCode(Integer code) { | |||
this.code = code; | |||
} | |||
public static IsEnable findByCode(Integer code) throws ServiceHandleException { | |||
if (null == code) { | |||
return null; | |||
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
} | |||
for (IsEnable value : IsEnable.values()) { | |||
if (code.equals(value.getCode())) { | |||
return value; | |||
} | |||
} | |||
return null; | |||
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
} | |||
public static IsEnable findByName(String name) throws ServiceHandleException { | |||
if (!StringUtils.hasText(name)) { | |||
return null; | |||
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
} | |||
for (IsEnable value : IsEnable.values()) { | |||
if (name.equals(value.name())) { | |||
return value; | |||
} | |||
} | |||
return null; | |||
// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
} | |||
} | |||
//package cn.com.taiji.core.entity.dict.user; | |||
// | |||
//import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
//import org.springframework.util.StringUtils; | |||
// | |||
///** | |||
// * 启用/停用 | |||
// **/ | |||
//public enum IsEnable { | |||
// ENABLE("启用", 1) {}, | |||
// DISABLE("禁用", 2) {}, | |||
// ; | |||
// private String name; | |||
// private Integer code; | |||
// | |||
// private IsEnable(String name, Integer code) { | |||
// this.name = name; | |||
// this.code = code; | |||
// } | |||
// | |||
// public String getName() { | |||
// return name; | |||
// } | |||
// | |||
// public void setName(String name) { | |||
// this.name = name; | |||
// } | |||
// | |||
// public Integer getCode() { | |||
// return code; | |||
// } | |||
// | |||
// public void setCode(Integer code) { | |||
// this.code = code; | |||
// } | |||
// | |||
// | |||
// public static IsEnable findByCode(Integer code) throws ServiceHandleException { | |||
// if (null == code) { | |||
// return null; | |||
//// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
// } | |||
// for (IsEnable value : IsEnable.values()) { | |||
// if (code.equals(value.getCode())) { | |||
// return value; | |||
// } | |||
// } | |||
// return null; | |||
//// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
// } | |||
// | |||
// public static IsEnable findByName(String name) throws ServiceHandleException { | |||
// if (!StringUtils.hasText(name)) { | |||
// return null; | |||
//// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
// } | |||
// for (IsEnable value : IsEnable.values()) { | |||
// if (name.equals(value.name())) { | |||
// return value; | |||
// } | |||
// } | |||
// return null; | |||
//// throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("【启用/停用】类型不存在"); | |||
// } | |||
//} |
@@ -1,9 +1,9 @@ | |||
package cn.com.taiji.core.entity.managew; | |||
import cn.com.taiji.core.entity.AbstractStringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.operation.FlashType; | |||
import cn.com.taiji.core.entity.dict.operation.TriggerType; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -23,11 +23,13 @@ public class NoticeFlash extends AbstractStringPropertyUUIDEntity { | |||
@Column(name = "HYPER_LINK") | |||
private String hyperLink;//超链接 | |||
@Column(name = "TRIGGER_TYPE") | |||
@Enumerated(EnumType.STRING) | |||
private TriggerType triggerType;//触发类型 | |||
@Column(name = "SEQUENCE") | |||
private Integer sequence;//排序 | |||
@Column(name = "STATUS") | |||
private IsEnable status;//状态 | |||
@Enumerated(EnumType.STRING) | |||
private EnableStatus status;//状态 | |||
@Column(name = "ROUTE_URL") | |||
private String routeUrl;//路由地址 | |||
@Column(name = "TEXT") |
@@ -9,8 +9,8 @@ import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -45,7 +45,7 @@ public class MsgwAlarmConfig extends StringPropertyUUIDEntity { | |||
@Size(max = 100) | |||
@Column(name = "STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private IsEnable status;//配置状态 | |||
private EnableStatus status;//配置状态 | |||
@NotBlank | |||
@Size(max = 100) | |||
@Column(name = "OPERATION_OPENID") |
@@ -8,8 +8,8 @@ import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -42,6 +42,6 @@ public class MsgwClient extends StringPropertyUUIDEntity { | |||
@NotBlank | |||
@Column(name = "STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private IsEnable status;//客户端状态 | |||
private EnableStatus status;//客户端状态 | |||
} |
@@ -1,17 +1,12 @@ | |||
package cn.com.taiji.core.entity.msgw; | |||
import java.math.BigDecimal; | |||
import java.time.LocalDate; | |||
import java.time.LocalDateTime; | |||
import javax.persistence.*; | |||
import javax.validation.constraints.Digits; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import javax.validation.constraints.Size; | |||
import cn.com.taiji.common.entity.StringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -50,10 +45,9 @@ public class MsgwSmsKeyConfig extends StringPropertyUUIDEntity { | |||
@Size(max = 100) | |||
@Column(name = "SMS_TYPE_CODE") | |||
private String smsTypeCode;//短信类型 | |||
@NotBlank | |||
@Column(name = "STATUS") | |||
@Enumerated(EnumType.STRING) | |||
private IsEnable status;//配置状态 | |||
private EnableStatus status;//配置状态 | |||
@@ -2,7 +2,7 @@ package cn.com.taiji.core.entity.user; | |||
import cn.com.taiji.core.entity.AbstractStringPropertyUUIDEntity; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.user.RbacSource; | |||
import cn.com.taiji.core.entity.dict.user.RbacStatus; | |||
import cn.com.taiji.core.entity.dict.user.SystemType; | |||
@@ -91,7 +91,7 @@ public class UserMenu extends AbstractStringPropertyUUIDEntity { | |||
*/ | |||
@Enumerated(EnumType.STRING) | |||
@Column(name = "IS_RECOMMEND") | |||
private IsEnable isRecommend; | |||
private EnableStatus isRecommend; | |||
@@ -121,6 +121,7 @@ public class VehicleUploadRequest extends AbstractOrderRequest<VehicleUploadResp | |||
validator.validFieldNotBlank("roadTransportPermitPicUrl", roadTransportPermitPicUrl); | |||
} | |||
} | |||
public void ownerValid(ErrorMsgBuilder validator) { | |||
@@ -130,7 +131,7 @@ public class VehicleUploadRequest extends AbstractOrderRequest<VehicleUploadResp | |||
validator.validFieldNotBlank("ownerIdAddress",ownerIdAddress); | |||
validator.validFieldNotBlank("ownerPosImgUrl",ownerPosImgUrl); | |||
// validator.validFieldNotBlank("ownerNegImgUrl",ownerNegImgUrl);// 单位的填不上 | |||
// validator.validFieldNotBlank("ownerTel",ownerTel); | |||
validator.validFieldNotBlank("ownerTel",ownerTel); | |||
validator.validFieldNotBlank("proxyUrl",proxyUrl); | |||
} | |||
@@ -1,8 +1,8 @@ | |||
package cn.com.taiji.core.repo.jpa.msgw; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.msgw.MessageType; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import cn.com.taiji.core.entity.msgw.MsgwAlarmConfig; | |||
import org.springframework.data.jpa.repository.Query; | |||
@@ -11,7 +11,7 @@ import java.util.List; | |||
public interface MsgwAlarmConfigRepo extends AbstractJpaRepo<MsgwAlarmConfig, String>{ | |||
@Query("from MsgwAlarmConfig where messageType=?1 and status=?2") | |||
List<MsgwAlarmConfig> findConfigByCondition(MessageType messageType, IsEnable status); | |||
List<MsgwAlarmConfig> findConfigByCondition(MessageType messageType, EnableStatus status); | |||
} |
@@ -1,7 +1,7 @@ | |||
package cn.com.taiji.core.repo.jpa.user; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.user.RbacSource; | |||
import cn.com.taiji.core.entity.dict.user.RbacStatus; | |||
import cn.com.taiji.core.entity.dict.user.SystemType; | |||
@@ -20,10 +20,10 @@ public interface UserMenuRepo extends AbstractJpaRepo<UserMenu, String> { | |||
UserMenu findNameById(String id); | |||
@Query("from UserMenu where menuSource=?1 and isRecommend=?2 and status=?3") | |||
List<UserMenu> findRecommendMenu(RbacSource source, IsEnable recommend, RbacStatus status); | |||
List<UserMenu> findRecommendMenu(RbacSource source, EnableStatus recommend, RbacStatus status); | |||
@Query("select count(*) from UserMenu where menuSource=?1 and isRecommend=?2 and status=?3") | |||
long countRecommendMenu(RbacSource source, IsEnable recommend, RbacStatus status); | |||
long countRecommendMenu(RbacSource source, EnableStatus recommend, RbacStatus status); | |||
@Query("select new UserMenu(id,name,link) from UserMenu where id=?1") | |||
UserMenu findSimpleMenuById(String id); |
@@ -2,8 +2,8 @@ package cn.com.taiji.core.repo.request.operation; | |||
import cn.com.taiji.common.pub.dao.HqlBuilder; | |||
import cn.com.taiji.common.repo.request.jpa.JpaDateTimePageableDataRequest; | |||
import cn.com.taiji.core.entity.dict.EnableStatus; | |||
import cn.com.taiji.core.entity.dict.operation.FlashType; | |||
import cn.com.taiji.core.entity.dict.user.IsEnable; | |||
import cn.com.taiji.core.entity.managew.NoticeFlash; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
@@ -24,7 +24,7 @@ public class NoticeFlashPageRequest extends JpaDateTimePageableDataRequest<Notic | |||
/** 标题 */ | |||
private String title; | |||
/** 状态 */ | |||
private IsEnable status; | |||
private EnableStatus status; | |||
/** 快讯类型 */ | |||
private FlashType flashType; | |||