瀏覽代碼

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts接入京东电子面单打印
liujiankang 5 年之前
父節點
當前提交
5f82a1ed50

+ 20 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AwaitSendController.java

@@ -425,6 +425,8 @@ public class AwaitSendController {
         Set<Integer> salesIdsset = new HashSet<Integer>();
         salesIdsset.add(salesOrderInfo.getSalesId());
 
+
+
         try {
             // 向第三方系统【快递鸟】提交订单数据,第三方系统会检测订单是否重复
             String json = OrderUtils.orderOnlineByJson(eOrderRequestData);
@@ -470,7 +472,14 @@ public class AwaitSendController {
                                         .append(";");
                             }
                             //替换产品名
-                            subTemplate = subTemplate.replace(uuid, productName.toString());
+                            //如果是京东订单则需直接根据订单id替换产品信息
+                            if(salesOrderInfo.getSalesPostFirm().equals("jd") || salesOrderInfo.getSalesPostFirm().equals("JD")){
+                                subTemplate = subTemplate.replace(salesId.toString(), "<font style=\"font-size:6px\">"+productName.toString()+"</font>");
+                            }else{
+                                subTemplate = subTemplate.replace(uuid, productName.toString());
+                            }
+
+
                             //替换订单号
                             subTemplate = subTemplate.replace(orderId, orders.get(i).getSalesOrderId());
                             //替换备注
@@ -499,9 +508,17 @@ public class AwaitSendController {
                 }
                 /*子母单设置 end*/
 
+
                 // 替换母订单产品名称
-                jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(uuid, goodName.toString()));
-                json = jsonObject.toString();
+                //如果是京东订单则需直接根据订单id替换产品信息
+                if(salesOrderInfo.getSalesPostFirm().equals("jd") || salesOrderInfo.getSalesPostFirm().equals("JD")){
+                    jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(salesId.toString(), "<font style=\"font-size:6px\">"+goodName.toString()+"</font>"));
+                    json = jsonObject.toString();
+                }else{
+                    jsonObject.put("PrintTemplate",jsonObject.get("PrintTemplate").toString().replace(uuid, goodName.toString()));
+                    json = jsonObject.toString();
+                }
+
 
                 // 保存HTML
                 String filePath = request.getServletContext().getRealPath("/common/");