Commit 0a3b8df0 authored by chenhao's avatar chenhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 7c562c87 67d943c8
...@@ -57,6 +57,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity { ...@@ -57,6 +57,9 @@ public class EquipmentSpecificAlarmLog extends BaseEntity {
@TableField("confirm_type") @TableField("confirm_type")
private String confirmType; private String confirmType;
@ApiModelProperty(value = "确认类型名称,前端已确认时回填用")
private String confirmTypeName;
@ApiModelProperty(value = "报警原因") @ApiModelProperty(value = "报警原因")
@TableField("alarm_reason") @TableField("alarm_reason")
private String alarmReason; private String alarmReason;
......
...@@ -13,10 +13,10 @@ import java.io.Serializable; ...@@ -13,10 +13,10 @@ import java.io.Serializable;
*/ */
@Data @Data
public class VideoDownloadVO implements Serializable { public class VideoDownloadVO implements Serializable {
@ExcelProperty(value = "名称", index = 0) @ExcelProperty(value = "名称(必填)", index = 0)
private String name; private String name;
@ExcelProperty(value = "编号", index = 1) @ExcelProperty(value = "编号(必填)", index = 1)
private String code; private String code;
@ExcelProperty(value = "视频地址", index = 2) @ExcelProperty(value = "视频地址", index = 2)
...@@ -46,4 +46,10 @@ public class VideoDownloadVO implements Serializable { ...@@ -46,4 +46,10 @@ public class VideoDownloadVO implements Serializable {
@ExcelProperty(value = "关联电力设备编码(多个分号分隔)", index = 10) @ExcelProperty(value = "关联电力设备编码(多个分号分隔)", index = 10)
private String importantEquipmentCodes; private String importantEquipmentCodes;
@ExcelProperty(value = "视频类型(枪机/球机)(必填)", index = 11)
private String type;
@ExcelProperty(value = "图片地址", index = 12)
private String img;
} }
package com.yeejoin.equipmanage.common.enums;
/**
* 画布资源枚举
* @author DELL
*
*/
public enum VideoTypeEnum {
gun("枪机", "51000000"),
ball("球机", "52000000");
VideoTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
private String name;
private String code;
public String getName() {
return name;
}
public String getCode() {
return code;
}
public static String getCode(String name) {
for (VideoTypeEnum c : VideoTypeEnum.values()) {
if (c.getName() == name) {
return c.code;
}
}
return "";
}
}
...@@ -31,4 +31,6 @@ public class SpeIndexVo { ...@@ -31,4 +31,6 @@ public class SpeIndexVo {
private String indexValue; private String indexValue;
private String indexName; private String indexName;
private String qrCode;
} }
...@@ -119,6 +119,17 @@ public class AlertCalled extends BaseEntity { ...@@ -119,6 +119,17 @@ public class AlertCalled extends BaseEntity {
private String callTimeEnd ; private String callTimeEnd ;
/*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 结束*/ /*bug 2408 接警记录,按警情状态和接警时间筛选功能失效 陈召 2021-09-22 结束*/
@ApiModelProperty(value = "经度")
@TableField(exist=false)
private String longitude;
@ApiModelProperty(value = "纬度")
@TableField(exist=false)
private String latitude;
@TableField(exist=false) @TableField(exist=false)
@ApiModelProperty(value = "是否处警") @ApiModelProperty(value = "是否处警")
private Boolean isFatherAlert = false; private Boolean isFatherAlert = false;
......
...@@ -166,6 +166,8 @@ public class CommandController extends BaseController { ...@@ -166,6 +166,8 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
/** /**
* 分页警情列表 * 分页警情列表
* *
...@@ -1445,6 +1447,8 @@ public class CommandController extends BaseController { ...@@ -1445,6 +1447,8 @@ public class CommandController extends BaseController {
//获取正在进行的灾情null //获取正在进行的灾情null
if (userCar != null) { if (userCar != null) {
AlertCalled alertCalled = powerTransferCompanyResourcesService.getByPowerTransferCompanyResourId(userCar.getCarId()); AlertCalled alertCalled = powerTransferCompanyResourcesService.getByPowerTransferCompanyResourId(userCar.getCarId());
alertCalled.setLatitude(alertCalled.getCoordinateX()!=null?alertCalled.getCoordinateX().toString():null);
alertCalled.setLongitude(alertCalled.getCoordinateY()!=null?alertCalled.getCoordinateY().toString():null);
return ResponseHelper.buildResponse(alertCalled); return ResponseHelper.buildResponse(alertCalled);
} }
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
......
...@@ -1431,6 +1431,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1431,6 +1431,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return list; return list;
} }
public List<OrgUsr> equipCompanyExport(ReginParams reginParams, String type) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.likeRight(OrgUsr::getBizOrgCode,reginParams.getPersonIdentity().getBizOrgCode());
wrapper.eq(OrgUsr::getBizOrgType,"DEPARTMENT").or().eq(OrgUsr::getBizOrgType,"COMPANY");
wrapper.eq(BaseEntity::getIsDelete,false);
List<OrgUsr> list = baseMapper.selectList(wrapper);
return list;
}
@Override @Override
public List<CheckObjectDto> companyListByUser(AgencyUserModel user) { public List<CheckObjectDto> companyListByUser(AgencyUserModel user) {
List<CheckObjectDto> list = new ArrayList<>(); List<CheckObjectDto> list = new ArrayList<>();
...@@ -2307,7 +2316,26 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2307,7 +2316,26 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, Object> param = new HashMap<>(); Map<String, Object> param = new HashMap<>();
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(authKey); PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgUsr> list = orgUsrMapper.companyTreeByUser(reginParams.getPersonIdentity().getBizOrgCode()); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getBizOrgCode,reginParams.getPersonIdentity().getBizOrgCode());
wrapper.eq(BaseEntity::getIsDelete,false);
wrapper.isNull(OrgUsr::getParentId);
OrgUsr orgUsr = baseMapper.selectOne(wrapper);
List<OrgUsr> list = new ArrayList<>();
if (ValidationUtil.isEmpty(orgUsr)){
list = orgUsrMapper.companyTreeByUser(reginParams.getPersonIdentity().getBizOrgCode());
}else {
LambdaQueryWrapper<OrgUsr> queryWrapper= new LambdaQueryWrapper<>();
wrapper.likeRight(OrgUsr::getBizOrgCode,reginParams.getPersonIdentity().getBizOrgCode());
wrapper.eq(BaseEntity::getIsDelete,false);
wrapper.eq(OrgUsr::getBizOrgType,"DEPARTMENT");
baseMapper.selectList(queryWrapper);
}
list = orgUsrMapper.companyTreeByUser(reginParams.getPersonIdentity().getBizOrgCode());
return buildTreeParallel(list); return buildTreeParallel(list);
} }
// /** // /**
......
...@@ -45,7 +45,6 @@ public class ConfirmAlarmController extends AbstractBaseController { ...@@ -45,7 +45,6 @@ public class ConfirmAlarmController extends AbstractBaseController {
public void confirmAlam(@RequestBody EquipmentSpecificAlarmLog ent) { public void confirmAlam(@RequestBody EquipmentSpecificAlarmLog ent) {
String appKey = getAppKey(); String appKey = getAppKey();
String product = getProduct(); String product = getProduct();
String token = getToken();
iConfirmAlarmService.confirmAlam(ent, appKey, product, getToken(), getUserId()); iConfirmAlarmService.confirmAlam(ent, appKey, product, getToken(), getUserId());
} }
......
...@@ -149,7 +149,7 @@ public class EquipmentAlarmController extends AbstractBaseController { ...@@ -149,7 +149,7 @@ public class EquipmentAlarmController extends AbstractBaseController {
CommonRequest request11 = new CommonRequest(); CommonRequest request11 = new CommonRequest();
request11.setName("cleanStatus"); request11.setName("cleanStatus");
request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null); request11.setValue(StringUtil.isNotEmpty(cleanStatus) ? StringUtils.trimToNull(cleanStatus) : null);
queryRequests.add(request1); queryRequests.add(request11);
CommonRequest request12 = new CommonRequest(); CommonRequest request12 = new CommonRequest();
request12.setName("isRemoveShield"); request12.setName("isRemoveShield");
request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null); request12.setValue(StringUtil.isNotEmpty(isRemoveShield) ? StringUtils.trimToNull(isRemoveShield) : null);
......
...@@ -151,15 +151,6 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -151,15 +151,6 @@ public class EquipmentDetailController extends AbstractBaseController {
throw new BadRequest("管理方式未输入"); throw new BadRequest("管理方式未输入");
} }
EquipmentSpecific vo = equipmentDate.getEquipmentSpecific(); EquipmentSpecific vo = equipmentDate.getEquipmentSpecific();
// int code = equipmentSpecificSerivce.count(new QueryWrapper<EquipmentSpecific>().eq("code", vo.getCode()));
// int iotCode = equipmentSpecificSerivce.count(new QueryWrapper<EquipmentSpecific>().eq("iot_code", vo.getIotCode()));
// if (code > 0){
// throw new BadRequest("设备编码重复");
// }
// if (iotCode > 0){
// throw new BadRequest("设备物联编码重复");
// }
String sysCode = vo.getCode(); String sysCode = vo.getCode();
if (StringUtils.isNotEmpty(sysCode) && StringUtils.isNotEmpty(sysCode.trim())) { if (StringUtils.isNotEmpty(sysCode) && StringUtils.isNotEmpty(sysCode.trim())) {
int code = equipmentSpecificSerivce.count(new QueryWrapper<EquipmentSpecific>().eq("code", sysCode.trim())); int code = equipmentSpecificSerivce.count(new QueryWrapper<EquipmentSpecific>().eq("code", sysCode.trim()));
...@@ -286,6 +277,7 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -286,6 +277,7 @@ public class EquipmentDetailController extends AbstractBaseController {
equipmentSpecific.setPosition(warehouseStructure.getFullName()); equipmentSpecific.setPosition(warehouseStructure.getFullName());
} }
} }
equipmentSpecific.getStockDetail().setDescription(equipmentDetail.getArea());
equipmentSpecificSerivce.updateEquipmentSpecific(equipmentSpecific, getSelectedOrgInfo(), getUserInfo()); equipmentSpecificSerivce.updateEquipmentSpecific(equipmentSpecific, getSelectedOrgInfo(), getUserInfo());
// TODO 后续判断成功,执行同步 // TODO 后续判断成功,执行同步
// 编辑同步redis装备iotcode数据 // 编辑同步redis装备iotcode数据
......
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto; import com.yeejoin.amos.boot.biz.common.dto.OrgMenuDto;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.dto.VideoDTO; import com.yeejoin.equipmanage.common.entity.dto.VideoDTO;
...@@ -58,7 +59,7 @@ public class VideoController extends AbstractBaseController { ...@@ -58,7 +59,7 @@ public class VideoController extends AbstractBaseController {
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public Video saveVideo(@RequestBody VideoSaveDto video) { public Video saveVideo(@RequestBody VideoSaveDto video) {
Video video1 = video.getVideo(); Video video1 = video.getVideo();
ReginParams usrinfo = getSelectedOrgInfo();
if (StringUtils.isNotEmpty(video1.getAddress())) { if (StringUtils.isNotEmpty(video1.getAddress())) {
String[] addressData = video1.getAddress().split("@address@"); String[] addressData = video1.getAddress().split("@address@");
if (addressData.length > 1) { if (addressData.length > 1) {
...@@ -70,6 +71,10 @@ public class VideoController extends AbstractBaseController { ...@@ -70,6 +71,10 @@ public class VideoController extends AbstractBaseController {
if (StringUtils.isNotEmpty(langLatObj.getString("latitude"))) { if (StringUtils.isNotEmpty(langLatObj.getString("latitude"))) {
video1.setLatitude(Double.valueOf(langLatObj.getString("latitude"))); video1.setLatitude(Double.valueOf(langLatObj.getString("latitude")));
} }
video1.setOrgCode(usrinfo.getCompany().getOrgCode());
video1.setCreatorId(usrinfo.getUserModel().getSequenceNbr());
video1.setCreatorName(usrinfo.getUserModel().getRealName());
video1.setCompanyName(usrinfo.getCompany().getCompanyName());
video.setVideo(video1); video.setVideo(video1);
} }
} }
......
...@@ -139,7 +139,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif ...@@ -139,7 +139,6 @@ public interface EquipmentSpecificAlarmMapper extends BaseMapper<EquipmentSpecif
Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param); Page<Map<String, Object>> page(Page page, @Param("param") CommonPageInfoParam param);
int count(CommonPageInfoParam param);
List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param); List<HashMap<String, Object>> getAlarmList(CommonPageInfoParam param);
......
...@@ -207,4 +207,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -207,4 +207,5 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId); List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
List<Map<String,String>> getStationInfo(); List<Map<String,String>> getStationInfo();
} }
...@@ -89,4 +89,5 @@ public interface VideoMapper extends BaseMapper<Video> { ...@@ -89,4 +89,5 @@ public interface VideoMapper extends BaseMapper<Video> {
List<Video> selectListBySourceId(Long floorId); List<Video> selectListBySourceId(Long floorId);
String getParentSourceIds(String childrenId); String getParentSourceIds(String childrenId);
} }
...@@ -294,7 +294,6 @@ public interface IBuilldService extends IService<Building> { ...@@ -294,7 +294,6 @@ public interface IBuilldService extends IService<Building> {
*/ */
Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId); Map<String, String> getBuildingToLongitudeAndLatitude(String instanceId);
/** /**
* 根据登陆人获取公司部门树 * 根据登陆人获取公司部门树
* @return list * @return list
...@@ -305,6 +304,7 @@ public interface IBuilldService extends IService<Building> { ...@@ -305,6 +304,7 @@ public interface IBuilldService extends IService<Building> {
List<BuildingTreeVo> getBuildingVideoTreeNew(); List<BuildingTreeVo> getBuildingVideoTreeNew();
List<Map<String, Object>> getBuildingDetaiList(); List<Map<String, Object>> getBuildingDetaiList();
/** /**
* 查询指定楼层下装备、摄像头 * 查询指定楼层下装备、摄像头
* @param floorId 楼层id * @param floorId 楼层id
......
...@@ -1255,6 +1255,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1255,6 +1255,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
String videoPointInScene = sourceScene.getVideoInScene() != null ? sourceScene.getVideoInScene() : ""; String videoPointInScene = sourceScene.getVideoInScene() != null ? sourceScene.getVideoInScene() : "";
//1.查询楼层下的所有装备list //1.查询楼层下的所有装备list
List<EquiplistSpecificBySystemVO> equipmentSpecifics = equipmentSpecificMapper.getListByWarehouseStructureId(floorId); List<EquiplistSpecificBySystemVO> equipmentSpecifics = equipmentSpecificMapper.getListByWarehouseStructureId(floorId);
equipmentSpecifics.forEach(e -> { equipmentSpecifics.forEach(e -> {
//已经标记则为已绑定 //已经标记则为已绑定
e.setIsBound(equipPointInScene.contains(e.getId().toString())); e.setIsBound(equipPointInScene.contains(e.getId().toString()));
...@@ -1278,6 +1279,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1278,6 +1279,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
return bySystemVOS; return bySystemVOS;
} }
@Override @Override
public List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode) { public List<BuildingTreeVo> getBuildingTreeInOrgCode(String bizOrgCode) {
......
...@@ -3,6 +3,8 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -3,6 +3,8 @@ 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.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo; import com.yeejoin.amos.boot.module.jcs.api.dto.IotSystemAlarmRo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -12,6 +14,7 @@ import com.yeejoin.equipmanage.common.dto.UserDto; ...@@ -12,6 +14,7 @@ import com.yeejoin.equipmanage.common.dto.UserDto;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecific; import com.yeejoin.equipmanage.common.entity.EquipmentSpecific;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarm;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog; import com.yeejoin.equipmanage.common.entity.EquipmentSpecificAlarmLog;
import com.yeejoin.equipmanage.common.entity.EquipmentSpecificIndex;
import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO; import com.yeejoin.equipmanage.common.entity.vo.AlamVideoVO;
import com.yeejoin.equipmanage.common.enums.AlarmCleanTypeEnum; import com.yeejoin.equipmanage.common.enums.AlarmCleanTypeEnum;
import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum; import com.yeejoin.equipmanage.common.enums.AlarmStatusEnum;
...@@ -81,6 +84,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -81,6 +84,9 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
private IEquipmentSpecificSerivce equipmentSpecificSerivce; private IEquipmentSpecificSerivce equipmentSpecificSerivce;
@Autowired @Autowired
private IEquipmentSpecificIndexSerivce iEquipmentSpecificIndexSerivce;
@Autowired
private IVideoService videoService; private IVideoService videoService;
@Value("${systemctl.jcs.switch}") @Value("${systemctl.jcs.switch}")
...@@ -110,7 +116,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -110,7 +116,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
@Override @Override
public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) { public Map<String, Object> getDetailsById(Long alarmId, Long equipId, String type, String area) {
final String videoType = "video"; final String videoType = "video";
final String alarmType = "IOT_CORE_PARAM";
Map<String, Object> res = new HashMap<>(); Map<String, Object> res = new HashMap<>();
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipId);
...@@ -127,10 +132,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -127,10 +132,6 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
videoBySpeId = videoMapper.getVideoBySpeId(equipId); videoBySpeId = videoMapper.getVideoBySpeId(equipId);
} else { } else {
videoBySpeId = videoMapper.getVideoBySpeId(specificAlarm.getEquipmentSpecificId()); videoBySpeId = videoMapper.getVideoBySpeId(specificAlarm.getEquipmentSpecificId());
List<DictionarieValueModel> dict = remoteSecurityService.listDictionaryByDictCode(alarmType);
Map<String, String> dictMap = dict.stream().collect(Collectors.toMap(DictionarieValueModel::getDictDataKey, DictionarieValueModel::getDictDataValue));
//specificAlarm.getEquipmentSpecificIndexKey() 取值为告警类型type,兼容之前的页面取值
specificAlarm.setEquipmentSpecificIndexName(dictMap.get(specificAlarm.getEquipmentSpecificIndexKey()));
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
...@@ -160,6 +161,13 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -160,6 +161,13 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId()); EquipmentSpecificAlarm alarm = equipmentSpecificAlarmMapper.selectById(alarmLog.getEquipmentSpecificAlarmId());
alarm.setStatus(AlarmStatusEnum.HF.getCode()); alarm.setStatus(AlarmStatusEnum.HF.getCode());
equipmentSpecificAlarmMapper.updateById(alarm); equipmentSpecificAlarmMapper.updateById(alarm);
// 警情处理确认后消除更新value 为false,否则灯还在闪
LambdaUpdateWrapper<EquipmentSpecificIndex> updateWrapper =new LambdaUpdateWrapper<EquipmentSpecificIndex>().
set(EquipmentSpecificIndex::getValue,"false").
set(EquipmentSpecificIndex::getUpdateDate,new Date()).
eq(EquipmentSpecificIndex::getEquipmentSpecificId,alarm.getEquipmentSpecificId()).
eq(EquipmentSpecificIndex::getEquipmentIndexKey,alarm.getEquipmentSpecificIndexKey());
iEquipmentSpecificIndexSerivce.update(updateWrapper);
MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), equipmentSpecificAlarmLogService); MqttReceiveServiceImpl.upAlarmLogStatus(alarmLog.getIotCode(), alarmLog.getEquipmentSpecificIndexKey(), equipmentSpecificAlarmLogService);
} }
// 如果是批量确警,先查询,再确警,用于批量消息推送 // 如果是批量确警,先查询,再确警,用于批量消息推送
......
...@@ -183,11 +183,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -183,11 +183,6 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param); Page<Map<String, Object>> resultPage = this.baseMapper.page(result, param);
if (resultPage.getTotal() > 0) { if (resultPage.getTotal() > 0) {
for (Map<String, Object> x : resultPage.getRecords()) { for (Map<String, Object> x : resultPage.getRecords()) {
Object type = x.get("type");
if (AlarmTypeEnum.HZGJ.getCode().equals(type) || AlarmTypeEnum.GZGJ.getCode().equals(type)) {
x.put("typeCode", type);
x.put("type", AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
}
LocalDateTime createDate = (LocalDateTime) x.get("createDate"); LocalDateTime createDate = (LocalDateTime) x.get("createDate");
x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant())); x.put("createDate", Date.from(createDate.atZone(ZoneId.systemDefault()).toInstant()));
x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType")))); x.put("handleType", ConfirmAlamEnum.getTypeByCode(String.valueOf(x.get("handleType"))));
...@@ -215,11 +210,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -215,11 +210,8 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
e.printStackTrace(); e.printStackTrace();
} }
dataVO.setAlarmEquip(String.valueOf(x.get("fireEquipmentName"))); dataVO.setAlarmEquip(String.valueOf(x.get("fireEquipmentName")));
Object type = x.get("type"); Object alarmType = x.get("alarmType");
if (AlarmTypeEnum.HZGJ.getCode().equals(type) || AlarmTypeEnum.GZGJ.getCode().equals(type) dataVO.setAlarmType(StringUtil.isNotEmpty(alarmType) ? alarmType.toString() : "");
|| AlarmTypeEnum.PB.getCode().equals(type)) {
dataVO.setAlarmType(AlarmTypeEnum.getTypeByCode(String.valueOf(type)));
}
dataVO.setType(String.valueOf(x.get("type"))); dataVO.setType(String.valueOf(x.get("type")));
dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType()); dataVO.setAlarmInfo(x.get("fireEquipmentName") + dataVO.getAlarmType());
dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId")))); dataVO.setEquipSpeId(Long.valueOf(String.valueOf(x.get("fireEquipmentId"))));
......
...@@ -142,6 +142,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -142,6 +142,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
@Autowired @Autowired
SignalClassifyMapper signalClassifyMapper; SignalClassifyMapper signalClassifyMapper;
@Autowired
FireFightingSystemMapper fireFightingSystemMapper;
@Value("${systemctl.sync.switch}") @Value("${systemctl.sync.switch}")
private Boolean syncSwitch; private Boolean syncSwitch;
...@@ -935,7 +938,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -935,7 +938,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (stockDetailService.count(stockDetailQueryWrapper) > 0) { if (stockDetailService.count(stockDetailQueryWrapper) > 0) {
throw new RuntimeException("设备已入库,无法删除"); throw new RuntimeException("设备已入库,无法删除");
} }
String code = this.getSystemCodeBySpeId(equipmentSpecific.getSystemId());
int res = this.baseMapper.deleteById(id); int res = this.baseMapper.deleteById(id);
if (StringUtil.isNotEmpty(code)) {
this.integrationPageSysDataRefresh(code);
}
if (res > 0 && syncSwitch) { if (res > 0 && syncSwitch) {
//数据同步 //数据同步
delEquipmentSpecificSyncData(id); delEquipmentSpecificSyncData(id);
...@@ -989,6 +996,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -989,6 +996,15 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
} }
private String getSystemCodeBySpeId(String sysIds) {
if (StringUtil.isNotEmpty(sysIds)) {
List<FireFightingSystemEntity> sys = fireFightingSystemMapper.getFightingSysByIds(sysIds.split(","));
return sys.stream().map(FireFightingSystemEntity::getCode).collect(Collectors.joining(","));
} else {
return null;
}
}
public void delEquipmentSpecificSyncData(Long id){ public void delEquipmentSpecificSyncData(Long id){
//数据同步 //数据同步
...@@ -1234,7 +1250,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1234,7 +1250,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecific.getStockDetail().setEquipmentSpecificId(equipmentSpecific.getId()); equipmentSpecific.getStockDetail().setEquipmentSpecificId(equipmentSpecific.getId());
equipmentSpecific.getStockDetail().setQrCode(qrCode); equipmentSpecific.getStockDetail().setQrCode(qrCode);
equipmentSpecific.getStockDetail().setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); equipmentSpecific.getStockDetail().setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
equipmentSpecific.getStockDetail().setDescription(equipmentData.getEquipmentDetail().getArea()); equipmentSpecific.getStockDetail().setDescription(equipmentDetail.getArea());
stockDetailService.save(equipmentSpecific.getStockDetail()); stockDetailService.save(equipmentSpecific.getStockDetail());
//4.3生成入库单 //4.3生成入库单
...@@ -1320,9 +1336,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1320,9 +1336,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
stockDetail.setUpdateDate(new Date()); stockDetail.setUpdateDate(new Date());
stockDetail.setQrCode(list.get(i)); stockDetail.setQrCode(list.get(i));
stockDetail.setEquipmentSpecificId(equipmentSpecifics.get(i).getId()); stockDetail.setEquipmentSpecificId(equipmentSpecifics.get(i).getId());
stockDetail.setDescription(equipmentDetail.getArea());
stockDetails.add(stockDetail); stockDetails.add(stockDetail);
stockDetail.setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); stockDetail.setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
} }
stockDetailService.saveBatch(stockDetails); stockDetailService.saveBatch(stockDetails);
//5.3生成入库单 //5.3生成入库单
...@@ -1418,6 +1434,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1418,6 +1434,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecific.getStockDetail().setWarehouseId(equipmentSpecific.getStock().getWarehouseId()); equipmentSpecific.getStockDetail().setWarehouseId(equipmentSpecific.getStock().getWarehouseId());
equipmentSpecific.getStockDetail().setEquipmentSpecificId(equipmentSpecific.getId()); equipmentSpecific.getStockDetail().setEquipmentSpecificId(equipmentSpecific.getId());
equipmentSpecific.getStockDetail().setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date())); equipmentSpecific.getStockDetail().setBatchNum(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
equipmentSpecific.getStockDetail().setDescription(equipmentDetail.getArea());
stockDetailService.save(equipmentSpecific.getStockDetail()); stockDetailService.save(equipmentSpecific.getStockDetail());
//生成入库单 //生成入库单
StockBill stockBill = buildStockBills(equipmentSpecific, reginParams, agencyUserModel); StockBill stockBill = buildStockBills(equipmentSpecific, reginParams, agencyUserModel);
......
...@@ -186,8 +186,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -186,8 +186,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} }
List<DynamicFormInstance> formInstance = vo.getFormInstances(); List<DynamicFormInstance> formInstance = vo.getFormInstances();
// 验证必填项 BUG 2725 by kongfm 2021-09-09 // 验证必填项 BUG 2725 by kongfm 2021-09-09
formInstance.stream().forEach(item -> { formInstance.forEach(item -> {
if (item.getNotNull() == true && StringUtils.isEmpty(item.getFieldValue())) { if (item.getNotNull() && StringUtils.isEmpty(item.getFieldValue())) {
throw new BadRequest(item.getFieldLabel() + "为必填项,请确认"); throw new BadRequest(item.getFieldLabel() + "为必填项,请确认");
} }
}); });
...@@ -868,7 +868,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -868,7 +868,6 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if (SystemTypeEnum.fireAlarmSys.getCode().equals(systemCode)) { if (SystemTypeEnum.fireAlarmSys.getCode().equals(systemCode)) {
data = fireFightingSystemMapper.fireAlarmSysEquipmentNumber(); data = fireFightingSystemMapper.fireAlarmSysEquipmentNumber();
this.putAll(data, fireFightingSystemMapper.fireAlarmSysIndexNumber()); this.putAll(data, fireFightingSystemMapper.fireAlarmSysIndexNumber());
this.putAll(data, fireFightingSystemMapper.fireWaterSysHydrant());
} else if (SystemTypeEnum.fireCAFSSys.getCode().equals(systemCode)) { } else if (SystemTypeEnum.fireCAFSSys.getCode().equals(systemCode)) {
data = fireFightingSystemMapper.getFireCafsSystem(); data = fireFightingSystemMapper.getFireCafsSystem();
} else if (SystemTypeEnum.fireONLSys.getCode().equals(systemCode)) { } else if (SystemTypeEnum.fireONLSys.getCode().equals(systemCode)) {
...@@ -885,6 +884,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -885,6 +884,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
data = fireFightingSystemMapper.fireWaterSysCollectingDevice(); data = fireFightingSystemMapper.fireWaterSysCollectingDevice();
this.putAll(data, fireFightingSystemMapper.fireWaterSysPool()); this.putAll(data, fireFightingSystemMapper.fireWaterSysPool());
this.putAll(data, fireFightingSystemMapper.fireWaterSysWaterPump()); this.putAll(data, fireFightingSystemMapper.fireWaterSysWaterPump());
this.putAll(data, fireFightingSystemMapper.fireWaterSysHydrant());
} else { } else {
data = fireFightingSystemMapper.otherSysIndexNumAndTotal(); data = fireFightingSystemMapper.otherSysIndexNumAndTotal();
} }
......
...@@ -75,9 +75,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper; ...@@ -75,9 +75,7 @@ import com.yeejoin.equipmanage.mapper.FireFightingSystemMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.ICarPropertyService; import com.yeejoin.equipmanage.service.ICarPropertyService;
import com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService; import com.yeejoin.equipmanage.service.IEquipmentAlarmReportDayService;
import com.yeejoin.equipmanage.service.IEquipmentDetailService;
import com.yeejoin.equipmanage.service.IEquipmentIndexService; import com.yeejoin.equipmanage.service.IEquipmentIndexService;
import com.yeejoin.equipmanage.service.IEquipmentService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce; import com.yeejoin.equipmanage.service.IEquipmentSpecificIndexSerivce;
...@@ -1137,7 +1135,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1137,7 +1135,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist); equipmentSpecificIndex = handleTemperatureAlarm(equipmentSpeIndex, iotDatalist);
//指标告警处理 //指标告警处理
if(1 == equipmentSpecificIndex.getIsAlarm()){ if(equipmentSpecificIndex.getIsAlarm() !=null && 1 == equipmentSpecificIndex.getIsAlarm()){
equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex)); equipmentSpecificAlarms.addAll(createIndexAlarmRecord(equipmentSpecificIndex));
} }
...@@ -1232,7 +1230,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1232,7 +1230,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
/** /**
* 组装数字换流站平台告警数据 * 组装数字换流站平台告警数据
* @param equipmentSpecificIndex * @param
* @return * @return
*/ */
private List<FireEquipmentFireAlarm> createFireEquipmentFireAlarmVo(List<EquipmentSpecificAlarmLog> equipmentAlarmLogs){ private List<FireEquipmentFireAlarm> createFireEquipmentFireAlarmVo(List<EquipmentSpecificAlarmLog> equipmentAlarmLogs){
...@@ -1267,13 +1265,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1267,13 +1265,13 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
* @param equipmentSpecificIndexList * @param equipmentSpecificIndexList
*/ */
private void syncSpecificIndexsToGS(List<EquipmentSpecificIndex> equipmentSpecificIndexList){ private void syncSpecificIndexsToGS(List<EquipmentSpecificIndex> equipmentSpecificIndexList){
if (ObjectUtils.isEmpty(equipmentSpecificIndexList) && syncSwitch) { if (!ObjectUtils.isEmpty(equipmentSpecificIndexList) && syncSwitch) {
// 数据同步 // 数据同步
List<EquipmentIndexVO> fireEquipMeasurementCollect = new ArrayList<>(); List<EquipmentIndexVO> fireEquipMeasurementCollect = new ArrayList<>();
equipmentSpecificIndexList.forEach(action->{ equipmentSpecificIndexList.forEach(action->{
EquipmentIndexVO equipmentIndexVO = new EquipmentIndexVO(); EquipmentIndexVO equipmentIndexVO = new EquipmentIndexVO();
BeanUtils.copyProperties(action, equipmentIndexVO); BeanUtils.copyProperties(action, equipmentIndexVO);
fireEquipMeasurementCollect.add(equipmentIndexVO);
}); });
if (0 < fireEquipMeasurementCollect.size()) { if (0 < fireEquipMeasurementCollect.size()) {
syncDataService.syncCreatedFireEquipMeasurement(fireEquipMeasurementCollect); syncDataService.syncCreatedFireEquipMeasurement(fireEquipMeasurementCollect);
...@@ -1451,6 +1449,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1451,6 +1449,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
carProperties.forEach(carProperty->{ carProperties.forEach(carProperty->{
if (iotDataVO.getKey().equals(carProperty.getNameKey())) { if (iotDataVO.getKey().equals(carProperty.getNameKey())) {
carProperty.setValue(iotDataVO.getValue().toString()); carProperty.setValue(iotDataVO.getValue().toString());
carProperty.setUpdateDate(new Date());
carPropertyVos.add(carPropertyToCarPropertyVo(carProperty)); carPropertyVos.add(carPropertyToCarPropertyVo(carProperty));
carIndexsList.add(carProperty); carIndexsList.add(carProperty);
} }
......
...@@ -446,7 +446,7 @@ public class SyncDataServiceImpl implements ISyncDataService { ...@@ -446,7 +446,7 @@ public class SyncDataServiceImpl implements ISyncDataService {
private void sendMessage(SyncDataMessage message) { private void sendMessage(SyncDataMessage message) {
try { try {
emqKeeper.getMqttClient().publish(message.getType().getMqTopic(), message.message2Bytes(), 1, false); emqKeeper.getMqttClient().publish(message.getType().getMqTopic(), message.message2Bytes(), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto; ...@@ -12,6 +12,7 @@ import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum; import com.yeejoin.equipmanage.common.enums.EquipmentSpeIndexEnum;
import com.yeejoin.equipmanage.common.enums.IndustryEnum; import com.yeejoin.equipmanage.common.enums.IndustryEnum;
import com.yeejoin.equipmanage.common.enums.VideoTypeEnum;
import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil; import com.yeejoin.equipmanage.common.utils.HttpContentTypeUtil;
import com.yeejoin.equipmanage.common.utils.StringUtil; import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.fegin.VideoFeignClient; import com.yeejoin.equipmanage.fegin.VideoFeignClient;
...@@ -384,8 +385,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -384,8 +385,8 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
VideoDownloadVO x = videoDownloadVOS.get(i); VideoDownloadVO x = videoDownloadVOS.get(i);
// 数据校验 // 数据校验
if (ValidationUtil.isEmpty(x.getName()) || ValidationUtil.isEmpty(x.getCode()) if (ValidationUtil.isEmpty(x.getName()) || ValidationUtil.isEmpty(x.getCode())
|| ValidationUtil.isEmpty(x.getUrl()) || ValidationUtil.isEmpty(x.getToken()) // || ValidationUtil.isEmpty(x.getUrl()) || ValidationUtil.isEmpty(x.getToken())
|| ValidationUtil.isEmpty(x.getAddress()) || ValidationUtil.isEmpty(x.getEquipmentSpecificCodes())) { || ValidationUtil.isEmpty(x.getAddress())) {
throw new RuntimeException("错误行" + rowNum + ":请检查非空字段"); throw new RuntimeException("错误行" + rowNum + ":请检查非空字段");
} }
if (videoCodeSet.contains(x.getCode().trim())) { if (videoCodeSet.contains(x.getCode().trim())) {
...@@ -406,6 +407,9 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements ...@@ -406,6 +407,9 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
video.setCode(x.getCode()); video.setCode(x.getCode());
video.setRemark(x.getRemark()); video.setRemark(x.getRemark());
video.setAddress(x.getAddress()); video.setAddress(x.getAddress());
video.setImg(x.getImg());
video.setType(x.getType());
video.setTypeCode(!ObjectUtils.isEmpty(VideoTypeEnum.getCode(x.getType()))?VideoTypeEnum.getCode(x.getType()):"");
video.setBizOrgCode(x.getBizOrgCode()); video.setBizOrgCode(x.getBizOrgCode());
video.setBizOrgName(x.getBizOrgName()); video.setBizOrgName(x.getBizOrgName());
videos.add(video); videos.add(video);
......
...@@ -139,13 +139,14 @@ public class FireSourceController extends AbstractBaseController { ...@@ -139,13 +139,14 @@ public class FireSourceController extends AbstractBaseController {
@ApiParam(value = "设备名称", required = false) @RequestParam(required = false) String fireEquipmentName, @ApiParam(value = "设备名称", required = false) @RequestParam(required = false) String fireEquipmentName,
@ApiParam(value = "按保护对象名称", required = false) @RequestParam(required = false) String equipmentName, @ApiParam(value = "按保护对象名称", required = false) @RequestParam(required = false) String equipmentName,
@ApiParam(value = "开始日期", required = false) @RequestParam(required = false) String startTime, @ApiParam(value = "开始日期", required = false) @RequestParam(required = false) String startTime,
@ApiParam(value = "建筑id", required = false) @RequestParam(required = false) String buildId,
@ApiParam(value = "结束日期", required = false) @RequestParam(required = false) String endTime, int pageNumber, @ApiParam(value = "结束日期", required = false) @RequestParam(required = false) String endTime, int pageNumber,
int pageSize) { int pageSize) {
CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize); CommonPageable commonPageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(iFireEquipService.queryForFireEquipmentHistory( return CommonResponseUtil.success(iFireEquipService.queryForFireEquipmentHistory(
StringUtils.trimToNull(fireEquipmentName), StringUtils.trimToNull(equipmentName), StringUtils.trimToNull(fireEquipmentName), StringUtils.trimToNull(equipmentName),
StringUtils.trimToNull(startTime), StringUtils.trimToNull(endTime), commonPageable)); StringUtils.trimToNull(startTime), StringUtils.trimToNull(endTime),StringUtils.trimToNull(buildId), commonPageable));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -27,7 +27,8 @@ public interface FireEquipMapper extends BaseMapper { ...@@ -27,7 +27,8 @@ public interface FireEquipMapper extends BaseMapper {
long queryForFireEquipmentHistoryCount(@Param("fireEquipmentName") String fireEquipmentName, long queryForFireEquipmentHistoryCount(@Param("fireEquipmentName") String fireEquipmentName,
@Param("equipmentName") String equipmentName, @Param("equipmentName") String equipmentName,
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime); @Param("endTime") String endTime,
@Param("buildId") String buildId);
//查询 消防设备历史数据 //查询 消防设备历史数据
List<Map> queryForFireEquipmentHistory( List<Map> queryForFireEquipmentHistory(
...@@ -36,7 +37,8 @@ public interface FireEquipMapper extends BaseMapper { ...@@ -36,7 +37,8 @@ public interface FireEquipMapper extends BaseMapper {
@Param("startTime") String startTime, @Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("start") long start, @Param("start") long start,
@Param("length") int length @Param("length") int length,
@Param("buildId") String buildId
); );
......
...@@ -14,10 +14,12 @@ import com.yeejoin.amos.fas.business.vo.FireStationVo; ...@@ -14,10 +14,12 @@ import com.yeejoin.amos.fas.business.vo.FireStationVo;
import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum; import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.CommonPage; import com.yeejoin.amos.fas.core.common.response.CommonPage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -90,18 +92,21 @@ public class FireEquipServiceImpl implements IFireEquipService { ...@@ -90,18 +92,21 @@ public class FireEquipServiceImpl implements IFireEquipService {
String equipmentName, String equipmentName,
String startTime, String startTime,
String endTime, String endTime,
String buildId,
CommonPageable commonPageable) { CommonPageable commonPageable) {
long total = fireEquipMapper.queryForFireEquipmentHistoryCount(fireEquipmentName, equipmentName, long total = fireEquipMapper.queryForFireEquipmentHistoryCount(fireEquipmentName, equipmentName,
startTime, startTime,
endTime); endTime,
buildId);
List<Map> content = fireEquipMapper.queryForFireEquipmentHistory(fireEquipmentName, List<Map> content = fireEquipMapper.queryForFireEquipmentHistory(fireEquipmentName,
equipmentName, equipmentName,
startTime, startTime,
endTime, endTime,
commonPageable.getOffset(), commonPageable.getOffset(),
commonPageable.getPageSize()); commonPageable.getPageSize(),
buildId);
Page result = new CommonPage(content, commonPageable, total); Page result = new CommonPage(content, commonPageable, total);
return result; return result;
} }
......
...@@ -30,6 +30,7 @@ public interface IFireEquipService { ...@@ -30,6 +30,7 @@ public interface IFireEquipService {
String equipmentName, String equipmentName,
String startTime, String startTime,
String endTime, String endTime,
String buildId,
CommonPageable commonPageable); CommonPageable commonPageable);
Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable,String bindStation); Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable,String bindStation);
......
...@@ -578,7 +578,7 @@ public class DataSourcesImpl implements DataSources { ...@@ -578,7 +578,7 @@ public class DataSourcesImpl implements DataSources {
ReginParams reginParams = result.getResult(); ReginParams reginParams = result.getResult();
List<OrgUsr> menus = iOrgUsrService.companyTreeByUserAndTypeNoTree(reginParams, null); List<OrgUsr> menus = iOrgUsrService.equipCompanyExport(reginParams, null);
List<String> names = menus.stream().map(item -> { List<String> names = menus.stream().map(item -> {
return item.getBizOrgName() + "@" + item.getSequenceNbr() + "@" + item.getBizOrgCode(); return item.getBizOrgName() + "@" + item.getSequenceNbr() + "@" + item.getBizOrgCode();
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -975,6 +975,7 @@ public class ExcelServiceImpl { ...@@ -975,6 +975,7 @@ public class ExcelServiceImpl {
if (item.getEquipName() == null || item.getEquipName().equals(" ")) { if (item.getEquipName() == null || item.getEquipName().equals(" ")) {
throw new RuntimeException("设备定义名称为必填字段,填写后重新上传"); throw new RuntimeException("设备定义名称为必填字段,填写后重新上传");
} }
// BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召开始 // BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召开始
item.setEquipCode(QRCodeUtil.generateQRCode()); item.setEquipCode(QRCodeUtil.generateQRCode());
// BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召结束 // BUG 2953 导入模板没有设备编码生成 2021-09-18 陈召结束
...@@ -1088,6 +1089,8 @@ public class ExcelServiceImpl { ...@@ -1088,6 +1089,8 @@ public class ExcelServiceImpl {
item.setContactUserId(contactUser[1]); item.setContactUserId(contactUser[1]);
} }
item = Bean.toPo(getCurrentInfo(), item); item = Bean.toPo(getCurrentInfo(), item);
//水源的isdelete是反着的
item.setIsDelete(true);
waterResourceServiceImpl.importByExcel(item); waterResourceServiceImpl.importByExcel(item);
}); });
} }
......
...@@ -2618,6 +2618,30 @@ ...@@ -2618,6 +2618,30 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="suhuiguang" id="1646103800910-2">
<comment>wl_stock_detail 更新区域描述 之前新增编辑未更新 alarm表使用到</comment>
<sql>
update wl_stock_detail
sd set sd.description =
(select
ed.area from wl_equipment_detail ed
where
ed.id = sd.equipment_detail_id and ed.area <![CDATA[<>]]>''
)
where sd.description is null;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1646291252942-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific_alarm_log" columnName="confirm_type_name"/>
</not>
</preConditions>
<comment>wl_equipment_specific_alarm_log add column confirm_type_name 确认类型名称前端回显用</comment>
<sql>
ALTER TABLE wl_equipment_specific_alarm_log ADD COLUMN `confirm_type_name` varchar(255) DEFAULT NULL COMMENT '确认类型名称前端回显用';
</sql>
</changeSet>
<changeSet author="tw" id="20220301-1"> <changeSet author="tw" id="20220301-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
...@@ -2662,6 +2686,4 @@ ...@@ -2662,6 +2686,4 @@
</sql> </sql>
</changeSet> </changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
<select id="getVPointInScene" resultType="string"> <select id="getVPointInScene" resultType="string">
select video_in_scene from wl_source_scene where scene_id =#{id} select video_in_scene from wl_source_scene where scene_id =#{id}
</select> </select>
<select id="getScenesList" resultType="com.yeejoin.equipmanage.common.entity.SourceScene"> <select id="getScenesList" resultType="com.yeejoin.equipmanage.common.entity.SourceScene">
select select
ins.instance_id as id, ins.instance_id as id,
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
ala.equipment_specific_id, ala.equipment_specific_id,
spe.code AS equipmentSpecificCode, spe.code AS equipmentSpecificCode,
ala.equipment_specific_index_name, ala.equipment_specific_index_name,
(select type_name from wl_signal_classify sc where sc.type_code = ala.type limit 1) as equipmentSpecificIndexName,
ala.type as equipment_specific_index_key, ala.type as equipment_specific_index_key,
concat(ala.equipment_specific_name,ala.equipment_specific_index_name) as alarmContent, concat(ala.equipment_specific_name,ala.equipment_specific_index_name) as alarmContent,
ala.location AS alarmPlace, ala.location AS alarmPlace,
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
) as protectName, ) as protectName,
if(confirm_type is null,'去确认','已处理') isConfirm, if(confirm_type is null,'去确认','已处理') isConfirm,
confirm_type, confirm_type,
(select type_name from wl_signal_classify sc where sc.type_code = ala.confirm_type limit 1) as confirmTypeName,
alarm_reason, alarm_reason,
resolve_result, resolve_result,
confirm_user, confirm_user,
...@@ -60,6 +62,7 @@ ...@@ -60,6 +62,7 @@
set set
confirm_date = now(), confirm_date = now(),
confirm_type = #{confirmType}, confirm_type = #{confirmType},
confirm_type_name = #{confirmTypeName},
alarm_reason = #{alarmReason}, alarm_reason = #{alarmReason},
resolve_result = #{resolveResult}, resolve_result = #{resolveResult},
confirm_user = #{confirmUser}, confirm_user = #{confirmUser},
......
...@@ -197,7 +197,8 @@ ...@@ -197,7 +197,8 @@
WHEN 'false' THEN '否' WHEN 'false' THEN '否'
ELSE wlesal.equipment_specific_index_value END ELSE wlesal.equipment_specific_index_value END
AS fireEquipmentPointValue, AS fireEquipmentPointValue,
wlesal.type AS type, wlesal.type AS typeCode,
(select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as type,
wlesal.create_date AS createDate, wlesal.create_date AS createDate,
CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/ CONCAT_WS(' ', wles.position,wled.area) AS warehouseStructureName, /*告警列表拼接详细地址*/
(select (select
...@@ -223,10 +224,10 @@ ...@@ -223,10 +224,10 @@
</if> </if>
<if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if> <if test="param.beginDate!=null">AND d.createDate <![CDATA[>=]]> #{param.beginDate}</if>
<if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if> <if test="param.endDate!=null">AND d.createDate <![CDATA[<=]]> #{param.endDate}</if>
<if test="param.alarmType == 'BREAKDOWN'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType == 'BREAKDOWN'">AND d.typeCode = #{param.alarmType}</if>
<if test="param.alarmType == 'FIREALARM'">AND d.type = #{param.alarmType}</if> <if test="param.alarmType == 'FIREALARM'">AND d.typeCode = #{param.alarmType}</if>
<if test="param.orgCode != null and param.orgCode != ''">AND d.org_code LIKE CONCAT (#{param.orgCode},'%') </if> <if test="param.orgCode != null and param.orgCode != ''">AND d.org_code = #{param.orgCode}</if>
<if test="param.type != null and param.type != ''">AND d.type = #{param.type}</if> <if test="param.type != null and param.type != ''">AND d.typeCode = #{param.type}</if>
<if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND <if test="param.handleStatus != null and param.handleStatus != '' and param.handleStatus == 1">AND
d.handleStatus = '已处理' d.handleStatus = '已处理'
</if> </if>
...@@ -250,43 +251,11 @@ ...@@ -250,43 +251,11 @@
d.cleanStatus = '未消除' d.cleanStatus = '未消除'
</if> </if>
<if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND <if test="param.isRemoveShield != null and param.isRemoveShield != ''">AND
d.type != 'SHIELD' d.typeCode != 'SHIELD'
</if> </if>
</where> </where>
ORDER BY d.createDate DESC ORDER BY d.createDate DESC
</select> </select>
<select id="count" resultType="java.lang.Integer">
SELECT
count(1) AS total_num
FROM
(
SELECT
wlesa.id,
wlesa.equipment_specific_id AS fireEquipmentId,
wles.code AS fireEquipmentCode,
wlesa.equipment_index_id AS fireEquipmentIndexId,
wlesa.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesa.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
wlesa.type AS type,
wlesa.create_date AS createDate,
wlesa.location AS warehouseStructureName
FROM wl_equipment_specific_alarm_log wlesa
left join wl_equipment_specific wles ON wlesa.equipment_specific_id = wles.id
) d
<where>
<if test="warehouseStructureName != null and warehouseStructureName != ''"> d.warehouseStructureName like
concat(concat("%",#{warehouseStructureName}),"%")
</if>
<if test="equipCode != null and equipCode != ''">AND d.fireEquipmentCode like
concat(concat("%",#{equipCode}),"%")
</if>
<if test="beginDate!=null">AND d.createDate >= #{beginDate}</if>
<if test="endDate!=null">AND d.createDate <![CDATA[<=]]> #{endDate}</if>
<if test="alarmType == 'BREAKDOWN'">AND d.type = #{alarmType}</if>
<if test="alarmType == 'FIREALARM'">AND d.type = #{alarmType}</if>
</where>
</select>
<select id="pageAlarmsInfo" resultType="Map"> <select id="pageAlarmsInfo" resultType="Map">
SELECT SELECT
d.* d.*
...@@ -335,6 +304,7 @@ ...@@ -335,6 +304,7 @@
wlesa.frequency AS frequency, wlesa.frequency AS frequency,
wlesal.status AS status, wlesal.status AS status,
wlesal.type AS type, wlesal.type AS type,
(select type_name from wl_signal_classify sc where sc.type_code = wlesal.type limit 1) as alarmType,
wlesal.create_date AS createDate, wlesal.create_date AS createDate,
wlesal.build_id AS buildId, wlesal.build_id AS buildId,
wlesa.recovery_date AS recoveryDate, wlesa.recovery_date AS recoveryDate,
......
...@@ -378,6 +378,7 @@ ...@@ -378,6 +378,7 @@
where vs.source_id = #{floorId} where vs.source_id = #{floorId}
and vs.video_id = v.id and vs.video_id = v.id
</select> </select>
<select id="getParentSourceIds" resultType="java.lang.String"> <select id="getParentSourceIds" resultType="java.lang.String">
select getBuildingParentIds(#{childrenId}) select getBuildingParentIds(#{childrenId})
</select> </select>
......
...@@ -130,7 +130,8 @@ ...@@ -130,7 +130,8 @@
WHERE WHERE
efe.fire_equipment_id = ind.equipment_specific_id efe.fire_equipment_id = ind.equipment_specific_id
) equipmentName, ) equipmentName,
ind.update_date ind.update_date,
spe.warehouse_structure_id buildId
FROM FROM
wl_equipment_specific_index as ind wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
...@@ -147,6 +148,12 @@ ...@@ -147,6 +148,12 @@
<if test="startTime!=null"> <if test="startTime!=null">
AND d.update_date BETWEEN '${startTime}' AND '${endTime}' AND d.update_date BETWEEN '${startTime}' AND '${endTime}'
</if> </if>
<if test="buildId!=null">
AND d.buildId in
<foreach item="item" index="index" collection="buildId" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
</select> </select>
...@@ -194,6 +201,12 @@ ...@@ -194,6 +201,12 @@
<if test="startTime!=null"> <if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if> </if>
<if test="buildId!=null">
AND d.buildId in
<foreach item="item" index="index" collection="buildId" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where> </where>
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT ${start},${length}
......
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