From 22dd31c65aabf118cc25c13823b526a3c748a96d Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Wed, 24 Jan 2024 09:25:29 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=9C=E4=B8=9A=E5=BC=80=E5=A7=8B=E6=97=B6?= =?UTF-8?q?=E9=97=B4=EF=BC=8C=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/impl/HotworkServiceImpl.java | 1 - .../datasource/eightwork/HotWorkMapper.xml | 42 +++++++++++++++++-- 2 files changed, 38 insertions(+), 5 deletions(-) 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..6df1508 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -133,7 +133,6 @@ public class HotworkServiceImpl implements HotworkService { List unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表 if(unsignedList == null || unsignedList.size() == 0){//如果没有未签人 则跳转下一步 - hotworkMapper.editStep(pd); if (pd.get("PREPARERS") != null && !pd.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index e988f9b..2baddc9 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,21 @@ 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, f.ANALYZE_TIME FROM bus_hotwork AS f @@ -323,6 +342,12 @@ 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' WHERE f.HOTWORK_ID = #{HOTWORK_ID} @@ -331,6 +356,15 @@ update set + + f.WORK_START_DATE = #{WORK_START_DATE}, + + + f.WORK_END_DATE = #{WORK_END_DATE}, + + + f.ACCEPT_TIME = #{ACCEPT_TIME}, + STEP_ID = #{STEP_ID} where HOTWORK_ID = #{HOTWORK_ID} From abeb80f88dde1511e1b801c70a5d798cc2fc9334 Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Wed, 24 Jan 2024 09:34:59 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4=EF=BC=8C?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4=E5=92=8C=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/datasource/eightwork/HotWorkMapper.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 2baddc9..140b602 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -357,13 +357,13 @@ set - f.WORK_START_DATE = #{WORK_START_DATE}, + WORK_START_DATE = #{WORK_START_DATE}, - f.WORK_END_DATE = #{WORK_END_DATE}, + WORK_END_DATE = #{WORK_END_DATE}, - f.ACCEPT_TIME = #{ACCEPT_TIME}, + ACCEPT_TIME = #{ACCEPT_TIME}, STEP_ID = #{STEP_ID} where From 25d0947d7f96cd6dcc72e739f61530a43dc899ef Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Wed, 24 Jan 2024 09:59:54 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A=20se?= =?UTF-8?q?rvice=E5=B1=82=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/impl/HotworkServiceImpl.java | 79 +++++++++---------- 1 file changed, 38 insertions(+), 41 deletions(-) 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 6df1508..15c2cb9 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 { @@ -105,44 +105,47 @@ public class HotworkServiceImpl implements HotworkService { @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){//如果没有未签人 则跳转下一步 - hotworkMapper.editStep(pd); + hotworkMapper.editStep(work); + PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); - if (pd.get("PREPARERS") != null && !pd.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 - savePreparers(pd,flow); + if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 + savePreparers(work,currentflow); } //保存日志 - 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); + + saveNextSigner(work,currentflow); } } @@ -271,19 +274,16 @@ public class HotworkServiceImpl implements HotworkService { private void saveMeasures(PageData pd) { 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 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("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); } } @@ -291,15 +291,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); From 9d93529c50822e10c67860bdf92298a0441cbd9d Mon Sep 17 00:00:00 2001 From: wangpeng Date: Wed, 24 Jan 2024 11:39:18 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/MainController.java | 151 ++++++++++- .../controller/system/RouteController.java | 130 ++++++++++ src/main/java/com/zcloud/entity/Result.java | 146 +++++++++++ .../java/com/zcloud/entity/system/Route.java | 167 ++++++++++++ .../mapper/datasource/system/RouteMapper.java | 68 +++++ .../zcloud/service/system/RouteService.java | 86 +++++++ .../service/system/impl/RouteServiceImpl.java | 237 ++++++++++++++++++ .../com/zcloud/util/BaseResultInterface.java | 18 ++ .../java/com/zcloud/util/CodeMessageEnum.java | 190 ++++++++++++++ .../mybatis/datasource/system/RouteMapper.xml | 191 ++++++++++++++ 10 files changed, 1376 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/zcloud/controller/system/RouteController.java create mode 100644 src/main/java/com/zcloud/entity/Result.java create mode 100644 src/main/java/com/zcloud/entity/system/Route.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/system/RouteMapper.java create mode 100644 src/main/java/com/zcloud/service/system/RouteService.java create mode 100644 src/main/java/com/zcloud/service/system/impl/RouteServiceImpl.java create mode 100644 src/main/java/com/zcloud/util/BaseResultInterface.java create mode 100644 src/main/java/com/zcloud/util/CodeMessageEnum.java create mode 100644 src/main/resources/mybatis/datasource/system/RouteMapper.xml 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/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/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/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} + + + + + + + + + + + From 44d1708a7982e885d5df40c36b2e15366395009e Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Wed, 24 Jan 2024 14:00:24 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=97=B6=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=AD=BE=E5=AD=97=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/AppHotworkController.java | 13 ----------- .../service/eightwork/HotworkService.java | 2 -- .../eightwork/impl/HotworkServiceImpl.java | 22 ++++++------------- .../datasource/eightwork/HotWorkMapper.xml | 10 +++++++++ 4 files changed, 17 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java index ad59de1..78fdeb0 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -157,19 +157,6 @@ public class AppHotworkController extends BaseController { return map; } - @RequestMapping("/accept") - @ResponseBody - @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "验收归档") - public Object accept() throws Exception { - Map map = new HashMap<>(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - hotworkService.accept(pd); - map.put("result",errInfo); - return map; - } - @RequestMapping("/checkWorkCount") @ResponseBody public Object checkWorkCount() 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..9e7e4cf 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -22,8 +22,6 @@ public interface HotworkService { void nextStep(PageData pd, MultipartFile[] files) throws Exception; - void accept(PageData pd)throws Exception; - void cancel(PageData pd) throws Exception; PageData findById(PageData pd) throws Exception; 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 15c2cb9..cb6ba59 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -136,29 +136,21 @@ public class HotworkServiceImpl implements HotworkService { List unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表 if(unsignedList == null || unsignedList.size() == 0){//如果没有未签人 则跳转下一步 hotworkMapper.editStep(work); - PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); - if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤 - savePreparers(work,currentflow); - } //保存日志 saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"1"); - + 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); } } - /** - * 验收归档 - */ - @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"); - } - /** * 取消 */ diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 140b602..0d706a2 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -301,6 +301,13 @@ 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 @@ -348,6 +355,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} From e3d2091070d2e4e060d8a570e31e77461ed5432c Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Wed, 24 Jan 2024 14:04:39 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=8E=AA=E6=96=BD=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/AppEightWorkController.java | 13 +++++-------- .../eightwork/impl/HotworkServiceImpl.java | 5 +++-- src/main/java/com/zcloud/util/img.png | Bin 14060 -> 0 bytes .../datasource/eightwork/HotworkSignMapper.xml | 2 +- .../eightwork/HotworkToMeasuresMapper.xml | 9 ++++++--- 5 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 src/main/java/com/zcloud/util/img.png diff --git a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java index 3668a03..a7d08ee 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java @@ -29,14 +29,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 +44,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; } 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 15c2cb9..07331a6 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -272,16 +272,17 @@ 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) { PageData measure = new PageData(); - measure.put("HOTWORKTOMEASURES_ID",json.get("BUS_HOTWORK_MEASURES_ID")); + 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); } 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 d087336abd84664f9ebf82a3ac7eb43994d6e2e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14060 zcmcJ0Ra9Kf_9q(LgS$5#AV84du4&vMxVyW%hQ{698ixQO3GN=;Ex0>OC*Qqy?yU8H zn1`8{UZ?Avs@k<{*WSM^75Pa~3JsYE843ytO-5Q=843z|8S=b@2m|?*ZfL22g5qwF z5f@SQ&_B*bQXw8r*?aUpd)K93V|#R4<7+$8gi1^K4N-cQACrQov~3 z0xH2zqj%q#@uIJ&^u@;ybNtvpeq6!g#Ay&$QX1z;AF2A1z*vb)Nv#`}bdCa}W|lL; zmwc_Eu3kR2_Jod2Bb`7oNcW895BujyM+jYj3TdMj20=qXnZQMGKtTn>Kmp%CK_y^O3_(8N zfDtEzf)bYeuTB9fVwq{n4-d9QvI^$;u>cg@yaoa2KYc!MX|H`jZ-{#A@mg| z2I4Ua&tJg(8Do9MA-cAd6~*o??BBodH)PHt-}3$)e|_fs?IsR`(_aFFDI5+j{{4mm z^PidFHM=0xB%nAHVnE1YMU<^umt_A-wIbTxIpQC(19G(>3(I2qKh~1a0g#d`Pwqoi z(~oR#=5237d6sxBWU=7aBY==3B~?;DLP%Q3S{s?EKli%guW*<8Diz#ZsH^%Wxu_B{ z+*96w5=hPJJ?Y%@e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z5;xg1$O?vUP&&F|+(?cEonV~c|Ba5JzLAr0$`*+S z5N~7t19_kVasgBX+L^3$1GtU;Pk(ROyoyYVeT_T+5Hweg(zAuw_*lv%W%l>3P6C!D zh>O=$qN!GvNlpbd-4hKLDe6!>^t7*JZ%>UYb+(%sFfz$#5Alhhpx}s@hjyBh%NP4A z_FEf+!mv{TQZ%W_YP<9nWaR}QFK1g%HM~Dgm2h59fo|4l$O?VK7QGTLu*+Y{;Flfy z%TTpm$l(Z@>)$&?fp4On^tB1-yJFaLadzrJ;G3v7N<<=mt{}mn8GzcjOsR(Ori~>D zcQ*z9Gbrdj4QD5<$|!y(+DGL>%f};(M8-d!Yd}D-L|Xx$LFHFcGP0Zm9fRHWN&IwO zeRT*X^R0?9a`E@ke|ci~_c&R)zd|%(4-HJr(;)L)NH624eAaiB(|R8MzNy>E_x8`# zB#H?`AbQ8E^If5L{15w(@+lNzS(l9}z~x`YA->lH`FlSFd?tHW(cfO`x?@_7`shId z|DPE?E$iPG6b3P?Sg5sF@InkFw7&Y& zY}0V+yH+d&Ark%Q*o&e0?je03@yGl2pg@a#|ED=2%6o0kD8W`>fH LP!z8bH4OS+T-d)M diff --git a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml index d8b3f09..20780a5 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml @@ -106,7 +106,7 @@ from f where - f.HOTWORK_ID = #{pd.HOTWORK_ID} + f.HOTWORK_ID = #{HOTWORK_ID} and f.SIGN_TIME is null diff --git a/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml index 390e949..271856c 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotworkToMeasuresMapper.xml @@ -77,7 +77,7 @@ HOTWORKTOMEASURES_ID, CONFIRM_ID ) values - + ( #{item.HOTWORK_ID}, #{item.BUS_HOTWORK_MEASURES_ID}, @@ -106,7 +106,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,9 +146,11 @@ From 0a64479a7dae500f55c586d9cf63a5fb1d95af99 Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Wed, 24 Jan 2024 17:14:19 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=89=93=E5=9B=9E=E4=B8=8E=E4=BF=9D=E5=AD=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/AppHotworkController.java | 22 +++---- .../datasource/eightwork/HotworkMapper.java | 1 - .../service/eightwork/HotworkService.java | 4 +- .../eightwork/impl/HotworkServiceImpl.java | 60 ++++++++++--------- 4 files changed, 41 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java index 78fdeb0..ed9d3c2 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -125,18 +125,6 @@ public class AppHotworkController extends BaseController { return map; } - @RequestMapping("/cancel") - @ResponseBody - @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "打回") - public Object cancel()throws Exception{ - Map map = new HashMap<>(); - String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); - hotworkService.cancel(pd); - map.put("result",errInfo); - return map; - } @RequestMapping("/nextStep") @ResponseBody @@ -215,12 +203,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; } 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..9f6cb9a 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java @@ -18,7 +18,6 @@ public interface HotworkMapper { void editGasTime(PageData pd); void editStep(PageData pd); List datalistPage(Page page); - void cancel(PageData pd); List listAllMeasures(); List checkWorkCount(PageData pd); diff --git a/src/main/java/com/zcloud/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index 9e7e4cf..c7f5789 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -22,8 +22,6 @@ public interface HotworkService { void nextStep(PageData pd, MultipartFile[] files) throws Exception; - void cancel(PageData pd) throws Exception; - PageData findById(PageData pd) throws Exception; PageData checkWorkCount(PageData pd); @@ -37,6 +35,6 @@ 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; } 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 d482d1f..a316b3c 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -134,7 +134,7 @@ public class HotworkServiceImpl implements HotworkService { } 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); //保存日志 @@ -148,21 +148,14 @@ public class HotworkServiceImpl implements HotworkService { savePreparers(work,currentflow); } saveNextSigner(work,currentflow); + }else if(pd.getString("APPLY_STATUS").equals("-1")){ + work.put("STEP_ID",-1); + hotworkMapper.editStep(work); + //保存日志 + saveLog(work,work.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); @@ -202,45 +195,56 @@ 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{ - saveLog(work,pd.getString("USER_ID"),"-2"); - work.put("STEP_ID", -1); + }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); + work.put("STEP_ID",-1); hotworkMapper.editStep(work); + //保存日志 + saveLog(work,pd.getString("USER_ID"),"-2"); } } From f43b48d546cdaf2a4914ff1042b6737eadfcea1e Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Wed, 24 Jan 2024 17:20:55 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=8E=AA=E6=96=BD=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/AppHotworkController.java | 13 ++++++++++ .../eightwork/HotworkSignMapper.java | 2 ++ .../service/eightwork/HotworkService.java | 2 ++ .../eightwork/impl/HotworkServiceImpl.java | 26 +++++++++++++++++++ .../datasource/eightwork/HotWorkMapper.xml | 2 +- .../eightwork/HotworkSignMapper.xml | 13 ++++++++++ .../eightwork/HotworkToMeasuresMapper.xml | 5 +++- 7 files changed, 61 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java index 78fdeb0..b1a89d8 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -125,6 +125,19 @@ public class AppHotworkController extends BaseController { return map; } + @RequestMapping("/listSignFinished") + @ResponseBody + public Object listSignFinished() throws Exception { + Map map = new HashMap<>(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + PageData signs = hotworkService.listSignFinished(pd); + map.put("result",errInfo); + map.put("signs",signs); + return map; + } + @RequestMapping("/cancel") @ResponseBody @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "打回") 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/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index 9e7e4cf..3ac8a22 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -26,6 +26,8 @@ public interface HotworkService { PageData findById(PageData pd) throws Exception; + PageData listSignFinished(PageData pd) throws Exception; + PageData checkWorkCount(PageData pd); //获取所有措施(bus_hotwork_measures) 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 d482d1f..20e9816 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -169,6 +169,32 @@ public class HotworkServiceImpl implements HotworkService { 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(); diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 0d706a2..681523e 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -454,7 +454,7 @@ 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 (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc + left join (select * from(select * from vi_eightwork_flow_log log where log.STATUS != -1 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' diff --git a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml index 20780a5..d534afc 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotworkSignMapper.xml @@ -100,6 +100,19 @@ order by f.SIGN_TIME desc + + select - + , + m.* from f + left join bus_hotwork_measures m on f.BUS_HOTWORK_MEASURES_ID = m.BUS_HOTWORK_MEASURES_ID where f.HOTWORK_ID = #{HOTWORK_ID} From 3eb09bdcc814f2b2db9fc5758ee381df13ad1dfb Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Wed, 24 Jan 2024 17:28:46 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E6=B0=94=E4=BD=93?= =?UTF-8?q?=E5=88=86=E6=9E=90=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=E5=BD=92=E6=A1=A3=E7=9A=84=E4=BD=9C=E4=B8=9A=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mybatis/datasource/eightwork/HotWorkMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 681523e..0fe0cec 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -471,7 +471,7 @@ 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} From b1db99346eb713949677bc74873f1cd787026c9d Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Thu, 25 Jan 2024 13:38:16 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/app/AppHiddenController.java | 2 +- .../eightwork/AppEightWorkController.java | 12 ++ .../eightwork/AppHotworkController.java | 18 ++ .../controller/mq/EightWorkListener.java | 168 +++++++++--------- .../datasource/eightwork/HotworkMapper.java | 2 + .../service/eightwork/EightWorkService.java | 1 + .../service/eightwork/HotworkService.java | 1 + .../eightwork/impl/EightWorkServiceImpl.java | 6 + .../eightwork/impl/HotworkServiceImpl.java | 16 +- .../datasource/eightwork/HotWorkMapper.xml | 33 +++- 10 files changed, 169 insertions(+), 90 deletions(-) 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 a7d08ee..f661060 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppEightWorkController.java @@ -60,4 +60,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 49bac0a..84ccc71 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -266,4 +266,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/mapper/datasource/eightwork/HotworkMapper.java b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java index 9f6cb9a..2004d0f 100644 --- a/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/eightwork/HotworkMapper.java @@ -21,4 +21,6 @@ public interface HotworkMapper { List listAllMeasures(); List checkWorkCount(PageData pd); + + List getFlowList(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..45cdd08 100644 --- a/src/main/java/com/zcloud/service/eightwork/EightWorkService.java +++ b/src/main/java/com/zcloud/service/eightwork/EightWorkService.java @@ -10,4 +10,5 @@ import java.util.List; */ public interface EightWorkService { public List getTaskSetps(PageData pd); + PageData checkWork(PageData pd); } diff --git a/src/main/java/com/zcloud/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index 494ee4c..d02c263 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -39,4 +39,5 @@ public interface HotworkService { 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..d7bea18 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/EightWorkServiceImpl.java @@ -25,4 +25,10 @@ public class EightWorkServiceImpl implements EightWorkService { public List getTaskSetps(PageData pd) { return eightWorkTaskFlowMapper.getTaskSetps(pd); } + + @Override + public PageData checkWork(PageData pd) { + return null; + } + } 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 aa657bf..660c4ef 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -149,10 +149,11 @@ public class HotworkServiceImpl implements HotworkService { } saveNextSigner(work,currentflow); }else if(pd.getString("APPLY_STATUS").equals("-1")){ - work.put("STEP_ID",-1); - hotworkMapper.editStep(work); //保存日志 saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"-1"); + + work.put("STEP_ID",-1); + hotworkMapper.editStep(work); } } @@ -267,13 +268,20 @@ public class HotworkServiceImpl implements HotworkService { sign.put("SIGN_PATH", String.join(",", filePaths)); sign.put("DESCR", pd.get("DESCR")); hotworkSignMapper.edit(sign); - work.put("STEP_ID",-1); - hotworkMapper.editStep(work); //保存日志 saveLog(work,pd.getString("USER_ID"),"-2"); + 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")); diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 681523e..37c4c7b 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -454,9 +454,12 @@ 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 (select * from(select * from vi_eightwork_flow_log log where log.STATUS != -1 having 1 order by log.ACT_TIME desc + 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 @@ -467,6 +470,9 @@ and step.STEP_NAME = #{pd.STEP_NAME} ) + + and log.NEXT_STEP_ID = #{pd.STEP_ID} + and f.CREATOR = #{pd.CREATOR} @@ -494,4 +500,29 @@ from BUS_HOTWORK_MEASURES + + From cc33e51b0c84c0475bfa9a192490afa458ca27a2 Mon Sep 17 00:00:00 2001 From: chenxinying <1039655633@qq.com> Date: Thu, 25 Jan 2024 13:47:52 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=85=AB=E9=A1=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A=E7=AD=BE=E5=AD=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=AE=8C=E6=88=90=EF=BC=8C=E5=8A=A8=E7=81=AB=E4=BA=BA?= =?UTF-8?q?=E5=8F=8A=E8=AF=81=E4=B9=A6=E7=BC=96=E5=8F=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eightwork/AppHotworkController.java | 20 +++++++++++++++++++ .../datasource/eightwork/HotworkMapper.java | 3 +++ .../service/eightwork/HotworkService.java | 2 ++ .../eightwork/impl/HotworkServiceImpl.java | 4 ++++ .../datasource/eightwork/HotWorkMapper.xml | 16 +++++++++++++++ 5 files changed, 45 insertions(+) diff --git a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java index 84ccc71..1257544 100644 --- a/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java +++ b/src/main/java/com/zcloud/controller/eightwork/AppHotworkController.java @@ -156,6 +156,26 @@ public class AppHotworkController extends BaseController { map.put("result",errInfo); return map; } + /**搜索动火作业动火人及证书编号 + * @param page + * @throws Exception + */ + @RequestMapping(value="/namelist") + @ResponseBody + @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(); + 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; + } @RequestMapping("/checkWorkCount") @ResponseBody 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 2004d0f..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,6 +18,9 @@ public interface HotworkMapper { void editGasTime(PageData pd); void editStep(PageData pd); List datalistPage(Page page); + + List namelist(PageData pd); + List listAllMeasures(); List checkWorkCount(PageData pd); diff --git a/src/main/java/com/zcloud/service/eightwork/HotworkService.java b/src/main/java/com/zcloud/service/eightwork/HotworkService.java index d02c263..44d8446 100644 --- a/src/main/java/com/zcloud/service/eightwork/HotworkService.java +++ b/src/main/java/com/zcloud/service/eightwork/HotworkService.java @@ -22,6 +22,8 @@ public interface HotworkService { void nextStep(PageData pd, MultipartFile[] files) throws Exception; + public List namelist(PageData pd)throws Exception; + PageData findById(PageData pd) throws Exception; PageData listSignFinished(PageData pd) throws Exception; 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 660c4ef..f31475f 100644 --- a/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java +++ b/src/main/java/com/zcloud/service/eightwork/impl/HotworkServiceImpl.java @@ -99,6 +99,10 @@ public class HotworkServiceImpl implements HotworkService { return hotworkMapper.datalistPage(page); } + public List namelist(PageData pd)throws Exception{ + return hotworkMapper.namelist(pd); + } + /* * 下一步 */ diff --git a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml index 349285c..2aac41a 100644 --- a/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/eightwork/HotWorkMapper.xml @@ -481,6 +481,22 @@ + + + + + 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 > 0 and h.STEP_ID < 15 and h.ISDELETE = '0' + + + +