|
|
|
@ -100,7 +100,7 @@ public class InvProductsTrService {
|
|
|
|
|
if (bussinessTypeEntity.isPreIn()) {
|
|
|
|
|
InvProductEntity invPreProductEntity =
|
|
|
|
|
invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
|
|
|
|
|
, warehouseEntity.getInvStorageCode(), warehouseEntity.getInvWarehouseCode());
|
|
|
|
|
, null, null);
|
|
|
|
|
if (invPreProductEntity == null) {
|
|
|
|
|
invPreProductEntity = buildInvProduct(erpOrderEntity.getGoodsid(), erpOrderEntity, orderEntity, warehouseEntity);
|
|
|
|
|
invPreInProductService.insertInvProduct(invPreProductEntity);
|
|
|
|
@ -149,6 +149,17 @@ public class InvProductsTrService {
|
|
|
|
|
invProductService.updateInvProduct(invProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orderEntity.isPreCheck()) {
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
|
|
InvProductEntity preInvEntity = invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(),
|
|
|
|
|
warehouseEntity.getSupId(), null, null);
|
|
|
|
|
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
preInvEntity.setOutCount(preInvEntity.getOutCount() + count);
|
|
|
|
|
}
|
|
|
|
|
invPreInProductService.updateInvProduct(preInvEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -172,6 +183,10 @@ public class InvProductsTrService {
|
|
|
|
|
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3);
|
|
|
|
|
} else {
|
|
|
|
|
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2);
|
|
|
|
|
|
|
|
|
|
if (orderEntity.isPreCheck()) {
|
|
|
|
|
insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) {
|
|
|
|
|
mInvProductDetailEntities.addAll(invProductDetailEntities);
|
|
|
|
@ -412,16 +427,7 @@ public class InvProductsTrService {
|
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
|
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();
|
|
|
|
|
// }
|
|
|
|
|
//获取寄售出入库结余数量
|
|
|
|
|
int invCount = getPreCountByOrder(null, udiInfoEntity.getRelId(), warehouseEntity.getBatchNo(), warehouseEntity.getSupId(), warehouseEntity.getLocStorageCode());
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
@ -506,7 +512,6 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setMainAction(ConstantType.TYPE_OUT);
|
|
|
|
|
}
|
|
|
|
|
codesTempService.insertCodesTemp(preOutList);
|
|
|
|
|
// ioTransInoutService.transInout(outOrder.getId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//生成寄售入库单据
|
|
|
|
|