库存转移
This commit is contained in:
parent
4b31c0b804
commit
9da8e38306
@ -8,6 +8,7 @@ import com.ktg.common.utils.StringUtils;
|
|||||||
import com.ktg.mes.wm.domain.WmStorageArea;
|
import com.ktg.mes.wm.domain.WmStorageArea;
|
||||||
import com.ktg.mes.wm.domain.WmStorageLocation;
|
import com.ktg.mes.wm.domain.WmStorageLocation;
|
||||||
import com.ktg.mes.wm.domain.WmWarehouse;
|
import com.ktg.mes.wm.domain.WmWarehouse;
|
||||||
|
import com.ktg.mes.wm.domain.tx.TransferTxBean;
|
||||||
import com.ktg.mes.wm.service.*;
|
import com.ktg.mes.wm.service.*;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -48,12 +49,13 @@ public class WmTransferController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWmWarehouseService wmWarehouseService;
|
private IWmWarehouseService wmWarehouseService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStorageCoreService storageCoreService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询转移单列表
|
* 查询转移单列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:list')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(WmTransfer wmTransfer)
|
public TableDataInfo list(WmTransfer wmTransfer)
|
||||||
{
|
{
|
||||||
@ -65,7 +67,7 @@ public class WmTransferController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出转移单列表
|
* 导出转移单列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:export')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:export')")
|
||||||
@Log(title = "转移单", businessType = BusinessType.EXPORT)
|
@Log(title = "转移单", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, WmTransfer wmTransfer)
|
public void export(HttpServletResponse response, WmTransfer wmTransfer)
|
||||||
@ -78,7 +80,7 @@ public class WmTransferController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取转移单详细信息
|
* 获取转移单详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:query')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:query')")
|
||||||
@GetMapping(value = "/{transferId}")
|
@GetMapping(value = "/{transferId}")
|
||||||
public AjaxResult getInfo(@PathVariable("transferId") Long transferId)
|
public AjaxResult getInfo(@PathVariable("transferId") Long transferId)
|
||||||
{
|
{
|
||||||
@ -88,7 +90,7 @@ public class WmTransferController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增转移单
|
* 新增转移单
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:add')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:add')")
|
||||||
@Log(title = "转移单", businessType = BusinessType.INSERT)
|
@Log(title = "转移单", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody WmTransfer wmTransfer)
|
public AjaxResult add(@RequestBody WmTransfer wmTransfer)
|
||||||
@ -114,7 +116,7 @@ public class WmTransferController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改转移单
|
* 修改转移单
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:edit')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:edit')")
|
||||||
@Log(title = "转移单", businessType = BusinessType.UPDATE)
|
@Log(title = "转移单", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody WmTransfer wmTransfer)
|
public AjaxResult edit(@RequestBody WmTransfer wmTransfer)
|
||||||
@ -138,7 +140,7 @@ public class WmTransferController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除转移单
|
* 删除转移单
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('wm:transfer:remove')")
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:remove')")
|
||||||
@Log(title = "转移单", businessType = BusinessType.DELETE)
|
@Log(title = "转移单", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{transferIds}")
|
@DeleteMapping("/{transferIds}")
|
||||||
@Transactional
|
@Transactional
|
||||||
@ -150,4 +152,27 @@ public class WmTransferController extends BaseController
|
|||||||
}
|
}
|
||||||
return toAjax(wmTransferService.deleteWmTransferByTransferIds(transferIds));
|
return toAjax(wmTransferService.deleteWmTransferByTransferIds(transferIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行退货
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('mes:wm:transfer:edit')")
|
||||||
|
@Log(title = "转移单", businessType = BusinessType.UPDATE)
|
||||||
|
@Transactional
|
||||||
|
@PutMapping("/{transferId}")
|
||||||
|
public AjaxResult execute(@PathVariable Long transferId){
|
||||||
|
WmTransfer transfer = wmTransferService.selectWmTransferByTransferId(transferId);
|
||||||
|
List<TransferTxBean> beans = wmTransferService.getTxBeans(transferId);
|
||||||
|
|
||||||
|
if(CollectionUtils.isEmpty(beans)){
|
||||||
|
return AjaxResult.error("请添加转移单行信息!");
|
||||||
|
}
|
||||||
|
|
||||||
|
storageCoreService.processTransfer(beans);
|
||||||
|
|
||||||
|
|
||||||
|
transfer.setStatus(UserConstants.ORDER_STATUS_FINISHED);
|
||||||
|
wmTransferService.updateWmTransfer(transfer);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,470 @@
|
|||||||
|
package com.ktg.mes.wm.domain.tx;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ktg.common.annotation.Excel;
|
||||||
|
import com.ktg.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class TransferTxBean 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;
|
||||||
|
|
||||||
|
private String workorderId;
|
||||||
|
|
||||||
|
private String workorderCode;
|
||||||
|
|
||||||
|
/** 供应商ID */
|
||||||
|
private Long vendorId;
|
||||||
|
|
||||||
|
/** 供应商编号 */
|
||||||
|
private String vendorCode;
|
||||||
|
|
||||||
|
/** 供应商名称 */
|
||||||
|
private String vendorName;
|
||||||
|
|
||||||
|
/** 供应商简称 */
|
||||||
|
private String vendorNick;
|
||||||
|
|
||||||
|
/** 移出仓库ID */
|
||||||
|
private Long fromWarehouseId;
|
||||||
|
|
||||||
|
/** 移出仓库编码 */
|
||||||
|
private String fromWarehouseCode;
|
||||||
|
|
||||||
|
/** 移出仓库名称 */
|
||||||
|
private String fromWarehouseName;
|
||||||
|
|
||||||
|
/** 移出库区ID */
|
||||||
|
private Long fromLocationId;
|
||||||
|
|
||||||
|
/** 移出库区编码 */
|
||||||
|
private String fromLocationCode;
|
||||||
|
|
||||||
|
/** 移出库区名称 */
|
||||||
|
private String fromLocationName;
|
||||||
|
|
||||||
|
/** 移出库位ID */
|
||||||
|
private Long fromAreaId;
|
||||||
|
|
||||||
|
/** 移出库位编码 */
|
||||||
|
private String fromAreaCode;
|
||||||
|
|
||||||
|
/** 移出库位名称 */
|
||||||
|
private String fromAreaName;
|
||||||
|
|
||||||
|
/** 移入仓库ID */
|
||||||
|
private Long toWarehouseId;
|
||||||
|
|
||||||
|
/** 移入仓库编码 */
|
||||||
|
private String toWarehouseCode;
|
||||||
|
|
||||||
|
/** 移入仓库名称 */
|
||||||
|
private String toWarehouseName;
|
||||||
|
|
||||||
|
/** 移入库区ID */
|
||||||
|
private Long toLocationId;
|
||||||
|
|
||||||
|
/** 移入库区编码 */
|
||||||
|
private String toLocationCode;
|
||||||
|
|
||||||
|
/** 移入库区名称 */
|
||||||
|
private String toLocationName;
|
||||||
|
|
||||||
|
/** 移入库位ID */
|
||||||
|
private Long toAreaId;
|
||||||
|
|
||||||
|
/** 移入库位编码 */
|
||||||
|
private String toAreaCode;
|
||||||
|
|
||||||
|
/** 移入库位名称 */
|
||||||
|
private String toAreaName;
|
||||||
|
|
||||||
|
private Date recptDate;
|
||||||
|
|
||||||
|
/** 有效期 */
|
||||||
|
private Date expireDate;
|
||||||
|
|
||||||
|
/** 单据类型 */
|
||||||
|
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 String getWorkorderId() {
|
||||||
|
return workorderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkorderId(String workorderId) {
|
||||||
|
this.workorderId = workorderId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkorderCode() {
|
||||||
|
return workorderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkorderCode(String workorderCode) {
|
||||||
|
this.workorderCode = workorderCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getVendorId() {
|
||||||
|
return vendorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVendorId(Long vendorId) {
|
||||||
|
this.vendorId = vendorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorCode() {
|
||||||
|
return vendorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVendorCode(String vendorCode) {
|
||||||
|
this.vendorCode = vendorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorName() {
|
||||||
|
return vendorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVendorName(String vendorName) {
|
||||||
|
this.vendorName = vendorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorNick() {
|
||||||
|
return vendorNick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVendorNick(String vendorNick) {
|
||||||
|
this.vendorNick = vendorNick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFromWarehouseId() {
|
||||||
|
return fromWarehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromWarehouseId(Long fromWarehouseId) {
|
||||||
|
this.fromWarehouseId = fromWarehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromWarehouseCode() {
|
||||||
|
return fromWarehouseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromWarehouseCode(String fromWarehouseCode) {
|
||||||
|
this.fromWarehouseCode = fromWarehouseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromWarehouseName() {
|
||||||
|
return fromWarehouseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromWarehouseName(String fromWarehouseName) {
|
||||||
|
this.fromWarehouseName = fromWarehouseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFromLocationId() {
|
||||||
|
return fromLocationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromLocationId(Long fromLocationId) {
|
||||||
|
this.fromLocationId = fromLocationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromLocationCode() {
|
||||||
|
return fromLocationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromLocationCode(String fromLocationCode) {
|
||||||
|
this.fromLocationCode = fromLocationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromLocationName() {
|
||||||
|
return fromLocationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromLocationName(String fromLocationName) {
|
||||||
|
this.fromLocationName = fromLocationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFromAreaId() {
|
||||||
|
return fromAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromAreaId(Long fromAreaId) {
|
||||||
|
this.fromAreaId = fromAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromAreaCode() {
|
||||||
|
return fromAreaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromAreaCode(String fromAreaCode) {
|
||||||
|
this.fromAreaCode = fromAreaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFromAreaName() {
|
||||||
|
return fromAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromAreaName(String fromAreaName) {
|
||||||
|
this.fromAreaName = fromAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getToWarehouseId() {
|
||||||
|
return toWarehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToWarehouseId(Long toWarehouseId) {
|
||||||
|
this.toWarehouseId = toWarehouseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToWarehouseCode() {
|
||||||
|
return toWarehouseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToWarehouseCode(String toWarehouseCode) {
|
||||||
|
this.toWarehouseCode = toWarehouseCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToWarehouseName() {
|
||||||
|
return toWarehouseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToWarehouseName(String toWarehouseName) {
|
||||||
|
this.toWarehouseName = toWarehouseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getToLocationId() {
|
||||||
|
return toLocationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToLocationId(Long toLocationId) {
|
||||||
|
this.toLocationId = toLocationId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToLocationCode() {
|
||||||
|
return toLocationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToLocationCode(String toLocationCode) {
|
||||||
|
this.toLocationCode = toLocationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToLocationName() {
|
||||||
|
return toLocationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToLocationName(String toLocationName) {
|
||||||
|
this.toLocationName = toLocationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getToAreaId() {
|
||||||
|
return toAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToAreaId(Long toAreaId) {
|
||||||
|
this.toAreaId = toAreaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToAreaCode() {
|
||||||
|
return toAreaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToAreaCode(String toAreaCode) {
|
||||||
|
this.toAreaCode = toAreaCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToAreaName() {
|
||||||
|
return toAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToAreaName(String toAreaName) {
|
||||||
|
this.toAreaName = toAreaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getExpireDate() {
|
||||||
|
return expireDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpireDate(Date expireDate) {
|
||||||
|
this.expireDate = expireDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getRecptDate() {
|
||||||
|
return recptDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecptDate(Date recptDate) {
|
||||||
|
this.recptDate = recptDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 "TransferTxBean{" +
|
||||||
|
"materialStockId=" + materialStockId +
|
||||||
|
", itemId=" + itemId +
|
||||||
|
", itemCode='" + itemCode + '\'' +
|
||||||
|
", itemName='" + itemName + '\'' +
|
||||||
|
", specification='" + specification + '\'' +
|
||||||
|
", unitOfMeasure='" + unitOfMeasure + '\'' +
|
||||||
|
", batchCode='" + batchCode + '\'' +
|
||||||
|
", workorderId='" + workorderId + '\'' +
|
||||||
|
", workorderCode='" + workorderCode + '\'' +
|
||||||
|
", vendorId=" + vendorId +
|
||||||
|
", vendorCode='" + vendorCode + '\'' +
|
||||||
|
", vendorName='" + vendorName + '\'' +
|
||||||
|
", vendorNick='" + vendorNick + '\'' +
|
||||||
|
", fromWarehouseId=" + fromWarehouseId +
|
||||||
|
", fromWarehouseCode='" + fromWarehouseCode + '\'' +
|
||||||
|
", fromWarehouseName='" + fromWarehouseName + '\'' +
|
||||||
|
", fromLocationId=" + fromLocationId +
|
||||||
|
", fromLocationCode='" + fromLocationCode + '\'' +
|
||||||
|
", fromLocationName='" + fromLocationName + '\'' +
|
||||||
|
", fromAreaId=" + fromAreaId +
|
||||||
|
", fromAreaCode='" + fromAreaCode + '\'' +
|
||||||
|
", fromAreaName='" + fromAreaName + '\'' +
|
||||||
|
", toWarehouseId=" + toWarehouseId +
|
||||||
|
", toWarehouseCode='" + toWarehouseCode + '\'' +
|
||||||
|
", toWarehouseName='" + toWarehouseName + '\'' +
|
||||||
|
", toLocationId=" + toLocationId +
|
||||||
|
", toLocationCode='" + toLocationCode + '\'' +
|
||||||
|
", toLocationName='" + toLocationName + '\'' +
|
||||||
|
", toAreaId=" + toAreaId +
|
||||||
|
", toAreaCode='" + toAreaCode + '\'' +
|
||||||
|
", toAreaName='" + toAreaName + '\'' +
|
||||||
|
", recptDate=" + recptDate +
|
||||||
|
", expireDate=" + expireDate +
|
||||||
|
", 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 java.util.List;
|
||||||
import com.ktg.mes.wm.domain.WmTransfer;
|
import com.ktg.mes.wm.domain.WmTransfer;
|
||||||
|
import com.ktg.mes.wm.domain.tx.TransferTxBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转移单Mapper接口
|
* 转移单Mapper接口
|
||||||
@ -27,6 +28,9 @@ public interface WmTransferMapper
|
|||||||
*/
|
*/
|
||||||
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
||||||
|
|
||||||
|
|
||||||
|
public List<TransferTxBean> getTxBeans(Long transferId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查编码是否唯一
|
* 检查编码是否唯一
|
||||||
* @param wmTransfer
|
* @param wmTransfer
|
||||||
|
@ -57,6 +57,16 @@ public interface IStorageCoreService {
|
|||||||
*/
|
*/
|
||||||
public void processProductSalse(List<ProductSalseTxBean> lines);
|
public void processProductSalse(List<ProductSalseTxBean> lines);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理销售退货
|
||||||
|
* @param lines
|
||||||
|
*/
|
||||||
public void processRtSalse(List<RtSalseTxBean> lines);
|
public void processRtSalse(List<RtSalseTxBean> lines);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理转移单
|
||||||
|
* @param lines
|
||||||
|
*/
|
||||||
|
public void processTransfer(List<TransferTxBean> lines);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ktg.mes.wm.domain.WmTransfer;
|
import com.ktg.mes.wm.domain.WmTransfer;
|
||||||
|
import com.ktg.mes.wm.domain.tx.TransferTxBean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转移单Service接口
|
* 转移单Service接口
|
||||||
@ -28,6 +29,8 @@ public interface IWmTransferService
|
|||||||
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
public List<WmTransfer> selectWmTransferList(WmTransfer wmTransfer);
|
||||||
|
|
||||||
|
|
||||||
|
public List<TransferTxBean> getTxBeans(Long transferid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查编码是否唯一
|
* 检查编码是否唯一
|
||||||
* @param wmTransfer
|
* @param wmTransfer
|
||||||
|
@ -351,5 +351,54 @@ public class StorageCoreServiceImpl implements IStorageCoreService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processTransfer(List<TransferTxBean> lines) {
|
||||||
|
if(CollUtil.isEmpty(lines)){
|
||||||
|
throw new BussinessException("没有需要处理的原料消耗单行");
|
||||||
|
}
|
||||||
|
String transactionType_out = UserConstants.TRANSACTION_TYPE_WAREHOUSE_TRANS_OUT;
|
||||||
|
String transactionType_in = UserConstants.TRANSACTION_TYPE_WAREHOUSE_TRANS_IN;
|
||||||
|
|
||||||
|
for(int i=0;i<lines.size();i++){
|
||||||
|
TransferTxBean line = lines.get(i);
|
||||||
|
//先执行出库
|
||||||
|
WmTransaction transaction_out = new WmTransaction();
|
||||||
|
transaction_out.setTransactionType(transactionType_out);
|
||||||
|
BeanUtils.copyBeanProp(transaction_out,line);
|
||||||
|
transaction_out.setWarehouseId(line.getFromWarehouseId());
|
||||||
|
transaction_out.setWarehouseCode(line.getFromWarehouseCode());
|
||||||
|
transaction_out.setWarehouseName(line.getFromWarehouseName());
|
||||||
|
transaction_out.setLocationId(line.getFromLocationId());
|
||||||
|
transaction_out.setLocationCode(line.getFromLocationCode());
|
||||||
|
transaction_out.setLocationName(line.getFromLocationName());
|
||||||
|
transaction_out.setAreaId(line.getFromAreaId());
|
||||||
|
transaction_out.setAreaCode(line.getFromAreaCode());
|
||||||
|
transaction_out.setAreaName(line.getFromAreaName());
|
||||||
|
transaction_out.setTransactionFlag(-1);//库存减少
|
||||||
|
wmTransactionService.processTransaction(transaction_out);
|
||||||
|
//再执行入库
|
||||||
|
WmTransaction transaction_in = new WmTransaction();
|
||||||
|
transaction_in.setTransactionType(transactionType_in);
|
||||||
|
BeanUtils.copyBeanProp(transaction_in,line);
|
||||||
|
transaction_in.setWarehouseId(line.getToWarehouseId());
|
||||||
|
transaction_in.setWarehouseCode(line.getToWarehouseCode());
|
||||||
|
transaction_in.setWarehouseName(line.getToWarehouseName());
|
||||||
|
transaction_in.setLocationId(line.getToLocationId());
|
||||||
|
transaction_in.setLocationCode(line.getToLocationCode());
|
||||||
|
transaction_in.setLocationName(line.getToLocationName());
|
||||||
|
transaction_in.setAreaId(line.getToAreaId());
|
||||||
|
transaction_in.setAreaCode(line.getToAreaCode());
|
||||||
|
transaction_in.setAreaName(line.getToAreaName());
|
||||||
|
|
||||||
|
transaction_in.setTransactionFlag(1);//库存增加
|
||||||
|
transaction_in.setTransactionDate(new Date());
|
||||||
|
//由于是新增的库存记录所以需要将查询出来的库存记录ID置为空
|
||||||
|
transaction_in.setMaterialStockId(null);
|
||||||
|
//设置入库相关联的出库事务ID
|
||||||
|
transaction_in.setRelatedTransactionId(transaction_out.getTransactionId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import com.ktg.common.constant.UserConstants;
|
import com.ktg.common.constant.UserConstants;
|
||||||
import com.ktg.common.utils.DateUtils;
|
import com.ktg.common.utils.DateUtils;
|
||||||
import com.ktg.common.utils.StringUtils;
|
import com.ktg.common.utils.StringUtils;
|
||||||
|
import com.ktg.mes.wm.domain.tx.TransferTxBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ktg.mes.wm.mapper.WmTransferMapper;
|
import com.ktg.mes.wm.mapper.WmTransferMapper;
|
||||||
@ -47,6 +48,11 @@ public class WmTransferServiceImpl implements IWmTransferService
|
|||||||
return wmTransferMapper.selectWmTransferList(wmTransfer);
|
return wmTransferMapper.selectWmTransferList(wmTransfer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TransferTxBean> getTxBeans(Long transferid) {
|
||||||
|
return wmTransferMapper.getTxBeans(transferid);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String checkUnique(WmTransfer wmTransfer) {
|
public String checkUnique(WmTransfer wmTransfer) {
|
||||||
WmTransfer transfer = wmTransferMapper.checkUnique(wmTransfer);
|
WmTransfer transfer = wmTransferMapper.checkUnique(wmTransfer);
|
||||||
|
@ -33,6 +33,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="TransferTxBeanResult" type="TransferTxBean">
|
||||||
|
<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="workorderId" column="workorder_id"></result>
|
||||||
|
<result property="workorderCode" column="workorder_code"></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="fromWarehouseId" column="from_warehouse_id"></result>
|
||||||
|
<result property="fromWarehouseCode" column="from_warehouse_code"></result>
|
||||||
|
<result property="fromWarehouseName" column="from_warehouse_name"></result>
|
||||||
|
<result property="fromLocationId" column="from_location_id"></result>
|
||||||
|
<result property="fromLocationCode" column="from_location_code"></result>
|
||||||
|
<result property="fromLocationName" column="from_location_name"></result>
|
||||||
|
<result property="fromAreaId" column="from_area_id"></result>
|
||||||
|
<result property="fromAreaCode" column="from_area_code"></result>
|
||||||
|
<result property="fromAreaName" column="from_area_name"></result>
|
||||||
|
|
||||||
|
<result property="toWarehouseId" column="to_warehouse_id"></result>
|
||||||
|
<result property="toWarehouseCode" column="to_warehouse_code"></result>
|
||||||
|
<result property="toWarehouseName" column="to_warehouse_name"></result>
|
||||||
|
<result property="toLocationId" column="to_location_id"></result>
|
||||||
|
<result property="toLocationCode" column="to_location_code"></result>
|
||||||
|
<result property="toLocationName" column="to_location_name"></result>
|
||||||
|
<result property="toAreaId" column="to_area_id"></result>
|
||||||
|
<result property="toAreaCode" column="to_area_code"></result>
|
||||||
|
<result property="toAreaName" column="to_area_name"></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="recptDate" column="recpt_date"></result>
|
||||||
|
<result property="expireDate" column="expire_date"></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="selectWmTransferVo">
|
<sql id="selectWmTransferVo">
|
||||||
select transfer_id, transfer_code, transfer_name, transfer_type, destination, carrier, booking_note,receiver,receiver_nick, from_warehouse_id, from_warehouse_code, from_warehouse_name, to_warehouse_id, to_warehouse_code, to_warehouse_name, transfer_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_transfer
|
select transfer_id, transfer_code, transfer_name, transfer_type, destination, carrier, booking_note,receiver,receiver_nick, from_warehouse_id, from_warehouse_code, from_warehouse_name, to_warehouse_id, to_warehouse_code, to_warehouse_name, transfer_date, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_transfer
|
||||||
</sql>
|
</sql>
|
||||||
@ -69,6 +117,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where transfer_code = #{transferCode}
|
where transfer_code = #{transferCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getTxBeans" parameterType="Long" resultMap="TransferTxBeanResult">
|
||||||
|
SELECT irl.material_stock_id,
|
||||||
|
irl.`item_id`,
|
||||||
|
irl.`item_code`,
|
||||||
|
irl.`item_name`,
|
||||||
|
irl.`specification`,
|
||||||
|
irl.`unit_of_measure`,
|
||||||
|
irl.`batch_code`,
|
||||||
|
irl.from_warehouse_id,
|
||||||
|
irl.from_warehouse_code,
|
||||||
|
irl.from_warehouse_name,
|
||||||
|
irl.from_location_id,
|
||||||
|
irl.from_location_code,
|
||||||
|
irl.from_location_name,
|
||||||
|
irl.from_area_id,
|
||||||
|
irl.from_area_code,
|
||||||
|
irl.from_area_name,
|
||||||
|
irl.to_warehouse_id,
|
||||||
|
irl.to_warehouse_code,
|
||||||
|
irl.to_warehouse_name,
|
||||||
|
irl.to_location_id,
|
||||||
|
irl.to_location_code,
|
||||||
|
irl.to_location_name,
|
||||||
|
irl.to_area_id,
|
||||||
|
irl.to_area_code,
|
||||||
|
irl.to_area_name,
|
||||||
|
ms.vendor_id,ms.vendor_code,ms.vendor_name,ms.vendor_nick,ms.workorder_id,ms.workorder_code,
|
||||||
|
'TRANSFER' AS source_doc_type,ir.`transfer_id` AS source_doc_id,
|
||||||
|
ir.`transfer_code` AS source_doc_code,
|
||||||
|
irl.`line_id` AS source_doc_line_id,
|
||||||
|
irl.quantity_transfer AS transaction_quantity,
|
||||||
|
ir.transfer_date as recpt_date,
|
||||||
|
irl.expire_date
|
||||||
|
FROM wm_transfer ir
|
||||||
|
LEFT JOIN wm_transfer_line irl
|
||||||
|
ON ir.transfer_id = irl.transfer_id
|
||||||
|
left join wm_material_stock ms
|
||||||
|
on irl.material_stock_id = ms.material_stock_id
|
||||||
|
WHERE ir.transfer_id = #{transferId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertWmTransfer" parameterType="WmTransfer" useGeneratedKeys="true" keyProperty="transferId">
|
<insert id="insertWmTransfer" parameterType="WmTransfer" useGeneratedKeys="true" keyProperty="transferId">
|
||||||
insert into wm_transfer
|
insert into wm_transfer
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
Loading…
Reference in New Issue
Block a user