|  | @@ -93,31 +93,35 @@ public class PushShippingDetailsJob implements Job {
 | 
											
												
													
														|  |                  List<String> shippingDetailIdList = syShippingDetailsService.getPushSrmIds();
 |  |                  List<String> shippingDetailIdList = syShippingDetailsService.getPushSrmIds();
 | 
											
												
													
														|  |                  shippingDetailIdList = shippingDetailIdList.stream().distinct().collect(Collectors.toList());
 |  |                  shippingDetailIdList = shippingDetailIdList.stream().distinct().collect(Collectors.toList());
 | 
											
												
													
														|  |                  for (String id : shippingDetailIdList) {
 |  |                  for (String id : shippingDetailIdList) {
 | 
											
												
													
														|  | -                    List<PurchasePreDeliverVo> purchasePreDeliverVoList = syShippingDetailsService.getPurchasePreDeliverVoList(id);
 |  | 
 | 
											
												
													
														|  | -                    if (purchasePreDeliverVoList.size() > 0) {
 |  | 
 | 
											
												
													
														|  | -                        ReqPurchasePreDeliverVo reqPurchasePreDeliverVo = new ReqPurchasePreDeliverVo();
 |  | 
 | 
											
												
													
														|  | -                        reqPurchasePreDeliverVo.setVerifyToken(srmAccessToken);
 |  | 
 | 
											
												
													
														|  | -                        reqPurchasePreDeliverVo.setBillList(purchasePreDeliverVoList);
 |  | 
 | 
											
												
													
														|  | -                        String reqString = JSONObject.toJSONString(reqPurchasePreDeliverVo);
 |  | 
 | 
											
												
													
														|  | -                        log.info("查看请求信息\t" + reqString);
 |  | 
 | 
											
												
													
														|  | -                        //获取url
 |  | 
 | 
											
												
													
														|  | -                        String url = dxpDataPlan.getItemIp();
 |  | 
 | 
											
												
													
														|  | -                        //处理返回信息
 |  | 
 | 
											
												
													
														|  | -                        String respStr = HttpHelper.httpJsonPost(url, reqString, null);
 |  | 
 | 
											
												
													
														|  | -                        log.info("查看返回信息\t" + respStr);
 |  | 
 | 
											
												
													
														|  | -                        JSONObject informationJson = JSONObject.parseObject(respStr);
 |  | 
 | 
											
												
													
														|  | -                        JSONArray jsonArray = informationJson.getJSONArray("result");
 |  | 
 | 
											
												
													
														|  | -                        log.info("jsonArray\t" + jsonArray);
 |  | 
 | 
											
												
													
														|  | -                        for (int i = 0; i < jsonArray.size(); i++) {
 |  | 
 | 
											
												
													
														|  | -                            JSONObject jsonObject = jsonArray.getJSONObject(i);
 |  | 
 | 
											
												
													
														|  | -                            String syShippingId = jsonObject.getString("extraInfo");
 |  | 
 | 
											
												
													
														|  | -                            boolean success = jsonObject.getBoolean("success");
 |  | 
 | 
											
												
													
														|  | -                            String message = oConvertUtils.getString(jsonObject.getString("message"));
 |  | 
 | 
											
												
													
														|  | -                            String status = success ? "1" : "2";
 |  | 
 | 
											
												
													
														|  | -                            syShippingDetailsService.setPurshInfo(
 |  | 
 | 
											
												
													
														|  | -                                    Arrays.asList(syShippingId.split(",")),
 |  | 
 | 
											
												
													
														|  | -                                    status, message);
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    try {
 | 
											
												
													
														|  | 
 |  | +                        List<PurchasePreDeliverVo> purchasePreDeliverVoList = syShippingDetailsService.getPurchasePreDeliverVoList(id);
 | 
											
												
													
														|  | 
 |  | +                        if (purchasePreDeliverVoList.size() > 0) {
 | 
											
												
													
														|  | 
 |  | +                            ReqPurchasePreDeliverVo reqPurchasePreDeliverVo = new ReqPurchasePreDeliverVo();
 | 
											
												
													
														|  | 
 |  | +                            reqPurchasePreDeliverVo.setVerifyToken(srmAccessToken);
 | 
											
												
													
														|  | 
 |  | +                            reqPurchasePreDeliverVo.setBillList(purchasePreDeliverVoList);
 | 
											
												
													
														|  | 
 |  | +                            String reqString = JSONObject.toJSONString(reqPurchasePreDeliverVo);
 | 
											
												
													
														|  | 
 |  | +                            log.info("查看请求信息\t" + reqString);
 | 
											
												
													
														|  | 
 |  | +                            //获取url
 | 
											
												
													
														|  | 
 |  | +                            String url = dxpDataPlan.getItemIp();
 | 
											
												
													
														|  | 
 |  | +                            //处理返回信息
 | 
											
												
													
														|  | 
 |  | +                            String respStr = HttpHelper.httpJsonPost(url, reqString, null);
 | 
											
												
													
														|  | 
 |  | +                            log.info("查看返回信息\t" + respStr);
 | 
											
												
													
														|  | 
 |  | +                            JSONObject informationJson = JSONObject.parseObject(respStr);
 | 
											
												
													
														|  | 
 |  | +                            JSONArray jsonArray = informationJson.getJSONArray("result");
 | 
											
												
													
														|  | 
 |  | +                            log.info("jsonArray\t" + jsonArray);
 | 
											
												
													
														|  | 
 |  | +                            for (int i = 0; i < jsonArray.size(); i++) {
 | 
											
												
													
														|  | 
 |  | +                                JSONObject jsonObject = jsonArray.getJSONObject(i);
 | 
											
												
													
														|  | 
 |  | +                                String syShippingId = jsonObject.getString("extraInfo");
 | 
											
												
													
														|  | 
 |  | +                                boolean success = jsonObject.getBoolean("success");
 | 
											
												
													
														|  | 
 |  | +                                String message = oConvertUtils.getString(jsonObject.getString("message"));
 | 
											
												
													
														|  | 
 |  | +                                String status = success ? "1" : "2";
 | 
											
												
													
														|  | 
 |  | +                                syShippingDetailsService.setPurshInfo(
 | 
											
												
													
														|  | 
 |  | +                                        Arrays.asList(syShippingId.split(",")),
 | 
											
												
													
														|  | 
 |  | +                                        status, message);
 | 
											
												
													
														|  | 
 |  | +                            }
 | 
											
												
													
														|  |                          }
 |  |                          }
 | 
											
												
													
														|  | 
 |  | +                    }catch (Exception e) {
 | 
											
												
													
														|  | 
 |  | +                        log.error("推送出运明细到SRM失败", e);
 | 
											
												
													
														|  |                      }
 |  |                      }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  }
 |  |                  }
 |