|  | @@ -66,6 +66,9 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
 | 
											
												
													
														|  |          BigDecimal hasRouteBalance = BigDecimal.ZERO;
 |  |          BigDecimal hasRouteBalance = BigDecimal.ZERO;
 | 
											
												
													
														|  |          BigDecimal goodsTotalBalance = goodsTotalPrice.multiply(balance).divide(totalAmount, 2, BigDecimal.ROUND_HALF_UP);
 |  |          BigDecimal goodsTotalBalance = goodsTotalPrice.multiply(balance).divide(totalAmount, 2, BigDecimal.ROUND_HALF_UP);
 | 
											
												
													
														|  |          List<SellOrder> sellOrders = new ArrayList<>();
 |  |          List<SellOrder> sellOrders = new ArrayList<>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          for (Integer goodsId : goodsIds) {
 |  |          for (Integer goodsId : goodsIds) {
 | 
											
												
													
														|  |              SellOrder sellOrder = new SellOrder();
 |  |              SellOrder sellOrder = new SellOrder();
 | 
											
												
													
														|  |              BigDecimal goodsPrice = BigDecimal.ZERO;
 |  |              BigDecimal goodsPrice = BigDecimal.ZERO;
 | 
											
										
											
												
													
														|  | @@ -115,6 +118,24 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
 | 
											
												
													
														|  |              } else {
 |  |              } else {
 | 
											
												
													
														|  |                  sellOrder.setType(SellTypeEnum.OTHER);
 |  |                  sellOrder.setType(SellTypeEnum.OTHER);
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +            StockType goodsStockType = StockType.INTERNAL;
 | 
											
												
													
														|  | 
 |  | +            for (Goods goods : goodies) {
 | 
											
												
													
														|  | 
 |  | +                if (goods.getId().equals(goodsId)) {
 | 
											
												
													
														|  | 
 |  | +                    goodsStockType = goods.getStockType();
 | 
											
												
													
														|  | 
 |  | +                    break;
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            //库存类型
 | 
											
												
													
														|  | 
 |  | +            if(goodsStockType.equals(StockType.ALL) && accountType.equals(AccountType.INTERNAL)){
 | 
											
												
													
														|  | 
 |  | +                sellOrder.setStockType(StockType.INTERNAL);
 | 
											
												
													
														|  | 
 |  | +            }else if(goodsStockType.equals(StockType.ALL) && accountType.equals(AccountType.EXTERNAL)){
 | 
											
												
													
														|  | 
 |  | +                sellOrder.setStockType(StockType.EXTERNAL);
 | 
											
												
													
														|  | 
 |  | +            }else {
 | 
											
												
													
														|  | 
 |  | +                sellOrder.setStockType(goodsStockType);
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +            //批次号 TODO
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |              sellOrders.add(sellOrder);
 |  |              sellOrders.add(sellOrder);
 | 
											
												
													
														|  |              i++;
 |  |              i++;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
										
											
												
													
														|  | @@ -137,7 +158,9 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          int i = 1;
 |  |          int i = 1;
 | 
											
												
													
														|  |          BigDecimal detailRouteBalance = BigDecimal.ZERO;
 |  |          BigDecimal detailRouteBalance = BigDecimal.ZERO;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(studentPaymentOrder.getPaymentChannel()), studentPaymentOrder.getMerNos());
 |  |          AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(studentPaymentOrder.getPaymentChannel()), studentPaymentOrder.getMerNos());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          for (StudentPaymentOrderDetail orderDetail : orderDetails) {
 |  |          for (StudentPaymentOrderDetail orderDetail : orderDetails) {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |              BigDecimal detailBalance = orderDetail.getPrice().compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO :
 |  |              BigDecimal detailBalance = orderDetail.getPrice().compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO :
 | 
											
										
											
												
													
														|  | @@ -220,7 +243,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
 | 
											
												
													
														|  |                  }else {
 |  |                  }else {
 | 
											
												
													
														|  |                      sellOrder.setStockType(goods.getStockType());
 |  |                      sellOrder.setStockType(goods.getStockType());
 | 
											
												
													
														|  |                  }
 |  |                  }
 | 
											
												
													
														|  | -                //批次号
 |  | 
 | 
											
												
													
														|  | 
 |  | +                //批次号 TODO
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  sellOrders.add(sellOrder);
 |  |                  sellOrders.add(sellOrder);
 | 
											
												
													
														|  |              }
 |  |              }
 |