Commit 48210361 authored by hkl's avatar hkl

feat:1.bug修复

parent 31133260
...@@ -65,6 +65,10 @@ ...@@ -65,6 +65,10 @@
<properties> <properties>
<package.environment>dev</package.environment> <package.environment>dev</package.environment>
</properties> </properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile> </profile>
<!-- 黄康林本地配置--> <!-- 黄康林本地配置-->
...@@ -73,10 +77,6 @@ ...@@ -73,10 +77,6 @@
<properties> <properties>
<package.environment>hkl</package.environment> <package.environment>hkl</package.environment>
</properties> </properties>
<!-- 是否默认 true表示默认-->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile> </profile>
<!-- 测试环境--> <!-- 测试环境-->
...@@ -93,7 +93,6 @@ ...@@ -93,7 +93,6 @@
<properties> <properties>
<package.environment>pressure</package.environment> <package.environment>pressure</package.environment>
</properties> </properties>
</profile> </profile>
<!-- 生成环境环境--> <!-- 生成环境环境-->
......
...@@ -7,18 +7,18 @@ import cn.hutool.poi.excel.ExcelReader; ...@@ -7,18 +7,18 @@ import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.config.AsyncTask;
import org.jeecg.modules.checkData.dto.MovementAdditiveInfoDTO; import org.jeecg.modules.checkData.dto.MovementAdditiveInfoDTO;
import org.jeecg.modules.checkData.dto.MovementRecordsMasterDTO; import org.jeecg.modules.checkData.dto.MovementRecordsMasterDTO;
import org.jeecg.modules.checkData.entity.*; import org.jeecg.modules.checkData.entity.*;
...@@ -43,7 +43,6 @@ import javax.transaction.Transactional; ...@@ -43,7 +43,6 @@ import javax.transaction.Transactional;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
...@@ -101,23 +100,19 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -101,23 +100,19 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@Resource @Resource
private IRailInspectionEquipmentItemDetailService railInspectionEquipmentItemDetailService; private IRailInspectionEquipmentItemDetailService railInspectionEquipmentItemDetailService;
@Resource
private AsyncTask asyncTask;
//**********************************人工静态检查****************************** //**********************************人工静态检查******************************
/** /**
* 动静态几何尺寸数据-分页列表查询 * 动静态几何尺寸数据-分页列表查询
*
* @param pageNo 1
* @param pageSize
* @param dto
* @return
*/ */
@AutoLog(value = "动静态几何尺寸数据-分页列表查询") @AutoLog(value = "动静态几何尺寸数据-分页列表查询")
@ApiOperation(value = "动静态几何尺寸数据-分页列表查询", notes = "动静态几何尺寸数据-分页列表查询") @ApiOperation(value = "动静态几何尺寸数据-分页列表查询", notes = "动静态几何尺寸数据-分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<IPage<MovementRecordsMasterVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, public Result<IPage<MovementRecordsMasterVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, MovementRecordsMasterDTO dto) {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
MovementRecordsMasterDTO dto) {
if (ObjectUtil.isEmpty(dto.getType())) { if (ObjectUtil.isEmpty(dto.getType())) {
return Result.error("传递参数不完整"); return Result.error("传递参数不完整");
} }
...@@ -138,10 +133,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -138,10 +133,7 @@ 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 = "lightRailId", required = true) String lightRailId, 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) {
@ApiParam(name = "lineAliasId", required = true) String lineAliasId,
@ApiParam(name = "区间id", required = false) String sectionId,
@ApiParam(name = "查询类型", required = true) String type) {
// 1.查询线路,线别,区间对象 // 1.查询线路,线别,区间对象
LightRail lightRail = lightRailService.getById(lightRailId); LightRail lightRail = lightRailService.getById(lightRailId);
...@@ -216,11 +208,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -216,11 +208,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@ApiOperation(value = "根据动静态几何尺寸数据主键查询检查里程相关信息", notes = "根据动静态几何尺寸数据主键查询检查里程相关信息") @ApiOperation(value = "根据动静态几何尺寸数据主键查询检查里程相关信息", notes = "根据动静态几何尺寸数据主键查询检查里程相关信息")
@GetMapping(value = "/getCourseList") @GetMapping(value = "/getCourseList")
public Result<List<MovementCourseVO>> getCourseList(@ApiParam(name = "动静态几何尺寸数据id") String id) { public Result<List<MovementCourseVO>> getCourseList(@ApiParam(name = "动静态几何尺寸数据id") String id) {
List<MovementCourse> listResult = movementCourseService.lambdaQuery() List<MovementCourse> listResult = movementCourseService.lambdaQuery().eq(ObjectUtil.isNotEmpty(id), MovementCourse::getMovementMasterId, id).eq(MovementCourse::getDelFlag, "0").orderByAsc(MovementCourse::getSort).list();
.eq(ObjectUtil.isNotEmpty(id), MovementCourse::getMovementMasterId, id)
.eq(MovementCourse::getDelFlag, "0")
.orderByAsc(MovementCourse::getSort)
.list();
List<MovementCourseVO> resultList = new ArrayList<>(); List<MovementCourseVO> resultList = new ArrayList<>();
if (listResult != null) { if (listResult != null) {
resultList = BeanCopyUtil.copyListProperties(listResult, MovementCourseVO::new); resultList = BeanCopyUtil.copyListProperties(listResult, MovementCourseVO::new);
...@@ -232,12 +220,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -232,12 +220,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@ApiOperation(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情", notes = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情") @ApiOperation(value = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情", notes = "根据动静态几何尺寸数据id和对应的里程相关信息id查询其详情")
@GetMapping(value = "/getInfoById") @GetMapping(value = "/getInfoById")
public Result<List<MovementCourseInfoOneVO>> getInfoById(@ApiParam(name = "动静态几何尺寸数据id") String movementMasterId, @ApiParam(name = "检查里程相关信息id") String movementCourseId) { public Result<List<MovementCourseInfoOneVO>> getInfoById(@ApiParam(name = "动静态几何尺寸数据id") String movementMasterId, @ApiParam(name = "检查里程相关信息id") String movementCourseId) {
List<MovementCourseInfo> listResult = movementCourseInfoService.lambdaQuery() List<MovementCourseInfo> listResult = movementCourseInfoService.lambdaQuery().eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId).eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId).eq(MovementCourseInfo::getDelFlag, "0").orderByAsc(MovementCourseInfo::getInfoSort).list();
.eq(ObjectUtil.isNotEmpty(movementMasterId), MovementCourseInfo::getMovementMasterId, movementMasterId)
.eq(ObjectUtil.isNotEmpty(movementCourseId), MovementCourseInfo::getMovementCourseId, movementCourseId)
.eq(MovementCourseInfo::getDelFlag, "0")
.orderByAsc(MovementCourseInfo::getInfoSort)
.list();
//初始化最终返回的集合 //初始化最终返回的集合
List<MovementCourseInfoOneVO> resultList = new ArrayList<>(); List<MovementCourseInfoOneVO> resultList = new ArrayList<>();
...@@ -272,7 +255,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -272,7 +255,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@ResponseBody @ResponseBody
public Result<String> saveOrUpdate(@RequestBody MovementRecordsMaster movementRecordsMaster) { public Result<String> saveOrUpdate(@RequestBody MovementRecordsMaster movementRecordsMaster) {
boolean state = validate(movementRecordsMaster); boolean state = validate(movementRecordsMaster);
if (false == state) { if (!state) {
return Result.error("传递参数不完整"); return Result.error("传递参数不完整");
} }
movementRecordsMaster.setDelFlag("0"); movementRecordsMaster.setDelFlag("0");
...@@ -404,19 +387,13 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -404,19 +387,13 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
String k = s.substring(s.indexOf("K") + 1, s.length()).trim(); String k = s.substring(s.indexOf("K") + 1, s.length()).trim();
// 按照“+”分割 // 按照“+”分割
startingAndEndingMileageStr = k.replace("\\s", "") startingAndEndingMileageStr = k.replace("\\s", "").replaceAll(" +", "").replace("+", "").trim();
.replaceAll(" +", "")
.replace("+", "")
.trim();
//结束里程 //结束里程
String s1 = start[1]; String s1 = start[1];
String[] ks1 = s1.replaceAll("\\s*", "") String[] ks1 = s1.replaceAll("\\s*", "").replaceAll(" ", "").split(",");
.replaceAll(" ", "")
.split(",");
String k1 = ks1[0]; String k1 = ks1[0];
String n1 = k1.replace("+", "") String n1 = k1.replace("+", "").replace("K", "");
.replace("K", "");
endingMileageStr = n1; endingMileageStr = n1;
//曲线半径 //曲线半径
...@@ -506,55 +483,48 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -506,55 +483,48 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
//获取轨距 //获取轨距
List<Object> trackGaugeList = rowRecords.get(7); List<Object> trackGaugeList = rowRecords.get(7);
String trackGauge = trackGaugeList.get(i).toString().trim(); String trackGauge = trackGaugeList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(trackGauge) if (ObjectUtil.isNotEmpty(trackGauge) && !("轨距").equals(trackGauge) && !p.matcher(trackGauge).matches()) {
&& !("轨距").equals(trackGauge) && !p.matcher(trackGauge).matches()) {
movementCourseInfo.setTrackGauge(trackGauge); movementCourseInfo.setTrackGauge(trackGauge);
} }
//获取水平 //获取水平
List<Object> levelList = rowRecords.get(8); List<Object> levelList = rowRecords.get(8);
String level = levelList.get(i).toString().trim(); String level = levelList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(level) if (ObjectUtil.isNotEmpty(level) && !("水平").equals(level) && !p.matcher(level).matches()) {
&& !("水平").equals(level) && !p.matcher(level).matches()) {
movementCourseInfo.setLevel(level); movementCourseInfo.setLevel(level);
} }
//获取三角坑 //获取三角坑
List<Object> triangularPitList = rowRecords.get(9); List<Object> triangularPitList = rowRecords.get(9);
String triangularPit = triangularPitList.get(i).toString().trim(); String triangularPit = triangularPitList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(triangularPit) if (ObjectUtil.isNotEmpty(triangularPit) && !("三角坑").equals(triangularPit) && !p.matcher(triangularPit).matches()) {
&& !("三角坑").equals(triangularPit) && !p.matcher(triangularPit).matches()) {
movementCourseInfo.setTriangularPit(triangularPit); movementCourseInfo.setTriangularPit(triangularPit);
} }
//获取方向 //获取方向
List<Object> directionList = rowRecords.get(10); List<Object> directionList = rowRecords.get(10);
String direction = directionList.get(i).toString().trim(); String direction = directionList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(direction) if (ObjectUtil.isNotEmpty(direction) && !("方向").equals(direction) && !p.matcher(direction).matches()) {
&& !("方向").equals(direction) && !p.matcher(direction).matches()) {
movementCourseInfo.setDirection(direction); movementCourseInfo.setDirection(direction);
} }
//获取高低 //获取高低
List<Object> heightList = rowRecords.get(11); List<Object> heightList = rowRecords.get(11);
String height = heightList.get(i).toString().trim(); String height = heightList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(height) if (ObjectUtil.isNotEmpty(height) && !("高低").equals(height) && !p.matcher(height).matches()) {
&& !("高低").equals(height) && !p.matcher(height).matches()) {
movementCourseInfo.setHeight(height); movementCourseInfo.setHeight(height);
} }
//获取结构 //获取结构
List<Object> structureList = rowRecords.get(12); List<Object> structureList = rowRecords.get(12);
String structure = structureList.get(i).toString().trim(); String structure = structureList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(structure) if (ObjectUtil.isNotEmpty(structure) && !("结构").equals(structure) && !p.matcher(structure).matches()) {
&& !("结构").equals(structure) && !p.matcher(structure).matches()) {
movementCourseInfo.setStructure(structure); movementCourseInfo.setStructure(structure);
} }
//获取整改 //获取整改
List<Object> rectificationList = rowRecords.get(13); List<Object> rectificationList = rowRecords.get(13);
String rectification = rectificationList.get(i).toString().trim(); String rectification = rectificationList.get(i).toString().trim();
if (ObjectUtil.isNotEmpty(rectification) if (ObjectUtil.isNotEmpty(rectification) && !("整改").equals(rectification) && !p.matcher(rectification).matches()) {
&& !("整改").equals(rectification) && !p.matcher(rectification).matches()) {
movementCourseInfo.setRectification(rectification); movementCourseInfo.setRectification(rectification);
} }
resultList.add(movementCourseInfo); resultList.add(movementCourseInfo);
...@@ -592,7 +562,6 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -592,7 +562,6 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "人工静态检查数据-保存曲线半径信息") @AutoLog(value = "人工静态检查数据-保存曲线半径信息")
@ApiOperation(value = "人工静态检查数据-保存曲线半径信息", notes = "人工静态检查数据-保存曲线半径信息") @ApiOperation(value = "人工静态检查数据-保存曲线半径信息", notes = "人工静态检查数据-保存曲线半径信息")
@PostMapping(value = "/saveAdditive") @PostMapping(value = "/saveAdditive")
// @PostMapping(value = "/saveLabourCheckItem")
public Result<String> saveLabourCheckItem(@RequestBody MovementCourse record) { public Result<String> saveLabourCheckItem(@RequestBody MovementCourse record) {
...@@ -604,9 +573,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -604,9 +573,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "人工静态检查数据-更新曲线半径信息") @AutoLog(value = "人工静态检查数据-更新曲线半径信息")
@ApiOperation(value = "人工静态检查数据-更新曲线半径信息", notes = "人工静态检查数据-更新曲线半径信息") @ApiOperation(value = "人工静态检查数据-更新曲线半径信息", notes = "人工静态检查数据-更新曲线半径信息")
@PostMapping(value = "/updateAdditive") @PostMapping(value = "/updateAdditive")
// @PostMapping(value = "/updateLabourCheckItem")
public Result<String> updateLabourCheckItem(@RequestBody MovementCourse record) { public Result<String> updateLabourCheckItem(@RequestBody MovementCourse record) {
// 保存人工项目检查表
movementRecordsMasterFace.updateLabourCheckItem(record); movementRecordsMasterFace.updateLabourCheckItem(record);
return Result.OK("操作成功"); return Result.OK("操作成功");
...@@ -615,14 +582,10 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -615,14 +582,10 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "人工静态检查数据-删除曲线半径信息") @AutoLog(value = "人工静态检查数据-删除曲线半径信息")
@ApiOperation(value = "人工静态检查数据-删除曲线半径信息", notes = "人工静态检查数据-删除曲线半径信息") @ApiOperation(value = "人工静态检查数据-删除曲线半径信息", notes = "人工静态检查数据-删除曲线半径信息")
@GetMapping(value = "/deleteAdditive") @GetMapping(value = "/deleteAdditive")
@ApiImplicitParams({ @ApiImplicitParams({@ApiImplicitParam(name = "movementCourseId", required = true, value = "曲线半径信息Id")})
@ApiImplicitParam(name = "movementCourseId", required = true, value = "曲线半径信息Id")
})
public Result<String> deleteAdditive(String movementCourseId) { public Result<String> deleteAdditive(String movementCourseId) {
//删除里程详情 //删除里程详情
movementCourseInfoService.lambdaUpdate() movementCourseInfoService.lambdaUpdate().eq(MovementCourseInfo::getMovementCourseId, movementCourseId).remove();
.eq(MovementCourseInfo::getMovementCourseId, movementCourseId)
.remove();
//删除里程相关 //删除里程相关
movementCourseService.removeById(movementCourseId); movementCourseService.removeById(movementCourseId);
...@@ -648,17 +611,8 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -648,17 +611,8 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
String id = String.valueOf(jsonObject.get("id")); String id = String.valueOf(jsonObject.get("id"));
movementCourseInfoService.lambdaUpdate() movementCourseInfoService.lambdaUpdate().set(jsonObject.containsKey("trackGauge"), MovementCourseInfo::getTrackGauge, jsonObject.get("trackGauge")).set(jsonObject.containsKey("level"), MovementCourseInfo::getLevel, jsonObject.get("level")) // 水平
.set(jsonObject.containsKey("trackGauge"), MovementCourseInfo::getTrackGauge, jsonObject.get("trackGauge")) .set(jsonObject.containsKey("triangularPit"), MovementCourseInfo::getTriangularPit, jsonObject.get("triangularPit")).set(jsonObject.containsKey("direction"), MovementCourseInfo::getDirection, jsonObject.get("direction")).set(jsonObject.containsKey("height"), MovementCourseInfo::getHeight, jsonObject.get("height")).set(jsonObject.containsKey("structure"), MovementCourseInfo::getStructure, jsonObject.get("structure")).set(jsonObject.containsKey("rectification"), MovementCourseInfo::getRectification, jsonObject.get("rectification")).set(MovementCourseInfo::getUpdateTime, new Date()).eq(MovementCourseInfo::getId, id).update();
.set(jsonObject.containsKey("level"), MovementCourseInfo::getLevel, jsonObject.get("level")) // 水平
.set(jsonObject.containsKey("triangularPit"), MovementCourseInfo::getTriangularPit, jsonObject.get("triangularPit"))
.set(jsonObject.containsKey("direction"), MovementCourseInfo::getDirection, jsonObject.get("direction"))
.set(jsonObject.containsKey("height"), MovementCourseInfo::getHeight, jsonObject.get("height"))
.set(jsonObject.containsKey("structure"), MovementCourseInfo::getStructure, jsonObject.get("structure"))
.set(jsonObject.containsKey("rectification"), MovementCourseInfo::getRectification, jsonObject.get("rectification"))
.set(MovementCourseInfo::getUpdateTime, new Date())
.eq(MovementCourseInfo::getId, id)
.update();
return Result.OK("操作成功"); return Result.OK("操作成功");
...@@ -678,9 +632,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -678,9 +632,7 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@AutoLog(value = "查询添乘仪详情") @AutoLog(value = "查询添乘仪详情")
@ApiOperation(value = "查询添乘仪详情", notes = "查询添乘仪详情") @ApiOperation(value = "查询添乘仪详情", notes = "查询添乘仪详情")
@GetMapping(value = "/getMovementAdditiveInfo") @GetMapping(value = "/getMovementAdditiveInfo")
public Result<IPage<MovementAdditiveInfoVO>> getMovementAdditiveInfo(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, public Result<IPage<MovementAdditiveInfoVO>> getMovementAdditiveInfo(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, MovementAdditiveInfoDTO dto) {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
MovementAdditiveInfoDTO dto) {
if (ObjectUtil.isEmpty(dto.getMovementMasterId())) { if (ObjectUtil.isEmpty(dto.getMovementMasterId())) {
return Result.error("参数不完整"); return Result.error("参数不完整");
} }
...@@ -818,68 +770,35 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -818,68 +770,35 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if ("1".equals(type)) { if ("1".equals(type)) {
//轨检车-》轨道动态几何尺寸容许值差管理值 //轨检车-》轨道动态几何尺寸容许值差管理值
List<MovementDiferenceManager> list = movementDiferenceManagerService.lambdaQuery() List<MovementDiferenceManager> list = movementDiferenceManagerService.lambdaQuery().eq(MovementDiferenceManager::getMovementMasterId, id).eq(MovementDiferenceManager::getDelFlag, "0").orderByAsc(MovementDiferenceManager::getSort).list();
.eq(MovementDiferenceManager::getMovementMasterId, id)
.eq(MovementDiferenceManager::getDelFlag, "0")
.orderByAsc(MovementDiferenceManager::getSort)
.list();
map.put("movementDiference", list); map.put("movementDiference", list);
} else if ("2".equals(type) && ObjectUtil.isNotEmpty(overType)) { } else if ("2".equals(type) && ObjectUtil.isNotEmpty(overType)) {
//轨检车-》超限记录报告 //轨检车-》超限记录报告
List<MovementOverReport> list = movementOverReportService.lambdaQuery() List<MovementOverReport> list = movementOverReportService.lambdaQuery().eq(MovementOverReport::getMovementMasterId, id).eq(MovementOverReport::getOverrunLevel, overType).eq(MovementOverReport::getDelFlag, "0").orderByAsc(MovementOverReport::getSort).list();
.eq(MovementOverReport::getMovementMasterId, id)
.eq(MovementOverReport::getOverrunLevel, overType)
.eq(MovementOverReport::getDelFlag, "0")
.orderByAsc(MovementOverReport::getSort)
.list();
map.put("movementOverReport", list); map.put("movementOverReport", list);
} else if ("3".equals(type)) { } else if ("3".equals(type)) {
//轨检车-》区段总结报告 //轨检车-》区段总结报告
List<MovementSectionReport> list = movementSectionReportService.lambdaQuery() List<MovementSectionReport> list = movementSectionReportService.lambdaQuery().eq(MovementSectionReport::getMovementMasterId, id).eq(MovementSectionReport::getDelFlag, "0").orderByAsc(MovementSectionReport::getSort).list();
.eq(MovementSectionReport::getMovementMasterId, id)
.eq(MovementSectionReport::getDelFlag, "0")
.orderByAsc(MovementSectionReport::getSort)
.list();
map.put("movementSectionReport", list); map.put("movementSectionReport", list);
} else if ("4".equals(type)) { } else if ("4".equals(type)) {
//轨检车-》公里总结报告表 //轨检车-》公里总结报告表
List<MovementSummaryReport> list = movementSummaryReportService.lambdaQuery() List<MovementSummaryReport> list = movementSummaryReportService.lambdaQuery().eq(MovementSummaryReport::getMovementMasterId, id).eq(MovementSummaryReport::getDelFlag, "0").orderByAsc(MovementSummaryReport::getSort).list();
.eq(MovementSummaryReport::getMovementMasterId, id)
.eq(MovementSummaryReport::getDelFlag, "0")
.orderByAsc(MovementSummaryReport::getSort)
.list();
map.put("movementSummaryReport", list); map.put("movementSummaryReport", list);
} else if ("5".equals(type)) { } else if ("5".equals(type)) {
//轨检车-》TQI公里总结报告 //轨检车-》TQI公里总结报告
List<MovementTqiKilometerReport> list = movementTqiKilometerReportService.lambdaQuery() List<MovementTqiKilometerReport> list = movementTqiKilometerReportService.lambdaQuery().eq(MovementTqiKilometerReport::getMovementMasterId, id).eq(MovementTqiKilometerReport::getDelFlag, "0").orderByAsc(MovementTqiKilometerReport::getSort).list();
.eq(MovementTqiKilometerReport::getMovementMasterId, id)
.eq(MovementTqiKilometerReport::getDelFlag, "0")
.orderByAsc(MovementTqiKilometerReport::getSort)
.list();
map.put("movementTqiKilometerReport", list); map.put("movementTqiKilometerReport", list);
} else if ("6".equals(type)) { } else if ("6".equals(type)) {
//轨检车-》TQI公里状态评定标准 //轨检车-》TQI公里状态评定标准
List<MovementTqiKilometerStandardManager> list = movementTqiKilometerStandardManagerService.lambdaQuery() List<MovementTqiKilometerStandardManager> list = movementTqiKilometerStandardManagerService.lambdaQuery().eq(MovementTqiKilometerStandardManager::getMovementMasterId, id).eq(MovementTqiKilometerStandardManager::getDelFlag, "0").orderByAsc(MovementTqiKilometerStandardManager::getSort).list();
.eq(MovementTqiKilometerStandardManager::getMovementMasterId, id)
.eq(MovementTqiKilometerStandardManager::getDelFlag, "0")
.orderByAsc(MovementTqiKilometerStandardManager::getSort)
.list();
map.put("movementTqiKilometerStandardManager", list); map.put("movementTqiKilometerStandardManager", list);
} else if ("7".equals(type)) { } else if ("7".equals(type)) {
//轨检车-》TQI总结报告 //轨检车-》TQI总结报告
List<MovementTqiReport> list = movementTqiReportService.lambdaQuery() List<MovementTqiReport> list = movementTqiReportService.lambdaQuery().eq(MovementTqiReport::getMovementMasterId, id).eq(MovementTqiReport::getDelFlag, "0").orderByAsc(MovementTqiReport::getSort).list();
.eq(MovementTqiReport::getMovementMasterId, id)
.eq(MovementTqiReport::getDelFlag, "0")
.orderByAsc(MovementTqiReport::getSort)
.list();
map.put("movementTqiReport", list); map.put("movementTqiReport", list);
} else { } else {
//轨检车-》200m区段轨道不平顺质量指数TQI管理标准(单位:mm) //轨检车-》200m区段轨道不平顺质量指数TQI管理标准(单位:mm)
List<MovementTqiStandardManager> list = movementTqiStandardManagerService.lambdaQuery() List<MovementTqiStandardManager> list = movementTqiStandardManagerService.lambdaQuery().eq(MovementTqiStandardManager::getMovementMasterId, id).eq(MovementTqiStandardManager::getDelFlag, "0").orderByAsc(MovementTqiStandardManager::getSort).list();
.eq(MovementTqiStandardManager::getMovementMasterId, id)
.eq(MovementTqiStandardManager::getDelFlag, "0")
.orderByAsc(MovementTqiStandardManager::getSort)
.list();
map.put("movementTqiStandardManager", list); map.put("movementTqiStandardManager", list);
} }
return Result.OK(map); return Result.OK(map);
...@@ -889,125 +808,165 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec ...@@ -889,125 +808,165 @@ public class MovementRecordsMasterController extends JeecgController<MovementRec
@ApiOperation(value = "轨检车导入", notes = "轨检车导入") @ApiOperation(value = "轨检车导入", notes = "轨检车导入")
@PostMapping(value = "/trackUpload") @PostMapping(value = "/trackUpload")
@Transactional @Transactional
public Result<String> trackUploadFile(MultipartFile file, @ApiParam(name = "动静态几何尺寸主键id") String id) throws Exception { public Result<String> trackUploadFile(MultipartFile file, @ApiParam(name = "动静态几何尺寸主键id") String id) {
try { List<List<Object>> rowRecords;
//初始化数据模板
boolean state = this.initData(id); //读取Excel中的数据
if (!state) { try (InputStream inputStream = file.getInputStream()) {
return Result.error("初始化数据失败"); rowRecords = ExcelAnalysisUtils.getListByExcel(inputStream);
} } catch (Exception e) {
InputStream in = file.getInputStream(); throw new RuntimeException(e);
//读取Excel中的数据 }
List<List<Object>> rowRecords = ExcelAnalysisUtils.getListByExcel(in);
//获取当前登录人信息 //获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname(); String realname = user.getRealname();
//初始化导入顺序 //初始化导入顺序
int sort = 0; int sort = 0;
//初始化公里总结报告集合 //初始化公里总结报告集合
List<MovementSummaryReport> movementSummaryReportList = new ArrayList<>(); List<MovementSummaryReport> movementSummaryReportList = new ArrayList<>();
//初始化TQI公里总结报告集合 //初始化TQI公里总结报告集合
List<MovementTqiKilometerReport> movementTqiKilometerReportList = new ArrayList<>(); List<MovementTqiKilometerReport> movementTqiKilometerReportList = new ArrayList<>();
//初始化TQI总结报告表集合 //初始化TQI总结报告表集合
List<MovementTqiReport> movementTqiReportList = new ArrayList<>(); List<MovementTqiReport> movementTqiReportList = new ArrayList<>();
//初始化区段总结报告集合 //初始化区段总结报告集合
List<MovementSectionReport> movementSectionReportList = new ArrayList<>(); List<MovementSectionReport> movementSectionReportList = new ArrayList<>();
//初始化超限记录报告集合 //初始化超限记录报告集合
List<MovementOverReport> movementOverReportList = new ArrayList<>(); List<MovementOverReport> movementOverReportList = new ArrayList<>();
//初始化轨道动态几何尺寸容许值差管理值集合 //初始化轨道动态几何尺寸容许值差管理值集合
List<MovementDiferenceManager> movementDiferenceManagertList = new ArrayList<>(); List<MovementDiferenceManager> movementDiferenceManagertList = new ArrayList<>();
//初始化200m区段轨道不平顺质量指数TQI管理标准(单位:mm)集合 //初始化200m区段轨道不平顺质量指数TQI管理标准(单位:mm)集合
List<MovementTqiStandardManager> movementTqiStandardManagerList = new ArrayList<>(); List<MovementTqiStandardManager> movementTqiStandardManagerList = new ArrayList<>();
//初始化TQI公里状态评定标准集合 //初始化TQI公里状态评定标准集合
List<MovementTqiKilometerStandardManager> movementTqiKilometerStandardManagerList = new ArrayList<>(); List<MovementTqiKilometerStandardManager> movementTqiKilometerStandardManagerList = new ArrayList<>();
for (int i = 0; i < rowRecords.size(); i++) {
List<Object> list = rowRecords.get(i); // 模板检查list
if (list == null || list.size() <= 0) { Map<String, Boolean> templateCheckMap = new LinkedHashMap<>();
continue; for (int i = 0; i < rowRecords.size(); i++) {
} List<Object> list = rowRecords.get(i);
String str = list.get(0).toString().trim(); if (list == null || list.size() <= 0) {
if (str.equals("")) { continue;
}
String str = list.get(0).toString().trim();
if (str.equals("")) {
continue;
}
if (str.equals("轨道动态几何尺寸容许值差管理值")) {
//处理轨道动态几何尺寸容许值差管理值解析封装逻辑
int dataOne = this.uploadMovementDiferenceManager(movementDiferenceManagertList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("200m区段轨道不平顺质量指数TQI管理标准(单位:mm)")) {
//处理200m区段轨道不平顺质量指数TQI管理标准(单位:mm)解析封装逻辑
int dataOne = this.uploadMovementTqiStandardManager(movementTqiStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("TQI公里状态评定标准")) {
//处理TQI公里状态评定标准解析封装逻辑
int dataOne = this.uploadMovementTqiKilometerStandardManager(movementTqiKilometerStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("四级缺陷记录报告表") || str.equals("三级缺陷记录报告表") || str.equals("二级缺陷记录报告表") || str.equals("一级缺陷记录报告表")) {
//处理超限记录报告解析封装逻辑
int dataOne = this.uploadMovementOverReport(movementOverReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("TQI总结报告表")) {
//处理TQI总结报告表解析封装逻辑
int dataOne = this.uploadMovementTqiReport(movementTqiReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("TQI公里总结报告表")) {
//处理TQI公里总结报告表解析封装逻辑
int dataOne = this.uploadMovementTqiKilometerReport(movementTqiKilometerReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("公里总结报告表")) {
//处理公里总结报告表解析封装逻辑
int dataOne = this.uploadMovementSummaryReport(movementSummaryReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else if (str.equals("区段总结报告表")) {
//处理区段总结报告表解析封装逻辑
int dataOne = this.uploadMovementSectionReport(movementSectionReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
templateCheckMap.put(str, true); // 表示存在
} else {
if (i != rowRecords.size() - 1) {
continue; continue;
} }
if (str.equals("轨道动态几何尺寸容许值差管理值")) {
//处理轨道动态几何尺寸容许值差管理值解析封装逻辑
int dataOne = this.uploadMovementDiferenceManager(movementDiferenceManagertList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("200m区段轨道不平顺质量指数TQI管理标准(单位:mm)")) {
//处理200m区段轨道不平顺质量指数TQI管理标准(单位:mm)解析封装逻辑
int dataOne = this.uploadMovementTqiStandardManager(movementTqiStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("TQI公里状态评定标准")) {
//处理TQI公里状态评定标准解析封装逻辑
int dataOne = this.uploadMovementTqiKilometerStandardManager(movementTqiKilometerStandardManagerList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("四级缺陷记录报告表") || str.equals("三级缺陷记录报告表") || str.equals("二级缺陷记录报告表") || str.equals("一级缺陷记录报告表")) {
//处理超限记录报告解析封装逻辑
int dataOne = this.uploadMovementOverReport(movementOverReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("TQI总结报告表")) {
//处理TQI总结报告表解析封装逻辑
int dataOne = this.uploadMovementTqiReport(movementTqiReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("TQI公里总结报告表")) {
//处理TQI公里总结报告表解析封装逻辑
int dataOne = this.uploadMovementTqiKilometerReport(movementTqiKilometerReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("公里总结报告表")) {
//处理公里总结报告表解析封装逻辑
int dataOne = this.uploadMovementSummaryReport(movementSummaryReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else if (str.equals("区段总结报告表")) {
//处理区段总结报告表解析封装逻辑
int dataOne = this.uploadMovementSectionReport(movementSectionReportList, i, sort, realname, rowRecords, id);
i = i + dataOne;
} else {
if (i != rowRecords.size() - 1) {
continue;
} else {
//释放资源
in.close();
}
}
} }
//维护公里总结报告表 }
if (movementSummaryReportList != null && movementSummaryReportList.size() > 0) {
movementSummaryReportService.saveBatch(movementSummaryReportList); List<String> templateCheckList = Arrays.asList("轨道动态几何尺寸容许值差管理值", "TQI公里状态评定标准", "200m区段轨道不平顺质量指数TQI管理标准(单位:mm)", "TQI总结报告表", "TQI公里总结报告表", "公里总结报告表", "区段总结报告表");
for (String item : templateCheckList) {
if (!templateCheckMap.containsKey(item)) {
throw JeecgBootException.error("请导入正确的模板");
} }
//维护TQI公里总结报告表 }
if (movementTqiKilometerReportList != null && movementTqiKilometerReportList.size() > 0) {
//初始化数据模板
boolean state = this.initData(id);
if (!state) {
return Result.error("初始化数据失败");
}
//维护公里总结报告表
if (movementSummaryReportList != null && movementSummaryReportList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementSummaryReportService.saveBatch(movementSummaryReportList);
});
}
//维护TQI公里总结报告表
if (movementTqiKilometerReportList != null && movementTqiKilometerReportList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementTqiKilometerReportService.saveBatch(movementTqiKilometerReportList); movementTqiKilometerReportService.saveBatch(movementTqiKilometerReportList);
} });
//维护TQI总结报告表 }
if (movementTqiReportList != null && movementTqiReportList.size() > 0) { //维护TQI总结报告表
if (movementTqiReportList != null && movementTqiReportList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementTqiReportService.saveBatch(movementTqiReportList); movementTqiReportService.saveBatch(movementTqiReportList);
} });
//维护超限记录报告 }
if (movementOverReportList != null && movementOverReportList.size() > 0) { //维护超限记录报告
if (movementOverReportList != null && movementOverReportList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementOverReportService.saveBatch(movementOverReportList); movementOverReportService.saveBatch(movementOverReportList);
} });
//维护区段总结报告 }
if (movementSectionReportList != null && movementSectionReportList.size() > 0) { //维护区段总结报告
if (movementSectionReportList != null && movementSectionReportList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementSectionReportService.saveBatch(movementSectionReportList); movementSectionReportService.saveBatch(movementSectionReportList);
} });
//维护轨道动态几何尺寸容许值差管理值 }
if (movementDiferenceManagertList != null && movementDiferenceManagertList.size() > 0) { //维护轨道动态几何尺寸容许值差管理值
if (movementDiferenceManagertList != null && movementDiferenceManagertList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementDiferenceManagerService.saveBatch(movementDiferenceManagertList); movementDiferenceManagerService.saveBatch(movementDiferenceManagertList);
} });
//维护200m区段轨道不平顺质量指数TQI管理标准(单位:mm) }
if (movementTqiStandardManagerList != null && movementTqiStandardManagerList.size() > 0) { //维护200m区段轨道不平顺质量指数TQI管理标准(单位:mm)
if (movementTqiStandardManagerList != null && movementTqiStandardManagerList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementTqiStandardManagerService.saveBatch(movementTqiStandardManagerList); movementTqiStandardManagerService.saveBatch(movementTqiStandardManagerList);
} });
//维护TQI公里状态评定标准 }
if (movementTqiKilometerStandardManagerList != null && movementTqiKilometerStandardManagerList.size() > 0) { //维护TQI公里状态评定标准
if (movementTqiKilometerStandardManagerList != null && movementTqiKilometerStandardManagerList.size() > 0) {
asyncTask.getAsyncExecutor().execute(() -> {
movementTqiKilometerStandardManagerService.saveBatch(movementTqiKilometerStandardManagerList); movementTqiKilometerStandardManagerService.saveBatch(movementTqiKilometerStandardManagerList);
} });
}
//释放资源 try {
in.close(); Thread.sleep(2000); //等待2000毫秒,即2秒
} catch (Exception e) { } catch (InterruptedException e) {
e.getMessage(); e.printStackTrace();
} }
return Result.ok("操作成功"); return Result.ok("操作成功");
} }
......
...@@ -15,6 +15,7 @@ import org.jeecg.common.api.vo.Result; ...@@ -15,6 +15,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.checkData.dto.RecordsMasterCheckDTO; import org.jeecg.modules.checkData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.entity.*; import org.jeecg.modules.checkData.entity.*;
import org.jeecg.modules.checkData.service.*; import org.jeecg.modules.checkData.service.*;
...@@ -138,6 +139,7 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC ...@@ -138,6 +139,7 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
recordsMasterCheck.setUpdateTime(new Date()); recordsMasterCheck.setUpdateTime(new Date());
recordsMasterCheck.setDelFlag("0"); recordsMasterCheck.setDelFlag("0");
if (ObjectUtil.isEmpty(recordsMasterCheck.getId())) { if (ObjectUtil.isEmpty(recordsMasterCheck.getId())) {
recordsMasterCheck.setId(UUIDGenerator.generate());
this.service.save(recordsMasterCheck); this.service.save(recordsMasterCheck);
} else { } else {
this.service.updateById(recordsMasterCheck); this.service.updateById(recordsMasterCheck);
......
package org.jeecg.modules.checkData.face.impl; package org.jeecg.modules.checkData.face.impl;
import cn.hutool.core.util.ObjectUtil;
import org.jeecg.common.util.UUIDGenerator; import org.jeecg.common.util.UUIDGenerator;
import org.jeecg.modules.checkData.entity.MovementCourse; import org.jeecg.modules.checkData.entity.MovementCourse;
import org.jeecg.modules.checkData.entity.MovementCourseInfo; import org.jeecg.modules.checkData.entity.MovementCourseInfo;
...@@ -71,7 +72,16 @@ public class MovementRecordsMasterFaceImpl implements MovementRecordsMasterFace ...@@ -71,7 +72,16 @@ public class MovementRecordsMasterFaceImpl implements MovementRecordsMasterFace
@Override @Override
public void updateLabourCheckItem(MovementCourse record) { public void updateLabourCheckItem(MovementCourse record) {
movementCourseService.lambdaUpdate()
.set(MovementCourse::getCourseStartingMileage, record.getCourseStartingMileage())
.set(MovementCourse::getCourseEndMileage, record.getCourseEndMileage())
.set(MovementCourse::getCurveRadius, record.getCurveRadius())
.set(MovementCourse::getSuperHigh, record.getSuperHigh())
.set(MovementCourse::getWiden, record.getWiden())
.set(MovementCourse::getSlopeRatio, record.getSlopeRatio())
.set(MovementCourse::getLongExtent, record.getLongExtent())
.eq(MovementCourse::getId, record.getId())
.update();
} }
/** /**
......
...@@ -1189,7 +1189,7 @@ public class AnalysisAlgorithm { ...@@ -1189,7 +1189,7 @@ public class AnalysisAlgorithm {
transfinite.setEkItemId(movementOverReport.getId()); transfinite.setEkItemId(movementOverReport.getId());
transfinite.setMeasurePointValue(movementOverReport.getPeakValue()); transfinite.setMeasurePointValue(movementOverReport.getPeakValue());
transfinite.setIsWork(isWork); transfinite.setIsWork(isWork);
transfinite.setDiseaseMileage(movementOverReport.getMileage()); transfinite.setDiseaseMileage(movementOverReport.getMileage().multiply(new BigDecimal("1000")));
transfinite.setTransfiniteGradeName(reasonLabel); transfinite.setTransfiniteGradeName(reasonLabel);
...@@ -1238,8 +1238,6 @@ public class AnalysisAlgorithm { ...@@ -1238,8 +1238,6 @@ public class AnalysisAlgorithm {
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage(); BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage();
// System.out.printf("【" + checkItemStartingMileage + "-" + checkItemEndMileage + "]");
// 2.2.1 命中检查项目 // 2.2.1 命中检查项目
if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) { if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) {
List<RailInspectionEquipmentItemDetail> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId()); List<RailInspectionEquipmentItemDetail> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId());
...@@ -1270,8 +1268,11 @@ public class AnalysisAlgorithm { ...@@ -1270,8 +1268,11 @@ public class AnalysisAlgorithm {
map.setCheckDetailEndMileage(currentEndEndMileage); map.setCheckDetailEndMileage(currentEndEndMileage);
movementCheckDataUnitDeviceMaps.add(map); movementCheckDataUnitDeviceMaps.add(map);
// 计算超限:如果为null则计算,否则和单元绑定 // 计算超限:如果为null则计算,否则和单元绑定
if (null == transfinite) { if (null == transfinite) {
movementCourseInfo.setCurrentStartMileage(currentStartMileage);
movementCourseInfo.setCurrentEndEndMileage(currentEndEndMileage);
transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo); transfinite = this.railDeviceCheckTransfinite(analysisBatch, movementCourseInfo);
} else { } else {
unitDevice.put("railDeviceTransfinite", transfinite); unitDevice.put("railDeviceTransfinite", transfinite);
......
package org.jeecg.modules.dynamicStaticAnalysis.controller; package org.jeecg.modules.dynamicStaticAnalysis.controller;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
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;
...@@ -20,6 +21,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO; ...@@ -20,6 +21,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -62,9 +64,9 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna ...@@ -62,9 +64,9 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna
// 查询明细 // 查询明细
List<AnalysisBatchQueryVO> records = pageData.getRecords(); List<AnalysisBatchQueryVO> records = pageData.getRecords();
if (ObjectUtil.isNotEmpty(records)) { if (ObjectUtil.isNotEmpty(records)) {
// 新增明细
List<String> analysisBatchIds = records.stream().map(AnalysisBatchQueryVO::getId).collect(Collectors.toList()); List<String> analysisBatchIds = records.stream().map(AnalysisBatchQueryVO::getId).collect(Collectors.toList());
List<CheckBatchVO> checkBatchList = this.service.listRecordDetail(analysisBatchIds); List<CheckBatchVO> checkBatchList = this.service.listRecordDetail(analysisBatchIds);
if (ObjectUtil.isNotEmpty(checkBatchList)) { if (ObjectUtil.isNotEmpty(checkBatchList)) {
Map<String, List<CheckBatchVO>> analysisBatchMap = checkBatchList.stream().collect(Collectors.groupingBy(CheckBatchVO::getAnalysisBatchId)); Map<String, List<CheckBatchVO>> analysisBatchMap = checkBatchList.stream().collect(Collectors.groupingBy(CheckBatchVO::getAnalysisBatchId));
records.forEach(record -> { records.forEach(record -> {
...@@ -72,6 +74,21 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna ...@@ -72,6 +74,21 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna
record.setCheckBatchList(checkBatchVOS); record.setCheckBatchList(checkBatchVOS);
}); });
} }
// 获取是否可编辑列表
List<Map<String, Object>> isEditList = this.service.getIsEditList(analysisBatchIds);
if (ObjectUtil.isNotEmpty(isEditList)) {
Map<String, Boolean> isEditMap = isEditList.stream().collect(
Collectors.toMap(
key -> key.get("id").toString(),
value -> !Convert.toBool(value.get("isEdit"))
)
);
records.forEach(record -> {
record.setEdit(isEditMap.get(record.getId()));
});
}
} }
return Result.OK(pageData); return Result.OK(pageData);
......
...@@ -10,6 +10,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO; ...@@ -10,6 +10,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.jeecg.modules.homePage.vo.ToDoDetailVO; import org.jeecg.modules.homePage.vo.ToDoDetailVO;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -28,4 +29,6 @@ public interface AnalysisBatchMapper extends BaseMapper<AnalysisBatch> { ...@@ -28,4 +29,6 @@ public interface AnalysisBatchMapper extends BaseMapper<AnalysisBatch> {
List<CheckBatchVO> listRecordDetail(List<String> analysisBatchIds); List<CheckBatchVO> listRecordDetail(List<String> analysisBatchIds);
List<ToDoDetailVO> getTodoList(String currentUserId); List<ToDoDetailVO> getTodoList(String currentUserId);
List<Map<String, Object>> getIsEditList(List<String> analysisBatchIds);
} }
...@@ -127,4 +127,18 @@ ...@@ -127,4 +127,18 @@
AND t3.create_by = #{currentUserId} AND t3.create_by = #{currentUserId}
</if> </if>
</select> </select>
<select id="getIsEditList" resultType="java.util.Map">
SELECT
t1.id,
COUNT(t3.analysis_batch_unit_device_id) isEdit
FROM
t_dsa_analysis_batch t1
LEFT JOIN t_dsa_analysis_batch_unit_device t2 ON t1.id = t2.analysis_batch_id
LEFT JOIN t_mw_work_batch_detail t3 ON t2.id = t3.analysis_batch_unit_device_id
WHERE t1.id IN
<foreach collection="analysisBatchIds" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
GROUP BY t1.id
</select>
</mapper> </mapper>
...@@ -11,6 +11,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO; ...@@ -11,6 +11,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.jeecg.modules.homePage.vo.ToDoDetailVO; import org.jeecg.modules.homePage.vo.ToDoDetailVO;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -35,4 +36,6 @@ public interface IAnalysisBatchService extends IService<AnalysisBatch> { ...@@ -35,4 +36,6 @@ public interface IAnalysisBatchService extends IService<AnalysisBatch> {
List<CheckBatchVO> listRecordDetail(List<String> analysisBatchIds); List<CheckBatchVO> listRecordDetail(List<String> analysisBatchIds);
List<ToDoDetailVO> getTodoList(String currentUserId); List<ToDoDetailVO> getTodoList(String currentUserId);
List<Map<String, Object>> getIsEditList(List<String> analysisBatchIds);
} }
...@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service; ...@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -169,5 +170,10 @@ public class AnalysisBatchServiceImpl extends ServiceImpl<AnalysisBatchMapper, A ...@@ -169,5 +170,10 @@ public class AnalysisBatchServiceImpl extends ServiceImpl<AnalysisBatchMapper, A
return this.baseMapper.getTodoList(currentUserId); return this.baseMapper.getTodoList(currentUserId);
} }
@Override
public List<Map<String, Object>> getIsEditList(List<String> analysisBatchIds) {
return this.baseMapper.getIsEditList(analysisBatchIds);
}
} }
...@@ -73,6 +73,9 @@ public class AnalysisBatchQueryVO { ...@@ -73,6 +73,9 @@ public class AnalysisBatchQueryVO {
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@ApiModelProperty("是否可以编辑 ture-可编辑 false-不可编辑")
private boolean isEdit;
@ApiModelProperty("动静态分析-检查批次VO") @ApiModelProperty("动静态分析-检查批次VO")
private List<CheckBatchVO> checkBatchList; private List<CheckBatchVO> checkBatchList;
} }
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<if test="dto.lineAliasId != null and dto.lineAliasId != ''"> <if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId} AND t1.line_alias_id = #{dto.lineAliasId}
</if> </if>
ORDER BY t1.create_time DESC
</select> </select>
<select id="getUnitDevicePage" resultType="java.util.Map"> <select id="getUnitDevicePage" resultType="java.util.Map">
......
...@@ -32,10 +32,7 @@ import org.springframework.stereotype.Service; ...@@ -32,10 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -130,7 +127,9 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -130,7 +127,9 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setUnitScore(detailDTO.getUnitScore()); workBatchDetail.setUnitScore(detailDTO.getUnitScore());
workBatchDetail.setUnitScoreLevel(detailDTO.getUnitScoreLevel()); workBatchDetail.setUnitScoreLevel(detailDTO.getUnitScoreLevel());
workBatchDetail.setRemark(detailDTO.getRemark()); workBatchDetail.setRemark(detailDTO.getRemark());
workBatchDetail.setUpdateTime(new Date());
workBatchDetail.setCreateTime(new Date());
workBatchDetail.setWorkStatus(0);
workBatchDetailMapper.insert(workBatchDetail); workBatchDetailMapper.insert(workBatchDetail);
} }
} }
...@@ -178,6 +177,7 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -178,6 +177,7 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setUnitScore(transfiniteDTO.getUnitScore()); workBatchDetail.setUnitScore(transfiniteDTO.getUnitScore());
workBatchDetail.setUnitScoreLevel(transfiniteDTO.getUnitScoreLevel()); workBatchDetail.setUnitScoreLevel(transfiniteDTO.getUnitScoreLevel());
workBatchDetail.setUnitScoreLevelStr(transfiniteDTO.getUnitScoreLevelStr()); workBatchDetail.setUnitScoreLevelStr(transfiniteDTO.getUnitScoreLevelStr());
workBatchDetail.setWorkStatus(0);
workBatchDetailList.add(workBatchDetail); workBatchDetailList.add(workBatchDetail);
} }
......
...@@ -131,7 +131,7 @@ spring: ...@@ -131,7 +131,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: master:
url: jdbc:mysql://47.94.207.62:3306/hzgw2?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://47.94.207.62:3306/hzgw3?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username: root username: root
password: superAdmin&321 password: superAdmin&321
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
......
...@@ -131,7 +131,7 @@ spring: ...@@ -131,7 +131,7 @@ spring:
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/hzgw2?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull url: jdbc:mysql://127.0.0.1:3306/hzgw3?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&zeroDateTimeBehavior=convertToNull
username: root username: root
password: superAdmin&321 password: superAdmin&321
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
......
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