diff --git a/src/main/java/com/huaheng/common/constant/SendTypeConstants.java b/src/main/java/com/huaheng/common/constant/SendTypeConstants.java new file mode 100644 index 0000000..a49de1b --- /dev/null +++ b/src/main/java/com/huaheng/common/constant/SendTypeConstants.java @@ -0,0 +1,17 @@ +package com.huaheng.common.constant; + +/** + * 发送通知方式 + * @author mahua + */ +public class SendTypeConstants { + + /** 邮箱 */ + public static final Integer EMAIL = 0; + + /** websocket 指定用户发送*/ + public static final Integer WEBSOCKET_USER = 1; + + /** websocket 广播*/ + public static final Integer WEBSOCKET_BROADCAST = 2; +} diff --git a/src/main/java/com/huaheng/common/utils/SendMessage.java b/src/main/java/com/huaheng/common/utils/SendMessage.java deleted file mode 100644 index 0784d7b..0000000 --- a/src/main/java/com/huaheng/common/utils/SendMessage.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.huaheng.common.utils; - -/** - * @Author lector - * @Descrpition TODO - * @Date 2020/7/15 16:17 - * @Version - */ -public class SendMessage { - - /**信息文本*/ - String message; - /**发送地址*/ - String sendSite; - /**收信地址*/ - String receiveSite; - /**收信人*/ - String bearer; - /**发送人*/ - String addressee; - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getSendSite() { - return sendSite; - } - - public void setSendSite(String sendSite) { - this.sendSite = sendSite; - } - - public String getReceiveSite() { - return receiveSite; - } - - public void setReceiveSite(String receiveSite) { - this.receiveSite = receiveSite; - } - - public String getBearer() { - return bearer; - } - - public void setBearer(String bearer) { - this.bearer = bearer; - } - - public String getAddressee() { - return addressee; - } - - public void setAddressee(String addressee) { - this.addressee = addressee; - } - -} diff --git a/src/main/java/com/huaheng/common/utils/SendNoticeUtils.java b/src/main/java/com/huaheng/common/utils/SendNoticeUtils.java new file mode 100644 index 0000000..dbfe5f0 --- /dev/null +++ b/src/main/java/com/huaheng/common/utils/SendNoticeUtils.java @@ -0,0 +1,63 @@ +package com.huaheng.common.utils; + +import com.huaheng.common.constant.SendTypeConstants; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.service.WebSocketServer; +import com.huaheng.pc.config.sendMail.service.MailService; +import com.huaheng.pc.system.notice.domain.SysNotice; +import com.huaheng.pc.system.notice.service.SysNoticeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.io.IOException; + +/** + * 发送通知工具类 + * @author mahua + */ +@Component +public class SendNoticeUtils { + private static SendNoticeUtils staticInstance; + + @Resource + private MailService mailService; + @Resource + private SysNoticeService noticeService; + + public SendNoticeUtils() { + super(); + // TODO Auto-generated constructor stub + } + @PostConstruct + public void init() { + staticInstance = this; + staticInstance.mailService = this.mailService; + staticInstance.noticeService = this.noticeService; + } + + public static AjaxResult sendNotice(String subject, String body, Integer type, String[] to, String[] cc) { + SysNotice notice = new SysNotice(); + + staticInstance.noticeService.save(notice); + if (type.equals(SendTypeConstants.EMAIL)) { +// mailService.sendSimpleMail(to, subject, body, cc); + } else if (type.equals(SendTypeConstants.WEBSOCKET_USER)) { + for (String userId : to) { + try { + WebSocketServer.sendInfo(body, userId); + } catch (IOException e) { + e.printStackTrace(); + } + } + } else if (type.equals(SendTypeConstants.WEBSOCKET_BROADCAST)) { + try { + WebSocketServer.sendInfo(body, ""); + } catch (IOException e) { + e.printStackTrace(); + } + } + return AjaxResult.success(); + } +} diff --git a/src/main/java/com/huaheng/common/utils/security/PermissionUtils.java b/src/main/java/com/huaheng/common/utils/security/PermissionUtils.java index 6540f7d..adaa8ca 100644 --- a/src/main/java/com/huaheng/common/utils/security/PermissionUtils.java +++ b/src/main/java/com/huaheng/common/utils/security/PermissionUtils.java @@ -1,8 +1,16 @@ package com.huaheng.common.utils.security; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.apache.commons.lang3.StringUtils; import com.huaheng.common.constant.PermissionConstants; import com.huaheng.common.utils.MessageUtils; +import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; + +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; /** * permission 工具类 @@ -11,6 +19,9 @@ import com.huaheng.common.utils.MessageUtils; */ public class PermissionUtils { + private static final Logger log = LoggerFactory.getLogger(PermissionUtils.class); + + /** * 权限错误消息提醒 * @@ -43,4 +54,36 @@ public class PermissionUtils } return msg; } + + /** + * 返回用户属性值 + * + * @param property 属性名称 + * @return 用户属性值 + */ + public static Object getPrincipalProperty(String property) + { + Subject subject = SecurityUtils.getSubject(); + if (subject != null) + { + Object principal = subject.getPrincipal(); + try + { + BeanInfo bi = Introspector.getBeanInfo(principal.getClass()); + for (PropertyDescriptor pd : bi.getPropertyDescriptors()) + { + if (pd.getName().equals(property) == true) + { + return pd.getReadMethod().invoke(principal, (Object[]) null); + } + } + } + catch (Exception e) + { + log.error("Error reading property [{}] from principal of type [{}]", property, + principal.getClass().getName()); + } + } + return null; + } } diff --git a/src/main/java/com/huaheng/framework/config/HuaHengConfig.java b/src/main/java/com/huaheng/framework/config/HuaHengConfig.java index ca80f5c..a7e4365 100644 --- a/src/main/java/com/huaheng/framework/config/HuaHengConfig.java +++ b/src/main/java/com/huaheng/framework/config/HuaHengConfig.java @@ -20,6 +20,8 @@ public class HuaHengConfig private String copyrightYear; /** 上传路径 */ private static String profile; + /** 上传路径 */ + private static String apkpath; /** 获取地址开关 */ private static boolean addressEnabled; @@ -63,6 +65,14 @@ public class HuaHengConfig HuaHengConfig.profile = profile; } + public static String getApkpath() { + return apkpath; + } + + public void setApkpath(String apkpath) { + HuaHengConfig.apkpath = apkpath; + } + public static boolean isAddressEnabled() { return addressEnabled; diff --git a/src/main/java/com/huaheng/framework/web/service/PermissionService.java b/src/main/java/com/huaheng/framework/web/service/PermissionService.java index c18a70e..123a447 100644 --- a/src/main/java/com/huaheng/framework/web/service/PermissionService.java +++ b/src/main/java/com/huaheng/framework/web/service/PermissionService.java @@ -1,24 +1,263 @@ package com.huaheng.framework.web.service; +import com.huaheng.common.utils.StringUtils; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; + /** - * huaheng首创 js调用 thymeleaf 实现按钮权限可见性 + * js调用 thymeleaf 实现按钮权限可见性 * * @author huaheng */ @Service("permission") public class PermissionService { + private static final Logger log = LoggerFactory.getLogger(PermissionService.class); + + /** 没有权限,hidden用于前端隐藏按钮 */ + public static final String NOACCESS = "hidden"; + + private static final String ROLE_DELIMETER = ","; + + private static final String PERMISSION_DELIMETER = ","; + + /** + * 验证用户是否具备某权限,无权限返回hidden用于前端隐藏(如需返回Boolean使用isPermitted) + * + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ public String hasPermi(String permission) { - return isPermittedOperator(permission) ? "" : "hidden"; + return isPermitted(permission) ? StringUtils.EMPTY : NOACCESS; + } + + /** + * 验证用户是否不具备某权限,与 hasPermi逻辑相反。无权限返回hidden用于前端隐藏(如需返回Boolean使用isLacksPermitted) + * + * @param permission 权限字符串 + * @return 用户是否不具备某权限 + */ + public String lacksPermi(String permission) + { + return isLacksPermitted(permission) ? StringUtils.EMPTY : NOACCESS; + } + + /** + * 验证用户是否具有以下任意一个权限,无权限返回hidden用于隐藏(如需返回Boolean使用hasAnyPermissions) + * + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @return 用户是否具有以下任意一个权限 + */ + public String hasAnyPermi(String permissions) + { + return hasAnyPermissions(permissions, PERMISSION_DELIMETER) ? StringUtils.EMPTY : NOACCESS; + } + + /** + * 验证用户是否具备某角色,无权限返回hidden用于隐藏(如需返回Boolean使用isRole) + * + * @param role 角色字符串 + * @return 用户是否具备某角色 + */ + public String hasRole(String role) + { + return isRole(role) ? StringUtils.EMPTY : NOACCESS; + } + + /** + * 验证用户是否不具备某角色,与hasRole逻辑相反。无权限返回hidden用于隐藏(如需返回Boolean使用isLacksRole) + * + * @param role 角色字符串 + * @return 用户是否不具备某角色 + */ + public String lacksRole(String role) + { + return isLacksRole(role) ? StringUtils.EMPTY : NOACCESS; + } + + /** + * 验证用户是否具有以下任意一个角色,无权限返回hidden用于隐藏(如需返回Boolean使用isAnyRoles) + * + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 + * @return 用户是否具有以下任意一个角色 + */ + public String hasAnyRoles(String roles) + { + return isAnyRoles(roles, ROLE_DELIMETER) ? StringUtils.EMPTY : NOACCESS; } - private boolean isPermittedOperator(String permission) + /** + * 验证用户是否认证通过或已记住的用户。 + * + * @return 用户是否认证通过或已记住的用户 + */ + public boolean isUser() + { + Subject subject = SecurityUtils.getSubject(); + return subject != null && subject.getPrincipal() != null; + } + + /** + * 判断用户是否拥有某个权限 + * + * @param permission 权限字符串 + * @return 用户是否具备某权限 + */ + public boolean isPermitted(String permission) { return SecurityUtils.getSubject().isPermitted(permission); } + /** + * 判断用户是否不具备某权限,与 isPermitted逻辑相反。 + * + * @param permission 权限名称 + * @return 用户是否不具备某权限 + */ + public boolean isLacksPermitted(String permission) + { + return isPermitted(permission) != true; + } + + /** + * 验证用户是否具有以下任意一个权限。 + * + * @param permissions 以 PERMISSION_NAMES_DELIMETER 为分隔符的权限列表 + * @return 用户是否具有以下任意一个权限 + */ + public boolean hasAnyPermissions(String permissions) + { + return hasAnyPermissions(permissions, PERMISSION_DELIMETER); + } + + /** + * 验证用户是否具有以下任意一个权限。 + * + * @param permissions 以 delimeter 为分隔符的权限列表 + * @param delimeter 权限列表分隔符 + * @return 用户是否具有以下任意一个权限 + */ + public boolean hasAnyPermissions(String permissions, String delimeter) + { + Subject subject = SecurityUtils.getSubject(); + + if (subject != null) + { + if (delimeter == null || delimeter.length() == 0) + { + delimeter = PERMISSION_DELIMETER; + } + + for (String permission : permissions.split(delimeter)) + { + if (permission != null && subject.isPermitted(permission.trim()) == true) + { + return true; + } + } + } + + return false; + } + + /** + * 判断用户是否拥有某个角色 + * + * @param role 角色字符串 + * @return 用户是否具备某角色 + */ + public boolean isRole(String role) + { + return SecurityUtils.getSubject().hasRole(role); + } + + /** + * 验证用户是否不具备某角色,与 isRole逻辑相反。 + * + * @param role 角色名称 + * @return 用户是否不具备某角色 + */ + public boolean isLacksRole(String role) + { + return isRole(role) != true; + } + + /** + * 验证用户是否具有以下任意一个角色。 + * + * @param roles 以 ROLE_NAMES_DELIMETER 为分隔符的角色列表 + * @return 用户是否具有以下任意一个角色 + */ + public boolean isAnyRoles(String roles) + { + return isAnyRoles(roles, ROLE_DELIMETER); + } + + /** + * 验证用户是否具有以下任意一个角色。 + * + * @param roles 以 delimeter 为分隔符的角色列表 + * @param delimeter 角色列表分隔符 + * @return 用户是否具有以下任意一个角色 + */ + public boolean isAnyRoles(String roles, String delimeter) + { + Subject subject = SecurityUtils.getSubject(); + if (subject != null) + { + if (delimeter == null || delimeter.length() == 0) + { + delimeter = ROLE_DELIMETER; + } + + for (String role : roles.split(delimeter)) + { + if (subject.hasRole(role.trim()) == true) + { + return true; + } + } + } + + return false; + } + + /** + * 返回用户属性值 + * + * @param property 属性名称 + * @return 用户属性值 + */ + public Object getPrincipalProperty(String property) + { + Subject subject = SecurityUtils.getSubject(); + if (subject != null) + { + Object principal = subject.getPrincipal(); + try + { + BeanInfo bi = Introspector.getBeanInfo(principal.getClass()); + for (PropertyDescriptor pd : bi.getPropertyDescriptors()) + { + if (pd.getName().equals(property) == true) + { + return pd.getReadMethod().invoke(principal, (Object[]) null); + } + } + } + catch (Exception e) + { + log.error("Error reading property [{}] from principal of type [{}]", property, principal.getClass().getName()); + } + } + return null; + } } diff --git a/src/main/java/com/huaheng/framework/web/service/WebSocketServer.java b/src/main/java/com/huaheng/framework/web/service/WebSocketServer.java index d40d244..9b378f3 100644 --- a/src/main/java/com/huaheng/framework/web/service/WebSocketServer.java +++ b/src/main/java/com/huaheng/framework/web/service/WebSocketServer.java @@ -2,9 +2,12 @@ package com.huaheng.framework.web.service; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang.StringUtils; +import com.huaheng.pc.system.notice.service.SysNoticeService; +import lombok.extern.slf4j.Slf4j; +import com.huaheng.common.utils.StringUtils; import org.springframework.stereotype.Component; +import javax.annotation.Resource; import javax.websocket.*; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; @@ -18,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; */ @ServerEndpoint("/imserver/{userId}") @Component +@Slf4j public class WebSocketServer { /**静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。*/ @@ -29,6 +33,9 @@ public class WebSocketServer { /**接收userId*/ private String userId=""; + @Resource + private SysNoticeService noticeService; + /** * 连接建立成功调用的方法*/ @OnOpen @@ -118,12 +125,26 @@ public class WebSocketServer { * 发送自定义消息 * */ public static void sendInfo(String message,@PathParam("userId") String userId) throws IOException { - System.out.println("发送消息到:"+userId+",报文:"+message); - if(StringUtils.isNotBlank(userId)&&webSocketMap.containsKey(userId)){ - webSocketMap.get(userId).sendMessage(message); - }else{ - System.out.println("发送消息到:"+userId+",报文:"+message); + + if(webSocketMap.isEmpty()){ + log.error("没有窗口号!!!!!!!!!"); + return; } + webSocketMap.forEach((k,v)->{ + try { + //这里可以设定只推送给这个winNum的,为null则全部推送 + if(StringUtils.isEmpty(userId)) { + v.sendMessage(message); + log.info("推送消息到窗口:{},推送内容: {}",message); + }else if(k.equals(userId)){ + log.info("推送消息到窗口:{},推送内容: {}",userId,message); + v.sendMessage(message); + } + } catch (IOException e) { + e.printStackTrace(); + log.info("找不到指定的 WebSocket 客户端:{}",userId); + } + }); } public static synchronized int getOnlineCount() { diff --git a/src/main/java/com/huaheng/pc/common/CommonController.java b/src/main/java/com/huaheng/pc/common/CommonController.java index 23b72d0..284c189 100644 --- a/src/main/java/com/huaheng/pc/common/CommonController.java +++ b/src/main/java/com/huaheng/pc/common/CommonController.java @@ -16,6 +16,7 @@ import com.huaheng.common.config.Global; import com.huaheng.common.config.ServerConfig; import com.huaheng.common.utils.QRCodeGenerator; import com.huaheng.common.utils.file.FileUploadUtils; +import com.huaheng.framework.config.HuaHengConfig; import com.huaheng.framework.web.domain.AjaxResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -120,7 +121,7 @@ public class CommonController try { // 上传文件路径 - String filePath = "D:/Huaheng/uploadPath/"; + String filePath = HuaHengConfig.getProfile(); // 上传并返回新文件名称 String fileName = FileUploadUtils.upload(filePath, file); String url = serverConfig.getUrl() + "/" + fileName; diff --git a/src/main/java/com/huaheng/pc/common/TestController.java b/src/main/java/com/huaheng/pc/common/TestController.java new file mode 100644 index 0000000..7630433 --- /dev/null +++ b/src/main/java/com/huaheng/pc/common/TestController.java @@ -0,0 +1,23 @@ +package com.huaheng.pc.common; + +import com.huaheng.common.constant.SendTypeConstants; +import com.huaheng.common.utils.SendNoticeUtils; +import com.huaheng.framework.web.controller.BaseController; +import com.huaheng.framework.web.domain.AjaxResult; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Controller +@RestController +@RequestMapping("/test") +public class TestController extends BaseController { + + + @GetMapping("/send") + public AjaxResult sendMessage(String subject, String body, Integer type, String[] to, String[] cc){ + SendNoticeUtils.sendNotice(subject, body, type, to, cc); + return AjaxResult.success(); + } +} diff --git a/src/main/java/com/huaheng/pc/config/materialWarnning/domain/MaterialWarning.java b/src/main/java/com/huaheng/pc/config/materialWarnning/domain/MaterialWarning.java index 825ff38..c7f4f66 100644 --- a/src/main/java/com/huaheng/pc/config/materialWarnning/domain/MaterialWarning.java +++ b/src/main/java/com/huaheng/pc/config/materialWarnning/domain/MaterialWarning.java @@ -75,7 +75,7 @@ public class MaterialWarning implements Serializable{ private String lastUpdatedBy; /** - */ @TableField(value = "userId") - private Long userId; + private String userId; /** - */ @TableField(value = "userName") private String userName; diff --git a/src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java b/src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java index 6b70627..502fddb 100644 --- a/src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java +++ b/src/main/java/com/huaheng/pc/config/materialWarnning/service/impl/MaterialWarningServiceImpl.java @@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huaheng.common.constant.QuantityConstant; +import com.huaheng.common.constant.SendTypeConstants; import com.huaheng.common.support.Convert; +import com.huaheng.common.utils.SendNoticeUtils; import com.huaheng.common.utils.StringUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.config.material.domain.Material; @@ -68,16 +70,18 @@ public class MaterialWarningServiceImpl extends ServiceImpl<MaterialWarningMappe .eq("companyCode", companyCode); Map<String, Object> map = inventoryDetailService.getMap(detailQueryWrapper); BigDecimal total = new BigDecimal(String.valueOf(map.get("total"))); + String body = ""; if (materialWarning.getMin().compareTo(total) > 0) { /* 发送预警*/ - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于最小值"); - } else if (materialWarning.getLower().compareTo(total) > 0) { - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于下限预警值"); + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于最小值"; + } else if (materialWarning.getLower().compareTo(total) > 0) { + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已低于下限预警值"; } else if (materialWarning.getMax().compareTo(total) < 0) { - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于最大值"); + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于最大值"; } else if (materialWarning.getUpper().compareTo(total) < 0) { - System.out.println("编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于上限预警值"); + body = "编码:"+materialCode+";名称:"+materialWarning.getMaterialName()+"库存已高于上限预警值"; } + SendNoticeUtils.sendNotice("", body, SendTypeConstants.WEBSOCKET_USER, Convert.toStrArray(materialWarning.getUserId()),null); } } } diff --git a/src/main/java/com/huaheng/pc/manager/apkinfo/controller/ApkinfoController.java b/src/main/java/com/huaheng/pc/manager/apkinfo/controller/ApkinfoController.java new file mode 100644 index 0000000..458a76e --- /dev/null +++ b/src/main/java/com/huaheng/pc/manager/apkinfo/controller/ApkinfoController.java @@ -0,0 +1,144 @@ +package com.huaheng.pc.manager.apkinfo.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huaheng.common.utils.file.FileUploadUtils; +import com.huaheng.framework.config.HuaHengConfig; +import com.huaheng.framework.web.page.PageDomain; +import com.huaheng.framework.web.page.TableDataInfo; +import com.huaheng.framework.web.page.TableSupport; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.pc.system.user.domain.User; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; +import com.huaheng.framework.aspectj.lang.annotation.Log; +import com.huaheng.framework.aspectj.lang.constant.BusinessType; +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo; +import com.huaheng.pc.manager.apkinfo.service.IApkinfoService; +import com.huaheng.framework.web.controller.BaseController; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.common.support.Convert; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * 【请填写功能名称】 信息操作处理 + * + * @author huaheng + * @date 2020-07-23 + */ +@Controller +@RequestMapping("/manager/apkinfo") +public class ApkinfoController extends BaseController { + private String prefix = "manager/apkinfo"; + + @Resource + private IApkinfoService apkinfoService; + + @GetMapping() + public String apkinfo() { + return prefix + "/list"; + } + + /** + * 查询【请填写功能名称】列表 + */ + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(Apkinfo apkinfo) { + LambdaQueryWrapper<Apkinfo> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.like(StringUtils.isNotEmpty(apkinfo.getPkgName()), Apkinfo::getPkgName, apkinfo.getPkgName()) + .eq(StringUtils.isNotNull(apkinfo.getVersionCode()), Apkinfo::getVersionCode, apkinfo.getVersionCode()) + .like(StringUtils.isNotEmpty(apkinfo.getVersionName()), Apkinfo::getVersionName, apkinfo.getVersionName()) + .eq(StringUtils.isNotEmpty(apkinfo.getUrl()), Apkinfo::getUrl, apkinfo.getUrl()) + .eq(StringUtils.isNotEmpty(apkinfo.getMd5()), Apkinfo::getMd5, apkinfo.getMd5()) + ; + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ + /*使用分页查询*/ + Page<Apkinfo> page = new Page<>(pageNum, pageSize); + IPage<Apkinfo> iPage = apkinfoService.page(page, lambdaQueryWrapper); + return getMpDataTable(iPage.getRecords(), iPage.getTotal()); + } else { + List<Apkinfo> list = apkinfoService.list(lambdaQueryWrapper); + return getDataTable(list); + } + } + + /** + * 新增【请填写功能名称】 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + /** + * 新增保存入库单 + */ + @Log(title = "新增应用信息", action = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(Apkinfo apkinfo) { + return toAjax(apkinfoService.save(apkinfo)); + } + + /** + * 修改【请填写功能名称】 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) { + Apkinfo apkinfo = apkinfoService.getById(id); + mmap.put("apkinfo", apkinfo); + return prefix + "/edit"; + } + + + @Log(title = "【请填写功能名称】", action = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(Apkinfo apkinfo) { + return toAjax(apkinfoService.updateById(apkinfo)); + } + + @Log(title = "【请填写功能名称】", action = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) { + if (StringUtils.isEmpty(ids)){ + return AjaxResult.error("id不能为空"); + } + return toAjax(apkinfoService.removeByIds(Arrays.asList(Convert.toIntArray(ids)))); + } + + + @Log(title = "系统管理-用户管理", operating = "保存头像", action = BusinessType.UPDATE) + @PostMapping("/updateApk") + @ResponseBody + public AjaxResult updateApk(@RequestParam("avatarfile") MultipartFile file) + { + try + { + if (!file.isEmpty()) + { + String apk = FileUploadUtils.upload(HuaHengConfig.getApkpath(), file, ""); + } + return success("上传成功"); + } + catch (Exception e) + { + return error(e.getMessage()); + } + } +} diff --git a/src/main/java/com/huaheng/pc/manager/apkinfo/domain/Apkinfo.java b/src/main/java/com/huaheng/pc/manager/apkinfo/domain/Apkinfo.java new file mode 100644 index 0000000..edaab68 --- /dev/null +++ b/src/main/java/com/huaheng/pc/manager/apkinfo/domain/Apkinfo.java @@ -0,0 +1,46 @@ +package com.huaheng.pc.manager.apkinfo.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 【请填写功能名称】表 apkinfo + * + * @author huaheng + * @date 2020-07-23 + */ +@Data +@TableName(value = "apkinfo") +public class Apkinfo implements Serializable{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + /** $column.columnComment */ + @TableField(value = "pkgName") + private String pkgName; + /** $column.columnComment */ + @TableField(value = "versionCode") + private Long versionCode; + /** $column.columnComment */ + @TableField(value = "versionName") + private String versionName; + /** $column.columnComment */ + @TableField(value = "url") + private String url; + /** $column.columnComment */ + @TableField(value = "md5") + private String md5; + +} diff --git a/src/main/java/com/huaheng/pc/manager/apkinfo/mapper/ApkinfoMapper.java b/src/main/java/com/huaheng/pc/manager/apkinfo/mapper/ApkinfoMapper.java new file mode 100644 index 0000000..94e10a2 --- /dev/null +++ b/src/main/java/com/huaheng/pc/manager/apkinfo/mapper/ApkinfoMapper.java @@ -0,0 +1,16 @@ +package com.huaheng.pc.manager.apkinfo.mapper; + +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import java.util.List; + +/** + * 【请填写功能名称】 数据层 + * + * @author huaheng + * @date 2020-07-23 + */ +public interface ApkinfoMapper extends BaseMapper<Apkinfo> { + +} + diff --git a/src/main/java/com/huaheng/pc/manager/apkinfo/service/IApkinfoService.java b/src/main/java/com/huaheng/pc/manager/apkinfo/service/IApkinfoService.java new file mode 100644 index 0000000..73e117c --- /dev/null +++ b/src/main/java/com/huaheng/pc/manager/apkinfo/service/IApkinfoService.java @@ -0,0 +1,17 @@ +package com.huaheng.pc.manager.apkinfo.service; + +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * 【请填写功能名称】 服务层 + * + * @author huaheng + * @date 2020-07-23 + */ +public interface IApkinfoService extends IService<Apkinfo> { + +} + + diff --git a/src/main/java/com/huaheng/pc/manager/apkinfo/service/impl/ApkinfoServiceImpl.java b/src/main/java/com/huaheng/pc/manager/apkinfo/service/impl/ApkinfoServiceImpl.java new file mode 100644 index 0000000..35901b6 --- /dev/null +++ b/src/main/java/com/huaheng/pc/manager/apkinfo/service/impl/ApkinfoServiceImpl.java @@ -0,0 +1,19 @@ +package com.huaheng.pc.manager.apkinfo.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.pc.manager.apkinfo.service.IApkinfoService; +import com.huaheng.pc.manager.apkinfo.domain.Apkinfo; +import com.huaheng.pc.manager.apkinfo.mapper.ApkinfoMapper; +import org.springframework.stereotype.Service; + + +/** + * 【请填写功能名称】 服务层实现 + * + * @author huaheng + * @date 2020-07-23 + */ +@Service +public class ApkinfoServiceImpl extends ServiceImpl<ApkinfoMapper, Apkinfo> implements IApkinfoService { + +} diff --git a/src/main/java/com/huaheng/pc/system/notice/controller/NoticeController.java b/src/main/java/com/huaheng/pc/system/notice/controller/NoticeController.java deleted file mode 100644 index cd4f3e5..0000000 --- a/src/main/java/com/huaheng/pc/system/notice/controller/NoticeController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.huaheng.pc.system.notice.controller; - -import java.util.List; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.huaheng.framework.aspectj.lang.annotation.Log; -import com.huaheng.framework.aspectj.lang.constant.BusinessType; -import com.huaheng.framework.web.controller.BaseController; -import com.huaheng.framework.web.domain.AjaxResult; -import com.huaheng.framework.web.page.TableDataInfo; -import com.huaheng.pc.system.notice.domain.Notice; -import com.huaheng.pc.system.notice.service.INoticeService; - -/** - * 公告 信息操作处理 - * - * @author huaheng - */ -@Controller -@RequestMapping("/system/notice") -public class NoticeController extends BaseController -{ - private String prefix = "system/notice"; - - @Autowired - private INoticeService noticeService; - - @RequiresPermissions("system:notice:view") - @GetMapping() - public String notice() - { - return prefix + "/notice"; - } - - /** - * 查询公告列表 - */ - @RequiresPermissions("system:notice:list") - @Log(title = "系统管理-通知公告", operating = "查询公告列表", action = BusinessType.GRANT) - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(Notice notice) - { - startPage(); - List<Notice> list = noticeService.selectNoticeList(notice); - return getDataTable(list); - } - - /** - * 新增公告 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/add"; - } - - /** - * 新增保存公告 - */ - @RequiresPermissions("system:notice:add") - @Log(title = "系统管理-通知公告", operating = "新增公告", action = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(Notice notice) - { - return toAjax(noticeService.insertNotice(notice)); - } - - /** - * 修改公告 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - mmap.put("notice", noticeService.selectNoticeById(id)); - return prefix + "/edit"; - } - - /** - * 修改保存公告 - */ - @RequiresPermissions("system:notice:edit") - @Log(title = "系统管理-通知公告", operating = "修改公告", action = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(Notice notice) - { - return toAjax(noticeService.updateNotice(notice)); - } - - /** - * 删除公告 - */ - @RequiresPermissions("system:notice:remove") - @Log(title = "系统管理-通知公告", operating = "删除公告", action = BusinessType.DELETE) - @PostMapping("/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(noticeService.deleteNoticeByIds(ids)); - } - -} diff --git a/src/main/java/com/huaheng/pc/system/notice/domain/Notice.java b/src/main/java/com/huaheng/pc/system/notice/domain/Notice.java deleted file mode 100644 index f0719d5..0000000 --- a/src/main/java/com/huaheng/pc/system/notice/domain/Notice.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.huaheng.pc.system.notice.domain; - -import com.baomidou.mybatisplus.annotation.*; -import com.fasterxml.jackson.annotation.JsonFormat; -import com.google.common.collect.Maps; -import lombok.Data; - -import java.util.Date; -import java.util.Map; - -/** - * 公告表 sys_notice - * - * @author huaheng - */ -@Data -@TableName(value = "sys_notice") -public class Notice { - - /** 公告ID */ - @TableId(value = "id",type = IdType.ID_WORKER) - private Integer id; - /** 公告标题 */ - @TableField(value = "noticeTitle") - private String noticeTitle; - /** 公告类型(1通知 2公告) */ - @TableField(value = "noticeType") - private String noticeType; - /** 公告内容 */ - @TableField(value = "noticeContent") - private String noticeContent; - /** 公告状态(0正常 1关闭) */ - @TableField(value = "status") - private String status; - /** 搜索值 */ - @TableField(value = "searchValue") - private String searchValue; - /** 创建者 */ - @TableField(value = "createBy") - private String createBy; - /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @TableField(value = "createTime") - private Date createTime; - /** 更新者 */ - @TableField(value = "updateBy") - private String updateBy; - /** 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @TableField(value = "updateTime") - private Date updateTime; - /** 备注 */ -// @TableField(exist=false) - @TableField(value = "remark") - private String remark; - /** 请求参数 */ - private Map<String, Object> params; - -} diff --git a/src/main/java/com/huaheng/pc/system/notice/domain/SysNotice.java b/src/main/java/com/huaheng/pc/system/notice/domain/SysNotice.java new file mode 100644 index 0000000..5858617 --- /dev/null +++ b/src/main/java/com/huaheng/pc/system/notice/domain/SysNotice.java @@ -0,0 +1,92 @@ +package com.huaheng.pc.system.notice.domain; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Date; +import lombok.Data; + +/** + * 通知公告表 + */ +@ApiModel(value="com-huaheng-pc-system-notice-domain-SysNotice") +@Data +@TableName(value = "sys_notice") +public class SysNotice { + /** + * ID + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value="ID") + private Integer id; + + /** + * 标题 + */ + @TableField(value = "title") + @ApiModelProperty(value="标题") + private String title; + + /** + * 类型 + */ + @TableField(value = "type") + @ApiModelProperty(value="类型") + private String type; + + /** + * 用户id + */ + @TableField(value = "userId") + @ApiModelProperty(value="用户id") + private String userId; + + /** + * 用户姓名 + */ + @TableField(value = "userName") + @ApiModelProperty(value="用户姓名") + private String userName; + + /** + * 内容 + */ + @TableField(value = "content") + @ApiModelProperty(value="内容") + private String content; + + /** + * 状态(0未读 1已读) + */ + @TableField(value = "status") + @ApiModelProperty(value="状态(0未读 1已读)") + private String status; + + /** + * 创建者 + */ + @TableField(value = "createdBy", fill = FieldFill.INSERT) + @ApiModelProperty(value="创建者") + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "created", fill = FieldFill.INSERT) + @ApiModelProperty(value="创建时间") + private Date created; + + /** + * 备注 + */ + @TableField(value = "remark") + @ApiModelProperty(value="备注") + private String remark; + + /** + * 接收地址 + */ + @TableField(value = "url") + @ApiModelProperty(value="接收地址") + private String url; +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/system/notice/mapper/NoticeMapper.java b/src/main/java/com/huaheng/pc/system/notice/mapper/NoticeMapper.java deleted file mode 100644 index d987c79..0000000 --- a/src/main/java/com/huaheng/pc/system/notice/mapper/NoticeMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huaheng.pc.system.notice.mapper; - -import com.huaheng.pc.system.notice.domain.Notice; -import java.util.List; - -/** - * 公告 数据层 - * - * @author huaheng - */ -public interface NoticeMapper -{ - /** - * 查询公告信息 - * - * @param id 公告ID - * @return 公告信息 - */ - public Notice selectNoticeById(Integer id); - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - public List<Notice> selectNoticeList(Notice notice); - - /** - * 新增公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int insertNotice(Notice notice); - - /** - * 修改公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int updateNotice(Notice notice); - - /** - * 批量删除公告 - * - * @param noticeIds 需要删除的数据ID - * @return 结果 - */ - public int deleteNoticeByIds(String[] noticeIds); - -} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/system/notice/mapper/SysNoticeMapper.java b/src/main/java/com/huaheng/pc/system/notice/mapper/SysNoticeMapper.java new file mode 100644 index 0000000..f4be6db --- /dev/null +++ b/src/main/java/com/huaheng/pc/system/notice/mapper/SysNoticeMapper.java @@ -0,0 +1,7 @@ +package com.huaheng.pc.system.notice.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.system.notice.domain.SysNotice; + +public interface SysNoticeMapper extends BaseMapper<SysNotice> { +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/system/notice/service/INoticeService.java b/src/main/java/com/huaheng/pc/system/notice/service/INoticeService.java deleted file mode 100644 index fd9e4a3..0000000 --- a/src/main/java/com/huaheng/pc/system/notice/service/INoticeService.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.huaheng.pc.system.notice.service; - -import com.huaheng.pc.system.notice.domain.Notice; -import java.util.List; - -/** - * 公告 服务层 - * - * @author huaheng - */ -public interface INoticeService -{ - /** - * 查询公告信息 - * - * @param id 公告ID - * @return 公告信息 - */ - public Notice selectNoticeById(Integer id); - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - public List<Notice> selectNoticeList(Notice notice); - - /** - * 新增公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int insertNotice(Notice notice); - - /** - * 修改公告 - * - * @param notice 公告信息 - * @return 结果 - */ - public int updateNotice(Notice notice); - - /** - * 删除公告信息 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - public int deleteNoticeByIds(String ids); - -} diff --git a/src/main/java/com/huaheng/pc/system/notice/service/NoticeServiceImpl.java b/src/main/java/com/huaheng/pc/system/notice/service/NoticeServiceImpl.java deleted file mode 100644 index a12846a..0000000 --- a/src/main/java/com/huaheng/pc/system/notice/service/NoticeServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.huaheng.pc.system.notice.service; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.huaheng.common.utils.security.ShiroUtils; -import com.huaheng.pc.system.notice.mapper.NoticeMapper; -import com.huaheng.pc.system.notice.domain.Notice; -import com.huaheng.common.support.Convert; - -/** - * 公告 服务层实现 - * - * @author huaheng - * @date 2018-06-25 - */ -@Service -public class NoticeServiceImpl implements INoticeService -{ - @Autowired - private NoticeMapper noticeMapper; - - /** - * 查询公告信息 - * - * @param id 公告ID - * @return 公告信息 - */ - @Override - public Notice selectNoticeById(Integer id) - { - return noticeMapper.selectNoticeById(id); - } - - /** - * 查询公告列表 - * - * @param notice 公告信息 - * @return 公告集合 - */ - @Override - public List<Notice> selectNoticeList(Notice notice) - { - return noticeMapper.selectNoticeList(notice); - } - - /** - * 新增公告 - * - * @param notice 公告信息 - * @return 结果 - */ - @Override - public int insertNotice(Notice notice) - { - notice.setCreateBy(ShiroUtils.getLoginName()); - return noticeMapper.insertNotice(notice); - } - - /** - * 修改公告 - * - * @param notice 公告信息 - * @return 结果 - */ - @Override - public int updateNotice(Notice notice) - { - notice.setUpdateBy(ShiroUtils.getLoginName()); - return noticeMapper.updateNotice(notice); - } - - /** - * 删除公告对象 - * - * @param ids 需要删除的数据ID - * @return 结果 - */ - @Override - public int deleteNoticeByIds(String ids) - { - return noticeMapper.deleteNoticeByIds(Convert.toStrArray(ids)); - } - -} diff --git a/src/main/java/com/huaheng/pc/system/notice/service/SysNoticeService.java b/src/main/java/com/huaheng/pc/system/notice/service/SysNoticeService.java new file mode 100644 index 0000000..9b39875 --- /dev/null +++ b/src/main/java/com/huaheng/pc/system/notice/service/SysNoticeService.java @@ -0,0 +1,15 @@ +package com.huaheng.pc.system.notice.service; + +import com.huaheng.pc.system.notice.domain.SysNotice; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +public interface SysNoticeService extends IService<SysNotice>{ + + /** + * 获取我的通知 + * @param status 状态0未读1已读 + */ + List<SysNotice> getMyNotice(Integer status); +} diff --git a/src/main/java/com/huaheng/pc/system/notice/service/impl/SysNoticeServiceImpl.java b/src/main/java/com/huaheng/pc/system/notice/service/impl/SysNoticeServiceImpl.java new file mode 100644 index 0000000..4993c40 --- /dev/null +++ b/src/main/java/com/huaheng/pc/system/notice/service/impl/SysNoticeServiceImpl.java @@ -0,0 +1,30 @@ +package com.huaheng.pc.system.notice.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.pc.config.warehouse.domain.Warehouse; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.pc.system.notice.domain.SysNotice; +import com.huaheng.pc.system.notice.mapper.SysNoticeMapper; +import com.huaheng.pc.system.notice.service.SysNoticeService; +@Service +public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService{ + + /** + * 获取我的通知 + * @param status 状态0未读1已读 + */ + @Override + public List<SysNotice> getMyNotice(Integer status) { + LambdaQueryWrapper<SysNotice> queryWrapper = Wrappers.lambdaQuery(); + queryWrapper.eq(SysNotice::getUserId, ShiroUtils.getUserId()) + .or().isNull(SysNotice::getUserId) + .eq(StringUtils.isNotNull(status), SysNotice::getStatus, status); + return this.list(queryWrapper); + } +} diff --git a/src/main/java/com/huaheng/pc/system/user/controller/IndexController.java b/src/main/java/com/huaheng/pc/system/user/controller/IndexController.java index 47b2913..9736495 100644 --- a/src/main/java/com/huaheng/pc/system/user/controller/IndexController.java +++ b/src/main/java/com/huaheng/pc/system/user/controller/IndexController.java @@ -2,6 +2,7 @@ package com.huaheng.pc.system.user.controller; import java.util.*; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.github.abel533.echarts.Option; import com.github.abel533.echarts.axis.Axis; import com.github.abel533.echarts.axis.CategoryAxis; @@ -15,6 +16,8 @@ import com.huaheng.common.support.Convert; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.report.excelReport.mapper.ExcelReportMapper; +import com.huaheng.pc.system.notice.domain.SysNotice; +import com.huaheng.pc.system.notice.service.SysNoticeService; import com.huaheng.pc.system.user.domain.ChartData; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -42,6 +45,8 @@ public class IndexController extends BaseController @Autowired private HuaHengConfig huahengConfig; + @Resource + private SysNoticeService noticeService; @Resource ExcelReportMapper mapper; @@ -307,8 +312,7 @@ public class IndexController extends BaseController // 系统首页 @GetMapping("/index") - public String index(ModelMap mmap) - { + public String index(ModelMap mmap) { // 取身份信息 User user = getUser(); // 根据用户id取出菜单 @@ -317,6 +321,7 @@ public class IndexController extends BaseController System.out.println(menus); mmap.put("user", user); mmap.put("copyrightYear", huahengConfig.getCopyrightYear()); + mmap.put("notices", noticeService.getMyNotice(0)); return "index"; } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8b461f1..4e483c0 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,6 +12,8 @@ huaheng: copyrightYear: 2020 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) profile: D:/Huaheng/uploadPath/ + # apk路径 + apkpath: D:/download/ # 获取ip地址开关 addressEnabled: false diff --git a/src/main/resources/mybatis/manager/apkinfo/ApkinfoMapper.xml b/src/main/resources/mybatis/manager/apkinfo/ApkinfoMapper.xml new file mode 100644 index 0000000..ee3efdf --- /dev/null +++ b/src/main/resources/mybatis/manager/apkinfo/ApkinfoMapper.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.huaheng.pc.manager.apkinfo.mapper.ApkinfoMapper"> + + <resultMap type="com.huaheng.pc.manager.apkinfo.domain.Apkinfo" id="apkinfoResult"> + <result property="id" column="id" /> + <result property="pkgName" column="pkgName" /> + <result property="versionCode" column="versionCode" /> + <result property="versionName" column="versionName" /> + <result property="url" column="url" /> + <result property="md5" column="md5" /> + </resultMap> + <sql id="selectapkinfoVo"> + select id, pkgName, versionCode, versionName, url, md5 from apkinfo + </sql> + +</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/system/NoticeMapper.xml b/src/main/resources/mybatis/system/NoticeMapper.xml deleted file mode 100644 index 2437a7e..0000000 --- a/src/main/resources/mybatis/system/NoticeMapper.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE mapper -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.huaheng.pc.system.notice.mapper.NoticeMapper"> - - <resultMap type="com.huaheng.pc.system.notice.domain.Notice" id="NoticeResult"> - <result property="id" column="id" /> - <result property="noticeTitle" column="noticeTitle" /> - <result property="noticeType" column="noticeType" /> - <result property="noticeContent" column="noticeContent" /> - <result property="status" column="status" /> - <result property="createBy" column="createBy" /> - <result property="createTime" column="createTime" /> - <result property="updateBy" column="updateBy" /> - <result property="updateTime" column="updateTime" /> - <result property="remark" column="remark" /> - </resultMap> - - <sql id="selectNoticeVo"> - select id, noticeTitle, noticeType, noticeContent, status, createBy, createTime, updateBy, updateTime, remark from sys_notice - </sql> - - <select id="selectNoticeById" parameterType="Integer" resultMap="NoticeResult"> - <include refid="selectNoticeVo"/> - where id = #{id} - </select> - - <select id="selectNoticeList" parameterType="com.huaheng.pc.system.notice.domain.Notice" resultMap="NoticeResult"> - <include refid="selectNoticeVo"/> - <where> - <if test="noticeTitle != null and noticeTitle != ''"> - AND noticeTitle like concat('%', #{noticeTitle}, '%') - </if> - <if test="noticeType != null and noticeType != ''"> - AND noticeType = #{noticeType} - </if> - <if test="createBy != null and createBy != ''"> - AND createBy like concat('%', #{createBy}, '%') - </if> - </where> - </select> - - <insert id="insertNotice" parameterType="com.huaheng.pc.system.notice.domain.Notice"> - insert into sys_notice ( - <if test="noticeTitle != null and noticeTitle != '' ">noticeTitle, </if> - <if test="noticeType != null and noticeType != '' ">noticeType, </if> - <if test="noticeContent != null and noticeContent != '' ">noticeContent, </if> - <if test="status != null and status != '' ">status, </if> - <if test="remark != null and remark != ''">remark,</if> - <if test="createBy != null and createBy != ''">createBy,</if> - createTime - )values( - <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if> - <if test="noticeType != null and noticeType != ''">#{noticeType}, </if> - <if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if> - <if test="status != null and status != ''">#{status}, </if> - <if test="remark != null and remark != ''">#{remark},</if> - <if test="createBy != null and createBy != ''">#{createBy},</if> - sysdate() - ) - </insert> - - <update id="updateNotice" parameterType="com.huaheng.pc.system.notice.domain.Notice"> - update sys_notice - <set> - <if test="noticeTitle != null and noticeTitle != ''">noticeTitle = #{noticeTitle}, </if> - <if test="noticeType != null and noticeType != ''">noticeType = #{noticeType}, </if> - <if test="noticeContent != null and noticeContent != ''">noticeContent = #{noticeContent}, </if> - <if test="status != null and status != ''">status = #{status}, </if> - <if test="updateBy != null and updateBy != ''">updateBy = #{updateBy},</if> - updateTime = sysdate() - </set> - where id = #{id} - </update> - - <delete id="deleteNoticeByIds" parameterType="String"> - delete from sys_notice where id in - <foreach item="id" collection="array" open="(" separator="," close=")"> - #{id} - </foreach> - </delete> - -</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/system/SysNoticeMapper.xml b/src/main/resources/mybatis/system/SysNoticeMapper.xml new file mode 100644 index 0000000..21ace13 --- /dev/null +++ b/src/main/resources/mybatis/system/SysNoticeMapper.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.huaheng.pc.system.notice.mapper.SysNoticeMapper"> + <resultMap id="BaseResultMap" type="com.huaheng.pc.system.notice.domain.SysNotice"> + <!--@mbg.generated--> + <!--@Table sys_notice--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="title" jdbcType="VARCHAR" property="title" /> + <result column="type" jdbcType="CHAR" property="type" /> + <result column="userId" jdbcType="BIGINT" property="userId" /> + <result column="userName" jdbcType="VARCHAR" property="userName" /> + <result column="content" jdbcType="VARCHAR" property="content" /> + <result column="status" jdbcType="CHAR" property="status" /> + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> + <result column="created" jdbcType="TIMESTAMP" property="created" /> + <result column="remark" jdbcType="VARCHAR" property="remark" /> + <result column="url" jdbcType="VARCHAR" property="url" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, title, `type`, userId, userName, content, `status`, createdBy, created, remark, + url + </sql> +</mapper> \ No newline at end of file diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 6069f71..c657e59 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -1317,7 +1317,8 @@ button.dim:active:before { .media-body { display: block; width: auto; - height:60px; overflow:hidden;position: relative;top: -8px;padding-left: 20px;/*border-bottom: 1px dotted #e5e5e5;*/ + padding: 0 5px; + height:60px; overflow:hidden;position: relative;top: -8px;border-bottom: 1px dotted #e5e5e5; } .chat-element>.pull-left { @@ -7462,3 +7463,63 @@ body.skin-yellow { background: #FFFFFF url(../img/up.png) no-repeat 20px; margin:0 auto; } + +.input_list li input { + border: 1px solid #ddd; + border-radius: 4px; + background: transparent; + outline: none; + height: 30px; + width: 200px; + padding-left: 5px; +} +.input_list li select { + border: 1px solid #ddd; + border-radius: 4px; + background: transparent; + outline: none; + height: 30px; + width: 200px; +} + +.wms-field-title{ + margin: 10px 0 20px; + border: none; + border-top: 1px solid #e2e2e2; +} + +.wms-field-title legend { + margin-left: 20px; + padding: 0 10px; + font-size: 16px; + font-weight: 300; +} +.input_list ul{ + width:100%; + padding: 5px 0; +} +.input_list li{ + width:25%; + padding: 3px 0; + display:inline-flex; +} +.input_list li label{ + width:120px; + text-align: right; + margin: 5px 0px 0px 0px; +} +.input_list li .onoffswitch label{ + text-align: left; +} +.div1 img:hover{ + cursor: pointer; +} + +@media (max-width:1200px) { + .input_list li{ + width:45%;} +} +@media (max-width:768px) { + .input_list li{ + width:100%;} +} \ No newline at end of file diff --git a/src/main/resources/static/huaheng/index.js b/src/main/resources/static/huaheng/index.js index 182f1d5..629f216 100644 --- a/src/main/resources/static/huaheng/index.js +++ b/src/main/resources/static/huaheng/index.js @@ -1,12 +1,12 @@ /** * 菜单处理 */ -$(function() { +$(function () { // MetsiMenu $('#side-menu').metisMenu(); //固定菜单栏 - $(function() { + $(function () { $('.sidebar-collapse').slimScroll({ height: '100%', railOpacity: 0.9, @@ -15,17 +15,17 @@ $(function() { }); // 菜单切换 - $('.navbar-minimalize').click(function() { + $('.navbar-minimalize').click(function () { $("body").toggleClass("mini-navbar"); SmoothlyMenu(); }); - $('#side-menu>li').click(function() { + $('#side-menu>li').click(function () { if ($('body').hasClass('mini-navbar')) { NavToggle(); } }); - $('#side-menu>li li a').click(function() { + $('#side-menu>li li a').click(function () { if ($(window).width() < 769) { NavToggle(); } @@ -41,12 +41,12 @@ $(function() { }); $(window).bind("load resize", -function() { - if ($(this).width() < 769) { - $('body').addClass('mini-navbar'); - $('.navbar-static-side').fadeIn(); - } -}); + function () { + if ($(this).width() < 769) { + $('body').addClass('mini-navbar'); + $('.navbar-static-side').fadeIn(); + } + }); function NavToggle() { $('.navbar-minimalize').trigger('click'); @@ -55,16 +55,16 @@ function NavToggle() { function SmoothlyMenu() { if (!$('body').hasClass('mini-navbar')) { $('#side-menu').hide(); - setTimeout(function() { - $('#side-menu').fadeIn(500); - }, - 100); + setTimeout(function () { + $('#side-menu').fadeIn(500); + }, + 100); } else if ($('body').hasClass('fixed-sidebar')) { $('#side-menu').hide(); - setTimeout(function() { - $('#side-menu').fadeIn(500); - }, - 300); + setTimeout(function () { + $('#side-menu').fadeIn(500); + }, + 300); } else { $('#side-menu').removeAttr('style'); } @@ -73,11 +73,11 @@ function SmoothlyMenu() { /** * iframe处理 */ -$(function() { +$(function () { //计算元素集合的总宽度 function calSumWidth(elements) { var width = 0; - $(elements).each(function() { + $(elements).each(function () { width += $(this).outerWidth(true); }); return width; @@ -86,7 +86,7 @@ $(function() { //滚动到指定选项卡 function scrollToTab(element) { var marginLeftVal = calSumWidth($(element).prevAll()), - marginRightVal = calSumWidth($(element).nextAll()); + marginRightVal = calSumWidth($(element).nextAll()); // 可视区域非tab宽度 var tabOuterWidth = calSumWidth($(".content-tabs").children().not(".menuTabs")); //可视区域tab宽度 @@ -108,9 +108,9 @@ $(function() { scrollVal = marginLeftVal - $(element).prev().outerWidth(true); } $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, - "fast"); + marginLeft: 0 - scrollVal + 'px' + }, + "fast"); } //查看左侧隐藏的选项卡 @@ -141,9 +141,9 @@ $(function() { } } $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, - "fast"); + marginLeft: 0 - scrollVal + 'px' + }, + "fast"); } //查看右侧隐藏的选项卡 @@ -172,15 +172,15 @@ $(function() { scrollVal = calSumWidth($(tabElement).prevAll()); if (scrollVal > 0) { $('.page-tabs-content').animate({ - marginLeft: 0 - scrollVal + 'px' - }, - "fast"); + marginLeft: 0 - scrollVal + 'px' + }, + "fast"); } } } //通过遍历给菜单项加上data-index属性 - $(".menuItem").each(function(index) { + $(".menuItem").each(function (index) { if (!$(this).attr('data-index')) { $(this).attr('data-index', index); } @@ -189,19 +189,19 @@ $(function() { function menuItem() { // 获取标识数据 var dataUrl = $(this).attr('href'), - dataIndex = $(this).data('index'), - menuName = $.trim($(this).text()), - flag = true; + dataIndex = $(this).data('index'), + menuName = $.trim($(this).text()), + flag = true; if (dataUrl == undefined || $.trim(dataUrl).length == 0) return false; // 选项卡菜单已存在 - $('.menuTab').each(function() { + $('.menuTab').each(function () { if ($(this).data('id') == dataUrl) { if (!$(this).hasClass('active')) { $(this).addClass('active').siblings('.menuTab').removeClass('active'); scrollToTab(this); // 显示tab对应的内容区 - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == dataUrl) { $(this).show().siblings('.huaheng_iframe').hide(); return false; @@ -220,13 +220,13 @@ $(function() { // 添加选项卡对应的iframe var str1 = '<iframe class="huaheng_iframe" name="iframe' + dataIndex + '" width="100%" height="100%" src="' + dataUrl + '" frameborder="0" data-id="' + dataUrl + '" seamless></iframe>'; $('.mainContent').find('iframe.huaheng_iframe').hide().parents('.mainContent').append(str1); - + $.modal.loading("数据加载中,请稍后..."); - + $('.mainContent iframe:visible').load(function () { - $.modal.closeLoading(); + $.modal.closeLoading(); }); - + // 添加选项卡 $('.menuTabs .page-tabs-content').append(str); scrollToTab($('.menuTab.active')); @@ -250,7 +250,7 @@ $(function() { var activeId = $(this).parents('.menuTab').next('.menuTab:eq(0)').data('id'); $(this).parents('.menuTab').next('.menuTab:eq(0)').addClass('active'); - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == activeId) { $(this).show().siblings('.huaheng_iframe').hide(); return false; @@ -260,16 +260,16 @@ $(function() { var marginLeftVal = parseInt($('.page-tabs-content').css('margin-left')); if (marginLeftVal < 0) { $('.page-tabs-content').animate({ - marginLeft: (marginLeftVal + currentWidth) + 'px' - }, - "fast"); + marginLeft: (marginLeftVal + currentWidth) + 'px' + }, + "fast"); } // 移除当前选项卡 $(this).parents('.menuTab').remove(); // 移除tab对应的内容区 - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == closeTabId) { $(this).remove(); return false; @@ -281,7 +281,7 @@ $(function() { if ($(this).parents('.menuTab').prev('.menuTab').size()) { var activeId = $(this).parents('.menuTab').prev('.menuTab:last').data('id'); $(this).parents('.menuTab').prev('.menuTab:last').addClass('active'); - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == activeId) { $(this).show().siblings('.huaheng_iframe').hide(); return false; @@ -292,7 +292,7 @@ $(function() { $(this).parents('.menuTab').remove(); // 移除tab对应的内容区 - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == closeTabId) { $(this).remove(); return false; @@ -306,7 +306,7 @@ $(function() { $(this).parents('.menuTab').remove(); // 移除相应tab对应的内容区 - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == closeTabId) { $(this).remove(); return false; @@ -321,18 +321,20 @@ $(function() { //关闭其他选项卡 function closeOtherTabs() { - $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function() { + $('.page-tabs-content').children("[data-id]").not(":first").not(".active").each(function () { $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').remove(); $(this).remove(); }); $('.page-tabs-content').css("margin-left", "0"); } + $('.tabCloseOther').on('click', closeOtherTabs); //滚动到已激活的选项卡 function showActiveTab() { scrollToTab($('.menuTab.active')); } + $('.tabShowActive').on('click', showActiveTab); // 点击选项卡菜单 @@ -340,7 +342,7 @@ $(function() { if (!$(this).hasClass('active')) { var currentId = $(this).data('id'); // 显示tab对应的内容区 - $('.mainContent .huaheng_iframe').each(function() { + $('.mainContent .huaheng_iframe').each(function () { if ($(this).data('id') == currentId) { $(this).show().siblings('.huaheng_iframe').hide(); return false; @@ -356,17 +358,17 @@ $(function() { //刷新iframe function refreshTab() { - var currentId = $('.page-tabs-content').find('.active').attr('data-id'); - var target = $('.huaheng_iframe[data-id="' + currentId + '"]'); + var currentId = $('.page-tabs-content').find('.active').attr('data-id'); + var target = $('.huaheng_iframe[data-id="' + currentId + '"]'); var url = target.attr('src'); target.attr('src', url).ready(); } - + // 全屏显示 $('#fullScreen').on('click', function () { - $('#wrapper').fullScreen(); + $('#wrapper').fullScreen(); }); - + // 刷新按钮 $('.tabReload').on('click', refreshTab); @@ -377,23 +379,22 @@ $(function() { // 右移按扭 $('.tabRight').on('click', scrollTabRight); - + // 关闭当前 $('.tabCloseCurrent').on('click', function () { $('.page-tabs-content').find('.active i').trigger("click"); }); // 关闭全部 - $('.tabCloseAll').on('click', function() { - $('.page-tabs-content').children("[data-id]").not(":first").each(function() { + $('.tabCloseAll').on('click', function () { + $('.page-tabs-content').children("[data-id]").not(":first").each(function () { $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').remove(); $(this).remove(); }); - $('.page-tabs-content').children("[data-id]:first").each(function() { + $('.page-tabs-content').children("[data-id]:first").each(function () { $('.huaheng_iframe[data-id="' + $(this).data('id') + '"]').show(); $(this).addClass("active"); }); $('.page-tabs-content').css("margin-left", "0"); }); - }); \ No newline at end of file diff --git a/src/main/resources/templates/config/receiptPreference/list.html b/src/main/resources/templates/config/receiptPreference/list.html index b386ac2..1290562 100644 --- a/src/main/resources/templates/config/receiptPreference/list.html +++ b/src/main/resources/templates/config/receiptPreference/list.html @@ -2,7 +2,10 @@ <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <meta charset="utf-8"> <head th:include="include :: header"> - + <style> + .layui-input-block, .layui-input-inline{position: relative;} + .layui-input-block{margin-left: 110px; min-height: 36px;} + </style> </head> <body class="gray-bg"> <div class="container-div"> @@ -12,11 +15,13 @@ <div class="box_all"> <div class="select-list box2"> <ul> + <!-- <li> <label>仓库:</label> <select name="warehousecode" id="warehouse" > </select> </li> + --> <li> <label>首选项代码:</label> <input type="text" name="code"/> @@ -25,10 +30,6 @@ <label>首选项名字:</label> <input type="text" name="name"/> </li> - <li> - <label>入库流程:</label> - <input type="text" name="receivingflow"/> - </li> <li class="time"> <label>创建时间:</label> <input type="text" class="time-input" id="startTime" placeholder="开始时间" @@ -38,6 +39,10 @@ name="endCreated"/> </li> + <!--<li> + <label>入库流程:</label> + <input type="text" name="receivingflow"/> + </li> <li> <label>自动生成托盘号:</label> <input type="text" name="autoassignlpn"/> @@ -144,143 +149,238 @@ <option value="0">否</option> <option value="-1">是</option> </select> - </li> + </li>--> - <p style=" float:right;text-align: right; padding:10px 50px 0 0"> + <p style=" float:right;text-align: right; padding:5px 50px 0 0"> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> </p> + <div class="div1" style="clear: both;width:16px;margin: auto"><img src="../img/down.png" onClick="test(this)"><!--this 指 img 对象 --> </div> </ul> - <!-- - <ul> - <li> - <label>仓库:</label> - <input type="text" name="warehousecode"/> - </li> - <li> - <label>首选项代码:</label> - <input type="text" name="code"/> - </li> - <li> - <label>首选项名字:</label> - <input type="text" name="name"/> - </li> - <li> - <label>入库流程:</label> - <input type="text" name="receivingflow"/> - </li> - <li> - <label>自动生成托盘号:</label> - <input type="text" name="autoassignlpn"/> - </li> - <li> - <label>允许超收:</label> - <select name="allowoverreceiving"> - <option value="">所有</option> - <option value="-1">代码生成请选择字典属性</option> - </select> - </li> - <li> - <label>允许超收范围:</label> - <input type="text" name="allowoverreceivingqty"/> - </li> - <li> - <label>自动定位:</label> - <input type="text" name="autolocate"/> - </li> - <li> - <label>RF显示未收数量:</label> - <input type="text" name="showopenqty"/> - </li> - <li> - <label>RF组车收货:</label> - <input type="text" name="groupputaway"/> - </li> - <li> - <label>人工组盘:</label> - <input type="text" name="manuallybuildlpn"/> - </li> - <li> - <label>定位规则:</label> - <input type="text" name="locationrule"/> - </li> - <li> - <label>空库位规则:</label> - <input type="text" name="emptylocrule"/> - </li> - <li> - <label>RF逐件收货:</label> - <input type="text" name="checkinbypiece"/> - </li> - <li> - <label>RF自动提交收货:</label> - <input type="text" name="piececonfirm"/> - </li> - <li> - <label>abc分类 0 否 1是:</label> - <input type="text" name="abcclass"/> - </li> - <li> - <label>保质期:</label> - <input type="text" name="daystoexpire"/> - </li> - <li> - <label>临期预警:</label> - <input type="text" name="expiringdays"/> - </li> - <li> - <label>收货预警(天):</label> - <input type="text" name="minshelflifedays"/> - </li> - <li> - <label>RF快速上架:</label> - <input type="text" name="allowquickputaway"/> - </li> - <li> - <label>属性模板:</label> - <input type="text" name="attributetemplatecode"/> - </li> - <li> - <label>快速入库:</label> - <input type="text" name="usequickcheckin"/> - </li> - <li class="select-time"> - <label>创建时间:</label> - <input type="text" class="time-input" id="startTime" placeholder="开始时间" - name="params[beginCreated]"/> - <span>-</span> - <input type="text" class="time-input" id="endTime" placeholder="结束时间" - name="params[endCreated]"/> - </li> - <li> - <label>创建用户:</label> - <input type="text" name="createdby"/> - </li> - <li class="select-time"> - <label>创建时间:</label> - <input type="text" class="time-input" id="startTime" placeholder="开始时间" - name="params[beginLastupdated]"/> - <span>-</span> - <input type="text" class="time-input" id="endTime" placeholder="结束时间" - name="params[endLastupdated]"/> - </li> - <li> - <label>更新用户:</label> - <input type="text" name="lastupdatedby"/> - </li> - <li> - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i - class="fa fa-search"></i> 搜索</a> - <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i - class="fa fa-refresh"></i> 重置</a> - </li> - </ul> - --> </div> + <!--下拉--> + <div class="clink_more" id="div2" style="display:none;"> + <!--分组--> + <div class="more_input"> + <div class="col-lg-12"> + <fieldset class="wms-field-title" style="margin-top: 20px;"> + <legend style="width:auto;padding: 0;margin-bottom: 10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">通用</legend> + </fieldset> + </div> + <div class="col-lg-12 input_list"> + <ul> + <li> + <label>入库流程:</label> + <select name="checkinbypiece"> + <option value="0">否</option> + <option value="-1">是</option> + </select> + </li> + </ul> + <ul> + <li> + <div class="col-lg-4"><label>自动生成托盘号:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="autoassignlpn" name="autoassignlpn" checked="checked"> + <label class="onoffswitch-label" for="autoassignlpn"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <label>托盘生成号:</label> + <input type="text" name="autoassignlpn" placeholder="on 就调出正则表达式" /> + </li> + </ul> + <ul> + <li> + <div class="col-lg-4"><label>允许超收:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="allowoverreceiving" name="allowoverreceiving" checked="checked"> + <label class="onoffswitch-label" for="allowoverreceiving"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <label>允许超收范围:</label> + <input type="text" name="allowoverreceivingqty" placeholder="%" /> + </li> + </ul> + <ul> + <li> + <div class="col-lg-4"><label>自动定位:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="autolocate" name="autolocate" checked="checked"> + <label class="onoffswitch-label" for="autolocate"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <label>定位规则:</label> + <select name="locationrule"> + <option value="0">否</option> + <option value="-1">是</option> + </select> + </li> + <li> + <label>容器选择规则:</label> + <select name="checkinbypiece"> + <option value="0">否</option> + <option value="-1">是</option> + </select> + </li> + </ul> + <ul> + <li> + <div class="col-lg-4"><label>快速入库:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="usequickcheckin" name="usequickcheckin" checked="checked"> + <label class="onoffswitch-label" for="usequickcheckin"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + </ul> + </div> + </div> + + <div class="more_input"> + <div class="col-lg-12"> + <fieldset class="wms-field-title" style="margin-top: 20px;"> + <legend style="width:auto;padding: 0;margin-bottom:10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">RF</legend> + </fieldset> + </div> + <div class="col-lg-12 input_list"> + <ul> + <li> + <div class="col-lg-4"><label>组车收货:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="groupputaway" name="groupputaway" checked="checked"> + <label class="onoffswitch-label" for="groupputaway"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <div class="col-lg-4"><label>显示未收货数量:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="showopenqty" name="showopenqty" checked="checked"> + <label class="onoffswitch-label" for="showopenqty"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <div class="col-lg-4"><label>人工组盘:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="manuallybuildlpn" name="manuallybuildlpn" checked="checked"> + <label class="onoffswitch-label" for="manuallybuildlpn"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <div class="col-lg-4"><label>逐件收货:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="checkinbypiece" name="checkinbypiece" checked="checked"> + <label class="onoffswitch-label" for="checkinbypiece"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <div class="col-lg-4"><label>自动提交(平库):</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="status" name="status" checked="checked"> + <label class="onoffswitch-label" for="status"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + + </ul> + </div> + </div> + <div class="more_input"> + <div class="col-lg-12"> + <fieldset class="wms-field-title" style="margin-top: 20px;"> + <legend style="width:auto;padding: 0;margin-bottom: 10px;font-size: 16px;line-height: inherit;color: #333;border: 0;">物料</legend> + </fieldset> + </div> + <div class="col-lg-12 input_list"> + <ul> + <li> + <div class="col-lg-4"><label>ABC分类:</label></div> + <div class="col-lg-8"> + <div class="onoffswitch"> + <input type="checkbox" class="onoffswitch-checkbox" id="classification" name="classification" checked="checked"> + <label class="onoffswitch-label" for="classification"> + <span class="onoffswitch-inner"></span> + <span class="onoffswitch-switch"></span> + </label> + </div> + </div> + </li> + <li> + <label>属性模板:</label> + <select name="checkinbypiece"> + <option value="0">否</option> + <option value="-1">是</option> + </select> + </li> + </ul> + <ul> + <li> + <label>保质期(天):</label> + <input type="text" name="autoassignlpn"/> + </li> + <li> + <label>临期预警(天):</label> + <input type="text" name="autoassignlpn"/> + </li> + <li> + <label>收货预警(天):</label> + <input type="text" name="autoassignlpn"/> + </li> + </ul> + </div> + </div> + <!--分组//--> + </div> + <!--下拉//--> </div> - <div class="boxdown"></div> + <!--<div class="boxdown"></div>--> </form> </div> <div class="btn-group hidden-xs" id="toolbar" role="group"> @@ -691,7 +791,18 @@ }); - +</script> +<script type="text/javascript"> + function test(obj){ + var div1=document.getElementById("div2"); + if(div1.style.display=="block"){ + div1.style.display="none"; + obj.src="../img/down.png"; + }else{ + div1.style.display="block"; + obj.src="../img/up.png"; + } + } </script> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 996f0c3..f9a9e8e 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="zh" xmlns:th="http://www.thymeleaf.org" th:with="corp = ${@corporationService.getEnableCorporation()}"> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" th:with="corp = ${@corporationService.getEnableCorporation()}"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @@ -27,7 +27,8 @@ } </style> </head> -<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden" th:classappend="${@config.getKey('sys.index.skinName')}"> +<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden" + th:classappend="${@config.getKey('sys.index.skinName')}"> <div id="wrapper"> <!--左侧导航开始--> @@ -40,58 +41,67 @@ <li class="nav-header"> <div class="dropdown profile-element"> <span class="pull-left" style="padding-right: 10px;"> - <img th:src="(${user.avatar} == '') ? (${corp}?${corp.getPLogoSmall()}:'img/profile.jpg') : 'profile/' + ${user.avatar}" alt="image" class="img-circle" height="45" width="45"/> + <img th:src="(${user.avatar} == '') ? (${corp}?${corp.getPLogoSmall()}:'img/profile.jpg') : 'profile/' + ${user.avatar}" + alt="image" class="img-circle" height="45" width="45"/> </span> - <a href="#" class="dropdown-toggle" data-toggle="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <span class="pull-left clear"> <span class="block m-t-xs"><strong class="font-bold">[[${user.userName}]]</strong></span> <span class="text-muted text-xs block"><span th:if="${not #strings.isEmpty(user.dept)}">[[${user.dept.deptName}]]</span> <b class="caret"></b> </span> </span> - </a> - <ul class="dropdown-menu animated fadeInRight m-t-xs" style="position:absolute;top:40px;"> - <li><a class="menuItem" th:href="@{/system/user/profile}">个人信息</a></li> - <li><a th:href="@{logout}">退出</a></li> - </ul> + </a> + <ul class="dropdown-menu animated fadeInRight m-t-xs" style="position:absolute;top:40px;"> + <li><a class="menuItem" th:href="@{/system/user/profile}">个人信息</a></li> + <li><a th:href="@{logout}">退出</a></li> + </ul> <div class="dw"><i class="fa fa-map-marker"></i> <span id="warehouse_name"></span></div> </div> </li> - <li class="active"> - <a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span class="fa arrow"></span></a> + <li class="active"> + <a href="index.html"><i class="fa fa-home"></i> <span class="nav-label">主页</span> <span + class="fa arrow"></span></a> <ul class="nav nav-second-level"> - <li class="active"><a class="menuItem" th:href="@{/system/main}">概 况</a></li> + <li class="active"><a class="menuItem" th:href="@{/system/main}">概 况</a> + </li> </ul> </li> <li th:each="menu : ${menus}"> - <a href="#"> - <i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i> - <span class="nav-label" th:text="${menu.menuName}">一级菜单</span> - <span class="fa arrow"></span> - </a> - <ul class="nav nav-second-level collapse"> - <li th:each="cmenu : ${menu.children}"> - <a th:if="${#lists.isEmpty(cmenu.children)}" class="menuItem" th:utext="${cmenu.menuName}" th:href="@{${cmenu.url}}">二级菜单</a> - <a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span class="fa arrow"></span></a> - <ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level"> + <a href="#"> + <i class="fa fa fa-bar-chart-o" th:class="${menu.icon}"></i> + <span class="nav-label" th:text="${menu.menuName}">一级菜单</span> + <span class="fa arrow"></span> + </a> + <ul class="nav nav-second-level collapse"> + <li th:each="cmenu : ${menu.children}"> + <a th:if="${#lists.isEmpty(cmenu.children)}" class="menuItem" th:utext="${cmenu.menuName}" + th:href="@{${cmenu.url}}">二级菜单</a> + <a th:if="${not #lists.isEmpty(cmenu.children)}" href="#">[[${cmenu.menuName}]]<span + class="fa arrow"></span></a> + <ul th:if="${not #lists.isEmpty(cmenu.children)}" class="nav nav-third-level"> <li th:each="emenu : ${cmenu.children}"> - <a th:if="${#lists.isEmpty(emenu.children)}" class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a> - <a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span class="fa arrow"></span></a> + <a th:if="${#lists.isEmpty(emenu.children)}" class="menuItem" + th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a> + <a th:if="${not #lists.isEmpty(emenu.children)}" href="#">[[${emenu.menuName}]]<span + class="fa arrow"></span></a> <ul th:if="${not #lists.isEmpty(emenu.children)}" class="nav nav-four-level"> - <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> + <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> </ul> </li> -<!-- <li th:each="emenu : ${cmenu.children}"><a class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a></li>--> - </ul> - </li> - </ul> + <!-- <li th:each="emenu : ${cmenu.children}"><a class="menuItem" th:text="${emenu.menuName}" th:href="@{${emenu.url}}">三级菜单</a></li>--> + </ul> + </li> + </ul> </li> </ul> </div> </nav> <!--左侧导航结束--> - + <!--右侧部分开始--> <div id="page-wrapper" class="gray-bg dashbard-1"> @@ -115,50 +125,21 @@ <!–<span class="label label-primary">8</span>–> </button>--> <!--消息--> - <div class="xx_box"> + <div class="xx_box"> <a class="dropdown-toggle count-info xx" data-toggle="dropdown" href="#"> <i class="fa fa-envelope"></i> <sup></sup> <!--<span class="label label-warning">16</span>--> </a> <ul class="dropdown-menu dropdown-messages"> - <li> - <div class="dropdown-messages-box"> - <a href="profile.html" class="pull-left"> - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/a7.jpg"> - </a> - <div class="media-body" style=""> - <small class="pull-right">46小时前</small> - <strong>小明</strong> 评论了 <strong>小红</strong>. <br> - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small> - </div> - </div> - </li> - <li class="divider"></li> - <li> + <li th:each="notice : ${notices}"> <div class="dropdown-messages-box"> - <a href="profile.html" class="pull-left"> - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/a4.jpg"> - </a> - <div class="media-body "> - <small class="pull-right text-navy">5小时前</small> - <strong>小红</strong> 打电话给了 <strong>小黑</strong>. <br> - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small> + <div class="media-body"> + <p th:text="${notice.content}"></p> + <small class="text-muted" style="position: relative;top:-30px;" + th:text="${#dates.format(notice.created, 'yyyy-MM-dd HH:mm:ss')}"></small> </div> </div> </li> - <li class="divider"></li> - <li> - <div class="dropdown-messages-box"> - <a href="profile.html" class="pull-left"> - <img alt="image" class="img-circle" src="http://cn.inspinia.cn/html/inspiniaen/img/profile.jpg"> - </a> - <div class="media-body "> - <small class="pull-right">23小时前</small> - <strong>小黑</strong> 点赞了 <strong>小红</strong>. <br> - <small class="text-muted" style="position: relative;top:-20px">2017.10.06 7:58</small> - </div> - </div> - </li> - <li class="divider"></li> + <!--<li class="divider"></li>--> <li> <div class="text-center link-block"> <a href="mailbox.html"> @@ -171,15 +152,15 @@ <!--消息--> <div class="btn-group roll-nav roll-right"> <button class="dropdown J_tabClose" data-toggle="dropdown"> - 页签操作<span class="caret"></span> + 页签操作<span class="caret"></span> </button> <ul role="menu" class="dropdown-menu dropdown-menu-right"> - <li><a class="tabCloseOther" href="javascript:void(0);">关闭其他</a></li> - <li><a class="tabCloseCurrent" href="javascript:void(0);">关闭当前</a></li> - <li><a class="tabCloseAll" href="javascript:void(0);">全部关闭</a></li> + <li><a class="tabCloseOther" href="javascript:void(0);">关闭其他</a></li> + <li><a class="tabCloseCurrent" href="javascript:void(0);">关闭当前</a></li> + <li><a class="tabCloseAll" href="javascript:void(0);">全部关闭</a></li> </ul> </div> - <div class="mlist"> + <div class="mlist"> <ul> <li><a id="fullScreen"><i class="fa fa-arrows-alt"></i> 全屏</a></li> <li><a class="tabReload"><i class="fa fa-refresh"></i> 刷新</a></li> @@ -192,25 +173,66 @@ th:src="@{/system/main}" frameborder="0" seamless></iframe> </div> <div class="footer"> - <div class="pull-right">© [[${copyrightYear}]] 长沙华恒机器人系统有限公司 Copyright </div> + <div class="pull-right">© [[${copyrightYear}]] 长沙华恒机器人系统有限公司 Copyright</div> </div> </div> <!--右侧部分结束--> </div> <!-- 全局js --> -<script th:src="@{/js/jquery.min.js}"></script> -<script th:src="@{/js/bootstrap.min.js}"></script> +<div th:include="include :: footer"></div> <script th:src="@{/js/plugins/metisMenu/jquery.metisMenu.js}"></script> -<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script> -<script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script> -<!--<script src="http://tajs.qq.com/stats?sId=62048022"></script>--> -<script th:src="@{/huaheng/js/huahengUI.min.js?v=2.3.0}"></script> <script th:src="@{/huaheng/index.js}"></script> <script th:src="@{/ajax/libs/fullscreen/jquery.fullscreen.js}"></script> -<script> +<script th:src="@{/js/plugins/slimscroll/jquery.slimscroll.min.js}"></script> + +<script th:inline="javascript"> var warehouse_name = localStorage.getItem("warehouse_name"); $("#warehouse_name").text(warehouse_name); // localStorage.removeItem("warehouse_name"); + + let socket; + + if (typeof (WebSocket) == "undefined") { + console.log("您的浏览器不支持WebSocket"); + alert("您的浏览器不支持WebSocket"); + } else { + console.log("您的浏览器支持WebSocket"); + let userId = [[${@permission.getPrincipalProperty('id')}]]; + //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 + //等同于socket = new WebSocket("ws://localhost:8888/xxxx/im/25"); + //var socketUrl="${request.contextPath}/im/"+$("#userId").val(); + let url = window.location.host; + let socketUrl = "http://" + url + "/wms/imserver/" + userId; + socketUrl = socketUrl.replace("https", "ws").replace("http", "ws"); + console.log(socketUrl); + if (socket != null) { + socket.close(); + socket = null; + } + socket = new WebSocket(socketUrl); + //打开事件 + socket.onopen = function () { + console.log("websocket已打开"); + //socket.send("这是来自客户端的消息" + location.href + new Date()); + }; + //获得消息事件 + socket.onmessage = function (msg) { + if (msg.data !== "连接成功") { + //向通知里插入消息 + } + console.log(msg.data); + }; + //关闭事件 + socket.onclose = function () { + console.log("websocket已关闭"); + $.modal.alertError("websocket已关闭"); + }; + //发生了错误事件 + socket.onerror = function () { + console.log("websocket发生了错误"); + $.modal.alertError("websocket发生了错误"); + } + } </script> </body> </html> diff --git a/src/main/resources/templates/manager/apkinfo/add.html b/src/main/resources/templates/manager/apkinfo/add.html new file mode 100644 index 0000000..d8837ab --- /dev/null +++ b/src/main/resources/templates/manager/apkinfo/add.html @@ -0,0 +1,86 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head> + <th:block th:include="include :: header"/> + </head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-apkinfo-add"> + <div class="form-group"> + <label class="col-sm-3 control-label">应用包名 + :</label> + <div class="col-sm-8"> + <input name="pkgname" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">应用版本号 + :</label> + <div class="col-sm-8"> + <input name="versioncode" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">应用版本名称 + :</label> + <div class="col-sm-8"> + <input name="versionname" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">下载链接 + :</label> + <div class="col-sm-8"> + <input name="url" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">MD5校验码 + :</label> + <div class="col-sm-8"> + <input name="md5" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> +<th:block th:include="include :: footer"/> +<script type="text/javascript"> + var prefix = ctx + "manager/apkinfo" + $("#form-apkinfo-add").validate({ + rules:{ + xxxx:{ + required:true, + }, + }, + submitHandler: function(form) { + $.ajax({ + cache : true, + type : "POST", + url : prefix + "/add", + async : false, + data : { + "pkgName": $("input[name='pkgname']").val(), + "versionCode": $("input[name='versioncode']").val(), + "versionName": $("input[name='versionname']").val(), + "url": $("input[name='url']").val(), + "md5": $("input[name='md5']").val(), + }, + error : function(request) { + $.modal.alertError("请求失败!"); + }, + success : function(data) { + $.operate.saveSuccess(data); + } + }); + } + }); +</script> +</body> +</html> diff --git a/src/main/resources/templates/manager/apkinfo/edit.html b/src/main/resources/templates/manager/apkinfo/edit.html new file mode 100644 index 0000000..fede22f --- /dev/null +++ b/src/main/resources/templates/manager/apkinfo/edit.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" > +<head> + <th:block th:include="include :: header" /> + </head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-apkinfo-edit" th:object="${apkinfo}"> + <input name="id" th:field="*{id}" type="hidden"> + <div class="form-group"> + <label class="col-sm-3 control-label">${comment}:</label> + <div class="col-sm-8"> + <input name="pkgname" th:field="*{pkgname}" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">${comment}:</label> + <div class="col-sm-8"> + <input name="versioncode" th:field="*{versioncode}" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">${comment}:</label> + <div class="col-sm-8"> + <input name="versionname" th:field="*{versionname}" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">${comment}:</label> + <div class="col-sm-8"> + <input name="url" th:field="*{url}" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">${comment}:</label> + <div class="col-sm-8"> + <input name="md5" th:field="*{md5}" class="form-control" type="text"> + </div> + </div> + </form> +</div> +<th:block th:include="include :: footer" /> + <script th:inline="javascript"> + var prefix = ctx + "task/apkinfo"; + $("#form-apkinfo-edit").validate({ + focusCleanup: true + }); + + function submitHandler() { + if ($.validate.form()) { + $.operate.save(prefix + "/edit", $('#form-apkinfo-edit').serialize()); + } + } + </script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/system/notice/notice.html b/src/main/resources/templates/manager/apkinfo/list.html index e9c5f95..69401aa 100644 --- a/src/main/resources/templates/system/notice/notice.html +++ b/src/main/resources/templates/manager/apkinfo/list.html @@ -3,115 +3,104 @@ <meta charset="utf-8"> <head th:include="include :: header"></head> <body class="gray-bg"> - - <div class="container-div"> - <div class="row"> - <div class="col-sm-12 select-info"> - <form id="notice-form"> - <div class="select-list"> - <ul> - <li> - 公告标题:<input type="text" name="noticeTitle"/> - </li> - <li> - 操作人员:<input type="text" name="createBy"/> - </li> - <li> - 公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}"> - <option value="">所有</option> - <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> - </select> - </li> - <li> - <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> - <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('notice-form')"><i class="fa fa-refresh"></i> 重置</a> - </li> - </ul> - </div> - </form> - </div> - - <div class="btn-group hidden-xs" id="toolbar" role="group"> - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.addFull()" - shiro:hasPermission="system:notice:add"> - <i class="fa fa-plus"></i> 新增 - </a> - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" - shiro:hasPermission="system:notice:remove"> - <i class="fa fa-trash-o"></i> 删除 - </a> - </div> - - <div class="col-sm-12 select-info"> - <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> - </div> - </div> - </div> - <div th:include="include :: footer"></div> - <script th:inline="javascript"> - var editFlag = [[${@permission.hasPermi('system:notice:edit')}]]; - var removeFlag = [[${@permission.hasPermi('system:notice:remove')}]]; - var types = [[${@dict.getType('sys_notice_type')}]]; - var datas = [[${@dict.getType('sys_notice_status')}]]; - var prefix = ctx + "system/notice" +<div class="container-div"> + <div class="row"> + <div class="col-sm-12 select-info"> + <form id="formId"> + <div class="select-list"> + <ul> + <li> + <label>应用包名:</label> + <input type="text" name="pkgname"/> + </li> + <li> + <label>应用版本号:</label> + <input type="text" name="versioncode"/> + </li> + <li> + <label>应用版本名称:</label> + <input type="text" name="versionname"/> + </li> + <li> + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i + class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i + class="fa fa-refresh"></i> 重置</a> + </li> + </ul> + </div> + </form> + </div> + <div class="btn-group hidden-xs" id="toolbar" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"> + <i class="fa fa-plus"></i> 新增 + </a> + <a class="btn btn-outline btn-primary single disabled" onclick="$.operate.edit()"> + <i class="fa fa-edit"></i> 修改 + </a> + <a class="btn btn-outline btn-danger btn-rounded multiple disabled" onclick="$.operate.batRemove()"> + <i class="fa fa-trash-o"></i> 删除 + </a> + </div> - $(function() { - var options = { - url: prefix + "/list", - createUrl: prefix + "/add", - updateUrl: prefix + "/edit/{id}", - removeUrl: prefix + "/remove", - modalName: "公告", - search: false, - columns: [{ - checkbox: true - }, - { - field : 'id', - title : '序号' - }, - { - field : 'noticeTitle', - title : '公告标题' - }, - { - field: 'noticeType', - title: '公告类型', - align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(types, value); - } - }, - { - field: 'status', - title: '状态', - align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(datas, value); - } - }, - { - field : 'createBy', - title : '创建者' - }, - { - field: 'createTime', - title: '创建时间', - sortable: true - }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); - actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); - return actions.join(''); - } - }] - }; - $.table.init(options); - }); - </script> + <div class="col-sm-12 select-info table-striped"> + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> + </div> + </div> + </div> + <div th:include="include :: footer"></div> + <script th:inline="javascript"> + var prefix = ctx + "manager/apkinfo" + + $(function () { + var options = { + url: prefix + "/list", + createUrl: prefix + "/add", + updateUrl: prefix + "/edit/{id}", + removeUrl: prefix + "/remove", + modalName: "上传应用", + columns: [{ + checkbox: true + }, + { + field: 'id', + title: 'id', + visible: false + }, + { + field: 'pkgName', + title: '应用包名' + }, + { + field: 'versionCode', + title: '应用版本号' + }, + { + field: 'versionName', + title: '应用版本名称' + }, + { + field: 'url', + title: '下载链接' + }, + { + field: 'md5', + title: 'md5校验码' + }, + { + title: '操作', + align: 'center', + formatter: function (value, row, index) { + var actions = []; + actions.push('<a class="btn btn-success btn-xs ' + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-danger btn-xs ' + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + +</script> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/system/notice/add.html b/src/main/resources/templates/system/notice/add.html deleted file mode 100644 index 5e528bf..0000000 --- a/src/main/resources/templates/system/notice/add.html +++ /dev/null @@ -1,73 +0,0 @@ -<!DOCTYPE HTML> -<html lang="zh" xmlns:th="http://www.thymeleaf.org"> -<meta charset="utf-8"> -<head th:include="include :: header"></head> -<link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/> -<link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/> -<body class="white-bg"> - <div class="wrapper wrapper-content animated fadeInRight ibox-content"> - <form class="form-horizontal m" id="form-notice-add"> - <div class="form-group"> - <label class="col-sm-3 control-label">公告标题:</label> - <div class="col-sm-8"> - <input id="noticeTitle" name="noticeTitle" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告类型:</label> - <div class="col-sm-8"> - <select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}"> - <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> - </select> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告内容:</label> - <div class="col-sm-8"> - <input id="noticeContent" name="noticeContent" type="hidden"> - <div class="summernote"></div> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告状态:</label> - <div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}"> - <div th:each="dict : ${type}" th:class="${dict['cssClass']}"> - <input type="radio" th:id="${dict['id']}" name="status" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}"> - <label th:for="${dict['id']}" th:text="${dict['dictLabel']}"></label> - </div> - </div> - </div> - <div class="form-group"> - <div class="form-control-static col-sm-offset-9"> - <button type="submit" class="btn btn-primary">提交</button> - <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> - </div> - </div> - </form> - </div> - <div th:include="include::footer"></div> - <script th:src="@{/ajax/libs/summernote/summernote.min.js}"></script> - <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script> - <script type="text/javascript"> - - $('.summernote').summernote({ - height : '220px', - lang : 'zh-CN' - }); - - var prefix = ctx + "system/notice" - $("#form-notice-add").validate({ - rules:{ - noticeTitle:{ - required:true, - } - }, - submitHandler: function(form) { - var sHTML = $('.summernote').code(); - $("#noticeContent").val(sHTML); - $.operate.save(prefix + "/add", $('#form-notice-add').serialize()); - } - }); - </script> -</body> -</html> diff --git a/src/main/resources/templates/system/notice/edit.html b/src/main/resources/templates/system/notice/edit.html deleted file mode 100644 index b2e9f8a..0000000 --- a/src/main/resources/templates/system/notice/edit.html +++ /dev/null @@ -1,77 +0,0 @@ -<!DOCTYPE HTML> -<html lang="zh" xmlns:th="http://www.thymeleaf.org"> -<meta charset="utf-8"> -<head th:include="include :: header"></head> -<link th:href="@{/ajax/libs/summernote/summernote.css}" rel="stylesheet"/> -<link th:href="@{/ajax/libs/summernote/summernote-bs3.css}" rel="stylesheet"/> -<body class="white-bg"> - <div class="wrapper wrapper-content animated fadeInRight ibox-content"> - <form class="form-horizontal m" id="form-notice-edit" th:object="${notice}"> - <input id="id" name="id" th:field="*{id}" type="hidden"> - <div class="form-group"> - <label class="col-sm-3 control-label">公告标题:</label> - <div class="col-sm-8"> - <input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告类型:</label> - <div class="col-sm-8"> - <select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}"> - <option th:each="dict : ${type}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}" th:field="*{noticeType}"></option> - </select> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告内容:</label> - <div class="col-sm-8"> - <input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden"> - <div id="editor" class="summernote"></div> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">公告状态:</label> - <div class="col-sm-8" th:with="type=${@dict.getType('sys_notice_status')}"> - <div th:each="dict : ${type}" th:class="${dict['cssClass']}"> - <input type="radio" th:id="${dict['id']}" name="status" th:value="${dict['dictValue']}" th:field="*{status}"> - <label th:for="${dict['id']}" th:text="${dict['dictLabel']}"></label> - </div> - </div> - </div> - <div class="form-group"> - <div class="form-control-static col-sm-offset-9"> - <button type="submit" class="btn btn-primary">提交</button> - <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> - </div> - </div> - </form> - </div> - <div th:include="include::footer"></div> - <script th:src="@{/ajax/libs/summernote/summernote.min.js}"></script> - <script th:src="@{/ajax/libs/summernote/summernote-zh-CN.js}"></script> - <script type="text/javascript"> - $(function() { - $('.summernote').summernote({ - height : '220px', - lang : 'zh-CN' - }); - var content = $("#noticeContent").val(); - $('#editor').code(content); - }); - - var prefix = ctx + "system/notice" - $("#form-notice-edit").validate({ - rules:{ - xxxx:{ - required:true, - }, - }, - submitHandler: function(form) { - var sHTML = $('.summernote').code(); - $("#noticeContent").val(sHTML); - $.operate.save(prefix + "/edit", $('#form-notice-edit').serialize()); - } - }); - </script> -</body> -</html> diff --git a/src/main/resources/templates/task/taskHeader/taskHeader.html b/src/main/resources/templates/task/taskHeader/taskHeader.html index a8dcac2..7c6ec0e 100644 --- a/src/main/resources/templates/task/taskHeader/taskHeader.html +++ b/src/main/resources/templates/task/taskHeader/taskHeader.html @@ -522,6 +522,21 @@ isAsc: params.order }; }; + + function print() { + let rows = $("#bootstrap-table").bootstrapTable('getSelections'); + if ($.common.isEmpty(rows)) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + let ids = rows[0].id; + for(let i = 1; i < rows.length; i++) { + ids = ids + "," + rows[i].id; + } + + let url = ctx + 'task/taskDetail/report/' + ids; + $.modal.open("任务打印" , url); + } </script> </body> </html> \ No newline at end of file