From c25cc69098b245fc6e983bfe8d290e589705e6de Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 12 May 2021 22:29:56 +0800 Subject: [PATCH] =?UTF-8?q?'=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighOrderController.java | 71 +++++++++++++------ .../com/bweb/model/ExportHighOrderModel.java | 11 +++ .../main/java/com/cweb/config/AuthConfig.java | 1 + .../HighMerchantStoreController.java | 25 +++++++ .../java/com/hai/dao/HighOrderMapperExt.java | 31 ++++---- .../com/hai/entity/HighMerchantStore.java | 14 ++++ .../com/hai/model/HighMerchantStoreModel.java | 12 ++++ .../java/com/hai/model/HighOrderModel.java | 9 +++ .../com/hai/service/HighMerchantService.java | 7 ++ .../service/impl/HighMerchantServiceImpl.java | 5 ++ 10 files changed, 152 insertions(+), 34 deletions(-) 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 3ce71385..72438da5 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -147,18 +147,35 @@ public class HighOrderController { @ResponseBody @ApiOperation(value = "查询商品订单列表") public ResponseData getGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, - @RequestParam(name = "orderNo", required = false) String orderNo, - @RequestParam(name = "paySerialNo", required = false) String paySerialNo, - @RequestParam(name = "payModel", required = false) Integer payModel, - @RequestParam(name = "payType", required = false) Integer payType, - @RequestParam(name = "orderStatus", required = false) Integer orderStatus, - @RequestParam(name = "payTimeS", required = false) Long payTimeS, - @RequestParam(name = "payTimeE", required = false) Long payTimeE, - @RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "pageSize", required = true) Integer pageSize) { + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + Map map = new HashMap<>(); - map.put("companyId", companyId); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + map.put("orderNo", orderNo); map.put("paySerialNo", paySerialNo); map.put("payModel", payModel); @@ -180,18 +197,32 @@ public class HighOrderController { @ResponseBody @ApiOperation(value = "导出商品订单列表") public ResponseData exportGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, - @RequestParam(name = "orderNo", required = false) String orderNo, - @RequestParam(name = "paySerialNo", required = false) String paySerialNo, - @RequestParam(name = "payModel", required = false) Integer payModel, - @RequestParam(name = "payType", required = false) Integer payType, - @RequestParam(name = "orderStatus", required = false) Integer orderStatus, - @RequestParam(name = "payTimeS", required = false) Long payTimeS, - @RequestParam(name = "payTimeE", required = false) Long payTimeE, - @RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "pageSize", required = true) Integer pageSize) { + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + HttpServletRequest request) { try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); Map map = new HashMap<>(); - map.put("companyId", companyId); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + map.put("orderNo", orderNo); map.put("paySerialNo", paySerialNo); map.put("payModel", payModel); diff --git a/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java b/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java index 7e0f6321..f1f3594d 100644 --- a/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java +++ b/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java @@ -7,6 +7,9 @@ import java.util.Date; public class ExportHighOrderModel { + @ExcelProperty("商户名称") + private String merchantName; + @ExcelProperty("商品类型") private String goodsType; @@ -64,6 +67,14 @@ public class ExportHighOrderModel { @ExcelProperty("取消时间") private Date cancelTime; + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + public String getGoodsType() { return goodsType; } diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index ee9f0d38..35867abd 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -99,6 +99,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/discount/getDiscountByDiscountAgentId") .excludePathPatterns("/highMerchantStore/getMerchantStoreById") .excludePathPatterns("/highMerchantStore/getStoreListByCoupon") + .excludePathPatterns("/highMerchantStore/getStoreList") .excludePathPatterns("/highMerchantStore/getMerchantList") .excludePathPatterns("/highMerchantStore/getStoreListByMerchant") .excludePathPatterns("/wechat/*") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java index 51cf18ff..1e687f58 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java @@ -1,5 +1,6 @@ package com.cweb.controller; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; @@ -153,5 +154,29 @@ public class HighMerchantStoreController { } } + @RequestMapping(value="/getStoreList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询门店列表") + public ResponseData getStoreList(@RequestParam(name = "storeName", required = false) String storeName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + + Map map = new HashMap<>(); + map.put("storeName", storeName); + + PageHelper.startPage(pageNum,pageSize); + PageInfo pageInfo = new PageInfo<>(highMerchantStoreService.getMerchantStoreList(map)); + for (HighMerchantStore store : pageInfo.getList()) { + store.setHighMerchant(highMerchantService.getDetailById(store.getMerchantId())); + } + return ResponseMsgUtil.success(pageInfo); + + } catch (Exception e) { + log.error("HighMerchantStoreController -> getStoreList() error!",e); + return ResponseMsgUtil.exception(e); + } + } } 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 d6bfd7ea..802a59de 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -94,21 +94,22 @@ public interface HighOrderMapperExt { @Select({""}) diff --git a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java index 844a3cae..05993a60 100644 --- a/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java +++ b/hai-service/src/main/java/com/hai/entity/HighMerchantStore.java @@ -106,6 +106,20 @@ public class HighMerchantStore implements Serializable { private Double distance; + private HighMerchant highMerchant; + + public HighMerchant getHighMerchant() { + return highMerchant; + } + + public void setHighMerchant(HighMerchant highMerchant) { + this.highMerchant = highMerchant; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + private static final long serialVersionUID = 1L; public Double getDistance() { diff --git a/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java b/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java index c71e0ece..52533361 100644 --- a/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java +++ b/hai-service/src/main/java/com/hai/model/HighMerchantStoreModel.java @@ -1,5 +1,6 @@ package com.hai.model; +import com.hai.entity.HighMerchant; import com.hai.entity.HighMerchantStore; import com.hai.entity.SecUser; @@ -13,6 +14,9 @@ public class HighMerchantStoreModel extends HighMerchantStore { // 账号 private SecUser secUser; + // 商户 + private HighMerchant highMerchant; + public SecUser getSecUser() { return secUser; } @@ -20,4 +24,12 @@ public class HighMerchantStoreModel extends HighMerchantStore { public void setSecUser(SecUser secUser) { this.secUser = secUser; } + + public HighMerchant getHighMerchant() { + return highMerchant; + } + + public void setHighMerchant(HighMerchant highMerchant) { + this.highMerchant = highMerchant; + } } diff --git a/hai-service/src/main/java/com/hai/model/HighOrderModel.java b/hai-service/src/main/java/com/hai/model/HighOrderModel.java index 94df268b..a8b45258 100644 --- a/hai-service/src/main/java/com/hai/model/HighOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/HighOrderModel.java @@ -5,6 +5,7 @@ import java.util.Date; public class HighOrderModel { + private String merchantName; private String goodsType; private String goodsName; private String giveawayType; @@ -25,6 +26,14 @@ public class HighOrderModel { private Date payTime; private Date cancelTime; + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + public String getGoodsType() { return goodsType; } diff --git a/hai-service/src/main/java/com/hai/service/HighMerchantService.java b/hai-service/src/main/java/com/hai/service/HighMerchantService.java index a9a34f97..eba34e5d 100644 --- a/hai-service/src/main/java/com/hai/service/HighMerchantService.java +++ b/hai-service/src/main/java/com/hai/service/HighMerchantService.java @@ -39,6 +39,13 @@ public interface HighMerchantService { */ HighMerchantModel getMerchantById(Long id); + /** + * 根据id 查询 + * @param id + * @return + */ + HighMerchant getDetailById(Long id); + /** * 查询列表 * @param map diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java index 22bb778b..ba5e8b4d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java @@ -94,6 +94,11 @@ public class HighMerchantServiceImpl implements HighMerchantService { return merchantModel; } + @Override + public HighMerchant getDetailById(Long id) { + return highMerchantMapper.selectByPrimaryKey(id); + } + @Override public List getMerchantList(Map map) { HighMerchantExample example = new HighMerchantExample();