zrj
2024-10-30 1f3835b24d77a899a2e2e55c846a575dc4db825d
src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java
@@ -8,15 +8,13 @@
import org.springblade.modules.system.service.IRegionService;
import org.springblade.modules.yw.entity.IndParkInfoEntity;
import org.springblade.modules.yw.excel.IndParkInfoExcel;
import org.springblade.modules.yw.service.IFirmInfoService;
import org.springblade.modules.yw.vo.IndParkInfoVO;
import org.springblade.modules.yw.mapper.IndParkInfoMapper;
import org.springblade.modules.yw.service.IIndParkInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -31,6 +29,9 @@
   @Autowired
   private IRegionService regionService;
   @Autowired
   private IFirmInfoService firmInfoService;
   /**
    * 自定义分页查询
@@ -109,4 +110,37 @@
      }
      return "";
   }
   /**
    * 园区基本信息查询(包含企业统计信息)
    * @param indParkInfo
    * @return
    */
   @Override
   public IndParkInfoVO getDetail(IndParkInfoEntity indParkInfo) {
      // 查询详情信息
      IndParkInfoVO indParkInfoVO = baseMapper.getDetail(indParkInfo);
      // 查询企业的数量
      long count = firmInfoService.count();
      // 设置企业数量
      indParkInfoVO.setFirmNum((int) count);
      // 设置行政区划
      setRegionInfo(indParkInfoVO);
      // 返回
      return indParkInfoVO;
   }
   /**
    * 设置行政区划
    * @param indParkInfoVO
    */
   private void setRegionInfo(IndParkInfoVO indParkInfoVO) {
      QueryWrapper<Region> wrapper = new QueryWrapper<>();
      wrapper.eq("ancestors","000000000000,"+indParkInfoVO.getAreaCode());
      List<Region> list = regionService.list(wrapper);
      if (list.size()>0){
         Region region = list.get(0);
         indParkInfoVO.setRegionName(region.getProvinceName()+"-"+region.getCityName());
      }
   }
}