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

钢轨探伤初始化以及道岔以及派工逻辑提交--shizhilong

parent 15c6601b
...@@ -29,8 +29,7 @@ public class CodeGenerate { ...@@ -29,8 +29,7 @@ public class CodeGenerate {
// 表名 // 表名
String[] tables = { String[] tables = {
"t_dsa_analysis_line_batch","t_dsa_analysis_line_batch_check_data_map", "t_dsa_analysis_line_batch_unit_device_rail_wear_info"
"t_dsa_analysis_line_batch_unit_device","t_dsa_analysis_line_batch_unit_device_turnout_info"
}; };
......
...@@ -75,6 +75,10 @@ public class AnalysisAlgorithmLine { ...@@ -75,6 +75,10 @@ public class AnalysisAlgorithmLine {
unitDeviceTable.put(unitDevice.get("unitCode").toString(), unitDevice); unitDeviceTable.put(unitDevice.get("unitCode").toString(), unitDevice);
} }
//原来单元信息删除
LambdaQueryWrapper<AnalysisLineBatchUnitDevice> wrapper2 = Wrappers.lambdaQuery();
wrapper2.eq(AnalysisLineBatchUnitDevice::getAnalysisBatchId, analysisLineBatch.getId());
unitDeviceService.remove(wrapper2);
// 1.4 循环分析检查项目 // 1.4 循环分析检查项目
for (AnalysisLineBatchCheckDataMap checkDataMap : analysisLineBatchCheckDataMapList) { for (AnalysisLineBatchCheckDataMap checkDataMap : analysisLineBatchCheckDataMapList) {
...@@ -82,6 +86,10 @@ public class AnalysisAlgorithmLine { ...@@ -82,6 +86,10 @@ public class AnalysisAlgorithmLine {
// 4-钢轨波磨检查 5-道床检查 6-线路检查 // 4-钢轨波磨检查 5-道床检查 6-线路检查
if ("1" == checkDataMap.getEkType()) { if ("1" == checkDataMap.getEkType()) {
//1-道岔检查 //1-道岔检查
//原来道岔检查单元信息详情删除
LambdaQueryWrapper<AnalysisLineBatchUnitDeviceTurnoutInfo> wrapper3 = Wrappers.lambdaQuery();
wrapper3.eq(AnalysisLineBatchUnitDeviceTurnoutInfo::getAnalysisBatchId, analysisLineBatch.getId());
analysisLineBatchUnitDeviceTurnoutInfoService.remove(wrapper3);
turnoutCheckDataLineAnalysis(analysisLineBatch, checkDataMap, unitDeviceList); turnoutCheckDataLineAnalysis(analysisLineBatch, checkDataMap, unitDeviceList);
} }
......
...@@ -15,11 +15,12 @@ import org.jeecg.modules.diseaseAnalysis.dto.EkRecordsMasterCheckDTO; ...@@ -15,11 +15,12 @@ import org.jeecg.modules.diseaseAnalysis.dto.EkRecordsMasterCheckDTO;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatch; import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatch;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchService; import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchService;
import org.jeecg.modules.diseaseAnalysis.vo.*; import org.jeecg.modules.diseaseAnalysis.vo.*;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import java.util.ArrayList;
import java.util.Arrays;
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;
...@@ -37,6 +38,7 @@ import java.util.stream.Collectors; ...@@ -37,6 +38,7 @@ import java.util.stream.Collectors;
public class AnalysisLineBatchController extends JeecgController<AnalysisLineBatch, IAnalysisLineBatchService> { public class AnalysisLineBatchController extends JeecgController<AnalysisLineBatch, IAnalysisLineBatchService> {
/** /**
* 线路质量分析-其他病害分析-检查记录(除去线路巡查)-分页列表查询 * 线路质量分析-其他病害分析-检查记录(除去线路巡查)-分页列表查询
*
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param dto * @param dto
...@@ -52,8 +54,10 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat ...@@ -52,8 +54,10 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat
pageData = this.service.queryPageEkList(pageData, dto); pageData = this.service.queryPageEkList(pageData, dto);
return Result.OK(pageData); return Result.OK(pageData);
} }
/** /**
* 线路质量分析-其他病害分析-线路巡查检查记录-分页列表查询 * 线路质量分析-其他病害分析-线路巡查检查记录-分页列表查询
*
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param dto * @param dto
...@@ -69,8 +73,10 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat ...@@ -69,8 +73,10 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat
pageData = this.service.queryPageEkPatrolList(pageData, dto); pageData = this.service.queryPageEkPatrolList(pageData, dto);
return Result.OK(pageData); return Result.OK(pageData);
} }
/** /**
* 线路质量分析-其他病害分析-分页列表查询 * 线路质量分析-其他病害分析-分页列表查询
*
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param dto * @param dto
...@@ -100,15 +106,17 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat ...@@ -100,15 +106,17 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat
} }
return Result.OK(pageData); return Result.OK(pageData);
} }
/** /**
* 线路质量分析-其他病害分析-详情查询-分页列表查询 * 线路质量分析-其他病害分析-单元查询-分页列表查询
*
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param dto * @param dto
* @return * @return
*/ */
@AutoLog(value = "线路质量分析-其他病害分析-详情查询-分页列表查询") @AutoLog(value = "线路质量分析-其他病害分析-单元查询-分页列表查询")
@ApiOperation(value = "线路质量分析-其他病害分析-详情查询-分页列表查询", notes = "线路质量分析-其他病害分析-详情查询-分页列表查询") @ApiOperation(value = "线路质量分析-其他病害分析-单元查询-分页列表查询", notes = "线路质量分析-其他病害分析-单元查询-分页列表查询")
@GetMapping(value = "/getInfoPageList") @GetMapping(value = "/getInfoPageList")
public Result<IPage<AnalysisLineBatchUnitDeviceVO>> getInfoPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, public Result<IPage<AnalysisLineBatchUnitDeviceVO>> getInfoPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
...@@ -119,19 +127,21 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat ...@@ -119,19 +127,21 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat
} }
/** /**
* 线路质量分析-其他病害分析-详情检查记录查询 * 线路质量分析-其他病害分析-道岔检查单元详情检查记录查询
*
* @param analysisBatchId 分析批次id * @param analysisBatchId 分析批次id
* @param ekId 检查批次id * @param ekId 检查批次id
* @param deviceId 线路质量分析-其他病害分析-单元表id * @param deviceId 线路质量分析-其他病害分析-单元表id
* @return * @return
*/ */
@AutoLog(value = "线路质量分析-其他病害分析-详情检查记录查询") @AutoLog(value = "线路质量分析-其他病害分析-道岔检查单元详情检查记录查询")
@ApiOperation(value = "线路质量分析-其他病害分析-详情检查记录查询", notes = "线路质量分析-其他病害分析-详情检查记录查询") @ApiOperation(value = "线路质量分析-其他病害分析-道岔检查单元详情检查记录查询", notes = "线路质量分析-其他病害分析-道岔检查单元详情检查记录查询")
@GetMapping(value = "/getAnalysisLineBatchUnitEkInfoList") @GetMapping(value = "/getAnalysisLineBatchUnitEkInfoList")
public Result<List<AnalysisLineBatchUnitDeviceTurnoutInfoVO>> getAnalysisLineBatchUnitEkInfoList(@RequestParam String analysisBatchId,@RequestParam String ekId,@RequestParam String deviceId) { public Result<List<AnalysisLineBatchUnitDeviceTurnoutInfoVO>> getAnalysisLineBatchUnitEkInfoList(@RequestParam String analysisBatchId, @RequestParam String ekId, @RequestParam String deviceId) {
List<AnalysisLineBatchUnitDeviceTurnoutInfoVO> list = this.service.getAnalysisLineBatchUnitEkInfoList(analysisBatchId,ekId,deviceId); List<AnalysisLineBatchUnitDeviceTurnoutInfoVO> list = this.service.getAnalysisLineBatchUnitEkInfoList(analysisBatchId, ekId, deviceId);
return Result.OK(list); return Result.OK(list);
} }
//***********************************分析新增编辑接口************************************************************************************************************* //***********************************分析新增编辑接口*************************************************************************************************************
@AutoLog(value = "其他病害分析-分析批次-新增分析批次") @AutoLog(value = "其他病害分析-分析批次-新增分析批次")
@ApiOperation(value = "其他病害分析-分析批次-新增分析批次", notes = "其他病害分析-分析批次-新增分析批次") @ApiOperation(value = "其他病害分析-分析批次-新增分析批次", notes = "其他病害分析-分析批次-新增分析批次")
...@@ -153,4 +163,47 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat ...@@ -153,4 +163,47 @@ public class AnalysisLineBatchController extends JeecgController<AnalysisLineBat
return Result.OK("操作成功"); return Result.OK("操作成功");
} }
@AutoLog(value = "其他病害分析-分析批次-更新分析批次")
@ApiOperation(value = "其他病害分析-分析批次-更新分析批次", notes = "其他病害分析-分析批次-更新分析批次")
@PostMapping(value = "/updateRecord")
public Result<String> updateRecord(@RequestBody AnalysisLineBatchSaveOrUpdateDTO dto) {
if (dto.getStartingMileage().compareTo(dto.getEndMileage()) > 0) {
throw new JeecgBootException("起始里程不能大于结束里程");
}
// 去重
AnalysisLineBatch exist = this.service.lambdaQuery()
.eq(AnalysisLineBatch::getAnalysisBatchCode, dto.getAnalysisBatchCode())
.ne(AnalysisLineBatch::getId, dto.getId())
.last("limit 1")
.one();
if (exist != null) {
throw new JeecgBootException("【" + dto.getAnalysisBatchCode() + "】分析批次已存在");
}
this.service.updateRecord(dto);
return Result.OK("操作成功");
}
/**
* 其他病害分析-分析批次-删除
*
* @param ids
* @return
*/
@AutoLog(value = "其他病害分析-分析批次-删除")
@ApiOperation(value = "其他病害分析-分析批次-删除", notes = "其他病害分析-分析批次-删除")
@GetMapping(value = "/deleteBatchRecord")
public Result<String> deleteBatchRecord(@RequestParam(name = "ids", required = true) String ids) {
List<String> idList = new ArrayList<>();
if (ids.contains(",")) {
idList = Arrays.asList(ids.split(","));
} else {
idList.add(ids);
}
this.service.deleteBatchRecord(idList);
return Result.OK("批量删除成功!");
}
} }
package org.jeecg.modules.diseaseAnalysis.controller;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDeviceRailWearInfo;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchUnitDeviceRailWearInfoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查 前端控制器
* </p>
*
* @author hkl
* @since 2024-07-24
*/
@RestController
@RequestMapping("/analysisLineBatchUnitDeviceRailWearInfo")
public class AnalysisLineBatchUnitDeviceRailWearInfoController extends JeecgController<AnalysisLineBatchUnitDeviceRailWearInfo, IAnalysisLineBatchUnitDeviceRailWearInfoService> {
}
package org.jeecg.modules.diseaseAnalysis.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查
* </p>
*
* @author hkl
* @since 2024-07-24
*/
@Getter
@Setter
@ApiModel(value = "AnalysisLineBatchUnitDeviceRailWearInfo对象", description = "线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查")
public class AnalysisLineBatchUnitDeviceRailWearInfoDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("分析批id")
private String analysisBatchId;
@ApiModelProperty("分析批次号")
private String analysisBatchCode;
@ApiModelProperty("设备检查记录主表id(t_ek_records_master_check)")
private String ekId;
@ApiModelProperty("检查批次号(t_ek_records_master_check)")
private String ekCode;
@ApiModelProperty("单元表id(t_dsa_analysis_line_batch_unit_device)")
private String deviceId;
@ApiModelProperty("检查设备id(设备资产四种表的主键)")
private String deviceProjectId;
@ApiModelProperty("检查设备编码(设备资产四种表的switch_code)")
private String deviceProjectCode;
@ApiModelProperty("检查设备类型(1-钢轨,2-曲线,3-竖曲线,4-道岔)")
private Integer deviceProjectType;
@ApiModelProperty("股别(1-左股,2-右股)")
private Integer damageLevel;
@ApiModelProperty("伤损钢轨数量")
private Integer damageNum;
@ApiModelProperty("伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)")
private Integer damageType;
@ApiModelProperty("伤损里程")
private BigDecimal damageMileage;
@ApiModelProperty("伤损程度(1-轻伤,2-轻伤有发展,3-重伤)")
private Integer damageDegree;
@ApiModelProperty("换轨计划")
private String damagePlan;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
private String delFlag;
}
package org.jeecg.modules.diseaseAnalysis.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查
* </p>
*
* @author hkl
* @since 2024-07-24
*/
@Getter
@Setter
@TableName("t_dsa_analysis_line_batch_unit_device_rail_wear_info")
@ApiModel(value = "AnalysisLineBatchUnitDeviceRailWearInfo对象", description = "线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查")
public class AnalysisLineBatchUnitDeviceRailWearInfo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
@TableField("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("analysis_batch_id")
private String analysisBatchId;
@ApiModelProperty("分析批次号")
@TableField("analysis_batch_code")
private String analysisBatchCode;
@ApiModelProperty("设备检查记录主表id(t_ek_records_master_check)")
@TableField("ek_id")
private String ekId;
@ApiModelProperty("检查批次号(t_ek_records_master_check)")
@TableField("ek_code")
private String ekCode;
@ApiModelProperty("单元表id(t_dsa_analysis_line_batch_unit_device)")
@TableField("device_id")
private String deviceId;
@ApiModelProperty("检查设备id(设备资产四种表的主键)")
@TableField("device_project_id")
private String deviceProjectId;
@ApiModelProperty("检查设备编码(设备资产四种表的switch_code)")
@TableField("device_project_code")
private String deviceProjectCode;
@ApiModelProperty("检查设备类型(1-钢轨,2-曲线,3-竖曲线,4-道岔)")
@TableField("device_project_type")
private Integer deviceProjectType;
@ApiModelProperty("股别(1-左股,2-右股)")
@TableField("damage_level")
private Integer damageLevel;
@ApiModelProperty("伤损钢轨数量")
@TableField("damage_num")
private Integer damageNum;
@ApiModelProperty("伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)")
@TableField("damage_type")
private Integer damageType;
@ApiModelProperty("伤损里程")
@TableField("damage_mileage")
private BigDecimal damageMileage;
@ApiModelProperty("伤损程度(1-轻伤,2-轻伤有发展,3-重伤)")
@TableField("damage_degree")
private Integer damageDegree;
@ApiModelProperty("换轨计划")
@TableField("damage_plan")
private String damagePlan;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
@TableField("del_flag")
private String delFlag;
}
package org.jeecg.modules.diseaseAnalysis.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDeviceRailWearInfo;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查 Mapper 接口
* </p>
*
* @author hkl
* @since 2024-07-24
*/
public interface AnalysisLineBatchUnitDeviceRailWearInfoMapper extends BaseMapper<AnalysisLineBatchUnitDeviceRailWearInfo> {
}
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<if test="dto.workStatus != null"> <if test="dto.workStatus != null">
AND t1.work_status = #{dto.workStatus} AND t1.work_status = #{dto.workStatus}
</if> </if>
ORDER BY t1.update_time DESC ORDER BY t1.unit_center_mileage ASC
</select> </select>
<select id="getAnalysisLineBatchUnitEkInfoList" resultType="org.jeecg.modules.diseaseAnalysis.vo.AnalysisLineBatchUnitDeviceTurnoutInfoVO"> <select id="getAnalysisLineBatchUnitEkInfoList" resultType="org.jeecg.modules.diseaseAnalysis.vo.AnalysisLineBatchUnitDeviceTurnoutInfoVO">
......
<?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.diseaseAnalysis.mapper.AnalysisLineBatchUnitDeviceRailWearInfoMapper">
</mapper>
...@@ -77,4 +77,16 @@ public interface IAnalysisLineBatchService extends IService<AnalysisLineBatch> { ...@@ -77,4 +77,16 @@ public interface IAnalysisLineBatchService extends IService<AnalysisLineBatch> {
* @param dto * @param dto
*/ */
void saveRecord(AnalysisLineBatchSaveOrUpdateDTO dto); void saveRecord(AnalysisLineBatchSaveOrUpdateDTO dto);
/**
* 其他病害分析-分析批次-更新分析批次
* @param dto
*/
void updateRecord(AnalysisLineBatchSaveOrUpdateDTO dto);
/**
* 其他病害分析-分析批次-删除
* @param idList
*/
void deleteBatchRecord(List<String> idList);
} }
package org.jeecg.modules.diseaseAnalysis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDeviceRailWearInfo;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查 服务类
* </p>
*
* @author hkl
* @since 2024-07-24
*/
public interface IAnalysisLineBatchUnitDeviceRailWearInfoService extends IService<AnalysisLineBatchUnitDeviceRailWearInfo> {
}
package org.jeecg.modules.diseaseAnalysis.service.impl; package org.jeecg.modules.diseaseAnalysis.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.common.util.UUIDGenerator;
import org.jeecg.modules.diseaseAnalysis.algorithm.MultiProducerLine; import org.jeecg.modules.diseaseAnalysis.algorithm.MultiProducerLine;
...@@ -10,12 +12,17 @@ import org.jeecg.modules.diseaseAnalysis.dto.AnalysisLineBatchSaveOrUpdateDTO; ...@@ -10,12 +12,17 @@ import org.jeecg.modules.diseaseAnalysis.dto.AnalysisLineBatchSaveOrUpdateDTO;
import org.jeecg.modules.diseaseAnalysis.dto.EkRecordsMasterCheckDTO; import org.jeecg.modules.diseaseAnalysis.dto.EkRecordsMasterCheckDTO;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatch; import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatch;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchCheckDataMap; import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchCheckDataMap;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDevice;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDeviceTurnoutInfo;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchCheckDataMapMapper; import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchCheckDataMapMapper;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchMapper; import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchMapper;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchUnitDeviceMapper;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchUnitDeviceTurnoutInfoMapper;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchService; import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.diseaseAnalysis.vo.*; import org.jeecg.modules.diseaseAnalysis.vo.*;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -33,7 +40,10 @@ import java.util.List; ...@@ -33,7 +40,10 @@ import java.util.List;
public class AnalysisLineBatchServiceImpl extends ServiceImpl<AnalysisLineBatchMapper, AnalysisLineBatch> implements IAnalysisLineBatchService { public class AnalysisLineBatchServiceImpl extends ServiceImpl<AnalysisLineBatchMapper, AnalysisLineBatch> implements IAnalysisLineBatchService {
@Resource @Resource
private AnalysisLineBatchCheckDataMapMapper analysisLineBatchCheckDataMapMapper; private AnalysisLineBatchCheckDataMapMapper analysisLineBatchCheckDataMapMapper;
@Resource
private AnalysisLineBatchUnitDeviceMapper analysisLineBatchUnitDeviceMapper;
@Resource
private AnalysisLineBatchUnitDeviceTurnoutInfoMapper analysisLineBatchUnitDeviceTurnoutInfoMapper;
/** /**
* 线路质量分析-其他病害分析-检查记录-分页列表查询 * 线路质量分析-其他病害分析-检查记录-分页列表查询
* *
...@@ -150,4 +160,74 @@ public class AnalysisLineBatchServiceImpl extends ServiceImpl<AnalysisLineBatchM ...@@ -150,4 +160,74 @@ public class AnalysisLineBatchServiceImpl extends ServiceImpl<AnalysisLineBatchM
// 执行分析 // 执行分析
MultiProducerLine.produce(analysisLineBatch.getId()); MultiProducerLine.produce(analysisLineBatch.getId());
} }
/**
* 其他病害分析-分析批次-更新分析批次
* @param dto
*/
@Override
public void updateRecord(AnalysisLineBatchSaveOrUpdateDTO dto) {
// 主表
AnalysisLineBatch analysisLineBatch = BeanUtil.copyProperties(dto, AnalysisLineBatch.class);
analysisLineBatch.setAnalysisStatus(1); // 1-分析中
// 明细
// 1.先删除
LambdaQueryWrapper<AnalysisLineBatchCheckDataMap> wrapper = Wrappers.lambdaQuery();
wrapper.eq(AnalysisLineBatchCheckDataMap::getAnalysisBatchId, analysisLineBatch.getId());
analysisLineBatchCheckDataMapMapper.delete(wrapper);
// 2.后新增
List<AnalysisLineBatchCheckDataMap> analysisLineBatchCheckDataMaps = new ArrayList<>();
List<AnalysisLineBatchSaveOrUpdateDTO.CheckDataDTO> checkDataList = dto.getCheckDataList();
for (AnalysisLineBatchSaveOrUpdateDTO.CheckDataDTO checkDataDTO : checkDataList) {
AnalysisLineBatchCheckDataMap analysisLineBatchCheckDataMap = new AnalysisLineBatchCheckDataMap();
analysisLineBatchCheckDataMap.setId(UUIDGenerator.generate());
analysisLineBatchCheckDataMap.setAnalysisBatchId(analysisLineBatch.getId());
analysisLineBatchCheckDataMap.setAnalysisBatchCode(analysisLineBatch.getAnalysisBatchCode());
analysisLineBatchCheckDataMap.setEkCode(checkDataDTO.getEkCode());
analysisLineBatchCheckDataMap.setEkId(checkDataDTO.getEkId());
analysisLineBatchCheckDataMap.setStartingMileage(checkDataDTO.getStartingMileage());
analysisLineBatchCheckDataMap.setEndMileage(checkDataDTO.getEndMileage());
analysisLineBatchCheckDataMap.setCheckTime(checkDataDTO.getCheckTime());
analysisLineBatchCheckDataMap.setEkType(checkDataDTO.getEkType());
analysisLineBatchCheckDataMap.setAnalysisStatus(1);// 分析中
analysisLineBatchCheckDataMap.setRemark(dto.getRemark());
analysisLineBatchCheckDataMaps.add(analysisLineBatchCheckDataMap);
}
this.updateById(analysisLineBatch);
for (AnalysisLineBatchCheckDataMap analysisLineBatchCheckDataMap : analysisLineBatchCheckDataMaps) {
analysisLineBatchCheckDataMapMapper.insert(analysisLineBatchCheckDataMap);
}
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
// 执行分析
MultiProducerLine.produce(analysisLineBatch.getId());
}
/**
* 其他病害分析-分析批次-删除
* @param idList
*/
@Override
@Transactional
public void deleteBatchRecord(List<String> idList) {
// 1.先删除病害分析主表与检查记录主表之间的关系表
LambdaQueryWrapper<AnalysisLineBatchCheckDataMap> wrapper = Wrappers.lambdaQuery();
wrapper.in(AnalysisLineBatchCheckDataMap::getAnalysisBatchId, idList);
analysisLineBatchCheckDataMapMapper.delete(wrapper);
// 2.删除单元表
LambdaQueryWrapper<AnalysisLineBatchUnitDevice> wrapper1 = Wrappers.lambdaQuery();
wrapper1.in(AnalysisLineBatchUnitDevice::getAnalysisBatchId, idList);
analysisLineBatchUnitDeviceMapper.delete(wrapper1);
//3.删除道岔单元详情表
LambdaQueryWrapper<AnalysisLineBatchUnitDeviceTurnoutInfo> wrapper2 = Wrappers.lambdaQuery();
wrapper2.in(AnalysisLineBatchUnitDeviceTurnoutInfo::getAnalysisBatchId, idList);
analysisLineBatchUnitDeviceTurnoutInfoMapper.delete(wrapper2);
//4.删除分析主表
this.baseMapper.deleteBatchIds(idList);
}
} }
package org.jeecg.modules.diseaseAnalysis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDeviceRailWearInfo;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchUnitDeviceRailWearInfoMapper;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchUnitDeviceRailWearInfoService;
import org.springframework.stereotype.Service;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查 服务实现类
* </p>
*
* @author hkl
* @since 2024-07-24
*/
@Service
public class AnalysisLineBatchUnitDeviceRailWearInfoServiceImpl extends ServiceImpl<AnalysisLineBatchUnitDeviceRailWearInfoMapper, AnalysisLineBatchUnitDeviceRailWearInfo> implements IAnalysisLineBatchUnitDeviceRailWearInfoService {
}
package org.jeecg.modules.diseaseAnalysis.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查
* </p>
*
* @author hkl
* @since 2024-07-24
*/
@Getter
@Setter
@ApiModel(value = "AnalysisLineBatchUnitDeviceRailWearInfo对象", description = "线路质量分析-分析批次表-单元设备详情(1个分析批次有多个检查批次,1个检查批次有多个单位设备,1个单元设备有多个详情)---钢轨探伤检查")
public class AnalysisLineBatchUnitDeviceRailWearInfoVO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键")
private String id;
@ApiModelProperty("创建人")
private String createBy;
@ApiModelProperty("创建日期")
private Date createTime;
@ApiModelProperty("更新人")
private String updateBy;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("分析批id")
private String analysisBatchId;
@ApiModelProperty("分析批次号")
private String analysisBatchCode;
@ApiModelProperty("设备检查记录主表id(t_ek_records_master_check)")
private String ekId;
@ApiModelProperty("检查批次号(t_ek_records_master_check)")
private String ekCode;
@ApiModelProperty("单元表id(t_dsa_analysis_line_batch_unit_device)")
private String deviceId;
@ApiModelProperty("检查设备id(设备资产四种表的主键)")
private String deviceProjectId;
@ApiModelProperty("检查设备编码(设备资产四种表的switch_code)")
private String deviceProjectCode;
@ApiModelProperty("检查设备类型(1-钢轨,2-曲线,3-竖曲线,4-道岔)")
private Integer deviceProjectType;
@ApiModelProperty("股别(1-左股,2-右股)")
private Integer damageLevel;
@ApiModelProperty("伤损钢轨数量")
private Integer damageNum;
@ApiModelProperty("伤损种类(1-鱼鳞纹,2-剥落掉块,3-表面疲劳裂纹,4-轨底掉块,5-灼伤,6-核伤,7-焊缝,8-其他)")
private Integer damageType;
@ApiModelProperty("伤损里程")
private BigDecimal damageMileage;
@ApiModelProperty("伤损程度(1-轻伤,2-轻伤有发展,3-重伤)")
private Integer damageDegree;
@ApiModelProperty("换轨计划")
private String damagePlan;
@ApiModelProperty("是否删除(0:未删除,1:已删除)")
private String delFlag;
}
package org.jeecg.modules.maintenanceWork.dto; package org.jeecg.modules.maintenanceWork.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -54,6 +55,9 @@ public class AnalysisBatchSaveDTO { ...@@ -54,6 +55,9 @@ public class AnalysisBatchSaveDTO {
@ApiModelProperty("作业班组") @ApiModelProperty("作业班组")
private String team; private String team;
@ApiModelProperty("分析类型(1-动静态分析2:其他病害分析)")
private Integer analysisType;
@ApiModelProperty("作业状态 0-未作业 1-已作业") @ApiModelProperty("作业状态 0-未作业 1-已作业")
private Integer workStatus; private Integer workStatus;
......
...@@ -43,6 +43,9 @@ public class WorkBatchDTO { ...@@ -43,6 +43,9 @@ public class WorkBatchDTO {
@ApiModelProperty("作业班组") @ApiModelProperty("作业班组")
private String team; private String team;
@ApiModelProperty("分析类型(1-动静态分析2:其他病害分析)")
private Integer analysisType;
@ApiModelProperty("来源 1-页面添加 2-超限派工添加") @ApiModelProperty("来源 1-页面添加 2-超限派工添加")
private Integer source; private Integer source;
......
package org.jeecg.modules.maintenanceWork.dto; package org.jeecg.modules.maintenanceWork.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -54,6 +55,9 @@ public class WorkBatchTransfiniteSaveDTO { ...@@ -54,6 +55,9 @@ public class WorkBatchTransfiniteSaveDTO {
@ApiModelProperty("作业班组") @ApiModelProperty("作业班组")
private String team; private String team;
@ApiModelProperty("分析类型(1-动静态分析2:其他病害分析)")
private Integer analysisType;
@ApiModelProperty("派工列表") @ApiModelProperty("派工列表")
private List<DispatchDTO> detailList; private List<DispatchDTO> detailList;
} }
...@@ -3,9 +3,11 @@ package org.jeecg.modules.maintenanceWork.entity; ...@@ -3,9 +3,11 @@ package org.jeecg.modules.maintenanceWork.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
...@@ -87,6 +89,10 @@ public class WorkBatch implements Serializable { ...@@ -87,6 +89,10 @@ public class WorkBatch implements Serializable {
@TableField("team") @TableField("team")
private String team; private String team;
@ApiModelProperty("分析类型(1-动静态分析2:其他病害分析)")
@TableField("analysis_type")
private Integer analysisType;
@ApiModelProperty("来源 1-页面添加 2-超限派工添加") @ApiModelProperty("来源 1-页面添加 2-超限派工添加")
@TableField("source") @TableField("source")
private Integer source; private Integer source;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
t1.source, t1.source,
t1.work_status, t1.work_status,
t1.del_flag, t1.del_flag,
t1.analysis_type,
(SELECT count(1) FROM t_mw_work_batch_detail WHERE work_batch_id = t1.id) work_unit_device_num (SELECT count(1) FROM t_mw_work_batch_detail WHERE work_batch_id = t1.id) work_unit_device_num
FROM FROM
t_mw_work_batch t1 t_mw_work_batch t1
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -11,6 +12,13 @@ import org.apache.shiro.SecurityUtils; ...@@ -11,6 +12,13 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
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.modules.diseaseAnalysis.dto.AnalysisLineBatchInfoDTO;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatch;
import org.jeecg.modules.diseaseAnalysis.entity.AnalysisLineBatchUnitDevice;
import org.jeecg.modules.diseaseAnalysis.mapper.AnalysisLineBatchUnitDeviceMapper;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchService;
import org.jeecg.modules.diseaseAnalysis.service.IAnalysisLineBatchUnitDeviceService;
import org.jeecg.modules.diseaseAnalysis.vo.AnalysisLineBatchUnitDeviceVO;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchUnitDeviceDTO; import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchUnitDeviceDTO;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice; import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMapper; import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMapper;
...@@ -61,6 +69,11 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -61,6 +69,11 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
@Resource @Resource
private AnalysisBatchUnitDeviceTransfiniteMapper transfiniteMapper; private AnalysisBatchUnitDeviceTransfiniteMapper transfiniteMapper;
@Resource
private IAnalysisLineBatchUnitDeviceService analysisLineBatchUnitDeviceService;
@Resource
private IAnalysisLineBatchService analysisLineBatchService;
@Override @Override
public Page<WorkBatchVO> listRecord(Page<WorkBatchVO> pageData, WorkBatchDTO dto) { public Page<WorkBatchVO> listRecord(Page<WorkBatchVO> pageData, WorkBatchDTO dto) {
Page<WorkBatchVO> page = this.baseMapper.listRecord(pageData, dto); Page<WorkBatchVO> page = this.baseMapper.listRecord(pageData, dto);
...@@ -164,13 +177,13 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -164,13 +177,13 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatch.setWorkStatus(0); workBatch.setWorkStatus(0);
workBatch.setSource(2); // 超限页面 workBatch.setSource(2); // 超限页面
this.save(workBatch); this.save(workBatch);
// 保存明细 // 保存明细
//获取当前登录人信息 //获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String username = user.getUsername(); String username = user.getUsername();
List<DispatchDTO> transfiniteList = dto.getDetailList(); List<DispatchDTO> transfiniteList = dto.getDetailList();
List<WorkBatchDetail> workBatchDetailList = new ArrayList<>(); List<WorkBatchDetail> workBatchDetailList = new ArrayList<>();
List<AnalysisLineBatchUnitDevice> analysisLineBatchUnitDeviceList = new ArrayList<>();
for (DispatchDTO transfiniteDTO : transfiniteList) { for (DispatchDTO transfiniteDTO : transfiniteList) {
WorkBatchDetail workBatchDetail = new WorkBatchDetail(); WorkBatchDetail workBatchDetail = new WorkBatchDetail();
workBatchDetail.setId(UUIDGenerator.generate()); workBatchDetail.setId(UUIDGenerator.generate());
...@@ -197,9 +210,22 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -197,9 +210,22 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setUpdateBy(username); workBatchDetail.setUpdateBy(username);
workBatchDetailList.add(workBatchDetail); workBatchDetailList.add(workBatchDetail);
//其他病害分析
if (dto.getAnalysisType() == 2) {
AnalysisLineBatchUnitDevice analysisLineBatchUnitDevice = new AnalysisLineBatchUnitDevice();
analysisLineBatchUnitDevice.setId(transfiniteDTO.getId());
analysisLineBatchUnitDevice.setWorkStatus(2);
analysisLineBatchUnitDeviceList.add(analysisLineBatchUnitDevice);
}
} }
workBatchDetailMapper.insertBatch(workBatchDetailList); workBatchDetailMapper.insertBatch(workBatchDetailList);
//其他病害分析更新派工状态
if (dto.getAnalysisType() == 2) {
if (CollectionUtils.isNotEmpty(analysisLineBatchUnitDeviceList)) {
analysisLineBatchUnitDeviceService.updateBatchById(analysisLineBatchUnitDeviceList);
}
}
} }
...@@ -216,10 +242,18 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -216,10 +242,18 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
// 1.构建工单主信息 // 1.构建工单主信息
WorkBatch workBatch = BeanUtil.copyProperties(dto, WorkBatch.class); WorkBatch workBatch = BeanUtil.copyProperties(dto, WorkBatch.class);
workBatch.setId(UUIDGenerator.generate()); workBatch.setId(UUIDGenerator.generate());
workBatch.setWorkStatus(0); // 0-已作业 workBatch.setWorkStatus(0); //0-未作业 9-已作业
workBatch.setSource(2); // 超限页面 workBatch.setSource(2); // 超限页面
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
//循环构建保存对象
List<WorkBatchDetail> workBatchDetailList = new ArrayList<>();
//更新已派工
List<AnalysisLineBatchUnitDevice> analysisLineBatchUnitDeviceList = new ArrayList<>();
if (dto.getAnalysisType() == 1) {
// 2.1 构建查询对象 // 2.1 构建查询对象
AnalysisBatchUnitDeviceDTO params = new AnalysisBatchUnitDeviceDTO(); AnalysisBatchUnitDeviceDTO params = new AnalysisBatchUnitDeviceDTO();
params.setAnalysisBatchId(dto.getAnalysisBatchId()); params.setAnalysisBatchId(dto.getAnalysisBatchId());
...@@ -247,11 +281,6 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -247,11 +281,6 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
if (ObjectUtil.isEmpty(transfiniteList)) { if (ObjectUtil.isEmpty(transfiniteList)) {
throw JeecgBootException.error("创建失败,没有对应的超限数据"); throw JeecgBootException.error("创建失败,没有对应的超限数据");
} }
// 2.3 循环构建保存对象
//获取当前登录人信息
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String realname = user.getRealname();
List<WorkBatchDetail> workBatchDetailList = new ArrayList<>();
for (AnalysisBatchUnitDeviceVO transfinite : transfiniteList) { for (AnalysisBatchUnitDeviceVO transfinite : transfiniteList) {
WorkBatchDetail workBatchDetail = new WorkBatchDetail(); WorkBatchDetail workBatchDetail = new WorkBatchDetail();
workBatchDetail.setId(UUIDGenerator.generate()); workBatchDetail.setId(UUIDGenerator.generate());
...@@ -278,11 +307,54 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch ...@@ -278,11 +307,54 @@ public class WorkBatchServiceImpl extends ServiceImpl<WorkBatchMapper, WorkBatch
workBatchDetail.setWorkStatus(0); workBatchDetail.setWorkStatus(0);
workBatchDetailList.add(workBatchDetail); workBatchDetailList.add(workBatchDetail);
} }
} else {
AnalysisLineBatchInfoDTO params = new AnalysisLineBatchInfoDTO();
params.setAnalysisBatchId(dto.getAnalysisBatchId());
params.setWorkStatus(0);// 0-未派工
Page<AnalysisLineBatchUnitDeviceVO> pageData = new Page<>(1, 99999);
Page<AnalysisLineBatchUnitDeviceVO> pageList = analysisLineBatchService.getInfoPageList(pageData, params);
List<AnalysisLineBatchUnitDeviceVO> records = pageList.getRecords();
// 2.3 循环构建保存对象
if (CollectionUtils.isEmpty(records)) {
throw JeecgBootException.error("创建失败,没有对应的线路超限数据");
}
for (AnalysisLineBatchUnitDeviceVO transfinite : records) {
WorkBatchDetail workBatchDetail = new WorkBatchDetail();
workBatchDetail.setId(UUIDGenerator.generate());
workBatchDetail.setWorkBatchId(workBatch.getId());
workBatchDetail.setWorkBatchCode(workBatch.getWorkBatchCode());
workBatchDetail.setAnalysisBatchUnitDeviceId(transfinite.getId());
workBatchDetail.setAnalysisBatchId(transfinite.getAnalysisBatchId());
workBatchDetail.setAnalysisBatchCode(transfinite.getAnalysisBatchCode());
workBatchDetail.setUnitId(transfinite.getUnitId());
workBatchDetail.setUnitCode(transfinite.getUnitCode());
workBatchDetail.setUnitType(transfinite.getUnitType());
workBatchDetail.setUnitTypeName(transfinite.getUnitTypeName());
workBatchDetail.setUnitDeviceCode(transfinite.getUnitDeviceCode());
workBatchDetail.setUnitStartMileage(transfinite.getUnitStartMileage());
workBatchDetail.setUnitEndMileage(transfinite.getUnitEndMileage());
workBatchDetail.setUnitCenterMileage(transfinite.getUnitCenterMileage());
workBatchDetail.setUpdateTime(new Date());
workBatchDetail.setCreateTime(new Date());
workBatchDetail.setCreateBy(realname);
workBatchDetail.setUpdateBy(realname);
workBatchDetail.setWorkStatus(0);
workBatchDetailList.add(workBatchDetail);
AnalysisLineBatchUnitDevice analysisLineBatchUnitDevice = new AnalysisLineBatchUnitDevice();
analysisLineBatchUnitDevice.setId(transfinite.getId());
analysisLineBatchUnitDevice.setWorkStatus(2);
analysisLineBatchUnitDeviceList.add(analysisLineBatchUnitDevice);
}
}
// 3. 执行数据库保存 // 3. 执行数据库保存
this.save(workBatch); this.save(workBatch);
workBatchDetailMapper.insertBatch(workBatchDetailList); workBatchDetailMapper.insertBatch(workBatchDetailList);
//其他病害分析更新派工状态
if (dto.getAnalysisType() == 2) {
if (CollectionUtils.isNotEmpty(analysisLineBatchUnitDeviceList)) {
analysisLineBatchUnitDeviceService.updateBatchById(analysisLineBatchUnitDeviceList);
}
}
} }
@Override @Override
......
...@@ -61,6 +61,10 @@ public class WorkBatchVO { ...@@ -61,6 +61,10 @@ public class WorkBatchVO {
@ApiModelProperty("作业班组") @ApiModelProperty("作业班组")
private String team; private String team;
@ApiModelProperty("分析类型(1-动静态分析2:其他病害分析)")
@TableField("analysis_type")
private Integer analysisType;
@ApiModelProperty("来源 1-页面添加 2-超限派工添加") @ApiModelProperty("来源 1-页面添加 2-超限派工添加")
private Integer source; private Integer source;
......
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