增加 调拨出库数量验证

master
wanghao 3 months ago
parent 465823cd6f
commit c39c0b7016

@ -204,9 +204,7 @@ public class WmsPdaApiController extends BaseController {
WmsInventory wmsInventory = null; WmsInventory wmsInventory = null;
if (type.equals("5")) { if (type.equals("5")) {
// 验证库存 // 验证库存
wmsInventory = apiService.outSelectInVentoryByBatch(outstockRecord); wmsInventory = apiService.outSelectInVentoryByBatch(outstockRecord);
} else if (type.equals("7")) { } else if (type.equals("7")) {
wmsInventory = apiService.outAllocateSelectInVentory(outstockRecord); wmsInventory = apiService.outAllocateSelectInVentory(outstockRecord);
} }
@ -214,10 +212,17 @@ public class WmsPdaApiController extends BaseController {
if (wmsInventory == null) { if (wmsInventory == null) {
return R.fail("物料扫描错误"); return R.fail("物料扫描错误");
} }
if (wmsInventory.getInventoryQty().compareTo(outstockRecord.getOutstockQty()) < 0) { if (wmsInventory.getInventoryQty().compareTo(outstockRecord.getOutstockQty()) < 0) {
R.fail("当前库位库存为:" + wmsInventory.getInventoryQty()); R.fail("当前库位库存为:" + wmsInventory.getInventoryQty());
} }
double outSum = wmsInventory.getOutSum();//已经出库数量
// BigDecimal allocateOrderQty = wmsInventory.getAllocateOrderQty();//计划数量
// BigDecimal outstockQty = outstockRecord.getOutstockQty();//出库数量
// if (allocateOrderQty.compareTo(outstockQty.add(BigDecimal.valueOf(outSum))) <0) {
// return R.fail("出库超量");
// }
Boolean result = apiService.rawOutSubmit(outstockRecord, wmsInventory); Boolean result = apiService.rawOutSubmit(outstockRecord, wmsInventory);
return result ? R.ok() : R.fail(); return result ? R.ok() : R.fail();

@ -127,8 +127,16 @@ public class WmsInventory {
/** /**
* wms * wms
*/ */
@TableField(exist = false) @TableField(exist = false)
private Long maxParkingTime; private Long maxParkingTime;
@TableField(exist = false)
/**
*
*/
private BigDecimal allocateOrderQty;
@TableField(exist = false)
private double outSum;//实际出库数量
} }

@ -367,8 +367,11 @@ public class WmsPdaApiServiceImpl implements IWmsPdaApiService {
public WmsInventory outAllocateSelectInVentory(WmsOutstockRecord outstockRecord) { public WmsInventory outAllocateSelectInVentory(WmsOutstockRecord outstockRecord) {
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class) MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class)
.selectAll(WmsInventory.class) .selectAll(WmsInventory.class)
.select(BaseMaterialInfo::getMaterialCode,BaseMaterialInfo::getMaterialName,BaseMaterialInfo::getMaterialUnit, BaseMaterialInfo::getMaterialSpec)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockDetail::getMaterialId)
.rightJoin(WmsAllocateOrderDetail.class, WmsAllocateOrderDetail::getMaterialId, WmsInventory::getMaterialId) .rightJoin(WmsAllocateOrderDetail.class, WmsAllocateOrderDetail::getMaterialId, WmsInventory::getMaterialId)
.select(WmsAllocateOrderDetail::getAoDId) .select(WmsAllocateOrderDetail::getAoDId,
WmsAllocateOrderDetail::getAllocateOrderQty,WmsAllocateOrderDetail::getOutSum)
.eq(WmsAllocateOrderDetail::getAllocateCode, outstockRecord.getOutstockCode()) .eq(WmsAllocateOrderDetail::getAllocateCode, outstockRecord.getOutstockCode())
.eq(WmsInventory::getBatchCode, outstockRecord.getBatchCode()).eq(WmsInventory::getLocationCode, outstockRecord.getLocationCode()); .eq(WmsInventory::getBatchCode, outstockRecord.getBatchCode()).eq(WmsInventory::getLocationCode, outstockRecord.getLocationCode());
return wmsInventoryMapper.selectOne(lqw); return wmsInventoryMapper.selectOne(lqw);

Loading…
Cancel
Save