Commit 50bb8cfc authored by fangxinjiang's avatar fangxinjiang

菜单角色 调优

parent c0af9aeb
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser; import com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService; import com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog; import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
...@@ -115,4 +116,18 @@ public class MSetttleCustomerUserController { ...@@ -115,4 +116,18 @@ public class MSetttleCustomerUserController {
public Integer getCustomerCount() { public Integer getCustomerCount() {
return mSetttleCustomerUserService.getCustomerCount(); return mSetttleCustomerUserService.getCustomerCount();
} }
/**
* @Author fxj
* @Description 远程接口获取用户B端权限关系
* @Date 10:18 2023/1/10
**/
@Inner
@PostMapping("/getSettlePermissionForB")
public TSettleDomainListVo getSettlePermissionForB(@RequestBody String userId) {
TSettleDomainListVo vo = new TSettleDomainListVo();
vo.setDeptIds(mSetttleCustomerUserService.getSettlePermissionForB(userId));
return vo;
}
} }
...@@ -30,4 +30,6 @@ public interface MSetttleCustomerUserMapper extends BaseMapper<MSetttleCustomerU ...@@ -30,4 +30,6 @@ public interface MSetttleCustomerUserMapper extends BaseMapper<MSetttleCustomerU
List<MSetttleCustomerUserVo> getCustomerUser(@Param("userIdList")List<Integer> userIdList); List<MSetttleCustomerUserVo> getCustomerUser(@Param("userIdList")List<Integer> userIdList);
Integer getCustomerCount(); Integer getCustomerCount();
List<String> getSettlePermissionForB(@Param("userId")String userId);
} }
...@@ -29,4 +29,6 @@ public interface MSetttleCustomerUserService extends IService<MSetttleCustomerUs ...@@ -29,4 +29,6 @@ public interface MSetttleCustomerUserService extends IService<MSetttleCustomerUs
Map<String,String> getCustomerUser(List<Integer> userIdList); Map<String,String> getCustomerUser(List<Integer> userIdList);
Integer getCustomerCount(); Integer getCustomerCount();
List<String> getSettlePermissionForB(String userId);
} }
...@@ -3,11 +3,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -3,11 +3,15 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser; import com.yifu.cloud.plus.v1.yifu.archives.entity.MSetttleCustomerUser;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.MSetttleCustomerUserMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.MSetttleCustomerUserMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService; import com.yifu.cloud.plus.v1.yifu.archives.service.MSetttleCustomerUserService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.MSetttleCustomerUserVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
...@@ -51,4 +55,12 @@ public class MSetttleCustomerUserServiceImpl extends ServiceImpl<MSetttleCustome ...@@ -51,4 +55,12 @@ public class MSetttleCustomerUserServiceImpl extends ServiceImpl<MSetttleCustome
public Integer getCustomerCount() { public Integer getCustomerCount() {
return baseMapper.getCustomerCount(); return baseMapper.getCustomerCount();
} }
@Override
public List<String> getSettlePermissionForB(String userId) {
if (Common.isNotNull(userId)){
return baseMapper.getSettlePermissionForB(userId);
}
return null;
}
} }
...@@ -51,5 +51,7 @@ ...@@ -51,5 +51,7 @@
<select id="getCustomerCount" resultType="java.lang.Integer"> <select id="getCustomerCount" resultType="java.lang.Integer">
SELECT count(DISTINCT customer_id) from m_setttle_customer_user a ; SELECT count(DISTINCT customer_id) from m_setttle_customer_user a ;
</select> </select>
<select id="getSettlePermissionForB" resultType="java.lang.String">
SELECT DISTINCT settle_id from m_setttle_customer_user a where a.user_id=#{userId}
</select>
</mapper> </mapper>
...@@ -458,4 +458,18 @@ public class ArchivesDaprUtil { ...@@ -458,4 +458,18 @@ public class ArchivesDaprUtil {
} }
return res; return res;
} }
/**
* @Author fxj
* @Description 获取所有客户单位的项目信息
* @Date 21:18 2022/7/18
* @Param
* @return
**/
public R<TSettleDomainListVo> getSettlePermissionForB(String userId){
R<TSettleDomainListVo> res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(),daprArchivesProperties.getAppId(),"/msetttlecustomeruser/getSettlePermissionForB",userId, TSettleDomainListVo.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("获取B端项目信息失败!");
}
return res;
}
} }
...@@ -78,6 +78,7 @@ public class BusinessUserController { ...@@ -78,6 +78,7 @@ public class BusinessUserController {
@Operation(description = "B端用户分页") @Operation(description = "B端用户分页")
public R<Page<BusinessUserVo>> getBusinessUserPage(Page<BusinessUserVo> page, BusinessUserVo user) { public R<Page<BusinessUserVo>> getBusinessUserPage(Page<BusinessUserVo> page, BusinessUserVo user) {
user.setDeptId(CommonConstants.HR_B_ORG_ID); user.setDeptId(CommonConstants.HR_B_ORG_ID);
user.setType(CommonConstants.TWO_STRING);
Page<BusinessUserVo> businessUserVoPage = userService.getBusinessUserVoPage(page, user); Page<BusinessUserVo> businessUserVoPage = userService.getBusinessUserVoPage(page, user);
//获取客户信息 //获取客户信息
if(Common.isNotNull(businessUserVoPage.getRecords())){ if(Common.isNotNull(businessUserVoPage.getRecords())){
...@@ -134,7 +135,10 @@ public class BusinessUserController { ...@@ -134,7 +135,10 @@ public class BusinessUserController {
sysUser = userService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUsername,user.getUsername()).ne(SysUser::getUserId,user.getUserId()) sysUser = userService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getUsername,user.getUsername()).ne(SysUser::getUserId,user.getUserId())
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(user.getPhone())){ if (Common.isNotNull(user.getPhone())){
userTemp = userService.getOne(Wrappers.<SysUser>lambdaQuery().eq(SysUser::getPhone, user.getPhone()).ne(SysUser::getUserId,user.getUserId()) userTemp = userService.getOne(Wrappers.<SysUser>lambdaQuery()
.eq(SysUser::getPhone, user.getPhone())
.ne(SysUser::getUserId,user.getUserId())
.eq(SysUser::getType,CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
} }
}else { }else {
......
...@@ -162,7 +162,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl ...@@ -162,7 +162,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
); );
} }
// 结算主体权限 // 结算主体权限
R< TSettleDomainListVo > sdRes = archivesDaprUtil.getPermissionByUserId(sysUser.getUserId()); R< TSettleDomainListVo > sdRes = null;
if (CommonConstants.TWO_STRING.equals(sysUser.getType())){
sdRes = archivesDaprUtil.getSettlePermissionForB(sysUser.getUserId());
}else {
sdRes = archivesDaprUtil.getPermissionByUserId(sysUser.getUserId());
}
if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())){ if (Common.isNotNull(sdRes) && Common.isNotNull(sdRes.getData())){
userInfo.setSettleIdList(sdRes.getData().getDeptIds()); userInfo.setSettleIdList(sdRes.getData().getDeptIds());
} }
......
...@@ -307,6 +307,9 @@ ...@@ -307,6 +307,9 @@
<if test="query.deptId != null and query.deptId != ''"> <if test="query.deptId != null and query.deptId != ''">
and `user`.dept_id = #{query.deptId} and `user`.dept_id = #{query.deptId}
</if> </if>
<if test="query.type != null and query.type != ''">
and `user`.type = #{query.type}
</if>
<if test="query.nickname != null and query.nickname != ''"> <if test="query.nickname != null and query.nickname != ''">
and `user`.nickname LIKE CONCAT('%',#{query.nickname},'%') and `user`.nickname LIKE CONCAT('%',#{query.nickname},'%')
</if> </if>
......
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