生产领料库存核心
This commit is contained in:
parent
b0259439ca
commit
a66f554a50
@ -359,6 +359,7 @@ drop table if exists wm_issue_line;
|
||||
create table wm_issue_line (
|
||||
line_id bigint(20) not null auto_increment comment '行ID',
|
||||
issue_id bigint(20) comment '领料单ID',
|
||||
material_stock_id bigint(20) comment '库存ID',
|
||||
item_id bigint(20) not null comment '产品物料ID',
|
||||
item_code varchar(64) comment '产品物料编码',
|
||||
item_name varchar(255) comment '产品物料名称',
|
||||
|
@ -122,12 +122,12 @@ public class UserConstants
|
||||
*/
|
||||
public static final String TRANSACTION_TYPE_ITEM_RECPT = "ITEM_RECPT"; //原材料接收入库
|
||||
public static final String TRANSACTION_TYPE_ITEM_RTV = "ITEM_RTV"; //原材料退回供应商
|
||||
public static final String TRANSACTION_TYPE_ITEM_ISSUE = "ITEM_ISSUE"; //原材料领用出库
|
||||
public static final String TRANSACTION_TYPE_ITEM_RS = "ITEM_RS"; //原材料退库
|
||||
public static final String TRANSACTION_TYPE_ITEM_ISSUE = "ITEM_ISSUE"; //生产领用
|
||||
public static final String TRANSACTION_TYPE_ITEM_RS = "ITEM_RS"; //生产退库
|
||||
public static final String TRANSACTION_TYPE_WAREHOUSE_TRANS_OUT = "TRANS_OUT"; //移库,移出
|
||||
public static final String TRANSACTION_TYPE_WAREHOUSE_TRANS_IN = "TRANS_IN"; //移库,移入
|
||||
public static final String TRANSACTION_TYPE_PRODUCT_ISSUE = "PRODUCT_ISSUE"; //产品出库
|
||||
public static final String TRANSACTION_TYPE_PRODUCT_RS = "PRODUCT_RS"; //产品退货
|
||||
public static final String TRANSACTION_TYPE_PRODUCT_ISSUE = "PRODUCT_ISSUE"; //销售出库
|
||||
public static final String TRANSACTION_TYPE_PRODUCT_RS = "PRODUCT_RS"; //销售退货
|
||||
public static final String TRANSACTION_TYPE_MISC_RECPT = "MISC_RECPT"; //杂项入库
|
||||
public static final String TRANSACTION_TYPE_MISC_ISSUE = "MISC_ISSUE"; //杂项出库
|
||||
|
||||
|
@ -3,8 +3,13 @@ package com.ktg.mes.wm.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.wm.domain.WmIssueLine;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.service.IStorageCoreService;
|
||||
import com.ktg.mes.wm.service.IWmIssueLineService;
|
||||
import com.ktg.mes.wm.service.IWmStorageAreaService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -41,6 +46,9 @@ public class WmIssueHeaderController extends BaseController
|
||||
@Autowired
|
||||
private IWmIssueLineService wmIssueLineService;
|
||||
|
||||
@Autowired
|
||||
private IStorageCoreService storageCoreService;
|
||||
|
||||
/**
|
||||
* 查询生产领料单头列表
|
||||
*/
|
||||
@ -120,4 +128,34 @@ public class WmIssueHeaderController extends BaseController
|
||||
|
||||
return toAjax(wmIssueHeaderService.deleteWmIssueHeaderByIssueIds(issueIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行出库
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:wm:issueheader:edit')")
|
||||
@Log(title = "生产领料单头", businessType = BusinessType.UPDATE)
|
||||
@Transactional
|
||||
@PutMapping("/{issueId}")
|
||||
public AjaxResult execute(@PathVariable Long issueId){
|
||||
WmIssueHeader header = wmIssueHeaderService.selectWmIssueHeaderByIssueId(issueId);
|
||||
WmIssueLine param = new WmIssueLine();
|
||||
param.setIssueId(issueId);
|
||||
List<WmIssueLine> lines = wmIssueLineService.selectWmIssueLineList(param);
|
||||
if(CollUtil.isEmpty(lines)){
|
||||
return AjaxResult.error("请指定领出的物资");
|
||||
}
|
||||
|
||||
List<IssueTxBean> beans = wmIssueHeaderService.getTxBeans(issueId);
|
||||
|
||||
//调用库存核心
|
||||
storageCoreService.processIssue(beans);
|
||||
|
||||
//更新单据状态
|
||||
header.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmIssueHeaderService.updateWmIssueHeader(header);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -206,10 +206,8 @@ public class WmItemRecptController extends BaseController
|
||||
storageCoreService.processItemRecpt(beans);
|
||||
|
||||
//更新单据状态
|
||||
WmItemRecpt wmItemRecpt =wmItemRecptService.selectWmItemRecptByRecptId(recptId);
|
||||
wmItemRecpt.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmItemRecptService.updateWmItemRecpt(wmItemRecpt);
|
||||
|
||||
recpt.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||
wmItemRecptService.updateWmItemRecpt(recpt);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ public class WmIssueLine extends BaseEntity
|
||||
@Excel(name = "领料单ID")
|
||||
private Long issueId;
|
||||
|
||||
private Long materialStockId;
|
||||
|
||||
/** 产品物料ID */
|
||||
@Excel(name = "产品物料ID")
|
||||
private Long itemId;
|
||||
@ -122,6 +124,14 @@ public class WmIssueLine extends BaseEntity
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public Long getMaterialStockId() {
|
||||
return materialStockId;
|
||||
}
|
||||
|
||||
public void setMaterialStockId(Long materialStockId) {
|
||||
this.materialStockId = materialStockId;
|
||||
}
|
||||
|
||||
public Long getItemId()
|
||||
{
|
||||
return itemId;
|
||||
|
269
ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/IssueTxBean.java
Normal file
269
ktg-mes/src/main/java/com/ktg/mes/wm/domain/tx/IssueTxBean.java
Normal file
@ -0,0 +1,269 @@
|
||||
package com.ktg.mes.wm.domain.tx;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class IssueTxBean extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long materialStockId;
|
||||
|
||||
/** 产品物料ID */
|
||||
private Long itemId;
|
||||
|
||||
/** 产品物料编码 */
|
||||
private String itemCode;
|
||||
|
||||
/** 产品物料名称 */
|
||||
private String itemName;
|
||||
|
||||
/** 规格型号 */
|
||||
private String specification;
|
||||
|
||||
/** 单位 */
|
||||
private String unitOfMeasure;
|
||||
|
||||
/** 批次号 */
|
||||
private String batchCode;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
private String warehouseName;
|
||||
|
||||
/** 库区ID */
|
||||
private Long locationId;
|
||||
|
||||
/** 库区编码 */
|
||||
private String locationCode;
|
||||
|
||||
/** 库区名称 */
|
||||
private String locationName;
|
||||
|
||||
/** 库位ID */
|
||||
private Long areaId;
|
||||
|
||||
/** 库位编码 */
|
||||
private String areaCode;
|
||||
|
||||
/** 库位名称 */
|
||||
private String areaName;
|
||||
|
||||
/** 单据类型 */
|
||||
private String sourceDocType;
|
||||
|
||||
/** 单据ID */
|
||||
private Long sourceDocId;
|
||||
|
||||
/** 单据编号 */
|
||||
private String sourceDocCode;
|
||||
|
||||
/** 单据行ID */
|
||||
private Long sourceDocLineId;
|
||||
|
||||
/** 事务数量 */
|
||||
private BigDecimal transactionQuantity;
|
||||
|
||||
public Long getMaterialStockId() {
|
||||
return materialStockId;
|
||||
}
|
||||
|
||||
public void setMaterialStockId(Long materialStockId) {
|
||||
this.materialStockId = materialStockId;
|
||||
}
|
||||
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public String getItemCode() {
|
||||
return itemCode;
|
||||
}
|
||||
|
||||
public void setItemCode(String itemCode) {
|
||||
this.itemCode = itemCode;
|
||||
}
|
||||
|
||||
public String getItemName() {
|
||||
return itemName;
|
||||
}
|
||||
|
||||
public void setItemName(String itemName) {
|
||||
this.itemName = itemName;
|
||||
}
|
||||
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getUnitOfMeasure() {
|
||||
return unitOfMeasure;
|
||||
}
|
||||
|
||||
public void setUnitOfMeasure(String unitOfMeasure) {
|
||||
this.unitOfMeasure = unitOfMeasure;
|
||||
}
|
||||
|
||||
public String getBatchCode() {
|
||||
return batchCode;
|
||||
}
|
||||
|
||||
public void setBatchCode(String batchCode) {
|
||||
this.batchCode = batchCode;
|
||||
}
|
||||
|
||||
public Long getWarehouseId() {
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseId(Long warehouseId) {
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseCode() {
|
||||
return warehouseCode;
|
||||
}
|
||||
|
||||
public void setWarehouseCode(String warehouseCode) {
|
||||
this.warehouseCode = warehouseCode;
|
||||
}
|
||||
|
||||
public String getWarehouseName() {
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName) {
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public Long getLocationId() {
|
||||
return locationId;
|
||||
}
|
||||
|
||||
public void setLocationId(Long locationId) {
|
||||
this.locationId = locationId;
|
||||
}
|
||||
|
||||
public String getLocationCode() {
|
||||
return locationCode;
|
||||
}
|
||||
|
||||
public void setLocationCode(String locationCode) {
|
||||
this.locationCode = locationCode;
|
||||
}
|
||||
|
||||
public String getLocationName() {
|
||||
return locationName;
|
||||
}
|
||||
|
||||
public void setLocationName(String locationName) {
|
||||
this.locationName = locationName;
|
||||
}
|
||||
|
||||
public Long getAreaId() {
|
||||
return areaId;
|
||||
}
|
||||
|
||||
public void setAreaId(Long areaId) {
|
||||
this.areaId = areaId;
|
||||
}
|
||||
|
||||
public String getAreaCode() {
|
||||
return areaCode;
|
||||
}
|
||||
|
||||
public void setAreaCode(String areaCode) {
|
||||
this.areaCode = areaCode;
|
||||
}
|
||||
|
||||
public String getAreaName() {
|
||||
return areaName;
|
||||
}
|
||||
|
||||
public void setAreaName(String areaName) {
|
||||
this.areaName = areaName;
|
||||
}
|
||||
|
||||
public String getSourceDocType() {
|
||||
return sourceDocType;
|
||||
}
|
||||
|
||||
public void setSourceDocType(String sourceDocType) {
|
||||
this.sourceDocType = sourceDocType;
|
||||
}
|
||||
|
||||
public Long getSourceDocId() {
|
||||
return sourceDocId;
|
||||
}
|
||||
|
||||
public void setSourceDocId(Long sourceDocId) {
|
||||
this.sourceDocId = sourceDocId;
|
||||
}
|
||||
|
||||
public String getSourceDocCode() {
|
||||
return sourceDocCode;
|
||||
}
|
||||
|
||||
public void setSourceDocCode(String sourceDocCode) {
|
||||
this.sourceDocCode = sourceDocCode;
|
||||
}
|
||||
|
||||
public Long getSourceDocLineId() {
|
||||
return sourceDocLineId;
|
||||
}
|
||||
|
||||
public void setSourceDocLineId(Long sourceDocLineId) {
|
||||
this.sourceDocLineId = sourceDocLineId;
|
||||
}
|
||||
|
||||
public BigDecimal getTransactionQuantity() {
|
||||
return transactionQuantity;
|
||||
}
|
||||
|
||||
public void setTransactionQuantity(BigDecimal transactionQuantity) {
|
||||
this.transactionQuantity = transactionQuantity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "IssueTxBean{" +
|
||||
"materialStockId=" + materialStockId +
|
||||
", itemId=" + itemId +
|
||||
", itemCode='" + itemCode + '\'' +
|
||||
", itemName='" + itemName + '\'' +
|
||||
", specification='" + specification + '\'' +
|
||||
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||
", batchCode='" + batchCode + '\'' +
|
||||
", warehouseId=" + warehouseId +
|
||||
", warehouseCode='" + warehouseCode + '\'' +
|
||||
", warehouseName='" + warehouseName + '\'' +
|
||||
", locationId=" + locationId +
|
||||
", locationCode='" + locationCode + '\'' +
|
||||
", locationName='" + locationName + '\'' +
|
||||
", areaId=" + areaId +
|
||||
", areaCode='" + areaCode + '\'' +
|
||||
", areaName='" + areaName + '\'' +
|
||||
", sourceDocType='" + sourceDocType + '\'' +
|
||||
", sourceDocId=" + sourceDocId +
|
||||
", sourceDocCode='" + sourceDocCode + '\'' +
|
||||
", sourceDocLineId=" + sourceDocLineId +
|
||||
", transactionQuantity=" + transactionQuantity +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmIssueHeader;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
|
||||
/**
|
||||
* 生产领料单头Mapper接口
|
||||
@ -65,4 +66,8 @@ public interface WmIssueHeaderMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmIssueHeaderByIssueIds(Long[] issueIds);
|
||||
|
||||
|
||||
public List<IssueTxBean> getTxBeans(Long issueId);
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ktg.mes.wm.service;
|
||||
|
||||
import com.ktg.mes.wm.domain.WmItemRecptLine;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.ItemRecptTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.RtVendorTxBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -22,5 +23,10 @@ public interface IStorageCoreService {
|
||||
*/
|
||||
public void processRtVendor(List<RtVendorTxBean> lines);
|
||||
|
||||
/**
|
||||
* 处理生产领料
|
||||
* @param lines
|
||||
*/
|
||||
public void processIssue(List<IssueTxBean> lines);
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.wm.domain.WmIssueHeader;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
|
||||
/**
|
||||
* 生产领料单头Service接口
|
||||
@ -65,4 +66,6 @@ public interface IWmIssueHeaderService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmIssueHeaderByIssueId(Long issueId);
|
||||
|
||||
public List<IssueTxBean> getTxBeans(Long issueId);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.exception.BussinessException;
|
||||
import com.ktg.common.utils.bean.BeanUtils;
|
||||
import com.ktg.mes.wm.domain.WmTransaction;
|
||||
import com.ktg.mes.wm.domain.tx.IssueTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.ItemRecptTxBean;
|
||||
import com.ktg.mes.wm.domain.tx.RtVendorTxBean;
|
||||
import com.ktg.mes.wm.service.IStorageCoreService;
|
||||
@ -73,4 +74,22 @@ public class StorageCoreServiceImpl implements IStorageCoreService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processIssue(List<IssueTxBean> lines) {
|
||||
String transactionType = UserConstants.TRANSACTION_TYPE_ITEM_ISSUE;
|
||||
if(CollUtil.isEmpty(lines)){
|
||||
throw new BussinessException("没有需要处理的领料单行");
|
||||
}
|
||||
|
||||
for(int i=0;i<lines.size();i++){
|
||||
IssueTxBean line = lines.get(i);
|
||||
WmTransaction transaction = new WmTransaction();
|
||||
transaction.setTransactionType(transactionType);
|
||||
BeanUtils.copyBeanProp(transaction,line);
|
||||
transaction.setTransactionFlag(-1);//库存减少
|
||||
transaction.setTransactionDate(new Date());
|
||||
wmTransactionService.processTransaction(transaction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ 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.tx.IssueTxBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.wm.mapper.WmIssueHeaderMapper;
|
||||
@ -106,4 +107,9 @@ public class WmIssueHeaderServiceImpl implements IWmIssueHeaderService
|
||||
{
|
||||
return wmIssueHeaderMapper.deleteWmIssueHeaderByIssueId(issueId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IssueTxBean> getTxBeans(Long issueId) {
|
||||
return wmIssueHeaderMapper.getTxBeans(issueId);
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="IssueTxBeanResult" type="IssueTxBean">
|
||||
<result property="materialStockId" column="material_stock_id"></result>
|
||||
<result property="itemId" column="item_id"></result>
|
||||
<result property="itemCode" column="item_code"></result>
|
||||
<result property="itemName" column="item_name"></result>
|
||||
<result property="specification" column="specification"></result>
|
||||
<result property="unitOfMeasure" column="unit_of_measure"></result>
|
||||
<result property="batchCode" column="batch_code"></result>
|
||||
<result property="warehouseId" column="warehouse_id"></result>
|
||||
<result property="warehouseCode" column="warehouse_code"></result>
|
||||
<result property="warehouseName" column="warehouse_name"></result>
|
||||
<result property="locationId" column="location_id"></result>
|
||||
<result property="locationCode" column="location_code"></result>
|
||||
<result property="locationName" column="location_name"></result>
|
||||
<result property="areaId" column="area_id"></result>
|
||||
<result property="areaCode" column="area_code"></result>
|
||||
<result property="areaName" column="area_name"></result>
|
||||
<result property="vendorId" column="vendor_id"></result>
|
||||
<result property="vendorCode" column="vendor_code"></result>
|
||||
<result property="vendorName" column="vendor_name"></result>
|
||||
<result property="vendorNick" column="vendor_nick"></result>
|
||||
<result property="sourceDocType" column="source_doc_type"></result>
|
||||
<result property="sourceDocId" column="source_doc_id"></result>
|
||||
<result property="sourceDocCode" column="source_doc_code"></result>
|
||||
<result property="sourceDocLineId" column="source_doc_line_id"></result>
|
||||
<result property="transactionQuantity" column="transaction_quantity"></result>
|
||||
<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="selectWmIssueHeaderVo">
|
||||
select issue_id, issue_code, issue_name, workstation_id, workstation_code, workorder_id, workorder_code, task_id, task_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, issue_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_issue_header
|
||||
</sql>
|
||||
@ -75,6 +107,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where issue_code = #{issueCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getTxBeans" parameterType="Long" resultMap="IssueTxBeanResult">
|
||||
SELECT irl.material_stock_id, irl.`item_id`,irl.`item_code`,irl.`item_name`,irl.`specification`,irl.`unit_of_measure`,irl.`batch_code`,
|
||||
irl.`warehouse_id`,irl.`warehouse_code`,irl.`warehouse_name`,irl.`location_id`,irl.`location_code`,irl.`location_name`,irl.`area_id`,irl.`area_code`,irl.`area_name`,
|
||||
'IR' AS source_doc_type,ir.`recpt_id` AS source_doc_id,ir.`recpt_code` AS source_doc_code,irl.`line_id` AS source_doc_line_id,
|
||||
irl.`quantity_issued` AS transaction_quantity,irl.`expire_date`,
|
||||
ir.`create_by`,ir.`create_time`,ir.`update_by`,ir.`update_time`
|
||||
FROM wm_issue_header ir
|
||||
LEFT JOIN wm_issue_line irl
|
||||
ON ir.issue_id = irl.`issue_id`
|
||||
WHERE ir.`issue_id` = #{issueId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmIssueHeader" parameterType="WmIssueHeader" useGeneratedKeys="true" keyProperty="issueId">
|
||||
insert into wm_issue_header
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="WmIssueLine" id="WmIssueLineResult">
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="issueId" column="issue_id" />
|
||||
<result property="materialStockId" column="material_stock_id" />
|
||||
<result property="itemId" column="item_id" />
|
||||
<result property="itemCode" column="item_code" />
|
||||
<result property="itemName" column="item_name" />
|
||||
@ -35,13 +36,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmIssueLineVo">
|
||||
select line_id, issue_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_issued, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_issue_line
|
||||
select line_id, issue_id,material_stock_id, item_id, item_code, item_name, specification, unit_of_measure, quantity_issued, batch_code, warehouse_id, warehouse_code, warehouse_name, location_id, location_code, location_name, area_id, area_code, area_name, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_issue_line
|
||||
</sql>
|
||||
|
||||
<select id="selectWmIssueLineList" parameterType="WmIssueLine" resultMap="WmIssueLineResult">
|
||||
<include refid="selectWmIssueLineVo"/>
|
||||
<where>
|
||||
<if test="issueId != null "> and issue_id = #{issueId}</if>
|
||||
<if test="materialStockId != null"> and material_stock_id = #{materialStockId}</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>
|
||||
@ -70,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into wm_issue_line
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="issueId != null">issue_id,</if>
|
||||
<if test="materialStockId != null ">material_stock_id,</if>
|
||||
<if test="itemId != null">item_id,</if>
|
||||
<if test="itemCode != null">item_code,</if>
|
||||
<if test="itemName != null">item_name,</if>
|
||||
@ -98,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="issueId != null">#{issueId},</if>
|
||||
<if test="materialStockId != null ">#{materialStockId},</if>
|
||||
<if test="itemId != null">#{itemId},</if>
|
||||
<if test="itemCode != null">#{itemCode},</if>
|
||||
<if test="itemName != null">#{itemName},</if>
|
||||
@ -130,6 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update wm_issue_line
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="issueId != null">issue_id = #{issueId},</if>
|
||||
<if test="materialStockId != null">material_stock_id = #{materialStockId},</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>
|
||||
|
Loading…
Reference in New Issue
Block a user