Commit c3e3b11f6c31ee015f9a5e0b004cb4add8ac874c

Authored by xqs
2 parents b5aad04f f6112072

Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms2 into develop

Showing 40 changed files with 1600 additions and 1059 deletions
src/main/java/com/huaheng/common/constant/SendTypeConstants.java 0 → 100644
  1 +package com.huaheng.common.constant;
  2 +
  3 +/**
  4 + * 发送通知方式
  5 + * @author mahua
  6 + */
  7 +public class SendTypeConstants {
  8 +
  9 + /** 邮箱 */
  10 + public static final Integer EMAIL = 0;
  11 +
  12 + /** websocket 指定用户发送*/
  13 + public static final Integer WEBSOCKET_USER = 1;
  14 +
  15 + /** websocket 广播*/
  16 + public static final Integer WEBSOCKET_BROADCAST = 2;
  17 +}
... ...
src/main/java/com/huaheng/common/utils/SendMessage.java deleted
1   -package com.huaheng.common.utils;
2   -
3   -/**
4   - * @Author lector
5   - * @Descrpition TODO
6   - * @Date 2020/7/15 16:17
7   - * @Version
8   - */
9   -public class SendMessage {
10   -
11   - /**信息文本*/
12   - String message;
13   - /**发送地址*/
14   - String sendSite;
15   - /**收信地址*/
16   - String receiveSite;
17   - /**收信人*/
18   - String bearer;
19   - /**发送人*/
20   - String addressee;
21   -
22   - public String getMessage() {
23   - return message;
24   - }
25   -
26   - public void setMessage(String message) {
27   - this.message = message;
28   - }
29   -
30   - public String getSendSite() {
31   - return sendSite;
32   - }
33   -
34   - public void setSendSite(String sendSite) {
35   - this.sendSite = sendSite;
36   - }
37   -
38   - public String getReceiveSite() {
39   - return receiveSite;
40   - }
41   -
42   - public void setReceiveSite(String receiveSite) {
43   - this.receiveSite = receiveSite;
44   - }
45   -
46   - public String getBearer() {
47   - return bearer;
48   - }
49   -
50   - public void setBearer(String bearer) {
51   - this.bearer = bearer;
52   - }
53   -
54   - public String getAddressee() {
55   - return addressee;
56   - }
57   -
58   - public void setAddressee(String addressee) {
59   - this.addressee = addressee;
60   - }
61   -
62   -}
src/main/java/com/huaheng/common/utils/SendNoticeUtils.java 0 → 100644
  1 +package com.huaheng.common.utils;
  2 +
  3 +import com.huaheng.common.constant.SendTypeConstants;
  4 +import com.huaheng.framework.web.domain.AjaxResult;
  5 +import com.huaheng.framework.web.service.WebSocketServer;
  6 +import com.huaheng.pc.config.sendMail.service.MailService;
  7 +import com.huaheng.pc.system.notice.domain.SysNotice;
  8 +import com.huaheng.pc.system.notice.service.SysNoticeService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import javax.annotation.PostConstruct;
  13 +import javax.annotation.Resource;
  14 +import java.io.IOException;
  15 +
  16 +/**
  17 + * 发送通知工具类
  18 + * @author mahua
  19 + */
  20 +@Component
  21 +public class SendNoticeUtils {
  22 + private static SendNoticeUtils staticInstance;
  23 +
  24 + @Resource
  25 + private MailService mailService;
  26 + @Resource
  27 + private SysNoticeService noticeService;
  28 +
  29 + public SendNoticeUtils() {
  30 + super();
  31 + // TODO Auto-generated constructor stub
  32 + }
  33 + @PostConstruct
  34 + public void init() {
  35 + staticInstance = this;
  36 + staticInstance.mailService = this.mailService;
  37 + staticInstance.noticeService = this.noticeService;
  38 + }
  39 +
  40 + public static AjaxResult sendNotice(String subject, String body, Integer type, String[] to, String[] cc) {
  41 + SysNotice notice = new SysNotice();
  42 +
  43 + staticInstance.noticeService.save(notice);
  44 + if (type.equals(SendTypeConstants.EMAIL)) {
  45 +// mailService.sendSimpleMail(to, subject, body, cc);
  46 + } else if (type.equals(SendTypeConstants.WEBSOCKET_USER)) {
  47 + for (String userId : to) {
  48 + try {
  49 + WebSocketServer.sendInfo(body, userId);
  50 + } catch (IOException e) {
  51 + e.printStackTrace();
  52 + }
  53 + }
  54 + } else if (type.equals(SendTypeConstants.WEBSOCKET_BROADCAST)) {
  55 + try {
  56 + WebSocketServer.sendInfo(body, "");
  57 + } catch (IOException e) {
  58 + e.printStackTrace();
  59 + }
  60 + }
  61 + return AjaxResult.success();
  62 + }
  63 +}
... ...
src/main/java/com/huaheng/common/utils/security/PermissionUtils.java
1 1 package com.huaheng.common.utils.security;
2 2  
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
3 5 import org.apache.commons.lang3.StringUtils;
4 6 import com.huaheng.common.constant.PermissionConstants;
5 7 import com.huaheng.common.utils.MessageUtils;
  8 +import org.apache.shiro.SecurityUtils;
  9 +import org.apache.shiro.subject.Subject;
  10 +
  11 +import java.beans.BeanInfo;
  12 +import java.beans.Introspector;
  13 +import java.beans.PropertyDescriptor;
6 14  
7 15 /**
8 16 * permission 工具类
... ... @@ -11,6 +19,9 @@ import com.huaheng.common.utils.MessageUtils;
11 19 */
12 20 public class PermissionUtils
13 21 {
  22 + private static final Logger log = LoggerFactory.getLogger(PermissionUtils.class);
  23 +
  24 +
14 25 /**
15 26 * 权限错误消息提醒
16 27 *
... ... @@ -43,4 +54,36 @@ public class PermissionUtils
43 54 }
44 55 return msg;
45 56 }
  57 +
  58 + /**
  59 + * 返回用户属性值
  60 + *
  61 + * @param property 属性名称
  62 + * @return 用户属性值
  63 + */
  64 + public static Object getPrincipalProperty(String property)
  65 + {
  66 + Subject subject = SecurityUtils.getSubject();
  67 + if (subject != null)
  68 + {
  69 + Object principal = subject.getPrincipal();
  70 + try
  71 + {
  72 + BeanInfo bi = Introspector.getBeanInfo(principal.getClass());
  73 + for (PropertyDescriptor pd : bi.getPropertyDescriptors())
  74 + {
  75 + if (pd.getName().equals(property) == true)
  76 + {
  77 + return pd.getReadMethod().invoke(principal, (Object[]) null);
  78 + }
  79 + }
  80 + }
  81 + catch (Exception e)
  82 + {
  83 + log.error("Error reading property [{}] from principal of type [{}]", property,
  84 + principal.getClass().getName());
  85 + }
  86 + }
  87 + return null;
  88 + }
46 89 }
... ...
src/main/java/com/huaheng/framework/config/HuaHengConfig.java
... ... @@ -20,6 +20,8 @@ public class HuaHengConfig
20 20 private String copyrightYear;
21 21 /** 上传路径 */
22 22 private static String profile;
  23 + /** 上传路径 */
  24 + private static String apkpath;
23 25 /** 获取地址开关 */
24 26 private static boolean addressEnabled;
25 27  
... ... @@ -63,6 +65,14 @@ public class HuaHengConfig
63 65 HuaHengConfig.profile = profile;
64 66 }
65 67  
  68 + public static String getApkpath() {
  69 + return apkpath;
  70 + }
  71 +
  72 + public void setApkpath(String apkpath) {
  73 + HuaHengConfig.apkpath = apkpath;
  74 + }
  75 +
66 76 public static boolean isAddressEnabled()
67 77 {
68 78 return addressEnabled;
... ...
src/main/java/com/huaheng/framework/web/service/PermissionService.java
1 1 package com.huaheng.framework.web.service;
2 2  
  3 +import com.huaheng.common.utils.StringUtils;
3 4 import org.apache.shiro.SecurityUtils;
  5 +import org.apache.shiro.subject.Subject;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
4 8 import org.springframework.stereotype.Service;
5 9  
  10 +import java.beans.BeanInfo;
  11 +import java.beans.Introspector;
  12 +import java.beans.PropertyDescriptor;
  13 +
6 14 /**
7   - * huaheng首创 js调用 thymeleaf 实现按钮权限可见性
  15 + * js调用 thymeleaf 实现按钮权限可见性
8 16 *
9 17 * @author huaheng
10 18 */
11 19 @Service("permission")
12 20 public class PermissionService
13 21 {
  22 + private static final Logger log = LoggerFactory.getLogger(PermissionService.class);
  23 +
  24 + /** 没有权限,hidden用于前端隐藏按钮 */
  25 + public static final String NOACCESS = "hidden";
  26 +
  27 + private static final String ROLE_DELIMETER = ",";
  28 +
  29 + private static final String PERMISSION_DELIMETER = ",";
  30 +
  31 + /**
  32 + * 验证用户是否具备某权限,无权限返回hidden用于前端隐藏(如需返回Boolean使用isPermitted)
  33 + *
  34 + * @param permission 权限字符串
  35 + * @return 用户是否具备某权限
  36 + */
14 37 public String hasPermi(String permission)
15 38 {
16   - return isPermittedOperator(permission) ? "" : "hidden";
  39 + return isPermitted(permission) ? StringUtils.EMPTY : NOACCESS;
  40 + }
  41 +
  42 + /**
  43 + * 验证用户是否不具备某权限,与 hasPermi逻辑相反。无权限返回hidden用于前端隐藏(如需返回Boolean使用isLacksPermitted)
  44 + *
  45 + * @param permission 权限字符串
  46 + * @return 用户是否不具备某权限
  47 + */
  48 + public String lacksPermi(String permission)
  49 + {
  50 + return isLacksPermitted(permission) ? StringUtils.EMPTY : NOACCESS;
  51 + }
  52 +
  53 + /**
  54 + * 验证用户是否具有以下任意一个权限,无权限返回hidden用于隐藏(如需返回Boolean使用hasAnyPermissions)
  55 + *
  56 + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表
  57 + * @return 用户是否具有以下任意一个权限
  58 + */
  59 + public String hasAnyPermi(String permissions)
  60 + {
  61 + return hasAnyPermissions(permissions, PERMISSION_DELIMETER) ? StringUtils.EMPTY : NOACCESS;
  62 + }
  63 +
  64 + /**
  65 + * 验证用户是否具备某角色,无权限返回hidden用于隐藏(如需返回Boolean使用isRole)
  66 + *
  67 + * @param role 角色字符串
  68 + * @return 用户是否具备某角色
  69 + */
  70 + public String hasRole(String role)
  71 + {
  72 + return isRole(role) ? StringUtils.EMPTY : NOACCESS;
  73 + }
  74 +
  75 + /**
  76 + * 验证用户是否不具备某角色,与hasRole逻辑相反。无权限返回hidden用于隐藏(如需返回Boolean使用isLacksRole)
  77 + *
  78 + * @param role 角色字符串
  79 + * @return 用户是否不具备某角色
  80 + */
  81 + public String lacksRole(String role)
  82 + {
  83 + return isLacksRole(role) ? StringUtils.EMPTY : NOACCESS;
  84 + }
  85 +
  86 + /**
  87 + * 验证用户是否具有以下任意一个角色,无权限返回hidden用于隐藏(如需返回Boolean使用isAnyRoles)
  88 + *
  89 + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
  90 + * @return 用户是否具有以下任意一个角色
  91 + */
  92 + public String hasAnyRoles(String roles)
  93 + {
  94 + return isAnyRoles(roles, ROLE_DELIMETER) ? StringUtils.EMPTY : NOACCESS;
17 95 }
18 96  
19   - private boolean isPermittedOperator(String permission)
  97 + /**
  98 + * 验证用户是否认证通过或已记住的用户。
  99 + *
  100 + * @return 用户是否认证通过或已记住的用户
  101 + */
  102 + public boolean isUser()
  103 + {
  104 + Subject subject = SecurityUtils.getSubject();
  105 + return subject != null && subject.getPrincipal() != null;
  106 + }
  107 +
  108 + /**
  109 + * 判断用户是否拥有某个权限
  110 + *
  111 + * @param permission 权限字符串
  112 + * @return 用户是否具备某权限
  113 + */
  114 + public boolean isPermitted(String permission)
20 115 {
21 116 return SecurityUtils.getSubject().isPermitted(permission);
22 117 }
23 118  
  119 + /**
  120 + * 判断用户是否不具备某权限,与 isPermitted逻辑相反。
  121 + *
  122 + * @param permission 权限名称
  123 + * @return 用户是否不具备某权限
  124 + */
  125 + public boolean isLacksPermitted(String permission)
  126 + {
  127 + return isPermitted(permission) != true;
  128 + }
  129 +
  130 + /**
  131 + * 验证用户是否具有以下任意一个权限。
  132 + *
  133 + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表
  134 + * @return 用户是否具有以下任意一个权限
  135 + */
  136 + public boolean hasAnyPermissions(String permissions)
  137 + {
  138 + return hasAnyPermissions(permissions, PERMISSION_DELIMETER);
  139 + }
  140 +
  141 + /**
  142 + * 验证用户是否具有以下任意一个权限。
  143 + *
  144 + * @param permissions 以 delimeter 为分隔符的权限列表
  145 + * @param delimeter 权限列表分隔符
  146 + * @return 用户是否具有以下任意一个权限
  147 + */
  148 + public boolean hasAnyPermissions(String permissions, String delimeter)
  149 + {
  150 + Subject subject = SecurityUtils.getSubject();
  151 +
  152 + if (subject != null)
  153 + {
  154 + if (delimeter == null || delimeter.length() == 0)
  155 + {
  156 + delimeter = PERMISSION_DELIMETER;
  157 + }
  158 +
  159 + for (String permission : permissions.split(delimeter))
  160 + {
  161 + if (permission != null && subject.isPermitted(permission.trim()) == true)
  162 + {
  163 + return true;
  164 + }
  165 + }
  166 + }
  167 +
  168 + return false;
  169 + }
  170 +
  171 + /**
  172 + * 判断用户是否拥有某个角色
  173 + *
  174 + * @param role 角色字符串
  175 + * @return 用户是否具备某角色
  176 + */
  177 + public boolean isRole(String role)
  178 + {
  179 + return SecurityUtils.getSubject().hasRole(role);
  180 + }
  181 +
  182 + /**
  183 + * 验证用户是否不具备某角色,与 isRole逻辑相反。
  184 + *
  185 + * @param role 角色名称
  186 + * @return 用户是否不具备某角色
  187 + */
  188 + public boolean isLacksRole(String role)
  189 + {
  190 + return isRole(role) != true;
  191 + }
  192 +
  193 + /**
  194 + * 验证用户是否具有以下任意一个角色。
  195 + *
  196 + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表
  197 + * @return 用户是否具有以下任意一个角色
  198 + */
  199 + public boolean isAnyRoles(String roles)
  200 + {
  201 + return isAnyRoles(roles, ROLE_DELIMETER);
  202 + }
  203 +
  204 + /**
  205 + * 验证用户是否具有以下任意一个角色。
  206 + *
  207 + * @param roles 以 delimeter 为分隔符的角色列表
  208 + * @param delimeter 角色列表分隔符
  209 + * @return 用户是否具有以下任意一个角色
  210 + */
  211 + public boolean isAnyRoles(String roles, String delimeter)
  212 + {
  213 + Subject subject = SecurityUtils.getSubject();
  214 + if (subject != null)
  215 + {
  216 + if (delimeter == null || delimeter.length() == 0)
  217 + {
  218 + delimeter = ROLE_DELIMETER;
  219 + }
  220 +
  221 + for (String role : roles.split(delimeter))
  222 + {
  223 + if (subject.hasRole(role.trim()) == true)
  224 + {
  225 + return true;
  226 + }
  227 + }
  228 + }
  229 +
  230 + return false;
  231 + }
  232 +
  233 + /**
  234 + * 返回用户属性值
  235 + *
  236 + * @param property 属性名称
  237 + * @return 用户属性值
  238 + */
  239 + public Object getPrincipalProperty(String property)
  240 + {
  241 + Subject subject = SecurityUtils.getSubject();
  242 + if (subject != null)
  243 + {
  244 + Object principal = subject.getPrincipal();
  245 + try
  246 + {
  247 + BeanInfo bi = Introspector.getBeanInfo(principal.getClass());
  248 + for (PropertyDescriptor pd : bi.getPropertyDescriptors())
  249 + {
  250 + if (pd.getName().equals(property) == true)
  251 + {
  252 + return pd.getReadMethod().invoke(principal, (Object[]) null);
  253 + }
  254 + }
  255 + }
  256 + catch (Exception e)
  257 + {
  258 + log.error("Error reading property [{}] from principal of type [{}]", property, principal.getClass().getName());
  259 + }
  260 + }
  261 + return null;
  262 + }
24 263 }
... ...
src/main/java/com/huaheng/framework/web/service/WebSocketServer.java
... ... @@ -2,9 +2,12 @@ package com.huaheng.framework.web.service;
2 2  
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.JSONObject;
5   -import org.apache.commons.lang.StringUtils;
  5 +import com.huaheng.pc.system.notice.service.SysNoticeService;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +import com.huaheng.common.utils.StringUtils;
6 8 import org.springframework.stereotype.Component;
7 9  
  10 +import javax.annotation.Resource;
8 11 import javax.websocket.*;
9 12 import javax.websocket.server.PathParam;
10 13 import javax.websocket.server.ServerEndpoint;
... ... @@ -18,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
18 21 */
19 22 @ServerEndpoint("/imserver/{userId}")
20 23 @Component
  24 +@Slf4j
21 25 public class WebSocketServer {
22 26  
23 27 /**静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。*/
... ... @@ -29,6 +33,9 @@ public class WebSocketServer {
29 33 /**接收userId*/
30 34 private String userId="";
31 35  
  36 + @Resource
  37 + private SysNoticeService noticeService;
  38 +
32 39 /**
33 40 * 连接建立成功调用的方法*/
34 41 @OnOpen
... ... @@ -118,12 +125,26 @@ public class WebSocketServer {
118 125 * 发送自定义消息
119 126 * */
120 127 public static void sendInfo(String message,@PathParam("userId") String userId) throws IOException {
121   - System.out.println("发送消息到:"+userId+",报文:"+message);
122   - if(StringUtils.isNotBlank(userId)&&webSocketMap.containsKey(userId)){
123   - webSocketMap.get(userId).sendMessage(message);
124   - }else{
125   - System.out.println("发送消息到:"+userId+",报文:"+message);
  128 +
  129 + if(webSocketMap.isEmpty()){
  130 + log.error("没有窗口号!!!!!!!!!");
  131 + return;
126 132 }
  133 + webSocketMap.forEach((k,v)->{
  134 + try {
  135 + //这里可以设定只推送给这个winNum的,为null则全部推送
  136 + if(StringUtils.isEmpty(userId)) {
  137 + v.sendMessage(message);
  138 + log.info("推送消息到窗口:{},推送内容: {}",message);
  139 + }else if(k.equals(userId)){
  140 + log.info("推送消息到窗口:{},推送内容: {}",userId,message);
  141 + v.sendMessage(message);
  142 + }
  143 + } catch (IOException e) {
  144 + e.printStackTrace();
  145 + log.info("找不到指定的 WebSocket 客户端:{}",userId);
  146 + }
  147 + });
127 148 }
128 149  
129 150 public static synchronized int getOnlineCount() {
... ...
src/main/java/com/huaheng/pc/common/CommonController.java
... ... @@ -16,6 +16,7 @@ import com.huaheng.common.config.Global;
16 16 import com.huaheng.common.config.ServerConfig;
17 17 import com.huaheng.common.utils.QRCodeGenerator;
18 18 import com.huaheng.common.utils.file.FileUploadUtils;
  19 +import com.huaheng.framework.config.HuaHengConfig;
19 20 import com.huaheng.framework.web.domain.AjaxResult;
20 21 import org.slf4j.Logger;
21 22 import org.slf4j.LoggerFactory;
... ... @@ -120,7 +121,7 @@ public class CommonController
120 121 try
121 122 {
122 123 // 上传文件路径
123   - String filePath = "D:/Huaheng/uploadPath/";
  124 + String filePath = HuaHengConfig.getProfile();
124 125 // 上传并返回新文件名称
125 126 String fileName = FileUploadUtils.upload(filePath, file);
126 127 String url = serverConfig.getUrl() + "/" + fileName;
... ...
src/main/java/com/huaheng/pc/common/TestController.java 0 → 100644
  1 +package com.huaheng.pc.common;
  2 +
  3 +import com.huaheng.common.constant.SendTypeConstants;
  4 +import com.huaheng.common.utils.SendNoticeUtils;
  5 +import com.huaheng.framework.web.controller.BaseController;
  6 +import com.huaheng.framework.web.domain.AjaxResult;
  7 +import org.springframework.stereotype.Controller;
  8 +import org.springframework.web.bind.annotation.GetMapping;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +@Controller
  13 +@RestController
  14 +@RequestMapping("/test")
  15 +public class TestController extends BaseController {
  16 +
  17 +
  18 + @GetMapping("/send")
  19 + public AjaxResult sendMessage(String subject, String body, Integer type, String[] to, String[] cc){
  20 + SendNoticeUtils.sendNotice(subject, body, type, to, cc);
  21 + return AjaxResult.success();
  22 + }
  23 +}
... ...
src/main/java/com/huaheng/pc/config/materialWarnning/domain/MaterialWarning.java
... ... @@ -75,7 +75,7 @@ public class MaterialWarning implements Serializable{
75 75 private String lastUpdatedBy;
76 76 /** - */
77 77 @TableField(value = "userId")
78   - private Long userId;
  78 + private String userId;
79 79 /** - */
80 80 @TableField(value = "userName")
81 81 private String userName;
... ...
src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java
... ... @@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7 import com.huaheng.common.constant.QuantityConstant;
  8 +import com.huaheng.common.constant.SendTypeConstants;
8 9 import com.huaheng.common.support.Convert;
  10 +import com.huaheng.common.utils.SendNoticeUtils;
9 11 import com.huaheng.common.utils.StringUtils;
10 12 import com.huaheng.framework.web.domain.AjaxResult;
11 13 import com.huaheng.pc.config.material.domain.Material;
... ... @@ -68,16 +70,18 @@ public class MaterialWarningServiceImpl extends ServiceImpl<MaterialWarningMappe
68 70 .eq("companyCode", companyCode);
69 71 Map<String, Object> map = inventoryDetailService.getMap(detailQueryWrapper);
70 72 BigDecimal total = new BigDecimal(String.valueOf(map.get("total")));
  73 + String body = "";
71 74 if (materialWarning.getMin().compareTo(total) > 0) {
72 75 /* 发送预警*/
73   - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于最小值");
74   - } else if (materialWarning.getLower().compareTo(total) > 0) {
75   - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于下限预警值");
  76 + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于最小值";
  77 + } else if (materialWarning.getLower().compareTo(total) > 0) {
  78 + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于下限预警值";
76 79 } else if (materialWarning.getMax().compareTo(total) < 0) {
77   - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于最大值");
  80 + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于最大值";
78 81 } else if (materialWarning.getUpper().compareTo(total) < 0) {
79   - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于上限预警值");
  82 + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于上限预警值";
80 83 }
  84 + SendNoticeUtils.sendNotice("", body, SendTypeConstants.WEBSOCKET_USER, Convert.toStrArray(materialWarning.getUserId()),null);
81 85 }
82 86 }
83 87 }
... ...
src/main/java/com/huaheng/pc/manager/apkinfo/controller/ApkinfoController.java 0 → 100644
  1 +package com.huaheng.pc.manager.apkinfo.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.utils.file.FileUploadUtils;
  8 +import com.huaheng.framework.config.HuaHengConfig;
  9 +import com.huaheng.framework.web.page.PageDomain;
  10 +import com.huaheng.framework.web.page.TableDataInfo;
  11 +import com.huaheng.framework.web.page.TableSupport;
  12 +import com.huaheng.common.utils.StringUtils;
  13 +import com.huaheng.pc.system.user.domain.User;
  14 +import io.swagger.annotations.ApiOperation;
  15 +import org.apache.shiro.authz.annotation.RequiresPermissions;
  16 +import org.springframework.beans.factory.annotation.Autowired;
  17 +import org.springframework.stereotype.Controller;
  18 +import org.springframework.ui.ModelMap;
  19 +import org.springframework.web.bind.annotation.*;
  20 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  21 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
  22 +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo;
  23 +import com.huaheng.pc.manager.apkinfo.service.IApkinfoService;
  24 +import com.huaheng.framework.web.controller.BaseController;
  25 +import com.huaheng.framework.web.domain.AjaxResult;
  26 +import com.huaheng.common.support.Convert;
  27 +import org.springframework.web.multipart.MultipartFile;
  28 +
  29 +import javax.annotation.Resource;
  30 +import java.util.Arrays;
  31 +import java.util.Date;
  32 +import java.util.List;
  33 +
  34 +/**
  35 + * 【请填写功能名称】 信息操作处理
  36 + *
  37 + * @author huaheng
  38 + * @date 2020-07-23
  39 + */
  40 +@Controller
  41 +@RequestMapping("/manager/apkinfo")
  42 +public class ApkinfoController extends BaseController {
  43 + private String prefix = "manager/apkinfo";
  44 +
  45 + @Resource
  46 + private IApkinfoService apkinfoService;
  47 +
  48 + @GetMapping()
  49 + public String apkinfo() {
  50 + return prefix + "/list";
  51 + }
  52 +
  53 + /**
  54 + * 查询【请填写功能名称】列表
  55 + */
  56 + @PostMapping("/list")
  57 + @ResponseBody
  58 + public TableDataInfo list(Apkinfo apkinfo) {
  59 + LambdaQueryWrapper<Apkinfo> lambdaQueryWrapper = Wrappers.lambdaQuery();
  60 + lambdaQueryWrapper.like(StringUtils.isNotEmpty(apkinfo.getPkgName()), Apkinfo::getPkgName, apkinfo.getPkgName())
  61 + .eq(StringUtils.isNotNull(apkinfo.getVersionCode()), Apkinfo::getVersionCode, apkinfo.getVersionCode())
  62 + .like(StringUtils.isNotEmpty(apkinfo.getVersionName()), Apkinfo::getVersionName, apkinfo.getVersionName())
  63 + .eq(StringUtils.isNotEmpty(apkinfo.getUrl()), Apkinfo::getUrl, apkinfo.getUrl())
  64 + .eq(StringUtils.isNotEmpty(apkinfo.getMd5()), Apkinfo::getMd5, apkinfo.getMd5())
  65 + ;
  66 + PageDomain pageDomain = TableSupport.buildPageRequest();
  67 + Integer pageNum = pageDomain.getPageNum();
  68 + Integer pageSize = pageDomain.getPageSize();
  69 + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
  70 + /*使用分页查询*/
  71 + Page<Apkinfo> page = new Page<>(pageNum, pageSize);
  72 + IPage<Apkinfo> iPage = apkinfoService.page(page, lambdaQueryWrapper);
  73 + return getMpDataTable(iPage.getRecords(), iPage.getTotal());
  74 + } else {
  75 + List<Apkinfo> list = apkinfoService.list(lambdaQueryWrapper);
  76 + return getDataTable(list);
  77 + }
  78 + }
  79 +
  80 + /**
  81 + * 新增【请填写功能名称】
  82 + */
  83 + @GetMapping("/add")
  84 + public String add() {
  85 + return prefix + "/add";
  86 + }
  87 + /**
  88 + * 新增保存入库单
  89 + */
  90 + @Log(title = "新增应用信息", action = BusinessType.INSERT)
  91 + @PostMapping("/add")
  92 + @ResponseBody
  93 + public AjaxResult addSave(Apkinfo apkinfo) {
  94 + return toAjax(apkinfoService.save(apkinfo));
  95 + }
  96 +
  97 + /**
  98 + * 修改【请填写功能名称】
  99 + */
  100 + @GetMapping("/edit/{id}")
  101 + public String edit(@PathVariable("id") Long id, ModelMap mmap) {
  102 + Apkinfo apkinfo = apkinfoService.getById(id);
  103 + mmap.put("apkinfo", apkinfo);
  104 + return prefix + "/edit";
  105 + }
  106 +
  107 +
  108 + @Log(title = "【请填写功能名称】", action = BusinessType.UPDATE)
  109 + @PostMapping("/edit")
  110 + @ResponseBody
  111 + public AjaxResult editSave(Apkinfo apkinfo) {
  112 + return toAjax(apkinfoService.updateById(apkinfo));
  113 + }
  114 +
  115 + @Log(title = "【请填写功能名称】", action = BusinessType.DELETE)
  116 + @PostMapping( "/remove")
  117 + @ResponseBody
  118 + public AjaxResult remove(String ids) {
  119 + if (StringUtils.isEmpty(ids)){
  120 + return AjaxResult.error("id不能为空");
  121 + }
  122 + return toAjax(apkinfoService.removeByIds(Arrays.asList(Convert.toIntArray(ids))));
  123 + }
  124 +
  125 +
  126 + @Log(title = "系统管理-用户管理", operating = "保存头像", action = BusinessType.UPDATE)
  127 + @PostMapping("/updateApk")
  128 + @ResponseBody
  129 + public AjaxResult updateApk(@RequestParam("avatarfile") MultipartFile file)
  130 + {
  131 + try
  132 + {
  133 + if (!file.isEmpty())
  134 + {
  135 + String apk = FileUploadUtils.upload(HuaHengConfig.getApkpath(), file, "");
  136 + }
  137 + return success("上传成功");
  138 + }
  139 + catch (Exception e)
  140 + {
  141 + return error(e.getMessage());
  142 + }
  143 + }
  144 +}
... ...
src/main/java/com/huaheng/pc/manager/apkinfo/domain/Apkinfo.java 0 → 100644
  1 +package com.huaheng.pc.manager.apkinfo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.IdType;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import lombok.Data;
  8 +import org.apache.commons.lang3.builder.ToStringBuilder;
  9 +import org.apache.commons.lang3.builder.ToStringStyle;
  10 +import io.swagger.annotations.ApiModelProperty;
  11 +import javax.validation.constraints.*;
  12 +import java.io.Serializable;
  13 +import java.math.BigDecimal;
  14 +import java.util.Date;
  15 +
  16 +/**
  17 + * 【请填写功能名称】表 apkinfo
  18 + *
  19 + * @author huaheng
  20 + * @date 2020-07-23
  21 + */
  22 +@Data
  23 +@TableName(value = "apkinfo")
  24 +public class Apkinfo implements Serializable{
  25 + private static final long serialVersionUID = 1L;
  26 +
  27 + /** $column.columnComment */
  28 + @TableId(value = "id", type = IdType.AUTO)
  29 + private Long id;
  30 + /** $column.columnComment */
  31 + @TableField(value = "pkgName")
  32 + private String pkgName;
  33 + /** $column.columnComment */
  34 + @TableField(value = "versionCode")
  35 + private Long versionCode;
  36 + /** $column.columnComment */
  37 + @TableField(value = "versionName")
  38 + private String versionName;
  39 + /** $column.columnComment */
  40 + @TableField(value = "url")
  41 + private String url;
  42 + /** $column.columnComment */
  43 + @TableField(value = "md5")
  44 + private String md5;
  45 +
  46 +}
... ...
src/main/java/com/huaheng/pc/manager/apkinfo/mapper/ApkinfoMapper.java 0 → 100644
  1 +package com.huaheng.pc.manager.apkinfo.mapper;
  2 +
  3 +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 【请填写功能名称】 数据层
  9 + *
  10 + * @author huaheng
  11 + * @date 2020-07-23
  12 + */
  13 +public interface ApkinfoMapper extends BaseMapper<Apkinfo> {
  14 +
  15 +}
  16 +
... ...
src/main/java/com/huaheng/pc/manager/apkinfo/service/IApkinfoService.java 0 → 100644
  1 +package com.huaheng.pc.manager.apkinfo.service;
  2 +
  3 +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 【请填写功能名称】 服务层
  9 + *
  10 + * @author huaheng
  11 + * @date 2020-07-23
  12 + */
  13 +public interface IApkinfoService extends IService<Apkinfo> {
  14 +
  15 +}
  16 +
  17 +
... ...
src/main/java/com/huaheng/pc/manager/apkinfo/service/impl/ApkinfoServiceImpl.java 0 → 100644
  1 +package com.huaheng.pc.manager.apkinfo.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.huaheng.pc.manager.apkinfo.service.IApkinfoService;
  5 +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo;
  6 +import com.huaheng.pc.manager.apkinfo.mapper.ApkinfoMapper;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +
  10 +/**
  11 + * 【请填写功能名称】 服务层实现
  12 + *
  13 + * @author huaheng
  14 + * @date 2020-07-23
  15 + */
  16 +@Service
  17 +public class ApkinfoServiceImpl extends ServiceImpl<ApkinfoMapper, Apkinfo> implements IApkinfoService {
  18 +
  19 +}
... ...
src/main/java/com/huaheng/pc/system/notice/controller/NoticeController.java deleted
1   -package com.huaheng.pc.system.notice.controller;
2   -
3   -import java.util.List;
4   -import org.apache.shiro.authz.annotation.RequiresPermissions;
5   -import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.stereotype.Controller;
7   -import org.springframework.ui.ModelMap;
8   -import org.springframework.web.bind.annotation.GetMapping;
9   -import org.springframework.web.bind.annotation.PathVariable;
10   -import org.springframework.web.bind.annotation.PostMapping;
11   -import org.springframework.web.bind.annotation.RequestMapping;
12   -import org.springframework.web.bind.annotation.ResponseBody;
13   -import com.huaheng.framework.aspectj.lang.annotation.Log;
14   -import com.huaheng.framework.aspectj.lang.constant.BusinessType;
15   -import com.huaheng.framework.web.controller.BaseController;
16   -import com.huaheng.framework.web.domain.AjaxResult;
17   -import com.huaheng.framework.web.page.TableDataInfo;
18   -import com.huaheng.pc.system.notice.domain.Notice;
19   -import com.huaheng.pc.system.notice.service.INoticeService;
20   -
21   -/**
22   - * 公告 信息操作处理
23   - *
24   - * @author huaheng
25   - */
26   -@Controller
27   -@RequestMapping("/system/notice")
28   -public class NoticeController extends BaseController
29   -{
30   - private String prefix = "system/notice";
31   -
32   - @Autowired
33   - private INoticeService noticeService;
34   -
35   - @RequiresPermissions("system:notice:view")
36   - @GetMapping()
37   - public String notice()
38   - {
39   - return prefix + "/notice";
40   - }
41   -
42   - /**
43   - * 查询公告列表
44   - */
45   - @RequiresPermissions("system:notice:list")
46   - @Log(title = "系统管理-通知公告", operating = "查询公告列表", action = BusinessType.GRANT)
47   - @PostMapping("/list")
48   - @ResponseBody
49   - public TableDataInfo list(Notice notice)
50   - {
51   - startPage();
52   - List<Notice> list = noticeService.selectNoticeList(notice);
53   - return getDataTable(list);
54   - }
55   -
56   - /**
57   - * 新增公告
58   - */
59   - @GetMapping("/add")
60   - public String add()
61   - {
62   - return prefix + "/add";
63   - }
64   -
65   - /**
66   - * 新增保存公告
67   - */
68   - @RequiresPermissions("system:notice:add")
69   - @Log(title = "系统管理-通知公告", operating = "新增公告", action = BusinessType.INSERT)
70   - @PostMapping("/add")
71   - @ResponseBody
72   - public AjaxResult addSave(Notice notice)
73   - {
74   - return toAjax(noticeService.insertNotice(notice));
75   - }
76   -
77   - /**
78   - * 修改公告
79   - */
80   - @GetMapping("/edit/{id}")
81   - public String edit(@PathVariable("id") Integer id, ModelMap mmap)
82   - {
83   - mmap.put("notice", noticeService.selectNoticeById(id));
84   - return prefix + "/edit";
85   - }
86   -
87   - /**
88   - * 修改保存公告
89   - */
90   - @RequiresPermissions("system:notice:edit")
91   - @Log(title = "系统管理-通知公告", operating = "修改公告", action = BusinessType.UPDATE)
92   - @PostMapping("/edit")
93   - @ResponseBody
94   - public AjaxResult editSave(Notice notice)
95   - {
96   - return toAjax(noticeService.updateNotice(notice));
97   - }
98   -
99   - /**
100   - * 删除公告
101   - */
102   - @RequiresPermissions("system:notice:remove")
103   - @Log(title = "系统管理-通知公告", operating = "删除公告", action = BusinessType.DELETE)
104   - @PostMapping("/remove")
105   - @ResponseBody
106   - public AjaxResult remove(String ids)
107   - {
108   - return toAjax(noticeService.deleteNoticeByIds(ids));
109   - }
110   -
111   -}
src/main/java/com/huaheng/pc/system/notice/domain/Notice.java deleted
1   -package com.huaheng.pc.system.notice.domain;
2   -
3   -import com.baomidou.mybatisplus.annotation.*;
4   -import com.fasterxml.jackson.annotation.JsonFormat;
5   -import com.google.common.collect.Maps;
6   -import lombok.Data;
7   -
8   -import java.util.Date;
9   -import java.util.Map;
10   -
11   -/**
12   - * 公告表 sys_notice
13   - *
14   - * @author huaheng
15   - */
16   -@Data
17   -@TableName(value = "sys_notice")
18   -public class Notice {
19   -
20   - /** 公告ID */
21   - @TableId(value = "id",type = IdType.ID_WORKER)
22   - private Integer id;
23   - /** 公告标题 */
24   - @TableField(value = "noticeTitle")
25   - private String noticeTitle;
26   - /** 公告类型(1通知 2公告) */
27   - @TableField(value = "noticeType")
28   - private String noticeType;
29   - /** 公告内容 */
30   - @TableField(value = "noticeContent")
31   - private String noticeContent;
32   - /** 公告状态(0正常 1关闭) */
33   - @TableField(value = "status")
34   - private String status;
35   - /** 搜索值 */
36   - @TableField(value = "searchValue")
37   - private String searchValue;
38   - /** 创建者 */
39   - @TableField(value = "createBy")
40   - private String createBy;
41   - /** 创建时间 */
42   - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
43   - @TableField(value = "createTime")
44   - private Date createTime;
45   - /** 更新者 */
46   - @TableField(value = "updateBy")
47   - private String updateBy;
48   - /** 更新时间 */
49   - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
50   - @TableField(value = "updateTime")
51   - private Date updateTime;
52   - /** 备注 */
53   -// @TableField(exist=false)
54   - @TableField(value = "remark")
55   - private String remark;
56   - /** 请求参数 */
57   - private Map<String, Object> params;
58   -
59   -}
src/main/java/com/huaheng/pc/system/notice/domain/SysNotice.java 0 → 100644
  1 +package com.huaheng.pc.system.notice.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.*;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import java.util.Date;
  7 +import lombok.Data;
  8 +
  9 +/**
  10 + * 通知公告表
  11 + */
  12 +@ApiModel(value="com-huaheng-pc-system-notice-domain-SysNotice")
  13 +@Data
  14 +@TableName(value = "sys_notice")
  15 +public class SysNotice {
  16 + /**
  17 + * ID
  18 + */
  19 + @TableId(value = "id", type = IdType.AUTO)
  20 + @ApiModelProperty(value="ID")
  21 + private Integer id;
  22 +
  23 + /**
  24 + * 标题
  25 + */
  26 + @TableField(value = "title")
  27 + @ApiModelProperty(value="标题")
  28 + private String title;
  29 +
  30 + /**
  31 + * 类型
  32 + */
  33 + @TableField(value = "type")
  34 + @ApiModelProperty(value="类型")
  35 + private String type;
  36 +
  37 + /**
  38 + * 用户id
  39 + */
  40 + @TableField(value = "userId")
  41 + @ApiModelProperty(value="用户id")
  42 + private String userId;
  43 +
  44 + /**
  45 + * 用户姓名
  46 + */
  47 + @TableField(value = "userName")
  48 + @ApiModelProperty(value="用户姓名")
  49 + private String userName;
  50 +
  51 + /**
  52 + * 内容
  53 + */
  54 + @TableField(value = "content")
  55 + @ApiModelProperty(value="内容")
  56 + private String content;
  57 +
  58 + /**
  59 + * 状态(0未读 1已读)
  60 + */
  61 + @TableField(value = "status")
  62 + @ApiModelProperty(value="状态(0未读 1已读)")
  63 + private String status;
  64 +
  65 + /**
  66 + * 创建者
  67 + */
  68 + @TableField(value = "createdBy", fill = FieldFill.INSERT)
  69 + @ApiModelProperty(value="创建者")
  70 + private String createdBy;
  71 +
  72 + /**
  73 + * 创建时间
  74 + */
  75 + @TableField(value = "created", fill = FieldFill.INSERT)
  76 + @ApiModelProperty(value="创建时间")
  77 + private Date created;
  78 +
  79 + /**
  80 + * 备注
  81 + */
  82 + @TableField(value = "remark")
  83 + @ApiModelProperty(value="备注")
  84 + private String remark;
  85 +
  86 + /**
  87 + * 接收地址
  88 + */
  89 + @TableField(value = "url")
  90 + @ApiModelProperty(value="接收地址")
  91 + private String url;
  92 +}
0 93 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/system/notice/mapper/NoticeMapper.java deleted
1   -package com.huaheng.pc.system.notice.mapper;
2   -
3   -import com.huaheng.pc.system.notice.domain.Notice;
4   -import java.util.List;
5   -
6   -/**
7   - * 公告 数据层
8   - *
9   - * @author huaheng
10   - */
11   -public interface NoticeMapper
12   -{
13   - /**
14   - * 查询公告信息
15   - *
16   - * @param id 公告ID
17   - * @return 公告信息
18   - */
19   - public Notice selectNoticeById(Integer id);
20   -
21   - /**
22   - * 查询公告列表
23   - *
24   - * @param notice 公告信息
25   - * @return 公告集合
26   - */
27   - public List<Notice> selectNoticeList(Notice notice);
28   -
29   - /**
30   - * 新增公告
31   - *
32   - * @param notice 公告信息
33   - * @return 结果
34   - */
35   - public int insertNotice(Notice notice);
36   -
37   - /**
38   - * 修改公告
39   - *
40   - * @param notice 公告信息
41   - * @return 结果
42   - */
43   - public int updateNotice(Notice notice);
44   -
45   - /**
46   - * 批量删除公告
47   - *
48   - * @param noticeIds 需要删除的数据ID
49   - * @return 结果
50   - */
51   - public int deleteNoticeByIds(String[] noticeIds);
52   -
53   -}
54 0 \ No newline at end of file
src/main/java/com/huaheng/pc/system/notice/mapper/SysNoticeMapper.java 0 → 100644
  1 +package com.huaheng.pc.system.notice.mapper;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.huaheng.pc.system.notice.domain.SysNotice;
  5 +
  6 +public interface SysNoticeMapper extends BaseMapper<SysNotice> {
  7 +}
0 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/system/notice/service/INoticeService.java deleted
1   -package com.huaheng.pc.system.notice.service;
2   -
3   -import com.huaheng.pc.system.notice.domain.Notice;
4   -import java.util.List;
5   -
6   -/**
7   - * 公告 服务层
8   - *
9   - * @author huaheng
10   - */
11   -public interface INoticeService
12   -{
13   - /**
14   - * 查询公告信息
15   - *
16   - * @param id 公告ID
17   - * @return 公告信息
18   - */
19   - public Notice selectNoticeById(Integer id);
20   -
21   - /**
22   - * 查询公告列表
23   - *
24   - * @param notice 公告信息
25   - * @return 公告集合
26   - */
27   - public List<Notice> selectNoticeList(Notice notice);
28   -
29   - /**
30   - * 新增公告
31   - *
32   - * @param notice 公告信息
33   - * @return 结果
34   - */
35   - public int insertNotice(Notice notice);
36   -
37   - /**
38   - * 修改公告
39   - *
40   - * @param notice 公告信息
41   - * @return 结果
42   - */
43   - public int updateNotice(Notice notice);
44   -
45   - /**
46   - * 删除公告信息
47   - *
48   - * @param ids 需要删除的数据ID
49   - * @return 结果
50   - */
51   - public int deleteNoticeByIds(String ids);
52   -
53   -}
src/main/java/com/huaheng/pc/system/notice/service/NoticeServiceImpl.java deleted
1   -package com.huaheng.pc.system.notice.service;
2   -
3   -import java.util.List;
4   -import org.springframework.beans.factory.annotation.Autowired;
5   -import org.springframework.stereotype.Service;
6   -import com.huaheng.common.utils.security.ShiroUtils;
7   -import com.huaheng.pc.system.notice.mapper.NoticeMapper;
8   -import com.huaheng.pc.system.notice.domain.Notice;
9   -import com.huaheng.common.support.Convert;
10   -
11   -/**
12   - * 公告 服务层实现
13   - *
14   - * @author huaheng
15   - * @date 2018-06-25
16   - */
17   -@Service
18   -public class NoticeServiceImpl implements INoticeService
19   -{
20   - @Autowired
21   - private NoticeMapper noticeMapper;
22   -
23   - /**
24   - * 查询公告信息
25   - *
26   - * @param id 公告ID
27   - * @return 公告信息
28   - */
29   - @Override
30   - public Notice selectNoticeById(Integer id)
31   - {
32   - return noticeMapper.selectNoticeById(id);
33   - }
34   -
35   - /**
36   - * 查询公告列表
37   - *
38   - * @param notice 公告信息
39   - * @return 公告集合
40   - */
41   - @Override
42   - public List<Notice> selectNoticeList(Notice notice)
43   - {
44   - return noticeMapper.selectNoticeList(notice);
45   - }
46   -
47   - /**
48   - * 新增公告
49   - *
50   - * @param notice 公告信息
51   - * @return 结果
52   - */
53   - @Override
54   - public int insertNotice(Notice notice)
55   - {
56   - notice.setCreateBy(ShiroUtils.getLoginName());
57   - return noticeMapper.insertNotice(notice);
58   - }
59   -
60   - /**
61   - * 修改公告
62   - *
63   - * @param notice 公告信息
64   - * @return 结果
65   - */
66   - @Override
67   - public int updateNotice(Notice notice)
68   - {
69   - notice.setUpdateBy(ShiroUtils.getLoginName());
70   - return noticeMapper.updateNotice(notice);
71   - }
72   -
73   - /**
74   - * 删除公告对象
75   - *
76   - * @param ids 需要删除的数据ID
77   - * @return 结果
78   - */
79   - @Override
80   - public int deleteNoticeByIds(String ids)
81   - {
82   - return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids));
83   - }
84   -
85   -}
src/main/java/com/huaheng/pc/system/notice/service/SysNoticeService.java 0 → 100644
  1 +package com.huaheng.pc.system.notice.service;
  2 +
  3 +import com.huaheng.pc.system.notice.domain.SysNotice;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface SysNoticeService extends IService<SysNotice>{
  9 +
  10 + /**
  11 + * 获取我的通知
  12 + * @param status 状态0未读1已读
  13 + */
  14 + List<SysNotice> getMyNotice(Integer status);
  15 +}
... ...
src/main/java/com/huaheng/pc/system/notice/service/impl/SysNoticeServiceImpl.java 0 → 100644
  1 +package com.huaheng.pc.system.notice.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.huaheng.common.utils.StringUtils;
  6 +import com.huaheng.common.utils.security.ShiroUtils;
  7 +import com.huaheng.pc.config.warehouse.domain.Warehouse;
  8 +import org.springframework.stereotype.Service;
  9 +import javax.annotation.Resource;
  10 +import java.util.List;
  11 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  12 +import com.huaheng.pc.system.notice.domain.SysNotice;
  13 +import com.huaheng.pc.system.notice.mapper.SysNoticeMapper;
  14 +import com.huaheng.pc.system.notice.service.SysNoticeService;
  15 +@Service
  16 +public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService{
  17 +
  18 + /**
  19 + * 获取我的通知
  20 + * @param status 状态0未读1已读
  21 + */
  22 + @Override
  23 + public List<SysNotice> getMyNotice(Integer status) {
  24 + LambdaQueryWrapper<SysNotice> queryWrapper = Wrappers.lambdaQuery();
  25 + queryWrapper.eq(SysNotice::getUserId, ShiroUtils.getUserId())
  26 + .or().isNull(SysNotice::getUserId)
  27 + .eq(StringUtils.isNotNull(status), SysNotice::getStatus, status);
  28 + return this.list(queryWrapper);
  29 + }
  30 +}
... ...
src/main/java/com/huaheng/pc/system/user/controller/IndexController.java
... ... @@ -2,6 +2,7 @@ package com.huaheng.pc.system.user.controller;
2 2  
3 3 import java.util.*;
4 4  
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 6 import com.github.abel533.echarts.Option;
6 7 import com.github.abel533.echarts.axis.Axis;
7 8 import com.github.abel533.echarts.axis.CategoryAxis;
... ... @@ -15,6 +16,8 @@ import com.huaheng.common.support.Convert;
15 16 import com.huaheng.common.utils.security.ShiroUtils;
16 17 import com.huaheng.framework.web.domain.AjaxResult;
17 18 import com.huaheng.pc.report.excelReport.mapper.ExcelReportMapper;
  19 +import com.huaheng.pc.system.notice.domain.SysNotice;
  20 +import com.huaheng.pc.system.notice.service.SysNoticeService;
18 21 import com.huaheng.pc.system.user.domain.ChartData;
19 22 import org.springframework.beans.factory.annotation.Autowired;
20 23 import org.springframework.stereotype.Controller;
... ... @@ -42,6 +45,8 @@ public class IndexController extends BaseController
42 45  
43 46 @Autowired
44 47 private HuaHengConfig huahengConfig;
  48 + @Resource
  49 + private SysNoticeService noticeService;
45 50  
46 51 @Resource
47 52 ExcelReportMapper mapper;
... ... @@ -307,8 +312,7 @@ public class IndexController extends BaseController
307 312  
308 313 // 系统首页
309 314 @GetMapping("/index")
310   - public String index(ModelMap mmap)
311   - {
  315 + public String index(ModelMap mmap) {
312 316 // 取身份信息
313 317 User user = getUser();
314 318 // 根据用户id取出菜单
... ... @@ -317,6 +321,7 @@ public class IndexController extends BaseController
317 321 System.out.println(menus);
318 322 mmap.put("user", user);
319 323 mmap.put("copyrightYear", huahengConfig.getCopyrightYear());
  324 + mmap.put("notices", noticeService.getMyNotice(0));
320 325 return "index";
321 326 }
322 327  
... ...
src/main/resources/application.yml
... ... @@ -12,6 +12,8 @@ huaheng:
12 12 copyrightYear: 2020
13 13 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
14 14 profile: D:/Huaheng/uploadPath/
  15 + # apk路径
  16 + apkpath: D:/download/
15 17 # 获取ip地址开关
16 18 addressEnabled: false
17 19  
... ...
src/main/resources/mybatis/manager/apkinfo/ApkinfoMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.huaheng.pc.manager.apkinfo.mapper.ApkinfoMapper">
  6 +
  7 + <resultMap type="com.huaheng.pc.manager.apkinfo.domain.Apkinfo" id="apkinfoResult">
  8 + <result property="id" column="id" />
  9 + <result property="pkgName" column="pkgName" />
  10 + <result property="versionCode" column="versionCode" />
  11 + <result property="versionName" column="versionName" />
  12 + <result property="url" column="url" />
  13 + <result property="md5" column="md5" />
  14 + </resultMap>
  15 + <sql id="selectapkinfoVo">
  16 + select id, pkgName, versionCode, versionName, url, md5 from apkinfo
  17 + </sql>
  18 +
  19 +</mapper>
0 20 \ No newline at end of file
... ...
src/main/resources/mybatis/system/NoticeMapper.xml deleted
1   -<?xml version="1.0" encoding="UTF-8" ?>
2   -<!DOCTYPE mapper
3   -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4   -"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5   -<mapper namespace="com.huaheng.pc.system.notice.mapper.NoticeMapper">
6   -
7   - <resultMap type="com.huaheng.pc.system.notice.domain.Notice" id="NoticeResult">
8   - <result property="id" column="id" />
9   - <result property="noticeTitle" column="noticeTitle" />
10   - <result property="noticeType" column="noticeType" />
11   - <result property="noticeContent" column="noticeContent" />
12   - <result property="status" column="status" />
13   - <result property="createBy" column="createBy" />
14   - <result property="createTime" column="createTime" />
15   - <result property="updateBy" column="updateBy" />
16   - <result property="updateTime" column="updateTime" />
17   - <result property="remark" column="remark" />
18   - </resultMap>
19   -
20   - <sql id="selectNoticeVo">
21   - select id, noticeTitle, noticeType, noticeContent, status, createBy, createTime, updateBy, updateTime, remark from sys_notice
22   - </sql>
23   -
24   - <select id="selectNoticeById" parameterType="Integer" resultMap="NoticeResult">
25   - <include refid="selectNoticeVo"/>
26   - where id = #{id}
27   - </select>
28   -
29   - <select id="selectNoticeList" parameterType="com.huaheng.pc.system.notice.domain.Notice" resultMap="NoticeResult">
30   - <include refid="selectNoticeVo"/>
31   - <where>
32   - <if test="noticeTitle != null and noticeTitle != ''">
33   - AND noticeTitle like concat('%', #{noticeTitle}, '%')
34   - </if>
35   - <if test="noticeType != null and noticeType != ''">
36   - AND noticeType = #{noticeType}
37   - </if>
38   - <if test="createBy != null and createBy != ''">
39   - AND createBy like concat('%', #{createBy}, '%')
40   - </if>
41   - </where>
42   - </select>
43   -
44   - <insert id="insertNotice" parameterType="com.huaheng.pc.system.notice.domain.Notice">
45   - insert into sys_notice (
46   - <if test="noticeTitle != null and noticeTitle != '' ">noticeTitle, </if>
47   - <if test="noticeType != null and noticeType != '' ">noticeType, </if>
48   - <if test="noticeContent != null and noticeContent != '' ">noticeContent, </if>
49   - <if test="status != null and status != '' ">status, </if>
50   - <if test="remark != null and remark != ''">remark,</if>
51   - <if test="createBy != null and createBy != ''">createBy,</if>
52   - createTime
53   - )values(
54   - <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
55   - <if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
56   - <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
57   - <if test="status != null and status != ''">#{status}, </if>
58   - <if test="remark != null and remark != ''">#{remark},</if>
59   - <if test="createBy != null and createBy != ''">#{createBy},</if>
60   - sysdate()
61   - )
62   - </insert>
63   -
64   - <update id="updateNotice" parameterType="com.huaheng.pc.system.notice.domain.Notice">
65   - update sys_notice
66   - <set>
67   - <if test="noticeTitle != null and noticeTitle != ''">noticeTitle = #{noticeTitle}, </if>
68   - <if test="noticeType != null and noticeType != ''">noticeType = #{noticeType}, </if>
69   - <if test="noticeContent != null and noticeContent != ''">noticeContent = #{noticeContent}, </if>
70   - <if test="status != null and status != ''">status = #{status}, </if>
71   - <if test="updateBy != null and updateBy != ''">updateBy = #{updateBy},</if>
72   - updateTime = sysdate()
73   - </set>
74   - where id = #{id}
75   - </update>
76   -
77   - <delete id="deleteNoticeByIds" parameterType="String">
78   - delete from sys_notice where id in
79   - <foreach item="id" collection="array" open="(" separator="," close=")">
80   - #{id}
81   - </foreach>
82   - </delete>
83   -
84   -</mapper>
85 0 \ No newline at end of file
src/main/resources/mybatis/system/SysNoticeMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.huaheng.pc.system.notice.mapper.SysNoticeMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.system.notice.domain.SysNotice">
  5 + <!--@mbg.generated-->
  6 + <!--@Table sys_notice-->
  7 + <id column="id" jdbcType="INTEGER" property="id" />
  8 + <result column="title" jdbcType="VARCHAR" property="title" />
  9 + <result column="type" jdbcType="CHAR" property="type" />
  10 + <result column="userId" jdbcType="BIGINT" property="userId" />
  11 + <result column="userName" jdbcType="VARCHAR" property="userName" />
  12 + <result column="content" jdbcType="VARCHAR" property="content" />
  13 + <result column="status" jdbcType="CHAR" property="status" />
  14 + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
  15 + <result column="created" jdbcType="TIMESTAMP" property="created" />
  16 + <result column="remark" jdbcType="VARCHAR" property="remark" />
  17 + <result column="url" jdbcType="VARCHAR" property="url" />
  18 + </resultMap>
  19 + <sql id="Base_Column_List">
  20 + <!--@mbg.generated-->
  21 + id, title, `type`, userId, userName, content, `status`, createdBy, created, remark,
  22 + url
  23 + </sql>
  24 +</mapper>
0 25 \ No newline at end of file
... ...
src/main/resources/static/css/style.css
... ... @@ -1317,7 +1317,8 @@ button.dim:active:before {
1317 1317 .media-body {
1318 1318 display: block;
1319 1319 width: auto;
1320   - height:60px; overflow:hidden;position: relative;top: -8px;padding-left: 20px;/*border-bottom: 1px dotted #e5e5e5;*/
  1320 + padding: 0 5px;
  1321 + height:60px; overflow:hidden;position: relative;top: -8px;border-bottom: 1px dotted #e5e5e5;
1321 1322 }
1322 1323  
1323 1324 .chat-element>.pull-left {
... ... @@ -7462,3 +7463,63 @@ body.skin-yellow {
7462 7463 background: #FFFFFF url(../img/up.png) no-repeat 20px;
7463 7464 margin:0 auto;
7464 7465 }
  7466 +
  7467 +.input_list li input {
  7468 + border: 1px solid #ddd;
  7469 + border-radius: 4px;
  7470 + background: transparent;
  7471 + outline: none;
  7472 + height: 30px;
  7473 + width: 200px;
  7474 + padding-left: 5px;
  7475 +}
  7476 +.input_list li select {
  7477 + border: 1px solid #ddd;
  7478 + border-radius: 4px;
  7479 + background: transparent;
  7480 + outline: none;
  7481 + height: 30px;
  7482 + width: 200px;
  7483 +}
  7484 +
  7485 +.wms-field-title{
  7486 + margin: 10px 0 20px;
  7487 + border: none;
  7488 + border-top: 1px solid #e2e2e2;
  7489 +}
  7490 +
  7491 +.wms-field-title legend {
  7492 + margin-left: 20px;
  7493 + padding: 0 10px;
  7494 + font-size: 16px;
  7495 + font-weight: 300;
  7496 +}
  7497 +.input_list ul{
  7498 + width:100%;
  7499 + padding: 5px 0;
  7500 +}
  7501 +.input_list li{
  7502 + width:25%;
  7503 + padding: 3px 0;
  7504 + display:inline-flex;
  7505 +}
  7506 +.input_list li label{
  7507 + width:120px;
  7508 + text-align: right;
  7509 + margin: 5px 0px 0px 0px;
  7510 +}
  7511 +.input_list li .onoffswitch label{
  7512 + text-align: left;
  7513 +}
  7514 +.div1 img:hover{
  7515 + cursor: pointer;
  7516 +}
  7517 +
  7518 +@media (max-width:1200px) {
  7519 + .input_list li{
  7520 + width:45%;}
  7521 +}
  7522 +@media (max-width:768px) {
  7523 + .input_list li{
  7524 + width:100%;}
  7525 +}
7465 7526 \ No newline at end of file
... ...
src/main/resources/static/huaheng/index.js
1 1 /**
2 2 * 菜单处理
3 3 */
4   -$(function() {
  4 +$(function () {
5 5 // MetsiMenu
6 6 $('#side-menu').metisMenu();
7 7  
8 8 //固定菜单栏
9   - $(function() {
  9 + $(function () {
10 10 $('.sidebar-collapse').slimScroll({
11 11 height: '100%',
12 12 railOpacity: 0.9,
... ... @@ -15,17 +15,17 @@ $(function() {
15 15 });
16 16  
17 17 // 菜单切换
18   - $('.navbar-minimalize').click(function() {
  18 + $('.navbar-minimalize').click(function () {
19 19 $("body").toggleClass("mini-navbar");
20 20 SmoothlyMenu();
21 21 });
22 22  
23   - $('#side-menu>li').click(function() {
  23 + $('#side-menu>li').click(function () {
24 24 if ($('body').hasClass('mini-navbar')) {
25 25 NavToggle();
26 26 }
27 27 });
28   - $('#side-menu>li li a').click(function() {
  28 + $('#side-menu>li li a').click(function () {
29 29 if ($(window).width() < 769) {
30 30 NavToggle();
31 31 }
... ... @@ -41,12 +41,12 @@ $(function() {
41 41 });
42 42  
43 43 $(window).bind("load resize",
44   -function() {
45   - if ($(this).width() < 769) {
46   - $('body').addClass('mini-navbar');
47   - $('.navbar-static-side').fadeIn();
48   - }
49   -});
  44 + function () {
  45 + if ($(this).width() < 769) {
  46 + $('body').addClass('mini-navbar');
  47 + $('.navbar-static-side').fadeIn();
  48 + }
  49 + });
50 50  
51 51 function NavToggle() {
52 52 $('.navbar-minimalize').trigger('click');
... ... @@ -55,16 +55,16 @@ function NavToggle() {
55 55 function SmoothlyMenu() {
56 56 if (!$('body').hasClass('mini-navbar')) {
57 57 $('#side-menu').hide();
58   - setTimeout(function() {
59   - $('#side-menu').fadeIn(500);
60   - },
61   - 100);
  58 + setTimeout(function () {
  59 + $('#side-menu').fadeIn(500);
  60 + },
  61 + 100);
62 62 } else if ($('body').hasClass('fixed-sidebar')) {
63 63 $('#side-menu').hide();
64   - setTimeout(function() {
65   - $('#side-menu').fadeIn(500);
66   - },
67   - 300);
  64 + setTimeout(function () {
  65 + $('#side-menu').fadeIn(500);
  66 + },
  67 + 300);
68 68 } else {
69 69 $('#side-menu').removeAttr('style');
70 70 }
... ... @@ -73,11 +73,11 @@ function SmoothlyMenu() {
73 73 /**
74 74 * iframe处理
75 75 */
76   -$(function() {
  76 +$(function () {
77 77 //计算元素集合的总宽度
78 78 function calSumWidth(elements) {
79 79 var width = 0;
80   - $(elements).each(function() {
  80 + $(elements).each(function () {
81 81 width += $(this).outerWidth(true);
82 82 });
83 83 return width;
... ... @@ -86,7 +86,7 @@ $(function() {
86 86 //滚动到指定选项卡
87 87 function scrollToTab(element) {
88 88 var marginLeftVal = calSumWidth($(element).prevAll()),
89   - marginRightVal = calSumWidth($(element).nextAll());
  89 + marginRightVal = calSumWidth($(element).nextAll());
90 90 // 可视区域非tab宽度
91 91 var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs"));
92 92 //可视区域tab宽度
... ... @@ -108,9 +108,9 @@ $(function() {
108 108 scrollVal = marginLeftVal - $(element).prev().outerWidth(true);
109 109 }
110 110 $('.page-tabs-content').animate({
111   - marginLeft: 0 - scrollVal + 'px'
112   - },
113   - "fast");
  111 + marginLeft: 0 - scrollVal + 'px'
  112 + },
  113 + "fast");
114 114 }
115 115  
116 116 //查看左侧隐藏的选项卡
... ... @@ -141,9 +141,9 @@ $(function() {
141 141 }
142 142 }
143 143 $('.page-tabs-content').animate({
144   - marginLeft: 0 - scrollVal + 'px'
145   - },
146   - "fast");
  144 + marginLeft: 0 - scrollVal + 'px'
  145 + },
  146 + "fast");
147 147 }
148 148  
149 149 //查看右侧隐藏的选项卡
... ... @@ -172,15 +172,15 @@ $(function() {
172 172 scrollVal = calSumWidth($(tabElement).prevAll());
173 173 if (scrollVal > 0) {
174 174 $('.page-tabs-content').animate({
175   - marginLeft: 0 - scrollVal + 'px'
176   - },
177   - "fast");
  175 + marginLeft: 0 - scrollVal + 'px'
  176 + },
  177 + "fast");
178 178 }
179 179 }
180 180 }
181 181  
182 182 //通过遍历给菜单项加上data-index属性
183   - $(".menuItem").each(function(index) {
  183 + $(".menuItem").each(function (index) {
184 184 if (!$(this).attr('data-index')) {
185 185 $(this).attr('data-index', index);
186 186 }
... ... @@ -189,19 +189,19 @@ $(function() {
189 189 function menuItem() {
190 190 // 获取标识数据
191 191 var dataUrl = $(this).attr('href'),
192   - dataIndex = $(this).data('index'),
193   - menuName = $.trim($(this).text()),
194   - flag = true;
  192 + dataIndex = $(this).data('index'),
  193 + menuName = $.trim($(this).text()),
  194 + flag = true;
195 195 if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false;
196 196  
197 197 // 选项卡菜单已存在
198   - $('.menuTab').each(function() {
  198 + $('.menuTab').each(function () {
199 199 if ($(this).data('id') == dataUrl) {
200 200 if (!$(this).hasClass('active')) {
201 201 $(this).addClass('active').siblings('.menuTab').removeClass('active');
202 202 scrollToTab(this);
203 203 // 显示tab对应的内容区
204   - $('.mainContent .huaheng_iframe').each(function() {
  204 + $('.mainContent .huaheng_iframe').each(function () {
205 205 if ($(this).data('id') == dataUrl) {
206 206 $(this).show().siblings('.huaheng_iframe').hide();
207 207 return false;
... ... @@ -220,13 +220,13 @@ $(function() {
220 220 // 添加选项卡对应的iframe
221 221 var str1 = '<iframe class="huaheng_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>';
222 222 $('.mainContent').find('iframe.huaheng_iframe').hide().parents('.mainContent').append(str1);
223   -
  223 +
224 224 $.modal.loading("数据加载中,请稍后...");
225   -
  225 +
226 226 $('.mainContent iframe:visible').load(function () {
227   - $.modal.closeLoading();
  227 + $.modal.closeLoading();
228 228 });
229   -
  229 +
230 230 // 添加选项卡
231 231 $('.menuTabs .page-tabs-content').append(str);
232 232 scrollToTab($('.menuTab.active'));
... ... @@ -250,7 +250,7 @@ $(function() {
250 250 var activeId = $(this).parents('.menuTab').next('.menuTab:eq(0)').data('id');
251 251 $(this).parents('.menuTab').next('.menuTab:eq(0)').addClass('active');
252 252  
253   - $('.mainContent .huaheng_iframe').each(function() {
  253 + $('.mainContent .huaheng_iframe').each(function () {
254 254 if ($(this).data('id') == activeId) {
255 255 $(this).show().siblings('.huaheng_iframe').hide();
256 256 return false;
... ... @@ -260,16 +260,16 @@ $(function() {
260 260 var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left'));
261 261 if (marginLeftVal < 0) {
262 262 $('.page-tabs-content').animate({
263   - marginLeft: (marginLeftVal + currentWidth) + 'px'
264   - },
265   - "fast");
  263 + marginLeft: (marginLeftVal + currentWidth) + 'px'
  264 + },
  265 + "fast");
266 266 }
267 267  
268 268 // 移除当前选项卡
269 269 $(this).parents('.menuTab').remove();
270 270  
271 271 // 移除tab对应的内容区
272   - $('.mainContent .huaheng_iframe').each(function() {
  272 + $('.mainContent .huaheng_iframe').each(function () {
273 273 if ($(this).data('id') == closeTabId) {
274 274 $(this).remove();
275 275 return false;
... ... @@ -281,7 +281,7 @@ $(function() {
281 281 if ($(this).parents('.menuTab').prev('.menuTab').size()) {
282 282 var activeId = $(this).parents('.menuTab').prev('.menuTab:last').data('id');
283 283 $(this).parents('.menuTab').prev('.menuTab:last').addClass('active');
284   - $('.mainContent .huaheng_iframe').each(function() {
  284 + $('.mainContent .huaheng_iframe').each(function () {
285 285 if ($(this).data('id') == activeId) {
286 286 $(this).show().siblings('.huaheng_iframe').hide();
287 287 return false;
... ... @@ -292,7 +292,7 @@ $(function() {
292 292 $(this).parents('.menuTab').remove();
293 293  
294 294 // 移除tab对应的内容区
295   - $('.mainContent .huaheng_iframe').each(function() {
  295 + $('.mainContent .huaheng_iframe').each(function () {
296 296 if ($(this).data('id') == closeTabId) {
297 297 $(this).remove();
298 298 return false;
... ... @@ -306,7 +306,7 @@ $(function() {
306 306 $(this).parents('.menuTab').remove();
307 307  
308 308 // 移除相应tab对应的内容区
309   - $('.mainContent .huaheng_iframe').each(function() {
  309 + $('.mainContent .huaheng_iframe').each(function () {
310 310 if ($(this).data('id') == closeTabId) {
311 311 $(this).remove();
312 312 return false;
... ... @@ -321,18 +321,20 @@ $(function() {
321 321  
322 322 //关闭其他选项卡
323 323 function closeOtherTabs() {
324   - $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function() {
  324 + $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function () {
325 325 $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').remove();
326 326 $(this).remove();
327 327 });
328 328 $('.page-tabs-content').css("margin-left", "0");
329 329 }
  330 +
330 331 $('.tabCloseOther').on('click', closeOtherTabs);
331 332  
332 333 //滚动到已激活的选项卡
333 334 function showActiveTab() {
334 335 scrollToTab($('.menuTab.active'));
335 336 }
  337 +
336 338 $('.tabShowActive').on('click', showActiveTab);
337 339  
338 340 // 点击选项卡菜单
... ... @@ -340,7 +342,7 @@ $(function() {
340 342 if (!$(this).hasClass('active')) {
341 343 var currentId = $(this).data('id');
342 344 // 显示tab对应的内容区
343   - $('.mainContent .huaheng_iframe').each(function() {
  345 + $('.mainContent .huaheng_iframe').each(function () {
344 346 if ($(this).data('id') == currentId) {
345 347 $(this).show().siblings('.huaheng_iframe').hide();
346 348 return false;
... ... @@ -356,17 +358,17 @@ $(function() {
356 358  
357 359 //刷新iframe
358 360 function refreshTab() {
359   - var currentId = $('.page-tabs-content').find('.active').attr('data-id');
360   - var target = $('.huaheng_iframe[data-id="' + currentId + '"]');
  361 + var currentId = $('.page-tabs-content').find('.active').attr('data-id');
  362 + var target = $('.huaheng_iframe[data-id="' + currentId + '"]');
361 363 var url = target.attr('src');
362 364 target.attr('src', url).ready();
363 365 }
364   -
  366 +
365 367 // 全屏显示
366 368 $('#fullScreen').on('click', function () {
367   - $('#wrapper').fullScreen();
  369 + $('#wrapper').fullScreen();
368 370 });
369   -
  371 +
370 372 // 刷新按钮
371 373 $('.tabReload').on('click', refreshTab);
372 374  
... ... @@ -377,23 +379,22 @@ $(function() {
377 379  
378 380 // 右移按扭
379 381 $('.tabRight').on('click', scrollTabRight);
380   -
  382 +
381 383 // 关闭当前
382 384 $('.tabCloseCurrent').on('click', function () {
383 385 $('.page-tabs-content').find('.active i').trigger("click");
384 386 });
385 387  
386 388 // 关闭全部
387   - $('.tabCloseAll').on('click', function() {
388   - $('.page-tabs-content').children("[data-id]").not(":first").each(function() {
  389 + $('.tabCloseAll').on('click', function () {
  390 + $('.page-tabs-content').children("[data-id]").not(":first").each(function () {
389 391 $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').remove();
390 392 $(this).remove();
391 393 });
392   - $('.page-tabs-content').children("[data-id]:first").each(function() {
  394 + $('.page-tabs-content').children("[data-id]:first").each(function () {
393 395 $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').show();
394 396 $(this).addClass("active");
395 397 });
396 398 $('.page-tabs-content').css("margin-left", "0");
397 399 });
398   -
399 400 });
400 401 \ No newline at end of file
... ...
src/main/resources/templates/config/receiptPreference/list.html
... ... @@ -2,7 +2,10 @@
2 2 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
3 3 <meta charset="utf-8">
4 4 <head th:include="include :: header">
5   -
  5 + <style>
  6 + .layui-input-block, .layui-input-inline{position: relative;}
  7 + .layui-input-block{margin-left: 110px; min-height: 36px;}
  8 + </style>
6 9 </head>
7 10 <body class="gray-bg">
8 11 <div class="container-div">
... ... @@ -12,11 +15,13 @@
12 15 <div class="box_all">
13 16 <div class="select-list box2">
14 17 <ul>
  18 + <!--
15 19 <li>
16 20 <label>仓库:</label>
17 21 <select name="warehousecode" id="warehouse" >
18 22 </select>
19 23 </li>
  24 + -->
20 25 <li>
21 26 <label>首选项代码:</label>
22 27 <input type="text" name="code"/>
... ... @@ -25,10 +30,6 @@
25 30 <label>首选项名字:</label>
26 31 <input type="text" name="name"/>
27 32 </li>
28   - <li>
29   - <label>入库流程:</label>
30   - <input type="text" name="receivingflow"/>
31   - </li>
32 33 <li class="time">
33 34 <label>创建时间:</label>
34 35 <input type="text" class="time-input" id="startTime" placeholder="开始时间"
... ... @@ -38,6 +39,10 @@
38 39 name="endCreated"/>
39 40 </li>
40 41  
  42 + <!--<li>
  43 + <label>入库流程:</label>
  44 + <input type="text" name="receivingflow"/>
  45 + </li>
41 46 <li>
42 47 <label>自动生成托盘号:</label>
43 48 <input type="text" name="autoassignlpn"/>
... ... @@ -144,143 +149,238 @@
144 149 <option value="0">否</option>
145 150 <option value="-1">是</option>
146 151 </select>
147   - </li>
  152 + </li>-->
148 153  
149   - <p style=" float:right;text-align: right; padding:10px 50px 0 0">
  154 + <p style=" float:right;text-align: right; padding:5px 50px 0 0">
150 155 <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
151 156 class="fa fa-search"></i>&nbsp;搜索</a>
152 157 <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
153 158 class="fa fa-refresh"></i>&nbsp;重置</a>
154 159 </p>
  160 + <div class="div1" style="clear: both;width:16px;margin: auto"><img src="../img/down.png" onClick="test(this)"><!--this 指 img 对象 --> </div>
155 161 </ul>
156   - <!--
157   - <ul>
158   - <li>
159   - <label>仓库:</label>
160   - <input type="text" name="warehousecode"/>
161   - </li>
162   - <li>
163   - <label>首选项代码:</label>
164   - <input type="text" name="code"/>
165   - </li>
166   - <li>
167   - <label>首选项名字:</label>
168   - <input type="text" name="name"/>
169   - </li>
170   - <li>
171   - <label>入库流程:</label>
172   - <input type="text" name="receivingflow"/>
173   - </li>
174   - <li>
175   - <label>自动生成托盘号:</label>
176   - <input type="text" name="autoassignlpn"/>
177   - </li>
178   - <li>
179   - <label>允许超收:</label>
180   - <select name="allowoverreceiving">
181   - <option value="">所有</option>
182   - <option value="-1">代码生成请选择字典属性</option>
183   - </select>
184   - </li>
185   - <li>
186   - <label>允许超收范围:</label>
187   - <input type="text" name="allowoverreceivingqty"/>
188   - </li>
189   - <li>
190   - <label>自动定位:</label>
191   - <input type="text" name="autolocate"/>
192   - </li>
193   - <li>
194   - <label>RF显示未收数量:</label>
195   - <input type="text" name="showopenqty"/>
196   - </li>
197   - <li>
198   - <label>RF组车收货:</label>
199   - <input type="text" name="groupputaway"/>
200   - </li>
201   - <li>
202   - <label>人工组盘:</label>
203   - <input type="text" name="manuallybuildlpn"/>
204   - </li>
205   - <li>
206   - <label>定位规则:</label>
207   - <input type="text" name="locationrule"/>
208   - </li>
209   - <li>
210   - <label>空库位规则:</label>
211   - <input type="text" name="emptylocrule"/>
212   - </li>
213   - <li>
214   - <label>RF逐件收货:</label>
215   - <input type="text" name="checkinbypiece"/>
216   - </li>
217   - <li>
218   - <label>RF自动提交收货:</label>
219   - <input type="text" name="piececonfirm"/>
220   - </li>
221   - <li>
222   - <label>abc分类 0 否 1是:</label>
223   - <input type="text" name="abcclass"/>
224   - </li>
225   - <li>
226   - <label>保质期:</label>
227   - <input type="text" name="daystoexpire"/>
228   - </li>
229   - <li>
230   - <label>临期预警:</label>
231   - <input type="text" name="expiringdays"/>
232   - </li>
233   - <li>
234   - <label>收货预警(天):</label>
235   - <input type="text" name="minshelflifedays"/>
236   - </li>
237   - <li>
238   - <label>RF快速上架:</label>
239   - <input type="text" name="allowquickputaway"/>
240   - </li>
241   - <li>
242   - <label>属性模板:</label>
243   - <input type="text" name="attributetemplatecode"/>
244   - </li>
245   - <li>
246   - <label>快速入库:</label>
247   - <input type="text" name="usequickcheckin"/>
248   - </li>
249   - <li class="select-time">
250   - <label>创建时间:</label>
251   - <input type="text" class="time-input" id="startTime" placeholder="开始时间"
252   - name="params[beginCreated]"/>
253   - <span>-</span>
254   - <input type="text" class="time-input" id="endTime" placeholder="结束时间"
255   - name="params[endCreated]"/>
256   - </li>
257   - <li>
258   - <label>创建用户:</label>
259   - <input type="text" name="createdby"/>
260   - </li>
261   - <li class="select-time">
262   - <label>创建时间:</label>
263   - <input type="text" class="time-input" id="startTime" placeholder="开始时间"
264   - name="params[beginLastupdated]"/>
265   - <span>-</span>
266   - <input type="text" class="time-input" id="endTime" placeholder="结束时间"
267   - name="params[endLastupdated]"/>
268   - </li>
269   - <li>
270   - <label>更新用户:</label>
271   - <input type="text" name="lastupdatedby"/>
272   - </li>
273   - <li>
274   - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
275   - class="fa fa-search"></i>&nbsp;搜索</a>
276   - <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
277   - class="fa fa-refresh"></i>&nbsp;重置</a>
278   - </li>
279   - </ul>
280   - -->
281 162 </div>
  163 + <!--下拉-->
  164 + <div class="clink_more" id="div2" style="display:none;">
  165 + <!--分组-->
  166 + <div class="more_input">
  167 + <div class="col-lg-12">
  168 + <fieldset class="wms-field-title" style="margin-top: 20px;">
  169 + <legend style="width:auto;padding: 0;margin-bottom: 10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">通用</legend>
  170 + </fieldset>
  171 + </div>
  172 + <div class="col-lg-12 input_list">
  173 + <ul>
  174 + <li>
  175 + <label>入库流程:</label>
  176 + <select name="checkinbypiece">
  177 + <option value="0">否</option>
  178 + <option value="-1">是</option>
  179 + </select>
  180 + </li>
  181 + </ul>
  182 + <ul>
  183 + <li>
  184 + <div class="col-lg-4"><label>自动生成托盘号:</label></div>
  185 + <div class="col-lg-8">
  186 + <div class="onoffswitch">
  187 + <input type="checkbox" class="onoffswitch-checkbox" id="autoassignlpn" name="autoassignlpn" checked="checked">
  188 + <label class="onoffswitch-label" for="autoassignlpn">
  189 + <span class="onoffswitch-inner"></span>
  190 + <span class="onoffswitch-switch"></span>
  191 + </label>
  192 + </div>
  193 + </div>
  194 + </li>
  195 + <li>
  196 + <label>托盘生成号:</label>
  197 + <input type="text" name="autoassignlpn" placeholder="on 就调出正则表达式" />
  198 + </li>
  199 + </ul>
  200 + <ul>
  201 + <li>
  202 + <div class="col-lg-4"><label>允许超收:</label></div>
  203 + <div class="col-lg-8">
  204 + <div class="onoffswitch">
  205 + <input type="checkbox" class="onoffswitch-checkbox" id="allowoverreceiving" name="allowoverreceiving" checked="checked">
  206 + <label class="onoffswitch-label" for="allowoverreceiving">
  207 + <span class="onoffswitch-inner"></span>
  208 + <span class="onoffswitch-switch"></span>
  209 + </label>
  210 + </div>
  211 + </div>
  212 + </li>
  213 + <li>
  214 + <label>允许超收范围:</label>
  215 + <input type="text" name="allowoverreceivingqty" placeholder="%" />
  216 + </li>
  217 + </ul>
  218 + <ul>
  219 + <li>
  220 + <div class="col-lg-4"><label>自动定位:</label></div>
  221 + <div class="col-lg-8">
  222 + <div class="onoffswitch">
  223 + <input type="checkbox" class="onoffswitch-checkbox" id="autolocate" name="autolocate" checked="checked">
  224 + <label class="onoffswitch-label" for="autolocate">
  225 + <span class="onoffswitch-inner"></span>
  226 + <span class="onoffswitch-switch"></span>
  227 + </label>
  228 + </div>
  229 + </div>
  230 + </li>
  231 + <li>
  232 + <label>定位规则:</label>
  233 + <select name="locationrule">
  234 + <option value="0">否</option>
  235 + <option value="-1">是</option>
  236 + </select>
  237 + </li>
  238 + <li>
  239 + <label>容器选择规则:</label>
  240 + <select name="checkinbypiece">
  241 + <option value="0">否</option>
  242 + <option value="-1">是</option>
  243 + </select>
  244 + </li>
  245 + </ul>
  246 + <ul>
  247 + <li>
  248 + <div class="col-lg-4"><label>快速入库:</label></div>
  249 + <div class="col-lg-8">
  250 + <div class="onoffswitch">
  251 + <input type="checkbox" class="onoffswitch-checkbox" id="usequickcheckin" name="usequickcheckin" checked="checked">
  252 + <label class="onoffswitch-label" for="usequickcheckin">
  253 + <span class="onoffswitch-inner"></span>
  254 + <span class="onoffswitch-switch"></span>
  255 + </label>
  256 + </div>
  257 + </div>
  258 + </li>
  259 + </ul>
  260 + </div>
  261 + </div>
  262 +
  263 + <div class="more_input">
  264 + <div class="col-lg-12">
  265 + <fieldset class="wms-field-title" style="margin-top: 20px;">
  266 + <legend style="width:auto;padding: 0;margin-bottom:10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">RF</legend>
  267 + </fieldset>
  268 + </div>
  269 + <div class="col-lg-12 input_list">
  270 + <ul>
  271 + <li>
  272 + <div class="col-lg-4"><label>组车收货:</label></div>
  273 + <div class="col-lg-8">
  274 + <div class="onoffswitch">
  275 + <input type="checkbox" class="onoffswitch-checkbox" id="groupputaway" name="groupputaway" checked="checked">
  276 + <label class="onoffswitch-label" for="groupputaway">
  277 + <span class="onoffswitch-inner"></span>
  278 + <span class="onoffswitch-switch"></span>
  279 + </label>
  280 + </div>
  281 + </div>
  282 + </li>
  283 + <li>
  284 + <div class="col-lg-4"><label>显示未收货数量:</label></div>
  285 + <div class="col-lg-8">
  286 + <div class="onoffswitch">
  287 + <input type="checkbox" class="onoffswitch-checkbox" id="showopenqty" name="showopenqty" checked="checked">
  288 + <label class="onoffswitch-label" for="showopenqty">
  289 + <span class="onoffswitch-inner"></span>
  290 + <span class="onoffswitch-switch"></span>
  291 + </label>
  292 + </div>
  293 + </div>
  294 + </li>
  295 + <li>
  296 + <div class="col-lg-4"><label>人工组盘:</label></div>
  297 + <div class="col-lg-8">
  298 + <div class="onoffswitch">
  299 + <input type="checkbox" class="onoffswitch-checkbox" id="manuallybuildlpn" name="manuallybuildlpn" checked="checked">
  300 + <label class="onoffswitch-label" for="manuallybuildlpn">
  301 + <span class="onoffswitch-inner"></span>
  302 + <span class="onoffswitch-switch"></span>
  303 + </label>
  304 + </div>
  305 + </div>
  306 + </li>
  307 + <li>
  308 + <div class="col-lg-4"><label>逐件收货:</label></div>
  309 + <div class="col-lg-8">
  310 + <div class="onoffswitch">
  311 + <input type="checkbox" class="onoffswitch-checkbox" id="checkinbypiece" name="checkinbypiece" checked="checked">
  312 + <label class="onoffswitch-label" for="checkinbypiece">
  313 + <span class="onoffswitch-inner"></span>
  314 + <span class="onoffswitch-switch"></span>
  315 + </label>
  316 + </div>
  317 + </div>
  318 + </li>
  319 + <li>
  320 + <div class="col-lg-4"><label>自动提交(平库):</label></div>
  321 + <div class="col-lg-8">
  322 + <div class="onoffswitch">
  323 + <input type="checkbox" class="onoffswitch-checkbox" id="status" name="status" checked="checked">
  324 + <label class="onoffswitch-label" for="status">
  325 + <span class="onoffswitch-inner"></span>
  326 + <span class="onoffswitch-switch"></span>
  327 + </label>
  328 + </div>
  329 + </div>
  330 + </li>
  331 +
  332 + </ul>
  333 + </div>
  334 + </div>
  335 + <div class="more_input">
  336 + <div class="col-lg-12">
  337 + <fieldset class="wms-field-title" style="margin-top: 20px;">
  338 + <legend style="width:auto;padding: 0;margin-bottom: 10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">物料</legend>
  339 + </fieldset>
  340 + </div>
  341 + <div class="col-lg-12 input_list">
  342 + <ul>
  343 + <li>
  344 + <div class="col-lg-4"><label>ABC分类:</label></div>
  345 + <div class="col-lg-8">
  346 + <div class="onoffswitch">
  347 + <input type="checkbox" class="onoffswitch-checkbox" id="classification" name="classification" checked="checked">
  348 + <label class="onoffswitch-label" for="classification">
  349 + <span class="onoffswitch-inner"></span>
  350 + <span class="onoffswitch-switch"></span>
  351 + </label>
  352 + </div>
  353 + </div>
  354 + </li>
  355 + <li>
  356 + <label>属性模板:</label>
  357 + <select name="checkinbypiece">
  358 + <option value="0">否</option>
  359 + <option value="-1">是</option>
  360 + </select>
  361 + </li>
  362 + </ul>
  363 + <ul>
  364 + <li>
  365 + <label>保质期(天):</label>
  366 + <input type="text" name="autoassignlpn"/>
  367 + </li>
  368 + <li>
  369 + <label>临期预警(天):</label>
  370 + <input type="text" name="autoassignlpn"/>
  371 + </li>
  372 + <li>
  373 + <label>收货预警(天):</label>
  374 + <input type="text" name="autoassignlpn"/>
  375 + </li>
  376 + </ul>
  377 + </div>
  378 + </div>
  379 + <!--分组//-->
  380 + </div>
  381 + <!--下拉//-->
282 382 </div>
283   - <div class="boxdown"></div>
  383 + <!--<div class="boxdown"></div>-->
284 384 </form>
285 385 </div>
286 386 <div class="btn-group hidden-xs" id="toolbar" role="group">
... ... @@ -691,7 +791,18 @@
691 791  
692 792 });
693 793  
694   -
  794 +</script>
  795 +<script type="text/javascript">
  796 + function test(obj){
  797 + var div1=document.getElementById("div2");
  798 + if(div1.style.display=="block"){
  799 + div1.style.display="none";
  800 + obj.src="../img/down.png";
  801 + }else{
  802 + div1.style.display="block";
  803 + obj.src="../img/up.png";
  804 + }
  805 + }
695 806 </script>
696 807 </body>
697 808 </html>
698 809 \ No newline at end of file
... ...
src/main/resources/templates/index.html
1 1 <!DOCTYPE html>
2   -<html lang="zh" xmlns:th="http://www.thymeleaf.org" th:with="corp = ${@corporationService.getEnableCorporation()}">
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" th:with="corp = ${@corporationService.getEnableCorporation()}">
3 3 <head>
4 4 <meta charset="utf-8">
5 5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
... ... @@ -27,7 +27,8 @@
27 27 }
28 28 </style>
29 29 </head>
30   -<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden" th:classappend="${@config.getKey('sys.index.skinName')}">
  30 +<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden"
  31 + th:classappend="${@config.getKey('sys.index.skinName')}">
31 32 <div id="wrapper">
32 33  
33 34 <!--左侧导航开始-->
... ... @@ -40,58 +41,67 @@
40 41 <li class="nav-header">
41 42 <div class="dropdown profile-element">
42 43 <span class="pull-left" style="padding-right: 10px;">
43   - <img th:src="(${user.avatar} == '') ? (${corp}?${corp.getPLogoSmall()}:'img/profile.jpg') : 'profile/' + ${user.avatar}" alt="image" class="img-circle" height="45" width="45"/>
  44 + <img th:src="(${user.avatar} == '') ? (${corp}?${corp.getPLogoSmall()}:'img/profile.jpg') : 'profile/' + ${user.avatar}"
  45 + alt="image" class="img-circle" height="45" width="45"/>
44 46 </span>
45   - <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  47 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">
46 48 <span class="pull-left clear">
47 49 <span class="block m-t-xs"><strong class="font-bold">[[${user.userName}]]</strong></span>
48 50 <span class="text-muted text-xs block"><span th:if="${not #strings.isEmpty(user.dept)}">[[${user.dept.deptName}]]</span>
49 51 <b class="caret"></b>
50 52 </span>
51 53 </span>
52   - </a>
53   - <ul class="dropdown-menu animated fadeInRight m-t-xs" style="position:absolute;top:40px;">
54   - <li><a class="menuItem" th:href="@{/system/user/profile}">个人信息</a></li>
55   - <li><a th:href="@{logout}">退出</a></li>
56   - </ul>
  54 + </a>
  55 + <ul class="dropdown-menu animated fadeInRight m-t-xs" style="position:absolute;top:40px;">
  56 + <li><a class="menuItem" th:href="@{/system/user/profile}">个人信息</a></li>
  57 + <li><a th:href="@{logout}">退出</a></li>
  58 + </ul>
57 59 <div class="dw"><i class="fa fa-map-marker"></i>&nbsp;<span id="warehouse_name"></span></div>
58 60 </div>
59 61  
60 62 </li>
61   - <li class="active">
62   - <a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a>
  63 + <li class="active">
  64 + <a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span
  65 + class="fa arrow"></span></a>
63 66 <ul class="nav nav-second-level">
64   - <li class="active"><a class="menuItem" th:href="@{/system/main}">概&nbsp;&nbsp;&nbsp;&nbsp;况</a></li>
  67 + <li class="active"><a class="menuItem" th:href="@{/system/main}">概&nbsp;&nbsp;&nbsp;&nbsp;况</a>
  68 + </li>
65 69 </ul>
66 70 </li>
67 71 <li th:each="menu : ${menus}">
68   - <a href="#">
69   - <i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i>
70   - <span class="nav-label" th:text="${menu.menuName}">一级菜单</span>
71   - <span class="fa arrow"></span>
72   - </a>
73   - <ul class="nav nav-second-level collapse">
74   - <li th:each="cmenu : ${menu.children}">
75   - <a th:if="${#lists.isEmpty(cmenu.children)}" class="menuItem" th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}">二级菜单</a>
76   - <a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span class="fa arrow"></span></a>
77   - <ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level">
  72 + <a href="#">
  73 + <i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i>
  74 + <span class="nav-label" th:text="${menu.menuName}">一级菜单</span>
  75 + <span class="fa arrow"></span>
  76 + </a>
  77 + <ul class="nav nav-second-level collapse">
  78 + <li th:each="cmenu : ${menu.children}">
  79 + <a th:if="${#lists.isEmpty(cmenu.children)}" class="menuItem" th:utext="${cmenu.menuName}"
  80 + th:href="@{${cmenu.url}}">二级菜单</a>
  81 + <a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span
  82 + class="fa arrow"></span></a>
  83 + <ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level">
78 84 <li th:each="emenu : ${cmenu.children}">
79   - <a th:if="${#lists.isEmpty(emenu.children)}" class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a>
80   - <a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span class="fa arrow"></span></a>
  85 + <a th:if="${#lists.isEmpty(emenu.children)}" class="menuItem"
  86 + th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a>
  87 + <a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span
  88 + class="fa arrow"></span></a>
81 89 <ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level">
82   - <li th:each="fmenu : ${emenu.children}"><a th:if="${#lists.isEmpty(fmenu.children)}" class="menuItem" th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}">四级菜单</a></li>
  90 + <li th:each="fmenu : ${emenu.children}"><a
  91 + th:if="${#lists.isEmpty(fmenu.children)}" class="menuItem"
  92 + th:text="${fmenu.menuName}" th:href="@{${fmenu.url}}">四级菜单</a></li>
83 93 </ul>
84 94 </li>
85   -<!-- <li th:each="emenu : ${cmenu.children}"><a class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a></li>-->
86   - </ul>
87   - </li>
88   - </ul>
  95 + <!-- <li th:each="emenu : ${cmenu.children}"><a class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a></li>-->
  96 + </ul>
  97 + </li>
  98 + </ul>
89 99 </li>
90 100 </ul>
91 101 </div>
92 102 </nav>
93 103 <!--左侧导航结束-->
94   -
  104 +
95 105 <!--右侧部分开始-->
96 106 <div id="page-wrapper" class="gray-bg dashbard-1">
97 107  
... ... @@ -115,50 +125,21 @@
115 125 &lt;!&ndash;<span class="label label-primary">8</span>&ndash;&gt;
116 126 </button>-->
117 127 <!--消息-->
118   - <div class="xx_box">
  128 + <div class="xx_box">
119 129 <a class="dropdown-toggle count-info xx" data-toggle="dropdown" href="#">
120 130 <i class="fa fa-envelope"></i> <sup></sup> <!--<span class="label label-warning">16</span>-->
121 131 </a>
122 132 <ul class="dropdown-menu dropdown-messages">
123   - <li>
124   - <div class="dropdown-messages-box">
125   - <a href="profile.html" class="pull-left">
126   - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/a7.jpg">
127   - </a>
128   - <div class="media-body" style="">
129   - <small class="pull-right">46小时前</small>
130   - <strong>小明</strong> 评论了 <strong>小红</strong>. <br>
131   - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small>
132   - </div>
133   - </div>
134   - </li>
135   - <li class="divider"></li>
136   - <li>
  133 + <li th:each="notice : ${notices}">
137 134 <div class="dropdown-messages-box">
138   - <a href="profile.html" class="pull-left">
139   - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/a4.jpg">
140   - </a>
141   - <div class="media-body ">
142   - <small class="pull-right text-navy">5小时前</small>
143   - <strong>小红</strong> 打电话给了 <strong>小黑</strong>. <br>
144   - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small>
  135 + <div class="media-body">
  136 + <p th:text="${notice.content}"></p>
  137 + <small class="text-muted" style="position: relative;top:-30px;"
  138 + th:text="${#dates.format(notice.created, 'yyyy-MM-dd HH:mm:ss')}"></small>
145 139 </div>
146 140 </div>
147 141 </li>
148   - <li class="divider"></li>
149   - <li>
150   - <div class="dropdown-messages-box">
151   - <a href="profile.html" class="pull-left">
152   - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/profile.jpg">
153   - </a>
154   - <div class="media-body ">
155   - <small class="pull-right">23小时前</small>
156   - <strong>小黑</strong> 点赞了 <strong>小红</strong>. <br>
157   - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small>
158   - </div>
159   - </div>
160   - </li>
161   - <li class="divider"></li>
  142 + <!--<li class="divider"></li>-->
162 143 <li>
163 144 <div class="text-center link-block">
164 145 <a href="mailbox.html">
... ... @@ -171,15 +152,15 @@
171 152 <!--消息-->
172 153 <div class="btn-group roll-nav roll-right">
173 154 <button class="dropdown J_tabClose" data-toggle="dropdown">
174   - 页签操作<span class="caret"></span>
  155 + 页签操作<span class="caret"></span>
175 156 </button>
176 157 <ul role="menu" class="dropdown-menu dropdown-menu-right">
177   - <li><a class="tabCloseOther" href="javascript:void(0);">关闭其他</a></li>
178   - <li><a class="tabCloseCurrent" href="javascript:void(0);">关闭当前</a></li>
179   - <li><a class="tabCloseAll" href="javascript:void(0);">全部关闭</a></li>
  158 + <li><a class="tabCloseOther" href="javascript:void(0);">关闭其他</a></li>
  159 + <li><a class="tabCloseCurrent" href="javascript:void(0);">关闭当前</a></li>
  160 + <li><a class="tabCloseAll" href="javascript:void(0);">全部关闭</a></li>
180 161 </ul>
181 162 </div>
182   - <div class="mlist">
  163 + <div class="mlist">
183 164 <ul>
184 165 <li><a id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li>
185 166 <li><a class="tabReload"><i class="fa fa-refresh"></i> 刷新</a></li>
... ... @@ -192,25 +173,66 @@
192 173 th:src="@{/system/main}" frameborder="0" seamless></iframe>
193 174 </div>
194 175 <div class="footer">
195   - <div class="pull-right">© [[${copyrightYear}]] 长沙华恒机器人系统有限公司 Copyright </div>
  176 + <div class="pull-right">© [[${copyrightYear}]] 长沙华恒机器人系统有限公司 Copyright</div>
196 177 </div>
197 178 </div>
198 179 <!--右侧部分结束-->
199 180 </div>
200 181 <!-- 全局js -->
201   -<script th:src="@{/js/jquery.min.js}"></script>
202   -<script th:src="@{/js/bootstrap.min.js}"></script>
  182 +<div th:include="include :: footer"></div>
203 183 <script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script>
204   -<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
205   -<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
206   -<!--<script src="http://tajs.qq.com/stats?sId=62048022"></script>-->
207   -<script th:src="@{/huaheng/js/huahengUI.min.js?v=2.3.0}"></script>
208 184 <script th:src="@{/huaheng/index.js}"></script>
209 185 <script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script>
210   -<script>
  186 +<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script>
  187 +
  188 +<script th:inline="javascript">
211 189 var warehouse_name = localStorage.getItem("warehouse_name");
212 190 $("#warehouse_name").text(warehouse_name);
213 191 // localStorage.removeItem("warehouse_name");
  192 +
  193 + let socket;
  194 +
  195 + if (typeof (WebSocket) == "undefined") {
  196 + console.log("您的浏览器不支持WebSocket");
  197 + alert("您的浏览器不支持WebSocket");
  198 + } else {
  199 + console.log("您的浏览器支持WebSocket");
  200 + let userId = [[${@permission.getPrincipalProperty('id')}]];
  201 + //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接
  202 + //等同于socket = new WebSocket("ws://localhost:8888/xxxx/im/25");
  203 + //var socketUrl="${request.contextPath}/im/"+$("#userId").val();
  204 + let url = window.location.host;
  205 + let socketUrl = "http://" + url + "/wms/imserver/" + userId;
  206 + socketUrl = socketUrl.replace("https", "ws").replace("http", "ws");
  207 + console.log(socketUrl);
  208 + if (socket != null) {
  209 + socket.close();
  210 + socket = null;
  211 + }
  212 + socket = new WebSocket(socketUrl);
  213 + //打开事件
  214 + socket.onopen = function () {
  215 + console.log("websocket已打开");
  216 + //socket.send("这是来自客户端的消息" + location.href + new Date());
  217 + };
  218 + //获得消息事件
  219 + socket.onmessage = function (msg) {
  220 + if (msg.data !== "连接成功") {
  221 + //向通知里插入消息
  222 + }
  223 + console.log(msg.data);
  224 + };
  225 + //关闭事件
  226 + socket.onclose = function () {
  227 + console.log("websocket已关闭");
  228 + $.modal.alertError("websocket已关闭");
  229 + };
  230 + //发生了错误事件
  231 + socket.onerror = function () {
  232 + console.log("websocket发生了错误");
  233 + $.modal.alertError("websocket发生了错误");
  234 + }
  235 + }
214 236 </script>
215 237 </body>
216 238 </html>
... ...
src/main/resources/templates/manager/apkinfo/add.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head>
  5 + <th:block th:include="include :: header"/>
  6 + </head>
  7 +<body class="white-bg">
  8 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  9 + <form class="form-horizontal m" id="form-apkinfo-add">
  10 + <div class="form-group">
  11 + <label class="col-sm-3 control-label">应用包名
  12 + :</label>
  13 + <div class="col-sm-8">
  14 + <input name="pkgname" class="form-control" type="text">
  15 + </div>
  16 + </div>
  17 + <div class="form-group">
  18 + <label class="col-sm-3 control-label">应用版本号
  19 + :</label>
  20 + <div class="col-sm-8">
  21 + <input name="versioncode" class="form-control" type="text">
  22 + </div>
  23 + </div>
  24 + <div class="form-group">
  25 + <label class="col-sm-3 control-label">应用版本名称
  26 + :</label>
  27 + <div class="col-sm-8">
  28 + <input name="versionname" class="form-control" type="text">
  29 + </div>
  30 + </div>
  31 + <div class="form-group">
  32 + <label class="col-sm-3 control-label">下载链接
  33 + :</label>
  34 + <div class="col-sm-8">
  35 + <input name="url" class="form-control" type="text">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">MD5校验码
  40 + :</label>
  41 + <div class="col-sm-8">
  42 + <input name="md5" class="form-control" type="text">
  43 + </div>
  44 + </div>
  45 + <div class="form-group">
  46 + <div class="form-control-static col-sm-offset-9">
  47 + <button type="submit" class="btn btn-primary">提交</button>
  48 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  49 + </div>
  50 + </div>
  51 + </form>
  52 +</div>
  53 +<th:block th:include="include :: footer"/>
  54 +<script type="text/javascript">
  55 + var prefix = ctx + "manager/apkinfo"
  56 + $("#form-apkinfo-add").validate({
  57 + rules:{
  58 + xxxx:{
  59 + required:true,
  60 + },
  61 + },
  62 + submitHandler: function(form) {
  63 + $.ajax({
  64 + cache : true,
  65 + type : "POST",
  66 + url : prefix + "/add",
  67 + async : false,
  68 + data : {
  69 + "pkgName": $("input[name='pkgname']").val(),
  70 + "versionCode": $("input[name='versioncode']").val(),
  71 + "versionName": $("input[name='versionname']").val(),
  72 + "url": $("input[name='url']").val(),
  73 + "md5": $("input[name='md5']").val(),
  74 + },
  75 + error : function(request) {
  76 + $.modal.alertError("请求失败!");
  77 + },
  78 + success : function(data) {
  79 + $.operate.saveSuccess(data);
  80 + }
  81 + });
  82 + }
  83 + });
  84 +</script>
  85 +</body>
  86 +</html>
... ...
src/main/resources/templates/manager/apkinfo/edit.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3 +<head>
  4 + <th:block th:include="include :: header" />
  5 + </head>
  6 +<body class="white-bg">
  7 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  8 + <form class="form-horizontal m" id="form-apkinfo-edit" th:object="${apkinfo}">
  9 + <input name="id" th:field="*{id}" type="hidden">
  10 + <div class="form-group">
  11 + <label class="col-sm-3 control-label">${comment}:</label>
  12 + <div class="col-sm-8">
  13 + <input name="pkgname" th:field="*{pkgname}" class="form-control" type="text">
  14 + </div>
  15 + </div>
  16 + <div class="form-group">
  17 + <label class="col-sm-3 control-label">${comment}:</label>
  18 + <div class="col-sm-8">
  19 + <input name="versioncode" th:field="*{versioncode}" class="form-control" type="text">
  20 + </div>
  21 + </div>
  22 + <div class="form-group">
  23 + <label class="col-sm-3 control-label">${comment}:</label>
  24 + <div class="col-sm-8">
  25 + <input name="versionname" th:field="*{versionname}" class="form-control" type="text">
  26 + </div>
  27 + </div>
  28 + <div class="form-group">
  29 + <label class="col-sm-3 control-label">${comment}:</label>
  30 + <div class="col-sm-8">
  31 + <input name="url" th:field="*{url}" class="form-control" type="text">
  32 + </div>
  33 + </div>
  34 + <div class="form-group">
  35 + <label class="col-sm-3 control-label">${comment}:</label>
  36 + <div class="col-sm-8">
  37 + <input name="md5" th:field="*{md5}" class="form-control" type="text">
  38 + </div>
  39 + </div>
  40 + </form>
  41 +</div>
  42 +<th:block th:include="include :: footer" />
  43 + <script th:inline="javascript">
  44 + var prefix = ctx + "task/apkinfo";
  45 + $("#form-apkinfo-edit").validate({
  46 + focusCleanup: true
  47 + });
  48 +
  49 + function submitHandler() {
  50 + if ($.validate.form()) {
  51 + $.operate.save(prefix + "/edit", $('#form-apkinfo-edit').serialize());
  52 + }
  53 + }
  54 + </script>
  55 +</body>
  56 +</html>
0 57 \ No newline at end of file
... ...
src/main/resources/templates/system/notice/notice.html renamed to src/main/resources/templates/manager/apkinfo/list.html
... ... @@ -3,115 +3,104 @@
3 3 <meta charset="utf-8">
4 4 <head th:include="include :: header"></head>
5 5 <body class="gray-bg">
6   -
7   - <div class="container-div">
8   - <div class="row">
9   - <div class="col-sm-12 select-info">
10   - <form id="notice-form">
11   - <div class="select-list">
12   - <ul>
13   - <li>
14   - 公告标题:<input type="text" name="noticeTitle"/>
15   - </li>
16   - <li>
17   - 操作人员:<input type="text" name="createBy"/>
18   - </li>
19   - <li>
20   - 公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}">
21   - <option value="">所有</option>
22   - <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
23   - </select>
24   - </li>
25   - <li>
26   - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
27   - <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('notice-form')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
28   - </li>
29   - </ul>
30   - </div>
31   - </form>
32   - </div>
33   -
34   - <div class="btn-group hidden-xs" id="toolbar" role="group">
35   - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.addFull()"
36   - shiro:hasPermission="system:notice:add">
37   - <i class="fa fa-plus"></i> 新增
38   - </a>
39   - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
40   - shiro:hasPermission="system:notice:remove">
41   - <i class="fa fa-trash-o"></i> 删除
42   - </a>
43   - </div>
44   -
45   - <div class="col-sm-12 select-info">
46   - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
47   - </div>
48   - </div>
49   - </div>
50   - <div th:include="include :: footer"></div>
51   - <script th:inline="javascript">
52   - var editFlag = [[${@permission.hasPermi('system:notice:edit')}]];
53   - var removeFlag = [[${@permission.hasPermi('system:notice:remove')}]];
54   - var types = [[${@dict.getType('sys_notice_type')}]];
55   - var datas = [[${@dict.getType('sys_notice_status')}]];
56   - var prefix = ctx + "system/notice"
  6 +<div class="container-div">
  7 + <div class="row">
  8 + <div class="col-sm-12 select-info">
  9 + <form id="formId">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + <label>应用包名:</label>
  14 + <input type="text" name="pkgname"/>
  15 + </li>
  16 + <li>
  17 + <label>应用版本号:</label>
  18 + <input type="text" name="versioncode"/>
  19 + </li>
  20 + <li>
  21 + <label>应用版本名称:</label>
  22 + <input type="text" name="versionname"/>
  23 + </li>
  24 + <li>
  25 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
  26 + class="fa fa-search"></i>&nbsp;搜索</a>
  27 + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
  28 + class="fa fa-refresh"></i>&nbsp;重置</a>
  29 + </li>
  30 + </ul>
  31 + </div>
  32 + </form>
  33 + </div>
  34 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  35 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()">
  36 + <i class="fa fa-plus"></i> 新增
  37 + </a>
  38 + <a class="btn btn-outline btn-primary single disabled" onclick="$.operate.edit()">
  39 + <i class="fa fa-edit"></i> 修改
  40 + </a>
  41 + <a class="btn btn-outline btn-danger btn-rounded multiple disabled" onclick="$.operate.batRemove()">
  42 + <i class="fa fa-trash-o"></i> 删除
  43 + </a>
  44 + </div>
57 45  
58   - $(function() {
59   - var options = {
60   - url: prefix + "/list",
61   - createUrl: prefix + "/add",
62   - updateUrl: prefix + "/edit/{id}",
63   - removeUrl: prefix + "/remove",
64   - modalName: "公告",
65   - search: false,
66   - columns: [{
67   - checkbox: true
68   - },
69   - {
70   - field : 'id',
71   - title : '序号'
72   - },
73   - {
74   - field : 'noticeTitle',
75   - title : '公告标题'
76   - },
77   - {
78   - field: 'noticeType',
79   - title: '公告类型',
80   - align: 'center',
81   - formatter: function(value, row, index) {
82   - return $.table.selectDictLabel(types, value);
83   - }
84   - },
85   - {
86   - field: 'status',
87   - title: '状态',
88   - align: 'center',
89   - formatter: function(value, row, index) {
90   - return $.table.selectDictLabel(datas, value);
91   - }
92   - },
93   - {
94   - field : 'createBy',
95   - title : '创建者'
96   - },
97   - {
98   - field: 'createTime',
99   - title: '创建时间',
100   - sortable: true
101   - },
102   - {
103   - title: '操作',
104   - align: 'center',
105   - formatter: function(value, row, index) {
106   - var actions = [];
107   - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
108   - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
109   - return actions.join('');
110   - }
111   - }]
112   - };
113   - $.table.init(options);
114   - });
115   - </script>
  46 + <div class="col-sm-12 select-info table-striped">
  47 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  48 + </div>
  49 + </div>
  50 + </div>
  51 + <div th:include="include :: footer"></div>
  52 + <script th:inline="javascript">
  53 + var prefix = ctx + "manager/apkinfo"
  54 +
  55 + $(function () {
  56 + var options = {
  57 + url: prefix + "/list",
  58 + createUrl: prefix + "/add",
  59 + updateUrl: prefix + "/edit/{id}",
  60 + removeUrl: prefix + "/remove",
  61 + modalName: "上传应用",
  62 + columns: [{
  63 + checkbox: true
  64 + },
  65 + {
  66 + field: 'id',
  67 + title: 'id',
  68 + visible: false
  69 + },
  70 + {
  71 + field: 'pkgName',
  72 + title: '应用包名'
  73 + },
  74 + {
  75 + field: 'versionCode',
  76 + title: '应用版本号'
  77 + },
  78 + {
  79 + field: 'versionName',
  80 + title: '应用版本名称'
  81 + },
  82 + {
  83 + field: 'url',
  84 + title: '下载链接'
  85 + },
  86 + {
  87 + field: 'md5',
  88 + title: 'md5校验码'
  89 + },
  90 + {
  91 + title: '操作',
  92 + align: 'center',
  93 + formatter: function (value, row, index) {
  94 + var actions = [];
  95 + actions.push('<a class="btn btn-success btn-xs ' + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  96 + actions.push('<a class="btn btn-danger btn-xs ' + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
  97 + return actions.join('');
  98 + }
  99 + }]
  100 + };
  101 + $.table.init(options);
  102 + });
  103 +
  104 +</script>
116 105 </body>
117 106 </html>
118 107 \ No newline at end of file
... ...
src/main/resources/templates/system/notice/add.html deleted
1   -<!DOCTYPE HTML>
2   -<html lang="zh" xmlns:th="http://www.thymeleaf.org">
3   -<meta charset="utf-8">
4   -<head th:include="include :: header"></head>
5   -<link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/>
6   -<link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/>
7   -<body class="white-bg">
8   - <div class="wrapper wrapper-content animated fadeInRight ibox-content">
9   - <form class="form-horizontal m" id="form-notice-add">
10   - <div class="form-group">
11   - <label class="col-sm-3 control-label">公告标题:</label>
12   - <div class="col-sm-8">
13   - <input id="noticeTitle" name="noticeTitle" class="form-control" type="text">
14   - </div>
15   - </div>
16   - <div class="form-group">
17   - <label class="col-sm-3 control-label">公告类型:</label>
18   - <div class="col-sm-8">
19   - <select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
20   - <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
21   - </select>
22   - </div>
23   - </div>
24   - <div class="form-group">
25   - <label class="col-sm-3 control-label">公告内容:</label>
26   - <div class="col-sm-8">
27   - <input id="noticeContent" name="noticeContent" type="hidden">
28   - <div class="summernote"></div>
29   - </div>
30   - </div>
31   - <div class="form-group">
32   - <label class="col-sm-3 control-label">公告状态:</label>
33   - <div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}">
34   - <div th:each="dict : ${type}" th:class="${dict['cssClass']}">
35   - <input type="radio" th:id="${dict['id']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
36   - <label th:for="${dict['id']}" th:text="${dict['dictLabel']}"></label>
37   - </div>
38   - </div>
39   - </div>
40   - <div class="form-group">
41   - <div class="form-control-static col-sm-offset-9">
42   - <button type="submit" class="btn btn-primary">提交</button>
43   - <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
44   - </div>
45   - </div>
46   - </form>
47   - </div>
48   - <div th:include="include::footer"></div>
49   - <script th:src="@{/ajax/libs/summernote/summernote.min.js}"></script>
50   - <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script>
51   - <script type="text/javascript">
52   -
53   - $('.summernote').summernote({
54   - height : '220px',
55   - lang : 'zh-CN'
56   - });
57   -
58   - var prefix = ctx + "system/notice"
59   - $("#form-notice-add").validate({
60   - rules:{
61   - noticeTitle:{
62   - required:true,
63   - }
64   - },
65   - submitHandler: function(form) {
66   - var sHTML = $('.summernote').code();
67   - $("#noticeContent").val(sHTML);
68   - $.operate.save(prefix + "/add", $('#form-notice-add').serialize());
69   - }
70   - });
71   - </script>
72   -</body>
73   -</html>
src/main/resources/templates/system/notice/edit.html deleted
1   -<!DOCTYPE HTML>
2   -<html lang="zh" xmlns:th="http://www.thymeleaf.org">
3   -<meta charset="utf-8">
4   -<head th:include="include :: header"></head>
5   -<link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/>
6   -<link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/>
7   -<body class="white-bg">
8   - <div class="wrapper wrapper-content animated fadeInRight ibox-content">
9   - <form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
10   - <input id="id" name="id" th:field="*{id}" type="hidden">
11   - <div class="form-group">
12   - <label class="col-sm-3 control-label">公告标题:</label>
13   - <div class="col-sm-8">
14   - <input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text">
15   - </div>
16   - </div>
17   - <div class="form-group">
18   - <label class="col-sm-3 control-label">公告类型:</label>
19   - <div class="col-sm-8">
20   - <select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
21   - <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" th:field="*{noticeType}"></option>
22   - </select>
23   - </div>
24   - </div>
25   - <div class="form-group">
26   - <label class="col-sm-3 control-label">公告内容:</label>
27   - <div class="col-sm-8">
28   - <input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
29   - <div id="editor" class="summernote"></div>
30   - </div>
31   - </div>
32   - <div class="form-group">
33   - <label class="col-sm-3 control-label">公告状态:</label>
34   - <div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}">
35   - <div th:each="dict : ${type}" th:class="${dict['cssClass']}">
36   - <input type="radio" th:id="${dict['id']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}">
37   - <label th:for="${dict['id']}" th:text="${dict['dictLabel']}"></label>
38   - </div>
39   - </div>
40   - </div>
41   - <div class="form-group">
42   - <div class="form-control-static col-sm-offset-9">
43   - <button type="submit" class="btn btn-primary">提交</button>
44   - <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
45   - </div>
46   - </div>
47   - </form>
48   - </div>
49   - <div th:include="include::footer"></div>
50   - <script th:src="@{/ajax/libs/summernote/summernote.min.js}"></script>
51   - <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script>
52   - <script type="text/javascript">
53   - $(function() {
54   - $('.summernote').summernote({
55   - height : '220px',
56   - lang : 'zh-CN'
57   - });
58   - var content = $("#noticeContent").val();
59   - $('#editor').code(content);
60   - });
61   -
62   - var prefix = ctx + "system/notice"
63   - $("#form-notice-edit").validate({
64   - rules:{
65   - xxxx:{
66   - required:true,
67   - },
68   - },
69   - submitHandler: function(form) {
70   - var sHTML = $('.summernote').code();
71   - $("#noticeContent").val(sHTML);
72   - $.operate.save(prefix + "/edit", $('#form-notice-edit').serialize());
73   - }
74   - });
75   - </script>
76   -</body>
77   -</html>
src/main/resources/templates/task/taskHeader/taskHeader.html
... ... @@ -522,6 +522,21 @@
522 522 isAsc: params.order
523 523 };
524 524 };
  525 +
  526 + function print() {
  527 + let rows = $("#bootstrap-table").bootstrapTable('getSelections');
  528 + if ($.common.isEmpty(rows)) {
  529 + $.modal.alertWarning("请至少选择一条记录");
  530 + return;
  531 + }
  532 + let ids = rows[0].id;
  533 + for(let i = 1; i < rows.length; i++) {
  534 + ids = ids + "," + rows[i].id;
  535 + }
  536 +
  537 + let url = ctx + 'task/taskDetail/report/' + ids;
  538 + $.modal.open("任务打印" , url);
  539 + }
525 540 </script>
526 541 </body>
527 542 </html>
528 543 \ No newline at end of file
... ...