From d59a9f1dfe20d4739f109ed433107940a3840ca9 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Mon, 18 Dec 2023 10:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/AppKeyProjectsController.java | 34 ++++ .../dsno2/keyProjects/OutSourcedMapper.java | 7 + .../keyProjects/OutSourcedService.java | 7 + .../impl/OutSourcedServiceImpl.java | 5 + .../keyProjects/KeyprojectHiddenMapper.xml | 2 + .../dsno2/keyProjects/OutSourcedMapper.xml | 152 +++++++++++++++--- 6 files changed, 181 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java index 3de397ac..ef4c4627 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java @@ -156,4 +156,38 @@ public class AppKeyProjectsController extends BaseController { map.put("result", errInfo); return map; } + + + /** 隐患列表 查询进行中的重点工程以及排序 + * @throws Exception + */ + @RequestMapping(value="/listHiddenOutsourced") + @ResponseBody + public Object listHiddenOutsourced(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + String UserId = pd.getString("UserId"); + if(!StringUtils.equals("1",UserId)){ + String CORPINFO_ID = pd.getString("CORPINFO_ID"); +// -- 河港机械 河港港工 河港检测 + if(!StringUtils.equals(CORPINFO_ID,"1e6dbbe16004402f8d2c0e52afd9a676") + &&!StringUtils.equals(CORPINFO_ID,"3a854eefa7894e06aaa1a2611bca80f6")&& + !StringUtils.equals(CORPINFO_ID,"020578a4c1f04bc692ee25145c2efbe5") + &&!StringUtils.equals(CORPINFO_ID,"90966974de3c4b83aca6f8fd6432d5c2")){ + pd.put("DeptId",outsourcedService.getDeptId(UserId)); + pd.put("UserId",UserId); + + } + } + page.setPd(pd); + List varList = outsourcedService.listHiddenOutsourced(page); //列出OutSourced列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } } diff --git a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java index 569023c7..b90f812a 100644 --- a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java +++ b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/OutSourcedMapper.java @@ -75,5 +75,12 @@ public interface OutSourcedMapper{ PageData jieshuOutSourced(PageData pd); void updateState(PageData pd); + + /** 重点工程隐患 列表 + * @param page + * @throws Exception + */ + List hiddenOutsourcedlistPage(Page page); + } diff --git a/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java b/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java index bf05b77d..ac3cfe77 100644 --- a/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java +++ b/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java @@ -76,5 +76,12 @@ public interface OutSourcedService{ PageData jieshuOutSourced(PageData pd); void updateState(PageData pd); + + /** 查询隐患的重点工程列表 排序规则不一致 + * @param page + * @throws Exception + */ + public List listHiddenOutsourced(Page page)throws Exception; + } diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java index af090e91..1431e8e7 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/OutSourcedServiceImpl.java @@ -106,5 +106,10 @@ public class OutSourcedServiceImpl implements OutSourcedService { pd.put("OPERATTIME", DateUtil.date2Str(new Date())); outsourcedMapper.updateState(pd); } + + @Override + public List listHiddenOutsourced(Page page) throws Exception { + return outsourcedMapper.hiddenOutsourcedlistPage(page); + } } diff --git a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml index 5030e522..ee2e4acf 100644 --- a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml +++ b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml @@ -1533,6 +1533,7 @@ f.ISDELETE = '0' AND f.SOURCE IN ( '4', '5', '1' ) AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL + AND (bo.ISDELETE = '0' or boai.ISDELETE = '0') and f.ISPUNISH is null and ( bo.PUNISH_THE_PERSON LIKE CONCAT( CONCAT( '%', #{loginUserId} ), '%' ) @@ -1554,6 +1555,7 @@ AND f.STATE = '2' AND f.CREATOR = #{loginUserId} AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL + AND (bo.ISDELETE = '0' or boai.ISDELETE = '0') ) t)CF_COUNT from `qa-gwj-regulatory`.bus_aiwarning f where f.ISDELETE = '0' diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index 7f2e8852..05eb3bb8 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml @@ -295,16 +295,13 @@ b.UNITS_NAME as UNITS_NAME, isu.NAME as AIWARNING_PEOPLE, pci.NAME Q_COMPETENT_DEPT_NAME, - (select count(1) from `qa-gwj-prevention`.BUS_KEYPROJECTCHECK c where c.OUTSOURCED_ID = f.OUTSOURCED_ID) as CHECK_COUNT, + cc.co as CHECK_COUNT, (select count(1) from `qa-gwj-regulatory`.BUS_AIWARNING a left join bus_videomanager avid on avid.VIDEOMANAGER_ID = a.VIDEOMANAGER_ID where avid.OUTSOURCED_ID= f.OUTSOURCED_ID and a.ISDELETE = '0') as AI_COUNT, (select count(1) from `qa-gwj-regulatory`.BUS_VIDEOMANAGER v where v.OUTSOURCED_ID = f.OUTSOURCED_ID and v.ISDELETE = '0') as VIDEO_COUNT, (SELECT count( 1 ) FROM `qa-gwj-prevention`.BUS_KEYPROJECTPUNISH k left join `qa-gwj-prevention`.bus_keyprojectcheck kjc on kjc.KEYPROJECTCHECK_ID = k.KEYPROJECTCHECK_ID WHERE kjc.OUTSOURCED_ID =f.OUTSOURCED_ID AND k.ISDELETE = '0' ) as KEY_COUNT, vua.NAME OUTSOURCED_CREATOR_NAME, ifnull(vac.CORP_NAME,'秦港股份有限公司') CORP_NAME, p.`NAME` as UNITS_PIC_NAME - - ,ifnull(dbsl.co,0) as co - from f left join bus_units b using (UNITS_ID) @@ -315,25 +312,7 @@ LEFT JOIN `qa-gwj-prevention`.vi_user_all vua on f.CREATOR = vua.USER_ID LEFT JOIN `qa-gwj-regulatory`.vi_all_corp vac on vua.CORPINFO_ID = vac.CORPINFO_ID left join `qa-gwj-regulatory`.bus_personnelmanagement p on p.PERSONNELMANAGEMENT_ID = f.UNITS_PIC - -- 这个判断是隐患管理排序以及隐患管理的角标 - - left join (SELECT t.OUTSOURCED_ID,COUNT( distinct t.HIDDEN_ID) co FROM ( - SELECT - f.HIDDEN_ID,ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) OUTSOURCED_ID - FROM - `qa-gwj-prevention`.BUS_KEYPROJECT_HIDDEN f - LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck keycheck ON keycheck.KEYPROJECTCHECK_ID = f.FOREIGN_ID - LEFT JOIN `qa-gwj-regulatory`.BUS_OUTSOURCED bo ON keycheck.OUTSOURCED_ID = bo.OUTSOURCED_ID - LEFT JOIN `qa-gwj-regulatory`.BUS_OUTSOURCED boai ON f.FOREIGN_ID = boai.OUTSOURCED_ID - LEFT JOIN `qa-gwj-prevention`.BUS_KEYPROJECTPUNISH pu ON pu.HIDDEN_ID = f.HIDDEN_ID - WHERE - f.ISDELETE = '0' - AND f.SOURCE IN ( '4', '5', '1' ) - AND f.STATE = '2' - AND f.CREATOR = #{pd.UserId} - AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL - ) t GROUP BY t.OUTSOURCED_ID ) dbsl on dbsl.OUTSOURCED_ID = f.OUTSOURCED_ID - + LEFT JOIN ( select count(c.KEYPROJECTCHECK_ID) co, c.OUTSOURCED_ID from `qa-gwj-prevention`.BUS_KEYPROJECTCHECK c where c.ISDELETE = '0' group by c.OUTSOURCED_ID ) cc on cc.OUTSOURCED_ID = f.OUTSOURCED_ID where f.ISDELETE = '0' and @@ -396,9 +375,7 @@ ) ORDER BY - - dbsl.co DESC, - + cc.co DESC, f.OPERATTIME DESC @@ -697,4 +674,127 @@ where OUTSOURCED_ID = #{OUTSOURCED_ID} + + + +