diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/domain/GoodsModel.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/domain/GoodsModel.java index 5cf7d3734..897a010e6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/domain/GoodsModel.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/demo/domain/GoodsModel.java @@ -1,5 +1,6 @@ package com.ruoyi.web.controller.demo.domain; +import java.util.Date; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -24,6 +25,11 @@ public class GoodsModel * 商品价格 */ private Double price; + + /** + * 商品日期 + */ + private Date date; /** * 商品种类 @@ -60,6 +66,16 @@ public class GoodsModel this.price = price; } + public Date getDate() + { + return date; + } + + public void setDate(Date date) + { + this.date = date; + } + public String getType() { return type; @@ -76,6 +92,7 @@ public class GoodsModel .append("name", getName()) .append("weight", getWeight()) .append("price", getPrice()) + .append("date", getDate()) .append("type", getType()) .toString(); } diff --git a/ruoyi-admin/src/main/resources/templates/demo/table/subdata.html b/ruoyi-admin/src/main/resources/templates/demo/table/subdata.html index b5df24258..175e58c9e 100644 --- a/ruoyi-admin/src/main/resources/templates/demo/table/subdata.html +++ b/ruoyi-admin/src/main/resources/templates/demo/table/subdata.html @@ -119,6 +119,15 @@ formatter: function(value, row, index) { var html = $.common.sprintf("", index, value); return html; + } + }, + { + field: 'date', + align: 'center', + title: '商品日期', + formatter: function(value, row, index) { + var html = $.common.sprintf("", index, value); + return html; } }, { @@ -155,6 +164,15 @@ autoclose: true }); + function bindDatetimepicker() { + $("input[name$='date']").datetimepicker({ + format: "yyyy-mm-dd", + minView: "month", + autoclose: true, + pickerPosition:'top-right' + }); + } + function addColumn() { var count = $("#" + table.options.id).bootstrapTable('getData').length; sub.editColumn(); @@ -166,9 +184,12 @@ name: "", weight: "", price: "", + date: "", type: "", } }); + + bindDatetimepicker(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java index 1dde6c286..7586174f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java @@ -119,7 +119,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService { Cache> cache = ehCacheManager.getCache(ShiroConstants.SYS_USERCACHE); Deque deque = cache.get(loginName); - if (StringUtils.isNull(cache) || StringUtils.isEmpty(deque)) + if (StringUtils.isEmpty(deque) || deque.size() == 0) { return; }