|
|
|
@ -7,6 +7,7 @@ import com.glxp.sale.admin.entity.basic.*;
|
|
|
|
|
import com.glxp.sale.admin.entity.inout.*;
|
|
|
|
|
import com.glxp.sale.admin.entity.inventory.InvProductDetailEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.inventory.InvProductEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.inventory.InvSubWarehouseEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.inventory.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.param.SystemParamConfigEntity;
|
|
|
|
|
import com.glxp.sale.admin.entity.udid.UdiEntity;
|
|
|
|
@ -19,6 +20,7 @@ import com.glxp.sale.admin.service.inout.*;
|
|
|
|
|
import com.glxp.sale.admin.service.inventory.*;
|
|
|
|
|
import com.glxp.sale.admin.service.param.SystemParamConfigService;
|
|
|
|
|
import com.glxp.sale.admin.util.*;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -26,6 +28,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Service
|
|
|
|
|
public class InvProductsTrService {
|
|
|
|
|
|
|
|
|
@ -70,6 +73,8 @@ public class InvProductsTrService {
|
|
|
|
|
InvWarehouseService invWarehouseService;
|
|
|
|
|
@Resource
|
|
|
|
|
GennerOrderUtils gennerOrderUtils;
|
|
|
|
|
@Resource
|
|
|
|
|
InvSubWarehouseService invSubWarehouseService;
|
|
|
|
|
|
|
|
|
|
@Async
|
|
|
|
|
public void genInvProducts(String orderId) {
|
|
|
|
@ -99,31 +104,11 @@ public class InvProductsTrService {
|
|
|
|
|
|
|
|
|
|
if (bussinessTypeEntity.isPreIn()) {
|
|
|
|
|
InvProductEntity invPreProductEntity = null;
|
|
|
|
|
// invPreInProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
|
|
|
|
|
// , warehouseEntity.getLocStorageCode(), warehouseEntity.getInvWarehouseCode());
|
|
|
|
|
if (invPreProductEntity == null) {
|
|
|
|
|
invPreProductEntity = buildInvPreInProduct(orderEntity, erpOrderEntity, warehouseEntity);
|
|
|
|
|
invPreProductEntity.setUpdateTime(new Date());
|
|
|
|
|
invPreInProductService.insertInvProduct(invPreProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* else {
|
|
|
|
|
* int actCount = getActCount(warehouseEntity);
|
|
|
|
|
* int count = actCount * warehouseEntity.getCount();
|
|
|
|
|
* if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
* invPreProductEntity.setOutCount(invPreProductEntity.getOutCount() + count);
|
|
|
|
|
* } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
|
* invPreProductEntity.setInCount(invPreProductEntity.getInCount() + count);
|
|
|
|
|
* }
|
|
|
|
|
* if (erpOrderEntity.getPrice() != null) {
|
|
|
|
|
* invPreProductEntity.setPrice(erpOrderEntity.getPrice() + "");
|
|
|
|
|
* }
|
|
|
|
|
* invPreProductEntity.setUpdateTime(new Date());
|
|
|
|
|
* invPreInProductService.updateInvProduct(invPreProductEntity);
|
|
|
|
|
* }
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
} else if (bussinessTypeEntity.isAdvanceType()) {//预入库,则转存预入库
|
|
|
|
|
InvProductEntity invPreProductEntity =
|
|
|
|
|
invPreProductService.selectByUuid(erpOrderEntity.getGoodsid(), erpOrderEntity.getBatchNo(), warehouseEntity.getSupId()
|
|
|
|
@ -213,11 +198,6 @@ public class InvProductsTrService {
|
|
|
|
|
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 3);
|
|
|
|
|
} else {
|
|
|
|
|
invProductDetailEntities = buildInvProductDetail(orderId, erpOrderEntity, orderEntity, 2);
|
|
|
|
|
//todo 为什么要插入库存
|
|
|
|
|
// if (orderEntity.isPreCheck()) {
|
|
|
|
|
//// insetInv(bussinessTypeEntity, invProductDetailEntities);//2.插入当前库存
|
|
|
|
|
// invPreInProductDetailService.insertInvProducts(invProductDetailEntities);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
if (invProductDetailEntities != null && invProductDetailEntities.size() > 0) {
|
|
|
|
|
mInvProductDetailEntities.addAll(invProductDetailEntities);
|
|
|
|
@ -227,32 +207,35 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//单据流转
|
|
|
|
|
List<BussinessChangeTypeEntity> bussinessChangeTypeEntitys = bussinessChangeTypeService.findByAction(bussinessLocalTypeEntity.getLocalAction());
|
|
|
|
|
if ((bussinessChangeTypeEntitys != null && bussinessChangeTypeEntitys.size() > 0) && bussinessLocalTypeEntity.isChangeEnable()) {
|
|
|
|
|
|
|
|
|
|
if (orderEntity.isOutChangeEnable()) {//是否缺量补单
|
|
|
|
|
//普通出库
|
|
|
|
|
if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
|
|
|
|
|
addUseOutOrder(orderEntity, mInvProductDetailEntities, bussinessChangeTypeEntitys);
|
|
|
|
|
} else if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType())
|
|
|
|
|
//普通入库补单
|
|
|
|
|
{
|
|
|
|
|
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
|
|
|
|
|
List<WarehouseEntity> datas = addPutOrder(orderEntity, mInvProductDetailEntities);
|
|
|
|
|
List<WarehouseEntity> temps = filterMapCodes(datas);
|
|
|
|
|
buildPreOutOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) {
|
|
|
|
|
//寄售出库补单
|
|
|
|
|
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
|
|
|
|
|
List<WarehouseEntity> datas = addPreOutOrder(orderEntity, mInvProductDetailEntities);
|
|
|
|
|
List<WarehouseEntity> temps = filterMapCodes(datas);
|
|
|
|
|
buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
|
|
|
|
|
} else {
|
|
|
|
|
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
|
|
|
|
|
}
|
|
|
|
|
BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeService.findOriginAction(bussinessLocalTypeEntity.getLocalAction());
|
|
|
|
|
if (bussinessChangeTypeEntity != null && bussinessLocalTypeEntity.isChangeEnable()) {
|
|
|
|
|
|
|
|
|
|
addUseOutOrder(orderEntity, mInvProductDetailEntities, bussinessChangeTypeEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (orderEntity.isOutChangeEnable()) {//是否缺量补单
|
|
|
|
|
// //普通出库
|
|
|
|
|
// if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType()) {
|
|
|
|
|
// addUseOutOrder(orderEntity, mInvProductDetailEntities, bussinessChangeTypeEntitys);
|
|
|
|
|
// } else if (ConstantType.TYPE_PUT.equals(bussinessTypeEntity.getMainAction()) && !bussinessTypeEntity.isAdvanceType())
|
|
|
|
|
// //普通入库补单
|
|
|
|
|
// {
|
|
|
|
|
// BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
|
|
|
|
|
// List<WarehouseEntity> datas = addPutOrder(orderEntity, mInvProductDetailEntities);
|
|
|
|
|
// List<WarehouseEntity> temps = filterMapCodes(datas);
|
|
|
|
|
// buildPreOutOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
|
|
|
|
|
// } else if (ConstantType.TYPE_OUT.equals(bussinessTypeEntity.getMainAction()) && bussinessTypeEntity.isAdvanceType()) {
|
|
|
|
|
// //寄售出库补单
|
|
|
|
|
// BussinessChangeTypeEntity bussinessChangeTypeEntity = bussinessChangeTypeEntitys.get(0);
|
|
|
|
|
// List<WarehouseEntity> datas = addPreOutOrder(orderEntity, mInvProductDetailEntities);
|
|
|
|
|
// List<WarehouseEntity> temps = filterMapCodes(datas);
|
|
|
|
|
// buildPreInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成流转单据
|
|
|
|
|
// } else {
|
|
|
|
|
// insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
insetInv(bussinessTypeEntity, mInvProductDetailEntities);//2.插入当前库存
|
|
|
|
@ -262,28 +245,13 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//普通出库补单-- //补采购入库,调拨入库,寄售转入
|
|
|
|
|
public void addUseOutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities, List<BussinessChangeTypeEntity> bussinessChangeTypeEntities) {
|
|
|
|
|
|
|
|
|
|
BussinessChangeTypeEntity advChangeTypeEntity = null;
|
|
|
|
|
BussinessChangeTypeEntity norChangeTypeEntity = null;
|
|
|
|
|
BussinessChangeTypeEntity outChangeTypeEntity = null;
|
|
|
|
|
BussinessChangeTypeEntity innorChangeTypeEntity = null;
|
|
|
|
|
for (BussinessChangeTypeEntity bussinessChangeTypeEntity : bussinessChangeTypeEntities) {
|
|
|
|
|
if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_ADV_IN) {
|
|
|
|
|
advChangeTypeEntity = bussinessChangeTypeEntity;
|
|
|
|
|
} else if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_NORMAL_IN) {
|
|
|
|
|
outChangeTypeEntity = bussinessChangeTypeEntity;
|
|
|
|
|
} else if (bussinessChangeTypeEntity.getChangeType() == ConstantStatus.ORDER_CHANGE_INNOR_NORMAL_IN) {
|
|
|
|
|
innorChangeTypeEntity = bussinessChangeTypeEntity;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public void addUseOutOrder(OrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities, BussinessChangeTypeEntity bussinessChangeTypeEntity) {
|
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.findByReceiptId(orderEntity.getId());
|
|
|
|
|
List<WarehouseEntity> inList = new ArrayList<>();
|
|
|
|
|
List<WarehouseEntity> preiInList = new ArrayList<>();
|
|
|
|
|
//缺量补单时是否全量补单
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity1 = bussinessTypeService.findBTByAction(orderEntity.getAction());
|
|
|
|
|
// SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("ullage_supplement_all");
|
|
|
|
|
if (bussinessTypeEntity1.isSupplementAll()) {
|
|
|
|
|
if (bussinessChangeTypeEntity.isSupplementAll()) {
|
|
|
|
|
insetInv(bussinessTypeEntity1, invProductDetailEntities);//2.插入当前库存
|
|
|
|
|
WarehouseEntity warehouseEntity = warehouseEntities.get(0);
|
|
|
|
|
InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode());
|
|
|
|
@ -293,15 +261,12 @@ public class InvProductsTrService {
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (locWarehouseEntity.getLevel() > 1) {
|
|
|
|
|
norChangeTypeEntity = innorChangeTypeEntity;
|
|
|
|
|
InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode());
|
|
|
|
|
for (WarehouseEntity tempEntity : warehouseEntities) {
|
|
|
|
|
tempEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
|
tempEntity.setFromCorpId(pInWarehouseEntity.getCode());
|
|
|
|
|
tempEntity.setFromCorp(bussinessChangeTypeEntity.getDefaultInv());
|
|
|
|
|
tempEntity.setFromCorpId(bussinessChangeTypeEntity.getDefaultSubInv());
|
|
|
|
|
inList.add(tempEntity);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
norChangeTypeEntity = outChangeTypeEntity;
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
|
for (WarehouseEntity tempEntity : warehouseEntities) {
|
|
|
|
|
tempEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
@ -321,7 +286,7 @@ public class InvProductsTrService {
|
|
|
|
|
* else(仓库等级>1)
|
|
|
|
|
* {可能需要补录的入库单据有一种:《调拨入库》}
|
|
|
|
|
*/
|
|
|
|
|
InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(warehouseEntity.getLocStorageCode());
|
|
|
|
|
InvWarehouseEntity locWarehouseEntity = invWarehouseService.selectByCode(bussinessChangeTypeEntity.getLocInv());
|
|
|
|
|
if (locWarehouseEntity.getLevel() == 1 && isAdavnce(warehouseEntity)) {//补寄售转入
|
|
|
|
|
//获取当前条码实际数量
|
|
|
|
|
int actCount = getActCount(warehouseEntity);
|
|
|
|
@ -332,7 +297,7 @@ public class InvProductsTrService {
|
|
|
|
|
* 《寄售转入库》往来单位:
|
|
|
|
|
* 单据类型的当前仓库(如果当前仓库有设置,则判断该当前仓库是否为1级库并且仓库类型=寄售,如果没设置,那么往来单位自动为默认寄售仓库),当前仓库:出库单据的当前仓库
|
|
|
|
|
*/
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(advChangeTypeEntity.getScAction());
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(bussinessChangeTypeEntity.getScAction());
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity;
|
|
|
|
|
if (!StrUtil.isEmpty(bussinessTypeEntity.getStorageCode())) {
|
|
|
|
|
invWarehouseEntity = invWarehouseService.selectByCode(bussinessTypeEntity.getStorageCode());
|
|
|
|
@ -344,13 +309,11 @@ public class InvProductsTrService {
|
|
|
|
|
} else
|
|
|
|
|
invWarehouseEntity = invWarehouseService.findDefault(true, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
warehouseEntity.setFromCorpId(invWarehouseEntity.getCode());
|
|
|
|
|
warehouseEntity.setFromCorp(invWarehouseEntity.getName());
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
|
if (count > invCount) { //当前数量>结余数量,说明该产品是无序列号或者是多级包装
|
|
|
|
|
// UdiEntity udiEntity = FilterUdiUtils.getUdi(warehouseEntity.getCode());
|
|
|
|
|
if (actCount > invCount) { //该产品实际数量大于结余数量,说明是多级包装,直接补
|
|
|
|
|
preiInList.add(warehouseEntity);
|
|
|
|
|
} else if (warehouseEntity.getSerialNo() == null) { //无序列号(多级包装无序列号的已在上一步被排除),补齐数量
|
|
|
|
@ -371,26 +334,27 @@ public class InvProductsTrService {
|
|
|
|
|
String code = warehouseEntity.getCode();
|
|
|
|
|
int count = actCount * warehouseEntity.getCount();
|
|
|
|
|
int invCount = 0;
|
|
|
|
|
if (locWarehouseEntity.getLevel() > 1) {//补调拨入库
|
|
|
|
|
/**
|
|
|
|
|
* 调拨入库》往来单位:出库单据的当前仓库的父级仓库,当前仓库:出库单据的当前仓库;
|
|
|
|
|
*/
|
|
|
|
|
InvWarehouseEntity pInWarehouseEntity = invWarehouseService.selectByCode(locWarehouseEntity.getPcode());
|
|
|
|
|
warehouseEntity.setFromCorp(pInWarehouseEntity.getName());
|
|
|
|
|
warehouseEntity.setFromCorpId(pInWarehouseEntity.getCode());
|
|
|
|
|
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
norChangeTypeEntity = innorChangeTypeEntity;
|
|
|
|
|
} else { //补供应商入库
|
|
|
|
|
if (locWarehouseEntity.getLevel() == 1 && StrUtil.isEmpty(bussinessChangeTypeEntity.getDefaultSubInv())) {
|
|
|
|
|
/**
|
|
|
|
|
* 供应商入库》往来单位:根据产品指定的供应商,当前仓库:出库单据的当前仓库;
|
|
|
|
|
*/
|
|
|
|
|
//供应商
|
|
|
|
|
warehouseEntity.setFromCorpId(warehouseEntity.getSupId());
|
|
|
|
|
BasicUnitMaintainEntity basicUnitMaintainEntity = basicUnitMaintainService.selectByErpId(warehouseEntity.getSupId());
|
|
|
|
|
warehouseEntity.setFromCorp(basicUnitMaintainEntity.getName());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
norChangeTypeEntity = outChangeTypeEntity;
|
|
|
|
|
} else if (StrUtil.isNotEmpty(bussinessChangeTypeEntity.getDefaultSubInv())) {
|
|
|
|
|
/**
|
|
|
|
|
* 调拨入库》往来单位:出库单据的当前仓库的父级仓库,当前仓库:出库单据的当前仓库;
|
|
|
|
|
*/
|
|
|
|
|
InvSubWarehouseEntity subWarehouseEntity = invSubWarehouseService.findByInvSubByCode(bussinessChangeTypeEntity.getDefaultSubInv());
|
|
|
|
|
warehouseEntity.setFromCorp(subWarehouseEntity.getName());
|
|
|
|
|
warehouseEntity.setFromCorpId(subWarehouseEntity.getParentId());
|
|
|
|
|
warehouseEntity.setFromSubInvCode(subWarehouseEntity.getCode());
|
|
|
|
|
invCount = getCountByOrder(null, warehouseEntity);
|
|
|
|
|
} else {
|
|
|
|
|
//无法补单,补单失败!
|
|
|
|
|
log.error("无法补单,补单失败!,单据流转设置未设置补单往来信息(" + orderEntity.getId() + ")");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (invCount > 0) {//仓库已存在该产品
|
|
|
|
@ -418,12 +382,12 @@ public class InvProductsTrService {
|
|
|
|
|
|
|
|
|
|
if (inList.size() > 0) {
|
|
|
|
|
List<WarehouseEntity> temps = filterMapCodes(inList);
|
|
|
|
|
buildInOrder(norChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据
|
|
|
|
|
buildInOrder(bussinessChangeTypeEntity, temps, orderEntity); //3.生成采购入库流转单据
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (preiInList.size() > 0) {
|
|
|
|
|
List<WarehouseEntity> temps1 = filterMapCodes(preiInList);
|
|
|
|
|
buildNorPreInOrder(advChangeTypeEntity, temps1, orderEntity); //3.补寄售转入
|
|
|
|
|
buildNorPreInOrder(bussinessChangeTypeEntity, temps1, orderEntity); //3.补寄售转入
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -698,7 +662,9 @@ public class InvProductsTrService {
|
|
|
|
|
} else
|
|
|
|
|
unkonwCorpList.add(warehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(bussinessChangeTypeEntity.getScAction());
|
|
|
|
|
|
|
|
|
|
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(bussinessChangeTypeEntity.getAction());
|
|
|
|
|
BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByAction(bussinessLocalTypeEntity.getAction());
|
|
|
|
|
//根据往来单位生成入库单
|
|
|
|
|
for (String corpName : filterSupMaps.keySet()) {
|
|
|
|
|
List<WarehouseEntity> temps;
|
|
|
|
@ -708,8 +674,8 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setSupplementNo(null);//补单需置空
|
|
|
|
|
outOrder.setActDate(DateUtil.getBeforeDay(outOrder.getActDate(), bussinessChangeTypeEntity.getBeforeTime()));
|
|
|
|
|
outOrder.setCreateTime(outOrder.getActDate());
|
|
|
|
|
outOrder.setAction(bussinessChangeTypeEntity.getScAction());
|
|
|
|
|
outOrder.setMainAction(ConstantType.TYPE_PUT);
|
|
|
|
|
outOrder.setAction(bussinessTypeEntity.getAction());
|
|
|
|
|
outOrder.setMainAction(bussinessTypeEntity.getMainAction());
|
|
|
|
|
outOrder.setContrastStatus(ConstantStatus.ORDER_CHECK_UN);
|
|
|
|
|
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
|
|
|
|
|
outOrder.setErpFk(null);
|
|
|
|
@ -718,14 +684,13 @@ public class InvProductsTrService {
|
|
|
|
|
outOrder.setId(orderNo);
|
|
|
|
|
outOrder.setFromCorpId(corpName);
|
|
|
|
|
outOrder.setFromCorp(temps.get(0).getFromCorp());
|
|
|
|
|
// BussinessTypeEntity originBT = bussinessTypeService.findBTByAction(orderEntity.getAction());
|
|
|
|
|
if (StrUtil.isNotEmpty(bussinessChangeTypeEntity.getDefaultSubInv())) {
|
|
|
|
|
outOrder.setFromSubInvCode(bussinessChangeTypeEntity.getDefaultSubInv());
|
|
|
|
|
}
|
|
|
|
|
outOrder.setCorpOrderId(CustomUtil.getId() + "x");
|
|
|
|
|
outOrder.setLocStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
outOrder.setInvStorageCode(orderEntity.getLocStorageCode());
|
|
|
|
|
|
|
|
|
|
outOrder.setLocStorageCode(bussinessChangeTypeEntity.getLocInv());
|
|
|
|
|
outOrder.setInvStorageCode(bussinessChangeTypeEntity.getLocInv());
|
|
|
|
|
outOrder.setInvWarehouseCode(bussinessChangeTypeEntity.getLocSubInv());
|
|
|
|
|
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("additional_auto_submit");
|
|
|
|
|
if ("1".equals(systemParamConfigEntity.getParamValue())) {
|
|
|
|
|
outOrder.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
|
|
|
|
@ -750,8 +715,8 @@ public class InvProductsTrService {
|
|
|
|
|
warehouseEntity.setFromCorpId(outOrder.getFromCorpId());
|
|
|
|
|
warehouseEntity.setLocStorageCode(outOrder.getLocStorageCode());
|
|
|
|
|
warehouseEntity.setInvWarehouseCode(outOrder.getInvWarehouseCode());
|
|
|
|
|
warehouseEntity.setAction(bussinessChangeTypeEntity.getScAction());
|
|
|
|
|
warehouseEntity.setMainAction(ConstantType.TYPE_PUT);
|
|
|
|
|
warehouseEntity.setAction(outOrder.getAction());
|
|
|
|
|
warehouseEntity.setMainAction(outOrder.getMainAction());
|
|
|
|
|
}
|
|
|
|
|
codesTempService.insertCodesTemp(temps);
|
|
|
|
|
}
|
|
|
|
|