Merge remote-tracking branch 'origin/master'

This commit is contained in:
lSun 2025-04-28 18:06:15 +08:00
commit 40a91219e0
1 changed files with 17 additions and 8 deletions

View File

@ -108,16 +108,25 @@ public class TbThreeSpanServiceImpl implements TbThreeSpanService {
@Transactional
public ServerResponse updateTbThreeSpan(TbThreeSpanVo data) {
try {
Long userId = UserUtil.getLoginUser().getId();
data.setUpdateUserId(userId);
tbThreeSpanMapper.updateTbThreeSpan(data);
List<TbSpanTowerVo> tbSpanTowerList =data.getTbSpanTowerList();
//获取跨越杆塔信息
if (tbSpanTowerList!=null){
tbSpanTowerService.updateTbSpanTower(tbSpanTowerList,data.getId());
TbThreeSpanVo tbThreeSpan = tbThreeSpanMapper.getTbThreeSpanById(data);
//判断是否改变类型
if (tbThreeSpan.getSpanType()!=data.getSpanType()){
//如果改变类型先删后加
delTbThreeSpan(data);
addTbThreeSpan(data);
}else {
Long userId = UserUtil.getLoginUser().getId();
data.setUpdateUserId(userId);
tbThreeSpanMapper.updateTbThreeSpan(data);
List<TbSpanTowerVo> tbSpanTowerList =data.getTbSpanTowerList();
//获取跨越杆塔信息
if (tbSpanTowerList!=null){
tbSpanTowerService.delTbSpanTower(data.getId());
tbSpanTowerService.addTbSpanTowerList(data.getId(),tbSpanTowerList);
}
}
return ServerResponse.createBySuccessMsg("三跨管理-修改成功");
} catch (Exception e) {
} catch (Throwable e) {
log.error(e.toString(), e);
return ServerResponse.createErroe("三跨管理-修改失败");
}