Commit 308318ee authored by root's avatar root

Merge branch 'meiteng' of ssh://103.249.252.28:10022/lcy/education into meiteng

parents 2ccf387b 4f5f6fdc
......@@ -32,10 +32,13 @@ public class BLabelController extends PaginationController<BLabel> {
@ApiOperation(value="501 根据条件分页查询", notes="根据条件分页查询标签", response = BLabel.class)
@ApiImplicitParam(name = "lName", value = "(标签名)模糊查询条件", required = false, dataType = "varchar")
@GetMapping(value = "/queryBlabelsByPagination")
public GridModel queryBlabelsByPagination(CurUser curUser, @Valid String lName, BindingResult br){
bLabelService.queryBlabelsByPagination(getPaginationUtility(),lName);
public Result queryBlabelsByPagination(CurUser curUser, @Valid String lName, BindingResult br){
bLabelService.queryBlabelsByPagination(getPaginationUtility(),lName,curUser.getCorpId());
GridModel gridModel = getGridModelResponse();
return gridModel;
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
gridModel);
}
@ApiOperation(value="502 物理删除", notes="根据ID删除一条记录")
......@@ -73,4 +76,14 @@ public class BLabelController extends PaginationController<BLabel> {
null);
}
@ApiOperation(value="505 根据条件查询", notes="根据条件查询标签")
@ApiImplicitParam(name = "lName", value = "(标签名)模糊查询条件", required = false, dataType = "varchar")
@GetMapping(value = "/queryBlabels")
public Result queryBlabels(CurUser curUser, @Valid String lName, BindingResult br){
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
bLabelService.queryBlabels(lName,curUser.getCorpId()));
}
}
......@@ -12,10 +12,13 @@ public interface BLabelRepository extends BaseMapper<BLabel> {
// 查询所有数据
@Select("<script>SELECT * FROM b_label where del_flag != 1 and flag = 1 " +
" and corp_id = #{corpId}" +
"<if test=\"lName!=null and lName != ''\"> and l_name like CONCAT('%',#{lName},'%') </if>" +
"</script>")
@ResultMap(value = "BaseResultMap")
List<BLabel> queryBlabels(@Param("lName") String lName);
List<BLabel> queryBlabels(@Param("lName") String lName,@Param("corpId")String corpId);
// 增加标签是检查标签名重复
@Select("SELECT * from b_label where l_name=#{lName} AND del_flag='0' and flag='1'")
......
......@@ -8,7 +8,9 @@ import java.util.List;
public interface BLabelService {
List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName);
List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName,String corpId);
List<BLabel> queryBlabels(String lName,String corpId);
PersistModel insertLabel(BLabel bLabel);
......
......@@ -22,8 +22,13 @@ public class BLabelServiceImpl implements BLabelService {
private BLabelRepository bLabelRepository;
@Override
public List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName) {
return bLabelRepository.queryBlabels(lName);
public List<BLabel> queryBlabelsByPagination(PageUtil pageUtil, String lName,String corpId) {
return bLabelRepository.queryBlabels(lName,corpId);
}
@Override
public List<BLabel> queryBlabels(String lName,String corpId) {
return bLabelRepository.queryBlabels(lName,corpId);
}
@Override
......
package org.rcisoft.config;
import org.apache.poi.ss.formula.functions.T;
import org.rcisoft.core.aop.CurUserAspect;
import org.rcisoft.core.aop.EntityParamAspect;
import org.rcisoft.core.aop.IdGenAspect;
import org.rcisoft.core.aop.PageUtil;
......@@ -32,6 +33,15 @@ public class AopConfig {
return new IdGenAspect();
}
/**
* 用户 id 企业id
* @return
*/
@Bean
public CurUserAspect curUserAspectt(){
return new CurUserAspect();
}
/**
* web param validation
* @return
......
......@@ -19,7 +19,6 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Aspect
@Component
public class CurUserAspect {
/**
* 获取当前登陆人
......
......@@ -30,19 +30,19 @@ public class SysMenuController extends ResponseController {
private SysMenuService sysMenuServiceImpl;
@ApiOperation(value="构建 treeView", notes="构建 treeView")
@GetMapping("queryMenusForTree")
public List<TreeViewModel> queryTreeView(){
return sysMenuServiceImpl.queryMenuTree();
}
@ApiOperation(value="根据角色ID获取菜单", notes="根据角色ID获取菜单(已获取权限的为选中状态)")
@ApiImplicitParam(name = "id", value = "角色ID", required = true, dataType = "varchar", paramType = "path")
@GetMapping("queryMenusOfRolePermission")
public List<TreeViewModel> queryMenusOfRolePermission(String id){
return sysMenuServiceImpl.queryMenuTreeForSelectedByRP(id);
}
// @ApiOperation(value="构建 treeView", notes="构建 treeView")
// @GetMapping("queryMenusForTree")
// public List<TreeViewModel> queryTreeView(){
//
// return sysMenuServiceImpl.queryMenuTree();
// }
//
// @ApiOperation(value="根据角色ID获取菜单", notes="根据角色ID获取菜单(已获取权限的为选中状态)")
// @ApiImplicitParam(name = "id", value = "角色ID", required = true, dataType = "varchar", paramType = "path")
// @GetMapping("queryMenusOfRolePermission")
// public List<TreeViewModel> queryMenusOfRolePermission(String id){
// return sysMenuServiceImpl.queryMenuTreeForSelectedByRP(id);
// }
@ApiOperation(value="根据id 查询 menu", notes="根据id 查询 menu")
@ApiImplicitParam(name = "id", value = "businessId", required = true, dataType = "Integer", paramType = "path")
......@@ -65,29 +65,6 @@ public class SysMenuController extends ResponseController {
return "true";
}
@ApiOperation(value="增加菜单", notes="增加菜单")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "Integer", paramType = "path"),
@ApiImplicitParam(name = "parentIds", value = "所有父级编号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "name", value = "名称", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "href", value = "链接", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "target", value = "目标( mainFrame、_blank、_self、_parent、_top)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "icon", value = "图标", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "sort", value = "排序", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "isShow", value = "是否在菜单中显示(1:显示;0:不显示)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "isActiviti", value = "是否同步到工作流(1:同步;0:不同步)", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "permission", value = "权限标识", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "parentId", value = "parent id", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "code", value = "菜单编号", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "modelId", value = "model ID in sys_model", required = false, dataType = "varchar"),
@ApiImplicitParam(name = "remarks", value = "备注", required = false, dataType = "varchar")})
@PostMapping("adminLog/menuAdd")
public Result menuAdd(@Valid SysMenu menu, BindingResult br){
PersistModel persistModel = sysMenuServiceImpl.persistMenu(menu);
return Result.builder(persistModel,
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
menu);
}
@ApiOperation(value="修改菜单", notes="修改菜单")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "Integer", paramType = "path"),
......
......@@ -51,6 +51,7 @@ public class SysUserController extends PaginationController<SysUser> {
@ApiImplicitParam(name = "roleName", value = "用户角色", required = false, dataType = "varchar")})
@GetMapping(value = "/queryUsers")
public GridModel queryUsers(CurUser curUser, @Valid QuerySysUserDTO dto, BindingResult br) {
dto.setCorpId(curUser.getCorpId());
userServiceImpl.queryUsersByPagination(getPaginationUtility(), dto);
GridModel gridModel = getGridModelResponse();
return gridModel;
......
......@@ -16,21 +16,26 @@ import java.util.List;
@Repository
public interface SysUserMapper extends BaseMapper<SysUser> {
@Select("<script>select su.* ,sr.role_name as roleList from s_user as su " +
"left join s_r_user_role as ru on su.business_id = ru.user_id " +
"left join s_role as sr on ru.role_id = sr.business_id " +
"where su.del_flag = 0" +
@Select("<script>SELECT su.*, sr.r_name AS roleList FROM s_user AS su " +
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " +
"LEFT JOIN tm_admin_role AS sr ON sr.r_id = ru.role_id " +
"WHERE su.del_flag = 0 " +
"and sr.r_status != 0 " +
"and corp_id = #{corpId} " +
"<if test=\"name!=null and name != ''\"> and su.name like CONCAT('%',#{name},'%') </if>" +
"<if test=\"roleName!=null and roleName != ''\"> and sr.role_name = #{roleName}</if>" +
"<if test=\"flag!=null and flag != ''\"> and su.flag = #{flag}</if></script>")
@ResultMap(value = "BaseResultMap")
List<SysUser> queryUsers(QuerySysUserDTO dto);
@Select("<script>SELECT sr.role_name AS roleList " +
@Select("<script>SELECT sr.r_name AS roleList " +
"FROM s_user AS su " +
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " +
"LEFT JOIN s_role AS sr ON ru.role_id = sr.business_id " +
"LEFT JOIN tm_admin_role AS sr ON ru.role_id = sr.r_id " +
"WHERE su.del_flag = 0 " +
"and sr.r_status != 0 " +
"AND su.business_id = #{businessId}</script>")
List<String> queryRoleByUserId(@Param("businessId") String businessId);
......
......@@ -16,6 +16,9 @@ public class QuerySysUserDTO {
@ApiModelProperty(value = "用户角色")
private String roleName;
@ApiModelProperty(value = "企业id")
private String corpId;
@ApiModelProperty(value = "部门(暂时不用)")
private String dept;
......
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