|  |  | 
 |  |  | package com.moral.api.pojo.form.organization; | 
 |  |  |  | 
 |  |  | import com.fasterxml.jackson.annotation.JsonFormat; | 
 |  |  | import com.moral.api.entity.Organization; | 
 |  |  | import com.moral.api.pojo.dto.organization.OrganizationDTO; | 
 |  |  | import com.moral.constant.ResponseCodeEnum; | 
 |  |  | import com.moral.util.DateUtils; | 
 |  |  | import com.moral.util.RegexUtils; | 
 |  |  | import lombok.Data; | 
 |  |  | import org.springframework.format.annotation.DateTimeFormat; | 
 |  |  | import org.springframework.util.ObjectUtils; | 
 |  |  |  | 
 |  |  | import java.util.Date; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @ClassName OrganizationQueryForm | 
 |  |  | 
 |  |  |  * @Version TODO | 
 |  |  |  **/ | 
 |  |  | @Data | 
 |  |  | public class OrganizationQueryForm { | 
 |  |  | public class OrganizationQueryForm  { | 
 |  |  |  | 
 |  |  |     private Integer page; | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     private Integer areaCode; | 
 |  |  |  | 
 |  |  |     private Long townCode; | 
 |  |  |  | 
 |  |  |     private Long villageCode; | 
 |  |  |  | 
 |  |  |     private String phone; | 
 |  |  |  | 
 |  |  |     private String email; | 
 |  |  | 
 |  |  |     private String wechat; | 
 |  |  |  | 
 |  |  |     private String isDelete; | 
 |  |  |  | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | 
 |  |  |     private Date createStartTime; | 
 |  |  |  | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | 
 |  |  |     private Date createEndTime; | 
 |  |  |  | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | 
 |  |  |     private Date expireStartTime; | 
 |  |  |  | 
 |  |  |     @DateTimeFormat(pattern = "yyyy-MM-dd") | 
 |  |  |     @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") | 
 |  |  |     private Date expireEndTime; | 
 |  |  |  | 
 |  |  |     private String order; | 
 |  |  |  | 
 |  |  | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public OrganizationDTO paramValid() { | 
 |  |  |         OrganizationDTO dto = new OrganizationDTO(); | 
 |  |  |         //判断电话号是否符合条件 | 
 |  |  |         if (!ObjectUtils.isEmpty(phone)) { | 
 |  |  |             if (!RegexUtils.checkMobile(phone) && !RegexUtils.checkPhone(phone)) { | 
 |  |  |                 dto.setCode(ResponseCodeEnum.PHONE_INVALID.getCode()); | 
 |  |  |                 dto.setMsg(ResponseCodeEnum.PHONE_INVALID.getMsg()); | 
 |  |  |                 return dto; | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         //判断邮箱是否符合条件 | 
 |  |  |         if (!ObjectUtils.isEmpty(email)) { | 
 |  |  |             if (!RegexUtils.checkEmail(email)) { | 
 |  |  |                 dto.setCode(ResponseCodeEnum.EMAIL_INVALID.getCode()); | 
 |  |  |                 dto.setMsg(ResponseCodeEnum.EMAIL_INVALID.getMsg()); | 
 |  |  |                 return dto; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); | 
 |  |  |         dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); | 
 |  |  |         return dto; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Organization formConvertEntity() { | 
 |  |  |         Organization organization = new Organization(); | 
 |  |  |         organization.setParentId(parentId); | 
 |  |  |         organization.setName(name); | 
 |  |  |         organization.setProvinceCode(provinceCode); | 
 |  |  |         organization.setCityCode(cityCode); | 
 |  |  |         organization.setAreaCode(areaCode); | 
 |  |  |         organization.setTownCode(townCode); | 
 |  |  |         organization.setVillageCode(villageCode); | 
 |  |  |         organization.setPhone(phone); | 
 |  |  |         organization.setEmail(email); | 
 |  |  |         organization.setWechat(wechat); | 
 |  |  |         organization.setIsDelete(isDelete); | 
 |  |  |         return organization; | 
 |  |  |     } | 
 |  |  | } |