Commit 893049fd authored by shizhilong's avatar shizhilong

Merge remote-tracking branch 'origin/dev' into dev

parents 80b57dfc abcb0a49
...@@ -3,23 +3,21 @@ package org.jeecg.modules.checkData.dynamicStaticGeometricData.controller; ...@@ -3,23 +3,21 @@ package org.jeecg.modules.checkData.dynamicStaticGeometricData.controller;
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 io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.*;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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.modules.checkData.dynamicStaticGeometricData.dto.RailInspectionEquipmentDTO; import org.jeecg.modules.checkData.dynamicStaticGeometricData.dto.RailInspectionEquipmentDTO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetailVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentVO; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentItemService; import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentItemService;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.web.multipart.MultipartFile;
import javax.transaction.Transactional;
import java.util.List; import java.util.List;
/** /**
...@@ -34,8 +32,8 @@ import java.util.List; ...@@ -34,8 +32,8 @@ import java.util.List;
@RequestMapping("/checkData/dynamicStaticGeometricData/railInspectionEquipmentItem") @RequestMapping("/checkData/dynamicStaticGeometricData/railInspectionEquipmentItem")
public class RailInspectionEquipmentItemController extends JeecgController<RailInspectionEquipmentItem, IRailInspectionEquipmentItemService> { public class RailInspectionEquipmentItemController extends JeecgController<RailInspectionEquipmentItem, IRailInspectionEquipmentItemService> {
@AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-分页列表查询") @AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询")
@ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-分页列表查询", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-分页列表查询") @ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "railInspectionEquipmentId", value = "轨检仪静态检查数据id") @ApiImplicitParam(name = "railInspectionEquipmentId", value = "轨检仪静态检查数据id")
...@@ -45,6 +43,30 @@ public class RailInspectionEquipmentItemController extends JeecgController<RailI ...@@ -45,6 +43,30 @@ public class RailInspectionEquipmentItemController extends JeecgController<RailI
return Result.OK(record); return Result.OK(record);
} }
@AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表")
@ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-项目明细列表")
@GetMapping(value = "/detailList")
@ApiImplicitParams({
@ApiImplicitParam(name = "railInspectionEquipmentItemId", value = "轨检仪静态检查项目id")
})
public Result<List<RailInspectionEquipmentItemDetailVO>> detailList(String railInspectionEquipmentItemId) {
List<RailInspectionEquipmentItemDetailVO> record = this.service.detailList(railInspectionEquipmentItemId);
return Result.OK(record);
}
@PostMapping(value = "/upload")
@AutoLog(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入")
@ApiOperation(value = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入", notes = "检查数据-动静态几何尺寸数据-轨检仪静态检查数据-导入")
@ApiImplicitParams({
@ApiImplicitParam(name = "railInspectionEquipmentId", value = "轨检仪静态检查数据id"),
@ApiImplicitParam(name = "file", value = "文件"),
})
public Result<String> uploadFile(String railInspectionEquipmentId, MultipartFile file) {
this.service.uploadFile(railInspectionEquipmentId, file);
return Result.ok("操作成功");
}
} }
...@@ -2,7 +2,9 @@ package org.jeecg.modules.checkData.dynamicStaticGeometricData.service; ...@@ -2,7 +2,9 @@ package org.jeecg.modules.checkData.dynamicStaticGeometricData.service;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetailVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
...@@ -17,4 +19,8 @@ import java.util.List; ...@@ -17,4 +19,8 @@ import java.util.List;
public interface IRailInspectionEquipmentItemService extends IService<RailInspectionEquipmentItem> { public interface IRailInspectionEquipmentItemService extends IService<RailInspectionEquipmentItem> {
List<RailInspectionEquipmentItemVO> queryList(String railInspectionEquipmentId); List<RailInspectionEquipmentItemVO> queryList(String railInspectionEquipmentId);
void uploadFile(String railInspectionEquipmentId, MultipartFile file);
List<RailInspectionEquipmentItemDetailVO> detailList(String railInspectionEquipmentItemId);
} }
package org.jeecg.modules.checkData.dynamicStaticGeometricData.service.impl; package org.jeecg.modules.checkData.dynamicStaticGeometricData.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItem;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetail;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemDetailVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO; import org.jeecg.modules.checkData.dynamicStaticGeometricData.entity.RailInspectionEquipmentItemVO;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.mapper.RailInspectionEquipmentItemDetailMapper;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.mapper.RailInspectionEquipmentItemMapper; import org.jeecg.modules.checkData.dynamicStaticGeometricData.mapper.RailInspectionEquipmentItemMapper;
import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentItemService; import org.jeecg.modules.checkData.dynamicStaticGeometricData.service.IRailInspectionEquipmentItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
/** /**
...@@ -20,8 +26,27 @@ import java.util.List; ...@@ -20,8 +26,27 @@ import java.util.List;
@Service @Service
public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInspectionEquipmentItemMapper, RailInspectionEquipmentItem> implements IRailInspectionEquipmentItemService { public class RailInspectionEquipmentItemServiceImpl extends ServiceImpl<RailInspectionEquipmentItemMapper, RailInspectionEquipmentItem> implements IRailInspectionEquipmentItemService {
@Resource
private RailInspectionEquipmentItemDetailMapper railInspectionEquipmentItemDetailMapper;
@Override @Override
public List<RailInspectionEquipmentItemVO> queryList(String railInspectionEquipmentId) { public List<RailInspectionEquipmentItemVO> queryList(String railInspectionEquipmentId) {
return this.baseMapper.queryList(railInspectionEquipmentId); return this.baseMapper.queryList(railInspectionEquipmentId);
} }
@Override
public void uploadFile(String railInspectionEquipmentId, MultipartFile file) {
throw new NullPointerException();
}
@Override
public List<RailInspectionEquipmentItemDetailVO> detailList(String railInspectionEquipmentItemId) {
LambdaQueryWrapper<RailInspectionEquipmentItemDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(RailInspectionEquipmentItemDetail::getRailInspectionEquipmentItemId,railInspectionEquipmentItemId);
List<RailInspectionEquipmentItemDetail> itemDetails = railInspectionEquipmentItemDetailMapper.selectList(lambdaQueryWrapper);
return null;
}
} }
...@@ -74,8 +74,8 @@ public class RailManagementController extends JeecgController<RailManagement, IR ...@@ -74,8 +74,8 @@ public class RailManagementController extends JeecgController<RailManagement, IR
@AutoLog(value = "资产管理-钢轨管理-智能生成") @AutoLog(value = "资产管理-钢轨管理-智能生成")
@ApiOperation(value = "资产管理-钢轨管理-智能生成", notes = "资产管理-钢轨管理-智能生成") @ApiOperation(value = "资产管理-钢轨管理-智能生成", notes = "资产管理-钢轨管理-智能生成")
@GetMapping(value = "/intelligentGeneration") @GetMapping(value = "/intelligentGeneration")
public Result<String> intelligentGeneration(@RequestParam(name = "ids", required = true) String ids) { public Result<String> intelligentGeneration() {
this.service.intelligentGeneration(); this.service.intelligentGeneration("1671390979417616386");
return Result.OK("生成成功"); return Result.OK("生成成功");
} }
......
...@@ -57,10 +57,10 @@ public class CurveManagement implements Serializable { ...@@ -57,10 +57,10 @@ public class CurveManagement implements Serializable {
private String curveDeflectionAngle; private String curveDeflectionAngle;
@ApiModelProperty(value = "曲线半径R(m)") @ApiModelProperty(value = "曲线半径R(m)")
private BigDecimal curveAdius; private BigDecimal curveRadius;
@ApiModelProperty(value = "缓和曲线长I(m)") @ApiModelProperty(value = "缓和曲线长I(m)")
private BigDecimal transitionCurveLen; private String transitionCurveLen;
@ApiModelProperty(value = "切线长T(m)") @ApiModelProperty(value = "切线长T(m)")
private BigDecimal tangentLen; private BigDecimal tangentLen;
......
...@@ -6,6 +6,9 @@ import org.jeecg.modules.deviceAsset.entity.RailManagement; ...@@ -6,6 +6,9 @@ import org.jeecg.modules.deviceAsset.entity.RailManagement;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO; import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 资产管理-钢轨管理 Mapper 接口 * 资产管理-钢轨管理 Mapper 接口
...@@ -17,4 +20,6 @@ import org.jeecg.modules.deviceAsset.vo.RailManagementVO; ...@@ -17,4 +20,6 @@ import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
public interface RailManagementMapper extends BaseMapper<RailManagement> { public interface RailManagementMapper extends BaseMapper<RailManagement> {
Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto); Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto);
List<Map<String, Object>> getLineSpecialRail(String lineAliasId);
} }
...@@ -27,4 +27,49 @@ ...@@ -27,4 +27,49 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getLineSpecialRail" resultType="java.util.Map">
SELECT
unitCode,
startMileage,
endMileage,
type
FROM
(
SELECT
t1.unit_code unitCode,
t1.curve_mileage_zh startMileage,
t1.curve_mileage_hz endMileage,
'曲线' type
FROM
t_da_curve_management t1
WHERE
t1.line_alias_id = #{lineAliasId}
UNION ALL
SELECT
unit_code unitCode,
starting_mileage startMileage,
end_mileage endMileage,
'竖曲线' type
FROM
t_da_vertical_curve_management
WHERE
line_alias_id = #{lineAliasId}
UNION ALL
SELECT
unit_code unitCode,
byroad_pre_mileage startMileage,
byroad_end_mileage endMileage,
'道岔' type
FROM
t_da_switch_management
WHERE
line_alias_id = #{lineAliasId}
) t
ORDER BY
t.startMileage
</select>
</mapper> </mapper>
...@@ -6,6 +6,9 @@ import org.jeecg.modules.deviceAsset.entity.RailManagement; ...@@ -6,6 +6,9 @@ import org.jeecg.modules.deviceAsset.entity.RailManagement;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO; import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 资产管理-钢轨管理 服务类 * 资产管理-钢轨管理 服务类
...@@ -20,5 +23,12 @@ public interface IRailManagementService extends IService<RailManagement> { ...@@ -20,5 +23,12 @@ public interface IRailManagementService extends IService<RailManagement> {
void edit(RailManagement railManagement); void edit(RailManagement railManagement);
void intelligentGeneration(); void intelligentGeneration(String lightRailId);
/**
* 获取线路的特殊钢轨
*
* @param lineAliasId 线别ID
*/
List<Map<String, Object>> getLineSpecialRail(String lineAliasId);
} }
package org.jeecg.modules.deviceAsset.service.impl; package org.jeecg.modules.deviceAsset.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.deviceAsset.dto.RailManagementDTO; import org.jeecg.modules.deviceAsset.dto.RailManagementDTO;
import org.jeecg.modules.deviceAsset.entity.RailManagement; import org.jeecg.modules.deviceAsset.entity.RailManagement;
import org.jeecg.modules.deviceAsset.mapper.RailManagementMapper; import org.jeecg.modules.deviceAsset.mapper.RailManagementMapper;
import org.jeecg.modules.deviceAsset.service.IRailManagementService; import org.jeecg.modules.deviceAsset.service.IRailManagementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.deviceAsset.vo.RailManagementVO; import org.jeecg.modules.deviceAsset.vo.RailManagementVO;
import org.jeecg.modules.subwayNetwork.entity.LightRail;
import org.jeecg.modules.subwayNetwork.mapper.LightRailMapper;
import org.jeecg.modules.utils.UnitCodeUtil; import org.jeecg.modules.utils.UnitCodeUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
* 资产管理-钢轨管理 服务实现类 * 资产管理-钢轨管理 服务实现类
...@@ -22,6 +35,14 @@ import org.springframework.stereotype.Service; ...@@ -22,6 +35,14 @@ import org.springframework.stereotype.Service;
@Service @Service
public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper, RailManagement> implements IRailManagementService { public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper, RailManagement> implements IRailManagementService {
/**
* 钢轨单元长度
*/
public static BigDecimal UNIT_LENGTH = new BigDecimal("25");
@Resource
private LightRailMapper lightRailMapper;
@Override @Override
public Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto) { public Page<RailManagementVO> queryPageList(Page<RailManagementVO> pageData, RailManagementDTO dto) {
return this.baseMapper.queryPageList(pageData, dto); return this.baseMapper.queryPageList(pageData, dto);
...@@ -39,8 +60,119 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper, ...@@ -39,8 +60,119 @@ public class RailManagementServiceImpl extends ServiceImpl<RailManagementMapper,
} }
} }
// 1.判断完整的线路有没有空白部分(指剩余区间既不是道岔、曲线、竖曲线、钢轨的部分),只需要填空白部分,空白部分一定是钢轨,按照25一根的逻辑余数自成一根;
// 2.如果不存在空白部分,则定义道岔曲线竖曲线为绝对正确里程值,并且定义为特殊钢轨,相邻两个特殊钢轨之间的里程区间按照25一根的逻辑余数自成一根。
@Override
public void intelligentGeneration(String lightRailId) {
// 1.删除整条线的
this.lambdaUpdate().remove();
// 2.查询当前车站的上下行里程
LightRail lightRail = lightRailMapper.selectById(lightRailId);
// 3.处理上行
// 3.1 查询上行所有里程数
List<RailManagement> allRailList = new ArrayList<>();
String sdkId = "1"; // 上行线id
List<Map<String, Object>> lineSpecialRailList = this.getLineSpecialRail(sdkId);
BigDecimal lineStartMileage = BigDecimal.ZERO;
BigDecimal endMileage = lightRail.getUpLineMileage();
// 3.2 循环处理
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, sdkId);
allRailList.addAll(innerRailList);
}
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, sdkId);
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, sdkId);
allRailList.addAll(innerRailList);
}
}
}
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.setRailOrderNum(i + 1);
railManagement.setCreateTime(new Date());
railManagement.setUpdateTime(new Date());
}
this.saveBatch(allRailList);
}
/**
* @param startMileage
* @param endMileage
* @param lineAliasId
* @return
*/
private List<RailManagement> generate(BigDecimal startMileage, BigDecimal endMileage, String lineAliasId) {
List<RailManagement> result = new ArrayList<>();
// 1.处理25米一段的钢轨
while (startMileage.add(UNIT_LENGTH).compareTo(endMileage) < 0) {
// 开始里程向后移动25米
BigDecimal currentEndMileage = startMileage.add(UNIT_LENGTH);
// 中心里程 = (开始里程+结束里程) / 2
BigDecimal centerMileage = startMileage.add(currentEndMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP);
RailManagement railManagement = new RailManagement();
railManagement.setId(UUIDGenerator.generate());
railManagement.setLineAliasId(lineAliasId);
railManagement.setStartingMileage(startMileage);
railManagement.setCenterMileage(centerMileage);
railManagement.setEndMileage(currentEndMileage);
result.add(railManagement);
startMileage = currentEndMileage;
}
// 2.处理不到25米一段的钢轨
RailManagement railManagement = new RailManagement();
railManagement.setId(UUIDGenerator.generate());
railManagement.setLineAliasId(lineAliasId);
railManagement.setStartingMileage(startMileage);
railManagement.setCenterMileage(startMileage.add(endMileage).divide(new BigDecimal("2"), 3, RoundingMode.HALF_UP)); // 中心里程 = (开始里程+结束里程) / 2
railManagement.setEndMileage(endMileage);
result.add(railManagement);
return result;
}
@Override @Override
public void intelligentGeneration() { public List<Map<String, Object>> getLineSpecialRail(String lineAliasId) {
throw new NullPointerException(); return this.baseMapper.getLineSpecialRail(lineAliasId);
} }
} }
...@@ -42,11 +42,11 @@ public class CurveManagementQueryVO implements Serializable { ...@@ -42,11 +42,11 @@ public class CurveManagementQueryVO implements Serializable {
@ApiModelProperty("曲线偏角a(°′″)") @ApiModelProperty("曲线偏角a(°′″)")
private String curveDeflectionAngle; private String curveDeflectionAngle;
@ApiModelProperty("曲线半径R(m)") @ApiModelProperty(value = "曲线半径R(m)")
private BigDecimal curveAdius; private BigDecimal curveRadius;
@ApiModelProperty("缓和曲线长I(m)") @ApiModelProperty(value = "缓和曲线长I(m)")
private BigDecimal transitionCurveLen; private String transitionCurveLen;
@ApiModelProperty("切线长T(m)") @ApiModelProperty("切线长T(m)")
private BigDecimal tangentLen; private BigDecimal tangentLen;
......
...@@ -12,6 +12,9 @@ import org.jeecg.modules.deviceAsset.service.IVerticalCurveManagementService; ...@@ -12,6 +12,9 @@ import org.jeecg.modules.deviceAsset.service.IVerticalCurveManagementService;
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;
import java.util.List;
import java.util.Map;
/** /**
* @describe:单元编码生成工具 * @describe:单元编码生成工具
*/ */
...@@ -41,20 +44,20 @@ public class UnitCodeUtil { ...@@ -41,20 +44,20 @@ public class UnitCodeUtil {
/** /**
* 钢轨单元编码:线别码+GG+流水号(5位流水号) * 钢轨单元编码:线别码+GG+流水号(5位流水号)
* 实例:SXGG00001 * 实例:SXXGG00001
* SQX - 竖曲线 * GG - 钢轨编码
* 000001-流水号 * 0001-流水号
* *
* @param lineId 线别ID * @param lineId 线别ID
*/ */
public static String railUnitCodeUtil(String lineId) { public static String railUnitCodeUtil(String lineId) {
// 获取线别拼音 // 获取线别拼音
LineAlias lineAlias = lineAliasService.getById(lineId); LineAlias lineAlias = lineAliasService.getById(lineId);
String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toLowerCase(); String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toUpperCase();
// 查询最大的编号 // 查询最大的编号
String unitCode = lineAliasPinyin + "SQX"; String unitCode = lineAliasPinyin + "GG";
RailManagement record = railManagementService.lambdaQuery() RailManagement record = railManagementService.lambdaQuery()
.likeRight(RailManagement::getUnitCode, unitCode) .likeRight(RailManagement::getUnitCode, unitCode)
.orderByDesc(RailManagement::getUnitCode) .orderByDesc(RailManagement::getUnitCode)
...@@ -66,7 +69,7 @@ public class UnitCodeUtil { ...@@ -66,7 +69,7 @@ public class UnitCodeUtil {
Integer serialNum = 1; Integer serialNum = 1;
if (null != record && record.getUnitCode() != null) { if (null != record && record.getUnitCode() != null) {
// 流水号+1 // 流水号+1
serialNum = Integer.parseInt(record.getUnitCode().substring(6)) + 1; serialNum = Integer.parseInt(record.getUnitCode().substring(record.getUnitCode().length() - 4)) + 1;
} }
String serialNumStr = supplementZero(4, serialNum); String serialNumStr = supplementZero(4, serialNum);
...@@ -74,17 +77,15 @@ public class UnitCodeUtil { ...@@ -74,17 +77,15 @@ public class UnitCodeUtil {
} }
/** /**
* 曲线代码生成: 01SQX0001
* 01 - 上行;02-表示下行
* SQX - 竖曲线 * SQX - 竖曲线
* 000001-流水号 * 0001-流水号
* *
* @param lineId 线别ID * @param lineId 线别ID
*/ */
public static String verticalCurveUnitCodeUtil(String lineId) { public static String verticalCurveUnitCodeUtil(String lineId) {
// 获取线别拼音 // 获取线别拼音
LineAlias lineAlias = lineAliasService.getById(lineId); LineAlias lineAlias = lineAliasService.getById(lineId);
String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toLowerCase(); String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toUpperCase();
// 查询最大的编号 // 查询最大的编号
...@@ -100,7 +101,7 @@ public class UnitCodeUtil { ...@@ -100,7 +101,7 @@ public class UnitCodeUtil {
Integer serialNum = 1; Integer serialNum = 1;
if (null != record && record.getUnitCode() != null) { if (null != record && record.getUnitCode() != null) {
// 流水号+1 // 流水号+1
serialNum = Integer.parseInt(record.getUnitCode().substring(6)) + 1; serialNum = Integer.parseInt(record.getUnitCode().substring(record.getUnitCode().length() - 4)) + 1;
} }
String serialNumStr = supplementZero(4, serialNum); String serialNumStr = supplementZero(4, serialNum);
...@@ -109,7 +110,6 @@ public class UnitCodeUtil { ...@@ -109,7 +110,6 @@ public class UnitCodeUtil {
/** /**
* 曲线代码生成: L201QX0001 * 曲线代码生成: L201QX0001
* 01 - 上行;02-表示下行
* QX - 曲线 * QX - 曲线
* 000001-流水号 * 000001-流水号
* *
...@@ -118,7 +118,7 @@ public class UnitCodeUtil { ...@@ -118,7 +118,7 @@ public class UnitCodeUtil {
public static String curveUnitCodeUtil(String lineId) { public static String curveUnitCodeUtil(String lineId) {
// 获取线别拼音 // 获取线别拼音
LineAlias lineAlias = lineAliasService.getById(lineId); LineAlias lineAlias = lineAliasService.getById(lineId);
String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toLowerCase(); String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toUpperCase();
// 查询最大的编号 // 查询最大的编号
...@@ -133,7 +133,7 @@ public class UnitCodeUtil { ...@@ -133,7 +133,7 @@ public class UnitCodeUtil {
Integer serialNum = 1; Integer serialNum = 1;
if (null != record && record.getUnitCode() != null) { if (null != record && record.getUnitCode() != null) {
// 流水号+1 // 流水号+1
serialNum = Integer.parseInt(record.getUnitCode().substring(6)) + 1; serialNum = Integer.parseInt(record.getUnitCode().substring(record.getUnitCode().length() - 4)) + 1;
} }
String serialNumStr = supplementZero(4, serialNum); String serialNumStr = supplementZero(4, serialNum);
...@@ -151,7 +151,7 @@ public class UnitCodeUtil { ...@@ -151,7 +151,7 @@ public class UnitCodeUtil {
public static String switchUnitCodeUtil(String lineId) { public static String switchUnitCodeUtil(String lineId) {
// 获取线别拼音 // 获取线别拼音
LineAlias lineAlias = lineAliasService.getById(lineId); LineAlias lineAlias = lineAliasService.getById(lineId);
String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toLowerCase(); String lineAliasPinyin = PinyinUtil.getFirstLetter(lineAlias.getLineAliasName(), "").toUpperCase();
// 查询最大的编号 // 查询最大的编号
...@@ -166,7 +166,7 @@ public class UnitCodeUtil { ...@@ -166,7 +166,7 @@ public class UnitCodeUtil {
Integer serialNum = 1; Integer serialNum = 1;
if (null != record && record.getUnitCode() != null) { if (null != record && record.getUnitCode() != null) {
// 流水号+1 // 流水号+1
serialNum = Integer.parseInt(record.getUnitCode().substring(6)) + 1; serialNum = Integer.parseInt(record.getUnitCode().substring(record.getUnitCode().length() - 4)) + 1;
} }
String serialNumStr = supplementZero(4, serialNum); String serialNumStr = supplementZero(4, serialNum);
...@@ -184,4 +184,18 @@ public class UnitCodeUtil { ...@@ -184,4 +184,18 @@ public class UnitCodeUtil {
return String.format("%0" + numLength + "d", num); return String.format("%0" + numLength + "d", num);
} }
/**
* 钢轨智能单元生成
*
* @param lineAliasId 线别ID
*/
public static void railIntelligentGeneration(String lineAliasId) {
List<Map<String, Object>> lineSpecialRail = railManagementService.getLineSpecialRail(lineAliasId);
// 1.判断完整的线路有没有空白部分(指剩余区间既不是道岔、曲线、竖曲线、钢轨的部分),只需要填空白部分,空白部分一定是钢轨,按照25一根的逻辑余数自成一根;
// 2.如果不存在空白部分,则定义道岔曲线竖曲线为绝对正确里程值,并且定义为特殊钢轨,相邻两个特殊钢轨之间的里程区间按照25一根的逻辑余数自成一根。
}
} }
\ No newline at end of file
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