三跨管理
This commit is contained in:
parent
2be8e81838
commit
ff80944e88
|
|
@ -1,9 +1,24 @@
|
|||
package com.bonus.digitalSignage.basic.controller;
|
||||
|
||||
import com.bonus.digitalSignage.annotation.DecryptAndVerify;
|
||||
import com.bonus.digitalSignage.annotation.LogAnnotation;
|
||||
import com.bonus.digitalSignage.basic.service.TbThreeSpanService;
|
||||
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
||||
import com.bonus.digitalSignage.basic.vo.TbThreeSpanVo;
|
||||
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
|
||||
import com.bonus.digitalSignage.system.vo.EncryptedReq;
|
||||
import com.bonus.digitalSignage.utils.ExcelUtil;
|
||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/4/25
|
||||
|
|
@ -13,4 +28,83 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@Slf4j
|
||||
public class TbThreeSpanController {
|
||||
|
||||
@Resource
|
||||
private TbThreeSpanService tbThreeSpanService;
|
||||
|
||||
/**
|
||||
* 三跨管理-查询列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "getTbThreeSpanList")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "三跨管理-查询列表", operation = "查询列表", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse getTbThreeSpanList(EncryptedReq<TbThreeSpanVo> dto) {
|
||||
PageHelper.startPage(dto.getData().getPageNum(), dto.getData().getPageSize());
|
||||
return tbThreeSpanService.getTbThreeSpanList(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-查询详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "getTbThreeSpanById")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "三跨管理-查询详情", operation = "查询详情", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse getTbThreeSpanById(EncryptedReq<TbThreeSpanVo> dto) {
|
||||
return tbThreeSpanService.getTbThreeSpanById(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-新增
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "addTbThreeSpan")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "三跨管理-新增", operation = "新增", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse addTbThreeSpan(EncryptedReq<TbThreeSpanVo> dto) {
|
||||
return tbThreeSpanService.addTbThreeSpan(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-修改
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "updateTbThreeSpan")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "三跨管理-修改", operation = "修改", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse updateTbThreeSpan(EncryptedReq<TbThreeSpanVo> dto) {
|
||||
return tbThreeSpanService.updateTbThreeSpan(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-删除
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "delTbThreeSpan")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "三跨管理-删除", operation = "删除", operDesc = "系统级事件",operType="查询")
|
||||
public ServerResponse delTbThreeSpan(EncryptedReq<TbThreeSpanVo> dto) {
|
||||
return tbThreeSpanService.delTbThreeSpan(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
*三跨管理导出
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/tbProjectExport")
|
||||
@DecryptAndVerify(decryptedClass = TbThreeSpanVo.class)
|
||||
@LogAnnotation(operModul = "三跨管理-导出", operation = "导出", operDesc = "系统级事件",operType="导出")
|
||||
public void tbProjectExport(HttpServletResponse response, EncryptedReq<TbThreeSpanVo> data) {
|
||||
|
||||
List<TbThreeSpanVo> tbThreeSpanVoList = tbThreeSpanService.tbProjectAll(data.getData());
|
||||
ExcelUtil<TbThreeSpanVo> util = new ExcelUtil<>(TbThreeSpanVo.class);
|
||||
util.exportExcel(response, tbThreeSpanVoList, "三跨管理");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,18 @@
|
|||
package com.bonus.digitalSignage.basic.dao;
|
||||
|
||||
import com.bonus.digitalSignage.basic.vo.TbThreeSpanVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbThreeSpanMapper {
|
||||
|
||||
List<TbThreeSpanVo> getTbThreeSpanList(TbThreeSpanVo data);
|
||||
|
||||
TbThreeSpanVo getTbThreeSpanById(TbThreeSpanVo data);
|
||||
|
||||
void addTbThreeSpan(TbThreeSpanVo data);
|
||||
|
||||
void updateTbThreeSpan(TbThreeSpanVo data);
|
||||
|
||||
void delTbThreeSpan(TbThreeSpanVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,50 @@
|
|||
package com.bonus.digitalSignage.basic.service;
|
||||
|
||||
import com.bonus.digitalSignage.basic.vo.TbThreeSpanVo;
|
||||
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
|
||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbThreeSpanService {
|
||||
/**
|
||||
* 三跨管理-查询列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getTbThreeSpanList(TbThreeSpanVo data);
|
||||
|
||||
/**
|
||||
* 三跨管理-查询详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse getTbThreeSpanById(TbThreeSpanVo data);
|
||||
|
||||
/**
|
||||
* 三跨管理-新增
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse addTbThreeSpan(TbThreeSpanVo data);
|
||||
|
||||
/**
|
||||
* 三跨管理-修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse updateTbThreeSpan(TbThreeSpanVo data);
|
||||
|
||||
/**
|
||||
* 三跨管理-删除
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
ServerResponse delTbThreeSpan(TbThreeSpanVo data);
|
||||
/**
|
||||
*三跨管理查询全部列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<TbThreeSpanVo> tbProjectAll(TbThreeSpanVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,126 @@
|
|||
package com.bonus.digitalSignage.basic.service.impl;
|
||||
|
||||
import com.bonus.digitalSignage.basic.dao.TbThreeSpanMapper;
|
||||
import com.bonus.digitalSignage.basic.dao.TbTowerMapper;
|
||||
import com.bonus.digitalSignage.basic.service.TbThreeSpanService;
|
||||
import com.bonus.digitalSignage.basic.vo.TbProjectVo;
|
||||
import com.bonus.digitalSignage.basic.vo.TbThreeSpanVo;
|
||||
import com.bonus.digitalSignage.basic.vo.TbTowerVo;
|
||||
import com.bonus.digitalSignage.utils.ServerResponse;
|
||||
import com.bonus.digitalSignage.utils.UserUtil;
|
||||
import com.bonus.digitalSignage.webResult.StringUtils;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/4/25
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TbThreeSpanServiceImpl implements TbThreeSpanService {
|
||||
|
||||
@Resource
|
||||
private TbThreeSpanMapper tbThreeSpanMapper;
|
||||
|
||||
/**
|
||||
* 三跨管理-查询列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getTbThreeSpanList(TbThreeSpanVo data) {
|
||||
try {
|
||||
List<TbThreeSpanVo> tbThreeSpanVoList = tbThreeSpanMapper.getTbThreeSpanList(data);
|
||||
PageInfo<TbThreeSpanVo> pageInfo = new PageInfo<>(tbThreeSpanVoList);
|
||||
return ServerResponse.createSuccessPage(pageInfo, data.getPageNum(), data.getPageSize());
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("三跨管理-查询列表失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-查询详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse getTbThreeSpanById(TbThreeSpanVo data) {
|
||||
try {
|
||||
TbThreeSpanVo tbThreeSpanVo = tbThreeSpanMapper.getTbThreeSpanById(data);
|
||||
return ServerResponse.createSuccess(tbThreeSpanVo);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("三跨管理-查询详情失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-新增
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse addTbThreeSpan(TbThreeSpanVo data) {
|
||||
try {
|
||||
Long userId = UserUtil.getLoginUser().getId();
|
||||
data.setCreateUserId(userId);
|
||||
data.setCreateTime(new Date());
|
||||
tbThreeSpanMapper.addTbThreeSpan(data);
|
||||
return ServerResponse.createSuccess("三跨管理-新增成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("三跨管理-新增失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-修改
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse updateTbThreeSpan(TbThreeSpanVo data) {
|
||||
try {
|
||||
Long userId = UserUtil.getLoginUser().getId();
|
||||
data.setUpdateUserId(userId);
|
||||
tbThreeSpanMapper.updateTbThreeSpan(data);
|
||||
return ServerResponse.createSuccess("三跨管理-修改成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("三跨管理-修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 三跨管理-删除
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ServerResponse delTbThreeSpan(TbThreeSpanVo data) {
|
||||
try {
|
||||
tbThreeSpanMapper.delTbThreeSpan(data);
|
||||
return ServerResponse.createSuccess("三跨管理-删除成功");
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return ServerResponse.createErroe("三跨管理-删除失败");
|
||||
}
|
||||
}
|
||||
/**
|
||||
*三跨管理查询全部列表
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TbThreeSpanVo> tbProjectAll(TbThreeSpanVo data) {
|
||||
List<TbThreeSpanVo> tbThreeSpanVoList = tbThreeSpanMapper.getTbThreeSpanList(data);
|
||||
return tbThreeSpanVoList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,107 @@
|
|||
package com.bonus.digitalSignage.basic.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author 马三炮
|
||||
* @date 2025/4/25
|
||||
*/
|
||||
@Data
|
||||
public class TbThreeSpanVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private Long proId;
|
||||
|
||||
/**
|
||||
* 跨越类型 1.跨线路 2.跨公路 3.跨铁路
|
||||
*/
|
||||
private String spanType;
|
||||
|
||||
/**
|
||||
* 开始杆塔id
|
||||
*/
|
||||
private Long towerId;
|
||||
|
||||
/**
|
||||
* 结束杆塔id
|
||||
*/
|
||||
private Long nextTowerId;
|
||||
|
||||
/**
|
||||
* 上层线路
|
||||
*/
|
||||
private Long upperLine;
|
||||
|
||||
/**
|
||||
* 下层线路
|
||||
*/
|
||||
private Long lowerLine;
|
||||
|
||||
/**
|
||||
* 交叉角度
|
||||
*/
|
||||
private Long intersectionAngle;
|
||||
|
||||
/**
|
||||
* 垂直距离(m)
|
||||
*/
|
||||
private Long verticalDistance;
|
||||
|
||||
/**
|
||||
* 安全裕度(°)
|
||||
*/
|
||||
private Long safetyMargin;
|
||||
|
||||
/**
|
||||
* 垂直净距(m)
|
||||
*/
|
||||
private Long verticalClearDistance;
|
||||
|
||||
/**
|
||||
* 杆塔间距(m)
|
||||
*/
|
||||
private Long towerSpacing;
|
||||
|
||||
/**
|
||||
* 公路宽度(m)
|
||||
*/
|
||||
private Long highwayWidth;
|
||||
|
||||
/**
|
||||
* 是否可用1.可用 0.不可用
|
||||
*/
|
||||
private Long isActive;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
* 修改人id
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
|
||||
private int pageNum = 1;
|
||||
private int pageSize = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,5 +2,80 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.digitalSignage.basic.dao.TbThreeSpanMapper">
|
||||
<insert id="addTbThreeSpan">
|
||||
insert into tb_three_span
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null ">pro_id,</if>
|
||||
<if test="spanType != null ">span_type,</if>
|
||||
<if test="towerId != null ">tower_id,</if>
|
||||
<if test="nextTowerId != null ">next_tower_id,</if>
|
||||
<if test="upperLine != null">upper_line,</if>
|
||||
<if test="lowerLine != null ">lower_line,</if>
|
||||
<if test="intersectionAngle != null ">intersection_angle,</if>
|
||||
<if test="verticalDistance != null ">vertical_distance,</if>
|
||||
<if test="safetyMargin != null ">safety_margin,</if>
|
||||
<if test="verticalClearDistance != null ">vertical_clear_distance,</if>
|
||||
<if test="towerSpacing != null ">tower_spacing,</if>
|
||||
<if test="highwayWidth != null ">highway_width,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createUserId != null ">create_user_id,</if>
|
||||
is_actvice
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="proId != null ">#{proId},</if>
|
||||
<if test="spanType != null ">#{spanType},</if>
|
||||
<if test="towerId != null ">#{towerId},</if>
|
||||
<if test="nextTowerId != null ">#{nextTowerId},</if>
|
||||
<if test="upperLine != null ">#{upperLine},</if>
|
||||
<if test="lowerLine != null ">#{lowerLine},</if>
|
||||
<if test="intersectionAngle != null ">#{intersectionAngle},</if>
|
||||
<if test="verticalDistance != null ">#{verticalDistance},</if>
|
||||
<if test="safetyMargin != null ">#{safetyMargin},</if>
|
||||
<if test="verticalClearDistance != null ">#{verticalClearDistance},</if>
|
||||
<if test="towerSpacing != null ">#{towerSpacing},</if>
|
||||
<if test="highwayWidth != null ">#{highwayWidth},</if>
|
||||
<if test="createTime != null ">#{createTime},</if>
|
||||
<if test="createUserId != null ">#{createUserId},</if>
|
||||
1
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateTbThreeSpan">
|
||||
update tb_three_span
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="spanType != null">span_type = #{spanType},</if>
|
||||
<if test="towerId != null">tower_id = #{towerId},</if>
|
||||
<if test="nextTowerId != null">next_tower_id = #{nextTowerId},</if>
|
||||
<if test="upperLine != null">upper_line = #{upperLine},</if>
|
||||
<if test="lowerLine != null">lower_line = #{lowerLine},</if>
|
||||
<if test="intersectionAngle != null">intersection_angle = #{intersectionAngle},</if>
|
||||
<if test="verticalDistance != null">vertical_distance = #{verticalDistance},</if>
|
||||
<if test="safetyMargin != null">safety_margin = #{safetyMargin},</if>
|
||||
<if test="verticalClearDistance != null">vertical_clear_distance = #{verticalClearDistance},</if>
|
||||
<if test="towerSpacing != null">tower_spacing = #{towerSpacing},</if>
|
||||
<if test="highwayWidth != null">highway_width = #{highwayWidth},</if>
|
||||
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
|
||||
update_time = now()
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<delete id="delTbThreeSpan">
|
||||
update tb_three_span set is_active = 0 where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getTbThreeSpanList" 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 pro_id = #{proId} and is_actvice = '1'
|
||||
<if test="towerName != '' and towerName != null">and tower_name like concat('%', #{towerName}, '%')</if>
|
||||
</select>
|
||||
<select id="getTbThreeSpanById" 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 id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue