Commit 6aba953e authored by hkl's avatar hkl

feat:1.bug修复

parent 61c13642
......@@ -93,6 +93,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码
filterChainDefinitionMap.put("/sys/common/static/**", "anon");//图片预览 &下载文件不限制token
filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
filterChainDefinitionMap.put("/sys/common/excelTemplate/**", "anon");//excel模板
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
......@@ -114,6 +115,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/**/*.ttf", "anon");
filterChainDefinitionMap.put("/**/*.woff", "anon");
filterChainDefinitionMap.put("/**/*.woff2", "anon");
filterChainDefinitionMap.put("/**/*.xlsx", "anon");
filterChainDefinitionMap.put("/druid/**", "anon");
filterChainDefinitionMap.put("/swagger-ui.html", "anon");
......@@ -123,15 +125,10 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/annountCement/show/**", "anon");
//积木报表排除
filterChainDefinitionMap.put("/test/**", "anon");
//websocket排除
filterChainDefinitionMap.put("/websocket/**", "anon");//系统通知和公告
filterChainDefinitionMap.put("/newsWebsocket/**", "anon");//CMS模块
filterChainDefinitionMap.put("/vxeSocket/**", "anon");//JVxeTable无痕刷新示例
// update-begin--author:liusq Date:20230522 for:[issues/4829]访问不存在的url时会提示Token失效,请重新登录呢
//错误路径排除
......
......@@ -65,10 +65,6 @@
<properties>
<package.environment>dev</package.environment>
</properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 黄康林本地配置-->
......@@ -79,12 +75,16 @@
</properties>
</profile>
<!-- 测试环境-->
<!-- 测试环境 -->
<profile>
<id>test</id>
<properties>
<package.environment>test</package.environment>
</properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 压测环境-->
......
......@@ -554,6 +554,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return Result.ok("操作成功");
......
......@@ -260,7 +260,19 @@ public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInsp
@Override
public void updateRecord(RailInspectionEquipmentItem record) {
this.updateById(record);
this.lambdaUpdate()
.set(RailInspectionEquipmentItem::getRemark, record.getRemark())
.set(RailInspectionEquipmentItem::getCourseStartingMileage, record.getCourseStartingMileage())
.set(RailInspectionEquipmentItem::getCourseEndMileage, record.getCourseEndMileage())
.set(RailInspectionEquipmentItem::getCurveRadius, record.getCurveRadius())
.set(RailInspectionEquipmentItem::getLongExtent, record.getLongExtent())
.set(RailInspectionEquipmentItem::getSlopeRatio, record.getSlopeRatio())
.set(RailInspectionEquipmentItem::getSuperHigh, record.getSuperHigh())
.set(RailInspectionEquipmentItem::getWiden, record.getWiden())
.eq(RailInspectionEquipmentItem::getId, record.getId())
.update();
// this.updateById(record);
}
@Override
......
......@@ -5,9 +5,11 @@ 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.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.deviceAsset.dto.CurveManagementDTO;
import org.jeecg.modules.deviceAsset.entity.CurveManagement;
import org.jeecg.modules.deviceAsset.service.ICurveManagementService;
......@@ -79,4 +81,18 @@ public class CurveManagementController extends JeecgController<CurveManagement,
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-曲线管理-校验曲线编码重复")
@ApiOperation(value = "资产管理-曲线管理-校验曲线编码重复", notes = "资产管理-曲线管理-校验曲线编码重复")
@GetMapping(value = "/checkCurveCodeRepeat")
public Result<String> checkCurveCodeRepeat(String id, String lightRailId, String curveCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkCurveCodeRepeat(id, lightRailId, curveCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -8,6 +8,7 @@ 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.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.deviceAsset.dto.FastenerManagementDTO;
......@@ -83,4 +84,19 @@ public class FastenerManagementController extends JeecgController<FastenerManage
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-扣件管理-校验扣件管理编码重复")
@ApiOperation(value = "资产管理-扣件管理-校验扣件管理编码重复", notes = "资产管理-扣件管理-校验扣件管理编码重复")
@GetMapping(value = "/checkFastenerCodeRepeat")
public Result<String> checkFastenerCodeRepeat(String id, String lightRailId, String fastenerCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkFastenerCodeRepeat(id, lightRailId, fastenerCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
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;
......@@ -9,6 +10,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement;
......@@ -17,6 +19,9 @@ import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* <p>
......@@ -70,15 +75,60 @@ public class RailManagementController extends JeecgController<RailManagement, IR
}
// @AutoLog(value = "资产管理-钢轨管理-智能生成")
// @ApiOperation(value = "资产管理-钢轨管理-智能生成", notes = "资产管理-钢轨管理-智能生成")
// @GetMapping(value = "/intelligentGeneration")
// @ApiImplicitParams({
// @ApiImplicitParam(name = "lightRailId", value = "线路id")
// })
// public Result<String> intelligentGeneration(String lightRailId) {
// this.service.intelligentGeneration(lightRailId);
// return Result.OK("生成成功");
// }
@AutoLog(value = "资产管理-钢轨管理-智能生成")
@ApiOperation(value = "资产管理-钢轨管理-智能生成", notes = "资产管理-钢轨管理-智能生成")
@GetMapping(value = "/intelligentGeneration")
@ApiImplicitParams({
@ApiImplicitParam(name = "lightRailId", value = "线路id")
@ApiImplicitParam(name = "lightRailId", value = "线路id"),
@ApiImplicitParam(name = "lineAliasId", value = "线别id")
})
public Result<String> intelligentGeneration(String lightRailId) {
this.service.intelligentGeneration(lightRailId);
public Result<String> intelligentGeneration(String lightRailId,String lineAliasId) {
// this.service.intelligentGeneration(lightRailId);
this.service.intelligentGeneration(lightRailId,lineAliasId);
return Result.OK("生成成功");
}
@AutoLog(value = "资产管理-钢轨管理-校验钢轨编码重复")
@ApiOperation(value = "资产管理-钢轨管理-校验钢轨编码重复", notes = "资产管理-钢轨管理-校验钢轨编码重复")
@GetMapping(value = "/checkRailCodeRepeat")
public Result<String> checkRailCodeRepeat(String id, String lightRailId, String railCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkRailCodeRepeat(id, lightRailId, railCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
@AutoLog(value = "资产管理-钢轨管理-获取新增时候参数")
@ApiOperation(value = "资产管理-钢轨管理-获取新增时候参数", notes = "资产管理-钢轨管理-获取新增时候参数")
@GetMapping(value = "/getAddParams")
@ApiImplicitParams({
@ApiImplicitParam(name = "lightRailId", value = "线路id"),
@ApiImplicitParam(name = "lineAliasId", value = "线别id"),
@ApiImplicitParam(name = "sectionId", value = "区间id"),
})
public Result<Map<String, Object>> getAddParams(String lightRailId, String lineAliasId, String sectionId) {
// 1.如果没有钢轨数据,返回区间里程
// 2.如果有钢轨有空隙就返回空隙
// 3.如果钢轨没有空隙返回区间里程
// 4.如果返回过长的里程
Map<String, Object> map = this.service.getAddParams(lightRailId,lineAliasId,sectionId);
return Result.OK(map);
}
}
......@@ -8,6 +8,7 @@ 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.common.exception.JeecgBootException;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.deviceAsset.dto.FastenerManagementDTO;
import org.jeecg.modules.deviceAsset.dto.SignBoardManagementDTO;
......@@ -87,4 +88,18 @@ public class SignBoardManagementController extends JeecgController<SignBoardMana
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-轨行区标识管理-校验轨行区标识牌编码重复")
@ApiOperation(value = "资产管理-轨行区标识管理-校验轨行区标识牌编码重复", notes = "资产管理-轨行区标识管理-校验轨行区标识牌编码重复")
@GetMapping(value = "/checkSignBoardCodeRepeat")
public Result<String> checkSignBoardCodeRepeat(String id, String lightRailId, String signBoardCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkSignBoardCodeRepeat(id, lightRailId, signBoardCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -8,6 +8,7 @@ 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.common.exception.JeecgBootException;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.deviceAsset.dto.SignBoardManagementDTO;
import org.jeecg.modules.deviceAsset.dto.SleeperManagementDTO;
......@@ -88,4 +89,18 @@ public class SleeperManagementController extends JeecgController<SleeperManageme
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-轨枕管理-校验轨枕牌编码重复")
@ApiOperation(value = "资产管理-轨枕管理-校验轨枕牌编码重复", notes = "资产管理-轨枕管理-校验轨枕牌编码重复")
@GetMapping(value = "/checkSleeperCodeRepeat")
public Result<String> checkSleeperCodeRepeat(String id, String lightRailId, String sleeperCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkSleeperCodeRepeat(id, lightRailId, sleeperCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.deviceAsset.dto.SwitchManagementQueryDTO;
import org.jeecg.modules.deviceAsset.entity.SwitchManagement;
......@@ -80,5 +81,18 @@ public class SwitchManagementController extends JeecgController<SwitchManagement
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-道岔管理-校验道岔编码重复")
@ApiOperation(value = "资产管理-道岔管理-校验道岔编码重复", notes = "资产管理-轨枕管理-校验道岔编码重复")
@GetMapping(value = "/checkSwitchCodeRepeat")
public Result<String> checkSwitchCodeRepeat(String id, String lightRailId, String switchCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkSwitchCodeRepeat(id, lightRailId, switchCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.deviceAsset.dto.TrackBedManagementDTO;
......@@ -100,4 +101,19 @@ public class TrackBedManagementController extends JeecgController<TrackBedManage
return Result.OK(listResult);
}
@AutoLog(value = "资产管理-道床管理-校验道床编码重复")
@ApiOperation(value = "资产管理-道床管理-校验道床编码重复", notes = "资产管理-道床管理-校验道床编码重复")
@GetMapping(value = "/checkTrackBedCodeRepeat")
public Result<String> checkTrackBedCodeRepeat(String id, String lightRailId, String trackBedCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkTrackBedCodeRepeat(id, lightRailId, trackBedCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -8,6 +8,7 @@ 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.common.exception.JeecgBootException;
import org.jeecg.modules.deviceAsset.dto.CurveManagementDTO;
import org.jeecg.modules.deviceAsset.dto.VerticalCurveManagementDTO;
import org.jeecg.modules.deviceAsset.entity.CurveManagement;
......@@ -81,4 +82,19 @@ public class VerticalCurveManagementController extends JeecgController<VerticalC
this.service.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@AutoLog(value = "资产管理-竖曲线管理-校验竖曲线编码重复")
@ApiOperation(value = "资产管理-竖曲线管理-校验竖曲线编码重复", notes = "资产管理-竖曲线管理-校验竖曲线编码重复")
@GetMapping(value = "/checkVerticalCurveCodeRepeat")
public Result<String> checkVerticalCurveCodeRepeat(String id, String lightRailId, String verticalCurveCode) {
Long count = 0L;
if (ObjectUtil.isNotEmpty(lightRailId)) {
count = this.service.checkVerticalCurveCodeRepeat(id, lightRailId, verticalCurveCode);
}
if (count > 0) {
throw JeecgBootException.error("");
}
return Result.OK("未重复");
}
}
......@@ -11,4 +11,6 @@ import org.jeecg.modules.deviceAsset.vo.CurveManagementQueryVO;
*/
public interface CurveManagementMapper extends BaseMapper<CurveManagement> {
Page<CurveManagementQueryVO> queryPageList(Page<CurveManagementQueryVO> pageData, CurveManagementDTO dto);
Long checkCurveCodeRepeat(String id, String lightRailId, String curveCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.FastenerManagementVO;
public interface FastenerManagementMapper extends BaseMapper<FastenerManagement> {
Page<FastenerManagementVO> queryPageList(Page<FastenerManagementVO> pageData, FastenerManagementDTO dto);
Long checkFastenerCodeRepeat(String id, String lightRailId, String fastenerCode);
}
......@@ -22,4 +22,6 @@ public interface RailManagementMapper extends BaseMapper<RailManagement> {
Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto);
List<Map<String, Object>> getLineSpecialRail(String lightRailId, String lineAliasId);
Long checkRailCodeRepeat(String id, String lightRailId, String railCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.SignBoardManagementVO;
public interface SignBoardManagementMapper extends BaseMapper<SignBoardManagement> {
Page<SignBoardManagementVO> queryPageList(Page<SignBoardManagementVO> pageData, SignBoardManagementDTO dto);
Long checkSignBoardCodeRepeat(String id, String lightRailId, String signBoardCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.SleeperManagementVO;
public interface SleeperManagementMapper extends BaseMapper<SleeperManagement> {
Page<SleeperManagementVO> queryPageList(Page<SleeperManagementVO> pageData, SleeperManagementDTO dto);
Long checkSleeperCodeRepeat(String id, String lightRailId, String sleeperCode);
}
......@@ -12,4 +12,6 @@ import org.jeecg.modules.deviceAsset.vo.SwitchManagementQueryVO;
public interface SwitchManagementMapper extends BaseMapper<SwitchManagement> {
Page<SwitchManagementQueryVO> queryPageList(Page<SwitchManagementQueryVO> pageData, SwitchManagementQueryDTO dto);
Long checkSwitchCodeRepeat(String id, String lightRailId, String switchCode);
}
......@@ -21,4 +21,6 @@ public interface TrackBedManagementMapper extends BaseMapper<TrackBedManagement>
Page<TrackBedManagementVO> queryPageList(Page<TrackBedManagementVO> pageData, TrackBedManagementDTO dto);
List<TrackBedManagement> getTrackBedById(String id);
Long checkTrackBedCodeRepeat(String id, String lightRailId, String trackBedCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.VerticalCurveManagementVO;
public interface VerticalCurveManagementMapper extends BaseMapper<VerticalCurveManagement> {
Page<VerticalCurveManagementVO> queryPageList(Page<VerticalCurveManagementVO> pageData, VerticalCurveManagementDTO dto);
Long checkVerticalCurveCodeRepeat(String id, String lightRailId, String verticalCurveCode);
}
......@@ -29,4 +29,22 @@
</if>
order by t1.line_alias_id,t1.curve_mileage_zh
</select>
<select id="checkCurveCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_curve_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="curveCode != null and curveCode != ''">
AND t1.curve_code = #{curveCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -34,4 +34,21 @@
AND t4.status = 1
</where>
</select>
<select id="checkFastenerCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_fastener_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="fastenerCode != null and fastenerCode != ''">
AND t1.fastener_code = #{fastenerCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -28,6 +28,7 @@
</select>
<select id="getLineSpecialRail" resultType="java.util.Map">
SELECT id,
sectionId,
unitCode,
deviceCode,
startMileage,
......@@ -36,8 +37,8 @@
type,
typeName
FROM (
<!--
SELECT t1.id,
SELECT t1.id,
t1.section_id sectionId,
t1.unit_code unitCode,
t1.rail_code deviceCode,
t1.starting_mileage startMileage,
......@@ -50,8 +51,9 @@
AND t1.light_rail_id = #{lightRailId}
UNION ALL
-->
SELECT t1.id,
t1.section_id sectionId,
t1.unit_code unitCode,
t1.curve_code deviceCode,
t1.curve_mileage_zh startMileage,
......@@ -67,6 +69,7 @@
UNION ALL
SELECT t1.id,
t1.section_id sectionId,
t1.unit_code unitCode,
t1.vertical_curve_code deviceCode,
t1.starting_mileage startMileage,
......@@ -82,6 +85,7 @@
UNION ALL
SELECT t1.id,
t2.section_id sectionId,
t1.unit_code unitCode,
t1.switch_code deviceCode,
t1.byroad_pre_mileage startMileage,
......@@ -97,4 +101,21 @@
) t
ORDER BY t.startMileage
</select>
<select id="checkRailCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_rail_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="railCode != null and railCode != ''">
AND t1.rail_code = #{railCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -29,4 +29,21 @@
AND t3.status = 1
</where>
</select>
<select id="checkSignBoardCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_sign_board_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="signBoardCode != null and signBoardCode != ''">
AND t1.sign_board_code = #{signBoardCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -34,4 +34,21 @@
AND t4.status = 1
</where>
</select>
<select id="checkSleeperCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_sleeper_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="sleeperCode != null and sleeperCode != ''">
AND t1.sleeper_code = #{sleeperCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -37,4 +37,22 @@
AND t4.status = 1
</where>
</select>
<select id="checkSwitchCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_switch_management t1
LEFT JOIN t_sn_section_station_map t2 ON t1.section_station_map_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="switchCode != null and switchCode != ''">
AND t1.switch_code = #{switchCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -37,4 +37,21 @@
LEFT JOIN t_da_track_bed_management t2 ON t1.trak_bed_management_id = t2.id
WHERE t1.records_master_check_id = #{id}
</select>
<select id="checkTrackBedCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_track_bed_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="trackBedCode != null and trackBedCode != ''">
AND t1.track_bed_code = #{trackBedCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -29,4 +29,22 @@
AND t3.status = 1
</where>
</select>
<select id="checkVerticalCurveCodeRepeat" resultType="java.lang.Long">
SELECT
count(1)
FROM
t_da_vertical_curve_management t1
LEFT JOIN t_sn_subway_section t2 ON t1.section_id = t2.id
WHERE 1=1
<if test="id != null and id != ''">
AND t1.id != #{id}
</if>
<if test="verticalCurveCode != null and verticalCurveCode != ''">
AND t1.vertical_curve_code = #{verticalCurveCode}
</if>
<if test="lightRailId != null and lightRailId != ''">
AND t2.light_rail_id = #{lightRailId}
</if>
</select>
</mapper>
......@@ -14,4 +14,6 @@ public interface ICurveManagementService extends IService<CurveManagement> {
Page<CurveManagementQueryVO> queryPageList(Page<CurveManagementQueryVO> pageData, CurveManagementDTO dto);
void edit(CurveManagement curveManagement);
Long checkCurveCodeRepeat(String id, String lightRailId, String curveCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.FastenerManagementVO;
public interface IFastenerManagementService extends IService<FastenerManagement> {
Page<FastenerManagementVO> queryPageList(Page<FastenerManagementVO> pageData, FastenerManagementDTO dto);
Long checkFastenerCodeRepeat(String id, String lightRailId, String fastenerCode);
}
......@@ -25,10 +25,16 @@ public interface IRailManagementService extends IService<RailManagement> {
void intelligentGeneration(String lightRailId);
void intelligentGeneration(String lightRailId,String lineAliasId);
/**
* 获取线路的特殊钢轨
*
* @param lineAliasId 线别ID
*/
List<Map<String, Object>> getLineSpecialRail(String lightRailId, String lineAliasId);
Long checkRailCodeRepeat(String id, String lightRailId, String railCode);
Map<String, Object> getAddParams(String lightRailId, String lineAliasId, String sectionId);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.SignBoardManagementVO;
public interface ISignBoardManagementService extends IService<SignBoardManagement> {
Page<SignBoardManagementVO> queryPageList(Page<SignBoardManagementVO> pageData, SignBoardManagementDTO dto);
Long checkSignBoardCodeRepeat(String id, String lightRailId, String signBoardCode);
}
......@@ -17,4 +17,6 @@ import org.jeecg.modules.deviceAsset.vo.SleeperManagementVO;
public interface ISleeperManagementService extends IService<SleeperManagement> {
Page<SleeperManagementVO> queryPageList(Page<SleeperManagementVO> pageData, SleeperManagementDTO dto);
Long checkSleeperCodeRepeat(String id, String lightRailId, String sleeperCode);
}
......@@ -17,4 +17,6 @@ public interface ISwitchManagementService extends IService<SwitchManagement> {
Page<SwitchManagementQueryVO> queryPageList(Page<SwitchManagementQueryVO> pageData, SwitchManagementQueryDTO dto);
void edit(SwitchManagement switchManagement);
Long checkSwitchCodeRepeat(String id, String lightRailId, String switchCode);
}
......@@ -23,4 +23,6 @@ public interface ITrackBedManagementService extends IService<TrackBedManagement>
List<TrackBedManagement> queryList();
List<TrackBedManagement> getTrackBedById(String id);
Long checkTrackBedCodeRepeat(String id, String lightRailId, String trackBedCode);
}
......@@ -19,4 +19,6 @@ public interface IVerticalCurveManagementService extends IService<VerticalCurveM
Page<VerticalCurveManagementVO> queryPageList(Page<VerticalCurveManagementVO> pageData, VerticalCurveManagementDTO dto);
void edit(VerticalCurveManagement verticalCurveManagement);
Long checkVerticalCurveCodeRepeat(String id, String lightRailId, String curveCode);
}
......@@ -47,4 +47,9 @@ public class CurveManagementServiceImpl extends ServiceImpl<CurveManagementMappe
}
}
@Override
public Long checkCurveCodeRepeat(String id, String lightRailId, String curveCode) {
return this.baseMapper.checkCurveCodeRepeat(id,lightRailId,curveCode);
}
}
......@@ -24,4 +24,9 @@ public class FastenerManagementServiceImpl extends ServiceImpl<FastenerManagemen
public Page<FastenerManagementVO> queryPageList(Page<FastenerManagementVO> pageData, FastenerManagementDTO dto) {
return this.baseMapper.queryPageList(pageData, dto);
}
@Override
public Long checkFastenerCodeRepeat(String id, String lightRailId, String fastenerCode) {
return this.baseMapper.checkFastenerCodeRepeat(id,lightRailId,fastenerCode);
}
}
......@@ -14,8 +14,10 @@ import org.jeecg.modules.deviceAsset.service.IRailManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.entity.LineAlias;
import org.jeecg.modules.subwayNetwork.entity.SubwaySection;
import org.jeecg.modules.subwayNetwork.mapper.LightRailMapper;
import org.jeecg.modules.subwayNetwork.mapper.LineAliasMapper;
import org.jeecg.modules.subwayNetwork.mapper.SubwaySectionMapper;
import org.jeecg.modules.utils.UnitCodeUtil;
import org.springframework.stereotype.Service;
......@@ -47,6 +49,9 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper,
@Resource
private SubwaySectionMapper subwaySectionMapper;
@Resource
private LineAliasMapper lineAliasMapper;
@Resource
private AsyncTask asyncTask;
......@@ -130,6 +135,37 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper,
}
@Override
public void intelligentGeneration(String lightRailId, String lineAliasId) {
System.out.printf("lineAliasId=" + lineAliasId);
// 2.查询当前车站的上下行里程
LightRail lightRail = lightRailMapper.selectById(lightRailId);
// 3.1 查询上行所有里程数
List<RailManagement> allRailList = new ArrayList<>();
generationCore(lightRail, allRailList, lineAliasId);
for (int i = 0; i < allRailList.size(); i++) {
RailManagement railManagement = allRailList.get(i);
String railCode = "钢轨[上行]" + UnitCodeUtil.supplementZero(4, i + 1);
railManagement.setRailCode(railCode);
String unitCode = "SXXGG" + UnitCodeUtil.supplementZero(4, i + 1);
railManagement.setUnitCode(unitCode);
railManagement.setLightRailId(lightRailId);
railManagement.setRailOrderNum(i + 1);
railManagement.setCreateBy("系统生成");
railManagement.setUpdateBy("系统生成");
}
// 3.2 计算区间
this.calcSection(lightRailId, lineAliasId, allRailList);
// 异步执行保存
asyncTask.getAsyncExecutor().execute(() -> {
this.saveBatch(allRailList);
});
}
/**
* 计算区间
*
......@@ -195,41 +231,68 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper,
private void generationCore(LightRail lightRail, List<RailManagement> allRailList, String lineAliasId) {
List<Map<String, Object>> lineSpecialRailList = this.getLineSpecialRail(lightRail.getId(), lineAliasId);
BigDecimal lineStartMileage = BigDecimal.ZERO;
LineAlias lineAlias = lineAliasMapper.selectById(lineAliasId);
BigDecimal endMileage = lightRail.getUpLineMileage();
// 3.2 循环处理
if (lineAlias.getLineAliasName().contains("下行")) {
endMileage = lightRail.getDownLineMileage();
}
int size = lineSpecialRailList.size();
for (int i = 0; i < size; i++) {
Map<String, Object> currentMap = lineSpecialRailList.get(i);
BigDecimal currentStartMileage = Convert.toBigDecimal(currentMap.get("startMileage"));
// 3.2.1 第一次进入循环
if (i == 0) {
if (currentStartMileage.subtract(lineStartMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(lineStartMileage, currentStartMileage, lineAliasId);
allRailList.addAll(innerRailList);
// 1.如果查询不到曲线,竖曲线,道岔,则全是钢轨
if (size == 0 && endMileage.compareTo(lineStartMileage) > 0) {
List<RailManagement> innerRailList = this.generate(lineStartMileage, endMileage, lineAliasId);
allRailList.addAll(innerRailList);
} else {
for (int i = 0; i < size; i++) {
Map<String, Object> currentMap = lineSpecialRailList.get(i);
BigDecimal currentStartMileage = Convert.toBigDecimal(currentMap.get("startMileage"));
BigDecimal currentEndMileage = Convert.toBigDecimal(currentMap.get("endMileage"));
// 3.2.1 第一次进入循环
if (i == 0) {
if (currentStartMileage.subtract(lineStartMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(lineStartMileage, currentStartMileage, lineAliasId);
allRailList.addAll(innerRailList);
}
// 只有一个的情况下要继续向下执行
if (size != 1) {
continue;
}
}
continue;
}
// 3.2.2 后一个的开始 - 前一个的结束时间 > 0 相当于有空白
Map<String, Object> frontMap = lineSpecialRailList.get(i - 1);
BigDecimal frontEndMileage = Convert.toBigDecimal(frontMap.get("endMileage"));
if (currentStartMileage.subtract(frontEndMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(frontEndMileage, currentStartMileage, lineAliasId);
allRailList.addAll(innerRailList);
}
// 3.2.2 后一个的开始里程 - 前一个的结束里程 > 0 相当于有空白[注:1个单元情况下不做]
if (0 != size - 1) {
Map<String, Object> frontMap = lineSpecialRailList.get(i - 1);
BigDecimal frontEndMileage = Convert.toBigDecimal(frontMap.get("endMileage"));
if (currentStartMileage.subtract(frontEndMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(frontEndMileage, currentStartMileage, lineAliasId);
allRailList.addAll(innerRailList);
}
}
// 3.2.3 最后一次循环
if (i == size - 1) {
if (endMileage.subtract(currentStartMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(currentStartMileage, endMileage, lineAliasId);
allRailList.addAll(innerRailList);
if (i == size - 1) {
// 3.2.3 最后一次循环
// ① 线路终点里程 > 最后一个单元结束里程,要补充[最后一个单元结束里程,线路终点里程]
if (endMileage.subtract(currentEndMileage).compareTo(BigDecimal.ZERO) > 0) {
List<RailManagement> innerRailList = this.generate(currentEndMileage, endMileage, lineAliasId);
allRailList.addAll(innerRailList);
}
// ② 最后一个单元起点里程 < 线路终点里程 < 最后一个单元结束里程,补充[前一个终点,最后一个单元起点里程]
if (endMileage.subtract(currentStartMileage).compareTo(BigDecimal.ZERO) > 0 && endMileage.subtract(currentEndMileage).compareTo(BigDecimal.ZERO) < 0) {
List<RailManagement> innerRailList = this.generate(currentStartMileage, endMileage, lineAliasId);
allRailList.addAll(innerRailList);
}
// ③ 最后一个单元起点里程 > 线路终点里程 啥都不做
}
}
}
}
......@@ -279,4 +342,71 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper,
public List<Map<String, Object>> getLineSpecialRail(String lightRailId, String lineAliasId) {
return this.baseMapper.getLineSpecialRail(lightRailId, lineAliasId);
}
@Override
public Long checkRailCodeRepeat(String id, String lightRailId, String railCode) {
return this.baseMapper.checkRailCodeRepeat(id, lightRailId, railCode);
}
@Override
public Map<String, Object> getAddParams(String lightRailId, String lineAliasId, String sectionId) {
Map<String, Object> map = new HashMap<>();
/* List<Map<String, Object>> lineSpecialRailList = this.getLineSpecialRail(lightRailId, lineAliasId);
// 过滤出命中区间
List<Map<String, Object>> sectionMapList = new ArrayList<>();
for (Map<String, Object> lineSpecialRaiMap : lineSpecialRailList) {
String currentSectionId = Convert.toStr(lineSpecialRaiMap.get("sectionId"));
if (sectionId.equals(currentSectionId)) {
sectionMapList.add(lineSpecialRaiMap);
}
}
SubwaySection subwaySection = subwaySectionMapper.selectById(sectionId);
BigDecimal subwayStartMileage = subwaySection.getSectionStartingMileage();
BigDecimal subwayEndMileage = subwaySection.getSectionEndMileage();
if (ObjectUtil.isNotEmpty(sectionMapList)) {
int size = sectionMapList.size();
for (int i = 0; i < size; i++) {
Map<String, Object> sectionMap = sectionMapList.get(i);
BigDecimal currentStartMileage = Convert.toBigDecimal(sectionMap.get("startMileage"));
BigDecimal currentEndMileage = Convert.toBigDecimal(sectionMap.get("endMileage"));
// 计算开始空白开始里程
// 单元起始里程-区间起始里程 > 0 说明有空
if (currentStartMileage.subtract(subwayStartMileage).compareTo(BigDecimal.ZERO) > 0) {
// 有空白地方,取 区间起点= 这个单元起点
subwayEndMileage = currentStartMileage;
// 计算结束里程
// if (currentEndMileage.compareTo(subwayEndMileage) < 0) {
// subwayEndMileage = currentStartMileage;
// }
// System.out.println("subwayStartMileage=" + subwayStartMileage);
break;
} else {
// 没有空白则像后面移动,并结束本次循环
subwayStartMileage = currentEndMileage;
continue;
}
}
}*/
SubwaySection subwaySection = subwaySectionMapper.selectById(sectionId);
BigDecimal subwayStartMileage = subwaySection.getSectionStartingMileage();
BigDecimal subwayEndMileage = subwaySection.getSectionEndMileage();
map.put("startMileage", subwayStartMileage);
map.put("endMileage", subwayEndMileage);
return map;
}
}
......@@ -24,4 +24,9 @@ public class SignBoardManagementServiceImpl extends ServiceImpl<SignBoardManagem
public Page<SignBoardManagementVO> queryPageList(Page<SignBoardManagementVO> pageData, SignBoardManagementDTO dto) {
return this.baseMapper.queryPageList(pageData,dto);
}
@Override
public Long checkSignBoardCodeRepeat(String id, String lightRailId, String signBoardCode) {
return this.baseMapper.checkSignBoardCodeRepeat(id,lightRailId,signBoardCode);
}
}
......@@ -24,4 +24,9 @@ public class SleeperManagementServiceImpl extends ServiceImpl<SleeperManagementM
public Page<SleeperManagementVO> queryPageList(Page<SleeperManagementVO> pageData, SleeperManagementDTO dto) {
return this.baseMapper.queryPageList(pageData, dto);
}
@Override
public Long checkSleeperCodeRepeat(String id, String lightRailId, String sleeperCode) {
return this.baseMapper.checkSleeperCodeRepeat(id,lightRailId,sleeperCode);
}
}
......@@ -44,4 +44,9 @@ public class SwitchManagementServiceImpl extends ServiceImpl<SwitchManagementMap
this.updateById(switchManagement);
}
}
@Override
public Long checkSwitchCodeRepeat(String id, String lightRailId, String switchCode) {
return this.baseMapper.checkSwitchCodeRepeat(id,lightRailId,switchCode);
}
}
......@@ -24,7 +24,7 @@ public class TrackBedManagementServiceImpl extends ServiceImpl<TrackBedManagemen
@Override
public Page<TrackBedManagementVO> queryPageList(Page<TrackBedManagementVO> pageData, TrackBedManagementDTO dto) {
return this.baseMapper.queryPageList(pageData,dto);
return this.baseMapper.queryPageList(pageData, dto);
}
@Override
......@@ -36,4 +36,9 @@ public class TrackBedManagementServiceImpl extends ServiceImpl<TrackBedManagemen
public List<TrackBedManagement> getTrackBedById(String id) {
return this.baseMapper.getTrackBedById(id);
}
@Override
public Long checkTrackBedCodeRepeat(String id, String lightRailId, String trackBedCode) {
return this.baseMapper.checkTrackBedCodeRepeat(id, lightRailId, trackBedCode);
}
}
......@@ -39,4 +39,9 @@ public class VerticalCurveManagementServiceImpl extends ServiceImpl<VerticalCurv
this.updateById(verticalCurveManagement);
}
}
@Override
public Long checkVerticalCurveCodeRepeat(String id, String lightRailId, String verticalCurveCode) {
return this.baseMapper.checkVerticalCurveCodeRepeat(id,lightRailId,verticalCurveCode);
}
}
......@@ -138,16 +138,15 @@ public class WorkBatchController extends JeecgController<WorkBatch, IWorkBatchSe
public Result<WorkUnitDeviceModifyVO> getUnitDeviceModify(String workBatchDetailId) {
WorkBatchDetail workBatchDetail = workBatchDetailService.getById(workBatchDetailId);
WorkUnitDeviceModifyVO vo = new WorkUnitDeviceModifyVO();
vo.setWorkBatchDetailId(workBatchDetail.getId());
vo.setReformRemark(workBatchDetail.getReformRemark());
List<WorkBatchDetailModifyVO> detailList = workBatchDetailModifyService.getUnitDeviceModify(workBatchDetailId);
vo.setDetailList(detailList);
if (ObjectUtil.isNotEmpty(workBatchDetail)) {
List<WorkBatchDetailModifyVO> detailList = workBatchDetailModifyService.getUnitDeviceModify(workBatchDetailId);
vo.setDetailList(detailList);
}
return Result.ok(vo);
}
}
......@@ -113,6 +113,10 @@ public class WorkBatchDetail implements Serializable {
@TableField("reform_remark")
private String reformRemark;
@ApiModelProperty("维修日期")
@TableField("maintenance_date")
private Date maintenanceDate;
@ApiModelProperty("维修建议")
@TableField("remark")
private String remark;
......
......@@ -38,6 +38,7 @@
t1.unit_score_level,
t1.unit_score_level_str,
t1.unit_score,
t1.reform_remark,
t1.remark
FROM t_mw_work_batch_detail t1
WHERE t1.work_batch_id in
......
......@@ -124,6 +124,8 @@
SELECT
t1.workBatchDetailId,
t1.unit_id,
t1.maintenance_date,
t1.reform_remark,
t2.id workBatchId,
t2.create_by,
t2.create_time,
......@@ -143,7 +145,7 @@
t2.work_status,
t2.del_flag
FROM
( SELECT work_batch_id, unit_id, unit_type,id as workBatchDetailId FROM t_mw_work_batch_detail WHERE unit_id = #{dto.unitId} AND unit_type = #{dto.unitType} ) t1
( SELECT work_batch_id, unit_id, unit_type,id as workBatchDetailId ,maintenance_date,reform_remark FROM t_mw_work_batch_detail WHERE unit_id = #{dto.unitId} AND unit_type = #{dto.unitType} ) t1
LEFT JOIN t_mw_work_batch t2 ON t1.work_batch_id = t2.id AND t2.del_flag = '0'
ORDER BY t2.create_time
</select>
......
......@@ -75,6 +75,9 @@ public class WorkBatchDetailVO {
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("整改备注")
private String reformRemark;
@ApiModelProperty("超限list")
private List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList;
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
......@@ -22,9 +23,6 @@ public class WorkUnitDeviceModifyVO implements Serializable {
@ApiModelProperty("作业计划详情id")
private String workBatchDetailId;
@ApiModelProperty("整改备注")
private String reformRemark;
@ApiModelProperty("整改详情")
private List<WorkBatchDetailModifyVO> detailList;
}
......@@ -37,7 +37,7 @@
<select id="getTreeSubwaySectionList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
SELECT t.id,
t.section_name label,
'3' level,
'4' level,
concat(t.light_rail_id, '-', t.line_alias_id) parent,
t.line_alias_id,
t3.line_alias_code,
......
......@@ -35,9 +35,9 @@
</select>
<select id="getTreeTrainStationList" resultType="org.jeecg.modules.subwayNetwork.vo.SectionStationNode">
SELECT
concat(t2.section_id,'-',t1.id) id,
t1.id,
t1.station_name label,
'3' level,
'4' level,
concat(t1.light_rail_id,'-',t1.line_alias_id) parent,
t1.line_alias_id,
t4.line_alias_code,
......@@ -46,8 +46,7 @@
t1.end_mileage endMileage,
true isLeaf
FROM 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
LEFT JOIN t_sn_light_rail t3 on t1.light_rail_id = t3.id
LEFT JOIN t_sn_line_alias t4 ON t1.line_alias_id = t4.id
WHERE t3.status = 1
ORDER BY startMileage,line_alias_id
......
package org.jeecg.modules.subwayNetwork.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -20,6 +24,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -109,9 +114,20 @@ public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail
}
/**
* 首页的树结构请修改为“线路->线别->车站、区间”这种树型结构
* <p>
* 车站1、车站1~车站2区间、车站2
* 格式:
* 线路1
* |_
* 线别1
* |_
* | 车站
* | |_车站1
* | ...
* | |_车站n
* |_
* 区间
* |_区间1
* ...
* |_区间n
*
* @return
*/
......@@ -161,6 +177,132 @@ public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail
}
// 2.2
// 2.2.1 组装区间
if (ObjectUtil.isNotEmpty(subwaySectionList)) {
// 定义一个虚拟区间map
Map<String, SectionStationNode> virtualSectionMap = new HashMap<>();
for (SectionStationNode sectionStationNode : subwaySectionList) {
SectionStationNode virtualSectionNode = virtualSectionMap.get(sectionStationNode.getParent());
if (virtualSectionNode == null) {
// 生成一个虚拟节点
virtualSectionNode = new SectionStationNode();
BeanUtil.copyProperties(sectionStationNode, virtualSectionNode);
String lineAliasId = sectionStationNode.getParent();
String virtualNodeId = "virtual_section_node_" + lineAliasId;
virtualSectionNode.setId(virtualNodeId);
virtualSectionNode.setLabel("区间");
virtualSectionNode.setLevel("3");
virtualSectionNode.setIsLeaf(false);
// 将属于这个线别的区间都归属到这个虚拟节点下面
sectionStationNode.setParent(virtualNodeId);
List<SectionStationNode> virtualSectionNodeChildren = new ArrayList<>();
virtualSectionNodeChildren.add(sectionStationNode);
virtualSectionNode.setChildren(virtualSectionNodeChildren);
virtualSectionMap.put(lineAliasId, virtualSectionNode);
} else {
// 将属于这个线别的区间都归属到这个虚拟节点下面
sectionStationNode.setParent(virtualSectionNode.getId());
virtualSectionNode.getChildren().add(sectionStationNode);
// 改变当前虚拟节点的结束和中点里程,结束里程等于最后一个节点的节点结束里程
BigDecimal startMileage = virtualSectionNode.getStartMileage();
BigDecimal centerMileage;
BigDecimal endMileage = sectionStationNode.getEndMileage();
centerMileage = startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
virtualSectionNode.setCenterMileage(centerMileage);
virtualSectionNode.setEndMileage(endMileage);
}
}
// 将虚拟区间添加到线别
for (SectionStationNode lineAliasNode : lineAliasList) {
SectionStationNode virtualSectionNode = virtualSectionMap.get(lineAliasNode.getId());
if (null != virtualSectionNode) {
lineAliasNode.setChildren(CollectionUtil.newArrayList(virtualSectionNode));
lineAliasNode.setIsLeaf(false);
}
}
}
// 2.2.2 组装车站
if (ObjectUtil.isNotEmpty(trainStationList)) {
// 定义一个虚拟车站map
Map<String, SectionStationNode> virtualtrainStationMap = new HashMap<>();
for (SectionStationNode trainStationNode : trainStationList) {
SectionStationNode virtualTrainStationNode = virtualtrainStationMap.get(trainStationNode.getParent());
if (virtualTrainStationNode == null) {
// 生成一个虚拟节点
virtualTrainStationNode = new SectionStationNode();
BeanUtil.copyProperties(trainStationNode, virtualTrainStationNode);
String lineAliasId = trainStationNode.getParent();
String virtualNodeId = "virtual_station_node_" + lineAliasId;
virtualTrainStationNode.setId(virtualNodeId);
virtualTrainStationNode.setLabel("车站");
virtualTrainStationNode.setLevel("3");
virtualTrainStationNode.setIsLeaf(false);
// 将属于这个线别的区间都归属到这个虚拟节点下面
trainStationNode.setParent(virtualNodeId);
List<SectionStationNode> virtualTrainStationNodeChildren = new ArrayList<>();
virtualTrainStationNodeChildren.add(trainStationNode);
virtualTrainStationNode.setChildren(virtualTrainStationNodeChildren);
virtualtrainStationMap.put(lineAliasId, virtualTrainStationNode);
} else {
// 将属于这个线别的区间都归属到这个虚拟节点下面
trainStationNode.setParent(virtualTrainStationNode.getId());
virtualTrainStationNode.getChildren().add(trainStationNode);
// 改变当前虚拟节点的结束和中点里程,结束里程等于最后一个节点的节点结束里程
BigDecimal startMileage = trainStationNode.getStartMileage();
BigDecimal centerMileage;
BigDecimal endMileage = trainStationNode.getEndMileage();
centerMileage = startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
virtualTrainStationNode.setCenterMileage(centerMileage);
virtualTrainStationNode.setEndMileage(endMileage);
}
}
// 将虚拟车站添加到线别上面
for (SectionStationNode lineAliasNode : lineAliasList) {
SectionStationNode virtualSectionNode = virtualtrainStationMap.get(lineAliasNode.getId());
if (null != virtualSectionNode) {
List<SectionStationNode> children = lineAliasNode.getChildren();
if (children == null) {
children = new ArrayList<>();
}
children.add(virtualSectionNode);
lineAliasNode.setChildren(children);
lineAliasNode.setIsLeaf(false);
}
}
}
/* // 2.2
// 2.2.1 组装车站,区间【车站1、车站1~车站2区间、车站2】
Map<String, SectionStationNode> subwaySectionMap = subwaySectionList.stream().collect(Collectors.toMap(SectionStationNode::getId, value -> value));
Map<String, List<SectionStationNode>> subwayAndtrainStationSectionMap = new HashMap<>();
......@@ -206,7 +348,7 @@ public class LightRailServiceImpl extends ServiceImpl<LightRailMapper, LightRail
lineAliasNode.setIsLeaf(false);
}
}
*/
return lightRailList;
}
}
package org.jeecg.modules.system.controller;
import cn.hutool.core.io.resource.ClassPathResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -176,42 +177,6 @@ public class CommonController {
return "";
}
// @PostMapping(value = "/upload2")
// public Result<?> upload2(HttpServletRequest request, HttpServletResponse response) {
// Result<?> result = new Result<>();
// try {
// String ctxPath = uploadpath;
// String fileName = null;
// String bizPath = "files";
// String tempBizPath = request.getParameter("biz");
// if(oConvertUtils.isNotEmpty(tempBizPath)){
// bizPath = tempBizPath;
// }
// String nowday = new SimpleDateFormat("yyyyMMdd").format(new Date());
// File file = new File(ctxPath + File.separator + bizPath + File.separator + nowday);
// if (!file.exists()) {
// file.mkdirs();// 创建文件根目录
// }
// MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
// MultipartFile mf = multipartRequest.getFile("file");// 获取上传文件对象
// String orgName = mf.getOriginalFilename();// 获取文件名
// fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
// String savePath = file.getPath() + File.separator + fileName;
// File savefile = new File(savePath);
// FileCopyUtils.copy(mf.getBytes(), savefile);
// String dbpath = bizPath + File.separator + nowday + File.separator + fileName;
// if (dbpath.contains("\\")) {
// dbpath = dbpath.replace("\\", "/");
// }
// result.setMessage(dbpath);
// result.setSuccess(true);
// } catch (IOException e) {
// result.setSuccess(false);
// result.setMessage(e.getMessage());
// log.error(e.getMessage(), e);
// }
// return result;
// }
/**
* 预览图片&下载文件
......@@ -276,6 +241,63 @@ public class CommonController {
}
@GetMapping(value = "/excelTemplate/**")
@ApiOperation(value = "excelTemplate 下载", notes = "excelTemplate 下载")
public void excelTemplate(HttpServletRequest request, HttpServletResponse response) {
// ISO-8859-1 ==> UTF-8 进行编码转换
String excelPath = extractPathFromPattern(request);
if (oConvertUtils.isEmpty(excelPath) || CommonConstant.STRING_NULL.equals(excelPath)) {
return;
}
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try {
excelPath = excelPath.replace("..", "").replace("../", "");
ClassPathResource classPathResource = new ClassPathResource("templates/excel/" + excelPath);
String filePath = classPathResource.getUrl().getFile();
File file = new File(filePath);
if (!file.exists()) {
response.setStatus(404);
throw new RuntimeException("文件[" + excelPath + "]不存在..");
}
// 设置强制下载不打开
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"), "iso-8859-1"));
response.addHeader("Cache-Control", "no-cache");
inputStream = new BufferedInputStream(new FileInputStream(filePath));
outputStream = response.getOutputStream();
byte[] buf = new byte[4096];
int len;
while ((len = inputStream.read(buf)) > 0) {
outputStream.write(buf, 0, len);
}
response.flushBuffer();
} catch (IOException e) {
log.error("预览文件失败" + e.getMessage());
response.setStatus(404);
e.printStackTrace();
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
}
}
// /**
// * 下载文件
// * 请求地址:http://localhost:8080/common/download/{user/20190119/e1fe9925bc315c60addea1b98eb1cb1349547719_1547866868179.jpg}
......
......@@ -43,10 +43,10 @@ public class CaseReportWorkBatchVO {
@ApiModelProperty("作业终止时间")
private Date workEndTime;
@ApiModelProperty("作业终止时间")
@ApiModelProperty("作业开始里程")
private BigDecimal workStartMileage;
@ApiModelProperty("作业终止时间")
@ApiModelProperty("做成结束里程")
private BigDecimal workEndMileage;
@ApiModelProperty("作业班组")
......@@ -61,6 +61,12 @@ public class CaseReportWorkBatchVO {
@ApiModelProperty("作业单元数量")
private Integer workUnitDeviceNum;
@ApiModelProperty("维修日期")
private Date maintenanceDate;
@ApiModelProperty("整改备注")
private String reformRemark;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
......
......@@ -167,7 +167,7 @@ mybatis-plus:
table-underline: true
configuration:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
# 驼峰
......
......@@ -287,6 +287,8 @@
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
......
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