From 199971c2c2f20e22fdfb088b11caeaee1e523c2f Mon Sep 17 00:00:00 2001 From: lizijie <lzjiiie@163.com> Date: Tue, 13 Apr 2021 14:26:11 +0800 Subject: [PATCH] 添加角色新增日志 --- screen-manage/src/main/java/com/moral/api/pojo/form/organization/OrganizationUpdateForm.java | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 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 66c5d6e..b90948c 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; @@ -50,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)) @@ -89,10 +93,8 @@ 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; } @@ -115,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