From ffab15405b47b11b829fa4ce0311c310f325a911 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Sat, 2 Apr 2022 10:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighTyAgentController.java | 1 - .../com/cweb/controller/HighGasController.java | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentController.java index 5919fd40..772895fd 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentController.java @@ -184,7 +184,6 @@ public class HighTyAgentController { } param.put("agentKey", agentKey); param.put("agentName", agentName); - param.put("orgId", orgId); param.put("agentUser", agentUser); param.put("agentPhone", agentPhone); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index da9a16be..d670ccf9 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -66,7 +66,8 @@ public class HighGasController { @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询加油站列表") - public ResponseData getGasStoreList(@RequestParam(name = "storeName", required = false) String storeName, + public ResponseData getGasStoreList(@RequestParam(name = "isTyAgent", required = false) Boolean isTyAgent, + @RequestParam(name = "storeName", required = false) String storeName, @RequestParam(name = "distance", required = true) Integer distanceRecent, @RequestParam(name = "regionId", required = true) Long regionId, @RequestParam(name = "oilNoName", required = true) String oilNoName, @@ -104,6 +105,20 @@ public class HighGasController { // 油品国标价 * 最终优惠比例 map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN)); } + + if (isTyAgent != null && isTyAgent == true) { + // 查询是否配置了优惠比例 + HighTyAgentOilStation tyAgentOilStation = tyAgentOilStationService.getDetailByOilStationId(MapUtils.getLong(map, "id")); + if (tyAgentOilStation != null) { + HighTyAgentPrice tyAgentPrice = tyAgentPriceService.getDetail(tyAgentOilStation.getId(), MapUtils.getString(map, "oil_no")); + if (tyAgentPrice != null) { + // 优惠比例 / 100 = 最终优惠比例 + BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); + // 油品国标价 * 最终优惠比例 + map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_DOWN)); + } + } + } } } return ResponseMsgUtil.success(mapPageInfo);