From 7bb560f9b16c594cf8fddff8af637a4792cc50a9 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Wed, 13 Apr 2022 09:44:56 +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 --- .../HighTyAgentOilStationController.java | 28 +++++++++++++++---- .../HighTyAgentPriceController.java | 2 +- .../cweb/controller/HighGasController.java | 8 +++--- .../cweb/controller/HighOrderController.java | 7 +---- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java index d2c02ac7..c65ec855 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentOilStationController.java @@ -332,8 +332,11 @@ public class HighTyAgentOilStationController { public ResponseData getOrderList(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "goodsName", required = false) String goodsName, @RequestParam(name = "salesmanName", required = false) String salesmanName, + @RequestParam(name = "salesmanId", required = false) Long salesmanId, @RequestParam(name = "agentName", required = false) String agentName, + @RequestParam(name = "agentId", required = false) Long agentId, @RequestParam(name = "orgName", required = false) String orgName, + @RequestParam(name = "orgId", required = false) Long orgId, @RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "payTimeS", required = false) Long payTimeS, @RequestParam(name = "payTimeE", required = false) Long payTimeE, @@ -359,17 +362,23 @@ public class HighTyAgentOilStationController { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { param.put("companyId", userModel.getBsCompany().getId()); param.put("orgName", orgName); + param.put("orgId", orgId); param.put("agentName", agentName); + param.put("agentId", agentId); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) { param.put("orgId", userModel.getBsOrganization().getId()); param.put("agentName", agentName); + param.put("agentId", agentId); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { param.put("agentId", userModel.getHighTyAgent().getId()); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { param.put("salesmanId", userModel.getHighTySalesman().getId()); @@ -391,11 +400,14 @@ public class HighTyAgentOilStationController { public ResponseData excelOrder(@RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "goodsName", required = false) String goodsName, @RequestParam(name = "salesmanName", required = false) String salesmanName, + @RequestParam(name = "salesmanId", required = false) Long salesmanId, + @RequestParam(name = "agentName", required = false) String agentName, + @RequestParam(name = "agentId", required = false) Long agentId, + @RequestParam(name = "orgName", required = false) String orgName, + @RequestParam(name = "orgId", required = false) Long orgId, @RequestParam(name = "memPhone", required = false) String memPhone, @RequestParam(name = "payTimeS", required = false) Long payTimeS, - @RequestParam(name = "payTimeE", required = false) Long payTimeE, - @RequestParam(name = "agentName", required = false) String agentName, - @RequestParam(name = "orgName", required = false) String orgName) { + @RequestParam(name = "payTimeE", required = false) Long payTimeE) { try { UserInfoModel userModel = userCenter.getSessionModel(UserInfoModel.class); if (userModel == null) { @@ -416,17 +428,23 @@ public class HighTyAgentOilStationController { if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { param.put("companyId", userModel.getBsCompany().getId()); param.put("orgName", orgName); + param.put("orgId", orgId); param.put("agentName", agentName); + param.put("agentId", agentId); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(0)) { param.put("orgId", userModel.getBsOrganization().getId()); param.put("agentName", agentName); + param.put("agentId", agentId); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { param.put("agentId", userModel.getHighTyAgent().getId()); param.put("salesmanName", salesmanName); + param.put("salesmanId", salesmanId); } else if (userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type7.getType())) { param.put("salesmanId", userModel.getHighTySalesman().getId()); @@ -442,7 +460,7 @@ public class HighTyAgentOilStationController { if (userModel.getBsCompany() != null) { headList.add("代理商"); } - if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { + if ((userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { headList.add("业务员"); } if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { @@ -473,7 +491,7 @@ public class HighTyAgentOilStationController { if (userModel.getBsCompany() != null) { data.add(orderModel.getAgentName()); } - if (userModel.getBsCompany() != null || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { + if ((userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) || userModel.getSecUser().getObjectType().equals(UserObjectTypeEnum.type6.getType())) { data.add(orderModel.getSalesmanName()); } if (userModel.getBsCompany() != null && userModel.getSecUser().getAdminFlag().equals(1)) { diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java index 87b2d63f..5e5de0d6 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTyAgentPriceController.java @@ -124,7 +124,7 @@ public class HighTyAgentPriceController { // 价格 HighTyAgentPrice priceRate = tyAgentPriceService.getDetail(station.getId(), price.getOilNo().toString()); if (priceRate == null) { - oilPriceMap.put("priceRate", MapUtils.getLong(oilPriceMap, "lowPrice")); + oilPriceMap.put("priceRate", gasDiscountOilPriceService.getDetailByOilNo(price.getOilNo().toString()).getPriceRate()); } else { oilPriceMap.put("priceRate", priceRate.getPriceRate()); } 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 d670ccf9..28aacba2 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -103,7 +103,7 @@ public class HighGasController { // 优惠比例 / 100 = 最终优惠比例 BigDecimal priceRate = gasDiscountOilPrice.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)); + map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); } if (isTyAgent != null && isTyAgent == true) { @@ -115,7 +115,7 @@ public class HighGasController { // 优惠比例 / 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)); + map.put("price_vip", new BigDecimal(MapUtils.getString(map, "price_official")).multiply(priceRate).setScale(2, BigDecimal.ROUND_HALF_UP)); } } } @@ -164,7 +164,7 @@ public class HighGasController { // 优惠比例 / 100 = 最终优惠比例 BigDecimal priceRate = gasDiscountOilPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); // 油品国标价 * 最终优惠比例 - 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_HALF_UP)); } if (isTyAgent != null && isTyAgent == true) { @@ -176,7 +176,7 @@ public class HighGasController { // 优惠比例 / 100 = 最终优惠比例 BigDecimal priceRate = tyAgentPrice.getPriceRate().divide(new BigDecimal("100").setScale(2, BigDecimal.ROUND_DOWN)); // 油品国标价 * 最终优惠比例 - 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_HALF_UP)); } } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 544732bf..0bd38c62 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -256,7 +256,7 @@ public class HighOrderController { // 平台的价格 childOrder.setExt1(childOrder.getGasPriceVip().toString()); - childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_HALF_UP)); + childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_DOWN)); // 团油的价格 childOrder.setGasPriceGun(priceDetail.getBigDecimal("priceGun")); @@ -423,11 +423,6 @@ public class HighOrderController { } } - public static void main(String[] args) { - System.out.println(new BigDecimal("100").divide(new BigDecimal("7.00"),10,BigDecimal.ROUND_DOWN) - .multiply(new BigDecimal("4.2")).setScale(2,BigDecimal.ROUND_HALF_UP)); - } - @RequestMapping(value = "/getOrderById", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询订单详情")