|
|
@ -3409,28 +3409,34 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
//若前端传值的订单类型为0则为现车,为1采购订单,为2排产
|
|
|
|
//数据库中1为现车,2为采购订单,3为排产
|
|
|
|
if ("0".equals(modelInfo.getType())) { |
|
|
|
//查询车架号
|
|
|
|
List<VinListsVo> vinLists = busSalesOrderVehicleService.selectLists(sid); |
|
|
|
//包含采购系统的车架号
|
|
|
|
List<String> vinList = vinLists.stream().map(v -> v.getVinNo()).collect(Collectors.toList()); |
|
|
|
List<String> orderVinList = busSalesOrderVehicleService.selectList(sid); |
|
|
|
if (!vinList.isEmpty()) { |
|
|
|
for (int i = 0; i < vinLists.size(); i++) { |
|
|
|
VinListsVo vinListsVo = vinLists.get(i); |
|
|
|
BigDecimal initBigDecimalTwo = BigDecimal.ZERO; |
|
|
|
//根据sid去查询销售政策的sid,根据销售政策查询销售政策的金额
|
|
|
|
ResultBean<List<String>> listResultBean = baseDiscountpackageFeign.getMoney(vinListsVo.getVinSid(), busSalesOrder.getUseOrgSid()); |
|
|
|
if (listResultBean.getSuccess() && !listResultBean.getData().isEmpty()) { |
|
|
|
List<String> stringList = listResultBean.getData(); |
|
|
|
initBigDecimalTwo = initBigDecimalTwo.add(stringList.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add)); |
|
|
|
} |
|
|
|
if (initBigDecimalTwo.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
vinList.set(i, vinList.get(i) + ",促销(" + initBigDecimalTwo.toString() + "元)"); |
|
|
|
if(StringUtils.isNotBlank(busSalesOrder.getNowCarUnknownVinNum())){ |
|
|
|
List<String> vinList = new ArrayList<>(); |
|
|
|
vinList.add("不确定车架号("+busSalesOrder.getNowCarUnknownVinNum()+")"); |
|
|
|
modelInfo.setVinList(vinList); |
|
|
|
}else{ |
|
|
|
//查询车架号
|
|
|
|
List<VinListsVo> vinLists = busSalesOrderVehicleService.selectLists(sid); |
|
|
|
//包含采购系统的车架号
|
|
|
|
List<String> vinList = vinLists.stream().map(v -> v.getVinNo()).collect(Collectors.toList()); |
|
|
|
List<String> orderVinList = busSalesOrderVehicleService.selectList(sid); |
|
|
|
if (!vinList.isEmpty()) { |
|
|
|
for (int i = 0; i < vinLists.size(); i++) { |
|
|
|
VinListsVo vinListsVo = vinLists.get(i); |
|
|
|
BigDecimal initBigDecimalTwo = BigDecimal.ZERO; |
|
|
|
//根据sid去查询销售政策的sid,根据销售政策查询销售政策的金额
|
|
|
|
ResultBean<List<String>> listResultBean = baseDiscountpackageFeign.getMoney(vinListsVo.getVinSid(), busSalesOrder.getUseOrgSid()); |
|
|
|
if (listResultBean.getSuccess() && !listResultBean.getData().isEmpty()) { |
|
|
|
List<String> stringList = listResultBean.getData(); |
|
|
|
initBigDecimalTwo = initBigDecimalTwo.add(stringList.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add)); |
|
|
|
} |
|
|
|
if (initBigDecimalTwo.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
vinList.set(i, vinList.get(i) + ",促销(" + initBigDecimalTwo.toString() + "元)"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
modelInfo.setVinList(vinList); |
|
|
|
modelInfo.setOrderVinList(orderVinList); |
|
|
|
} |
|
|
|
modelInfo.setVinList(vinList); |
|
|
|
modelInfo.setOrderVinList(orderVinList); |
|
|
|
} else { |
|
|
|
if ("1".equals(modelInfo.getType())) { |
|
|
|
//查询采购订单编号
|
|
|
@ -7027,4 +7033,16 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<BusSalesOrdersVo> getSalesOrderOne(String sid) { |
|
|
|
ResultBean<BusSalesOrdersVo> rb = ResultBean.fireFail(); |
|
|
|
BusSalesOrdersVo busSalesOrdersVo = new BusSalesOrdersVo(); |
|
|
|
BusSalesOrder busSalesOrder = fetchBySid(sid); |
|
|
|
BusSalesOrderPrice busSalesOrderPrice = busSalesOrderPriceService.selectBySalesOrderSid(sid); |
|
|
|
BusSalesOrderModel busSalesOrderModel = busSalesOrderModelService.selectByOrderSid(sid); |
|
|
|
busSalesOrdersVo.setBusSalesOrder(busSalesOrder); |
|
|
|
busSalesOrdersVo.setBusSalesOrderModel(busSalesOrderModel); |
|
|
|
busSalesOrdersVo.setBusSalesOrderPrice(busSalesOrderPrice); |
|
|
|
return rb.success().setData(busSalesOrdersVo); |
|
|
|
} |
|
|
|
} |