提交代码

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 originalOilPriceList = result.getJSONArray("oilPriceList");
// 新油品价格 // 新油品价格
JSONArray newOilPriceList = new JSONArray(); JSONArray newOilPriceList = new JSONArray();
@ -139,8 +140,12 @@ public class HighGasController {
// 油品国标价 * 最终优惠比例 // 油品国标价 * 最终优惠比例
price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN)); price.put("priceVip", price.getBigDecimal("priceOfficial").multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN));
} }
// 过滤油品,只保留汽油
if (price.getInteger("oilType") == 1) {
newOilPriceList.add(price); newOilPriceList.add(price);
} }
}
result.put("oilPriceList", newOilPriceList); 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)); 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"); JSONArray oilPriceList = object.getJSONArray("oilPriceList");
for (Object oilPrice : oilPriceList) { for (Object oilPrice : oilPriceList) {
JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice));
// 查询门店油号 // 查询门店油号
highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo"));
if (highGasOilPrice == null) { if (highGasOilPrice == null) {

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

Loading…
Cancel
Save