提交代码

dev-discount
胡锐 3 years ago
parent 2d80423225
commit f1aab27964
  1. 5
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  2. 2
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  3. 3
      hai-service/src/main/java/com/hai/service/impl/HighGasOilPriceServiceImpl.java

@ -125,6 +125,7 @@ public class HighGasController {
// 原始油品价格
JSONArray originalOilPriceList = result.getJSONArray("oilPriceList");
// 新油品价格
JSONArray newOilPriceList = new JSONArray();
@ -139,8 +140,12 @@ public class HighGasController {
// 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN));
}
// 过滤油品,只保留汽油
if (price.getInteger("oilType") == 1) {
newOilPriceList.add(price);
}
}
result.put("oilPriceList", newOilPriceList);
double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude));

@ -76,6 +76,8 @@ public class HighGasSchedule {
JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo"));
if (highGasOilPrice == null) {

@ -18,6 +18,7 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
@Override
public void editGasOilPrice(HighGasOilPrice highGasOilPrice) {
if (highGasOilPrice.getOilType() != null && highGasOilPrice.getOilType() == 1) {
if (highGasOilPrice.getId() != null) {
highGasOilPriceMapper.updateByPrimaryKey(highGasOilPrice);
} else {
@ -25,6 +26,8 @@ public class HighGasOilPriceServiceImpl implements HighGasOilPriceService {
}
}
}
@Override
public HighGasOilPrice getGasOilPriceByStoreAndOilNo(Long storeId, Integer oilNo) {
HighGasOilPriceExample example = new HighGasOilPriceExample();

Loading…
Cancel
Save