|
|
@ -232,6 +232,13 @@ public class InvProductsTrService {
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
List<WarehouseEntity> inList = new ArrayList<>();
|
|
|
|
List<WarehouseEntity> inList = new ArrayList<>();
|
|
|
|
List<WarehouseEntity> preiInList = new ArrayList<>();
|
|
|
|
List<WarehouseEntity> preiInList = new ArrayList<>();
|
|
|
|
|
|
|
|
//缺量补单时是否全量补单
|
|
|
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all");
|
|
|
|
|
|
|
|
if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
|
|
|
|
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
|
|
|
inList.add(warehouseEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 如果出库单据需要缺量自动补录入库单据?
|
|
|
|
* 如果出库单据需要缺量自动补录入库单据?
|
|
|
@ -366,6 +373,8 @@ public class InvProductsTrService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (inList.size() > 0) {
|
|
|
|
if (inList.size() > 0) {
|
|
|
|
List<WarehouseEntity> temps = filterMapCodes(inList);
|
|
|
|
List<WarehouseEntity> temps = filterMapCodes(inList);
|
|
|
@ -379,45 +388,6 @@ public class InvProductsTrService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public List<WarehouseEntity> addOutOrder(OrderEntity
|
|
|
|
|
|
|
|
// orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
|
|
|
|
|
|
|
|
// List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
|
|
|
|
// List<WarehouseEntity> inList = new ArrayList<>();
|
|
|
|
|
|
|
|
// for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
|
|
|
// //获取普通出入库结余数量
|
|
|
|
|
|
|
|
// 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 invCount = getCountByOrder(null, warehouseEntity.getCode(), warehouseEntity.getSupId());
|
|
|
|
|
|
|
|
// if (invCount <= 0) {
|
|
|
|
|
|
|
|
// invCount = getCountByOrder(null, code, warehouseEntity.getSupId());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (invCount > 0) {
|
|
|
|
|
|
|
|
// if (count > invCount) {
|
|
|
|
|
|
|
|
// int lea = count - invCount;
|
|
|
|
|
|
|
|
// warehouseEntity.setCount(lea / actCount);
|
|
|
|
|
|
|
|
// inList.add(warehouseEntity);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// warehouseEntity.setCount(count);
|
|
|
|
|
|
|
|
// inList.add(warehouseEntity);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
|
|
|
|
// insetInvSingle(false, invProductDetailEntity);
|
|
|
|
|
|
|
|
// warehouseEntity.setCode(code);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return inList;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//普通入库补单
|
|
|
|
//普通入库补单
|
|
|
|
public List<WarehouseEntity> addPutOrder(OrderEntity
|
|
|
|
public List<WarehouseEntity> addPutOrder(OrderEntity
|
|
|
|
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
|
|
|
|
orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
|
|
|
@ -440,6 +410,13 @@ public class InvProductsTrService {
|
|
|
|
|
|
|
|
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
List<WarehouseEntity> prePutList = new ArrayList<>();
|
|
|
|
List<WarehouseEntity> prePutList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all");
|
|
|
|
|
|
|
|
if (systemParamConfigEntity != null && systemParamConfigEntity.getParamValue().equals("1")) {
|
|
|
|
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
|
|
|
prePutList.add(warehouseEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
@ -473,6 +450,9 @@ public class InvProductsTrService {
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
InvProductDetailEntity invProductDetailEntity = filterInvByCode(invProductDetailEntities, warehouseEntity.getCode());
|
|
|
|
insetInvSingle(true, invProductDetailEntity);
|
|
|
|
insetInvSingle(true, invProductDetailEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return prePutList;
|
|
|
|
return prePutList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -516,7 +496,7 @@ public class InvProductsTrService {
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
outOrder.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
outOrder.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
outOrder.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
outOrder.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
|
|
|
|
outOrder.setLocStorageCode(defaultWarehouseEntity.getCode());
|
|
|
@ -586,7 +566,7 @@ public class InvProductsTrService {
|
|
|
|
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
outOrder.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
//互填单号
|
|
|
|
//互填单号
|
|
|
|
orderEntity.setUllageSupNo(outOrder.getId());
|
|
|
|
orderEntity.setUllageSupNo(outOrder.getId());
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
|
orderEntity.setUpdateTime(new Date());
|
|
|
@ -691,7 +671,7 @@ public class InvProductsTrService {
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
outOrder.setId("SM" + CustomUtil.getId());
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
|
|
|
|
if ("1".equals(systemParamConfigEntity.getParamValue())) {
|
|
|
|
if ("1".equals(systemParamConfigEntity.getParamValue())) {
|
|
|
@ -764,7 +744,7 @@ public class InvProductsTrService {
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
outOrder.setFromCorpId(temps.get(0).getFromCorpId());
|
|
|
|
outOrder.setFromCorpId(temps.get(0).getFromCorpId());
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId()+"x");
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
|
outOrder.setFromType(ConstantStatus.FROM_CHANGE);
|
|
|
@ -803,7 +783,6 @@ public class InvProductsTrService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成库存
|
|
|
|
//生成库存
|
|
|
|
private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity
|
|
|
|
private InvProductEntity buildInvProduct(String relId, ErpOrderEntity erpOrderEntity, OrderEntity
|
|
|
|
orderEntity, WarehouseEntity warehouseEntity) {
|
|
|
|
orderEntity, WarehouseEntity warehouseEntity) {
|
|
|
|