Commit 97759818 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.5.8' into MVP1.5.8

parents 745dd6e0 47fc091e
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @Author hgw
* @Date 2023-9-5 09:42:31
* @Description EKP数据权限
* @Version 1.0
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.permission", ignoreInvalidFields = false)
public class DaprEkpPermissionProperties {
/*
* @author fxj
* @date 14:34
* @Description dapr sidercar url 如:http://localhost:3005/v1.0/invoke/
**/
String appUrl;
/*
* @author fxj
* @date 14:35
* @decription app_id 如:"yifu_upms_sider"
**/
String appId;
String appPort;
String httpPort;
String grpcPort;
String metricsPort;
}
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprEkpPermissionProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Author hgw
* @Description EKP权限定时任务
* @Date 2023-9-5 09:40:09
**/
@Component(value = "ekpPermissionTask")
@Slf4j
@EnableConfigurationProperties(DaprEkpPermissionProperties.class)
public class EkpPermissionTask {
@Autowired
private DaprEkpPermissionProperties daprEkpPermissionProperties;
/**
* @return
* @Author hgw
* @Description 刷新EKP权限里的账号信息
* @Date 2023-9-5 09:45:22
* @Param
**/
public void doRefreshEkpUser() throws Exception {
log.info("-------------刷新EKP权限里的账号信息-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpPermissionProperties.getAppUrl(), daprEkpPermissionProperties.getAppId(),
"/sysuserinfo/inner/doRefreshEkpUser", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------刷新EKP权限里的账号信息-定时任务结束------------");
}
}
\ No newline at end of file
......@@ -20,10 +20,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
......@@ -36,9 +34,8 @@ import javax.validation.constraints.NotBlank;
*/
@Data
@TableName("sys_role_menu_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-角色-菜单-关联表")
public class SysRoleMenuRes extends BaseEntity {
public class SysRoleMenuRes {
/**
* 主键
......
......@@ -20,10 +20,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
......@@ -36,9 +34,8 @@ import javax.validation.constraints.NotBlank;
*/
@Data
@TableName("sys_user_role_res")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "新权限-账号-角色关联表")
public class SysUserRoleRes extends BaseEntity {
public class SysUserRoleRes {
/**
* 主键
......
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 新权限-字段vo
*
* @author huyc
* @date 2023-09-04 14:49:40
*/
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@Data
public class SysDictVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String id;
/**
* 编码
*/
@Schema(description = "编码")
private String name;
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.permission.vo;/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
/**
* 新权限-账号管理表
*
* @author huyc
* @date 2023-09-04 14:49:40
*/
@Data
public class SysUserDeptVo implements Serializable {
/**
* 名称
*/
@Schema(description = "名称")
private String name;
/**
* 编码
*/
@Schema(description = "编码")
private String code;
/**
* 类型
*/
@Schema(description = "类型")
private String type;
/**
* 登录名
*/
@Schema(description = "登录名")
private String loginName;
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
/**
* 新权限-用户权限表
......@@ -18,8 +19,8 @@ public class SysUserPermissionSearchVo extends SysUserPermission {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,多个逗号分割")
private String ids;
@Schema(description = "选中ID,数组")
private List<String> idList;
/**
* 创建时间区间 [开始时间,结束时间]
......
package com.yifu.cloud.plus.v1.yifu.permission.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import io.swagger.v3.oas.annotations.media.Schema;
......@@ -21,16 +19,6 @@ import java.io.Serializable;
@Data
public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "id 不能为空")
@Length(max = 36, message = "id 不能超过36 个字符")
@ExcelAttribute(name = "id", isNotEmpty = true, errorInfo = "id 不能为空", maxLength = 36)
@Schema(description = "id")
@ExcelProperty("id")
private String id;
/**
* 员工姓名
*/
......@@ -83,26 +71,18 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
* 是否包含(0 是 1否)
*/
@Length(max = 1, message = "是否包含(0 是 1否) 不能超过1 个字符")
@ExcelAttribute(name = "是否包含(0 是 1否)", maxLength = 1)
@Schema(description = "是否包含(0 是 1否)")
@ExcelProperty("是否包含(0 是 1否)")
@Length(max = 1, message = "是否含下级部门 不能超过1 个字符")
@ExcelAttribute(name = "是否含下级部门", maxLength = 1)
@Schema(description = "是否含下级部门")
@ExcelProperty("是否含下级部门")
private String isContains;
/**
* 授权状态(0启用、1禁用)
*/
@Length(max = 1, message = "授权状态(0启用、1禁用) 不能超过1 个字符")
@ExcelAttribute(name = "授权状态(0启用、1禁用)", maxLength = 1)
@Schema(description = "授权状态(0启用、1禁用)")
@ExcelProperty("授权状态(0启用、1禁用)")
@Length(max = 1, message = "授权状态 不能超过1 个字符")
@ExcelAttribute(name = "授权状态", maxLength = 1)
@Schema(description = "授权状态")
@ExcelProperty("授权状态")
private String permissionStatus;
/**
* 删除状态(0是、1否)
*/
@Length(max = 1, message = "删除状态(0是、1否) 不能超过1 个字符")
@ExcelAttribute(name = "删除状态(0是、1否)", maxLength = 1)
@Schema(description = "删除状态(0是、1否)")
@ExcelProperty("删除状态(0是、1否)")
private String deleteFlag;
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.permission.service.SysUserInfoService;
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.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo;
......@@ -113,4 +114,32 @@ public class SysUserInfoController {
return R.ok(sysUserInfoService.removeById(fdId));
}
/**
* @Description: 手动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/5 16:14
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "手动同步并更新账号信息", description = "手动同步并更新账号信息")
@SysLog("手动同步并更新账号信息")
@PostMapping("/startRefreshEkpUser")
public R<String> startRefreshEkpUser() {
sysUserInfoService.doRefreshEkpUser();
return R.ok();
}
/**
* @param
* @Description: 定时任务-自动同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 16:07
* @return: void
**/
@Inner
@Operation(description = "定时任务-自动同步并更新账号信息")
@PostMapping("/inner/doRefreshEkpUser")
public void doRefreshEkpUser() {
sysUserInfoService.doRefreshEkpUser();
}
}
......@@ -7,6 +7,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -33,7 +35,6 @@ public class SysUserPermissionController {
private final SysUserPermissionService sysUserPermissionService;
/**
* 简单分页查询
*
......@@ -47,18 +48,6 @@ public class SysUserPermissionController {
return new R<>(sysUserPermissionService.getSysUserPermissionPage(page, sysUserPermission));
}
/**
* 不分页查询
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage")
public R<List<SysUserPermission>> getSysUserPermissionNoPage(@RequestBody SysUserPermissionSearchVo sysUserPermission) {
return R.ok(sysUserPermissionService.noPageDiy(sysUserPermission));
}
/**
* 通过id查询新权限-用户权限表
*
......@@ -102,15 +91,15 @@ public class SysUserPermissionController {
/**
* 通过id删除新权限-用户权限表
*
* @param id id
* @param idList
* @return R
*/
@Operation(description = "通过id删除新权限-用户权限表:hasPermission('permission_sysuserpermission_del')")
@SysLog("通过id删除新权限-用户权限表")
@DeleteMapping("/{id}")
@PostMapping("/deleteByIds")
@PreAuthorize("@pms.hasPermission('permission_sysuserpermission_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(sysUserPermissionService.removeById(id));
public R<Boolean> removeById(@RequestBody List<String> idList) {
return R.ok(sysUserPermissionService.removeBatchByIds(idList));
}
/**
......@@ -139,4 +128,29 @@ public class SysUserPermissionController {
public void export(HttpServletResponse response, @RequestBody SysUserPermissionSearchVo searchVo) {
sysUserPermissionService.listExport(response, searchVo);
}
/**
* 名称,编码模糊搜索
*
* @param page 分页对象
* @param searchVo 新权限-用户权限表
* @return
*/
@Operation(description = "根据名称,编码模糊搜索")
@GetMapping("/customerPage")
public R<IPage<SysUserDeptVo>> getNameCodePage(Page<SysUserDeptVo> page, SysUserDeptVo searchVo) {
return new R<>(sysUserPermissionService.getNameCodePage(page,searchVo));
}
/**
* 根据类型查询字典值
*
* @param type 字典类型
* @return
*/
@Operation(description = "根据类型查询字典值")
@PostMapping("/selectDictByType")
public R<List<SysDictVo>> selectDictByType(@RequestParam String type) {
return new R<>(sysUserPermissionService.selectDictByType(type));
}
}
......@@ -22,6 +22,8 @@ import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-账号管理表
*
......@@ -37,4 +39,14 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
* @return
*/
IPage<SysUserInfo> getSysUserInfoPage(Page<SysUserInfo> page, @Param("sysUserInfo") SysUserInfo sysUserInfo);
/**
* @param
* @Description: 获取EKP全部账号
* @Author: hgw
* @Date: 2023/9/4 11:32
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo>
**/
List<SysUserInfo> getEkpUser();
}
......@@ -4,9 +4,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 新权限-用户权限表
*
......@@ -15,10 +21,86 @@ import org.apache.ibatis.annotations.Param;
*/
@Mapper
public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
/**
* 新权限-用户权限表简单分页查询
* @param sysUserPermission 新权限-用户权限表
* @return
*/
IPage<SysUserPermission> getSysUserPermissionPage(Page<SysUserPermission> page, @Param("sysUserPermission") SysUserPermission sysUserPermission);
/**
* 新权限-用户权限表简单分页查询
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
IPage<SysUserPermission> getSysUserPermissionPage(Page<SysUserPermission> page, @Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 导出查询数量
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
long userSelectCount(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 查询导出数据
*
* @param sysUserPermission 新权限-用户权限表
* @return
*/
List<SysUserPermissionVo> userSelectList(@Param("sysUserPermission") SysUserPermissionSearchVo sysUserPermission);
/**
* 根据名称或者编码查询数据
* 单位权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectUnitVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectContractVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 合同权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectContractSimpleVO(Page<SysUserDeptVo> page, @Param("loginName") String loginName, @Param("name") String name, @Param("type") String type);
/**
* 根据名称或者编码查询数据
* 项目权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectSettleVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 商机权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectBusinessVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 报价单权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectQuotationVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 部门&&收入归属权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectDeptVO(Page<SysUserDeptVo> page, @Param("name") String name);
List<SysDictVo> selectDictByType(@Param("type") String type);
}
......@@ -60,4 +60,13 @@ public interface SysUserInfoService extends IService<SysUserInfo> {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
**/
R<String> saveOrUpdateUserInfo(SysUserInfoSaveVo vo);
/**
* @param
* @Description: 同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 11:30
* @return: void
**/
void doRefreshEkpUser();
}
......@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserPermission;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionSearchVo;
import javax.servlet.http.HttpServletResponse;
......@@ -30,5 +32,12 @@ public interface SysUserPermissionService extends IService<SysUserPermission> {
void listExport(HttpServletResponse response, SysUserPermissionSearchVo searchVo);
List<SysUserPermission> noPageDiy(SysUserPermissionSearchVo searchVo);
/**
* 新权限-用户权限表简单分页查询
* @param searchVo
* @return
*/
IPage<SysUserDeptVo> getNameCodePage(Page<SysUserDeptVo> page, SysUserDeptVo searchVo);
List<SysDictVo> selectDictByType(String type);
}
......@@ -79,15 +79,15 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
SysRoleMenuResSearchVo sysRoleMenuRes = new SysRoleMenuResSearchVo();
sysRoleMenuRes.setRoleId(role.getFdId());
List<SysRoleMenuRes> resList = sysRoleMenuResService.noPageDiy(sysRoleMenuRes);
List<TreeNode<String>> collect = sysMenuMapper
.selectList(Wrappers.<SysMenu>lambdaQuery()
.orderByAsc(SysMenu::getCreateTime)).stream()
.map(getNodeFunction()).collect(Collectors.toList());
List<Tree<String>> tree = TreeUtil.build(collect, CommonConstants.ZERO_STRING);
vo.setRole(role);
vo.setResList(resList);
vo.setTree(tree);
}
List<TreeNode<String>> collect = sysMenuMapper
.selectList(Wrappers.<SysMenu>lambdaQuery()
.orderByAsc(SysMenu::getCreateTime)).stream()
.map(getNodeFunction()).collect(Collectors.toList());
List<Tree<String>> tree = TreeUtil.build(collect, CommonConstants.ZERO_STRING);
vo.setTree(tree);
return R.ok(vo);
}
......@@ -111,6 +111,9 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
return R.failed("名称已存在");
}
this.saveOrUpdate(role);
for (SysRoleMenuRes res : resList) {
res.setRoleId(role.getFdId());
}
sysRoleMenuResService.saveBatch(resList);
return R.ok("保存成功");
}
......
......@@ -15,7 +15,6 @@ package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -24,7 +23,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysRoleMenuResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysRoleMenuResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysRoleMenuResSearchVo;
import lombok.extern.log4j.Log4j2;
......@@ -62,7 +60,6 @@ public class SysRoleMenuResServiceImpl extends ServiceImpl<SysRoleMenuResMapper,
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
......@@ -80,14 +77,6 @@ public class SysRoleMenuResServiceImpl extends ServiceImpl<SysRoleMenuResMapper,
private LambdaQueryWrapper buildQueryWrapper(SysRoleMenuResSearchVo entity) {
LambdaQueryWrapper<SysRoleMenuRes> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysRoleMenuRes::getCreateTime, entity.getCreateTimes()[0])
.le(SysRoleMenuRes::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysRoleMenuRes::getCreateName, entity.getCreateName());
}
return wrapper;
}
......
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysRoleMenuRes;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo;
......@@ -148,10 +149,26 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
sysUserRoleResService.deleteByUserId(user.getFdId());
}
this.saveOrUpdate(user);
for (SysUserRoleRes res : resList) {
res.setUserId(user.getFdId());
}
sysUserRoleResService.saveBatch(resList);
return R.ok("保存成功");
}
return R.failed("请检查信息");
}
/**
* @param
* @Description: 同步并更新账号信息
* @Author: hgw
* @Date: 2023/9/4 11:31
* @return: java.lang.String
**/
@Override
public void doRefreshEkpUser() {
List<SysUserInfo> ekpUser = baseMapper.getEkpUser();
this.saveOrUpdateBatch(ekpUser);
}
}
......@@ -15,7 +15,6 @@ package com.yifu.cloud.plus.v1.permission.service.impl;/*
* Author: lengleng (wangiegie@gmail.com)
*/
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -24,7 +23,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.permission.mapper.SysUserRoleResMapper;
import com.yifu.cloud.plus.v1.permission.service.SysUserRoleResService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes;
import com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo;
import lombok.extern.log4j.Log4j2;
......@@ -62,7 +60,6 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper,
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0) {
wrapper.last(" limit " + searchVo.getLimitStart() + "," + searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
......@@ -78,14 +75,6 @@ public class SysUserRoleResServiceImpl extends ServiceImpl<SysUserRoleResMapper,
private LambdaQueryWrapper buildQueryWrapper(SysUserRoleResSearchVo entity) {
LambdaQueryWrapper<SysUserRoleRes> wrapper = Wrappers.lambdaQuery();
if (ArrayUtil.isNotEmpty(entity.getCreateTimes())) {
wrapper.ge(SysUserRoleRes::getCreateTime, entity.getCreateTimes()[0])
.le(SysUserRoleRes::getCreateTime,
entity.getCreateTimes()[1]);
}
if (Common.isNotNull(entity.getCreateName())) {
wrapper.eq(SysUserRoleRes::getCreateName, entity.getCreateName());
}
return wrapper;
}
......
......@@ -60,7 +60,7 @@
<include refid="Base_Column_List"/>
FROM sys_menu a
<where>
1=1 AND a.DELETE_STATUS = '1'
a.DELETE_STATUS = '1'
<include refid="sysMenu_where"/>
</where>
order by a.CREATE_TIME desc
......
......@@ -116,4 +116,14 @@
order by a.CREATE_TIME desc
</select>
<!--list-->
<select id="getEkpUser" resultMap="sysUserInfoMap">
select e.fd_id,e.fd_name,p.fd_login_name,e.fd_ldap_dn
,SUBSTRING_INDEX(SUBSTRING_INDEX(e.fd_ldap_dn,',ou', 2),',ou=', -1) AS fd_dept_name
,p.fd_mobile_no,p.fd_email
from sys_org_element e JOIN sys_org_person p on e.fd_id=p.fd_id
where e.fd_is_available = '1'
</select>
</mapper>
......@@ -20,11 +20,33 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<resultMap id="sysUserPermissionExportMap" type="com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserPermissionVo">
<result property="empName" column="EMP_NAME"/>
<result property="empLoginName" column="EMP_LOGIN_NAME"/>
<result property="empDept" column="EMP_DEPT"/>
<result property="permissionType" column="PERMISSION_TYPE"/>
<result property="name" column="NAME"/>
<result property="code" column="CODE"/>
<result property="isContains" column="IS_CONTAINS"/>
<result property="permissionStatus" column="PERMISSION_STATUS"/>
</resultMap>
<resultMap id="nameAndCodeMap" type="com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo">
<result property="name" column="name"/>
<result property="code" column="code"/>
</resultMap>
<resultMap id="dictMap" type="com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo">
<result property="id" column="id"/>
<result property="name" column="name"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_NAME,
a.EMP_LOGIN_NAME,
a.EMP_DEPT,
b.fd_dept_name,
a.PERMISSION_TYPE,
a.NAME,
a.CODE,
......@@ -35,6 +57,13 @@
</sql>
<sql id="sysUserPermission_where">
<if test="sysUserPermission != null">
<if test="sysUserPermission.idList != null">
AND a.id in
<foreach item="idStr" index="index" collection="sysUserPermission.idList" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
<if test="sysUserPermission.idList == null">
<if test="sysUserPermission.empName != null and sysUserPermission.empName.trim() != ''">
AND a.EMP_NAME like concat('%',#{sysUserPermission.empName},'%')
</if>
......@@ -42,7 +71,7 @@
AND a.EMP_LOGIN_NAME = #{sysUserPermission.empLoginName}
</if>
<if test="sysUserPermission.empDept != null and sysUserPermission.empDept.trim() != ''">
AND a.EMP_DEPT like concat('%',#{sysUserPermission.empDept},'%')
AND b.EMP_DEPT like concat('%',#{sysUserPermission.empDept},'%')
</if>
<if test="sysUserPermission.permissionType != null and sysUserPermission.permissionType.trim() != ''">
AND a.PERMISSION_TYPE = #{sysUserPermission.permissionType}
......@@ -56,17 +85,131 @@
<if test="sysUserPermission.permissionStatus != null and sysUserPermission.permissionStatus.trim() != ''">
AND a.PERMISSION_STATUS = #{sysUserPermission.permissionStatus}
</if>
</if>
</if>
</sql>
<!--sysUserPermission简单分页查询-->
<select id="getSysUserPermissionPage" resultMap="sysUserPermissionMap">
SELECT
<include refid="Base_Column_List"/>
FROM sys_user_permission a
FROM sys_user_permission a left join sys_user_info b on a.EMP_LOGIN_NAME = b.fd_login_name
<where>
1=1 AND a.DELETE_FLAG = '1'
a.DELETE_FLAG = '1'
<include refid="sysUserPermission_where"/>
</where>
order by a.CREATE_TIME desc
</select>
<select id="userSelectCount" resultType="java.lang.Long">
SELECT
count(1)
FROM sys_user_permission a left join sys_user_info b on a.EMP_LOGIN_NAME = b.fd_login_name
<where>
a.DELETE_FLAG = '1'
<include refid="sysUserPermission_where"/>
</where>
</select>
<select id="userSelectList" resultMap="sysUserPermissionExportMap">
SELECT
a.EMP_NAME,
a.EMP_LOGIN_NAME,
b.fd_dept_name,
b.name AS PERMISSION_TYPE,
a.NAME,
a.CODE,
CASE WHEN a.IS_CONTAINS=0 THEN "是"
WHEN a.IS_CONTAINS =1 THEN "否"
ELSE a.IS_CONTAINS END as IS_CONTAINS,
CASE WHEN a.PERMISSION_STATUS=0 THEN "启用"
WHEN a.PERMISSION_STATUS =1 THEN "禁用"
ELSE a.PERMISSION_STATUS END as PERMISSION_STATUS
FROM sys_user_permission a
LEFT JOIN permission_type b on a.PERMISSION_TYPE = b.id
LEFT JOIN sys_user_info b on a.EMP_LOGIN_NAME = b.fd_login_name
<where>
a.DELETE_FLAG = '1'
<include refid="sysUserPermission_where"/>
</where>
limit #{sysUserPermission.limitStart},#{sysUserPermission.limitEnd}
</select>
<select id="selectUnitVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3a9d1d4d438bfc code,a.fd_3a9d1d4caeeeb8 name
from ekp_05b7485fd444f95a6177 a
where 1=1
<if test="name != null and name.trim() != ''">
AND (a.fd_3a9d1d4d438bfc like concat('%',#{name},'%') or a.fd_3a9d1d4caeeeb8 like concat('%',#{name},'%'))
</if>
</select>
<select id="selectContractVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3ade33763baa0e code,a.fd_3ade334bac0016 name
from ekp_0103c453b2848c3bb31c a
where 1=1
<if test="name != null and name.trim() != ''">
AND (a.fd_3ade33763baa0e like concat('%',#{name},'%') or a.fd_3ade334bac0016 like concat('%',#{name},'%'))
</if>
</select>
<select id="selectSettleVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3a37fe508071fe code,a.fd_3a2b38c61ef9aa name
from ekp_24a8e6a7fc143bb8c48a a
where 1=1
<if test="name != null and name.trim() != ''">
AND (a.fd_3a37fe508071fe like concat('%',#{name},'%') or a.fd_3a2b38c61ef9aa like concat('%',#{name},'%'))
</if>
</select>
<select id="selectContractSimpleVO" resultMap="nameAndCodeMap">
SELECT
a.NAME,
a.CODE
from sys_user_permission a
where a.EMP_LOGIN_NAME = #{loginName} and a.PERMISSION_TYPE = #{type}
<if test="name != null and name.trim() != ''">
AND (a.NAME like concat('%',#{name},'%') or a.CODE like concat('%',#{name},'%'))
</if>
</select>
<select id="selectBusinessVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3b107f1084fd96 code,a.fd_3b04b95268f19c name
from ekp_2f8e08660c542d8a169f a
where 1=1
<if test="name != null and name.trim() != ''">
AND (a.fd_3b107f1084fd96 like concat('%',#{name},'%') or a.fd_3b04b95268f19c like concat('%',#{name},'%'))
</if>
</select>
<select id="selectQuotationVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3b04b9dc64a9f4 code,a.fd_3b04b9daa0c25e name
from ekp_2f8e08660c542d8a169f a
where 1=1
<if test="name != null and name.trim() != ''">
AND (a.fd_3b04b9dc64a9f4 like concat('%',#{name},'%') or a.fd_3b04b9daa0c25e like concat('%',#{name},'%'))
</if>
</select>
<select id="selectDeptVO" resultMap="nameAndCodeMap">
SELECT
a.fd_no code,a.fd_name name
from sys_org_element a
where a.fd_is_available = '1' and fd_org_type = 2
<if test="name != null and name.trim() != ''">
AND (a.fd_no like concat('%',#{name},'%') or a.fd_name like concat('%',#{name},'%'))
</if>
</select>
<select id="selectDictByType" resultMap="dictMap">
SELECT
a.dict_id as id,a.name
from permission_type a
where a.dict_type = #{type}
</select>
</mapper>
......@@ -299,6 +299,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
@Override
public void sumSearchExport(HttpServletResponse response, TPaymentInfoSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
String fileName = PaymentConstants.PAYMENT_SEARCH_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX;
//获取要导出的列表
List<TPaymentInfoNewExportVo> list = new ArrayList<>();
......@@ -309,6 +310,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
if (count > 150000 && !CommonConstants.ONE_STRING.equals(user.getId())) {
out.write("导出量过大,请选择更多查询条件!如果确定要导出这些数据请联系管理员操作".getBytes("GBK"));
out.close();
return;
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfoNewExportVo.class).includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0;
......
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