添加到货通知单功能

This commit is contained in:
yinjinlu-pc\尹金路 2024-11-13 18:13:59 +08:00
parent f476c526da
commit fc4b91b604
29 changed files with 1975 additions and 61 deletions

View File

@ -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、供应商表

View File

@ -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 = '工序流转卡-工序信息表';

View File

@ -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 '严重缺陷率',

View File

@ -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 = '批次记录表';

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<WmArrivalNotice> 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<WmArrivalNotice> list = wmArrivalNoticeService.selectWmArrivalNoticeList(wmArrivalNotice);
ExcelUtil<WmArrivalNotice> util = new ExcelUtil<WmArrivalNotice>(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<WmArrivalNoticeLine> 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));
}
}

View File

@ -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<WmArrivalNoticeLine> 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<WmArrivalNoticeLine> list = wmArrivalNoticeLineService.selectWmArrivalNoticeLineList(wmArrivalNoticeLine);
ExcelUtil<WmArrivalNoticeLine> util = new ExcelUtil<WmArrivalNoticeLine>(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));
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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<WmArrivalNoticeLine> selectWmArrivalNoticeLineList(WmArrivalNoticeLine wmArrivalNoticeLine);
/**
* 获取指定通知单下所有待检测但未检测的行
* @param noticeId
* @return
*/
public List<WmArrivalNoticeLine> 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);
}

View File

@ -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<WmArrivalNotice> 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);
}

View File

@ -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<WmArrivalNoticeLine> 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);
}

View File

@ -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<WmArrivalNotice> 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);
}

View File

@ -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<WmArrivalNoticeLine> 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);
}
}

View File

@ -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<WmArrivalNotice> 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<WmArrivalNoticeLine> 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);
}
}

View File

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="minStock" column="min_stock" />
<result property="maxStock" column="max_stock" />
<result property="highValue" column="high_value" />
<result property="batchFlag" column="batch_flag" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
@ -33,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectMdItemVo">
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
</sql>
@ -112,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="safeStockFlag =='Y'.toString()">min_stock,</if>
<if test="safeStockFlag =='Y'.toString()">max_stock,</if>
<if test="highValue !=null and highValue !=''">high_value,</if>
<if test="batchFlag !=null and batchFlag !=''">batch_flag,</if>
<if test="remark !=null and remark !=''">remark,</if>
<if test="attr1 !=null and attr1 !=''">attr1,</if>
<if test="attr2 !=null and attr2 !=''">attr2,</if>
@ -135,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="safeStockFlag =='Y'.toString() and minStock !=null ">#{minStock},</if>
<if test="safeStockFlag =='Y'.toString() and safeStockFlag !=null ">#{maxStock},</if>
<if test="highValue !=null and highValue !=''">#{highValue},</if>
<if test="batchFlag !=null and batchFlag !=''">#{batchFlag},</if>
<if test="remark !=null and remark !=''">#{remark},</if>
<if test="attr1 !=null and attr1 !=''">#{attr1},</if>
<if test="attr2 !=null and attr2 !=''">#{attr2},</if>
@ -161,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="minStock !=null and minStock !=''">min_stock = #{minStock},</if>
<if test="maxStock !=null and maxStock !=''">max_stock = #{maxStock},</if>
<if test="highValue !=null and highValue !=''">high_value = #{highValue},</if>
<if test="batchFlag !=null and batchFlag !=''">batch_flag = #{batchFlag},</if>
<if test="remark !=null and remark !=''">remark = #{remark},</if>
<if test="attr1 !=null and attr1 !=''">attr1=#{attr1},</if>
<if test="attr2 !=null and attr2 !=''">attr2=#{attr2},</if>

View File

@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quantityMaxUnqualified" column="quantity_max_unqualified" />
<result property="quantityRecived" column="quantity_recived" />
<result property="quantityCheck" column="quantity_check" />
<result property="quantityQualified" column="quantity_qualified" />
<result property="quantityUnqualified" column="quantity_unqualified" />
<result property="crRate" column="cr_rate" />
<result property="majRate" column="maj_rate" />
@ -52,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectQcIqcVo">
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
</sql>
<select id="selectQcIqcList" parameterType="QcIqc" resultMap="QcIqcResult">
@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quantityMaxUnqualified != null "> and quantity_max_unqualified = #{quantityMaxUnqualified}</if>
<if test="quantityRecived != null "> and quantity_recived = #{quantityRecived}</if>
<if test="quantityCheck != null "> and quantity_check = #{quantityCheck}</if>
<if test="quantityQualified != null "> and quantity_qualified = #{quantityQualified}</if>
<if test="quantityUnqualified != null "> and quantity_unqualified = #{quantityUnqualified}</if>
<if test="crRate != null "> and cr_rate = #{crRate}</if>
<if test="majRate != null "> and maj_rate = #{majRate}</if>
@ -129,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quantityMaxUnqualified != null">quantity_max_unqualified,</if>
<if test="quantityRecived != null">quantity_recived,</if>
<if test="quantityCheck != null">quantity_check,</if>
<if test="quantityQualified != null">quantity_qualified,</if>
<if test="quantityUnqualified != null">quantity_unqualified,</if>
<if test="crRate != null">cr_rate,</if>
<if test="majRate != null">maj_rate,</if>
@ -173,6 +176,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quantityMaxUnqualified != null">#{quantityMaxUnqualified},</if>
<if test="quantityRecived != null">#{quantityRecived},</if>
<if test="quantityCheck != null">#{quantityCheck},</if>
<if test="quantityQualified != null">#{quantityQualified},</if>
<if test="quantityUnqualified != null">#{quantityUnqualified},</if>
<if test="crRate != null">#{crRate},</if>
<if test="majRate != null">#{majRate},</if>
@ -242,6 +246,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quantityMaxUnqualified != null">quantity_max_unqualified = #{quantityMaxUnqualified},</if>
<if test="quantityRecived != null">quantity_recived = #{quantityRecived},</if>
<if test="quantityCheck != null">quantity_check = #{quantityCheck},</if>
<if test="quantityQualified != null">quantity_qualified = #{quantityQualified},</if>
<if test="quantityUnqualified != null">quantity_unqualified = #{quantityUnqualified},</if>
<if test="crRate != null">cr_rate = #{crRate},</if>
<if test="majRate != null">maj_rate = #{majRate},</if>

View File

@ -50,8 +50,8 @@
FROM
(
SELECT
wi.recpt_id as source_doc_id,
wi.recpt_code AS source_doc_code,
wi.notice_id as source_doc_id,
wi.notice_code AS source_doc_code,
wil.line_id AS source_line_id,
wi.create_time AS record_time,
'IQC' AS qc_type,
@ -60,7 +60,7 @@
wil.item_name,
wil.specification,
wil.unit_of_measure,
wil.quantity_recived AS quantity_uncheck,
wil.quantity_arrival AS quantity_uncheck,
NULL AS workorder_id,
NULL AS workorder_code,
NULL AS workorder_name,
@ -74,23 +74,25 @@
wi.vendor_code as vendor_client_code,
wi.vendor_name as vendor_client_name,
wi.vendor_nick as vendor_client_nick,
wil.batch_code,
wil.warehouse_id,
wil.warehouse_code,
wil.warehouse_name,
wil.location_id,
wil.location_code,
wil.location_name,
wil.area_id,
wil.area_code,
wil.area_name,
concat( wil.warehouse_name, wil.location_name, wil.area_name ) AS address
null as batch_code,
null as warehouse_id,
null as warehouse_code,
null as warehouse_name,
null as location_id,
NULL AS location_code,
NULL AS location_name,
NULL AS area_id,
NULL AS area_code,
NULL AS area_name,
NULL AS address
FROM
wm_item_recpt wi
LEFT JOIN wm_item_recpt_line wil ON wi.recpt_id = wil.recpt_id
wm_arrival_notice wi
LEFT JOIN wm_arrival_notice_line wil ON wi.notice_id = wil.notice_id
WHERE
wil.iqc_check = 'Y'
AND wil.iqc_id IS NULL UNION ALL
AND wil.iqc_id IS NULL
AND wi.status = 'APPROVING'
UNION ALL
SELECT
pf.record_id as source_doc_id,
pf.feedback_code AS source_doc_code,

View File

@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t.template_id, template_code, template_name, qc_types, enable_flag, t.remark
from qc_template t
left join qc_template_product tl on t.template_id = tl.template_id
where t.qc_types like concat('%',#{qcTypes},'%') and tl.item_id = #{itemId}
where t.qc_types like concat('%',#{qcTypes},'%') and tl.item_id = #{itemId} and t.enable_flag = 'Y'
limit 1;
</select>
@ -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
</select>

View File

@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmArrivalNoticeLineMapper">
<resultMap type="WmArrivalNoticeLine" id="WmArrivalNoticeLineResult">
<result property="lineId" column="line_id" />
<result property="noticeId" column="notice_id" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="specification" column="specification" />
<result property="unitOfMeasure" column="unit_of_measure" />
<result property="quantityArrival" column="quantity_arrival" />
<result property="quantityQuanlified" column="quantity_quanlified" />
<result property="iqcCheck" column="iqc_check" />
<result property="iqcId" column="iqc_id" />
<result property="iqcCode" column="iqc_code" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmArrivalNoticeLineVo">
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
</sql>
<select id="selectWmArrivalNoticeLineList" parameterType="WmArrivalNoticeLine" resultMap="WmArrivalNoticeLineResult">
<include refid="selectWmArrivalNoticeLineVo"/>
<where>
<if test="noticeId != null "> and notice_id = #{noticeId}</if>
<if test="itemId != null "> and item_id = #{itemId}</if>
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="quantityArrival != null "> and quantity_arrival = #{quantityArrival}</if>
<if test="quantityQuanlified != null "> and quantity_quanlified = #{quantityQuanlified}</if>
<if test="iqcCheck != null and iqcCheck != ''"> and iqc_check = #{iqcCheck}</if>
<if test="iqcId != null "> and iqc_id = #{iqcId}</if>
<if test="iqcCode != null and iqcCode != ''"> and iqc_code = #{iqcCode}</if>
</where>
</select>
<select id="selectWmArrivalNoticeLineByLineId" parameterType="Long" resultMap="WmArrivalNoticeLineResult">
<include refid="selectWmArrivalNoticeLineVo"/>
where line_id = #{lineId}
</select>
<select id="selectUncheckedLine" parameterType="Long" resultMap="WmArrivalNoticeLineResult">
<include refid="selectWmArrivalNoticeLineVo"/>
where notice_id = #{noticeId}
and iqc_check = 'Y'
and iqc_id is null
</select>
<insert id="insertWmArrivalNoticeLine" parameterType="WmArrivalNoticeLine" useGeneratedKeys="true" keyProperty="lineId">
insert into wm_arrival_notice_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noticeId != null">notice_id,</if>
<if test="itemId != null">item_id,</if>
<if test="itemCode != null">item_code,</if>
<if test="itemName != null">item_name,</if>
<if test="specification != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="quantityArrival != null">quantity_arrival,</if>
<if test="quantityQuanlified != null">quantity_quanlified,</if>
<if test="iqcCheck != null">iqc_check,</if>
<if test="iqcId != null">iqc_id,</if>
<if test="iqcCode != null">iqc_code,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noticeId != null">#{noticeId},</if>
<if test="itemId != null">#{itemId},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
<if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="quantityArrival != null">#{quantityArrival},</if>
<if test="quantityQuanlified != null">#{quantityQuanlified},</if>
<if test="iqcCheck != null">#{iqcCheck},</if>
<if test="iqcId != null">#{iqcId},</if>
<if test="iqcCode != null">#{iqcCode},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmArrivalNoticeLine" parameterType="WmArrivalNoticeLine">
update wm_arrival_notice_line
<trim prefix="SET" suffixOverrides=",">
<if test="noticeId != null">notice_id = #{noticeId},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="itemCode != null">item_code = #{itemCode},</if>
<if test="itemName != null">item_name = #{itemName},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="quantityArrival != null">quantity_arrival = #{quantityArrival},</if>
<if test="quantityQuanlified != null">quantity_quanlified = #{quantityQuanlified},</if>
<if test="iqcCheck != null">iqc_check = #{iqcCheck},</if>
<if test="iqcId != null">iqc_id = #{iqcId},</if>
<if test="iqcCode != null">iqc_code = #{iqcCode},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where line_id = #{lineId}
</update>
<delete id="deleteWmArrivalNoticeLineByLineId" parameterType="Long">
delete from wm_arrival_notice_line where line_id = #{lineId}
</delete>
<delete id="deleteWmArrivalNoticeLineByLineIds" parameterType="String">
delete from wm_arrival_notice_line where line_id in
<foreach item="lineId" collection="array" open="(" separator="," close=")">
#{lineId}
</foreach>
</delete>
<delete id="deleteByNoticeId" parameterType="Long">
delete from wm_arrival_notice_line where notice_id = #{noticeId}
</delete>
</mapper>

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmArrivalNoticeMapper">
<resultMap type="WmArrivalNotice" id="WmArrivalNoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeCode" column="notice_code" />
<result property="noticeName" column="notice_name" />
<result property="poCode" column="po_code" />
<result property="vendorId" column="vendor_id" />
<result property="vendorCode" column="vendor_code" />
<result property="vendorName" column="vendor_name" />
<result property="vendorNick" column="vendor_nick" />
<result property="arrivalDate" column="arrival_date" />
<result property="contact" column="contact" />
<result property="tel" column="tel" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmArrivalNoticeVo">
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
</sql>
<select id="selectWmArrivalNoticeList" parameterType="WmArrivalNotice" resultMap="WmArrivalNoticeResult">
<include refid="selectWmArrivalNoticeVo"/>
<where>
<if test="noticeCode != null and noticeCode != ''"> and notice_code = #{noticeCode}</if>
<if test="noticeName != null and noticeName != ''"> and notice_name like concat('%', #{noticeName}, '%')</if>
<if test="poCode != null and poCode != ''"> and po_code = #{poCode}</if>
<if test="vendorId != null "> and vendor_id = #{vendorId}</if>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
<if test="vendorName != null and vendorName != ''"> and vendor_name like concat('%', #{vendorName}, '%')</if>
<if test="vendorNick != null and vendorNick != ''"> and vendor_nick = #{vendorNick}</if>
<if test="contact != null and contact != ''"> and contact = #{contact}</if>
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
<if test="arrivalDate != null "> and arrival_date = #{arrivalDate}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectWmArrivalNoticeByNoticeId" parameterType="Long" resultMap="WmArrivalNoticeResult">
<include refid="selectWmArrivalNoticeVo"/>
where notice_id = #{noticeId}
</select>
<select id="checkRnCodeUnique" parameterType="WmArrivalNotice" resultMap="WmArrivalNoticeResult">
<include refid="selectWmArrivalNoticeVo"/>
where notice_code = #{noticeCode}
</select>
<insert id="insertWmArrivalNotice" parameterType="WmArrivalNotice" useGeneratedKeys="true" keyProperty="noticeId">
insert into wm_arrival_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noticeCode != null and noticeCode != ''">notice_code,</if>
<if test="noticeName != null and noticeName != ''">notice_name,</if>
<if test="poCode != null">po_code,</if>
<if test="vendorId != null">vendor_id,</if>
<if test="vendorCode != null">vendor_code,</if>
<if test="vendorName != null">vendor_name,</if>
<if test="vendorNick != null">vendor_nick,</if>
<if test="arrivalDate != null">arrival_date,</if>
<if test="contact != null">contact,</if>
<if test="tel != null">tel,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="attr4 != null">attr4,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noticeCode != null and noticeCode != ''">#{noticeCode},</if>
<if test="noticeName != null and noticeName != ''">#{noticeName},</if>
<if test="poCode != null">#{poCode},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="vendorCode != null">#{vendorCode},</if>
<if test="vendorName != null">#{vendorName},</if>
<if test="vendorNick != null">#{vendorNick},</if>
<if test="arrivalDate != null">#{arrivalDate},</if>
<if test="contact != null">#{contact},</if>
<if test="tel != null">#{tel},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="attr4 != null">#{attr4},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateWmArrivalNotice" parameterType="WmArrivalNotice">
update wm_arrival_notice
<trim prefix="SET" suffixOverrides=",">
<if test="noticeCode != null and noticeCode != ''">notice_code = #{noticeCode},</if>
<if test="noticeName != null and noticeName != ''">notice_name = #{noticeName},</if>
<if test="poCode != null">po_code = #{poCode},</if>
<if test="vendorId != null">vendor_id = #{vendorId},</if>
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>
<if test="vendorName != null">vendor_name = #{vendorName},</if>
<if test="vendorNick != null">vendor_nick = #{vendorNick},</if>
<if test="arrivalDate != null">arrival_date = #{arrivalDate},</if>
<if test="contact != null">contact = #{contact},</if>
<if test="tel != null">tel = #{tel},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="attr4 != null">attr4 = #{attr4},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where notice_id = #{noticeId}
</update>
<delete id="deleteWmArrivalNoticeByNoticeId" parameterType="Long">
delete from wm_arrival_notice where notice_id = #{noticeId}
</delete>
<delete id="deleteWmArrivalNoticeByNoticeIds" parameterType="String">
delete from wm_arrival_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
</mapper>

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="WmItemRecptLine" id="WmItemRecptLineResult">
<result property="lineId" column="line_id" />
<result property="recptId" column="recpt_id" />
<result property="noticeLineId" column="notice_line_id" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
@ -39,13 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWmItemRecptLineVo">
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
</sql>
<select id="selectWmItemRecptLineList" parameterType="WmItemRecptLine" resultMap="WmItemRecptLineResult">
<include refid="selectWmItemRecptLineVo"/>
<where>
<if test="recptId != null "> and recpt_id = #{recptId}</if>
<if test="noticeLineId != null "> and notice_line_id = #{noticeLineId}</if>
<if test="itemId != null "> and item_id = #{itemId}</if>
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
@ -76,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into wm_item_recpt_line
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="recptId != null">recpt_id,</if>
<if test="noticeLineId != null">notice_line_id,</if>
<if test="itemId != null">item_id,</if>
<if test="itemCode != null">item_code,</if>
<if test="itemName != null">item_name,</if>
@ -108,6 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="recptId != null">#{recptId},</if>
<if test="noticeLineId != null">#{noticeLineId},</if>
<if test="itemId != null">#{itemId},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
@ -144,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update wm_item_recpt_line
<trim prefix="SET" suffixOverrides=",">
<if test="recptId != null">recpt_id = #{recptId},</if>
<if test="noticeLineId != null">notice_line_id = #{noticeLineId},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="itemCode != null">item_code = #{itemCode},</if>
<if test="itemName != null">item_name = #{itemName},</if>

View File

@ -10,6 +10,8 @@
<result property="recptName" column="recpt_name" />
<result property="iqcId" column="iqc_id" />
<result property="iqcCode" column="iqc_code" />
<result property="noticeId" column="notice_id" />
<result property="noticeCode" column="notice_code" />
<result property="poCode" column="po_code" />
<result property="vendorId" column="vendor_id" />
<result property="vendorCode" column="vendor_code" />
@ -72,7 +74,7 @@
<sql id="selectWmItemRecptVo">
select recpt_id, recpt_code, recpt_name, iqc_id, iqc_code, po_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, recpt_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_item_recpt
select recpt_id, recpt_code, recpt_name, iqc_id, iqc_code, notice_id, notice_code,po_code, vendor_id, vendor_code, vendor_name, vendor_nick, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, recpt_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_item_recpt
</sql>
<select id="selectWmItemRecptList" parameterType="WmItemRecpt" resultMap="WmItemRecptResult">
@ -82,6 +84,8 @@
<if test="recptName != null and recptName != ''"> and recpt_name like concat('%', #{recptName}, '%')</if>
<if test="iqcId != null "> and iqc_id = #{iqcId}</if>
<if test="iqcCode != null and iqcCode != ''"> and iqc_code = #{iqcCode}</if>
<if test="noticeId != null "> and notice_id = #{noticeId}</if>
<if test="noticeCode != null and noticeCode != ''"> and notice_code = #{noticeCode}</if>
<if test="poCode != null and poCode != ''"> and po_code = #{poCode}</if>
<if test="vendorId != null "> and vendor_id = #{vendorId}</if>
<if test="vendorCode != null and vendorCode != ''"> and vendor_code = #{vendorCode}</if>
@ -134,6 +138,8 @@
<if test="recptName != null and recptName != ''">recpt_name,</if>
<if test="iqcId != null">iqc_id,</if>
<if test="iqcCode != null">iqc_code,</if>
<if test="noticeId != null">notice_id,</if>
<if test="noticeCode != null">notice_code,</if>
<if test="poCode != null">po_code,</if>
<if test="vendorId != null">vendor_id,</if>
<if test="vendorCode != null">vendor_code,</if>
@ -165,6 +171,8 @@
<if test="recptName != null and recptName != ''">#{recptName},</if>
<if test="iqcId != null">#{iqcId},</if>
<if test="iqcCode != null">#{iqcCode},</if>
<if test="noticeId != null">#{noticeId},</if>
<if test="noticeCode != null">#{noticeCode},</if>
<if test="poCode != null">#{poCode},</if>
<if test="vendorId != null">#{vendorId},</if>
<if test="vendorCode != null">#{vendorCode},</if>
@ -200,6 +208,8 @@
<if test="recptName != null and recptName != ''">recpt_name = #{recptName},</if>
<if test="iqcId != null">iqc_id = #{iqcId},</if>
<if test="iqcCode != null">iqc_code = #{iqcCode},</if>
<if test="noticeId != null">notice_id = #{noticeId},</if>
<if test="noticeCode != null">notice_code = #{noticeCode},</if>
<if test="poCode != null">po_code = #{poCode},</if>
<if test="vendorId != null">vendor_id = #{vendorId},</if>
<if test="vendorCode != null">vendor_code = #{vendorCode},</if>