Commit 58bef5fe authored by 高建强's avatar 高建强

item:视频监控新增所属机构树,函数脚本维护。

parent 8a0a5b00
...@@ -26,6 +26,7 @@ public class ReginParams implements Serializable { ...@@ -26,6 +26,7 @@ public class ReginParams implements Serializable {
private String personName; private String personName;
private String companyId; private String companyId;
private String companyName; private String companyName;
private String bizOrgCode;
} }
public PersonIdentity getPersonIdentity() { public PersonIdentity getPersonIdentity() {
......
...@@ -97,4 +97,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -97,4 +97,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String,Object>> queryCompanyIdNew(String bizOrgName); List<Map<String,Object>> queryCompanyIdNew(String bizOrgName);
OrgUsr queryByUserId(@Param("userId")Long userId); OrgUsr queryByUserId(@Param("userId")Long userId);
List<OrgUsr> companyTreeByUserAndType(@Param("userId") String userId, @Param("type") String type);
OrgUsr queryBySequenceNbr(@Param("parentId") String parentId);
} }
...@@ -201,6 +201,15 @@ public interface IOrgUsrService { ...@@ -201,6 +201,15 @@ public interface IOrgUsrService {
*/ */
List<OrgMenuDto> companyTreeByUser(AgencyUserModel user); List<OrgMenuDto> companyTreeByUser(AgencyUserModel user);
/**
* 根据登录人及类型获取公司部门树
* @param user
* @param type 默认查询公司及部门,公司:COMPANY,部门:DEPARTMENT
* @return
*/
List<OrgMenuDto> companyTreeByUserAndType(AgencyUserModel user, String type);
/** /**
* 根据登陆人获取公司列表(关联重点部位) * 根据登陆人获取公司列表(关联重点部位)
*/ */
...@@ -283,4 +292,6 @@ public interface IOrgUsrService { ...@@ -283,4 +292,6 @@ public interface IOrgUsrService {
void updateByIdOrgPersonFlc(OrgPersonDto OrgPersonVo, Long id) throws Exception; void updateByIdOrgPersonFlc(OrgPersonDto OrgPersonVo, Long id) throws Exception;
JSONObject selectPersonByUserId(Long userId) throws Exception; JSONObject selectPersonByUserId(Long userId) throws Exception;
UserDto getUserParentInfo(String userId);
} }
...@@ -737,4 +737,24 @@ LEFT JOIN ( ...@@ -737,4 +737,24 @@ LEFT JOIN (
AND amos_org_id = #{userId} AND amos_org_id = #{userId}
</if> </if>
</select> </select>
<select id="queryBySequenceNbr" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
<if test="parentId != null and parentId != ''">
AND sequence_nbr = #{parentId}
</if>
</select>
<select id="companyTreeByUserAndType" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
SELECT
*
FROM
cb_org_usr usr
<where>
usr.sequence_nbr IN ( SELECT getOrgUsrTreeById ( ( SELECT parent_id FROM cb_org_usr WHERE amos_org_id = #{userId} ) ) )
<if test="type != null and type != ''">
AND usr.biz_org_type = #{type}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -11,35 +11,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -11,35 +11,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.UserDto;
import com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService; import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -66,6 +52,10 @@ public class OrgUsrController extends BaseController { ...@@ -66,6 +52,10 @@ public class OrgUsrController extends BaseController {
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired
private IOrgUsrService orgUsrService;
@Autowired @Autowired
ESOrgUsrService eSOrgUsrService; ESOrgUsrService eSOrgUsrService;
...@@ -108,11 +98,11 @@ public class OrgUsrController extends BaseController { ...@@ -108,11 +98,11 @@ public class OrgUsrController extends BaseController {
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm // BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start //bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
OrgUsr tempOrg = iOrgUsrService.getById(id.toString()); OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY") || tempOrg.getBizOrgType().equals("DEPARTMENT")) { if (tempOrg.getBizOrgType().equals("COMPANY") || tempOrg.getBizOrgType().equals("DEPARTMENT")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false)); List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId, id).eq(OrgUsr::getIsDelete, false));
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 start*/ /*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 start*/
List<FireTeam> fireTeams = fireTeamMapper.byTeamId(id); List<FireTeam> fireTeams = fireTeamMapper.byTeamId(id);
if(tempList.size() > 0 || fireTeams.size() > 0 ) { if (tempList.size() > 0 || fireTeams.size() > 0) {
return ResponseHelper.buildResponse("-1"); return ResponseHelper.buildResponse("-1");
} }
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 end*/ /*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 end*/
...@@ -144,7 +134,7 @@ public class OrgUsrController extends BaseController { ...@@ -144,7 +134,7 @@ public class OrgUsrController extends BaseController {
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception { public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY); OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
// iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id); // iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse( iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id)); return ResponseHelper.buildResponse(iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id));
} }
...@@ -382,6 +372,16 @@ public class OrgUsrController extends BaseController { ...@@ -382,6 +372,16 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType(@RequestParam(required = false) String type) throws Exception {
// 获取登陆人角色
AgencyUserModel user = getUserInfo();
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(user, type);
return ResponseHelper.buildResponse(menus);
}
/** /**
* 获取单位部门树 * 获取单位部门树
* *
...@@ -441,6 +441,13 @@ public class OrgUsrController extends BaseController { ...@@ -441,6 +441,13 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.getUserInfo(userId)); return ResponseHelper.buildResponse(iOrgUsrService.getUserInfo(userId));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{userId}/getUserParentInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取用户本级及父级信息", notes = "获取用户本级及父级信息")
public UserDto getUserParentInfo(@PathVariable String userId) {
return orgUsrService.getUserParentInfo(userId);
}
/** /**
* 获取登陆人绑定的人员关系 * 获取登陆人绑定的人员关系
* *
...@@ -450,7 +457,7 @@ public class OrgUsrController extends BaseController { ...@@ -450,7 +457,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = {"/getLoginUserDetails/{userId}", "/getLoginUserDetails"}, method = RequestMethod.GET) @RequestMapping(value = {"/getLoginUserDetails/{userId}", "/getLoginUserDetails"}, method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系") @ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系")
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@PathVariable(required=false) String userId) { public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@PathVariable(required = false) String userId) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
String userIds = userId; String userIds = userId;
if (StringUtils.isEmpty(userIds)) { if (StringUtils.isEmpty(userIds)) {
...@@ -482,6 +489,7 @@ public class OrgUsrController extends BaseController { ...@@ -482,6 +489,7 @@ public class OrgUsrController extends BaseController {
} }
return equipjSONObject; return equipjSONObject;
} }
/** /**
* 判断关联账户是否已关联 * 判断关联账户是否已关联
* *
......
...@@ -1387,7 +1387,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1387,7 +1387,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return gettTreeByUser(user, companyDepartmentMsgList); return gettTreeByUser(user, companyDepartmentMsgList);
} }
; @Override
public List<OrgMenuDto> companyTreeByUserAndType(AgencyUserModel user, String type) {
String userId = user.getUserId();
if (StringUtils.isNotBlank(userId)) {
List<OrgUsr> list = orgUsrMapper.companyTreeByUserAndType(userId, type);
return buildTreeParallel(list);
}
return Lists.newArrayList();
}
@Override @Override
public List<CheckObjectDto> companyListByUser(AgencyUserModel user) { public List<CheckObjectDto> companyListByUser(AgencyUserModel user) {
...@@ -2062,6 +2070,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -2062,6 +2070,27 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return jsonObject; return jsonObject;
} }
@Override
public UserDto getUserParentInfo(String userId) {
UserDto userDto = new UserDto();
if (StringUtils.isNotEmpty(userId)) {
OrgUsr orgUsr = orgUsrMapper.queryByUserId(Long.parseLong(userId));
if (!ObjectUtils.isEmpty(orgUsr)) {
String parentId = orgUsr.getParentId();
userDto.setPersonSeq(String.valueOf(orgUsr.getSequenceNbr()));
userDto.setPersonName(orgUsr.getBizOrgName());
OrgUsr bizOrg = orgUsrMapper.queryBySequenceNbr(parentId);
if (!ObjectUtils.isEmpty(bizOrg)) {
userDto.setBizOrgType(bizOrg.getBizOrgType());
userDto.setBizOrgCode(bizOrg.getBizOrgCode());
userDto.setCompanyId(String.valueOf(bizOrg.getSequenceNbr()));
userDto.setCompanyName(bizOrg.getBizOrgName());
}
}
}
return userDto;
}
public Object getOrgUserByAmosUserId(String amosUserId) throws Exception{ public Object getOrgUserByAmosUserId(String amosUserId) throws Exception{
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>(); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false); wrapper.eq(OrgUsr::getIsDelete, false);
......
package com.yeejoin.equipmanage.controller; package com.yeejoin.equipmanage.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.equipmanage.common.entity.Video; import com.yeejoin.equipmanage.common.entity.Video;
import com.yeejoin.equipmanage.common.entity.dto.VideoDTO; import com.yeejoin.equipmanage.common.entity.dto.VideoDTO;
import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto; import com.yeejoin.equipmanage.common.entity.dto.VideoSaveDto;
...@@ -33,14 +12,26 @@ import com.yeejoin.equipmanage.common.entity.vo.PageVideoVO; ...@@ -33,14 +12,26 @@ import com.yeejoin.equipmanage.common.entity.vo.PageVideoVO;
import com.yeejoin.equipmanage.common.entity.vo.VideoListVo; import com.yeejoin.equipmanage.common.entity.vo.VideoListVo;
import com.yeejoin.equipmanage.common.enums.ExcelEnums; import com.yeejoin.equipmanage.common.enums.ExcelEnums;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.core.framework.PersonIdentify;
import com.yeejoin.equipmanage.dto.ExcelDto; import com.yeejoin.equipmanage.dto.ExcelDto;
import com.yeejoin.equipmanage.service.IExcelService; import com.yeejoin.equipmanage.service.IExcelService;
import com.yeejoin.equipmanage.service.IVideoService; import com.yeejoin.equipmanage.service.IVideoService;
import com.yeejoin.equipmanage.utils.ExcelUtil; import com.yeejoin.equipmanage.utils.ExcelUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -58,6 +49,9 @@ public class VideoController extends AbstractBaseController { ...@@ -58,6 +49,9 @@ public class VideoController extends AbstractBaseController {
@Autowired @Autowired
private IExcelService excelService; private IExcelService excelService;
@Autowired
private IOrgUsrService orgUsrService;
/** /**
* 新增 * 新增
* *
...@@ -284,4 +278,11 @@ public class VideoController extends AbstractBaseController { ...@@ -284,4 +278,11 @@ public class VideoController extends AbstractBaseController {
return flvUrl; return flvUrl;
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司部门树", notes = "根据登录人及类型获取公司部门树")
public List<OrgMenuDto> companyTreeByUserAndType(@RequestParam(required = false) String type) {
return orgUsrService.companyTreeByUserAndType(getUserInfo(), type);
}
} }
package com.yeejoin.equipmanage.core.framework;
import java.lang.annotation.*;
/**
* @author DELL
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PersonIdentify {
/**
* 是否进行人员校验
* @return boolean
*/
boolean isNeedIdentity() default true;
}
package com.yeejoin.equipmanage.core.framework;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.UserDto;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.equipmanage.exception.PermissionException;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.ResponseBody;
import org.typroject.tyboot.core.foundation.context.RequestContext;
/**
* @author DELL
*/
@Aspect
@Component
@ResponseBody
@Order(value = 1)
public class PersonIdentifyAspect {
@Autowired
RedisUtils redisUtils;
@Autowired
private IOrgUsrService orgUsrService;
@Before(value = "@annotation(com.yeejoin.equipmanage.core.framework.PersonIdentify) && @annotation(permission)")
public void personIdentity(JoinPoint joinPoint, PersonIdentify permission) throws PermissionException {
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
if (permission.isNeedIdentity() && reginParam != null) {
String userId = reginParam.getUserModel().getUserId();
UserDto userDto = orgUsrService.getUserParentInfo(userId);
if (!ObjectUtils.isEmpty(userDto)) {
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
personIdentity.setBizOrgCode(userDto.getBizOrgCode());
personIdentity.setCompanyId(userDto.getCompanyId());
personIdentity.setCompanyName(userDto.getCompanyName());
personIdentity.setPersonSeq(userDto.getPersonSeq());
personIdentity.setPersonName(userDto.getPersonName());
personIdentity.setIdentityType(userDto.getIdentityType());
reginParam.setPersonIdentity(personIdentity);
redisUtils.set(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} else {
throw new RuntimeException("人员未绑定!");
}
}
}
}
package com.yeejoin.equipmanage.exception;
import org.springframework.http.HttpStatus;
public class PermissionException extends RuntimeException{
private static final long serialVersionUID = -6126611364667754200L;
public PermissionException(String message) {
super(message);
}
public PermissionException(String message, Throwable cause) {
super(message, cause);
}
public HttpStatus getStatus() {
return HttpStatus.FORBIDDEN; // 403
}
}
...@@ -2068,4 +2068,29 @@ ...@@ -2068,4 +2068,29 @@
INSERT INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000252, 'bizOrgName', '机构/部门名称', 'String', 132828674810, 'eq', b'0', 'building', 2581805, '2021-12-15 17:34:04'); INSERT INTO `wl_form_group_column`(`id`, `field_name`, `field_label`, `data_type`, `group_id`, `query_strategy`, `not_null`, `group_code`, `creator_id`, `create_date`) VALUES (133000000252, 'bizOrgName', '机构/部门名称', 'String', 132828674810, 'eq', b'0', 'building', 2581805, '2021-12-15 17:34:04');
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="gaojianqiang" id="1639540630-20211217-01">
<comment>`getOrgUsrTreeById`</comment>
<sql endDelimiter="#">
DROP FUNCTION IF EXISTS `getOrgUsrTreeById`#
CREATE DEFINER = `root` @`%` FUNCTION `getOrgUsrTreeById` ( `rootId` BIGINT ) RETURNS VARCHAR ( 1000 ) CHARSET utf8 BEGIN
DECLARE
sTemp TEXT;
DECLARE
sTempChd VARCHAR ( 4000 );
SET sTemp = '$';
SET sTempChd = CAST( rootId AS CHAR );
WHILE
sTempChd IS NOT NULL DO
SET sTemp = CONCAT( sTemp, ',', sTempChd );
SELECT
GROUP_CONCAT( DISTINCT sequence_nbr ) INTO sTempChd
FROM
cb_org_usr
WHERE
FIND_IN_SET( parent_id, sTempChd ) > 0;
END WHILE;
RETURN substring( sTemp, 3 );
END#
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -231,8 +231,8 @@ ...@@ -231,8 +231,8 @@
AND par.field_name = 'parentId' AND par.field_name = 'parentId'
LEFT JOIN wl_form_instance AS cd ON cd.instance_id = ins.instance_id LEFT JOIN wl_form_instance AS cd ON cd.instance_id = ins.instance_id
AND cd.field_name = 'code' AND cd.field_name = 'code'
LEFT JOIN wl_form_instance AS bzc ON cd.instance_id = ins.instance_id LEFT JOIN wl_form_instance AS bzc ON bzc.instance_id = ins.instance_id
AND cd.field_name = 'bizOrgCode' AND bzc.field_name = 'bizOrgCode'
GROUP BY GROUP BY
ins.instance_id ins.instance_id
ORDER BY ORDER BY
......
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