Bug修复,已有三跨点和索道点的杆塔不允许删除和修改

This commit is contained in:
马三炮 2025-05-07 14:35:05 +08:00
parent 1c1fc622ef
commit 9f87cc433f
6 changed files with 40 additions and 2 deletions

View File

@ -14,4 +14,6 @@ public interface TbCablewaTransMapper {
void updateTbCablewaTrans(TbCablewaTransVo data);
void delTbCablewaTrans(TbCablewaTransVo data);
TbCablewaTransVo getTbCablewaTransByTowerId(Long towerId);
}

View File

@ -15,4 +15,6 @@ public interface TbThreeSpanMapper {
void updateTbThreeSpan(TbThreeSpanVo data);
void delTbThreeSpan(TbThreeSpanVo data);
List<TbThreeSpanVo> getTbThreeSpanByTowerId(Long towerId);
}

View File

@ -1,7 +1,11 @@
package com.bonus.digitalSignage.basic.service.impl;
import com.bonus.digitalSignage.basic.dao.TbCablewaTransMapper;
import com.bonus.digitalSignage.basic.dao.TbThreeSpanMapper;
import com.bonus.digitalSignage.basic.dao.TbTowerMapper;
import com.bonus.digitalSignage.basic.service.TbTowerService;
import com.bonus.digitalSignage.basic.vo.TbCablewaTransVo;
import com.bonus.digitalSignage.basic.vo.TbThreeSpanVo;
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
import com.bonus.digitalSignage.utils.*;
import com.bonus.digitalSignage.webResult.StringUtils;
@ -24,6 +28,13 @@ public class TbTowerServiceImpl implements TbTowerService {
@Resource
private TbTowerMapper tbTowerMapper;
@Resource
private TbThreeSpanMapper tbThreeSpanMapper;
@Resource
private TbCablewaTransMapper tbCablewaTransMapper;
/**
* 杆塔管理-查询列表
* @param data
@ -110,6 +121,11 @@ public class TbTowerServiceImpl implements TbTowerService {
if (StringUtils.isNotNull(tbTower) && data.getId()!=tbTower.getId()){
return ServerResponse.createErroe("排序已存在");
}
List<TbThreeSpanVo> tbThreeSpanVo = tbThreeSpanMapper.getTbThreeSpanByTowerId(data.getId());
TbCablewaTransVo tbCablewaTransVo = tbCablewaTransMapper.getTbCablewaTransByTowerId(data.getId());
if(tbThreeSpanVo!=null || tbCablewaTransVo!=null){
return ServerResponse.createErroe("修改失败-已有三跨点和索道点的杆塔不允许删除和修改");
}
//如果改变杆塔类型先删后加
if (StringUtils.isNotNull(tbTower) && tbTower.getUploadType()!=data.getUploadType()){
delTbTower(data);
@ -144,6 +160,11 @@ public class TbTowerServiceImpl implements TbTowerService {
@Override
public ServerResponse delTbTower(TbTowerVo data) {
try {
List<TbThreeSpanVo> tbThreeSpanVo = tbThreeSpanMapper.getTbThreeSpanByTowerId(data.getId());
TbCablewaTransVo tbCablewaTransVo = tbCablewaTransMapper.getTbCablewaTransByTowerId(data.getId());
if(tbThreeSpanVo!=null || tbCablewaTransVo!=null){
return ServerResponse.createErroe("删除失败-已有三跨点和索道点的杆塔不允许删除和修改");
}
tbTowerMapper.delTbTower(data);
return ServerResponse.createBySuccessMsg("杆塔管理-删除成功");
} catch (Exception e) {

View File

@ -63,4 +63,10 @@
left join tb_tower tt on tct.tower_id = tt.id
where tct.id = #{id}
</select>
<select id="getTbCablewaTransByTowerId" resultType="com.bonus.digitalSignage.basic.vo.TbCablewaTransVo">
select tct.id as id,tct.pro_id as proId,tct.tower_id as towerId,tct.cableway_length as cablewayLength,
tct.max_height as maxHeight,tct.safety_distance as safetyDistance,tct.max_slope as maxSlope,
tct.create_user_id as createUserId
from tb_cablewa_trans tct where tct.tower_id = #{towerId}
</select>
</mapper>

View File

@ -86,4 +86,11 @@
tower_spacing as towerSpacing,highway_width as highwayWidth
from tb_three_span where id = #{id}
</select>
<select id="getTbThreeSpanByTowerId" resultType="com.bonus.digitalSignage.basic.vo.TbThreeSpanVo">
select id as id,pro_id as proId,span_type as spanType,tower_id as towerId,next_tower_id as nextTowerId,
upper_line as upperLine,lower_line as lowerLine,intersection_angle as intersectionAngle,
vertical_distance as verticalDistance,safety_margin as safetyMargin,vertical_clear_distance as verticalClearDistance,
tower_spacing as towerSpacing,highway_width as highwayWidth
from tb_three_span where is_active = '1' and (tower_id = #{towerId} or tower_id = #{next_tower_id})
</select>
</mapper>

View File

@ -175,7 +175,7 @@ function delData(id) {
query()
},1000)
} else if (result.code === 500) {
} else {
layer.alert(result.msg, {icon: 2})
}
}, function (xhr) {
@ -223,4 +223,4 @@ function importTower(){
'proId':idParam
}
openIframe2("ropeway", '数据导入', "importTower.html", '1000px', '625px', param);
}
}