diff --git a/src/main/java/com/zcloud/controller/app/AppHiddenController.java b/src/main/java/com/zcloud/controller/app/AppHiddenController.java index 0483e7e..b8bbb2c 100644 --- a/src/main/java/com/zcloud/controller/app/AppHiddenController.java +++ b/src/main/java/com/zcloud/controller/app/AppHiddenController.java @@ -1198,7 +1198,7 @@ public class AppHiddenController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); pd = hiddenService.findById(pd); // 根据ID读取 - if(pd.getString("CONFIRM_USER")!=null || pd.getString("CONFIRM_USER").equals("undefined")){ + if(pd.get("CONFIRM_USER")!=null || pd.getString("CONFIRM_USER").equals("undefined")){ pd.put("USER_ID",pd.getString("CONFIRM_USER")); PageData user = usersService.findById(pd); if(user!=null){ diff --git a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java index 3668a03..328d303 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java @@ -2,15 +2,21 @@ package com.zcloud.controller.eightwork; import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.entity.Response; +import com.zcloud.logs.LogAnno; import com.zcloud.service.eightwork.EightWorkService; +import com.zcloud.service.system.DictionariesService; import com.zcloud.util.*; +import org.apache.commons.lang.StringUtils; import org.apache.fop.util.DataURLUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; +import java.util.List; import java.util.Map; @RestController @@ -21,6 +27,63 @@ public class AppEightWorkController extends BaseController { private Smb smb; @Autowired private EightWorkService eightWorkService; + @Autowired + private DictionariesService dictionariesService; + + /**八项作业列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "八项作业",instructionsOperate = "八项作业",instructionsType = "列表") + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); +// pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + page.setPd(pd); + List varList = eightWorkService.list(page); //列出confinedspace列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * description: + * accidentType-风险点 + * hiddenLevel-隐患级别 + * + * @return tree or list + * @throws Exception all + */ + @RequestMapping(value = "/getInfo") + @ResponseBody + public Response getInfo() throws Exception { + Response response = Response.getResponse(); + try { + PageData request = this.getPageData(); + if (StringUtils.isBlank(request.getString("vectors"))) throw new RuntimeException("未找到要获取的数据字典类型"); + List vectors = Warden.getList(request.getString("vectors"),String.class); + for (String vector: vectors) { + switch (vector) { + case "accidentType": + //事故类型 + response.put("accidentType", dictionariesService.getTreeById("cee1190ea96a4ca9b7bca81e11f0d0f8")); + continue; + default: + } + } + return response.OK(); + } catch (Exception e) { + e.printStackTrace(); + return response.errorMessage(e.getMessage()); + } + } @RequestMapping("/saveFile") @ResponseBody @@ -29,14 +92,11 @@ public class AppEightWorkController extends BaseController { String errorInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - if (null != file && !file.isEmpty()) { - String ffile = DateUtil.getDays(); - String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - pd.put("FILE_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); - } + String ffile = DateUtil.getDays(); + String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + map.put("FILE_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); map.put("result",errorInfo); - map.put("pd",pd); return map; } @@ -47,7 +107,7 @@ public class AppEightWorkController extends BaseController { String errorInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - smb.deleteFile(pd.getString("CORPINFO_ID")); + smb.deleteFile(pd.getString("FILE_PATH")); map.put("result",errorInfo); return map; } @@ -63,4 +123,16 @@ public class AppEightWorkController extends BaseController { map.put("result",errorInfo); return map; } + + @RequestMapping("/checkWork") + @ResponseBody + public Object checkWork() throws Exception{ + Map map = new HashMap<>(); + String errorInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + map.put("count",eightWorkService.checkWork(pd)); + map.put("result",errorInfo); + return map; + } } diff --git a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java index ad59de1..1257544 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -125,16 +125,16 @@ public class AppHotworkController extends BaseController { return map; } - @RequestMapping("/cancel") + @RequestMapping("/listSignFinished") @ResponseBody - @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "打回") - public Object cancel()throws Exception{ - Map map = new HashMap<>(); + public Object listSignFinished() throws Exception { + Map map = new HashMap<>(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - hotworkService.cancel(pd); + PageData signs = hotworkService.listSignFinished(pd); map.put("result",errInfo); + map.put("signs",signs); return map; } @@ -156,17 +156,24 @@ public class AppHotworkController extends BaseController { map.put("result",errInfo); return map; } - - @RequestMapping("/accept") + /**搜索动火作业动火人及证书编号 + * @param page + * @throws Exception + */ + @RequestMapping(value="/namelist") @ResponseBody - @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "验收归档") - public Object accept() throws Exception { - Map map = new HashMap<>(); + @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "动火作业动火人及证书编号") + public Object namelist(Page page) throws Exception{ + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - hotworkService.accept(pd); - map.put("result",errInfo); + pd.put("CORPINFO_ID", pd.get("CORPINFO_ID")); //企业ID + page.setPd(pd); + List varList = hotworkService.namelist(pd); //列出PersonnelManagement列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); return map; } @@ -228,12 +235,18 @@ public class AppHotworkController extends BaseController { @RequestMapping(value="/gas/save") @ResponseBody @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "保存气体检测") - public Object gasSave(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{ + public Object gasSave(MultipartRequest request) throws Exception{ Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); - hotworkService.saveGas(pd,file); + List fileList = new ArrayList(); + String SIGNTIME[] = pd.getString("SIGNTIME").split(","); + + for (int i = 0; i < SIGNTIME.length; i++) { + fileList.add(request.getFile("file" + i)); + } + hotworkService.saveGas(pd,fileList.toArray(new MultipartFile[fileList.size()])); map.put("result", errInfo); return map; } @@ -273,4 +286,22 @@ public class AppHotworkController extends BaseController { return map; } + /**获取动火作业流程 + * @param + * @throws Exception + */ + @RequestMapping(value="/getFlowList") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "获取动火作业流程") + public Object getFlowList() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + List flowList = hotworkService.getFlowList(pd); + map.put("flowList", flowList); + map.put("result", errInfo); //返回结果 + return map; + } + } diff --git a/src/main/java/com/zcloud/controller/mq/EightWorkListener.java b/src/main/java/com/zcloud/controller/mq/EightWorkListener.java index a758e75..c503ac4 100644 --- a/src/main/java/com/zcloud/controller/mq/EightWorkListener.java +++ b/src/main/java/com/zcloud/controller/mq/EightWorkListener.java @@ -1,85 +1,85 @@ -package com.zcloud.controller.mq; - -import com.alibaba.fastjson.JSON; -import com.zcloud.dto.TenCorpDto; -import com.zcloud.entity.PageData; -import com.zcloud.mapper.dsno2.mq.MqMessageLogMapper; -import com.zcloud.service.eightwork.HotworkService; -import com.zcloud.service.mq.LogService; -import com.zcloud.service.mq.SendMessageService; -import com.zcloud.util.DateUtil; -import com.zcloud.util.MqUtil; -import com.zcloud.util.Warden; -import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; -import org.apache.rocketmq.spring.annotation.SelectorType; -import org.apache.rocketmq.spring.core.RocketMQListener; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Date; - -/** - * 说明:消费某个 topic 下指定 tag 的消息 对接课件DEMO - * 作者:wangxuan - * 官网:www.zcloudchina.com - */ -@Component -@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}", - topic = "${mq.topic.eightWork}", - selectorType = SelectorType.TAG) -public class EightWorkListener implements RocketMQListener { - - @Resource - private SendMessageService sendMessageService; - @Resource - private LogService logService; - @Resource - private MqMessageLogMapper mqMessageLogMapper; - @Autowired - private HotworkService hotworkService; - - @Override - public void onMessage(String message) { - TenCorpDto data = JSON.parseObject(message, TenCorpDto.class); - PageData log = data.getPd(); - log.put("MESSAGE_LOG_ID", Warden.get32UUID()); - log.put("CREATE_TIME", DateUtil.getTime()); - log.put("PRODUCER_NAME",data.getProducer_name()); - log.put("TYPE","1"); - try { - System.out.println("消费者:" + data.toString()); - Date limit_date = MqUtil.dateFormat(data.getTime_stamp()); - if (limit_date.getTime() - new Date().getTime() > 1000) { - sendMessageService.sendDelayQueue(data); - log.put("DIGESTION_FLAG","0"); - } else { - switch (data.getMessage()){ -// case "confined-space": -// System.out.println("受限空间模块消费"); -// confinedSpaceService.cancel(data.getData()); +//package com.zcloud.controller.mq; +// +//import com.alibaba.fastjson.JSON; +//import com.zcloud.dto.TenCorpDto; +//import com.zcloud.entity.PageData; +//import com.zcloud.mapper.dsno2.mq.MqMessageLogMapper; +//import com.zcloud.service.eightwork.HotworkService; +//import com.zcloud.service.mq.LogService; +//import com.zcloud.service.mq.SendMessageService; +//import com.zcloud.util.DateUtil; +//import com.zcloud.util.MqUtil; +//import com.zcloud.util.Warden; +//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +//import org.apache.rocketmq.spring.annotation.SelectorType; +//import org.apache.rocketmq.spring.core.RocketMQListener; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +//import javax.annotation.Resource; +//import java.util.Date; +// +///** +// * 说明:消费某个 topic 下指定 tag 的消息 对接课件DEMO +// * 作者:wangxuan +// * 官网:www.zcloudchina.com +// */ +//@Component +//@RocketMQMessageListener(consumerGroup = "${mq.group.eightWork}", +// topic = "${mq.topic.eightWork}", +// selectorType = SelectorType.TAG) +//public class EightWorkListener implements RocketMQListener { +// +// @Resource +// private SendMessageService sendMessageService; +// @Resource +// private LogService logService; +// @Resource +// private MqMessageLogMapper mqMessageLogMapper; +// @Autowired +// private HotworkService hotworkService; +// +// @Override +// public void onMessage(String message) { +// TenCorpDto data = JSON.parseObject(message, TenCorpDto.class); +// PageData log = data.getPd(); +// log.put("MESSAGE_LOG_ID", Warden.get32UUID()); +// log.put("CREATE_TIME", DateUtil.getTime()); +// log.put("PRODUCER_NAME",data.getProducer_name()); +// log.put("TYPE","1"); +// try { +// System.out.println("消费者:" + data.toString()); +// Date limit_date = MqUtil.dateFormat(data.getTime_stamp()); +// if (limit_date.getTime() - new Date().getTime() > 1000) { +// sendMessageService.sendDelayQueue(data); +// log.put("DIGESTION_FLAG","0"); +// } else { +// switch (data.getMessage()){ +//// case "confined-space": +//// System.out.println("受限空间模块消费"); +//// confinedSpaceService.cancel(data.getData()); +//// break; +//// case "electricity": +//// System.out.println("临时用电模块消费"); +//// electricityService.cancel(data.getData()); +//// break; +// case "hot-work": +// System.out.println("动火模块消费"); +// hotworkService.cancel(data.getData()); // break; -// case "electricity": -// System.out.println("临时用电模块消费"); -// electricityService.cancel(data.getData()); -// break; - case "hot-work": - System.out.println("动火模块消费"); - hotworkService.cancel(data.getData()); - break; - default: - System.out.println("异常模块不消费"); - throw new RuntimeException("未找到对应的消费者"); - } - log.put("DIGESTION_FLAG","1"); - } - mqMessageLogMapper.save(log); - } catch (Exception e) { - e.printStackTrace(); - logService.saveErrorMessage(log,e.getMessage()); - throw new RuntimeException(e); - } - } - -} - +// default: +// System.out.println("异常模块不消费"); +// throw new RuntimeException("未找到对应的消费者"); +// } +// log.put("DIGESTION_FLAG","1"); +// } +// mqMessageLogMapper.save(log); +// } catch (Exception e) { +// e.printStackTrace(); +// logService.saveErrorMessage(log,e.getMessage()); +// throw new RuntimeException(e); +// } +// } +// +//} +// diff --git a/src/main/java/com/zcloud/controller/system/MainController.java b/src/main/java/com/zcloud/controller/system/MainController.java index a6803ba..6a21d64 100644 --- a/src/main/java/com/zcloud/controller/system/MainController.java +++ b/src/main/java/com/zcloud/controller/system/MainController.java @@ -4,6 +4,7 @@ import com.zcloud.controller.base.BaseController; import com.zcloud.entity.PageData; import com.zcloud.entity.system.Menu; import com.zcloud.entity.system.Role; +import com.zcloud.entity.system.Route; import com.zcloud.entity.system.User; import com.zcloud.logs.LogAnno; import com.zcloud.service.system.*; @@ -35,6 +36,8 @@ public class MainController extends BaseController { @Autowired private MenuService menuService; @Autowired + private RouteService routeService; + @Autowired private ButtonrightsService buttonrightsService; @Autowired private FhButtonService fhButtonService; @@ -68,15 +71,29 @@ public class MainController extends BaseController { session.setAttribute(USERNAME + Const.SESSION_ROLE_RIGHTS, roleRights); //将角色权限存入session session.setAttribute(Const.SESSION_USERNAME, USERNAME); //放入用户名到session session.setAttribute(Const.SESSION_U_NAME, user.getNAME()); //放入用户姓名到session - List menuList = new ArrayList(); - Collection shiroSet= new HashSet(); //存放菜单权限标识 - menuList = this.getAttributeMenu(session, USERNAME, roleRights, getArrayRoleRights(ROLE_IDS), - this.getUQX(user,role,shiroSet), this.getUQX2(user), shiroSet); //菜单缓存以及赋值权限 - if(null == session.getAttribute(USERNAME + Const.SHIROSET)){ - session.setAttribute(USERNAME + Const.SHIROSET, shiroSet); //存放菜单权限标识 + //菜单替换成路由 + //菜单 已屏蔽 +// List menuList = new ArrayList(); +// Collection shiroSet= new HashSet(); //存放菜单权限标识 +// menuList = this.getAttributeMenu(session, USERNAME, roleRights, getArrayRoleRights(ROLE_IDS), +// this.getUQX(user,role,shiroSet), this.getUQX2(user), shiroSet); //菜单缓存以及赋值权限 +// if(null == session.getAttribute(USERNAME + Const.SHIROSET)){ +// session.setAttribute(USERNAME + Const.SHIROSET, shiroSet); //存放菜单权限标识 +// } +// this.setRemortIP(USERNAME); //更新登录IP +// map.put("menuList", menuList); + List routeList = new ArrayList(); + Collection shiroSet = new HashSet(); //存放菜单权限标识 + routeList = this.getAttributeRoute(session, USERNAME, roleRights, getArrayRoleRights(ROLE_IDS), + this.getUQX(user, role, shiroSet), + this.getUQX2(user), shiroSet); //菜单缓存以及赋值权限 + if (null == session.getAttribute(USERNAME + Const.SHIROSET)) { + session.setAttribute(USERNAME + Const.SHIROSET, shiroSet); //存放菜单权限标识 } - this.setRemortIP(USERNAME); //更新登录IP - map.put("menuList", menuList); + this.setRemortIP(USERNAME); //更新登录IP + map.put("routeList", routeList); + + if(null == session.getAttribute(Const.SKIN)){//用户皮肤 map.put("SKIN", user.getSKIN()); session.setAttribute(Const.SKIN, user.getSKIN()); @@ -116,6 +133,124 @@ public class MainController extends BaseController { return allmenuList; } + /** + * 菜单缓存以及赋值权限 + * + * @param session + * @param USERNAME 用户名 + * @param roleRights 主职角色加密的权限字符串 + * @param arrayRoleRights 副职角色加密的权限字符串列表 + * @param uqxmap 主职角色的增删改查权限 + * @param uqxmap2 副职角色的增删改查权限 + * @param shiroSet 放入shiro权限标识的的SET + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public List getAttributeRoute(Session session, String USERNAME, String roleRights, List arrayRoleRights, Map uqxmap, Map> uqxmap2, Collection shiroSet) throws Exception { + List allRouteList = new ArrayList(); + if (null == session.getAttribute(USERNAME + Const.SESSION_ALLMENU)) { + allRouteList = routeService.listAllMenuJur("0"); + if (Tools.notEmpty(roleRights)) { + allRouteList = this.readRoute(USERNAME, allRouteList, roleRights, arrayRoleRights, shiroSet, uqxmap, uqxmap2); //根据角色权限获取本权限的菜单列表 + } + session.setAttribute(USERNAME + Const.SESSION_ALLMENU, allRouteList); //菜单权限放入session中 + } else { + allRouteList = (List) session.getAttribute(USERNAME + Const.SESSION_ALLMENU); + } + return allRouteList; + } + + /** + * 根据角色权限获取本权限的菜单列表(递归处理) + * + * @param USERNAME 用户名 + * @param menuList 传入的总菜单 + * @param roleRights 主职角色加密的权限字符串 + * @param arrayRoleRights 副职角色加密的权限字符串列表 + * @param shiroSet 放入shiro权限标识的的Set + * @param uqxmap 主职角色的增删改查权限 + * @param uqxmap2 副职角色的增删改查权限 + * @return + */ + public List readRoute(String USERNAME, List menuList, String roleRights, List arrayRoleRights, Collection shiroSet, Map uqxmap, Map> uqxmap2) { + for (int i = 0; i < menuList.size(); i++) { + Boolean b1 = RightsHelper.testRights(roleRights, menuList.get(i).getROUTE_ID()); + menuList.get(i).setHasMenu(b1); //赋予主职角色菜单权限 + if (!b1 && null != arrayRoleRights) { + for (int n = 0; n < arrayRoleRights.size(); n++) { + if (RightsHelper.testRights(arrayRoleRights.get(n), menuList.get(i).getROUTE_ID())) { + menuList.get(i).setHasMenu(true); + if (Tools.notEmpty(menuList.get(i).getSHIRO_KEY()) && !"(无)".equals(menuList.get(i).getSHIRO_KEY())) { + shiroSet.add(menuList.get(i).getSHIRO_KEY()); + } + break; + } + } + } + if (b1) { //有此菜单权限才进行按钮权限判断 + if (Tools.notEmpty(menuList.get(i).getSHIRO_KEY()) && !"(无)".equals(menuList.get(i).getSHIRO_KEY())) { + + shiroSet.add(menuList.get(i).getSHIRO_KEY()); //把菜单权限标识放入shiro Set + + /*以下判断增删改查的按钮权限*/ + Boolean b_add = RightsHelper.testRights(uqxmap.get("adds").toString(), menuList.get(i).getROUTE_ID()); + if (b_add || "admin".equals(USERNAME)) { //判断主职角色此菜单下有无新增权限,有则把此菜单下的新增权限标识放入 shiro Set + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":add"); + } else if (null != uqxmap2 && null != uqxmap2.get("addsList")) { //无则继续判断副职角色权限 + for (int n = 0; n < uqxmap2.get("addsList").size(); n++) { + Boolean b_add_s = RightsHelper.testRights(uqxmap2.get("addsList").get(n), menuList.get(i).getROUTE_ID()); //判断第一个副职角色的此菜单的新增权限 + if (b_add_s) { //有则把此菜单下的新增权限标识放入 shiro Set, 并且跳出循环,无则继续循环判断其它副职的角色 + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":add"); + break; + } + } + } + Boolean b_del = RightsHelper.testRights(uqxmap.get("dels").toString(), menuList.get(i).getROUTE_ID()); + if (b_del || "admin".equals(USERNAME)) { //判断主职角色此菜单下有无删除权限,有则把此菜单下的删除权限标识放入 shiro Set + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":del"); + } else if (null != uqxmap2 && null != uqxmap2.get("delsList")) { //无则继续判断副职角色权限 + for (int n = 0; n < uqxmap2.get("delsList").size(); n++) { + Boolean b_del_s = RightsHelper.testRights(uqxmap2.get("delsList").get(n), menuList.get(i).getROUTE_ID()); //判断第一个副职角色的此菜单的删除权限 + if (b_del_s) { //有则把此菜单下的删除权限标识放入 shiro Set, 并且跳出循环,无则继续循环判断其它副职的角色 + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":del"); + break; + } + } + } + Boolean b_edit = RightsHelper.testRights(uqxmap.get("edits").toString(), menuList.get(i).getROUTE_ID()); + if (b_edit || "admin".equals(USERNAME)) { //判断主职角色此菜单下有无修改权限,有则把此菜单下的修改权限标识放入 shiro Set + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":edit"); + } else if (null != uqxmap2 && null != uqxmap2.get("editsList")) { //无则继续判断副职角色权限 + for (int n = 0; n < uqxmap2.get("editsList").size(); n++) { + Boolean b_edit_s = RightsHelper.testRights(uqxmap2.get("editsList").get(n), menuList.get(i).getROUTE_ID()); //判断第一个副职角色的此菜单的修改权限 + if (b_edit_s) { //有则把此菜单下的修改权限标识放入 shiro Set, 并且跳出循环,无则继续循环判断其它副职的角色 + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":edit"); + break; + } + } + } + Boolean b_cha = RightsHelper.testRights(uqxmap.get("chas").toString(), menuList.get(i).getROUTE_ID()); + if (b_cha || "admin".equals(USERNAME)) { //判断主职角色此菜单下有无查看权限,有则把此菜单下的查看权限标识放入 shiro Set + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":cha"); + } else if (null != uqxmap2 && null != uqxmap2.get("chasList")) { //无则继续判断副职角色权限 + for (int n = 0; n < uqxmap2.get("chasList").size(); n++) { + Boolean b_cha_s = RightsHelper.testRights(uqxmap2.get("chasList").get(n), menuList.get(i).getROUTE_ID()); //判断第一个副职角色的此菜单的查看权限 + if (b_cha_s) { //有则把此菜单下的查看权限标识放入 shiro Set, 并且跳出循环,无则继续循环判断其它副职的角色 + shiroSet.add(menuList.get(i).getSHIRO_KEY().split(":")[0] + ":cha"); + break; + } + } + } + } + } + if (menuList.get(i).isHasMenu()) { //判断是否有此菜单权限 + this.readRoute(USERNAME, menuList.get(i).getSubMenu(), roleRights, arrayRoleRights, shiroSet, uqxmap, uqxmap2);//是:继续排查其子菜单 + } + } + return menuList; + } + /**获取副职角色权限List * @param ROLE_IDS 副职角色ID列表 * @return diff --git a/src/main/java/com/zcloud/controller/system/RouteController.java b/src/main/java/com/zcloud/controller/system/RouteController.java new file mode 100644 index 0000000..3808fe1 --- /dev/null +++ b/src/main/java/com/zcloud/controller/system/RouteController.java @@ -0,0 +1,130 @@ +package com.zcloud.controller.system; + +import com.alibaba.fastjson.JSONObject; +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.PageData; +import com.zcloud.entity.Result; +import com.zcloud.service.system.FHlogService; +import com.zcloud.service.system.RouteService; +import com.zcloud.util.Jurisdiction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +/** + * 说明:菜单管理处理类 + * 作者:luoxiaobao + * 官网:www.qdkjchina.com + */ +@Controller +@RequestMapping("/route") +public class RouteController extends BaseController { + + @Autowired + private RouteService routeService; + @Autowired + private FHlogService FHLOG; + + /** + * @Description: 菜单列表 + * @Author: dearLin + * @Date: 2023/6/9/009 9:28 + * @Param: [java.lang.String] [ROUTE_ID] + * @Return: java.lang.Object + */ + @RequestMapping(value = "/treeAll") + @ResponseBody + public Result routeTreeAll() throws Exception { + Result result = new Result(); + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("ROUTE_ID", "0"); + List menuList = routeService.treeAll(pd); + result.put("menuList", menuList); + return result; + } + + + /** + * @Description: 菜单新增 + * @Author: dearLin + * @Date: 2023/6/9/009 10:19 + * @Param: [java.util.Map] [data] + * @Return: com.zcloud.entity.R + */ + @RequestMapping(value = "/add") +// @RequiresPermissions("route:add") + @ResponseBody + public Result routeAdd() throws Exception { + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("ROUTE_ID", String.valueOf(Integer.parseInt(routeService.findMaxId(pd).get("MID").toString()) + 1)); + pd.put("ROUTE_ICON", ""); //默认无路由图标 + routeService.add(pd); //新增路由 + FHLOG.save(Jurisdiction.getUsername(), "新增路由:" + ((JSONObject) JSONObject.parse(pd.getString("META"))).getString("title")); //记录日志 + return Result.ok(); + } + + + /** + * @Description: 菜单修改 + * @Author: dearLin + * @Date: 2023/6/9/009 10:19 + * @Param: [java.util.Map] [data] + * @Return: com.zcloud.entity.R + */ + @RequestMapping(value = "/edit") +// @RequiresPermissions("route:edit") + @ResponseBody + public Result routeEdit() throws Exception { + PageData pd = new PageData(); + pd = this.getPageData(); + routeService.edit(pd); + FHLOG.save(Jurisdiction.getUsername(), "修改路由:" + ((JSONObject) JSONObject.parse(pd.getString("META"))).getString("title")); //记录日志 + return Result.ok(); + } + + + @RequestMapping(value = "/delete") +// @RequiresPermissions("route:del") + @ResponseBody + public Result routeDelete() throws Exception { + PageData pd = new PageData(); + pd = this.getPageData(); + String ROUTE_ID = pd.getString("ROUTE_ID"); + if (routeService.listSubRouteByParentId(ROUTE_ID).size() > 0) {//判断是否有子路由,是:不允许删除 + return Result.error("请先删除子路由"); + } else { + routeService.delete(ROUTE_ID); + FHLOG.save(Jurisdiction.getUsername(), "删除的路由ID为:" + ROUTE_ID); //记录日志 + } + return Result.ok(); + } + + /** + * 新增菜单 + * + * @param + * @return + */ + @RequestMapping(value = "/icon") +// @RequiresPermissions("route:edit") + @ResponseBody + public Object icon() throws Exception { + Result result = new Result(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData route = routeService.findById(pd); + JSONObject metaJson = JSONObject.parseObject(route.getString("META")); + metaJson.put("icon", pd.getString("ICON")); + route.put("META", metaJson.toJSONString()); + routeService.edit(route); + result.put("result", errInfo); + return result; + } + +} diff --git a/src/main/java/com/zcloud/entity/Result.java b/src/main/java/com/zcloud/entity/Result.java new file mode 100644 index 0000000..7c7c4d6 --- /dev/null +++ b/src/main/java/com/zcloud/entity/Result.java @@ -0,0 +1,146 @@ +package com.zcloud.entity; + +/** + * 说明:TODO + * 作者:wangxuan + * 官网:www.zcloudchina.com + */ + +import com.zcloud.util.CodeMessageEnum; +import org.apache.http.HttpStatus; + +import java.util.HashMap; +import java.util.Map; + +/** + * @description: R类 + **/ +public class Result extends HashMap { + /** + * 序列ID + */ + private static final long serialVersionUID = 1L; + + /** + * R的无参构造, 初始化信息 + */ + public Result() { + put("code", 0); + put("msg", "success"); + put("result", "success"); + } + + /** + * error1: 返回默认error + * + * @return 返回默认error + */ + public static Result error() { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常, 请联系管理员"); + } + + /** + * error2 + * + * @param msg 错误信息 + * @return 返回自定义信息的error + */ + public static Result error(String msg) { + return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg); + } + + public static Result error(CodeMessageEnum codeMessageEnum, String uri) { + return error(codeMessageEnum.getCode(), codeMessageEnum.getMessage(), uri); + } + + /** + * 原先R的code和msg被覆盖 + * + * @param code 错误码 + * @param msg 错误信息 + * @return 自定义的错误码和错误信息 + */ + public static Result error(int code, String msg) { + Result r = new Result(); + r.put("code", code); + r.put("result", "error"); + r.put("msg", msg); + return r; + } + + public static Result error(String code, String msg) { + Result r = new Result(); + r.put("code", code); + r.put("result", "error"); + r.put("msg", msg); + return r; + } + + public static Result error(String code, String msg, String uri) { + Result r = new Result(); + r.put("code", code); + r.put("result", "error"); + r.put("msg", msg); + r.put("uri", uri); + return r; + } + + /** + * ok1 + * 加入了msg + * + * @param msg + * @return + */ + public static Result ok(String msg) { + Result r = new Result(); + r.put("msg", msg); + return r; + } + + /** + * ok2: 加入了map + * + * @param map + * @return + */ + public static Result ok(Map map) { + Result r = new Result(); + r.putAll(map); + return r; + } + + /** + * ok3: 直接返回"0", "success" + * + * @return + */ + public static Result ok() { + return new Result(); + } + + /** + * 放入自定义的key和value, 然后返回 + * + * @param key + * @param value + * @return + */ + @Override + public Result put(String key, Object value) { + super.put(key, value); + return this; + } + + /** + * 得到这个对象的code + * + * @return + */ + public Integer getCode() { + return (Integer) this.get("code"); + } +} + + + diff --git a/src/main/java/com/zcloud/entity/system/Route.java b/src/main/java/com/zcloud/entity/system/Route.java new file mode 100644 index 0000000..22e1d59 --- /dev/null +++ b/src/main/java/com/zcloud/entity/system/Route.java @@ -0,0 +1,167 @@ +package com.zcloud.entity.system; + +import java.io.Serializable; +import java.util.List; + +/** + * 说明:路由(菜单)实体类 + * 作者:luoxiaobao + * 官网:www.qdkjchina.com + */ +public class Route implements Serializable { + private String ROUTE_ID; //菜单ID + private String PARENT_ID; // 上级菜单ID + private String PARENT_IDS; // 上级菜单串 + private String PATH; // 路由地址 + private String REDIRECT; // 路由重定向地址 + private String COMPONENT; // 文件位置(非子节点均填children) + private String META; // 菜单扩展字段(json格式) + private String ROUTE_ORDER; // 菜单排序 + private String ROUTE_ICON; // 菜单图标 + private String ROUTE_STATE; // + private String SHIRO_KEY; // + private String SHOW_MODEL; // + private String ROUTE_TYPE; // + private String ROUTE_NAME; + + + private String target; + private List subMenu; + private boolean hasMenu = false; + + public String getROUTE_ID() { + return ROUTE_ID; + } + + public void setROUTE_ID(String ROUTE_ID) { + this.ROUTE_ID = ROUTE_ID; + } + + public String getPARENT_ID() { + return PARENT_ID; + } + + public void setPARENT_ID(String PARENT_ID) { + this.PARENT_ID = PARENT_ID; + } + + public String getPARENT_IDS() { + return PARENT_IDS; + } + + public void setPARENT_IDS(String PARENT_IDS) { + this.PARENT_IDS = PARENT_IDS; + } + + public String getPATH() { + return PATH; + } + + public void setPATH(String PATH) { + this.PATH = PATH; + } + + public String getREDIRECT() { + return REDIRECT; + } + + public void setREDIRECT(String REDIRECT) { + this.REDIRECT = REDIRECT; + } + + public String getCOMPONENT() { + return COMPONENT; + } + + public void setCOMPONENT(String COMPONENT) { + this.COMPONENT = COMPONENT; + } + + public String getMETA() { + return META; + } + + public void setMETA(String META) { + this.META = META; + } + + public String getROUTE_ORDER() { + return ROUTE_ORDER; + } + + public void setROUTE_ORDER(String ROUTE_ORDER) { + this.ROUTE_ORDER = ROUTE_ORDER; + } + + public String getROUTE_ICON() { + return ROUTE_ICON; + } + + public void setROUTE_ICON(String ROUTE_ICON) { + this.ROUTE_ICON = ROUTE_ICON; + } + + public String getROUTE_STATE() { + return ROUTE_STATE; + } + + public void setROUTE_STATE(String ROUTE_STATE) { + this.ROUTE_STATE = ROUTE_STATE; + } + + public String getSHIRO_KEY() { + return SHIRO_KEY; + } + + public void setSHIRO_KEY(String SHIRO_KEY) { + this.SHIRO_KEY = SHIRO_KEY; + } + + public String getSHOW_MODEL() { + return SHOW_MODEL; + } + + public void setSHOW_MODEL(String SHOW_MODEL) { + this.SHOW_MODEL = SHOW_MODEL; + } + + public String getROUTE_TYPE() { + return ROUTE_TYPE; + } + + public void setROUTE_TYPE(String ROUTE_TYPE) { + this.ROUTE_TYPE = ROUTE_TYPE; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public List getSubMenu() { + return subMenu; + } + + public void setSubMenu(List subMenu) { + this.subMenu = subMenu; + } + + public boolean isHasMenu() { + return hasMenu; + } + + public void setHasMenu(boolean hasMenu) { + this.hasMenu = hasMenu; + } + + public String getROUTE_NAME() { + return ROUTE_NAME; + } + + public void setROUTE_NAME(String ROUTE_NAME) { + this.ROUTE_NAME = ROUTE_NAME; + } +} diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/EightWorkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/EightWorkMapper.java new file mode 100644 index 0000000..77095f3 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/EightWorkMapper.java @@ -0,0 +1,25 @@ +package com.zcloud.mapper.datasource.eightwork; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:有限空间作业 + * 作者:luoxiaobao + * 时间:2021-09-13 + * 官网:www.zcloudchina.com + */ +public interface EightWorkMapper { + + + + /**列表 + * @param page + * @throws Exception + */ + List datalist(Page page); + +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java index b9647f2..721cc7c 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java @@ -18,8 +18,12 @@ public interface HotworkMapper { void editGasTime(PageData pd); void editStep(PageData pd); List datalistPage(Page page); - void cancel(PageData pd); + + List namelist(PageData pd); + List listAllMeasures(); List checkWorkCount(PageData pd); + + List getFlowList(PageData pd); } diff --git a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkSignMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkSignMapper.java index 60ce6fe..2b7a065 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkSignMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkSignMapper.java @@ -28,6 +28,8 @@ public interface HotworkSignMapper { */ List listById(PageData pd); + List listAll(PageData sign); + /**根据动火ID查询未签字列表 * @throws Exception */ diff --git a/src/main/java/com/zcloud/mapper/datasource/system/RouteMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/RouteMapper.java new file mode 100644 index 0000000..f878ec5 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/system/RouteMapper.java @@ -0,0 +1,68 @@ +package com.zcloud.mapper.datasource.system; + +import com.zcloud.entity.PageData; +import com.zcloud.entity.system.Route; + +import java.util.List; + +/** + * 说明:菜单Mapper + * 作者:luoxiaobao + * 官网:www.qdkjchina.com + */ +public interface RouteMapper { + + /**新增菜单 + * @param pd + */ + void add(PageData pd); + + /**保存修改菜单 + * @param pd + */ + void edit(PageData pd); + + /** + * 通过菜单ID获取数据 + * @param pd + * @return + */ + PageData findById(PageData pd); + + /**获取最大的菜单ID + * @param pd + * @return + */ + PageData findMaxId(PageData pd); + + /**通过ID获取其子一级菜单 + * @param parentId + * @return + */ + List listSubRouteByParentId(String parentId); + + /**通过ID获取其子一级菜单 + * @param parentId + * @return + */ + List listRouteByParentId(String parentId); + + /**删除菜单 + * @param ROUTE_ID + */ + void delete(String ROUTE_ID); + + /**保存菜单图标 + * @param pd + * @return + */ + void editicon(PageData pd); + + /**获取所有菜单 + * @param pd + * @return + */ + List listAll(PageData pd); + + +} diff --git a/src/main/java/com/zcloud/service/eightwork/EightWorkService.java b/src/main/java/com/zcloud/service/eightwork/EightWorkService.java index 9f41d9f..9f30af1 100644 --- a/src/main/java/com/zcloud/service/eightwork/EightWorkService.java +++ b/src/main/java/com/zcloud/service/eightwork/EightWorkService.java @@ -1,5 +1,6 @@ package com.zcloud.service.eightwork; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import java.util.List; @@ -10,4 +11,11 @@ import java.util.List; */ public interface EightWorkService { public List getTaskSetps(PageData pd); + PageData checkWork(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index e0e6cd7..44d8446 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -22,12 +22,12 @@ public interface HotworkService { void nextStep(PageData pd, MultipartFile[] files) throws Exception; - void accept(PageData pd)throws Exception; - - void cancel(PageData pd) throws Exception; + public List namelist(PageData pd)throws Exception; PageData findById(PageData pd) throws Exception; + PageData listSignFinished(PageData pd) throws Exception; + PageData checkWorkCount(PageData pd); //获取所有措施(bus_hotwork_measures) @@ -39,6 +39,7 @@ public interface HotworkService { // //获取所有签字完成的措施(bus_hotworktomeasures) List listSignFinishMeasures(PageData pd) throws Exception; - void saveGas(PageData pd,MultipartFile file) throws Exception; + void saveGas(PageData pd,MultipartFile[] files) throws Exception; + List getFlowList(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java index d2a0984..6a6f0b6 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java @@ -1,5 +1,6 @@ package com.zcloud.service.eightwork.impl; +import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.eightwork.EightWorkFlowLogMapper; import com.zcloud.mapper.datasource.eightwork.EightWorkTaskFlowMapper; @@ -7,6 +8,7 @@ import com.zcloud.service.eightwork.EightWorkService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.zcloud.mapper.datasource.eightwork.EightWorkMapper; import java.util.List; @@ -21,8 +23,26 @@ public class EightWorkServiceImpl implements EightWorkService { private EightWorkTaskFlowMapper eightWorkTaskFlowMapper; @Autowired private EightWorkFlowLogMapper eightWorkFlowLogMapper; + @Autowired + private EightWorkMapper eightworkMapper; + + @Override public List getTaskSetps(PageData pd) { return eightWorkTaskFlowMapper.getTaskSetps(pd); } + + @Override + public PageData checkWork(PageData pd) { + return null; + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return eightworkMapper.datalist(page); + } + } diff --git a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java index cfdbd48..f31475f 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -45,8 +45,8 @@ public class HotworkServiceImpl implements HotworkService { @Autowired private Smb smb; - private final static String primary_key = "HOTWORK_ID"; - private final static String work_type = "HOTWORK"; + private final String primary_key = "HOTWORK_ID"; + private final String work_type = "HOTWORK"; @Override @Transactional public void save(PageData pd) throws Exception { @@ -99,82 +99,100 @@ public class HotworkServiceImpl implements HotworkService { return hotworkMapper.datalistPage(page); } + public List namelist(PageData pd)throws Exception{ + return hotworkMapper.namelist(pd); + } + /* * 下一步 */ @Override @Transactional public void nextStep(PageData pd, MultipartFile[] files) throws Exception { + PageData work = this.findById(pd); + work.putAll(pd); List filePaths = new ArrayList<>(); for (int i = 0; i < files.length; i++) { //保存签名文件 String ffile = DateUtil.getDays(); String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - filePaths.add(Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile); + filePaths.add(Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); } - PageData flow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID")); - pd.put("STEP_ID", flow.get("NEXT_STEP_ID")); + PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); + work.put("STEP_ID", flow.get("NEXT_STEP_ID")); //保存签名信息 PageData sign = new PageData(); - sign.put(primary_key, pd.get(primary_key)); - sign.put("STEP_ID", pd.get("STEP_ID")); - sign.put("SIGN_USER_ID", pd.get("USER_ID")); - sign.put("SIGN_TIME", pd.getString("SIGNTIME")); + sign.put(primary_key, work.get(primary_key)); + sign.put("STEP_ID", work.get("STEP_ID")); + sign.put("SIGN_USER_ID", work.get("USER_ID")); + sign.put("SIGN_TIME", work.getString("SIGNTIME")); sign.put("SIGN_PATH", String.join(",",filePaths)); - sign.put("DESCR", pd.get("DESCR")); + sign.put("DESCR", work.get("DESCR")); hotworkSignMapper.edit(sign); - if (pd.get("MEASURES") != null && !pd.get("MEASURES").equals("")) { //安全措施确认步骤 - saveMeasures(pd); + if (work.get("MEASURES") != null && !work.get("MEASURES").equals("")) { //安全措施确认步骤 + saveMeasures(work); } List unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表 - if(unsignedList == null || unsignedList.size() == 0){//如果没有未签人 则跳转下一步 + if((unsignedList == null || unsignedList.size() == 0) && pd.getString("APPLY_STATUS").equals("1")){//如果没有未签人 则跳转下一步 + hotworkMapper.editStep(work); - hotworkMapper.editStep(pd); - - if (pd.get("PREPARERS") != null && !pd.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 - savePreparers(pd,flow); - } //保存日志 - saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"1"); + saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"1"); - PageData currentflow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID")); - saveNextSigner(pd,currentflow); + PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); + if("99".equals(currentflow.getString("NEXT_STEP_ID"))){ + return; + } + if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 + savePreparers(work,currentflow); + } + saveNextSigner(work,currentflow); + }else if(pd.getString("APPLY_STATUS").equals("-1")){ + //保存日志 + saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"-1"); + + work.put("STEP_ID",-1); + hotworkMapper.editStep(work); } } - /** - * 验收归档 - */ - @Override - public void accept(PageData pd)throws Exception{ - PageData flow = getStep(pd.get("TASK_ID"), 99); - hotworkMapper.edit(pd); - saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"1"); - } - - /** - * 取消 - */ - @Override - @Transactional - public void cancel(PageData pd)throws Exception{ - PageData flow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID")); - saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"-1"); - pd.put("STEP_ID", -1); - hotworkMapper.editStep(pd); - } - @Override public PageData findById(PageData pd) throws Exception { PageData pageData = hotworkMapper.findById(pd); return pageData; } + @Override + public PageData listSignFinished(PageData pd) throws Exception { + Map> rmap = new HashMap<>(); + List varList = hotworkSignMapper.listAll(pd); + if (varList != null && !varList.isEmpty()) { + varList.stream().forEach(item -> { + PageData sign = new PageData(); + sign.put("SIGN_PATH", item.getString("SIGN_PATH").split(",")); + sign.put("SIGN_TIME", item.getString("SIGN_TIME").split(",")); + sign.put("DESCR", item.getString("DESCR") != null ? item.getString("DESCR") : "无"); + if(rmap.containsKey(item.getString("CODE"))){ + rmap.get(item.getString("CODE")).add(sign); + }else{ + List signs = new ArrayList<>(); + signs.add(sign); + rmap.put(item.getString("CODE"),signs); + } + }); + } + PageData rpd = new PageData(); + if (rmap != null && !rmap.isEmpty()) { + rpd.putAll(rmap); + } + return rpd; + } + @Override public PageData checkWorkCount(PageData pd) { PageData rpd = new PageData(); @@ -208,48 +226,66 @@ public class HotworkServiceImpl implements HotworkService { @Override @Transactional - public void saveGas(PageData pd,MultipartFile file) throws Exception { + public void saveGas(PageData pd, MultipartFile[] files) throws Exception { PageData work = hotworkMapper.findById(pd); - String ffile = DateUtil.getDays(); - String fileName = UuidUtil.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); - smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); - String filePath = Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName; + List filePaths = new ArrayList<>(); + for (int i = 0; i < files.length; i++) { + //保存签名文件 + String ffile = DateUtil.getDays(); + String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile); + filePaths.add(Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + } pd.put("HOTWORKGAS_ID", UuidUtil.get32UUID()); //主键 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 - pd.put("SIGN_PATH", filePath); + pd.put("SIGN_PATH", String.join(",",filePaths)); hotworkGasMapper.save(pd); hotworkMapper.editGasTime(pd);//修改最后一次气体检测时间 PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); if (pd.get("APPLY_STATUS").equals("1")) { //如果通过 - if(flow.get("NEXT_STEP_ID") != null && flow.getString("NEXT_STEP_ID").equals("2")){//如果为气体检测步骤,则保存日志并跳转下一步 + if(flow.get("NEXT_STEP_ID") != null && flow.getString("NEXT_STEP_ID").equals("2")) {//如果为气体检测步骤,则保存日志并跳转下一步 PageData sign = new PageData(); sign.put(primary_key, work.get(primary_key)); sign.put("STEP_ID", 2); sign.put("SIGN_USER_ID", pd.get("USER_ID")); sign.put("SIGN_TIME", DateUtil.date2Str(new Date())); - sign.put("SIGN_PATH", filePath); + sign.put("SIGN_PATH", String.join(",", filePaths)); sign.put("DESCR", pd.get("DESCR")); hotworkSignMapper.edit(sign); - work.put("STEP_ID", flow.get("NEXT_STEP_ID")); hotworkMapper.editStep(work); //保存日志 - saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"1"); + saveLog(work, work.getString(flow.get("ACTOR_FIELD")), "1"); //预存下一步 PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); - saveNextSigner(work,currentflow); - + saveNextSigner(work, currentflow); } - }else{ + }else if(pd.getString("APPLY_STATUS").equals("-1")){ + PageData sign = new PageData(); + sign.put(primary_key, work.get(primary_key)); + sign.put("STEP_ID", 2); + sign.put("SIGN_USER_ID", pd.get("USER_ID")); + sign.put("SIGN_TIME", DateUtil.date2Str(new Date())); + sign.put("SIGN_PATH", String.join(",", filePaths)); + sign.put("DESCR", pd.get("DESCR")); + hotworkSignMapper.edit(sign); + //保存日志 saveLog(work,pd.getString("USER_ID"),"-2"); - work.put("STEP_ID", -1); + work.put("STEP_ID",-1); hotworkMapper.editStep(work); + } } + @Override + public List getFlowList(PageData pd) throws Exception { + pd=findById(pd); + return hotworkMapper.getFlowList(pd); + } + private void saveNextSigner(PageData pd,PageData flow) throws Exception { pd.put("STEP_ID",flow.get("NEXT_STEP_ID")); @@ -270,21 +306,19 @@ public class HotworkServiceImpl implements HotworkService { } private void saveMeasures(PageData pd) { - List list = (List) JSON.parse(pd.get("PREPARERS").toString()); + List list = (List) JSON.parse(pd.get("MEASURES").toString()); for (JSONObject json : list) { - if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null - && json.get("USER_ID") != "") { - PageData measure = new PageData(); - measure.put("HOTWORKTOMEASURES_ID",json.get("BUS_HOTWORK_MEASURES_ID")); - measure.put("STATUS", json.get("STATUS")); - measure.put("ANSWER1", json.get("ANSWER1")); - measure.put("ANSWER2", json.get("ANSWER2")); - measure.put("ANSWER3", json.get("ANSWER3")); - measure.put("ANSWER4", json.get("ANSWER4")); - measure.put("SIGN_PATH", json.get("SIGN_PATH")); - measure.put("IMG_PATH", json.get("IMG_PATH")); - hotworkToMeasuresMapper.edit(measure); - } + PageData measure = new PageData(); + measure.put("HOTWORKTOMEASURES_ID",json.get("HOTWORKTOMEASURES_ID")); + measure.put("STATUS", json.get("STATUS")); + measure.put("ANSWER1", json.get("ANSWER1")); + measure.put("ANSWER2", json.get("ANSWER2")); + measure.put("ANSWER3", json.get("ANSWER3")); + measure.put("ANSWER4", json.get("ANSWER4")); + measure.put("SIGN_PATH", json.get("SIGN_PATH")); + measure.put("SIGN_TIME", json.get("SIGN_TIME")); + measure.put("IMG_PATH", json.get("IMG_PATH")); + hotworkToMeasuresMapper.edit(measure); } } @@ -292,15 +326,12 @@ public class HotworkServiceImpl implements HotworkService { List signers = new ArrayList<>(); List list = (List) JSON.parse(pd.get("PREPARERS").toString()); for (JSONObject json : list) { - if (json.get("DEPARTMENT_ID") != null && json.get("DEPARTMENT_ID") != "" && json.get("USER_ID") != null - && json.get("USER_ID") != "") { - PageData preparer = new PageData(); - preparer.put("HOTWORKTOMEASURES_ID", UuidUtil.get32UUID()); // 主键 - preparer.put("HOTWORK_ID", pd.get("HOTWORK_ID")); - preparer.put("BUS_HOTWORK_MEASURES_ID", json.get("BUS_HOTWORK_MEASURES_ID")); - preparer.put("CONFIRM_ID", json.get("USER_ID")); - signers.add(preparer); - } + PageData preparer = new PageData(); + preparer.put("HOTWORKTOMEASURES_ID", UuidUtil.get32UUID()); // 主键 + preparer.put("HOTWORK_ID", pd.get("HOTWORK_ID")); + preparer.put("BUS_HOTWORK_MEASURES_ID", json.get("BUS_HOTWORK_MEASURES_ID")); + preparer.put("CONFIRM_ID", json.get("USER_ID")); + signers.add(preparer); } if(signers.size() > 0){ hotworkToMeasuresMapper.saveBatch(signers); diff --git a/src/main/java/com/zcloud/service/system/RouteService.java b/src/main/java/com/zcloud/service/system/RouteService.java new file mode 100644 index 0000000..c4ded87 --- /dev/null +++ b/src/main/java/com/zcloud/service/system/RouteService.java @@ -0,0 +1,86 @@ +package com.zcloud.service.system; + +import com.zcloud.entity.PageData; +import com.zcloud.entity.system.Route; + +import java.util.List; + +/** + * 说明:路由服务接口 + * 作者:luoxiaobao + * 官网:www.qdkjchina.com + */ +public interface RouteService { + + /**新增路由 + * @param pd + * @throws Exception + */ + public void add(PageData pd) throws Exception; + + /**保存修改路由 + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception; + + /**获取最大的路由ID + * @param pd + * @return + * @throws Exception + */ + public PageData findMaxId(PageData pd) throws Exception; + + /**通过ID获取其子一级路由 + * @param parentId + * @return + * @throws Exception + */ + public List listSubRouteByParentId(String parentId)throws Exception; + + /**通过ID获取其子一级路由 + * @param parentId + * @return + * @throws Exception + */ + public List listRouteByParentId(String parentId)throws Exception; + + /**获取所有路由并填充每个路由的子路由列表(系统路由列表) + * @param pd + * @return + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception; + + /**删除路由 + * @param ROUTE_ID + * @throws Exception + */ + public void delete(String ROUTE_ID) throws Exception; + + /**保存路由图标 + * @param pd + * @throws Exception + */ + public void editicon(PageData pd) throws Exception; + + /**获取所有路由 + * @param pd + * @return + */ + List treeAll(PageData pd) throws Exception; + + /**获取所有路由(集合) + * @param pd + * @return + */ + List listAll(PageData pd) throws Exception; + + /**获取所有菜单并填充每个菜单的子菜单列表(系统菜单列表) + * @param MENU_ID + * @return + * @throws Exception + */ + List listAllMenuJur(String MENU_ID) throws Exception; + +} diff --git a/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java new file mode 100644 index 0000000..d532d2f --- /dev/null +++ b/src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java @@ -0,0 +1,237 @@ +package com.zcloud.service.system.impl; + +import com.alibaba.fastjson.JSONObject; +import com.zcloud.entity.PageData; +import com.zcloud.entity.system.Route; +import com.zcloud.mapper.datasource.system.RouteMapper; +import com.zcloud.service.system.RouteService; +import com.zcloud.util.Tools; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * 说明:菜单服务接口实现类 + * 作者:luoxiaobao + * 官网:www.qdkjchina.com + */ +@Service +@Transactional //开启事物 +public class RouteServiceImpl implements RouteService { + + @Autowired + private RouteMapper routeMapper; + + /** + * 新增菜单 + * + * @param pd + * @throws Exception + */ + // @CacheEvict(value="routecache", allEntries=true) + public void add(PageData pd) throws Exception { + routeMapper.add(pd); + } + + /** + * 保存修改菜单 + * + * @param pd + * @throws Exception + */ +// @CacheEvict(value="routecache", allEntries=true) + public void edit(PageData pd) throws Exception { + routeMapper.edit(pd); + } + + /** + * 通过菜单ID获取数据 + * + * @param pd + * @return + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return routeMapper.findById(pd); + } + + /** + * 获取最大的菜单ID + * + * @param pd + * @return + * @throws Exception + */ + public PageData findMaxId(PageData pd) throws Exception { + return routeMapper.findMaxId(pd); + } + + /** + * 通过ID获取其子一级菜单 + * + * @param parentId + * @return + * @throws Exception + */ + @Override +// @Cacheable(key = "'route-'+#parentId", value = "routecache") + public List listSubRouteByParentId(String parentId) throws Exception { + return routeMapper.listSubRouteByParentId(parentId); + } + + /** + * 通过ID获取其子一级菜单 + * + * @param parentId + * @return + * @throws Exception + */ + @Override +// @Cacheable(key = "'route-'+#parentId", value = "routecache") + public List listRouteByParentId(String parentId) throws Exception { + return routeMapper.listRouteByParentId(parentId); + } + + /** + * 删除菜单 + * + * @param ROUTE_ID + * @throws Exception + */ +// @CacheEvict(value="routecache", allEntries=true) + public void delete(String ROUTE_ID) throws Exception { + routeMapper.delete(ROUTE_ID); + } + + /** + * 保存菜单图标 + * + * @param pd + * @throws Exception + */ + @CacheEvict(value = "routecache", allEntries = true) + public void editicon(PageData pd) throws Exception { + routeMapper.editicon(pd); + } + + @Override + public List treeAll(PageData router) throws Exception { + List routeList = this.listRouteByParentId(router.get("ROUTE_ID").toString()); + if ("1".equals(router.getString("removePath"))) { + routeList.removeIf((item) -> Tools.isEmpty(item.getString("path"))); //去掉path为空的项 + } + for (PageData route : routeList) { + if ("0".equals(route.getString("ROUTE_ID"))) { + route.put("PARENT_NAME", "(无)"); + } else { + JSONObject meta = JSONObject.parseObject(route.getString("meta")); + route.put("PARENT_NAME", meta.getString("title")); + } + route.put("meta", JSONObject.parse(route.getString("meta"))); + if ("1".equals(router.getString("removePath"))) { + route.put("removePath", router.getString("removePath")); + } + route.put("children", this.treeAll(route)); + } + return routeList; + } + + +// @Override +// public List treeAll(PageData pd) throws Exception { +// List list = new ArrayList(); +// List routeList = routeMapper.listAll(pd); +// Map map = new HashMap(); +// for (PageData r : routeList) { +// r.put("meta", JSONObject.parse(r.getString("meta"))); +// map.put(r.getString("ROUTE_ID"), r); +// } +// +// Iterator> it = map.entrySet().iterator(); +// while (it.hasNext()) { +// Map.Entry entry = it.next(); +// PageData root = entry.getValue(); +// if ("0".equals(root.getString("PARENT_ID"))) { +// root.put("PARENT_NAME", "(无)"); +// list.add(entry.getValue()); +// it.remove();//使用迭代器的remove()方法删除元素 +// } +// } +// TreeAppendChildren(map, list); +// return list; +// } + + @Override + public List listAll(PageData pd) throws Exception { + return routeMapper.listAll(pd); + } + + + /** + * 获取所有菜单并填充每个菜单的子菜单列表(系统菜单列表)(递归处理) + * + * @param MENU_ID + * @return + * @throws Exception + */ + @Override + public List listAllMenuJur(String MENU_ID) throws Exception { + List routeList = this.listSubRouteByParentId(MENU_ID); + for (Route route : routeList) { + route.setSubMenu(this.listAllMenuJur(route.getROUTE_ID())); + route.setTarget("treeFrame"); + } + return routeList; + } + + + private void TreeAppendChildren(Map map, List list) { + if (!map.isEmpty()) { + for (PageData parent : list) { + List children = new ArrayList(); + Iterator> it = map.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry entry = it.next(); + PageData child = entry.getValue(); + if (parent.getString("ROUTE_ID").equals(child.getString("PARENT_ID"))) { + child.put("PARENT_NAME", ((JSONObject) parent.get("meta")).getString("title")); + children.add(child); + it.remove();//使用迭代器的remove()方法删除元素 + } + } + if (children.size() > 0) { + parent.put("children", children); + TreeAppendChildren(map, children); + } + } + } + } + +// private void TreeAppendChildren(Map map, List list) { +// if (!map.isEmpty()) { +// for (PageData parent : list) { +// List children = new ArrayList(); +// Iterator> it = map.entrySet().iterator(); +// while (it.hasNext()) { +// Map.Entry entry = it.next(); +// PageData child = entry.getValue(); +// if (parent.getString("ROUTE_ID").equals(child.getString("PARENT_ID"))) { +// child.put("PARENT_NAME", ((JSONObject) parent.get("meta")).getString("title")); +// children.add(child); +// it.remove();//使用迭代器的remove()方法删除元素 +// } +// } +// if (children.size() > 0) { +// parent.put("children", children); +// TreeAppendChildren(map, children); +// } +// } +// } +// } +} diff --git a/src/main/java/com/zcloud/util/BaseResultInterface.java b/src/main/java/com/zcloud/util/BaseResultInterface.java new file mode 100644 index 0000000..cff9df8 --- /dev/null +++ b/src/main/java/com/zcloud/util/BaseResultInterface.java @@ -0,0 +1,18 @@ +package com.zcloud.util; + +/** + * 说明:TODO + * 作者:wangxuan + * 官网:www.zcloudchina.com + */ +/** + * @desc 对象返回到前端以及异常抛出的接口类 + */ +public interface BaseResultInterface { + + + String getCode(); + + + String getMessage(); +} diff --git a/src/main/java/com/zcloud/util/CodeMessageEnum.java b/src/main/java/com/zcloud/util/CodeMessageEnum.java new file mode 100644 index 0000000..9ebdff2 --- /dev/null +++ b/src/main/java/com/zcloud/util/CodeMessageEnum.java @@ -0,0 +1,190 @@ +package com.zcloud.util; + +/** + * 说明:TODO + * 作者:wangxuan + * 官网:www.zcloudchina.com + */ +public enum CodeMessageEnum implements BaseResultInterface { + + /** ********* 0000成功 *************** */ + SUCCESS("0000", "成功!"), + SUCCESS_LOGIN("0001", "用户登录成功"), + SUCCESS_LOGOUT("0002", "用户退出成功"), + + /* 默认失败 */ + COMMON_FAIL("999", "失败"), + + /** ********* 1xxx系统错误 *************** */ + SERVER_BUSY("1001", "服务器正忙,请稍后再试!"), + INTERNAL_SERVER_ERROR("1002", "服务器内部错误"), + NOT_FOUND("1003", "未找到该资源!"), + REQUEST_METHOD_ERROR("1004", "接口请求方法异常"), + SQL_SYNTAX_ERROR_EXCEPTION("1005", "SQL语法错误异常"), + NULL_POINT_ERROR_EXCEPTION("1006", "空指针异常信息"), + INNER_FRAME_EXCEPTION("1007", "内部框架执行异常"), + PARSE_TOKEN_EXCEPTION("1008", "解析token异常"), + TOKEN_NOT_EXIST("1009", "token不存在"), + TOKEN_SIGNATURE_EXCEPTION("1010", "token签名异常"), + TOKEN_EXPIRE("1011", "token过期,请重新登录"), + IMG_TYPE_NOT_CONFIG("1012", "请配置图片类型"), + NOT_CONFIG_FILE_DIR("1013", "请配置文件路径"), + UPLOAD_FILE_ERROR("1014", "文件上传失败"), + FILE_NOT_EXIST("1015", "文件不存在"), + FILE_HAS_DELETED("1016", "文件已被删除"), + DRIVER_CLASS_NOT_FOUND("1017", "数据库的连接驱动正在加载中..."), + TRY_CONNECT_DATABASE_ERROR("1018", "尝试连接数据库失败"), + CLOSE_CONNECT_DATABASE_ERROR("1019", "关闭数据库连接失败"), + DATABASE_NAME_NOT_EXIST("1020", "数据库名称不存在"), + CLOSE_DATASOURCE_ERROR("1021", "释放数据库资源异常"), + DRUID_DATASOURCE_ERROR("1022", "数据源创建中..."), + CREATE_DATABASE_ERROR("1023", "创建数据库失败"), + CREATE_TABLE_ERROR("1024", "创建表失败"), + UPDATE_TABLE_FIELD_ERROR("1025", "更新表字段失败"), + DELETE_TABLE_FIELD_ERROR("1026", "删除表字段失败"), + QUERY_ROLE_ERROR("1027", "查询角色失败"), + UPDATE_GROUP_ERROR("1028", "更新接口组失败"), + DELETE_GROUP_ERROR("1029", "删除接口组失败"), + SAVE_INTERFACE_ERROR("1030", "保存接口信息失败"), + + /** + * ******2xxx参数错误 ********************* + */ + BODY_NOT_MATCH("2001", "请求的数据格式不符"), + SIGNATURE_NOT_MATCH("2002", "请求的数字签名不匹配!"), + REQUEST_PATH_NOT_MATCH("2003", "当前请求路径没有权限!"), + NOT_UPLOAD_FILE_NAME_ERROR("2004", "上传的文件名不存在,请重新上传"), + NOT_SUPPORT_IMG_TYPE("2005", "图片格式不正确,请重新上传"), + NOT_SUPPORT_USERNAME_TYPE("2006", "excel用户名不能为空"), + NOT_SUPPORT_ROLE_TYPE("2007", "角色不存在"), + NOT_SUPPORT_DEPT_TYPE("2008", "部门不存在"), + SQL_INJECT_NOT_ALLOWED("2009", "参数中存在数据库关键字,请修改"), + TABLE_FIELD_NOT_EXIST("2010", "表字段不存在"), + + /** *********** 3xxx用户错误 ******************* */ + USER_NOT_LOGIN("3001", "用户未登录"), + USER_ACCOUNT_EXPIRED("3002", "账号已过期"), + USER_CREDENTIALS_ERROR("3003", "用户名或密码错误"), + USER_CREDENTIALS_EXPIRED("3004", "密码过期"), + USER_ACCOUNT_NOT_BIND_ENTERPRISE("3005", "当前账号未绑定企业"), + USER_ACCOUNT_LOCKED("3006", "账号被锁定"), + USER_ACCOUNT_NOT_EXIST("3007", "账号不存在"), + USER_ACCOUNT_ALREADY_EXIST("3008", "账号已存在"), + USER_ACCOUNT_USE_BY_OTHERS("3009", "账号下线"), + USER_NO_PERMISSION("3010", "当前账号没有此权限"), + USERNAME_NOT_BLANK("3011", "用户不能为空"), + USER_LOGIN_ERROR("3012", "用户登录失败"), + USER_LOGOUT_ERROR("3013", "用户退出失败"), + USER_ACCOUNT_USE_BY_OTHERS_ERROR("3014", "账号下线异常"), + USER_ACCESS_DENIED("3015", "权限认证失败"), + USERNAME_EXIST_ERROR("3016", "用户名重名"), + + ROLE_NAME_ALREADY_EXIST("3101", "角色已存在"), + + /** ********** 4xxx业务错误 *********************** */ + ENTERPRISE_NOT_EXIST("4001", "当前企业不存在"), + APP_KEY_EXIST("4002", "应用key已存在"), + APP_NOT_EXIST("4003", "应用不存在"), + APP_PAGE_NAME_EXIST("4004", "当前页面名称已存在"), + APP_PAGE_KEY_EXIST("4005", "当前页面key已存在"), + APP_PAGE_NOT_EXIST("4006", "当前页面不存在,或已删除"), + APP_PAGE_TYPE_ERROR("4007", "页面类型有误"), + APP_PAGE_HOME_IS_NOT_EXIST("4008", "请设置首页"), + CAN_NOT_DELETE_HOME_PAGE("4009", "请勿删除首页"), + DELETE_PAGE_ERROR("4010", "删除页面失败"), + CONFIG_CUSTOM_ERROR("4011", "配置自定义页面失败"), + APP_PAGE_PARENT_NOT_EXIST("4012", "当前页面的父级页面不存在,或已删除"), + DATASOURCE_NAME_EXIST("4013", "当前数据源名称已经存在,请修改后重试"), + DATASOURCE_NOT_EXIST("4014", "当前数据源不存在"), + DATASOURCE_HAS_DELETED("4015", "当前数据源已删除"), + MODEL_NOT_EXIST("4016", "当前模型不存在"), + MODEL_HAS_DELETED("4017", "当前模型已删除"), + MODEL_NAME_HAS_EXIST("4018", "当前模型名称已存在"), + DATASOURCE_NOT_CONFIG("4019", "数据源配置为空,请联系管理员"), + DATASOURCE_NOT_CONFIG_DIALECT("4020", "未配置数据源的类型"), + DATASOURCE_NOT_CONFIG_DRIVER_CLASS_NAME("4021", "未配置数据源的驱动"), + DEPT_USER_EXIST("4022", "部门下存在用户"), + NOT_CONFIG_PAGE_BUTTON_TYPE("4023", "未配置按钮雷星"), + MODEL_PAGE_RELATION_MODEL("4024", "已关联当前模型页面"), + MODEL_PAGE_NOT_EXIST("4025", "模型页面不存在或已被删除"), + MODEL_HAS_RELATION_MODEL_PAGE("4026", "当前模型已关联模型页面,不允许删除"), + FORM_NOT_EXIST("4027", "模型表单不存在"), + READ_FILE_ERROR("4028", "读取模型页面的模板文件失败"), + MODEL_PAGE_CONTENT_NULL("4029", "未配置模型页面的模板文件"), + NOT_CONFIG_QUERY_SQL("4030", "未配置查询语句"), + APP_PAGE_BUTTON_OPTION_VALUE_ERROR("4031", "未配置接口"), + DELETE_COLUMN_ERROR("4032", "删除当前失败"), + INSERT_DATA_ERROR("4033", "新建数据失败"), + EDIT_DATA_ERROR("4034", "编辑数据失败"), + DATASOURCE_HAS_MODELS("4035", "当前数据源存在模型,不允许删除"), + NOT_CONFIG_FORM_API("4036", "未配置模型表单页的接口信息"), + PLEASE_WRITE_AT_LEAST_DATA("4037", "请至少填写一行数据"), + AMIS_PAGE_ERROR("4038", "分页参数异常"), + QUERY_APP_PAGE_QUERY_FIELD_ERROR("4039", "查询搜素参数异常"), + REQUEST_PARAM_NOT_IN_APP_PAGE_QUERY_FIELD("4040", "请求参数不在查询数据表中"), + STYLE_LANGUAGE_ON_CSS("4041", "自定义css中的样式语言不能为空"), + APP_CONFIG_TYPE_NOT_EXIST("4042", "不支持当前应用设置的类型"), + APP_CONFIG_NOT_EXIST_OR_DELETED("4043", "当前设置不存在或已被删除"), + APP_HAS_CONFIG_ON_THIS_TYPE("4044", "当前应用设置的类型已存在,请更新"), + NOT_SUPPORT_COMPONENT_FRAME("4045", "不支持当前组件框架"), + NOT_SUPPORT_COMPONENT_TYPE("4046", "不支持当前组件类型"), + CURRENT_APP_KEY_EXIST("4047", "当前应用的组件key已存在"), + CREATE_CUSTOM_COMPONENT_ERROR("4048", "新增自定义组件失败"), + APP_CUSTOM_COMPONENT_NOT_EXIST("4049", "当前组件不存在或已被删除"), + UPDATE_CUSTOM_COMPONENT_ERROR("4050", "更新自定义组件失败"), + DELETED_CUSTOM_COMPONENT_ERROR("4051", "删除自定义组件失败"), + INSERT_COMPONENT_DEPENDENCE_ERROR("4052", "新增自定义组件依赖项失败"), + DELETE_COMPONENT_DEPENDENCE_ERROR("4053", "删除自定义组件依赖项失败"), + CURRENT_COMPONENT_DEPENDENCE_NOT_EXIST("4054", "当前自定义组件依赖项不存在或已被删除"), + CURRENT_APP_NAME_EXIST("4055", "当前应用的组件名称已存在"), + NOT_SUPPORT_DATASOURCE_FROM("4056", "不支持当前的数据库来源"), + JDBC_CONFIG_ERROR("4057", "平台内置的数据源配置有误"), + NOT_SUPPORT_MODEL_TYPE("4058", "不支持当前的页面模板"), + NOT_SUPPORT_CUSTOM_PAGE("4059", "暂不支持自定义页面"), + FORM_PAGE_ON_DEVELOPING("4060", "自定义页面的该功能正在开发中..."), + APP_PAGE_QUERY_FIELD_NOT_EXIST("4061", "当前查询条件不存在,或已被删除"), + APP_PAGE_BUTTON_NOT_EXIST("4062", "当前页面按钮不存在,或已被删除"), + TABLE_KEY_MORE_THEN_ONE("4063", "主键超过一个"), + TABLE_KEY_LESS_THEN_ONE("4064", "主键必须存在"), + TABLE_KEY_MUST_BE_INT("4065", "主键必须为整数类型"), + TABLE_FIELD_MUST_EXIST("4066", "必须存在表字段"), + CURRENT_MODEL_PAGE_HAS_CONVERSION_CUSTOM_PAGE("4067", "当前模型页面已转成自定义页面"), + NOT_SUPPORT_RELEASE_STATUS("4068", "发布版本状态有误"), + APP_FORM_BUTTON_NOT_EXIST("4067", "当前表单按钮不存在,或已被删除"), + DATASOURCE_KEY_EXIST_ERROR("4068","数据源key已存在") + ; + + CodeMessageEnum(String code, String message) { + this.code = code; + this.message = message; + } + + /** 返回到前端的code值 */ + private String code; + + /** 返回到前端的code对应的message值 */ + private String message; + + @Override + public String getCode() { + return this.code; + } + + @Override + public String getMessage() { + return this.message; + } + +// public static CodeVo getJsonObjectByCode(String code) { +// CodeVo codeVo = new CodeVo(); +// if (Tools.isEmpty(code)) { +// return codeVo; +// } +// for (CodeMessageEnum enumObj : CodeMessageEnum.values()) { +// if (enumObj.getCode().equals(code)) { +// return new CodeVo(code, enumObj.message); +// } +// } +// return codeVo; +// } +} diff --git a/src/main/java/com/zcloud/util/img.png b/src/main/java/com/zcloud/util/img.png deleted file mode 100644 index d087336..0000000 Binary files a/src/main/java/com/zcloud/util/img.png and /dev/null differ diff --git a/src/main/resources/mybatis/datasource/eightwork/EightWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/EightWorkMapper.xml new file mode 100644 index 0000000..fdfc9de --- /dev/null +++ b/src/main/resources/mybatis/datasource/eightwork/EightWorkMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index e988f9b..2aac41a 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -53,7 +53,8 @@ f.WORK_START_DEPARTMENT_ID, f.WORK_START_USER_ID, f.WORK_END_DEPARTMENT_ID, - f.WORK_END_USER_ID + f.WORK_END_USER_ID, + f.ACCEPT_TIME @@ -103,7 +104,8 @@ WORK_START_DEPARTMENT_ID, WORK_START_USER_ID, WORK_END_DEPARTMENT_ID, - WORK_END_USER_ID + WORK_END_USER_ID, + ACCEPT_TIME @@ -153,7 +155,8 @@ #{WORK_START_DEPARTMENT_ID}, #{WORK_START_USER_ID}, #{WORK_END_DEPARTMENT_ID}, - #{WORK_END_USER_ID} + #{WORK_END_USER_ID}, + #{ACCEPT_TIME} @@ -232,7 +235,8 @@ WORK_START_DEPARTMENT_ID=#{WORK_START_DEPARTMENT_ID}, WORK_START_USER_ID=#{WORK_START_USER_ID}, WORK_END_DEPARTMENT_ID=#{WORK_END_DEPARTMENT_ID}, - WORK_END_USER_ID=#{WORK_END_USER_ID} + WORK_END_USER_ID=#{WORK_END_USER_ID}, + ACCEPT_TIME = #{ACCEPT_TIME} where HOTWORK_ID = #{HOTWORK_ID} @@ -282,6 +286,28 @@ stau.`NAME` as WORK_START_USER_NAME, endo.`NAME` as WORK_END_DEPARTMENT_NAME, endu.`NAME` as WORK_END_USER_NAME, + confirm.SIGN_TIME as CONFIRM_USER_SIGNER_TIME, + confirm.SIGN_PATH as CONFIRM_USER_SIGNER_PATH, + IFNULL(confirm.DESCR,'无') as CONFIRM_CONTENT, + leader.SIGN_TIME as LEADER_USER_SIGNER_TIME, + leader.SIGN_PATH as LEADER_USER_SIGNER_PATH, + IFNULL(leader.DESCR,'无') as LEADER_CONTENT, + audit.SIGN_TIME as AUDIT_USER_SIGNER_TIME, + audit.SIGN_PATH as AUDIT_USER_SIGNER_PATH, + IFNULL(audit.DESCR,'无') as AUDIT_CONTENT, + approve.SIGN_TIME as APPROVE_USER_SIGNER_TIME, + approve.SIGN_PATH as APPROVE_USER_SIGNER_PATH, + IFNULL(approve.DESCR,'无') as APPROVE_CONTENT, + monitor.SIGN_TIME as MONITOR_USER_SIGNER_TIME, + monitor.SIGN_PATH as MONITOR_USER_SIGNER_PATH, + IFNULL(monitor.DESCR,'无') as MONITOR_CONTENT, + start.SIGN_TIME as WORK_START_USER_SIGNER_TIME, + start.SIGN_PATH as WORK_START_USER_SIGNER_PATH, + end.SIGN_TIME as WORK_END_USER_SIGNER_TIME, + end.SIGN_PATH as WORK_END_USER_SIGNER_PATH, + accept.SIGN_TIME as ACCEPT_USER_SIGNER_TIME, + accept.SIGN_PATH as ACCEPT_USER_SIGNER_PATH, + IFNULL(accept.DESCR,'无') as ACCEPT_CONTENT, f.ANALYZE_TIME FROM bus_hotwork AS f @@ -323,6 +349,15 @@ left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID + + left join bus_hotwork_sign confirm on confirm.HOTWORK_ID = f.HOTWORK_ID and confirm.STEP_ID = '8' + left join bus_hotwork_sign leader on leader.HOTWORK_ID = f.HOTWORK_ID and leader.STEP_ID = '9' + left join bus_hotwork_sign audit on audit.HOTWORK_ID = f.HOTWORK_ID and audit.STEP_ID = '10' + left join bus_hotwork_sign approve on approve.HOTWORK_ID = f.HOTWORK_ID and approve.STEP_ID = '11' + left join bus_hotwork_sign monitor on monitor.HOTWORK_ID = f.HOTWORK_ID and monitor.STEP_ID = '12' + left join bus_hotwork_sign start on start.HOTWORK_ID = f.HOTWORK_ID and start.STEP_ID = '13' + left join bus_hotwork_sign end on end.HOTWORK_ID = f.HOTWORK_ID and end.STEP_ID = '14' + left join bus_hotwork_sign accept on accept.HOTWORK_ID = f.HOTWORK_ID and accept.STEP_ID = '15' WHERE f.HOTWORK_ID = #{HOTWORK_ID} @@ -331,6 +366,15 @@ update set + + WORK_START_DATE = #{WORK_START_DATE}, + + + WORK_END_DATE = #{WORK_END_DATE}, + + + ACCEPT_TIME = #{ACCEPT_TIME}, + STEP_ID = #{STEP_ID} where HOTWORK_ID = #{HOTWORK_ID} @@ -413,6 +457,9 @@ left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc ) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.HOTWORK_ID where f.ISDELETE = '0' + + and f.CHECK_NO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%') + and exists ( select 1 from bus_hotwork_sign sign @@ -423,14 +470,33 @@ and step.STEP_NAME = #{pd.STEP_NAME} ) + + and log.NEXT_STEP_ID = #{pd.STEP_ID} + and f.CREATOR = #{pd.CREATOR} - and f.STEP_ID > 0 and f.STEP_ID != 100 and f.ANALYZE_USER_ID = #{pd.GASCHECK} + and f.STEP_ID > 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK} + + + + + diff --git a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml index d8b3f09..d534afc 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml @@ -100,13 +100,26 @@ order by f.SIGN_TIME desc + + diff --git a/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml index 390e949..96f0a4c 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml @@ -24,6 +24,7 @@ f.HOTWORKTOMEASURES_ID, f.CONFIRM_ID, f.SIGN_PATH, + f.SIGN_TIME, f.IMG_PATH @@ -77,7 +78,7 @@ HOTWORKTOMEASURES_ID, CONFIRM_ID ) values - + ( #{item.HOTWORK_ID}, #{item.BUS_HOTWORK_MEASURES_ID}, @@ -106,7 +107,8 @@ ANSWER3 = #{ANSWER3}, ANSWER4 = #{ANSWER4}, SIGN_PATH = #{SIGN_PATH}, - IMG_PATH = #{IMG_PATH} + IMG_PATH = #{IMG_PATH}, + SIGN_TIME = #{SIGN_TIME} where HOTWORKTOMEASURES_ID = #{HOTWORKTOMEASURES_ID} @@ -145,18 +147,22 @@ diff --git a/src/main/resources/mybatis/datasource/system/RouteMapper.xml b/src/main/resources/mybatis/datasource/system/RouteMapper.xml new file mode 100644 index 0000000..ad53392 --- /dev/null +++ b/src/main/resources/mybatis/datasource/system/RouteMapper.xml @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + SYS_ROUTE + + + + + ROUTE_ID, + PARENT_ID, + PARENT_IDS, + PATH, + REDIRECT, + COMPONENT, + META, + ROUTE_ORDER, + ROUTE_ICON, + ROUTE_STATE, + SHIRO_KEY, + SHOW_MODEL, + ROUTE_TYPE, + ROUTE_NAME + + + + + #{ROUTE_ID}, + #{PARENT_ID}, + #{PARENT_IDS}, + #{PATH}, + #{REDIRECT}, + #{COMPONENT}, + #{META}, + #{ROUTE_ORDER}, + #{ROUTE_ICON}, + #{ROUTE_STATE}, + #{SHIRO_KEY}, + #{SHOW_MODEL}, + #{ROUTE_TYPE}, + #{ROUTE_NAME} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + PARENT_ID = #{PARENT_ID}, + PARENT_IDS = #{PARENT_IDS}, + PATH = #{PATH}, + REDIRECT = #{REDIRECT}, + COMPONENT = #{COMPONENT}, + META = #{META}, + ROUTE_ORDER = #{ROUTE_ORDER}, + ROUTE_ICON = #{ROUTE_ICON}, + ROUTE_STATE = #{ROUTE_STATE}, + SHIRO_KEY = #{SHIRO_KEY}, + SHOW_MODEL = #{SHOW_MODEL}, + ROUTE_TYPE = #{ROUTE_TYPE}, + ROUTE_NAME = #{ROUTE_NAME} + where + ROUTE_ID=#{ROUTE_ID} + + + + + + + + + + + + + + + delete from + + where ROUTE_ID=#{ROUTE_ID} + + + + + update + + set + ROUTE_ICON = #{ICON} + where + ROUTE_ID=#{ROUTE_ID} + + + + + + + + + + +