|
|
@ -81,24 +81,21 @@ public class BsGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional(propagation= Propagation.REQUIRED) |
|
|
|
|
|
|
|
public void businessHandle(BsGasOilPriceTask gasOilPriceTask) { |
|
|
|
public void businessHandle(BsGasOilPriceTask gasOilPriceTask) { |
|
|
|
// 立刻执行
|
|
|
|
// 立刻执行
|
|
|
|
gasOilPriceTask.setStartTime(new Date()); |
|
|
|
gasOilPriceTask.setStartTime(new Date()); |
|
|
|
gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus()); |
|
|
|
gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus()); |
|
|
|
editData(gasOilPriceTask); |
|
|
|
editData(gasOilPriceTask); |
|
|
|
|
|
|
|
|
|
|
|
// 国标价
|
|
|
|
|
|
|
|
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { |
|
|
|
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { |
|
|
|
|
|
|
|
// 国标价
|
|
|
|
// 更新国标价
|
|
|
|
// 更新国标价
|
|
|
|
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(),gasOilPriceTask.getOilPriceZoneId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); |
|
|
|
gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(),gasOilPriceTask.getOilPriceZoneId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); |
|
|
|
|
|
|
|
|
|
|
|
// 更新自建站的国标价
|
|
|
|
// 更新自建站的国标价
|
|
|
|
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); |
|
|
|
gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); |
|
|
|
} |
|
|
|
} else if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) { |
|
|
|
|
|
|
|
|
|
|
|
// 油站价
|
|
|
|
// 油站价
|
|
|
|
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) { |
|
|
|
|
|
|
|
// 查询油品价格
|
|
|
|
// 查询油品价格
|
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
if (price == null) { |
|
|
|
if (price == null) { |
|
|
@ -107,10 +104,8 @@ public class BsGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { |
|
|
|
price.setPriceGun(gasOilPriceTask.getPrice().subtract(price.getGasStationDrop())); |
|
|
|
price.setPriceGun(gasOilPriceTask.getPrice().subtract(price.getGasStationDrop())); |
|
|
|
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); |
|
|
|
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); |
|
|
|
gasOilPriceService.editOilPrice(price); |
|
|
|
gasOilPriceService.editOilPrice(price); |
|
|
|
} |
|
|
|
} else if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) { |
|
|
|
|
|
|
|
|
|
|
|
// 平台优惠
|
|
|
|
// 平台优惠
|
|
|
|
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) { |
|
|
|
|
|
|
|
// 查询油品价格
|
|
|
|
// 查询油品价格
|
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
if (price == null) { |
|
|
|
if (price == null) { |
|
|
@ -119,10 +114,8 @@ public class BsGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { |
|
|
|
price.setPreferentialMargin(gasOilPriceTask.getPrice()); |
|
|
|
price.setPreferentialMargin(gasOilPriceTask.getPrice()); |
|
|
|
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); |
|
|
|
price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); |
|
|
|
gasOilPriceService.editOilPrice(price); |
|
|
|
gasOilPriceService.editOilPrice(price); |
|
|
|
} |
|
|
|
} else if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus())) { |
|
|
|
|
|
|
|
|
|
|
|
// 油站直降
|
|
|
|
// 油站直降
|
|
|
|
if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus())) { |
|
|
|
|
|
|
|
// 查询油品价格
|
|
|
|
// 查询油品价格
|
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); |
|
|
|
if (price == null) { |
|
|
|
if (price == null) { |
|
|
|