From 562a960261b75d70abd65aa10528f09aeece94e8 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 24 九月 2024 09:49:23 +0800
Subject: [PATCH] 代码提交

---
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java |   61 +++++++++++++++---------------
 1 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
index dfe47ea..f55613d 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -2,6 +2,7 @@
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.reflect.TypeToken;
@@ -17,6 +18,7 @@
 import com.smartor.common.SendService;
 import com.smartor.domain.*;
 import com.smartor.mapper.ServiceTaskMapper;
+import com.smartor.mapper.SysUserImportMapper;
 import com.smartor.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
@@ -63,6 +65,9 @@
 
     @Autowired
     private PlatformTransactionManager transactionManager;
+
+    @Autowired
+    private SysUserImportMapper sysUserImportMapper;
 
     @Value("${localIP}")
     private String localIP;
@@ -119,36 +124,30 @@
     }
 
     public void importData() {
-//        String filePath = "path/to/your/file.txt"; // 鏇挎崲涓轰綘鐨勬枃浠惰矾寰�
-//
-//        try {
-//            // 璇诲彇鏂囦欢鍐呭
-//            String jsonContent = new String(Files.readAllBytes(Paths.get(filePath)));
-//
-//            // 鍒涘缓ObjectMapper瀵硅薄
-//            ObjectMapper objectMapper = new ObjectMapper();
-//
-//            // 瑙f瀽JSON涓篔sonNode
-//            JsonNode rootNode = objectMapper.readTree(jsonContent);
-//            // 鑾峰彇resultList
-//            JsonNode resultListNode = rootNode.path("results").path("resultList");
-//            // 閬嶅巻resultList涓殑姣忎釜瀵硅薄
-//            for (JsonNode item : resultListNode) {
-//                String userName = item.path("staffNum").asText();
-//                String idCard = item.path("idCard").asText();
-//                String personnelStampNum = item.path("defaultWardId").asText();
-//                String personnelStampNum = item.path("defaultWardName").asText();
-//                String deptName = item.path("defaultDeptName").asText();
-//                String deptCode = item.path("defaultDeptId").asText();
-//                String phonenumber = item.path("telphone").asText();
-//                String nickName = item.path("staffName").asText();
-//                String sex = item.path("staffSex").asText();
-//
-//            }
-//
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        }
+        String filePath = "C:\\Users\\86176\\Desktop\\鏂板缓鏂囨湰鏂囨。 4.txt"; // 鏇挎崲涓轰綘鐨勬枃浠惰矾寰�
+
+        try {
+            // 璇诲彇鏂囦欢鍐呭
+            String jsonContent = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);
+
+            // 鍒涘缓ObjectMapper瀵硅薄
+            ObjectMapper objectMapper = new ObjectMapper();
+            // 瑙f瀽JSON涓篔sonNode
+            JsonNode rootNode = objectMapper.readTree(jsonContent);
+            // 鑾峰彇resultList
+            JsonNode resultListNode = rootNode.path("results").path("resultList");
+            // 閬嶅巻resultList涓殑姣忎釜瀵硅薄
+            for (JsonNode item : resultListNode) {
+
+                SysUserImport person = objectMapper.treeToValue(item, SysUserImport.class);
+                person.setStaffPhoto("");
+                sysUserImportMapper.insertSysUserImport(person);
+
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
 
     }
 
@@ -563,7 +562,7 @@
                 patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
                 //濡傛灉鏄嚭闄紝鍏堥�氳繃鎮h�呯紪鍙峰拰娴佹按鍙峰幓鏌ヤ竴涓嬶紝鎮h�呮槸鍚﹀瓨鍦紝濡傛灉瀛樺湪锛屽垯杩涜淇敼
                 PatMedInhosp inhosp = new PatMedInhosp();
-                inhosp.setInhospno(patArchive.getPatientno());
+                inhosp.setPatno(patArchive.getPatientno());
                 inhosp.setSerialnum(patMedInhosp.getSerialnum());
                 List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhospList(inhosp);
                 if (CollectionUtils.isNotEmpty(patMedInhosps)) {

--
Gitblit v1.9.3