This commit is contained in:
牛子源 2025-05-19 14:35:16 +08:00
parent 2e467405a2
commit 6c84b8012e
3 changed files with 54 additions and 50 deletions

View File

@ -132,6 +132,11 @@
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>5.2.3</version> <version>5.2.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -13,6 +13,7 @@ import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper; import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
import com.syjiaer.clinic.server.mapper.social.*; import com.syjiaer.clinic.server.mapper.social.*;
import com.syjiaer.clinic.server.service.BaseService; import com.syjiaer.clinic.server.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
@ -38,6 +39,7 @@ import java.util.stream.Collectors;
/* /*
* 医保目录 * 医保目录
*/ */
@Slf4j
@Service @Service
public class SocialDirectoryService extends BaseService { public class SocialDirectoryService extends BaseService {
@Autowired @Autowired
@ -61,7 +63,6 @@ public class SocialDirectoryService extends BaseService {
@Autowired @Autowired
private GoodsMapper goodsMapper; private GoodsMapper goodsMapper;
private Logger logger = Logger.getLogger(SocialDirectoryService.class.getName());
/* /*
* 下载接口 * 下载接口
@ -232,9 +233,6 @@ public class SocialDirectoryService extends BaseService {
//mongodb分页 //mongodb分页
QueryWrapper<SocialDirectory> codeqw = new QueryWrapper<>(); QueryWrapper<SocialDirectory> codeqw = new QueryWrapper<>();
if (typeList.size() == 1) { if (typeList.size() == 1) {
codeqw.eq("type", typeList.get(0)); codeqw.eq("type", typeList.get(0));
@ -333,18 +331,19 @@ public class SocialDirectoryService extends BaseService {
// 资源文件的路径 // 资源文件的路径
String resourceName = "doc_title/" + type + ".json"; String resourceName = "doc_title/" + type + ".json";
StringBuilder content = new StringBuilder(); StringBuilder content = new StringBuilder();
try (InputStream inputStream = classLoader.getResourceAsStream(resourceName); try {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { InputStream inputStream = classLoader.getResourceAsStream(resourceName);
if (inputStream != null) { if(inputStream==null){
return resultList;
}
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line; String line;
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
content.append(line); content.append(line);
} }
} else {
logger.info("未找到资源文件: " + resourceName);
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error("doc_title解析错误:{} ", resourceName);
return resultList;
} }
JSONArray list = JSON.parseArray(content.toString()); JSONArray list = JSON.parseArray(content.toString());
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {

View File

@ -10,9 +10,9 @@ spring:
host: dev.jizhiweb.cn host: dev.jizhiweb.cn
port: 6379 port: 6379
datasource: datasource:
driver-class-name: org.postgresql.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:postgresql://dev.jizhiweb.cn:15321/syjiaer_clinic url: jdbc:mysql://dev.jizhiweb.cn:3306/syjiaer_clinic
username: postgres username: root
password: i7L0BS91pADGuy7z password: i7L0BS91pADGuy7z
config: config:
import: optional:classpath:developer-config.yml import: optional:classpath:developer-config.yml