|
|
@ -113,7 +113,6 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: anrui-buscenter(业务管理) <br/> |
|
|
@ -1394,7 +1393,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
if ("1".equals(busSalesOrder.getType())) { |
|
|
|
//类型为现车,查询该销售订单的现车车辆信息
|
|
|
|
List<AppNowCarListVo> nowCarList = busSalesOrderVehicleService.selectAppDetailsVoBySaleOrderSid(saleOrderSid); |
|
|
|
nowCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
nowCarList.removeAll(Collections.singleton(null)); |
|
|
|
if (!nowCarList.isEmpty()) { |
|
|
|
orderInfo.setNowCarList(nowCarList); |
|
|
|
boolean isCheck = isCheck(vinNoList, nowCarList); |
|
|
@ -1406,7 +1405,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
if ("2".equals(busSalesOrder.getType())) { |
|
|
|
List<AppReadyCarListVo> appReadyCarList = busSalesVehicleOrderService.selectAppDetailsVoBySaleOrderSid(saleOrderSid); |
|
|
|
appReadyCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
appReadyCarList.removeAll(Collections.singleton(null)); |
|
|
|
if (!appReadyCarList.isEmpty()) { |
|
|
|
for (AppReadyCarListVo v : appReadyCarList) { |
|
|
|
if (appCarInfo.getReadyCar().size() > 0) { |
|
|
@ -1506,33 +1505,39 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
List<AppReadyCarListVo> appReadyCarLists = new ArrayList<>(); |
|
|
|
//根据车型及配置查询车型信息
|
|
|
|
ResultBean<AppCarConfigSummaryVo> appCarConfigSummaryVoResultBean = baseVehmodelConfigFeign.selectCarConfigSummary(modelSid, configSid, userSid); |
|
|
|
AppCarConfigSummaryVo data = appCarConfigSummaryVoResultBean.getData(); |
|
|
|
//车型sid
|
|
|
|
orderInfo.setModelSid(modelSid); |
|
|
|
//车型名称
|
|
|
|
orderInfo.setModelName(data.getModel()); |
|
|
|
//配置sid
|
|
|
|
orderInfo.setConfigSid(configSid); |
|
|
|
//车型配置
|
|
|
|
orderInfo.setCommonlyConfig(data.getConfig()); |
|
|
|
//更多配置
|
|
|
|
orderInfo.setMoreConfig(data.getMoreConfig()); |
|
|
|
//特殊说明:若为意向车型则为意向车型的特殊说明
|
|
|
|
orderInfo.setSpecialInstructions(special); |
|
|
|
//订单选择的现车列表
|
|
|
|
orderInfo.setNowCarList(appNowCarLists); |
|
|
|
//订单选择的采购订单列表
|
|
|
|
orderInfo.setReadyCarList(appReadyCarLists); |
|
|
|
vo.setPrice(data.getPrice()); |
|
|
|
if (appCarConfigSummaryVoResultBean.getSuccess()) { |
|
|
|
AppCarConfigSummaryVo data = appCarConfigSummaryVoResultBean.getData(); |
|
|
|
//车型sid
|
|
|
|
orderInfo.setModelSid(modelSid); |
|
|
|
//车型名称
|
|
|
|
orderInfo.setModelName(data.getModel()); |
|
|
|
//配置sid
|
|
|
|
orderInfo.setConfigSid(configSid); |
|
|
|
//车型配置
|
|
|
|
orderInfo.setCommonlyConfig(data.getConfig()); |
|
|
|
//更多配置
|
|
|
|
orderInfo.setMoreConfig(data.getMoreConfig()); |
|
|
|
//特殊说明:若为意向车型则为意向车型的特殊说明
|
|
|
|
orderInfo.setSpecialInstructions(special); |
|
|
|
//订单选择的现车列表
|
|
|
|
orderInfo.setNowCarList(appNowCarLists); |
|
|
|
//订单选择的采购订单列表
|
|
|
|
orderInfo.setReadyCarList(appReadyCarLists); |
|
|
|
vo.setPrice(data.getPrice()); |
|
|
|
} |
|
|
|
|
|
|
|
vo.setOrderInfo(orderInfo); |
|
|
|
//查询该车型下的现车列表
|
|
|
|
ResultBean<List<AppBaseVehicleOrderVo>> orderVoResultBean = baseVehicleFeign.selectAppList(modelSid, configSid); |
|
|
|
if (orderVoResultBean.getSuccess()) { |
|
|
|
List<AppBaseVehicleOrderVo> voList = orderVoResultBean.getData(); |
|
|
|
for (AppBaseVehicleOrderVo vehicleOrderVo : voList) { |
|
|
|
AppNowCarVo appNowCarVo = new AppNowCarVo(); |
|
|
|
BeanUtil.copyProperties(vehicleOrderVo, appNowCarVo); |
|
|
|
appNowCars.add(appNowCarVo); |
|
|
|
voList.removeAll(Collections.singleton(null)); |
|
|
|
if (!voList.isEmpty()) { |
|
|
|
for (AppBaseVehicleOrderVo vehicleOrderVo : voList) { |
|
|
|
AppNowCarVo appNowCarVo = new AppNowCarVo(); |
|
|
|
BeanUtil.copyProperties(vehicleOrderVo, appNowCarVo); |
|
|
|
appNowCars.add(appNowCarVo); |
|
|
|
} |
|
|
|
} |
|
|
|
appCarInfo.setNowCar(appNowCars); |
|
|
|
} |
|
|
@ -1540,26 +1545,29 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
ResultBean<List<AppBusVehicleApplyListVo>> applyListResultBean = busVehicleApplyDetailFeign.getAppApplyList(modelSid, configSid); |
|
|
|
if (applyListResultBean.getSuccess()) { |
|
|
|
List<AppBusVehicleApplyListVo> applyListVos = applyListResultBean.getData(); |
|
|
|
for (AppBusVehicleApplyListVo applyListVo : applyListVos) { |
|
|
|
//采购订单信息
|
|
|
|
AppReadyCarVo appReadyCarVo = new AppReadyCarVo(); |
|
|
|
BeanUtil.copyProperties(applyListVo, appReadyCarVo); |
|
|
|
if (StringUtils.isNotBlank(applyListVo.getTotalNum())) { |
|
|
|
//总数量
|
|
|
|
int totalNum = Integer.parseInt(applyListVo.getTotalNum()); |
|
|
|
if (StringUtils.isNotBlank(applyListVo.getLockingNum())) { |
|
|
|
//锁定数量
|
|
|
|
int lockNum = Integer.parseInt(applyListVo.getLockingNum()); |
|
|
|
//可使用数量
|
|
|
|
int canUseNum = totalNum - lockNum; |
|
|
|
appReadyCarVo.setCanUseNum(String.valueOf(canUseNum)); |
|
|
|
applyListVos.removeAll(Collections.singleton(null)); |
|
|
|
if (!applyListVos.isEmpty()) { |
|
|
|
for (AppBusVehicleApplyListVo applyListVo : applyListVos) { |
|
|
|
//采购订单信息
|
|
|
|
AppReadyCarVo appReadyCarVo = new AppReadyCarVo(); |
|
|
|
BeanUtil.copyProperties(applyListVo, appReadyCarVo); |
|
|
|
if (StringUtils.isNotBlank(applyListVo.getTotalNum())) { |
|
|
|
//总数量
|
|
|
|
int totalNum = Integer.parseInt(applyListVo.getTotalNum()); |
|
|
|
if (StringUtils.isNotBlank(applyListVo.getLockingNum())) { |
|
|
|
//锁定数量
|
|
|
|
int lockNum = Integer.parseInt(applyListVo.getLockingNum()); |
|
|
|
//可使用数量
|
|
|
|
int canUseNum = totalNum - lockNum; |
|
|
|
appReadyCarVo.setCanUseNum(String.valueOf(canUseNum)); |
|
|
|
} else { |
|
|
|
appReadyCarVo.setCanUseNum(String.valueOf(totalNum)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
appReadyCarVo.setCanUseNum(String.valueOf(totalNum)); |
|
|
|
appReadyCarVo.setCanUseNum("0"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
appReadyCarVo.setCanUseNum("0"); |
|
|
|
appReadyCar.add(appReadyCarVo); |
|
|
|
} |
|
|
|
appReadyCar.add(appReadyCarVo); |
|
|
|
} |
|
|
|
appCarInfo.setReadyCar(appReadyCar); |
|
|
|
} |
|
|
@ -1884,7 +1892,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
if ("02".equals(busSalesOrderDepositDetailsVo.getDepositTypeKey())) { |
|
|
|
List<BusDepositFictitiousDetailsVo> list = busDepositFictitiousService.detailsList(busSalesOrderDepositDetailsVo.getSid()); |
|
|
|
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
if (list.isEmpty()) { |
|
|
|
isDeposit = false; |
|
|
|
} |
|
|
@ -1918,7 +1926,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
//该销售订单所选择的现车的列表
|
|
|
|
List<AppNowCarListVo> nowCarList = busSalesOrderVehicleService.selectAppDetailsVoBySaleOrderSid(sid); |
|
|
|
nowCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
nowCarList.removeAll(Collections.singleton(null)); |
|
|
|
if (!nowCarList.isEmpty()) { |
|
|
|
boolean isCheck = isCheck(vinNoList, nowCarList); |
|
|
|
if (isCheck) { |
|
|
@ -1979,7 +1987,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
appCarInfo.setReadyCar(appReadyCar); |
|
|
|
//销售订单下的所选择的采购订单列表
|
|
|
|
List<AppReadyCarListVo> appReadyCarList = busSalesVehicleOrderService.selectAppDetailsVoBySaleOrderSid(sid); |
|
|
|
appReadyCarList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
appReadyCarList.removeAll(Collections.singleton(null)); |
|
|
|
if (!appReadyCarList.isEmpty()) { |
|
|
|
//验证所选采购订单的车辆是否发生了变化
|
|
|
|
boolean isCheck = isCheck2(map, appReadyCarList); |
|
|
@ -2047,19 +2055,19 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
/***************************车型信息***************************************/ |
|
|
|
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) { |
|
|
|
//若订单类型为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); |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setModelInfo(modelInfo); |
|
|
|
} |
|
|
|
|
|
|
@ -2083,7 +2091,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
} |
|
|
|
/***************************主车优惠***************************************/ |
|
|
|
List<AppOrderDiscountListVo> discountList = busSalesOrderDiscountService.selectDiscount(sid); |
|
|
|
discountList.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
discountList.removeAll(Collections.singleton(null)); |
|
|
|
if (!discountList.isEmpty()) { |
|
|
|
vo.setDiscountList(discountList); |
|
|
|
} |
|
|
@ -2093,7 +2101,7 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper |
|
|
|
String a = "由"; |
|
|
|
if ("02".equals(depositInfo.getDepositTypeKey())) { |
|
|
|
List<BusDepositFictitiousDetailsVo> list = busDepositFictitiousService.detailsList(depositInfo.getSid()); |
|
|
|
list.parallelStream().filter(Objects::nonNull).collect(Collectors.toList()); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
if (!list.isEmpty()) { |
|
|
|
for (BusDepositFictitiousDetailsVo v : list) { |
|
|
|
String b = "编号为" + v.getDepositBillNo() + "虚拟订单订金转入" + v.getPrice() + "元,"; |
|
|
|