Commit 52dea4db by 墨竹

feat:区经权限

parent d5c4e9c7
...@@ -192,7 +192,6 @@ public interface StaffApiService { ...@@ -192,7 +192,6 @@ public interface StaffApiService {
/** /**
* 被职员id二维码
* 获取职员id二维码 * 获取职员id二维码
* *
* @param clerkId 职员id * @param clerkId 职员id
...@@ -261,4 +260,15 @@ public interface StaffApiService { ...@@ -261,4 +260,15 @@ public interface StaffApiService {
*/ */
List<String> getHaoBanStoreRolesByEnterpriseId(String enterpriseId, String wxEnterpriseId); List<String> getHaoBanStoreRolesByEnterpriseId(String enterpriseId, String wxEnterpriseId);
/**
*
* 获取区经管辖门店数量
*
* @param wxEnterpriseId wx企业标识
* @param clerkId 职员id
* @return int
*/
int getCountHaoBanStoreIdsByClerkId(String clerkId,String wxEnterpriseId);
} }
...@@ -11,10 +11,12 @@ import java.util.Set; ...@@ -11,10 +11,12 @@ import java.util.Set;
public interface TabHaobanStoreRelationMapper { public interface TabHaobanStoreRelationMapper {
/** /**
*
*/ */
int insertBatch(@Param("list") List<TabStoreRelation> list); int insertBatch(@Param("list") List<TabStoreRelation> list);
/** /**
*
*/ */
TabStoreRelation selectByPrimaryKey(String storeRelationId); TabStoreRelation selectByPrimaryKey(String storeRelationId);
...@@ -90,8 +92,18 @@ public interface TabHaobanStoreRelationMapper { ...@@ -90,8 +92,18 @@ public interface TabHaobanStoreRelationMapper {
List<String> listStoreGroupIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, List<String> listStoreGroupIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId); @Param("enterpriseId") String enterpriseId);
List<String> listStoreIdByName(@Param("wxEnterpriseId") String wxEnterpriseId, List<String> listStoreIdByName(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId, @Param("storeName")String storeName); @Param("enterpriseId") String enterpriseId,
@Param("storeName") String storeName);
/**
* 获取门店数量
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return int
*/
int getCountStoreIdByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId);
} }
\ No newline at end of file
...@@ -8,8 +8,6 @@ import com.gic.haoban.manage.service.entity.TabStoreRelation; ...@@ -8,8 +8,6 @@ import com.gic.haoban.manage.service.entity.TabStoreRelation;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
/** /**
* Created 2021/4/9. * Created 2021/4/9.
* *
...@@ -99,6 +97,15 @@ public interface StoreRangeService { ...@@ -99,6 +97,15 @@ public interface StoreRangeService {
public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId); public List<String> listStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId);
/** /**
* 门店数量
*
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return int
*/
int getCountStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId);
/**
* 更新门店名称 * 更新门店名称
* *
* @param enterpriseId * @param enterpriseId
......
...@@ -255,6 +255,11 @@ public class StoreRangeServiceImpl implements StoreRangeService { ...@@ -255,6 +255,11 @@ public class StoreRangeServiceImpl implements StoreRangeService {
} }
@Override @Override
public int getCountStoreIdByWxEnterpriseId(String wxEnterpriseId, String enterpriseId) {
return tabHaobanStoreRelationMapper.getCountStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
}
@Override
public void updatwStoreName(String enterpriseId, String storeId, String storeName) { public void updatwStoreName(String enterpriseId, String storeId, String storeName) {
tabHaobanStoreRelationMapper.updateStoreName(enterpriseId, storeId, storeName); tabHaobanStoreRelationMapper.updateStoreName(enterpriseId, storeId, storeName);
} }
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import java.util.ArrayList; import cn.hutool.core.collection.CollectionUtil;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
...@@ -38,16 +22,7 @@ import com.gic.haoban.base.api.common.ServiceResponse; ...@@ -38,16 +22,7 @@ import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.RolesListUtils; import com.gic.haoban.common.utils.RolesListUtils;
import com.gic.haoban.common.utils.UuidUtil; import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffPrivacyUseLogDTO;
import com.gic.haoban.manage.api.dto.StaffQrCodeDTO;
import com.gic.haoban.manage.api.dto.UserLoginLogDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
...@@ -57,18 +32,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanDepartment; ...@@ -57,18 +32,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog; import com.gic.haoban.manage.service.entity.TabHaobanSyncErrorLog;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffPrivacyUseLogService;
import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.StoreRangeService;
import com.gic.haoban.manage.service.service.SyncErrorLogService;
import com.gic.haoban.manage.service.service.UserLoginLogService;
import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.haoban.manage.service.util.EmojiFilterUtil; import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.thirdparty.api.dto.PicUploadResDTO; import com.gic.thirdparty.api.dto.PicUploadResDTO;
...@@ -79,8 +43,16 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService; ...@@ -79,8 +43,16 @@ import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.collection.CollectionUtil; import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
@Service @Service
public class StaffApiServiceImpl implements StaffApiService { public class StaffApiServiceImpl implements StaffApiService {
...@@ -935,6 +907,23 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -935,6 +907,23 @@ public class StaffApiServiceImpl implements StaffApiService {
return storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId); return storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
} }
@Override
public int getCountHaoBanStoreIdsByClerkId(String clerkId, String wxEnterpriseId) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
logger.info("导购不存在:clerkId:{}", clerkId);
return 0;
}
String enterpriseId = clerkDTO.getEnterpriseId();
int haobanStoreCount = storeRangeService.getCountStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (haobanStoreCount == 0) {
logger.info("好办门店空,eid={}", enterpriseId);
return 0;
}
int gicStoreCount = storeWidgetService.getClerkWidgetStore(clerkId);
return Math.min(haobanStoreCount,gicStoreCount);
}
/** /**
* 门店筛选器id企业端获取gic门店id列表 * 门店筛选器id企业端获取gic门店id列表
*/ */
......
...@@ -127,4 +127,16 @@ ...@@ -127,4 +127,16 @@
and store_name like CONCAT('%',#{storeName},'%') and store_name like CONCAT('%',#{storeName},'%')
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="getCountStoreIdByWxEnterpriseId" resultType="java.lang.Integer">
select
count(*)
from tab_haoban_store_relation
where
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
<if test="enterpriseId!=null">
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
</if>
and status_flag=1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,7 +9,6 @@ import com.gic.haoban.common.utils.HaobanResponse; ...@@ -9,7 +9,6 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.enums.AppPageType;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
...@@ -137,13 +136,6 @@ public class ClerkController extends WebBaseController{ ...@@ -137,13 +136,6 @@ public class ClerkController extends WebBaseController{
String storeName = departmentDTO.getDepartmentName(); String storeName = departmentDTO.getDepartmentName();
String staffName = staffDTO.getStaffName(); String staffName = staffDTO.getStaffName();
String leaderName = leader.getClerkName(); String leaderName = leader.getClerkName();
// String content = "【" + leaderName + "】:【" + storeName + "】" + staffName + "导购code:" + oldClerkCode + "已解绑,请重新分配会员!";
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("storeId", storeId);
// String data = jsonObject.toJSONString();
// String pageUrl = staffDepartmentRelatedApiService.getPageUrl(AppPageType.MEMBER_LIST.getCode(), data);
// staffDepartmentRelatedApiService.sendSingleMessage(clerkId, "分配会员通知", content, pageUrl);
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put("leaderName", leaderName); params.put("leaderName", leaderName);
params.put("storeName", storeName); params.put("storeName", storeName);
......
...@@ -266,7 +266,7 @@ public class StaffController extends WebBaseController { ...@@ -266,7 +266,7 @@ public class StaffController extends WebBaseController {
} }
} }
if (dto.getManageFlag() != null && dto.getManageFlag() == 1) { if (dto.getManageFlag() != null && dto.getManageFlag() == 1) {
dto.setManageStoreCount(storeWidgetService.getClerkWidgetStore(dto.getClerkId())); dto.setManageStoreCount(staffApiService.getCountHaoBanStoreIdsByClerkId(dto.getClerkId(),staff.getWxEnterpriseId()));
} }
} }
return resultResponse(HaoBanErrCode.ERR_1, retList); return resultResponse(HaoBanErrCode.ERR_1, retList);
......
...@@ -789,7 +789,7 @@ public class ClerkController extends WebBaseController { ...@@ -789,7 +789,7 @@ public class ClerkController extends WebBaseController {
//绑定 //绑定
@HttpLimit @HttpLimit
@RequestMapping("bind-staff") @RequestMapping("bind-staff")
public HaobanResponse bindStaff(String clerkId, String staffId, Integer auditType,Integer manageFlag) { public HaobanResponse bindStaff(String clerkId, String staffId, Integer auditType, Integer manageFlag) {
if (StringUtils.isAnyBlank(clerkId, staffId)) { if (StringUtils.isAnyBlank(clerkId, staffId)) {
return resultResponse(HaoBanErrCode.ERR_2); return resultResponse(HaoBanErrCode.ERR_2);
} }
...@@ -834,7 +834,7 @@ public class ClerkController extends WebBaseController { ...@@ -834,7 +834,7 @@ public class ClerkController extends WebBaseController {
ServiceResponse serviceResponse = staffClerkRelationApiService.wxBindStaffClerk(staffClerkRelation, staffId, ChannelCodeEnum.SELF_BIND.getCode()); ServiceResponse serviceResponse = staffClerkRelationApiService.wxBindStaffClerk(staffClerkRelation, staffId, ChannelCodeEnum.SELF_BIND.getCode());
if (!serviceResponse.isSuccess()) { if (!serviceResponse.isSuccess()) {
return resultResponse(HaoBanErrCode.ERR_DEFINE,serviceResponse.getMessage()); return resultResponse(HaoBanErrCode.ERR_DEFINE, serviceResponse.getMessage());
} }
//无需审核 //无需审核
...@@ -1071,7 +1071,6 @@ public class ClerkController extends WebBaseController { ...@@ -1071,7 +1071,6 @@ public class ClerkController extends WebBaseController {
* 导购详情 * 导购详情
* *
* @param clerkId * @param clerkId
* @param wxEnterpriseId
* @return * @return
*/ */
@RequestMapping("/clerk-detail") @RequestMapping("/clerk-detail")
...@@ -1206,10 +1205,11 @@ public class ClerkController extends WebBaseController { ...@@ -1206,10 +1205,11 @@ public class ClerkController extends WebBaseController {
/** /**
* 好友数量 * 好友数量
*
* @param clerkId * @param clerkId
* @return * @return
*/ */
@RequestMapping(value = "manage-store-count",method = RequestMethod.GET) @RequestMapping(value = "manage-store-count", method = RequestMethod.GET)
public RestResponse<Integer> manageStoreCount(String clerkId) { public RestResponse<Integer> manageStoreCount(String clerkId) {
return RestResponse.successResult(storeWidgetService.getClerkWidgetStore(clerkId)); return RestResponse.successResult(storeWidgetService.getClerkWidgetStore(clerkId));
} }
...@@ -1256,14 +1256,39 @@ public class ClerkController extends WebBaseController { ...@@ -1256,14 +1256,39 @@ public class ClerkController extends WebBaseController {
/** /**
* 根据角色查询菜单 * 根据角色查询菜单
*
* @return * @return
*/ */
@RequestMapping(value = "/queryMenuCodesByClerkType",method = RequestMethod.GET) @RequestMapping(value = "/queryMenuCodesByClerkType", method = RequestMethod.GET)
public RestResponse<HaobanRoleDTO> queryMenuByClerkType(Integer clerkType) { public RestResponse<HaobanRoleDTO> queryMenuByClerkType(Integer clerkType) {
if (clerkType == null) { if (clerkType == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_2.getCode()),HaoBanErrCode.ERR_2.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_2.getCode()), HaoBanErrCode.ERR_2.getMsg());
} }
ServiceResponse<HaobanRoleDTO> serviceResponse = haobanRoleApiService.getMenuByWxEnterpriseIdAndClerkType(this.getLoginUser().getWxEnterpriseId(), clerkType,1); ServiceResponse<HaobanRoleDTO> serviceResponse = haobanRoleApiService.getMenuByWxEnterpriseIdAndClerkType(this.getLoginUser().getWxEnterpriseId(), clerkType, 1);
return RestResponse.successResult(serviceResponse.getResult()); return RestResponse.successResult(serviceResponse.getResult());
} }
/**
* 获取导购管辖门店数量
*
* @param clerkId
* @return
*/
@RequestMapping(value = "/getCountHaoBanStoreIdsByClerkId", method = RequestMethod.GET)
public RestResponse<Integer> getCountHaoBanStoreIdsByClerkId(String clerkId) {
int count = staffApiService.getCountHaoBanStoreIdsByClerkId(clerkId, this.getLoginUser().getWxEnterpriseId());
return RestResponse.successResult(count);
}
/**
* 导购gic门店和好办企业门店交集
* @param clerkId
* @return
*/
@RequestMapping(value = "/getHaoBanStoreIdsRolesByClerkId", method = RequestMethod.GET)
public RestResponse<List<String>> getHaoBanStoreIdsRolesByClerkId(String clerkId) {
List<String> storeIds = staffApiService.getHaoBanStoreIdsRolesByClerkId(clerkId, this.getLoginUser().getWxEnterpriseId());
return RestResponse.successResult(storeIds);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment