|
|
@@ -84,7 +84,7 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ReceiveErrorDto saveData(ProtectionEditDto protectionEditDto, String msgId, String branchId) {
|
|
|
+ public ReceiveErrorDto saveData(ProtectionEditDto protectionEditDto, String msgId) {
|
|
|
|
|
|
ReceiveErrorDto result = new ReceiveErrorDto();
|
|
|
String organizationGuid = protectionEditDto.getOrganizationGuid();
|
|
|
@@ -125,7 +125,7 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
|
|
|
SysOrg org = orgService.findByCode(organizationGuid, SecurityConstants.INNER);
|
|
|
if (org == null) {
|
|
|
- NorthError error = new NorthError(msgId, branchId, "/status/defencearea"
|
|
|
+ NorthError error = new NorthError(msgId, "/status/defencearea"
|
|
|
, protectionEditDto, "orgGUID:" + organizationGuid + "不正确");
|
|
|
northErrorService.saveError(error);
|
|
|
return result;
|
|
|
@@ -257,7 +257,7 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ReceiveErrorDto defenceAreaList(DataPageDto<DefenceAreaDto> request, String branchId, String msgId) {
|
|
|
+ public ReceiveErrorDto defenceAreaList(DataPageDto<DefenceAreaDto> request, String msgId) {
|
|
|
String packageGuid = request.getPackageGuid();
|
|
|
if (StringUtils.isEmpty(packageGuid)) {
|
|
|
return ReceiveErrorDto.error("packageGuid参数非法");
|
|
|
@@ -270,7 +270,7 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
if (CollectionUtils.isEmpty(request.getData())) {
|
|
|
return ReceiveErrorDto.error("报警主机子系统及防区信息为空");
|
|
|
}
|
|
|
- final List<DefenceAreaDto> defenceareaList = RedisCheckRepeatDataUtil.isCompleted(request,DefenceAreaDto.class);
|
|
|
+ final List<DefenceAreaDto> defenceareaList = RedisCheckRepeatDataUtil.isCompleted(request, DefenceAreaDto.class);
|
|
|
LogUtils.BASE_INFO_DEFENCEAREA.info("判断是否获取全部报警主机子系统及防区信息分页数据:{}", defenceareaList.size() > 0);
|
|
|
if (ObjectUtil.isEmpty(defenceareaList)) {
|
|
|
return ReceiveErrorDto.error("尚未获取全部报警主机子系统及防区信息分页数据,暂不处理!");
|
|
|
@@ -278,12 +278,12 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
LogUtils.BASE_INFO_DEFENCEAREA.info("获取全部的报警主机子系统及防区信息,开始数据处理界面!");
|
|
|
this.northStatisticsSyncService.saveOrUpdateBaseCountByDataType(DataType.protectionCount.getIndex(), defenceareaList.size(), false);
|
|
|
new Thread(() -> {
|
|
|
- this.saveAndUpdate(defenceareaList, branchId, msgId);
|
|
|
+ this.saveAndUpdate(defenceareaList, msgId);
|
|
|
}).start();
|
|
|
return ReceiveErrorDto.success();
|
|
|
}
|
|
|
|
|
|
- public ReceiveErrorDto saveAndUpdate(List<DefenceAreaDto> defenceareaList, String branchId, String msgId) {
|
|
|
+ public ReceiveErrorDto saveAndUpdate(List<DefenceAreaDto> defenceareaList, String msgId) {
|
|
|
if (CollectionUtils.isEmpty(defenceareaList)) {
|
|
|
return ReceiveErrorDto.error("报警主机子系统及防区信息为空");
|
|
|
}
|
|
|
@@ -297,23 +297,23 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
List<MediatorCategory> categorys = categoryService.list();
|
|
|
//查询报警主机主机设备列表
|
|
|
List<IotDevice> devices = iotDeviceService.findByCategory(CategoryDataEnum.ALARM_HOST_DEVICE.getId());
|
|
|
- checkParam(defenceareaList, branchId, msgId, errors, orgList, categorys, devices, deviceList, protectionList, sensorList);
|
|
|
+ checkParam(defenceareaList, msgId, errors, orgList, categorys, devices, deviceList, protectionList, sensorList);
|
|
|
return ReceiveErrorDto.success();
|
|
|
}
|
|
|
|
|
|
- private void checkParam(List<DefenceAreaDto> defenceareaList, String branchId, String msgId, List<NorthError> errors, List<SysOrgVO> orgList, List<MediatorCategory> categorys, List<IotDevice> devices, List<IotAlarmSubsystem> deviceList, List<IotAlarmSubsystem> protectionList, List<IotAlarmDefenceArea> sensorList) {
|
|
|
+ private void checkParam(List<DefenceAreaDto> defenceareaList, String msgId, List<NorthError> errors, List<SysOrgVO> orgList, List<MediatorCategory> categorys, List<IotDevice> devices, List<IotAlarmSubsystem> deviceList, List<IotAlarmSubsystem> protectionList, List<IotAlarmDefenceArea> sensorList) {
|
|
|
NorthError error = null;
|
|
|
for (DefenceAreaDto dto : defenceareaList) {
|
|
|
SysOrgVO org = null;
|
|
|
if (StringUtils.isEmpty(dto.getOrganizationGuid())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传organizationGuid");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
} else {
|
|
|
List<SysOrgVO> orgs = orgList.stream().filter(r -> r.getGuid().equals(dto.getOrganizationGuid())).collect(Collectors.toList()); //orgDao.findByGuid(dto.getOrganizationGuid());
|
|
|
if (orgs.size() == 0) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "orgGUID:" + dto.getOrganizationGuid() + "不正确");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
@@ -323,28 +323,28 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(dto.getDefenceareaCode())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传defenceareaCode");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(dto.getDefenceareaName())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传defenceareaName");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(dto.getAlarmHostCode())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传alarmHostCode");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
if (dto.getSensorArray() == null || dto.getSensorArray().size() == 0) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传sensorArray");
|
|
|
errors.add(error);
|
|
|
//continue;
|
|
|
@@ -353,38 +353,38 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
|
|
|
for (SensorDto sensorDto : sensorArray) {
|
|
|
if (StringUtils.isEmpty(sensorDto.getInputName())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传InputName");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
if (sensorDto.getInputIndex() == null) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传InputIndex");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(sensorDto.getModuleAddress())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传ModuleAddress");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(sensorDto.getSensorType())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传SensorType");
|
|
|
errors.add(error);
|
|
|
continue;
|
|
|
}
|
|
|
if (StringUtils.isEmpty(sensorDto.getSensorTypeName())) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:未传SensorTypeName");
|
|
|
errors.add(error);
|
|
|
}
|
|
|
|
|
|
List<MediatorCategory> categorysa = categorys.stream().filter(r -> r.getName().equals(sensorDto.getSensorTypeName())).collect(Collectors.toList());//categoryDao.getOne(qw);
|
|
|
if (categorysa.size() == 0) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:没有找到设备类型,默认归到其他类型中");
|
|
|
errors.add(error);
|
|
|
}
|
|
|
@@ -393,7 +393,7 @@ public class IotAlarmSubSystemServiceImpl extends ServiceImpl<IotAlarmSubsystemM
|
|
|
SysOrgVO finalOrg = org;
|
|
|
List<IotDevice> devicesa = devices.stream().filter(r -> r.getEquipmentCode().equals(dto.getAlarmHostCode()) && r.getOrgId().equals(finalOrg.getId())).collect(Collectors.toList());
|
|
|
if (devicesa.size() == 0) {
|
|
|
- error = new NorthError(msgId, branchId, "/api/data/defenceareaList"
|
|
|
+ error = new NorthError(msgId, "/api/data/defenceareaList"
|
|
|
, dto, "参数非法:没有找到报警主机");
|
|
|
errors.add(error);
|
|
|
continue;
|