新增测试项修改功能

This commit is contained in:
xy
2025-01-09 11:52:41 +08:00
parent 2df06d9597
commit 158917f2bc
5 changed files with 35 additions and 2 deletions

View File

@@ -127,6 +127,20 @@ public class WlRecordController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 修改测试项日志
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
@PostMapping("/updateRecordData")
@ApiOperation("修改测试项日志")
@ApiImplicitParam(name = "record", value = "测试项日志信息", required = true)
public HttpResult<Boolean> updateRecordData(@RequestBody @Validated WlRecordParam.UpdateRecord record) {
String methodDescribe = getMethodDescribe("updateRecordData");
LogUtil.njcnDebug(log, "{},修改的测试项日志信息:{}", methodDescribe, record);
wlRecordService.updateRecordData(record);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 新增或修改方案
*/

View File

@@ -63,6 +63,8 @@ public interface IWlRecordService extends IService<WlRecord> {
*/
void updateTestRecord(WlRecordParam.UpdateRecord record);
void updateRecordData(WlRecordParam.UpdateRecord record);
/**
* 新增或修改方案
* @param record

View File

@@ -206,6 +206,20 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
overlimitService.saveOrUpdate(overlimit);
}
@Override
public void updateRecordData(WlRecordParam.UpdateRecord record) {
LambdaQueryWrapper<WlRecord> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(WlRecord::getId, record.getId());
WlRecord wlRecord = this.getOne(queryWrapper);
if (Objects.isNull(wlRecord)) {
throw new BusinessException("测试项缺失!");
} else {
wlRecord.setStartTime(record.getProStartTime());
wlRecord.setEndTime(record.getProEndTime());
}
this.updateById(wlRecord);
}
@Override
public void updateSchemeRecord(WlRecordParam.UpdateRecord record) {
WlRecord wlRecord = new WlRecord();
@@ -682,7 +696,7 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
StatisticalDataDTO statisticalDataDTO = commonMapper.getLineRtData(influxQueryWrapper);
if(Objects.nonNull(statisticalDataDTO)){
LocalDateTime endTime = statisticalDataDTO.getTime().atOffset(ZoneOffset.ofHours(0)).toLocalDateTime();
Duration duration = Duration.between(now, endTime);
Duration duration = Duration.between(endTime,now);
long hour = duration.toHours();
if(hour>6){
WlRecord wlRecord = new WlRecord();