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..cd435f83 100644 --- a/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java +++ b/src/main/java/com/zcloud/controller/keyProjects/app/AppKeyProjectsController.java @@ -6,6 +6,7 @@ import com.zcloud.entity.PageData; import com.zcloud.service.keyProjects.OutSourcedService; import com.zcloud.service.keyProjects.PersonnelManagementService; import com.zcloud.service.keyProjects.UnitsService; +import com.zcloud.service.keyProjects.VideoManagerService; import com.zcloud.service.system.DictionariesService; import com.zcloud.util.Jurisdiction; import com.zcloud.util.Tools; @@ -38,6 +39,9 @@ public class AppKeyProjectsController extends BaseController { @Autowired private PersonnelManagementService personnelmanagementService; + @Autowired + private VideoManagerService videomanagerService; + /**列表 * @throws Exception */ @@ -156,4 +160,127 @@ 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; + } + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/videomanagerList") + @ResponseBody + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + page.setPd(pd); + List varList = videomanagerService.listApp(page); //列出VideoManager列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + + /**去修改页面获取数据 + * @param + * @throws Exception + */ + @RequestMapping(value="/getOutsourced") + @ResponseBody + public Object getOutsourced() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = outsourcedService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** 修改工程状态 + * @param + * @throws Exception + */ + @RequestMapping(value="/updateState") + @ResponseBody + public Object updateState() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + outsourcedService.updateState(pd); //获取同时绑定的重点工程信息如果大于1表示还有其他重点工程 + map.put("result", errInfo); + return map; + } + + /**列表 + * @throws Exception + */ + @RequestMapping(value="/outSouceslistPage") + @ResponseBody + public Object outSouceslistPage(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.outSouceslistPage(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..931dc169 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,20 @@ public interface OutSourcedMapper{ PageData jieshuOutSourced(PageData pd); void updateState(PageData pd); + + /** 重点工程隐患 列表 + * @param page + * @throws Exception + */ + List hiddenOutsourcedlistPage(Page page); + + /** + * 重点工程管理列表 + * @param page + * @return + */ + List outSouceslistPage(Page page); + + } diff --git a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java index bce67b13..8215607b 100644 --- a/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java +++ b/src/main/java/com/zcloud/mapper/dsno2/keyProjects/VideoManagerMapper.java @@ -75,5 +75,7 @@ public interface VideoManagerMapper { void editByResourcesId(PageData pd); void updateAiByOUTSOURCED_ID(PageData pd); + + List dataApplistPage(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..e575f688 100644 --- a/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java +++ b/src/main/java/com/zcloud/service/keyProjects/OutSourcedService.java @@ -76,5 +76,21 @@ public interface OutSourcedService{ PageData jieshuOutSourced(PageData pd); void updateState(PageData pd); + + /** 查询隐患的重点工程列表 排序规则不一致 + * @param page + * @throws Exception + */ + public List listHiddenOutsourced(Page page)throws Exception; + + /** + * 重点工程管理列表APP + * @param page + * @return + * @throws Exception + */ + public List outSouceslistPage(Page page)throws Exception; + + } diff --git a/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java b/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java index aa472aa9..4b7c0f25 100644 --- a/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java +++ b/src/main/java/com/zcloud/service/keyProjects/VideoManagerService.java @@ -73,5 +73,7 @@ public interface VideoManagerService { void updateAiByOUTSOURCED_ID(PageData pd); + + List listApp(Page page); } 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..a4e51674 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,15 @@ 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); + } + + @Override + public List outSouceslistPage(Page page) throws Exception { + return outsourcedMapper.outSouceslistPage(page); + } } diff --git a/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java b/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java index af6a8611..b0dfdba5 100644 --- a/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java +++ b/src/main/java/com/zcloud/service/keyProjects/impl/VideoManagerServiceImpl.java @@ -121,5 +121,10 @@ public class VideoManagerServiceImpl implements VideoManagerService { public void updateAiByOUTSOURCED_ID(PageData pd) { videomanagerMapper.updateAiByOUTSOURCED_ID(pd); } + + @Override + public List listApp(Page page) { + return videomanagerMapper.dataApplistPage(page); + } } diff --git a/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml b/src/main/resources/mybatis/datasource/keyProjects/KeyprojectHiddenMapper.xml index 5030e522..022c4347 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,7 +1555,21 @@ AND f.STATE = '2' AND f.CREATOR = #{loginUserId} AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL - ) t)CF_COUNT + AND (bo.ISDELETE = '0' or boai.ISDELETE = '0') + ) t)CF_COUNT, + (SELECT + COUNT( DISTINCT t.OUTSOURCED_ID ) +FROM + ( + SELECT + b.OUTSOURCED_ID + FROM + `qa-gwj-regulatory`.BUS_OUTSOURCED b + WHERE + b.ISDELETE = '0' + AND ( b.STATE = '-1' OR b.STATE = '-2' ) + AND b.CREATOR = #{loginUserId} + ) t) GC_COUNT from `qa-gwj-regulatory`.bus_aiwarning f where f.ISDELETE = '0' and f.STATUS = 0 diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index 7f2e8852..963cb222 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,231 @@ where OUTSOURCED_ID = #{OUTSOURCED_ID} + + + + + + + diff --git a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml index fb13f861..b6cefcf0 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/VideoManagerMapper.xml @@ -291,4 +291,23 @@ where OUTSOURCED_ID = #{OUTSOURCED_ID} + + + +