|
|
@ -262,7 +262,7 @@ public class InvProductsTrService {
|
|
|
|
invWarehouseEntity = invWarehouseService.findDefault(true, true);
|
|
|
|
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.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
@ -272,12 +272,12 @@ public class InvProductsTrService {
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
int lea = count - invCount;
|
|
|
|
int lea = count - invCount;
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
// warehouseEntity.setCount(count);
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
@ -307,7 +307,7 @@ public class InvProductsTrService {
|
|
|
|
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
|
|
|
|
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());
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId(), locWarehouseEntity.getPcode());
|
|
|
@ -321,7 +321,7 @@ public class InvProductsTrService {
|
|
|
|
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
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);
|
|
|
|
// invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId(), null);
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
// if (invCount <= 0) {
|
|
|
@ -337,12 +337,12 @@ public class InvProductsTrService {
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
int lea = count - invCount;
|
|
|
|
int lea = count - invCount;
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
// warehouseEntity.setCount(count);
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (invCount > 0) {
|
|
|
|
// if (invCount > 0) {
|
|
|
@ -457,12 +457,12 @@ public class InvProductsTrService {
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
} else if (udiEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
int lea = count - invCount;
|
|
|
|
int lea = count - invCount;
|
|
|
|
warehouseEntity.setCount(lea / (getActCount(warehouseEntity))); //
|
|
|
|
warehouseEntity.setCount(lea / (warehouseEntity.getCount())); //
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
} else { //结余数量《=0直接补
|
|
|
|
warehouseEntity.setCount(count);
|
|
|
|
// warehouseEntity.setCount(count);
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
@ -984,7 +984,7 @@ public class InvProductsTrService {
|
|
|
|
invProductEntity.setProductsName(erpOrderEntity.getCoName());
|
|
|
|
invProductEntity.setProductsName(erpOrderEntity.getCoName());
|
|
|
|
invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany());
|
|
|
|
invProductEntity.setYlqxzcrbarmc(erpOrderEntity.getProductCompany());
|
|
|
|
invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode());
|
|
|
|
invProductEntity.setZczbhhzbapzbh(erpOrderEntity.getAuthCode());
|
|
|
|
invProductEntity.setInvStorageCode(warehouseEntity.getInvStorageCode());
|
|
|
|
invProductEntity.setInvStorageCode(warehouseEntity.getLocStorageCode());
|
|
|
|
invProductEntity.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode());
|
|
|
|
invProductEntity.setInvWarehouseCode(warehouseEntity.getInvWarehouseCode());
|
|
|
|
int count = getActCount(warehouseEntity) * warehouseEntity.getCount();
|
|
|
|
int count = getActCount(warehouseEntity) * warehouseEntity.getCount();
|
|
|
|
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
@ -1026,7 +1026,7 @@ public class InvProductsTrService {
|
|
|
|
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
|
|
|
|
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
|
|
|
|
invProductDetailEntity.setAction(warehouseEntity.getAction());
|
|
|
|
invProductDetailEntity.setAction(warehouseEntity.getAction());
|
|
|
|
invProductDetailEntity.setMainAction(orderEntity.getMainAction());
|
|
|
|
invProductDetailEntity.setMainAction(orderEntity.getMainAction());
|
|
|
|
invProductDetailEntity.setInvStorageCode(warehouseEntity.getInvStorageCode());
|
|
|
|
invProductDetailEntity.setInvStorageCode(warehouseEntity.getLocStorageCode());
|
|
|
|
invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode());
|
|
|
|
invProductDetailEntity.setInvWarehouseCode(warehouseEntity.getWarehouseCode());
|
|
|
|
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
|
|
|
|
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
|
|
|
|
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
|
|
|
|
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
|
|
|
@ -1096,9 +1096,10 @@ public class InvProductsTrService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int getActCount(WarehouseEntity warehouseEntity) {
|
|
|
|
public int getActCount(WarehouseEntity warehouseEntity) {
|
|
|
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
|
|
|
|
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
|
|
|
|
UdiRelevanceResponse udiInfoBean = udiRelevanceService.selectByNameCode(warehouseEntity.getNameCode());
|
|
|
|
if (udiInfoBean != null) {
|
|
|
|
if (udiInfoBean != null) {
|
|
|
|
if (udiInfoBean.getIsUseDy() == 1 && udiInfoBean.getDiType() != 2) {
|
|
|
|
if ((udiRelevanceEntity.getIsUseDy()!=null && udiRelevanceEntity.getIsUseDy()) && udiInfoBean.getDiType() != 2) {
|
|
|
|
if (udiInfoBean.getBhzxxsbzsl() == 0)
|
|
|
|
if (udiInfoBean.getBhzxxsbzsl() == 0)
|
|
|
|
return udiInfoBean.getZxxsbzbhsydysl();
|
|
|
|
return udiInfoBean.getZxxsbzbhsydysl();
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1155,6 +1156,10 @@ public class InvProductsTrService {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UdiInfoEntity getUdiInfo(WarehouseEntity warehouseEntity) {
|
|
|
|
|
|
|
|
UdiInfoEntity udiInfoBean = udiInfoService.findByNameCode(warehouseEntity.getNameCode());
|
|
|
|
|
|
|
|
return udiInfoBean;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//根据条码获取库存结余数量
|
|
|
|
//根据条码获取库存结余数量
|
|
|
|
public int getCountByOrder(String mainAction, String code, String supId, String invWarehouseCode) {
|
|
|
|
public int getCountByOrder(String mainAction, String code, String supId, String invWarehouseCode) {
|
|
|
@ -1180,12 +1185,21 @@ public class InvProductsTrService {
|
|
|
|
return invCount;
|
|
|
|
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 filterInvProductDetailRequest = new FilterInvProductDetailRequest();
|
|
|
|
filterInvProductDetailRequest.setSupId(supId);
|
|
|
|
UdiInfoEntity udiRelevanceResponse = getUdiInfo(warehouseEntity);
|
|
|
|
filterInvProductDetailRequest.setInvStorageCode(invWarehouseCode);
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(warehouseEntity.getRelId());
|
|
|
|
filterInvProductDetailRequest.setProductIdFk(relId);
|
|
|
|
|
|
|
|
filterInvProductDetailRequest.setBatchNo(batchNo);
|
|
|
|
//是否严格按照UDI码出入库,是:
|
|
|
|
|
|
|
|
// todo
|
|
|
|
|
|
|
|
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)
|
|
|
|
if (mainAction != null)
|
|
|
|
filterInvProductDetailRequest.setMainAction(mainAction);
|
|
|
|
filterInvProductDetailRequest.setMainAction(mainAction);
|
|
|
|
List<InvProductDetailEntity> resultLists = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
|
|
|
|
List<InvProductDetailEntity> resultLists = invProductDetailService.filterInvProduct(filterInvProductDetailRequest);
|
|
|
|