Commit 26ed17dc authored by maoying's avatar maoying

Merge branch 'develop_dl_3.7.0.9_huaian' into temp

parents 9aad0037 d0b8efcb
...@@ -78,4 +78,13 @@ public class EquipmentIndexVO { ...@@ -78,4 +78,13 @@ public class EquipmentIndexVO {
@ApiModelProperty(value = "网关标识") @ApiModelProperty(value = "网关标识")
private String gatewayId; private String gatewayId;
@ApiModelProperty(value = "是否是告警设备")
private String isAlarm;
@ApiModelProperty(value = "装备名称")
private String equipmentSpecificName;
@ApiModelProperty(value = "装备指标名称")
private String equipmentIndexName;
} }
...@@ -13,14 +13,20 @@ public enum PressurePumpEnum { ...@@ -13,14 +13,20 @@ public enum PressurePumpEnum {
ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5", ALONE_START_QT("FHS_PressurePump_Start_ALONE_START_QT", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"), PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
ALONE_START_QT_WJ("FHS_PressurePump_Start_ALONE_START_QT_WJ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALONE_START_QT_YZ("FHS_PressurePump_Start_ALONE_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"),
ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "5", ALL_START_QT_WJ("FHS_PressurePump_Start_ALL_START_QT_WJ", PressurePumpCheckEnum.LE.getCode(), "", "5",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【5】分钟"),
START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30", START_QT_WJ_ALL("FHS_PressurePump_Start_ALL_START_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "5", "30",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"), PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_QT_WJ.getCode(), "【30】分钟"),
ALL_STOP_QT_YZ("FHS_PressurePump_Stop_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60", ALL_STOP_QT_YZ("FHS_PressurePump_Start_ALL_STOP_QT_YZ", PressurePumpCheckEnum.BE.getCode(), "30", "60",
PressurePumpValueEnum.LAST_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时"); PressurePumpValueEnum.LATELY_START.getCode(), PressurePumpMessageEnum.MESSAGE_LEVEL_YZ.getCode(), "【1】小时");
// 备份2023-07-13 // 备份2023-07-13
// ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5", // ALONE_START_YXSC("FHS_PressurePump_Start_ALONE_START_YXSC", "", LocalDateTime.now().getSecond() + " " + (LocalDateTime.now().getMinute()) + "/5 * * * ?", "5",
......
...@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity { ...@@ -46,4 +46,7 @@ public class OrganizationUser extends BaseEntity {
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private int sort; private int sort;
@ApiModelProperty(value = "是否是值长")
private boolean dutyLeader;
} }
...@@ -8,9 +8,13 @@ public interface IOrganizationUserService { ...@@ -8,9 +8,13 @@ public interface IOrganizationUserService {
OrganizationUser updateModelById(OrganizationUser organizationUser); OrganizationUser updateModelById(OrganizationUser organizationUser);
void updateModelByTel(OrganizationUser organizationUser);
OrganizationUser getDetailsById(Long id); OrganizationUser getDetailsById(Long id);
IPage<OrganizationUser> getListPage(int pageNumber, int pageSize, Long id); IPage<OrganizationUser> getListPage(int pageNumber, int pageSize, Long id);
IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel);
int deleteById(Long id); int deleteById(Long id);
} }
...@@ -17,58 +17,7 @@ ...@@ -17,58 +17,7 @@
LIMIT 5 LIMIT 5
</select> </select>
<select id="getTeamLeader" resultType="Map"> <select id="getTeamLeader" resultType="Map">
SELECT SELECT cou.member_name AS `value`, cou.telephone AS tel, '当值值长' AS `name` FROM cb_organization_user cou WHERE cou.duty_leader = true LIMIT 1
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
(
SELECT
cdfi.field_value AS userId
FROM
cb_dynamic_form_instance cdfi
WHERE
cdfi.instance_id IN (
SELECT
cdps.instance_id
FROM
cb_duty_person_shift cdps
LEFT JOIN cb_dynamic_form_instance cdfi ON cdps.instance_id = cdfi.instance_id
WHERE
cdfi.field_code = 'postType'
AND field_value = '1676'
AND cdps.duty_date = ( SELECT DATE_FORMAT(NOW(),"%Y-%m-%d"))
)
AND cdfi.field_code = 'userId'
) temp
LEFT JOIN cb_dynamic_form_instance dfi ON dfi.instance_id = temp.userId WHERE dfi.field_code = 'telephone'
) AS tel,
'当值值长' AS name
</select> </select>
<select id="getOrganizationList" resultType="java.util.Map"> <select id="getOrganizationList" resultType="java.util.Map">
SELECT SELECT
......
...@@ -19,6 +19,4 @@ public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportant ...@@ -19,6 +19,4 @@ public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportant
List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map); List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map);
List<String> getVideoAddressGroupList(Map<String, Object> map);
} }
...@@ -2,12 +2,15 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -2,12 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO; import com.yeejoin.equipmanage.common.dto.EquiplistSpecificBySystemESVO;
import com.yeejoin.equipmanage.common.entity.EquipmentIndex;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto; import com.yeejoin.equipmanage.common.entity.dto.EquipmentAlarmLogDto;
import com.yeejoin.equipmanage.common.exception.BaseException; import com.yeejoin.equipmanage.common.exception.BaseException;
import com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository; import com.yeejoin.equipmanage.dao.ESequiplistSpecificBySystemRepository;
import com.yeejoin.equipmanage.mapper.EquipmentIndexMapper;
import com.yeejoin.equipmanage.service.IESeqService; import com.yeejoin.equipmanage.service.IESeqService;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
...@@ -46,7 +49,8 @@ public class ESeqServiceImpl implements IESeqService { ...@@ -46,7 +49,8 @@ public class ESeqServiceImpl implements IESeqService {
@Autowired @Autowired
private ESequiplistSpecificBySystemRepository esequiplistSpecificBySystemRepository; private ESequiplistSpecificBySystemRepository esequiplistSpecificBySystemRepository;
@Autowired
private EquipmentIndexMapper equipmentIndexMapper;
@Value("${es.ESEquiplistSpecific.flag}") @Value("${es.ESEquiplistSpecific.flag}")
private Boolean flag; private Boolean flag;
...@@ -101,9 +105,14 @@ public class ESeqServiceImpl implements IESeqService { ...@@ -101,9 +105,14 @@ public class ESeqServiceImpl implements IESeqService {
Date daf =new Date(equiplistSpecificBySystemESVO.getTime()); Date daf =new Date(equiplistSpecificBySystemESVO.getTime());
String time=ft.format(daf); String time=ft.format(daf);
da.setTime(time); da.setTime(time);
String value=equiplistSpecificBySystemESVO.getValue(); // String value=equiplistSpecificBySystemESVO.getValue();
value= getReadableStatus(value ); // value= getReadableStatus(value );
da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value); // da.setContent(equiplistSpecificBySystemESVO.getEquipmentIndexName()+":"+value);
QueryWrapper<EquipmentIndex> wrapper = new QueryWrapper<>();
wrapper.eq("name_key", equiplistSpecificBySystemESVO.getEquipmentIndexKey());
wrapper.last("limit 1");
EquipmentIndex index = equipmentIndexMapper.selectOne(wrapper);
da.setContent(index.getTypeName());
list.add(da); list.add(da);
} }
pageBean.setRecords(list); pageBean.setRecords(list);
......
...@@ -198,6 +198,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -198,6 +198,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Value("classpath:/json/equipmentCode.json") @Value("classpath:/json/equipmentCode.json")
private Resource equipmentCode; private Resource equipmentCode;
@Value("${equipment.pressurepump.start}")
private String pressurePumpStart;
private final String injection = "{\n" + private final String injection = "{\n" +
"\n" + "\n" +
...@@ -1921,17 +1924,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1921,17 +1924,18 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) { if (!ObjectUtils.isEmpty(equipmentSpecificIndex)) {
IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo(); IotIndexInfoVo iotIndexInfoVo = new IotIndexInfoVo();
iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName()); iotIndexInfoVo.setType(equipmentSpecificIndex.getTypeName()!=null?equipmentSpecificIndex.getTypeName(): equipmentSpecificIndex.getIndexName());
iotIndexInfoVo.setNumber(deviceName); iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend() == 1) { if (equipmentSpecificIndex.getIsTrend() == 1) {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName()); iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + entry.getValue() + equipmentSpecificIndex.getIndexUnitName());
} else { } else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName()); if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) {
iotIndexInfoVo.setContent(TrueOrFalseEnum.real.value.equals(entry.getValue()) ? equipmentSpecificIndex.getEquipmentIndexName() : PressurePumpRelateEnum.STOP.getDesc());
} else {
iotIndexInfoVo.setContent(equipmentSpecificIndex.getEquipmentIndexName());
}
} }
iotIndexInfoVo.setSendTime(dateStr); iotIndexInfoVo.setSendTime(dateStr);
infoVoList.add(iotIndexInfoVo); infoVoList.add(iotIndexInfoVo);
} }
......
...@@ -2019,6 +2019,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2019,6 +2019,21 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex); List<EquipmentSpecificIndex> equipmentSpeIndexList = equipmentSpecificIndexService.getEquipmentSpeIndexByIndex(listIndex);
List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexValue); List<PressurePumpEnum> enumListByCode = PressurePumpEnum.getEnumListByCode(indexValue);
if (TrueOrFalseEnum.fake.value.equals(indexValue)) {
String jobName = topicEntity.getIotCode() + "_" + indexKey;
String triggerName = PUMP_TRIGGER_NAME + "-" + topicEntity.getIotCode();
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
// 删除这个稳压泵的监听任务
if (b) {
QuartzManager.removeJob(jobName, PUMP_JOB_GROUP_NAME, triggerName, PUMP_TRIGGER_GROUP_NAME);
}
// 稳压泵漏水告警恢复
List<EquipmentSpecificIndex> collect = equipmentSpeIndexList.stream().filter(item -> !ObjectUtils.isEmpty(item.getIotCode()) && item.getIotCode().equals(topicEntity.getIotCode())).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect) && !ObjectUtils.isEmpty(collect.get(0)) && !ObjectUtils.isEmpty(collect.get(0).getEquipmentId())) {
equipmentSpecificAlarmLogService.pressurePumpRestore(collect.get(0).getEquipmentId());
}
}
if (!CollectionUtils.isEmpty(enumListByCode)) { if (!CollectionUtils.isEmpty(enumListByCode)) {
enumListByCode.forEach(pressurePumpEnum -> { enumListByCode.forEach(pressurePumpEnum -> {
// 1. 获取需要校验的值 // 1. 获取需要校验的值
...@@ -2051,8 +2066,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2051,8 +2066,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} else { } else {
throw new BadRequest("装备物联编码错误,请确认!"); throw new BadRequest("装备物联编码错误,请确认!");
} }
String jobName = topicEntity.getIotCode() + "_" + indexKey;
String triggerName = PUMP_TRIGGER_NAME + "-" + topicEntity.getIotCode();
switch (valueEnum) { switch (valueEnum) {
case LAST_STOP: case LAST_STOP:
List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> lastStop = equipmentSpeIndexList.stream().filter(e ->
...@@ -2064,12 +2078,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2064,12 +2078,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
break; break;
case LAST_START: case LAST_START:
boolean b = QuartzManager.checkExists(jobName, PUMP_JOB_GROUP_NAME);
// 删除这个稳压泵的监听任务
if (b) {
QuartzManager.removeJob(jobName, PUMP_JOB_GROUP_NAME, triggerName, PUMP_TRIGGER_GROUP_NAME);
}
List<EquipmentSpecificIndex> lastStart = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> lastStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -2090,10 +2098,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2090,10 +2098,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
break; break;
case LATELY_START: case LATELY_START:
List<EquipmentSpecificIndex> latelyStart = equipmentSpeIndexList.stream().filter(e -> List<EquipmentSpecificIndex> latelyStart = equipmentSpeIndexList.stream().filter(e ->
StringUtil.isNotEmpty(e.getValue()) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed()) StringUtil.isNotEmpty(e.getValue()) && e.getIotCode().equals(iotCode) && pressurePumpStart.equals(e.getEquipmentIndexKey())).sorted(Comparator.comparing(EquipmentSpecificIndex::getUpdateDate).reversed())
.collect(Collectors.toList()); .collect(Collectors.toList());
if (!CollectionUtils.isEmpty(latelyStart)) { if (!CollectionUtils.isEmpty(latelyStart)) {
EquipmentSpecificIndex aTrue = getIotDate(equipmentSpecificIndex, latelyStart, prefix, null, "true"); EquipmentSpecificIndex aTrue = getIotDateExceptSelf(equipmentSpecificIndex, latelyStart, prefix, suffix, "true");
BeanUtils.copyProperties(aTrue, equipmentSpecificIndex); BeanUtils.copyProperties(aTrue, equipmentSpecificIndex);
} }
break; break;
...@@ -2108,14 +2116,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -2108,14 +2116,34 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
private EquipmentSpecificIndex getIotDate(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) { private EquipmentSpecificIndex getIotDate(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) {
ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "1", prefix, suffix, flag, pressurePumpStart); ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "2", prefix, suffix, flag, pressurePumpStart);
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) { if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult()); String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList()); List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
Date startDate = null;
if (1 < collect.size()) {
String startTime = collect.get(1).get("time").substring(0, 19).replace("T", " ");
startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
}
listData.get(0).setUpdateDate(startDate);
BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex);
}
return equipmentSpecificIndex;
}
String startTime = collect.get(0).get("time").substring(0, 19).replace("T", " "); private EquipmentSpecificIndex getIotDateExceptSelf(EquipmentSpecificIndex equipmentSpecificIndex, List<EquipmentSpecificIndex> listData, String prefix, String suffix, String flag) {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8); ResponseModel start = iotFeign.selectOne(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), "100", prefix, null, flag, pressurePumpStart + "," + "deviceName");
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
listObject1 = listObject1.stream().filter(x -> !suffix.equalsIgnoreCase(x.get("deviceName"))).collect(Collectors.toList());
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
Date startDate = null;
if (0 < collect.size()) {
String startTime = collect.get(0).get("time").substring(0, 19).replace("T", " ");
startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
}
listData.get(0).setUpdateDate(startDate); listData.get(0).setUpdateDate(startDate);
BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex); BeanUtils.copyProperties(listData.get(0), equipmentSpecificIndex);
} }
......
...@@ -7,12 +7,7 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper; ...@@ -7,12 +7,7 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -33,19 +28,12 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta ...@@ -33,19 +28,12 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta
@Override @Override
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) { public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) {
ArrayList<Map<String, List<VideoImportantEquipmentVo>>> maps = new ArrayList<>();
List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map); List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map);
List<String> videoAddressGroupList = videoImportantEquipmentMapper.getVideoAddressGroupList(map); return videoList.stream()
for (String address : videoAddressGroupList) { .collect(Collectors.groupingBy(VideoImportantEquipmentVo::getAddress,LinkedHashMap::new,Collectors.toList()))
if (!ObjectUtils.isEmpty(address)) { .entrySet().stream()
List<VideoImportantEquipmentVo> collect = videoList.stream().filter(item -> item.getAddress().equals(address)).collect(Collectors.toList()); .map(entry -> Collections.singletonMap(entry.getKey(), entry.getValue()))
if (collect.size() > 0) { .collect(Collectors.toList());
HashMap<String, List<VideoImportantEquipmentVo>> listMap = new HashMap<>();
listMap.put(address, collect);
maps.add(listMap);
}
}
}
return maps;
} }
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil;
import com.yeejoin.amos.boot.module.jcs.api.entity.Organization; import com.yeejoin.amos.boot.module.jcs.api.entity.Organization;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser; import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationMapper;
...@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController { ...@@ -51,6 +52,18 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.updateModelById(organizationUser)); return ResponseHelper.buildResponse(organizationUserService.updateModelById(organizationUser));
} }
/**
* 编辑应急小组成员
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/updateByTel", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "编辑应急小组成员", notes = "编辑应急小组成员")
public ResponseModel updateModelByTel(@RequestBody OrganizationUser organizationUser){
organizationUserService.updateModelByTel(organizationUser);
return CommonResponseUtil.success();
}
@GetMapping(value = "/getDetailsById") @GetMapping(value = "/getDetailsById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情") @ApiOperation(httpMethod = "GET", value = "获取详情", notes = "获取详情")
...@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController { ...@@ -66,6 +79,15 @@ public class OrganizationUserController extends BaseController {
return ResponseHelper.buildResponse(organizationUserService.getListPage(pageNumber, pageSize, id)); return ResponseHelper.buildResponse(organizationUserService.getListPage(pageNumber, pageSize, id));
} }
@GetMapping(value = "/page")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "卡片值长列表", notes = "卡片值长列表")
public ResponseModel<IPage<OrganizationUser>> getPage(@RequestParam(value = "pageNumber", required = false) int pageNumber,
@RequestParam(value = "pageSize", required = false) int pageSize,
@RequestParam(value = "tel", required = false) String tel) {
return ResponseHelper.buildResponse(organizationUserService.getPage(pageNumber, pageSize, tel));
}
@GetMapping(value = "/deleteById") @GetMapping(value = "/deleteById")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "删除", notes = "根据id删除") @ApiOperation(httpMethod = "GET", value = "删除", notes = "根据id删除")
......
...@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or ...@@ -53,7 +53,7 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
} else { } else {
// 跟现场确认此处值长只有一人,所以只做一人处理 // 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap.put("name", resMap.get("name") + " " + "1人"); leaderMap.put("name", resMap.get("name") + " " + "1人");
leaderMap.put("value", resMap.get("value") + "-" + resMap.get("tel")); leaderMap.put("value", resMap.get("value") + ( ObjectUtils.isNotEmpty(resMap.get("tel")) ? "-" + resMap.get("tel") : "" ));
} }
res.add(leaderMap); res.add(leaderMap);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser; import com.yeejoin.amos.boot.module.jcs.api.entity.OrganizationUser;
import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.OrganizationUserMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService; import com.yeejoin.amos.boot.module.jcs.api.service.IOrganizationUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class OrganizationUserImpl extends BaseService<OrganizationUser,OrganizationUser, OrganizationUserMapper> implements IOrganizationUserService { public class OrganizationUserImpl extends BaseService<OrganizationUser,OrganizationUser, OrganizationUserMapper> implements IOrganizationUserService {
@Override @Override
...@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat ...@@ -24,6 +30,31 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
} }
@Override @Override
public void updateModelByTel(OrganizationUser organizationUser) {
QueryWrapper<OrganizationUser> oldQuery = new QueryWrapper<>();
oldQuery.eq("duty_leader", 1);
List<OrganizationUser> oldList = this.baseMapper.selectList(oldQuery);
if (0 < oldList.size()) {
oldList.forEach(x -> {
x.setDutyLeader(false);
this.baseMapper.updateById(x);
});
}
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (!ObjectUtils.isEmpty(organizationUser.getTelephone())) {
wrapper.eq(OrganizationUser::getTelephone, organizationUser.getTelephone());
} else if (!ObjectUtils.isEmpty(organizationUser.getSequenceNbr())) {
wrapper.eq(OrganizationUser::getSequenceNbr, organizationUser.getSequenceNbr());
}
List<OrganizationUser> newList = this.baseMapper.selectList(wrapper);
newList.forEach(x -> {
x.setDutyLeader(true);
this.baseMapper.updateById(x);
});
}
@Override
public OrganizationUser getDetailsById(Long id) { public OrganizationUser getDetailsById(Long id) {
return this.baseMapper.selectById(id); return this.baseMapper.selectById(id);
} }
...@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat ...@@ -44,6 +75,22 @@ public class OrganizationUserImpl extends BaseService<OrganizationUser,Organizat
} }
@Override @Override
public IPage<OrganizationUser> getPage(int pageNumber, int pageSize, String tel) {
Page<OrganizationUser> page = new Page<>();
page.setSize(pageSize);
page.setCurrent(pageNumber);
LambdaQueryWrapper<OrganizationUser> wrapper = new LambdaQueryWrapper<>();
if (StringUtil.isNotEmpty(tel)) {
wrapper.eq(OrganizationUser::getTelephone, tel);
}
wrapper.eq(OrganizationUser::getIsDelete, false);
wrapper.orderByDesc(OrganizationUser::getSort);
wrapper.groupBy(OrganizationUser::getTelephone);
return this.baseMapper.selectPage(page, wrapper);
}
@Override
public int deleteById(Long id) { public int deleteById(Long id) {
return this.baseMapper.deleteById(id); return this.baseMapper.deleteById(id);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</parent> </parent>
<artifactId>amos-boot-system-equip</artifactId> <artifactId>amos-boot-system-equip</artifactId>
<version>3.7.0.9</version> <version>3.7.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
......
...@@ -139,7 +139,9 @@ ...@@ -139,7 +139,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '920322', '%' ) wes.equipment_code LIKE concat( '920322', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) temp ) temp
</select> </select>
...@@ -217,8 +219,10 @@ ...@@ -217,8 +219,10 @@
wl_equipment_specific wes wl_equipment_specific wes
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921003', '%' ) wes.equipment_code LIKE concat( '921003', '%')
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) UNION
( (
SELECT SELECT
...@@ -242,7 +246,9 @@ ...@@ -242,7 +246,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921002', '%' ) wes.equipment_code LIKE concat( '921002', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION ) UNION
( (
...@@ -267,7 +273,9 @@ ...@@ -267,7 +273,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921004', '%' ) wes.equipment_code LIKE concat( '921004', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) UNION ) UNION
( (
...@@ -292,7 +300,9 @@ ...@@ -292,7 +300,9 @@
JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id JOIN f_equipment_fire_equipment fire ON wes.id = fire.fire_equipment_id
WHERE WHERE
wes.equipment_code LIKE concat( '921005', '%' ) wes.equipment_code LIKE concat( '921005', '%' )
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code}) <if test="code != null and code!='' ">
AND fire.equipment_id = (SELECT id FROM f_equipment WHERE `code` = #{code})
</if>
AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' ) AND wes.biz_org_code LIKE CONCAT( #{bizOrgCode}, '%' )
) )
</select> </select>
......
...@@ -727,7 +727,15 @@ ...@@ -727,7 +727,15 @@
(SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName, (SELECT name from wl_equipment_specific where id = wlesal.equipment_specific_id) AS fireEquipmentName,
wlesal.equipment_index_id AS fireEquipmentIndexId, wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey, wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName, (
SELECT
type_name
FROM
wl_signal_classify sc
WHERE
sc.type_code = wlesal.type
LIMIT 1
) AS fireEquipmentSpecificIndexName,
if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType, if(wlesal.confirm_type IS NULL, 0, 1) AS confirmType,
if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus, if(wlesal.clean_time IS NULL, 0, 1) AS cleanStatus,
CASE CASE
......
...@@ -44,18 +44,4 @@ ...@@ -44,18 +44,4 @@
</where> </where>
ORDER BY v.create_date DESC ORDER BY v.create_date DESC
</select> </select>
<select id="getVideoAddressGroupList" resultType="java.lang.String">
SELECT
v.address
FROM
wl_video v
<where>
<if test="importantEquipmentId != null">
v.id in (select video_id from wl_video_important_equipment
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
GROUP BY v.address
ORDER BY v.create_date DESC
</select>
</mapper> </mapper>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<artifactId>amos-boot-system-jcs</artifactId> <artifactId>amos-boot-system-jcs</artifactId>
<version>3.7.0.9</version> <version>3.7.1.0</version>
<dependencies> <dependencies>
<dependency> <dependency>
......
...@@ -3894,4 +3894,16 @@ ...@@ -3894,4 +3894,16 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="ky" id="2023-07-24">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_organization_user" columnName="duty_leader"/>
</not>
</preConditions>
<comment>cb_organization_user add column</comment>
<sql>
alter table `cb_organization_user` add column `duty_leader` bit(1) NULL DEFAULT b'0' COMMENT '是否是值长'
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment