WMS:半成品出库库位表清空containercode。半成品入成品库保存containercode
master
xs 4 months ago
parent 68a276854c
commit b5509540c8

@ -261,6 +261,10 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
wmsTransferDetail.setExecuteTime(currentDate); wmsTransferDetail.setExecuteTime(currentDate);
wmsTransferDetailMapper.insertWmsTransferDetail(wmsTransferDetail); wmsTransferDetailMapper.insertWmsTransferDetail(wmsTransferDetail);
oriLocation.setContainerCode("");
oriLocation.setUpdateBy(userName);
oriLocation.setUpdateTime(currentDate);
wmsBaseLocationMapper.updateWmsBaseLocation(oriLocation);
wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId()); wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
@ -290,30 +294,50 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
throw new ServiceException("物料条码错误"); throw new ServiceException("物料条码错误");
} }
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getPalletInfoCode())) {
throw new ServiceException("此物料条码没有绑定托盘");
}
WmsBaseLocation targetLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(targetLocationCode); WmsBaseLocation targetLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(targetLocationCode);
if (targetLocation == null) { if (targetLocation == null) {
throw new ServiceException("库位不存在"); throw new ServiceException("库位不存在");
} }
/**判断有没有已出库的转库记录*/
WmsTransfer queryTransfer = new WmsTransfer();
queryTransfer.setProductBatch(materialBarcode);
queryTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_NOT_FINISH);
List<WmsTransfer> wmsTransfers = wmsTransferMapper.selectWmsTransferList(queryTransfer);
if (wmsTransfers == null || wmsTransfers.isEmpty()) {
throw new ServiceException("没有此成品的转库出库记录,不能转库入库");
}
WmsProductStock queryProductStock = new WmsProductStock(); WmsProductStock queryProductStock = new WmsProductStock();
queryProductStock.setLocationCode(targetLocationCode); queryProductStock.setLocationCode(targetLocationCode);
List<WmsProductStock> productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock); List<WmsProductStock> productStocks = wmsProductStockMapper.selectOnlyWmsProductStockInList(queryProductStock);
if(productStocks!=null && !productStocks.isEmpty()){ if (productStocks != null && !productStocks.isEmpty()) {
throw new ServiceException("此库位已经有库存,不能入库"); throw new ServiceException("此库位已经有库存,不能入库");
} }
WmsTransfer queryTransfer = new WmsTransfer();
queryTransfer.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_NOT_FINISH);
String barcodeType = mesBaseBarcodeInfo.getBarcodeType();
//如果是非成品条码,就还可以入原来的半成品库
Long targetWarehouseId = targetLocation.getWarehouseId(); Long targetWarehouseId = targetLocation.getWarehouseId();
WmsBaseWarehouse targetWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetWarehouseId); WmsBaseWarehouse targetWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(targetWarehouseId);
if (!barcodeType.equals(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT)) {
// queryTransfer.setProductBatch(materialBarcode);
throw new ServiceException("请打印成品条码入成品库");
}
//如果是成品条码,则只能入成品库
if (StringUtils.isEmpty(mesBaseBarcodeInfo.getBindBarcode())) {
throw new ServiceException("物料条码有误,没有绑定");
}
if (!targetWarehouse.getWarehouseFloor().equals(5L) ||
!targetWarehouse.getWarehouseInstockType().equals(WmsConstants.PRODUCT_STOCK_STOCK_TYPE_PRODUCT)) {
throw new ServiceException("请入5楼成品库");
}
queryTransfer.setProductBatch(mesBaseBarcodeInfo.getBindBarcode());
/**判断有没有已出库的转库记录*/
List<WmsTransfer> wmsTransfers = wmsTransferMapper.selectWmsTransferList(queryTransfer);
if (wmsTransfers == null || wmsTransfers.isEmpty()) {
throw new ServiceException("没有此成品的转库出库记录,不能转库入库");
}
WmsTransfer wmsTransfer = wmsTransfers.get(0); WmsTransfer wmsTransfer = wmsTransfers.get(0);
wmsTransfer.setTargetWarehouseId(targetWarehouseId); wmsTransfer.setTargetWarehouseId(targetWarehouseId);
@ -325,6 +349,11 @@ public class WmsTransferServiceImpl implements IWmsTransferService {
wmsTransfer.setEndTime(currentDate); wmsTransfer.setEndTime(currentDate);
wmsTransferMapper.updateWmsTransfer(wmsTransfer); wmsTransferMapper.updateWmsTransfer(wmsTransfer);
//更新库位表的containercode代表此库位有库存供调度判断使用
targetLocation.setContainerCode(mesBaseBarcodeInfo.getPalletInfoCode());
targetLocation.setUpdateTime(currentDate);
targetLocation.setUpdateBy(userName);
wmsBaseLocationMapper.updateWmsBaseLocation(targetLocation);
//插入转库任务明细 //插入转库任务明细
wmsTransferDetail.setTransferId(wmsTransfer.getTransferId()); wmsTransferDetail.setTransferId(wmsTransfer.getTransferId());

@ -39,6 +39,8 @@
<result property="length" column="length" /> <result property="length" column="length" />
<result property="width" column="width" /> <result property="width" column="width" />
<result property="height" column="height" /> <result property="height" column="height" />
<result property="exceptionDesc" column="exception_desc" />
<result property="containerStatus" column="container_status" />
</resultMap> </resultMap>
<sql id="selectWmsBaseLocationVo"> <sql id="selectWmsBaseLocationVo">
@ -155,6 +157,7 @@
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if> <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="agvPositionCode != null and agvPositionCode != ''">agv_position_code = #{agvPositionCode},</if> <if test="agvPositionCode != null and agvPositionCode != ''">agv_position_code = #{agvPositionCode},</if>
<if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if> <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
<if test="containerCode != null">container_code = #{containerCode},</if>
<if test="locRow != null">loc_row = #{locRow},</if> <if test="locRow != null">loc_row = #{locRow},</if>
<if test="layerNum != null">layer_num = #{layerNum},</if> <if test="layerNum != null">layer_num = #{layerNum},</if>
<if test="locColumn != null">loc_column = #{locColumn},</if> <if test="locColumn != null">loc_column = #{locColumn},</if>

Loading…
Cancel
Save