bug-15746 修复修改消防点位检查报错问题

626相关方人员数据对接
water_xu 2024-05-31 17:01:50 +08:00
parent dd534649e5
commit 7f97d2b82e
4 changed files with 54 additions and 52 deletions

View File

@ -91,7 +91,7 @@ public interface FireRecordMapper {
List<PageData> datalistPage(Page page);
PageData getCheckingByCid(String fireCheckId);
List<PageData> getCheckingByCid(String fireCheckId);
PageData getCheckingNoFinByCid(String fireCheckId);
void removeRecordPointByCidRidPids(PageData pd);

View File

@ -89,7 +89,7 @@ public interface FireRecordService {
* @Param: [java.lang.String] [fireCheckId]
* @Return: com.zcloud.entity.PageData
*/
PageData getCheckingByCid(String fireCheckId);
List<PageData> getCheckingByCid(String fireCheckId);
/**
* @Description: checkidpointidrecordid

View File

@ -1,5 +1,6 @@
package com.zcloud.service.firemanager.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -574,58 +575,60 @@ public class FireCheckListServiceImpl implements FireCheckListService {
* 2.
* 3.
* */
PageData checkingData = fireRecordService.getCheckingByCid(FIRE_CHECK_ID);
List<PageData> checkingByCid = fireRecordService.getCheckingByCid(FIRE_CHECK_ID);
// 无检查记录 什么也不干
if (checkingData != null) {
String FIRE_RECORD_ID = checkingData.getString("FIRE_RECORD_ID");
if (CollUtil.isNotEmpty(checkingByCid)) {
checkingByCid.stream().forEach(checkingData -> {
String FIRE_RECORD_ID = checkingData.getString("FIRE_RECORD_ID");
// 有删除的点位那么 删除记录中的点位
if (deletedPoints.size() > 0) {
PageData delRecordData = new PageData();
initPageDataUtil.initEdit(delRecordData);
delRecordData.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
delRecordData.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
delRecordData.put("list", deletedPoints);
fireRecordService.removeRecordPointByCidRidPids(delRecordData);
}
// 有新增的点位 把点位初始化
if (addPoints.size() > 0) {
for (PageData addedRecordPointData : addPoints) {
initPageDataUtil.initSave(addedRecordPointData, "EQUIPMENT_POINT_ID");
addedRecordPointData.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
addedRecordPointData.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
addedRecordPointData.put("CORPINFO_ID", CORPINFO_ID);
addedRecordPointData.put("P_ISCHECKED", 1);
// 有删除的点位那么 删除记录中的点位
if (deletedPoints.size() > 0) {
PageData delRecordData = new PageData();
initPageDataUtil.initEdit(delRecordData);
delRecordData.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
delRecordData.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
delRecordData.put("list", deletedPoints);
fireRecordService.removeRecordPointByCidRidPids(delRecordData);
}
fireRecordService.addedRecordPoint(addPoints);
}
// 有删除的器材那么 删除记录中的器材
if (deviceIds.length > 0) {
PageData removeRecordDevice = new PageData();
initPageDataUtil.initSave(removeRecordDevice);
removeRecordDevice.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
removeRecordDevice.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
removeRecordDevice.put("list", deviceIds);
fireRecordService.removeDeviceByCIdRid(removeRecordDevice);
}
// 有新增的器材那么 新增记录中的器材, 点位信息变更为也未检查完的状态。
if (DEVICE_PREPARED_DATA.size() > 0) {
// 准备变更状态的 点位id
HashSet<String> preChangesPid = new HashSet<>();
for (PageData device_prepared_info : DEVICE_PREPARED_DATA) {
initPageDataUtil.initSave(device_prepared_info, "EQUIPMENT_RECORD_ID");
device_prepared_info.put("ISCHECKED", 0);
device_prepared_info.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
device_prepared_info.put("ISNORMAL", 2);
preChangesPid.add(device_prepared_info.getString("FIRE_POINT_ID"));
// 有新增的点位 把点位初始化
if (addPoints.size() > 0) {
for (PageData addedRecordPointData : addPoints) {
initPageDataUtil.initSave(addedRecordPointData, "EQUIPMENT_POINT_ID");
addedRecordPointData.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
addedRecordPointData.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
addedRecordPointData.put("CORPINFO_ID", CORPINFO_ID);
addedRecordPointData.put("P_ISCHECKED", 1);
}
fireRecordService.addedRecordPoint(addPoints);
}
fireRecordService.addedRecordDeviceList(DEVICE_PREPARED_DATA);
PageData checkedPageData = new PageData();
initPageDataUtil.initEdit(checkedPageData);
checkedPageData.put("FIRE_RECORD_ID",FIRE_RECORD_ID);
checkedPageData.put("list",preChangesPid);
fireRecordService.updCheckedByRidPid(checkedPageData);
}
// 有删除的器材那么 删除记录中的器材
if (deviceIds.length > 0) {
PageData removeRecordDevice = new PageData();
initPageDataUtil.initSave(removeRecordDevice);
removeRecordDevice.put("FIRE_CHECK_ID", FIRE_CHECK_ID);
removeRecordDevice.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
removeRecordDevice.put("list", deviceIds);
fireRecordService.removeDeviceByCIdRid(removeRecordDevice);
}
// 有新增的器材那么 新增记录中的器材, 点位信息变更为也未检查完的状态。
if (DEVICE_PREPARED_DATA.size() > 0) {
// 准备变更状态的 点位id
HashSet<String> preChangesPid = new HashSet<>();
for (PageData device_prepared_info : DEVICE_PREPARED_DATA) {
initPageDataUtil.initSave(device_prepared_info, "EQUIPMENT_RECORD_ID");
device_prepared_info.put("ISCHECKED", 0);
device_prepared_info.put("FIRE_RECORD_ID", FIRE_RECORD_ID);
device_prepared_info.put("ISNORMAL", 2);
preChangesPid.add(device_prepared_info.getString("FIRE_POINT_ID"));
}
fireRecordService.addedRecordDeviceList(DEVICE_PREPARED_DATA);
PageData checkedPageData = new PageData();
initPageDataUtil.initEdit(checkedPageData);
checkedPageData.put("FIRE_RECORD_ID",FIRE_RECORD_ID);
checkedPageData.put("list",preChangesPid);
fireRecordService.updCheckedByRidPid(checkedPageData);
}
});
}
}

View File

@ -1,7 +1,6 @@
package com.zcloud.service.firemanager.impl;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
@ -730,7 +729,7 @@ public class FireRecordServiceImpl implements FireRecordService {
}
@Override
public PageData getCheckingByCid(String fireCheckId) {
public List<PageData> getCheckingByCid(String fireCheckId) {
return fireRecordMapper.getCheckingByCid(fireCheckId);
}