You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/java/com/glxp/api/controller/inv/DeviceInspectSetController....

69 lines
2.2 KiB
Java

package com.glxp.api.controller.inv;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.inv.DeviceInspectSetEntity;
import com.glxp.api.req.inv.AddDeviceInspectSetRequest;
import com.glxp.api.res.inv.DeviceInspectSetResponse;
import com.glxp.api.service.inv.DeviceInspectSetService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 科室设备巡检设置接口
*/
@Slf4j
@RestController
public class DeviceInspectSetController {
@Resource
private DeviceInspectSetService deviceInspectSetService;
/**
* 查询设备巡检设置
*
* @param code
* @return
*/
@GetMapping("/udiwms/inv/device/inspect/set/findInspectSet")
public BaseResponse findInspectSet(String code) {
DeviceInspectSetResponse inspectSet = deviceInspectSetService.findInspectSet(code);
return ResultVOUtils.success(inspectSet);
}
/**
* 添加设备巡检设置
*
* @param addDeviceInspectSetRequest
* @return
*/
@PostMapping("/udiwms/inv/device/inspect/set/addDeviceInspect")
public BaseResponse addDeviceInspect(@RequestBody AddDeviceInspectSetRequest addDeviceInspectSetRequest) {
if (null == addDeviceInspectSetRequest || StrUtil.isBlank(addDeviceInspectSetRequest.getCode())) {
return ResultVOUtils.paramVerifyFail();
}
return deviceInspectSetService.addDeviceInspect(addDeviceInspectSetRequest);
}
/**
* 更新设备巡检设置
*
* @param deviceInspectSetEntity
* @return
*/
@PostMapping("/udiwms/inv/device/inspect/set/updateInspectSet")
public BaseResponse updateInspectSet(@RequestBody DeviceInspectSetEntity deviceInspectSetEntity) {
if (null == deviceInspectSetEntity) {
return ResultVOUtils.paramVerifyFail();
}
return deviceInspectSetService.updateInspectSet(deviceInspectSetEntity);
}
}