Ver código fonte

fixed 多商户bug

fushengqian 1 ano atrás
pai
commit
6e57ca271e

+ 4 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/StaffServiceImpl.java

@@ -82,6 +82,10 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
         if (StringUtils.isNotBlank(mobile)) {
         if (StringUtils.isNotBlank(mobile)) {
             lambdaQueryWrapper.eq(MtStaff::getMobile, mobile);
             lambdaQueryWrapper.eq(MtStaff::getMobile, mobile);
         }
         }
+        String merchantId = paginationRequest.getSearchParams().get("merchantId") == null ? "" : paginationRequest.getSearchParams().get("merchantId").toString();
+        if (StringUtils.isNotBlank(merchantId)) {
+            lambdaQueryWrapper.eq(MtStaff::getMerchantId, merchantId);
+        }
         String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
         String storeId = paginationRequest.getSearchParams().get("storeId") == null ? "" : paginationRequest.getSearchParams().get("storeId").toString();
         if (StringUtils.isNotBlank(storeId)) {
         if (StringUtils.isNotBlank(storeId)) {
             lambdaQueryWrapper.eq(MtStaff::getStoreId, storeId);
             lambdaQueryWrapper.eq(MtStaff::getStoreId, storeId);

+ 3 - 0
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendRefundController.java

@@ -96,6 +96,9 @@ public class BackendRefundController extends BaseController {
         paginationRequest.setPageSize(pageSize);
         paginationRequest.setPageSize(pageSize);
 
 
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
+        if (account.getMerchantId() != null && account.getMerchantId() > 0) {
+            params.put("merchantId", account.getMerchantId());
+        }
         if (StringUtil.isNotEmpty(status)) {
         if (StringUtil.isNotEmpty(status)) {
             params.put("status", status);
             params.put("status", status);
         }
         }

+ 5 - 4
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendStaffController.java

@@ -67,16 +67,17 @@ public class BackendStaffController extends BaseController {
         if (accountInfo == null) {
         if (accountInfo == null) {
             return getFailureResult(1001, "请先登录");
             return getFailureResult(1001, "请先登录");
         }
         }
-
-        if (accountInfo.getStoreId() > 0) {
+        if (accountInfo.getStoreId() != null && accountInfo.getStoreId() > 0) {
             storeId = accountInfo.getStoreId().toString();
             storeId = accountInfo.getStoreId().toString();
         }
         }
-
         PaginationRequest paginationRequest = new PaginationRequest();
         PaginationRequest paginationRequest = new PaginationRequest();
         paginationRequest.setCurrentPage(page);
         paginationRequest.setCurrentPage(page);
         paginationRequest.setPageSize(pageSize);
         paginationRequest.setPageSize(pageSize);
 
 
         Map<String, Object> params = new HashMap<>();
         Map<String, Object> params = new HashMap<>();
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            params.put("merchantId", accountInfo.getMerchantId());
+        }
         if (StringUtil.isNotEmpty(realName)) {
         if (StringUtil.isNotEmpty(realName)) {
             params.put("name", realName);
             params.put("name", realName);
         }
         }
@@ -171,7 +172,7 @@ public class BackendStaffController extends BaseController {
         if (mtStaff == null && StringUtil.isNotEmpty(id)) {
         if (mtStaff == null && StringUtil.isNotEmpty(id)) {
             return getFailureResult(201, "员工信息不存在");
             return getFailureResult(201, "员工信息不存在");
         }
         }
-
+        mtStaff.setMerchantId(accountInfo.getMerchantId());
         mtStaff.setStoreId(Integer.parseInt(storeId));
         mtStaff.setStoreId(Integer.parseInt(storeId));
         mtStaff.setRealName(realName);
         mtStaff.setRealName(realName);
         mtStaff.setMobile(mobile);
         mtStaff.setMobile(mobile);

+ 9 - 0
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendUserGradeController.java

@@ -53,12 +53,18 @@ public class BackendUserGradeController extends BaseController {
     @RequestMapping(value = "/list", method = RequestMethod.GET)
     @RequestMapping(value = "/list", method = RequestMethod.GET)
     @CrossOrigin
     @CrossOrigin
     public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
     public ResponseObject list(HttpServletRequest request) throws BusinessCheckException {
+        String token = request.getHeader("Access-Token");
         String name = request.getParameter("name");
         String name = request.getParameter("name");
         String status = request.getParameter("status");
         String status = request.getParameter("status");
         String catchTypeKey = request.getParameter("catchType");
         String catchTypeKey = request.getParameter("catchType");
         Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
         Integer page = request.getParameter("page") == null ? Constants.PAGE_NUMBER : Integer.parseInt(request.getParameter("page"));
         Integer pageSize = request.getParameter("pageSize") == null ? Constants.PAGE_SIZE : Integer.parseInt(request.getParameter("pageSize"));
         Integer pageSize = request.getParameter("pageSize") == null ? Constants.PAGE_SIZE : Integer.parseInt(request.getParameter("pageSize"));
 
 
+        AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
+        if (accountInfo == null) {
+            return getFailureResult(1001, "请先登录");
+        }
+
         PaginationRequest paginationRequest = new PaginationRequest();
         PaginationRequest paginationRequest = new PaginationRequest();
         paginationRequest.setCurrentPage(page);
         paginationRequest.setCurrentPage(page);
         paginationRequest.setPageSize(pageSize);
         paginationRequest.setPageSize(pageSize);
@@ -73,6 +79,9 @@ public class BackendUserGradeController extends BaseController {
         if (StringUtil.isNotEmpty(catchTypeKey)) {
         if (StringUtil.isNotEmpty(catchTypeKey)) {
             params.put("catchType", catchTypeKey);
             params.put("catchType", catchTypeKey);
         }
         }
+        if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
+            params.put("merchantId", accountInfo.getMerchantId());
+        }
         paginationRequest.setSearchParams(params);
         paginationRequest.setSearchParams(params);
 
 
         PaginationResponse<MtUserGrade> paginationResponse = userGradeService.queryUserGradeListByPagination(paginationRequest);
         PaginationResponse<MtUserGrade> paginationResponse = userGradeService.queryUserGradeListByPagination(paginationRequest);