diff --git a/src/main/java/com/zcloud/aspect/DockingAspect.java b/src/main/java/com/zcloud/aspect/DockingAspect.java index 171a8ee9..5c520a6e 100644 --- a/src/main/java/com/zcloud/aspect/DockingAspect.java +++ b/src/main/java/com/zcloud/aspect/DockingAspect.java @@ -32,6 +32,13 @@ import java.util.Map; public class DockingAspect { @Autowired private DockSendMessageService sendMessageService; + @Value("${mq.csy.data.topic}") + private String csyDataDocking; + + @Value("${mq.cmt.data.topic}") + private String cmtDataDocking; + @Value("${mq.czks.data.topic}") + private String czksDataDocking; @Value("${baseimgpath}") public String baseimgpath; @Pointcut("@annotation(com.zcloud.aspect.DockAnnotation)") @@ -104,9 +111,27 @@ public class DockingAspect { tenCorpDto.setProducer_name("qa-prevention-czks"); // 有dockData if (Tools.notEmpty(proceed.get("dockData"))) { - sendData.put("dockData", proceed.get("dockData")); + String dockData = proceed.get("dockData"); + PageData dockDataMap = JSON.parseObject(dockData, PageData.class); + sendData.put("dockData",dockData); + // 操作企业 + if ("f8da1790b1034058ae2efefd69af3284".contains(dockDataMap.getString("operatingCorpId")) + || "016d19225e9d4ece863cce8a256a3e72".contains(dockDataMap.getString("operatingCorpId")) + || "1".equals(dockDataMap.getString("sendAllCorp")) + ){ + tenCorpDto.setTopic(czksDataDocking); + sendMessageService.sendMessage(tenCorpDto); + } + // todo先不给其他两家发送消息,上线前打开 + if ("8854edee3aa94be496cee676b6d4845a".equals(dockDataMap.getString("operatingCorpId")) || "1".equals(dockDataMap.getString("sendAllCorp"))){ + tenCorpDto.setTopic(csyDataDocking); + sendMessageService.sendMessage(tenCorpDto); + } + if ("6aa255d41602497fa0f934a822820df4".equals(dockDataMap.getString("operatingCorpId")) || "1".equals(dockDataMap.getString("sendAllCorp"))){ + tenCorpDto.setTopic(cmtDataDocking); + sendMessageService.sendMessage(tenCorpDto); + } proceed.remove("dockData"); - sendMessageService.sendMessage(tenCorpDto); } else { System.out.println("------------------------无dockData不发消息------------------------"); } diff --git a/src/main/java/com/zcloud/controller/map/MapController.java b/src/main/java/com/zcloud/controller/map/MapController.java index d676c8fe..645365d4 100644 --- a/src/main/java/com/zcloud/controller/map/MapController.java +++ b/src/main/java/com/zcloud/controller/map/MapController.java @@ -939,7 +939,7 @@ public class MapController extends BaseController { AlarmGet alarmGet = new AlarmGet(); alarmGet.setPage(new com.zcloud.service.dw.dto.Page()); alarmGet.getPage().setCurrent("1"); - alarmGet.getPage().setSize("12"); + alarmGet.getPage().setSize("5"); alarmGet.setCorpId(pd.getString("corpId")); map.put("result", "success"); map.put("alarmList", dwService.getAlarmList(alarmGet)); @@ -952,7 +952,7 @@ public class MapController extends BaseController { AlarmGet alarmGet = new AlarmGet(); alarmGet.setPage(new com.zcloud.service.dw.dto.Page()); alarmGet.getPage().setCurrent("1"); - alarmGet.getPage().setSize("12"); + alarmGet.getPage().setSize("9"); alarmGet.setCorpId(pd.getString("corpId")); map.put("result", "success"); map.put("alarmList", new ArrayList<>()); diff --git a/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java b/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java index c26eb59c..be50910a 100644 --- a/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java +++ b/src/main/java/com/zcloud/controller/map/MapPlatFormElectronicController.java @@ -2,13 +2,17 @@ package com.zcloud.controller.map; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.PageData; +import com.zcloud.service.keyProjects.PlatformvideomanagementService; import com.zcloud.service.map.util.HKPostUtil; +import com.zcloud.service.system.DictionariesService; +import org.apache.commons.lang3.StringUtils; 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 com.zcloud.service.map.PlatformelectronicService; +import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,6 +23,9 @@ public class MapPlatFormElectronicController extends BaseController { @Autowired private PlatformelectronicService platformelectronicService; + @Autowired + private PlatformvideomanagementService platformvideomanagementService; + /**总摄像头数 * @throws Exception */ @@ -27,8 +34,7 @@ public class MapPlatFormElectronicController extends BaseController { public Object listAll() throws Exception{ Map map = new HashMap(); String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); + PageData pd = this.getPageData(); Integer allForMap = platformelectronicService.countAllForMap(pd); //列出Platformelectronic列表 map.put("allForMap", allForMap); map.put("result", errInfo); @@ -52,6 +58,8 @@ public class MapPlatFormElectronicController extends BaseController { return map; } + @Resource + private DictionariesService dictionariesService; /**地图插点 * @throws Exception @@ -61,8 +69,46 @@ public class MapPlatFormElectronicController extends BaseController { public Object listAllLocation() throws Exception{ Map map = new HashMap(); String errInfo = "success"; - PageData pd = new PageData(); - pd = this.getPageData(); + PageData pd = this.getPageData(); + if ("bianjieruqin".equals(pd.getString("TYPE"))){ + if (StringUtils.isEmpty(pd.getString("CORPINFO_ID"))){ + pd.put("CORPINFO_ID",pd.get("corpId")); + } + //列出Platformvideomanagement列表 + PageData condition = new PageData(); + List varList = platformvideomanagementService.listAll(pd); + for (PageData data : varList) { + data.put("MAP_POINT_NAME", data.getString("NAME")); + condition.clear(); + condition.put("INDEXCODE",data.getString("INDEXCODE")); + //增加容错 + List list = platformelectronicService.listAll(condition); + if (list.size() > 0){ + data.put("FANGQU_IDS",list.get(0).getString("FANGQU_IDS")); + } + } + condition.clear(); + condition.put("PARENT_ID","f0bae7becdee4d779a2cb82037948ab4"); + Map> tongJi = new HashMap<>(); + List dic = dictionariesService.findByCondition(condition); + // 找出要统计的图标信息 + for (PageData _dic : dic){ + condition.clear(); + condition.put("PARENT_ID",_dic.getString("DICTIONARIES_ID")); + List dic2 = dictionariesService.findByCondition(condition); + for (PageData _dic2 : dic2){ + _dic2.put("NAME",_dic.getString("NAME") + _dic2.getString("NAME")); + // 统计不同防区中的不同的 + _dic2.put("num",varList.stream().filter(n -> n.getString("FANGQU_IDS").contains(_dic2.getString("DICTIONARIES_ID"))).count()); + } + tongJi.put(_dic.getString("NAME"),dic2); + } + map.put("iconData",tongJi); + // 根据统计的数据 + map.put("varList", varList); + map.put("result", errInfo); + return map; + } pd.put("forMap","1"); List varList = platformelectronicService.listAll(pd); //列出Platformelectronic列表 for (PageData data : varList) { diff --git a/src/main/java/com/zcloud/dto/TenCorpDto.java b/src/main/java/com/zcloud/dto/TenCorpDto.java index 011721d9..f9398c74 100644 --- a/src/main/java/com/zcloud/dto/TenCorpDto.java +++ b/src/main/java/com/zcloud/dto/TenCorpDto.java @@ -2,6 +2,7 @@ package com.zcloud.dto; import com.alibaba.fastjson.JSON; import com.zcloud.entity.PageData; +import com.zcloud.util.Warden; import lombok.Data; @Data @@ -23,6 +24,10 @@ public class TenCorpDto { // 消息体 private PageData data; + private String messageLogId; + + private String CREATE_TIME; + public TenCorpDto() { this.id = Warden.get32UUID(); } @@ -40,6 +45,9 @@ public class TenCorpDto { info.put("MARK_NAME", this.mark_name); info.put("MESSAGE", this.message); info.put("TOPIC",this.topic); + info.put("DATA", JSON.toJSONString(this.data)); + info.put("CREATE_TIME", this.CREATE_TIME); + info.put("MESSAGE_LOG_ID", this.messageLogId); return info; } } diff --git a/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java index b7c8ad88..fa470a66 100644 --- a/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/system/DictionariesMapper.java @@ -106,4 +106,6 @@ public interface DictionariesMapper { */ List getIdsByRecuByParentId(String parentId); List getIdsByParentIds(List parentIds); + + List findByCondition(PageData condition); } diff --git a/src/main/java/com/zcloud/service/dw/dto/AlarmGet.java b/src/main/java/com/zcloud/service/dw/dto/AlarmGet.java index e4c5044a..07eca741 100644 --- a/src/main/java/com/zcloud/service/dw/dto/AlarmGet.java +++ b/src/main/java/com/zcloud/service/dw/dto/AlarmGet.java @@ -10,5 +10,7 @@ public class AlarmGet { private String status; private String corpId; private Page page; + // 告警来源 + private String sourceNum; } diff --git a/src/main/java/com/zcloud/service/mq/impl/DockSendMessageServiceImpl.java b/src/main/java/com/zcloud/service/mq/impl/DockSendMessageServiceImpl.java index ca474cd1..d4c56f41 100644 --- a/src/main/java/com/zcloud/service/mq/impl/DockSendMessageServiceImpl.java +++ b/src/main/java/com/zcloud/service/mq/impl/DockSendMessageServiceImpl.java @@ -26,6 +26,13 @@ public class DockSendMessageServiceImpl implements DockSendMessageService { private String gwjDataTopic; @Value("${mq.gwj.file.topic}") private String gwjFileTopic; + @Value("${mq.csy.data.topic}") + private String csyDataDocking; + + @Value("${mq.cmt.data.topic}") + private String cmtDataDocking; + @Value("${mq.czks.data.topic}") + private String czksDataDocking; @Resource private RocketMQTemplate rocketMQTemplate; @@ -40,14 +47,32 @@ public class DockSendMessageServiceImpl implements DockSendMessageService { @Override public void sendMessage(TenCorpDto tenCorpDto) throws Exception { + PageData productionPD = new PageData(); + productionPD.put("PRODUCTION_ID", Warden.get32UUID()); + productionPD.put("MESSAGE_LOG_ID", tenCorpDto.getMessageLogId() == null ? "" : tenCorpDto.getMessageLogId()); + productionPD.put("PRODUCTION_TYPE", "gwj-DockSendMessageServiceImpl.sendMessage(TenCorpDto tenCorpDto)"); + productionPD.put("PRODUCTION_TIME", DateUtil.getTime()); + productionPD.put("CREATE_TIME", tenCorpDto.getCREATE_TIME() == null ? "" : tenCorpDto.getCREATE_TIME()); + productionPD.put("MARK", tenCorpDto.getMark() == null ? "" : tenCorpDto.getMark()); + productionPD.put("DATA", tenCorpDto.getData() == null ? "" : tenCorpDto.getData().toString()); try { PageData log = tenCorpDto.getPd(); log.put("MESSAGE_LOG_ID", Warden.get32UUID()); log.put("CREATE_TIME", DateUtil.getTime()); mqMessageLogMapper.save(log); System.out.println("生产者:" + tenCorpDto.toString()); - SendResult sendResult = rocketMQTemplate.syncSend(this.gwjDataTopic, tenCorpDto.toString()); - if (!sendResult.getSendStatus().equals(SendStatus.SEND_OK)) { + SendResult sendResult = null; + // 曹煤炭 后期是 三家 + if (tenCorpDto.getTopic().equals(czksDataDocking)) { + sendResult = rocketMQTemplate.syncSend(this.czksDataDocking, tenCorpDto.toString()); + } + if (tenCorpDto.getTopic().equals(cmtDataDocking)) { + sendResult = rocketMQTemplate.syncSend(this.cmtDataDocking, tenCorpDto.toString()); + } + if (tenCorpDto.getTopic().equals(csyDataDocking)) { + sendResult = rocketMQTemplate.syncSend(this.csyDataDocking, tenCorpDto.toString()); + } + if (sendResult != null && !sendResult.getSendStatus().equals(SendStatus.SEND_OK)) { throw new RuntimeException("产品入栈失败"); } } catch (Exception e) { diff --git a/src/main/java/com/zcloud/service/system/DictionariesService.java b/src/main/java/com/zcloud/service/system/DictionariesService.java index 8712c5f3..f7a058aa 100644 --- a/src/main/java/com/zcloud/service/system/DictionariesService.java +++ b/src/main/java/com/zcloud/service/system/DictionariesService.java @@ -151,4 +151,5 @@ public interface DictionariesService { */ public List getIdsByParentIds(List parentIds) throws Exception; + List findByCondition(PageData condition) throws Exception; } diff --git a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java index 367da87b..3638c3f6 100644 --- a/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/DictionariesServiceImpl.java @@ -256,4 +256,9 @@ public class DictionariesServiceImpl implements DictionariesService { return dictionariesMapper.getIdsByParentIds(parentIds); } + @Override + public List findByCondition(PageData condition) throws Exception { + return dictionariesMapper.findByCondition(condition); + } + } diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 33943a5b..607a0617 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -2,12 +2,12 @@ datasource.no1.driver-class-name: com.mysql.cj.jdbc.Driver datasource.no1.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-prevention?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 -datasource.no1.username=root -datasource.no1.password=Mysql@zcloud88888 +datasource.no1.username=dev +datasource.no1.password=Zykj@dev123456 datasource.no2.driver-class-name: com.mysql.cj.jdbc.Driver datasource.no2.url=jdbc:mysql://39.101.130.96:33068/qa-gwj-regulatory?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=utf-8 -datasource.no2.username=root -datasource.no2.password=Mysql@zcloud88888 +datasource.no2.username=dev +datasource.no2.password=Zykj@dev123456 #druid??? @@ -63,18 +63,18 @@ spring.main.banner-mode=off preventionxgf.api.url=https://qgxgf.qhdsafety.com/qa-prevention-xgf/ qa-regulatory-gwj.api.url=https://qgjg.qhdsafety.com/qa-regulatory-gwj/ #????? -smb.host=192.168.192.201 +smb.host=39.101.130.96 smb.port=22 smb.user=root -smb.password=SJSKAQHBGLXT@20220311 -smb.basePath=/mnt/qask/file/ +smb.password=Zcloud@zcloud88888 +smb.basePath=/mnt/wwag/file/ #Mq\u914D\u7F6E rocketmq.consumer.group2=edu-admin-edit rocketmq.consumer.group1=edu-admin-add #rocketmq.name-server=10.0.140.141:9876 #rocketmq.name-server=192.168.0.70:9876 -rocketmq.name-server=192.168.151.57:9876 +rocketmq.name-server=192.168.0.2:9876 rocketmq.producer.group=libmiddle rocketmq.producer.send-message-timeout=3000 rocketmq.producer.compress-message-body-threshold=4096 @@ -95,6 +95,28 @@ corp.default.pic-path=https://qgqy.qhdsafety.com/ corp.default.back-end-path=https://qgqy.qhdsafety.com/file/ http.file.url=https://qgqy.qhdsafety.com/file/ +mq.csy.data.topic=csy_docking +mq.csy.data.group=scheduled_tasks_csy_docking +mq.csy.file.topic=csy_dockingPicture +mq.csy.file.group=scheduled_tasks_csy_dockingPicture + +mq.cmt.data.topic=cmt_docking +mq.cmt.data.group=scheduled_tasks_cmt_docking +mq.cmt.file.topic=cmt_dockingPicture +mq.cmt.file.group=scheduled_tasks_cmt_dockingPicture + +mq.czks.data.topic=czks_docking +mq.czks.data.group=scheduled_tasks_czks_docking +mq.czks.file.topic=czks_dockingPicture +mq.czks.file.group=scheduled_tasks_czks_dockingPicture + +mq.gwj.data.topic=czks_docking +mq.gwj.file.topic=czks_dockingPicture +baseimgpath =http://192.168.192.201:8991/file/ + +heBeiQinAnFile=https://file.zcloudchina.com/YTHFile +biaoZhunShuJuKu=https://file.zcloudchina.com/ +dw.url=http://192.168.192.201:8888/qa-dingWei-gwj/ #�û���ʶ # ���ݿ�ʯ diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index dd259ac5..ea7feb10 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,11 +2,11 @@ spring.application.name=qa-prevention-gwj server.port=8091 #?? -#spring.profiles.active=local +spring.profiles.active=local #����31ʱʹ�� #spring.profiles.active=dev #?? -spring.profiles.active=master +#spring.profiles.active=master diff --git a/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml b/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml index 9f5c464d..cc960f73 100644 --- a/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml +++ b/src/main/resources/mybatis/datasource/system/DictionariesMapper.xml @@ -266,4 +266,23 @@ #{PARENT_ID} + diff --git a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml index 5e2d3e6d..7a9f668a 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/OutSourcedMapper.xml @@ -304,7 +304,7 @@ vua.NAME OUTSOURCED_CREATOR_NAME, ifnull(vac.CORP_NAME,'秦港股份有限公司') CORP_NAME, p.`NAME` as UNITS_PIC_NAME, - ifnull(h.HIDDEN_COUNT,0) HIDDEN_COUNT + ifnull(h.HIDDEN_COUNT,0) + ifnull(hai.AI_COUNT ,0) HIDDEN_COUNT from f left join bus_units b using (UNITS_ID) @@ -335,9 +335,24 @@ ) t group by t.OUTSOURCED_ID,t.CREATOR ) uncheck on uncheck.OUTSOURCED_ID = f.OUTSOURCED_ID and uncheck.CREATOR = #{pd.UserId} - left join ( SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT, t.SOURCE SOURCE, t.CREATOR CREATOR - FROM - ( SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* FROM `qa-gwj-prevention`.bus_keyproject_hidden h LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID and h.ISDELETE = '0') t GROUP BY t.OUTSOURCED_ID,t.CREATOR ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID + left join ( + SELECT t.OUTSOURCED_ID, COUNT( t.HIDDEN_ID ) HIDDEN_COUNT, t.SOURCE SOURCE, t.CREATOR CREATOR + FROM + ( + SELECT IFNULL( k.OUTSOURCED_ID, h.FOREIGN_ID ) OUTSOURCED_ID, h.* + FROM `qa-gwj-prevention`.bus_keyproject_hidden h + LEFT JOIN `qa-gwj-prevention`.bus_keyprojectcheck k ON h.FOREIGN_ID = k.KEYPROJECTCHECK_ID and h.ISDELETE = '0' + ) t + GROUP BY t.OUTSOURCED_ID,t.CREATOR + ) h on h.OUTSOURCED_ID = f.OUTSOURCED_ID + left join ( + select vm.OUTSOURCED_ID ,COUNT(1) AI_COUNT + from `qa-gwj-regulatory`.bus_videomanager vm + left join `qa-gwj-regulatory`.bus_aiwarning ai on ai.VIDEOMANAGER_ID = vm.VIDEOMANAGER_ID and vm.ISDELETE = '0' + left join `qa-gwj-regulatory`.bus_aiwarning_hiddens ah on ai.AIWARNING_ID = ah.AIWARNING_ID + left join `qa-gwj-prevention`.bus_keyproject_hidden h on ah.HIDDEN_ID = h.HIDDEN_ID + where h.ISDELETE = '0' and h.SOURCE = '1' + ) hai on hai.OUTSOURCED_ID = f.OUTSOURCED_ID where f.ISDELETE = '0' and