| | |
| | | package com.moral.api.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.moral.api.entity.Organization; |
| | | import com.moral.api.entity.ServicesScope; |
| | |
| | | import com.moral.api.service.ServicesScopeService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.moral.constant.Constants; |
| | | import com.moral.util.RegionCodeUtils; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | QueryWrapper<Organization> organizationQueryWrapper = new QueryWrapper<>(); |
| | | organizationQueryWrapper.eq("is_delete",Constants.NOT_DELETE); |
| | | organizationQueryWrapper.eq("id",organizationId); |
| | | if (!ObjectUtils.isEmpty(map.get("province_code"))){ |
| | | organizationQueryWrapper.eq("province_code",Integer.parseInt(map.get("province_code").toString())); |
| | | } |
| | | if (!ObjectUtils.isEmpty(map.get("city_code"))){ |
| | | organizationQueryWrapper.eq("city_code",Integer.parseInt(map.get("city_code").toString())); |
| | | } |
| | | if (!ObjectUtils.isEmpty(map.get("area_code"))){ |
| | | organizationQueryWrapper.eq("area_code",Integer.parseInt(map.get("area_code").toString())); |
| | | if (!ObjectUtils.isEmpty(map.get("regionCode"))){ |
| | | String region = RegionCodeUtils.regionCodeConvertToName(Integer.parseInt(map.get("regionCode").toString())); |
| | | organizationQueryWrapper.eq(region,Integer.parseInt(map.get("regionCode").toString())); |
| | | } |
| | | Organization organization = new Organization(); |
| | | organization = organizationMapper.selectById(organizationId); |
| | | organization = organizationMapper.selectOne(organizationQueryWrapper); |
| | | if (ObjectUtils.isEmpty(organization)){ |
| | | continue; |
| | | } |
| | | resultMap.put("organization",organization); |
| | | resultMap = JSON.parseObject(JSON.toJSONString(organization), Map.class); |
| | | //resultMap.put("organization",organization); |
| | | QueryWrapper<ServicesScope> servicesScopeQueryWrapper = new QueryWrapper<>(); |
| | | servicesScopeQueryWrapper.eq("is_delete",Constants.NOT_DELETE); |
| | | servicesScopeQueryWrapper.eq("organization_id",organizationId); |