diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/AssetReceiveApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/AssetReceiveApi.java new file mode 100644 index 00000000..686afeea --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/AssetReceiveApi.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.system.api.assetreceive; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.system.api.assetreceive.dto.AssetReceiveSaveDTO; +import cn.iocoder.yudao.module.system.enums.ApiConstants; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; + +@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = +@Tag(name = "RPC 服务 - 资产领用") +public interface AssetReceiveApi { + + String PREFIX = ApiConstants.PREFIX + "/assetReceive"; + + @PostMapping(PREFIX + "/createReceive") + @Operation(summary = "创建资产领用信息") + CommonResult createReceive(@RequestBody List saveDTOs); +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/dto/AssetReceiveSaveDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/dto/AssetReceiveSaveDTO.java new file mode 100644 index 00000000..80a86ba1 --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/assetreceive/dto/AssetReceiveSaveDTO.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.module.system.api.assetreceive.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.time.LocalDate; + +@Schema(description = "管理后台 - 资产领用新增/修改 Request VO") +@Data +public class AssetReceiveSaveDTO { + + @Schema(description = "资产领用表单主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + private Long id; + + @Schema(description = "领用人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "146") + @NotNull(message = "领用人的用户编号不能为空") + private Long userId; + + @Schema(description = "领用人的部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "128") + @NotNull(message = "领用人的部门编号不能为空") + private Long deptId; + + @Schema(description = "分配人的用户编号") + private Long receiveUserId; + + @Schema(description = "资产编号") + private String assetsNo; + + @Schema(description = "资产类型编号", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "资产类型编号不能为空") + private Long assetsTypeId; + + @Schema(description = "数量", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "数量不能为空") + private Integer num; + + @Schema(description = "申请日期") + private LocalDate applyDate; + + @Schema(description = "分配日期") + private LocalDate allocationDate; + + @Schema(description = "领用状态 | 0待领用 1采购中 2已领用 ", example = "0") + private Integer status; + + @Schema(description = "附件信息") + private String fileItems; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java index 2f1de939..886f2f76 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java @@ -242,6 +242,7 @@ public interface ErrorCodeConstants { ErrorCode INSUFFICIENT_IDLE_MATERIALS = new ErrorCode(1_010_001_005, "空闲物料不足!"); ErrorCode THE_CORRESPONDING_ASSET_TYPE_WAS_NOT_FOUND = new ErrorCode(1_010_001_006, "未找到对应的资产类型!"); + ErrorCode ASSET_RECEIVE_NOT_EXISTS = new ErrorCode(1_010_001_007, "资产领用不存在"); // ========== 考勤设备相关 1-011-001-001 ========== ErrorCode USERS_EXT_NOT_EXISTS = new ErrorCode(1_011_001_001, "用户信息不存在!");