预验收按货位退货

master
anthonywj 2 years ago committed by wangwei
parent d5a8a5e1fb
commit 8ca7d523df

@ -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, "预验收库存数量不足");
* }
* }
* }
* }
* }
*/
}
// 是否检验寄售库存

@ -29,5 +29,7 @@ public class AddOrderRequest {
private String remark;
private String checkPreInOrders;
// 预验收货位
private String checkPreInSpaceCode;
private int fromVailPi; //是否需要校验三期1不需要2需要
}

@ -803,7 +803,6 @@ public class IoCheckInoutService {
// ThreadUtil.execAsync(() -> {
if (StrUtil.isNotEmpty(bussinessTypeEntity.getPreInBackAction())) {
if (bussinessTypeEntity.getBackPreinType() == 1) { //按单退货
String orderIds = orderEntity.getCheckPreInOrders();
if (StrUtil.isNotEmpty(orderIds)) {
String[] orderIdArray = orderIds.split(",");
@ -861,7 +860,6 @@ public class IoCheckInoutService {
codeEntity.setReCount(udiCalCountUtil.getActCount(codeEntity.getNameCode()));
codeEntity.setWarehouseCode(orderEntity.getCheckPreInSpaceCode());
backCodeList.add(codeEntity);
}
}
genBackOrder(orderEntity, backCodeList);

@ -190,7 +190,7 @@ public class InvPreInProductDetailServiceImpl implements InvPreinProductDetailSe
@Override
public InvPreInProductDetailEntity findUseOneByCode(String code) {
List<InvPreInProductDetailEntity> invPreinDetailEntities = invPreInProductDetailDao.selectList(new QueryWrapper<InvPreInProductDetailEntity>().eq("code", code)
.last("limit 1"));
.last("limit 1"));
if (CollUtil.isNotEmpty(invPreinDetailEntities)) {
return invPreinDetailEntities.get(0);
}

Loading…
Cancel
Save