| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | } |