From d651a004647ed5ce63c79e56616d9ba961f10b00 Mon Sep 17 00:00:00 2001 From: xusd <hugeinfo123> Date: Mon, 14 Oct 2024 18:12:09 +0800 Subject: [PATCH] Merge branch 'release/release_20241014' into gzdyh_test --- dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java index 787bcb9..36af820 100644 --- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java +++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUnitService.java @@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -670,4 +671,34 @@ throw new ServiceException("CtUnitService.getParentZzzx", e); } } + + /** + * 获取本级综治中心 + * @param unitId 当前单位编号 + * @return + */ + public CtUnitDTO getBjZzzx(String unitId){ + try{ + CtUnitDTO ctUnitDTO = new CtUnitDTO(); + // 查询自己是否是综治中心 + CtUnit loginCtUnit = mapper.selectById(unitId); + if (UserBaseConsts.UNIT_TYPE_1 == loginCtUnit.getUnitType()){ + BeanUtils.copyProperties(loginCtUnit, ctUnitDTO); + }else { + // 查询当前单位的上级综治中心 + QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>(); + ctUnitQueryWrapper.eq("id", loginCtUnit.getParentId()).eq("unit_type", UserBaseConsts.UNIT_TYPE_1); + CtUnit zzzxCtUnit = mapper.selectOne(ctUnitQueryWrapper); + BeanUtils.copyProperties(zzzxCtUnit, ctUnitDTO); + } + return ctUnitDTO; + }catch (Exception e){ + log.error("[CtUnitService.getParentZzzx]调用失败,异常信息:"+e, e); + throw new ServiceException("CtUnitService.getParentZzzx", e); + } + } + + public CtUnit selectUnitByGridId(String gridUnitId){ + return mapper.selectUnitByGridId(gridUnitId); + } } -- Gitblit v1.8.0