配合前端做些数据修改

This commit is contained in:
guofeihu
2024-07-12 16:37:18 +08:00
parent 2746ae377f
commit a630792641
3 changed files with 5 additions and 16 deletions

View File

@@ -138,19 +138,6 @@ public class WlRecordController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
} }
/**
* 添加测试项中的设备基础数据
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
@PostMapping("/saveDataRecord")
@ApiOperation("添加测试项中的设备基础数据")
public HttpResult<Boolean> saveDataRecord(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
String methodDescribe = getMethodDescribe("saveDataRecord");
LogUtil.njcnDebug(log, "{},测试项及基础数据对象为:{}", methodDescribe, record);
wlRecordService.saveDataRecord(record);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/** /**
* 查询测试项时间段实时数据 * 查询测试项时间段实时数据
*/ */

View File

@@ -40,7 +40,7 @@
</select> </select>
<select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo"> <select id="getRecordAllLine" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllLineTreeVo">
select a.line_id as id,c.name as name, #{wlRecordPageParam.devId} as pid from wl_record a select concat(a.line_id,'-',#{wlRecordPageParam.devId}) as id,c.name as name, #{wlRecordPageParam.devId} as pid from wl_record a
left join cs_line c on a.line_id = c.line_id left join cs_line c on a.line_id = c.line_id
where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and
<if test="wlRecordPageParam.isTrueFlag == 0"> <if test="wlRecordPageParam.isTrueFlag == 0">
@@ -53,7 +53,7 @@
</select> </select>
<select id="getRecordAllTime" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllTimeTreeVo"> <select id="getRecordAllTime" resultType="com.njcn.csdevice.pojo.vo.RecordAllDevTreeVo$RecordAllTimeTreeVo">
select a.id as id,concat(a.start_time,'-',a.end_time) as name, #{wlRecordPageParam.lineId} as pid from wl_record a select a.id as id,concat(a.start_time,'-',a.end_time) as name, concat(#{wlRecordPageParam.lineId},'-',#{wlRecordPageParam.devId}) as pid from wl_record a
left join cs_line c on a.line_id = c.line_id left join cs_line c on a.line_id = c.line_id
where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and a.line_id=#{wlRecordPageParam.lineId} where a.type=1 and a.state =1 and a.dev_id=#{wlRecordPageParam.devId} and a.line_id=#{wlRecordPageParam.lineId}
and and

View File

@@ -102,10 +102,12 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void updateTestRecord(WlRecordParam.UpdateRecord record) { public void updateTestRecord(WlRecordParam.UpdateRecord record) {
WlRecord wlRecord = new WlRecord(); WlRecord wlRecord = new WlRecord();
BeanUtils.copyProperties(record, wlRecord); BeanUtils.copyProperties(record, wlRecord);
this.updateById(wlRecord); this.updateById(wlRecord);
saveDataRecord(record);
} }
@Override @Override
@@ -176,7 +178,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
wlRecordPageParam.setDevId(recordAllDevTreeVo.getId()); wlRecordPageParam.setDevId(recordAllDevTreeVo.getId());
List<RecordAllDevTreeVo.RecordAllLineTreeVo> recordAllLineTreeVos = this.baseMapper.getRecordAllLine(wlRecordPageParam); List<RecordAllDevTreeVo.RecordAllLineTreeVo> recordAllLineTreeVos = this.baseMapper.getRecordAllLine(wlRecordPageParam);
for(RecordAllDevTreeVo.RecordAllLineTreeVo recordAllLineTreeVo : recordAllLineTreeVos){ for(RecordAllDevTreeVo.RecordAllLineTreeVo recordAllLineTreeVo : recordAllLineTreeVos){
wlRecordPageParam.setLineId(recordAllLineTreeVo.getId()); wlRecordPageParam.setLineId(recordAllLineTreeVo.getId().split("-")[0]);
recordAllLineTreeVo.setChildren(this.baseMapper.getRecordAllTime(wlRecordPageParam)); recordAllLineTreeVo.setChildren(this.baseMapper.getRecordAllTime(wlRecordPageParam));
} }
recordAllDevTreeVo.setChildren(recordAllLineTreeVos); recordAllDevTreeVo.setChildren(recordAllLineTreeVos);