mdf:用户,部门去jpa2

This commit is contained in:
zhangzhiqiang
2022-11-30 10:38:50 +08:00
parent 99d78828a1
commit 839863ade9
36 changed files with 94 additions and 235 deletions

View File

@@ -2,19 +2,10 @@ package org.nl.modules.common.base;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import javax.persistence.Column;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Date;
/**
* @author Zheng Jie

View File

@@ -18,8 +18,6 @@ package org.nl.modules.common.base;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@@ -28,7 +26,7 @@ import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* 通用字段, is_del 根据需求自行添加
@@ -55,15 +53,13 @@ public class BaseEntity implements Serializable {
private Long update_optid;
@CreationTimestamp
@Column(name = "create_time", updatable = false)
@ApiModelProperty(value = "创建时间", hidden = true)
private Timestamp create_time;
private Date create_time;
@UpdateTimestamp
@Column(name = "update_time")
@ApiModelProperty(value = "更新时间", hidden = true)
private Timestamp update_time;
private Date update_time;
/* 分组校验 */
public @interface Create {}

View File

@@ -29,11 +29,11 @@ class ApiError {
private Integer status = 400;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime timestamp;
private LocalDateTime Date;
private String message;
private ApiError() {
timestamp = LocalDateTime.now();
Date = LocalDateTime.now();
}
public static ApiError error(String message){

View File

@@ -36,18 +36,18 @@ public class DateUtil {
* @param localDateTime /
* @return /
*/
public static Long getTimeStamp(LocalDateTime localDateTime) {
public static Long getDate(LocalDateTime localDateTime) {
return localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
}
/**
* 时间戳转LocalDateTime
*
* @param timeStamp /
* @param Date /
* @return /
*/
public static LocalDateTime fromTimeStamp(Long timeStamp) {
return LocalDateTime.ofEpochSecond(timeStamp, 0, OffsetDateTime.now().getOffset());
public static LocalDateTime fromDate(Long Date) {
return LocalDateTime.ofEpochSecond(Date, 0, OffsetDateTime.now().getOffset());
}
/**

View File

@@ -47,7 +47,7 @@ import static org.nl.modules.common.utils.FileUtil.SYS_TEM_DIR;
@SuppressWarnings({"unchecked", "all"})
public class GenUtil {
private static final String TIMESTAMP = "Timestamp";
private static final String Date = "Date";
private static final String BIGDECIMAL = "BigDecimal";
@@ -218,10 +218,10 @@ public class GenUtil {
genMap.put("className", className);
// 保存小写开头的类名
genMap.put("changeClassName", changeClassName);
// 存在 Timestamp 字段
genMap.put("hasTimestamp", false);
// 查询类中存在 Timestamp 字段
genMap.put("queryHasTimestamp", false);
// 存在 Date 字段
genMap.put("hasDate", false);
// 查询类中存在 Date 字段
genMap.put("queryHasDate", false);
// 存在 BigDecimal 字段
genMap.put("hasBigDecimal", false);
// 查询类中存在 BigDecimal 字段
@@ -266,9 +266,9 @@ public class GenUtil {
// 存储大写开头的字段名
genMap.put("pkCapitalColName", capitalColumnName);
}
// 是否存在 Timestamp 类型的字段
if (TIMESTAMP.equals(colType)) {
genMap.put("hasTimestamp", true);
// 是否存在 Date 类型的字段
if (Date.equals(colType)) {
genMap.put("hasDate", true);
}
// 是否存在 BigDecimal 类型的字段
if (BIGDECIMAL.equals(colType)) {
@@ -317,9 +317,9 @@ public class GenUtil {
listMap.put("queryType", column.getQueryType());
// 是否存在查询
genMap.put("hasQuery", true);
if (TIMESTAMP.equals(colType)) {
// 查询中存储 Timestamp 类型
genMap.put("queryHasTimestamp", true);
if (Date.equals(colType)) {
// 查询中存储 Date 类型
genMap.put("queryHasDate", true);
}
if (BIGDECIMAL.equals(colType)) {
// 查询中存储 BigDecimal 类型

View File

@@ -18,11 +18,10 @@ package org.nl.modules.logging.domain;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* @author Zheng Jie
@@ -71,8 +70,7 @@ public class Log implements Serializable {
private byte[] exceptionDetail;
/** 创建日期 */
@CreationTimestamp
private Timestamp createTime;
private Date createTime;
public Log(String logType, Long time) {
this.logType = logType;

View File

@@ -18,7 +18,7 @@ package org.nl.modules.logging.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* @author Zheng Jie
@@ -43,5 +43,5 @@ public class LogErrorDTO implements Serializable {
private String address;
private Timestamp createTime;
}
private Date createTime;
}

View File

@@ -18,7 +18,7 @@ package org.nl.modules.logging.service.dto;
import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
@@ -36,5 +36,5 @@ public class LogQueryCriteria {
private String logType;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
private List<Date> createTime;
}

View File

@@ -18,7 +18,7 @@ package org.nl.modules.logging.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* @author Zheng Jie
@@ -37,5 +37,5 @@ public class LogSmallDTO implements Serializable {
private String browser;
private Timestamp createTime;
private Date createTime;
}

View File

@@ -17,11 +17,10 @@ package org.nl.modules.quartz.domain;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
/**
* @author Zheng Jie
@@ -62,7 +61,7 @@ public class QuartzLog implements Serializable {
@ApiModelProperty(value = "执行耗时", hidden = true)
private Long time;
@CreationTimestamp
@ApiModelProperty(value = "创建时间", hidden = true)
private Timestamp createTime;
private Date createTime;
}

View File

@@ -18,7 +18,7 @@ package org.nl.modules.quartz.service.dto;
import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
@@ -35,5 +35,5 @@ public class JobQueryCriteria {
private Boolean isSuccess;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
private List<Date> createTime;
}

View File

@@ -85,13 +85,7 @@ public interface DeptService {
* @return /
*/
<T> T findById(Long id, Class<T> tagert);
/**
* 根据角色ID查询
*
* @param id /
* @return /
*/
Set<Dept> findByRoleId(Long id);
/**

View File

@@ -19,9 +19,7 @@ import lombok.Data;
import org.nl.modules.common.annotation.DataPermission;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
* @author Zheng Jie

View File

@@ -18,7 +18,7 @@ package org.nl.modules.system.service.dto;
import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
@@ -32,7 +32,7 @@ public class MenuQueryCriteria {
private String blurry;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
private List<Date> createTime;
@Query(type = Query.Type.IS_NULL, propName = "pid")
private Boolean pidIsNull;

View File

@@ -18,7 +18,7 @@ package org.nl.modules.system.service.dto;
import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
@@ -32,5 +32,5 @@ public class RoleQueryCriteria {
private String blurry;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
private List<Date> createTime;
}

View File

@@ -19,10 +19,8 @@ import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**

View File

@@ -82,15 +82,17 @@ public class DataServiceImpl implements DataService {
* @param role 角色
* @return 数据权限ID
*/
@Deprecated
public Set<Long> getCustomize(Set<Long> deptIds, RoleSmallDto role){
Set<Dept> depts = deptService.findByRoleId(role.getId());
for (Dept dept : depts) {
deptIds.add(dept.getDept_id());
List<Dept> deptChildren = deptService.findByPid(dept.getPid());
if (deptChildren != null && deptChildren.size() != 0) {
deptIds.addAll(deptService.getDeptChildren(deptChildren));
}
}
return deptIds;
//角色跟部门不挂钩
// Set<Dept> depts = deptService.findByRoleId(role.getId());
// for (Dept dept : depts) {
// deptIds.add(dept.getDept_id());
// List<Dept> deptChildren = deptService.findByPid(dept.getPid());
// if (deptChildren != null && deptChildren.size() != 0) {
// deptIds.addAll(deptService.getDeptChildren(deptChildren));
// }
// }
return null;
}
}

View File

@@ -17,7 +17,6 @@ package org.nl.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.db.Db;
import cn.hutool.db.Entity;
@@ -25,22 +24,14 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.apache.poi.ss.formula.functions.T;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.CacheKey;
import org.nl.modules.common.utils.QueryHelp;
import org.nl.modules.common.utils.RedisUtils;
import org.nl.modules.common.utils.ValidationUtil;
import org.nl.modules.system.domain.Dept;
import org.nl.modules.system.domain.User;
import org.nl.modules.system.repository.DeptRepository;
import org.nl.modules.system.repository.RoleRepository;
import org.nl.modules.system.repository.UserRepository;
import org.nl.modules.system.service.DeptService;
import org.nl.modules.system.service.dto.DeptDto;
import org.nl.modules.system.service.dto.DeptQueryCriteria;
import org.nl.modules.system.service.dto.DeptTree;
import org.nl.modules.system.service.mapstruct.DeptMapper;
import org.nl.modules.tools.MapOf;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.ResultBean;
@@ -69,11 +60,7 @@ import java.util.stream.Collectors;
@CacheConfig(cacheNames = "dept")
public class DeptServiceImpl implements DeptService {
private final DeptRepository deptRepository;
private final DeptMapper deptMapper;
private final UserRepository userRepository;
private final RedisUtils redisUtils;
private final RoleRepository roleRepository;
@Override
public List<Dept> queryAll(DeptQueryCriteria criteria, Boolean isQuery) throws Exception {
@@ -112,11 +99,6 @@ public class DeptServiceImpl implements DeptService {
}
@Override
public Set<Dept> findByRoleId(Long id) {
return deptRepository.findByRoleId(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void create(Dept resources) {
@@ -164,7 +146,7 @@ public class DeptServiceImpl implements DeptService {
public Set<Dept> getDeleteDepts(List<Dept> menuList, Set<Dept> deptDtos) {
for (Dept dept : menuList) {
deptDtos.add(dept);
List<Dept> depts = deptRepository.findByPid(dept.getDept_id());
List<Dept> depts = findByPid(dept.getDept_id());
if (depts != null && depts.size() != 0) {
getDeleteDepts(depts, deptDtos);
}
@@ -259,9 +241,10 @@ public class DeptServiceImpl implements DeptService {
* @param id /
*/
public void delCaches(Long id) {
List<User> users = userRepository.findByRoleDeptId(id);
JSONArray array = WQLObject.getWQLObject("sys_user_dept").query("dept_id ='" + id + "'").getResultJSONArray(0);
Set<Long> users = array.stream().map(a -> ((JSONObject) a).getLong("user_id")).collect(Collectors.toSet());
// 删除数据权限
redisUtils.delByKeys(CacheKey.DATA_USER, users.stream().map(User::getUser_id).collect(Collectors.toSet()));
redisUtils.delByKeys(CacheKey.DATA_USER, users);
redisUtils.del(CacheKey.DEPT_ID + id);
}
@@ -270,7 +253,7 @@ public class DeptServiceImpl implements DeptService {
List<Long> list = new ArrayList<>();
deptList.forEach(dept -> {
if (dept != null && dept.getIs_used()) {
List<Dept> depts = deptRepository.findByPid(dept.getDept_id());
List<Dept> depts = findByPid(dept.getDept_id());
if (deptList.size() != 0) {
list.addAll(getDeptChildren(depts));
}

View File

@@ -31,7 +31,6 @@ import org.nl.modules.system.service.RoleService;
import org.nl.modules.system.service.dto.RoleDto;
import org.nl.modules.system.service.dto.RoleQueryCriteria;
import org.nl.modules.system.service.dto.RoleSmallDto;
import org.nl.modules.system.service.dto.UserDto;
import org.nl.modules.system.service.mapstruct.RoleMapper;
import org.nl.modules.system.service.mapstruct.RoleSmallMapper;
import org.nl.modules.wql.WQL;
@@ -41,7 +40,6 @@ import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.util.IdUtil;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

View File

@@ -32,18 +32,14 @@ import org.nl.modules.common.utils.*;
import org.nl.modules.common.utils.dto.CurrentUser;
import org.nl.modules.security.service.OnlineUserService;
import org.nl.modules.system.domain.User;
import org.nl.modules.system.repository.UserRepository;
import org.nl.modules.system.service.UserService;
import org.nl.modules.system.service.dto.RoleSmallDto;
import org.nl.modules.system.service.dto.UserDto;
import org.nl.modules.system.service.dto.UserQueryCriteria;
import org.nl.modules.system.service.mapstruct.UserMapper;
import org.nl.modules.tools.MapOf;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -66,7 +62,6 @@ import java.util.stream.Collectors;
@CacheConfig(cacheNames = "user")
public class UserServiceImpl implements UserService {
private final UserMapper userMapper;
private final FileProperties properties;
private final RedisUtils redisUtils;
private final OnlineUserService onlineUserService;

View File

@@ -1,30 +0,0 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nl.modules.system.service.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.nl.modules.common.base.BaseMapper;
import org.nl.modules.system.domain.Dept;
import org.nl.modules.system.service.dto.DeptDto;
/**
* @author Zheng Jie
* @date 2019-03-25
*/
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DeptMapper extends BaseMapper<DeptDto, Dept> {
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nl.modules.system.service.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.nl.modules.common.base.BaseMapper;
import org.nl.modules.system.domain.Dept;
import org.nl.modules.system.service.dto.DeptSmallDto;
/**
* @author Zheng Jie
* @date 2019-03-25
*/
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DeptSmallMapper extends BaseMapper<DeptSmallDto, Dept> {
}

View File

@@ -25,7 +25,7 @@ import org.nl.modules.system.service.dto.RoleDto;
* @author Zheng Jie
* @date 2018-11-23
*/
@Mapper(componentModel = "spring", uses = {MenuMapper.class, DeptMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
@Mapper(componentModel = "spring", uses = {MenuMapper.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface RoleMapper extends BaseMapper<RoleDto, Role> {
}

View File

@@ -1,30 +0,0 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nl.modules.system.service.mapstruct;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.nl.modules.common.base.BaseMapper;
import org.nl.modules.system.domain.User;
import org.nl.modules.system.service.dto.UserDto;
/**
* @author Zheng Jie
* @date 2018-11-23
*/
@Mapper(componentModel = "spring",uses = {RoleMapper.class, DeptMapper.class},unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface UserMapper extends BaseMapper<UserDto, User> {
}

View File

@@ -18,7 +18,7 @@ package org.nl.modules.tools.service.dto;
import lombok.Data;
import org.nl.modules.common.annotation.Query;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
@@ -33,5 +33,5 @@ public class LocalStorageQueryCriteria{
private String blurry;
@Query(type = Query.Type.BETWEEN)
private List<Timestamp> createTime;
}
private List<Date> createTime;
}

View File

@@ -29,4 +29,4 @@ import org.nl.modules.tools.service.dto.LocalStorageDto;
@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface LocalStorageMapper extends BaseMapper<LocalStorageDto, LocalStorage> {
}
}

View File

@@ -7,7 +7,7 @@
*
* 创 建 者 yumeng
* 创建时间2014-07-01 14:25:35
* 文件版本v1.0
* 文件版本v1.0
*
*******************************************************/
package org.nl.modules.wql.core.bean;
@@ -110,7 +110,7 @@ public class ResultBean implements Serializable, Cloneable {
// */
// public WQLData getWQLData(WQLObject wo,int value){
// if (value < rslist.size()) {
//
//
// ArrayList list = getResultSet(value);
// try{
// WQLData wd = null;
@@ -127,7 +127,7 @@ public class ResultBean implements Serializable, Cloneable {
// }
// return null;
// }
//
//
// /**
// * 返回普通dataset
// * @param value
@@ -287,10 +287,10 @@ public class ResultBean implements Serializable, Cloneable {
Object value = row.get(key);
String strValue = WqlUtil.getSQLFieldValue(value).trim();
if (value instanceof Timestamp)
if (value instanceof Date)
//时间处理
if (ObjectUtil.isEmpty(strValue) && ObjectUtil.isNotEmpty(value)) {
if (value instanceof Timestamp) {
if (value instanceof Date) {
strValue = value.toString();
}
}

View File

@@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.sql.Timestamp;
import java.util.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -648,16 +648,16 @@ public class MethodFactory {
// }
// }
//
// if (prop.getPropertyType().getName().indexOf("Timestamp") >= 0) {
// if (prop.getPropertyType().getName().indexOf("Date") >= 0) {
//
// Method method = prop.getReadMethod();
// if (method != null) {
//
// Timestamp date = (Timestamp) (method.invoke(dto,
// Date date = (Date) (method.invoke(dto,
// null));
//
// if ((date != null)
// && (date.before(Timestamp
// && (date.before(Date
// .valueOf("1900-01-02 00:00:00.0")))) {
//
// method = prop.getWriteMethod();
@@ -969,7 +969,7 @@ public class MethodFactory {
prop.append("double");
propValue = "0.0";
} else if (props[i].getPropertyType().getName().indexOf(
"Timestamp") >= 0) {
"Date") >= 0) {
prop.append("String");
propValue = "\"\"";
} else {
@@ -1022,7 +1022,7 @@ public class MethodFactory {
PropertyDescriptor[] props = java.beans.Introspector.getBeanInfo(
inClass).getPropertyDescriptors();
for (int i = 0; i < props.length; i++) {
if (props[i].getPropertyType().getName().indexOf("Timestamp") >= 0) {
if (props[i].getPropertyType().getName().indexOf("Date") >= 0) {
StringBuffer prop = new StringBuffer();
//formreceivedate = MethodFactory.formatDBDate(formreceivedate);
prop.append("form" + props[i].getName());
@@ -1368,8 +1368,6 @@ public class MethodFactory {
// depot.setustcStatus(new Integer(8));
// depot.setostcInputerid(new Integer(Constants.NULL_INT));
// aForm.setForminputdate(formatDBDate(null));
System.out.println(Timestamp.valueOf("2003-01-01 00:00:00.0")
.compareTo(Timestamp.valueOf("1990-01-02 00:00:00.0")));
//System.out.println(formatDBDate(null));
// copyProperties(depot, aForm, false);
//generateVariable("com.crea.curmedi.biz.struct.stcbBizkeep");
@@ -1385,4 +1383,4 @@ public class MethodFactory {
}
}
}
}

View File

@@ -6,7 +6,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:nl-sso-server}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:nl-sso-server}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:yongyu_lms2}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root}
password: ${DB_PWD:P@ssw0rd}

View File

@@ -22,6 +22,6 @@ text=String
mediumtext=String
longtext=String
date=Timestamp
datetime=Timestamp
timestamp=Timestamp
date=Date
datetime=Date
Date=Date

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
package ${package}.service.dto;
import lombok.Data;
<#if hasTimestamp>
import java.sql.Timestamp;
<#if hasDate>
import java.util.Date;
</#if>
<#if hasBigDecimal>
import java.math.BigDecimal;

View File

@@ -13,8 +13,8 @@ import javax.persistence.*;
import javax.persistence.Table;
import org.hibernate.annotations.*;
</#if>
<#if hasTimestamp>
import java.sql.Timestamp;
<#if hasDate>
import java.util.Date;
</#if>
<#if hasBigDecimal>
import java.math.BigDecimal;
@@ -48,10 +48,10 @@ public class ${className} implements Serializable {
</#if>
</#if>
<#if (column.dateAnnotation)?? && column.dateAnnotation != ''>
<#if column.dateAnnotation = 'CreationTimestamp'>
@CreationTimestamp
<#if column.dateAnnotation = 'CreationDate'>
<#else>
@UpdateTimestamp
@UpdateDate
</#if>
</#if>
<#if column.remark != ''>

View File

@@ -2,8 +2,8 @@
package ${package}.service.dto;
import lombok.Data;
<#if queryHasTimestamp>
import java.sql.Timestamp;
<#if queryHasDate>
import java.util.Date;
</#if>
<#if queryHasBigDecimal>
import java.math.BigDecimal;

View File

@@ -85,7 +85,7 @@
{{ dict.label.${column.dictName}[scope.row.${column.changeColumnName}] }}
</template>
</el-table-column>
<#elseif column.columnType != 'Timestamp'>
<#elseif column.columnType != 'Date'>
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>')"/>
<#else>
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" :min-width="flexWidth('${column.changeColumnName}',crud.data,'<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>')">