diff --git a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java index a39ddc24..c4a83506 100644 --- a/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java +++ b/mes-module-heli/mes-module-heli-api/src/main/java/com/chanko/yunxi/mes/module/heli/enums/CodeEnum.java @@ -20,13 +20,17 @@ public enum CodeEnum { * 班组 Wt+四位流水号 * 客户 Cus+六位流水号 * 供应商 Sup+六位流水号 + * 工序 Prs+六位流水号 + * 仓库 St+四位流水号 * */ FACTORY("工厂", "Fa", 4), DEPT("部门", "De", 4), WORKSHOP("车间", "Ce", 4), CLASSES("班组", "Wt", 4), CUSTOMER("客户", "Cus", 6), - SUPPLIER("供应商", "Sup", 6) + SUPPLIER("供应商", "Sup", 6), + PROCEDURE("工序", "Prs", 6), + WAREHOUSE("仓库", "St", 4), ; diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java index b67cf39a..2f3048c1 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialPageReqVO.java @@ -1,10 +1,13 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; -import lombok.*; -import java.util.*; -import io.swagger.v3.oas.annotations.media.Schema; import com.chanko.yunxi.mes.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; import java.time.LocalDateTime; import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -27,33 +30,12 @@ public class MaterialPageReqVO extends PageParam { @Schema(description = "规格") private String spec; - @Schema(description = "物料分类 零件|半成品|模具 1 2 3", example = "2") - private String materialType; - - @Schema(description = "主要单位") - private String unit; - @Schema(description = "尺寸信息") private String sizeInfo; - @Schema(description = "材质id", example = "17489") - private Long compositionId; - - @Schema(description = "库存预警上限") - private Long invUpperLimit; - - @Schema(description = "库存预警下限") - private Long invLowerLimit; - @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") private Integer traceType; - @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") - private String virsualPart; - - @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") - private Integer mainFrom; - @Schema(description = "默认保存的仓库,对应仓库表中的Id") private Long dftStoreWh; @@ -66,9 +48,6 @@ public class MaterialPageReqVO extends PageParam { @Schema(description = "默认工艺路线,对应工艺路线表中的Id") private Long dftRoute; - @Schema(description = "默认包装方式,对应包装方式表中的Id") - private Long dftPack; - @Schema(description = "物料描述", example = "你说的对") private String description; @@ -79,4 +58,43 @@ public class MaterialPageReqVO extends PageParam { @Schema(description = "状态,1表示正常,2表示禁用", example = "1") private Integer status; -} \ No newline at end of file + @Schema(description = "物料简称", example = "赵六") + private String shortName; + + @Schema(description = "物料类型", example = "1") + private String materialType; + + @Schema(description = "材质id", example = "6704") + private Long compositionId; + + @Schema(description = "销项税率或进项税率 (%)") + private BigDecimal outputInputTaxRate; + + @Schema(description = "首选供应商", example = "15535") + private Long mainSupplierId; + + @Schema(description = "物料主要来源") + private Integer mainFrom; + + @Schema(description = "主要单位") + private String unit; + + @Schema(description = "安全库存") + private BigDecimal invSafe; + + @Schema(description = "库存预警上限") + private BigDecimal invUpperLimit; + + @Schema(description = "库存预警下限") + private BigDecimal invLowerLimit; + + @Schema(description = "物料条码") + private String barcode; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virtualPart; + + @Schema(description = "物料logo地址") + private String logo; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java index 98cbf8f5..5b0b4006 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialRespVO.java @@ -1,12 +1,14 @@ package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.chanko.yunxi.mes.framework.excel.core.annotations.DictFormat; +import com.chanko.yunxi.mes.framework.excel.core.convert.DictConvert; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.util.*; -import org.springframework.format.annotation.DateTimeFormat; +import lombok.Data; + +import java.math.BigDecimal; import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; @Schema(description = "管理后台 - 物料 Response VO") @Data @@ -33,42 +35,14 @@ public class MaterialRespVO { @ExcelProperty("规格") private String spec; - @Schema(description = "物料分类 零件|半成品|模具 1 2 3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @ExcelProperty("物料分类 零件|半成品|模具 1 2 3") - private String materialType; - - @Schema(description = "主要单位") - @ExcelProperty("主要单位") - private String unit; - @Schema(description = "尺寸信息") @ExcelProperty("尺寸信息") private String sizeInfo; - @Schema(description = "材质id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17489") - @ExcelProperty("材质id") - private Long compositionId; - - @Schema(description = "库存预警上限") - @ExcelProperty("库存预警上限") - private Long invUpperLimit; - - @Schema(description = "库存预警下限") - @ExcelProperty("库存预警下限") - private Long invLowerLimit; - @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") @ExcelProperty("管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理") private Integer traceType; - @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") - @ExcelProperty("虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") - private String virsualPart; - - @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") - @ExcelProperty("物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") - private Integer mainFrom; - @Schema(description = "默认保存的仓库,对应仓库表中的Id") @ExcelProperty("默认保存的仓库,对应仓库表中的Id") private Long dftStoreWh; @@ -85,10 +59,6 @@ public class MaterialRespVO { @ExcelProperty("默认工艺路线,对应工艺路线表中的Id") private Long dftRoute; - @Schema(description = "默认包装方式,对应包装方式表中的Id") - @ExcelProperty("默认包装方式,对应包装方式表中的Id") - private Long dftPack; - @Schema(description = "物料描述", example = "你说的对") @ExcelProperty("物料描述") private String description; @@ -98,7 +68,67 @@ public class MaterialRespVO { private LocalDateTime createTime; @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @ExcelProperty("状态,1表示正常,2表示禁用") + @ExcelProperty(value = "状态,1表示正常,2表示禁用", converter = DictConvert.class) + @DictFormat("heli_common_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 private Integer status; -} \ No newline at end of file + @Schema(description = "物料简称", example = "赵六") + @ExcelProperty("物料简称") + private String shortName; + + @Schema(description = "物料类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @ExcelProperty(value = "物料类型", converter = DictConvert.class) + @DictFormat("heli_material_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String materialType; + + @Schema(description = "材质id", example = "6704") + @ExcelProperty("材质id") + private Long compositionId; + + @Schema(description = "销项税率或进项税率 (%)") + @ExcelProperty("销项税率或进项税率 (%)") + private BigDecimal outputInputTaxRate; + + @Schema(description = "首选供应商", example = "15535") + @ExcelProperty("首选供应商") + private Long mainSupplierId; + + @Schema(description = "物料主要来源") + @ExcelProperty(value = "物料主要来源", converter = DictConvert.class) + @DictFormat("heli_material_original") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private Integer mainFrom; + + @Schema(description = "主要单位", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty(value = "主要单位", converter = DictConvert.class) + @DictFormat("heli_material_unit") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 + private String unit; + + @Schema(description = "安全库存") + @ExcelProperty("安全库存") + private BigDecimal invSafe; + + @Schema(description = "库存预警上限") + @ExcelProperty("库存预警上限") + private BigDecimal invUpperLimit; + + @Schema(description = "库存预警下限") + @ExcelProperty("库存预警下限") + private BigDecimal invLowerLimit; + + @Schema(description = "物料条码") + @ExcelProperty("物料条码") + private String barcode; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + @ExcelProperty("虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virtualPart; + + @Schema(description = "物料logo地址") + @ExcelProperty("物料logo地址") + private String logo; + + @Schema(description = "首选供应商名称", example = "15535") + @ExcelProperty("首选供应商名称") + private String mainSupplierName; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java index 959e8404..d140243e 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/material/vo/MaterialSaveReqVO.java @@ -1,81 +1,97 @@ -package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; -import java.util.*; - -@Schema(description = "管理后台 - 物料新增/修改 Request VO") -@Data -public class MaterialSaveReqVO { - - @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11225") - private Long id; - - @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "物料编码不能为空") - private String code; - - @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "物料名称不能为空") - private String name; - - @Schema(description = "品牌") - private String brand; - - @Schema(description = "规格") - private String spec; - - @Schema(description = "物料分类 零件|半成品|模具 1 2 3", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotEmpty(message = "物料分类 零件|半成品|模具 1 2 3不能为空") - private String materialType; - - @Schema(description = "主要单位") - private String unit; - - @Schema(description = "尺寸信息") - private String sizeInfo; - - @Schema(description = "材质id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17489") - @NotNull(message = "材质id不能为空") - private Long compositionId; - - @Schema(description = "库存预警上限") - private Long invUpperLimit; - - @Schema(description = "库存预警下限") - private Long invLowerLimit; - - @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") - private Integer traceType; - - @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") - private String virsualPart; - - @Schema(description = "物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工") - private Integer mainFrom; - - @Schema(description = "默认保存的仓库,对应仓库表中的Id") - private Long dftStoreWh; - - @Schema(description = "默认保存的库区,对应库区表中的Id") - private Long dftStoreRg; - - @Schema(description = "默认保存的库位,对应库位表中的Id") - private Long dftStorePn; - - @Schema(description = "默认工艺路线,对应工艺路线表中的Id") - private Long dftRoute; - - @Schema(description = "默认包装方式,对应包装方式表中的Id") - private Long dftPack; - - @Schema(description = "物料描述", example = "你说的对") - private String description; - - @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "状态,1表示正常,2表示禁用不能为空") - private Integer status; - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.controller.admin.material.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.math.BigDecimal; + +@Schema(description = "管理后台 - 物料新增/修改 Request VO") +@Data +public class MaterialSaveReqVO { + + @Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED, example = "11225") + private Long id; + + @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "物料编码不能为空") + private String code; + + @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") + @NotEmpty(message = "物料名称不能为空") + private String name; + + @Schema(description = "品牌") + private String brand; + + @Schema(description = "规格") + private String spec; + + @Schema(description = "尺寸信息") + private String sizeInfo; + + @Schema(description = "管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理", example = "2") + private Integer traceType; + + @Schema(description = "默认保存的仓库,对应仓库表中的Id") + private Long dftStoreWh; + + @Schema(description = "默认保存的库区,对应库区表中的Id") + private Long dftStoreRg; + + @Schema(description = "默认保存的库位,对应库位表中的Id") + private Long dftStorePn; + + @Schema(description = "默认工艺路线,对应工艺路线表中的Id") + private Long dftRoute; + + @Schema(description = "物料描述", example = "你说的对") + private String description; + + @Schema(description = "状态,1表示正常,2表示禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotNull(message = "状态,1表示正常,2表示禁用不能为空") + private Integer status; + + @Schema(description = "物料简称", example = "赵六") + private String shortName; + + @Schema(description = "物料类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "物料类型不能为空") + private String materialType; + + @Schema(description = "材质id", example = "6704") + private Long compositionId; + + @Schema(description = "销项税率或进项税率 (%)") + private BigDecimal outputInputTaxRate; + + @Schema(description = "首选供应商", example = "15535") + private Long mainSupplierId; + + @Schema(description = "物料主要来源") + private Integer mainFrom; + + @Schema(description = "主要单位", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "主要单位不能为空") + private String unit; + + @Schema(description = "安全库存") + private BigDecimal invSafe; + + @Schema(description = "库存预警上限") + private BigDecimal invUpperLimit; + + @Schema(description = "库存预警下限") + private BigDecimal invLowerLimit; + + @Schema(description = "物料条码") + private String barcode; + + @Schema(description = "虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之") + private String virtualPart; + + @Schema(description = "物料logo地址") + private String logo; + +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java index 9d6d902a..c664c67e 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/dataobject/material/MaterialDO.java @@ -4,6 +4,10 @@ import lombok.*; import java.util.*; import java.time.LocalDateTime; import java.time.LocalDateTime; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; +import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.*; import com.chanko.yunxi.mes.framework.mybatis.core.dataobject.BaseDO; @@ -44,68 +48,99 @@ public class MaterialDO extends BaseDO { */ private String spec; /** - * 物料分类 零件|半成品|模具 1 2 3 + * 尺寸信息 */ - private String materialType; + private String sizeInfo; /** - * 主要单位 + * 管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理 */ - private String unit; + private Integer traceType; /** - * 尺寸信息 + * 默认保存的仓库,对应仓库表中的Id */ - private String sizeInfo; + private Long dftStoreWh; /** - * 材质id + * 默认保存的库区,对应库区表中的Id */ - private Long compositionId; + private Long dftStoreRg; /** - * 库存预警上限 + * 默认保存的库位,对应库位表中的Id */ - private Long invUpperLimit; + private Long dftStorePn; /** - * 库存预警下限 + * 默认工艺路线,对应工艺路线表中的Id */ - private Long invLowerLimit; + private Long dftRoute; /** - * 管控方式,只有两种值,分别是1和2,1表示单个管理,2表示批次管理 + * 物料描述 */ - private Integer traceType; + private String description; /** - * 虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之 + * 状态,1表示正常,2表示禁用 + * + * 枚举 {@link TODO heli_common_status 对应的类} + */ + private Integer status; + /** + * 物料简称 */ - private String virsualPart; + private String shortName; /** - * 物料主要来源,只有三种值,分别是1,2,3,其中1表示自制,2表示外购,3表示委外加工 + * 物料类型 + * + * 枚举 {@link TODO heli_material_type 对应的类} + */ + private String materialType; + /** + * 材质id + */ + private Long compositionId; + /** + * 销项税率或进项税率 (%) + */ + private BigDecimal outputInputTaxRate; + /** + * 首选供应商 + */ + private Long mainSupplierId; + /** + * 物料主要来源 + * + * 枚举 {@link TODO heli_material_original 对应的类} */ private Integer mainFrom; /** - * 默认保存的仓库,对应仓库表中的Id + * 主要单位 + * + * 枚举 {@link TODO heli_material_unit 对应的类} */ - private Long dftStoreWh; + private String unit; /** - * 默认保存的库区,对应库区表中的Id + * 安全库存 */ - private Long dftStoreRg; + private BigDecimal invSafe; /** - * 默认保存的库位,对应库位表中的Id + * 库存预警上限 */ - private Long dftStorePn; + private BigDecimal invUpperLimit; /** - * 默认工艺路线,对应工艺路线表中的Id + * 库存预警下限 */ - private Long dftRoute; + private BigDecimal invLowerLimit; /** - * 默认包装方式,对应包装方式表中的Id + * 物料条码 */ - private Long dftPack; + private String barcode; /** - * 物料描述 + * 虚拟物料标识,只能填写Y和N,Y表示虚拟物料,N表示反之 */ - private String description; + private String virtualPart; /** - * 状态,1表示正常,2表示禁用 + * 物料logo地址 */ - private Integer status; + private String logo; + + @TableField(exist = false) + private String mainSupplierName; -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/classes/ClassesMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/classes/ClassesMapper.java index 7440d760..5d3410bc 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/classes/ClassesMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/classes/ClassesMapper.java @@ -23,7 +23,9 @@ public interface ClassesMapper extends BaseMapperX { query.selectAll(ClassesDO.class) .select("u.nickname as leaderUserName", "w.name as workshopName") .leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, ClassesDO::getLeaderUserId) - .leftJoin(WorkshopDO.class, "w", WorkshopDO::getId, ClassesDO::getWorkshopId); + .leftJoin(WorkshopDO.class, "w", WorkshopDO::getId, ClassesDO::getWorkshopId) + .disableSubLogicDel() + .orderByDesc(ClassesDO::getId); query.like(!StringUtils.isEmpty(reqVO.getCode()), ClassesDO::getCode, reqVO.getCode()) .like(!StringUtils.isEmpty(reqVO.getName()), ClassesDO::getName, reqVO.getName()) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java index a6750bc5..e465763f 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/material/MaterialMapper.java @@ -1,13 +1,13 @@ package com.chanko.yunxi.mes.module.heli.dal.mysql.material; -import java.util.*; - import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX; import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialPageReqVO; import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.supplier.SupplierDO; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; -import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; +import org.springframework.util.StringUtils; /** * 物料 Mapper @@ -18,29 +18,18 @@ import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; public interface MaterialMapper extends BaseMapperX { default PageResult selectPage(MaterialPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MaterialDO::getCode, reqVO.getCode()) - .likeIfPresent(MaterialDO::getName, reqVO.getName()) - .eqIfPresent(MaterialDO::getBrand, reqVO.getBrand()) - .eqIfPresent(MaterialDO::getSpec, reqVO.getSpec()) - .eqIfPresent(MaterialDO::getMaterialType, reqVO.getMaterialType()) - .eqIfPresent(MaterialDO::getUnit, reqVO.getUnit()) - .eqIfPresent(MaterialDO::getSizeInfo, reqVO.getSizeInfo()) - .eqIfPresent(MaterialDO::getCompositionId, reqVO.getCompositionId()) - .eqIfPresent(MaterialDO::getInvUpperLimit, reqVO.getInvUpperLimit()) - .eqIfPresent(MaterialDO::getInvLowerLimit, reqVO.getInvLowerLimit()) - .eqIfPresent(MaterialDO::getTraceType, reqVO.getTraceType()) - .eqIfPresent(MaterialDO::getVirsualPart, reqVO.getVirsualPart()) - .eqIfPresent(MaterialDO::getMainFrom, reqVO.getMainFrom()) - .eqIfPresent(MaterialDO::getDftStoreWh, reqVO.getDftStoreWh()) - .eqIfPresent(MaterialDO::getDftStoreRg, reqVO.getDftStoreRg()) - .eqIfPresent(MaterialDO::getDftStorePn, reqVO.getDftStorePn()) - .eqIfPresent(MaterialDO::getDftRoute, reqVO.getDftRoute()) - .eqIfPresent(MaterialDO::getDftPack, reqVO.getDftPack()) - .eqIfPresent(MaterialDO::getDescription, reqVO.getDescription()) - .betweenIfPresent(MaterialDO::getCreateTime, reqVO.getCreateTime()) - .eqIfPresent(MaterialDO::getStatus, reqVO.getStatus()) - .orderByDesc(MaterialDO::getId)); + MPJLambdaWrapper query = new MPJLambdaWrapper<>(); + query.selectAll(MaterialDO.class) + .select("s.name as mainSupplierName") + .leftJoin(SupplierDO.class, "s", SupplierDO::getId, MaterialDO::getMainSupplierId) + .disableSubLogicDel() + .orderByDesc(MaterialDO::getId); + query.like(!StringUtils.isEmpty(reqVO.getName()), MaterialDO::getName, reqVO.getName()) + .like(!StringUtils.isEmpty(reqVO.getCode()), MaterialDO::getCode, reqVO.getCode()) + .eq(!StringUtils.isEmpty(reqVO.getMaterialType()), MaterialDO::getMaterialType, reqVO.getMaterialType()) + .eq(reqVO.getStatus() != null, MaterialDO::getStatus, reqVO.getStatus()); + + return selectPage(reqVO, query); } -} \ No newline at end of file +} diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/workshop/WorkshopMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/workshop/WorkshopMapper.java index 96c08493..f8ca1ed8 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/workshop/WorkshopMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/workshop/WorkshopMapper.java @@ -23,7 +23,9 @@ public interface WorkshopMapper extends BaseMapperX { query.selectAll(WorkshopDO.class) .select("u.nickname as leaderUserName", "d.name as deptName") .leftJoin(AdminUserDO.class, "u", AdminUserDO::getId, WorkshopDO::getLeaderUserId) - .leftJoin(DeptDO.class, "d", DeptDO::getId, WorkshopDO::getDeptId); + .leftJoin(DeptDO.class, "d", DeptDO::getId, WorkshopDO::getDeptId) + .disableSubLogicDel() + .orderByDesc(WorkshopDO::getId); query.like(!StringUtils.isEmpty(reqVO.getCode()), WorkshopDO::getCode, reqVO.getCode()) .like(!StringUtils.isEmpty(reqVO.getName()), WorkshopDO::getName, reqVO.getName()) diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java index f2337082..207fcf4c 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/service/material/MaterialServiceImpl.java @@ -1,74 +1,71 @@ -package com.chanko.yunxi.mes.module.heli.service.material; - -import org.springframework.stereotype.Service; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.*; -import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; -import com.chanko.yunxi.mes.framework.common.pojo.PageResult; -import com.chanko.yunxi.mes.framework.common.pojo.PageParam; -import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; - -import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; - -import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*; - -/** - * 物料 Service 实现类 - * - * @author 开发者 - */ -@Service -@Validated -public class MaterialServiceImpl implements MaterialService { - - @Resource - private MaterialMapper materialMapper; - - @Override - public Long createMaterial(MaterialSaveReqVO createReqVO) { - // 插入 - MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); - materialMapper.insert(material); - // 返回 - return material.getId(); - } - - @Override - public void updateMaterial(MaterialSaveReqVO updateReqVO) { - // 校验存在 - validateMaterialExists(updateReqVO.getId()); - // 更新 - MaterialDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDO.class); - materialMapper.updateById(updateObj); - } - - @Override - public void deleteMaterial(Long id) { - // 校验存在 - validateMaterialExists(id); - // 删除 - materialMapper.deleteById(id); - } - - private void validateMaterialExists(Long id) { - if (materialMapper.selectById(id) == null) { - throw exception(MATERIAL_NOT_EXISTS); - } - } - - @Override - public MaterialDO getMaterial(Long id) { - return materialMapper.selectById(id); - } - - @Override - public PageResult getMaterialPage(MaterialPageReqVO pageReqVO) { - return materialMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file +package com.chanko.yunxi.mes.module.heli.service.material; + +import com.chanko.yunxi.mes.framework.common.pojo.PageResult; +import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialPageReqVO; +import com.chanko.yunxi.mes.module.heli.controller.admin.material.vo.MaterialSaveReqVO; +import com.chanko.yunxi.mes.module.heli.dal.dataobject.material.MaterialDO; +import com.chanko.yunxi.mes.module.heli.dal.mysql.material.MaterialMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception; +import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.MATERIAL_NOT_EXISTS; + +/** + * 物料 Service 实现类 + * + * @author 开发者 + */ +@Service +@Validated +public class MaterialServiceImpl implements MaterialService { + + @Resource + private MaterialMapper materialMapper; + + @Override + public Long createMaterial(MaterialSaveReqVO createReqVO) { + // 插入 + MaterialDO material = BeanUtils.toBean(createReqVO, MaterialDO.class); + materialMapper.insert(material); + // 返回 + return material.getId(); + } + + @Override + public void updateMaterial(MaterialSaveReqVO updateReqVO) { + // 校验存在 + validateMaterialExists(updateReqVO.getId()); + // 更新 + MaterialDO updateObj = BeanUtils.toBean(updateReqVO, MaterialDO.class); + materialMapper.updateById(updateObj); + } + + @Override + public void deleteMaterial(Long id) { + // 校验存在 + validateMaterialExists(id); + // 删除 + materialMapper.deleteById(id); + } + + private void validateMaterialExists(Long id) { + if (materialMapper.selectById(id) == null) { + throw exception(MATERIAL_NOT_EXISTS); + } + } + + @Override + public MaterialDO getMaterial(Long id) { + return materialMapper.selectById(id); + } + + @Override + public PageResult getMaterialPage(MaterialPageReqVO pageReqVO) { + return materialMapper.selectPage(pageReqVO); + } + +} diff --git a/mes-server/src/main/resources/application-local.yaml b/mes-server/src/main/resources/application-local.yaml index 95523470..fe011c1b 100644 --- a/mes-server/src/main/resources/application-local.yaml +++ b/mes-server/src/main/resources/application-local.yaml @@ -153,6 +153,8 @@ spring: logging: file: name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 + level: + com.chanko.yunxi.mes.module.heli: debug --- #################### 微信公众号相关配置 #################### wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 diff --git a/mes-server/src/main/resources/logback-spring.xml b/mes-server/src/main/resources/logback-spring.xml index 71295c0f..a3bc2e57 100644 --- a/mes-server/src/main/resources/logback-spring.xml +++ b/mes-server/src/main/resources/logback-spring.xml @@ -60,8 +60,8 @@ - - + + diff --git a/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts b/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts index aa032e7f..5e26667b 100644 --- a/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts +++ b/mes-ui/mes-ui-admin-vue3/src/api/heli/material/index.ts @@ -1,55 +1,60 @@ -import request from '@/config/axios' - -export interface MaterialVO { - id: number - code: string - name: string - brand: string - spec: string - materialType: string - unit: string - sizeInfo: string - compositionId: number - invUpperLimit: number - invLowerLimit: number - traceType: number - virsualPart: string - mainFrom: number - dftStoreWh: number - dftStoreRg: number - dftStorePn: number - dftRoute: number - dftPack: number - description: string - status: number -} - -// 查询物料分页 -export const getMaterialPage = async (params) => { - return await request.get({ url: `/heli/material/page`, params }) -} - -// 查询物料详情 -export const getMaterial = async (id: number) => { - return await request.get({ url: `/heli/material/get?id=` + id }) -} - -// 新增物料 -export const createMaterial = async (data: MaterialVO) => { - return await request.post({ url: `/heli/material/create`, data }) -} - -// 修改物料 -export const updateMaterial = async (data: MaterialVO) => { - return await request.put({ url: `/heli/material/update`, data }) -} - -// 删除物料 -export const deleteMaterial = async (id: number) => { - return await request.delete({ url: `/heli/material/delete?id=` + id }) -} - -// 导出物料 Excel -export const exportMaterial = async (params) => { - return await request.download({ url: `/heli/material/export-excel`, params }) -} \ No newline at end of file +import request from '@/config/axios' + +export interface MaterialVO { + id: number + code: string + name: string + brand: string + spec: string + sizeInfo: string + traceType: number + dftStoreWh: number + dftStoreRg: number + dftStorePn: number + dftRoute: number + description: string + status: number + shortName: string + materialType: string + compositionId: number + outputInputTaxRate: number + mainSupplierId: number + mainFrom: number + unit: string + invSafe: number + invUpperLimit: number + invLowerLimit: number + barcode: string + virtualPart: string + logo: string +} + +// 查询物料分页 +export const getMaterialPage = async (params) => { + return await request.get({ url: `/heli/material/page`, params }) +} + +// 查询物料详情 +export const getMaterial = async (id: number) => { + return await request.get({ url: `/heli/material/get?id=` + id }) +} + +// 新增物料 +export const createMaterial = async (data: MaterialVO) => { + return await request.post({ url: `/heli/material/create`, data }) +} + +// 修改物料 +export const updateMaterial = async (data: MaterialVO) => { + return await request.put({ url: `/heli/material/update`, data }) +} + +// 删除物料 +export const deleteMaterial = async (id: number) => { + return await request.delete({ url: `/heli/material/delete?id=` + id }) +} + +// 导出物料 Excel +export const exportMaterial = async (params) => { + return await request.download({ url: `/heli/material/export-excel`, params }) +} diff --git a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts index 62b62054..0c94aa64 100644 --- a/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts +++ b/mes-ui/mes-ui-admin-vue3/src/utils/dict.ts @@ -212,5 +212,9 @@ export enum DICT_TYPE { HELI_COMPOSITION_ORIGINAL = 'heli_composition_original', // 材质主要来源 HELI_SUPPLIER_LEVEL = 'heli_supplier_level', //供应商级别 HELI_SUPPLIER_CATEGORY = 'heli_supplier_category', //供应商分类 + HELI_MATERIAL_TYPE = 'heli_material_type', // 物料类型 + HELI_MATERIAL_UNIT = 'heli_material_unit', // 物料单位 + HELI_MATERIAL_ORIGINAL = 'heli_material_original', // 物料主要来源 + } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue index d3f888c9..b590c1f1 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/MaterialForm.vue @@ -4,75 +4,100 @@ ref="formRef" :model="formData" :rules="formRules" - label-width="100px" + label-width="150px" v-loading="formLoading" > + + + - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + - - + + - - + + - - - - - + + - - + + + + - - + + + + - - + + + + - - + + - + - 请选择字典生成 + + {{ dict.label }} + + + + + + + \ No newline at end of file + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue index db8379ea..c443a47f 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/material/index.vue @@ -26,171 +26,34 @@ class="!w-240px" /> - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + @@ -204,7 +67,7 @@ > 新增 - 导出 - + --> @@ -220,35 +83,34 @@ - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + @@ -283,6 +145,7 @@ \ No newline at end of file + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/role/RoleAssignMenuForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/role/RoleAssignMenuForm.vue index 9304532c..06bd0501 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/role/RoleAssignMenuForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/role/RoleAssignMenuForm.vue @@ -1,6 +1,6 @@