|
|
|
@ -239,19 +239,12 @@ public class InvProductsTrService {
|
|
|
|
|
|
|
|
|
|
if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入
|
|
|
|
|
|
|
|
|
|
//获取普通出入库结余数量
|
|
|
|
|
//获取当前条码实际数量
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
int count = 0;
|
|
|
|
|
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
|
|
|
|
|
String code = warehouseEntity.getCode();
|
|
|
|
|
if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
|
|
|
|
|
|| (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
|
|
|
|
|
warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
|
|
|
|
|
code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
|
|
|
|
|
count = actCount * warehouseEntity.getCount();
|
|
|
|
|
} else {
|
|
|
|
|
count = warehouseEntity.getCount();
|
|
|
|
|
}
|
|
|
|
|
count = actCount * warehouseEntity.getCount();
|
|
|
|
|
/**
|
|
|
|
|
* 《寄售转入库》往来单位:
|
|
|
|
|
* 单据类型的当前仓库(如果当前仓库有设置,则判断该当前仓库是否为1级库并且仓库类型=寄售,如果没设置,那么往来单位自动为默认寄售仓库),当前仓库:出库单据的当前仓库
|
|
|
|
@ -267,19 +260,23 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
invWarehouseEntity = invWarehouseService.findDefault(true, true);
|
|
|
|
|
int invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), invWarehouseEntity.getCode());
|
|
|
|
|
if (invCount <= 0) {
|
|
|
|
|
invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), invWarehouseEntity.getCode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
|
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
|
if (invCount > 0) {
|
|
|
|
|
if (count > invCount) {
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity)));
|
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
|
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
|
|
|
|
|
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
|
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
@ -288,19 +285,18 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setCode(code);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//获取普通出入库结余数量
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
int count = 0;
|
|
|
|
|
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
|
|
|
|
|
String code = warehouseEntity.getCode();
|
|
|
|
|
if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
|
|
|
|
|
|| (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
|
|
|
|
|
warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
|
|
|
|
|
code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
|
|
|
|
|
count = actCount * warehouseEntity.getCount();
|
|
|
|
|
} else {
|
|
|
|
|
count = warehouseEntity.getCount();
|
|
|
|
|
}
|
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
|
|
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
|
|
|
|
|
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
|
|
|
|
|
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
|
|
|
|
|
// code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
|
|
|
|
|
// count = actCount * warehouseEntity.getCount();
|
|
|
|
|
// } else {
|
|
|
|
|
// count = warehouseEntity.getCount();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
int invCount = 0;
|
|
|
|
|
if (locWarehouseEntity.getLevel() > 1) {//补调拨入库
|
|
|
|
@ -310,10 +306,12 @@ public class InvProductsTrService {
|
|
|
|
|
InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode());
|
|
|
|
|
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
|
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
|
if (invCount <= 0) {
|
|
|
|
|
invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
|
// }
|
|
|
|
|
norChangeTypeEntity = innorChangeTypeEntity;
|
|
|
|
|
} else { //补供应商入库
|
|
|
|
|
/**
|
|
|
|
@ -323,22 +321,40 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
|
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null);
|
|
|
|
|
if (invCount <= 0) {
|
|
|
|
|
invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), null);
|
|
|
|
|
}
|
|
|
|
|
invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
|
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null);
|
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), null);
|
|
|
|
|
// }
|
|
|
|
|
norChangeTypeEntity = outChangeTypeEntity;
|
|
|
|
|
}
|
|
|
|
|
if (invCount > 0) {
|
|
|
|
|
if (count > invCount) {
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / getActCount(warehouseEntity));
|
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
|
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
|
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
|
|
|
|
|
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
|
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
// if (invCount > 0) {
|
|
|
|
|
// if (count > invCount) {
|
|
|
|
|
// int lea = count - invCount;
|
|
|
|
|
// warehouseEntity.setCount(lea / getActCount(warehouseEntity));
|
|
|
|
|
// inList.add(warehouseEntity);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// warehouseEntity.setCount(count);
|
|
|
|
|
// inList.add(warehouseEntity);
|
|
|
|
|
// }
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
|
insetInvSingle(false, invProductDetailEntity);
|
|
|
|
|
warehouseEntity.setCode(code);
|
|
|
|
@ -421,35 +437,36 @@ public class InvProductsTrService {
|
|
|
|
|
List<WarehouseEntity> prePutList = new ArrayList<>();
|
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
int count = 0;
|
|
|
|
|
String code = warehouseEntity.getCode();
|
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
|
|
// String code = warehouseEntity.getCode();
|
|
|
|
|
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
|
|
|
|
|
if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
|
|
|
|
|
|| (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
|
|
|
|
|
warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
|
|
|
|
|
code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
|
|
|
|
|
count = actCount * warehouseEntity.getCount();
|
|
|
|
|
} else {
|
|
|
|
|
count = warehouseEntity.getCount();
|
|
|
|
|
}
|
|
|
|
|
// if (udiInfoEntity.getDiType() == ConstantStatus.DITYPE_PACK || udiInfoEntity.getDiType() == ConstantStatus.DITYPE_SYDY
|
|
|
|
|
// || (udiInfoEntity.getSjcpbm() != null && !"".equals(udiInfoEntity.getSjcpbm()))) {
|
|
|
|
|
// warehouseEntity.setNameCode(udiInfoEntity.getNameCode());
|
|
|
|
|
// code = FilterUdiUtils.transGlxpNoSerStr(warehouseEntity);
|
|
|
|
|
// count = actCount * warehouseEntity.getCount();
|
|
|
|
|
// } else {
|
|
|
|
|
// count = warehouseEntity.getCount();
|
|
|
|
|
// }
|
|
|
|
|
//获取寄售出入库结余数量
|
|
|
|
|
int invCount = getPreCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
|
|
|
|
|
if (invCount <= 0) {
|
|
|
|
|
invCount = getPreCountByOrder(null, code, warehouseEntity.getSupId());
|
|
|
|
|
}
|
|
|
|
|
if (invCount > 0) {
|
|
|
|
|
if (count > invCount) {
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity.getCode())));
|
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
|
int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
|
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
|
|
|
|
|
UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
|
|
|
|
|
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
|
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
|
int lea = count - invCount;
|
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
|
insetInvSingle(true, invProductDetailEntity);
|
|
|
|
|
warehouseEntity.setCode(code);
|
|
|
|
|
}
|
|
|
|
|
return prePutList;
|
|
|
|
|
}
|
|
|
|
@ -494,7 +511,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
outOrder.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
|
outOrder.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
|
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
|
|
|
|
@ -559,7 +576,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
|
|
|
|
|
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
@ -596,7 +613,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setRemark("未选择供应商");
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
outOrder.setFromCorp(null);
|
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
|
outOrder.setFromCorpId(null);
|
|
|
|
@ -652,7 +669,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
@ -716,7 +733,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
|
|
|
|
|
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
@ -760,7 +777,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setRemark("未选择供应商");
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
outOrder.setFromCorp(null);
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
outOrder.setFromCorpId(null);
|
|
|
|
@ -822,7 +839,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
|
|
|
|
|
// outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
// outOrder.setFromCorpId(corpName);
|
|
|
|
@ -890,7 +907,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
// BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(corpName);
|
|
|
|
|
// outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
// outOrder.setFromCorpId(corpName);
|
|
|
|
@ -933,7 +950,7 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setRemark("未选择供应商");
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
|
outOrder.setId(CustomUtil.getId());
|
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
|
outOrder.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
|
outOrder.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
@ -1132,6 +1149,7 @@ public class InvProductsTrService {
|
|
|
|
|
return udiInfoEntity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
udiInfoEntity.setRelId(udiInfoBean.getId() + "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
@ -1162,6 +1180,30 @@ public class InvProductsTrService {
|
|
|
|
|
return invCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getCountByOrder(String mainAction, String relId, String batchNo, String supId, String invWarehouseCode) {
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|
filterInvProductDetailRequest.setSupId(supId);
|
|
|
|
|
filterInvProductDetailRequest.setInvStorageCode(invWarehouseCode);
|
|
|
|
|
filterInvProductDetailRequest.setProductIdFk(relId);
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(batchNo);
|
|
|
|
|
if (mainAction != null)
|
|
|
|
|
filterInvProductDetailRequest.setMainAction(mainAction);
|
|
|
|
|
List<InvProductDetailEntity> resultLists = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
|
|
|
|
|
int invCount = 0;
|
|
|
|
|
if (resultLists != null && resultLists.size() > 0) {
|
|
|
|
|
for (InvProductDetailEntity invProductDetailEntity : resultLists) {
|
|
|
|
|
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
invCount = invCount - invProductDetailEntity.getCount();
|
|
|
|
|
} else {
|
|
|
|
|
invCount = invCount + invProductDetailEntity.getCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return invCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据条码获取预入库结余数量
|
|
|
|
|
public int getPreCountByOrder(String mainAction, String code, String supId) {
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
@ -1186,6 +1228,30 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int getPreCountByOrder(String mainAction, String relId, String batchNo, String supId, String invWarehouseCode) {
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|
filterInvProductDetailRequest.setSupId(supId);
|
|
|
|
|
filterInvProductDetailRequest.setInvStorageCode(invWarehouseCode);
|
|
|
|
|
filterInvProductDetailRequest.setProductIdFk(relId);
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(batchNo);
|
|
|
|
|
if (mainAction != null)
|
|
|
|
|
filterInvProductDetailRequest.setMainAction(mainAction);
|
|
|
|
|
List<InvProductDetailEntity> resultLists = invPreProductDetailService.filterInvProduct(filterInvProductDetailRequest);
|
|
|
|
|
int invCount = 0;
|
|
|
|
|
if (resultLists != null && resultLists.size() > 0) {
|
|
|
|
|
for (InvProductDetailEntity invProductDetailEntity : resultLists) {
|
|
|
|
|
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
invCount = invCount - invProductDetailEntity.getCount();
|
|
|
|
|
} else {
|
|
|
|
|
invCount = invCount + invProductDetailEntity.getCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return invCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据条码获取库存结余数量
|
|
|
|
|
public int getCountByProduct(String mainAction, String productId, String batchNo, String supId) {
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|