Commit 39dd7dc0 authored by hkl's avatar hkl

feat:1.代码提交

parent d94c1e4e
package org.jeecg.modules.deviceAsset.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.dto.SignBoardManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement;
import org.jeecg.modules.deviceAsset.entity.SignBoardManagement;
import org.jeecg.modules.deviceAsset.service.IRailManagementService;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import org.jeecg.modules.deviceAsset.vo.SignBoardManagementVO;
import org.springframework.web.bind.annotation.*;
import org.jeecg.common.system.base.controller.JeecgController;
import java.util.Arrays;
/**
* <p>
* 资产管理-钢轨管理 前端控制器
* </p>
*
* @author hkl
* @since 2023-07-06
*/
@RestController
@RequestMapping("/deviceAsset/railManagement")
@Api(tags = "资产管理-钢轨管理")
public class RailManagementController extends JeecgController<RailManagement, IRailManagementService> {
@AutoLog(value = "资产管理-钢轨管理 -分页列表查询")
@ApiOperation(value = "资产管理-道岔管理-分页列表查询", notes = "资产管理-道岔管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<RailManagementVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
RailManagementDTO dto) {
Page<RailManagementVO> pageData = new Page<>(pageNo, pageSize);
pageData = this.service.queryPageList(pageData, dto);
return Result.OK(pageData);
}
@AutoLog(value = "资产管理-钢轨管理-编辑")
@ApiOperation(value = "资产管理-钢轨管理-编辑", notes = "资产管理-钢轨管理-编辑")
@PostMapping(value = "/edit")
public Result<String> edit(@RequestBody RailManagement railManagement) {
if (ObjectUtil.isEmpty(railManagement.getId())) {
this.service.save(railManagement);
} else {
this.service.updateById(railManagement);
}
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "资产管理-钢轨管理-通过id删除")
@ApiOperation(value = "资产管理-钢轨管理-通过id删除", notes = "资产管理-钢轨管理-通过id删除")
@GetMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
this.service.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "资产管理-钢轨管理-批量删除")
@ApiOperation(value = "资产管理-钢轨管理-批量删除", notes = "资产管理-钢轨管理-批量删除")
@GetMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
}
......@@ -92,8 +92,8 @@ public class TrackBedManagementController extends JeecgController<TrackBedManage
public Result<List<TrackBedManagement>> queryList(@ApiParam(name = "区间id") String sectionId,
@ApiParam(name = "线别id") String lineAliasId) {
List<TrackBedManagement> listResult = this.service.lambdaQuery()
.eq(TrackBedManagement::getSectionId, sectionId)
.eq(TrackBedManagement::getLineAliasId, lineAliasId)
.eq(ObjectUtil.isNotEmpty(sectionId), TrackBedManagement::getSectionId, sectionId)
.eq(ObjectUtil.isNotEmpty(lineAliasId), TrackBedManagement::getLineAliasId, lineAliasId)
.list();
return Result.OK(listResult);
}
......
package org.jeecg.modules.deviceAsset.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
* 资产管理-钢轨管理
* </p>
*
* @author hkl
* @since 2023-07-06
*/
@Data
@ApiModel(value = "RailManagementDTO对象", description = "资产管理-钢轨管理")
public class RailManagementDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("钢轨编码")
private Integer railCode;
@ApiModelProperty("备注")
private String remark;
}
......@@ -55,6 +55,10 @@ public class FastenerManagement implements Serializable {
@TableField("fastener_type")
private String fastenerType;
@ApiModelProperty("扣件数量")
@TableField("fastener_num")
private Integer fastenerNum;
@ApiModelProperty("区间id")
@TableField("section_id")
private String sectionId;
......@@ -63,21 +67,9 @@ public class FastenerManagement implements Serializable {
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("起始里程")
@TableField("starting_mileage")
private BigDecimal startingMileage;
@ApiModelProperty("结束里程")
@TableField("end_mileage")
private BigDecimal endMileage;
@ApiModelProperty("扣件长度")
@TableField("fastener_len")
private BigDecimal fastenerLen;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ApiModelProperty("道床id")
@TableField("track_bed_id")
private String trackBedId;
}
package org.jeecg.modules.deviceAsset.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 资产管理-钢轨管理
* </p>
*
* @author hkl
* @since 2023-07-06
*/
@Data
@TableName("t_da_rail_management")
@ApiModel(value = "RailManagement对象", description = "资产管理-钢轨管理")
public class RailManagement implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableField("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("钢轨序号")
@TableField("rail_order_num")
private Integer railOrderNum;
@ApiModelProperty("钢轨编码")
@TableField("rail_code")
private String railCode;
@ApiModelProperty("区间id")
@TableField("section_id")
private String sectionId;
@ApiModelProperty("线别id")
@TableField("line_alias_id")
private String lineAliasId;
@ApiModelProperty("起始里程")
@TableField("starting_mileage")
private BigDecimal startingMileage;
@ApiModelProperty("中心里程")
@TableField("center_mileage")
private BigDecimal centerMileage;
@ApiModelProperty("结束里程")
@TableField("end_mileage")
private BigDecimal endMileage;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
}
package org.jeecg.modules.deviceAsset.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
/**
* <p>
* 资产管理-钢轨管理 Mapper 接口
* </p>
*
* @author hkl
* @since 2023-07-06
*/
public interface RailManagementMapper extends BaseMapper<RailManagement> {
Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto);
}
......@@ -3,6 +3,24 @@
<mapper namespace="org.jeecg.modules.deviceAsset.mapper.FastenerManagementMapper">
<select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.FastenerManagementVO">
select * from t_da_fastener_management
SELECT
t1.*,
t2.light_rail_name,
t2.light_rail_id,
t2.section_name,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name,
t3.track_bed_code,
t3.starting_mileage,
t3.end_mileage,
t3.track_bed_len,
t3.remark
FROM t_da_fastener_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_da_track_bed_management t3 ON t1.track_bed_id = t3.id
<where>
<if test="dto.fastenerCode != null and dto.fastenerCode != ''">
AND t1.fastener_code like concat('%',#{dto.fastenerCode},'%')
</if>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.deviceAsset.mapper.RailManagementMapper">
<select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.RailManagementVO">
SELECT
t1.*,
t2.light_rail_name,
t2.light_rail_id,
t2.section_name,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name
FROM
t_da_rail_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
<where>
<if test="dto.railCode != null and dto.railCode != ''">
AND t1.rail_code like concat('%',#{dto.railCode},'%')
</if>
</where>
</select>
</mapper>
......@@ -8,9 +8,13 @@
t2.light_rail_name,
t2.light_rail_id,
t2.section_name,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name
FROM
t_da_sleeper_management t1
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name,
t3.track_bed_code,
t3.starting_mileage,
t3.end_mileage,
t3.track_bed_len,
t3.remark
FROM t_da_sleeper_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_da_track_bed_management t3 ON t1.track_bed_id = t3.id
<where>
......
package org.jeecg.modules.deviceAsset.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
/**
* <p>
* 资产管理-钢轨管理 服务类
* </p>
*
* @author hkl
* @since 2023-07-06
*/
public interface IRailManagementService extends IService<RailManagement> {
Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto);
}
package org.jeecg.modules.deviceAsset.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement;
import org.jeecg.modules.deviceAsset.mapper.RailManagementMapper;
import org.jeecg.modules.deviceAsset.service.IRailManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import org.springframework.stereotype.Service;
/**
* <p>
* 资产管理-钢轨管理 服务实现类
* </p>
*
* @author hkl
* @since 2023-07-06
*/
@Service
public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper, RailManagement> implements IRailManagementService {
@Override
public Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto) {
return this.baseMapper.queryPageList(pageData,dto);
}
}
......@@ -34,6 +34,9 @@ public class FastenerManagementVO {
@ApiModelProperty("扣件类型")
private String fastenerType;
@ApiModelProperty("扣件数量")
private Integer fastenerNum;
@ApiModelProperty("线路Id")
private String lightRailId;
......@@ -43,17 +46,29 @@ public class FastenerManagementVO {
@ApiModelProperty("区间id")
private String sectionId;
@ApiModelProperty("区间名称")
private String sectionName;
@ApiModelProperty("线别id")
private String lineAliasId;
@ApiModelProperty("线别名称")
private String lineAliasName;
@ApiModelProperty("道床Id")
private String trackBedId;
@ApiModelProperty("道床编号")
private String trackBedCode;
@ApiModelProperty("起始里程")
private BigDecimal startingMileage;
@ApiModelProperty("结束里程")
private BigDecimal endMileage;
@ApiModelProperty("扣件长度")
private BigDecimal fastenerLen;
@ApiModelProperty("道床长度=结束里程-起始里程")
private BigDecimal trackBedLen;
@ApiModelProperty("备注")
private String remark;
......
package org.jeecg.modules.deviceAsset.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 资产管理-钢轨管理
* </p>
*
* @author hkl
* @since 2023-07-06
*/
@Data
@ApiModel(value = "RailManagementVO对象", description = "资产管理-钢轨管理")
public class RailManagementVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("钢轨序号")
private Integer railOrderNum;
@ApiModelProperty("钢轨编码")
private String railCode;
@ApiModelProperty("线路id")
private String lightRailId;
@ApiModelProperty("线路名称")
private String lightRailName;
@ApiModelProperty("区间id")
private String sectionId;
@ApiModelProperty("区间名称")
private String sectionName;
@ApiModelProperty("线别id")
private String lineAliasId;
@ApiModelProperty("线别名称")
private String lineAliasName;
@ApiModelProperty("起始里程")
private BigDecimal startingMileage;
@ApiModelProperty("中心里程")
private BigDecimal centerMileage;
@ApiModelProperty("结束里程")
private BigDecimal endMileage;
@ApiModelProperty("备注")
private String remark;
}
package org.jeecg.modules.deviceAsset.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
......@@ -50,13 +51,40 @@ public class SleeperManagementVO implements Serializable {
@ApiModelProperty("轨枕类型")
private String sleeperType;
@ApiModelProperty("线路id")
private String lightRailId;
@ApiModelProperty("线路名称")
private String lightRailName;
@ApiModelProperty("区间id")
private String sectionId;
@ApiModelProperty("区间名称")
private String sectionName;
@ApiModelProperty("线别id")
private String lineAliasId;
@ApiModelProperty("线别名称")
private String lineAliasName;
@ApiModelProperty("道床id")
private String trackBedId;
@ApiModelProperty("道床编号")
private String trackBedCode;
@ApiModelProperty("起始里程")
private BigDecimal startingMileage;
@ApiModelProperty("结束里程")
private BigDecimal endMileage;
@ApiModelProperty("道床长度=结束里程-起始里程")
private BigDecimal trackBedLen;
@ApiModelProperty("备注")
private String remark;
}
......@@ -67,7 +67,7 @@ public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, S
TrainStation startTrainStation = trainStationMapper.selectById(subwaySection.getStartTrainStationId());
TrainStation endTrainStation = trainStationMapper.selectById(subwaySection.getEndTrainStationId());
QueryWrapper<TrainStation> tsQueryWrapper = new QueryWrapper<>();
tsQueryWrapper.select("DISTINCT line_alias_code line_alias_code", "id", "station_name");
tsQueryWrapper.select("DISTINCT station_name station_name", "id");
tsQueryWrapper.lambda().ge(TrainStation::getSeq, startTrainStation.getSeq())
.le(TrainStation::getSeq, endTrainStation.getSeq())
.eq(TrainStation::getLightRailId, subwaySection.getLightRailId());
......
......@@ -29,7 +29,7 @@ public class CodeGenerate {
// 表名
String[] tables = {
"t_da_sleeper_management",
"t_da_rail_management",
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment