ccjgmwz před 3 roky
rodič
revize
02fab0db08

+ 8 - 8
sendGoodNotPlat.xml

@@ -1,20 +1,20 @@
 <?xml version="1.0" encoding="GBK"?>
 <request>
     <functionID>dangdang.order.goods.send</functionID>
-    <time>2022-06-08 11:42:33</time>
+    <time>2022-06-08 12:25:17</time>
     <OrdersList>
         <OrderInfo>
-            <orderID>44843106768</orderID>
-            <logisticsName>°ŮĘŔťăͨżěľÝ</logisticsName>
-            <logisticsNameAb>BEST</logisticsNameAb>
-            <logisticsTel>400-956-5656</logisticsTel>
-            <logisticsOrderID>JT3004612839432</logisticsOrderID>
+            <orderID>44841261853</orderID>
+            <logisticsName>ÔĎ´ďżěľÝ</logisticsName>
+            <logisticsNameAb>YUNDA</logisticsNameAb>
+            <logisticsTel>400-821-6789</logisticsTel>
+            <logisticsOrderID>312138981110329</logisticsOrderID>
             <SendGoodsList>
                 <ItemInfo>
-                    <itemID>11071546579</itemID>
+                    <itemID>11097181474</itemID>
                     <sendGoodsCount>1</sendGoodsCount>
                     <belongProductsPromoID></belongProductsPromoID>
-                    <productItemId>44843106768001</productItemId>
+                    <productItemId>44841261853001</productItemId>
                 </ItemInfo>
             </SendGoodsList>
         </OrderInfo>

+ 97 - 95
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/shop/impl/ShopLogServiceImpl.java

@@ -15,112 +15,114 @@ import com.iotechn.unimall.data.mapper.shop.ShopLogMapper;
 import com.iotechn.unimall.data.domain.shop.ShopLog;
 import com.iotechn.unimall.admin.api.shop.IShopLogService;
 import com.iotechn.unimall.data.model.Page;
+
 import java.util.Date;
+
 import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 同步日志Service业务层处理
- * 
+ *
  * @author jlb
  * @date 2022-06-08
  */
 @Service
-public class ShopLogServiceImpl implements IShopLogService{
-	@Autowired
-	private ShopLogMapper shopLogMapper;
-	
-	@Override
-	public Boolean add(ShopLog shopLog,Long adminId) throws ServiceException {
-		Date now = new Date();
-		shopLog.setGmtCreate(now);
-		shopLog.setGmtUpdate(now);
-		shopLog.setAdminId(adminId);
-		return shopLogMapper.insert(shopLog)>0;
-	}
+public class ShopLogServiceImpl implements IShopLogService {
+    @Autowired
+    private ShopLogMapper shopLogMapper;
+
+    @Override
+    public Boolean add(ShopLog shopLog, Long adminId) throws ServiceException {
+        Date now = new Date();
+        shopLog.setGmtCreate(now);
+        shopLog.setGmtUpdate(now);
+        shopLog.setAdminId(adminId);
+        return shopLogMapper.insert(shopLog) > 0;
+    }
+
+    @Override
+    public Page<ShopLog> list(String title, String content, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<ShopLog> wrapper = new EntityWrapper<ShopLog>();
+        if (!StringUtils.isEmpty(title)) {
+            wrapper.like("title", title);
+        }
+        if (!StringUtils.isEmpty(content)) {
+            wrapper.like("content", content);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        wrapper.eq("delete_flag", 0);
+        List<ShopLog> list = shopLogMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+        Integer count = shopLogMapper.selectCount(wrapper);
+        return new Page<ShopLog>(list, page, limit, count);
+    }
 
-	@Override
-	public Page<ShopLog> list(String title,String content,Long deleteFlag,Date gmtCreate,Date gmtUpdate,Long userId,Long adminId, Integer page, Integer limit)throws ServiceException {
-		Wrapper<ShopLog> wrapper = new EntityWrapper<ShopLog>();
-														if (!StringUtils.isEmpty(title)) {
-					wrapper.eq("title", title);
-				}
-												if (!StringUtils.isEmpty(content)) {
-					wrapper.eq("content", content);
-				}
-																	if (!StringUtils.isEmpty(deleteFlag)) {
-					wrapper.eq("delete_flag", deleteFlag);
-				}
-												if (!StringUtils.isEmpty(gmtCreate)) {
-					wrapper.eq("gmt_create", gmtCreate);
-				}
-												if (!StringUtils.isEmpty(gmtUpdate)) {
-					wrapper.eq("gmt_update", gmtUpdate);
-				}
-												if (!StringUtils.isEmpty(userId)) {
-					wrapper.eq("user_id", userId);
-				}
-												if (!StringUtils.isEmpty(adminId)) {
-					wrapper.eq("admin_id", adminId);
-				}
-							wrapper.eq("delete_flag", 0);
-		List<ShopLog> list = shopLogMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
-		Integer count = shopLogMapper.selectCount(wrapper);
-		return new Page<ShopLog>(list, page, limit, count);
-	}
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(Long id) {
+        String[] ids = String.valueOf(id).split(",");
+        for (String tt : ids) {
+            ShopLog tmp = shopLogMapper.selectById(Long.parseLong(tt));
+            if (tmp != null) {
+                tmp.setDeleteFlag(1);
+                shopLogMapper.updateById(tmp);
+            }
+        }
+        return true;
+    }
 
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public Boolean delete(Long id) {
-		String[] ids = String.valueOf(id).split(",");
-		for (String tt:ids) {
-			ShopLog tmp =  shopLogMapper.selectById(Long.parseLong(tt));
-			if(tmp != null){
-				tmp.setDeleteFlag(1);
-				shopLogMapper.updateById(tmp);
-			}
-		}
-		return true;
-	}
+    @Override
+    public Boolean update(ShopLog shopLog, Long adminId) throws ServiceException {
+        Date now = new Date();
+        shopLog.setGmtUpdate(now);
+        shopLog.setAdminId(adminId);
+        return shopLogMapper.updateById(shopLog) > 0;
+    }
 
-	@Override
-	public Boolean update(ShopLog shopLog,Long adminId) throws ServiceException {
-		Date now = new Date();
-		shopLog.setGmtUpdate(now);
-		shopLog.setAdminId(adminId);
-		return shopLogMapper.updateById(shopLog)>0;
-	}
+    @Override
+    public ShopLog get(Long id) throws ServiceException {
+        return shopLogMapper.selectById(id);
+    }
 
-	@Override
-	public ShopLog get(Long id) throws ServiceException {
-		return shopLogMapper.selectById(id);
-	}
-	
-	@Override
-	public String export(String title,String content,Long deleteFlag,Date gmtCreate,Date gmtUpdate,Long userId,Long adminId, Integer page, Integer limit)throws ServiceException {
-		Wrapper<ShopLog> wrapper = new EntityWrapper<ShopLog>();
-														if (!StringUtils.isEmpty(title)) {
-					wrapper.eq("title", title);
-				}
-												if (!StringUtils.isEmpty(content)) {
-					wrapper.eq("content", content);
-				}
-																	if (!StringUtils.isEmpty(deleteFlag)) {
-					wrapper.eq("delete_flag", deleteFlag);
-				}
-												if (!StringUtils.isEmpty(gmtCreate)) {
-					wrapper.eq("gmt_create", gmtCreate);
-				}
-												if (!StringUtils.isEmpty(gmtUpdate)) {
-					wrapper.eq("gmt_update", gmtUpdate);
-				}
-												if (!StringUtils.isEmpty(userId)) {
-					wrapper.eq("user_id", userId);
-				}
-												if (!StringUtils.isEmpty(adminId)) {
-					wrapper.eq("admin_id", adminId);
-				}
-							List<ShopLog> list = shopLogMapper.selectList(wrapper);
-		ExcelUtil<ShopLog> util = new ExcelUtil<ShopLog>(ShopLog.class);
-		return util.exportExcel(list, "操作日志");
-	}
+    @Override
+    public String export(String title, String content, Long deleteFlag, Date gmtCreate, Date gmtUpdate, Long userId, Long adminId, Integer page, Integer limit) throws ServiceException {
+        Wrapper<ShopLog> wrapper = new EntityWrapper<ShopLog>();
+        if (!StringUtils.isEmpty(title)) {
+            wrapper.eq("title", title);
+        }
+        if (!StringUtils.isEmpty(content)) {
+            wrapper.eq("content", content);
+        }
+        if (!StringUtils.isEmpty(deleteFlag)) {
+            wrapper.eq("delete_flag", deleteFlag);
+        }
+        if (!StringUtils.isEmpty(gmtCreate)) {
+            wrapper.eq("gmt_create", gmtCreate);
+        }
+        if (!StringUtils.isEmpty(gmtUpdate)) {
+            wrapper.eq("gmt_update", gmtUpdate);
+        }
+        if (!StringUtils.isEmpty(userId)) {
+            wrapper.eq("user_id", userId);
+        }
+        if (!StringUtils.isEmpty(adminId)) {
+            wrapper.eq("admin_id", adminId);
+        }
+        List<ShopLog> list = shopLogMapper.selectList(wrapper);
+        ExcelUtil<ShopLog> util = new ExcelUtil<ShopLog>(ShopLog.class);
+        return util.exportExcel(list, "操作日志");
+    }
 }

+ 132 - 95
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserServiceImpl.java

@@ -15,12 +15,14 @@ import com.dangdang.openplatform.openapi.sdk.response.order.OrdersContentDecrypt
 import com.dangdang.openplatform.openapi.sdk.responsemodel.order.CryptUserInfo;
 import com.dangdang.openplatform.openapi.sdk.responsemodel.order.OrdersContentDecryptDTO;
 import com.iotechn.unimall.data.domain.shop.ShopAccount;
+import com.iotechn.unimall.data.domain.shop.ShopLog;
 import com.iotechn.unimall.data.domain.shop.ShopOrder;
 import com.iotechn.unimall.data.domain.shop.ShopTran;
 import com.iotechn.unimall.data.dto.shop.XmlObject.OrderDetail;
 import com.iotechn.unimall.data.dto.shop.XmlObject.SendGood;
 import com.iotechn.unimall.data.dto.shop.XmlObject.SendGoodsInfo;
 import com.iotechn.unimall.data.mapper.shop.ShopAccountMapper;
+import com.iotechn.unimall.data.mapper.shop.ShopLogMapper;
 import com.iotechn.unimall.data.mapper.shop.ShopOrderMapper;
 import com.iotechn.unimall.data.mapper.shop.ShopTranMapper;
 import com.iotechn.unimall.data.util.XMLUtil;
@@ -85,6 +87,8 @@ public class AdminUserServiceImpl implements AdminUserService {
     @Autowired
     private ShopAccountMapper shopAccountMapper;
 
+    @Autowired
+    private ShopLogMapper shopLogMapper;
     @Autowired
     private ShopOrderMapper shopOrderMapper;
     @Autowired
@@ -167,96 +171,93 @@ public class AdminUserServiceImpl implements AdminUserService {
 
     @Override
     public String test(String param,String param1) throws Exception {
-
-        List<ShopOrder> shopOrders = shopOrderMapper.selectList(new EntityWrapper<ShopOrder>()
-                .eq("dang_order_status","未发货")
-                .ne("shipping_com","京东快递")
-                .ne("shipping_com","丰网速运")
-                .eq("order_status_name","卖家已发货"));
-        for (ShopOrder qqq:shopOrders
-             ) {
-            ShopAccount shopAccount = shopAccountMapper.selectById(qqq.getAccountId());
-            flushCookie(shopAccount);
-            CloseableHttpClient httpClient = HttpClientBuilder.create().build();
-            HttpGet get = new HttpGet("https://shop.kongfz.com/buyer/order/index/?pageCurr=1&pageShow=9999&orderId="+qqq.getOrderId());
-            //这里可以设置请求参数,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("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
-            CloseableHttpResponse response = httpClient.execute(get);//执行获取响应
-            try{
-
-                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK){//根据状态码处理
-                    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获取的字段需要根据提供的返回值去获取
-                    List<ShopOrder> data = JSONArray.parseArray(datas.get("data").toString(),ShopOrder.class);//"data"是根据返回值设定
-                    for (ShopOrder tmp: data
-                    ) {
-                        //正则表达式,用于匹配非数字串,+号用于匹配出多个非数字串
-                        String regEx="[^0-9]+";
-                        Pattern pattern = Pattern.compile(regEx);
-                        //用定义好的正则表达式拆分字符串,把字符串中的数字留出来
-                        String[] cs = pattern.split(tmp.getRemarkText());
-                        String dangOrder = "";
-                        for (String str:cs
+        try{
+            List<ShopOrder> shopOrders = shopOrderMapper.selectList(new EntityWrapper<ShopOrder>()
+                    .eq("dang_order_status","未发货").ne("shipping_com","京东快递")
+                    .ne("shipping_com","丰网速运")
+                    .eq("order_status_name","卖家已发货"));
+            for (ShopOrder qqq:shopOrders
+            ) {
+                ShopAccount shopAccount = shopAccountMapper.selectById(qqq.getAccountId());
+                flushCookie(shopAccount);
+                CloseableHttpClient httpClient = HttpClientBuilder.create().build();
+                HttpGet get = new HttpGet("https://shop.kongfz.com/buyer/order/index/?pageCurr=1&pageShow=9999&orderId="+qqq.getOrderId());
+                //这里可以设置请求参数,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("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
+                CloseableHttpResponse response = httpClient.execute(get);//执行获取响应
+                try{
+
+                    if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK){//根据状态码处理
+                        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获取的字段需要根据提供的返回值去获取
+                        List<ShopOrder> data = JSONArray.parseArray(datas.get("data").toString(),ShopOrder.class);//"data"是根据返回值设定
+                        for (ShopOrder tmp: data
                         ) {
-                            if(dangOrder.length()>= 11 || str.equals("*")){
-                                break;
+                            //正则表达式,用于匹配非数字串,+号用于匹配出多个非数字串
+                            String regEx="[^0-9]+";
+                            Pattern pattern = Pattern.compile(regEx);
+                            //用定义好的正则表达式拆分字符串,把字符串中的数字留出来
+                            String[] cs = pattern.split(tmp.getRemarkText());
+                            String dangOrder = "";
+                            for (String str:cs
+                            ) {
+                                if(dangOrder.length()>= 11 || str.equals("*")){
+                                    break;
+                                }
+                                dangOrder += str;
                             }
-                            dangOrder += str;
-                        }
-                        tmp.setDangOrder(dangOrder);
-                        tmp.setAccountId(shopAccount.getId());
-                        Long time  = Long.parseLong(tmp.getShippingTime());
-                        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-                        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
-                        String time1 = sdf.format(new Date(time * 1000));
-                        tmp.setShippingTime(time1);
-                        tmp.setDeleteFlag(0);
-                        tmp.setGmtUpdate(new Date());
-                        tmp.setGmtCreate(new Date());
-                        if(tmp.getShippingComName().equals("快递包裹")||tmp.getShippingComName().equals("挂号印刷品")){
-                            tmp.setShippingComName("中国邮政");
-                        }
-                        ShopOrder tt = new ShopOrder();
-                        tt.setOrderId(tmp.getOrderId());
-                        tt =  shopOrderMapper.selectOne(tt);
-                        if(tt == null){
-                            shopOrderMapper.insert(tmp);
-                        }
-                        else{
-                            if(!tt.getDangOrder().equals(tmp.getDangOrder())||!tt.getShippingComName().equals(tmp.getShippingComName())){
-                                shopOrderMapper.update(tmp,new EntityWrapper<ShopOrder>().eq("order_id",tt.getOrderId()));
+                            tmp.setDangOrder(dangOrder);
+                            tmp.setAccountId(shopAccount.getId());
+                            Long time  = Long.parseLong(tmp.getShippingTime());
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                            sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
+                            String time1 = sdf.format(new Date(time * 1000));
+                            tmp.setShippingTime(time1);
+                            tmp.setDeleteFlag(0);
+                            tmp.setGmtUpdate(new Date());
+                            tmp.setGmtCreate(new Date());
+                            if(tmp.getShippingComName().equals("快递包裹")||tmp.getShippingComName().equals("挂号印刷品")){
+                                tmp.setShippingComName("中国邮政");
+                            }
+                            ShopOrder tt = new ShopOrder();
+                            tt.setOrderId(tmp.getOrderId());
+                            tt =  shopOrderMapper.selectOne(tt);
+                            if(tt == null){
+                                shopOrderMapper.insert(tmp);
+                            }
+                            else{
+                                if(!tt.getDangOrder().equals(tmp.getDangOrder())||!tt.getShippingComName().equals(tmp.getShippingComName())){
+                                    shopOrderMapper.update(tmp,new EntityWrapper<ShopOrder>().eq("order_id",tt.getOrderId()));
+                                }
+                                dangOrderDeal(shopAccount,qqq);
                             }
-                            dangOrderDeal(shopAccount,qqq);
                         }
-                    }
 
-                }
+                    }
 
 
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            finally {
-                response.close();
-                httpClient.close();
+                } catch (IOException e) {
+                    throw e;
+                }
+                finally {
+                    response.close();
+                    httpClient.close();
+                }
             }
         }
-
-//        Wrapper wrapper1 = new EntityWrapper();
-//        wrapper1.eq("order_status_name","卖家已发货");
-//        wrapper1.eq("dang_order_status","未发货");
-//        wrapper1.orderBy("gmt_update",false);
-//        List<ShopOrder> list1 = shopOrderMapper.selectList(wrapper1);
-//        for (ShopOrder shopOrder: list1
-//        ) {
-//            ShopAccount shopAccount = shopAccountMapper.selectById(shopOrder.getAccountId());
-//            dangOrderDeal(shopAccount,shopOrder);
-//        }
+        catch (Exception e) {
+            ShopLog shopLog = new ShopLog();
+            shopLog.setGmtCreate(new Date());
+            shopLog.setTitle("同步定时任务异常");
+            shopLog.setContent(e.getMessage());
+            shopLogMapper.insert(shopLog);
+            e.printStackTrace();
+        }
         return "";
 
     }
@@ -277,12 +278,15 @@ public class AdminUserServiceImpl implements AdminUserService {
             try {
                 resultt = sdkClient.excute(ss);
                 if(resultt.getOrderID() == null){
-                    System.out.println("当当订单信息不存在:"+shopOrder.getDangOrder());
+                    ShopLog shopLog = new ShopLog();
+                    shopLog.setGmtCreate(new Date());
+                    shopLog.setTitle("当当订单编号错误");
+                    shopLog.setContent("店铺:"+shopAccount.getDangName()+",孔网订单:"+shopOrder.getOrderId()+",当当订单:"+shopOrder.getDangOrder());
+                    shopLogMapper.insert(shopLog);
                     return;
                 }
             } catch (ApiException e) {
-                e.printStackTrace();
-
+                throw e;
             }
 
             /**
@@ -296,7 +300,7 @@ public class AdminUserServiceImpl implements AdminUserService {
             try {
                 odgrp = sdkClient.excute(odgr);
             } catch (ApiException e) {
-                e.printStackTrace();
+                throw e;
             }
             SdkClient jiemi = new SdkClient(shopAccount.getDangAppKey(),shopAccount.getDangAppSecret(),shopAccount.getDangSession(),shopAccount.getDangVersion());
             OrdersContentDecryptRequest ordersContentDecryptRequest=new OrdersContentDecryptRequest();
@@ -313,7 +317,7 @@ public class AdminUserServiceImpl implements AdminUserService {
             try {
                 ordersContentDecryptResponse=jiemi.excute(ordersContentDecryptRequest);
             } catch (ApiException e) {
-                e.printStackTrace();
+                throw e;
             }
             List<OrdersContentDecryptDTO> data = ordersContentDecryptResponse.getData();
             CryptUserInfo cryptUserInfo = data.get(0).getCryptUserInfo();
@@ -348,8 +352,7 @@ public class AdminUserServiceImpl implements AdminUserService {
             wrapper.like("fuzi_name",shopOrder.getShippingComName());
             List<ShopTran> list = shopTranMapper.selectList(wrapper);
             if(list.size() == 0 ){
-                System.out.println("物流公司不存在:"+shopOrder.getShippingComName());
-                return;
+                throw new Exception("物流公司不存在");
             }
             HashMap<String, Object> stringObjectHashMap = new HashMap<>();
             stringObjectHashMap.put("DANG_DANG_ORDER", shopOrder.getDangOrder());
@@ -369,10 +372,8 @@ public class AdminUserServiceImpl implements AdminUserService {
             PrintWriter out = null;
             try {
                 out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream("sendGoodNotPlat.xml"), "GBK")));
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
+            }catch (Exception e) {
+                throw e;
             }
             out.write(xmlFileStr);
             out.close();
@@ -388,16 +389,33 @@ public class AdminUserServiceImpl implements AdminUserService {
             try {
                 result = sdkClient.excute(sendGoodsRequest);
             } catch (ApiException e) {
-                e.printStackTrace();
+                throw e;
             }
             System.out.println(result.toString());
             if(result.getResult().getOrdersList().get(0).getOrderOperCode() == 0 || result.getResult().getOrdersList().get(0).getOrderOperCode() == 605){
+                ShopLog shopLog = new ShopLog();
+                shopLog.setGmtCreate(new Date());
+                shopLog.setTitle("当当订单发货成功");
+                shopLog.setContent("店铺:"+shopAccount.getDangName()+",孔网订单:"+shopOrder.getOrderId()+",当当订单:"+shopOrder.getDangOrder());
+                shopLogMapper.insert(shopLog);
                 shopOrder.setDangOrderStatus("已发货");
                 shopOrderMapper.update(shopOrder,new EntityWrapper<ShopOrder>().eq("order_id",shopOrder.getOrderId()));
             }
+            else{
+                ShopLog shopLog = new ShopLog();
+                shopLog.setGmtCreate(new Date());
+                shopLog.setTitle("当当订单发货失败");
+                shopLog.setContent("店铺:"+shopAccount.getDangName()+",孔网订单:"+shopOrder.getOrderId()+",当当订单:"+shopOrder.getDangOrder()+",快递:"+shopOrder.getShippingComName());
+                shopLogMapper.insert(shopLog);
+            }
         }
         catch (Exception e){
             e.printStackTrace();
+            ShopLog shopLog = new ShopLog();
+            shopLog.setGmtCreate(new Date());
+            shopLog.setTitle("当当发货异常");
+            shopLog.setContent(e.getMessage());
+            shopLogMapper.insert(shopLog);
         }
 
     }
@@ -422,8 +440,8 @@ public class AdminUserServiceImpl implements AdminUserService {
                     }
                 }
             }
-            catch (Exception exception){
-
+            catch (Exception e){
+                throw e;
             }
             finally {
                 response.close();
@@ -463,15 +481,34 @@ public class AdminUserServiceImpl implements AdminUserService {
                 System.out.println("nCookie:" + nCookie);
                 shopAccount.setFuziCookie(nCookie);
                 shopAccountMapper.updateById(shopAccount);
+                ShopLog shopLog = new ShopLog();
+                shopLog.setGmtCreate(new Date());
+                shopLog.setTitle("更新cookie成功");
+                shopLog.setContent("账号:"+shopAccount.getFuziAccount()+",cookie:"+nCookie);
+                shopLogMapper.insert(shopLog);
+            }
+            else{
+                ShopLog shopLog = new ShopLog();
+                shopLog.setGmtCreate(new Date());
+                shopLog.setTitle("更新cookie失败");
+                shopLog.setContent(response.toString());
+                shopLogMapper.insert(shopLog);
             }
             // 释放链接
             response.close();
 
         }catch (Exception e) {
             e.printStackTrace();
+            ShopLog shopLog = new ShopLog();
+            shopLog.setGmtCreate(new Date());
+            shopLog.setTitle("更新cookie异常");
+            shopLog.setContent(e.getMessage());
+            shopLogMapper.insert(shopLog);
         }
 
     }
+
+
     /**
      * Unicode转 汉字字符串
      *