Commit f3960342 authored by 史志龙's avatar 史志龙

Merge branch 'dev-szl' into 'dev'

道岔使用情况检查数据类导入接口 -shizhilong

See merge request !47
parents 33af7b45 0a926251
......@@ -3,13 +3,14 @@ package org.jeecg.modules.checkData.equipmentCheckData.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
......@@ -17,29 +18,29 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.checkData.equipmentCheckData.dto.RecordsMasterCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.*;
import org.jeecg.modules.checkData.equipmentCheckData.service.*;
import org.jeecg.modules.checkData.equipmentCheckData.vo.MovementCourseVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterCheckVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RecordsMasterTurnoutInfoVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.TrackBedManagementCheckVO;
import org.jeecg.modules.deviceAsset.entity.TrackBedManagement;
import org.jeecg.modules.deviceAsset.service.ICurveManagementService;
import org.jeecg.modules.deviceAsset.service.ITrackBedManagementService;
import org.jeecg.modules.utils.BeanCopyUtil;
import org.jeecg.modules.utils.ExcelAnalysisUtils;
import org.jeecg.modules.utils.ExcelUtils;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.transaction.Transactional;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* <p>
......@@ -64,6 +65,7 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
@Autowired
private ICurveWearRecordService curveWearRecordService;
//********************************设备检查记录相关接口*************************************************************
/**
* 设备检查记录-分页列表查询
*
......@@ -161,10 +163,10 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
} else if ("2".equals(type)) {
//钢轨伤损情况检查表
railWearRecordService.lambdaUpdate().eq(RailWearRecord::getRecordsMasterCheckId, id).remove();
} else if("3".equals(type)){
} else if ("3".equals(type)) {
//曲线磨损情况检查数据
curveWearRecordService.lambdaUpdate().eq(CurveWearRecord::getRecordsMasterCheckId, id).remove();
} else if("5".equals(type)){
} else if ("5".equals(type)) {
//道床使用情况检查数据
trackBedManagementCheckService.lambdaUpdate().eq(TrackBedManagementCheck::getRecordsMasterCheckId, id).remove();
}
......@@ -173,6 +175,7 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
return Result.OK("删除成功!");
}
//****************************道岔使用情况检查数据相关接口**************************************************************************************************************
/**
* 根据设备检查记录主键查询道岔使用情况检查数据
*
......@@ -182,9 +185,10 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
@AutoLog(value = "根据设备检查记录主键查询道岔使用情况检查数据")
@ApiOperation(value = "根据设备检查记录主键查询道岔使用情况检查数据", notes = "根据设备检查记录主键查询道岔使用情况检查数据")
@GetMapping(value = "/getTurnoutInfoList")
public Result<List<RecordsMasterTurnoutInfoVO>> getTurnoutInfoList(@ApiParam(name = "设备检查记录主键id") String id) {
public Result<List<RecordsMasterTurnoutInfoVO>> getTurnoutInfoList(@ApiParam(name = "设备检查记录主键id") String id,@ApiParam(name = "道岔编码") String code) {
List<RecordsMasterTurnoutInfo> listResult = recordsMasterTurnoutInfoService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(id), RecordsMasterTurnoutInfo::getRecordsMasterId, id)
.eq(RecordsMasterTurnoutInfo::getSwitchCode,code)
.eq(RecordsMasterTurnoutInfo::getDelFlag, "0")
.list();
List<RecordsMasterTurnoutInfoVO> resultList = new ArrayList<>();
......@@ -193,7 +197,411 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
}
return Result.OK(resultList);
}
/**
* 根据设备检查记录主键回显道岔编号的集合
*
* @param id 设备检查记录主键
* @return
*/
@AutoLog(value = "根据设备检查记录主键回显道岔编号的集合")
@ApiOperation(value = "根据设备检查记录主键回显道岔编号的集合", notes = "根据设备检查记录主键回显道岔编号的集合")
@GetMapping(value = "/getTurnoutCodeList")
public Result<List<RecordsMasterTurnoutInfo>> getTurnoutCodeList(@ApiParam(name = "设备检查记录主键id") String id) {
List<RecordsMasterTurnoutInfo> listResult = recordsMasterTurnoutInfoService.lambdaQuery()
.eq(ObjectUtil.isNotEmpty(id), RecordsMasterTurnoutInfo::getRecordsMasterId, id)
.eq(RecordsMasterTurnoutInfo::getDelFlag, "0")
.eq(RecordsMasterTurnoutInfo::getType, "9")
.orderByAsc(RecordsMasterTurnoutInfo::getSort)
.list();
return Result.OK(listResult);
}
@AutoLog(value = "道岔使用情况导入")
@ApiOperation(value = "道岔使用情况导入", notes = "道岔使用情况导入")
@PostMapping(value = "/turnoutInfoUpload")
@Transactional
public Result<String> turnoutInfoUpload(MultipartFile file, @ApiParam(name = "设备检查记录主键id") String id) throws Exception {
try {
//初始化数据模板
QueryWrapper<RecordsMasterTurnoutInfo> wrapper = new QueryWrapper<>();
wrapper.eq("records_master_id", id);
recordsMasterTurnoutInfoService.remove(wrapper);
InputStream in = file.getInputStream();
//读取Excel中的数据
List<List<Object>> rowRecords = ExcelAnalysisUtils.getListByExcel(in);
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
//初始化道岔编号
String switchCode = "";
//初始化备注
String remark = "";
//初始化道岔使用情况检查数据集合
List<RecordsMasterTurnoutInfo> recordsMasterTurnoutInfoList = new ArrayList<>();
//初始化道岔顺序
Integer sort = 0;
for (int i = 0; i < rowRecords.size(); i++) {
List<Object> list = rowRecords.get(i);
String str = list.get(0).toString().trim();
if (str.contains("道岔编号")) {
//截取最后一个:号之后的字符串并去除首位空格
switchCode = str.substring(str.indexOf("道岔编号") + 5).trim();
} else if (str.contains("备注")) {
sort = sort + 1;
//截取最后一个:号之后的字符串并去除首位空格
remark = list.get(1).toString().trim();
RecordsMasterTurnoutInfo model = new RecordsMasterTurnoutInfo();
model.setId(IdWorker.get32UUID());
model.setDelFlag("0");
model.setRecordsMasterId(id);
model.setCreateTime(new Date());
model.setUpdateTime(new Date());
model.setCreateBy(realname);
model.setUpdateBy(realname);
model.setType("9");
model.setSwitchCode(switchCode);
model.setRemark(remark);
model.setSort(sort);
recordsMasterTurnoutInfoList.add(model);
} else if (str.equals("轨距")) {
this.uploadTrackGauge(recordsMasterTurnoutInfoList, i, realname, rowRecords, id, "1",switchCode);
} else if (str.equals("水平")) {
this.uploadTrackGauge(recordsMasterTurnoutInfoList, i, realname, rowRecords, id, "2",switchCode);
} else if (str.equals("支距")) {
//获取支距下一行的数据
List<Object> offsetList = rowRecords.get(i + 1);
this.uploadOffset(recordsMasterTurnoutInfoList, offsetList, realname, id,switchCode);
} else if (str.equals("轮缘槽")) {
//获取支距下两行的数据
List<Object> flangeList = rowRecords.get(i + 2);
this.uploadFlange(recordsMasterTurnoutInfoList, flangeList, realname, id,switchCode);
} else {
if (i != rowRecords.size() - 1) {
continue;
} else {
//释放资源
in.close();
}
}
}
// else if (str.equals("2.1")) {
// this.uploadSwitchPlate(recordsMasterTurnoutInfoList,list,realname,id,"5");
// }else if (str.equals("2.2")) {
// this.uploadSwitchPlate(recordsMasterTurnoutInfoList,list,realname,id,"6");
// }else if (str.equals("3.1")) {
// this.uploadSwitchPlate(recordsMasterTurnoutInfoList,list,realname,id,"7");
// }else if (str.equals("3.2")) {
// this.uploadSwitchPlate(recordsMasterTurnoutInfoList,list,realname,id,"8");
// }
//维护道岔使用情况检查数据表
if (recordsMasterTurnoutInfoList != null && recordsMasterTurnoutInfoList.size() > 0) {
recordsMasterTurnoutInfoService.saveBatch(recordsMasterTurnoutInfoList);
}
//释放资源
in.close();
} catch (Exception e) {
e.getMessage();
}
return Result.ok("操作成功");
}
//*****************************************封装解析方法*************************************************************
/**
* 处理滑床板部分
* @param recordsMasterTurnoutInfoList
* @param list
* @param realname
* @param id
*/
// public void uploadSwitchPlate(List<RecordsMasterTurnoutInfo> recordsMasterTurnoutInfoList, List<Object> list, String realname, String id,String type) {
// String str1 = list.get(1).toString().trim();
// String[] n = str1.split("þ");
// String s = n[0];
// String s1 = n[1];
// RecordsMasterTurnoutInfo model = new RecordsMasterTurnoutInfo();
// model.setId(IdWorker.get32UUID());
// model.setDelFlag("0");
// model.setRecordsMasterId(id);
// model.setCreateTime(new Date());
// model.setUpdateTime(new Date());
// model.setCreateBy(realname);
// model.setUpdateBy(realname);
// model.setType(type);
// if(s.contains("不合格")){
// model.setQualified("2");
// String noQualifiedRemark = "";
// noQualifiedRemark = s1.substring(s1.indexOf("不合格说明")+6).trim();
// model.setNoQualifiedRemark(noQualifiedRemark);
// }else {
// model.setQualified("1");
// }
// recordsMasterTurnoutInfoList.add(model);
// }
/**
* 处理轮缘槽部分
*
* @param recordsMasterTurnoutInfoList
* @param list
* @param realname
* @param id
*/
public void uploadFlange(List<RecordsMasterTurnoutInfo> recordsMasterTurnoutInfoList, List<Object> list, String realname, String id,String switchCode) {
RecordsMasterTurnoutInfo model = new RecordsMasterTurnoutInfo();
model.setId(IdWorker.get32UUID());
model.setDelFlag("0");
model.setRecordsMasterId(id);
model.setCreateTime(new Date());
model.setUpdateTime(new Date());
model.setCreateBy(realname);
model.setUpdateBy(realname);
model.setType("4");
model.setSwitchCode(switchCode);
String one = "";
one = list.get(1).toString().trim();
if (ObjectUtil.isNotEmpty(one)) {
model.setNumOne(one);
}
String two = "";
two = list.get(3).toString().trim();
if (ObjectUtil.isNotEmpty(two)) {
model.setNumTwo(two);
}
String three = "";
three = list.get(5).toString().trim();
if (ObjectUtil.isNotEmpty(three)) {
model.setNumThree(three);
}
String four = "";
four = list.get(7).toString().trim();
if (ObjectUtil.isNotEmpty(four)) {
model.setNumFour(four);
}
String five = "";
five = list.get(9).toString().trim();
if (ObjectUtil.isNotEmpty(five)) {
model.setNumFive(five);
}
String six = "";
six = list.get(11).toString().trim();
if (ObjectUtil.isNotEmpty(six)) {
model.setNumSix(six);
}
String seven = "";
seven = list.get(13).toString().trim();
if (ObjectUtil.isNotEmpty(seven)) {
model.setNumSeven(seven);
}
String eight = "";
eight = list.get(15).toString().trim();
if (ObjectUtil.isNotEmpty(eight)) {
model.setNumEight(eight);
}
String nine = "";
nine = list.get(17).toString().trim();
if (ObjectUtil.isNotEmpty(nine)) {
model.setNumNine(nine);
}
String ten = "";
ten = list.get(20).toString().trim();
if (ObjectUtil.isNotEmpty(ten)) {
model.setNumTen(two);
}
recordsMasterTurnoutInfoList.add(model);
}
/**
* 处理支距部分
*
* @param recordsMasterTurnoutInfoList
* @param offsetList
* @param realname
* @param id
*/
public void uploadOffset(List<RecordsMasterTurnoutInfo> recordsMasterTurnoutInfoList, List<Object> offsetList, String realname, String id,String switchCode) {
RecordsMasterTurnoutInfo model = new RecordsMasterTurnoutInfo();
model.setId(IdWorker.get32UUID());
model.setDelFlag("0");
model.setRecordsMasterId(id);
model.setCreateTime(new Date());
model.setUpdateTime(new Date());
model.setCreateBy(realname);
model.setUpdateBy(realname);
model.setType("3");
model.setSwitchCode(switchCode);
String one = "";
one = offsetList.get(1).toString().trim();
if (ObjectUtil.isNotEmpty(one)) {
model.setNumOne(one);
}
String two = "";
two = offsetList.get(5).toString().trim();
if (ObjectUtil.isNotEmpty(two)) {
model.setNumTwo(two);
}
String three = "";
three = offsetList.get(8).toString().trim();
if (ObjectUtil.isNotEmpty(three)) {
model.setNumThree(three);
}
String four = "";
four = offsetList.get(11).toString().trim();
if (ObjectUtil.isNotEmpty(four)) {
model.setNumFour(four);
}
String five = "";
five = offsetList.get(14).toString().trim();
if (ObjectUtil.isNotEmpty(five)) {
model.setNumFive(five);
}
String six = "";
six = offsetList.get(17).toString().trim();
if (ObjectUtil.isNotEmpty(six)) {
model.setNumSix(six);
}
String seven = "";
seven = offsetList.get(20).toString().trim();
if (ObjectUtil.isNotEmpty(seven)) {
model.setNumSeven(seven);
}
recordsMasterTurnoutInfoList.add(model);
}
/**
* @param recordsMasterTurnoutInfoList 最终的轨距集合
* @param i 当前行坐标
* @param realname 当前登录人姓名
* @param rowRecords 总行列数据集合
* @param id 主表id
* @param type 导入子类型
*/
public void uploadTrackGauge(List<RecordsMasterTurnoutInfo> recordsMasterTurnoutInfoList, int i, String realname, List<List<Object>> rowRecords, String id, String type,String switchCode) {
//初始化公里总结报告表
RecordsMasterTurnoutInfo model = new RecordsMasterTurnoutInfo();
model.setId(IdWorker.get32UUID());
model.setDelFlag("0");
model.setRecordsMasterId(id);
model.setCreateTime(new Date());
model.setUpdateTime(new Date());
model.setCreateBy(realname);
model.setUpdateBy(realname);
model.setType(type);
model.setSwitchCode(switchCode);
//轨距->前顺坡终点S1
String one = "";
one = rowRecords.get(i).get(1).toString().trim();
if (ObjectUtil.isNotEmpty(one)) {
model.setNumOne(one);
}
String two = "";
two = rowRecords.get(i).get(2).toString().trim();
if (ObjectUtil.isNotEmpty(two)) {
model.setNumTwo(two);
}
String three = "";
three = rowRecords.get(i).get(3).toString().trim();
if (ObjectUtil.isNotEmpty(three)) {
model.setNumThree(three);
}
String four = "";
four = rowRecords.get(i).get(4).toString().trim();
if (ObjectUtil.isNotEmpty(four)) {
model.setNumFour(four);
}
String five = "";
five = rowRecords.get(i).get(5).toString().trim();
if (ObjectUtil.isNotEmpty(five)) {
model.setNumFive(five);
}
String six = "";
six = rowRecords.get(i).get(6).toString().trim();
if (ObjectUtil.isNotEmpty(six)) {
model.setNumSix(six);
}
String seven = "";
seven = rowRecords.get(i).get(7).toString().trim();
if (ObjectUtil.isNotEmpty(seven)) {
model.setNumSeven(seven);
}
String eight = "";
eight = rowRecords.get(i).get(8).toString().trim();
if (ObjectUtil.isNotEmpty(eight)) {
model.setNumEight(eight);
}
String nine = "";
nine = rowRecords.get(i).get(9).toString().trim();
if (ObjectUtil.isNotEmpty(nine)) {
model.setNumNine(nine);
}
String ten = "";
ten = rowRecords.get(i).get(10).toString().trim();
if (ObjectUtil.isNotEmpty(ten)) {
model.setNumTen(two);
}
String tenOne = "";
tenOne = rowRecords.get(i).get(11).toString().trim();
if (ObjectUtil.isNotEmpty(tenOne)) {
model.setNumTenOne(tenOne);
}
String tenTwo = "";
tenTwo = rowRecords.get(i).get(12).toString().trim();
if (ObjectUtil.isNotEmpty(tenTwo)) {
model.setNumTenTwo(tenTwo);
}
String tenThree = "";
tenThree = rowRecords.get(i).get(13).toString().trim();
if (ObjectUtil.isNotEmpty(tenThree)) {
model.setNumTenThree(tenThree);
}
String tenFour = "";
tenFour = rowRecords.get(i).get(14).toString().trim();
if (ObjectUtil.isNotEmpty(tenFour)) {
model.setNumTenFour(tenFour);
}
String tenFive = "";
tenFive = rowRecords.get(i).get(15).toString().trim();
if (ObjectUtil.isNotEmpty(tenFive)) {
model.setNumTenFive(tenFive);
}
String tenSix = "";
tenSix = rowRecords.get(i).get(16).toString().trim();
if (ObjectUtil.isNotEmpty(tenSix)) {
model.setNumTenSix(tenSix);
}
String tenSeven = "";
tenSeven = rowRecords.get(i).get(17).toString().trim();
if (ObjectUtil.isNotEmpty(tenSeven)) {
model.setNumTenSeven(tenSeven);
}
String tenEight = "";
tenEight = rowRecords.get(i).get(18).toString().trim();
if (ObjectUtil.isNotEmpty(tenEight)) {
model.setNumTenEight(tenEight);
}
String tenNine = "";
tenNine = rowRecords.get(i).get(19).toString().trim();
if (ObjectUtil.isNotEmpty(tenNine)) {
model.setNumTenNine(tenNine);
}
String twenty = "";
twenty = rowRecords.get(i).get(20).toString().trim();
if (ObjectUtil.isNotEmpty(twenty)) {
model.setNumTwenty(twenty);
}
String twentyOne = "";
twentyOne = rowRecords.get(i).get(21).toString().trim();
if (ObjectUtil.isNotEmpty(twentyOne)) {
model.setNumTwentyOne(twentyOne);
}
String twentyTwo = "";
twentyTwo = rowRecords.get(i).get(22).toString().trim();
if (ObjectUtil.isNotEmpty(twentyTwo)) {
model.setNumTwentyTwo(twentyTwo);
}
recordsMasterTurnoutInfoList.add(model);
}
//************************其他接口******************************************************************************
/**
* 设备检查记录导出excel
* @param request
......
package org.jeecg.modules.checkData.equipmentCheckData.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
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.modules.checkData.equipmentCheckData.dto.UseTurnoutRecordCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.UseTurnoutRecordCheck;
import org.jeecg.modules.checkData.equipmentCheckData.service.IUseTurnoutRecordCheckService;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckVO;
import org.jeecg.modules.utils.BeanCopyUtil;
import org.springframework.web.bind.annotation.GetMapping;
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 java.util.*;
/**
* <p>
* 检查数据设备-设备检查记录数据-曲线磨耗情况检查-道岔使用情况检查数据 前端控制器
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@RestController
@RequestMapping("/checkData/equipmentCheckData/useTurnoutRecordCheck")
@Api(tags = "检查数据设备-设备检查记录数据-曲线磨耗情况检查")
public class UseTurnoutRecordCheckController extends JeecgController<UseTurnoutRecordCheck, IUseTurnoutRecordCheckService> {
@AutoLog(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-分页列表查询")
@ApiOperation(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-分页列表查询", notes = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<UseTurnoutRecordCheckVO>> queryPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
UseTurnoutRecordCheckDTO dto) {
Page<UseTurnoutRecordCheckVO> pageData = new Page<>(pageNo, pageSize);
pageData = this.service.queryPageList(pageData, dto);
return Result.OK(pageData);
}
@AutoLog(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-获取道岔编号List")
@ApiOperation(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-获取道岔编号List", notes = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-获取道岔编号List")
@GetMapping(value = "/getTurnoutCodeList")
public Result<List<Map<String, Object>>> getTurnoutCodeList(@ApiParam("设备检查记录主表id") String recordsMasterCheckId) {
List<UseTurnoutRecordCheck> records = this.service.lambdaQuery()
.eq(UseTurnoutRecordCheck::getRecordsMasterCheckId, recordsMasterCheckId)
.list();
List<Map<String, Object>> list = new ArrayList<>();
for (UseTurnoutRecordCheck useTurnoutRecordCheck : records) {
Map<String, Object> map = new HashMap<>();
map.put("label", useTurnoutRecordCheck.getTurnoutCode());
map.put("value", useTurnoutRecordCheck.getId());
list.add(map);
}
return Result.OK(list);
}
@AutoLog(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-道岔检查详情页")
@ApiOperation(value = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-道岔检查详情页", notes = "检查数据设备-设备检查记录数据-曲线磨耗情况检查-道岔检查详情页")
@GetMapping(value = "/getDetail")
public Result<UseTurnoutRecordCheckDetailVO> getDetail(@ApiParam("设备检查记录表id") String useTurnoutRecordId) {
UseTurnoutRecordCheckDetailVO data = this.service.getDetail(useTurnoutRecordId);
return Result.OK(data);
}
}
......@@ -128,4 +128,7 @@ public class RecordsMasterTurnoutInfoDTO {
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
private String delFlag;
@ApiModelProperty("导入道岔顺序")
private Integer sort;
}
package org.jeecg.modules.checkData.equipmentCheckData.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@Data
@ApiModel(value = "UseTurnoutRecordCheckDTO对象", description = "检查数据设备-检查记录数据-道岔使用情况检查数据")
public class UseTurnoutRecordCheckDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("批次编码")
private String ekCode;
@ApiModelProperty("道岔编码")
private String turnoutCode;
@ApiModelProperty("开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@ApiModelProperty("结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
}
......@@ -61,7 +61,7 @@ public class RecordsMasterTurnoutInfo implements Serializable {
@TableField("switch_code")
private String switchCode;
@ApiModelProperty("检查项目类型(1:轨距;2:水平;3:支距;4:轮缘槽;5:滑床板;6:顶铁;7:接头螺栓;8:护轨螺栓)")
@ApiModelProperty("检查项目类型(1:轨距;2:水平;3:支距;4:轮缘槽;5:滑床板;6:顶铁;7:接头螺栓;8:护轨螺栓;9:道岔)")
@TableField("type")
private String type;
......@@ -170,5 +170,8 @@ public class RecordsMasterTurnoutInfo implements Serializable {
@TableField("del_flag")
private String delFlag;
@ApiModelProperty("导入道岔顺序")
@TableField("sort")
private Integer sort;
}
package org.jeecg.modules.checkData.equipmentCheckData.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@Getter
@Setter
@TableName("t_ek_use_turnout_record_check")
@ApiModel(value = "UseTurnoutRecordCheck对象", description = "检查数据设备-检查记录数据-道岔使用情况检查数据")
public class UseTurnoutRecordCheck implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableId("id")
private String id;
@ApiModelProperty("创建人")
@TableField("create_by")
private String createBy;
@ApiModelProperty("创建日期")
@TableField("create_time")
private Date createTime;
@ApiModelProperty("更新人")
@TableField("update_by")
private String updateBy;
@ApiModelProperty("更新时间")
@TableField("update_time")
private Date updateTime;
@ApiModelProperty("设备检查记录主表id")
@TableField("records_master_check_id")
private String recordsMasterCheckId;
@ApiModelProperty("道岔id")
@TableField("switch_management_id")
private String switchManagementId;
@ApiModelProperty("车站id")
@TableField("station_id")
private String trainStationId;
@ApiModelProperty("检查日期")
@TableField("check_time")
private Date checkTime;
@ApiModelProperty("道岔编码")
@TableField("turnout_code")
private String turnoutCode;
@ApiModelProperty("几何尺寸")
@TableField(value = "geometric_dimensions", typeHandler = FastjsonTypeHandler.class)
private String geometricDimensions;
@ApiModelProperty("转辙器")
@TableField(value = "switch_part", typeHandler = FastjsonTypeHandler.class)
private String switchPart;
@ApiModelProperty("钢轨及其连接零件")
@TableField(value = "rail_and_conn_part", typeHandler = FastjsonTypeHandler.class)
private String railAndConnPart;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
@TableField("del_flag")
private String delFlag;
}
......@@ -6,7 +6,6 @@ import org.jeecg.modules.checkData.equipmentCheckData.entity.CurveWearRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.checkData.equipmentCheckData.vo.CurveWearRecordDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.CurveWearRecordVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
/**
* <p>
......
......@@ -6,7 +6,6 @@ import org.jeecg.modules.checkData.equipmentCheckData.entity.RailWearRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RailWearRecordDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RailWearRecordVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
/**
* <p>
......
package org.jeecg.modules.checkData.equipmentCheckData.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.UseTurnoutRecordCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.UseTurnoutRecordCheck;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckVO;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据 Mapper 接口
* </p>
*
* @author hkl
* @since 2023-07-09
*/
public interface UseTurnoutRecordCheckMapper extends BaseMapper<UseTurnoutRecordCheck> {
Page<UseTurnoutRecordCheckVO> queryPageList(Page<UseTurnoutRecordCheckVO> pageData, UseTurnoutRecordCheckDTO dto);
UseTurnoutRecordCheckDetailVO getDetail(String useTurnoutRecordId);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.checkData.equipmentCheckData.mapper.UseTurnoutRecordCheckMapper">
<select id="queryPageList"
resultType="org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckVO">
SELECT
t2.id recordsMasterCheckId,
t2.ek_code,
t2.work_code,
t2.check_time,
t2.check_by,
t2.verify_by,
t2.verify_time,
t2.subway_section_id,
t2.subway_section_name,
t2.light_rail_id,
t2.light_rail_name,
t2.line_alias_id,
t2.line_alias_name,
t2.starting_mileage,
t2.end_mileage,
t1.gauge_code,
COUNT(1) turnout_num,
t3.station_name,
t2.remark
FROM
t_ek_use_turnout_record_check t1
LEFT JOIN t_ek_records_master_check t2 ON t1.records_master_check_id = t2.id and t2.del_flag = '0'
LEFT JOIN t_sn_train_station t3 ON t1.station_id = t3.id
LEFT JOIN t_sn_light_rail t4 on t2.light_rail_id = t4.id
AND t3.light_rail_id = t4.id
WHERE t1.del_flag = '0'
<if test="dto.turnoutCode != null and dto.turnoutCode != ''">
AND t1.gauge_code like concat('%',#{dto.turnoutCode},'%')
</if>
<if test="dto.ekCode != null and dto.ekCode != ''">
AND t2.ek_code like concat('%',#{dto.ekCode},'%')
</if>
<if test="dto.startTime != null">
AND t2.check_time >= #{dto.startTime}
</if>
<if test="dto.endTime != null">
AND t2.check_time <![CDATA[ <= ]]> #{dto.endTime}
</if>
AND t4.status = 1
GROUP BY t1.gauge_code
</select>
<select id="getDetail"
resultType="org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO">
SELECT
t1.*,
t2.byroad_pre_mileage,
t2.byroad_center_mileage,
t2.byroad_end_mileage,
t2.open_to,
t2.line_alias_id,
t2.switch_model,
(SELECT line_alias_name FROM t_sn_line_alias WHERE id = t2.line_alias_id limit 1) line_alias_name
FROM
t_ek_use_turnout_record_check t1
LEFT JOIN t_da_switch_management t2 ON t1.switch_management_id = t2.id
WHERE t1.id =#{useTurnoutRecordId}
</select>
</mapper>
package org.jeecg.modules.checkData.equipmentCheckData.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.UseTurnoutRecordCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.UseTurnoutRecordCheck;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckVO;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据 服务类
* </p>
*
* @author hkl
* @since 2023-07-09
*/
public interface IUseTurnoutRecordCheckService extends IService<UseTurnoutRecordCheck> {
Page<UseTurnoutRecordCheckVO> queryPageList(Page<UseTurnoutRecordCheckVO> pageData, UseTurnoutRecordCheckDTO dto);
UseTurnoutRecordCheckDetailVO getDetail(String useTurnoutRecordId);
}
......@@ -8,7 +8,6 @@ import org.jeecg.modules.checkData.equipmentCheckData.service.IRailWearRecordSer
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RailWearRecordDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.RailWearRecordVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
import org.springframework.stereotype.Service;
/**
......
package org.jeecg.modules.checkData.equipmentCheckData.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.checkData.equipmentCheckData.dto.UseTurnoutRecordCheckDTO;
import org.jeecg.modules.checkData.equipmentCheckData.entity.UseTurnoutRecordCheck;
import org.jeecg.modules.checkData.equipmentCheckData.mapper.UseTurnoutRecordCheckMapper;
import org.jeecg.modules.checkData.equipmentCheckData.service.IUseTurnoutRecordCheckService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckDetailVO;
import org.jeecg.modules.checkData.equipmentCheckData.vo.UseTurnoutRecordCheckVO;
import org.springframework.stereotype.Service;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据 服务实现类
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@Service
public class UseTurnoutRecordCheckServiceImpl extends ServiceImpl<UseTurnoutRecordCheckMapper, UseTurnoutRecordCheck> implements IUseTurnoutRecordCheckService {
@Override
public Page<UseTurnoutRecordCheckVO> queryPageList(Page<UseTurnoutRecordCheckVO> pageData, UseTurnoutRecordCheckDTO dto) {
return this.baseMapper.queryPageList(pageData,dto);
}
@Override
public UseTurnoutRecordCheckDetailVO getDetail(String useTurnoutRecordId) {
return this.baseMapper.getDetail(useTurnoutRecordId);
}
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.jeecg.modules.utils.DicMap;
import org.springframework.format.annotation.DateTimeFormat;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
......
......@@ -128,5 +128,7 @@ public class RecordsMasterTurnoutInfoVO {
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
private String delFlag;
@ApiModelProperty("导入道岔顺序")
private Integer sort;
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@Data
@ApiModel(value = "UseTurnoutRecordCheck对象", description = "检查数据设备-检查记录数据-道岔使用情况检查数据")
public class UseTurnoutRecordCheckDetailVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("检查日期")
private Date checkTime;
@ApiModelProperty("道岔编码")
private String turnoutCode;
@ApiModelProperty("几何尺寸")
private String geometricDimensions;
@ApiModelProperty("转辙器")
private String switchPart;
@ApiModelProperty("钢轨及其连接零件")
private String railAndConnPart;
@ApiModelProperty(value = "线别Id")
private String lineAliasId;
@ApiModelProperty(value = "线别名称")
private String lineAliasName;
@ApiModelProperty(value = "开向")
private String openTo;
@ApiModelProperty(value = "岔前/岔前里程")
private BigDecimal byroadPreMileage;
@ApiModelProperty(value = "岔心里程")
private BigDecimal byroadCenterMileage;
@ApiModelProperty(value = "岔前/岔后里程")
private BigDecimal byroadEndMileage;
@ApiModelProperty(value = "道岔型号")
private String switchModel;
}
package org.jeecg.modules.checkData.equipmentCheckData.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 检查数据设备-检查记录数据-道岔使用情况检查数据
* </p>
*
* @author hkl
* @since 2023-07-09
*/
@Data
@ApiModel(value = "UseTurnoutRecordCheck对象", description = "检查数据设备-检查记录数据-道岔使用情况检查数据")
public class UseTurnoutRecordCheckVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("设备检查记录主表id")
private String recordsMasterCheckId;
@ApiModelProperty("检查批次号")
private String ekCode;
@ApiModelProperty("工单编号")
private String workCode;
@ApiModelProperty("轨距水平尺编号")
private String gaugeCode;
@ApiModelProperty("检查区间id")
private String subwaySectionId;
@ApiModelProperty("检查区间名称")
private String subwaySectionName;
@ApiModelProperty("所属线路id")
private String lightRailId;
@ApiModelProperty("所属线路名称")
private String lightRailName;
@ApiModelProperty("所属线别id")
private String lineAliasId;
@ApiModelProperty("所属线别名称")
private String lineAliasName;
@ApiModelProperty("车站id")
private String stationId;
@ApiModelProperty("车站名称")
private String stationName;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("检查日期")
private Date checkTime;
@ApiModelProperty("检查人")
private String checkBy;
@ApiModelProperty("审核人姓名")
private String verifyBy;
@ApiModelProperty("审核时间")
private Date verifyTime;
@ApiModelProperty("起点里程")
private BigDecimal startingMileage;
@ApiModelProperty("终点里程")
private BigDecimal endMileage;
@ApiModelProperty("道岔数量")
private Integer turnoutNum;
@ApiModelProperty("备注")
private String remark;
}
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