Bläddra i källkod

产品库物料库功能修改

yzc 1 år sedan
förälder
incheckning
027ea14702

+ 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);
+//    }
+//
+//}

+ 0 - 32
hx-item/src/main/java/com/fjhx/item/controller/product/ProductInfoController.java

@@ -47,22 +47,6 @@ public class ProductInfoController {
         return productInfoService.productInfoStatistics(dto);
     }
 
-//    /**
-//     * 产品库分页 维多利亚
-//     */
-//    @PostMapping("/pageByWdly")
-//    public Page<ProductInfoVo> pageByWdly(@RequestBody ProductInfoSelectDto dto) {
-//        return productInfoService.getPageByWdly(dto);
-//    }
-
-//    /**
-//     * 产品库组合产品分页
-//     */
-//    @PostMapping("/getCombinationPage")
-//    public Page<ProductInfoVo> getCombinationPage(@RequestBody ProductInfoSelectDto dto) {
-//        return productInfoService.getCombinationPage(dto);
-//    }
-
     /**
      * 客户产品库分页
      */
@@ -119,14 +103,6 @@ public class ProductInfoController {
         return productInfoService.detail(dto.getId());
     }
 
-//    /**
-//     * 产品库明细
-//     */
-//    @PostMapping("/detailByWdly")
-//    public ProductInfoVo detailByWdly(@RequestBody BaseSelectDto dto) {
-//        return productInfoService.detailByWdly(dto.getId());
-//    }
-
     /**
      * 产品库新增
      */
@@ -135,14 +111,6 @@ public class ProductInfoController {
         productInfoService.add(productInfoDto);
     }
 
-//    /**
-//     * 产品库新增 维多利亚
-//     */
-//    @PostMapping("/addByWdly")
-//    public void addByWdly(@RequestBody ProductInfoDto productInfoDto) {
-//        productInfoService.addByWdly(productInfoDto);
-//    }
-
     /**
      * 产品库编辑
      */

+ 5 - 0
hx-item/src/main/java/com/fjhx/item/entity/product/po/ProductClassify.java

@@ -41,4 +41,9 @@ public class ProductClassify extends BasePo {
      */
     private String name;
 
+    /**
+     * 排序
+     */
+    private Integer sort;
+
 }

+ 78 - 22
hx-item/src/main/java/com/fjhx/item/entity/product/po/ProductInfo.java

@@ -1,6 +1,5 @@
 package com.fjhx.item.entity.product.po;
 
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.domain.BasePo;
 import lombok.Getter;
@@ -25,6 +24,10 @@ public class ProductInfo extends BasePo {
      * 定义 1产品 2物料
      */
     private Integer definition;
+    /**
+     * 工艺id
+     */
+    Long technologyId;
 
     /**
      * 产品分类id
@@ -32,62 +35,115 @@ public class ProductInfo extends BasePo {
     private Long productClassifyId;
 
     /**
+     * 自定义编码
+     */
+    private String customCode;
+
+    /**
+     * 产品名称
+     */
+    private String name;
+    /**
      * 产品编码
      */
     private String code;
-
     /**
-     * 自定义编码
+     * 英文名
      */
-    private String customCode;
-
+    private String nameEnglish;
     /**
-     * 产品类型
+     * 销售价
      */
-    private String type;
-
+    private BigDecimal price;
     /**
-     * 产品名称
+     * 币种
      */
-    private String name;
+    private String currency;
 
     /**
      * 规格型号
      */
     private String spec;
+    /**
+     * 产品长
+     */
+    private BigDecimal length;
+    /**
+     * 产品宽
+     */
+    private BigDecimal width;
+    /**
+     * 产品高
+     */
+    private BigDecimal height;
 
     /**
-     * 单位
+     * 净重
      */
-    private String unit;
+    private BigDecimal netWeight;
 
     /**
-     * 标准产品库json
+     * 海关编码
      */
-    private String standardJson;
+    private String hsCode;
 
     /**
      * 备注
      */
     private String remark;
 
+    //---------------------------------------------------------------
+
+    /**
+     * 材质
+     */
+    private String material;
+    /**
+     * 正面纹路
+     */
+    private String frontalTexture;
+    /**
+     * 反面纹路
+     */
+    private String reverseTexture;
     /**
-     * 维多利亚json
+     * 单位
+     */
+    private String unit;
+    /**
+     * 色层
      */
-    private String victoriatouristJson;
+    private String colorLayer;
+    /**
+     * 颜色
+     */
+    private String color;
+    /**
+     * 安全库存
+     */
+    private String stockThreshold;
+    /**
+     * 成本价
+     */
+    private BigDecimal costPrice;
 
     /**
-     * 产品spuid
+     * 成本价币种
      */
-    private Long productSpuId;
+    private String costCurrency;
 
-    @TableField(exist = false)
-    private Integer count;
 
+    //---------------------------------------------------------------
     /**
-     * 尔泓json
+     * 产品类型
      */
-    private String ehsdJson;
+    private String type;
+
+
+    /**
+     * 产品spuid
+     */
+    private Long productSpuId;
 
     /**
      * 条码编号

+ 2 - 3
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductClassifyServiceImpl.java

@@ -2,9 +2,7 @@ package com.fjhx.item.service.product.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.item.entity.product.dto.ProductClassifyDto;
 import com.fjhx.item.entity.product.po.ProductClassify;
 import com.fjhx.item.mapper.product.ProductClassifyMapper;
@@ -41,9 +39,10 @@ public class ProductClassifyServiceImpl extends ServiceImpl<ProductClassifyMappe
         String name = productClassify.getName();
 
         List<ProductClassify> list = lambdaQuery()
-                .select(ProductClassify::getId, ProductClassify::getName, ProductClassify::getParentId)
+                .select(ProductClassify::getId, ProductClassify::getName, ProductClassify::getParentId, ProductClassify::getSort)
                 .eq(ProductClassify::getDefinition, productClassify.getDefinition())
                 .like(ObjectUtil.isNotEmpty(name), ProductClassify::getName, name)
+                .orderByAsc(ProductClassify::getSort)
                 .list();
 
         // 构建树形

+ 49 - 209
hx-item/src/main/java/com/fjhx/item/service/product/impl/ProductInfoServiceImpl.java

@@ -3,8 +3,6 @@ package com.fjhx.item.service.product.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson2.JSONObject;
-import com.alibaba.fastjson2.JSONWriter;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -13,8 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.utils.Assert;
-import com.fjhx.customer.entity.customer.po.Customer;
-import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.file.utils.ObsFileUtil;
 import com.fjhx.item.entity.product.bo.ProductAnalysisBo;
 import com.fjhx.item.entity.product.dto.ProductInfoDto;
@@ -22,7 +18,6 @@ import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
 import com.fjhx.item.entity.product.po.ProductClassify;
 import com.fjhx.item.entity.product.po.ProductInfo;
 import com.fjhx.item.entity.product.po.ProductInfoEhsdExcel;
-import com.fjhx.item.entity.product.po.ProductInfoEhsdJson;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.mapper.product.ProductInfoMapper;
 import com.fjhx.item.service.product.ProductClassifyService;
@@ -38,7 +33,6 @@ import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.SqlField;
-import com.ruoyi.system.service.ISysDeptService;
 import com.ruoyi.system.utils.UserUtil;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -65,13 +59,6 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
 
     @Autowired
     private ProductClassifyService productClassifyService;
-
-    @Autowired
-    private ISysDeptService sysDeptService;
-
-    @Autowired
-    private CustomerService customerService;
-
     @Autowired
     private DictTenantDataService dictTenantDataService;
 
@@ -90,20 +77,12 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         wrapper.like("pi", ProductInfo::getName, dto.getName());
         wrapper.like("pi", ProductInfo::getCustomCode, dto.getCustomCode());
         wrapper.like("pi", ProductInfo::getBarCode, dto.getBarCode());
-        wrapper.like("json_unquote(standard_json->'$.englishName')", dto.getEnglishName());
-        wrapper.like("json_unquote(standard_json->'$.customsCode')", dto.getCustomsCode());
         wrapper.keyword(dto.getKeyword(),
                 new SqlField("pi", ProductInfo::getName),
                 new SqlField("pi", ProductInfo::getCode),
                 new SqlField("pi", ProductInfo::getCustomCode),
-                new SqlField("pi", ProductInfo::getSpec),
-                //材质面料过滤
-                new SqlField("json_unquote(pi.victoriatourist_json -> '$.materialQuality')")
+                new SqlField("pi", ProductInfo::getSpec)
         );
-        //计算并根据生命周期过滤
-        wrapper.eq("IF(DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.growUpDay' ),3,IF( DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.newProductsDay' ), 2, 1 ))", dto.getLifeCycle());
-        //过滤组合产品
-        wrapper.eq("json_unquote( victoriatourist_json -> '$.combination' )", dto.getCombination());
 
         Page<ProductInfoVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
 
@@ -138,60 +117,6 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         return page;
     }
 
-
-//    @Override
-//    public Page<ProductInfoVo> getPageByWdly(ProductInfoSelectDto dto) {
-//        Page<ProductInfoVo> page = getPage(dto);
-//        List<ProductInfoVo> records = page.getRecords();
-//        //赋值维多利亚扩展部门名称
-//        List<Long> ids = new ArrayList<>();
-//        for (ProductInfoVo record : records) {
-//            String victoriatouristJson = record.getVictoriatouristJson();
-//            if (ObjectUtil.isNotEmpty(victoriatouristJson)) {
-//                JSONObject json = JSONObject.parseObject(victoriatouristJson);
-//                ids.add(json.getLong("deptId"));
-//            }
-//        }
-//        if (ObjectUtil.isEmpty(ids)) {
-//            return page;
-//        }
-//
-//        IWrapper<SysDept> wrapper1 = IWrapper.getWrapper();
-//        wrapper1.in(SysDept::getDeptId, ids);
-//        DynamicDataSourceContextHolder.push(SourceConstant.BASE);
-//        List<SysDept> sysDepts = sysDeptService.list(wrapper1);
-//        DynamicDataSourceContextHolder.poll();
-//        Map<Long, String> sysDeptMap = sysDepts.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
-//
-//        for (ProductInfoVo record : records) {
-//            String victoriatouristJson = record.getVictoriatouristJson();
-//
-//            if (ObjectUtil.isEmpty(victoriatouristJson)) {
-//                continue;
-//            }
-//
-//            JSONObject json = JSONObject.parseObject(victoriatouristJson);
-//            json.put("deptName", sysDeptMap.get(json.getLong("deptId")));
-//
-//            //生命周期计算(在sql里面计算了) 当前时间-创建时间=的天数>growUpDay成熟期,>newProductsDay就是成长期,要不然就是新品期
-//            json.put("lifeCycle", record.getLifeCycle());
-//
-//            //将部门id转为字符串(帮助解决前端问题)
-//            json.put("deptId", json.getString("deptId"));
-//
-//            record.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
-//        }
-//
-//        return page;
-//    }
-
-//    @Override
-//    public Page<ProductInfoVo> getCombinationPage(ProductInfoSelectDto dto) {
-//        dto.setCombination(1);
-//        Page<ProductInfoVo> page = getPageByWdly(dto);
-//        return page;
-//    }
-
     @Override
     public Page<ProductInfoVo> getCustomerProductList(ProductInfoSelectDto dto) {
         IWrapper<ProductInfo> wrapper = getWrapper();
@@ -202,7 +127,6 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     @Override
     public Page<ProductInfoVo> getConditionProductList(ProductInfoSelectDto dto) {
         IWrapper<ProductInfo> wrapper = getWrapper();
-        wrapper.eq("json_unquote(pi.ehsd_json -> '$.type')", 1);//公司产品
         return getPageByEhsd(dto, wrapper);
     }
 
@@ -213,39 +137,15 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         //根据产品名称/产品编号过滤
         if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
             wrapper.and(q -> q.like("pi", ProductInfo::getName, dto.getKeyword())
-                    .or().like("json_unquote(pi.ehsd_json -> '$.nameEnglish')", dto.getKeyword())
                     .or().like("pi", ProductInfo::getCode, dto.getKeyword())//产品编号
-                    .or().like("c.name", dto.getKeyword()));//客户名称
+            );//客户名称
         }
-        //根据客户id过滤
-        wrapper.eq("c.id", dto.getCustomerId());
+
         //根据产品分类id过滤
         wrapper.eq("pi", ProductInfo::getProductClassifyId, dto.getProductClassifyId());
         wrapper.orderByDesc("pi", ProductInfo::getCreateTime);
 
         Page<ProductInfoVo> page = baseMapper.getCustomerProductList(dto.getPage(), wrapper);
-        List<ProductInfoVo> records = page.getRecords();
-        //赋值客户名称
-        List<Long> customerIds = new ArrayList<>();
-        for (ProductInfoVo record : records) {
-            ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(record.getEhsdJson(), ProductInfoEhsdJson.class);
-            if (ObjectUtil.isNotEmpty(productInfoEhsdJson.getCustomerId())) {
-                customerIds.add(Long.parseLong(productInfoEhsdJson.getCustomerId()));
-            }
-        }
-        if (ObjectUtil.isNotEmpty(customerIds)) {
-            Map<Long, String> customerMap = customerService.mapKV(Customer::getId, Customer::getName, q -> q.in(Customer::getId, customerIds));
-            for (ProductInfoVo record : records) {
-                ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(record.getEhsdJson(), ProductInfoEhsdJson.class);
-
-                String customerId = productInfoEhsdJson.getCustomerId();
-                if (ObjectUtil.isNotEmpty(customerId)) {
-                    String customerName = customerMap.get(Long.parseLong(customerId));
-                    productInfoEhsdJson.setCustomerName(customerName);
-                }
-                record.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson, JSONWriter.Feature.WriteLongAsString));
-            }
-        }
         //赋值创建人名称
         UserUtil.assignmentNickName(page.getRecords(), ProductInfo::getCreateUser, ProductInfoVo::setCreateUserName);
         return page;
@@ -255,42 +155,15 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     public ProductInfoVo detail(Long id) {
         ProductInfo productInfo = this.getById(id);
         ProductInfoVo result = BeanUtil.toBean(productInfo, ProductInfoVo.class);
+
+        //赋值分类名称
+        ProductClassify productClassify = productClassifyService.getById(result.getProductClassifyId());
+        if (ObjectUtil.isNotEmpty(productClassify)) {
+            result.setClassifyName(productClassify.getName());
+        }
         return result;
     }
 
-//    @Override
-//    public ProductInfoVo detailByWdly(Long id) {
-//        ProductInfoVo result = detail(id);
-//        //赋值维多利亚组合产品信息
-//        JSONObject json = JSONObject.parseObject(result.getVictoriatouristJson());
-//        List<Long> ids = new ArrayList<>();
-//        if (ObjectUtil.isNotEmpty(json) && ObjectUtil.isNotEmpty(json.getJSONArray("productCombinationList"))) {
-//            JSONArray productCombinationList = json.getJSONArray("productCombinationList");
-//            for (int i = 0; i < productCombinationList.size(); i++) {
-//                JSONObject item = productCombinationList.getJSONObject(i);
-//                ids.add(item.getLong("linkProductId"));
-//            }
-//            if (ObjectUtil.isNotEmpty(ids)) {
-//                List<ProductInfo> productInfoList = this.listByIds(ids);
-//                Map<Long, ProductInfo> productInfoMap = productInfoList.stream().collect(Collectors.toMap(ProductInfo::getId, Function.identity()));
-//                JSONArray jsonArray = new JSONArray();
-//                for (int i = 0; i < productCombinationList.size(); i++) {
-//                    JSONObject item = productCombinationList.getJSONObject(i);
-//                    ProductInfo productInfo1 = productInfoMap.get(item.getLong("linkProductId"));
-//                    if (ObjectUtil.isNotEmpty(productInfo1)) {
-//                        item.put("code", productInfo1.getCode());
-//                        item.put("customCode", productInfo1.getCustomCode());
-//                        item.put("name", productInfo1.getName());
-//                    }
-//                    jsonArray.add(item);
-//                }
-//                json.put("productCombinationList", jsonArray);
-//                result.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
-//            }
-//        }
-//        return result;
-//    }
-
     @DSTransactional
     @Override
     public void add(ProductInfoDto productInfoDto) {
@@ -323,15 +196,6 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     @DSTransactional
     @Override
     public void addByEhsd(ProductInfoDto productInfoDto) {
-        //赋值初始状态
-        ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(productInfoDto.getEhsdJson(), ProductInfoEhsdJson.class);
-        if (ObjectUtil.isEmpty(productInfoEhsdJson.getCustomerId())) {
-            //如果客户id为空就赋值为0 公司产品
-            productInfoEhsdJson.setCustomerId("0");
-            productInfoEhsdJson.setType("1");//默认公司产品
-        }
-        productInfoDto.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson, JSONWriter.Feature.WriteLongAsString));
-
         // 赋值产品编号
         productInfoDto.setCode(CodeEnum.PRODUCT.getCode());
         // 排除名称重复
@@ -354,17 +218,6 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     public ProductInfoVo detailByEhsd(Long id) {
         ProductInfo ProductInfo = this.getById(id);
         ProductInfoVo result = BeanUtil.toBean(ProductInfo, ProductInfoVo.class);
-
-        ProductInfoEhsdJson productInfoEhsdJson = JSONObject.parseObject(result.getEhsdJson(), ProductInfoEhsdJson.class);
-        //判断客户id不为空
-        if (ObjectUtil.isNotEmpty(productInfoEhsdJson) && ObjectUtil.isNotEmpty(productInfoEhsdJson.getCustomerId())) {
-            //赋值客户名称
-            Customer customer = customerService.getById(productInfoEhsdJson.getCustomerId());
-            if (ObjectUtil.isNotEmpty(customer)) {
-                productInfoEhsdJson.setCustomerName(customer.getName());
-                result.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson, JSONWriter.Feature.WriteLongAsString));
-            }
-        }
         //赋值创建人名称
         UserUtil.assignmentNickName(Arrays.asList(result), ProductInfoVo::getCreateUser, ProductInfoVo::setCreateUserName);
         return result;
@@ -405,53 +258,40 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
                 }
                 productInfo.setUnit(unit);
             }
-            ProductInfoEhsdJson productInfoEhsdJson = BeanUtil.copyProperties(productInfoEhsdExcel, ProductInfoEhsdJson.class);
-            productInfoEhsdJson.setType("1");//公司产品
-            productInfoEhsdJson.setCustomerId("0");//客户id为0 公司产品
-            //内外包装方式名称转字典key
-            String innerPackMethod = productInfoEhsdJson.getInnerPackMethod();
-            if (ObjectUtil.isNotEmpty(innerPackMethod)) {
-                String[] split = innerPackMethod.split(",");
-                for (int i = 0; i < split.length; i++) {
-                    String key = innerPackMethodMap.get(split[i]);
-                    if (ObjectUtil.isEmpty(key)) {
-                        throw new ServiceException("未知内包装方式" + split[i]);
-                    }
-                    split[i] = key;
-                }
-                productInfoEhsdJson.setInnerPackMethod(String.join(",", split));
-            }
-            String outerPackMethod = productInfoEhsdJson.getOuterPackMethod();
-            if (ObjectUtil.isNotEmpty(outerPackMethod)) {
-                String[] split = outerPackMethod.split(",");
-                for (int i = 0; i < split.length; i++) {
-                    String key = outsidePackMethodMap.get(split[i]);
-                    if (ObjectUtil.isEmpty(key)) {
-                        throw new ServiceException("未知外包装方式" + split[i]);
-                    }
-                    split[i] = key;
-                }
-                productInfoEhsdJson.setOuterPackMethod(String.join(",", split));
-            }
-            productInfo.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson, JSONWriter.Feature.WriteLongAsString));
+//            ProductInfoEhsdJson productInfoEhsdJson = BeanUtil.copyProperties(productInfoEhsdExcel, ProductInfoEhsdJson.class);
+//            productInfoEhsdJson.setType("1");//公司产品
+//            productInfoEhsdJson.setCustomerId("0");//客户id为0 公司产品
+//            //内外包装方式名称转字典key
+//            String innerPackMethod = productInfoEhsdJson.getInnerPackMethod();
+//            if (ObjectUtil.isNotEmpty(innerPackMethod)) {
+//                String[] split = innerPackMethod.split(",");
+//                for (int i = 0; i < split.length; i++) {
+//                    String key = innerPackMethodMap.get(split[i]);
+//                    if (ObjectUtil.isEmpty(key)) {
+//                        throw new ServiceException("未知内包装方式" + split[i]);
+//                    }
+//                    split[i] = key;
+//                }
+//                productInfoEhsdJson.setInnerPackMethod(String.join(",", split));
+//            }
+//            String outerPackMethod = productInfoEhsdJson.getOuterPackMethod();
+//            if (ObjectUtil.isNotEmpty(outerPackMethod)) {
+//                String[] split = outerPackMethod.split(",");
+//                for (int i = 0; i < split.length; i++) {
+//                    String key = outsidePackMethodMap.get(split[i]);
+//                    if (ObjectUtil.isEmpty(key)) {
+//                        throw new ServiceException("未知外包装方式" + split[i]);
+//                    }
+//                    split[i] = key;
+//                }
+//                productInfoEhsdJson.setOuterPackMethod(String.join(",", split));
+//            }
+//            productInfo.setEhsdJson(JSONObject.toJSONString(productInfoEhsdJson, JSONWriter.Feature.WriteLongAsString));
             productInfoList.add(productInfo);
         }
         saveBatch(productInfoList);
     }
 
-//    @DSTransactional
-//    @Override
-//    public void addByWdly(ProductInfoDto productInfoDto) {
-//        //处理维多利亚扩展
-//        String victoriatouristJson = productInfoDto.getVictoriatouristJson();
-//        if (ObjectUtil.isNotEmpty(victoriatouristJson)) {
-//            JSONObject json = JSONObject.parseObject(victoriatouristJson);
-//            json.put("deptId", SecurityUtils.getDeptId());
-//            productInfoDto.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
-//        }
-//        add(productInfoDto);
-//    }
-
     @DSTransactional
     @Override
     public void edit(ProductInfoDto productInfoDto) {
@@ -515,10 +355,10 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
     @Override
     public void transfer(ProductInfoDto productInfoDto) {
         ProductInfo productInfo = getById(productInfoDto.getId());
-        String victoriatouristJson = productInfo.getVictoriatouristJson();
-        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-        json.put("deptId", productInfoDto.getDeptId());
-        productInfo.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
+//        String victoriatouristJson = productInfo.getVictoriatouristJson();
+//        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
+//        json.put("deptId", productInfoDto.getDeptId());
+//        productInfo.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
         updateById(productInfo);
     }
 
@@ -550,9 +390,9 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         List<ProductInfo> productInfoList = baseMapper.selectList(query);
         Map<String, List<ProductInfo>> productInfoTypeMap = productInfoList.stream().collect(Collectors.groupingBy(ProductInfo::getType));
         //计算新增总计
-        Integer newTotal = productInfoList.stream().map(ProductInfo::getCount).reduce(Integer::sum).orElse(0);
+        Integer newTotal = 0;// productInfoList.stream().map(ProductInfo::getCount).reduce(Integer::sum).orElse(0);
         //总计
-        Integer total = productInfos.stream().map(ProductInfo::getCount).reduce(Integer::sum).orElse(0);
+        Integer total = 0;//productInfos.stream().map(ProductInfo::getCount).reduce(Integer::sum).orElse(0);
 
         map.put("newTotal", newTotal);
         map.put("total", total);
@@ -577,13 +417,13 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             //赋值新增的款数
             List<ProductInfo> productInfoNewList = productInfoTypeMap.get(dictTenantDataVo.getDictKey());
             if (ObjectUtil.isNotEmpty(productInfoNewList)) {
-                map1.put("typeNewTotal", productInfoNewList.get(0).getCount());
+                map1.put("typeNewTotal", 0);//productInfoNewList.get(0).getCount());
             }
 
             //赋值类型总计
             List<ProductInfo> productInfoTotalList = productInfoTotalMap.get(dictTenantDataVo.getDictKey());
             if (ObjectUtil.isNotEmpty(productInfoTotalList)) {
-                map1.put("typeTotal", productInfoTotalList.get(0).getCount());
+                map1.put("typeTotal", 0);//productInfoTotalList.get(0).getCount());
             }
             typeList.add(map1);
         }
@@ -636,7 +476,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
 
             List<ProductInfo> productInfoList = productInfoMap.get(dictTenantDataVo.getDictKey());
             if (ObjectUtil.isNotEmpty(productInfoList)) {
-                map.put("count", productInfoList.get(0).getCount());
+                map.put("count", 0);//productInfoList.get(0).getCount());
             }
             list.add(map);
         }
@@ -746,7 +586,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
         Map<String, List<ProductInfo>> productInfoMap = productInfos.stream().collect(Collectors.groupingBy(ProductInfo::getType));
 
         //计算统计合计
-        Integer amount = productInfos.stream().map(productInfo -> productInfo.getCount()).reduce(Integer::sum).orElse(0);
+        Integer amount = 0;//productInfos.stream().map(productInfo -> productInfo.getCount()).reduce(Integer::sum).orElse(0);
 
         map.put("amount", amount);
         //获取产品类型统计数据
@@ -766,7 +606,7 @@ public class ProductInfoServiceImpl extends ServiceImpl<ProductInfoMapper, Produ
             //赋值
             List<ProductInfo> productInfoList = productInfoMap.get(dictTenantDataVo.getDictKey());
             if (CollectionUtils.isNotEmpty(productInfoList)) {
-                typeMap.put("count", productInfoList.get(0).getCount());
+                typeMap.put("count", 0);//productInfoList.get(0).getCount());
             }
             list.add(typeMap);
 

+ 45 - 47
hx-item/src/main/resources/mapper/product/ProductInfoMapper.xml

@@ -2,38 +2,54 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.item.mapper.product.ProductInfoMapper">
 
+    <sql id="page">
+        SELECT pi.id,
+               pi.definition,
+               pi.product_classify_id,
+               pi.CODE,
+               pi.type,
+               pi.NAME,
+               pi.spec,
+               pi.unit,
+               pi.remark,
+               pi.custom_code,
+               pi.create_user,
+               pi.create_time,
+               pi.update_user,
+               pi.update_time,
+               pi.bar_code,
+               pi.length,
+               pi.width,
+               pi.height,
+               pi.net_weight,
+               pi.technology_id,
+               pi.name_english,
+               pi.technology_id,
+               pi.hs_code,
+               pi.material,
+               pi.frontal_texture,
+               pi.reverse_texture,
+               pi.color_layer,
+               pi.color,
+               pi.stock_threshold,
+               pi.price,
+               pi.currency,
+               pi.cost_price,
+               pi.cost_currency
+        FROM product_info pi
+    </sql>
+
     <select id="getPage" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
-        SELECT
-            pi.id,
-            pi.definition,
-            pi.product_classify_id,
-            pi.CODE,
-            pi.type,
-            pi.NAME,
-            pi.spec,
-            pi.unit,
-            pi.remark,
-            pi.custom_code,
-            pi.create_user,
-            pi.create_time,
-            pi.update_user,
-            pi.update_time,
-            pi.victoriatourist_json,
-            pi.bar_code,
-            IF(DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.growUpDay' ),3,IF( DATEDIFF(now(),pi.create_time)> json_unquote( victoriatourist_json -> '$.newProductsDay' ), 2, 1 )) AS lifeCycle,
-            pi.unit_price,
-            pi.standard_json
-        FROM
-            product_info pi
-            ${ew.customSqlSegment}
+        <include refid="page"/>
+        ${ew.customSqlSegment}
     </select>
 
     <select id="getListByProductIds" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
         SELECT
-            t1.*,
-            t2.`name` AS classifyName
+        t1.*,
+        t2.`name` AS classifyName
         FROM
-            product_info t1
+        product_info t1
         LEFT JOIN product_classify t2 ON t1.product_classify_id = t2.id
         <where>
             <if test="productIds neq null and productIds.size() > 0">
@@ -93,27 +109,9 @@
     </select>
 
     <select id="getCustomerProductList" resultType="com.fjhx.item.entity.product.vo.ProductInfoVo">
-        SELECT pi.id,
-               pi.definition,
-               pi.product_classify_id,
-               pi.CODE,
-               pi.type,
-               pi.NAME,
-               pi.spec,
-               pi.unit,
-               pi.remark,
-               pi.custom_code,
-               pi.create_user,
-               pi.create_time,
-               pi.update_user,
-               pi.update_time,
-               pi.ehsd_json,
-               pi.bar_code,
-               c.`name` customerName
-        FROM product_info pi
-                 LEFT JOIN product_classify pc ON pi.product_classify_id = pc.id
-                 LEFT JOIN customer c ON json_unquote(pi.ehsd_json - > '$.customerId') = c.id
-            ${ew.customSqlSegment}
+        <include refid="page"/>
+        LEFT JOIN product_classify pc ON pi.product_classify_id = pc.id
+        ${ew.customSqlSegment}
     </select>
 
     <select id="statisticsProduct" resultType="java.util.Map">

+ 14 - 66
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java

@@ -2,7 +2,6 @@ package com.fjhx.purchase.service.subscribe.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -128,10 +127,6 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
             s.setProductDefinition(productInfo.getDefinition());
             s.setProductCustomCode(productInfo.getCustomCode());
             s.setProductSpec(productInfo.getSpec());
-
-            String victoriatouristJson = productInfo.getVictoriatouristJson();
-            JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-            s.setDeptId(json.getLong("deptId"));
         }
 
         // 赋值采购数量
@@ -156,48 +151,6 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
         return page;
     }
 
-//    @Override
-//    public Page<SubscribeDetailVo> getPageByWdly(SubscribeDetailSelectDto dto) {
-//        Page<SubscribeDetailVo> page = getPage(dto);
-//        List<SubscribeDetailVo> records = page.getRecords();
-//        if (ObjectUtil.isEmpty(records)) {
-//            return page;
-//        }
-//
-//        //获取到货仓库id列表
-//        List<Long> wids = new ArrayList<>();
-//        for (SubscribeDetailVo subscribeDetailVo : records) {
-//            String victoriatouristJson = subscribeDetailVo.getVictoriatouristJson();
-//            if (ObjectUtil.isNotEmpty(victoriatouristJson)) {
-//                JSONObject json = JSONObject.parseObject(victoriatouristJson);
-//                wids.add(json.getLong("receiptWarehouseId"));
-//            }
-//        }
-//        //赋值到货仓库名称
-//        if (ObjectUtil.isNotEmpty(wids)) {
-//            List<Warehouse> warehouses = warehouseService.listByIds(wids);
-//            Map<Long, String> warehousesMap = warehouses.stream().collect(Collectors.toMap(Warehouse::getId, Warehouse::getName));
-//            for (SubscribeDetailVo subscribeDetailVo : records) {
-//                String victoriatouristJson = subscribeDetailVo.getVictoriatouristJson();
-//                if (ObjectUtil.isNotEmpty(victoriatouristJson)) {
-//                    JSONObject json = JSONObject.parseObject(victoriatouristJson);
-//                    json.put("receiptWarehouseName", warehousesMap.get(json.getLong("receiptWarehouseId")));
-//                    subscribeDetailVo.setVictoriatouristJson(JSONObject.toJSONString(json,JSONWriter.Feature.WriteLongAsString));
-//                }
-//            }
-//        }
-//        //赋值采购数量
-//        for (SubscribeDetailVo record : records) {
-//            List<PurchaseDetail> list = purchaseDetailService.list(q -> q.eq(PurchaseDetail::getSubscribeDetailId, record.getId()));
-//            BigDecimal count = list.stream()
-//                    .map(PurchaseDetail::getCount)
-//                    .reduce(BigDecimal.ZERO, BigDecimal::add);
-//            record.setPurchaseCount(count);
-//        }
-//
-//        return page;
-//    }
-
     /**
      * 根据IDS获取明细
      *
@@ -226,11 +179,6 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
                     s.setProductSpec(p.getSpec());
                     s.setProductCustomCode(p.getCustomCode());
                     s.setProductDefinition(p.getDefinition());
-
-                    //维多利亚赋值部门id
-                    String victoriatouristJson = p.getVictoriatouristJson();
-                    JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-                    s.setDeptId(json.getLong("deptId"));
                 }
             }
         }
@@ -261,7 +209,7 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
         Map<String, Object> map = new HashMap<>();
 
         //存放申购统计详情数据
-        List<Map<String,Object>> list = new ArrayList<>();
+        List<Map<String, Object>> list = new ArrayList<>();
 
         QueryWrapper<Object> query = Wrappers.query();
         query.groupBy("pi.type");
@@ -272,42 +220,42 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
 
         //计算申购笔合计数据
         Integer amount = subscribeDetailVos.stream().map(SubscribeDetailVo::getCounts).reduce(Integer::sum).orElse(0);
-        map.put("amount",amount);
+        map.put("amount", amount);
         //计算申购货品种类合计数据
         Integer typeAmount = subscribeDetailVos.stream().map(SubscribeDetailVo::getTypeCount).reduce(Integer::sum).orElse(0);
-        map.put("typeAmount",typeAmount);
+        map.put("typeAmount", typeAmount);
         //切换数据源
         DynamicDataSourceContextHolder.push(SourceConstant.BASE);
         //获取产品类型字典数据
         List<DictTenantDataVo> dictTenantDataVoList = getDict("product_type");
         DynamicDataSourceContextHolder.poll();
 
-        if (ObjectUtil.isEmpty(dictTenantDataVoList)){
-            throw  new ServiceException("数据有误:产品没有配置产品类型字典,请先添加产品类型字典");
+        if (ObjectUtil.isEmpty(dictTenantDataVoList)) {
+            throw new ServiceException("数据有误:产品没有配置产品类型字典,请先添加产品类型字典");
         }
 
         //赋值笔数、货品种类数据
         for (DictTenantDataVo dictTenantDataVo : dictTenantDataVoList) {
             //设置初始值
-            Map<String,Object> typeMap = new HashMap<>();
-            typeMap.put("type",dictTenantDataVo.getDictValue());
-            typeMap.put("count",0);
-            typeMap.put("typeCount",0);
+            Map<String, Object> typeMap = new HashMap<>();
+            typeMap.put("type", dictTenantDataVo.getDictValue());
+            typeMap.put("count", 0);
+            typeMap.put("typeCount", 0);
 
             //赋值
             List<SubscribeDetailVo> subscribeDetailVoList = subscribeDetailVoMap.get(dictTenantDataVo.getDictKey());
-            if (ObjectUtil.isNotEmpty(subscribeDetailVoList)){
-                typeMap.put("count",subscribeDetailVoList.get(0).getCounts());
-                typeMap.put("typeCount",subscribeDetailVoList.get(0).getTypeCount());
+            if (ObjectUtil.isNotEmpty(subscribeDetailVoList)) {
+                typeMap.put("count", subscribeDetailVoList.get(0).getCounts());
+                typeMap.put("typeCount", subscribeDetailVoList.get(0).getTypeCount());
             }
             list.add(typeMap);
         }
-        map.put("productTypeList",list);
+        map.put("productTypeList", list);
         return map;
     }
 
     //根据字典编码获取字典的数据
-    private List<DictTenantDataVo> getDict(String code){
+    private List<DictTenantDataVo> getDict(String code) {
         DictTenantDataSelectDto dto = new DictTenantDataSelectDto();
         dto.setDictCode(code);
         return dictTenantDataService.getList(dto);

+ 8 - 9
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeServiceImpl.java

@@ -2,7 +2,6 @@ package com.fjhx.purchase.service.subscribe.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.extra.spring.SpringUtil;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -188,21 +187,21 @@ public class SubscribeServiceImpl extends ServiceImpl<SubscribeMapper, Subscribe
         String status = subscribeDetailDto.getStatus();
         if(ObjectUtils.isEmpty(status)){
             list = subscribeDetailService.list();
-        }else {
+        } else {
             String[] split = status.split(",");
             list = subscribeDetailService.list(q -> q.in(SubscribeDetail::getStatus, split));
         }
-        if(ObjectUtils.isEmpty(list)){
+        if (ObjectUtils.isEmpty(list)) {
             return new ArrayList<>();
         }
         List<Long> ids = list.stream().map(SubscribeDetail::getBussinessId).collect(Collectors.toList());
         List<ProductInfo> list1 = productInfoService.listByIds(ids);
-        for (ProductInfo productInfo : list1) {
-            String victoriatouristJson = productInfo.getVictoriatouristJson();
-            JSONObject json = ObjectUtils.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-            Long deptId = json.getLong("deptId");
-            deptIds.add(deptId);
-        }
+//        for (ProductInfo productInfo : list1) {
+//            String victoriatouristJson = productInfo.getVictoriatouristJson();
+//            JSONObject json = ObjectUtils.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
+//            Long deptId = json.getLong("deptId");
+//            deptIds.add(deptId);
+//        }
         if (ObjectUtils.isEmpty(deptIds)) {
             return new ArrayList<>();
         }

+ 7 - 8
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractServiceImpl.java

@@ -43,7 +43,6 @@ import com.fjhx.item.entity.product.bo.ProductAnalysisBo;
 import com.fjhx.item.entity.product.dto.ProductInfoDto;
 import com.fjhx.item.entity.product.dto.ProductInfoSelectDto;
 import com.fjhx.item.entity.product.po.ProductInfo;
-import com.fjhx.item.entity.product.po.ProductInfoEhsdJson;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
 import com.fjhx.purchase.entity.pay.po.Pay;
@@ -2620,17 +2619,17 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract>
         //处理输出数据
         Map<Long, Map<String, Object>> reData = new HashMap<>();
         for (ProductInfo productInfo : list) {
-            ProductInfoEhsdJson ehsdJson = JSONObject.parseObject(productInfo.getEhsdJson(), ProductInfoEhsdJson.class);
+//            ProductInfoEhsdJson ehsdJson = JSONObject.parseObject(productInfo.getEhsdJson(), ProductInfoEhsdJson.class);
 
             Long productInfoId = productInfo.getId();
 
             Map<String, Object> data = new HashMap<>();
-            //销售指导价和币种
-            data.put("price", ehsdJson.getPrice());
-            data.put("currency", ehsdJson.getCurrency());
-            //成本价和币种
-            data.put("costPrice", ehsdJson.getCostPrice());
-            data.put("costCurrency", ehsdJson.getCostCurrency());
+//            //销售指导价和币种
+//            data.put("price", ehsdJson.getPrice());
+//            data.put("currency", ehsdJson.getCurrency());
+//            //成本价和币种
+//            data.put("costPrice", ehsdJson.getCostPrice());
+//            data.put("costCurrency", ehsdJson.getCostCurrency());
             //销售给指定客户近3条产品价格
             data.put("customerContractProductList", customerContractProductMap.getOrDefault(productInfoId, new ArrayList<>()));
             //该产品近20条销售价格

+ 4 - 5
hx-sale/src/main/java/com/fjhx/sale/service/sample/impl/SampleServiceImpl.java

@@ -2,7 +2,6 @@ package com.fjhx.sale.service.sample.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -551,10 +550,10 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
             if (ObjectUtil.isNotEmpty(productInfo)) {
                 productIndo.setProductRemark(productInfo.getRemark());
                 productIndo.setProductSpec(productInfo.getSpec());
-                JSONObject ehsdJson = JSONObject.parseObject(productInfo.getEhsdJson());
-                if (ObjectUtil.isNotEmpty(ehsdJson)) {
-                    productIndo.setPackMethod(ehsdJson.getString("packMethod"));
-                }
+//                JSONObject ehsdJson = JSONObject.parseObject(productInfo.getEhsdJson());
+//                if (ObjectUtil.isNotEmpty(ehsdJson)) {
+//                    productIndo.setPackMethod(ehsdJson.getString("packMethod"));
+//                }
             }
 
             return productIndo;

+ 1 - 1
pom.xml

@@ -51,7 +51,7 @@
             <dependency>
                 <groupId>com.fjhx</groupId>
                 <artifactId>hx-base</artifactId>
-                <version>1.0.2</version>
+                <version>1.0.3</version>
             </dependency>
             <dependency>
                 <groupId>com.fjhx</groupId>