ccjgmwz %!s(int64=3) %!d(string=hai) anos
pai
achega
0e3d42f917

+ 8 - 74
sendGoodNotPlat.xml

@@ -1,86 +1,20 @@
 <?xml version="1.0" encoding="GBK"?>
 <request>
     <functionID>dangdang.order.goods.send</functionID>
-    <time>2022-06-09 08:24:33</time>
+    <time>2022-06-17 16:00:45</time>
     <OrdersList>
         <OrderInfo>
-            <orderID>44815686208</orderID>
-            <logisticsName>Բͨ¿ìµÝ</logisticsName>
-            <logisticsNameAb>YTO</logisticsNameAb>
-            <logisticsTel>95554</logisticsTel>
-            <logisticsOrderID>YT6529355800045</logisticsOrderID>
+            <orderID>44885548604</orderID>
+            <logisticsName>¼«ÍÃËÙµÝ</logisticsName>
+            <logisticsNameAb>JT</logisticsNameAb>
+            <logisticsTel>400-820-1666</logisticsTel>
+            <logisticsOrderID>JT3005412176967</logisticsOrderID>
             <SendGoodsList>
                 <ItemInfo>
-                    <itemID>11081647279</itemID>
+                    <itemID>11070579096</itemID>
                     <sendGoodsCount>1</sendGoodsCount>
                     <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208001</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11073236999</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208002</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11073650089</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208003</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11071482799</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208004</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11073061929</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208005</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11074425359</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208006</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11069540229</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208007</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11074400579</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208008</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11072932369</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208009</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11073993839</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208010</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11069586469</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208011</productItemId>
-                </ItemInfo>
-                <ItemInfo>
-                    <itemID>11074231639</itemID>
-                    <sendGoodsCount>1</sendGoodsCount>
-                    <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44815686208012</productItemId>
+                    <productItemId>44885548604001</productItemId>
                 </ItemInfo>
             </SendGoodsList>
         </OrderInfo>

+ 7 - 1
unimall-admin-api/pom.xml

@@ -85,7 +85,13 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter</artifactId>
 		</dependency>
-
+		<dependency>
+			<groupId>com.baidu.contact-center</groupId>
+			<artifactId>cf-auth-api-token</artifactId>
+			<version>5.1.5-SNAPSHOT</version>
+			<scope>system</scope>
+			<systemPath>${project.basedir}/src/main/lib/cf-auth-api-token-5.1.5-SNAPSHOT-jar-with-dependencies.jar</systemPath>
+		</dependency>
 		<dependency>
 			<groupId>org.projectlombok</groupId>
 			<artifactId>lombok</artifactId>

+ 91 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/AuthService.java

@@ -0,0 +1,91 @@
+package com.iotechn.unimall.admin;
+
+/**
+ * @Author:chengchangjiang
+ * @Description:
+ * @Date:Created in 15:59 2022-06-17
+ */
+
+
+import org.json.JSONObject;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 获取token类
+ */
+public class AuthService {
+
+    /**
+     * 获取权限token
+     * @return 返回示例:
+     * {
+     * "access_token": "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567",
+     * "expires_in": 2592000
+     * }
+     */
+    public static String getAuth() {
+        // 官网获取的 API Key 更新为你注册的
+        String clientId = "346da55bb3c248ea84e39b5913939f05";
+        // 官网获取的 Secret Key 更新为你注册的
+        String clientSecret = "0628356ece284d87935f73017af1c0ce";
+        return getAuth(clientId, clientSecret);
+    }
+
+    /**
+     * 获取API访问token
+     * 该token有一定的有效期,需要自行管理,当失效时需重新获取.
+     * @param ak - 百度云官网获取的 API Key
+     * @param sk - 百度云官网获取的 Securet Key
+     * @return assess_token 示例:
+     * "24.460da4889caad24cccdb1fea17221975.2592000.1491995545.282335-1234567"
+     */
+    public static String getAuth(String ak, String sk) {
+        // 获取token地址
+        String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
+        String getAccessTokenUrl = authHost
+                // 1. grant_type为固定参数
+                + "grant_type=client_credentials"
+                // 2. 官网获取的 API Key
+                + "&client_id=" + ak
+                // 3. 官网获取的 Secret Key
+                + "&client_secret=" + sk;
+        try {
+            URL realUrl = new URL(getAccessTokenUrl);
+            // 打开和URL之间的连接
+            HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();
+            connection.setRequestMethod("GET");
+            connection.connect();
+            // 获取所有响应头字段
+            Map<String, List<String>> map = connection.getHeaderFields();
+            // 遍历所有的响应头字段
+            for (String key : map.keySet()) {
+                System.out.println(key + "--->" + map.get(key));
+            }
+            // 定义 BufferedReader输入流来读取URL的响应
+            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            String result = "";
+            String line;
+            while ((line = in.readLine()) != null) {
+                result += line;
+            }
+            /**
+             * 返回结果示例
+             */
+            System.out.println("result:" + result);
+            JSONObject jsonObject = new JSONObject(result);
+            String access_token = jsonObject.getString("access_token");
+            return access_token;
+        } catch (Exception e) {
+            System.err.printf("获取token失败!");
+            e.printStackTrace(System.err);
+        }
+        return null;
+    }
+
+}

+ 2 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/shop/IShopOrderService.java

@@ -93,5 +93,7 @@ public interface IShopOrderService {
             @NotNull @HttpParam(name = "orderId", type = HttpParamType.COMMON, description = "夫子订单编号") String orderId,
             @NotNull @HttpParam(name = "dangId", type = HttpParamType.COMMON, description = "当当店铺id") String dangId,
             @NotNull @HttpParam(name = "dangOrder", type = HttpParamType.COMMON, description = "当当订单编号") String dangOrder) throws Exception;
+    @HttpMethod(description = "百度智能外呼调用")
+    public ShopOrder callPhone(@NotNull @HttpParam(name = "mobile", type = HttpParamType.COMMON, description = "电话") String mobile) throws Exception;
 
 }

+ 120 - 67
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/shop/impl/ShopOrderServiceImpl.java

@@ -3,6 +3,8 @@ package com.iotechn.unimall.admin.api.shop.impl;
 import java.io.*;
 import java.text.SimpleDateFormat;
 import java.util.*;
+
+import com.baidu.ccc.auth.api.token.ApiTokenV1;
 import com.dangdang.openplatform.openapi.sdk.ApiException;
 import com.dangdang.openplatform.openapi.sdk.SdkClient;
 import com.dangdang.openplatform.openapi.sdk.internal.util.FileItem;
@@ -16,7 +18,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.iotechn.unimall.data.domain.shop.ShopAccount;
 import com.iotechn.unimall.data.domain.shop.ShopLog;
 import com.iotechn.unimall.data.domain.shop.ShopTran;
-import com.iotechn.unimall.data.dto.shop.FuziDTO;
 import com.iotechn.unimall.data.dto.shop.ShopDTO;
 import com.iotechn.unimall.data.dto.shop.XmlObject.OrderDetail;
 import com.iotechn.unimall.data.dto.shop.XmlObject.SendGood;
@@ -25,14 +26,9 @@ import com.iotechn.unimall.data.mapper.shop.ShopAccountMapper;
 import com.iotechn.unimall.data.mapper.shop.ShopLogMapper;
 import com.iotechn.unimall.data.mapper.shop.ShopTranMapper;
 import com.iotechn.unimall.data.util.XMLUtil;
-import org.apache.commons.httpclient.Cookie;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.NameValuePair;
-import org.apache.commons.httpclient.cookie.CookiePolicy;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
+import org.apache.http.client.HttpClient;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
 import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
@@ -90,15 +86,15 @@ public class ShopOrderServiceImpl implements IShopOrderService {
     }
 
     @Override
-    public Page<ShopOrder> list(Long accountId, String orderId, String dangOrder,String dangOrderStatus, String address, String provName, String cityName, String areaName, String orderStatus, String orderStatusName, String payStatus, String payName, String receiverName, String mobile, String receiver, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId,String shopName, Integer page, Integer limit) throws ServiceException {
+    public Page<ShopOrder> list(Long accountId, String orderId, String dangOrder, String dangOrderStatus, String address, String provName, String cityName, String areaName, String orderStatus, String orderStatusName, String payStatus, String payName, String receiverName, String mobile, String receiver, Integer deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, String shopName, Integer page, Integer limit) throws ServiceException {
         Wrapper<ShopOrder> wrapper = new EntityWrapper<ShopOrder>();
         List<Long> param = new ArrayList<>();
-        if(!StringUtils.isEmpty(shopName)){
+        if (!StringUtils.isEmpty(shopName)) {
             Wrapper<ShopAccount> wrapper1 = new EntityWrapper<ShopAccount>();
-            wrapper1.like("dang_name",shopName);
+            wrapper1.like("dang_name", shopName);
             List<ShopAccount> list = shopAccountMapper.selectList(wrapper1);
-            for (ShopAccount shopAccount:list
-                 ) {
+            for (ShopAccount shopAccount : list
+            ) {
                 param.add(shopAccount.getId());
             }
             wrapper.in("account_id", param);
@@ -161,10 +157,10 @@ public class ShopOrderServiceImpl implements IShopOrderService {
             wrapper.like("dang_order_status", dangOrderStatus);
         }
         wrapper.eq("delete_flag", 0);
-        wrapper.orderBy("created_time",false);
+        wrapper.orderBy("created_time", false);
         List<ShopOrder> list = shopOrderMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
-        for (ShopOrder shopOrder: list
-             ) {
+        for (ShopOrder shopOrder : list
+        ) {
             ShopAccount shopAccount = shopAccountMapper.selectById(shopOrder.getAccountId());
             shopOrder.setShopAccount(shopAccount);
         }
@@ -266,65 +262,63 @@ public class ShopOrderServiceImpl implements IShopOrderService {
 
     @Override
     public String syncOrderInfoList(ShopDTO shopDTO) throws Exception {
-        for (ShopDTO tmp:shopDTO.getShopDTOS()
-             ) {
-            syncOrderInfo(tmp.getOrderId(),tmp.getDangId(),tmp.getDangOrder());
+        for (ShopDTO tmp : shopDTO.getShopDTOS()
+        ) {
+            syncOrderInfo(tmp.getOrderId(), tmp.getDangId(), tmp.getDangOrder());
         }
         return "ok";
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public ShopOrder syncOrderInfo(String orderId,String dangId,String dangOrder) throws Exception {
-        try{
+    public ShopOrder syncOrderInfo(String orderId, String dangId, String dangOrder) throws Exception {
+        try {
 
             ShopAccount shopAccount = new ShopAccount();
-            if(dangId != null){
+            if (dangId != null) {
                 shopAccount.setDangId(dangId);
             }
-    //        if(fuziId != null){
-    //            shopAccount.setFuziId(fuziId);
-    //        }
+            //        if(fuziId != null){
+            //            shopAccount.setFuziId(fuziId);
+            //        }
             shopAccount = shopAccountMapper.selectOne(shopAccount);
             flushCookie(shopAccount);
             CloseableHttpClient httpClient = HttpClientBuilder.create().build();
-            HttpGet get = new HttpGet("https://shop.kongfz.com/buyer/order/getOrderInfo/?orderId="+orderId);
+            HttpGet get = new HttpGet("https://shop.kongfz.com/buyer/order/getOrderInfo/?orderId=" + orderId);
             //这里可以设置请求参数,token等
             get.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36");
-            get.addHeader("cookie",shopAccount.getFuziCookie());
+            get.addHeader("cookie", shopAccount.getFuziCookie());
             HttpResponse response = httpClient.execute(get);//执行获取响应
-            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK){//根据状态码处理
+            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {//根据状态码处理
                 //返回字符串
-                String res = unicodeToString(EntityUtils.toString(response.getEntity(),"UTF-8"));
+                String res = unicodeToString(EntityUtils.toString(response.getEntity(), "UTF-8"));
                 System.out.println(res);
                 JSONObject datas = JSONObject.parseObject(res);//转换成JSON格式
                 Boolean status = (Boolean) datas.get("status");//获取返回数据状态,get获取的字段需要根据提供的返回值去获取
-                ShopOrder data = JSONObject.parseObject(datas.get("data").toString(),ShopOrder.class);//"data"是根据返回值设定
+                ShopOrder data = JSONObject.parseObject(datas.get("data").toString(), ShopOrder.class);//"data"是根据返回值设定
                 ShopOrder tmp = new ShopOrder();
                 tmp.setOrderId(data.getOrderId());
                 tmp = shopOrderMapper.selectOne(tmp);
                 data.setAccountId(shopAccount.getId());
-                if(tmp == null){
+                if (tmp == null) {
                     data.setDangOrder(dangOrder);
                     data.setGmtCreate(new Date());
                     data.setGmtUpdate(new Date());
                     shopOrderMapper.insert(data);
-                }
-                else{
+                } else {
                     data.setDangOrder(dangOrder);
                     data.setGmtUpdate(new Date());
-                    shopOrderMapper.update(data,new EntityWrapper<ShopOrder>().eq("order_id",tmp.getOrderId()));
+                    shopOrderMapper.update(data, new EntityWrapper<ShopOrder>().eq("order_id", tmp.getOrderId()));
                 }
                 tmp = new ShopOrder();
                 tmp.setOrderId(data.getOrderId());
                 tmp = shopOrderMapper.selectOne(tmp);
-                if(tmp.getOrderStatusName().equals("卖家已发货")&&tmp.getDangOrderStatus().equals("未发货")){
+                if (tmp.getOrderStatusName().equals("卖家已发货") && tmp.getDangOrderStatus().equals("未发货")) {
                     //调用当当API 更新发货状态
-                    dangOrderDeal(shopAccount,tmp);
+                    dangOrderDeal(shopAccount, tmp);
                 }
                 return tmp;
-            }
-            else{
+            } else {
                 return null;
             }
 
@@ -339,40 +333,100 @@ public class ShopOrderServiceImpl implements IShopOrderService {
         }
 
     }
-    public void flushCookie(ShopAccount shopAccount){
-        try{
+
+    @Override
+    public ShopOrder callPhone(String mobile) throws Exception {
+
+        ApiTokenV1.ApiAuthTokenV1Builder builder = new ApiTokenV1.ApiAuthTokenV1Builder();
+        // 必填参数 ak,sk,uri,host,http method, 过期时间
+        builder.ak("346da55bb3c248ea84e39b5913939f05");   // ak
+        builder.sk("0628356ece284d87935f73017af1c0ce");   // sk
+        builder.uri("/api/v3/console/realtime/status/create");                // 接口路径
+        builder.host("aicc.bce.baidu.com");               // host
+        builder.httpMethod("POST");                        // http method
+        builder.expireInSeconds(1800);                    // 过期时间
+
+        // 以下是非必须参数
+        // 参与生成token的请求头, 此处若使用了x-bce-date,则调用外呼api接口时,请求头内必需带上x-bce-date
+//        HashMap<String, String> headerMap = new HashMap<String, String>();
+//        headerMap.put("x-bce-date", "2022-06-17T08:40:14Z");
+//        builder.httpHeaderMap(headerMap);
+        builder.httpHeader("Content-Type", "application/json");
+        builder.httpHeader("Authorization", builder.build().getToken());
+        // url里?带的参数,如/api/v1/robot/list?robotName=test, 没有?参数可以不调用此方法
+        builder.queryStr("robotId=b304c245-ec71-40ef-b7b8-c94e6874e8ed&mobile="+mobile+"&secretType=2");
+
+        System.out.println(builder.build().getToken());
+        String token = builder.build().getToken();
+        System.out.println("token=" + token);
+        // 登陆 Url
+        String loginUrl = "https://aicc.bce.baidu.com/api/v3/console/realtime/status/create";
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
+        HttpPost httpPost = new HttpPost(loginUrl);
+        // 装填参数
+        List<BasicNameValuePair> nvps = new ArrayList<BasicNameValuePair>();
+        nvps.add(new BasicNameValuePair("robotId", "b304c245-ec71-40ef-b7b8-c94e6874e8ed"));
+        nvps.add(new BasicNameValuePair("mobile", mobile));
+        nvps.add(new BasicNameValuePair("secretType", "2"));
+        // 设置参数到请求对象中
+        httpPost.setEntity(new UrlEncodedFormEntity(nvps, "UTF-8"));
+
+        // 设置header信息
+        // 指定报文头【Content-type】、【User-Agent】
+        httpPost.setHeader("Content-type", "application/json");
+        httpPost.setHeader("Authorization", token);
+        httpPost.setHeader("x-bce-date", "2022-06-17T08:40:14Z");
+
+        // 执行请求操作,并拿到结果(同步阻塞)
+        CloseableHttpResponse response = httpClient.execute(httpPost);
+        try {
+            if (response.getStatusLine().getStatusCode() == 302) {
+            }
+            System.out.println(EntityUtils.toString(response.getEntity(), "UTF-8"));
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            // 释放链接
+            response.close();
+            httpClient.close();
+        }
+
+        return null;
+    }
+
+    public void flushCookie(ShopAccount shopAccount) {
+        try {
             CloseableHttpClient httpClient = HttpClientBuilder.create().build();
             HttpGet getMethod = new HttpGet("https://shop.kongfz.com/buyer/order/index/?pageCurr=1&pageShow=30");
             getMethod.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36");
-            getMethod.addHeader("cookie",shopAccount.getFuziCookie());
+            getMethod.addHeader("cookie", shopAccount.getFuziCookie());
 
             httpClient.execute(getMethod);
             CloseableHttpResponse response = httpClient.execute(getMethod);//执行获取响应
-            try{
+            try {
                 if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {//根据状态码处理
-                    String strTmp= EntityUtils.toString(response.getEntity(),"UTF-8");
+                    String strTmp = EntityUtils.toString(response.getEntity(), "UTF-8");
                     //返回字符串
                     String res = unicodeToString(strTmp);
                     JSONObject datas = JSONObject.parseObject(res);//转换成JSON格式
                     Boolean status = (Boolean) datas.get("status");//获取返回数据状态,get获取的字段需要根据提供的返回值去获取
-                    if(status){
+                    if (status) {
                         return;
                     }
                 }
-            }
-            catch (Exception exception){
+            } catch (Exception exception) {
 
-            }
-            finally {
+            } finally {
                 response.close();
                 httpClient.close();
             }
 
-            System.out.println("原cookies = "+shopAccount.getFuziCookie());
+            System.out.println("原cookies = " + shopAccount.getFuziCookie());
 
             // 登陆 Url
             String loginUrl = "https://login.kongfz.com/Pc/Login/account";
-            BasicCookieStore store= new BasicCookieStore();
+            BasicCookieStore store = new BasicCookieStore();
             httpClient = HttpClients.custom().setDefaultCookieStore(store).build();
             // 模拟登陆,按实际服务器端要求选用 Post 或 Get 请求方式
             HttpPost httpPost = new HttpPost(loginUrl);
@@ -390,13 +444,13 @@ public class ShopOrderServiceImpl implements IShopOrderService {
 
             // 执行请求操作,并拿到结果(同步阻塞)
             response = httpClient.execute(httpPost);
-            if(response.getStatusLine().getStatusCode() == 302){
+            if (response.getStatusLine().getStatusCode() == 302) {
                 List<org.apache.http.cookie.Cookie> cookielist = store.getCookies();
                 String nCookie = "";
-                for(org.apache.http.cookie.Cookie cookie: cookielist){
-                    String name=cookie.getName();
-                    String value=cookie.getValue();
-                    nCookie += name + "="+value+";";
+                for (org.apache.http.cookie.Cookie cookie : cookielist) {
+                    String name = cookie.getName();
+                    String value = cookie.getValue();
+                    nCookie += name + "=" + value + ";";
                 }
                 System.out.println("nCookie:" + nCookie);
                 shopAccount.setFuziCookie(nCookie);
@@ -405,19 +459,19 @@ public class ShopOrderServiceImpl implements IShopOrderService {
             // 释放链接
             response.close();
 
-        }catch (Exception e) {
+        } catch (Exception e) {
             e.printStackTrace();
         }
 
     }
 
-    public void dangOrderDeal(ShopAccount shopAccount,ShopOrder shopOrder) throws Exception {
+    public void dangOrderDeal(ShopAccount shopAccount, ShopOrder shopOrder) throws Exception {
         /**
          * 获取一下店铺的所有静态参数
          */
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
-        SdkClient sdkClient = new SdkClient(shopAccount.getDangAppKey(),shopAccount.getDangAppSecret(),shopAccount.getDangSession(),shopAccount.getDangVersion());
+        SdkClient sdkClient = new SdkClient(shopAccount.getDangAppKey(), shopAccount.getDangAppSecret(), shopAccount.getDangSession(), shopAccount.getDangVersion());
 
         OrderDetailsGetRequest ss = new OrderDetailsGetRequest();
         OrderDetailsGet orderDetailsGet = new OrderDetailsGet();
@@ -444,8 +498,8 @@ public class ShopOrderServiceImpl implements IShopOrderService {
         } catch (ApiException e) {
             e.printStackTrace();
         }
-        SdkClient jiemi = new SdkClient(shopAccount.getDangAppKey(),shopAccount.getDangAppSecret(),shopAccount.getDangSession(),shopAccount.getDangVersion());
-        OrdersContentDecryptRequest ordersContentDecryptRequest=new OrdersContentDecryptRequest();
+        SdkClient jiemi = new SdkClient(shopAccount.getDangAppKey(), shopAccount.getDangAppSecret(), shopAccount.getDangSession(), shopAccount.getDangVersion());
+        OrdersContentDecryptRequest ordersContentDecryptRequest = new OrdersContentDecryptRequest();
 
         List<EncryptDTO> encryptVOS = new ArrayList<EncryptDTO>();
 
@@ -457,7 +511,7 @@ public class ShopOrderServiceImpl implements IShopOrderService {
         ordersContentDecryptRequest.setO_cryptStr(JSON.toJSONString(encryptVOS));
         OrdersContentDecryptResponse ordersContentDecryptResponse = null;
         try {
-            ordersContentDecryptResponse=jiemi.excute(ordersContentDecryptRequest);
+            ordersContentDecryptResponse = jiemi.excute(ordersContentDecryptRequest);
         } catch (ApiException e) {
             e.printStackTrace();
         }
@@ -465,7 +519,6 @@ public class ShopOrderServiceImpl implements IShopOrderService {
         CryptUserInfo cryptUserInfo = data.get(0).getCryptUserInfo();
 
 
-
         OrderDetail o = (OrderDetail) XMLUtil.convertXmlStrToObject(OrderDetail.class, odgrp.getBody());
         SendGoodsInfo sgi = new SendGoodsInfo();
         sgi.setConsigneeAddr(cryptUserInfo.getConsigneeAddr());
@@ -491,9 +544,9 @@ public class ShopOrderServiceImpl implements IShopOrderService {
          * 组成OrderInfo
          */
         Wrapper wrapper = new EntityWrapper();
-        wrapper.like("fuzi_name",shopOrder.getShippingComName());
+        wrapper.like("fuzi_name", shopOrder.getShippingComName());
         List<ShopTran> list = shopTranMapper.selectList(wrapper);
-        if(list.size() == 0 ){
+        if (list.size() == 0) {
             throw new Exception("物流公司不存在");
         }
         HashMap<String, Object> stringObjectHashMap = new HashMap<>();
@@ -536,16 +589,16 @@ public class ShopOrderServiceImpl implements IShopOrderService {
             e.printStackTrace();
         }
         System.out.println(result.toString());
-        if(result.getResult().getOrdersList().get(0).getOrderOperCode() == 0){
+        if (result.getResult().getOrdersList().get(0).getOrderOperCode() == 0) {
             shopOrder.setDangOrderStatus("已发货");
-            shopOrderMapper.update(shopOrder,new EntityWrapper<ShopOrder>().eq("order_id",shopOrder.getOrderId()));
+            shopOrderMapper.update(shopOrder, new EntityWrapper<ShopOrder>().eq("order_id", shopOrder.getOrderId()));
         }
     }
+
     /**
      * Unicode转 汉字字符串
      *
-     * @param str
-     *            \u6728
+     * @param str \u6728
      * @return '木' 26408
      */
     public static String unicodeToString(String str) {

BIN=BIN
unimall-admin-api/src/main/lib/cf-auth-api-token-5.1.5-SNAPSHOT-jar-with-dependencies.jar


+ 1 - 0
unimall-launcher/pom.xml

@@ -73,6 +73,7 @@
 		<dependency>
 			<groupId>org.projectlombok</groupId>
 			<artifactId>lombok</artifactId>
+			<version>1.18.4</version>
 			<scope>provided</scope>
 		</dependency>
 

+ 5 - 5
unimall-launcher/src/main/resources/application.properties

@@ -1,4 +1,4 @@
-server.port=8081
+server.port=8181
 
 logging.path=/Users/dyl/Desktop/jialebao/logs
 logging.file=unimall.log
@@ -8,9 +8,9 @@ logging.level.root=info
 ###MySql (MySqlConfiguration)
 ########################################################
 spring.druid.driverClassName=com.mysql.jdbc.Driver
-spring.druid.url=jdbc:mysql://101.227.51.94/shop?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&useSSL=false
-spring.druid.username=aye
-spring.druid.password=387545
+spring.druid.url=jdbc:mysql://106.14.75.12/shop?createDatabaseIfNotExist=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true&useSSL=false
+spring.druid.username=root
+spring.druid.password=Ccj841968545
 spring.druid.maxActive=30
 spring.druid.minIdle=5
 spring.druid.maxWait=10000
@@ -115,7 +115,7 @@ com.iotechn.ship.query.kdn.business-id=db73dd78-990f-4fc8-ae18-83d0dacf7556
 #机器编号
 com.iotechn.unimall.machine-no=01
 #运行环境 1.开发环境 2.测试环境 3.生产环境 一定要记得改环境
-com.iotechn.unimall.env=1
+com.iotechn.unimall.env=3
 
 #自定义配置信息
 # 名称