Commit 14f3e481 authored by shizhilong's avatar shizhilong

解决bug部分--shizhilong

parent ce200d49
...@@ -179,41 +179,58 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -179,41 +179,58 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情") @AutoLog(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情")
@ApiOperation(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情", notes = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情") @ApiOperation(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情", notes = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情")
@GetMapping(value = "/getInfoById") @GetMapping(value = "/getInfoById")
public Result<List<MovementCourseInfoOneVO>> getInfoById(@ApiParam(name = "动静态几何尺寸数据id") String movementMasterId, @ApiParam(name = "检查里程相关信息id") String movementCourseId) { public Result<List<MovementCourseInfoVO>> getInfoById(@ApiParam(name = "动静态几何尺寸数据id") String movementMasterId, @ApiParam(name = "检查里程相关信息id") String movementCourseId) {
List<MovementCourseInfo> listResult = movementCourseInfoService.lambdaQuery() List<MovementCourseInfo> listResult = movementCourseInfoService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId) .eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId)
.eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId) .eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId)
.eq(MovementCourseInfo::getDelFlag, "0") .eq(MovementCourseInfo::getDelFlag, "0")
.orderByAsc(MovementCourseInfo::getInfoSort) .orderByAsc(MovementCourseInfo::getInfoSort)
.list(); .list();
//初始化最终返回的集合 List<MovementCourseInfoVO> resultList = new ArrayList<>();
List<MovementCourseInfoOneVO> resultList = new ArrayList<>(); if(listResult != null && listResult.size() > 0){
if (listResult != null && listResult.size() > 0) { resultList = BeanCopyUtil.copyListProperties(listResult, MovementCourseInfoVO::new);
List<String> trackCodeList = listResult.stream().map(MovementCourseInfo::getTrackCode).distinct().collect(Collectors.toList());
for (String code : trackCodeList) {
//初始化最终返回的对象
MovementCourseInfoOneVO resultModel = new MovementCourseInfoOneVO();
//初始化检查项目对应的详情记录的集合
List<MovementCourseInfoVO> infoList = new ArrayList<>();
//循环符合条件的数据项集合
for (MovementCourseInfo entity : listResult) {
//判断项目名称一样
if (code.equals(entity.getTrackCode())) {
//初始化检查项目对应的详情记录的对象
MovementCourseInfoVO infoVo = new MovementCourseInfoVO();
BeanCopyUtil.copyProperties(entity, infoVo);
infoList.add(infoVo);
}
}
resultModel.setInfoList(infoList);
resultModel.setTrackCode(code);
resultList.add(resultModel);
}
} }
return Result.OK(resultList); return Result.OK(resultList);
} }
// @AutoLog(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情")
// @ApiOperation(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情", notes = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情")
// @GetMapping(value = "/getInfoById")
// public Result<List<MovementCourseInfoOneVO>> getInfoById(@ApiParam(name = "动静态几何尺寸数据id") String movementMasterId, @ApiParam(name = "检查里程相关信息id") String movementCourseId) {
// List<MovementCourseInfo> listResult = movementCourseInfoService.lambdaQuery()
// .eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId)
// .eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId)
// .eq(MovementCourseInfo::getDelFlag, "0")
// .orderByAsc(MovementCourseInfo::getInfoSort)
// .list();
//
// //初始化最终返回的集合
// List<MovementCourseInfoOneVO> resultList = new ArrayList<>();
// if (listResult != null && listResult.size() > 0) {
// List<String> trackCodeList = listResult.stream().map(MovementCourseInfo::getTrackCode).distinct().collect(Collectors.toList());
// for (String code : trackCodeList) {
// //初始化最终返回的对象
// MovementCourseInfoOneVO resultModel = new MovementCourseInfoOneVO();
// //初始化检查项目对应的详情记录的集合
// List<MovementCourseInfoVO> infoList = new ArrayList<>();
// //循环符合条件的数据项集合
// for (MovementCourseInfo entity : listResult) {
// //判断项目名称一样
// if (code.equals(entity.getTrackCode())) {
// //初始化检查项目对应的详情记录的对象
// MovementCourseInfoVO infoVo = new MovementCourseInfoVO();
// BeanCopyUtil.copyProperties(entity, infoVo);
// infoList.add(infoVo);
// }
// }
// resultModel.setInfoList(infoList);
// resultModel.setTrackCode(code);
// resultList.add(resultModel);
// }
// }
// return Result.OK(resultList);
// }
@AutoLog(value = "动静态几何尺寸主数据新增或者编辑") @AutoLog(value = "动静态几何尺寸主数据新增或者编辑")
@ApiOperation(value = "动静态几何尺寸主数据新增或者编辑", notes = "动静态几何尺寸主数据新增或者编辑") @ApiOperation(value = "动静态几何尺寸主数据新增或者编辑", notes = "动静态几何尺寸主数据新增或者编辑")
@PostMapping(value = "/saveOrUpdate") @PostMapping(value = "/saveOrUpdate")
...@@ -343,28 +360,26 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -343,28 +360,26 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
//开始里程 //开始里程
String[] start = mileage.split("-"); String[] start = mileage.split("-");
String s = start[0]; String s = start[0];
String[] n0 = s.split("\\+"); String k = s.substring(s.indexOf("K") + 1, s.length()).trim();
startingAndEndingMileageStr = n0[1].trim(); startingAndEndingMileageStr = k.replace("+","").trim();
//System.out.println(skipColumnNum+"开始里程="+startMileage);
//结束里程 //结束里程
String s1 = start[1]; String s1 = start[1];
String[] n1 = s1.split("\\+"); String[] ks1 = s1.split("K");
String k1 = ks1[1];
String[] n1 = k1.split("\\+");
String s2 = n1[1]; String s2 = n1[1];
endingMileageStr = s2.substring(0, s2.indexOf(" ")).trim(); endingMileageStr = n1[0]+s2.substring(0, s2.indexOf(" ")).trim();
//System.out.println(skipColumnNum+"结束里程="+endMileage);
//曲线半径 //曲线半径
String[] n2 = s2.split("半径 "); String[] n2 = s1.split("半径 ");
String s3 = n2[1]; String s3 = n2[1];
curveRadius = s3.substring(0, s3.indexOf(" m")).replace("/", "").trim(); curveRadius = s3.substring(0, s3.indexOf(" m")).replace("/", "").trim();
//System.out.println(skipColumnNum+"曲线半径="+bj+";");
//解析超高、加宽、顺坡率、线路全长 //解析超高、加宽、顺坡率、线路全长
String[] n3 = courseStr.split("超高"); String[] n3 = courseStr.split("超高");
String s4 = n3[1]; String s4 = n3[1];
superHigh = s4.substring(0, s4.indexOf("mm")).replace("/", "").trim(); superHigh = s4.substring(0, s4.indexOf("mm")).replace("/", "").trim();
//System.out.println(skipColumnNum+"超高="+superHigh+";");
//加宽 //加宽
String[] n4 = courseStr.split("加宽"); String[] n4 = courseStr.split("加宽");
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
SELECT SELECT
t1.* t1.*
FROM FROM
t_djt_movement_records_master t1 t_djt_movement_records_master t1 left join t_sn_light_rail t2 on t1.light_rail_id = t2.id
<where> <where>
1=1 1=1
<if test="dto.ekCode != null and dto.ekCode != ''"> <if test="dto.ekCode != null and dto.ekCode != ''">
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
</if> </if>
AND t1.type = #{dto.type} AND t1.type = #{dto.type}
AND t1.del_flag = '0' AND t1.del_flag = '0'
AND t2.status = 1
order by t1.create_time desc order by t1.create_time desc
</where> </where>
</select> </select>
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
AND t3.id = #{lineAliasId} AND t3.id = #{lineAliasId}
AND t4.curve_mileage_zh &gt;= #{startingMileage} AND t4.curve_mileage_zh &gt;= #{startingMileage}
AND t4.curve_mileage_hz &lt;= #{endMileage} AND t4.curve_mileage_hz &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''"> <if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId} AND t.id = #{sectionId}
</if> </if>
...@@ -64,6 +66,7 @@ ...@@ -64,6 +66,7 @@
AND t3.id = #{lineAliasId} AND t3.id = #{lineAliasId}
AND t4.starting_mileage &gt;= #{startingMileage} AND t4.starting_mileage &gt;= #{startingMileage}
AND t4.end_mileage &lt;= #{endMileage} AND t4.end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''"> <if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId} AND t.id = #{sectionId}
</if> </if>
...@@ -86,6 +89,7 @@ ...@@ -86,6 +89,7 @@
AND t3.id = #{lineAliasId} AND t3.id = #{lineAliasId}
AND t4.starting_mileage &gt;= #{startingMileage} AND t4.starting_mileage &gt;= #{startingMileage}
AND t4.end_mileage &lt;= #{endMileage} AND t4.end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''"> <if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId} AND t.id = #{sectionId}
</if> </if>
...@@ -108,6 +112,7 @@ ...@@ -108,6 +112,7 @@
AND t3.id = #{lineAliasId} AND t3.id = #{lineAliasId}
AND t4.byroad_pre_mileage &gt;= #{startingMileage} AND t4.byroad_pre_mileage &gt;= #{startingMileage}
AND t4.byroad_end_mileage &lt;= #{endMileage} AND t4.byroad_end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''"> <if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId} AND t.id = #{sectionId}
</if> </if>
......
...@@ -9,10 +9,11 @@ ...@@ -9,10 +9,11 @@
t2.light_rail_name, t2.light_rail_name,
t2.light_rail_id, t2.light_rail_id,
t2.section_name, t2.section_name,
(SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id limit 1) line_alias_name (SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id limit 1) line_alias_name
FROM FROM
t_da_curve_management t1 t_da_curve_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_sn_light_rail t3 ON t2.light_rail_id = t3.id
<where> <where>
<if test="dto.curveCode != null and dto.curveCode != ''"> <if test="dto.curveCode != null and dto.curveCode != ''">
AND t1.curve_code like concat('%',#{dto.curveCode},'%') AND t1.curve_code like concat('%',#{dto.curveCode},'%')
...@@ -26,6 +27,7 @@ ...@@ -26,6 +27,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t3.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
FROM t_da_fastener_management t1 FROM t_da_fastener_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id 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 LEFT JOIN t_da_track_bed_management t3 ON t1.track_bed_id = t3.id
LEFT JOIN t_sn_light_rail t4 ON t2.light_rail_id = t4.id
<where> <where>
<if test="dto.fastenerCode != null and dto.fastenerCode != ''"> <if test="dto.fastenerCode != null and dto.fastenerCode != ''">
AND t1.fastener_code like concat('%',#{dto.fastenerCode},'%') AND t1.fastener_code like concat('%',#{dto.fastenerCode},'%')
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t4.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
FROM FROM
t_da_rail_management t1 t_da_rail_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_sn_light_rail t3 ON t2.light_rail_id = t3.id
<where> <where>
<if test="dto.railCode != null and dto.railCode != ''"> <if test="dto.railCode != null and dto.railCode != ''">
AND t1.rail_code like concat('%',#{dto.railCode},'%') AND t1.rail_code like concat('%',#{dto.railCode},'%')
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t3.status = 1
</where> </where>
</select> </select>
<select id="getLineSpecialRail" resultType="java.util.Map"> <select id="getLineSpecialRail" resultType="java.util.Map">
......
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
<select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.SignBoardManagementVO"> <select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.SignBoardManagementVO">
SELECT SELECT
t1.*, t1.*,
t2.light_rail_name, t2.light_rail_name,
t2.light_rail_id, t2.light_rail_id,
t2.section_name, t2.section_name,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name ( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name
FROM FROM
t_da_sign_board_management t1 t_da_sign_board_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_sn_light_rail t3 ON t2.light_rail_id = t3.id
<where> <where>
<if test="dto.signBoardCode != null and dto.signBoardCode != ''"> <if test="dto.signBoardCode != null and dto.signBoardCode != ''">
AND t1.sign_board_code like concat('%',#{dto.signBoardCode},'%') AND t1.sign_board_code like concat('%',#{dto.signBoardCode},'%')
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t3.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
FROM t_da_sleeper_management t1 FROM t_da_sleeper_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id 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 LEFT JOIN t_da_track_bed_management t3 ON t1.track_bed_id = t3.id
LEFT JOIN t_sn_light_rail t4 ON t2.light_rail_id = t4.id
<where> <where>
<if test="dto.sleeperCode != null and dto.sleeperCode != ''"> <if test="dto.sleeperCode != null and dto.sleeperCode != ''">
AND t1.sleeper_code like concat('%',#{dto.sleeperCode},'%') AND t1.sleeper_code like concat('%',#{dto.sleeperCode},'%')
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t4.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
FROM FROM
t_da_switch_management t1 LEFT JOIN t_sn_section_station_map t2 ON t1.section_station_map_id = t2.id t_da_switch_management t1 LEFT JOIN t_sn_section_station_map t2 ON t1.section_station_map_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t1.line_alias_id = t3.id LEFT JOIN t_sn_line_alias t3 ON t1.line_alias_id = t3.id
LEFT JOIN t_sn_light_rail t4 ON t2.light_rail_id = t4.id
<where> <where>
<if test="dto.switchCode != null and dto.switchCode != ''"> <if test="dto.switchCode != null and dto.switchCode != ''">
AND t1.switch_code like concat('%',#{dto.switchCode},'%') AND t1.switch_code like concat('%',#{dto.switchCode},'%')
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t4.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -4,14 +4,15 @@ ...@@ -4,14 +4,15 @@
<select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.TrackBedManagementVO"> <select id="queryPageList" resultType="org.jeecg.modules.deviceAsset.vo.TrackBedManagementVO">
SELECT SELECT
t1.*, t1.*,
t2.light_rail_name, t2.light_rail_name,
t2.light_rail_id, t2.light_rail_id,
t2.section_name, t2.section_name,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name ( SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id LIMIT 1 ) line_alias_name
FROM FROM
t_da_track_bed_management t1 t_da_track_bed_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_sn_light_rail t3 ON t2.light_rail_id = t3.id
<where> <where>
<if test="dto.trackBedCode != null and dto.trackBedCode != ''"> <if test="dto.trackBedCode != null and dto.trackBedCode != ''">
AND t1.track_bed_code like concat('%',#{dto.trackBedCode},'%') AND t1.track_bed_code like concat('%',#{dto.trackBedCode},'%')
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t3.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
FROM FROM
t_da_vertical_curve_management t1 t_da_vertical_curve_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
LEFT JOIN t_sn_light_rail t3 ON t2.light_rail_id = t3.id
<where> <where>
<if test="dto.verticalCurveCode != null and dto.verticalCurveCode != ''"> <if test="dto.verticalCurveCode != null and dto.verticalCurveCode != ''">
AND t1.vertical_curve_code like concat('%',#{dto.verticalCurveCode},'%') AND t1.vertical_curve_code like concat('%',#{dto.verticalCurveCode},'%')
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
AND t3.status = 1
</where> </where>
</select> </select>
</mapper> </mapper>
package org.jeecg.modules.subwayNetwork.controller; package org.jeecg.modules.subwayNetwork.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.subwayNetwork.dto.LineAliasQueryDTO; import org.jeecg.modules.subwayNetwork.dto.LineAliasQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LineAlias; import org.jeecg.modules.subwayNetwork.entity.LineAlias;
import org.jeecg.modules.subwayNetwork.service.ILineAliasService; import org.jeecg.modules.subwayNetwork.service.ILineAliasService;
...@@ -46,16 +50,43 @@ public class LightAliasController extends JeecgController<LineAlias, ILineAliasS ...@@ -46,16 +50,43 @@ public class LightAliasController extends JeecgController<LineAlias, ILineAliasS
@ApiOperation(value = "线路车站-线别管理-编辑", notes = "线路车站-线别管理-编辑") @ApiOperation(value = "线路车站-线别管理-编辑", notes = "线路车站-线别管理-编辑")
@PostMapping(value = "/edit") @PostMapping(value = "/edit")
public Result<String> edit(@RequestBody LineAlias lineAlias) { public Result<String> edit(@RequestBody LineAlias lineAlias) {
lineAlias.setUpdateTime(new Date());
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
lineAlias.setUpdateBy(realname);
//获取当前用户 //获取当前用户
if (ObjectUtil.isEmpty(lineAlias.getId())) { if (ObjectUtil.isEmpty(lineAlias.getId())) {
List<LineAlias> list = this.getQueryList(lineAlias.getLineAliasName());
if(list != null && list.size() > 0 ){
return Result.error("线别名称已存在");
}
lineAliasService.save(lineAlias); lineAliasService.save(lineAlias);
} else { } else {
LambdaQueryWrapper<LineAlias> lambdaQuery = Wrappers.lambdaQuery();
lambdaQuery.ne(LineAlias::getId,lineAlias.getId());
lambdaQuery.eq(LineAlias::getLineAliasName,lineAlias.getLineAliasName());
List<LineAlias> list = this.service.list(lambdaQuery);
if(list != null && list.size() > 0 ){
return Result.error("线别名称已重复");
}
lineAliasService.updateById(lineAlias); lineAliasService.updateById(lineAlias);
} }
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
/**
* 查询线别
* @param name
* @return
*/
public List<LineAlias> getQueryList(String name){
LambdaQueryWrapper<LineAlias> lambdaQuery = Wrappers.lambdaQuery();
lambdaQuery.eq(LineAlias::getLineAliasName,name);
List<LineAlias> list = this.service.list(lambdaQuery);
return list;
}
/** /**
* 通过id删除 * 通过id删除
* *
......
...@@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -5,6 +5,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.dto.PageSearch; import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
...@@ -118,7 +120,9 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe ...@@ -118,7 +120,9 @@ public class LightRailController extends JeecgController<LightRail, ILightRailSe
@ApiOperation(value = "线路车站-轻轨线路-获取全部线路", notes = "线路车站-轻轨线路-获取全部线路") @ApiOperation(value = "线路车站-轻轨线路-获取全部线路", notes = "线路车站-轻轨线路-获取全部线路")
@GetMapping(value = "/listAll") @GetMapping(value = "/listAll")
public Result<List<Map<String, Object>>> listAll() { public Result<List<Map<String, Object>>> listAll() {
List<LightRail> pageList = this.service.list(); LambdaQueryWrapper<LightRail> lambdaQuery = Wrappers.lambdaQuery();
lambdaQuery.eq(LightRail::getStatus,1);
List<LightRail> pageList =this.service.list(lambdaQuery);
List<Map<String, Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
for (LightRail lightRail : pageList) { for (LightRail lightRail : pageList) {
......
...@@ -29,17 +29,21 @@ ...@@ -29,17 +29,21 @@
</select> </select>
<select id="getSectionStation" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationMapVO"> <select id="getSectionStation" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationMapVO">
SELECT SELECT
id, m.id,
light_rail_id, m.light_rail_id,
light_rail_name, m.light_rail_name,
section_name, m.section_name,
section_id, m.section_id,
station_id, m.station_id,
station_name, m.station_name,
station_line_alias_id line_alias_id, m.station_line_alias_id line_alias_id,
( SELECT line_alias_name FROM t_sn_line_alias WHERE id = station_line_alias_id LIMIT 1 ) line_alias_name ( SELECT line_alias_name FROM t_sn_line_alias WHERE id = m.station_line_alias_id LIMIT 1 ) line_alias_name
FROM FROM
t_sn_section_station_map t_sn_section_station_map m left join t_sn_light_rail t on m.light_rail_id = t.id
<where>
1=1
AND t.status = 1
</where>
</select> </select>
<select id="getTreeLightRailList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode"> <select id="getTreeLightRailList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
...@@ -55,6 +59,10 @@ ...@@ -55,6 +59,10 @@
true isLeaf true isLeaf
FROM FROM
t_sn_light_rail t_sn_light_rail
<where>
1=1
AND status = 1
</where>
<!-- UNION ALL <!-- UNION ALL
SELECT SELECT
concat(id,'-2') id, concat(id,'-2') id,
......
...@@ -4,45 +4,51 @@ ...@@ -4,45 +4,51 @@
<select id="queryPageList" resultType="org.jeecg.modules.subwayNetwork.vo.SubwaySectionVO"> <select id="queryPageList" resultType="org.jeecg.modules.subwayNetwork.vo.SubwaySectionVO">
SELECT SELECT
t1.id, t1.id,
t1.create_by, t1.create_by,
t1.create_time, t1.create_time,
t1.section_name, t1.update_by,
t2.rail_line_name light_rail_name, t1.update_time,
t1.light_rail_id, t1.section_name,
t1.start_train_station_id, t2.rail_line_name light_rail_name,
t1.end_train_station_id, t1.light_rail_id,
t1.line_alias_id, t1.start_train_station_id,
(SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id limit 1) line_alias_name, t1.end_train_station_id,
(SELECT count(1) FROM t_sn_section_station_map WHERE section_id = t1.id ) trainStationNum, t1.line_alias_id,
t1.section_starting_mileage, (SELECT line_alias_name FROM t_sn_line_alias WHERE id = t1.line_alias_id limit 1) line_alias_name,
t1.section_end_mileage, (SELECT count(1) FROM t_sn_section_station_map WHERE section_id = t1.id ) trainStationNum,
t1.section_end_mileage -t1.section_starting_mileage sectionMileage, t1.section_starting_mileage,
t1.remark t1.section_end_mileage,
t1.section_end_mileage -t1.section_starting_mileage sectionMileage,
t1.remark
FROM FROM
t_sn_subway_section t1 LEFT JOIN t_sn_light_rail t2 ON t1.light_rail_id = t2.id t_sn_subway_section t1 LEFT JOIN t_sn_light_rail t2 ON t1.light_rail_id = t2.id
<where> <where>
1=1
<if test="query.sectionName != null and query.sectionName != ''"> <if test="query.sectionName != null and query.sectionName != ''">
AND t1.section_name like concat('%',#{query.sectionName},'%') AND t1.section_name like concat('%',#{query.sectionName},'%')
</if> </if>
<if test="query.lineAliasId !=null and query.lineAliasId!=''"> <if test="query.lineAliasId !=null and query.lineAliasId!=''">
AND t1.line_alias_id = #{query.lineAliasId} AND t1.line_alias_id = #{query.lineAliasId}
</if> </if>
AND t2.status = 1
</where> </where>
</select> </select>
<select id="getTreeSubwaySectionList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode"> <select id="getTreeSubwaySectionList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
SELECT SELECT t.id,
id, t.section_name label,
section_name label, '2' level,
'2' level, t.light_rail_id parent,
light_rail_id parent, t.line_alias_id,
line_alias_id, t.light_rail_id,
light_rail_id, t.section_starting_mileage startMileage,
section_starting_mileage startMileage, TRUNCATE((t.section_end_mileage + t.section_starting_mileage) / 2, 3) centerMileage,
TRUNCATE ( (section_end_mileage+section_starting_mileage) / 2, 3 ) centerMileage, t.section_end_mileage endMileage,
section_end_mileage endMileage, true isLeaf
true isLeaf FROM t_sn_subway_section t left join t_sn_light_rail t2 ON t.light_rail_id = t2.id
FROM <where>
t_sn_subway_section 1=1
AND t2.status = 1
</where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<if test="query.lineAliasId !=null and query.lineAliasId!=''"> <if test="query.lineAliasId !=null and query.lineAliasId!=''">
AND t1.line_alias_id = #{query.lineAliasId} AND t1.line_alias_id = #{query.lineAliasId}
</if> </if>
AND t2.status = 1
</where> </where>
</select> </select>
<select id="getTreeTrainStationList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode"> <select id="getTreeTrainStationList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
...@@ -44,5 +45,10 @@ ...@@ -44,5 +45,10 @@
true isLeaf true isLeaf
FROM FROM
t_sn_train_station t1 LEFT JOIN t_sn_section_station_map t2 ON t1.id = t2.station_id t_sn_train_station t1 LEFT JOIN t_sn_section_station_map t2 ON t1.id = t2.station_id
LEFT JOIN t_sn_light_rail t3 on t1.light_rail_id = t3.id and t2.light_rail_id = t3.id
<where>
1=1
AND t3.status = 1
</where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.dto.PageSearch; import org.jeecg.common.api.dto.PageSearch;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO; import org.jeecg.modules.subwayNetwork.dto.SubwaySectionEditDTO;
import org.jeecg.modules.subwayNetwork.dto.SubwaySectionQueryDTO; import org.jeecg.modules.subwayNetwork.dto.SubwaySectionQueryDTO;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
...@@ -25,6 +27,7 @@ import org.springframework.stereotype.Service; ...@@ -25,6 +27,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -59,6 +62,11 @@ public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, S ...@@ -59,6 +62,11 @@ public class SubwaySectionServiceImpl extends ServiceImpl<SubwaySectionMapper, S
subwaySection.setLightRailName(rail.getRailLineName());// 线路昵称 subwaySection.setLightRailName(rail.getRailLineName());// 线路昵称
subwaySection.setSectionStartingMileage(startTrainStation.getCenterMileage()); // 区间起始里程 subwaySection.setSectionStartingMileage(startTrainStation.getCenterMileage()); // 区间起始里程
subwaySection.setSectionEndMileage(endTrainStation.getCenterMileage());// 区间结束里程 subwaySection.setSectionEndMileage(endTrainStation.getCenterMileage());// 区间结束里程
//维护区间的更新人和更新时间
subwaySection.setUpdateTime(new Date());
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
subwaySection.setUpdateBy(realname);
if (ObjectUtil.isEmpty(dto.getId())) { if (ObjectUtil.isEmpty(dto.getId())) {
this.save(subwaySection); this.save(subwaySection);
} else { } else {
......
package org.jeecg.modules.system.controller; package org.jeecg.modules.system.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -151,7 +152,27 @@ public class SysUserController { ...@@ -151,7 +152,27 @@ public class SysUserController {
public Result<IPage<SysUser>> queryAllPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, public Result<IPage<SysUser>> queryAllPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
//用户账号
String username = req.getParameter("username");
if(ObjectUtil.isNotEmpty(username)){
queryWrapper.like("username",username);
}
//用户姓名
String realname = req.getParameter("realname");
if(ObjectUtil.isNotEmpty(realname)){
queryWrapper.like("realname",realname);
}
//性别
String sex = req.getParameter("sex");
if(ObjectUtil.isNotEmpty(sex)){
queryWrapper.eq("sex",sex);
}
//手机号码
String phone = req.getParameter("phone");
if(ObjectUtil.isNotEmpty(phone)){
queryWrapper.like("phone",phone);
}
return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo); return sysUserService.queryPageList(req, queryWrapper, pageSize, pageNo);
} }
......
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