feat:设备后端接口-使用记录、设备申请等

This commit is contained in:
FCL
2026-01-04 08:58:27 +08:00
parent cc2812c458
commit 3c4b951c7b
21 changed files with 758 additions and 84 deletions

View File

@@ -168,7 +168,7 @@ public interface ErrorCodeConstants {
ErrorCode DEVICE_AFFILIATION_RELATIVITY_NOT_EXISTS = new ErrorCode(1_032_150_000, "附属设备关系不存在");
ErrorCode DEVICE_APPLY_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备申请明细数据不存在");
ErrorCode DEVICE_APPLY_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备申请数据不存在");
ErrorCode DEVICE_CONFIG_FLOW_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备通用流程配置不存在");
// -------------物料试剂-------------
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");

View File

@@ -52,16 +52,17 @@ public class DeviceApplyController extends AbstractFileUploadController implemen
@Resource
private DeviceApplyService deviceApplyService;
//todo 通过设备通用流程配置创建
@PostMapping("/create")
@Operation(summary = "创建设备通用流程,验收、降级、停用、报废、还原、启用")
@PreAuthorize("@ss.hasPermission('qms:device-apply:create')")
// @PreAuthorize("@ss.hasPermission('qms:device-apply:create')")
public CommonResult<DeviceApplyRespVO> createDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO createReqVO) {
return success(deviceApplyService.createDeviceApply(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新设备通用流程,验收、降级、停用、报废、还原、启用")
@PreAuthorize("@ss.hasPermission('qms:device-apply:update')")
// @PreAuthorize("@ss.hasPermission('qms:device-apply:update')")
public CommonResult<Boolean> updateDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO updateReqVO) {
deviceApplyService.updateDeviceApply(updateReqVO);
return success(true);
@@ -70,7 +71,7 @@ public class DeviceApplyController extends AbstractFileUploadController implemen
@DeleteMapping("/delete")
@Operation(summary = "删除设备通用流程,验收、降级、停用、报废、还原、启用")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('qms:device-apply:delete')")
// @PreAuthorize("@ss.hasPermission('qms:device-apply:delete')")
public CommonResult<Boolean> deleteDeviceApply(@RequestParam("id") Long id) {
deviceApplyService.deleteDeviceApply(id);
return success(true);

View File

@@ -96,8 +96,11 @@ public class DeviceUseRecordController extends AbstractFileUploadController impl
@PutMapping("/update")
@Operation(summary = "更新设备-使用记录")
@PreAuthorize("@ss.hasPermission('qms:device-use-record:update')")
public CommonResult<Boolean> updateDeviceUseRecord(@Valid @RequestBody DeviceUseRecordSaveReqVO updateReqVO) {
deviceUseRecordService.updateDeviceUseRecord(updateReqVO);
public CommonResult<Boolean> updateDeviceUseRecord(@Valid @RequestBody DeviceUseRecordSaveReqVO reqVO) {
Long deviceId = reqVO.getDeviceId();
if(deviceId == null)
return CommonResult.error(DEVICE_USE_RECORD_NOT_EXISTS.getCode(), "设备ID不能为空");
deviceUseRecordService.updateDeviceUseRecord(reqVO);
return success(true);
}

View File

@@ -12,7 +12,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data
public class DeviceApplyPageReqVO extends PageParam {
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五")
private String businessName;
@Schema(description = "申请部门", example = "王五")
@@ -21,7 +21,7 @@ public class DeviceApplyPageReqVO extends PageParam {
@Schema(description = "申请部门ID")
private String applyDepartment;
@Schema(description = "申请人", example = "王五")
@Schema(description = "申请人", example = "ZT")
private String applyUserName;
@Schema(description = "申请人ID")
@@ -43,13 +43,13 @@ public class DeviceApplyPageReqVO extends PageParam {
@Schema(description = "借用人")
private String businessUser;
@Schema(description = "借用人id", example = "14524")
@Schema(description = "借用人id", example = "30865")
private Long businessUserId;
@Schema(description = "借用部门")
private String businessDepartment;
@Schema(description = "借用部门id", example = "894")
@Schema(description = "借用部门id", example = "3852")
private Long businessDepartmentId;
@Schema(description = "计划归还日期")
@@ -59,16 +59,22 @@ public class DeviceApplyPageReqVO extends PageParam {
@Schema(description = "归还接收人")
private String givebackReceiveUser;
@Schema(description = "归还接收人id", example = "1528")
@Schema(description = "归还接收人id", example = "1499")
private Long givebackReceiveUserId;
@Schema(description = "数据集配置ID", example = "12435")
@Schema(description = "表单模板ID", example = "23422")
private String templateId;
@Schema(description = "表单组件")
private String formComponent;
@Schema(description = "数据集配置ID", example = "17263")
private Long dataCollectionId;
@Schema(description = "表单数据")
private String formData;
@Schema(description = "流程实例id", example = "15634")
@Schema(description = "流程实例id", example = "289")
private String flowInstanceId;
@Schema(description = "所属部门")

View File

@@ -11,11 +11,11 @@ import com.alibaba.excel.annotation.*;
@ExcelIgnoreUnannotated
public class DeviceApplyRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20295")
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23536")
@ExcelProperty("ID")
private Long id;
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五")
@ExcelProperty("业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等")
private String businessName;
@@ -27,7 +27,7 @@ public class DeviceApplyRespVO {
@ExcelProperty("申请部门ID")
private String applyDepartment;
@Schema(description = "申请人", example = "王五")
@Schema(description = "申请人", example = "ZT")
@ExcelProperty("申请人")
private String applyUserName;
@@ -55,7 +55,7 @@ public class DeviceApplyRespVO {
@ExcelProperty("借用人")
private String businessUser;
@Schema(description = "借用人id", example = "14524")
@Schema(description = "借用人id", example = "30865")
@ExcelProperty("借用人id")
private Long businessUserId;
@@ -63,7 +63,7 @@ public class DeviceApplyRespVO {
@ExcelProperty("借用部门")
private String businessDepartment;
@Schema(description = "借用部门id", example = "894")
@Schema(description = "借用部门id", example = "3852")
@ExcelProperty("借用部门id")
private Long businessDepartmentId;
@@ -75,11 +75,19 @@ public class DeviceApplyRespVO {
@ExcelProperty("归还接收人")
private String givebackReceiveUser;
@Schema(description = "归还接收人id", example = "1528")
@Schema(description = "归还接收人id", example = "1499")
@ExcelProperty("归还接收人id")
private Long givebackReceiveUserId;
@Schema(description = "数据集配置ID", example = "12435")
@Schema(description = "表单模板ID", example = "23422")
@ExcelProperty("表单模板ID")
private String templateId;
@Schema(description = "表单组件")
@ExcelProperty("表单组件")
private String formComponent;
@Schema(description = "数据集配置ID", example = "17263")
@ExcelProperty("数据集配置ID")
private Long dataCollectionId;
@@ -87,7 +95,7 @@ public class DeviceApplyRespVO {
@ExcelProperty("表单数据")
private String formData;
@Schema(description = "流程实例id", example = "15634")
@Schema(description = "流程实例id", example = "289")
@ExcelProperty("流程实例id")
private String flowInstanceId;

View File

@@ -9,10 +9,10 @@ import java.time.LocalDateTime;
@Data
public class DeviceApplySaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20295")
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23536")
private Long id;
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "王五")
private String businessName;
@Schema(description = "申请部门", example = "王五")
@@ -21,7 +21,7 @@ public class DeviceApplySaveReqVO {
@Schema(description = "申请部门ID")
private String applyDepartment;
@Schema(description = "申请人", example = "王五")
@Schema(description = "申请人", example = "ZT")
private String applyUserName;
@Schema(description = "申请人ID")
@@ -42,13 +42,13 @@ public class DeviceApplySaveReqVO {
@Schema(description = "借用人")
private String businessUser;
@Schema(description = "借用人id", example = "14524")
@Schema(description = "借用人id", example = "30865")
private Long businessUserId;
@Schema(description = "借用部门")
private String businessDepartment;
@Schema(description = "借用部门id", example = "894")
@Schema(description = "借用部门id", example = "3852")
private Long businessDepartmentId;
@Schema(description = "计划归还日期")
@@ -57,16 +57,22 @@ public class DeviceApplySaveReqVO {
@Schema(description = "归还接收人")
private String givebackReceiveUser;
@Schema(description = "归还接收人id", example = "1528")
@Schema(description = "归还接收人id", example = "1499")
private Long givebackReceiveUserId;
@Schema(description = "数据集配置ID", example = "12435")
@Schema(description = "表单模板ID", example = "23422")
private String templateId;
@Schema(description = "表单组件")
private String formComponent;
@Schema(description = "数据集配置ID", example = "17263")
private Long dataCollectionId;
@Schema(description = "表单数据")
private String formData;
@Schema(description = "流程实例id", example = "15634")
@Schema(description = "流程实例id", example = "289")
private String flowInstanceId;
@Schema(description = "所属部门")

View File

@@ -0,0 +1,49 @@
package com.zt.plat.module.qms.resource.device.controller.vo;
import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 设备通用流程配置分页 Request VO")
@Data
public class DeviceConfigFlowPageReqVO extends PageParam {
@Schema(description = "业务类型", example = "2")
private String businessType;
@Schema(description = "业务类型名称", example = "王五")
private String businessName;
@Schema(description = "流程key")
private String flowKey;
@Schema(description = "数据集配置Key")
private String dataCollectionKey;
@Schema(description = "表单模板key")
private String templateKey;
@Schema(description = "表单组件")
private String formComponent;
@Schema(description = "其他配置")
private String customConfig;
@Schema(description = "排序号")
private Integer orderNo;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,60 @@
package com.zt.plat.module.qms.resource.device.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 设备通用流程配置 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DeviceConfigFlowRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6744")
@ExcelProperty("主键")
private Long id;
@Schema(description = "业务类型", example = "2")
@ExcelProperty("业务类型")
private String businessType;
@Schema(description = "业务类型名称", example = "王五")
@ExcelProperty("业务类型名称")
private String businessName;
@Schema(description = "流程key")
@ExcelProperty("流程key")
private String flowKey;
@Schema(description = "数据集配置Key")
@ExcelProperty("数据集配置ID")
private String dataCollectionKey;
@Schema(description = "表单模板key")
@ExcelProperty("表单模板key")
private String templateKey;
@Schema(description = "表单组件")
@ExcelProperty("表单组件")
private String formComponent;
@Schema(description = "其他配置")
private String customConfig;;
@Schema(description = "排序号")
private Integer orderNo;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,43 @@
package com.zt.plat.module.qms.resource.device.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@Schema(description = "管理后台 - 设备通用流程配置新增/修改 Request VO")
@Data
public class DeviceConfigFlowSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6744")
private Long id;
@Schema(description = "业务类型", example = "2")
private String businessType;
@Schema(description = "业务类型名称", example = "王五")
private String businessName;
@Schema(description = "流程key")
private String flowKey;
@Schema(description = "数据集配置Key")
private String dataCollectionKey;
@Schema(description = "表单模板key")
private String templateKey;
@Schema(description = "表单组件")
private String formComponent;
@Schema(description = "其他配置")
private String customConfig;;
@Schema(description = "排序号")
private Integer orderNo;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

Some files were not shown because too many files have changed in this diff Show More