|
|
|
@ -629,7 +629,6 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
//产品是否可以以使用单元入库
|
|
|
|
|
udiRelevanceResponses = udiRelevanceService.selectGroupByNameCode(codeEnttity.getNameCode(), false);
|
|
|
|
|
if (udiRelevanceResponses.size() >= 1) {
|
|
|
|
|
// UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0);
|
|
|
|
|
if (udiRelevanceResponse == null) {
|
|
|
|
|
return ResultVOUtils.error(500, "该产品信息未维护!");
|
|
|
|
|
} else if (!udiRelevanceResponse.getUseDy() && udiRelevanceResponse.getDiType() == ConstantStatus.DITYPE_SYDY) {
|
|
|
|
@ -708,18 +707,6 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
if (baseResponse != null) {
|
|
|
|
|
deleteEmptyBillNo(orderEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断证书是否过期
|
|
|
|
|
// if (codeEnttity.getRelId() != null && bussinessTypeEntity.isCheckCertExpire()) {
|
|
|
|
|
//
|
|
|
|
|
// SupProductEntity supProductEntity = supProductService.findByRelIdFk(codeEnttity.getRelId() + "");
|
|
|
|
|
// if(supProductEntity!=null){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// if (DateUtil.)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
genDetaiEntity = codeEnttity;
|
|
|
|
|
if (baseResponse == null) {
|
|
|
|
|
baseResponse = checkSupId(bussinessTypeEntity, codeEnttity, unitFk);
|
|
|
|
@ -784,14 +771,8 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByOne(ConstantStatus.ACTION_TYPE_ADVANCE);
|
|
|
|
|
int count = 0;
|
|
|
|
|
if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_NULL) {
|
|
|
|
|
// if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
// count = invPreProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), null, codeTempEntity.getCode());
|
|
|
|
|
// } else
|
|
|
|
|
count = invPreProductDetailService.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 = invPreProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
// } else
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode());
|
|
|
|
|
} else if (bussinessTypeEntity.getSpaceOut() == ConstantStatus.SPACE_OUT_CODE) {
|
|
|
|
|
//按指定货位出库
|
|
|
|
@ -809,35 +790,12 @@ public class IoCodeTempController extends BaseController {
|
|
|
|
|
return ResultVOUtils.error(500, "添加失败,该产品未上架货位!");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// if (StrUtil.isNotEmpty(codeTempEntity.getSerialNo())) {
|
|
|
|
|
// count = invPreProductDetailService.vailStockCountByCode(null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode(), codeTempEntity.getCode());
|
|
|
|
|
// } else
|
|
|
|
|
count = invPreProductDetailService.vailStockCount(codeTempEntity.getRelId(), codeTempEntity.getBatchNo(), codeTempEntity.getSupId(), null, invWarehouseEntity.getCode(), codeTempEntity.getPreSpaceCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// InvPreProductDetailEntity invPreinDetailEntity = invPreProductDetailService.findUseOneByCode(codeTempEntity.getCode());
|
|
|
|
|
if (count <= 0) {
|
|
|
|
|
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 (count < (tempEntity.getMyCount() + 1)) {
|
|
|
|
|
// return ResultVOUtils.error(500, "超出寄售库存数量");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (count < 1) {
|
|
|
|
|
// return ResultVOUtils.error(500, "寄售库存数量不足");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
int exitCount = IntUtil.value(codeTempService.selectExitCount(codeTempEntity.getOrderId(), codeTempEntity.getBatchNo(), codeTempEntity.getRelId(), codeTempEntity.getSupId()));
|
|
|
|
|
if ((codeTempEntity.getMyReCount() + exitCount) > count) {
|
|
|
|
|
return ResultVOUtils.error(500, "寄售库存数量不足");
|
|
|
|
|