Commit ca71a35a authored by hkl's avatar hkl

feat: 1.用户删除后再次新增,登录后报错 2.人工静态检查数据,新增批次时,起始里程、钢轨/曲线/竖曲线/道岔数量均为0

parent 5048ed09
package org.jeecg.modules.checkData.equipmentCheckData.controller; package org.jeecg.modules.checkData.equipmentCheckData.controller;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
...@@ -23,6 +24,7 @@ import org.jeecg.modules.checkData.equipmentCheckData.dto.MovementRecordsMasterD ...@@ -23,6 +24,7 @@ import org.jeecg.modules.checkData.equipmentCheckData.dto.MovementRecordsMasterD
import org.jeecg.modules.checkData.equipmentCheckData.entity.*; import org.jeecg.modules.checkData.equipmentCheckData.entity.*;
import org.jeecg.modules.checkData.equipmentCheckData.service.*; import org.jeecg.modules.checkData.equipmentCheckData.service.*;
import org.jeecg.modules.checkData.equipmentCheckData.vo.*; import org.jeecg.modules.checkData.equipmentCheckData.vo.*;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisAlgorithmMapper;
import org.jeecg.modules.subwayNetwork.entity.LightRail; import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.entity.LineAlias; import org.jeecg.modules.subwayNetwork.entity.LineAlias;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection; import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
...@@ -35,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -35,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -55,35 +58,38 @@ import java.util.stream.Collectors; ...@@ -55,35 +58,38 @@ import java.util.stream.Collectors;
@RequestMapping("/movement/master") @RequestMapping("/movement/master")
@Api(tags = "动静态几何尺寸数据") @Api(tags = "动静态几何尺寸数据")
public class MovementRecordsMasterController extends JeecgController<MovementRecordsMaster, IMovementRecordsMasterService> { public class MovementRecordsMasterController extends JeecgController<MovementRecordsMaster, IMovementRecordsMasterService> {
@Autowired @Resource
private IMovementCourseService movementCourseService; private IMovementCourseService movementCourseService;
@Autowired @Resource
private IMovementCourseInfoService movementCourseInfoService; private IMovementCourseInfoService movementCourseInfoService;
@Autowired @Resource
private ISubwaySectionService subwaySectionService; private ISubwaySectionService subwaySectionService;
@Autowired @Resource
private ILineAliasService lineAliasService; private ILineAliasService lineAliasService;
@Autowired @Resource
private IMovementAdditiveInfoService movementAdditiveInfoService; private IMovementAdditiveInfoService movementAdditiveInfoService;
@Autowired @Resource
private ILightRailService lightRailService; private ILightRailService lightRailService;
@Autowired @Resource
private IMovementDiferenceManagerService movementDiferenceManagerService; private IMovementDiferenceManagerService movementDiferenceManagerService;
@Autowired @Resource
private IMovementOverReportService movementOverReportService; private IMovementOverReportService movementOverReportService;
@Autowired @Resource
private IMovementSectionReportService movementSectionReportService; private IMovementSectionReportService movementSectionReportService;
@Autowired @Resource
private IMovementSummaryReportService movementSummaryReportService; private IMovementSummaryReportService movementSummaryReportService;
@Autowired @Resource
private IMovementTqiKilometerReportService movementTqiKilometerReportService; private IMovementTqiKilometerReportService movementTqiKilometerReportService;
@Autowired @Resource
private IMovementTqiKilometerStandardManagerService movementTqiKilometerStandardManagerService; private IMovementTqiKilometerStandardManagerService movementTqiKilometerStandardManagerService;
@Autowired @Resource
private IMovementTqiReportService movementTqiReportService; private IMovementTqiReportService movementTqiReportService;
@Autowired @Resource
private IMovementTqiStandardManagerService movementTqiStandardManagerService; private IMovementTqiStandardManagerService movementTqiStandardManagerService;
@Resource
private AnalysisAlgorithmMapper analysisAlgorithmMapper;
//**********************************人工静态检查****************************** //**********************************人工静态检查******************************
...@@ -121,15 +127,22 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -121,15 +127,22 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "动静态几何新增时初始化回显数据") @AutoLog(value = "动静态几何新增时初始化回显数据")
@ApiOperation(value = "动静态几何新增时初始化回显数据", notes = "动静态几何新增时初始化回显数据") @ApiOperation(value = "动静态几何新增时初始化回显数据", notes = "动静态几何新增时初始化回显数据")
@GetMapping(value = "/getMovementAdditiveQuery") @GetMapping(value = "/getMovementAdditiveQuery")
public Result<MovementAdditiveSavaQueryVO> getMovementAdditiveQuery(@ApiParam(name = "线路id", required = true) String lightRailId, @ApiParam(name = "线别id", required = true) String lineAliasId, @ApiParam(name = "区间id", required = false) String sectionId, @ApiParam(name = "查询类型", required = true) String type) { public Result<MovementAdditiveSavaQueryVO> getMovementAdditiveQuery(@ApiParam(name = "lightRailId", required = true) String lightRailId,
@ApiParam(name = "lineAliasId", required = true) String lineAliasId,
@ApiParam(name = "区间id", required = false) String sectionId,
@ApiParam(name = "查询类型", required = true) String type) {
// 1.查询线路,线别,区间对象
LightRail lightRail = lightRailService.getById(lightRailId);
LineAlias lineAlias = lineAliasService.getById(lineAliasId);
SubwaySection subwaySection = subwaySectionService.getById(sectionId);
// 2.构建返回数据
MovementAdditiveSavaQueryVO result = new MovementAdditiveSavaQueryVO(); MovementAdditiveSavaQueryVO result = new MovementAdditiveSavaQueryVO();
result.setLightRailId(lightRailId); result.setLightRailId(lightRailId);
result.setLineAliasId(lineAliasId); result.setLineAliasId(lineAliasId);
//查询线路对象
LightRail lightRail = lightRailService.getById(lightRailId);
result.setLightRailName(lightRail.getRailLineName()); result.setLightRailName(lightRail.getRailLineName());
//查询线别对象
LineAlias lineAlias = lineAliasService.getById(lineAliasId);
result.setLineAliasName(lineAlias.getLineAliasName()); result.setLineAliasName(lineAlias.getLineAliasName());
if ("4".equals(type)) { if ("4".equals(type)) {
result.setStartingMileage(BigDecimal.ZERO); result.setStartingMileage(BigDecimal.ZERO);
...@@ -139,23 +152,46 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -139,23 +152,46 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
if ("下行线".equals(lineAlias.getLineAliasName())) { if ("下行线".equals(lineAlias.getLineAliasName())) {
result.setEndMileage(lightRail.getDownLineMileage()); result.setEndMileage(lightRail.getDownLineMileage());
} }
} else {
SubwaySection subwaySection = subwaySectionService.getById(sectionId);
result.setEndMileage(subwaySection.getSectionStartingMileage());
result.setEndMileage(subwaySection.getSectionEndMileage());
} }
if (ObjectUtil.isNotEmpty(sectionId)) { if (ObjectUtil.isNotEmpty(sectionId)) {
result.setSubwaySectionId(sectionId); result.setSubwaySectionId(sectionId);
result.setSubwaySectionName(subwaySectionService.getById(sectionId).getSectionName()); result.setSubwaySectionName(subwaySection.getSectionName());
result.setStartingMileage(subwaySection.getSectionStartingMileage());
result.setEndMileage(subwaySection.getSectionEndMileage());
}
// 3.按公里数正序排序所有1-钢轨,2-曲线,3-竖曲线,4-道岔
List<Map<String, Object>> unitDeviceList = analysisAlgorithmMapper.getUnitDevice(lightRailId, lineAliasId, result.getStartingMileage(), result.getEndMileage());
int railNum = 0;
int curveNum = 0;
int verticalCurveNum = 0;
int switchNum = 0;
for (Map<String, Object> unitDevice : unitDeviceList) {
Integer unitDeviceType = Convert.toInt(unitDevice.get("type"));
switch (unitDeviceType) {
case 1:
railNum++;
break;
case 2:
curveNum++;
break;
case 3:
verticalCurveNum++;
break;
case 4:
switchNum++;
break;
}
} }
//钢轨单元数量
result.setRailNum(this.service.getRailNums(sectionId, lightRailId, lineAliasId, result.getStartingMileage(), result.getEndMileage()));
//曲线数量 result.setRailNum(railNum);
result.setCurveNum(this.service.getCurveNums(sectionId, lightRailId, lineAliasId, result.getStartingMileage(), result.getEndMileage())); result.setCurveNum(curveNum);
//竖曲线数量 result.setVerticalCurveNum(verticalCurveNum);
result.setVerticalCurveNum(this.service.getVerticalCurveNum(sectionId, lightRailId, lineAliasId, result.getStartingMileage(), result.getEndMileage())); result.setSwitchNum(switchNum);
//道岔数量
result.setSwitchNum(this.service.getSwitchNum(sectionId, lightRailId, lineAliasId, result.getStartingMileage(), result.getEndMileage()));
return Result.ok(result); return Result.ok(result);
} }
......
...@@ -28,51 +28,6 @@ public interface MovementRecordsMasterMapper extends BaseMapper<MovementRecordsM ...@@ -28,51 +28,6 @@ public interface MovementRecordsMasterMapper extends BaseMapper<MovementRecordsM
*/ */
Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto); Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto);
/**
* 统计钢轨单元数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getRailNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计曲线数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getCurveNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计竖曲线数量
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getVerticalCurveNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计道岔数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getSwitchNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/** /**
* 查询添乘仪详情 * 查询添乘仪详情
* *
......
...@@ -32,98 +32,6 @@ ...@@ -32,98 +32,6 @@
order by t1.create_time desc order by t1.create_time desc
</where> </where>
</select> </select>
<!-- 统计钢轨单元数量 -->
<select id="getRailNums" resultType="java.lang.Integer">
SELECT DISTINCT
count( t4.id )
FROM
t_sn_subway_section t
LEFT JOIN t_sn_light_rail t2 ON t.light_rail_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t.line_alias_id = t3.id
LEFT JOIN t_da_curve_management t4 ON t4.section_id = t.id
AND t4.line_alias_id = t3.id
AND t4.line_alias_id = t.line_alias_id
<where>
1 = 1
AND t2.id = #{lightRailId}
AND t3.id = #{lineAliasId}
AND t4.curve_mileage_zh &gt;= #{startingMileage}
AND t4.curve_mileage_hz &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId}
</if>
</where>
</select>
<!-- 统计曲线数量 -->
<select id="getCurveNums" resultType="java.lang.Integer">
SELECT DISTINCT
count( t4.id )
FROM
t_sn_subway_section t
LEFT JOIN t_sn_light_rail t2 ON t.light_rail_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t.line_alias_id = t3.id
LEFT JOIN t_da_rail_management t4 ON t.id = t4.section_id
AND t3.id = t4.line_alias_id
AND t.line_alias_id = t4.line_alias_id
<where>
1 = 1
AND t2.id = #{lightRailId}
AND t3.id = #{lineAliasId}
AND t4.starting_mileage &gt;= #{startingMileage}
AND t4.end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId}
</if>
</where>
</select>
<!-- 统计竖曲线数量 -->
<select id="getVerticalCurveNum" resultType="java.lang.Integer">
SELECT DISTINCT
count( t4.id )
FROM
t_sn_subway_section t
LEFT JOIN t_sn_light_rail t2 ON t.light_rail_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t.line_alias_id = t3.id
LEFT JOIN t_da_vertical_curve_management t4 ON t.id = t4.section_id
AND t3.id = t4.line_alias_id
AND t.line_alias_id = t4.line_alias_id
<where>
1 = 1
AND t2.id = #{lightRailId}
AND t3.id = #{lineAliasId}
AND t4.starting_mileage &gt;= #{startingMileage}
AND t4.end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId}
</if>
</where>
</select>
<!-- 统计道岔数量 -->
<select id="getSwitchNum" resultType="java.lang.Integer">
SELECT DISTINCT
count( t4.id )
FROM
t_sn_subway_section t
LEFT JOIN t_sn_light_rail t2 ON t.light_rail_id = t2.id
LEFT JOIN t_sn_line_alias t3 ON t.line_alias_id = t3.id
LEFT JOIN t_da_switch_management t4 ON t.id = t4.section_station_map_id
AND t3.id = t4.line_alias_id
AND t.line_alias_id = t4.line_alias_id
<where>
1 = 1
AND t2.id = #{lightRailId}
AND t3.id = #{lineAliasId}
AND t4.byroad_pre_mileage &gt;= #{startingMileage}
AND t4.byroad_end_mileage &lt;= #{endMileage}
AND t2.status = 1
<if test="sectionId != null and sectionId != ''">
AND t.id = #{sectionId}
</if>
</where>
</select>
<!--查询添乘仪详情--> <!--查询添乘仪详情-->
<select id="queryPageAdditiveInfoList" <select id="queryPageAdditiveInfoList"
resultType="org.jeecg.modules.checkData.equipmentCheckData.vo.MovementAdditiveInfoVO"> resultType="org.jeecg.modules.checkData.equipmentCheckData.vo.MovementAdditiveInfoVO">
......
...@@ -28,50 +28,6 @@ public interface IMovementRecordsMasterService extends IService<MovementRecordsM ...@@ -28,50 +28,6 @@ public interface IMovementRecordsMasterService extends IService<MovementRecordsM
*/ */
Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto); Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto);
/**
* 统计钢轨单元数量
*
* @param lightRailId
* @param lineAliasId
* @param startingMileage
* @param endMileage
* @return
*/
Integer getRailNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计曲线数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getCurveNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计竖曲线数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getVerticalCurveNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/**
* 统计道岔数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
Integer getSwitchNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage);
/** /**
* 查询添乘仪详情 * 查询添乘仪详情
* *
......
...@@ -25,67 +25,16 @@ import java.math.BigDecimal; ...@@ -25,67 +25,16 @@ import java.math.BigDecimal;
public class MovementRecordsMasterServiceImpl extends ServiceImpl<MovementRecordsMasterMapper, MovementRecordsMaster> implements IMovementRecordsMasterService { public class MovementRecordsMasterServiceImpl extends ServiceImpl<MovementRecordsMasterMapper, MovementRecordsMaster> implements IMovementRecordsMasterService {
/** /**
* 动静态几何尺寸列表-分页列表查询 * 动静态几何尺寸列表-分页列表查询
*
* @param pageData * @param pageData
* @param dto * @param dto
* @return * @return
*/ */
@Override @Override
public Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto) { public Page<MovementRecordsMasterVO> queryPageList(Page<MovementRecordsMasterVO> pageData, MovementRecordsMasterDTO dto) {
return this.baseMapper.queryPageList(pageData,dto); return this.baseMapper.queryPageList(pageData, dto);
} }
/**
* 统计钢轨单元数量
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
@Override
public Integer getRailNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage) {
return this.baseMapper.getRailNums(sectionId, lightRailId,lineAliasId,startingMileage,endMileage);
}
/**
* 统计曲线数量
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
@Override
public Integer getCurveNums(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage) {
return this.baseMapper.getCurveNums(sectionId, lightRailId,lineAliasId,startingMileage,endMileage);
}
/**
* 统计竖曲线数量
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
@Override
public Integer getVerticalCurveNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage) {
return this.baseMapper.getVerticalCurveNum(sectionId, lightRailId,lineAliasId,startingMileage,endMileage);
}
/**
* 统计道岔数量
*
* @param sectionId 区间id
* @param lightRailId 线路id
* @param lineAliasId 线别id
* @param startingMileage 开始里程
* @param endMileage 结束里程
* @return
*/
@Override
public Integer getSwitchNum(String sectionId, String lightRailId, String lineAliasId, BigDecimal startingMileage, BigDecimal endMileage) {
return this.baseMapper.getSwitchNum(sectionId, lightRailId,lineAliasId,startingMileage,endMileage);
}
/** /**
* 查询添乘仪详情 * 查询添乘仪详情
* *
...@@ -95,6 +44,6 @@ public class MovementRecordsMasterServiceImpl extends ServiceImpl<MovementRecord ...@@ -95,6 +44,6 @@ public class MovementRecordsMasterServiceImpl extends ServiceImpl<MovementRecord
*/ */
@Override @Override
public Page<MovementAdditiveInfoVO> queryPageAdditiveInfoList(Page<MovementAdditiveInfoVO> pageData, MovementAdditiveInfoDTO dto) { public Page<MovementAdditiveInfoVO> queryPageAdditiveInfoList(Page<MovementAdditiveInfoVO> pageData, MovementAdditiveInfoDTO dto) {
return this.baseMapper.queryPageAdditiveInfoList(pageData,dto); return this.baseMapper.queryPageAdditiveInfoList(pageData, dto);
} }
} }
...@@ -21,7 +21,7 @@ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { ...@@ -21,7 +21,7 @@ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> {
* @param username 用户账号名称 * @param username 用户账号名称
* @return List<String> * @return List<String>
*/ */
@Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username}))") @Select("select role_code from sys_role where id in (select role_id from sys_user_role where user_id = (select id from sys_user where username=#{username} AND del_flag = '0' ORDER BY create_time desc limit 1))")
List<String> getRoleByUserName(@Param("username") String username); List<String> getRoleByUserName(@Param("username") String username);
/** /**
......
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