Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
This commit is contained in:
@@ -1,7 +1,15 @@
|
|||||||
package com.cool.store.dao;
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||||
|
import com.cool.store.entity.SysRoleMenuDO;
|
||||||
|
import com.cool.store.mapper.SysRoleMenuMapper;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
* @date 2023-05-19 03:01
|
* @date 2023-05-19 03:01
|
||||||
@@ -9,4 +17,20 @@ import org.springframework.stereotype.Repository;
|
|||||||
@Repository
|
@Repository
|
||||||
public class SysRoleMenuDAO {
|
public class SysRoleMenuDAO {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysRoleMenuMapper sysRoleMenuMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取菜单
|
||||||
|
* @param roleId
|
||||||
|
* @param platform
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<SysRoleMenuDO> getRoleMenuByRoleId(String roleId, String platform){
|
||||||
|
if(Objects.isNull(roleId) || StringUtils.isBlank(platform)){
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return sysRoleMenuMapper.getRoleMenuByRoleId(roleId, platform);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -39,6 +39,14 @@ public class UserRegionMappingDAO {
|
|||||||
return userRegionMappingMapper.deleteUserRegion(regionId, dataSourceEnum.getCode(), excludeUserIds);
|
return userRegionMappingMapper.deleteUserRegion(regionId, dataSourceEnum.getCode(), excludeUserIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Integer deleteUserRegionByUserId(String userId, DataSourceEnum dataSourceEnum, List<String> excludeRegionIds){
|
||||||
|
if(StringUtils.isBlank(userId) || Objects.isNull(dataSourceEnum)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return userRegionMappingMapper.deleteUserRegionByExcludeRegionIds(userId, dataSourceEnum.getCode(), excludeRegionIds);
|
||||||
|
}
|
||||||
|
|
||||||
public Integer deleteRegionUserByExcludeRegionIds(List<String> excludeRegionIds){
|
public Integer deleteRegionUserByExcludeRegionIds(List<String> excludeRegionIds){
|
||||||
if(CollectionUtils.isEmpty(excludeRegionIds)){
|
if(CollectionUtils.isEmpty(excludeRegionIds)){
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
|||||||
import com.cool.store.entity.SysRoleMenuDO;
|
import com.cool.store.entity.SysRoleMenuDO;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
* @date 2023-05-19 03:01
|
* @date 2023-05-19 03:01
|
||||||
@@ -22,4 +24,12 @@ public interface SysRoleMenuMapper {
|
|||||||
* dateTime:2023-05-19 03:01
|
* dateTime:2023-05-19 03:01
|
||||||
*/
|
*/
|
||||||
int updateByPrimaryKeySelective(@Param("record") SysRoleMenuDO record);
|
int updateByPrimaryKeySelective(@Param("record") SysRoleMenuDO record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色获取菜单
|
||||||
|
* @param roleId
|
||||||
|
* @param platform
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysRoleMenuDO> getRoleMenuByRoleId(@Param("roleId")String roleId, @Param("platform")String platform);
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,15 @@ public interface UserRegionMappingMapper {
|
|||||||
*/
|
*/
|
||||||
int deleteUserRegion(@Param("regionId") String regionId, @Param("type")Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
int deleteUserRegion(@Param("regionId") String regionId, @Param("type")Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户不存在的部门
|
||||||
|
* @param userId
|
||||||
|
* @param type
|
||||||
|
* @param excludeRegionIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteUserRegionByExcludeRegionIds(@Param("userId") String userId, @Param("type")Integer type, @Param("excludeRegionIds") List<String> excludeRegionIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除没有的部门映射关系
|
* 删除没有的部门映射关系
|
||||||
* @param excludeRegionIds
|
* @param excludeRegionIds
|
||||||
|
|||||||
@@ -368,10 +368,10 @@
|
|||||||
<if test="record.roomStatus !=null">
|
<if test="record.roomStatus !=null">
|
||||||
and hpip.room_status = #{record.roomStatus}
|
and hpip.room_status = #{record.roomStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="record.startTime !=null">
|
<if test="record.startTime !=null and record.startTime != ''">
|
||||||
and hpip.start_time >= #{record.startTime}
|
and hpip.start_time >= #{record.startTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="record.endTime !=null">
|
<if test="record.endTime != null and record.endTime != ''">
|
||||||
and hpip.end_time <= #{record.endTime}
|
and hpip.end_time <= #{record.endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="record.deleted !=null and record.deleted!=''">
|
<if test="record.deleted !=null and record.deleted!=''">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.SysRoleMenuDO">
|
<resultMap id="BaseResultMap" type="com.cool.store.entity.SysRoleMenuDO">
|
||||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||||
<result column="menu_id" jdbcType="BIGINT" property="menuId"/>
|
<result column="menu_id" jdbcType="BIGINT" property="menuId"/>
|
||||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
||||||
<result column="platform" jdbcType="VARCHAR" property="platform"/>
|
<result column="platform" jdbcType="VARCHAR" property="platform"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
@@ -50,4 +50,13 @@
|
|||||||
</set>
|
</set>
|
||||||
where id = #{record.id}
|
where id = #{record.id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getRoleMenuByRoleId" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
from
|
||||||
|
sys_role_menu
|
||||||
|
where
|
||||||
|
role_id=#{roleId} and platform=#{platform}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -111,6 +111,13 @@
|
|||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="deleteUserRegionByExcludeRegionIds">
|
||||||
|
update user_region_mapping set deleted = 1 where user_id = #{userId} and type = #{type}
|
||||||
|
<if test="excludeRegionIds != null and excludeRegionIds.size() > 0">
|
||||||
|
and region_id not in <foreach collection="excludeRegionIds" separator="," open="(" close=")" item="regionId" >#{regionId}</foreach>
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="deleteRegionUserByExcludeRegionIds">
|
<update id="deleteRegionUserByExcludeRegionIds">
|
||||||
update user_region_mapping set deleted = 1 where region_id not in <foreach collection="excludeRegionIds" open="(" close=")" separator="," item="regionId">#{regionId}</foreach>
|
update user_region_mapping set deleted = 1 where region_id not in <foreach collection="excludeRegionIds" open="(" close=")" separator="," item="regionId">#{regionId}</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.cool.store.dto.trtc.callback;
|
package com.cool.store.dto.trtc.callback;
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,7 +23,7 @@ public class TencentVod {
|
|||||||
@JsonProperty("StartTimeStamp")
|
@JsonProperty("StartTimeStamp")
|
||||||
private long startTimeStamp;
|
private long startTimeStamp;
|
||||||
@JsonProperty("EndTimeStamp")
|
@JsonProperty("EndTimeStamp")
|
||||||
private int endTimeStamp;
|
private long endTimeStamp;
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
@@ -82,11 +81,11 @@ public class TencentVod {
|
|||||||
this.startTimeStamp = startTimeStamp;
|
this.startTimeStamp = startTimeStamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getEndTimeStamp() {
|
public long getEndTimeStamp() {
|
||||||
return endTimeStamp;
|
return endTimeStamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEndTimeStamp(int endTimeStamp) {
|
public void setEndTimeStamp(long endTimeStamp) {
|
||||||
this.endTimeStamp = endTimeStamp;
|
this.endTimeStamp = endTimeStamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class SysRoleMenuDO implements Serializable {
|
|||||||
private Long menuId;
|
private Long menuId;
|
||||||
|
|
||||||
@ApiModelProperty("角色id")
|
@ApiModelProperty("角色id")
|
||||||
private Long roleId;
|
private String roleId;
|
||||||
|
|
||||||
@ApiModelProperty("菜单类型")
|
@ApiModelProperty("菜单类型")
|
||||||
private String platform;
|
private String platform;
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
|
|||||||
regionPathMap = regionList.stream().collect(Collectors.toMap(k->k.getRegionId(), v->v.getRegionPath()));
|
regionPathMap = regionList.stream().collect(Collectors.toMap(k->k.getRegionId(), v->v.getRegionPath()));
|
||||||
userRegionMappingDAO.batchInsertOrUpdateUserRegion(UserRegionMappingDO.convertSyncDO(departmentLists, userDetail.getUserId()));
|
userRegionMappingDAO.batchInsertOrUpdateUserRegion(UserRegionMappingDO.convertSyncDO(departmentLists, userDetail.getUserId()));
|
||||||
}
|
}
|
||||||
|
userRegionMappingDAO.deleteUserRegionByUserId(userDetail.getUserId(), DataSourceEnum.SYNC, departmentLists);
|
||||||
String jobTitle = userDetail.getJobTitle();
|
String jobTitle = userDetail.getJobTitle();
|
||||||
if(StringUtils.isNotBlank(jobTitle)){
|
if(StringUtils.isNotBlank(jobTitle)){
|
||||||
SysRoleDO role = sysRoleDAO.getRoleByName(jobTitle, DataSourceEnum.SYNC);
|
SysRoleDO role = sysRoleDAO.getRoleByName(jobTitle, DataSourceEnum.SYNC);
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ public class FlowServiceImpl implements FlowService {
|
|||||||
dataBody.setSkrName(request.getRealControlUsername());
|
dataBody.setSkrName(request.getRealControlUsername());
|
||||||
dataBody.setSkrIDCard(request.getRealControlIdcard());
|
dataBody.setSkrIDCard(request.getRealControlIdcard());
|
||||||
dataBody.setSkrRelship(request.getSignerRealControlRelation());
|
dataBody.setSkrRelship(request.getSignerRealControlRelation());
|
||||||
String[] split = request.getSignerRealControlRelationCert().split(",");
|
|
||||||
dataBody.setSkrRelshipOther(request.getSignerOtherRealControlRelation());
|
dataBody.setSkrRelshipOther(request.getSignerOtherRealControlRelation());
|
||||||
dataBody.setAmtJoin(request.getPartnerFee());
|
dataBody.setAmtJoin(request.getPartnerFee());
|
||||||
dataBody.setAmtTechSer(request.getTechnicalServiceFee());
|
dataBody.setAmtTechSer(request.getTechnicalServiceFee());
|
||||||
@@ -147,7 +146,7 @@ public class FlowServiceImpl implements FlowService {
|
|||||||
String jobNumber = investmentManager.getJobnumber();
|
String jobNumber = investmentManager.getJobnumber();
|
||||||
String mobile = investmentManager.getMobile();
|
String mobile = investmentManager.getMobile();
|
||||||
DingdingUserDO dingdingUserDO = dingdingUserMapper.selectDingDingUserByMobile(mobile);
|
DingdingUserDO dingdingUserDO = dingdingUserMapper.selectDingDingUserByMobile(mobile);
|
||||||
if (Objects.isNull(dingdingUserDO)) {
|
if (Objects.isNull(dingdingUserDO) || Objects.isNull(dingdingUserDO.getUserid())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.DINGDING_USER_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.DINGDING_USER_NOT_EXIST);
|
||||||
}
|
}
|
||||||
rpcRequest.setDingUserId(dingdingUserDO.getUserid());
|
rpcRequest.setDingUserId(dingdingUserDO.getUserid());
|
||||||
@@ -159,7 +158,7 @@ public class FlowServiceImpl implements FlowService {
|
|||||||
if (!Objects.isNull(developmentDirector)) {
|
if (!Objects.isNull(developmentDirector)) {
|
||||||
String mobile = developmentDirector.getMobile();
|
String mobile = developmentDirector.getMobile();
|
||||||
DingdingUserDO dingdingUserDO = dingdingUserMapper.selectDingDingUserByMobile(mobile);
|
DingdingUserDO dingdingUserDO = dingdingUserMapper.selectDingDingUserByMobile(mobile);
|
||||||
if (Objects.isNull(dingdingUserDO)) {
|
if (Objects.isNull(dingdingUserDO) || Objects.isNull(dingdingUserDO.getUserid())) {
|
||||||
throw new ServiceException(ErrorCodeEnum.DINGDING_USER_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.DINGDING_USER_NOT_EXIST);
|
||||||
}
|
}
|
||||||
rpcRequest.getData().setUserSiteDevDingUserId(dingdingUserDO.getUserid());
|
rpcRequest.getData().setUserSiteDevDingUserId(dingdingUserDO.getUserid());
|
||||||
|
|||||||
@@ -2,14 +2,20 @@ package com.cool.store.service.impl;
|
|||||||
|
|
||||||
import com.cool.store.constants.CommonConstants;
|
import com.cool.store.constants.CommonConstants;
|
||||||
import com.cool.store.dao.SysMenuDAO;
|
import com.cool.store.dao.SysMenuDAO;
|
||||||
|
import com.cool.store.dao.SysRoleMenuDAO;
|
||||||
import com.cool.store.entity.SysMenuDO;
|
import com.cool.store.entity.SysMenuDO;
|
||||||
|
import com.cool.store.entity.SysRoleMenuDO;
|
||||||
|
import com.cool.store.enums.MenuTypeEnum;
|
||||||
import com.cool.store.enums.PlatFormTypeEnum;
|
import com.cool.store.enums.PlatFormTypeEnum;
|
||||||
import com.cool.store.service.MenuService;
|
import com.cool.store.service.MenuService;
|
||||||
import com.cool.store.vo.menu.MenuTreeVO;
|
import com.cool.store.vo.menu.MenuTreeVO;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zhangchenbiao
|
* @author zhangchenbiao
|
||||||
@@ -22,11 +28,35 @@ public class MenuServiceImpl implements MenuService {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysMenuDAO sysMenuDAO;
|
private SysMenuDAO sysMenuDAO;
|
||||||
|
@Resource
|
||||||
|
private SysRoleMenuDAO sysRoleMenuDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MenuTreeVO> getUserMenus(String userId, String roleId) {
|
public List<MenuTreeVO> getUserMenus(String userId, String roleId) {
|
||||||
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
|
List<SysMenuDO> menuList= sysMenuDAO.selectMenuAll(null, PlatFormTypeEnum.PC.getCode());
|
||||||
|
List<SysRoleMenuDO> roleMenuList = sysRoleMenuDAO.getRoleMenuByRoleId(roleId, PlatFormTypeEnum.PC.getCode());
|
||||||
|
List<Long> anthMenuIdList = menuList.stream().filter(o -> MenuTypeEnum.AUTH.getCode().equals(o.getMenuType())).map(SysMenuDO::getId).collect(Collectors.toList());
|
||||||
|
List<Long> roleMenuIdList = roleMenuList.stream().map(SysRoleMenuDO::getMenuId).filter(anthMenuIdList::contains).collect(Collectors.toList());
|
||||||
|
Set<Long> authMenuSet = new HashSet<>();
|
||||||
|
//1倒推菜单列表 2.转换成树`
|
||||||
|
if (CollectionUtils.isEmpty(roleMenuIdList)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
authMenuSet.addAll(roleMenuIdList);
|
||||||
|
Map<Long, Long> idMap = menuList.stream().filter(a -> a.getId() != null && a.getParentId() != null).collect(Collectors.toMap(SysMenuDO::getId, SysMenuDO::getParentId));
|
||||||
|
for (Long menuId : roleMenuIdList) {
|
||||||
|
getParentNode(menuId, idMap, authMenuSet);
|
||||||
|
}
|
||||||
|
menuList = menuList.stream().filter(data -> authMenuSet.contains(data.getId())).collect(Collectors.toList());
|
||||||
//根据角色获取菜单
|
//根据角色获取菜单
|
||||||
return MenuTreeVO.dealMenuTree(CommonConstants.ZERO_LONG, menuList);
|
return MenuTreeVO.dealMenuTree(CommonConstants.ZERO_LONG, menuList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void getParentNode(Long menuId, Map<Long, Long> idMap, Set<Long> authMenuList) {
|
||||||
|
Long parentId = idMap.get(menuId);
|
||||||
|
authMenuList.add(parentId);
|
||||||
|
if (parentId!=null&&parentId != 0) {
|
||||||
|
getParentNode(parentId, idMap, authMenuList);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user