Procházet zdrojové kódy

申购 采购 作废功能修改

yzc před 1 rokem
rodič
revize
f2f212e320

+ 20 - 20
hx-admin/src/main/resources/application-prod.yml

@@ -13,14 +13,14 @@ spring:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_common?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user
                     password: kfG-A93-w7h-qX8
-                oa:
-                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
-                    username: bytesailing_db_user
-                    password: kfG-A93-w7h-qX8
-                mes:
-                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_mes?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
-                    username: bytesailing_db_user
-                    password: kfG-A93-w7h-qX8
+#                oa:
+#                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_oa?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+#                    username: bytesailing_db_user
+#                    password: kfG-A93-w7h-qX8
+#                mes:
+#                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_mes?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+#                    username: bytesailing_db_user
+#                    password: kfG-A93-w7h-qX8
                 wms:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_wms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user
@@ -37,10 +37,10 @@ spring:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_base?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user
                     password: kfG-A93-w7h-qX8
-                iot:
-                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
-                    username: bytesailing_db_user
-                    password: kfG-A93-w7h-qX8
+#                iot:
+#                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+#                    username: bytesailing_db_user
+#                    password: kfG-A93-w7h-qX8
                 customer:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_customer?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user
@@ -53,14 +53,14 @@ spring:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_account?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user
                     password: kfG-A93-w7h-qX8
-                sale:
-                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_sale?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
-                    username: bytesailing_db_user
-                    password: kfG-A93-w7h-qX8
-                mail:
-                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_mail?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
-                    username: bytesailing_db_user
-                    password: kfG-A93-w7h-qX8
+#                sale:
+#                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_sale?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+#                    username: bytesailing_db_user
+#                    password: kfG-A93-w7h-qX8
+#                mail:
+#                    url: jdbc:mysql://192.168.0.238:23063/bytesailing_mail?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
+#                    username: bytesailing_db_user
+#                    password: kfG-A93-w7h-qX8
                 kd100:
                     url: jdbc:mysql://192.168.0.238:23063/bytesailing_kd100?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai
                     username: bytesailing_db_user

+ 183 - 183
hx-admin/src/test/java/DingDingTest.java

@@ -1,183 +1,183 @@
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson.JSON;
-import com.aliyun.dingtalkoauth2_1_0.Client;
-import com.aliyun.dingtalkoauth2_1_0.models.GetCorpAccessTokenRequest;
-import com.aliyun.dingtalkoauth2_1_0.models.GetCorpAccessTokenResponseBody;
-import com.aliyun.tea.TeaException;
-import com.aliyun.teaopenapi.models.Config;
-import com.fjhx.admin.BytesailingApplication;
-import com.fjhx.area.service.CustomizeAreaService;
-import com.fjhx.dingding.constant.Constant;
-import com.fjhx.dingding.service.DingService;
-import com.ruoyi.common.annotation.TenantIgnore;
-import com.ruoyi.common.exception.ServiceException;
-import com.ruoyi.framework.mybatis.holder.TenantHolder;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BytesailingApplication.class)
-@Slf4j
-public class DingDingTest {
-
-
-    @Autowired
-    private DingService dingService;
-
-    @Autowired
-    private CustomizeAreaService customizeAreaService;
-
-    @TenantIgnore
-    @Test
-    public void test1() {
-
-        TenantHolder.setIgnore(true);
-
-        String a = "{ \"bizData\":[\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683798054000,\n" +
-                "            \"biz_type\":4,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19960,\n" +
-                "            \"gmt_modified\":1683798054000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager2795\\\"},\\\"eventId\\\":\\\"e18758c115604987bb7ba2b4621ab34e\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"dingc265ea6f59c8a65524f2f5cc6abecb85\\\",\\\"auth_level\\\":0,\\\"corp_city\\\":\\\"吉隆坡\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"影音视频\\\",\\\"full_corp_name\\\":\\\"宏星钉测\\\",\\\"corp_name\\\":\\\"宏星钉测\\\",\\\"corp_province\\\":\\\"吉隆坡\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=dingc265ea6f59c8a65524f2f5cc6abecb85&inviteCode=LWeFQxRHOfULrKM\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581464649,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager2795\\\",\\\"231344025724080775\\\",\\\"1244061748905460\\\"]}]},\\\"permanent_code\\\":\\\"MGUG4eSzQWXajGqyCKlVxeZDly-fIhvIsg-Oe_9RiDAuVZselpxX3utY7KBYJLNx\\\",\\\"syncSeq\\\":\\\"8C4DD3DFE04AAE2FB1E6B2AEF7\\\"}\",\n" +
-                "            \"corp_id\":\"dingc265ea6f59c8a65524f2f5cc6abecb85\",\n" +
-                "            \"status\":0\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683798959000,\n" +
-                "            \"biz_type\":4,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19966,\n" +
-                "            \"gmt_modified\":1683798959000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"0146512911051043578\\\"},\\\"eventId\\\":\\\"04a9b05f50334f9fa51293892e20ed95\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding53d823e205604918a39a90f97fcb1e09\\\",\\\"auth_level\\\":1,\\\"corp_city\\\":\\\"福州\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"计算机软件\\\",\\\"full_corp_name\\\":\\\"福建数字云帆科技有限公司\\\",\\\"corp_name\\\":\\\"福建数字云帆科技有限公司\\\",\\\"corp_province\\\":\\\"福建\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding53d823e205604918a39a90f97fcb1e09&inviteCode=NxLoVevdvDloXGi\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":true,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581336572,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"01392913111186905\\\",\\\"0146512911051043578\\\"]}]},\\\"permanent_code\\\":\\\"-icZLdi8NmOL2Rte7Sh3CqdbBcIOGf6eZtJhFNMRBkBugTISTm7zbP21uspckibW\\\",\\\"syncSeq\\\":\\\"844DD3DFE04AAE2FB1E6B2AEA0\\\"}\",\n" +
-                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
-                "            \"status\":0\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683799205000,\n" +
-                "            \"biz_type\":4,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19970,\n" +
-                "            \"gmt_modified\":1683799205000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager6338\\\"},\\\"eventId\\\":\\\"025ca5fb30c9472c8a7ea8211adf78ef\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"dingb543e6dc430497bbee0f45d8e4f7c288\\\",\\\"auth_level\\\":0,\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"\\\",\\\"full_corp_name\\\":\\\"hffff 测试\\\",\\\"corp_name\\\":\\\"hffff 测试\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=dingb543e6dc430497bbee0f45d8e4f7c288&inviteCode=DVwNu9mv9AowRNZ\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581242807,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager6338\\\"]}]},\\\"permanent_code\\\":\\\"oVS5wid1S_B5JPXGZtiNH_gu0N0Diev6SLWHSaEpvHvClNEua_eIINRMOw2JIUC4\\\",\\\"syncSeq\\\":\\\"874DD3DFE04AA32FA1E6B2AEA5\\\"}\",\n" +
-                "            \"corp_id\":\"dingb543e6dc430497bbee0f45d8e4f7c288\",\n" +
-                "            \"status\":0\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683810014000,\n" +
-                "            \"biz_type\":4,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19981,\n" +
-                "            \"gmt_modified\":1683810014000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager8063\\\"},\\\"eventId\\\":\\\"9cee61dc4e3e4226a424b0f07c593a0e\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding379d86d92b0c876eee0f45d8e4f7c288\\\",\\\"auth_level\\\":0,\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"\\\",\\\"full_corp_name\\\":\\\"中星华宸\\\",\\\"corp_name\\\":\\\"中星华宸\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding379d86d92b0c876eee0f45d8e4f7c288&inviteCode=r1zJSofuiKs5eDA\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581402962,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager8063\\\"]}]},\\\"permanent_code\\\":\\\"jZa3L6vaNTyEhmg5ZmAT2Ym9-NUrUjTIp8wSNek2SO8O3bZPGzn9pfDUE0N5E82k\\\",\\\"syncSeq\\\":\\\"804DD3DFE04AAF2F01E6B2AE67\\\"}\",\n" +
-                "            \"corp_id\":\"ding379d86d92b0c876eee0f45d8e4f7c288\",\n" +
-                "            \"status\":0\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683854166000,\n" +
-                "            \"biz_type\":4,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19993,\n" +
-                "            \"gmt_modified\":1683854166000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager7560\\\"},\\\"eventId\\\":\\\"8f508ef39eab4a37b643c0195e8ec862\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding3f327504d104ac1cf2c783f7214b6d69\\\",\\\"auth_level\\\":0,\\\"corp_city\\\":\\\"福州\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"计算机软件\\\",\\\"full_corp_name\\\":\\\"hf测试\\\",\\\"corp_name\\\":\\\"hf测试\\\",\\\"corp_province\\\":\\\"福建\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding3f327504d104ac1cf2c783f7214b6d69&inviteCode=i8yWYDEytZJIkIa\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581273014,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager7560\\\"]}]},\\\"permanent_code\\\":\\\"caY2fuNclujXwRXlDOuctE-4HlOY6hWfgBTnMDbOaCPGQ-yzWQBxE6-axKq9XSJy\\\",\\\"syncSeq\\\":\\\"844DD3DFE04AAD2F91E6B2AEE5\\\"}\",\n" +
-                "            \"corp_id\":\"ding3f327504d104ac1cf2c783f7214b6d69\",\n" +
-                "            \"status\":0\n" +
-                "        },\n" +
-                "        {\n" +
-                "            \"gmt_create\":1683854404000,\n" +
-                "            \"biz_type\":2,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19994,\n" +
-                "            \"gmt_modified\":1683854404000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"eventId\\\":\\\"e50ed7cdf209448fa567e523bfc52b83\\\",\\\"syncAction\\\":\\\"suite_ticket\\\",\\\"suiteTicket\\\":\\\"2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl\\\",\\\"syncSeq\\\":\\\"2AEA5DA284BB85DEE8CA8D33A9\\\"}\",\n" +
-                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
-                "            \"status\":0\n" +
-                "        }\n" +
-                "    ]}";
-
-
-        dingService.pushHigh(JSON.parseObject(a));
-
-        System.out.println();
-
-    }
-
-    public static void main(String[] args) {
-        String a = "{ \"bizData\":[        {\n" +
-                "            \"gmt_create\":1683854404000,\n" +
-                "            \"biz_type\":2,\n" +
-                "            \"open_cursor\":0,\n" +
-                "            \"subscribe_id\":\"30319001_0\",\n" +
-                "            \"id\":19994,\n" +
-                "            \"gmt_modified\":1683854404000,\n" +
-                "            \"biz_id\":\"30319001\",\n" +
-                "            \"biz_data\":\"{\\\"eventId\\\":\\\"e50ed7cdf209448fa567e523bfc52b83\\\",\\\"syncAction\\\":\\\"suite_ticket\\\",\\\"suiteTicket\\\":\\\"2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl\\\",\\\"syncSeq\\\":\\\"2AEA5DA284BB85DEE8CA8D33A9\\\"}\",\n" +
-                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
-                "            \"status\":0\n" +
-                "        }]}";
-        System.out.println(JSON.parse(a));
-    }
-
-
-    private static String test1(String corpId) {
-        GetCorpAccessTokenRequest getCorpAccessTokenRequest = new GetCorpAccessTokenRequest()
-                .setSuiteKey(Constant.SUITE_KEY)
-                .setSuiteSecret(Constant.SUITE_SECRET)
-                .setAuthCorpId(corpId)
-                .setSuiteTicket("2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl");
-
-        try {
-            Client client = getClient2();
-            GetCorpAccessTokenResponseBody body = client.getCorpAccessToken(getCorpAccessTokenRequest).getBody();
-            return body.getAccessToken();
-        } catch (Exception e) {
-
-            TeaException teaException;
-
-            if (e instanceof TeaException) {
-                teaException = (TeaException) e;
-            } else {
-                teaException = new TeaException(e.getMessage(), e);
-            }
-
-            String errCode = teaException.getCode();
-            String errMsg = teaException.getMessage();
-
-            if (StrUtil.isAllNotBlank(errCode, errMsg)) {
-                log.error("钉钉授权认证失败: code:{},message:{}", errCode, errMsg);
-                throw new ServiceException(errMsg);
-            } else {
-                log.error("钉钉授权认证失败", teaException);
-                throw new ServiceException("发生未知异常,钉钉授权认证失败");
-            }
-
-        }
-    }
-
-
-    private static com.aliyun.dingtalkoauth2_1_0.Client getClient2() throws Exception {
-        Config config = new Config();
-        config.protocol = "https";
-        config.regionId = "central";
-        return new com.aliyun.dingtalkoauth2_1_0.Client(config);
-    }
-
-}
+//import cn.hutool.core.util.StrUtil;
+//import com.alibaba.fastjson.JSON;
+//import com.aliyun.dingtalkoauth2_1_0.Client;
+//import com.aliyun.dingtalkoauth2_1_0.models.GetCorpAccessTokenRequest;
+//import com.aliyun.dingtalkoauth2_1_0.models.GetCorpAccessTokenResponseBody;
+//import com.aliyun.tea.TeaException;
+//import com.aliyun.teaopenapi.models.Config;
+//import com.fjhx.admin.BytesailingApplication;
+//import com.fjhx.area.service.CustomizeAreaService;
+//import com.fjhx.dingding.constant.Constant;
+//import com.fjhx.dingding.service.DingService;
+//import com.ruoyi.common.annotation.TenantIgnore;
+//import com.ruoyi.common.exception.ServiceException;
+//import com.ruoyi.framework.mybatis.holder.TenantHolder;
+//import lombok.extern.slf4j.Slf4j;
+//import org.junit.Test;
+//import org.junit.runner.RunWith;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.boot.test.context.SpringBootTest;
+//import org.springframework.test.context.junit4.SpringRunner;
+//
+//
+//@RunWith(SpringRunner.class)
+//@SpringBootTest(classes = BytesailingApplication.class)
+//@Slf4j
+//public class DingDingTest {
+//
+//
+//    @Autowired
+//    private DingService dingService;
+//
+//    @Autowired
+//    private CustomizeAreaService customizeAreaService;
+//
+//    @TenantIgnore
+//    @Test
+//    public void test1() {
+//
+//        TenantHolder.setIgnore(true);
+//
+//        String a = "{ \"bizData\":[\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683798054000,\n" +
+//                "            \"biz_type\":4,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19960,\n" +
+//                "            \"gmt_modified\":1683798054000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager2795\\\"},\\\"eventId\\\":\\\"e18758c115604987bb7ba2b4621ab34e\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"dingc265ea6f59c8a65524f2f5cc6abecb85\\\",\\\"auth_level\\\":0,\\\"corp_city\\\":\\\"吉隆坡\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"影音视频\\\",\\\"full_corp_name\\\":\\\"宏星钉测\\\",\\\"corp_name\\\":\\\"宏星钉测\\\",\\\"corp_province\\\":\\\"吉隆坡\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=dingc265ea6f59c8a65524f2f5cc6abecb85&inviteCode=LWeFQxRHOfULrKM\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581464649,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager2795\\\",\\\"231344025724080775\\\",\\\"1244061748905460\\\"]}]},\\\"permanent_code\\\":\\\"MGUG4eSzQWXajGqyCKlVxeZDly-fIhvIsg-Oe_9RiDAuVZselpxX3utY7KBYJLNx\\\",\\\"syncSeq\\\":\\\"8C4DD3DFE04AAE2FB1E6B2AEF7\\\"}\",\n" +
+//                "            \"corp_id\":\"dingc265ea6f59c8a65524f2f5cc6abecb85\",\n" +
+//                "            \"status\":0\n" +
+//                "        },\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683798959000,\n" +
+//                "            \"biz_type\":4,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19966,\n" +
+//                "            \"gmt_modified\":1683798959000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"0146512911051043578\\\"},\\\"eventId\\\":\\\"04a9b05f50334f9fa51293892e20ed95\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding53d823e205604918a39a90f97fcb1e09\\\",\\\"auth_level\\\":1,\\\"corp_city\\\":\\\"福州\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"计算机软件\\\",\\\"full_corp_name\\\":\\\"福建数字云帆科技有限公司\\\",\\\"corp_name\\\":\\\"福建数字云帆科技有限公司\\\",\\\"corp_province\\\":\\\"福建\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding53d823e205604918a39a90f97fcb1e09&inviteCode=NxLoVevdvDloXGi\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":true,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581336572,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"01392913111186905\\\",\\\"0146512911051043578\\\"]}]},\\\"permanent_code\\\":\\\"-icZLdi8NmOL2Rte7Sh3CqdbBcIOGf6eZtJhFNMRBkBugTISTm7zbP21uspckibW\\\",\\\"syncSeq\\\":\\\"844DD3DFE04AAE2FB1E6B2AEA0\\\"}\",\n" +
+//                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
+//                "            \"status\":0\n" +
+//                "        },\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683799205000,\n" +
+//                "            \"biz_type\":4,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19970,\n" +
+//                "            \"gmt_modified\":1683799205000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager6338\\\"},\\\"eventId\\\":\\\"025ca5fb30c9472c8a7ea8211adf78ef\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"dingb543e6dc430497bbee0f45d8e4f7c288\\\",\\\"auth_level\\\":0,\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"\\\",\\\"full_corp_name\\\":\\\"hffff 测试\\\",\\\"corp_name\\\":\\\"hffff 测试\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=dingb543e6dc430497bbee0f45d8e4f7c288&inviteCode=DVwNu9mv9AowRNZ\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581242807,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager6338\\\"]}]},\\\"permanent_code\\\":\\\"oVS5wid1S_B5JPXGZtiNH_gu0N0Diev6SLWHSaEpvHvClNEua_eIINRMOw2JIUC4\\\",\\\"syncSeq\\\":\\\"874DD3DFE04AA32FA1E6B2AEA5\\\"}\",\n" +
+//                "            \"corp_id\":\"dingb543e6dc430497bbee0f45d8e4f7c288\",\n" +
+//                "            \"status\":0\n" +
+//                "        },\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683810014000,\n" +
+//                "            \"biz_type\":4,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19981,\n" +
+//                "            \"gmt_modified\":1683810014000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager8063\\\"},\\\"eventId\\\":\\\"9cee61dc4e3e4226a424b0f07c593a0e\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding379d86d92b0c876eee0f45d8e4f7c288\\\",\\\"auth_level\\\":0,\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"\\\",\\\"full_corp_name\\\":\\\"中星华宸\\\",\\\"corp_name\\\":\\\"中星华宸\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding379d86d92b0c876eee0f45d8e4f7c288&inviteCode=r1zJSofuiKs5eDA\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581402962,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager8063\\\"]}]},\\\"permanent_code\\\":\\\"jZa3L6vaNTyEhmg5ZmAT2Ym9-NUrUjTIp8wSNek2SO8O3bZPGzn9pfDUE0N5E82k\\\",\\\"syncSeq\\\":\\\"804DD3DFE04AAF2F01E6B2AE67\\\"}\",\n" +
+//                "            \"corp_id\":\"ding379d86d92b0c876eee0f45d8e4f7c288\",\n" +
+//                "            \"status\":0\n" +
+//                "        },\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683854166000,\n" +
+//                "            \"biz_type\":4,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19993,\n" +
+//                "            \"gmt_modified\":1683854166000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"auth_user_info\\\":{\\\"userId\\\":\\\"manager7560\\\"},\\\"eventId\\\":\\\"8f508ef39eab4a37b643c0195e8ec862\\\",\\\"auth_corp_info\\\":{\\\"corp_type\\\":0,\\\"corpid\\\":\\\"ding3f327504d104ac1cf2c783f7214b6d69\\\",\\\"auth_level\\\":0,\\\"corp_city\\\":\\\"福州\\\",\\\"auth_channel\\\":\\\"4\\\",\\\"industry\\\":\\\"计算机软件\\\",\\\"full_corp_name\\\":\\\"hf测试\\\",\\\"corp_name\\\":\\\"hf测试\\\",\\\"corp_province\\\":\\\"福建\\\",\\\"is_ecological_corp\\\":false,\\\"invite_url\\\":\\\"https://wx-in-i.dingtalk.com/invite-page/weixin.html?bizSource=____source____&corpId=ding3f327504d104ac1cf2c783f7214b6d69&inviteCode=i8yWYDEytZJIkIa\\\",\\\"auth_channel_type\\\":\\\"\\\",\\\"corp_type_v2\\\":0,\\\"invite_code\\\":\\\"\\\",\\\"is_authenticated\\\":false,\\\"license_code\\\":\\\"\\\",\\\"corp_logo_url\\\":\\\"\\\"},\\\"syncAction\\\":\\\"org_suite_auth\\\",\\\"auth_scope\\\":{\\\"errcode\\\":0,\\\"condition_field\\\":[],\\\"auth_user_field\\\":[\\\"jobnumber\\\",\\\"isLeader\\\",\\\"name\\\",\\\"isAdmin\\\",\\\"avatar\\\",\\\"position\\\",\\\"department\\\",\\\"userid\\\",\\\"deviceId\\\",\\\"isHide\\\"],\\\"auth_org_scopes\\\":{\\\"authed_user\\\":[],\\\"authed_dept\\\":[1]},\\\"errmsg\\\":\\\"ok\\\"},\\\"auth_info\\\":{\\\"agent\\\":[{\\\"agentid\\\":2581273014,\\\"agent_name\\\":\\\"byteSailing_test\\\",\\\"logo_url\\\":\\\"https://static-legacy.dingtalk.com/media/lALPDfJ6cdfiyqfNAZDNAZA_400_400.png\\\",\\\"appid\\\":131175,\\\"use_app_role\\\":false,\\\"admin_list\\\":[\\\"manager7560\\\"]}]},\\\"permanent_code\\\":\\\"caY2fuNclujXwRXlDOuctE-4HlOY6hWfgBTnMDbOaCPGQ-yzWQBxE6-axKq9XSJy\\\",\\\"syncSeq\\\":\\\"844DD3DFE04AAD2F91E6B2AEE5\\\"}\",\n" +
+//                "            \"corp_id\":\"ding3f327504d104ac1cf2c783f7214b6d69\",\n" +
+//                "            \"status\":0\n" +
+//                "        },\n" +
+//                "        {\n" +
+//                "            \"gmt_create\":1683854404000,\n" +
+//                "            \"biz_type\":2,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19994,\n" +
+//                "            \"gmt_modified\":1683854404000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"eventId\\\":\\\"e50ed7cdf209448fa567e523bfc52b83\\\",\\\"syncAction\\\":\\\"suite_ticket\\\",\\\"suiteTicket\\\":\\\"2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl\\\",\\\"syncSeq\\\":\\\"2AEA5DA284BB85DEE8CA8D33A9\\\"}\",\n" +
+//                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
+//                "            \"status\":0\n" +
+//                "        }\n" +
+//                "    ]}";
+//
+//
+//        dingService.pushHigh(JSON.parseObject(a));
+//
+//        System.out.println();
+//
+//    }
+//
+//    public static void main(String[] args) {
+//        String a = "{ \"bizData\":[        {\n" +
+//                "            \"gmt_create\":1683854404000,\n" +
+//                "            \"biz_type\":2,\n" +
+//                "            \"open_cursor\":0,\n" +
+//                "            \"subscribe_id\":\"30319001_0\",\n" +
+//                "            \"id\":19994,\n" +
+//                "            \"gmt_modified\":1683854404000,\n" +
+//                "            \"biz_id\":\"30319001\",\n" +
+//                "            \"biz_data\":\"{\\\"eventId\\\":\\\"e50ed7cdf209448fa567e523bfc52b83\\\",\\\"syncAction\\\":\\\"suite_ticket\\\",\\\"suiteTicket\\\":\\\"2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl\\\",\\\"syncSeq\\\":\\\"2AEA5DA284BB85DEE8CA8D33A9\\\"}\",\n" +
+//                "            \"corp_id\":\"ding53d823e205604918a39a90f97fcb1e09\",\n" +
+//                "            \"status\":0\n" +
+//                "        }]}";
+//        System.out.println(JSON.parse(a));
+//    }
+//
+//
+//    private static String test1(String corpId) {
+//        GetCorpAccessTokenRequest getCorpAccessTokenRequest = new GetCorpAccessTokenRequest()
+//                .setSuiteKey(Constant.SUITE_KEY)
+//                .setSuiteSecret(Constant.SUITE_SECRET)
+//                .setAuthCorpId(corpId)
+//                .setSuiteTicket("2SwvImnFmDGqrCpEdmHeOjwBpBBj0o30nJmsqzMGUD3HJ2zMqckkTwlzM40GycbsjBKE0h2wUQHb3AQMrRtzCl");
+//
+//        try {
+//            Client client = getClient2();
+//            GetCorpAccessTokenResponseBody body = client.getCorpAccessToken(getCorpAccessTokenRequest).getBody();
+//            return body.getAccessToken();
+//        } catch (Exception e) {
+//
+//            TeaException teaException;
+//
+//            if (e instanceof TeaException) {
+//                teaException = (TeaException) e;
+//            } else {
+//                teaException = new TeaException(e.getMessage(), e);
+//            }
+//
+//            String errCode = teaException.getCode();
+//            String errMsg = teaException.getMessage();
+//
+//            if (StrUtil.isAllNotBlank(errCode, errMsg)) {
+//                log.error("钉钉授权认证失败: code:{},message:{}", errCode, errMsg);
+//                throw new ServiceException(errMsg);
+//            } else {
+//                log.error("钉钉授权认证失败", teaException);
+//                throw new ServiceException("发生未知异常,钉钉授权认证失败");
+//            }
+//
+//        }
+//    }
+//
+//
+//    private static com.aliyun.dingtalkoauth2_1_0.Client getClient2() throws Exception {
+//        Config config = new Config();
+//        config.protocol = "https";
+//        config.regionId = "central";
+//        return new com.aliyun.dingtalkoauth2_1_0.Client(config);
+//    }
+//
+//}

+ 8 - 0
hx-purchase/src/main/java/com/fjhx/purchase/controller/purchase/PurchaseController.java

@@ -154,4 +154,12 @@ public class PurchaseController {
         purchaseService.editContractCode(purchaseDto);
     }
 
+    /**
+     * 采购 作废
+     */
+    @PostMapping("/cancellation")
+    public void cancellation(@RequestBody PurchaseSelectDto dto) {
+        purchaseService.cancellation(dto.getId());
+    }
+
 }

+ 9 - 0
hx-purchase/src/main/java/com/fjhx/purchase/controller/subscribe/SubscribeDetailController.java

@@ -6,6 +6,7 @@ import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.purchase.entity.subscribe.SubscribeDetailExcelBo;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
+import com.fjhx.purchase.entity.subscribe.dto.SubscribeSelectDto;
 import com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.ruoyi.common.core.domain.BaseSelectDto;
@@ -97,4 +98,12 @@ public class SubscribeDetailController {
         return subscribeDetailService.excelImport(file);
     }
 
+    /**
+     * 申购 作废
+     */
+    @PostMapping("/cancellation")
+    public void cancellation(@RequestBody SubscribeSelectDto dto) {
+        subscribeDetailService.cancellation(dto.getId());
+    }
+
 }

+ 5 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/PurchaseService.java

@@ -107,4 +107,9 @@ public interface PurchaseService extends BaseService<Purchase> {
      * 修改采购单号
      */
     void editContractCode(PurchaseDto dto);
+
+    /**
+     * 作废
+     */
+    void cancellation(Long id);
 }

+ 49 - 14
hx-purchase/src/main/java/com/fjhx/purchase/service/purchase/impl/PurchaseServiceImpl.java

@@ -18,9 +18,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.entity.documentary.bo.DocumentaryData;
 import com.fjhx.common.enums.CodingRuleEnum;
+import com.fjhx.common.enums.FlowStatusEnum1;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.service.documentary.GetDocumentaryBusinessTemplate;
 import com.fjhx.common.utils.Assert;
+import com.fjhx.flow.entity.flow.po.FlowExample;
+import com.fjhx.flow.enums.FlowStatusEnum;
+import com.fjhx.flow.service.flow.FlowExampleService;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.item.util.excel.util.ExcelUtil;
@@ -148,6 +152,8 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
     private ISysRoleService sysRoleService;
     @Autowired
     private WdlyService wdlyService;
+    @Autowired
+    private FlowExampleService flowExampleService;
 
     /**
      * 列表
@@ -205,13 +211,13 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
             //供应商
             List<Long> supplierInfoIds = supplierInfoService.listObject(SupplierInfo::getId, q -> q.like(SupplierInfo::getName, dto.getKeyword()));
             wrapper.and(q -> q.like("json_unquote(p.victoriatourist_json -> '$.contractCode')", dto.getKeyword())
-                    .or().in("p", Purchase::getSupplyId, supplierInfoIds)
-                    .or().like("p", Purchase::getPurchaseName, dto.getKeyword())
-                    //根据明细 产品名称 产品编号 过滤
+                            .or().in("p", Purchase::getSupplyId, supplierInfoIds)
+                            .or().like("p", Purchase::getPurchaseName, dto.getKeyword())
+                            //根据明细 产品名称 产品编号 过滤
 //                    .or().like("pi.name", dto.getKeyword())
 //                    .or().like("pi.custom_code", dto.getKeyword())
-                    //exists
-                    .or().inSql("p.id","SELECT pd.purchase_id FROM purchase_detail pd LEFT JOIN bytesailing_item.product_info pi ON pd.bussiness_id = pi.id WHERE ( pi.`name` LIKE CONCAT( '%', '"+dto.getKeyword()+"', '%' ) OR pi.custom_code LIKE CONCAT( '%', '"+dto.getKeyword()+"', '%' ) OR pi.spec LIKE CONCAT( '%', '"+dto.getKeyword()+"', '%' ))")
+                            //exists
+                            .or().inSql("p.id", "SELECT pd.purchase_id FROM purchase_detail pd LEFT JOIN bytesailing_item.product_info pi ON pd.bussiness_id = pi.id WHERE ( pi.`name` LIKE CONCAT( '%', '" + dto.getKeyword() + "', '%' ) OR pi.custom_code LIKE CONCAT( '%', '" + dto.getKeyword() + "', '%' ) OR pi.spec LIKE CONCAT( '%', '" + dto.getKeyword() + "', '%' ))")
             );
         }
         //高级检索
@@ -256,8 +262,8 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
         wrapper.eq("de.dept_id", dto.getDeptId());
 
         //时间范围过滤
-        wrapper.ge("p", Purchase::getCreateTime,dto.getBeginTime());
-        wrapper.le("p", Purchase::getCreateTime,dto.getEndTime());
+        wrapper.ge("p", Purchase::getCreateTime, dto.getBeginTime());
+        wrapper.le("p", Purchase::getCreateTime, dto.getEndTime());
 
         wrapper.groupBy("p.id");
         return wrapper;
@@ -386,7 +392,7 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
     }
 
     @Override
-    public PurchaseVo getPageStatistics(PurchaseSelectDto dto){
+    public PurchaseVo getPageStatistics(PurchaseSelectDto dto) {
         IWrapper<Purchase> wrapper = getWdlyPageWrapper(dto);
         return baseMapper.getPageStatistics(wrapper);
     }
@@ -943,12 +949,41 @@ public class PurchaseServiceImpl extends ServiceImpl<PurchaseMapper, Purchase>
      */
     @Override
     public void editContractCode(PurchaseDto dto) {
-        Assert.notEmpty(dto.getId(),"采购id不能为空");
-        this.update(q->q
-                .eq(Purchase::getId,dto.getId())
-                .set(BasePo::getUpdateTime,new Date())
-                .set(BasePo::getUpdateUser,SecurityUtils.getUserId())
-                .setSql("victoriatourist_json = JSON_SET(victoriatourist_json,'$.contractCode','"+dto.getContractCode()+"')")
+        Assert.notEmpty(dto.getId(), "采购id不能为空");
+        this.update(q -> q
+                .eq(Purchase::getId, dto.getId())
+                .set(BasePo::getUpdateTime, new Date())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .setSql("victoriatourist_json = JSON_SET(victoriatourist_json,'$.contractCode','" + dto.getContractCode() + "')")
+        );
+    }
+
+    @Override
+    public void cancellation(Long id) {
+        Purchase purchase = getById(id);
+        this.update(q -> q
+                .eq(Purchase::getId, id)
+                .set(Purchase::getPurchaseStatus, FlowStatusEnum1.CANCELLATION.getKey())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .set(BasePo::getUpdateTime, new Date())
         );
+
+        purchaseDetailService.update(q -> q
+                .eq(PurchaseDetail::getPurchaseId, purchase.getId())
+                .set(PurchaseDetail::getStatus, FlowStatusEnum1.CANCELLATION.getKey())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .set(BasePo::getUpdateTime, new Date())
+        );
+
+        //销毁审批中的流程
+        DynamicDataSourceContextHolder.push(SourceConstant.BASE);
+        flowExampleService.update(q -> q
+                .eq(FlowExample::getId, purchase.getFlowId())
+                .in(FlowExample::getStatus, FlowStatusEnum.READY_START.getKey(), FlowStatusEnum.IN_PROGRESS.getKey())
+                .set(FlowExample::getStatus, FlowStatusEnum.CANCELLATION.getKey())
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .set(BasePo::getUpdateTime, new Date())
+        );
+        DynamicDataSourceContextHolder.poll();
     }
 }

+ 5 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/SubscribeDetailService.java

@@ -62,4 +62,9 @@ public interface SubscribeDetailService extends BaseService<SubscribeDetail> {
      * 申购明细导入
      */
     List<SubscribeDetailExcelBo> excelImport(MultipartFile file);
+
+    /**
+     * 作废
+     */
+    void cancellation(Long id);
 }

+ 35 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java

@@ -4,9 +4,11 @@ import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson2.JSONObject;
 import com.alibaba.fastjson2.JSONWriter;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -26,12 +28,14 @@ import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo;
 import com.fjhx.purchase.mapper.subscribe.SubscribeDetailMapper;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.tenant.entity.dict.dto.DictTenantDataSelectDto;
 import com.fjhx.tenant.entity.dict.vo.DictTenantDataVo;
 import com.fjhx.tenant.service.dict.DictTenantDataService;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.service.warehouse.WarehouseService;
+import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
@@ -70,6 +74,8 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
     private DictTenantDataService dictTenantDataService;
     @Autowired
     private ISysRoleService sysRoleService;
+    @Autowired
+    private PurchaseService purchaseService;
 
     /**
      * 分页
@@ -376,4 +382,33 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
         return excelBoList;
     }
 
+    /**
+     * 作废
+     */
+    @DSTransactional
+    @Override
+    public void cancellation(Long id) {
+        //检查采购单
+        List<Long> pIds = purchaseDetailService.listObject(PurchaseDetail::getPurchaseId, q -> q.eq(PurchaseDetail::getSubscribeDetailId, id));
+        if (ObjectUtils.isNotEmpty(pIds)) {
+            //如果存在 非作废的采购订单
+            List<String> pCode = purchaseService.listObject(Purchase::getCode, q -> q
+                    .ne(Purchase::getPurchaseStatus, 88)
+                    .in(Purchase::getId, pIds)
+            );
+            if (ObjectUtils.isNotEmpty(pCode)) {
+                String collect = pCode.stream().collect(Collectors.joining(","));
+                throw new com.obs.services.internal.ServiceException("该申购单下存在【非作废】的采购订单,单号如下:" + collect + " 禁止作废!");
+            }
+        }
+
+        //作废申购明细
+        this.update(q -> q
+                .eq(SubscribeDetail::getId, id)
+                .set(SubscribeDetail::getStatus, 99)
+                .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
+                .set(BasePo::getUpdateTime, new Date())
+        );
+    }
+
 }

+ 1 - 1
hx-purchase/src/main/resources/mapper/subscribe/SubscribeDetailMapper.xml

@@ -36,7 +36,7 @@
             IFNULL( SUM( t2.count ), 0 ) AS purchaseCount
         FROM
             subscribe_detail t1
-        LEFT JOIN purchase_detail t2 ON t1.id = t2.subscribe_detail_id
+        LEFT JOIN purchase_detail t2 ON t1.id = t2.subscribe_detail_id and t2.status != 88
         <where>
             <if test="ids neq null and ids.size() > 0">
                 <foreach collection="ids" item="id" open="t1.id IN (" separator="," close=")">