Commit 9012a04f authored by litengwei's avatar litengwei

Merge remote-tracking branch 'origin/develop_dl_3.7.0.9' into develop_dl_3.7.0.9

parents 1f0366bc 5a076e8b
......@@ -22,7 +22,6 @@ import lombok.EqualsAndHashCode;
@ApiModel(value="OrgUsr对象", description="人员信息")
public class OrgPersonDto extends BaseDto {
/**
*
*/
......@@ -82,4 +81,6 @@ public class OrgPersonDto extends BaseDto {
@ApiModelProperty(value = "动态表单值")
private List<DynamicFormInstance> dynamicFormValue;
private String personImg;
}
......@@ -99,4 +99,6 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "消防信息实体")
private CompanyInfo companyInfo;
private String personImg;
}
......@@ -90,4 +90,7 @@ public class OrgUsr extends BaseEntity {
@ApiModelProperty(value = "管理类别")
@TableField(exist = false)
private String managementType;
@ApiModelProperty(value = "人员照片")
private String personImg;
}
......@@ -15,7 +15,9 @@ import java.util.Map;
public interface OrganizationMapper extends BaseMapper<Organization> {
Page<Map<String, Object>> getOrganizationInfo(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
List<Map<String, Object>> getOrganizationInfo(@Param("bizOrgCode") String bizOrgCode);
Map<String, Object> getTeamLeader();
Page<Map<String, Object>> getOrganizationList(Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode);
......
......@@ -5,13 +5,22 @@
<select id="getOrganizationInfo" resultType="java.util.Map">
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value,
co.emergency_team_name AS name
FROM
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort desc
LIMIT 5
</select>
<select id="getTeamLeader" resultType="Map">
SELECT
(
SELECT
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS
value
Ifnull (GROUP_CONCAT( cou.biz_org_name ),'') AS value
FROM
(
SELECT
......@@ -32,25 +41,34 @@
)
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
,
'当值值长' AS name UNION
(
LEFT JOIN cb_org_usr cou ON cou.sequence_nbr = temp.userId WHERE cou.is_delete = 0
) AS value,
(
SELECT
( SELECT COUNT( 1 ) FROM cb_organization_user cou WHERE cou.emergency_team_id = co.sequence_nbr ) AS
value
,
co.emergency_team_name AS name
Ifnull(GROUP_CONCAT( dfi.field_value ),'') AS tel
FROM
cb_organization co
WHERE co.is_delete = 0
ORDER BY
co.sort desc
LIMIT 5
(
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 id="getOrganizationList" resultType="java.util.Map">
SELECT
......
......@@ -778,9 +778,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
public String getPersonImg(String id) {
Long userId = Long.valueOf(id);
OrgUsr orgUsr = this.baseMapper.queryByUserId(userId);
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listBySeqnum(orgUsr.getSequenceNbr());
String str = list.get(0).getFieldValue();
return str;
return orgUsr.getPersonImg();
}
public List<FormValue> getFormValueDetail(Long id) throws Exception {
......@@ -2964,6 +2962,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgName(peopleBasicInfoDto.getName());
orgUsr.setParentId(peopleBasicInfoDto.getCompany());
orgUsr.setParentName(peopleBasicInfoDto.getBizOrgName());
orgUsr.setPersonImg(peopleBasicInfoDto.getPersonImg());
orgUsr.setIsDelete(false);
return orgUsr;
}
......
......@@ -232,4 +232,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
List<Map<String, Object>> stationInfo();
void updateStatusByAlarm();
void clearAlarmData(@Param("equipmentSpecificId") Long equipmentSpecificId);
}
......@@ -2,6 +2,9 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.ManufacturerInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper 接口
......@@ -14,7 +17,6 @@ public interface ManufacturerInfoMapper extends BaseMapper<ManufacturerInfo> {
int checkName(String name, Long id);
String checkDelete(Long id);
List<String> checkDelete(@Param("ids") List<Long> ids);
}
......@@ -383,14 +383,8 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
@Override
public String checkDelete(List<Long> ids) {
String res = "";
for (Long id : ids) {
String s = manufacturerInfoMapper.checkDelete(id);
if (s != null && !("").equals(s)) {
res = res + s + " , ";
}
}
return res;
List<String> s = manufacturerInfoMapper.checkDelete(ids);
return String.join(",", s);
}
@Override
......
......@@ -1004,6 +1004,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentDetailService.removeById(equipmentSpecific.getEquipmentDetailId());
}
if (res > 0) {
equipmentSpecificAlarmMapper.clearAlarmData(id);
// 删除设备动态表单扩展属性
return formInstanceEquipService.deleteInstanceById(id);
} else {
......
......@@ -357,22 +357,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
JSONObject jsonObject = JSONObject.parseObject(message);
String dataType = jsonObject.getString("datatype");
String indexAddress,value,timeStamp,quality = null;
String indexAddress, value, timeStamp, quality = null;
//如果消息是遥信类型,进行指标转换
if(dataType != null && dataType.equals("state")){
if (dataType != null && dataType.equals("state")) {
indexAddress = jsonObject.getString("scadaid");
value = jsonObject.getInteger("value") ==1 ? "true":"false";
value = jsonObject.getInteger("value") == 1 ? "true" : "false";
timeStamp = jsonObject.getString("timestamp");
}else{
} else {
indexAddress = jsonObject.getString("key");
value = jsonObject.getString("value");
timeStamp = jsonObject.getString("time_stamp");
quality = jsonObject.getString("quality");
}
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByIndexAddress(indexAddress,null);
if (equipmentSpeIndex == null){
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByIndexAddress(indexAddress, null);
if (equipmentSpeIndex == null) {
return;
}
equipmentSpeIndex.setValue(value);
......@@ -625,11 +625,11 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
String traceId = jsonObject.getString("traceId");
String deviceCode = jsonObject.getString("deviceCode");
String gatewayId = jsonObject.getString("gatewayId");
String value=jsonObject.getString("value");
String value = jsonObject.getString("value");
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByIndexAddress(indexAddress,gatewayId);
if (equipmentSpeIndex == null){
EquipmentSpecificIndex equipmentSpeIndex = equipmentSpecificIndexService.getEquipmentSpeIndexByIndexAddress(indexAddress, gatewayId);
if (equipmentSpeIndex == null) {
return;
}
......@@ -644,7 +644,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
//更新装备性能指标
//equipmentSpecificIndexService.updateById(equipmentSpeIndex);
tagsMap.put("key", indexAddress+"_"+gatewayId);
tagsMap.put("key", indexAddress + "_" + gatewayId);
fieldsMap.put("traceId", traceId);
fieldsMap.put("address", indexAddress);
......@@ -655,10 +655,12 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
fieldsMap.put("equipmentIndexName", equipmentSpeIndex.getEquipmentIndexName());
fieldsMap.put("equipmentIndexKey", equipmentSpeIndex.getEquipmentIndexKey());
fieldsMap.put("isAlarm", equipmentSpeIndex.getIsAlarm().toString());
fieldsMap.put("unit", equipmentSpeIndex.getUnit());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fieldsMap.put("createdTime", simpleDateFormat.format(new Date()));
fieldsMap.put("equipmentIndex", JSON.toJSONString(equipmentSpeIndex));
//保存influxDB库
influxDbConnection.insert("iot_data", tagsMap, fieldsMap);
QueryWrapper<EquipmentSpecific> queryWrapper = new QueryWrapper<>();
......@@ -697,7 +699,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
// 直流中心消息推送刷新
publishDataToDCCenterPage(equipmentSpecificIndexList);
......@@ -772,12 +774,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
iotDataListToCacheMap(iotDatalist);
iotDatalist.forEach(iotDataVO -> {
boolean alarmFlag = false;
String indexKey = iotDataVO.getKey();
String indexValue = iotDataVO.getValue().toString();
// 稳压泵启停信号处理
if (indexKey.equals(pressurePumpStart)) {
pressurePump(indexKey, indexValue, iotDatalist, topicEntity);
}
for (EquipmentSpecificIndex equipmentSpecificIndex : indexList) {
if (!ObjectUtils.isEmpty(equipmentSpecificIndex.getNameKey())
&& equipmentSpecificIndex.getNameKey().toLowerCase().equals(iotDataVO.getKey().toLowerCase())) {
......@@ -897,6 +894,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
iotDatalist.forEach(iotDataVO -> {
String indexKey = iotDataVO.getKey();
String indexValue = iotDataVO.getValue().toString();
// 稳压泵启停信号处理
if (indexKey.equals(pressurePumpStart)) {
pressurePump(indexKey, indexValue, iotDatalist, topicEntity);
}
});
equipmentSpecificAlarms.forEach(action -> {
if (AlarmStatusEnum.BJ.getCode() == action.getStatus()) {
alarmLogs.add(addEquipAlarmLogRecord(action));
......
......@@ -5,6 +5,7 @@ import java.util.*;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.entity.*;
import com.yeejoin.amos.boot.module.common.api.enums.ExceptionEnum;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -50,14 +51,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FirefightersZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.PeopleBasicInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.PeopleInfoDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContract;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersThought;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl;
......
......@@ -38,12 +38,25 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
@Override
public Page<Map<String, Object>> getOrganizationInfo(Page<Map<String, Object>> page, String bizOrgCode) {
Page<Map<String, Object>> page1 = new Page<>();
List<Map<String, Object>> list = organizationMapper.getOrganizationInfo(page, bizOrgCode).getRecords();
List<Map<String, Object>> list = organizationMapper.getOrganizationInfo(bizOrgCode);
LambdaQueryWrapper<Organization> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(Organization::getSort);
List<Organization> organizations = this.baseMapper.selectList(wrapper);
List<Map<String, Object>> res = new ArrayList<>();
if (0 < list.size()) {
// 获取值长
Map<String, Object> resMap = this.baseMapper.getTeamLeader();
Map<String, Object> leaderMap = new HashMap<>();
if (ObjectUtils.isEmpty(resMap.get("value"))) {
leaderMap.put("name", resMap.get("name") + "");
leaderMap.put("value", "");
} else {
// 跟现场确认此处值长只有一人,所以只做一人处理
leaderMap.put("name", resMap.get("name") + " " + "1人");
leaderMap.put("value", resMap.get("value") + "-" + resMap.get("tel"));
}
res.add(leaderMap);
for (Map<String, Object> map : list) {
Map<String, Object> tempMap = new HashMap<>();
if (ObjectUtils.isEmpty(map.get("value"))) {
......@@ -51,19 +64,22 @@ public class OrganizationImpl extends BaseService<Organization, Organization, Or
tempMap.put("value", "");
} else {
tempMap.put("name", map.get("name") + " " + map.get("value") + "人");
Organization organization = organizations.stream().filter(x -> x.getEmergencyTeamName().equals(map.get("name"))).collect(Collectors.toList()).get(0);
String[] nameArr = organization.getGroupLeader().split(",");
List<String> nameList = Arrays.asList(nameArr);
String[] telArr = new String[nameList.size()];
if (ObjectUtils.isNotEmpty(organization.getGroupLeaderTel())) {
telArr = organization.getGroupLeaderTel().split("\n");
}
List<String> telList = Arrays.asList(telArr);
List<String> valueList = new ArrayList<>();
for (int i = 0; i < nameList.size(); i++) {
valueList.add(nameList.get(i) + "-" + telList.get(i));
List<Organization> organizationList = organizations.stream().filter(x -> x.getEmergencyTeamName().equals(map.get("name"))).collect(Collectors.toList());
if (0 < organizationList.size()) {
Organization organization = organizationList.get(0);
String[] nameArr = organization.getGroupLeader().split(",");
List<String> nameList = Arrays.asList(nameArr);
String[] telArr = new String[nameList.size()];
if (ObjectUtils.isNotEmpty(organization.getGroupLeaderTel())) {
telArr = organization.getGroupLeaderTel().split("\n");
}
List<String> telList = Arrays.asList(telArr);
List<String> valueList = new ArrayList<>();
for (int i = 0; i < nameList.size(); i++) {
valueList.add(nameList.get(i) + "-" + telList.get(i));
}
tempMap.put("value", String.join(",", valueList));
}
tempMap.put("value", String.join(",", valueList));
}
res.add(tempMap);
}
......
......@@ -713,8 +713,8 @@ public class InputItemController extends AbstractBaseController {
}
//如果为1则为否,顺应机场逻辑
param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
param.setKeyPartsType("1".equals(param.getKeyPartsType()) ? null : param.getKeyPartsType());
/* param.setCustomType("1".equals(param.getCustomType()) ? null : param.getCustomType());
param.setKeyPartsType("1".equals(param.getKeyPartsType()) ? null : param.getKeyPartsType());*/
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
......
......@@ -155,10 +155,10 @@
<select id="checkDelete" resultType="String">
select
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
(select name from wl_equipment_detail eq where eq.id = sto.equipment_detail_id) as name
from wl_stock_detail as sto
where
equipment_detail_id = #{id}
equipment_detail_id = #{id}
group by equipment_detail_id
</select>
<select id="getWareId" resultType="Long">
......
......@@ -1589,4 +1589,10 @@
GROUP BY
a.`name`
</select>
<delete id="clearAlarmData">
DELETE FROM wl_equipment_specific_alarm WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_specific_alarm_log WHERE equipment_specific_id = #{equipmentSpecificId};
DELETE FROM wl_equipment_alarm_report_day WHERE equipment_specific_id = #{equipmentSpecificId};
</delete>
</mapper>
\ No newline at end of file
......@@ -26,8 +26,26 @@
</select>
<select id="checkDelete" resultType="string">
select name from wl_equipment_detail where equipment_id = #{id}
select
name
from
wl_equipment_detail
<where>
equipment_id IN
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
union
select name from wl_car where equipment_id = #{id}
select
name
from
wl_car
<where>
equipment_id IN
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</where>
</select>
</mapper>
......@@ -3882,4 +3882,16 @@
</sql>
</changeSet>
<changeSet author="ky" id="2023-06-21-001">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_org_usr" columnName="person_img"/>
</not>
</preConditions>
<comment>cb_org_usr add column</comment>
<sql>
alter table `cb_org_usr` add column `person_img` varchar(255) DEFAULT NULL COMMENT '人员照片'
</sql>
</changeSet>
</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