终端周期检测代码调整

This commit is contained in:
xy
2024-07-03 14:18:49 +08:00
parent 306200791a
commit fd23719a41
11 changed files with 165 additions and 11 deletions

View File

@@ -167,4 +167,13 @@ public class DeviceController extends BaseController {
Console.log("string payload : {}", payload);
}
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
@PostMapping("/updateDevCheckTime")
@ApiOperation("技术监督修改装置定检时间")
public HttpResult<String> updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
String methodDescribe = getMethodDescribe("updateDevCheckTime");
iDeviceService.updateDevCheckTime(devId,thisTimeCheck,nextTimeCheck);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
}
}

View File

@@ -125,4 +125,12 @@ public interface IDeviceService extends IService<Device> {
* @Date: 2023/8/17 9:24
*/
String restartDev(List<String> devList);
/**
* @param devId 装置id
* @param thisTimeCheck 本次定检时间
* @param nextTimeCheck 下次定检时间
* @Description: 技术监督修改装置定检时间
*/
void updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck);
}

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.device.pq.mapper.DevVersionMapper;
import com.njcn.device.pq.mapper.DeviceMapper;
@@ -397,5 +398,14 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
return "命令发送成功";
}
@Override
public void updateDevCheckTime(String devId, String thisTimeCheck, String nextTimeCheck) {
LambdaUpdateWrapper<Device> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(Device::getId, devId)
.set(Device::getThisTimeCheck, thisTimeCheck)
.set(Device::getNextTimeCheck, nextTimeCheck);
this.update(updateWrapper);
}
}