|
|
@@ -31,8 +31,7 @@ import static com.ktg.common.constant.Constants.SYS_ATTR;
|
|
|
* @date 2024-10-18
|
|
|
*/
|
|
|
@Service
|
|
|
-public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMapper, IsIsolationPoint> implements IIsIsolationPointService
|
|
|
-{
|
|
|
+public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMapper, IsIsolationPoint> implements IIsIsolationPointService {
|
|
|
@Autowired
|
|
|
private IsIsolationPointMapper isIsolationPointMapper;
|
|
|
@Autowired
|
|
|
@@ -53,8 +52,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
* @return 隔离点
|
|
|
*/
|
|
|
@Override
|
|
|
- public PointDetailVO selectIsIsolationPointByPointId(Long pointId)
|
|
|
- {
|
|
|
+ public PointDetailVO selectIsIsolationPointByPointId(Long pointId) {
|
|
|
return isIsolationPointMapper.selectIsIsolationPointByPointId(pointId);
|
|
|
}
|
|
|
|
|
|
@@ -65,8 +63,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
* @return 隔离点
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<IsIsolationPoint> selectIsIsolationPointList(IsIsolationPoint isIsolationPoint)
|
|
|
- {
|
|
|
+ public List<IsIsolationPoint> selectIsIsolationPointList(IsIsolationPoint isIsolationPoint) {
|
|
|
return isIsolationPointMapper.selectIsIsolationPointList(isIsolationPoint);
|
|
|
}
|
|
|
|
|
|
@@ -78,8 +75,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
*/
|
|
|
@Transactional
|
|
|
@Override
|
|
|
- public int insertIsIsolationPoint(IsIsolationPoint isIsolationPoint)
|
|
|
- {
|
|
|
+ public int insertIsIsolationPoint(IsIsolationPoint isIsolationPoint) {
|
|
|
// 断言校验
|
|
|
Assert.isTrue(StringUtils.isNotBlank(isIsolationPoint.getPointName()), "隔离点名称不可为空!");
|
|
|
Assert.isTrue(StringUtils.isNotBlank(isIsolationPoint.getPointCode()), "隔离点编号名称不可为空!");
|
|
|
@@ -128,8 +124,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int updateIsIsolationPoint(IsIsolationPoint isIsolationPoint)
|
|
|
- {
|
|
|
+ public int updateIsIsolationPoint(IsIsolationPoint isIsolationPoint) {
|
|
|
// 断言校验
|
|
|
Assert.notNull(isIsolationPoint.getPointId(), "隔离点ID不可为空!");
|
|
|
Assert.isTrue(StringUtils.isNotBlank(isIsolationPoint.getPointName()), "隔离点名称不可为空!");
|
|
|
@@ -162,8 +157,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteIsIsolationPointByPointIds(String pointIds)
|
|
|
- {
|
|
|
+ public int deleteIsIsolationPointByPointIds(String pointIds) {
|
|
|
Assert.notBlank(pointIds, "请选择需要删除的数据!");
|
|
|
Long[] longIds = Convert.toLongArray(pointIds);
|
|
|
// 查询有没有sop使用改隔离点,有的话不允许删除
|
|
|
@@ -182,13 +176,18 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
}
|
|
|
// 检查电柜有没有配置该隔离点,如果还在配置中,需要先从电柜解除绑定
|
|
|
for (Long longId : longIds) {
|
|
|
- String usePoint = '"' + "pointId" + '"' + ": " + '"' + longId + '"' + ",";
|
|
|
+ /*String usePoint = '"' + "pointId" + '"' + ": " + '"' + longId + '"' + ",";
|
|
|
List<IsLotoStation> list = iIsLotoStationService.list(Wrappers.<IsLotoStation>lambdaQuery()
|
|
|
.like(IsLotoStation::getMap, usePoint));
|
|
|
if (!list.isEmpty()) {
|
|
|
IsIsolationPoint isolationPoint = getById(longId);
|
|
|
Assert.isTrue(false, isolationPoint.getPointName() + "正在被" + list.get(0).getLotoName() + "锁定站使用,请先从锁定站解除绑定!");
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ // 清理is_map_point
|
|
|
+ iIsMapPointService.remove(Wrappers.<IsMapPoint>lambdaQuery()
|
|
|
+ .and(item -> item.eq(IsMapPoint::getMapType, "2")
|
|
|
+ .or().eq(IsMapPoint::getMapType, "3"))
|
|
|
+ .eq(IsMapPoint::getEntityId, longId));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -200,8 +199,7 @@ public class IsIsolationPointServiceImpl extends ServiceImpl<IsIsolationPointMap
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteIsIsolationPointByPointId(Long pointId)
|
|
|
- {
|
|
|
+ public int deleteIsIsolationPointByPointId(Long pointId) {
|
|
|
return isIsolationPointMapper.deleteIsIsolationPointByPointId(pointId);
|
|
|
}
|
|
|
|