|
|
|
@ -21,7 +21,6 @@ import com.glxp.api.controller.BaseController;
|
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
|
import com.glxp.api.entity.inv.InvPreInProductDetailEntity;
|
|
|
|
|
import com.glxp.api.req.basic.CompanyProductRelevanceRequest;
|
|
|
|
|
import com.glxp.api.req.inout.*;
|
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
@ -39,8 +38,6 @@ import com.glxp.api.util.*;
|
|
|
|
|
import com.glxp.api.util.udi.FilterUdiUtils;
|
|
|
|
|
import com.glxp.api.util.udi.UdiCalCountUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.regexp.RE;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
@ -93,6 +90,8 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
IoAddInoutService ioAddInoutService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeService ioOrderDetailCodeService;
|
|
|
|
|
@Resource
|
|
|
|
|
IoCheckInvService checkInvService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* PDA-----单据上传
|
|
|
|
@ -555,21 +554,21 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
BaseResponse invRes = null;
|
|
|
|
|
if (IntUtil.value(bussinessTypeEntity.getUseDyCount()) == 2) {
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse, 2)) { //校验预验收库存
|
|
|
|
|
invRes = checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
}
|
|
|
|
|
if (bussinessTypeEntity.isAdvancePreIn() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse, 3)) { //校验寄售库存
|
|
|
|
|
invRes = checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
}
|
|
|
|
|
if (bussinessTypeEntity.isVailInv() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse, 1)) {
|
|
|
|
|
invRes = checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
|
|
|
|
|
invRes = checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
|
|
|
|
|
invRes = checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
} else {
|
|
|
|
|
invRes = checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -745,21 +744,21 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
if (IntUtil.value(bussinessTypeEntity.getUseDyCount()) == 2) {
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse.getId(), 2)) { //校验预验收库存
|
|
|
|
|
BaseResponse invRes = checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bussinessTypeEntity.isAdvancePreIn() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse.getId(), 3)) { //校验寄售库存
|
|
|
|
|
BaseResponse invRes = checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bussinessTypeEntity.isVailInv() && checkDiAttribute(bussinessTypeEntity, udiRelevanceResponse.getId(), 1)) {
|
|
|
|
|
BaseResponse invRes = checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
@ -767,19 +766,19 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
|
|
|
|
|
BaseResponse invRes = checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
|
|
|
|
|
BaseResponse invRes = checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
BaseResponse invRes = checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
@ -825,201 +824,6 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BaseResponse checkInv(BasicBussinessTypeEntity bussinessTypeEntity, IoCodeTempEntity codeTempEntity, boolean isEdit) {
|
|
|
|
|
if (bussinessTypeEntity.isVailInv() && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
String outInvCode = codeTempEntity.getInvCode();
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findNoInvTypeInv(bussinessTypeEntity.getDeptNoInvType(), outInvCode);
|
|
|
|
|
if (invWarehouseEntity != null) {
|
|
|
|
|
outInvCode = invWarehouseEntity.getCode();
|
|
|
|
|
}
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, outInvCode, null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
count = invProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), codeTempEntity.getDeptCode(), codeTempEntity.getInvCode(), codeTempEntity.getWarehouseCode());
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_CODE) {
|
|
|
|
|
//按指定货位出库
|
|
|
|
|
if (StrUtil.isEmpty(codeTempEntity.getWarehouseCode())) {
|
|
|
|
|
List<InvPlaceDetailResponse> invProductDetailEntities = invProductDetailService.findByGroupCode(codeTempEntity.getInvCode(), codeTempEntity.getCode(), true);
|
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities) && invProductDetailEntities.size() > 1) {
|
|
|
|
|
BaseResponse baseResponse = ResultVOUtils.error(511, "存在多个货位,请指定当前货位!");
|
|
|
|
|
baseResponse.setData(invProductDetailEntities);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} else if (invProductDetailEntities.size() == 1) {
|
|
|
|
|
InvPlaceDetailResponse invPlaceDetailResponse = invProductDetailEntities.get(0);
|
|
|
|
|
count = invPlaceDetailResponse.getReCount();
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "添加失败,该产品未上架货位!");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
count = invProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), codeTempEntity.getDeptCode(), codeTempEntity.getInvCode(), codeTempEntity.getWarehouseCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count == -1) {
|
|
|
|
|
return ResultVOUtils.error(500, "该产品未入库");
|
|
|
|
|
} else
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
} else {
|
|
|
|
|
//查询此单据已扫描的条码数量
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_CODE) {
|
|
|
|
|
int exitCount = IntUtil.value(codeTempService.selectExitCount(codeTempEntity.getOrderId(), codeTempEntity.getCode()));
|
|
|
|
|
if (isEdit) {
|
|
|
|
|
if (exitCount > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ((codeTempEntity.getMyReCount() + exitCount) > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
int exitCount = IntUtil.value(codeTempService.selectExitCount(codeTempEntity.getOrderId(), codeTempEntity.getBatchNo(), codeTempEntity.getRelId(), codeTempEntity.getSupId()));
|
|
|
|
|
if (isEdit) {
|
|
|
|
|
if (exitCount > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ((codeTempEntity.getMyReCount() + exitCount) > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "当前库存不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 校验寄售库存
|
|
|
|
|
*/
|
|
|
|
|
public BaseResponse checkPreInv(BasicBussinessTypeEntity bussinessTypeEntity, IoCodeTempEntity codeTempEntity, boolean isEdit) {
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE);
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode());
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_CODE) {
|
|
|
|
|
//按指定货位出库
|
|
|
|
|
if (StrUtil.isEmpty(codeTempEntity.getPreSpaceCode())) {
|
|
|
|
|
List<InvPlaceDetailResponse> invProductDetailEntities = invPreProductDetailService.findByGroupCode(invWarehouseEntity.getCode(), codeTempEntity.getCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities) && invProductDetailEntities.size() > 1) {
|
|
|
|
|
BaseResponse baseResponse = ResultVOUtils.error(511, "存在多个货位,请指定当前货位!");
|
|
|
|
|
baseResponse.setData(invProductDetailEntities);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} else if (invProductDetailEntities.size() == 1) {
|
|
|
|
|
InvPlaceDetailResponse invPlaceDetailResponse = invProductDetailEntities.get(0);
|
|
|
|
|
count = invPlaceDetailResponse.getReCount();
|
|
|
|
|
codeTempEntity.setPreSpaceCode(invPlaceDetailResponse.getInvSpaceCode());
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "添加失败,该产品未上架货位!");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count == -1) {
|
|
|
|
|
return ResultVOUtils.error(500, "该产品未入库");
|
|
|
|
|
} else
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足!");
|
|
|
|
|
} else {
|
|
|
|
|
int exitCount = IntUtil.value(codeTempService.selectExitCount(codeTempEntity.getOrderId(), codeTempEntity.getBatchNo(), codeTempEntity.getRelId(), codeTempEntity.getSupId()));
|
|
|
|
|
if (isEdit) {
|
|
|
|
|
if (exitCount > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if ((codeTempEntity.getMyReCount() + exitCount) > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验预验收库存
|
|
|
|
|
public BaseResponse checkPreInInv(BasicBussinessTypeEntity bussinessTypeEntity, IoCodeTempEntity codeTempEntity, boolean isEdit) {
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_PREIN);
|
|
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), null, codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), null);
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_SET) {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreInSpaceCode());
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_CODE) {
|
|
|
|
|
//按指定货位出库
|
|
|
|
|
if (StrUtil.isEmpty(codeTempEntity.getPreSpaceCode())) {
|
|
|
|
|
List<InvPlaceDetailResponse> invProductDetailEntities = invPreinProductDetailService.findByGroupCode(invWarehouseEntity.getCode(), codeTempEntity.getCode());
|
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities) && invProductDetailEntities.size() > 1) {
|
|
|
|
|
BaseResponse baseResponse = ResultVOUtils.error(511, "存在多个货位,请指定当前货位!");
|
|
|
|
|
baseResponse.setData(invProductDetailEntities);
|
|
|
|
|
return baseResponse;
|
|
|
|
|
} else if (invProductDetailEntities.size() == 1) {
|
|
|
|
|
InvPlaceDetailResponse invPlaceDetailResponse = invProductDetailEntities.get(0);
|
|
|
|
|
count = invPlaceDetailResponse.getReCount();
|
|
|
|
|
codeTempEntity.setPreSpaceCode(invPlaceDetailResponse.getInvSpaceCode());
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "添加失败,该产品未上架货位!");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
count = invPreinProductDetailService.vailStockCountByCode(null, codeTempEntity.getInvCode(), codeTempEntity.getPreInSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
} else
|
|
|
|
|
count = invPreinProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, codeTempEntity.getInvCode(), codeTempEntity.getPreInSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InvPreInProductDetailEntity invPreinDetailEntity = invPreinProductDetailService.findUseOneByCode(codeTempEntity.getCode());
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
if (count == -1) {
|
|
|
|
|
return ResultVOUtils.error(500, "该产品未入库");
|
|
|
|
|
} else
|
|
|
|
|
return ResultVOUtils.error(500, "预验收库存数量不足!");
|
|
|
|
|
} else {
|
|
|
|
|
// if (StrUtil.isNotEmpty(invPreinDetailEntity.getBatchNo()) && StrUtil.isNotEmpty(codeTempEntity.getBatchNo())
|
|
|
|
|
// && !invPreinDetailEntity.getBatchNo().equals(codeTempEntity.getBatchNo())) {
|
|
|
|
|
// return ResultVOUtils.error(500, "当前批次号与预验收录入批次号不匹配!");
|
|
|
|
|
// }
|
|
|
|
|
if (StrUtil.isNotEmpty(codeTempEntity.getOrderId())) {//非首次添加
|
|
|
|
|
if (StrUtil.isEmpty(codeTempEntity.getSerialNo())) {//该单据已有该产品
|
|
|
|
|
//无序列号,则可能存在多个预验收入库单
|
|
|
|
|
IoCodeTempEntity tempEntity = codeTempService.findByUnique(codeTempEntity.getOrderId(), codeTempEntity.getCode());
|
|
|
|
|
if (tempEntity != null) {
|
|
|
|
|
if (isEdit) {
|
|
|
|
|
if (count < (tempEntity.getReCount())) {
|
|
|
|
|
return ResultVOUtils.error(500, "超出预验收存数量");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (count < (tempEntity.getReCount() + codeTempEntity.getReCount())) {
|
|
|
|
|
return ResultVOUtils.error(500, "超出预验收存数量");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (count < 1) {
|
|
|
|
|
return ResultVOUtils.error(500, "预验收库存数量不足");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//校验条码完整性
|
|
|
|
|
public BaseResponse checkOriginCode(UdiEntity udiEntity) {
|
|
|
|
|
//校验条码的完整性
|
|
|
|
@ -1356,11 +1160,11 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(tempEntity.getAction());
|
|
|
|
|
BaseResponse invRes = null;
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn() && checkDiAttribute(bussinessTypeEntity, codeTempEntity.getRelId(), 2)) { //校验预验收库存
|
|
|
|
|
invRes = checkPreInInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
invRes = checkInvService.checkPreInInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn() && checkDiAttribute(bussinessTypeEntity, codeTempEntity.getRelId(), 3)) { //校验寄售库存
|
|
|
|
|
invRes = checkPreInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
invRes = checkInvService.checkPreInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn() && checkDiAttribute(bussinessTypeEntity, codeTempEntity.getRelId(), 1)) {
|
|
|
|
|
invRes = checkInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
invRes = checkInvService.checkInv(bussinessTypeEntity, codeTempEntity, true);
|
|
|
|
|
}
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
codeTempService.updateById(tempEntity);
|
|
|
|
@ -1650,11 +1454,11 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
BaseResponse invRes = null;
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
|
|
|
|
|
invRes = checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
|
|
|
|
|
invRes = checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkPreInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
} else {
|
|
|
|
|
invRes = checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
invRes = checkInvService.checkInv(bussinessTypeEntity, genDetaiEntity, false);
|
|
|
|
|
}
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
return invRes;
|
|
|
|
@ -1805,19 +1609,19 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bussinessTypeEntity.isScanPreIn()) { //校验预验收库存
|
|
|
|
|
BaseResponse invRes = checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvancePreIn()) { //校验寄售库存
|
|
|
|
|
BaseResponse invRes = checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkPreInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
BaseResponse invRes = checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
BaseResponse invRes = checkInvService.checkInv(bussinessTypeEntity, codeEnttity, false);
|
|
|
|
|
if (invRes != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
return invRes;
|
|
|
|
|