Commit 4cf9ebaa authored by hkl's avatar hkl

feat:1.修改bug

parent fe473b97
......@@ -519,37 +519,6 @@ public class RecordsMasterCheckController extends JeecgController<RecordsMasterC
recordsMasterCorrWaveList.add(model);
}
/**
* 处理滑床板部分
* @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);
// }
/**
* 处理轮缘槽部分
......
......@@ -33,7 +33,6 @@
AND t1.check_time <![CDATA[ <= ]]> #{dto.endTime}
</if>
AND t1.type = #{dto.type}
AND t2.status = 1
order by t1.create_time desc
</where>
</select>
......
{
"name": "右股仪器编号",
"code": "",
"probeCombination": {
"checkName": "探头组合",
"value1": "37℃",
......
......@@ -8,18 +8,17 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchQueryDTO;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchSaveOrUpdateDTO;
import org.jeecg.modules.dynamicStaticAnalysis.dto.CheckBatchDTO;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatch;
import org.jeecg.modules.dynamicStaticAnalysis.face.AnalysisBatchUnitDeviceFace;
import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchService;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -84,6 +83,18 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna
@PostMapping(value = "/saveRecord")
public Result<String> saveRecord(@RequestBody AnalysisBatchSaveOrUpdateDTO dto) {
if (dto.getStartingMileage().compareTo(dto.getEndMileage()) > 0) {
throw new JeecgBootException("起始里程不能大于结束里程");
}
// 出重
AnalysisBatch exist = this.service.lambdaQuery().eq(AnalysisBatch::getAnalysisBatchCode, dto.getAnalysisBatchCode())
.last("limit 1")
.one();
if (exist != null) {
throw new JeecgBootException("【" + dto.getAnalysisBatchCode() + "】分析批次已存在");
}
this.service.saveRecord(dto);
return Result.OK("操作成功");
......@@ -94,6 +105,10 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna
@ApiOperation(value = "动静态分析-分析批次-更新分析批次", notes = "动静态分析-分析批次-更新分析批次")
@PostMapping(value = "/updateRecord")
public Result<String> updateRecord(@RequestBody AnalysisBatchSaveOrUpdateDTO dto) {
if (dto.getStartingMileage().compareTo(dto.getEndMileage()) > 0) {
throw new JeecgBootException("起始里程不能大于结束里程");
}
this.service.updateRecord(dto);
......@@ -124,5 +139,4 @@ public class AnalysisBatchController extends JeecgController<AnalysisBatch, IAna
}
}
......@@ -37,4 +37,9 @@ public class AnalysisBatchQueryDTO {
@ApiModelProperty("分析状态 0-创建 1-分析中 99-分析完成")
private Integer analysisStatus;
@ApiModelProperty("开始里程")
private BigDecimal startMileage;
@ApiModelProperty("结束里程")
private BigDecimal endMileage;
}
......@@ -17,4 +17,6 @@ import java.util.List;
public interface AnalysisBatchUnitDeviceTransfiniteMapper extends BaseMapper<AnalysisBatchUnitDeviceTransfinite> {
List<AnalysisBatchUnitDeviceTransfiniteVO> getTransfiniteList(String analysisBatchUnitDeviceId);
List<AnalysisBatchUnitDeviceTransfiniteVO> getTransfiniteListByIds(List<String> analysisBatchUnitDeviceIds);
}
......@@ -60,6 +60,22 @@
t1.remark
FROM
t_dsa_analysis_batch t1
where 1=1
<if test="dto.lightRailId != null and dto.lightRailId != ''">
AND t1.light_rail_id = #{dto.lightRailId}
</if>
<if test="dto.lineAliasId != null and dto.lineAliasId != ''">
AND t1.line_alias_id = #{dto.lineAliasId}
</if>
<if test="dto.startMileage != null">
AND t1.starting_mileage >= #{dto.startMileage }
</if>
<if test="dto.endMileage != null">
AND t1.end_mileage <![CDATA[ <= ]]> #{dto.endMileage}
</if>
<if test="dto.analysisBatchCode != null and dto.analysisBatchCode != ''">
AND t1.analysis_batch_code like concat('%',#{dto.analysisBatchCode},'%')
</if>
</select>
<select id="listRecordDetail" resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.CheckBatchVO">
SELECT
......
......@@ -28,4 +28,36 @@
t_dsa_analysis_batch_unit_device_transfinite t1
WHERE t1.analysis_batch_unit_device_id = #{analysisBatchUnitDeviceId}
</select>
<select id="getTransfiniteListByIds"
resultType="org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO">
SELECT
t1.id,
t1.create_by,
t1.create_time,
t1.update_by,
t1.update_time,
t1.analysis_batch_unit_device_id,
t1.analysis_batch_code,
t1.analysis_batch_id,
t1.unit_id,
t1.unit_code,
t1.unit_type,
t1.unit_type_name,
t1.transfinite_grade,
t1.transfinite_grade_name,
t1.transfinite_type,
t1.allow_value,
t1.measure_point_value,
t1.is_work,
t1.remark
FROM
t_dsa_analysis_batch_unit_device_transfinite t1
WHERE t1.analysis_batch_unit_device_id IN
<if test="analysisBatchUnitDeviceIds !=null and analysisBatchUnitDeviceIds.size()>0">
<foreach collection="analysisBatchUnitDeviceIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
package org.jeecg.modules.dynamicStaticAnalysis.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.dynamicStaticAnalysis.dto.AnalysisBatchUnitDeviceDTO;
import org.jeecg.modules.dynamicStaticAnalysis.entity.AnalysisBatchUnitDevice;
......@@ -7,6 +8,7 @@ import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceMap
import org.jeecg.modules.dynamicStaticAnalysis.mapper.AnalysisBatchUnitDeviceTransfiniteMapper;
import org.jeecg.modules.dynamicStaticAnalysis.service.IAnalysisBatchUnitDeviceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchQueryVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceTransfiniteVO;
import org.jeecg.modules.dynamicStaticAnalysis.vo.AnalysisBatchUnitDeviceVO;
import org.jeecg.modules.unitDevice.vo.RailAddInstrumentCheckVO;
......@@ -16,7 +18,10 @@ import org.jeecg.modules.unitDevice.vo.StaticCheckVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* <p>
......@@ -36,9 +41,13 @@ public class AnalysisBatchUnitDeviceServiceImpl extends ServiceImpl<AnalysisBatc
public Page<AnalysisBatchUnitDeviceVO> listRecord(Page<AnalysisBatchUnitDeviceVO> pageData, AnalysisBatchUnitDeviceDTO dto) {
Page<AnalysisBatchUnitDeviceVO> page = this.baseMapper.listRecord(pageData, dto);
for (AnalysisBatchUnitDeviceVO record : page.getRecords()) {
List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = transfiniteMapper.getTransfiniteList(record.getId());
record.setTransfiniteList(transfiniteList);
if (ObjectUtil.isNotEmpty(page.getRecords())) {
List<String> analysisBatchUnitDeviceIds = page.getRecords().stream().map(AnalysisBatchUnitDeviceVO::getId).collect(Collectors.toList());
List<AnalysisBatchUnitDeviceTransfiniteVO> transfiniteList = transfiniteMapper.getTransfiniteListByIds(analysisBatchUnitDeviceIds);
Map<String, List<AnalysisBatchUnitDeviceTransfiniteVO>> map = transfiniteList.stream().collect(Collectors.groupingBy(AnalysisBatchUnitDeviceTransfiniteVO::getAnalysisBatchUnitDeviceId));
page.getRecords().forEach(record -> record.setTransfiniteList(map.get(record.getId())));
}
return page;
......
......@@ -2,4 +2,4 @@ spring:
application:
name: jeecg-system
profiles:
active: dev
active: hkl
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