diff --git a/doc/设计文档/数据库设计/mes-md.sql b/doc/设计文档/数据库设计/mes-md.sql index 579fcfd..f978630 100644 --- a/doc/设计文档/数据库设计/mes-md.sql +++ b/doc/设计文档/数据库设计/mes-md.sql @@ -18,6 +18,7 @@ create table md_item ( min_stock double(12,4) default 0 comment '最低库存量', max_stock double(12,4) default 0 comment '最大库存量', high_value char(1) default 'N' not null comment '高价值物资', + batch_flag char(1) default 'Y' not null comment '批次管理', remark varchar(500) default '' comment '备注', attr1 varchar(64) default null comment '预留字段1', attr2 varchar(255) default null comment '预留字段2', @@ -82,6 +83,40 @@ create table md_product_bom ( primary key (bom_id) ) engine=innodb auto_increment=200 comment = '产品BOM关系表'; +-- ---------------------------- +-- 3、物料批次属性配置表 +-- ---------------------------- +drop table if exists md_item_batch_config; +create table md_item_batch_config ( + config_id bigint(20) not null auto_increment comment '批次ID', + item_id bigint(20) not null comment '产品物料ID', + produce_date_flag char(1) comment '生产日期', + expire_date_flag char(1) comment '有效期', + recpt_date_flag char(1) comment '入库日期', + vendor_flag char(1) comment '供应商', + client_flag char(1) comment '客户', + co_code_flag char(1) comment '销售订单编号', + po_code_flag char(1) comment '采购订单编号', + workorder_flag char(1) comment '生产工单', + task_flag char(1) comment '生产任务', + workstation_flag char(1) comment '工作站', + tool_flag char(1) comment '工具', + mold_flag char(1) comment '模具', + product_code_flag char(1) comment '生产批号', + quality_status_flag char(1) comment '质量状态', + enable_flag char(1) comment '生效状态', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (config_id) +) engine=innodb auto_increment=200 comment = '物料批次属性配置表'; + -- ---------------------------- -- 4、供应商表 diff --git a/doc/设计文档/数据库设计/mes-pro.sql b/doc/设计文档/数据库设计/mes-pro.sql index bf7e31b..09f566c 100644 --- a/doc/设计文档/数据库设计/mes-pro.sql +++ b/doc/设计文档/数据库设计/mes-pro.sql @@ -570,3 +570,73 @@ create table pro_shutdown_record ( ) engine=innodb auto_increment=200 comment = '停机记录记录'; +-- ---------------------------- +-- 4、工序流转卡表 +-- ---------------------------- +drop table if exists pro_card; +create table pro_card ( + card_id bigint(20) not null auto_increment comment '流转卡ID', + card_code varchar(64) comment '流转卡编号', + workorder_id bigint(20) comment '生产工单ID', + workorder_code varchar(64) comment '生产工单编号', + workorder_name varchar(255) comment '生产工单名称', + batch_code varchar(64) comment '批次号', + item_id bigint(20) comment '产品物料ID', + item_code varchar(64) not null comment '产品物料编码', + item_name varchar(255) not null comment '产品物料名称', + specification varchar(500) default null comment '规格型号', + unit_of_measure varchar(64) not null comment '单位', + barcode_url varchar(255) comment '赋码地址', + quantity_transfered double(12,2) comment '流转数量', + status varchar(64) comment '流转卡状态', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (card_id) +) engine=innodb auto_increment=200 comment = '流转卡表'; + + + +-- ---------------------------- +-- 4、工序流转卡-工序信息表 +-- ---------------------------- +drop table if exists pro_card_process; +create table pro_card_process ( + record_id bigint(20) not null auto_increment comment '流水ID', + card_id bigint(20) not null comment '流转卡ID', + card_code varchar(64) comment '流转卡编号', + seq_num int(11) default 1 comment '序号', + process_id bigint(20) comment '工序ID', + process_code varchar(64) comment '工序编号', + process_name varchar(255) comment '工序名称', + input_time datetime comment '进入工序时间', + output_time datetime comment '出工序时间', + quantity_input double(12,2) comment '投入数量', + quantity_output double(12,2) comment '产出数量', + quantity_unquanlify double(12,2) comment '不合格品数量', + workstation_id bigint(20) not null comment '工作站ID', + workstation_code varchar(64) comment '工作站编号', + workstation_name varchar(125) comment '工作站名称', + user_id bigint(20) not null comment '用户ID', + user_name varchar(64) comment '用户名', + nick_name varchar(125) comment '名称', + ipqc_id bigint(20) comment '过程检验单ID', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (record_id) +) engine=innodb auto_increment=200 comment = '工序流转卡-工序信息表'; + + diff --git a/doc/设计文档/数据库设计/mes-qc.sql b/doc/设计文档/数据库设计/mes-qc.sql index e483340..4016822 100644 --- a/doc/设计文档/数据库设计/mes-qc.sql +++ b/doc/设计文档/数据库设计/mes-qc.sql @@ -116,6 +116,7 @@ create table qc_defect ( defect_name varchar(500) not null comment '缺陷描述', index_type varchar(64) not null comment '检测项类型', defect_level varchar(64) not null comment '缺陷等级', + process_method varchar(500) comment '处置方法', remark varchar(500) default '' comment '备注', attr1 varchar(64) default null comment '预留字段1', attr2 varchar(255) default null comment '预留字段2', @@ -156,7 +157,8 @@ create table qc_iqc ( quantity_min_check int(11) default 1 comment '最低检测数', quantity_max_unqualified int(11) default 0 comment '最大不合格数', quantity_recived double(12,2) not null comment '本次接收数量', - quantity_check int(11) not null comment '本次检测数量', + quantity_check int(11) comment '本次检测数量', + quantity_qualified int(11) default 0 comment '合格数', quantity_unqualified int(11) default 0 comment '不合格数', cr_rate double(12,2) default 0 comment '致命缺陷率', maj_rate double(12,2) default 0 comment '严重缺陷率', diff --git a/doc/设计文档/数据库设计/mes-wm.sql b/doc/设计文档/数据库设计/mes-wm.sql index 6467553..b7ac3c2 100644 --- a/doc/设计文档/数据库设计/mes-wm.sql +++ b/doc/设计文档/数据库设计/mes-wm.sql @@ -169,6 +169,7 @@ create table wm_material_stock ( package_code varchar(64) comment '容器编号', quantity_onhand double(12,2) comment '在库数量', quantity_reserved double(12,2) comment '保留数量', + production_date datetime comment '生产日期', recpt_date datetime comment '入库时间', expire_date datetime comment '库存有效期', frozen_flag char(1) default 'N' not null comment '是否冻结', @@ -184,6 +185,66 @@ create table wm_material_stock ( ) engine=innodb auto_increment=200 comment = '库存记录表'; +-- ---------------------------- +-- 6、到货通知单 +-- ---------------------------- +drop table if exists wm_arrival_notice; +create table wm_arrival_notice ( + notice_id bigint(20) not null auto_increment comment '通知单ID', + notice_code varchar(64) not null comment '通知单编号', + notice_name varchar(255) not null comment '通知单名称', + po_code varchar(64) comment '采购订单编号', + vendor_id bigint(20) comment '供应商ID', + vendor_code varchar(64) comment '供应商编码', + vendor_name varchar(255) comment '供应商名称', + vendor_nick varchar(255) comment '供应商简称', + arrival_date datetime comment '到货日期', + contact varchar(64) comment '联系人', + tel varchar(128) comment '联系方式', + status varchar(64) default 'PREPARE' comment '单据状态', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (notice_id) +) engine=innodb auto_increment=200 comment = '到货通知单表'; + + +-- ---------------------------- +-- 7、到货通知单行表 +-- ---------------------------- +drop table if exists wm_arrival_notice_line; +create table wm_arrival_notice_line ( + line_id bigint(20) not null auto_increment comment '行ID', + notice_id bigint(20) comment '通知单ID', + item_id bigint(20) not null comment '产品物料ID', + item_code varchar(64) comment '产品物料编码', + item_name varchar(255) comment '产品物料名称', + specification varchar(500) comment '规格型号', + unit_of_measure varchar(64) comment '单位', + quantity_arrival double(12,2) not null comment '到货数量', + quantity_quanlified double(12,2) comment '合格数量', + iqc_check char(1) comment '是否来料检验', + iqc_id bigint(20) comment '来料检验单ID', + iqc_code varchar(64) comment '来料检验单编号', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (line_id) +) engine=innodb auto_increment=200 comment = '到货通知单行表'; + + -- ---------------------------- -- 6、物料入库单表 @@ -195,6 +256,8 @@ create table wm_item_recpt ( recpt_name varchar(255) not null comment '入库单名称', iqc_id bigint(20) comment '来料检验单ID', iqc_code varchar(64) comment '来料检验单编号', + notice_id bigint(20) comment '到货通知单ID', + notice_code varchar(64) comment '到货通知单编号', po_code varchar(64) comment '采购订单编号', vendor_id bigint(20) comment '供应商ID', vendor_code varchar(64) comment '供应商编码', @@ -231,6 +294,7 @@ drop table if exists wm_item_recpt_line; create table wm_item_recpt_line ( line_id bigint(20) not null auto_increment comment '行ID', recpt_id bigint(20) comment '入库单ID', + notice_line_id bigint(20) comment '到货通知单行ID', item_id bigint(20) not null comment '产品物料ID', item_code varchar(64) comment '产品物料编码', item_name varchar(255) comment '产品物料名称', @@ -1388,3 +1452,55 @@ create table wm_outsource_recpt_line ( ) engine=innodb auto_increment=200 comment = '外协入库单行表'; +-- ---------------------------- +-- 31、批次记录表 +-- ---------------------------- +drop table if exists wm_batch; +create table wm_batch ( + batch_id bigint(20) not null auto_increment comment '批次ID', + batch_code varchar(64) not null comment '批次编号', + item_id bigint(20) not null comment '产品物料ID', + item_code varchar(64) comment '产品物料编码', + item_name varchar(255) comment '产品物料名称', + specification varchar(500) comment '规格型号', + unit_of_measure varchar(64) comment '单位', + produce_date datetime comment '生产日期', + expire_date datetime comment '有效期', + recpt_date datetime comment '入库日期', + vendor_id bigint(20) comment '供应商ID', + vendor_code varchar(64) comment '供应商编码', + vendor_name varchar(255) comment '供应商名称', + vendor_nick varchar(255) comment '供应商简称', + client_id bigint(20) comment '客户ID', + client_code varchar(64) comment '客户编码', + client_name varchar(255) comment '客户名称', + client_nick varchar(255) comment '客户简称', + co_code varchar(64) comment '销售订单编号', + po_code varchar(64) comment '采购订单编号', + workorder_id bigint(20) comment '生产工单ID', + workorder_code varchar(64) comment '生产工单编码', + task_id bigint(20) comment '生产任务ID', + task_code varchar(64) comment '生产任务编号', + workstation_id bigint(20) comment '工作站ID', + workstation_code varchar(64) comment '工作站编码', + tool_id bigint(20) comment '工具ID', + tool_code varchar(64) comment '工具编号', + mold_id bigint(20) comment '模具ID', + mold_code varchar(64) comment '模具编号', + product_code varchar(128) comment '生产批号', + quality_status varchar(64) comment '质量状态', + remark varchar(500) default '' comment '备注', + attr1 varchar(64) default null comment '预留字段1', + attr2 varchar(255) default null comment '预留字段2', + attr3 int(11) default 0 comment '预留字段3', + attr4 int(11) default 0 comment '预留字段4', + create_by varchar(64) default '' comment '创建者', + create_time datetime comment '创建时间', + update_by varchar(64) default '' comment '更新者', + update_time datetime comment '更新时间', + primary key (batch_id) +) engine=innodb auto_increment=200 comment = '批次记录表'; + + + + diff --git a/doc/设计文档/数据库设计/数据库设计.xlsx b/doc/设计文档/数据库设计/数据库设计.xlsx index 1bfccfa..5ac58a1 100644 Binary files a/doc/设计文档/数据库设计/数据库设计.xlsx and b/doc/设计文档/数据库设计/数据库设计.xlsx differ diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java index 6d8c1bd..b3787b8 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/MdItem.java @@ -33,6 +33,7 @@ public class MdItem extends BaseEntity { private Double minStock; private Double maxStock; private String highValue; + private String batchFlag; private String attr1; private String attr2; private String attr3; @@ -160,6 +161,14 @@ public class MdItem extends BaseEntity { return highValue; } + public String getBatchFlag() { + return batchFlag; + } + + public void setBatchFlag(String batchFlag) { + this.batchFlag = batchFlag; + } + public void setHighValue(String highValue) { this.highValue = highValue; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java index ad56f56..48aa65c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/QcIqcController.java @@ -1,5 +1,6 @@ package com.ktg.mes.qc.controller; +import java.math.BigDecimal; import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -10,7 +11,10 @@ import com.ktg.mes.pro.domain.ProFeedback; import com.ktg.mes.pro.service.IProFeedbackService; import com.ktg.mes.qc.domain.*; import com.ktg.mes.qc.service.*; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; import com.ktg.mes.wm.domain.WmItemRecptLine; +import com.ktg.mes.wm.service.IWmArrivalNoticeLineService; +import com.ktg.mes.wm.service.IWmArrivalNoticeService; import com.ktg.mes.wm.service.IWmItemRecptLineService; import com.ktg.mes.wm.service.IWmItemRecptService; import org.springframework.security.access.prepost.PreAuthorize; @@ -57,7 +61,10 @@ public class QcIqcController extends BaseController private IQcDefectRecordService qcDefectRecordService; @Autowired - private IWmItemRecptLineService wmItemRecptLineService; + private IWmArrivalNoticeLineService wmArrivalNoticeLineService; + + @Autowired + private IWmArrivalNoticeService wmArrivalNoticeService; /** @@ -148,12 +155,16 @@ public class QcIqcController extends BaseController //如果是完成状态,则根据来源单据更新其对应的检测单 if(UserConstants.ORDER_STATUS_FINISHED.equals(qcIqc.getStatus())){ if(StringUtils.isNotNull(qcIqc.getSourceDocCode())){ - //这里默认是采购入库单,后续有其他单据则根据单据类型(sourceDocType)进行区分 - WmItemRecptLine line = wmItemRecptLineService.selectWmItemRecptLineByLineId(qcIqc.getSourceLineId()); + //这里默认是到货通知单,后续有其他单据则根据单据类型(sourceDocType)进行区分 + WmArrivalNoticeLine line = wmArrivalNoticeLineService.selectWmArrivalNoticeLineByLineId(qcIqc.getSourceLineId()); + if(StringUtils.isNotNull(line)){ line.setIqcCode(qcIqc.getIqcCode()); line.setIqcId(qcIqc.getIqcId()); - wmItemRecptLineService.updateWmItemRecptLine(line); + line.setQuantityQuanlified(qcIqc.getQuantityQualified()); + wmArrivalNoticeLineService.updateWmArrivalNoticeLine(line); + //根据行的检测情况更新到货通知单的状态 + wmArrivalNoticeService.updateStatus(qcIqc.getSourceDocId()); } } } @@ -208,9 +219,9 @@ public class QcIqcController extends BaseController line.setUnitOfMeasure(index.getUnitOfMeasure()); line.setThresholdMax(index.getThresholdMax()); line.setThresholdMin(index.getThresholdMin()); - line.setCrQuantity(0L); - line.setMajQuantity(0L); - line.setMajQuantity(0L); + line.setCrQuantity(BigDecimal.ZERO); + line.setMajQuantity(BigDecimal.ZERO); + line.setMajQuantity(BigDecimal.ZERO); qcIqcLineService.insertQcIqcLine(line); } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java index 1098d3d..864f015 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqc.java @@ -86,11 +86,11 @@ public class QcIqc extends BaseEntity /** 最低检测数 */ @Excel(name = "最低检测数") - private Long quantityMinCheck; + private BigDecimal quantityMinCheck; /** 最大不合格数 */ @Excel(name = "最大不合格数") - private Long quantityMaxUnqualified; + private BigDecimal quantityMaxUnqualified; /** 本次接收数量 */ @Excel(name = "本次接收数量") @@ -98,11 +98,17 @@ public class QcIqc extends BaseEntity /** 本次检测数量 */ @Excel(name = "本次检测数量") - private Long quantityCheck; + private BigDecimal quantityCheck; + + /** + * 合格品数量 + */ + @Excel(name = "合格品数量") + private BigDecimal quantityQualified; /** 不合格数 */ @Excel(name = "不合格数") - private Long quantityUnqualified; + private BigDecimal quantityUnqualified; /** 致命缺陷率 */ @Excel(name = "致命缺陷率") @@ -118,15 +124,15 @@ public class QcIqc extends BaseEntity /** 致命缺陷数量 */ @Excel(name = "致命缺陷数量") - private Long crQuantity; + private BigDecimal crQuantity; /** 严重缺陷数量 */ @Excel(name = "严重缺陷数量") - private Long majQuantity; + private BigDecimal majQuantity; /** 轻微缺陷数量 */ @Excel(name = "轻微缺陷数量") - private Long minQuantity; + private BigDecimal minQuantity; /** 检测结果 */ @Excel(name = "检测结果") @@ -323,21 +329,21 @@ public class QcIqc extends BaseEntity { return unitOfMeasure; } - public void setQuantityMinCheck(Long quantityMinCheck) + public void setQuantityMinCheck(BigDecimal quantityMinCheck) { this.quantityMinCheck = quantityMinCheck; } - public Long getQuantityMinCheck() + public BigDecimal getQuantityMinCheck() { return quantityMinCheck; } - public void setQuantityMaxUnqualified(Long quantityMaxUnqualified) + public void setQuantityMaxUnqualified(BigDecimal quantityMaxUnqualified) { this.quantityMaxUnqualified = quantityMaxUnqualified; } - public Long getQuantityMaxUnqualified() + public BigDecimal getQuantityMaxUnqualified() { return quantityMaxUnqualified; } @@ -350,21 +356,30 @@ public class QcIqc extends BaseEntity { return quantityRecived; } - public void setQuantityCheck(Long quantityCheck) + public void setQuantityCheck(BigDecimal quantityCheck) { this.quantityCheck = quantityCheck; } - public Long getQuantityCheck() + public BigDecimal getQuantityCheck() { return quantityCheck; } - public void setQuantityUnqualified(Long quantityUnqualified) + + public BigDecimal getQuantityQualified() { + return quantityQualified; + } + + public void setQuantityQualified(BigDecimal quantityQualified) { + this.quantityQualified = quantityQualified; + } + + public void setQuantityUnqualified(BigDecimal quantityUnqualified) { this.quantityUnqualified = quantityUnqualified; } - public Long getQuantityUnqualified() + public BigDecimal getQuantityUnqualified() { return quantityUnqualified; } @@ -395,30 +410,30 @@ public class QcIqc extends BaseEntity { return minRate; } - public void setCrQuantity(Long crQuantity) + public void setCrQuantity(BigDecimal crQuantity) { this.crQuantity = crQuantity; } - public Long getCrQuantity() + public BigDecimal getCrQuantity() { return crQuantity; } - public void setMajQuantity(Long majQuantity) + public void setMajQuantity(BigDecimal majQuantity) { this.majQuantity = majQuantity; } - public Long getMajQuantity() + public BigDecimal getMajQuantity() { return majQuantity; } - public void setMinQuantity(Long minQuantity) + public void setMinQuantity(BigDecimal minQuantity) { this.minQuantity = minQuantity; } - public Long getMinQuantity() + public BigDecimal getMinQuantity() { return minQuantity; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java index 51862b1..2dd4b94 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcLine.java @@ -65,15 +65,15 @@ public class QcIqcLine extends BaseEntity /** 致命缺陷数量 */ @Excel(name = "致命缺陷数量") - private Long crQuantity; + private BigDecimal crQuantity; /** 严重缺陷数量 */ @Excel(name = "严重缺陷数量") - private Long majQuantity; + private BigDecimal majQuantity; /** 轻微缺陷数量 */ @Excel(name = "轻微缺陷数量") - private Long minQuantity; + private BigDecimal minQuantity; /** 预留字段1 */ private String attr1; @@ -195,30 +195,30 @@ public class QcIqcLine extends BaseEntity { return thresholdMin; } - public void setCrQuantity(Long crQuantity) + public void setCrQuantity(BigDecimal crQuantity) { this.crQuantity = crQuantity; } - public Long getCrQuantity() + public BigDecimal getCrQuantity() { return crQuantity; } - public void setMajQuantity(Long majQuantity) + public void setMajQuantity(BigDecimal majQuantity) { this.majQuantity = majQuantity; } - public Long getMajQuantity() + public BigDecimal getMajQuantity() { return majQuantity; } - public void setMinQuantity(Long minQuantity) + public void setMinQuantity(BigDecimal minQuantity) { this.minQuantity = minQuantity; } - public Long getMinQuantity() + public BigDecimal getMinQuantity() { return minQuantity; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeController.java new file mode 100644 index 0000000..3e23224 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeController.java @@ -0,0 +1,147 @@ +package com.ktg.mes.wm.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ktg.common.constant.UserConstants; +import com.ktg.common.utils.StringUtils; +import com.ktg.mes.qc.domain.QcTemplate; +import com.ktg.mes.qc.service.IQcTemplateService; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; +import com.ktg.mes.wm.service.IWmArrivalNoticeLineService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.wm.domain.WmArrivalNotice; +import com.ktg.mes.wm.service.IWmArrivalNoticeService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 到货通知单Controller + * + * @author yinjinlu + * @date 2024-11-12 + */ +@RestController +@RequestMapping("/mes/wm/arrivalnotice") +public class WmArrivalNoticeController extends BaseController +{ + @Autowired + private IWmArrivalNoticeService wmArrivalNoticeService; + + @Autowired + private IWmArrivalNoticeLineService wmArrivalNoticeLineService; + + @Autowired + private IQcTemplateService qcTemplateService; + + /** + * 查询到货通知单列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:list')") + @GetMapping("/list") + public TableDataInfo list(WmArrivalNotice wmArrivalNotice) + { + startPage(); + List list = wmArrivalNoticeService.selectWmArrivalNoticeList(wmArrivalNotice); + return getDataTable(list); + } + + /** + * 导出到货通知单列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:export')") + @Log(title = "到货通知单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmArrivalNotice wmArrivalNotice) + { + List list = wmArrivalNoticeService.selectWmArrivalNoticeList(wmArrivalNotice); + ExcelUtil util = new ExcelUtil(WmArrivalNotice.class); + util.exportExcel(response, list, "到货通知单数据"); + } + + /** + * 获取到货通知单详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:query')") + @GetMapping(value = "/{noticeId}") + public AjaxResult getInfo(@PathVariable("noticeId") Long noticeId) + { + return AjaxResult.success(wmArrivalNoticeService.selectWmArrivalNoticeByNoticeId(noticeId)); + } + + /** + * 新增到货通知单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:add')") + @Log(title = "到货通知单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmArrivalNotice wmArrivalNotice) + { + if(UserConstants.NOT_UNIQUE.equals(wmArrivalNoticeService.checkRnCodeUnique(wmArrivalNotice))){ + return AjaxResult.error("单据编号已存在"); + } + + return toAjax(wmArrivalNoticeService.insertWmArrivalNotice(wmArrivalNotice)); + } + + /** + * 修改到货通知单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:edit')") + @Log(title = "到货通知单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmArrivalNotice wmArrivalNotice) + { + if(UserConstants.NOT_UNIQUE.equals(wmArrivalNoticeService.checkRnCodeUnique(wmArrivalNotice))){ + return AjaxResult.error("单据编号已存在"); + } + + //提交时判断通知单行上的物料 + if(UserConstants.ORDER_STATUS_APPROVING.equals(wmArrivalNotice.getStatus())){ + //到货内容检查 + WmArrivalNoticeLine param = new WmArrivalNoticeLine(); + param.setNoticeId(wmArrivalNotice.getNoticeId()); + List lines = wmArrivalNoticeLineService.selectWmArrivalNoticeLineList(param); + if(CollectionUtils.isEmpty(lines)){ + return AjaxResult.error("请添加到货物资!"); + } + } + return toAjax(wmArrivalNoticeService.updateWmArrivalNotice(wmArrivalNotice)); + } + + /** + * 删除到货通知单 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:remove')") + @Log(title = "到货通知单", businessType = BusinessType.DELETE) + @Transactional + @DeleteMapping("/{noticeIds}") + public AjaxResult remove(@PathVariable Long[] noticeIds) + { + for(Long noticeId:noticeIds){ + + WmArrivalNotice notice = wmArrivalNoticeService.selectWmArrivalNoticeByNoticeId(noticeId); + if(StringUtils.isNotNull(notice) && !UserConstants.ORDER_STATUS_PREPARE.equals(notice.getStatus()) ){ + return AjaxResult.error("只能删除草稿状态的单据!"); + } + wmArrivalNoticeLineService.deleteByNoticeId(noticeId); + } + + return toAjax(wmArrivalNoticeService.deleteWmArrivalNoticeByNoticeIds(noticeIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeLineController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeLineController.java new file mode 100644 index 0000000..f60f4be --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmArrivalNoticeLineController.java @@ -0,0 +1,114 @@ +package com.ktg.mes.wm.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ktg.common.constant.UserConstants; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ktg.common.annotation.Log; +import com.ktg.common.core.controller.BaseController; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.enums.BusinessType; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; +import com.ktg.mes.wm.service.IWmArrivalNoticeLineService; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.common.core.page.TableDataInfo; + +/** + * 到货通知单行Controller + * + * @author yinjinlu + * @date 2024-11-12 + */ +@RestController +@RequestMapping("/mes/wm/arrivalnoticeline") +public class WmArrivalNoticeLineController extends BaseController +{ + @Autowired + private IWmArrivalNoticeLineService wmArrivalNoticeLineService; + + /** + * 查询到货通知单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:list')") + @GetMapping("/list") + public TableDataInfo list(WmArrivalNoticeLine wmArrivalNoticeLine) + { + startPage(); + List list = wmArrivalNoticeLineService.selectWmArrivalNoticeLineList(wmArrivalNoticeLine); + return getDataTable(list); + } + + /** + * 导出到货通知单行列表 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:export')") + @Log(title = "到货通知单行", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WmArrivalNoticeLine wmArrivalNoticeLine) + { + List list = wmArrivalNoticeLineService.selectWmArrivalNoticeLineList(wmArrivalNoticeLine); + ExcelUtil util = new ExcelUtil(WmArrivalNoticeLine.class); + util.exportExcel(response, list, "到货通知单行数据"); + } + + /** + * 获取到货通知单行详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:query')") + @GetMapping(value = "/{lineId}") + public AjaxResult getInfo(@PathVariable("lineId") Long lineId) + { + return AjaxResult.success(wmArrivalNoticeLineService.selectWmArrivalNoticeLineByLineId(lineId)); + } + + /** + * 新增到货通知单行 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:add')") + @Log(title = "到货通知单行", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WmArrivalNoticeLine wmArrivalNoticeLine) + { + //如果不需要检验,则合格品数量直接=接收数量;否则合格品数量就由对应的检验单负责更新 + if(UserConstants.NO.equals(wmArrivalNoticeLine.getIqcCheck())){ + wmArrivalNoticeLine.setQuantityQuanlified(wmArrivalNoticeLine.getQuantityArrival()); + } + return toAjax(wmArrivalNoticeLineService.insertWmArrivalNoticeLine(wmArrivalNoticeLine)); + } + + /** + * 修改到货通知单行 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:edit')") + @Log(title = "到货通知单行", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WmArrivalNoticeLine wmArrivalNoticeLine) + { + //如果不需要检验,则合格品数量直接=接收数量;否则合格品数量就由对应的检验单负责更新 + if(UserConstants.NO.equals(wmArrivalNoticeLine.getIqcCheck())){ + wmArrivalNoticeLine.setQuantityQuanlified(wmArrivalNoticeLine.getQuantityArrival()); + } + return toAjax(wmArrivalNoticeLineService.updateWmArrivalNoticeLine(wmArrivalNoticeLine)); + } + + /** + * 删除到货通知单行 + */ + @PreAuthorize("@ss.hasPermi('mes:wm:arrivalnotice:remove')") + @Log(title = "到货通知单行", businessType = BusinessType.DELETE) + @DeleteMapping("/{lineIds}") + public AjaxResult remove(@PathVariable Long[] lineIds) + { + return toAjax(wmArrivalNoticeLineService.deleteWmArrivalNoticeLineByLineIds(lineIds)); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNotice.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNotice.java new file mode 100644 index 0000000..75386c2 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNotice.java @@ -0,0 +1,248 @@ +package com.ktg.mes.wm.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 到货通知单对象 wm_arrival_notice + * + * @author yinjinlu + * @date 2024-11-12 + */ +public class WmArrivalNotice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 入库单ID */ + private Long noticeId; + + /** 入库单编号 */ + @Excel(name = "入库单编号") + private String noticeCode; + + /** 入库单名称 */ + @Excel(name = "入库单名称") + private String noticeName; + + /** 采购订单编号 */ + @Excel(name = "采购订单编号") + private String poCode; + + /** 供应商ID */ + @Excel(name = "供应商ID") + private Long vendorId; + + /** 供应商编码 */ + @Excel(name = "供应商编码") + private String vendorCode; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String vendorName; + + /** 供应商简称 */ + @Excel(name = "供应商简称") + private String vendorNick; + + /** 到货日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date arrivalDate; + + /** 联系人 */ + @Excel(name = "联系人") + private String contact; + + /** 联系方式 */ + @Excel(name = "联系方式") + private String tel; + + /** 单据状态 */ + @Excel(name = "单据状态") + private String status; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setNoticeId(Long noticeId) + { + this.noticeId = noticeId; + } + + public Long getNoticeId() + { + return noticeId; + } + public void setNoticeCode(String noticeCode) + { + this.noticeCode = noticeCode; + } + + public String getNoticeCode() + { + return noticeCode; + } + public void setNoticeName(String noticeName) + { + this.noticeName = noticeName; + } + + public String getNoticeName() + { + return noticeName; + } + public void setPoCode(String poCode) + { + this.poCode = poCode; + } + + public String getPoCode() + { + return poCode; + } + public void setVendorId(Long vendorId) + { + this.vendorId = vendorId; + } + + public Long getVendorId() + { + return vendorId; + } + public void setVendorCode(String vendorCode) + { + this.vendorCode = vendorCode; + } + + public String getVendorCode() + { + return vendorCode; + } + public void setVendorName(String vendorName) + { + this.vendorName = vendorName; + } + + public String getVendorName() + { + return vendorName; + } + public void setVendorNick(String vendorNick) + { + this.vendorNick = vendorNick; + } + + public String getVendorNick() + { + return vendorNick; + } + public void setArrivalDate(Date arrivalDate) + { + this.arrivalDate = arrivalDate; + } + + public Date getArrivalDate() + { + return arrivalDate; + } + + public String getContact() { + return contact; + } + + public void setContact(String contact) { + this.contact = contact; + } + + public String getTel() { + return tel; + } + + public void setTel(String tel) { + this.tel = tel; + } + + public void setStatus(String status) + { + this.status = status; + } + + public String getStatus() + { + return status; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(Long attr3) + { + this.attr3 = attr3; + } + + public Long getAttr3() + { + return attr3; + } + public void setAttr4(Long attr4) + { + this.attr4 = attr4; + } + + public Long getAttr4() + { + return attr4; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("noticeId", getNoticeId()) + .append("noticeCode", getNoticeCode()) + .append("noticeName", getNoticeName()) + .append("poCode", getPoCode()) + .append("vendorId", getVendorId()) + .append("vendorCode", getVendorCode()) + .append("vendorName", getVendorName()) + .append("vendorNick", getVendorNick()) + .append("arrivalDate", getArrivalDate()) + .append("status", getStatus()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNoticeLine.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNoticeLine.java new file mode 100644 index 0000000..5fb0458 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmArrivalNoticeLine.java @@ -0,0 +1,249 @@ +package com.ktg.mes.wm.domain; + +import java.math.BigDecimal; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ktg.common.annotation.Excel; +import com.ktg.common.core.domain.BaseEntity; + +/** + * 到货通知单行对象 wm_arrival_notice_line + * + * @author yinjinlu + * @date 2024-11-12 + */ +public class WmArrivalNoticeLine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 行ID */ + private Long lineId; + + /** 通知单ID */ + @Excel(name = "通知单ID") + private Long noticeId; + + /** 产品物料ID */ + @Excel(name = "产品物料ID") + private Long itemId; + + /** 产品物料编码 */ + @Excel(name = "产品物料编码") + private String itemCode; + + /** 产品物料名称 */ + @Excel(name = "产品物料名称") + private String itemName; + + /** 规格型号 */ + @Excel(name = "规格型号") + private String specification; + + /** 单位 */ + @Excel(name = "单位") + private String unitOfMeasure; + + /** 到货数量 */ + @Excel(name = "到货数量") + private BigDecimal quantityArrival; + + /** 合格数量 */ + @Excel(name = "合格数量") + private BigDecimal quantityQuanlified; + + /** 是否来料检验 */ + @Excel(name = "是否来料检验") + private String iqcCheck; + + /** 来料检验单ID */ + @Excel(name = "来料检验单ID") + private Long iqcId; + + /** 来料检验单编号 */ + @Excel(name = "来料检验单编号") + private String iqcCode; + + /** 预留字段1 */ + private String attr1; + + /** 预留字段2 */ + private String attr2; + + /** 预留字段3 */ + private Long attr3; + + /** 预留字段4 */ + private Long attr4; + + public void setLineId(Long lineId) + { + this.lineId = lineId; + } + + public Long getLineId() + { + return lineId; + } + public void setNoticeId(Long noticeId) + { + this.noticeId = noticeId; + } + + public Long getNoticeId() + { + return noticeId; + } + public void setItemId(Long itemId) + { + this.itemId = itemId; + } + + public Long getItemId() + { + return itemId; + } + public void setItemCode(String itemCode) + { + this.itemCode = itemCode; + } + + public String getItemCode() + { + return itemCode; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } + + public String getItemName() + { + return itemName; + } + public void setSpecification(String specification) + { + this.specification = specification; + } + + public String getSpecification() + { + return specification; + } + public void setUnitOfMeasure(String unitOfMeasure) + { + this.unitOfMeasure = unitOfMeasure; + } + + public String getUnitOfMeasure() + { + return unitOfMeasure; + } + public void setQuantityArrival(BigDecimal quantityArrival) + { + this.quantityArrival = quantityArrival; + } + + public BigDecimal getQuantityArrival() + { + return quantityArrival; + } + public void setQuantityQuanlified(BigDecimal quantityQuanlified) + { + this.quantityQuanlified = quantityQuanlified; + } + + public BigDecimal getQuantityQuanlified() + { + return quantityQuanlified; + } + public void setIqcCheck(String iqcCheck) + { + this.iqcCheck = iqcCheck; + } + + public String getIqcCheck() + { + return iqcCheck; + } + public void setIqcId(Long iqcId) + { + this.iqcId = iqcId; + } + + public Long getIqcId() + { + return iqcId; + } + public void setIqcCode(String iqcCode) + { + this.iqcCode = iqcCode; + } + + public String getIqcCode() + { + return iqcCode; + } + public void setAttr1(String attr1) + { + this.attr1 = attr1; + } + + public String getAttr1() + { + return attr1; + } + public void setAttr2(String attr2) + { + this.attr2 = attr2; + } + + public String getAttr2() + { + return attr2; + } + public void setAttr3(Long attr3) + { + this.attr3 = attr3; + } + + public Long getAttr3() + { + return attr3; + } + public void setAttr4(Long attr4) + { + this.attr4 = attr4; + } + + public Long getAttr4() + { + return attr4; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("lineId", getLineId()) + .append("noticeId", getNoticeId()) + .append("itemId", getItemId()) + .append("itemCode", getItemCode()) + .append("itemName", getItemName()) + .append("specification", getSpecification()) + .append("unitOfMeasure", getUnitOfMeasure()) + .append("quantityArrival", getQuantityArrival()) + .append("quantityQuanlified", getQuantityQuanlified()) + .append("iqcCheck", getIqcCheck()) + .append("iqcId", getIqcId()) + .append("iqcCode", getIqcCode()) + .append("remark", getRemark()) + .append("attr1", getAttr1()) + .append("attr2", getAttr2()) + .append("attr3", getAttr3()) + .append("attr4", getAttr4()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecpt.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecpt.java index 20ed9be..224630e 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecpt.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecpt.java @@ -36,6 +36,17 @@ public class WmItemRecpt extends BaseEntity @Excel(name = "来料检验单编号") private String iqcCode; + /** + * 到货通知单ID + */ + private Long noticeId; + + /** + * 到货通知单编号 + */ + private String noticeCode; + + /** 采购订单编号 */ @Excel(name = "采购订单编号") private String poCode; @@ -158,7 +169,24 @@ public class WmItemRecpt extends BaseEntity { return iqcCode; } - public void setPoCode(String poCode) + + public Long getNoticeId() { + return noticeId; + } + + public void setNoticeId(Long noticeId) { + this.noticeId = noticeId; + } + + public String getNoticeCode() { + return noticeCode; + } + + public void setNoticeCode(String noticeCode) { + this.noticeCode = noticeCode; + } + + public void setPoCode(String poCode) { this.poCode = poCode; } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecptLine.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecptLine.java index 4976c15..cb70247 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecptLine.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/WmItemRecptLine.java @@ -25,6 +25,11 @@ public class WmItemRecptLine extends BaseEntity @Excel(name = "入库单ID") private Long recptId; + /** + * 到货通知单行ID + */ + private Long noticeLineId; + /** 产品物料ID */ @Excel(name = "产品物料ID") private Long itemId; diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeLineMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeLineMapper.java new file mode 100644 index 0000000..81dfd25 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeLineMapper.java @@ -0,0 +1,78 @@ +package com.ktg.mes.wm.mapper; + +import java.util.List; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; + +/** + * 到货通知单行Mapper接口 + * + * @author yinjinlu + * @date 2024-11-12 + */ +public interface WmArrivalNoticeLineMapper +{ + /** + * 查询到货通知单行 + * + * @param lineId 到货通知单行主键 + * @return 到货通知单行 + */ + public WmArrivalNoticeLine selectWmArrivalNoticeLineByLineId(Long lineId); + + /** + * 查询到货通知单行列表 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 到货通知单行集合 + */ + public List selectWmArrivalNoticeLineList(WmArrivalNoticeLine wmArrivalNoticeLine); + + + /** + * 获取指定通知单下所有待检测,但未检测的行 + * @param noticeId + * @return + */ + public List selectUncheckedLine(Long noticeId); + + + /** + * 新增到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + public int insertWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine); + + /** + * 修改到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + public int updateWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine); + + /** + * 删除到货通知单行 + * + * @param lineId 到货通知单行主键 + * @return 结果 + */ + public int deleteWmArrivalNoticeLineByLineId(Long lineId); + + /** + * 批量删除到货通知单行 + * + * @param lineIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmArrivalNoticeLineByLineIds(Long[] lineIds); + + /** + * 根据通知单号删除所有行 + * @param noticeId + * @return + */ + public int deleteByNoticeId(Long noticeId); + +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeMapper.java b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeMapper.java new file mode 100644 index 0000000..30e5060 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/mapper/WmArrivalNoticeMapper.java @@ -0,0 +1,69 @@ +package com.ktg.mes.wm.mapper; + +import java.util.List; +import com.ktg.mes.wm.domain.WmArrivalNotice; + +/** + * 到货通知单Mapper接口 + * + * @author yinjinlu + * @date 2024-11-12 + */ +public interface WmArrivalNoticeMapper +{ + /** + * 查询到货通知单 + * + * @param noticeId 到货通知单主键 + * @return 到货通知单 + */ + public WmArrivalNotice selectWmArrivalNoticeByNoticeId(Long noticeId); + + /** + * 查询到货通知单列表 + * + * @param wmArrivalNotice 到货通知单 + * @return 到货通知单集合 + */ + public List selectWmArrivalNoticeList(WmArrivalNotice wmArrivalNotice); + + + /** + * 检查通知单编码是否唯一 + * @return + */ + public WmArrivalNotice checkRnCodeUnique(WmArrivalNotice wmArrivalNotice); + + + /** + * 新增到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + public int insertWmArrivalNotice(WmArrivalNotice wmArrivalNotice); + + /** + * 修改到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + public int updateWmArrivalNotice(WmArrivalNotice wmArrivalNotice); + + /** + * 删除到货通知单 + * + * @param noticeId 到货通知单主键 + * @return 结果 + */ + public int deleteWmArrivalNoticeByNoticeId(Long noticeId); + + /** + * 批量删除到货通知单 + * + * @param noticeIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWmArrivalNoticeByNoticeIds(Long[] noticeIds); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeLineService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeLineService.java new file mode 100644 index 0000000..0a07464 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeLineService.java @@ -0,0 +1,70 @@ +package com.ktg.mes.wm.service; + +import java.util.List; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; + +/** + * 到货通知单行Service接口 + * + * @author yinjinlu + * @date 2024-11-12 + */ +public interface IWmArrivalNoticeLineService +{ + /** + * 查询到货通知单行 + * + * @param lineId 到货通知单行主键 + * @return 到货通知单行 + */ + public WmArrivalNoticeLine selectWmArrivalNoticeLineByLineId(Long lineId); + + /** + * 查询到货通知单行列表 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 到货通知单行集合 + */ + public List selectWmArrivalNoticeLineList(WmArrivalNoticeLine wmArrivalNoticeLine); + + /** + * 新增到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + public int insertWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine); + + /** + * 修改到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + public int updateWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine); + + /** + * 批量删除到货通知单行 + * + * @param lineIds 需要删除的到货通知单行主键集合 + * @return 结果 + */ + public int deleteWmArrivalNoticeLineByLineIds(Long[] lineIds); + + /** + * 删除到货通知单行信息 + * + * @param lineId 到货通知单行主键 + * @return 结果 + */ + public int deleteWmArrivalNoticeLineByLineId(Long lineId); + + + /** + * 根据通知单ID,删除所有通知单行 + * @param noticeId + * @return + */ + public int deleteByNoticeId(Long noticeId); + +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeService.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeService.java new file mode 100644 index 0000000..7d5032b --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/IWmArrivalNoticeService.java @@ -0,0 +1,76 @@ +package com.ktg.mes.wm.service; + +import java.util.List; +import com.ktg.mes.wm.domain.WmArrivalNotice; + +/** + * 到货通知单Service接口 + * + * @author yinjinlu + * @date 2024-11-12 + */ +public interface IWmArrivalNoticeService +{ + /** + * 查询到货通知单 + * + * @param noticeId 到货通知单主键 + * @return 到货通知单 + */ + public WmArrivalNotice selectWmArrivalNoticeByNoticeId(Long noticeId); + + /** + * 查询到货通知单列表 + * + * @param wmArrivalNotice 到货通知单 + * @return 到货通知单集合 + */ + public List selectWmArrivalNoticeList(WmArrivalNotice wmArrivalNotice); + + + + /** + * 检查通知单编码是否唯一 + * @return + */ + public String checkRnCodeUnique(WmArrivalNotice wmArrivalNotice); + + /** + * 新增到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + public int insertWmArrivalNotice(WmArrivalNotice wmArrivalNotice); + + /** + * 修改到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + public int updateWmArrivalNotice(WmArrivalNotice wmArrivalNotice); + + /** + * 根据行上的检测状态,更新当前单据的状态 + * 如果所有需要进行检验的行已经绑定了检验单,则更新为APPROVED + * @param noticeId + */ + public void updateStatus(Long noticeId); + + /** + * 批量删除到货通知单 + * + * @param noticeIds 需要删除的到货通知单主键集合 + * @return 结果 + */ + public int deleteWmArrivalNoticeByNoticeIds(Long[] noticeIds); + + /** + * 删除到货通知单信息 + * + * @param noticeId 到货通知单主键 + * @return 结果 + */ + public int deleteWmArrivalNoticeByNoticeId(Long noticeId); +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeLineServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeLineServiceImpl.java new file mode 100644 index 0000000..dc3803f --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeLineServiceImpl.java @@ -0,0 +1,108 @@ +package com.ktg.mes.wm.service.impl; + +import java.util.List; +import com.ktg.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ktg.mes.wm.mapper.WmArrivalNoticeLineMapper; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; +import com.ktg.mes.wm.service.IWmArrivalNoticeLineService; + +/** + * 到货通知单行Service业务层处理 + * + * @author yinjinlu + * @date 2024-11-12 + */ +@Service +public class WmArrivalNoticeLineServiceImpl implements IWmArrivalNoticeLineService +{ + @Autowired + private WmArrivalNoticeLineMapper wmArrivalNoticeLineMapper; + + /** + * 查询到货通知单行 + * + * @param lineId 到货通知单行主键 + * @return 到货通知单行 + */ + @Override + public WmArrivalNoticeLine selectWmArrivalNoticeLineByLineId(Long lineId) + { + return wmArrivalNoticeLineMapper.selectWmArrivalNoticeLineByLineId(lineId); + } + + /** + * 查询到货通知单行列表 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 到货通知单行 + */ + @Override + public List selectWmArrivalNoticeLineList(WmArrivalNoticeLine wmArrivalNoticeLine) + { + return wmArrivalNoticeLineMapper.selectWmArrivalNoticeLineList(wmArrivalNoticeLine); + } + + /** + * 新增到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + @Override + public int insertWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine) + { + wmArrivalNoticeLine.setCreateTime(DateUtils.getNowDate()); + return wmArrivalNoticeLineMapper.insertWmArrivalNoticeLine(wmArrivalNoticeLine); + } + + /** + * 修改到货通知单行 + * + * @param wmArrivalNoticeLine 到货通知单行 + * @return 结果 + */ + @Override + public int updateWmArrivalNoticeLine(WmArrivalNoticeLine wmArrivalNoticeLine) + { + wmArrivalNoticeLine.setUpdateTime(DateUtils.getNowDate()); + return wmArrivalNoticeLineMapper.updateWmArrivalNoticeLine(wmArrivalNoticeLine); + } + + /** + * 批量删除到货通知单行 + * + * @param lineIds 需要删除的到货通知单行主键 + * @return 结果 + */ + @Override + public int deleteWmArrivalNoticeLineByLineIds(Long[] lineIds) + { + return wmArrivalNoticeLineMapper.deleteWmArrivalNoticeLineByLineIds(lineIds); + } + + /** + * 删除到货通知单行信息 + * + * @param lineId 到货通知单行主键 + * @return 结果 + */ + @Override + public int deleteWmArrivalNoticeLineByLineId(Long lineId) + { + return wmArrivalNoticeLineMapper.deleteWmArrivalNoticeLineByLineId(lineId); + } + + /** + * 根据通知单ID删除所有通知单行 + * @param noticeId + * @return + */ + @Override + public int deleteByNoticeId(Long noticeId) { + return wmArrivalNoticeLineMapper.deleteByNoticeId(noticeId); + } + + +} diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeServiceImpl.java new file mode 100644 index 0000000..6f8f617 --- /dev/null +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/service/impl/WmArrivalNoticeServiceImpl.java @@ -0,0 +1,136 @@ +package com.ktg.mes.wm.service.impl; + +import java.util.List; + +import com.ktg.common.constant.UserConstants; +import com.ktg.common.utils.DateUtils; +import com.ktg.common.utils.StringUtils; +import com.ktg.mes.wm.domain.WmArrivalNoticeLine; +import com.ktg.mes.wm.mapper.WmArrivalNoticeLineMapper; +import org.apache.catalina.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ktg.mes.wm.mapper.WmArrivalNoticeMapper; +import com.ktg.mes.wm.domain.WmArrivalNotice; +import com.ktg.mes.wm.service.IWmArrivalNoticeService; +import org.springframework.util.CollectionUtils; + +/** + * 到货通知单Service业务层处理 + * + * @author yinjinlu + * @date 2024-11-12 + */ +@Service +public class WmArrivalNoticeServiceImpl implements IWmArrivalNoticeService +{ + @Autowired + private WmArrivalNoticeMapper wmArrivalNoticeMapper; + + @Autowired + private WmArrivalNoticeLineMapper wmArrivalNoticeLineMapper; + + /** + * 查询到货通知单 + * + * @param noticeId 到货通知单主键 + * @return 到货通知单 + */ + @Override + public WmArrivalNotice selectWmArrivalNoticeByNoticeId(Long noticeId) + { + return wmArrivalNoticeMapper.selectWmArrivalNoticeByNoticeId(noticeId); + } + + /** + * 查询到货通知单列表 + * + * @param wmArrivalNotice 到货通知单 + * @return 到货通知单 + */ + @Override + public List selectWmArrivalNoticeList(WmArrivalNotice wmArrivalNotice) + { + return wmArrivalNoticeMapper.selectWmArrivalNoticeList(wmArrivalNotice); + } + + /** + * 检查通知单编码是否唯一 + * @param wmArrivalNotice + * @return + */ + @Override + public String checkRnCodeUnique(WmArrivalNotice wmArrivalNotice) { + WmArrivalNotice notice = wmArrivalNoticeMapper.checkRnCodeUnique(wmArrivalNotice); + Long noticeId = notice == null? -1L:notice.getNoticeId(); + if(StringUtils.isNotNull(notice) && notice.getNoticeId().longValue() != noticeId.longValue()){ + return UserConstants.NOT_UNIQUE; + } + return UserConstants.UNIQUE; + } + + /** + * 新增到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + @Override + public int insertWmArrivalNotice(WmArrivalNotice wmArrivalNotice) + { + wmArrivalNotice.setCreateTime(DateUtils.getNowDate()); + return wmArrivalNoticeMapper.insertWmArrivalNotice(wmArrivalNotice); + } + + /** + * 修改到货通知单 + * + * @param wmArrivalNotice 到货通知单 + * @return 结果 + */ + @Override + public int updateWmArrivalNotice(WmArrivalNotice wmArrivalNotice) + { + wmArrivalNotice.setUpdateTime(DateUtils.getNowDate()); + return wmArrivalNoticeMapper.updateWmArrivalNotice(wmArrivalNotice); + } + + /** + * 检查通知单下是否还有未检测的行,没有则更新单据状态为待接收APPROVED + * @param noticeId + */ + @Override + public void updateStatus(Long noticeId) { + + List lines = wmArrivalNoticeLineMapper.selectUncheckedLine(noticeId); + if(CollectionUtils.isEmpty(lines)){ + WmArrivalNotice notice = wmArrivalNoticeMapper.selectWmArrivalNoticeByNoticeId(noticeId); + notice.setStatus(UserConstants.ORDER_STATUS_APPROVED); + wmArrivalNoticeMapper.updateWmArrivalNotice(notice); + } + } + + /** + * 批量删除到货通知单 + * + * @param noticeIds 需要删除的到货通知单主键 + * @return 结果 + */ + @Override + public int deleteWmArrivalNoticeByNoticeIds(Long[] noticeIds) + { + return wmArrivalNoticeMapper.deleteWmArrivalNoticeByNoticeIds(noticeIds); + } + + /** + * 删除到货通知单信息 + * + * @param noticeId 到货通知单主键 + * @return 结果 + */ + @Override + public int deleteWmArrivalNoticeByNoticeId(Long noticeId) + { + return wmArrivalNoticeMapper.deleteWmArrivalNoticeByNoticeId(noticeId); + } +} diff --git a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index 6e78f4e..89bf00d 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -33,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select item_id, item_code, item_name, specification, unit_of_measure,unit_name, item_or_product, - item_type_id,item_type_code,item_type_name,enable_flag,safe_stock_flag,min_stock,max_stock,high_value, create_by, create_time, remark + item_type_id,item_type_code,item_type_name,enable_flag,safe_stock_flag,min_stock,max_stock,high_value,batch_flag, create_by, create_time, remark from md_item @@ -112,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" min_stock, max_stock, high_value, + batch_flag, remark, attr1, attr2, @@ -135,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{minStock}, #{maxStock}, #{highValue}, + #{batchFlag}, #{remark}, #{attr1}, #{attr2}, @@ -161,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" min_stock = #{minStock}, max_stock = #{maxStock}, high_value = #{highValue}, + batch_flag = #{batchFlag}, remark = #{remark}, attr1=#{attr1}, attr2=#{attr2}, diff --git a/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml b/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml index 1573106..fb0a9c2 100644 --- a/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml +++ b/ktg-mes/src/main/resources/mapper/qc/QcIqcMapper.xml @@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -52,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select iqc_id, iqc_code, iqc_name, template_id, source_doc_id,source_doc_type, source_doc_code, source_line_id, vendor_id, vendor_code, vendor_name, vendor_nick, vendor_batch, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_recived, quantity_check, quantity_unqualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, recive_date, inspect_date, inspector,u.nick_name as inspector_name, q.status, q.remark, attr1, attr2, attr3, attr4, q.create_by, q.create_time, q.update_by, q.update_time from qc_iqc q left join sys_user u on u.user_name = q.inspector + select iqc_id, iqc_code, iqc_name, template_id, source_doc_id,source_doc_type, source_doc_code, source_line_id, vendor_id, vendor_code, vendor_name, vendor_nick, vendor_batch, item_id, item_code, item_name, specification, unit_of_measure, quantity_min_check, quantity_max_unqualified, quantity_recived, quantity_check, quantity_qualified,quantity_unqualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, recive_date, inspect_date, inspector,u.nick_name as inspector_name, q.status, q.remark, attr1, attr2, attr3, attr4, q.create_by, q.create_time, q.update_by, q.update_time from qc_iqc q left join sys_user u on u.user_name = q.inspector @@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" on t.template_id = p.template_id where p.item_id = #{itemId} and t.qc_types like concat('%',#{qcType},'%') + and t.enable_flag = 'Y' limit 1 diff --git a/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeLineMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeLineMapper.xml new file mode 100644 index 0000000..8c6d3bc --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeLineMapper.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select line_id, notice_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_arrival, quantity_quanlified, iqc_check, iqc_id, iqc_code, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_arrival_notice_line + + + + + + + + + + insert into wm_arrival_notice_line + + notice_id, + item_id, + item_code, + item_name, + specification, + unit_of_measure, + quantity_arrival, + quantity_quanlified, + iqc_check, + iqc_id, + iqc_code, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{noticeId}, + #{itemId}, + #{itemCode}, + #{itemName}, + #{specification}, + #{unitOfMeasure}, + #{quantityArrival}, + #{quantityQuanlified}, + #{iqcCheck}, + #{iqcId}, + #{iqcCode}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wm_arrival_notice_line + + notice_id = #{noticeId}, + item_id = #{itemId}, + item_code = #{itemCode}, + item_name = #{itemName}, + specification = #{specification}, + unit_of_measure = #{unitOfMeasure}, + quantity_arrival = #{quantityArrival}, + quantity_quanlified = #{quantityQuanlified}, + iqc_check = #{iqcCheck}, + iqc_id = #{iqcId}, + iqc_code = #{iqcCode}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where line_id = #{lineId} + + + + delete from wm_arrival_notice_line where line_id = #{lineId} + + + + delete from wm_arrival_notice_line where line_id in + + #{lineId} + + + + + delete from wm_arrival_notice_line where notice_id = #{noticeId} + + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeMapper.xml new file mode 100644 index 0000000..d16750a --- /dev/null +++ b/ktg-mes/src/main/resources/mapper/wm/WmArrivalNoticeMapper.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select notice_id, notice_code, notice_name, po_code, vendor_id, vendor_code, vendor_name, vendor_nick, arrival_date, contact, tel, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_arrival_notice + + + + + + + + + + insert into wm_arrival_notice + + notice_code, + notice_name, + po_code, + vendor_id, + vendor_code, + vendor_name, + vendor_nick, + arrival_date, + contact, + tel, + status, + remark, + attr1, + attr2, + attr3, + attr4, + create_by, + create_time, + update_by, + update_time, + + + #{noticeCode}, + #{noticeName}, + #{poCode}, + #{vendorId}, + #{vendorCode}, + #{vendorName}, + #{vendorNick}, + #{arrivalDate}, + #{contact}, + #{tel}, + #{status}, + #{remark}, + #{attr1}, + #{attr2}, + #{attr3}, + #{attr4}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update wm_arrival_notice + + notice_code = #{noticeCode}, + notice_name = #{noticeName}, + po_code = #{poCode}, + vendor_id = #{vendorId}, + vendor_code = #{vendorCode}, + vendor_name = #{vendorName}, + vendor_nick = #{vendorNick}, + arrival_date = #{arrivalDate}, + contact = #{contact}, + tel = #{tel}, + status = #{status}, + remark = #{remark}, + attr1 = #{attr1}, + attr2 = #{attr2}, + attr3 = #{attr3}, + attr4 = #{attr4}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where notice_id = #{noticeId} + + + + delete from wm_arrival_notice where notice_id = #{noticeId} + + + + delete from wm_arrival_notice where notice_id in + + #{noticeId} + + + \ No newline at end of file diff --git a/ktg-mes/src/main/resources/mapper/wm/WmItemRecptLineMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmItemRecptLineMapper.xml index eb5d9df..b6bbf55 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmItemRecptLineMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmItemRecptLineMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -39,13 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select line_id, recpt_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_recived, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, expire_date,iqc_check,iqc_id,iqc_code, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_item_recpt_line + select line_id, recpt_id, notice_line_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_recived, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, expire_date,iqc_check,iqc_id,iqc_code, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_item_recpt_line @@ -82,6 +84,8 @@ and recpt_name like concat('%', #{recptName}, '%') and iqc_id = #{iqcId} and iqc_code = #{iqcCode} + and notice_id = #{noticeId} + and notice_code = #{noticeCode} and po_code = #{poCode} and vendor_id = #{vendorId} and vendor_code = #{vendorCode} @@ -134,6 +138,8 @@ recpt_name, iqc_id, iqc_code, + notice_id, + notice_code, po_code, vendor_id, vendor_code, @@ -165,6 +171,8 @@ #{recptName}, #{iqcId}, #{iqcCode}, + #{noticeId}, + #{noticeCode}, #{poCode}, #{vendorId}, #{vendorCode}, @@ -200,6 +208,8 @@ recpt_name = #{recptName}, iqc_id = #{iqcId}, iqc_code = #{iqcCode}, + notice_id = #{noticeId}, + notice_code = #{noticeCode}, po_code = #{poCode}, vendor_id = #{vendorId}, vendor_code = #{vendorCode},