From b74bfb8ba7ae78eb134fd79bb5756eca277dd71d Mon Sep 17 00:00:00 2001
From: zrj <646384940@qq.com>
Date: Wed, 30 Oct 2024 16:59:15 +0800
Subject: [PATCH] 救援队伍类型调整

---
 src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java b/src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java
index 6ffbadf..462b88b 100644
--- a/src/main/java/org/springblade/modules/yw/service/impl/IndParkInfoServiceImpl.java
+++ b/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());
+		}
+	}
 }

--
Gitblit v1.9.3