| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.DictBizCache; |
| | | import org.springblade.common.utils.PositionUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.yw.entity.FirmInfo; |
| | |
| | | import org.springblade.modules.yw.mapper.FirmInfoMapper; |
| | | import org.springblade.modules.yw.service.IFirmInfoService; |
| | | import org.springblade.modules.yw.vo.FirmInfoVO; |
| | | import org.springblade.modules.yw.vo.SearchVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public IPage<FirmInfoVO> selectFirmInfoPage(IPage<FirmInfoVO> page, FirmInfoVO firmInfo) { |
| | | return page.setRecords(baseMapper.selectFirmInfoPage(page,firmInfo)); |
| | | List<FirmInfoVO> firmInfoVOS = baseMapper.selectFirmInfoPage(page, firmInfo); |
| | | for (FirmInfoVO firmInfoVO : firmInfoVOS) { |
| | | if (!Strings.isBlank(firmInfoVO.getCategory())){ |
| | | firmInfoVO.setCategoryName(firmInfoVO.getCategory()); |
| | | } |
| | | } |
| | | return page.setRecords(firmInfoVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 数据转换 |
| | | FirmInfo firmInfo = Objects.requireNonNull(BeanUtil.copy(firmInfoExcel, FirmInfo.class)); |
| | | // 经纬度转换 |
| | | System.out.println("firmInfo = " + firmInfo.getName()); |
| | | positionConvert(firmInfo); |
| | | // positionConvert(firmInfo); |
| | | // 判断信息是否已录入 |
| | | FirmInfo oldFirmInfo = isSave(firmInfo); |
| | | // 已存在并且不更新 |
| | |
| | | // 返回 |
| | | return getOne(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 自定义详情查询 |
| | | * @param firmInfo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public FirmInfoVO getDetail(FirmInfoVO firmInfo) { |
| | | FirmInfoVO detail = baseMapper.getDetail(firmInfo); |
| | | // 设置类型解析 |
| | | if (!Strings.isBlank(detail.getCategory())){ |
| | | detail.setCategoryName( |
| | | DictBizCache.getValues("industry_category",detail.getCategory()) |
| | | ); |
| | | } |
| | | // 返回 |
| | | return detail; |
| | | } |
| | | |
| | | /** |
| | | * 模糊查询企业名称、应急空间名称、风险源名称 |
| | | * @param firmInfo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<SearchVO> fuzzyQuery(FirmInfoVO firmInfo) { |
| | | return baseMapper.fuzzyQuery(firmInfo); |
| | | } |
| | | } |