Merge remote-tracking branch 'origin/dev' into dev

pull/4/head
dearlin 2024-01-25 14:20:40 +08:00
commit 84b0151796
26 changed files with 1940 additions and 211 deletions

View File

@ -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){

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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<PageData> 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<String> 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<String,Object> 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;
}
}

View File

@ -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<String, Object> map = new HashMap<>();
public Object listSignFinished() throws Exception {
Map<String,Object> 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<String,Object> map = new HashMap<>();
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "动火作业动火人及证书编号")
public Object namelist(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
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<PageData> 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<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
hotworkService.saveGas(pd,file);
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
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<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> flowList = hotworkService.getFlowList(pd);
map.put("flowList", flowList);
map.put("result", errInfo); //返回结果
return map;
}
}

View File

@ -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<String> {
@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<String> {
//
// @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);
// }
// }
//
//}
//

View File

@ -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<Menu> menuList = new ArrayList<Menu>();
Collection<String> shiroSet= new HashSet<String>(); //存放菜单权限标识
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<Menu> menuList = new ArrayList<Menu>();
// Collection<String> shiroSet= new HashSet<String>(); //存放菜单权限标识
// 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<Route> routeList = new ArrayList<Route>();
Collection<String> shiroSet = new HashSet<String>(); //存放菜单权限标识
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 shiroSET
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public List<Route> getAttributeRoute(Session session, String USERNAME, String roleRights, List<String> arrayRoleRights, Map<String, String> uqxmap, Map<String, List<String>> uqxmap2, Collection<String> shiroSet) throws Exception {
List<Route> allRouteList = new ArrayList<Route>();
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<Route>) session.getAttribute(USERNAME + Const.SESSION_ALLMENU);
}
return allRouteList;
}
/**
* ()
*
* @param USERNAME
* @param menuList
* @param roleRights
* @param arrayRoleRights
* @param shiroSet shiroSet
* @param uqxmap
* @param uqxmap2
* @return
*/
public List<Route> readRoute(String USERNAME, List<Route> menuList, String roleRights, List<String> arrayRoleRights, Collection<String> shiroSet, Map<String, String> uqxmap, Map<String, List<String>> 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

View File

@ -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<PageData> menuList = routeService.treeAll(pd);
result.put("menuList", menuList);
return result;
}
/**
* @Description:
* @Author: dearLin
* @Date: 2023/6/9/009 10:19
* @Param: [java.util.Map<java.lang.String, java.lang.String>] [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<java.lang.String, java.lang.String>] [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;
}
}

View File

@ -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<String, Object> {
/**
* 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);
}
/**
* Rcodemsg
*
* @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<String, Object> map) {
Result r = new Result();
r.putAll(map);
return r;
}
/**
* ok3: "0", "success"
*
* @return
*/
public static Result ok() {
return new Result();
}
/**
* keyvalue,
*
* @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");
}
}

View File

@ -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<Route> 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<Route> getSubMenu() {
return subMenu;
}
public void setSubMenu(List<Route> 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;
}
}

View File

@ -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<PageData> datalist(Page page);
}

View File

@ -18,8 +18,12 @@ public interface HotworkMapper {
void editGasTime(PageData pd);
void editStep(PageData pd);
List<PageData> datalistPage(Page page);
void cancel(PageData pd);
List<PageData> namelist(PageData pd);
List<PageData> listAllMeasures();
List<PageData> checkWorkCount(PageData pd);
List<PageData> getFlowList(PageData pd);
}

View File

@ -28,6 +28,8 @@ public interface HotworkSignMapper {
*/
List<PageData> listById(PageData pd);
List<PageData> listAll(PageData sign);
/**ID
* @throws Exception
*/

View File

@ -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<Route> listSubRouteByParentId(String parentId);
/**ID
* @param parentId
* @return
*/
List<PageData> listRouteByParentId(String parentId);
/**
* @param ROUTE_ID
*/
void delete(String ROUTE_ID);
/**
* @param pd
* @return
*/
void editicon(PageData pd);
/**
* @param pd
* @return
*/
List<PageData> listAll(PageData pd);
}

View File

@ -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<PageData> getTaskSetps(PageData pd);
PageData checkWork(PageData pd);
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
}

View File

@ -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<PageData> 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<PageData> listSignFinishMeasures(PageData pd) throws Exception;
void saveGas(PageData pd,MultipartFile file) throws Exception;
void saveGas(PageData pd,MultipartFile[] files) throws Exception;
List<PageData> getFlowList(PageData pd)throws Exception;
}

View File

@ -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<PageData> getTaskSetps(PageData pd) {
return eightWorkTaskFlowMapper.getTaskSetps(pd);
}
@Override
public PageData checkWork(PageData pd) {
return null;
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return eightworkMapper.datalist(page);
}
}

View File

@ -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<PageData> 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<String> 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<PageData> 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<String,List<PageData>> rmap = new HashMap<>();
List<PageData> 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<PageData> 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<String> 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<PageData> 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<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("PREPARERS").toString());
List<JSONObject> list = (List<JSONObject>) 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<PageData> signers = new ArrayList<>();
List<JSONObject> list = (List<JSONObject>) 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);

View File

@ -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<Route> listSubRouteByParentId(String parentId)throws Exception;
/**ID
* @param parentId
* @return
* @throws Exception
*/
public List<PageData> 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<PageData> treeAll(PageData pd) throws Exception;
/**(
* @param pd
* @return
*/
List<PageData> listAll(PageData pd) throws Exception;
/**()
* @param MENU_ID
* @return
* @throws Exception
*/
List<Route> listAllMenuJur(String MENU_ID) throws Exception;
}

View File

@ -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<Route> listSubRouteByParentId(String parentId) throws Exception {
return routeMapper.listSubRouteByParentId(parentId);
}
/**
* ID
*
* @param parentId
* @return
* @throws Exception
*/
@Override
// @Cacheable(key = "'route-'+#parentId", value = "routecache")
public List<PageData> 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<PageData> treeAll(PageData router) throws Exception {
List<PageData> 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<PageData> treeAll(PageData pd) throws Exception {
// List<PageData> list = new ArrayList<PageData>();
// List<PageData> routeList = routeMapper.listAll(pd);
// Map<String, PageData> map = new HashMap<String, PageData>();
// for (PageData r : routeList) {
// r.put("meta", JSONObject.parse(r.getString("meta")));
// map.put(r.getString("ROUTE_ID"), r);
// }
//
// Iterator<Map.Entry<String, PageData>> it = map.entrySet().iterator();
// while (it.hasNext()) {
// Map.Entry<String, PageData> 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<PageData> listAll(PageData pd) throws Exception {
return routeMapper.listAll(pd);
}
/**
* ()()
*
* @param MENU_ID
* @return
* @throws Exception
*/
@Override
public List<Route> listAllMenuJur(String MENU_ID) throws Exception {
List<Route> 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<String, PageData> map, List<PageData> list) {
if (!map.isEmpty()) {
for (PageData parent : list) {
List<PageData> children = new ArrayList<PageData>();
Iterator<Map.Entry<String, PageData>> it = map.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, PageData> 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<String, PageData> map, List<PageData> list) {
// if (!map.isEmpty()) {
// for (PageData parent : list) {
// List<PageData> children = new ArrayList<PageData>();
// Iterator<Map.Entry<String, PageData>> it = map.entrySet().iterator();
// while (it.hasNext()) {
// Map.Entry<String, PageData> 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);
// }
// }
// }
// }
}

View File

@ -0,0 +1,18 @@
package com.zcloud.util;
/**
* TODO
* wangxuan
* www.zcloudchina.com
*/
/**
* @desc
*/
public interface BaseResultInterface {
String getCode();
String getMessage();
}

View File

@ -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;
// }
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,57 @@
<?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.zcloud.mapper.datasource.eightwork.EightWorkMapper">
<!-- 列表 -->
<select id="datalist" parameterType="page" resultType="pd">
<!-- select
CONCAT_WS(" ","受限空间作业",f.CHECK_NO) as CHECK_NO,f.CONFINEDSPACE_ID as ID
from
bus_confinedspace f
where f.ISDELETE = '0' and f.STEP_ID &gt; 0 and f.STEP_ID &lt; 15 and f.CORPINFO_ID = #{pd.CORPINFO_ID}
union
select
CONCAT_WS(" ","盲板抽堵作业",b.CHECK_NO) as CHECK_NO,b.BLINDBOARD_ID as ID
from
bus_blindboard b
where b.CORPINFO_ID = #{pd.CORPINFO_ID} and b.STEP_ID &gt; 0 and b.STEP_ID &lt; 15 and b.ISDELETE = '0'
union
select
CONCAT_WS(" ","临时用电作业",e.CHECK_NO) as CHECK_NO,e.ELECTRICITY_ID as ID
from
bus_electricity e
where e.CORPINFO_ID = #{pd.CORPINFO_ID} and e.STEP_ID &gt; 0 and e.STEP_ID &lt; 15 and e.ISDELETE = '0'
union
select
CONCAT_WS(" ","吊装作业",g.CHECK_NO) as CHECK_NO,g.HOISTING_ID as ID
from
bus_hoisting g
where g.CORPINFO_ID = #{pd.CORPINFO_ID} and g.STEP_ID &gt; 0 and g.STEP_ID &lt; 15 and g.ISDELETE = '0'
union
select
CONCAT_WS(" ","动土作业",a.CHECK_NO) as CHECK_NO ,a.BREAKGROUND_ID as ID
from
bus_breakground a
where a.CORPINFO_ID = #{pd.CORPINFO_ID} and a.STEP_ID &gt; 0 and a.STEP_ID &lt; 15 and a.ISDELETE = '0'
union
select
CONCAT_WS(" ","断路作业",d.CHECK_NO) as CHECK_NO,d.CUTROAD_ID as ID
from
bus_cutroad d
where d.CORPINFO_ID = #{pd.CORPINFO_ID} and d.STEP_ID &gt; 0 and d.STEP_ID &lt; 15 and d.ISDELETE = '0'
union
select
CONCAT_WS(" ","高处作业",w.CHECK_NO) as CHECK_NO,w.HIGHWORK_ID as ID
from
bus_highwork w
where w.CORPINFO_ID = #{pd.CORPINFO_ID} and w.STEP_ID &gt; 0 and w.STEP_ID &lt; 15 and w.ISDELETE = '0'
union -->
select
CONCAT_WS(" ","动火作业",h.CHECK_NO) as CHECK_NO,h.HOTWORK_ID as ID
from
bus_hotwork h
where h.CORPINFO_ID = #{pd.CORPINFO_ID} and h.STEP_ID &gt; 0 and h.STEP_ID &lt; 15 and h.ISDELETE = '0'
</select>
</mapper>

View File

@ -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
</sql>
<!-- 字段用于新增 -->
@ -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
</sql>
<!-- 字段值 -->
@ -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}
</sql>
<!-- 获取编码 -->
@ -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}
</update>
@ -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}
</select>
@ -331,6 +366,15 @@
update
<include refid="tableName"></include>
set
<if test="WORK_START_DATE != null and WORK_START_DATE != ''"><!-- 关键词检索 -->
WORK_START_DATE = #{WORK_START_DATE},
</if>
<if test="WORK_END_DATE != null and WORK_END_DATE != ''"><!-- 关键词检索 -->
WORK_END_DATE = #{WORK_END_DATE},
</if>
<if test="ACCEPT_TIME != null and ACCEPT_TIME != ''"><!-- 关键词检索 -->
ACCEPT_TIME = #{ACCEPT_TIME},
</if>
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'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and f.CHECK_NO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
</if>
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
and exists (
select 1 from bus_hotwork_sign sign
@ -423,14 +470,33 @@
and step.STEP_NAME = #{pd.STEP_NAME}
)
</if>
<if test="pd.STEP_ID != null and pd.STEP_ID != ''"><!-- 关键词检索 -->
and log.NEXT_STEP_ID = #{pd.STEP_ID}
</if>
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
and f.CREATOR = #{pd.CREATOR}
</if>
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
and f.STEP_ID &gt; 0 and f.STEP_ID != 100 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
</if>
</select>
<select id="namelist" parameterType="pd" resultType="pd">
select
concat("姓名:",f.NAME,'',"编号:",f.CERTIFICATE_NUM) NAME
from
BUS_PERSONNELMANAGEMENT f
left join sys_dictionaries a on a.DICTIONARIES_ID = f.JOB_TYPE
left join bus_corp_info b on b.CORPINFO_ID = f.CORPINFO_ID
left join bus_units r on r.UNITS_ID = f.UNITS_ID
where f.ISDELETE = '0'
<if test="CORPINFO_ID != null and ORPINFO_ID != ''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
ORDER BY f.OPERATTIME DESC
</select>
<select id="checkWorkCount" parameterType="pd" resultType="pd" >
select
step.CODE,count(1) COUNT
@ -450,4 +516,29 @@
from
BUS_HOTWORK_MEASURES
</select>
<select id="getFlowList" resultType="pd">
select
step.STEP_NAME,
user.NAME as ACT_USER_NAME,
log.ACT_TIME,
log.STATUS,
cu.SIGN_USER,
cu.STEP_ID as CURRENT_STEP
from
bus_eightwork_task_flow flow
left join bus_eightwork_step step on step.STEP_ID = flow.STEP_ID
left join bus_eightwork_flow_log log on log.STEP_ID = flow.STEP_ID and
log.WORK_ID = #{HOTWORK_ID}
left join sys_user user on user.USER_ID = log.ACT_USER
left join (select sign.STEP_ID,GROUP_CONCAT(signer.NAME) sign_user from bus_hotwork_sign sign
left join sys_user signer on signer.USER_ID = sign.SIGN_USER_ID where sign.HOTWORK_ID = #{HOTWORK_ID}
and sign.SIGN_TIME is null) cu on cu.STEP_ID = step.STEP_ID
where
flow.TASK_ID = #{TASK_ID}
and
flow.STEP_ID != 0
order by
flow.ORDER_BY
</select>
</mapper>

View File

@ -100,13 +100,26 @@
order by f.SIGN_TIME desc
</select>
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
step.CODE
from
<include refid="tableName"></include> f
left join bus_eightwork_step step on step.STEP_ID = f.STEP_ID
where
f.HOTWORK_ID = #{HOTWORK_ID}
and
f.SIGN_TIME is not null
</select>
<select id="checkUnsigned" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.HOTWORK_ID = #{pd.HOTWORK_ID}
f.HOTWORK_ID = #{HOTWORK_ID}
and
f.SIGN_TIME is null
</select>

View File

@ -24,6 +24,7 @@
f.HOTWORKTOMEASURES_ID,
f.CONFIRM_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.IMG_PATH
</sql>
@ -77,7 +78,7 @@
HOTWORKTOMEASURES_ID,
CONFIRM_ID
) values
<foreach collection="list" item="item" index="index" open="(" separator="),(" close=")">
<foreach collection="list" item="item" index="index" separator="," >
(
#{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}
</update>
@ -145,18 +147,22 @@
<select id="listAllMeasuresForSign" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
f.HOTWORKTOMEASURES_ID,
m.*
from
<include refid="tableName"></include> f
left join bus_hotwork_measures m on f.BUS_HOTWORK_MEASURES_ID = m.BUS_HOTWORK_MEASURES_ID
where
f.HOTWORK_ID = #{HOTWORK_ID} and f.CONFIRM_ID = #{CONFIRM_ID}
</select>
<select id="listSignFinishMeasures" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
<include refid="Field"></include>,
m.*
from
<include refid="tableName"></include> f
left join bus_hotwork_measures m on f.BUS_HOTWORK_MEASURES_ID = m.BUS_HOTWORK_MEASURES_ID
where
f.HOTWORK_ID = #{HOTWORK_ID}
</select>

View File

@ -0,0 +1,191 @@
<?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.zcloud.mapper.datasource.system.RouteMapper">
<resultMap type="com.zcloud.entity.system.Route" id="routeResultMap">
<id column="ROUTE_ID" property="ROUTE_ID"/>
<result column="PARENT_ID" property="PARENT_ID"/>
<result column="PARENT_IDS" property="PARENT_IDS"/>
<result column="PATH" property="PATH"/>
<result column="REDIRECT" property="REDIRECT"/>
<result column="COMPONENT" property="COMPONENT"/>
<result column="META" property="META"/>
<result column="ROUTE_ORDER" property="ROUTE_ORDER"/>
<result column="ROUTE_ICON" property="ROUTE_ICON"/>
<result column="ROUTE_STATE" property="ROUTE_STATE"/>
<result column="SHIRO_KEY" property="SHIRO_KEY"/>
<result column="SHOW_MODEL" property="SHOW_MODEL"/>
<result column="ROUTE_TYPE" property="ROUTE_TYPE"/>
<result column="ROUTE_NAME" property="ROUTE_NAME"/>
</resultMap>
<!--表名 -->
<sql id="tableName">
SYS_ROUTE
</sql>
<!-- 字段 -->
<sql id="Field">
ROUTE_ID,
PARENT_ID,
PARENT_IDS,
PATH,
REDIRECT,
COMPONENT,
META,
ROUTE_ORDER,
ROUTE_ICON,
ROUTE_STATE,
SHIRO_KEY,
SHOW_MODEL,
ROUTE_TYPE,
ROUTE_NAME
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ROUTE_ID},
#{PARENT_ID},
#{PARENT_IDS},
#{PATH},
#{REDIRECT},
#{COMPONENT},
#{META},
#{ROUTE_ORDER},
#{ROUTE_ICON},
#{ROUTE_STATE},
#{SHIRO_KEY},
#{SHOW_MODEL},
#{ROUTE_TYPE},
#{ROUTE_NAME}
</sql>
<!--新增 -->
<insert id="add" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!--编辑 -->
<update id="edit" parameterType="menu">
update
<include refid="tableName"></include>
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}
</update>
<!--通过菜单ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
where ROUTE_ID=#{ROUTE_ID}
</select>
<!--取最大ID-->
<select id="findMaxId" parameterType="pd" resultType="pd">
select IFNULL(MAX(ROUTE_ID),0) MID from
<include refid="tableName"></include>
</select>
<!--获取所有菜单 -->
<select id="listAll" parameterType="pd" resultType="pd">
select
ROUTE_ID,
PARENT_ID,
PARENT_IDS,
PATH path,
REDIRECT,
COMPONENT component,
META meta,
ROUTE_ORDER,
ROUTE_ICON,
ROUTE_STATE,
SHIRO_KEY,
SHOW_MODEL,
ROUTE_TYPE,
ROUTE_NAME
from
<include refid="tableName"></include>
order by ROUTE_ORDER asc
</select>
<!--删除菜单-->
<delete id="delete" parameterType="String">
delete from
<include refid="tableName"></include>
where ROUTE_ID=#{ROUTE_ID}
</delete>
<!--保存菜单图标 -->
<update id="editicon" parameterType="pd">
update
<include refid="tableName"></include>
set
ROUTE_ICON = #{ICON}
where
ROUTE_ID=#{ROUTE_ID}
</update>
<!--通过ID获取其子一级菜单 -->
<select id="listSubRouteByParentId" parameterType="String" resultMap="routeResultMap">
SELECT
<include refid="Field"></include>
FROM
<include refid="tableName"></include>
WHERE
PARENT_ID = #{parentId}
ORDER BY
ROUTE_ORDER
</select>
<!--获取所有菜单 -->
<select id="listRouteByParentId" parameterType="String" resultType="pd">
select
ROUTE_ID,
PARENT_ID,
PARENT_IDS,
PATH path,
REDIRECT,
COMPONENT component,
META meta,
ROUTE_ORDER,
ROUTE_ICON,
ROUTE_STATE,
SHIRO_KEY,
SHOW_MODEL,
ROUTE_TYPE,
ROUTE_NAME
from
<include refid="tableName"></include>
WHERE
PARENT_ID = #{parentId}
order by ROUTE_ORDER asc
</select>
</mapper>