|
|
|
@ -194,11 +194,11 @@ public class IoChangeInoutService {
|
|
|
|
|
for (BasicBusTypePreEntity busTypePreEntity : busTypePreEntities) {
|
|
|
|
|
targetBustypeEntity = basicBussinessTypeService.findByAction(busTypePreEntity.getAction());
|
|
|
|
|
if (busTypePreEntity.getSplitOrder() == ConstantStatus.ACTION_TYPE_NORMAL) {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, normalCodes, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, normalCodes, orderEntity, isGenInovice, null);
|
|
|
|
|
} else if (busTypePreEntity.getSplitOrder() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, preInCodes, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, preInCodes, orderEntity, isGenInovice, null);
|
|
|
|
|
} else if (busTypePreEntity.getSplitOrder() == ConstantStatus.ACTION_TYPE_ADVANCE) {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, preCodes, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, busTypePreEntity, preCodes, orderEntity, isGenInovice, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -223,22 +223,22 @@ public class IoChangeInoutService {
|
|
|
|
|
.collect(Collectors.groupingBy(IoCodeEntity::getRelId));
|
|
|
|
|
if (splitMap.size() > 1) {
|
|
|
|
|
for (List<IoCodeEntity> splitItems : splitMap.values()) {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, splitItems, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, splitItems, orderEntity, isGenInovice, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, groupBuyList, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, groupBuyList, orderEntity, isGenInovice, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (CollUtil.isNotEmpty(unGroupBuyList)) {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, unGroupBuyList, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, unGroupBuyList, orderEntity, isGenInovice, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, useInList, orderEntity, isGenInovice);
|
|
|
|
|
buildGenOrder(targetBustypeEntity, bussinessChangeTypeEntity, useInList, orderEntity, isGenInovice, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -246,7 +246,8 @@ public class IoChangeInoutService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void buildGenOrder(BasicBussinessTypeEntity targetBustypeEntity, BasicBusTypePreEntity bussinessChangeTypeEntity, List<IoCodeEntity> useInList, IoOrderEntity orderEntity, boolean isGenInvoice) {
|
|
|
|
|
public void buildGenOrder(BasicBussinessTypeEntity targetBustypeEntity, BasicBusTypePreEntity bussinessChangeTypeEntity,
|
|
|
|
|
List<IoCodeEntity> useInList, IoOrderEntity orderEntity, boolean isGenInvoice, Integer groupBuy) {
|
|
|
|
|
Map<String, List<IoCodeEntity>> filterSupMaps = new HashMap<>();
|
|
|
|
|
//过滤供应商
|
|
|
|
|
if (targetBustypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_OUT || bussinessChangeTypeEntity.getCreateType() == 3 || bussinessChangeTypeEntity.getCreateType() == 4) {
|
|
|
|
@ -374,9 +375,27 @@ public class IoChangeInoutService {
|
|
|
|
|
if (CollUtil.isNotEmpty(orderDetailBizEntities)) {
|
|
|
|
|
for (IoOrderDetailBizEntity orderDetailBizEntity : orderDetailBizEntities) {
|
|
|
|
|
if (corpName.equals(orderDetailBizEntity.getSupId())) {
|
|
|
|
|
orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo());
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizService.insert(orderDetailBizEntity);
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(orderDetailBizEntity.getBindRlFk());
|
|
|
|
|
if (IntUtil.value(groupBuy) == 1) {
|
|
|
|
|
if (IntUtil.value(udiRelevanceEntity.getGroupBuy())) {
|
|
|
|
|
orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo());
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizService.insert(orderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if (IntUtil.value(groupBuy) == 2) {
|
|
|
|
|
if (!IntUtil.value(udiRelevanceEntity.getGroupBuy())) {
|
|
|
|
|
orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo());
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizService.insert(orderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
orderDetailBizEntity.setOrderIdFk(outOrder.getBillNo());
|
|
|
|
|
orderDetailBizEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
orderDetailBizService.insert(orderDetailBizEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|