|
|
|
@ -495,7 +495,7 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
//校验预验收库存是否已存在
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) {
|
|
|
|
|
if (bussinessTypeEntity.getBackPreinType() == 1 && bussinessTypeEntity.isPreInBack()) {//按单出库
|
|
|
|
|
if (bussinessTypeEntity.getBackPreinType() == 1) {//按单出库&& bussinessTypeEntity.isPreInBack()
|
|
|
|
|
String orderIds = addOrderRequest.getCheckPreInOrders();
|
|
|
|
|
if (StrUtil.isNotEmpty(orderIds)) {
|
|
|
|
|
String[] orderIdArray = orderIds.split(",");
|
|
|
|
@ -524,8 +524,11 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
return ResultVOUtils.error(500, "未选择预验收入库单,请先选择预验收入库单!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else { //按库存出库
|
|
|
|
|
int preInCount = invPreinProductDetailService.findCountByCode(code);
|
|
|
|
|
} else if (bussinessTypeEntity.getBackPreinType() == 2) { //按货位出库
|
|
|
|
|
if (StrUtil.isEmpty(addOrderRequest.getCheckPreInSpaceCode()))
|
|
|
|
|
return ResultVOUtils.error(500, "" +
|
|
|
|
|
"请选择预验收货位!");
|
|
|
|
|
int preInCount = invPreinProductDetailService.findCountBySpaceCode(addOrderRequest.getCheckPreInSpaceCode(), code);
|
|
|
|
|
InvPreInProductDetailEntity invPreinDetailEntity = invPreinProductDetailService.findUseOneByCode(code);
|
|
|
|
|
if (preInCount <= 0) {
|
|
|
|
|
return ResultVOUtils.error(500, "预验收库存数量不足!");
|
|
|
|
@ -552,6 +555,36 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* else { //按库存出库
|
|
|
|
|
* int preInCount = invPreinProductDetailService.findCountByCode(code);
|
|
|
|
|
* InvPreInProductDetailEntity invPreinDetailEntity = invPreinProductDetailService.findUseOneByCode(code);
|
|
|
|
|
* if (preInCount <= 0) {
|
|
|
|
|
* return ResultVOUtils.error(500, "预验收库存数量不足!");
|
|
|
|
|
* } else {
|
|
|
|
|
* if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(udiEntity.getBatchNo())
|
|
|
|
|
* && !invPreinDetailEntity.getBatchNo().equals(udiEntity.getBatchNo())) {
|
|
|
|
|
* return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!");
|
|
|
|
|
* }
|
|
|
|
|
* if (StrUtil.isNotEmpty(orderId)) {//非首次添加
|
|
|
|
|
* if (StrUtil.isEmpty(udiEntity.getSerialNo())) {//该单据已有该产品
|
|
|
|
|
* //无序列号,则可能存在多个预验收入库单
|
|
|
|
|
* IoCodeTempEntity codeTempEntity = codeTempService.findByUnique(orderId, code);
|
|
|
|
|
* if (codeTempEntity != null) {
|
|
|
|
|
* if (preInCount < (codeTempEntity.getMyCount() + 1)) {
|
|
|
|
|
* return ResultVOUtils.error(500, "超出预验收库存数量");
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
* } else {
|
|
|
|
|
* if (preInCount < 1) {
|
|
|
|
|
* return ResultVOUtils.error(500, "预验收库存数量不足");
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
* }
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 是否检验寄售库存
|
|
|
|
|