diff --git a/ant-design-vue-jeecg/src/api/login.js b/ant-design-vue-jeecg/src/api/login.js index b35998998a38344f61c05668362f52f48c59a447..7bd6344bc86e3b228f6c4251b576298c8b451184 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 0000000000000000000000000000000000000000..12b9db077e690700fba6b64d7efbac929e335bb1 --- /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 0000000000000000000000000000000000000000..c8a2ed642625eeb512d5260408b67ad380bb7e51 --- /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 0000000000000000000000000000000000000000..8c7c1f2acc4a6938bc33e573b7e97b8a9d5cf17a --- /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 0000000000000000000000000000000000000000..a1c236f48da5c5a53e17a642deb08f0f6fee17d8 --- /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 b1d15b7cf1f7ed20ff0353a35a90421604be33c1..41ac3aad20c4f02a9d895d188303f5ff72e9fbad 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 576cf31fca2d1401aba7f39419c049a7688e66d1..3c329cbddf05784d6ec67d2574136792bd2cc05c 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 fed60798e800fbf72aff1f301bb46e13c8d2045c..ba02b61d690661fa9911446587b8030b157cd916 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 447d35361e625f5dcc9a748450aee6492cce5360..3da88916b7c7266e88f52fb648d73dafced88abf 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 4b50220ff942e6e5eab1f43a820fac12ae4423cc..f04f4c14c6b65e243f1fde963be2d42547a59b46 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 3580d6e6a63475e1db24395e66c228538f462dfd..d80d8405f2d96e78fe0e2970f2a1cfa36bf7c7c5 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 09518a2ac79cab21ef9461851ca4c857da281e86..d645a8f7dfd0bb84cea4252763aa641bdf1a4281 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 e1ee41101750e379760feb43ccd885056beea8c4..9bd5dfd16abd3b51c8ebc9133898af5c1f0ba0a9 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 ba65239d3f27c93f2b8c7e4ec3a16717a595ebcc..c93099cad02df9f11a438805a185599008268139 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 e54b6bc330b1b69d880bcc67e08d876f2209bcf5..c637759e381ebe87741c184aa79839ac33f1f5f7 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 b15908bd5e2494f4f7339d301bde9cad97c53c40..25e80fb659fc310bd23eaa06a8f37b13bf7a624e 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")