Merge branch 'cc_20251005_fuck' into 'master'
Cc 20251005 fuck See merge request hangzhou/java/custom_zxjp!165
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
<when test="regionIdList != null and regionIdList.size > 0">
|
||||
SELECT store_id as storeId, store_name as shopName, store_num as shopCode, store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
WHERE a.is_delete = 'effective'
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
@@ -136,7 +136,7 @@
|
||||
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
|
||||
WHERE a.is_delete = 'effective'
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
@@ -151,7 +151,7 @@
|
||||
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
|
||||
WHERE a.is_delete = 'effective'
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.EnterpriseUserRoleDao;
|
||||
import com.cool.store.dao.StoreDao;
|
||||
import com.cool.store.dto.GetAccessTokenDTO;
|
||||
import com.cool.store.dto.HqtTokenDTO;
|
||||
import com.cool.store.dto.ModifyPasswordDTO;
|
||||
import com.cool.store.dto.XgjOrganizationDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.UserRoleEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.ZxjpApiRequest;
|
||||
import com.cool.store.request.xgj.PushFranchiseFeeRequest;
|
||||
@@ -182,8 +188,28 @@ public class PushServiceImpl implements PushService {
|
||||
return executeApiCall(apiUrl, dto, String.class, "", "");
|
||||
}
|
||||
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
@Resource
|
||||
EnterpriseUserRoleDao enterpriseUserRoleDao;
|
||||
@Resource
|
||||
StoreDao storeDao;
|
||||
|
||||
@Override
|
||||
public String getPosToken(GetAccessTokenDTO dto) {
|
||||
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(dto.getMobile());
|
||||
if (enterpriseUserDO != null){
|
||||
List<Long> userRoleIds = enterpriseUserRoleDao.getUserRoleIds(enterpriseUserDO.getUserId());
|
||||
//如果userRoleIds包含督导。大区总。分部负责人任何一个 使用当前门店的手机号
|
||||
if (userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode()) ||
|
||||
userRoleIds.contains(UserRoleEnum.HEAD_OF_DIVISION.getCode()) ||
|
||||
userRoleIds.contains(UserRoleEnum.REGION_MANAGER.getCode())) {
|
||||
StoreDO store = storeDao.getByStoreNum(dto.getShopCode());
|
||||
if (store != null&&store.getTelephone()!=null){
|
||||
dto.setMobile(store.getTelephone());
|
||||
}
|
||||
}
|
||||
}
|
||||
String apiUrl = url + "/dzgV1/zxcrm/business_user/generateToken";
|
||||
return executeApiCall(apiUrl, dto, String.class, username, secret);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,10 @@ public class StoreServiceImpl implements StoreService {
|
||||
List<Long> userRoleIds = enterpriseUserRoleDao.getUserRoleIds(enterpriseUserDO.getUserId());
|
||||
//查询职位详情,筛选掉店外职位
|
||||
List<SysRoleDO> roleIds = sysRoleDao.selectRoleByRoleIds(userRoleIds);
|
||||
List<SysRoleDO> sysRoleDOS = roleIds.stream().filter(role -> "store_inside".equals(role.getPositionType())||UserRoleEnum.SUPERVISION.getCode().equals(role.getId())).collect(Collectors.toList());
|
||||
List<SysRoleDO> sysRoleDOS = roleIds.stream().filter(role -> "store_inside".equals(role.getPositionType())
|
||||
||UserRoleEnum.SUPERVISION.getCode().equals(role.getId())
|
||||
||UserRoleEnum.HEAD_OF_DIVISION.getCode().equals(role.getId())
|
||||
||UserRoleEnum.REGION_MANAGER.getCode().equals(role.getId())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(sysRoleDOS)){
|
||||
//获取用户管辖区域
|
||||
List<UserAuthMappingDO> userAuthMapping = userAuthMappingService.listUserAuthMappingByUserId(enterpriseUserDO.getUserId());
|
||||
|
||||
Reference in New Issue
Block a user