From c7dd4a195d8d893d92c49963447cdf6486844584 Mon Sep 17 00:00:00 2001
From: cjl <276999030@qq.com>
Date: Fri, 20 Oct 2023 09:45:53 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wb' into cjl
---
screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java | 51 +++++++++++++++++++++++++--------------------------
1 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java b/screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java
index 99385ad..36908c1 100644
--- a/screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java
+++ b/screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java
@@ -1,11 +1,13 @@
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;
@@ -28,15 +30,19 @@
private Integer provinceCode;
+ private String provinceName;
+
private Integer cityCode;
+
+ private String cityName;
private Integer areaCode;
- private Long townCode;
+ private String areaName;
- private Long villageCode;
+ private Integer locationLevelCode;
- private String locationLevel;
+ private String locationLevelName;
private String address;
@@ -46,7 +52,9 @@
private String wechat;
- private String expireTime;
+ @DateTimeFormat(pattern = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+ private Date expireTime;
public boolean valid() {
if (ObjectUtils.isEmpty(organizationId))
@@ -57,13 +65,11 @@
ObjectUtils.isEmpty(provinceCode) &&
ObjectUtils.isEmpty(cityCode) &&
ObjectUtils.isEmpty(areaCode) &&
- ObjectUtils.isEmpty(townCode) &&
- ObjectUtils.isEmpty(villageCode) &&
- ObjectUtils.isEmpty(locationLevel) &&
+ ObjectUtils.isEmpty(locationLevelCode) &&
ObjectUtils.isEmpty(address) &&
- ObjectUtils.isEmpty(phone) &&
- ObjectUtils.isEmpty(email) &&
- ObjectUtils.isEmpty(wechat) &&
+ phone==null &&
+ email==null &&
+ wechat==null &&
ObjectUtils.isEmpty(expireTime)
)
return false;
@@ -76,19 +82,19 @@
organization.setParentId(parentId);
organization.setName(name);
organization.setProvinceCode(provinceCode);
+ organization.setProvinceName(provinceName);
organization.setCityCode(cityCode);
+ organization.setCityName(cityName);
organization.setAreaCode(areaCode);
- organization.setTownCode(townCode);
- organization.setVillageCode(villageCode);
- organization.setLocationLevel(locationLevel);
+ organization.setAreaName(areaName);
+ organization.setLocationLevelCode(locationLevelCode);
+ organization.setLocationLevelName(locationLevelName);
organization.setAddress(address);
organization.setPhone(phone);
organization.setEmail(email);
organization.setWechat(wechat);
- if (!ObjectUtils.isEmpty(expireTime)) {
- Date expireTimeDate = DateUtils.getDate(expireTime + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
- organization.setExpireTime(expireTimeDate);
- }
+ organization.setExpireTime(expireTime);
+
return organization;
}
@@ -111,17 +117,10 @@
return dto;
}
}
- //������������������������
+ //������������������������������������������
if (!ObjectUtils.isEmpty(expireTime)) {
- if (!RegexUtils.checkDate(expireTime)) {
- dto.setCode(ResponseCodeEnum.TIME_FORMAT_INVALID.getCode());
- dto.setMsg(ResponseCodeEnum.TIME_FORMAT_INVALID.getMsg());
- return dto;
- }
- //������������������������������������������
- Date expireDate = DateUtils.getDate(expireTime, "yyyy-MM-dd");
Date currentDate = new Date();
- if (DateUtils.compareDateStr(expireDate, currentDate) >= 0) {
+ if (DateUtils.compareDateStr(expireTime, currentDate) >= 0) {
dto.setCode(ResponseCodeEnum.TIME_INVALID.getCode());
dto.setMsg(ResponseCodeEnum.TIME_INVALID.getMsg());
return dto;
--
Gitblit v1.8.0