From be899b43367c01b339ee56c4854436a2a153c7f3 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Fri, 10 Jun 2022 17:08:59 +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/HighGasController.java | 64 +++++++++++++++++-- .../bweb/controller/HighOrderController.java | 3 + .../java/com/hai/dao/HighOrderMapperExt.java | 2 +- .../hai/service/HighMerchantStoreService.java | 7 ++ .../impl/HighMerchantStoreServiceImpl.java | 7 ++ 5 files changed, 78 insertions(+), 5 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java index dceb3f8a..056bd7be 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -173,11 +173,33 @@ public class HighGasController { Map param = new HashMap<>();; // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工 if (userInfoModel.getSecUser().getObjectType().equals(2)) { - param.put("storeId", storeId); + if (storeId != null) { + param.put("storeId", storeId); + } else { + String storeIdStr = ""; + List storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId()); + for (HighMerchantStore store : storeList) { + if (StringUtils.isBlank(storeIdStr)) { + storeIdStr += store.getId().toString(); + } else { + storeIdStr += "," + store.getId().toString(); + } + } + + if (StringUtils.isNotBlank(storeIdStr)) { + param.put("storeId", storeIdStr); + } else { + param.put("storeId", 0); + } + + } + } else if (userInfoModel.getSecUser().getObjectType().equals(3)) { param.put("storeId", userInfoModel.getMerchantStore().getId()); + } else if (userInfoModel.getSecUser().getObjectType().equals(8)) { param.put("storeId", userInfoModel.getMerchantStore().getId()); + } else { log.error("HighGasController -> disabledOil() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); @@ -237,17 +259,51 @@ public class HighGasController { @ResponseBody @ApiOperation(value = "导出油站订单") public ResponseData exportGasOrder(@RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "storeId", required = false) Long storeId, @RequestParam(name = "status", required = false) Integer status, @RequestParam(name = "createTimeS", required = false) Long createTimeS, @RequestParam(name = "createTimeE", required = false) Long createTimeE) { try { UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); - if (userInfoModel == null || userInfoModel.getMerchantStore() == null) { + if (userInfoModel == null) { log.error("HighGasController -> disabledOil() error!",""); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); } - Map param = new HashMap<>();; - param.put("storeId", userInfoModel.getMerchantStore().getId()); + Map param = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 5.充值后台工商 6.团油代理商 7.团油业务员 8. 加油站员工 + if (userInfoModel.getSecUser().getObjectType().equals(2)) { + if (storeId != null) { + param.put("storeId", storeId); + } else { + String storeIdStr = ""; + List storeList = merchantStoreService.getStoreListByMer(userInfoModel.getMerchant().getId()); + for (HighMerchantStore store : storeList) { + if (StringUtils.isBlank(storeIdStr)) { + storeIdStr += store.getId().toString(); + } else { + storeIdStr += "," + store.getId().toString(); + } + } + + if (StringUtils.isNotBlank(storeIdStr)) { + param.put("storeId", storeIdStr); + } else { + param.put("storeId", 0); + } + + } + + } else if (userInfoModel.getSecUser().getObjectType().equals(3)) { + param.put("storeId", userInfoModel.getMerchantStore().getId()); + + } else if (userInfoModel.getSecUser().getObjectType().equals(8)) { + param.put("storeId", userInfoModel.getMerchantStore().getId()); + + } else { + log.error("HighGasController -> disabledOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + param.put("orderNo", orderNo); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 61dfd7b7..ec7436fd 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -346,6 +346,9 @@ public class HighOrderController { } else if (userInfoModel.getSecUser().getObjectType() == 2) { map.put("merchantId", userInfoModel.getMerchant().getId()); + + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); } map.put("orderNo", orderNo); diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index c56c39f3..1b3c8122 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -1121,7 +1121,7 @@ public interface HighOrderMapperExt { " from high_child_order a,high_order b " + " where a.order_id = b.id " + " and goods_type = 3 " + - " and goods_id = #{param.storeId} " + + " and goods_id in (${param.storeId}) " + " and b.order_status in (${param.status})" + " = #{param.createTimeS} ]]> ", " ", diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java b/hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java index 64504c1e..4f1b781f 100644 --- a/hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java +++ b/hai-service/src/main/java/com/hai/service/HighMerchantStoreService.java @@ -70,6 +70,13 @@ public interface HighMerchantStoreService { */ HighMerchantStore getDetailById(Long id); + /** + * 查询门店列表 + * @param merId + * @return + */ + List getStoreListByMer(Long merId); + /** * @Author 胡锐 * @Description 查询门店列表 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java index a3f15204..6f2f9498 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantStoreServiceImpl.java @@ -170,6 +170,13 @@ public class HighMerchantStoreServiceImpl implements HighMerchantStoreService { return highMerchantStoreMapper.selectByPrimaryKey(id); } + @Override + public List getStoreListByMer(Long merId) { + HighMerchantStoreExample example = new HighMerchantStoreExample(); + example.createCriteria().andMerchantIdEqualTo(merId); + return highMerchantStoreMapper.selectByExample(example); + } + @Override public List getMerchantStoreList(Map map) { HighMerchantStoreExample example = new HighMerchantStoreExample();