From 43329545d8d03e033375eb6bf6f745ba55430470 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Thu, 17 Jun 2021 10:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90gitee/I3HTFI=E3=80=91=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=A0=91=E6=8E=A7=E4=BB=B6=E7=9A=84=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E9=87=8C=E7=9A=84=E5=A4=96=E9=94=AE=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=98=BE=E7=A4=BAid=E4=B8=8D=E6=98=BE=E7=A4=BAname=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9B=91=E6=8E=A7=E5=9C=A8=E7=BA=BF=E7=94=A8=E6=88=B7?= =?UTF-8?q?=20=E9=98=BF=E9=87=8C=E7=9B=91=E6=8E=A7=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ant-design-vue-jeecg/src/api/login.js | 13 ++ .../src/views/system/SysOnlineList.vue | 158 ++++++++++++++++++ .../java/org/jeecg/config/DruidConfig.java | 81 +++++++++ .../controller/SysOnlineController.java | 128 ++++++++++++++ .../jeecg/modules/system/vo/SysOnlineVO.java | 60 +++++++ .../entity/${entityName}.javai | 4 +- .../entity/${entityName}.javai | 10 +- .../${entityPackage}/entity/[1-n]Entity.javai | 4 +- .../entity/${entityName}.javai | 10 +- .../entity/${entityName}.javai | 6 +- .../entity/${entityName}.javai | 10 +- .../${entityPackage}/entity/[1-n]Entity.javai | 4 +- .../entity/${entityName}.javai | 10 +- .../${entityPackage}/entity/[1-n]Entity.javai | 4 +- .../entity/${entityName}.javai | 10 +- .../${entityPackage}/entity/[1-n]Entity.javai | 4 +- 16 files changed, 478 insertions(+), 38 deletions(-) create mode 100644 ant-design-vue-jeecg/src/views/system/SysOnlineList.vue create mode 100644 jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysOnlineController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/SysOnlineVO.java diff --git a/ant-design-vue-jeecg/src/api/login.js b/ant-design-vue-jeecg/src/api/login.js index b359989..7bd6344 100644 --- a/ant-design-vue-jeecg/src/api/login.js +++ b/ant-design-vue-jeecg/src/api/login.js @@ -71,4 +71,17 @@ export function thirdLogin(token,thirdType) { 'Content-Type': 'application/json;charset=UTF-8' } }) +} + +/** + * 强退其他账号 + * @param token + * @returns {*} + */ +export function forceLogout(parameter) { + return axios({ + url: '/sys/online/forceLogout', + method: 'post', + data: parameter + }) } \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/system/SysOnlineList.vue b/ant-design-vue-jeecg/src/views/system/SysOnlineList.vue new file mode 100644 index 0000000..12b9db0 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/SysOnlineList.vue @@ -0,0 +1,158 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java new file mode 100644 index 0000000..c8a2ed6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java @@ -0,0 +1,81 @@ +package org.jeecg.config; + +import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; +import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties; +import com.alibaba.druid.util.Utils; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.*; +import java.io.IOException; + +@Configuration +@AutoConfigureAfter(DruidDataSourceAutoConfigure.class) +public class DruidConfig { + + /** + * 带有广告的common.js全路径,druid-1.1.14 + */ + private static final String FILE_PATH = "support/http/resources/js/common.js"; + /** + * 原始脚本,触发构建广告的语句 + */ + private static final String ORIGIN_JS = "this.buildFooter();"; + /** + * 替换后的脚本 + */ + private static final String NEW_JS = "//this.buildFooter();"; + + /** + * 去除Druid监控页面的广告 + * + * @param properties DruidStatProperties属性集合 + * @return {@link org.springframework.boot.web.servlet.FilterRegistrationBean} + */ + @Bean + @ConditionalOnWebApplication + @ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true") + public FilterRegistrationBean removeDruidAdFilter( + DruidStatProperties properties) throws IOException { + // 获取web监控页面的参数 + DruidStatProperties.StatViewServlet config = properties.getStatViewServlet(); + // 提取common.js的配置路径 + String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*"; + String commonJsPattern = pattern.replaceAll("\\*", "js/common.js"); + // 获取common.js + String text = Utils.readFromResource(FILE_PATH); + // 屏蔽 this.buildFooter(); 不构建广告 + final String newJs = text.replace(ORIGIN_JS, NEW_JS); + FilterRegistrationBean registration = new FilterRegistrationBean<>(); + registration.setFilter(new RemoveAdFilter(newJs)); + registration.addUrlPatterns(commonJsPattern); + return registration; + } + + /** + * 删除druid的广告过滤器 + * + * @author BBF + */ + private class RemoveAdFilter implements Filter { + + private final String newJs; + + public RemoveAdFilter(String newJS) { + this.newJs = newJS; + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + chain.doFilter(request, response); + // 重置缓冲区,响应头不会被重置 + response.resetBuffer(); + response.getWriter().write(newJs); + } + } +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysOnlineController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysOnlineController.java new file mode 100644 index 0000000..8c7c1f2 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/SysOnlineController.java @@ -0,0 +1,128 @@ +package org.jeecg.modules.system.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.constant.CacheConstant; +import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.system.api.ISysBaseAPI; +import org.jeecg.common.system.util.JwtUtil; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.RedisUtil; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.base.service.BaseCommonService; +import org.jeecg.modules.system.service.ISysUserService; +import org.jeecg.modules.system.vo.SysOnlineVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * @Description: 在线用户 + * @Author: chenli + * @Date: 2020-06-07 + * @Version: V1.0 + */ +@RestController +@RequestMapping("/sys/online") +@Slf4j +public class SysOnlineController { + + @Autowired + private RedisUtil redisUtil; + + @Autowired + public RedisTemplate redisTemplate; + + @Autowired + public ISysUserService userService; + + @Autowired + private ISysBaseAPI sysBaseAPI; + + @Resource + private BaseCommonService baseCommonService; + + @RequestMapping(value = "/list", method = RequestMethod.GET) + public Result> list(@RequestParam(name="username", required=false) String username, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { + Collection keys = redisTemplate.keys(CommonConstant.PREFIX_USER_TOKEN + "*"); + SysOnlineVO online; + List onlineList = new ArrayList(); + for (String key : keys) { + online = new SysOnlineVO(); + String token = (String) redisUtil.get(key); + if (!StringUtils.isEmpty(token)){ + online.setToken(token); + LoginUser loginUser = sysBaseAPI.getUserByName(JwtUtil.getUsername(token)); + BeanUtils.copyProperties(loginUser, online); + if (StringUtils.isNotEmpty(username)) { + if (StringUtils.equals(username, online.getUsername())) { + onlineList.add(online); + } + } else { + onlineList.add(online); + } + } + } + + Page page = new Page(pageNo, pageSize); + int count = onlineList.size(); + List pages = new ArrayList<>(); + //计算当前页第一条数据的下标 + int currId = pageNo>1 ? (pageNo-1)*pageSize:0; + for (int i=0; i> result = new Result>(); + result.setSuccess(true); + result.setResult(page); + return result; + } + + /** + * 强退用户 + */ + @RequestMapping(value = "/forceLogout",method = RequestMethod.POST) + public Result forceLogout(@RequestBody SysOnlineVO online) { + //用户退出逻辑 + if(oConvertUtils.isEmpty(online.getToken())) { + return Result.error("退出登录失败!"); + } + String username = JwtUtil.getUsername(online.getToken()); + LoginUser sysUser = sysBaseAPI.getUserByName(username); + if(sysUser!=null) { + baseCommonService.addLog("强制: "+sysUser.getRealname()+"退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser); + log.info(" 强制 "+sysUser.getRealname()+"退出成功! "); + //清空用户登录Token缓存 + redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + online.getToken()); + //清空用户登录Shiro权限缓存 + redisUtil.del(CommonConstant.PREFIX_USER_SHIRO_CACHE + sysUser.getId()); + //清空用户的缓存信息(包括部门信息),例如sys:cache:user:: + redisUtil.del(String.format("%s::%s", CacheConstant.SYS_USERS_CACHE, sysUser.getUsername())); + //调用shiro的logout + SecurityUtils.getSubject().logout(); + return Result.ok("退出登录成功!"); + }else { + return Result.error("Token无效!"); + } + } +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/SysOnlineVO.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/SysOnlineVO.java new file mode 100644 index 0000000..a1c236f --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/vo/SysOnlineVO.java @@ -0,0 +1,60 @@ +package org.jeecg.modules.system.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.jeecg.common.aspect.annotation.Dict; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +/** + * + * @Author: chenli + * @Date: 2020-06-07 + * @Version: V1.0 + */ +@Data +public class SysOnlineVO { + /** + * 会话id + */ + private String id; + + /** + * 会话编号 + */ + private String token; + + /** + * 用户名 + */ + private String username; + + /** + * 用户名 + */ + private String realname; + + /** + * 头像 + */ + private String avatar; + + /** + * 生日 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date birthday; + + /** + * 性别(1:男 2:女) + */ + @Dict(dicCode = "sex") + private Integer sex; + + /** + * 手机号 + */ + private String phone; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index b1d15b7..41ac3aa 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -55,13 +55,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 576cf31..3c329cb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -39,9 +39,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> @@ -50,13 +50,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai index fed6079..ba02b61 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai @@ -51,13 +51,13 @@ public class ${subTab.entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 447d353..3da8891 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -40,9 +40,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> @@ -51,13 +51,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 4b50220..f04f4c1 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -39,9 +39,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index 3580d6e..d80d840 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -39,9 +39,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> @@ -50,13 +50,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai index 09518a2..d645a8f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai @@ -52,13 +52,13 @@ public class ${subTab.entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index e1ee411..9bd5dfd 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -39,9 +39,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> @@ -50,13 +50,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai index ba65239..c93099c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai @@ -51,13 +51,13 @@ public class ${subTab.entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai index e54b6bc..c637759 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/${entityName}.javai @@ -39,9 +39,9 @@ public class ${entityName} implements Serializable { <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText}", dicCode = "${po.dictField}"'> <#elseif po.dictField?default("")?trim?length gt 1> <#assign list_field_dictCode=', dicCode = "${po.dictField}"'> - <#elseif po.classType=='sel_tree'> - <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> - + + <#elseif po.classType=='sel_tree'> + <#assign list_field_dictCode=', dictTable = "${po.dictTable}", dicText = "${po.dictText?split(",")[2]}", dicCode = "${po.dictText?split(",")[0]}"'> /**${po.filedComment}*/ <#if po.fieldName == primaryKeyField> @@ -50,13 +50,13 @@ public class ${entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai index b15908b..25e80fb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai @@ -51,13 +51,13 @@ public class ${subTab.entityName} implements Serializable { <#if po.fieldDbType =='Date'> <#if po.classType=='date'> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 15, format = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd") <#else> <#if !excel_ignore_arr?seq_contains("${po.fieldName}")> - @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss"${list_field_dictCode}) + @Excel(name = "${po.filedComment}", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") -- GitLab