|
|
@ -2005,4 +2005,81 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 销售订单的详情 |
|
|
|
* |
|
|
|
* @param sid 销售订单sid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<AppOrderDetailsVo> getSaleOrderDetails(String sid) { |
|
|
|
ResultBean<AppOrderDetailsVo> rb = ResultBean.fireFail(); |
|
|
|
BusSalesOrder busSalesOrder = fetchBySid(sid); |
|
|
|
if (busSalesOrder == null) { |
|
|
|
return rb.setMsg("该销售订单单据不存在"); |
|
|
|
} |
|
|
|
AppOrderDetailsVo vo = new AppOrderDetailsVo(); |
|
|
|
vo = baseMapper.getSaleOrderDetails(sid); |
|
|
|
/***************************车型信息***************************************/ |
|
|
|
AppOrderModelInfoVo modelInfo = busSalesOrderModelService.selectModel(sid); |
|
|
|
//若订单类型为0则为现车,为1采购订单,为2排产
|
|
|
|
if ("0".equals(modelInfo.getType())) { |
|
|
|
//查询车架号
|
|
|
|
List<String> vinList = busSalesOrderVehicleService.selectList(sid); |
|
|
|
modelInfo.setVinList(vinList); |
|
|
|
} else { |
|
|
|
if ("1".equals(modelInfo.getType())) { |
|
|
|
//查询采购订单编号
|
|
|
|
List<String> stringList = busSalesVehicleOrderService.selectList(sid); |
|
|
|
modelInfo.setOrderList(stringList); |
|
|
|
} |
|
|
|
} |
|
|
|
if (modelInfo != null) { |
|
|
|
vo.setModelInfo(modelInfo); |
|
|
|
} |
|
|
|
|
|
|
|
/***************************价格信息***************************************/ |
|
|
|
AppOrderPriceInfoVo priceInfo = busSalesOrderPriceService.selectPrice(sid); |
|
|
|
if (priceInfo != null) { |
|
|
|
vo.setPriceInfo(priceInfo); |
|
|
|
} |
|
|
|
/***************************上装信息***************************************/ |
|
|
|
if ("1".equals(busSalesOrder.getIsTop())) { |
|
|
|
AppOrderTopInfoVo topInfo = busSalesOrderMakeupService.selectTop(sid); |
|
|
|
if (topInfo != null) { |
|
|
|
if (StringUtils.isNotBlank(topInfo.getContractPath())) { |
|
|
|
List<String> stringList = Arrays.asList(topInfo.getContractPath().split(",")); |
|
|
|
if (!stringList.isEmpty()) { |
|
|
|
topInfo.setContractImages(stringList); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setTopInfo(topInfo); |
|
|
|
} |
|
|
|
} |
|
|
|
/***************************主车优惠***************************************/ |
|
|
|
List<AppOrderDiscountListVo> discountList = busSalesOrderDiscountService.selectDiscount(sid); |
|
|
|
discountList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
if (!discountList.isEmpty()) { |
|
|
|
vo.setDiscountList(discountList); |
|
|
|
} |
|
|
|
/***************************订金信息***************************************/ |
|
|
|
AppOrderDepositInfoVo depositInfo = busSalesOrderDepositService.selectDeposit(sid); |
|
|
|
if (depositInfo != null) { |
|
|
|
String a = "由"; |
|
|
|
if ("02".equals(depositInfo.getDepositTypeKey())) { |
|
|
|
List<BusDepositFictitiousDetailsVo> list = busDepositFictitiousService.detailsList(depositInfo.getSid()); |
|
|
|
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
for (BusDepositFictitiousDetailsVo v : list) { |
|
|
|
String b = "编号为" + v.getDepositBillNo() + "虚拟订单订金转入" + v.getPrice() + "元,"; |
|
|
|
a = a + b; |
|
|
|
} |
|
|
|
a = a + "原订金额度使用完后,其收据自动作废。"; |
|
|
|
depositInfo.setDepositRemarks(a); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setDepositInfo(depositInfo); |
|
|
|
} |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
} |