瀏覽代碼

发货单列表添加按订单明细id查询

hu 2 年之前
父節點
當前提交
3faac8f7f9
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

+ 15 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -236,6 +236,21 @@ public class dispatch extends Controller {
                     where.append(" and t1.sa_dispatchid  in").append(str);
                 }
             }
+
+            if (whereObject.containsKey("sa_orderitemsid") && !"".equals(whereObject.getString("sa_orderitemsid"))) {
+                Rows rowsDispatchid = dbConnect.runSqlQuery("select t1.sa_dispatchid from sa_dispatch_items t1 left join sa_dispatch t2 on t1.sa_dispatchid=t2.sa_dispatchid and t1.siteid=t2.siteid " +
+                        " where t2.status !='新建' and t1.siteid='"+siteid+"' and t1.sa_orderitemsid ="+whereObject.getLong("sa_orderitemsid")+"");
+
+                if(rowsDispatchid.toJsonArray("sa_dispatchid").isEmpty()){
+                    where.append(" and t1.sa_dispatchid in (0)");
+                }else {
+                    String str = rowsDispatchid.toJsonArray("sa_dispatchid").toJSONString();
+                    str = str.replace("[", "(").replace("]", ")");
+                    where.append(" and t1.sa_dispatchid  in" ).append(str);
+                }
+
+
+            }
         }
 //        SQLFactory sqlFactory = new SQLFactory(this, "发货单列表查询", pageSize, pageNumber, pageSorting);
 //        sqlFactory.addParameter("siteid", siteid);