|
|
|
@ -151,10 +151,10 @@ public class WmsPdaApiController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/raw/outSelectByOrderCode")
|
|
|
|
@PostMapping("/raw/outSelectByOrderCode")
|
|
|
|
public R<List<WmsOutstockDetailVo>> outSelectByOrderCode(String orderCode, String orderType) {
|
|
|
|
public R<List<WmsOutstockDetailVo>> outSelectByOrderCode(String orderCode, String orderType) {
|
|
|
|
List<WmsOutstockDetailVo> wmsOutstockDetailVo = null;
|
|
|
|
List<WmsOutstockDetailVo> wmsOutstockDetailVoList;
|
|
|
|
if (orderType.equals("5")) {
|
|
|
|
if (orderType.equals("5")) {
|
|
|
|
wmsOutstockDetailVo = apiService.outSelectByOrderCode(orderCode);
|
|
|
|
wmsOutstockDetailVoList = apiService.outSelectByOrderCode(orderCode);
|
|
|
|
wmsOutstockDetailVo.forEach(item -> {
|
|
|
|
wmsOutstockDetailVoList.forEach(item -> {
|
|
|
|
WmsInventoryVo inventory = wmsInventoryService.selectOrderBeachCode(item.getMaterialId());
|
|
|
|
WmsInventoryVo inventory = wmsInventoryService.selectOrderBeachCode(item.getMaterialId());
|
|
|
|
if (inventory != null) {
|
|
|
|
if (inventory != null) {
|
|
|
|
item.setLocationCode(inventory.getLocationCode());
|
|
|
|
item.setLocationCode(inventory.getLocationCode());
|
|
|
|
@ -165,8 +165,9 @@ public class WmsPdaApiController extends BaseController {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else if (orderType.equals("7")) {
|
|
|
|
} else if (orderType.equals("7")) {
|
|
|
|
List<WmsAllocateOrderDetailVo> list = wmsAllocateOrderDetailService.selectdetailListByOrderCode(orderCode);
|
|
|
|
List<WmsAllocateOrderDetailVo> list = wmsAllocateOrderDetailService.selectdetailListByOrderCode(orderCode);
|
|
|
|
if (list != null && list.size() > 0) {
|
|
|
|
if (list != null && !list.isEmpty()) {
|
|
|
|
wmsOutstockDetailVo = new ArrayList<>(list.size());
|
|
|
|
wmsOutstockDetailVoList = new ArrayList<>(list.size());
|
|
|
|
|
|
|
|
|
|
|
|
list.forEach(item -> {
|
|
|
|
list.forEach(item -> {
|
|
|
|
WmsInventoryVo inventory = wmsInventoryService.selectOrderBeachCode(item.getMaterialId());
|
|
|
|
WmsInventoryVo inventory = wmsInventoryService.selectOrderBeachCode(item.getMaterialId());
|
|
|
|
WmsOutstockDetailVo vo = new WmsOutstockDetailVo();
|
|
|
|
WmsOutstockDetailVo vo = new WmsOutstockDetailVo();
|
|
|
|
@ -175,16 +176,22 @@ public class WmsPdaApiController extends BaseController {
|
|
|
|
vo.setBatchCode(inventory.getBatchCode());
|
|
|
|
vo.setBatchCode(inventory.getBatchCode());
|
|
|
|
vo.setInventoryQty(inventory.getInventoryQty());
|
|
|
|
vo.setInventoryQty(inventory.getInventoryQty());
|
|
|
|
vo.setMaterialCode(inventory.getMaterialCode());
|
|
|
|
vo.setMaterialCode(inventory.getMaterialCode());
|
|
|
|
vo.setMaterialName(inventory.getMaterialName());
|
|
|
|
vo.setOutSum(item.getOutSum());
|
|
|
|
|
|
|
|
vo.setMaterialName(item.getMaterialName());
|
|
|
|
vo.setOutstockQty(item.getAllocateOrderQty());
|
|
|
|
vo.setOutstockQty(item.getAllocateOrderQty());
|
|
|
|
|
|
|
|
wmsOutstockDetailVoList.add(vo);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
wmsOutstockDetailVoList = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
wmsOutstockDetailVoList = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wmsOutstockDetailVo == null) return R.fail("出库单号不正确");
|
|
|
|
if (wmsOutstockDetailVoList == null) return R.fail("出库单号不正确");
|
|
|
|
return R.ok(wmsOutstockDetailVo);
|
|
|
|
return R.ok(wmsOutstockDetailVoList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -192,8 +199,18 @@ vo.setOutstockQty(item.getAllocateOrderQty());
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/raw/selectInVentoryByBatchCode")
|
|
|
|
@PostMapping("/raw/selectInVentoryByBatchCode")
|
|
|
|
public R<Void> rawSelectInVentoryByBatchCode(@RequestBody WmsOutstockRecord outstockRecord) {
|
|
|
|
public R<Void> rawSelectInVentoryByBatchCode(@RequestBody WmsOutstockRecord outstockRecord) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String type = outstockRecord.getSpecialType();
|
|
|
|
|
|
|
|
WmsInventory wmsInventory = null;
|
|
|
|
|
|
|
|
if (type.equals("5")) {
|
|
|
|
// 验证库存
|
|
|
|
// 验证库存
|
|
|
|
WmsInventory wmsInventory = apiService.outSelectInVentoryByBatch(outstockRecord);
|
|
|
|
|
|
|
|
|
|
|
|
wmsInventory = apiService.outSelectInVentoryByBatch(outstockRecord);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type.equals("7")) {
|
|
|
|
|
|
|
|
wmsInventory = apiService.outAllocateSelectInVentory(outstockRecord);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (wmsInventory == null) {
|
|
|
|
if (wmsInventory == null) {
|
|
|
|
return R.fail("物料扫描错误");
|
|
|
|
return R.fail("物料扫描错误");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -201,6 +218,7 @@ vo.setOutstockQty(item.getAllocateOrderQty());
|
|
|
|
if (wmsInventory.getInventoryQty().compareTo(outstockRecord.getOutstockQty()) < 0) {
|
|
|
|
if (wmsInventory.getInventoryQty().compareTo(outstockRecord.getOutstockQty()) < 0) {
|
|
|
|
R.fail("当前库位库存为:" + wmsInventory.getInventoryQty());
|
|
|
|
R.fail("当前库位库存为:" + wmsInventory.getInventoryQty());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Boolean result = apiService.rawOutSubmit(outstockRecord, wmsInventory);
|
|
|
|
Boolean result = apiService.rawOutSubmit(outstockRecord, wmsInventory);
|
|
|
|
return result ? R.ok() : R.fail();
|
|
|
|
return result ? R.ok() : R.fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|