|
|
|
@ -231,7 +231,8 @@ public class InvProductsTrService {
|
|
|
|
|
//获取当前条码实际数量
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
int count = 0;
|
|
|
|
|
UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
|
|
|
|
|
// UdiInfoEntity udiInfoEntity = getMinDi(warehouseEntity);
|
|
|
|
|
|
|
|
|
|
String code = warehouseEntity.getCode();
|
|
|
|
|
count = actCount * warehouseEntity.getCount();
|
|
|
|
|
/**
|
|
|
|
@ -251,7 +252,7 @@ public class InvProductsTrService {
|
|
|
|
|
invWarehouseEntity = invWarehouseService.findDefault(true, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
int invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
|
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
@ -296,7 +297,7 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
|
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
|
|
|
|
|
|
|
|
|
|
invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
@ -310,7 +311,7 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
|
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
invCount = getCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
|
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null);
|
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
@ -1001,13 +1002,13 @@ public class InvProductsTrService {
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
warehouseEntity.setCode(code);
|
|
|
|
|
}
|
|
|
|
|
// 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);
|
|
|
|
|
// warehouseEntity.setCode(code);
|
|
|
|
|
// }
|
|
|
|
|
invProductDetailEntity.setCode(code);
|
|
|
|
|
invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo());
|
|
|
|
|
invProductDetailEntity.setProductionDate(warehouseEntity.getProduceDate());
|
|
|
|
@ -1017,7 +1018,7 @@ public class InvProductsTrService {
|
|
|
|
|
invProductDetailEntity.setInvStorageCode(warehouseEntity.getInvStorageCode());
|
|
|
|
|
invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode());
|
|
|
|
|
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
|
|
|
|
|
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
|
|
|
|
|
invProductDetailEntity.setCount(warehouseEntity.getCount());
|
|
|
|
|
if (purchaseType != null) {
|
|
|
|
|
invProductDetailEntity.setPurchaseType(purchaseType);
|
|
|
|
|
}
|
|
|
|
@ -1084,9 +1085,10 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getActCount(WarehouseEntity warehouseEntity) {
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
|
|
|
|
|
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
|
|
|
|
|
if (udiInfoBean != null) {
|
|
|
|
|
if (udiInfoBean.getIsUseDy() == 1 && udiInfoBean.getDiType() != 2) {
|
|
|
|
|
if ((udiRelevanceEntity.getIsUseDy()!=null && udiRelevanceEntity.getIsUseDy()) && udiInfoBean.getDiType() != 2) {
|
|
|
|
|
if (udiInfoBean.getBhzxxsbzsl() == 0)
|
|
|
|
|
return udiInfoBean.getZxxsbzbhsydysl();
|
|
|
|
|
else
|
|
|
|
@ -1143,6 +1145,11 @@ public class InvProductsTrService {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UdiRelevanceResponse getUdiInfo(WarehouseEntity warehouseEntity) {
|
|
|
|
|
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
|
|
|
|
|
return udiInfoBean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据条码获取库存结余数量
|
|
|
|
|
public int getCountByOrder(String mainAction, String code, String supId, String invWarehouseCode) {
|
|
|
|
@ -1168,12 +1175,18 @@ public class InvProductsTrService {
|
|
|
|
|
return invCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getCountByOrder(String mainAction, String relId, String batchNo, String supId, String invWarehouseCode) {
|
|
|
|
|
public int getCountByOrder(String mainAction, WarehouseEntity warehouseEntity) {
|
|
|
|
|
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
|
filterInvProductDetailRequest.setSupId(supId);
|
|
|
|
|
filterInvProductDetailRequest.setInvStorageCode(invWarehouseCode);
|
|
|
|
|
filterInvProductDetailRequest.setProductIdFk(relId);
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(batchNo);
|
|
|
|
|
UdiRelevanceResponse udiRelevanceResponse = getUdiInfo(warehouseEntity);
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
|
|
|
|
|
if (warehouseEntity.getSerialNo() != null && udiRelevanceResponse.getDiType() == 1 && (udiRelevanceEntity.getIsUseDy()==null || !udiRelevanceEntity.getIsUseDy())) {
|
|
|
|
|
filterInvProductDetailRequest.setCode(warehouseEntity.getCode());
|
|
|
|
|
} else {
|
|
|
|
|
filterInvProductDetailRequest.setProductIdFk(warehouseEntity.getRelId());
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(warehouseEntity.getBatchNo());
|
|
|
|
|
}
|
|
|
|
|
filterInvProductDetailRequest.setSupId(warehouseEntity.getSupId());
|
|
|
|
|
filterInvProductDetailRequest.setInvStorageCode(warehouseEntity.getLocStorageCode());
|
|
|
|
|
if (mainAction != null)
|
|
|
|
|
filterInvProductDetailRequest.setMainAction(mainAction);
|
|
|
|
|
List<InvProductDetailEntity> resultLists = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
|
|
|
|
|