fix:设备-维护功能细节调整

This commit is contained in:
FCL
2026-03-10 17:51:04 +08:00
parent 5adc5525e9
commit 5eb77f6ede
4 changed files with 23 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ public class DeviceConfigBusinessItemController extends AbstractFileUploadContro
Long productId = pageReqVO.getProductId();
if (productId != null) {
DeviceConfigBusinessRuleDO ruleDO = deviceConfigBusinessRuleService.getByProductId(productId, DeviceConstant.MAINTAIN_TYPE);
DeviceConfigBusinessRuleDO ruleDO = deviceConfigBusinessRuleService.getByProductId(productId, pageReqVO.getBusinessDomain());
if(ruleDO != null){
pageReqVO.setRuleId(ruleDO.getId());
}

View File

@@ -20,6 +20,7 @@ import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.io.IOException;
@@ -103,8 +104,23 @@ public class DeviceMaintainController extends AbstractFileUploadController imple
@PostMapping("/create")
@Operation(summary = "创建设备-点检、保养记录")
// @PreAuthorize("@ss.hasPermission('qms:device-maintain:create')")
public CommonResult<DeviceMaintainRespVO> createDeviceMaintain(@Valid @RequestBody DeviceMaintainSaveReqVO createReqVO) {
return success(deviceMaintainService.createDeviceMaintain(createReqVO));
public CommonResult<DeviceMaintainVO> createDeviceMaintain(@RequestBody JSONObject jsonObject) {
Long deviceId = jsonObject.getLong("deviceId");
String dataType = jsonObject.getString("dataType");
String dateStr = jsonObject.getString("date");
if (deviceId == null || dataType == null) {
return CommonResult.error(DEVICE_MAINTAIN_NOT_EXISTS.getCode(), "参数错误");
}
//检查设备状态
CommonResult<Boolean> checkResult = deviceInfomationService.checkDeviceUsable(deviceId);
if(!checkResult.isSuccess()){
return checkResult.error(checkResult.getCode(), checkResult.getMsg());
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(ObjectUtils.isEmpty(dateStr))
dateStr = sdf.format(new Date());
LocalDate localDate = LocalDate.parse(dateStr);
return deviceMaintainService.create(deviceId, localDate, dataType);
}
@PutMapping("/update")

View File

@@ -57,4 +57,7 @@ public class DeviceConfigBusinessItemPageReqVO extends PageParam {
@Schema(description = "设备大类id")
private Long productId;
@Schema(description = "业务类型")
private String businessDomain;
}

View File

@@ -99,7 +99,7 @@ public class DeviceMaintainItemDO extends BusinessBaseDO {
/**
* 所属周期截止日期
*/
@TableField("FREQ_TM_STRT")
@TableField("FREQ_TM_END")
private LocalDateTime frequencyTimeEnd;
/**
* 检查标准