Merge branch 'pet' into liujun-2024-06-20-工匠学员对接

xuyifeng-0724-人员中台对接-dev
liujun 2024-06-28 11:19:04 +08:00
commit a6f40ada38
13 changed files with 194 additions and 24 deletions

View File

@ -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不发消息------------------------");
}

View File

@ -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<>());

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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<String,Object> map = new HashMap<String,Object>();
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<PageData> 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<PageData> 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<String,List<PageData>> tongJi = new HashMap<>();
List<PageData> dic = dictionariesService.findByCondition(condition);
// 找出要统计的图标信息
for (PageData _dic : dic){
condition.clear();
condition.put("PARENT_ID",_dic.getString("DICTIONARIES_ID"));
List<PageData> 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<PageData> varList = platformelectronicService.listAll(pd); //列出Platformelectronic列表
for (PageData data : varList) {

View File

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

View File

@ -106,4 +106,6 @@ public interface DictionariesMapper {
*/
List<PageData> getIdsByRecuByParentId(String parentId);
List<PageData> getIdsByParentIds(List<String> parentIds);
List<PageData> findByCondition(PageData condition);
}

View File

@ -10,5 +10,7 @@ public class AlarmGet {
private String status;
private String corpId;
private Page page;
// 告警来源
private String sourceNum;
}

View File

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

View File

@ -151,4 +151,5 @@ public interface DictionariesService {
*/
public List<PageData> getIdsByParentIds(List<String> parentIds) throws Exception;
List<PageData> findByCondition(PageData condition) throws Exception;
}

View File

@ -256,4 +256,9 @@ public class DictionariesServiceImpl implements DictionariesService {
return dictionariesMapper.getIdsByParentIds(parentIds);
}
@Override
public List<PageData> findByCondition(PageData condition) throws Exception {
return dictionariesMapper.findByCondition(condition);
}
}

View File

@ -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/
#<23>û<EFBFBD><C3BB><EFBFBD>ʶ
# <20><><EFBFBD>ݿ<EFBFBD>ʯ

View File

@ -2,11 +2,11 @@ spring.application.name=qa-prevention-gwj
server.port=8091
#??
#spring.profiles.active=local
spring.profiles.active=local
#<23><><EFBFBD><EFBFBD>31ʱʹ<CAB1><CAB9>
#spring.profiles.active=dev
#??
spring.profiles.active=master
#spring.profiles.active=master

View File

@ -266,4 +266,23 @@
#{PARENT_ID}
</foreach>
</select>
<select id="findByCondition" resultType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
where ISDELETE = 0
<if test="BIANMA != null and BIANMA != ''">
and BIANMA = #{BIANMA}
</if>
<if test="NAME != null and NAME != ''">
and NAME = #{NAME}
</if>
<if test="PARENT_ID != null and PARENT_ID != ''">
and PARENT_ID = #{PARENT_ID}
</if>
<if test="DICTIONARIES_ID != null and DICTIONARIES_ID != ''">
and DICTIONARIES_ID = #{DICTIONARIES_ID}
</if>
</select>
</mapper>

View File

@ -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
<include refid="tableName"></include> 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}
</if>
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'
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and