diff --git a/wms-module-system/src/main/java/top/wms/admin/material/mapper/MaterialInfoMapper.java b/wms-module-system/src/main/java/top/wms/admin/material/mapper/MaterialInfoMapper.java new file mode 100644 index 0000000..1d1b791 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/mapper/MaterialInfoMapper.java @@ -0,0 +1,16 @@ +package top.wms.admin.material.mapper; + +import top.continew.starter.data.mp.base.BaseMapper; +import top.wms.admin.material.model.entity.MaterialInfoDO; +import org.springframework.stereotype.Repository; + +/** + * 物料信息 Mapper + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Repository +public interface MaterialInfoMapper extends BaseMapper { + +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/model/entity/MaterialInfoDO.java b/wms-module-system/src/main/java/top/wms/admin/material/model/entity/MaterialInfoDO.java new file mode 100644 index 0000000..49d67fd --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/model/entity/MaterialInfoDO.java @@ -0,0 +1,49 @@ +package top.wms.admin.material.model.entity; + +import lombok.Data; + +import com.baomidou.mybatisplus.annotation.TableName; + +import top.wms.admin.common.model.entity.BaseDO; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 物料信息实体 + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Data +@TableName("sys_material_info") +public class MaterialInfoDO extends BaseDO { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 物料编码 + */ + private String encoding; + + /** + * 物料单位重量(g) + */ + private BigDecimal unitWeight; + + /** + * 物料单次可称量最大重量(kg) + */ + private BigDecimal maxWeight; + + /** + * 物料照片地址 + */ + private String photoUrl; +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/model/query/MaterialInfoQuery.java b/wms-module-system/src/main/java/top/wms/admin/material/model/query/MaterialInfoQuery.java new file mode 100644 index 0000000..7a1daed --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/model/query/MaterialInfoQuery.java @@ -0,0 +1,39 @@ +package top.wms.admin.material.model.query; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import top.continew.starter.data.core.annotation.Query; +import top.continew.starter.data.core.enums.QueryType; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 物料信息查询条件 + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Data +@Schema(description = "物料信息查询条件") +public class MaterialInfoQuery implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + @Query(type = QueryType.LIKE) + private String materialName; + + /** + * 物料编码 + */ + @Schema(description = "物料编码") + @Query(type = QueryType.EQ) + private String encoding; +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/model/req/MaterialInfoReq.java b/wms-module-system/src/main/java/top/wms/admin/material/model/req/MaterialInfoReq.java new file mode 100644 index 0000000..688cfa8 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/model/req/MaterialInfoReq.java @@ -0,0 +1,61 @@ +package top.wms.admin.material.model.req; + +import jakarta.validation.constraints.*; + +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import org.hibernate.validator.constraints.Length; + +import java.io.Serial; +import java.io.Serializable; + +/** + * 创建或修改物料信息参数 + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Data +@Schema(description = "创建或修改物料信息参数") +public class MaterialInfoReq implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + @NotBlank(message = "物料名称不能为空") + @Length(max = 255, message = "物料名称长度不能超过 {max} 个字符") + private String materialName; + + /** + * 物料编码 + */ + @Schema(description = "物料编码") + @NotBlank(message = "物料编码不能为空") + @Length(max = 255, message = "物料编码长度不能超过 {max} 个字符") + private String encoding; + + /** + * 物料单位重量(g) + */ + @Schema(description = "物料单位重量(g)") + private Double unitWeight; + + /** + * 物料单次可称量最大重量(kg) + */ + @Schema(description = "物料单次可称量最大重量(kg)") + private Double maxWeight; + + /** + * 物料照片地址 + */ + @Schema(description = "物料照片地址") + @Length(max = 255, message = "物料照片地址长度不能超过 {max} 个字符") + private String photoUrl; +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/model/resp/MaterialInfoResp.java b/wms-module-system/src/main/java/top/wms/admin/material/model/resp/MaterialInfoResp.java new file mode 100644 index 0000000..9551ccb --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/model/resp/MaterialInfoResp.java @@ -0,0 +1,60 @@ +package top.wms.admin.material.model.resp; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import io.swagger.v3.oas.annotations.media.Schema; + +import top.wms.admin.common.model.resp.BaseDetailResp; + +import java.io.Serial; + +/** + * 物料信息信息 + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Data +@Schema(description = "物料信息信息") +public class MaterialInfoResp extends BaseDetailResp { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 物料名称 + */ + @Schema(description = "物料名称") + @ExcelProperty(value = "物料名称") + private String materialName; + + /** + * 物料编码 + */ + @Schema(description = "物料编码") + @ExcelProperty(value = "物料编码") + private String encoding; + + /** + * 物料单位重量(g) + */ + @Schema(description = "物料单位重量(g)") + @ExcelProperty(value = "物料单位重量(g)") + private Double unitWeight; + + /** + * 物料单次可称量最大重量(kg) + */ + @Schema(description = "物料单次可称量最大重量(kg)") + @ExcelProperty(value = "物料单次可称量最大重量(kg)") + private Double maxWeight; + + /** + * 物料照片地址 + */ + @Schema(description = "物料照片地址") + @ExcelIgnore + private String photoUrl; +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/service/MaterialInfoService.java b/wms-module-system/src/main/java/top/wms/admin/material/service/MaterialInfoService.java new file mode 100644 index 0000000..bd879ab --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/service/MaterialInfoService.java @@ -0,0 +1,16 @@ +package top.wms.admin.material.service; + +import top.continew.starter.extension.crud.service.BaseService; +import top.wms.admin.material.model.query.MaterialInfoQuery; +import top.wms.admin.material.model.req.MaterialInfoReq; +import top.wms.admin.material.model.resp.MaterialInfoResp; + +/** + * 物料信息业务接口 + * + * @author lz + * @since 2026/02/27 14:19 + */ +public interface MaterialInfoService extends BaseService { + +} diff --git a/wms-module-system/src/main/java/top/wms/admin/material/service/impl/MaterialInfoServiceImpl.java b/wms-module-system/src/main/java/top/wms/admin/material/service/impl/MaterialInfoServiceImpl.java new file mode 100644 index 0000000..e24ae18 --- /dev/null +++ b/wms-module-system/src/main/java/top/wms/admin/material/service/impl/MaterialInfoServiceImpl.java @@ -0,0 +1,25 @@ +package top.wms.admin.material.service.impl; + +import lombok.RequiredArgsConstructor; + +import org.springframework.stereotype.Service; + +import top.continew.starter.extension.crud.service.BaseServiceImpl; +import top.wms.admin.material.mapper.MaterialInfoMapper; +import top.wms.admin.material.model.entity.MaterialInfoDO; +import top.wms.admin.material.model.query.MaterialInfoQuery; +import top.wms.admin.material.model.req.MaterialInfoReq; +import top.wms.admin.material.model.resp.MaterialInfoResp; +import top.wms.admin.material.service.MaterialInfoService; + +/** + * 物料信息业务实现 + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Service +@RequiredArgsConstructor +public class MaterialInfoServiceImpl extends BaseServiceImpl implements MaterialInfoService { + +} diff --git a/wms-module-system/src/main/java/top/wms/admin/system/model/entity/UserDO.java b/wms-module-system/src/main/java/top/wms/admin/system/model/entity/UserDO.java index 9f034e9..92ea78b 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/model/entity/UserDO.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/model/entity/UserDO.java @@ -32,17 +32,18 @@ public class UserDO extends BaseDO { */ private String username; - /** - * 昵称 - */ - private String nickname; - /** * 密码 */ // @FieldEncrypt(encryptor = BCryptEncryptor.class) private String password; + + /* + * 卡号 + * */ + private String cardNo; + /** * 性别 */ @@ -87,11 +88,6 @@ public class UserDO extends BaseDO { */ private LocalDateTime pwdResetTime; - /** - * 部门 ID - */ - private Long deptId; - /** * 设备ID */ diff --git a/wms-module-system/src/main/java/top/wms/admin/system/model/query/UserQuery.java b/wms-module-system/src/main/java/top/wms/admin/system/model/query/UserQuery.java index 1087715..65eb18d 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/model/query/UserQuery.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/model/query/UserQuery.java @@ -69,4 +69,7 @@ public class UserQuery implements Serializable { */ @Schema(description = "设备ID") private Long equipmentId; + + @Schema(description = "卡号") + private String cardNo; } diff --git a/wms-module-system/src/main/java/top/wms/admin/system/model/req/user/UserReq.java b/wms-module-system/src/main/java/top/wms/admin/system/model/req/user/UserReq.java index aae5a4a..117da3c 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/model/req/user/UserReq.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/model/req/user/UserReq.java @@ -38,13 +38,6 @@ public class UserReq implements Serializable { @Pattern(regexp = RegexConstants.USERNAME, message = "用户名长度为 4-64 个字符,支持大小写字母、数字、下划线,以字母开头") private String username; - /** - * 昵称 - */ - @Schema(description = "昵称", example = "张三") - @NotBlank(message = "昵称不能为空") - @Pattern(regexp = RegexConstants.GENERAL_NAME, message = "昵称长度为 2-30 个字符,支持中文、字母、数字、下划线,短横线") - private String nickname; /** * 密码(加密) @@ -53,6 +46,12 @@ public class UserReq implements Serializable { @NotBlank(message = "密码不能为空", groups = CrudValidationGroup.Add.class) private String password; + /* + * 卡号 + * */ + @Schema(description = "卡号") + private String cardNo; + /** * 邮箱 */ @@ -75,13 +74,6 @@ public class UserReq implements Serializable { @NotNull(message = "性别非法") private GenderEnum gender; - /** - * 所属部门 - */ - @Schema(description = "所属部门", example = "5") - @NotNull(message = "所属部门不能为空") - private Long deptId; - /** * 所属角色 */ diff --git a/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserDetailResp.java b/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserDetailResp.java index 0b296f6..c7b3a55 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserDetailResp.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserDetailResp.java @@ -108,11 +108,15 @@ public class UserDetailResp extends BaseDetailResp { @FieldEncrypt private String phone; + @Schema(description = "卡号") + @ExcelProperty(value = "卡号", order = 11) + private String cardNo; + /** * 邮箱 */ @Schema(description = "邮箱", example = "123456789@qq.com") - @ExcelProperty(value = "邮箱", order = 11) + @ExcelProperty(value = "邮箱", order = 12) @FieldEncrypt private String email; @@ -120,21 +124,21 @@ public class UserDetailResp extends BaseDetailResp { * 是否为系统内置数据 */ @Schema(description = "系统内置", example = "false") - @ExcelProperty(value = "系统内置", order = 12) + @ExcelProperty(value = "系统内置", order = 13) private Boolean isSystem; /** * 描述 */ @Schema(description = "描述", example = "张三描述信息") - @ExcelProperty(value = "描述", order = 13) + @ExcelProperty(value = "描述", order = 14) private String description; /** * 头像地址 */ @Schema(description = "头像地址", example = "https://himg.bdimg.com/sys/portrait/item/public.1.81ac9a9e.rf1ix17UfughLQjNo7XQ_w.jpg") - @ExcelProperty(value = "头像地址", order = 14) + @ExcelProperty(value = "头像地址", order = 15) private String avatar; /** diff --git a/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserResp.java b/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserResp.java index 77eeac1..b4cca19 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserResp.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/model/resp/user/UserResp.java @@ -2,8 +2,11 @@ package top.wms.admin.system.model.resp.user; import cn.crane4j.annotation.Assemble; import cn.crane4j.core.executor.handler.ManyToManyAssembleOperationHandler; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; +import lombok.Value; import top.wms.admin.common.model.resp.BaseDetailResp; import top.wms.admin.common.constant.ContainerConstants; import top.wms.admin.common.context.UserContextHolder; @@ -34,12 +37,19 @@ public class UserResp extends BaseDetailResp { * 用户名 */ @Schema(description = "用户名", example = "zhangsan") + @ExcelProperty(value = "用户名") private String username; + + @Schema(description = "卡号") + @ExcelProperty(value = "卡号") + private String cardNo; + /** * 昵称 */ @Schema(description = "昵称", example = "张三") + @ExcelIgnore private String nickname; /** @@ -52,6 +62,7 @@ public class UserResp extends BaseDetailResp { * 头像地址 */ @Schema(description = "头像地址", example = "https://himg.bdimg.com/sys/portrait/item/public.1.81ac9a9e.rf1ix17UfughLQjNo7XQ_w.jpg") + @ExcelIgnore private String avatar; /** @@ -59,6 +70,7 @@ public class UserResp extends BaseDetailResp { */ @Schema(description = "邮箱", example = "c*******@126.com") @JsonMask(MaskType.EMAIL) + @ExcelIgnore private String email; /** @@ -78,6 +90,7 @@ public class UserResp extends BaseDetailResp { * 是否为系统内置数据 */ @Schema(description = "是否为系统内置数据", example = "false") + @ExcelIgnore private Boolean isSystem; /** @@ -90,12 +103,14 @@ public class UserResp extends BaseDetailResp { * 部门 ID */ @Schema(description = "部门 ID", example = "5") + @ExcelIgnore private Long deptId; /** * 所属部门 */ @Schema(description = "所属部门", example = "测试部") + @ExcelIgnore private String deptName; /** diff --git a/wms-module-system/src/main/java/top/wms/admin/system/service/impl/UserServiceImpl.java b/wms-module-system/src/main/java/top/wms/admin/system/service/impl/UserServiceImpl.java index fc1b23f..6fa9fff 100644 --- a/wms-module-system/src/main/java/top/wms/admin/system/service/impl/UserServiceImpl.java +++ b/wms-module-system/src/main/java/top/wms/admin/system/service/impl/UserServiceImpl.java @@ -736,4 +736,7 @@ public class UserServiceImpl extends BaseServiceImpl + + + diff --git a/wms-module-system/src/main/resources/mapper/UserMapper.xml b/wms-module-system/src/main/resources/mapper/UserMapper.xml index fb0c809..54b90f0 100644 --- a/wms-module-system/src/main/resources/mapper/UserMapper.xml +++ b/wms-module-system/src/main/resources/mapper/UserMapper.xml @@ -5,6 +5,7 @@ SELECT t1.id, + t1.card_no, t1.create_user, t1.create_time, t1.update_user, @@ -53,4 +54,4 @@ AND id != #{id} - \ No newline at end of file + diff --git a/wms-webapi/src/main/java/top/wms/admin/controller/meterial/MaterialInfoController.java b/wms-webapi/src/main/java/top/wms/admin/controller/meterial/MaterialInfoController.java new file mode 100644 index 0000000..7408eef --- /dev/null +++ b/wms-webapi/src/main/java/top/wms/admin/controller/meterial/MaterialInfoController.java @@ -0,0 +1,29 @@ +package top.wms.admin.controller.meterial; + +import top.continew.starter.extension.crud.enums.Api; + +import io.swagger.v3.oas.annotations.tags.Tag; + +import org.springframework.web.bind.annotation.*; + +import lombok.RequiredArgsConstructor; +import top.continew.starter.extension.crud.annotation.CrudRequestMapping; +import top.wms.admin.common.controller.BaseController; +import top.wms.admin.material.model.query.MaterialInfoQuery; +import top.wms.admin.material.model.req.MaterialInfoReq; +import top.wms.admin.material.model.resp.MaterialInfoResp; +import top.wms.admin.material.service.MaterialInfoService; + +/** + * 物料信息管理 API + * + * @author lz + * @since 2026/02/27 14:19 + */ +@Tag(name = "物料信息管理 API") +@RestController +@RequiredArgsConstructor +@CrudRequestMapping(value = "/admin/meterialInfo", api = {Api.PAGE, Api.DETAIL, Api.ADD, Api.UPDATE, Api.DELETE, Api.EXPORT}) +public class MaterialInfoController extends BaseController { + +}