Bug修复,已有三跨点和索道点的杆塔不允许删除和修改
This commit is contained in:
parent
1c1fc622ef
commit
9f87cc433f
|
|
@ -14,4 +14,6 @@ public interface TbCablewaTransMapper {
|
||||||
void updateTbCablewaTrans(TbCablewaTransVo data);
|
void updateTbCablewaTrans(TbCablewaTransVo data);
|
||||||
|
|
||||||
void delTbCablewaTrans(TbCablewaTransVo data);
|
void delTbCablewaTrans(TbCablewaTransVo data);
|
||||||
|
|
||||||
|
TbCablewaTransVo getTbCablewaTransByTowerId(Long towerId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,6 @@ public interface TbThreeSpanMapper {
|
||||||
void updateTbThreeSpan(TbThreeSpanVo data);
|
void updateTbThreeSpan(TbThreeSpanVo data);
|
||||||
|
|
||||||
void delTbThreeSpan(TbThreeSpanVo data);
|
void delTbThreeSpan(TbThreeSpanVo data);
|
||||||
|
|
||||||
|
List<TbThreeSpanVo> getTbThreeSpanByTowerId(Long towerId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.bonus.digitalSignage.basic.service.impl;
|
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.dao.TbTowerMapper;
|
||||||
import com.bonus.digitalSignage.basic.service.TbTowerService;
|
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.basic.vo.TbTowerVo;
|
||||||
import com.bonus.digitalSignage.utils.*;
|
import com.bonus.digitalSignage.utils.*;
|
||||||
import com.bonus.digitalSignage.webResult.StringUtils;
|
import com.bonus.digitalSignage.webResult.StringUtils;
|
||||||
|
|
@ -24,6 +28,13 @@ public class TbTowerServiceImpl implements TbTowerService {
|
||||||
@Resource
|
@Resource
|
||||||
private TbTowerMapper tbTowerMapper;
|
private TbTowerMapper tbTowerMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbThreeSpanMapper tbThreeSpanMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TbCablewaTransMapper tbCablewaTransMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 杆塔管理-查询列表
|
* 杆塔管理-查询列表
|
||||||
* @param data
|
* @param data
|
||||||
|
|
@ -110,6 +121,11 @@ public class TbTowerServiceImpl implements TbTowerService {
|
||||||
if (StringUtils.isNotNull(tbTower) && data.getId()!=tbTower.getId()){
|
if (StringUtils.isNotNull(tbTower) && data.getId()!=tbTower.getId()){
|
||||||
return ServerResponse.createErroe("排序已存在");
|
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()){
|
if (StringUtils.isNotNull(tbTower) && tbTower.getUploadType()!=data.getUploadType()){
|
||||||
delTbTower(data);
|
delTbTower(data);
|
||||||
|
|
@ -144,6 +160,11 @@ public class TbTowerServiceImpl implements TbTowerService {
|
||||||
@Override
|
@Override
|
||||||
public ServerResponse delTbTower(TbTowerVo data) {
|
public ServerResponse delTbTower(TbTowerVo data) {
|
||||||
try {
|
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);
|
tbTowerMapper.delTbTower(data);
|
||||||
return ServerResponse.createBySuccessMsg("杆塔管理-删除成功");
|
return ServerResponse.createBySuccessMsg("杆塔管理-删除成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -63,4 +63,10 @@
|
||||||
left join tb_tower tt on tct.tower_id = tt.id
|
left join tb_tower tt on tct.tower_id = tt.id
|
||||||
where tct.id = #{id}
|
where tct.id = #{id}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -86,4 +86,11 @@
|
||||||
tower_spacing as towerSpacing,highway_width as highwayWidth
|
tower_spacing as towerSpacing,highway_width as highwayWidth
|
||||||
from tb_three_span where id = #{id}
|
from tb_three_span where id = #{id}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ function delData(id) {
|
||||||
query()
|
query()
|
||||||
},1000)
|
},1000)
|
||||||
|
|
||||||
} else if (result.code === 500) {
|
} else {
|
||||||
layer.alert(result.msg, {icon: 2})
|
layer.alert(result.msg, {icon: 2})
|
||||||
}
|
}
|
||||||
}, function (xhr) {
|
}, function (xhr) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue