【同步】BOOT 和 CLOUD 的功能(mes)

pull/248/head
YunaiV 2026-04-18 10:04:51 +08:00
parent b794031b71
commit 11ff5b4a7c
328 changed files with 4614 additions and 1020 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -9,6 +9,7 @@ import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Date;
@ -52,6 +53,10 @@ public class RandomUtils {
}
return RandomUtil.randomInt();
});
// BigDecimal限制精度在 DECIMAL(10,2) 范围内,避免 H2 等数据库溢出
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(BigDecimal.class,
(dataProviderStrategy, attributeMetadata, map) ->
BigDecimal.valueOf(RandomUtil.randomInt(0, 10000000), 2));
// LocalDateTime
PODAM_FACTORY.getStrategy().addOrReplaceTypeManufacturer(LocalDateTime.class,
(dataProviderStrategy, attributeMetadata, map) -> randomLocalDateTime());

View File

@ -7,32 +7,81 @@ package cn.iocoder.yudao.module.mes.enums;
*/
public interface DictTypeConstants {
// ========== 基础数据 (MD) ==========
String MES_MD_ITEM_OR_PRODUCT = "mes_md_item_or_product"; // MES 物料产品标识
String MES_MD_AUTO_CODE_PART_TYPE = "mes_md_auto_code_part_type"; // MES 分段类型
String MES_MD_AUTO_CODE_CYCLE_METHOD = "mes_md_auto_code_cycle_method"; // MES 循环方式
String MES_MD_AUTO_CODE_PADDED_METHOD = "mes_md_auto_code_padded_method"; // MES 补齐方式
String MES_CLIENT_TYPE = "mes_client_type"; // MES 客户类型
String MES_VENDOR_LEVEL = "mes_vendor_level"; // MES 供应商级别
String MES_CAL_HOLIDAY_TYPE = "mes_cal_holiday_type"; // MES 假期类型
String MES_TM_TOOL_STATUS = "mes_tm_tool_status"; // MES 工具状态
String MES_TM_MAINTEN_TYPE = "mes_tm_mainten_type"; // MES 保养维护类型
String MES_CAL_SHIFT_TYPE = "mes_cal_shift_type"; // MES 轮班方式
String MES_CAL_SHIFT_METHOD = "mes_cal_shift_method"; // MES 倒班方式
String MES_CAL_CALENDAR_TYPE = "mes_cal_calendar_type"; // MES 班组类型
String MES_CAL_PLAN_STATUS = "mes_cal_plan_status"; // MES 排班计划状态
String MES_DV_MACHINERY_STATUS = "mes_dv_machinery_status"; // MES 设备状态
String MES_DV_SUBJECT_TYPE = "mes_dv_subject_type"; // MES 点检保养项目类型
// ========== 生产计划与执行 (PRO) ==========
String MES_PRO_WORK_ORDER_STATUS = "mes_pro_work_order_status"; // MES 生产工单状态
String MES_PRO_WORK_ORDER_SOURCE_TYPE = "mes_pro_work_order_source_type"; // MES 工单来源类型
String MES_PRO_WORK_ORDER_TYPE = "mes_pro_work_order_type"; // MES 工单类型
String MES_PRO_LINK_TYPE = "mes_pro_link_type"; // MES 工序关系类型
String MES_TIME_UNIT_TYPE = "mes_time_unit_type"; // MES 时间单位
String MES_PRO_ANDON_STATUS = "mes_pro_andon_status"; // MES 安灯处置状态
String MES_PRO_ANDON_LEVEL = "mes_pro_andon_level"; // MES 安灯级别
String MES_PRO_WORK_RECORD_TYPE = "mes_pro_work_record_type"; // MES 上下工状态类型
String MES_PRO_FEEDBACK_STATUS = "mes_pro_feedback_status"; // MES 生产报工状态
String MES_PRO_FEEDBACK_TYPE = "mes_pro_feedback_type"; // MES 生产报工类型
String MES_PRO_FEEDBACK_CHANNEL = "mes_pro_feedback_channel"; // MES 生产报工途径
String MES_PRO_TASK_STATUS = "mes_pro_task_status"; // MES 任务状态
// ========== 仓储条码与管理 (WM) ==========
String MES_BARCODE_FORMAT = "mes_barcode_format"; // MES 条码格式
String MES_BARCODE_BIZ_TYPE = "mes_barcode_biz_type"; // MES 条码业务类型
String MES_WM_TRANSACTION_TYPE = "mes_wm_transaction_type"; // MES 库存事务类型
String MES_WM_QUALITY_STATUS = "mes_wm_quality_status"; // MES 质量状态(待检/合格/不合格)
// ========== 仓储入库 (WM Receipt) ==========
String MES_WM_ARRIVAL_NOTICE_STATUS = "mes_wm_arrival_notice_status"; // MES 到货通知单状态
String MES_WM_ITEM_RECEIPT_STATUS = "mes_wm_item_receipt_status"; // MES 采购入库单状态
String MES_WM_PRODUCT_PRODUCE_STATUS = "mes_wm_product_produce_status"; // MES 生产入库单状态
String MES_WM_MISC_RECEIPT_TYPE = "mes_wm_misc_receipt_type"; // MES 杂项入库类型
String MES_WM_MISC_RECEIPT_STATUS = "mes_wm_misc_receipt_status"; // MES 杂项入库状态
String MES_WM_OUTSOURCE_RECEIPT_STATUS = "mes_wm_outsource_receipt_status"; // MES 委外入库状态
String MES_WM_PRODUCT_RECEIPT_STATUS = "mes_wm_product_receipt_status"; // MES 产品入库状态
String MES_WM_RETURN_ISSUE_TYPE = "mes_wm_return_issue_type"; // MES 生产退料类型
String MES_WM_RETURN_ISSUE_STATUS = "mes_wm_return_issue_status"; // MES 生产退料单状态
String MES_WM_RETURN_SALES_STATUS = "mes_wm_return_sales_status"; // MES 销售退货状态
// ========== 仓储出库 (WM Issue) ==========
String MES_WM_MISC_ISSUE_TYPE = "mes_wm_misc_issue_type"; // MES 杂项出库类型
String MES_WM_MISC_ISSUE_STATUS = "mes_wm_misc_issue_status"; // MES 杂项出库单状态
String MES_WM_SALES_NOTICE_STATUS = "mes_wm_sales_notice_status"; // MES 发货通知单状态
String MES_WM_PRODUCT_SALES_STATUS = "mes_wm_product_sales_status"; // MES 销售出库单状态
String MES_WM_OUTSOURCE_ISSUE_STATUS = "mes_wm_outsource_issue_status"; // MES 委外出库状态
String MES_WM_PRODUCT_ISSUE_STATUS = "mes_wm_product_issue_status"; // MES 生产领料状态
String MES_WM_RETURN_VENDOR_STATUS = "mes_wm_return_vendor_status"; // MES 供应商退货单状态
// ========== 仓储移库与盘点 (WM Transfer) ==========
String MES_WM_TRANSFER_STATUS = "mes_wm_transfer_status"; // MES 转移单状态
String MES_WM_TRANSFER_TYPE = "mes_wm_transfer_type"; // MES 转移单类型
String MES_WM_STOCK_TAKING_PLAN_PARAM_TYPE = "mes_wm_stock_taking_plan_param_type"; // MES 盘点参数值类型
String MES_WM_STOCK_TAKING_TYPE = "mes_wm_stock_taking_type"; // MES 盘点类型
String MES_WM_STOCK_TAKING_TASK_STATUS = "mes_wm_stock_taking_task_status"; // MES 盘点任务状态
String MES_WM_STOCK_TAKING_TASK_LINE_STATUS = "mes_wm_stock_taking_task_line_status"; // MES 盘点任务明细状态
// ========== 其它仓储 (WM Misc) ==========
String MES_WM_PACKAGE_STATUS = "mes_wm_package_status"; // MES 打包状态
String MES_WM_ITEM_CONSUME_STATUS = "mes_wm_item_consume_status"; // MES 物料消耗状态
// ========== 质量管理 (QC) ==========
String MES_INDICATOR_TYPE = "mes_indicator_type"; // MES 检测项类型
String MES_QC_RESULT_TYPE = "mes_qc_result_type"; // MES 质检结果值类型
String MES_DEFECT_TYPE = "mes_defect_type"; // MES 缺陷检测项类型
String MES_DEFECT_LEVEL = "mes_defect_level"; // MES 缺陷等级
String MES_PRO_WORK_ORDER_STATUS = "mes_pro_work_order_status"; // MES 生产工单状态
String MES_PRO_WORK_ORDER_SOURCE_TYPE = "mes_pro_work_order_source_type"; // MES 工单来源类型
String MES_PRO_WORK_ORDER_TYPE = "mes_pro_work_order_type"; // MES 工单类型
String MES_QC_TYPE = "mes_qc_type"; // MES 检测种类IQC/IPQC/OQC/RQC
String MES_PRO_LINK_TYPE = "mes_pro_link_type"; // MES 工序关系类型
String MES_TIME_UNIT_TYPE = "mes_time_unit_type"; // MES 时间单位
String MES_IPQC_TYPE = "mes_ipqc_type"; // MES IPQC 检验类型
String MES_ORDER_STATUS = "mes_order_status"; // MES 单据状态IQC/IPQC/OQC/RQC 通用)
String MES_QC_CHECK_RESULT = "mes_qc_check_result"; // MES 检测结果
String MES_QC_SOURCE_DOC_TYPE = "mes_qc_source_doc_type"; // MES 来源单据类型
// ========== 设备管理 (DV) ==========
String MES_DV_MACHINERY_STATUS = "mes_dv_machinery_status"; // MES 设备状态
String MES_DV_SUBJECT_TYPE = "mes_dv_subject_type"; // MES 点检保养项目类型
String MES_DV_CYCLE_TYPE = "mes_dv_cycle_type"; // MES 点检保养周期类型
String MES_DV_CHECK_PLAN_STATUS = "mes_dv_check_plan_status"; // MES 点检保养方案状态
String MES_MAINTEN_RECORD_STATUS = "mes_mainten_record_status"; // MES 保养记录状态
@ -41,23 +90,15 @@ public interface DictTypeConstants {
String MES_DV_CHECK_RESULT = "mes_dv_check_result"; // MES 点检结果
String MES_DV_REPAIR_STATUS = "mes_dv_repair_status"; // MES 维修工单状态
String MES_DV_REPAIR_RESULT = "mes_dv_repair_result"; // MES 维修结果
String MES_PRO_ANDON_STATUS = "mes_pro_andon_status"; // MES 安灯处置状态
String MES_PRO_ANDON_LEVEL = "mes_pro_andon_level"; // MES 安灯级别
String MES_PRO_WORK_RECORD_TYPE = "mes_pro_work_record_type"; // MES 上下工状态类型
String MES_PRO_FEEDBACK_STATUS = "mes_pro_feedback_status"; // MES 生产报工状态
String MES_PRO_FEEDBACK_TYPE = "mes_pro_feedback_type"; // MES 生产报工类型
String MES_PRO_FEEDBACK_CHANNEL = "mes_pro_feedback_channel"; // MES 生产报工途径
String MES_WM_ARRIVAL_NOTICE_STATUS = "mes_wm_arrival_notice_status"; // MES 到货通知单状态
String MES_WM_ITEM_RECEIPT_STATUS = "mes_wm_item_receipt_status"; // MES 采购入库单状态
String MES_WM_PRODUCT_PRODUCE_STATUS = "mes_wm_product_produce_status"; // MES 生产入库单状态
String MES_WM_RETURN_VENDOR_STATUS = "mes_wm_return_vendor_status"; // MES 供应商退货单状态
String MES_WM_QUALITY_STATUS = "mes_wm_quality_status"; // MES 质量状态(待检/合格/不合格)
String MES_WM_RETURN_ISSUE_STATUS = "mes_wm_return_issue_status"; // MES 生产退料单状态
String MES_WM_RETURN_ISSUE_TYPE = "mes_wm_return_issue_type"; // MES 生产退料类型
String MES_WM_MISC_ISSUE_TYPE = "mes_wm_misc_issue_type"; // MES 杂项出库类型
String MES_WM_MISC_ISSUE_STATUS = "mes_wm_misc_issue_status"; // MES 杂项出库单状态
String MES_WM_SALES_NOTICE_STATUS = "mes_wm_sales_notice_status"; // MES 发货通知单状态
String MES_WM_TRANSFER_STATUS = "mes_wm_transfer_status"; // MES 转移单状态
String MES_WM_TRANSFER_TYPE = "mes_wm_transfer_type"; // MES 转移单类型
// ========== 排班日历 (CAL) ==========
String MES_CAL_HOLIDAY_TYPE = "mes_cal_holiday_type"; // MES 假期类型
String MES_CAL_SHIFT_TYPE = "mes_cal_shift_type"; // MES 轮班方式
String MES_CAL_SHIFT_METHOD = "mes_cal_shift_method"; // MES 倒班方式
String MES_CAL_CALENDAR_TYPE = "mes_cal_calendar_type"; // MES 班组类型
String MES_CAL_PLAN_STATUS = "mes_cal_plan_status"; // MES 排班计划状态
// ========== 工具管理 (TM) ==========
String MES_TM_TOOL_STATUS = "mes_tm_tool_status"; // MES 工具状态
String MES_TM_MAINTEN_TYPE = "mes_tm_mainten_type"; // MES 保养维护类型
}

View File

@ -18,11 +18,16 @@ public interface ErrorCodeConstants {
ErrorCode MD_ITEM_TYPE_CODE_DUPLICATE = new ErrorCode(1_040_100_005, "同一父分类下已存在该编码的分类");
ErrorCode MD_ITEM_TYPE_PARENT_IS_CHILD = new ErrorCode(1_040_100_006, "不能设置自己的子分类为父分类");
ErrorCode MD_ITEM_TYPE_EXITS_ITEM = new ErrorCode(1_040_100_007, "该分类下存在物料,无法删除");
ErrorCode MD_ITEM_TYPE_NOT_LEAF = new ErrorCode(1_040_100_008, "只能将物料挂载到叶子分类(该分类下存在子分类)");
// ========== MES 基础数据-计量单位1-040-101-000 ==========
ErrorCode MD_UNIT_MEASURE_NOT_EXISTS = new ErrorCode(1_040_101_000, "计量单位不存在");
ErrorCode MD_UNIT_MEASURE_CODE_DUPLICATE = new ErrorCode(1_040_101_001, "计量单位编码已存在");
ErrorCode MD_UNIT_MEASURE_HAS_ITEM = new ErrorCode(1_040_101_002, "该计量单位下存在物料,无法删除");
ErrorCode MD_UNIT_MEASURE_HAS_SECONDARY = new ErrorCode(1_040_101_003, "该主单位下存在辅单位,无法删除");
ErrorCode MD_UNIT_MEASURE_HAS_TASK_ISSUE = new ErrorCode(1_040_101_004, "该计量单位已被生产投料引用,无法删除");
ErrorCode MD_UNIT_MEASURE_HAS_QC_TEMPLATE_INDICATOR = new ErrorCode(1_040_101_005, "该计量单位已被质检方案指标项引用,无法删除");
ErrorCode MD_UNIT_MEASURE_HAS_QC_LINE = new ErrorCode(1_040_101_006, "该计量单位已被质检单据行引用,无法删除");
// ========== MES 基础数据-物料1-040-102-000 ==========
ErrorCode MD_ITEM_NOT_EXISTS = new ErrorCode(1_040_102_000, "物料不存在");
@ -30,6 +35,7 @@ public interface ErrorCodeConstants {
ErrorCode MD_ITEM_NAME_DUPLICATE = new ErrorCode(1_040_102_002, "物料名称已存在");
ErrorCode MD_ITEM_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_040_102_003, "导入物料数据不能为空");
ErrorCode MD_ITEM_BATCH_REQUIRED = new ErrorCode(1_040_102_004, "当前物料启用了批次管理,请选择批次");
ErrorCode MD_ITEM_IS_DISABLE = new ErrorCode(1_040_102_005, "物料已禁用");
// ========== MES 基础数据-物料批次属性配置1-040-102-100 ==========
ErrorCode MD_ITEM_BATCH_CONFIG_NOT_EXISTS = new ErrorCode(1_040_102_100, "物料批次属性配置不存在");
@ -51,6 +57,10 @@ public interface ErrorCodeConstants {
ErrorCode WM_BATCH_MOLD_REQUIRED = new ErrorCode(1_040_717_011, "批次配置要求模具不能为空");
ErrorCode WM_BATCH_LOT_NUMBER_REQUIRED = new ErrorCode(1_040_717_012, "批次配置要求生产批号不能为空");
ErrorCode WM_BATCH_QUALITY_STATUS_REQUIRED = new ErrorCode(1_040_717_013, "批次配置要求质量状态不能为空");
ErrorCode WM_BATCH_NOT_EXISTS = new ErrorCode(1_040_717_014, "批次不存在");
ErrorCode WM_BATCH_ITEM_MISMATCH = new ErrorCode(1_040_717_015, "批次不属于当前物料");
ErrorCode WM_BATCH_CLIENT_MISMATCH = new ErrorCode(1_040_717_016, "批次不属于当前客户");
ErrorCode WM_BATCH_VENDOR_MISMATCH = new ErrorCode(1_040_717_017, "批次不属于当前供应商");
// ========== MES 基础数据-客户1-040-103-000 ==========
ErrorCode MD_CLIENT_NOT_EXISTS = new ErrorCode(1_040_103_000, "客户不存在");
@ -58,6 +68,7 @@ public interface ErrorCodeConstants {
ErrorCode MD_CLIENT_NAME_DUPLICATE = new ErrorCode(1_040_103_002, "客户名称已存在");
ErrorCode MD_CLIENT_NICKNAME_DUPLICATE = new ErrorCode(1_040_103_003, "客户简称已存在");
ErrorCode MD_CLIENT_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_040_103_004, "导入客户数据不能为空");
ErrorCode MD_CLIENT_IS_DISABLE = new ErrorCode(1_040_103_005, "客户已禁用");
// ========== MES 基础数据-供应商1-040-104-000 ==========
ErrorCode MD_VENDOR_NOT_EXISTS = new ErrorCode(1_040_104_000, "供应商不存在");
@ -66,6 +77,7 @@ public interface ErrorCodeConstants {
ErrorCode MD_VENDOR_NICKNAME_DUPLICATE = new ErrorCode(1_040_104_003, "供应商简称已存在");
ErrorCode MD_VENDOR_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_040_104_004, "导入供应商数据不能为空");
ErrorCode MD_VENDOR_HAS_REFERENCE = new ErrorCode(1_040_104_005, "该供应商已被其他业务引用,无法删除");
ErrorCode MD_VENDOR_IS_DISABLE = new ErrorCode(1_040_104_006, "供应商已禁用");
// ========== MES 基础数据-车间1-040-105-000 ==========
ErrorCode MD_WORKSHOP_NOT_EXISTS = new ErrorCode(1_040_105_000, "车间不存在");
@ -77,6 +89,7 @@ public interface ErrorCodeConstants {
ErrorCode MD_WORKSTATION_NOT_EXISTS = new ErrorCode(1_040_106_000, "工作站不存在");
ErrorCode MD_WORKSTATION_CODE_DUPLICATE = new ErrorCode(1_040_106_001, "工作站编码已存在");
ErrorCode MD_WORKSTATION_NAME_DUPLICATE = new ErrorCode(1_040_106_002, "工作站名称已存在");
ErrorCode MD_WORKSTATION_IS_DISABLE = new ErrorCode(1_040_106_003, "工作站已禁用");
// ========== MES 基础数据-设备资源1-040-106-100 ==========
ErrorCode MD_WORKSTATION_MACHINE_NOT_EXISTS = new ErrorCode(1_040_106_100, "设备资源记录不存在");
ErrorCode MD_WORKSTATION_MACHINE_EXISTS = new ErrorCode(1_040_106_101, "该设备已分配至工作站:{}");
@ -91,6 +104,7 @@ public interface ErrorCodeConstants {
ErrorCode MD_PRODUCT_BOM_NOT_EXISTS = new ErrorCode(1_040_107_000, "产品BOM不存在");
ErrorCode MD_PRODUCT_BOM_SELF_REFERENCE = new ErrorCode(1_040_107_001, "产品不能作为自身的BOM物料");
ErrorCode MD_PRODUCT_BOM_CIRCULAR = new ErrorCode(1_040_107_002, "BOM物料存在闭环无法新增");
ErrorCode MD_PRODUCT_BOM_ITEM_INVALID = new ErrorCode(1_040_107_003, "选择的 BOM 物料不属于当前产品");
// ========== MES 基础数据-产品SOP1-040-108-000 ==========
ErrorCode MD_PRODUCT_SOP_NOT_EXISTS = new ErrorCode(1_040_108_000, "产品SOP不存在");
@ -149,6 +163,7 @@ public interface ErrorCodeConstants {
// ========== MES 设备管理-设备台账1-040-301-000 ==========
ErrorCode DV_MACHINERY_NOT_EXISTS = new ErrorCode(1_040_301_000, "设备不存在");
ErrorCode DV_MACHINERY_CODE_DUPLICATE = new ErrorCode(1_040_301_001, "设备编码已存在");
ErrorCode DV_MACHINERY_IS_DISABLE = new ErrorCode(1_040_301_007, "设备已禁用");
ErrorCode DV_MACHINERY_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_040_301_002, "导入设备数据不能为空");
ErrorCode DV_MACHINERY_HAS_CHECK_PLAN = new ErrorCode(1_040_301_003, "设备已关联点检计划,无法删除");
ErrorCode DV_MACHINERY_HAS_CHECK_RECORD = new ErrorCode(1_040_301_004, "设备已关联点检记录,无法删除");
@ -159,6 +174,7 @@ public interface ErrorCodeConstants {
ErrorCode DV_SUBJECT_NOT_EXISTS = new ErrorCode(1_040_304_000, "点检保养项目不存在");
ErrorCode DV_SUBJECT_CODE_DUPLICATE = new ErrorCode(1_040_304_001, "项目编码已存在");
ErrorCode DV_SUBJECT_USED_BY_CHECK_PLAN = new ErrorCode(1_040_304_002, "点检保养项目已被点检保养方案使用,无法删除");
ErrorCode DV_SUBJECT_IS_DISABLE = new ErrorCode(1_040_304_003, "点检保养项目已禁用");
// ========== MES 设备管理-点检计划1-040-302-000 ==========
ErrorCode DV_CHECK_PLAN_NOT_EXISTS = new ErrorCode(1_040_302_000, "点检计划不存在");
@ -167,6 +183,8 @@ public interface ErrorCodeConstants {
ErrorCode DV_CHECK_PLAN_NO_MACHINERY = new ErrorCode(1_040_302_003, "启用方案时,至少需要关联一台设备");
ErrorCode DV_CHECK_PLAN_NO_SUBJECT = new ErrorCode(1_040_302_004, "启用方案时,至少需要关联一个点检保养项目");
ErrorCode DV_CHECK_PLAN_NOT_ENABLED = new ErrorCode(1_040_302_005, "点检保养方案未启用,不允许停用");
ErrorCode DV_CHECK_PLAN_TYPE_MISMATCH = new ErrorCode(1_040_302_006, "点检保养方案类型与当前业务不匹配");
ErrorCode DV_CHECK_PLAN_NOT_ENABLED_FOR_RECORD = new ErrorCode(1_040_302_007, "点检保养方案未启用,不允许创建记录");
// ========== MES 设备管理-点检方案设备1-040-302-100 ==========
ErrorCode DV_CHECK_PLAN_MACHINERY_NOT_EXISTS = new ErrorCode(1_040_302_100, "点检保养方案设备不存在");
ErrorCode DV_CHECK_PLAN_MACHINERY_DUPLICATE = new ErrorCode(1_040_302_101, "该设备已关联到当前方案,请勿重复添加");
@ -203,16 +221,19 @@ public interface ErrorCodeConstants {
ErrorCode TM_TOOL_TYPE_CODE_DUPLICATE = new ErrorCode(1_040_400_001, "工具类型编码已存在");
ErrorCode TM_TOOL_TYPE_NAME_DUPLICATE = new ErrorCode(1_040_400_002, "工具类型名称已存在");
ErrorCode TM_TOOL_TYPE_HAS_TOOL = new ErrorCode(1_040_400_003, "该工具类型下存在工具,无法删除");
ErrorCode TM_TOOL_TYPE_HAS_WORKSTATION_TOOL = new ErrorCode(1_040_400_004, "该工具类型已被工作站工装资源引用,无法删除");
// ========== MES 工具管理-工具台账1-040-401-000 ==========
ErrorCode TM_TOOL_NOT_EXISTS = new ErrorCode(1_040_401_000, "工具不存在");
ErrorCode TM_TOOL_CODE_DUPLICATE = new ErrorCode(1_040_401_001, "工具编码已存在");
ErrorCode TM_TOOL_HAS_BATCH = new ErrorCode(1_040_401_002, "该工具已被批次引用,无法删除");
// ========== MES 生产管理-工序1-040-500-000 ==========
ErrorCode PRO_PROCESS_NOT_EXISTS = new ErrorCode(1_040_500_000, "工序不存在");
ErrorCode PRO_PROCESS_CODE_EXISTS = new ErrorCode(1_040_500_001, "工序编码已存在");
ErrorCode PRO_PROCESS_NAME_EXISTS = new ErrorCode(1_040_500_002, "工序名称已存在");
ErrorCode PRO_PROCESS_USED_BY_ROUTE = new ErrorCode(1_040_500_003, "工序已被工艺路线引用,无法删除");
ErrorCode PRO_PROCESS_IS_DISABLE = new ErrorCode(1_040_500_004, "工序已禁用");
// ========== MES 生产管理-工序内容1-040-500-100 ==========
ErrorCode PRO_PROCESS_CONTENT_NOT_EXISTS = new ErrorCode(1_040_500_100, "工序内容不存在");
@ -241,11 +262,17 @@ public interface ErrorCodeConstants {
ErrorCode PRO_WORK_ORDER_NOT_PREPARE = new ErrorCode(1_040_502_002, "只有草稿状态的工单才能执行此操作");
ErrorCode PRO_WORK_ORDER_NOT_CONFIRMED = new ErrorCode(1_040_502_003, "只有已确认状态的工单才能执行此操作");
ErrorCode PRO_WORK_ORDER_HAS_CHILDREN = new ErrorCode(1_040_502_004, "存在子工单,无法删除");
ErrorCode PRO_WORK_ORDER_PRODUCT_MISMATCH = new ErrorCode(1_040_502_005, "当前产品物料与生产工单产品不一致");
ErrorCode PRO_WORK_ORDER_BOM_NOT_EXISTS = new ErrorCode(1_040_502_100, "生产工单BOM不存在");
// ========== MES 生产管理-生产任务1-040-503-000 ==========
ErrorCode PRO_TASK_NOT_EXISTS = new ErrorCode(1_040_503_000, "生产任务不存在");
ErrorCode PRO_TASK_ALREADY_FINISHED = new ErrorCode(1_040_503_001, "生产任务已完成或已取消,不能继续操作");
ErrorCode PRO_TASK_WORK_ORDER_MISMATCH = new ErrorCode(1_040_503_002, "生产任务不属于当前生产工单");
ErrorCode PRO_TASK_WORKSTATION_MISMATCH = new ErrorCode(1_040_503_003, "生产任务不属于当前工作站");
ErrorCode PRO_TASK_ROUTE_PROCESS_MISMATCH = new ErrorCode(1_040_503_004, "生产任务与当前工艺路线或工序不一致");
ErrorCode PRO_TASK_ITEM_MISMATCH = new ErrorCode(1_040_503_005, "生产任务产品与当前产品物料不一致");
ErrorCode PRO_WORKSTATION_PROCESS_MISMATCH = new ErrorCode(1_040_503_006, "工作站所属工序与当前工序不一致");
// ========== MES 生产管理-生产任务投料1-040-503-100 ==========
ErrorCode PRO_TASK_ISSUE_NOT_EXISTS = new ErrorCode(1_040_503_100, "生产任务投料记录不存在");
@ -278,6 +305,7 @@ public interface ErrorCodeConstants {
ErrorCode PRO_CARD_CODE_DUPLICATE = new ErrorCode(1_040_507_001, "流转卡编码已存在");
ErrorCode PRO_CARD_STATUS_ERROR = new ErrorCode(1_040_507_002, "流转卡状态不正确");
ErrorCode PRO_CARD_CANCEL_NOT_ALLOWED = new ErrorCode(1_040_507_003, "已完成或已取消的流转卡不允许取消");
ErrorCode PRO_CARD_NOT_PREPARE = new ErrorCode(1_040_507_004, "流转卡不是草稿状态,不允许修改或删除");
// ========== MES 生产管理-流转卡工序1-040-507-100 ==========
ErrorCode PRO_CARD_PROCESS_NOT_EXISTS = new ErrorCode(1_040_507_100, "流转卡工序记录不存在");
@ -323,6 +351,11 @@ public interface ErrorCodeConstants {
ErrorCode QC_IPQC_QUANTITY_MISMATCH = new ErrorCode(1_040_604_004, "合格品与不合格品数量之和须等于检测数量");
ErrorCode QC_IPQC_NO_TEMPLATE = new ErrorCode(1_040_604_005, "当前产品未配置 IPQC 检测模板");
ErrorCode QC_IPQC_CHECK_RESULT_EMPTY = new ErrorCode(1_040_604_006, "完成检验单前,检测结果必须填写");
ErrorCode QC_IPQC_SOURCE_DOC_TYPE_UNKNOWN = new ErrorCode(1_040_604_007, "未知的 IPQC 来源单据类型");
ErrorCode QC_IPQC_SOURCE_DOC_NO_PENDING_LINE = new ErrorCode(1_040_604_008, "来源报工单不存在待检产出行,无法创建 IPQC");
ErrorCode QC_IPQC_SOURCE_LINE_NOT_BELONG = new ErrorCode(1_040_604_009, "来源单据行不属于该报工单");
ErrorCode QC_IPQC_SOURCE_LINE_REQUIRED = new ErrorCode(1_040_604_010, "来源单据类型为报工时,来源产出行 ID 不能为空");
ErrorCode QC_IPQC_SOURCE_LINE_NOT_PENDING = new ErrorCode(1_040_604_011, "来源产出行不是待检验状态");
// ========== MES 质量管理-过程检验行1-040-604-100 ==========
ErrorCode QC_IPQC_LINE_NOT_EXISTS = new ErrorCode(1_040_604_100, "过程检验行不存在");
@ -333,6 +366,8 @@ public interface ErrorCodeConstants {
// ========== MES 质量管理-检验结果1-040-606-000 ==========
ErrorCode QC_RESULT_NOT_EXISTS = new ErrorCode(1_040_606_000, "检验结果不存在");
ErrorCode QC_RESULT_VALUE_FORMAT_INVALID = new ErrorCode(1_040_606_001, "检测值格式不正确:{}");
ErrorCode QC_FINISH_INDICATOR_RESULT_REQUIRED = new ErrorCode(1_040_606_002, "完成检验单前,至少需要录入一条检测结果");
// ========== MES 质量管理-出货检验1-040-607-000 ==========
ErrorCode QC_OQC_NOT_EXISTS = new ErrorCode(1_040_607_000, "出货检验单不存在");
@ -341,6 +376,8 @@ public interface ErrorCodeConstants {
ErrorCode QC_OQC_QUANTITY_MISMATCH = new ErrorCode(1_040_607_004, "合格品与不合格品数量之和须等于检测数量");
ErrorCode QC_OQC_NO_TEMPLATE = new ErrorCode(1_040_607_005, "当前产品未配置 OQC 检测模板");
ErrorCode QC_OQC_CHECK_RESULT_EMPTY = new ErrorCode(1_040_607_006, "完成检验单前,检测结果必须填写");
ErrorCode QC_OQC_SOURCE_DOC_TYPE_UNKNOWN = new ErrorCode(1_040_607_007, "未知的 OQC 来源单据类型");
// ========== MES 质量管理-出货检验行1-040-607-100 ==========
ErrorCode QC_OQC_LINE_NOT_EXISTS = new ErrorCode(1_040_607_100, "出货检验行不存在");
@ -399,6 +436,8 @@ public interface ErrorCodeConstants {
ErrorCode WM_TRANSACTION_RELATED_NOT_EXISTS = new ErrorCode(1_040_703_010, "关联的库存事务不存在");
ErrorCode WM_TRANSACTION_LIST_EMPTY = new ErrorCode(1_040_703_011, "库存事务列表不能为空");
ErrorCode WM_TRANSACTION_BATCH_NOT_EXISTS = new ErrorCode(1_040_703_012, "批次记录不存在");
ErrorCode WM_MATERIAL_STOCK_REQUIRED = new ErrorCode(1_040_703_013, "库存记录不能为空");
ErrorCode WM_MATERIAL_STOCK_SELECTION_MISMATCH = new ErrorCode(1_040_703_014, "库存记录与提交的物料、批次或库位信息不一致");
// ========== MES 仓库管理-到货通知单1-040-704-000 ==========
ErrorCode WM_ARRIVAL_NOTICE_NOT_EXISTS = new ErrorCode(1_040_704_000, "到货通知单不存在");
@ -408,6 +447,7 @@ public interface ErrorCodeConstants {
ErrorCode WM_ARRIVAL_NOTICE_STATUS_NOT_PENDING_RECEIPT = new ErrorCode(1_040_704_004, "只有待入库状态才允许完成");
ErrorCode WM_ARRIVAL_NOTICE_IQC_PENDING = new ErrorCode(1_040_704_005, "存在待检验行,无法审批通过");
ErrorCode WM_ARRIVAL_NOTICE_NO_LINE = new ErrorCode(1_040_704_006, "至少需要一条行项目");
ErrorCode WM_ARRIVAL_NOTICE_VENDOR_MISMATCH = new ErrorCode(1_040_704_007, "到货通知单的供应商与当前单据不一致");
ErrorCode WM_ARRIVAL_NOTICE_LINE_NOT_EXISTS = new ErrorCode(1_040_704_100, "到货通知单行不存在");
ErrorCode WM_ARRIVAL_NOTICE_LINE_NOT_MATCH = new ErrorCode(1_040_704_101, "到货通知单行不属于指定的到货通知单");
@ -444,6 +484,8 @@ public interface ErrorCodeConstants {
ErrorCode WM_OUTSOURCE_ISSUE_LINE_NOT_EXISTS = new ErrorCode(1_040_707_100, "外协发料单行不存在");
ErrorCode WM_OUTSOURCE_ISSUE_LINE_ITEM_NOT_IN_BOM = new ErrorCode(1_040_707_101, "发料单行对应的物料不在当前工单的 BOM 列表中");
ErrorCode WM_OUTSOURCE_ISSUE_DETAIL_NOT_EXISTS = new ErrorCode(1_040_707_200, "外协发料单明细不存在");
ErrorCode WM_OUTSOURCE_ISSUE_DETAIL_LINE_NOT_MATCH = new ErrorCode(1_040_707_201, "拣货明细不属于指定的外协发料单");
ErrorCode WM_OUTSOURCE_ISSUE_DETAIL_ITEM_MISMATCH = new ErrorCode(1_040_707_202, "拣货明细的物料与外协发料单行的物料不一致");
ErrorCode WM_OUTSOURCE_ISSUE_WORK_ORDER_TYPE_INVALID = new ErrorCode(1_040_707_008, "工单类型不是外协(代工)类型");
// ========== MES 仓库管理-生产领料出库单1-040-708-000 ==========
@ -459,6 +501,8 @@ public interface ErrorCodeConstants {
ErrorCode WM_PRODUCT_ISSUE_CODE_DUPLICATE = new ErrorCode(1_040_708_102, "领料出库单编码已存在");
ErrorCode WM_PRODUCT_ISSUE_DETAIL_NOT_EXISTS = new ErrorCode(1_040_708_200, "生产领料出库单明细不存在");
ErrorCode WM_PRODUCT_ISSUE_DETAIL_ITEM_MISMATCH = new ErrorCode(1_040_708_201, "拣货明细的物料与领料单行的物料不一致");
ErrorCode WM_PRODUCT_ISSUE_DETAIL_LINE_NOT_MATCH = new ErrorCode(1_040_708_202, "拣货明细不属于指定的领料出库单");
ErrorCode WM_PRODUCT_ISSUE_NO_DETAIL = new ErrorCode(1_040_708_203, "领料出库单没有拣货明细,无法执行领出");
// ========== MES 仓库管理-生产入库单1-040-709-000 ==========
ErrorCode WM_PRODUCT_PRODUCE_NOT_EXISTS = new ErrorCode(1_040_709_000, "生产入库单不存在");
@ -501,6 +545,8 @@ public interface ErrorCodeConstants {
ErrorCode WM_RETURN_ISSUE_DETAIL_QUANTITY_INVALID = new ErrorCode(1_040_710_201, "退料明细数量必须大于0");
ErrorCode WM_RETURN_ISSUE_DETAIL_QUANTITY_EXCEED = new ErrorCode(1_040_710_202, "退料明细总数量不能超过退料单行数量");
ErrorCode WM_RETURN_ISSUE_CODE_DUPLICATE = new ErrorCode(1_040_710_203, "退料单编码已存在");
ErrorCode WM_RETURN_ISSUE_DETAIL_LINE_NOT_MATCH = new ErrorCode(1_040_710_204, "退料明细不属于指定的退料单");
ErrorCode WM_RETURN_ISSUE_DETAIL_ITEM_MISMATCH = new ErrorCode(1_040_710_205, "退料明细的物料与退料单行的物料不一致");
// ========== MES 仓库管理-供应商退货单1-040-711-000 ==========
ErrorCode WM_RETURN_VENDOR_NOT_EXISTS = new ErrorCode(1_040_711_000, "供应商退货单不存在");
@ -514,6 +560,7 @@ public interface ErrorCodeConstants {
ErrorCode WM_RETURN_VENDOR_LINE_NOT_EXISTS = new ErrorCode(1_040_711_100, "供应商退货单行不存在");
ErrorCode WM_RETURN_VENDOR_DETAIL_NOT_EXISTS = new ErrorCode(1_040_711_200, "供应商退货单明细不存在");
ErrorCode WM_RETURN_VENDOR_DETAIL_QUANTITY_INVALID = new ErrorCode(1_040_711_201, "退货明细数量必须大于 0");
ErrorCode WM_RETURN_VENDOR_DETAIL_LINE_NOT_MATCH = new ErrorCode(1_040_711_202, "拣货明细不属于指定的供应商退货单");
// ========== MES 仓库管理-产品收货单1-040-712-000 ==========
ErrorCode WM_PRODUCT_RECPT_NOT_EXISTS = new ErrorCode(1_040_712_000, "产品收货单不存在");
@ -588,6 +635,20 @@ public interface ErrorCodeConstants {
ErrorCode WM_PRODUCT_SALES_DETAIL_NOT_EXISTS = new ErrorCode(1_040_714_012, "销售出库明细不存在");
ErrorCode WM_PRODUCT_SALES_STOCK_INSUFFICIENT = new ErrorCode(1_040_714_013, "库存不足,无法拣货");
ErrorCode WM_PRODUCT_SALES_LINE_QUANTITY_INVALID = new ErrorCode(1_040_714_014, "出库数量必须大于 0");
ErrorCode WM_PRODUCT_SALES_DETAIL_LINE_NOT_MATCH = new ErrorCode(1_040_714_015, "拣货明细不属于指定的销售出库单");
ErrorCode WM_PRODUCT_SALES_DETAIL_ITEM_MISMATCH = new ErrorCode(1_040_714_016, "拣货明细的物料与销售出库单行的物料不一致");
ErrorCode WM_PRODUCT_SALES_LINE_SALES_NOTICE_LINE_REQUIRED = new ErrorCode(1_040_714_017,
"出库单关联了发货通知单,必须选择发货通知单行");
ErrorCode WM_PRODUCT_SALES_LINE_SALES_NOTICE_LINE_NOT_ALLOWED = new ErrorCode(1_040_714_018,
"出库单未关联发货通知单,不能选择发货通知单行");
ErrorCode WM_PRODUCT_SALES_LINE_NOTICE_LINE_ITEM_MISMATCH = new ErrorCode(1_040_714_030,
"出库行物料与发货通知单行物料不一致");
ErrorCode WM_PRODUCT_SALES_LINE_NOTICE_LINE_QUANTITY_MISMATCH = new ErrorCode(1_040_714_031,
"出库行数量与发货通知单行数量不一致");
ErrorCode WM_PRODUCT_SALES_LINE_NOTICE_LINE_BATCH_MISMATCH = new ErrorCode(1_040_714_032,
"出库行批次号与发货通知单行批次号不一致");
ErrorCode WM_PRODUCT_SALES_LINE_NOTICE_LINE_OQC_MISMATCH = new ErrorCode(1_040_714_033,
"出库行 OQC 检验标识与发货通知单行不一致");
// ========== MES 仓库管理-杂项出库单1-040-715-000 ==========
ErrorCode WM_MISC_ISSUE_NOT_EXISTS = new ErrorCode(1_040_715_000, "杂项出库单不存在");
@ -616,8 +677,11 @@ public interface ErrorCodeConstants {
ErrorCode WM_SALES_NOTICE_CODE_DUPLICATE = new ErrorCode(1_040_720_001, "通知单编号重复");
ErrorCode WM_SALES_NOTICE_STATUS_NOT_ALLOW_DELETE = new ErrorCode(1_040_720_002, "单据状态不允许删除");
ErrorCode WM_SALES_NOTICE_STATUS_NOT_ALLOW_UPDATE = new ErrorCode(1_040_720_003, "单据状态不允许修改");
ErrorCode WM_SALES_NOTICE_STATUS_NOT_APPROVED = new ErrorCode(1_040_720_004, "发货通知单不是待出库状态");
ErrorCode WM_SALES_NOTICE_CLIENT_MISMATCH = new ErrorCode(1_040_720_005, "发货通知单的客户与当前单据不一致");
ErrorCode WM_SALES_NOTICE_LINE_NOT_EXISTS = new ErrorCode(1_040_720_010, "发货通知单行不存在");
ErrorCode WM_SALES_NOTICE_LINE_EMPTY = new ErrorCode(1_040_720_011, "发货通知单行为空,不能提交");
ErrorCode WM_SALES_NOTICE_LINE_NOT_MATCH = new ErrorCode(1_040_720_012, "发货通知单行不属于指定的发货通知单");
// ========== MES 仓库管理-条码配置1-040-730-000 ==========
ErrorCode WM_BARCODE_CONFIG_NOT_EXISTS = new ErrorCode(1_040_730_000, "条码配置不存在");

View File

@ -19,7 +19,7 @@ import java.util.List;
public enum MesCalShiftTypeEnum implements ArrayValuable<Integer> {
SINGLE(1, "单白班", ListUtil.of(
Pair.of("白班", new String[]{"08:00", "17:00"})
Pair.of("白班", new String[]{"08:00", "18:00"})
)),
TWO(2, "两班倒", ListUtil.of(
Pair.of("白班", new String[]{"08:00", "20:00"}),
@ -45,7 +45,7 @@ public enum MesCalShiftTypeEnum implements ArrayValuable<Integer> {
*
*
* key: "白班", "夜班", "中班"
* value: [startTime, endTime] ["08:00", "17:00"]
* value: [startTime, endTime] ["08:00", "18:00"]
*/
private final List<Pair<String, String[]>> shifts;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.mes.enums.wm;
package cn.iocoder.yudao.module.mes.enums.dv;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import lombok.AllArgsConstructor;
@ -7,15 +7,18 @@ import lombok.Getter;
import java.util.Arrays;
/**
* MES
* MES
*
* @author
*/
@Getter
@AllArgsConstructor
public enum MesWmMiscReceiptTypeEnum implements ArrayValuable<Integer> {
public enum MesDvCheckPlanTypeEnum implements ArrayValuable<Integer> {
ADJUST(1, "库存调整");
CHECK(1, "点检"),
MAINTENANCE(2, "保养");
public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesWmMiscReceiptTypeEnum::getType).toArray(Integer[]::new);
public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvCheckPlanTypeEnum::getType).toArray(Integer[]::new);
/**
*

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.mes.enums.dv;
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
import cn.iocoder.yudao.module.mes.enums.MesOrderStatusConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -20,13 +21,13 @@ public enum MesDvMaintenRecordStatusEnum implements ArrayValuable<Integer> {
*
* MesDvMaintenRecordService#createMaintenRecord
*/
PREPARE(1, "草稿"),
PREPARE(MesOrderStatusConstants.PREPARE, "草稿"),
/**
*
*
* MesDvMaintenRecordService#submitMaintenRecord
*/
SUBMITTED(2, "已提交");
SUBMITTED(MesOrderStatusConstants.FINISHED, "已提交");
public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesDvMaintenRecordStatusEnum::getStatus)
.toArray(Integer[]::new);

View File

@ -12,10 +12,12 @@ import lombok.Getter;
@AllArgsConstructor
public enum MesMdAutoCodeRuleCodeEnum {
MD_ITEM_TYPE_CODE("MD_ITEM_TYPE_CODE", "物料分类编码"),
MD_ITEM_CODE("MD_ITEM_CODE", "物料编码"),
MD_VENDOR_CODE("MD_VENDOR_CODE", "供应商编码"),
MD_CLIENT_CODE("MD_CLIENT_CODE", "客户编码"),
MD_WORKSTATION_CODE("MD_WORKSTATION_CODE", "工作站编码"),
MD_WORKSHOP_CODE("MD_WORKSHOP_CODE", "车间编码"),
TM_TOOL_TYPE_CODE("TM_TOOL_TYPE_CODE", "工具类型编码"),
WM_ARRIVAL_NOTICE_CODE("WM_ARRIVAL_NOTICE_CODE", "到货通知单编码"),
WM_ITEM_RECEIPT_CODE("WM_ITEM_RECEIPT_CODE", "采购入库单编码"),

View File

@ -75,7 +75,7 @@ public class MesDvCheckPlanMachineryController {
return BeanUtils.toBean(list, MesDvCheckPlanMachineryRespVO.class, vo ->
MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery ->
vo.setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
.setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec())
.setMachineryBrand(machinery.getBrand()).setMachinerySpecification(machinery.getSpecification())
)
);
}

View File

@ -28,7 +28,7 @@ public class MesDvCheckPlanMachineryRespVO {
private String machineryBrand;
@Schema(description = "规格型号", example = "HTF120")
private String machinerySpec;
private String machinerySpecification;
@Schema(description = "备注")
private String remark;

View File

@ -46,10 +46,8 @@ public class MesDvCheckRecordController {
@Resource
private MesDvCheckRecordService checkRecordService;
@Resource
private MesDvCheckPlanService checkPlanService;
@Resource
private MesDvMachineryService machineryService;
@ -143,7 +141,7 @@ public class MesDvCheckRecordController {
.setPlanCycleType(plan.getCycleType()).setPlanCycleCount(plan.getCycleCount()));
MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery -> vo
.setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
.setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec()));
.setMachineryBrand(machinery.getBrand()).setMachinerySpecification(machinery.getSpecification()));
MapUtils.findAndThen(userMap, vo.getUserId(),
user -> vo.setNickname(user.getNickname()));
});

View File

@ -64,7 +64,7 @@ public class MesDvCheckRecordRespVO {
@Schema(description = "规格型号", example = "X-100")
@ExcelProperty("规格型号")
private String machinerySpec;
private String machinerySpecification;
@Schema(description = "点检时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("点检时间")

View File

@ -48,10 +48,8 @@ public class MesDvMachineryController {
@Resource
private MesDvMachineryService machineryService;
@Resource
private MesDvMachineryTypeService machineryTypeService;
@Resource
private MesMdWorkshopService workshopService;
@ -126,7 +124,7 @@ public class MesDvMachineryController {
// 手动创建导出 demo
List<MesDvMachineryImportExcelVO> list = Collections.singletonList(
MesDvMachineryImportExcelVO.builder().code("EQ-001").name("示例设备")
.brand("示例品牌").spec("型号A").machineryTypeCode("MT-001")
.brand("示例品牌").specification("型号A").machineryTypeCode("MT-001")
.workshopCode("WS-001").status(0).build()
);
// 输出

View File

@ -28,7 +28,7 @@ public class MesDvMachineryImportExcelVO {
private String brand;
@ExcelProperty("规格型号")
private String spec;
private String specification;
@ExcelProperty("设备类型编码")
private String machineryTypeCode;

View File

@ -33,7 +33,7 @@ public class MesDvMachineryRespVO {
@Schema(description = "规格型号", example = "S7-300")
@ExcelProperty("规格型号")
private String spec;
private String specification;
@Schema(description = "设备类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Long machineryTypeId;

View File

@ -26,7 +26,7 @@ public class MesDvMachinerySaveReqVO {
private String brand;
@Schema(description = "规格型号", example = "S7-300")
private String spec;
private String specification;
@Schema(description = "设备类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
@NotNull(message = "设备类型不能为空")

View File

@ -46,10 +46,8 @@ public class MesDvMaintenRecordController {
@Resource
private MesDvMaintenRecordService maintenRecordService;
@Resource
private MesDvCheckPlanService checkPlanService;
@Resource
private MesDvMachineryService machineryService;
@ -146,7 +144,7 @@ public class MesDvMaintenRecordController {
.setPlanCycleCount(plan.getCycleCount()));
MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery -> vo
.setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
.setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec()));
.setMachineryBrand(machinery.getBrand()).setMachinerySpecification(machinery.getSpecification()));
MapUtils.findAndThen(userMap, vo.getUserId(),
user -> vo.setNickname(user.getNickname()));
});

View File

@ -64,7 +64,7 @@ public class MesDvMaintenRecordRespVO {
@Schema(description = "规格型号", example = "X-100")
@ExcelProperty("规格型号")
private String machinerySpec;
private String machinerySpecification;
@Schema(description = "保养时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("保养时间")

View File

@ -48,7 +48,6 @@ public class MesDvRepairController {
@Resource
private MesDvRepairService repairService;
@Resource
private MesDvMachineryService machineryService;
@ -160,7 +159,7 @@ public class MesDvRepairController {
return BeanUtils.toBean(list, MesDvRepairRespVO.class, vo -> {
MapUtils.findAndThen(machineryMap, vo.getMachineryId(), machinery -> vo
.setMachineryCode(machinery.getCode()).setMachineryName(machinery.getName())
.setMachineryBrand(machinery.getBrand()).setMachinerySpec(machinery.getSpec()));
.setMachineryBrand(machinery.getBrand()).setMachinerySpecification(machinery.getSpecification()));
MapUtils.findAndThen(userMap, vo.getAcceptedUserId(),
user -> vo.setAcceptedUserNickname(user.getNickname()));
MapUtils.findAndThen(userMap, vo.getConfirmUserId(),

View File

@ -44,7 +44,7 @@ public class MesDvRepairRespVO {
@Schema(description = "规格型号", example = "X-100")
@ExcelProperty("规格型号")
private String machinerySpec;
private String machinerySpecification;
@Schema(description = "报修日期")
@ExcelProperty("报修日期")

View File

@ -37,6 +37,39 @@ public class MesMdClientImportExcelVO {
@ExcelProperty("客户邮箱地址")
private String email;
@ExcelProperty("客户英文名称")
private String englishName;
@ExcelProperty("客户简介")
private String description;
@ExcelProperty("客户地址")
private String address;
@ExcelProperty("客户官网地址")
private String website;
@ExcelProperty("联系人1")
private String contact1Name;
@ExcelProperty("联系人1-电话")
private String contact1Telephone;
@ExcelProperty("联系人1-邮箱")
private String contact1Email;
@ExcelProperty("联系人2")
private String contact2Name;
@ExcelProperty("联系人2-电话")
private String contact2Telephone;
@ExcelProperty("联系人2-邮箱")
private String contact2Email;
@ExcelProperty("统一社会信用代码")
private String creditCode;
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat(cn.iocoder.yudao.module.system.enums.DictTypeConstants.COMMON_STATUS)
private Integer status;

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.module.mes.controller.admin.md.client.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - MES 客户新增/修改 Request VO")
@ -14,22 +16,28 @@ public class MesMdClientSaveReqVO {
@Schema(description = "客户编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "C00184")
@NotEmpty(message = "客户编码不能为空")
@Size(max = 64, message = "客户编码长度不能超过 64 个字符")
private String code;
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "比亚迪")
@NotEmpty(message = "客户名称不能为空")
@Size(max = 255, message = "客户名称长度不能超过 255 个字符")
private String name;
@Schema(description = "客户简称", example = "比亚迪")
@Size(max = 255, message = "客户简称长度不能超过 255 个字符")
private String nickname;
@Schema(description = "客户英文名称", example = "BYD")
@Size(max = 255, message = "客户英文名称长度不能超过 255 个字符")
private String englishName;
@Schema(description = "客户简介", example = "比亚迪品牌诞生于深圳")
@Size(max = 500, message = "客户简介长度不能超过 500 个字符")
private String description;
@Schema(description = "客户LOGO地址", example = "https://xxx.com/logo.png")
@Size(max = 255, message = "客户LOGO地址长度不能超过 255 个字符")
private String logo;
@Schema(description = "客户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ -37,36 +45,50 @@ public class MesMdClientSaveReqVO {
private Integer type;
@Schema(description = "客户地址", example = "深圳南山区")
@Size(max = 500, message = "客户地址长度不能超过 500 个字符")
private String address;
@Schema(description = "客户官网地址", example = "https://www.bydglobal.com")
@Size(max = 255, message = "客户官网地址长度不能超过 255 个字符")
private String website;
@Schema(description = "客户邮箱地址", example = "salse@bydglobal.com")
@Size(max = 255, message = "客户邮箱地址长度不能超过 255 个字符")
@Email(message = "客户邮箱地址格式不正确")
private String email;
@Schema(description = "客户电话", example = "123432222")
@Size(max = 64, message = "客户电话长度不能超过 64 个字符")
private String telephone;
@Schema(description = "联系人1", example = "张三")
@Size(max = 64, message = "联系人1长度不能超过 64 个字符")
private String contact1Name;
@Schema(description = "联系人1-电话", example = "122212312")
@Size(max = 64, message = "联系人1-电话长度不能超过 64 个字符")
private String contact1Telephone;
@Schema(description = "联系人1-邮箱", example = "s1@bydglobal.com")
@Size(max = 255, message = "联系人1-邮箱长度不能超过 255 个字符")
@Email(message = "联系人1-邮箱格式不正确")
private String contact1Email;
@Schema(description = "联系人2", example = "李四")
@Size(max = 64, message = "联系人2长度不能超过 64 个字符")
private String contact2Name;
@Schema(description = "联系人2-电话", example = "1132323232")
@Size(max = 64, message = "联系人2-电话长度不能超过 64 个字符")
private String contact2Telephone;
@Schema(description = "联系人2-邮箱", example = "s2@bydglobal.com")
@Size(max = 255, message = "联系人2-邮箱长度不能超过 255 个字符")
@Email(message = "联系人2-邮箱格式不正确")
private String contact2Email;
@Schema(description = "统一社会信用代码", example = "11212121")
@Size(max = 64, message = "统一社会信用代码长度不能超过 64 个字符")
private String creditCode;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@ -74,6 +96,7 @@ public class MesMdClientSaveReqVO {
private Integer status;
@Schema(description = "备注", example = "备注")
@Size(max = 500, message = "备注长度不能超过 500 个字符")
private String remark;
}

View File

@ -37,6 +37,39 @@ public class MesMdVendorImportExcelVO {
@ExcelProperty("供应商邮箱地址")
private String email;
@ExcelProperty("供应商英文名称")
private String englishName;
@ExcelProperty("供应商简介")
private String description;
@ExcelProperty("供应商地址")
private String address;
@ExcelProperty("供应商官网地址")
private String website;
@ExcelProperty("联系人1")
private String contact1Name;
@ExcelProperty("联系人1-电话")
private String contact1Telephone;
@ExcelProperty("联系人1-邮箱")
private String contact1Email;
@ExcelProperty("联系人2")
private String contact2Name;
@ExcelProperty("联系人2-电话")
private String contact2Telephone;
@ExcelProperty("联系人2-邮箱")
private String contact2Email;
@ExcelProperty("统一社会信用代码")
private String creditCode;
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat(cn.iocoder.yudao.module.system.enums.DictTypeConstants.COMMON_STATUS)
private Integer status;

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.module.mes.controller.admin.md.vendor.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - MES 供应商新增/修改 Request VO")
@ -14,61 +16,82 @@ public class MesMdVendorSaveReqVO {
@Schema(description = "供应商编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "V00101")
@NotEmpty(message = "供应商编码不能为空")
@Size(max = 64, message = "供应商编码长度不能超过 64 个字符")
private String code;
@Schema(description = "供应商名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "海力德电子")
@NotEmpty(message = "供应商名称不能为空")
@Size(max = 255, message = "供应商名称长度不能超过 255 个字符")
private String name;
@Schema(description = "供应商简称", example = "海力德")
@Size(max = 255, message = "供应商简称长度不能超过 255 个字符")
private String nickname;
@Schema(description = "供应商英文名称", example = "HLD Electronics")
@Size(max = 255, message = "供应商英文名称长度不能超过 255 个字符")
private String englishName;
@Schema(description = "供应商简介", example = "专业从事电子元器件生产与销售")
@Size(max = 500, message = "供应商简介长度不能超过 500 个字符")
private String description;
@Schema(description = "供应商LOGO地址", example = "https://xxx.com/logo.png")
@Size(max = 255, message = "供应商LOGO地址长度不能超过 255 个字符")
private String logo;
@Schema(description = "供应商等级", example = "A")
@Size(max = 64, message = "供应商等级长度不能超过 64 个字符")
private String level;
@Schema(description = "供应商评分", example = "95")
private Integer score;
@Schema(description = "供应商地址", example = "深圳市宝安区")
@Size(max = 500, message = "供应商地址长度不能超过 500 个字符")
private String address;
@Schema(description = "供应商官网地址", example = "https://www.hld-elec.com")
@Size(max = 255, message = "供应商官网地址长度不能超过 255 个字符")
private String website;
@Schema(description = "供应商邮箱地址", example = "info@hld-elec.com")
@Size(max = 255, message = "供应商邮箱地址长度不能超过 255 个字符")
@Email(message = "供应商邮箱地址格式不正确")
private String email;
@Schema(description = "供应商电话", example = "0755-12345678")
@Size(max = 64, message = "供应商电话长度不能超过 64 个字符")
private String telephone;
@Schema(description = "联系人1", example = "王经理")
@Size(max = 64, message = "联系人1长度不能超过 64 个字符")
private String contact1Name;
@Schema(description = "联系人1-电话", example = "13800138001")
@Size(max = 64, message = "联系人1-电话长度不能超过 64 个字符")
private String contact1Telephone;
@Schema(description = "联系人1-邮箱", example = "wang@hld-elec.com")
@Size(max = 255, message = "联系人1-邮箱长度不能超过 255 个字符")
@Email(message = "联系人1-邮箱格式不正确")
private String contact1Email;
@Schema(description = "联系人2", example = "赵助理")
@Size(max = 64, message = "联系人2长度不能超过 64 个字符")
private String contact2Name;
@Schema(description = "联系人2-电话", example = "13800138002")
@Size(max = 64, message = "联系人2-电话长度不能超过 64 个字符")
private String contact2Telephone;
@Schema(description = "联系人2-邮箱", example = "zhao@hld-elec.com")
@Size(max = 255, message = "联系人2-邮箱长度不能超过 255 个字符")
@Email(message = "联系人2-邮箱格式不正确")
private String contact2Email;
@Schema(description = "统一社会信用代码", example = "91440300MA5EXAMPLE")
@Size(max = 64, message = "统一社会信用代码长度不能超过 64 个字符")
private String creditCode;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
@ -76,6 +99,7 @@ public class MesMdVendorSaveReqVO {
private Integer status;
@Schema(description = "备注", example = "备注")
@Size(max = 500, message = "备注长度不能超过 500 个字符")
private String remark;
}

View File

@ -77,7 +77,11 @@ public class MesMdWorkshopController {
@PreAuthorize("@ss.hasPermission('mes:md-workshop:query')")
public CommonResult<MesMdWorkshopRespVO> getWorkshop(@RequestParam("id") Long id) {
MesMdWorkshopDO workshop = workshopService.getWorkshop(id);
return success(BeanUtils.toBean(workshop, MesMdWorkshopRespVO.class));
if (workshop == null) {
return success(null);
}
List<MesMdWorkshopRespVO> voList = buildWorkshopRespVOList(Collections.singletonList(workshop));
return success(voList.get(0));
}
@GetMapping("/page")
@ -92,8 +96,19 @@ public class MesMdWorkshopController {
@Operation(summary = "获得车间精简列表", description = "只包含被开启的车间,主要用于前端的下拉选项")
public CommonResult<List<MesMdWorkshopRespVO>> getWorkshopSimpleList() {
List<MesMdWorkshopDO> list = workshopService.getWorkshopListByStatus(CommonStatusEnum.ENABLE.getStatus());
return success(convertList(list, ws -> new MesMdWorkshopRespVO()
.setId(ws.getId()).setCode(ws.getCode()).setName(ws.getName()).setArea(ws.getArea())));
if (CollUtil.isEmpty(list)) {
return success(Collections.emptyList());
}
// 批量获取负责人信息
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertSet(list, MesMdWorkshopDO::getChargeUserId));
return success(convertList(list, ws -> {
MesMdWorkshopRespVO vo = new MesMdWorkshopRespVO()
.setId(ws.getId()).setCode(ws.getCode()).setName(ws.getName()).setArea(ws.getArea());
MapUtils.findAndThen(userMap, ws.getChargeUserId(),
user -> vo.setChargeUserName(user.getNickname()));
return vo;
}));
}
@GetMapping("/export-excel")

View File

@ -47,13 +47,10 @@ public class MesProCardController {
@Resource
private MesProCardService cardService;
@Resource
private MesProWorkOrderService workOrderService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@ -128,12 +125,6 @@ public class MesProCardController {
return success(new PageResult<>(buildCardRespVOList(pageResult.getList()), pageResult.getTotal()));
}
@GetMapping("/simple-list")
@Operation(summary = "获得生产流转卡精简列表", description = "主要用于前端的下拉选项")
public CommonResult<List<MesProCardRespVO>> getCardSimpleList() {
List<MesProCardDO> list = cardService.getCardSimpleList();
return success(buildCardRespVOList(list));
}
@GetMapping("/export-excel")
@Operation(summary = "导出生产流转卡 Excel")

View File

@ -32,13 +32,13 @@ public class MesProCardRespVO {
@ExcelProperty("工单名称")
private String workOrderName;
@Schema(description = "产品物料编号", example = "200")
private Long itemId;
@Schema(description = "批次号", example = "BATCH-001")
@ExcelProperty("批次号")
private String batchCode;
@Schema(description = "产品物料编号", example = "200")
private Long itemId;
@Schema(description = "产品编码", example = "P-001")
@ExcelProperty("产品编码")
private String itemCode;

View File

@ -22,13 +22,13 @@ public class MesProCardSaveReqVO {
@NotNull(message = "生产工单不能为空")
private Long workOrderId;
@Schema(description = "批次号", example = "BATCH-001")
private String batchCode;
@Schema(description = "产品物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
@NotNull(message = "产品物料不能为空")
private Long itemId;
@Schema(description = "批次号", example = "BATCH-001")
private String batchCode;
@Schema(description = "流转数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
@NotNull(message = "流转数量不能为空")
private BigDecimal transferedQuantity;

View File

@ -49,7 +49,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPOR
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
import static cn.iocoder.yudao.framework.common.util.collection.MapUtils.findAndThen;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - MES 生产报工")
@RestController
@ -158,7 +158,7 @@ public class MesProFeedbackController {
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('mes:pro-feedback:approve')")
public CommonResult<Boolean> approveFeedback(@RequestParam("id") Long id) {
return success(feedbackService.approveFeedback(id, getLoginUserId()));
return success(feedbackService.approveFeedback(id));
}
// ==================== 拼接 VO ====================

View File

@ -39,12 +39,13 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProcessDO;
import cn.iocoder.yudao.module.mes.service.pro.route.MesProRouteProcessService;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -59,24 +60,20 @@ public class MesProTaskController {
@Resource
private MesProTaskService taskService;
@Resource
private MesProWorkOrderService workOrderService;
@Resource
private MesMdWorkstationService workstationService;
@Resource
private MesProProcessService processService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdClientService clientService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private MesProRouteProcessService routeProcessService;
@PostMapping("/create")
@Operation(summary = "创建生产任务")
@ -122,18 +119,6 @@ public class MesProTaskController {
return success(new PageResult<>(buildTaskRespVOList(pageResult.getList()), pageResult.getTotal()));
}
@GetMapping("/simple-list")
@Operation(summary = "获得生产任务精简列表", description = "主要用于前端的下拉选项")
public CommonResult<List<MesProTaskRespVO>> getTaskSimpleList(
@RequestParam(value = "workOrderId", required = false) Long workOrderId) {
List<MesProTaskDO> list = taskService.getTaskListByWorkOrderId(workOrderId);
return success(convertList(list, task -> new MesProTaskRespVO()
.setId(task.getId()).setCode(task.getCode()).setName(task.getName())
.setWorkOrderId(task.getWorkOrderId()).setWorkstationId(task.getWorkstationId())
.setRouteId(task.getRouteId()).setProcessId(task.getProcessId())
.setItemId(task.getItemId()).setStatus(task.getStatus())));
}
@GetMapping("/gantt-list")
@Operation(summary = "获得甘特图任务列表", description = "后端组装工单=project + 任务=task 列表")
@PreAuthorize("@ss.hasPermission('mes:pro-task:query')")
@ -229,11 +214,24 @@ public class MesProTaskController {
Map<Long, MesMdWorkstationDO> workstationMap = workstationService.getWorkstationMap(
convertSet(list, MesProTaskDO::getWorkstationId));
Map<Long, MesProProcessDO> processMap = processService.getProcessMap(
new java.util.ArrayList<>(convertSet(list, MesProTaskDO::getProcessId)));
new ArrayList<>(convertSet(list, MesProTaskDO::getProcessId)));
Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(
convertSet(list, MesProTaskDO::getItemId));
Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap(
convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId));
Map<Long, MesMdClientDO> clientMap = clientService.getClientMap(
convertSet(list, MesProTaskDO::getClientId));
// 工序的 checkFlag批量查询后构建 routeId -> processId -> checkFlag 的双层 Map
Set<Long> routeIds = convertSet(list, MesProTaskDO::getRouteId);
Map<Long, Map<Long, Boolean>> routeProcessCheckFlagMap = new HashMap<>();
if (CollUtil.isNotEmpty(routeIds)) {
List<MesProRouteProcessDO> allRouteProcesses = routeProcessService.getRouteProcessListByRouteIds(routeIds);
for (MesProRouteProcessDO rp : allRouteProcesses) {
routeProcessCheckFlagMap
.computeIfAbsent(rp.getRouteId(), k -> new HashMap<>())
.put(rp.getProcessId(), Boolean.TRUE.equals(rp.getCheckFlag()));
}
}
// 拼接 VO
return convertList(list, task -> {
MesProTaskRespVO vo = BeanUtils.toBean(task, MesProTaskRespVO.class);
@ -243,10 +241,15 @@ public class MesProTaskController {
vo.setWorkstationCode(ws.getCode()).setWorkstationName(ws.getName()));
findAndThen(processMap, task.getProcessId(), p ->
vo.setProcessName(p.getName()));
findAndThen(itemMap, task.getItemId(), item ->
vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpec(item.getSpecification()));
findAndThen(itemMap, task.getItemId(), item -> {
vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification());
findAndThen(unitMeasureMap, item.getUnitMeasureId(), unit ->
vo.setUnitMeasureName(unit.getName()));
});
findAndThen(clientMap, task.getClientId(), c ->
vo.setClientName(c.getName()));
findAndThen(routeProcessCheckFlagMap, task.getRouteId(), processCheckMap ->
findAndThen(processCheckMap, task.getProcessId(), vo::setCheckFlag));
return vo;
});
}

View File

@ -40,10 +40,8 @@ public class MesProTaskIssueController {
@Resource
private MesProTaskIssueService taskIssueService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@ -115,7 +113,7 @@ public class MesProTaskIssueController {
return cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList(list, issue -> {
MesProTaskIssueRespVO vo = BeanUtils.toBean(issue, MesProTaskIssueRespVO.class);
findAndThen(itemMap, issue.getItemId(), item ->
vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpec(item.getSpecification()));
vo.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification()));
findAndThen(unitMap, issue.getUnitMeasureId(), unit ->
vo.setUnitMeasureName(unit.getName()));
return vo;

View File

@ -22,21 +22,21 @@ public class MesProTaskIssueRespVO {
@Schema(description = "工作站编号", example = "1")
private Long workstationId;
@Schema(description = "来源单据类型", example = "MATERIAL_ISSUE")
private String sourceDocType;
@Schema(description = "来源单据编号", example = "1")
private Long sourceDocId;
@Schema(description = "来源单据行编号", example = "1")
private Long sourceLineId;
@Schema(description = "来源单据编码", example = "DOC-001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "MATERIAL_ISSUE")
private String sourceDocType;
@Schema(description = "投料批次", example = "BATCH-001")
private String batchCode;
@Schema(description = "来源单据行编号", example = "1")
private Long sourceLineId;
@Schema(description = "产品物料编号", example = "100")
private Long itemId;
@ -47,7 +47,7 @@ public class MesProTaskIssueRespVO {
private String itemName;
@Schema(description = "规格型号", example = "100x200mm")
private String itemSpec;
private String itemSpecification;
@Schema(description = "单位编号", example = "1")
private Long unitMeasureId;

View File

@ -23,22 +23,22 @@ public class MesProTaskIssueSaveReqVO {
@Schema(description = "工作站编号", example = "1")
private Long workstationId;
@Schema(description = "来源单据类型", example = "MATERIAL_ISSUE")
private String sourceDocType;
@Schema(description = "来源单据编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "来源单据编号不能为空")
private Long sourceDocId;
@Schema(description = "来源单据行编号", example = "1")
private Long sourceLineId;
@Schema(description = "来源单据编码", example = "DOC-001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "MATERIAL_ISSUE")
private String sourceDocType;
@Schema(description = "投料批次", example = "BATCH-001")
private String batchCode;
@Schema(description = "来源单据行编号", example = "1")
private Long sourceLineId;
@Schema(description = "产品物料编号", example = "100")
private Long itemId;

View File

@ -8,6 +8,7 @@ import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -38,6 +39,12 @@ public class MesProTaskPageReqVO extends PageParam {
@Schema(description = "任务状态", example = "0")
private Integer status;
@Schema(description = "任务状态列表IN 查询)", example = "[0, 1, 2]")
private List<Integer> statuses;
@Schema(description = "是否质检(关联工艺路线工序)", example = "true")
private Boolean checkFlag;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;

View File

@ -56,7 +56,10 @@ public class MesProTaskRespVO {
private String itemName;
@Schema(description = "规格型号", example = "100x200mm")
private String itemSpec;
private String itemSpecification;
@Schema(description = "计量单位名称", example = "个")
private String unitMeasureName;
@Schema(description = "排产数量", example = "100.00")
private BigDecimal quantity;
@ -103,6 +106,9 @@ public class MesProTaskRespVO {
@Schema(description = "任务状态", example = "0")
private Integer status;
@Schema(description = "是否质检(派生自工艺路线工序 checkFlag", example = "true")
private Boolean checkFlag;
@Schema(description = "备注", example = "备注")
private String remark;

View File

@ -43,16 +43,12 @@ public class MesProWorkOrderBomController {
@Resource
private MesProWorkOrderBomService workOrderBomService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private MesMdItemTypeService itemTypeService;
@Resource
private MesMdProductBomService productBomService;
@ -122,6 +118,8 @@ public class MesProWorkOrderBomController {
Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(leafItems.keySet());
Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap(
convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId));
Map<Long, MesMdItemTypeDO> itemTypeMap = itemTypeService.getItemTypeMap(
convertSet(itemMap.values(), MesMdItemDO::getItemTypeId));
List<MesProWorkOrderItemRespVO> result = new ArrayList<>(leafItems.size());
for (Map.Entry<Long, BigDecimal> entry : leafItems.entrySet()) {
MesMdItemDO item = itemMap.get(entry.getKey());
@ -130,9 +128,11 @@ public class MesProWorkOrderBomController {
}
MesProWorkOrderItemRespVO vo = new MesProWorkOrderItemRespVO()
.setItemId(item.getId()).setQuantity(entry.getValue())
.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpec(item.getSpecification());
.setItemCode(item.getCode()).setItemName(item.getName()).setItemSpecification(item.getSpecification());
MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(),
unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName()));
MapUtils.findAndThen(itemTypeMap, item.getItemTypeId(),
itemType -> vo.setItemOrProduct(itemType.getItemOrProduct()));
result.add(vo);
}
return success(result);
@ -155,7 +155,7 @@ public class MesProWorkOrderBomController {
return BeanUtils.toBean(list, MesProWorkOrderBomRespVO.class, vo -> {
MapUtils.findAndThen(itemMap, vo.getItemId(), item -> {
vo.setItemName(item.getName()).setItemCode(item.getCode())
.setItemSpec(item.getSpecification());
.setItemSpecification(item.getSpecification());
MapUtils.findAndThen(itemTypeMap, item.getItemTypeId(),
itemType -> vo.setItemOrProduct(itemType.getItemOrProduct()));
MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(),

View File

@ -47,16 +47,12 @@ public class MesProWorkOrderController {
@Resource
private MesProWorkOrderService workOrderService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdClientService clientService;
@Resource
private MesMdVendorService vendorService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@ -165,7 +161,7 @@ public class MesProWorkOrderController {
return BeanUtils.toBean(list, MesProWorkOrderRespVO.class, vo -> {
MapUtils.findAndThen(itemMap, vo.getProductId(), item -> {
vo.setProductName(item.getName()).setProductCode(item.getCode())
.setProductSpec(item.getSpecification());
.setProductSpecification(item.getSpecification());
MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(),
unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName()));
});

View File

@ -19,7 +19,7 @@ public class MesProWorkOrderItemRespVO {
private String itemName;
@Schema(description = "规格型号", example = "0603")
private String itemSpec;
private String itemSpecification;
@Schema(description = "单位名称", example = "个")
private String unitMeasureName;
@ -27,4 +27,7 @@ public class MesProWorkOrderItemRespVO {
@Schema(description = "需求数量", example = "1000.00")
private BigDecimal quantity;
@Schema(description = "物料/产品标识", example = "ITEM")
private String itemOrProduct;
}

View File

@ -35,6 +35,9 @@ public class MesProWorkOrderPageReqVO extends PageParam {
@Schema(description = "客户编号", example = "300")
private Long clientId;
@Schema(description = "工单状态", example = "1")
private Integer status;
@Schema(description = "需求日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] requestDate;

View File

@ -55,7 +55,7 @@ public class MesProWorkOrderRespVO {
@Schema(description = "规格型号", example = "100x200mm")
@ExcelProperty("规格型号")
private String productSpec;
private String productSpecification;
@Schema(description = "单位名称", example = "个")
@ExcelProperty("单位")

View File

@ -33,7 +33,7 @@ public class MesProWorkOrderBomRespVO {
@Schema(description = "规格型号", example = "10K 0603")
@ExcelProperty("规格型号")
private String itemSpec;
private String itemSpecification;
@Schema(description = "单位编号", example = "300")
private Long unitMeasureId;

View File

@ -18,8 +18,8 @@ public class MesQcDefectPageReqVO extends PageParam {
@Schema(description = "缺陷描述", example = "外观缺陷")
private String name;
@Schema(description = "检测项类型", example = "APPEARANCE")
private String type;
@Schema(description = "检测项类型", example = "2")
private Integer type;
@Schema(description = "缺陷等级", example = "1")
private Integer level;

View File

@ -27,10 +27,10 @@ public class MesQcDefectRespVO {
@ExcelProperty("缺陷描述")
private String name;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "APPEARANCE")
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty(value = "检测项类型", converter = DictConvert.class)
@DictFormat(DictTypeConstants.MES_DEFECT_TYPE)
private String type;
private Integer type;
@Schema(description = "缺陷等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "缺陷等级", converter = DictConvert.class)

View File

@ -22,9 +22,9 @@ public class MesQcDefectSaveReqVO {
@NotEmpty(message = "缺陷描述不能为空")
private String name;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "APPEARANCE")
@NotEmpty(message = "检测项类型不能为空")
private String type;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "检测项类型不能为空")
private Integer type;
@Schema(description = "缺陷等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "缺陷等级不能为空")
@ -34,4 +34,4 @@ public class MesQcDefectSaveReqVO {
@Schema(description = "备注", example = "备注")
private String remark;
}
}

View File

@ -46,7 +46,7 @@ public class MesQcDefectRecordController {
@DeleteMapping("/delete")
@Operation(summary = "删除质检缺陷记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('mes:qc-defect:update')")
@PreAuthorize("@ss.hasPermission('mes:qc-defect:delete')")
public CommonResult<Boolean> deleteDefectRecord(@RequestParam("id") Long id) {
defectRecordService.deleteDefectRecord(id);
return success(true);

View File

@ -77,13 +77,6 @@ public class MesQcIndicatorController {
return success(BeanUtils.toBean(pageResult, MesQcIndicatorRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得质检指标精简列表", description = "主要用于前端的下拉选项")
public CommonResult<List<MesQcIndicatorRespVO>> getIndicatorSimpleList() {
List<MesQcIndicatorDO> list = indicatorService.getIndicatorList();
return success(BeanUtils.toBean(list, MesQcIndicatorRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出质检指标 Excel")
@PreAuthorize("@ss.hasPermission('mes:qc-indicator:export')")

View File

@ -18,8 +18,8 @@ public class MesQcIndicatorPageReqVO extends PageParam {
@Schema(description = "检测项名称", example = "长度")
private String name;
@Schema(description = "检测项类型", example = "SIZE")
private String type;
@Schema(description = "检测项类型", example = "1")
private Integer type;
@Schema(description = "结果值类型", example = "1")
private Integer resultType;

View File

@ -27,10 +27,10 @@ public class MesQcIndicatorRespVO {
@ExcelProperty("检测项名称")
private String name;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "SIZE")
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "检测项类型", converter = DictConvert.class)
@DictFormat(DictTypeConstants.MES_INDICATOR_TYPE)
private String type;
private Integer type;
@Schema(description = "检测工具", example = "卡尺")
@ExcelProperty("检测工具")

View File

@ -20,9 +20,9 @@ public class MesQcIndicatorSaveReqVO {
@NotEmpty(message = "检测项名称不能为空")
private String name;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "SIZE")
@NotEmpty(message = "检测项类型不能为空")
private String type;
@Schema(description = "检测项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "检测项类型不能为空")
private Integer type;
@Schema(description = "检测工具", example = "卡尺")
private String tool;

View File

@ -34,12 +34,12 @@ public class MesQcIpqcRespVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "304")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;

View File

@ -27,8 +27,8 @@ public class MesQcIpqcLineRespVO {
@Schema(description = "检测指标名称", example = "外观")
private String indicatorName;
@Schema(description = "检测指标类型", example = "QUANTITATIVE")
private String indicatorType;
@Schema(description = "检测指标类型", example = "1")
private Integer indicatorType;
@Schema(description = "检测工具", example = "卡尺")
private String tool;

View File

@ -30,12 +30,12 @@ public class MesQcIqcRespVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "100")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;

View File

@ -27,8 +27,8 @@ public class MesQcIqcLineRespVO {
@Schema(description = "检测指标名称", example = "外观")
private String indicatorName;
@Schema(description = "检测指标类型", example = "QUANTITATIVE")
private String indicatorType;
@Schema(description = "检测指标类型", example = "1")
private Integer indicatorType;
@Schema(description = "检测工具", example = "卡尺")
private String tool;

View File

@ -30,12 +30,12 @@ public class MesQcOqcRespVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "118")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;
@ -51,12 +51,12 @@ public class MesQcOqcRespVO {
@ExcelProperty("客户简称")
private String clientNickname;
// ========== 物料 ==========
@Schema(description = "批次号", example = "BC20250101")
@ExcelProperty("批次号")
private String batchCode;
// ========== 物料 ==========
@Schema(description = "产品物料 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
private Long itemId;

View File

@ -26,12 +26,12 @@ public class MesQcOqcSaveReqVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "118")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;
@ -41,11 +41,11 @@ public class MesQcOqcSaveReqVO {
@NotNull(message = "客户不能为空")
private Long clientId;
// ========== 物料 ==========
@Schema(description = "批次号", example = "BC20250101")
private String batchCode;
// ========== 物料 ==========
@Schema(description = "产品物料 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
@NotNull(message = "产品物料不能为空")
private Long itemId;
@ -74,9 +74,8 @@ public class MesQcOqcSaveReqVO {
// ========== 检验 ==========
@Schema(description = "检测人员用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "检测人员不能为空")
private Long inspectorUserId;
@Schema(description = "检测结果", example = "1")
private Integer checkResult;
@Schema(description = "出货日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "出货日期不能为空")
@ -86,8 +85,9 @@ public class MesQcOqcSaveReqVO {
@NotNull(message = "检测日期不能为空")
private LocalDateTime inspectDate;
@Schema(description = "检测结果", example = "1")
private Integer checkResult;
@Schema(description = "检测人员用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "检测人员不能为空")
private Long inspectorUserId;
@Schema(description = "备注", example = "备注")
private String remark;

View File

@ -27,8 +27,8 @@ public class MesQcOqcLineRespVO {
@Schema(description = "检测指标名称", example = "外观")
private String indicatorName;
@Schema(description = "检测指标类型", example = "QUANTITATIVE")
private String indicatorType;
@Schema(description = "检测指标类型", example = "1")
private Integer indicatorType;
@Schema(description = "检测工具", example = "卡尺")
private String tool;

View File

@ -10,17 +10,16 @@ import java.time.LocalDateTime;
@Data
public class MesQcPendingInspectRespVO {
@Schema(description = "来源单据 ID", example = "100")
private Long sourceDocId;
@Schema(description = "来源单据类型MesBizTypeConstants", example = "100")
private Integer sourceDocType;
@Schema(description = "来源单据编号", example = "AN2025001")
private String sourceDocCode;
@Schema(description = "来源单据 ID", example = "100")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "200")
private Long sourceLineId;
@Schema(description = "来源单据编号", example = "AN2025001")
private String sourceDocCode;
@Schema(description = "检验类型MesQcTypeEnum", example = "1")
private Integer qcType;

View File

@ -30,12 +30,12 @@ public class MesQcRqcRespVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "116")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;
@ -85,6 +85,26 @@ public class MesQcRqcRespVO {
@ExcelProperty("不合格数量")
private BigDecimal unqualifiedQuantity;
// ========== 缺陷统计 ==========
@Schema(description = "致命缺陷率(%", example = "5.00")
private BigDecimal criticalRate;
@Schema(description = "严重缺陷率(%", example = "10.00")
private BigDecimal majorRate;
@Schema(description = "轻微缺陷率(%", example = "15.00")
private BigDecimal minorRate;
@Schema(description = "致命缺陷数量", example = "5")
private Integer criticalQuantity;
@Schema(description = "严重缺陷数量", example = "10")
private Integer majorQuantity;
@Schema(description = "轻微缺陷数量", example = "15")
private Integer minorQuantity;
// ========== 检验 ==========
@Schema(description = "检测结果", example = "1")
@ -110,26 +130,6 @@ public class MesQcRqcRespVO {
@ExcelProperty("备注")
private String remark;
// ========== 缺陷统计 ==========
@Schema(description = "致命缺陷数量", example = "5")
private Integer criticalQuantity;
@Schema(description = "严重缺陷数量", example = "10")
private Integer majorQuantity;
@Schema(description = "轻微缺陷数量", example = "15")
private Integer minorQuantity;
@Schema(description = "致命缺陷率(%", example = "5.00")
private BigDecimal criticalRate;
@Schema(description = "严重缺陷率(%", example = "10.00")
private BigDecimal majorRate;
@Schema(description = "轻微缺陷率(%", example = "15.00")
private BigDecimal minorRate;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;

View File

@ -32,12 +32,12 @@ public class MesQcRqcSaveReqVO {
// ========== 来源单据 ==========
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据类型", example = "116")
private Integer sourceDocType;
@Schema(description = "来源单据 ID", example = "200")
private Long sourceDocId;
@Schema(description = "来源单据行 ID", example = "300")
private Long sourceLineId;

View File

@ -27,8 +27,8 @@ public class MesQcRqcLineRespVO {
@Schema(description = "检测指标名称", example = "外观")
private String indicatorName;
@Schema(description = "检测指标类型", example = "QUANTITATIVE")
private String indicatorType;
@Schema(description = "检测指标类型", example = "1")
private Integer indicatorType;
@Schema(description = "检测工具", example = "卡尺")
private String tool;

View File

@ -77,13 +77,6 @@ public class MesQcTemplateController {
return success(BeanUtils.toBean(pageResult, MesQcTemplateRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得质检方案精简列表", description = "主要用于前端的下拉选项")
public CommonResult<List<MesQcTemplateRespVO>> getTemplateSimpleList() {
List<MesQcTemplateDO> list = templateService.getTemplateList();
return success(BeanUtils.toBean(list, MesQcTemplateRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出质检方案 Excel")
@PreAuthorize("@ss.hasPermission('mes:qc-template:export')")

View File

@ -63,9 +63,9 @@ public class MesQcTemplateIndicatorRespVO {
@ExcelProperty("检测项名称")
private String indicatorName;
@Schema(description = "检测项类型(字典 mes_index_type", example = "SIZE")
@Schema(description = "检测项类型", example = "1")
@ExcelProperty("检测项类型")
private String indicatorType;
private Integer indicatorType;
@Schema(description = "检测工具", example = "卡尺")
@ExcelProperty("检测工具")

View File

@ -25,7 +25,7 @@ public class MesTmToolPageReqVO extends PageParam {
private String brand;
@Schema(description = "型号规格", example = "M5-100")
private String spec;
private String specification;
@Schema(description = "状态", example = "1")
private Integer status;

View File

@ -33,7 +33,7 @@ public class MesTmToolRespVO {
@Schema(description = "型号规格", example = "M5-100")
@ExcelProperty("型号规格")
private String spec;
private String specification;
@Schema(description = "工具类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Long toolTypeId;

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.tm.tool.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import java.time.LocalDateTime;
@ -16,17 +17,21 @@ public class MesTmToolSaveReqVO {
@Schema(description = "工具编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "T-001")
@NotEmpty(message = "工具编码不能为空")
@Size(max = 64, message = "工具编码长度不能超过 64 个字符")
private String code;
@Schema(description = "工具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "5mm 铣刀")
@NotEmpty(message = "工具名称不能为空")
@Size(max = 255, message = "工具名称长度不能超过 255 个字符")
private String name;
@Schema(description = "品牌", example = "三菱")
@Size(max = 255, message = "品牌长度不能超过 255 个字符")
private String brand;
@Schema(description = "型号规格", example = "M5-100")
private String spec;
@Size(max = 255, message = "型号规格长度不能超过 255 个字符")
private String specification;
@Schema(description = "工具类型编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
@NotNull(message = "工具类型不能为空")
@ -36,7 +41,8 @@ public class MesTmToolSaveReqVO {
@NotNull(message = "数量不能为空")
private Integer quantity;
@Schema(description = "可用数量", example = "1")
@Schema(description = "可用数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "可用数量不能为空")
private Integer availableQuantity;
@Schema(description = "保养维护类型", example = "1")
@ -53,6 +59,7 @@ public class MesTmToolSaveReqVO {
private Integer status;
@Schema(description = "备注", example = "备注")
@Size(max = 500, message = "备注长度不能超过 500 个字符")
private String remark;
}
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.tm.tool.vo.type;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
@Schema(description = "管理后台 - MES 工具类型新增/修改 Request VO")
@ -14,10 +15,12 @@ public class MesTmToolTypeSaveReqVO {
@Schema(description = "类型编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "TT-001")
@NotEmpty(message = "类型编码不能为空")
@Size(max = 64, message = "类型编码长度不能超过 64 个字符")
private String code;
@Schema(description = "类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "铣刀")
@NotEmpty(message = "类型名称不能为空")
@Size(max = 255, message = "类型名称长度不能超过 255 个字符")
private String name;
@Schema(description = "是否编码管理", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@ -31,6 +34,7 @@ public class MesTmToolTypeSaveReqVO {
private Integer maintenPeriod;
@Schema(description = "备注", example = "备注")
@Size(max = 500, message = "备注长度不能超过 500 个字符")
private String remark;
}
}

View File

@ -42,7 +42,6 @@ public class MesWmArrivalNoticeController {
@Resource
private MesWmArrivalNoticeService arrivalNoticeService;
@Resource
private MesMdVendorService vendorService;
@ -112,15 +111,6 @@ public class MesWmArrivalNoticeController {
return success(true);
}
@GetMapping("/simple-list")
@Operation(summary = "获得到货通知单精简列表")
@Parameter(name = "status", description = "状态", example = "2")
public CommonResult<List<MesWmArrivalNoticeRespVO>> getArrivalNoticeSimpleList(
@RequestParam(value = "status", required = false) Integer status) {
List<MesWmArrivalNoticeDO> list = arrivalNoticeService.getArrivalNoticeListByStatus(status);
return success(buildRespVOList(list));
}
// ==================== 拼接 VO ====================
private List<MesWmArrivalNoticeRespVO> buildRespVOList(List<MesWmArrivalNoticeDO> list) {

View File

@ -40,13 +40,10 @@ public class MesWmArrivalNoticeLineController {
@Resource
private MesWmArrivalNoticeLineService arrivalNoticeLineService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private MesQcIqcService iqcService;
@ -95,16 +92,6 @@ public class MesWmArrivalNoticeLineController {
return success(new PageResult<>(buildRespVOList(pageResult.getList()), pageResult.getTotal()));
}
@GetMapping("/list-by-notice-id")
@Operation(summary = "获得到货通知单行列表")
@Parameter(name = "noticeId", description = "到货通知单编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')")
public CommonResult<List<MesWmArrivalNoticeLineRespVO>> getArrivalNoticeLineListByNoticeId(
@RequestParam("noticeId") Long noticeId) {
List<MesWmArrivalNoticeLineDO> list = arrivalNoticeLineService.getArrivalNoticeLineListByNoticeId(noticeId);
return success(buildRespVOList(list));
}
// ==================== 拼接 VO ====================
private List<MesWmArrivalNoticeLineRespVO> buildRespVOList(List<MesWmArrivalNoticeLineDO> list) {

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.mes.controller.admin.wm.itemconsume.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -13,6 +14,7 @@ import lombok.ToString;
public class MesWmItemConsumeLinePageReqVO extends PageParam {
@Schema(description = "报工记录编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "报工记录编号不能为空")
private Long feedbackId;
}

View File

@ -10,10 +10,12 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.line.MesWm
import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.line.MesWmItemReceiptLineSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt.MesWmItemReceiptDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt.MesWmItemReceiptLineDO;
import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService;
import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService;
import cn.iocoder.yudao.module.mes.service.wm.itemreceipt.MesWmItemReceiptLineService;
import cn.iocoder.yudao.module.mes.service.wm.itemreceipt.MesWmItemReceiptService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -38,12 +40,12 @@ public class MesWmItemReceiptLineController {
@Resource
private MesWmItemReceiptLineService itemReceiptLineService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private MesWmItemReceiptService itemReceiptService;
@PostMapping("/create")
@Operation(summary = "创建采购入库单行")
@ -101,6 +103,8 @@ public class MesWmItemReceiptLineController {
convertSet(list, MesWmItemReceiptLineDO::getItemId));
Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap(
convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId));
Map<Long, MesWmItemReceiptDO> receiptMap = itemReceiptService.getItemReceiptMap(
convertSet(list, MesWmItemReceiptLineDO::getReceiptId));
// 2. 构建结果
return BeanUtils.toBean(list, MesWmItemReceiptLineRespVO.class, vo -> {
MapUtils.findAndThen(itemMap, vo.getItemId(), item -> {
@ -108,6 +112,8 @@ public class MesWmItemReceiptLineController {
MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(),
unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName()));
});
MapUtils.findAndThen(receiptMap, vo.getReceiptId(), receipt ->
vo.setReceiptCode(receipt.getCode()).setPurchaseOrderCode(receipt.getPurchaseOrderCode()));
});
}

View File

@ -16,6 +16,12 @@ public class MesWmItemReceiptLineRespVO {
@Schema(description = "入库单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long receiptId;
@Schema(description = "入库单编码", example = "IR2026020001")
private String receiptCode;
@Schema(description = "采购订单号", example = "PO20260201")
private String purchaseOrderCode;
@Schema(description = "到货通知单行编号", example = "1")
private Long arrivalNoticeLineId;

View File

@ -52,22 +52,16 @@ public class MesWmMaterialStockController {
@Resource
private MesWmMaterialStockService materialStockService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private MesWmWarehouseService warehouseService;
@Resource
private MesWmWarehouseLocationService locationService;
@Resource
private MesWmWarehouseAreaService areaService;
@Resource
private MesMdVendorService vendorService;
@ -139,8 +133,8 @@ public class MesWmMaterialStockController {
MapUtils.findAndThen(unitMeasureMap, item.getUnitMeasureId(),
unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName()));
});
MapUtils.findAndThen(warehouseMap, vo.getWarehouseId(),
warehouse -> vo.setWarehouseName(warehouse.getName()));
MapUtils.findAndThen(warehouseMap, vo.getWarehouseId(), warehouse ->
vo.setWarehouseCode(warehouse.getCode()).setWarehouseName(warehouse.getName()));
MapUtils.findAndThen(locationMap, vo.getLocationId(),
location -> vo.setLocationName(location.getName()));
MapUtils.findAndThen(areaMap, vo.getAreaId(),

View File

@ -12,6 +12,18 @@ import lombok.ToString;
@ToString(callSuper = true)
public class MesWmMaterialStockPageReqVO extends PageParam {
/**
* -
*/
public static final String VIRTUAL_FILTER_EXCLUDE = "exclude";
/**
* -
*/
public static final String VIRTUAL_FILTER_ONLY = "only";
@Schema(description = "虚拟仓过滤模式", example = "exclude")
private String virtualFilter;
@Schema(description = "物料分类编号", example = "1")
private Long itemTypeId;
@ -21,6 +33,9 @@ public class MesWmMaterialStockPageReqVO extends PageParam {
@Schema(description = "批次号", example = "B20260101")
private String batchCode;
@Schema(description = "批次编号", example = "1")
private Long batchId;
@Schema(description = "仓库编号", example = "1")
private Long warehouseId;

View File

@ -49,6 +49,9 @@ public class MesWmMaterialStockRespVO {
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long warehouseId;
@Schema(description = "仓库编码", example = "WH001")
private String warehouseCode;
@Schema(description = "仓库名称", example = "原料仓")
@ExcelProperty("仓库")
private String warehouseName;

View File

@ -21,15 +21,14 @@ public class MesWmMiscIssueRespVO {
@Schema(description = "杂项类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer type;
@Schema(description = "来源单据类型", example = "PURCHASE_ORDER")
private String sourceDocType;
@Schema(description = "来源单据ID", example = "1")
private Long sourceDocId;
@Schema(description = "来源单据编号", example = "DOC20260302001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "PURCHASE_ORDER")
private String sourceDocType;
@Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime issueDate;

View File

@ -26,15 +26,14 @@ public class MesWmMiscIssueSaveReqVO {
@NotNull(message = "杂项类型不能为空")
private Integer type;
@Schema(description = "来源单据类型", example = "PURCHASE_ORDER")
private String sourceDocType;
@Schema(description = "来源单据ID", example = "1")
private Long sourceDocId;
@Schema(description = "来源单据编号", example = "DOC20260302001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "PURCHASE_ORDER")
private String sourceDocType;
@Schema(description = "出库日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "出库日期不能为空")
private LocalDateTime issueDate;

View File

@ -21,15 +21,14 @@ public class MesWmMiscReceiptRespVO {
@Schema(description = "杂项类型", example = "1")
private Integer type;
@Schema(description = "来源单据类型", example = "WORK_ORDER")
private String sourceDocType;
@Schema(description = "来源单据 ID", example = "1")
private Long sourceDocId;
@Schema(description = "来源单据编码", example = "WO2026030001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "WORK_ORDER")
private String sourceDocType;
@Schema(description = "入库日期")
private LocalDateTime receiptDate;

View File

@ -26,15 +26,14 @@ public class MesWmMiscReceiptSaveReqVO {
@NotNull(message = "杂项类型不能为空")
private Integer type;
@Schema(description = "来源单据类型", example = "WORK_ORDER")
private String sourceDocType;
@Schema(description = "来源单据 ID", example = "1")
private Long sourceDocId;
@Schema(description = "来源单据编码", example = "WO2026030001")
private String sourceDocCode;
@Schema(description = "来源单据类型", example = "WORK_ORDER")
private String sourceDocType;
@Schema(description = "入库日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "入库日期不能为空")
private LocalDateTime receiptDate;

View File

@ -50,6 +50,7 @@ public class MesWmPackageController {
private MesMdClientService clientService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@Resource
private AdminUserApi adminUserApi;
@ -125,20 +126,6 @@ public class MesWmPackageController {
return success(true);
}
@GetMapping("/childable-simple-list")
@Operation(summary = "可添加为子箱的装箱单精简列表")
@PreAuthorize("@ss.hasPermission('mes:wm-package:query')")
public CommonResult<List<MesWmPackageRespVO>> getChildablePackageSimpleList() {
List<MesWmPackageDO> list = packageService.getChildablePackageList();
return success(buildRespVOList(list));
}
@GetMapping("/simple-list")
@Operation(summary = "获得装箱单精简列表", description = "主要用于前端的下拉选项")
public CommonResult<List<MesWmPackageRespVO>> getPackageSimpleList() {
List<MesWmPackageDO> list = packageService.getPackageSimpleList();
return success(buildRespVOList(list));
}
// ========== 私有方法 ==========

View File

@ -32,4 +32,7 @@ public class MesWmPackagePageReqVO extends PageParam {
@Schema(description = "检查员用户 ID", example = "1")
private Long inspectorUserId;
@Schema(description = "单据状态", example = "1")
private Integer status;
}

View File

@ -36,10 +36,10 @@ public class MesWmPackageLineSaveReqVO {
@DecimalMin(value = "0.01", message = "装箱数量必须大于 0")
private BigDecimal quantity;
@Schema(description = "生产工单 ID", example = "1")
@Schema(description = "生产工单 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "生产工单不能为空")
private Long workOrderId;
// DONE @AI时间都是 LocalDateTIme
@Schema(description = "有效期")
private LocalDateTime expireDate;

View File

@ -26,6 +26,9 @@ public class MesWmProductIssueDetailSaveReqVO {
@NotNull(message = "物料编号不能为空")
private Long itemId;
@Schema(description = "库存记录编号", example = "1")
private Long materialStockId;
@Schema(description = "领料数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "300.00")
@NotNull(message = "领料数量不能为空")
@DecimalMin(value = "0", inclusive = false, message = "领料数量必须大于 0")
@ -49,4 +52,4 @@ public class MesWmProductIssueDetailSaveReqVO {
@Schema(description = "备注", example = "备注")
private String remark;
}
}

View File

@ -7,7 +7,7 @@ import lombok.Data;
import java.math.BigDecimal;
@Schema(description = "管理后台 - MES 产品收货单行新增/修改 Request VO")
@Schema(description = "管理后台 - MES 产品入库单行新增/修改 Request VO")
@Data
public class MesWmProductReceiptLineSaveReqVO {

View File

@ -43,7 +43,6 @@ public class MesWmProductSalesController {
@Resource
private MesWmProductSalesService productSalesService;
@Resource
private MesMdClientService clientService;
@Resource
@ -174,7 +173,7 @@ public class MesWmProductSalesController {
MapUtils.findAndThen(clientMap, vo.getClientId(), client ->
vo.setClientName(client.getName()).setClientCode(client.getCode()));
MapUtils.findAndThen(noticeMap, vo.getNoticeId(),
notice -> vo.setNoticeCode(notice.getNoticeCode()));
notice -> vo.setNoticeCode(notice.getCode()));
});
}

View File

@ -16,6 +16,9 @@ public class MesWmProductSalesLineRespVO {
@Schema(description = "出库单ID", example = "1")
private Long salesId;
@Schema(description = "发货通知单行ID", example = "1")
private Long noticeLineId;
@Schema(description = "物料ID", example = "1")
private Long itemId;

View File

@ -17,6 +17,9 @@ public class MesWmProductSalesLineSaveReqVO {
@NotNull(message = "出库单ID不能为空")
private Long salesId;
@Schema(description = "发货通知单行ID", example = "1")
private Long noticeLineId;
@Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "物料不能为空")
private Long itemId;

View File

@ -26,6 +26,9 @@ public class MesWmReturnIssueDetailSaveReqVO {
@NotNull(message = "物料编号不能为空")
private Long itemId;
@Schema(description = "库存记录编号", example = "1")
private Long materialStockId;
@Schema(description = "退料数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "300.00")
@NotNull(message = "退料数量不能为空")
@DecimalMin(value = "0", inclusive = false, message = "退料数量必须大于0")

View File

@ -39,6 +39,9 @@ public class MesWmReturnSalesDetailSaveReqVO {
@Schema(description = "批次ID", example = "1")
private Long batchId;
@Schema(description = "批次号", example = "B20250101")
private String batchCode;
@Schema(description = "仓库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "仓库ID不能为空")
private Long warehouseId;

View File

@ -32,9 +32,12 @@ public class MesWmReturnSalesLineSaveReqVO {
@DecimalMin(value = "0", inclusive = false, message = "退货数量必须大于 0")
private BigDecimal quantity;
@Schema(description = "批次", example = "B20250101")
@Schema(description = "批次ID", example = "1")
private Long batchId;
@Schema(description = "批次号", example = "B20250101")
private String batchCode;
@Schema(description = "是否需要质检", example = "true")
private Boolean rqcCheckFlag;

View File

@ -14,21 +14,20 @@ public class MesWmReturnVendorDetailSaveReqVO {
@Schema(description = "编号", example = "1024")
private Long id;
@Schema(description = "退货单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "退货单编号不能为空")
private Long returnId;
@Schema(description = "退货单行编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "退货单行编号不能为空")
private Long lineId;
@Schema(description = "退货单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "退货单编号不能为空")
private Long returnId;
@Schema(description = "库存记录编号", example = "1")
private Long materialStockId;
@Schema(description = "物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "物料编号不能为空")
private Long itemId;
@Schema(description = "库存记录编号", example = "1")
private Long materialStockId;
@Schema(description = "退货数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "300.00")
@NotNull(message = "退货数量不能为空")
@DecimalMin(value = "0", inclusive = false, message = "退货数量必须大于 0")

View File

@ -42,7 +42,6 @@ public class MesWmSalesNoticeController {
@Resource
private MesWmSalesNoticeService salesNoticeService;
@Resource
private MesMdClientService clientService;
@ -112,15 +111,6 @@ public class MesWmSalesNoticeController {
return success(true);
}
@GetMapping("/simple-list")
@Operation(summary = "获得发货通知单精简列表")
@Parameter(name = "status", description = "状态", example = "1")
public CommonResult<List<MesWmSalesNoticeRespVO>> getSalesNoticeSimpleList(
@RequestParam(value = "status", required = false) Integer status) {
List<MesWmSalesNoticeDO> list = salesNoticeService.getSalesNoticeListByStatus(status);
return success(buildRespVOList(list));
}
// ==================== 拼接 VO ====================
private List<MesWmSalesNoticeRespVO> buildRespVOList(List<MesWmSalesNoticeDO> list) {

View File

@ -13,10 +13,10 @@ import lombok.ToString;
public class MesWmSalesNoticePageReqVO extends PageParam {
@Schema(description = "通知单编码", example = "SN202603010001")
private String noticeCode;
private String code;
@Schema(description = "通知单名称", example = "测试发货通知")
private String noticeName;
private String name;
@Schema(description = "销售订单编号", example = "SO202603010001")
private String salesOrderCode;
@ -24,4 +24,7 @@ public class MesWmSalesNoticePageReqVO extends PageParam {
@Schema(description = "客户编号", example = "1")
private Long clientId;
@Schema(description = "状态", example = "3")
private Integer status;
}

View File

@ -18,11 +18,11 @@ public class MesWmSalesNoticeRespVO {
@Schema(description = "通知单编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "SN202603010001")
@ExcelProperty("通知单编码")
private String noticeCode;
private String code;
@Schema(description = "通知单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试发货通知")
@ExcelProperty("通知单名称")
private String noticeName;
private String name;
@Schema(description = "销售订单编号", example = "SO202603010001")
@ExcelProperty("销售订单编号")

View File

@ -16,11 +16,11 @@ public class MesWmSalesNoticeSaveReqVO {
@Schema(description = "通知单编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "SN202603010001")
@NotEmpty(message = "通知单编码不能为空")
private String noticeCode;
private String code;
@Schema(description = "通知单名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试发货通知")
@NotEmpty(message = "通知单名称不能为空")
private String noticeName;
private String name;
@Schema(description = "销售订单编号", example = "SO202603010001")
private String salesOrderCode;

View File

@ -13,7 +13,9 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnGroupRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnPageReqVO;
import cn.iocoder.yudao.module.mes.controller.admin.wm.sn.vo.MesWmSnRespVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO;
import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService;
import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService;
import cn.iocoder.yudao.module.mes.service.wm.sn.MesWmSnService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -44,6 +46,8 @@ public class MesWmSnController {
private MesWmSnService snService;
@Resource
private MesMdItemService itemService;
@Resource
private MesMdUnitMeasureService unitMeasureService;
@PostMapping("/generate")
@Operation(summary = "生成 SN 码")
@ -103,8 +107,12 @@ public class MesWmSnController {
return;
}
Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(convertSet(list, MesWmSnGroupRespVO::getItemId));
list.forEach(vo -> MapUtils.findAndThen(itemMap, vo.getItemId(), item ->
vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification())));
Map<Long, MesMdUnitMeasureDO> unitMap = unitMeasureService.getUnitMeasureMap(
convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId));
list.forEach(vo -> MapUtils.findAndThen(itemMap, vo.getItemId(), item -> {
vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification());
MapUtils.findAndThen(unitMap, item.getUnitMeasureId(), unit -> vo.setUnitName(unit.getName()));
}));
}
private void buildItemInfo(List<MesWmSnRespVO> list) {
@ -112,8 +120,12 @@ public class MesWmSnController {
return;
}
Map<Long, MesMdItemDO> itemMap = itemService.getItemMap(convertSet(list, MesWmSnRespVO::getItemId));
list.forEach(vo -> MapUtils.findAndThen(itemMap, vo.getItemId(), item ->
vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification())));
Map<Long, MesMdUnitMeasureDO> unitMap = unitMeasureService.getUnitMeasureMap(
convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId));
list.forEach(vo -> MapUtils.findAndThen(itemMap, vo.getItemId(), item -> {
vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification());
MapUtils.findAndThen(unitMap, item.getUnitMeasureId(), unit -> vo.setUnitName(unit.getName()));
}));
}
}

View File

@ -34,6 +34,10 @@ public class MesWmSnGroupRespVO {
@ExcelProperty("规格型号")
private String specification;
@Schema(description = "单位", example = "个")
@ExcelProperty("单位")
private String unitName;
@Schema(description = "批次号", example = "BATCH001")
@ExcelProperty("批次号")
private String batchCode;

View File

@ -37,6 +37,10 @@ public class MesWmSnRespVO {
@ExcelProperty("规格型号")
private String specification;
@Schema(description = "单位", example = "个")
@ExcelProperty("单位")
private String unitName;
@Schema(description = "批次号", example = "BATCH001")
@ExcelProperty("批次号")
private String batchCode;

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.mes.controller.admin.wm.stocktaking.plan;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -24,7 +23,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -104,13 +102,4 @@ public class MesWmStockTakingPlanController {
BeanUtils.toBean(pageResult.getList(), MesWmStockTakingPlanRespVO.class));
}
@GetMapping("/simple-list")
@Operation(summary = "获得已启用的盘点方案精简列表")
@PreAuthorize("@ss.hasPermission('mes:wm-stock-taking-task:query')")
public CommonResult<List<MesWmStockTakingPlanRespVO>> getEnabledStockTakingPlanSimpleList() {
List<MesWmStockTakingPlanDO> list = stockTakingPlanService.getStockTakingPlanListByStatus(
CommonStatusEnum.ENABLE.getStatus());
return success(BeanUtils.toBean(list, MesWmStockTakingPlanRespVO.class));
}
}

View File

@ -19,4 +19,7 @@ public class MesWmStockTakingPlanPageReqVO extends PageParam {
@Schema(description = "盘点类型", example = "1")
private Integer type;
@Schema(description = "状态", example = "0")
private Integer status;
}

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