浏览代码

查询是否存在新建的发货单

eganwu 1 年之前
父节点
当前提交
eebc8004aa
共有 2 个文件被更改,包括 14 次插入13 次删除
  1. 4 1
      src/custom/restcontroller/R.java
  2. 10 12
      src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

+ 4 - 1
src/custom/restcontroller/R.java

@@ -5434,7 +5434,10 @@ public class R {
         public static class v1 {
         }
     }
-
+    public static class ID20240123163302 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 10 - 12
src/custom/restcontroller/webmanage/sale/dispatch/dispatch.java

@@ -45,6 +45,16 @@ public class dispatch extends Controller {
         // TODO Auto-generated constructor stub
     }
 
+    @API(title = "查询是否存在新建的发货单", apiversion = R.ID20240123163302.v1.class)
+    public String query() throws YosException {
+
+        Long sys_enterpriseid = content.getLongValue("sys_enterpriseid");
+        Long sa_orderid = content.getLongValue("sa_orderid");
+        Rows rows = dbConnect.runSqlQuery("SELECT * from sa_dispatch WHERE sys_enterpriseid=" + sys_enterpriseid + " and status='新建' and sa_orderid='" + sa_orderid + "' and siteid='" + siteid + "'");
+        return getSucReturnObject().setData(rows).toString();
+
+    }
+
 
     @API(title = "发货单新增更新", apiversion = R.ID20221114135203.v1.class, intervaltime = 200)
     @CACHEING_CLEAN(apiversions = {R.ID20221114135303.v1.class, R.ID20221114135403.v1.class, R.ID20230320160203.v1.class})
@@ -64,18 +74,6 @@ public class dispatch extends Controller {
 
         if (sa_dispatchid <= 0) {
 
-            Rows rows = dbConnect.runSqlQuery("SELECT * from sa_dispatch WHERE sys_enterpriseid=" + content.getLong("sys_enterpriseid") + " and status='新建' and sa_orderid='" + sa_orderid + "' and siteid='" + siteid + "'");
-
-            if (rows.isNotEmpty()) {
-                sa_dispatchid = rows.get(0).getLong("sa_dispatchid");
-//                content.put("sa_dispatchid", sa_dispatchid);
-                Row row = new Row();
-                row.put("sa_dispatchid", sa_dispatchid);
-                row.put("error", "该订单号已存在新建的发货单");
-                return getErrReturnObject().setErrMsg(row.toString()).toString();
-            }
-
-
             sa_dispatchid = createTableID(tableName);
             Rows rowsinfo = dbConnect
                     .runSqlQuery("select contactsid from sys_enterprise_contacts where workaddress=1 and sys_enterpriseid="