diff --git a/web-app/src/main/java/com/zcloud/zcGbsServicer/command/ControlRoomRemoveExe.java b/web-app/src/main/java/com/zcloud/zcGbsServicer/command/ControlRoomRemoveExe.java index 2046f95..3451480 100644 --- a/web-app/src/main/java/com/zcloud/zcGbsServicer/command/ControlRoomRemoveExe.java +++ b/web-app/src/main/java/com/zcloud/zcGbsServicer/command/ControlRoomRemoveExe.java @@ -1,9 +1,10 @@ package com.zcloud.zcGbsServicer.command; +import cn.hutool.core.util.StrUtil; +import com.alibaba.cola.exception.BizException; import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum; import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum; import com.zcloud.zcGbsServicer.domain.gateway.ControlRoomGateway; -import com.alibaba.cola.exception.BizException; import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway; import com.zcloud.zcGbsServicer.domain.gateway.ResourcePersonGateway; import com.zcloud.zcGbsServicer.persistence.dataobject.ControlRoomDO; @@ -12,8 +13,10 @@ import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; - - +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * web-app @@ -31,10 +34,15 @@ public class ControlRoomRemoveExe { @Transactional(rollbackFor = Exception.class) public boolean execute(Long id) { ControlRoomDO controlRoomDO = controlRoomRepository.getById(id); + if (controlRoomDO == null) { + throw new BizException("数据不存在"); + } boolean res = controlRoomGateway.deletedControlRoomById(id); - boolean resDelPer = resourcePersonGateway.deletedResourcePersonByBizId(controlRoomDO.getRoomId(), PersonTypeEnum.CONTROL_ROOM.getCode()); - boolean resDelDev = resourceDeviceGateway.deletedResourceDeviceByBizId(controlRoomDO.getRoomId(), DeviceTypeEnum.CONTROL_ROOM.getCode()); - if(!res || !resDelPer || !resDelDev){ + boolean resDelPer = resourcePersonGateway.deletedResourcePersonByBizId( + controlRoomDO.getRoomId(), PersonTypeEnum.CONTROL_ROOM.getCode()); + boolean resDelDev = resourceDeviceGateway.deletedResourceDeviceByBizId( + controlRoomDO.getRoomId(), DeviceTypeEnum.CONTROL_ROOM.getCode()); + if (!res || !resDelPer || !resDelDev) { throw new BizException("删除失败"); } return true; @@ -42,11 +50,28 @@ public class ControlRoomRemoveExe { @Transactional(rollbackFor = Exception.class) public boolean execute(Long[] ids) { + if (ids == null || ids.length == 0) { + return true; + } + List roomIds = Arrays.stream(ids) + .map(controlRoomRepository::getById) + .filter(Objects::nonNull) + .map(ControlRoomDO::getRoomId) + .filter(StrUtil::isNotBlank) + .collect(Collectors.toList()); + boolean res = controlRoomGateway.deletedControlRoomByIds(ids); - if(!res){ - throw new BizException("删除失败"); + boolean resDelPer = true; + boolean resDelDev = true; + for (String roomId : roomIds) { + resDelPer = resDelPer && resourcePersonGateway.deletedResourcePersonByBizId( + roomId, PersonTypeEnum.CONTROL_ROOM.getCode()); + resDelDev = resDelDev && resourceDeviceGateway.deletedResourceDeviceByBizId( + roomId, DeviceTypeEnum.CONTROL_ROOM.getCode()); + } + if (!res || !resDelPer || !resDelDev) { + throw new BizException("Delete failed"); } return true; } } - diff --git a/web-app/src/main/java/com/zcloud/zcGbsServicer/command/PumpRoomRemoveExe.java b/web-app/src/main/java/com/zcloud/zcGbsServicer/command/PumpRoomRemoveExe.java index ea1df8f..f415fa3 100644 --- a/web-app/src/main/java/com/zcloud/zcGbsServicer/command/PumpRoomRemoveExe.java +++ b/web-app/src/main/java/com/zcloud/zcGbsServicer/command/PumpRoomRemoveExe.java @@ -1,13 +1,19 @@ package com.zcloud.zcGbsServicer.command; -import com.zcloud.zcGbsServicer.domain.gateway.PumpRoomGateway; import com.alibaba.cola.exception.BizException; +import com.zcloud.zcGbsServicer.domain.enums.DeviceTypeEnum; +import com.zcloud.zcGbsServicer.domain.gateway.PumpRoomGateway; +import com.zcloud.zcGbsServicer.domain.gateway.ResourceDeviceGateway; +import com.zcloud.zcGbsServicer.persistence.dataobject.PumpRoomDO; +import com.zcloud.zcGbsServicer.persistence.repository.PumpRoomRepository; import lombok.AllArgsConstructor; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; - - +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; /** * web-app @@ -18,11 +24,19 @@ import org.springframework.transaction.annotation.Transactional; @AllArgsConstructor public class PumpRoomRemoveExe { private final PumpRoomGateway pumpRoomGateway; + private final PumpRoomRepository pumpRoomRepository; + private final ResourceDeviceGateway resourceDeviceGateway; @Transactional(rollbackFor = Exception.class) public boolean execute(Long id) { + PumpRoomDO pumpRoomDO = pumpRoomRepository.getById(id); + if (pumpRoomDO == null) { + throw new BizException("数据不存在"); + } boolean res = pumpRoomGateway.deletedPumpRoomById(id); - if(!res){ + boolean resDelDev = resourceDeviceGateway.deletedResourceDeviceByBizId( + pumpRoomDO.getPumpRoomId(), DeviceTypeEnum.PUMP_ROOM.getCode()); + if (!res || !resDelDev) { throw new BizException("删除失败"); } return true; @@ -30,11 +44,24 @@ public class PumpRoomRemoveExe { @Transactional(rollbackFor = Exception.class) public boolean execute(Long[] ids) { + if (ids == null || ids.length == 0) { + return true; + } + List pumpRoomIds = Arrays.stream(ids) + .map(pumpRoomRepository::getById) + .filter(Objects::nonNull) + .map(PumpRoomDO::getPumpRoomId) + .collect(Collectors.toList()); + boolean res = pumpRoomGateway.deletedPumpRoomByIds(ids); - if(!res){ - throw new BizException("删除失败"); + boolean resDelDev = true; + for (String pumpRoomId : pumpRoomIds) { + resDelDev = resDelDev && resourceDeviceGateway.deletedResourceDeviceByBizId( + pumpRoomId, DeviceTypeEnum.PUMP_ROOM.getCode()); + } + if (!res || !resDelDev) { + throw new BizException("Delete failed"); } return true; } } - diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomAddCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomAddCmd.java index 47d14c1..5bfeef8 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomAddCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomAddCmd.java @@ -28,26 +28,26 @@ public class ControlRoomAddCmd extends Command { private String roomName; @ApiModelProperty(value = "消防控制室状态(字典码)", name = "roomStatus", required = true) - @NotEmpty(message = "消防控制室状态(字典码)不能为空") +// @NotEmpty(message = "消防控制室状态(字典码)不能为空") private String roomStatus; @ApiModelProperty(value = "消防控制室状态名称") private String roomStatusName; @ApiModelProperty(value = "负责人", name = "principalName", required = true) - @NotEmpty(message = "负责人不能为空") +// @NotEmpty(message = "负责人不能为空") private String principalName; @ApiModelProperty(value = "负责人手机号", name = "principalPhone", required = true) - @NotEmpty(message = "负责人手机号不能为空") +// @NotEmpty(message = "负责人手机号不能为空") private String principalPhone; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "设备信息") diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomUpdateCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomUpdateCmd.java index c06c2ca..d9bb60b 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomUpdateCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/ControlRoomUpdateCmd.java @@ -26,24 +26,24 @@ public class ControlRoomUpdateCmd extends Command { @NotEmpty(message = "业务主键ID不能为空") private String roomId; @ApiModelProperty(value = "消防控制室名称", name = "roomName", required = true) - @NotEmpty(message = "消防控制室名称不能为空") +// @NotEmpty(message = "消防控制室名称不能为空") private String roomName; @ApiModelProperty(value = "消防控制室状态(字典码)", name = "roomStatus", required = true) - @NotEmpty(message = "消防控制室状态(字典码)不能为空") +// @NotEmpty(message = "消防控制室状态(字典码)不能为空") private String roomStatus; @ApiModelProperty(value = "消防控制室状态名称") private String roomStatusName; @ApiModelProperty(value = "负责人", name = "principalName", required = true) - @NotEmpty(message = "负责人不能为空") +// @NotEmpty(message = "负责人不能为空") private String principalName; @ApiModelProperty(value = "负责人手机号", name = "principalPhone", required = true) - @NotEmpty(message = "负责人手机号不能为空") +// @NotEmpty(message = "负责人手机号不能为空") private String principalPhone; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "人员信息") diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomAddCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomAddCmd.java index a32d90b..aa5cdb7 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomAddCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomAddCmd.java @@ -28,23 +28,23 @@ public class PumpRoomAddCmd extends Command { private String pumpRoomName; @ApiModelProperty(value = "消防泵房状态(字典码)", name = "pumpRoomStatus", required = true) - @NotEmpty(message = "消防泵房状态(字典码)不能为空") +// @NotEmpty(message = "消防泵房状态(字典码)不能为空") private String pumpRoomStatus; @ApiModelProperty(value = "负责人", name = "principalName", required = true) - @NotEmpty(message = "负责人不能为空") +// @NotEmpty(message = "负责人不能为空") private String principalName; @ApiModelProperty(value = "负责人手机号", name = "principalPhone", required = true) - @NotEmpty(message = "负责人手机号不能为空") +// @NotEmpty(message = "负责人手机号不能为空") private String principalPhone; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "设备集合") diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomUpdateCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomUpdateCmd.java index 3a3fbe2..81d4928 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomUpdateCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/PumpRoomUpdateCmd.java @@ -29,19 +29,19 @@ public class PumpRoomUpdateCmd extends Command { @NotEmpty(message = "消防泵房名称不能为空") private String pumpRoomName; @ApiModelProperty(value = "消防泵房状态(字典码)", name = "pumpRoomStatus", required = true) - @NotEmpty(message = "消防泵房状态(字典码)不能为空") +// @NotEmpty(message = "消防泵房状态(字典码)不能为空") private String pumpRoomStatus; @ApiModelProperty(value = "负责人", name = "principalName", required = true) - @NotEmpty(message = "负责人不能为空") +// @NotEmpty(message = "负责人不能为空") private String principalName; @ApiModelProperty(value = "负责人手机号", name = "principalPhone", required = true) - @NotEmpty(message = "负责人手机号不能为空") +// @NotEmpty(message = "负责人手机号不能为空") private String principalPhone; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "设备信息") diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamAddCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamAddCmd.java index b2cd018..47517e1 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamAddCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamAddCmd.java @@ -37,19 +37,19 @@ public class RescueTeamAddCmd extends Command { private String teamTypeName; @ApiModelProperty(value = "负责人单位或部门", name = "chargeOrgDept", required = true) - @NotEmpty(message = "负责人单位或部门不能为空") +// @NotEmpty(message = "负责人单位或部门不能为空") private String chargeOrgDept; @ApiModelProperty(value = "队长", name = "captainName", required = true) - @NotEmpty(message = "队长不能为空") +// @NotEmpty(message = "队长不能为空") private String captainName; @ApiModelProperty(value = "队长电话", name = "captainPhone", required = true) - @NotEmpty(message = "队长电话不能为空") +// @NotEmpty(message = "队长电话不能为空") private String captainPhone; @ApiModelProperty(value = "指挥人员") - @NotEmpty(message = "指挥人员不能为空") +// @NotEmpty(message = "指挥人员不能为空") private String commandCrew; @ApiModelProperty(value = "建立日期", name = "establishDate", required = true) @@ -64,7 +64,7 @@ public class RescueTeamAddCmd extends Command { private String regionScopeName; @ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true) - @NotEmpty(message = "职责和任务范围不能为空") +// @NotEmpty(message = "职责和任务范围不能为空") private String dutyScope; @ApiModelProperty(value = "消防队员") diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamUpdateCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamUpdateCmd.java index 7571244..1379b4f 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamUpdateCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/RescueTeamUpdateCmd.java @@ -35,19 +35,19 @@ public class RescueTeamUpdateCmd extends Command { @ApiModelProperty(value = "类型名称") private String teamTypeName; @ApiModelProperty(value = "负责人单位或部门", name = "chargeOrgDept", required = true) - @NotEmpty(message = "负责人单位或部门不能为空") +// @NotEmpty(message = "负责人单位或部门不能为空") private String chargeOrgDept; @ApiModelProperty(value = "队长", name = "captainName", required = true) - @NotEmpty(message = "队长不能为空") +// @NotEmpty(message = "队长不能为空") private String captainName; @ApiModelProperty(value = "队长电话", name = "captainPhone", required = true) - @NotEmpty(message = "队长电话不能为空") +// @NotEmpty(message = "队长电话不能为空") private String captainPhone; @ApiModelProperty(value = "指挥人员") - @NotEmpty(message = "指挥人员不能为空") +// @NotEmpty(message = "指挥人员不能为空") private String commandCrew;; @ApiModelProperty(value = "建立日期", name = "establishDate", required = true) - @NotNull(message = "建立日期不能为空") +// @NotNull(message = "建立日期不能为空") private LocalDate establishDate; @ApiModelProperty(value = "所属区域或范围(字典码)", name = "regionScope", required = true) // @NotEmpty(message = "所属区域或范围(字典码)不能为空") @@ -55,7 +55,7 @@ public class RescueTeamUpdateCmd extends Command { @ApiModelProperty(value = "所属区域或范围名称") private String regionScopeName; @ApiModelProperty(value = "职责和任务范围", name = "dutyScope", required = true) - @NotEmpty(message = "职责和任务范围不能为空") +// @NotEmpty(message = "职责和任务范围不能为空") private String dutyScope; @ApiModelProperty(value = "消防队员") private List rescueMembers; diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceAddCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceAddCmd.java index c0a332d..d4b04f9 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceAddCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceAddCmd.java @@ -27,51 +27,51 @@ public class WaterSourceAddCmd extends Command { private String waterSourceName; @ApiModelProperty(value = "消防水源状态(字典码)", name = "waterSourceStatus", required = true) - @NotEmpty(message = "消防水源状态不能为空") +// @NotEmpty(message = "消防水源状态不能为空") private String waterSourceStatus; @ApiModelProperty(value = "所属单位或部门", name = "belongOrgDept", required = true) - @NotEmpty(message = "所属单位或部门不能为空") +// @NotEmpty(message = "所属单位或部门不能为空") private String belongOrgDept; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "水源位置", name = "waterLocation", required = true) - @NotEmpty(message = "水源位置不能为空") +// @NotEmpty(message = "水源位置不能为空") private String waterLocation; @ApiModelProperty(value = "接口形式", name = "interfaceForm", required = true) - @NotEmpty(message = "接口形式不能为空") +// @NotEmpty(message = "接口形式不能为空") private String interfaceForm; @ApiModelProperty(value = "水源类型", name = "waterType", required = true) - @NotEmpty(message = "水源类型不能为空") +// @NotEmpty(message = "水源类型不能为空") private String waterType; @ApiModelProperty(value = "水源编号", name = "waterCode", required = true) - @NotEmpty(message = "水源编号不能为空") +// @NotEmpty(message = "水源编号不能为空") private String waterCode; @ApiModelProperty(value = "吸水口规格", name = "suctionSpec", required = true) - @NotEmpty(message = "吸水口规格不能为空") +// @NotEmpty(message = "吸水口规格不能为空") private String suctionSpec; @ApiModelProperty(value = "水源容量", name = "capacity", required = true) - @NotEmpty(message = "水源容量不能为空") +// @NotEmpty(message = "水源容量不能为空") private String capacity; @ApiModelProperty(value = "供水能力", name = "supplyAbility", required = true) - @NotEmpty(message = "供水能力不能为空") +// @NotEmpty(message = "供水能力不能为空") private String supplyAbility; @ApiModelProperty(value = "设备清单", name = "equipmentList", required = true) - @NotEmpty(message = "设备清单不能为空") +// @NotEmpty(message = "设备清单不能为空") private String equipmentList; } diff --git a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceUpdateCmd.java b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceUpdateCmd.java index a52d871..43d0252 100644 --- a/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceUpdateCmd.java +++ b/web-client/src/main/java/com/zcloud/zcGbsServicer/dto/WaterSourceUpdateCmd.java @@ -28,40 +28,40 @@ public class WaterSourceUpdateCmd extends Command { @NotEmpty(message = "消防水源名称不能为空") private String waterSourceName; @ApiModelProperty(value = "消防水源状态(字典码)", name = "waterSourceStatus", required = true) - @NotEmpty(message = "消防水源状态(字典码)不能为空") +// @NotEmpty(message = "消防水源状态(字典码)不能为空") private String waterSourceStatus; @ApiModelProperty(value = "所属单位或部门", name = "belongOrgDept", required = true) - @NotEmpty(message = "所属单位或部门不能为空") +// @NotEmpty(message = "所属单位或部门不能为空") private String belongOrgDept; @ApiModelProperty(value = "经度", name = "lng", required = true) - @NotNull(message = "经度不能为空") +// @NotNull(message = "经度不能为空") private Double lng; @ApiModelProperty(value = "纬度", name = "lat", required = true) - @NotNull(message = "纬度不能为空") +// @NotNull(message = "纬度不能为空") private Double lat; @ApiModelProperty(value = "水源位置", name = "waterLocation", required = true) - @NotEmpty(message = "水源位置不能为空") +// @NotEmpty(message = "水源位置不能为空") private String waterLocation; @ApiModelProperty(value = "接口形式", name = "interfaceForm", required = true) - @NotEmpty(message = "接口形式不能为空") +// @NotEmpty(message = "接口形式不能为空") private String interfaceForm; @ApiModelProperty(value = "水源类型", name = "waterType", required = true) - @NotEmpty(message = "水源类型不能为空") +// @NotEmpty(message = "水源类型不能为空") private String waterType; @ApiModelProperty(value = "水源编号", name = "waterCode", required = true) - @NotEmpty(message = "水源编号不能为空") +// @NotEmpty(message = "水源编号不能为空") private String waterCode; @ApiModelProperty(value = "吸水口规格", name = "suctionSpec", required = true) - @NotEmpty(message = "吸水口规格不能为空") +// @NotEmpty(message = "吸水口规格不能为空") private String suctionSpec; @ApiModelProperty(value = "水源容量", name = "capacity", required = true) - @NotEmpty(message = "水源容量不能为空") +// @NotEmpty(message = "水源容量不能为空") private String capacity; @ApiModelProperty(value = "供水能力", name = "supplyAbility", required = true) - @NotEmpty(message = "供水能力不能为空") +// @NotEmpty(message = "供水能力不能为空") private String supplyAbility; @ApiModelProperty(value = "设备清单", name = "equipmentList", required = true) - @NotEmpty(message = "设备清单不能为空") +// @NotEmpty(message = "设备清单不能为空") private String equipmentList; } diff --git a/web-infrastructure/src/main/java/com/zcloud/zcGbsServicer/gatewayimpl/ResourcePersonGatewayImpl.java b/web-infrastructure/src/main/java/com/zcloud/zcGbsServicer/gatewayimpl/ResourcePersonGatewayImpl.java index c034051..bda1905 100644 --- a/web-infrastructure/src/main/java/com/zcloud/zcGbsServicer/gatewayimpl/ResourcePersonGatewayImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/zcGbsServicer/gatewayimpl/ResourcePersonGatewayImpl.java @@ -68,6 +68,9 @@ public class ResourcePersonGatewayImpl implements ResourcePersonGateway { @Override public Boolean deletedResourcePersonByBizId(String bizId, Integer bizType) { List resourcePersonDOList = resourcePersonRepository.listByBizIdAndBizType(CollUtil.newArrayList(bizId), bizType); + if (CollUtil.isEmpty(resourcePersonDOList)) { + return true; + } return resourcePersonRepository.removeBatchByIds(resourcePersonDOList.stream().map(ResourcePersonDO::getId).collect(Collectors.toList())); } } diff --git a/web-infrastructure/src/main/resources/mapper/ControlRoomMapper.xml b/web-infrastructure/src/main/resources/mapper/ControlRoomMapper.xml index 745c23e..c4a1514 100644 --- a/web-infrastructure/src/main/resources/mapper/ControlRoomMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/ControlRoomMapper.xml @@ -10,6 +10,7 @@ FROM control_room + delete_enum = 'FALSE' AND ${ew.sqlSegment} diff --git a/web-infrastructure/src/main/resources/mapper/PumpRoomMapper.xml b/web-infrastructure/src/main/resources/mapper/PumpRoomMapper.xml index ffbe8b1..de1e2ff 100644 --- a/web-infrastructure/src/main/resources/mapper/PumpRoomMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/PumpRoomMapper.xml @@ -10,6 +10,7 @@ FROM pump_room + delete_enum = 'FALSE' AND ${ew.sqlSegment} diff --git a/web-infrastructure/src/main/resources/mapper/RescueTeamMapper.xml b/web-infrastructure/src/main/resources/mapper/RescueTeamMapper.xml index 22a15d3..10e8d79 100644 --- a/web-infrastructure/src/main/resources/mapper/RescueTeamMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/RescueTeamMapper.xml @@ -10,6 +10,7 @@ FROM rescue_team + delete_enum = 'FALSE' AND ${ew.sqlSegment} diff --git a/web-infrastructure/src/main/resources/mapper/WaterSourceMapper.xml b/web-infrastructure/src/main/resources/mapper/WaterSourceMapper.xml index e1ed1b4..d908d0b 100644 --- a/web-infrastructure/src/main/resources/mapper/WaterSourceMapper.xml +++ b/web-infrastructure/src/main/resources/mapper/WaterSourceMapper.xml @@ -10,6 +10,7 @@ FROM water_source + delete_enum = 'FALSE' AND ${ew.sqlSegment}