From b00edf4891b49f400263601492c3dc819cb7c8a9 Mon Sep 17 00:00:00 2001
From: tjx <t2856754968@163.com>
Date: 星期一, 22 十二月 2025 09:04:48 +0800
Subject: [PATCH] 新增企业微信的接口

---
 src/main/java/com/gs/xky/task/ScheduledTasks.java                        |  230 +++++++---------
 src/main/java/com/gs/xky/config/DataAcquisitionConfiguration.java        |   13 
 src/main/java/com/gs/xky/service/XkyService.java                         |    2 
 src/main/java/com/gs/xky/service/Impl/MesQaItemsDetect01ServiceImpl.java |    5 
 src/main/java/com/gs/xky/entity/DingtalkMsg.java                         |    4 
 src/main/java/com/gs/xky/service/DingtalkInfoService.java                |   11 
 src/main/java/com/gs/xky/service/Impl/DingtalkInfoServiceImpl.java       |  281 --------------------
 pom.xml                                                                  |    7 
 src/main/resources/mapper/VwCjScSjTsBbMonthMapper.xml                    |   23 -
 src/main/resources/application.yml                                       |    6 
 src/test/java/com/gs/xky/XkyApplicationTests.java                        |  245 ++++++++++-------
 11 files changed, 267 insertions(+), 560 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8d554bb..f9b3e16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,13 +96,6 @@
             <artifactId>hutool-all</artifactId>
             <version>5.8.18</version>
         </dependency>
-
-        <!-- Apache POI for Excel (required by Hutool) -->
-        <dependency>
-            <groupId>org.apache.poi</groupId>
-            <artifactId>poi-ooxml</artifactId>
-            <version>5.2.3</version>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/src/main/java/com/gs/xky/config/DataAcquisitionConfiguration.java b/src/main/java/com/gs/xky/config/DataAcquisitionConfiguration.java
index 0b55a2d..68b01af 100644
--- a/src/main/java/com/gs/xky/config/DataAcquisitionConfiguration.java
+++ b/src/main/java/com/gs/xky/config/DataAcquisitionConfiguration.java
@@ -25,26 +25,19 @@
     /**
      * 搴旂敤鐨� AgentId
      */
-    public static final Long AGENT_ID = 4104598880L;
+    public static final Long AGENT_ID = 3303296035L;
     /**
      * 搴旂敤鐨� AppKey
      */
-    public static final String TALK_APP_KEY = "dinggglb3pttl1x0gn0c";
+    public static final String TALK_APP_KEY = "dingnpc4kma0t19nphhd";
     /**
      * 搴旂敤鐨� AppSecret
      */
-    public static final String TALK_APP_SECRET = "Zc7r0Mb7bPsC_xy7ryrWoEnE5OzHEXibUMPDCA2LBusJ9pYzIolRk_OdZuLvNExf";
+    public static final String TALK_APP_SECRET = "uMecvKIfErf9htigYIyjI3svHpXEEDWROy2v1cXw7V6EXIG09oQI5N5e-EMqBo4r";
 
     //缇よ亰鏈哄櫒浜虹浉鍏�
 
     public static final String CUSTOM_ROBOT_TOKEN = "c2849e46cb0d91b0721c377742938b8ac5ef57e3c9eeab918e2cd5dd9c3aad2a";
 
     public static final String SECRET = "SEC382027a5c81ea5152b71b687fb2c1ebf26acbde035355da6ab2fb37306454134";
-
-    //浼佷笟寰俊
-    public static final String CORPID = "wwabe21b935901a7d8";
-
-    public static final String CORPSECRET = "Z-7fNbZjrd80ypz69U14j8FMxI_fpUxcT6PksxlvKaY";
-
-    public static final String TXL_CORPSECRET = "T64bdcV7fo0hvW10W3NJYmGUmlBYxYMfiW6EiUJ9VPM";
 }
diff --git a/src/main/java/com/gs/xky/entity/DingtalkMsg.java b/src/main/java/com/gs/xky/entity/DingtalkMsg.java
index 1ddf816..c021eb4 100644
--- a/src/main/java/com/gs/xky/entity/DingtalkMsg.java
+++ b/src/main/java/com/gs/xky/entity/DingtalkMsg.java
@@ -51,4 +51,8 @@
      * 瀹℃牳浜�
      */
     private String modify1By;
+    /**
+     * 鏂欏搧鍚嶇О
+     */
+    private String itemName;
 }
\ No newline at end of file
diff --git a/src/main/java/com/gs/xky/service/DingtalkInfoService.java b/src/main/java/com/gs/xky/service/DingtalkInfoService.java
index a7a0f7e..a397591 100644
--- a/src/main/java/com/gs/xky/service/DingtalkInfoService.java
+++ b/src/main/java/com/gs/xky/service/DingtalkInfoService.java
@@ -11,15 +11,4 @@
 public interface DingtalkInfoService extends IService<DingtalkInfo> {
 
     boolean sendMessage(String releaseNo);
-
-    boolean sendActionCardMessage() throws Exception;
-
-    /**
-     * 鍙戦�佹枃浠舵秷鎭�
-     *
-     * @param filePath 鏈湴鏂囦欢璺緞
-     * @return 鏄惁鍙戦�佹垚鍔�
-     * @throws Exception 寮傚父
-     */
-    boolean sendFileMessage(String filePath) throws Exception;
 }
diff --git a/src/main/java/com/gs/xky/service/Impl/DingtalkInfoServiceImpl.java b/src/main/java/com/gs/xky/service/Impl/DingtalkInfoServiceImpl.java
index a04cd14..68af584 100644
--- a/src/main/java/com/gs/xky/service/Impl/DingtalkInfoServiceImpl.java
+++ b/src/main/java/com/gs/xky/service/Impl/DingtalkInfoServiceImpl.java
@@ -14,13 +14,11 @@
 import com.gs.xky.mapper.MesStaffMapper;
 import com.gs.xky.service.DingtalkInfoService;
 import com.gs.xky.service.SimpleExample;
-import com.taobao.api.FileItem;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.io.File;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
@@ -132,95 +130,6 @@
         }
     }
 
-    @Override
-    public boolean sendActionCardMessage() {
-        try {
-            // 1. 鑾峰彇闇�瑕佹帹閫佺殑鐢ㄦ埛鍒楄〃锛堝彲浠ユ槸鍥哄畾鎺ㄩ�佺敤鎴凤級
-            List<DingtalkInfo> fixedList = baseMapper.selectList(
-                    new LambdaQueryWrapper<DingtalkInfo>().eq(DingtalkInfo::getIsHead, 1)
-            );
-
-            List<Long> sidList = fixedList.stream()
-                    .map(DingtalkInfo::getSid)
-                    .collect(Collectors.toList());
-
-            List<String> userIdList = getDingtalkUserIdListBySids(sidList);
-
-            if (userIdList == null || userIdList.isEmpty()) {
-                log.warn("娌℃湁闇�瑕佸彂閫侀拤閽夋秷鎭殑鐢ㄦ埛");
-                return false;
-            }
-
-            String userIdListStr = String.join(",", userIdList);
-
-            // 2. 鏋勫缓娑堟伅鍐呭
-            String title = "鐢熶骇鏁版嵁鐪嬫澘";
-            String markdown = "璇风偣鍑讳笅鏂规寜閽煡鐪嬭缁咮I鎶ヨ〃";
-            String singleTitle = "鏌ョ湅鎶ヨ〃";
-            String singleUrl = "http://192.168.1.22:8081/design?fid=rpte6045ab079b211f0824bd3cfd50c6b93&fserid=4b198960bedd11f09f6f792bfe147b64&fsharetype=3";
-
-            // 3. 鍙戦�佹秷鎭�
-            OapiMessageCorpconversationAsyncsendV2Response rsp =
-                    sendActionCardMessage(userIdListStr, title, markdown, singleTitle, singleUrl);
-
-            log.info("鎴愬姛鍙戦�丄ctionCard娑堟伅: {}", rsp.getBody());
-            return true;
-        } catch (Exception e) {
-            log.error("鍙戦�丄ctionCard娑堟伅澶辫触", e);
-            return false;
-        }
-    }
-
-    @Override
-    public boolean sendFileMessage(String filePath) throws Exception {
-        try {
-            // 1. 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦�
-            File file = new File(filePath);
-            if (!file.exists()) {
-                log.error("鏂囦欢涓嶅瓨鍦�: {}", filePath);
-                return false;
-            }
-
-            // 2. 鑾峰彇闇�瑕佹帹閫佺殑鐢ㄦ埛鍒楄〃锛堝彲鏍规嵁瀹為檯闇�姹傝皟鏁达紝杩欓噷浣跨敤isHead=1鐨勭敤鎴凤級
-            List<DingtalkInfo> fixedList = baseMapper.selectList(
-                    new LambdaQueryWrapper<DingtalkInfo>().eq(DingtalkInfo::getIsHead, 1)
-            );
-
-            if (fixedList == null || fixedList.isEmpty()) {
-                log.warn("娌℃湁闇�瑕佸彂閫佹枃浠剁殑鐢ㄦ埛锛坕sHead=1锛�");
-                return false;
-            }
-
-            List<String> sidList = fixedList.stream()
-                    .map(DingtalkInfo::getPhone)
-                    .collect(Collectors.toList());
-
-            List<String> userIdList = getDingtalkUserIdListByPhones(sidList);
-
-            if (userIdList == null || userIdList.isEmpty()) {
-                log.warn("娌℃湁鏈夋晥鐨勯拤閽夌敤鎴稩D");
-                return false;
-            }
-
-            String userIdListStr = String.join(",", userIdList);
-
-            // 3. 涓婁紶鏂囦欢鍒伴拤閽夋湇鍔″櫒
-            log.info("寮�濮嬩笂浼犳枃浠�: {}", filePath);
-            String mediaId = uploadMedia(filePath, "file");
-
-            // 4. 鍙戦�佹枃浠舵秷鎭�
-            log.info("寮�濮嬪彂閫佹枃浠舵秷鎭紝mediaId: {}", mediaId);
-            OapiMessageCorpconversationAsyncsendV2Response response = sendFileMessageByMediaId(userIdListStr, mediaId);
-
-            log.info("鏂囦欢娑堟伅鍙戦�佸搷搴�: {}", response.getBody());
-            return response.getErrcode() == 0;
-
-        } catch (Exception e) {
-            log.error("鍙戦�佹枃浠舵秷鎭け璐�", e);
-            throw e;
-        }
-    }
-
     /**
      * 鏍规嵁鎸囧畾鐨剆id鍒楄〃鑾峰彇閽夐拤鐢ㄦ埛ID鍒楄〃
      *
@@ -285,72 +194,13 @@
         }
     }
 
-
-    private List<String> getDingtalkUserIdListByPhones(List<String> phoneList) {
-        try {
-            if (phoneList == null || phoneList.isEmpty()) {
-                return new ArrayList<>();
-            }
-
-            // 鍘婚噸
-            phoneList = phoneList.stream().distinct().collect(Collectors.toList());
-
-            // 鏍规嵁sid鏌ヨDingtalkInfo
-            List<DingtalkInfo> list = baseMapper.selectList(
-                    new LambdaQueryWrapper<DingtalkInfo>().in(DingtalkInfo::getPhone, phoneList)
-            );
-
-            if (list == null || list.isEmpty()) {
-                return new ArrayList<>();
-            }
-
-            // 浣跨敤stream娴佽繃婊ゅ嚭list涓璬ingtalkId涓虹┖鐨勬暟鎹�
-            List<DingtalkInfo> emptyDingtalkIdList = list.stream()
-                    .filter(info -> !StringUtils.hasText(info.getDingtalkId()))
-                    .collect(Collectors.toList());
-
-            // 濡傛灉瀛樺湪涓虹┖鐨勬暟鎹氨閫氳繃閽夐拤鐨勬帴鍙h幏鍙栵紝涓篸ingtalkId璧嬪�硷紝骞朵笖鏇存柊鏁版嵁搴�
-            if (!emptyDingtalkIdList.isEmpty()) {
-                String accessToken = simpleExample.getAccessToken();
-
-                for (DingtalkInfo info : emptyDingtalkIdList) {
-                    if (StringUtils.hasText(info.getPhone())) {
-                        try {
-                            // 閫氳繃鎵嬫満鍙疯幏鍙栭拤閽夌敤鎴稩D
-                            com.dingtalk.api.response.OapiV2UserGetbymobileResponse response =
-                                    simpleExample.getOapiV2UserGetbymobileResponse(info.getPhone(), accessToken);
-
-                            if (response != null && response.getResult() != null) {
-                                info.setDingtalkId(response.getResult().getUserid());
-                                // 鏇存柊鏁版嵁搴�
-                                updateById(info);
-                            }
-                        } catch (Exception e) {
-                            log.error("鑾峰彇閽夐拤鐢ㄦ埛ID澶辫触锛屾墜鏈哄彿锛歿}", info.getPhone(), e);
-                        }
-                    }
-                }
-            }
-
-            // 涓嶅瓨鍦ㄤ负绌虹殑鏁版嵁鎴栬�呭鐞嗗畬绌烘暟鎹悗锛岃繑鍥炴墍鏈夋湁鏁堢殑dingtalkId鍒楄〃
-            return list.stream()
-                    .map(DingtalkInfo::getDingtalkId)
-                    .filter(StringUtils::hasText)
-                    .distinct()
-                    .collect(Collectors.toList());
-        } catch (Exception e) {
-            log.error("鑾峰彇閽夐拤鐢ㄦ埛鍒楄〃澶辫触", e);
-            return new ArrayList<>();
-        }
-    }
-
     private OapiMessageCorpconversationAsyncsendV2Response sendMessage(String userIdListStr, String message) throws Exception {
 
         String accessToken = simpleExample.getAccessToken();
 
         DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
         OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
-        request.setAgentId(4104598880L);
+        request.setAgentId(3917187842L);
         request.setUseridList(userIdListStr);
         request.setToAllUser(false);
 
@@ -358,135 +208,6 @@
         msg.setMsgtype("text");
         msg.setText(new OapiMessageCorpconversationAsyncsendV2Request.Text());
         msg.getText().setContent(message);
-        request.setMsg(msg);
-
-        return client.execute(request, accessToken);
-
-    }
-
-    /**
-     * 鍙戦�乴ink娑堟伅锛堝湪閽夐拤鍐呯疆娴忚鍣ㄤ腑鎵撳紑锛�
-     *
-     * @param userIdListStr 鐢ㄦ埛ID鍒楄〃锛岄�楀彿鍒嗛殧
-     * @param title         娑堟伅鏍囬
-     * @param text          娑堟伅鍐呭
-     * @param messageUrl    鐐瑰嚮娑堟伅鍚庤烦杞殑URL
-     * @param picUrl        鍥剧墖URL锛堝彲閫夛級
-     * @return 鍝嶅簲缁撴灉
-     * @throws Exception 寮傚父
-     */
-    private OapiMessageCorpconversationAsyncsendV2Response sendLinkMessage(String userIdListStr, String title, String text, String messageUrl, String picUrl) throws Exception {
-
-        String accessToken = simpleExample.getAccessToken();
-
-        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
-        OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
-        request.setAgentId(4104598880L);
-        request.setUseridList(userIdListStr);
-        request.setToAllUser(false);
-
-        OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
-        msg.setMsgtype("link");
-        msg.setLink(new OapiMessageCorpconversationAsyncsendV2Request.Link());
-        msg.getLink().setTitle(title);
-        msg.getLink().setText(text);
-        msg.getLink().setMessageUrl(messageUrl);
-        if (StringUtils.hasText(picUrl)) {
-            msg.getLink().setPicUrl(picUrl);
-        }
-        request.setMsg(msg);
-
-        return client.execute(request, accessToken);
-
-    }
-
-    /**
-     * 鍙戦�丄ctionCard娑堟伅锛堝湪澶栭儴娴忚鍣ㄤ腑鎵撳紑閾炬帴锛岄�傚悎BI绛夊閮ㄧ郴缁燂級
-     *
-     * @param userIdListStr 鐢ㄦ埛ID鍒楄〃锛岄�楀彿鍒嗛殧
-     * @param title         娑堟伅鏍囬
-     * @param markdown      娑堟伅鍐呭锛堟敮鎸丮arkdown鏍煎紡锛�
-     * @param singleTitle   鎸夐挳鏂囧瓧锛屼緥濡傦細"鏌ョ湅璇︽儏"
-     * @param singleUrl     鐐瑰嚮鎸夐挳鍚庤烦杞殑URL锛堝閮ㄩ摼鎺ワ級
-     * @return 鍝嶅簲缁撴灉
-     * @throws Exception 寮傚父
-     */
-    private OapiMessageCorpconversationAsyncsendV2Response sendActionCardMessage(String userIdListStr, String title, String markdown, String singleTitle, String singleUrl) throws Exception {
-
-        String accessToken = simpleExample.getAccessToken();
-
-        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
-        OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
-        request.setAgentId(4104598880L);
-        request.setUseridList(userIdListStr);
-        request.setToAllUser(false);
-
-        OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
-        msg.setMsgtype("action_card");
-        msg.setActionCard(new OapiMessageCorpconversationAsyncsendV2Request.ActionCard());
-        msg.getActionCard().setTitle(title);
-        msg.getActionCard().setMarkdown(markdown);
-        msg.getActionCard().setSingleTitle(singleTitle);
-        msg.getActionCard().setSingleUrl(singleUrl);
-        request.setMsg(msg);
-
-        return client.execute(request, accessToken);
-
-    }
-
-    /**
-     * 涓婁紶鏂囦欢鍒伴拤閽夋湇鍔″櫒锛岃幏鍙杕edia_id
-     *
-     * @param filePath 鏈湴鏂囦欢璺緞
-     * @param fileType 鏂囦欢绫诲瀷锛歠ile(鏅�氭枃浠�), voice(璇煶鏂囦欢), video(瑙嗛鏂囦欢), image(鍥剧墖鏂囦欢)
-     * @return media_id
-     * @throws Exception 寮傚父
-     */
-    private String uploadMedia(String filePath, String fileType) throws Exception {
-        String accessToken = simpleExample.getAccessToken();
-
-        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/media/upload");
-        com.dingtalk.api.request.OapiMediaUploadRequest request = new com.dingtalk.api.request.OapiMediaUploadRequest();
-        request.setType(fileType);
-
-        // 浣跨敤 FileItem 鍖呰鏂囦欢
-        File file = new File(filePath);
-        FileItem fileItem = new FileItem(file);
-        request.setMedia(fileItem);
-
-        com.dingtalk.api.response.OapiMediaUploadResponse response = client.execute(request, accessToken);
-
-        if (response.getErrcode() == 0) {
-            log.info("鏂囦欢涓婁紶鎴愬姛锛宮edia_id: {}", response.getMediaId());
-            return response.getMediaId();
-        } else {
-            log.error("鏂囦欢涓婁紶澶辫触锛岄敊璇爜: {}, 閿欒淇℃伅: {}", response.getErrcode(), response.getErrmsg());
-            throw new Exception("鏂囦欢涓婁紶澶辫触: " + response.getErrmsg());
-        }
-    }
-
-    /**
-     * 閫氳繃media_id鍙戦�佹枃浠舵秷鎭�
-     *
-     * @param userIdListStr 鐢ㄦ埛ID鍒楄〃锛岄�楀彿鍒嗛殧
-     * @param mediaId       鏂囦欢鐨刴edia_id锛堥�氳繃uploadMedia鏂规硶鑾峰彇锛�
-     * @return 鍝嶅簲缁撴灉
-     * @throws Exception 寮傚父
-     */
-    private OapiMessageCorpconversationAsyncsendV2Response sendFileMessageByMediaId(String userIdListStr, String mediaId) throws Exception {
-
-        String accessToken = simpleExample.getAccessToken();
-
-        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
-        OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
-        request.setAgentId(4104598880L);
-        request.setUseridList(userIdListStr);
-        request.setToAllUser(false);
-
-        OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
-        msg.setMsgtype("file");
-        msg.setFile(new OapiMessageCorpconversationAsyncsendV2Request.File());
-        msg.getFile().setMediaId(mediaId);
         request.setMsg(msg);
 
         return client.execute(request, accessToken);
diff --git a/src/main/java/com/gs/xky/service/Impl/MesQaItemsDetect01ServiceImpl.java b/src/main/java/com/gs/xky/service/Impl/MesQaItemsDetect01ServiceImpl.java
index a2491fa..030f8e4 100644
--- a/src/main/java/com/gs/xky/service/Impl/MesQaItemsDetect01ServiceImpl.java
+++ b/src/main/java/com/gs/xky/service/Impl/MesQaItemsDetect01ServiceImpl.java
@@ -47,6 +47,11 @@
 
         List<String> collect = list.stream().filter(s -> !StrUtil.isNotEmpty(s.getFcheckResu())).map(MesQaItemsDetect01::getReleaseNo).collect(Collectors.toList());
 
+
+        if (CollUtil.isEmpty(collect)) {
+            return true;
+        }
+
         LambdaUpdateWrapper<MesQaItemsDetect01> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.in(MesQaItemsDetect01::getReleaseNo, collect);
         if (remove(wrapper)) {
diff --git a/src/main/java/com/gs/xky/service/XkyService.java b/src/main/java/com/gs/xky/service/XkyService.java
index 2550373..23aadac 100644
--- a/src/main/java/com/gs/xky/service/XkyService.java
+++ b/src/main/java/com/gs/xky/service/XkyService.java
@@ -97,7 +97,7 @@
     private void processBatchDeliveries(List<XkyEntity> batchDeliveries) {
         batchDeliveries.forEach(deliveryNo -> {
             try {
-                if ("6".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
+                if ("6".equals(deliveryNo.getStatus()) || "8".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
                     log.info("銆恜rocessBatchDeliveries銆戠Щ闄ら�佽揣鍗�: {}", deliveryNo.getDeliveryNo());
                     remove1(deliveryNo);
                 } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
diff --git a/src/main/java/com/gs/xky/task/ScheduledTasks.java b/src/main/java/com/gs/xky/task/ScheduledTasks.java
index 75c256f..3f6d295 100644
--- a/src/main/java/com/gs/xky/task/ScheduledTasks.java
+++ b/src/main/java/com/gs/xky/task/ScheduledTasks.java
@@ -1,157 +1,133 @@
 package com.gs.xky.task;
 
 
-import com.gs.xky.service.VwCjScSjTsBbService;
+import cn.hutool.core.collection.ListUtil;
+import com.gs.xky.config.DingTalkParam;
+import com.gs.xky.config.DingTalkResponse;
+import com.gs.xky.dto.EmployeeInfo;
+import com.gs.xky.entity.MesInvItemArn;
+import com.gs.xky.service.*;
 import lombok.RequiredArgsConstructor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.stream.Collectors;
 
 @Component
 @RequiredArgsConstructor
 public class ScheduledTasks {
     private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class);
 
-    private final VwCjScSjTsBbService vwCjScSjTsBbService;
-
-    private final AtomicBoolean exportTaskRunning = new AtomicBoolean(false);
-
-//    private final XkyService xkyService;
-//    private final ApiService apiService;
-//    private final MesStaffService staffService;
-//    private final DeliveryNoticeService deliveryNoticeService;
-//    private final MesInvItemArnService invItemArnService;
-//    private final Executor taskExecutor; // 娉ㄥ叆閫氱敤绾跨▼姹�
+    private final XkyService xkyService;
+    private final ApiService apiService;
+    private final MesStaffService staffService;
+    private final DeliveryNoticeService deliveryNoticeService;
+    private final MesInvItemArnService invItemArnService;
+    private final Executor taskExecutor; // 娉ㄥ叆閫氱敤绾跨▼姹�
 
     // 鐢ㄤ簬鏍囪鍚勪换鍔℃槸鍚︽鍦ㄦ墽琛�
-//    private final AtomicBoolean isDeviceDataRunning = new AtomicBoolean(false);
-//    private final AtomicBoolean isCompensateRunning = new AtomicBoolean(false);
-//    private final AtomicBoolean isDingTalkRunning = new AtomicBoolean(false);
+    private final AtomicBoolean isDeviceDataRunning = new AtomicBoolean(false);
+    private final AtomicBoolean isCompensateRunning = new AtomicBoolean(false);
+    private final AtomicBoolean isDingTalkRunning = new AtomicBoolean(false);
 
     /**
-     * 姣忓ぉ涓婂崍9鐐规墽琛�
-     * 瀵煎嚭鐢熶骇鏁版嵁骞跺彂閫侀拤閽夋秷鎭�
+     * 姣忎簲鍒嗛挓鎵ц涓�娆�
+     * 鑾峰彇璁惧鏈�杩戠殑涓�鏉¤褰�
      */
-    @Async("taskExecutor")
-    @Scheduled(cron = "0 0 12,16 * * ?")
-    public void exportAndSendProductionDataTask() {
-        if (!exportTaskRunning.compareAndSet(false, true)) {
-            log.warn("鐢熶骇鏁版嵁瀵煎嚭浠诲姟姝e湪鎵ц涓紝璺宠繃鏈鎵ц");
+    @Scheduled(cron = "0 0/5 * * * ?")
+    public void getDeviceRealTimeData() {
+        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
+        if (!isDeviceDataRunning.compareAndSet(false, true)) {
+            log.info("銆恎etDeviceRealTimeData銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
             return;
         }
 
-        try {
-            log.info("寮�濮嬫墽琛岀敓浜ф暟鎹鍑哄苟鍙戦�侀拤閽変换鍔�");
-            boolean result = vwCjScSjTsBbService.exportAndSendToDingtalk();
+        log.info("銆恎etDeviceRealTimeData銆戝紑濮嬭幏鍙栬澶囧疄鏃舵暟鎹�");
 
-            if (result) {
-                log.info("鐢熶骇鏁版嵁瀵煎嚭骞跺彂閫侀拤閽変换鍔℃墽琛屾垚鍔�");
-            } else {
-                log.error("鐢熶骇鏁版嵁瀵煎嚭骞跺彂閫侀拤閽変换鍔℃墽琛屽け璐�");
+        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
+        CompletableFuture.runAsync(() -> {
+            try {
+                xkyService.GetSaveDetail();
+                log.info("銆恎etDeviceRealTimeData銆戣幏鍙栬澶囧疄鏃舵暟鎹垚鍔�");
+            } catch (IOException e) {
+                log.error("銆恎etDeviceRealTimeData銆戣幏鍙栬澶囧疄鏃舵暟鎹紓甯�: {}", e.getMessage(), e);
+            } finally {
+                isDeviceDataRunning.set(false);
             }
-        } catch (Exception e) {
-            log.error("鐢熶骇鏁版嵁瀵煎嚭骞跺彂閫侀拤閽変换鍔℃墽琛屽紓甯�", e);
-        } finally {
-            exportTaskRunning.set(false);
-        }
+        }, taskExecutor);
     }
 
-//    /**
-//     * 姣忎簲鍒嗛挓鎵ц涓�娆�
-//     * 鑾峰彇鍗忓浜戞渶杩戠殑涓�鏉¤褰�
-//     */
-//    @Scheduled(cron = "0 0/5 * * * ?")
-//    public void getDeviceRealTimeData() {
-//        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
-//        if (!isDeviceDataRunning.compareAndSet(false, true)) {
-//            log.info("銆恎etDeviceRealTimeData銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
-//            return;
-//        }
-//
-//        log.info("銆恎etDeviceRealTimeData銆戝紑濮嬭幏鍙栬澶囧疄鏃舵暟鎹�");
-//
-//        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
-//        CompletableFuture.runAsync(() -> {
-//            try {
-//                xkyService.GetSaveDetail();
-//                log.info("銆恎etDeviceRealTimeData銆戣幏鍙栬澶囧疄鏃舵暟鎹垚鍔�");
-//            } catch (IOException e) {
-//                log.error("銆恎etDeviceRealTimeData銆戣幏鍙栬澶囧疄鏃舵暟鎹紓甯�: {}", e.getMessage(), e);
-//            } finally {
-//                isDeviceDataRunning.set(false);
-//            }
-//        }, taskExecutor);
-//    }
-//
-//    /**
-//     * 瀹氭椂鎵ц琛ュ伩閫昏緫
-//     */
-//    @Scheduled(cron = "10 3,8,13,18,23,28,33,38,43,48,53,58 * * * ?")
-//    public void compensateMethod() {
-//        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
-//        if (!isCompensateRunning.compareAndSet(false, true)) {
-//            log.info("銆恈ompensateMethod銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
-//            return;
-//        }
-//
-//        log.info("銆恈ompensateMethod銆戝紑濮嬫墽琛岃ˉ鍋块�昏緫");
-//
-//        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
-//        CompletableFuture.runAsync(() -> {
-//            try {
-//                // 琛ュ伩閫昏緫
-//                List<MesInvItemArn> itemArnMinus = invItemArnService.getItemArnMinus();
-//                deliveryNoticeService.processMesInvItemArnStatusAsync(itemArnMinus);
-//                log.info("銆恈ompensateMethod銆戣ˉ鍋块�昏緫鎵ц鎴愬姛");
-//            } catch (Exception e) {
-//                log.error("銆恈ompensateMethod銆戣ˉ鍋块�昏緫鎵ц寮傚父: {}", e.getMessage(), e);
-//            } finally {
-//                isCompensateRunning.set(false);
-//            }
-//        }, taskExecutor);
-//    }
-//
-//    /**
-//     * 瀹氭椂鑾峰彇閽夐拤鏁版嵁
-//     */
-//    @Scheduled(cron = "0 0/53 * * * ?")
-//    public void getDinTalkData() {
-//        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
-//        if (!isDingTalkRunning.compareAndSet(false, true)) {
-//            log.info("銆恎etDinTalkData銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
-//            return;
-//        }
-//
-//        log.info("銆恎etDinTalkData銆戝紑濮嬭幏鍙栭拤閽夋暟鎹�");
-//
-//        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
-//        CompletableFuture.runAsync(() -> {
-//            try {
-//                DingTalkParam dingTalkParam = new DingTalkParam(1);
-//                DingTalkResponse<EmployeeInfo> employeeInfoDingTalkResponse =
-//                        apiService.sendListRequest(dingTalkParam, EmployeeInfo.class,
-//                                "http://192.168.1.64/eHR/eHRExternalService/Service.ashx");
-//
-//                List<EmployeeInfo> collect = employeeInfoDingTalkResponse.getData().stream()
-//                        .filter(s -> "閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃".equals(s.getCUnitName()))
-//                        .collect(Collectors.toList());
-//
-//                log.info("銆恎etDinTalkData銆戣幏鍙栧埌{}鏉″憳宸ユ暟鎹�", collect.size());
-//
-//                List<List<EmployeeInfo>> partition = ListUtil.partition(collect, 100);
-//                partition.forEach(staffService::UpdateStaff);
-//
-//                log.info("銆恎etDinTalkData銆戦拤閽夋暟鎹鐞嗗畬鎴�");
-//            } catch (IOException e) {
-//                log.error("銆恎etDinTalkData銆戣幏鍙栭拤閽夋暟鎹紓甯�: {}", e.getMessage(), e);
-//            } finally {
-//                isDingTalkRunning.set(false);
-//            }
-//        }, taskExecutor);
-//    }
+    /**
+     * 瀹氭椂鎵ц琛ュ伩閫昏緫
+     */
+    @Scheduled(cron = "10 3,8,13,18,23,28,33,38,43,48,53,58 * * * ?")
+    public void compensateMethod() {
+        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
+        if (!isCompensateRunning.compareAndSet(false, true)) {
+            log.info("銆恈ompensateMethod銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
+            return;
+        }
 
+        log.info("銆恈ompensateMethod銆戝紑濮嬫墽琛岃ˉ鍋块�昏緫");
+
+        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
+        CompletableFuture.runAsync(() -> {
+            try {
+                // 琛ュ伩閫昏緫
+                List<MesInvItemArn> itemArnMinus = invItemArnService.getItemArnMinus();
+                deliveryNoticeService.processMesInvItemArnStatusAsync(itemArnMinus);
+                log.info("銆恈ompensateMethod銆戣ˉ鍋块�昏緫鎵ц鎴愬姛");
+            } catch (Exception e) {
+                log.error("銆恈ompensateMethod銆戣ˉ鍋块�昏緫鎵ц寮傚父: {}", e.getMessage(), e);
+            } finally {
+                isCompensateRunning.set(false);
+            }
+        }, taskExecutor);
+    }
+
+    /**
+     * 瀹氭椂鑾峰彇閽夐拤鏁版嵁
+     */
+    @Scheduled(cron = "0 0/53 * * * ?")
+    public void getDinTalkData() {
+        // 濡傛灉浠诲姟宸茬粡鍦ㄨ繍琛岋紝鍒欒烦杩囨湰娆℃墽琛�
+        if (!isDingTalkRunning.compareAndSet(false, true)) {
+            log.info("銆恎etDinTalkData銆戜笂涓�娆′换鍔¤繕鍦ㄦ墽琛屼腑锛岃烦杩囨湰娆℃墽琛�");
+            return;
+        }
+
+        log.info("銆恎etDinTalkData銆戝紑濮嬭幏鍙栭拤閽夋暟鎹�");
+
+        // 浣跨敤寮傛鎵ц锛岄伩鍏嶉樆濉炶皟搴︾嚎绋�
+        CompletableFuture.runAsync(() -> {
+            try {
+                DingTalkParam dingTalkParam = new DingTalkParam(1);
+                DingTalkResponse<EmployeeInfo> employeeInfoDingTalkResponse =
+                        apiService.sendListRequest(dingTalkParam, EmployeeInfo.class,
+                                "http://192.168.1.64/eHR/eHRExternalService/Service.ashx");
+
+                List<EmployeeInfo> collect = employeeInfoDingTalkResponse.getData().stream()
+                        .filter(s -> "閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃".equals(s.getCUnitName()))
+                        .collect(Collectors.toList());
+
+                log.info("銆恎etDinTalkData銆戣幏鍙栧埌{}鏉″憳宸ユ暟鎹�", collect.size());
+
+                List<List<EmployeeInfo>> partition = ListUtil.partition(collect, 100);
+                partition.forEach(staffService::UpdateStaff);
+
+                log.info("銆恎etDinTalkData銆戦拤閽夋暟鎹鐞嗗畬鎴�");
+            } catch (IOException e) {
+                log.error("銆恎etDinTalkData銆戣幏鍙栭拤閽夋暟鎹紓甯�: {}", e.getMessage(), e);
+            } finally {
+                isDingTalkRunning.set(false);
+            }
+        }, taskExecutor);
+    }
 }
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 447ee31..25dad16 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -5,9 +5,9 @@
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: oracle.jdbc.OracleDriver
-    url: jdbc:oracle:thin:@192.168.1.22:1521/ORCL
-    username: hm_prd
-    password: hmprd
+    url: jdbc:oracle:thin:@192.168.1.104:1521/ORCL
+    username: zmz_prd
+    password: zmzprd
     druid:
       initialSize: 5
       minIdle: 5
diff --git a/src/main/resources/mapper/VwCjScSjTsBbMonthMapper.xml b/src/main/resources/mapper/VwCjScSjTsBbMonthMapper.xml
index 95078a8..825082e 100644
--- a/src/main/resources/mapper/VwCjScSjTsBbMonthMapper.xml
+++ b/src/main/resources/mapper/VwCjScSjTsBbMonthMapper.xml
@@ -4,27 +4,4 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.gs.xky.mapper.VwCjScSjTsBbMonthMapper">
 
-    <resultMap id="BaseResultMap" type="com.gs.xky.entity.VwCjScSjTsBbMonth">
-            <result property="itemName" column="ITEM_NAME" />
-            <result property="itemNo" column="ITEM_NO" />
-            <result property="departmentname" column="DEPARTMENTNAME" />
-            <result property="departmentcode" column="DEPARTMENTCODE" />
-            <result property="daa001" column="DAA001" />
-            <result property="lineName" column="LINE_NAME" />
-            <result property="lineNo" column="LINE_NO" />
-            <result property="daa008" column="DAA008" />
-            <result property="yjkg" column="YJKG" />
-            <result property="sjkg" column="SJKG" />
-            <result property="sq" column="SQ" />
-            <result property="rk" column="RK" />
-            <result property="sqwwg" column="SQWWG" />
-            <result property="rkwwg" column="RKWWG" />
-            <result property="sqwrk" column="SQWRK" />
-    </resultMap>
-
-    <sql id="Base_Column_List">
-        ITEM_NAME,ITEM_NO,DEPARTMENTNAME,DEPARTMENTCODE,DAA001,LINE_NAME,
-        LINE_NO,DAA008,YJKG,SJKG,SQ,
-        RK,SQWWG,RKWWG,SQWRK
-    </sql>
 </mapper>
diff --git a/src/test/java/com/gs/xky/XkyApplicationTests.java b/src/test/java/com/gs/xky/XkyApplicationTests.java
index 40c332e..782b4ed 100644
--- a/src/test/java/com/gs/xky/XkyApplicationTests.java
+++ b/src/test/java/com/gs/xky/XkyApplicationTests.java
@@ -1,7 +1,14 @@
 package com.gs.xky;
 
-import com.gs.xky.service.VwCjScSjTsBbService;
-import com.gs.xky.service.WorkWXService;
+import com.alibaba.fastjson.JSONObject;
+import com.gs.xky.config.ApiResponse;
+import com.gs.xky.config.BodyParam;
+import com.gs.xky.config.DataAcquisitionConfiguration;
+import com.gs.xky.config.XkyCommonParam;
+import com.gs.xky.dto.BarcodeDeliveryNo;
+import com.gs.xky.dto.XkyDetail;
+import com.gs.xky.dto.XkyEntity;
+import com.gs.xky.service.*;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -13,126 +20,168 @@
 class XkyApplicationTests {
 
 
+    public static final String URL = "http://192.168.1.64/eHR/eHRExternalService/Service.ashx";
     @Autowired
-    private VwCjScSjTsBbService vwCjScSjTsBbService;
+    private XkyService xkyService;
 
     @Autowired
-    private WorkWXService workWXService;
+    private ApiService apiService;
 
-    /**
-     * 娴嬭瘯瀵煎嚭鐢熶骇鏁版嵁骞跺彂閫侀拤閽夋秷鎭�
-     * 鍔熻兘锛氭煡璇W_CJ_SC_SJ_TS_BB琛ㄦ暟鎹� -> 瀵煎嚭Excel -> 鍙戦�侀拤閽夋枃浠舵秷鎭�
-     */
+    @Autowired
+    private MesStaffService staffService;
+
+    @Autowired
+    private DeliveryNoticeService deliveryNoticeService;
+
+    @Autowired
+    private TblBarcodeInformationService barcodeInformationService;
+
+    @Autowired
+    private MesInvItemArnService invItemArnService;
+    @Autowired
+    private PurchaseService service;
+    @Autowired
+    private DingtalkInfoService dingtalkInfoService;
+
     @Test
-    void testExportAndSendProductionData() throws Exception {
-        System.out.println("=== 寮�濮嬫祴璇曞鍑虹敓浜ф暟鎹苟鍙戦�侀拤閽� ===");
+    void contextLoads() throws IOException {
 
-//        try {
-//            boolean result = vwCjScSjTsBbService.exportAndSendToDingtalk();
+//        List<MesInvItemArn> itemArnMinus = invItemArnService.getItemArnMinus();
 //
-//            if (result) {
-//                System.out.println("鉁� 鐢熶骇鏁版嵁瀵煎嚭骞跺彂閫佹垚鍔�");
-//                System.out.println("  - 鏁版嵁宸蹭粠 VW_CJ_SC_SJ_TS_BB 琛ㄦ煡璇�");
-//                System.out.println("  - Excel 鏂囦欢宸茬敓鎴愬苟淇濆瓨鍒� D:\\BIFile\\");
-//                System.out.println("  - 閽夐拤鏂囦欢娑堟伅宸插彂閫�");
-//            } else {
-//                System.out.println("鉁� 鐢熶骇鏁版嵁瀵煎嚭鎴栧彂閫佸け璐�");
-//            }
-//        } catch (Exception e) {
-//            System.out.println("鉁� 瀵煎嚭骞跺彂閫佹椂鍙戠敓寮傚父: " + e.getMessage());
-//            e.printStackTrace();
-//        }
+//        deliveryNoticeService.processMesInvItemArnStatusAsync(itemArnMinus);
 
-        System.out.println("=== 娴嬭瘯缁撴潫 ===");
     }
 
     @Test
-    void testGetCheckinDataByQwStaff() {
-        System.out.println("=== 寮�濮嬫祴璇曢�氳繃QW_STAFF琛ㄨ幏鍙栨墦鍗℃暟鎹� ===");
-
-        try {
-            long currentTime = System.currentTimeMillis() / 1000;
-            long oneDaySeconds = 86400;
-
-            long endTime = (currentTime / oneDaySeconds) * oneDaySeconds - 1;
-            long startTime = endTime - oneDaySeconds + 1;
-
-            System.out.println("  - 寮�濮嬫椂闂�: " + new java.util.Date(startTime * 1000));
-            System.out.println("  - 缁撴潫鏃堕棿: " + new java.util.Date(endTime * 1000));
-
-            List<WorkWXService.CheckinData> checkinDataList = workWXService.getCheckinDataByQwStaff(startTime, endTime);
-
-            if (checkinDataList != null && !checkinDataList.isEmpty()) {
-                System.out.println("鉁� 鎴愬姛鑾峰彇鎵撳崱鏁版嵁");
-                System.out.println("  - 鎵撳崱璁板綍鎬绘暟: " + checkinDataList.size());
-                System.out.println("  - 鍓�5鏉℃暟鎹�:");
-                checkinDataList.stream().limit(5).forEach(data -> {
-                    System.out.println("    * userid: " + data.getUserid() +
-                            ", 鎵撳崱鏃堕棿: " + new java.util.Date(data.getCheckinTime() * 1000) +
-                            ", 鎵撳崱绫诲瀷: " + data.getCheckinType() +
-                            ", 寮傚父绫诲瀷: " + data.getExceptionType() +
-                            ", 鍦扮偣: " + data.getLocationDetail());
-                });
-            } else {
-                System.out.println("鉁� 鑾峰彇鐨勬墦鍗℃暟鎹负绌猴紙鍙兘QW_STAFF琛ㄦ棤鏁版嵁鎴栨椂闂磋寖鍥村唴鏃犳墦鍗¤褰曪級");
-            }
-        } catch (IOException e) {
-            System.out.println("鉁� 鑾峰彇鎵撳崱鏁版嵁澶辫触: " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        System.out.println("=== 娴嬭瘯缁撴潫 ===");
+    public void getDeviceRealTimeData() throws IOException {
+//        xkyService.GetSaveDetail();
     }
 
     @Test
-    void testGetWorkWXUserList() {
-        System.out.println("=== 寮�濮嬫祴璇曡幏鍙栦紒涓氬井淇$敤鎴峰垪琛� ===");
+    void cs() throws IOException {
 
-        try {
-            List<WorkWXService.WorkWXUser> userList = workWXService.getUserList();
+        String str = "22251123LM3X";
 
-            if (userList != null && !userList.isEmpty()) {
-                System.out.println("鉁� 鎴愬姛鑾峰彇浼佷笟寰俊鐢ㄦ埛鍒楄〃");
-                System.out.println("  - 鐢ㄦ埛鎬绘暟: " + userList.size());
-                System.out.println("  - 鍓�10鏉℃暟鎹�:");
-                userList.stream().limit(10).forEach(user -> {
-                    System.out.println("    * userid: " + user.getUserid() +
-                            ", 濮撳悕: " + user.getName() +
-                            ", 閮ㄩ棬: " + user.getDepartment());
-                });
-            } else {
-                System.out.println("鉁� 鑾峰彇鐨勭敤鎴峰垪琛ㄤ负绌�");
+
+        String[] split = str.split(";");
+
+        for (String s : split) {
+            XkyCommonParam param = XkyCommonParam.GetInit();
+
+            // 鍒涘缓 BodyParam 瀵硅薄骞惰祴鍊�
+            BodyParam bodyParam = new BodyParam();
+
+            bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
+            bodyParam.setDeliveryNo(s);
+
+            param.setBody(bodyParam);
+
+            ApiResponse<XkyDetail> detail = apiService.sendListRequest(param, XkyDetail.class, "https://openapi.xiekeyun.com/delivery/getDetail.json");
+
+            XkyDetail deliveryNo = detail.getData();
+            System.out.println((JSONObject) JSONObject.toJSON(deliveryNo));
+            if (deliveryNo == null) {
+                System.out.println("涓虹┖鐨勯�佽揣鍗曞彿" + s);
+                return;
             }
-        } catch (IOException e) {
-            System.out.println("鉁� 鑾峰彇鐢ㄦ埛鍒楄〃澶辫触: " + e.getMessage());
-            e.printStackTrace();
+            System.out.println("閫佽揣鍗曠姸鎬�" + deliveryNo.getStatus());
+            if ("6".equals(deliveryNo.getStatus()) || "8".equals(deliveryNo.getStatus()) || "0".equals(deliveryNo.getLogisticsStatus())) {
+                XkyEntity xkyEntity = new XkyEntity();
+                xkyEntity.setDeliveryNo(deliveryNo.getDeliveryNo());
+                xkyService.remove1(xkyEntity);
+            } else if ("1".equals(deliveryNo.getStatus()) && ("2".equals(deliveryNo.getLogisticsStatus()) || "1".equals(deliveryNo.getLogisticsStatus()))) {
+                XkyDetail detail1 = deliveryNo;
+                deliveryNoticeService.saveDeliveryNotice(detail1);
+                List<BarcodeDeliveryNo> barcodeDeliveryNos = GetBarcodeInformation(deliveryNo.getDeliveryNo());
+                barcodeInformationService.SaveBarcodeInformation(barcodeDeliveryNos, deliveryNo.getDeliveryNo());
+                if ("2".equals(deliveryNo.getLogisticsStatus())) {
+                    deliveryNoticeService.callPdaReceiptBtn("閫佽揣鍗曠鏀禰BTNOK[PL017[" + deliveryNo.getDeliveryNo(), "");
+                }
+            }
         }
+    }
 
-        System.out.println("=== 娴嬭瘯缁撴潫 ===");
+    private List<BarcodeDeliveryNo> GetBarcodeInformation(String deliveryNo) throws IOException {
+        XkyCommonParam param = XkyCommonParam.GetInit();
+
+        // 鍒涘缓 BodyParam 瀵硅薄骞惰祴鍊�
+        BodyParam bodyParam = new BodyParam();
+
+        bodyParam.setErpCode(DataAcquisitionConfiguration.TEST_ERP_CODE);
+        bodyParam.setDeliveryNo(deliveryNo);
+
+        param.setBody(bodyParam);
+
+
+        ApiResponse<BarcodeDeliveryNo> noList = apiService.sendListRequest(param, BarcodeDeliveryNo.class, "https://openapi.xiekeyun.com/barcode/byDeliveryNo.json");
+
+        return noList.getDataList();
     }
 
     @Test
-    void testGetUserDetail() {
-        System.out.println("=== 寮�濮嬫祴璇曡幏鍙栫敤鎴疯鎯� ===");
+    void cs1() throws IOException {
+//        DingTalkParam dingTalkParam = new DingTalkParam(0);
+//
+//        DingTalkResponse<EmployeeInfo> employeeInfoDingTalkResponse = apiService.sendListRequest(dingTalkParam, EmployeeInfo.class, "http://192.168.1.64/eHR/eHRExternalService/Service.ashx");
+//
+//        //閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃 cUnitName
+//        //http://192.168.1.64/eHR
+//        List<EmployeeInfo> collect = employeeInfoDingTalkResponse.getData().stream().filter(s -> "閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃".equals(s.getCUnitName())).collect(Collectors.toList());
+//        //System.out.println(collect.size());
+//
+//        collect.stream().filter(s->s.getEmployeeId().equals("2025130028")).forEach(System.out::println);
+//
+//        List<List<EmployeeInfo>> partition = ListUtil.partition(collect, 500);
 
-        try {
-            String userid = "ShenJuanYue";
-            WorkWXService.WorkWXUserDetail userDetail = workWXService.getUserDetail(userid);
+//        partition.forEach(list -> {
+//            staffService.SaveStaff(list);
+//        });
+//        XkyCommonParam param = XkyCommonParam.GetInit();
+//        String jsonString = JSON.toJSONString(param);
+//        System.out.println(jsonString);
+    }
 
-            if (userDetail != null && userDetail.getErrcode() == 0) {
-                System.out.println("鉁� 鎴愬姛鑾峰彇鐢ㄦ埛璇︽儏");
-                System.out.println("  - userid: " + userDetail.getUserid());
-                System.out.println("  - 濮撳悕: " + userDetail.getName());
-                System.out.println("  - 鎵嬫満鍙�: " + userDetail.getMobile());
-                System.out.println("  - 鑱屼綅: " + userDetail.getPosition());
-            } else {
-                System.out.println("鉁� 鑾峰彇鐢ㄦ埛璇︽儏澶辫触");
-            }
-        } catch (IOException e) {
-            System.out.println("鉁� 鑾峰彇鐢ㄦ埛璇︽儏澶辫触: " + e.getMessage());
-            e.printStackTrace();
-        }
+    @Test
+    void cs2() throws IOException {
+//        DingTalkParam dingTalkParam = new DingTalkParam(1);
+//
+//        DingTalkResponse<EmployeeInfo> employeeInfoDingTalkResponse = apiService.sendListRequest(dingTalkParam, EmployeeInfo.class, "http://192.168.1.64/eHR/eHRExternalService/Service.ashx");
+//
+//        //閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃 cUnitName
+//        //http://192.168.1.64/eHR
+//        List<EmployeeInfo> collect = employeeInfoDingTalkResponse.getData().stream().filter(s -> "閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃".equals(s.getCUnitName())).collect(Collectors.toList());
+//        System.out.println(collect.size());
+//
+//        List<List<EmployeeInfo>> partition = ListUtil.partition(collect, 100);
+//
+//        partition.forEach(list -> {
+//            staffService.UpdateStaff(list);
+//
+//
+//        });
 
-        System.out.println("=== 娴嬭瘯缁撴潫 ===");
+    }
+
+    @Test
+    void cs113() throws Exception {
+//        DingTalkParam dingTalkParam = new DingTalkParam(1);
+//        DingTalkResponse<EmployeeInfo> employeeInfoDingTalkResponse =
+//                apiService.sendListRequest(dingTalkParam, EmployeeInfo.class,
+//                        "http://192.168.1.64/eHR/eHRExternalService/Service.ashx");
+//
+//        List<EmployeeInfo> collect = employeeInfoDingTalkResponse.getData().stream()
+//                .filter(s -> "閫犳ⅵ鑰咃紙娴欐睙锛夌鎶�鏈夐檺鍏徃".equals(s.getCUnitName()))
+//                .collect(Collectors.toList());
+
+    }
+
+    @Test
+    void cs3() throws Exception {
+//        dingtalkInfoService.sendMessage("CGJY20250412166");
+
+//        XkyEntity xkyEntity = new XkyEntity();
+//        xkyEntity.setDeliveryNo("222505057541");
+//        xkyService.remove1(xkyEntity);
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3