Преглед изворни кода

立体仓库新增指令查询和指令删除方法

shenjingwei пре 8 месеци
родитељ
комит
c1d4318c10
1 измењених фајлова са 57 додато и 0 уклоњено
  1. 57 0
      src/custom/beans/wms/Wms.java

+ 57 - 0
src/custom/beans/wms/Wms.java

@@ -13,6 +13,7 @@ import java.util.ArrayList;
  */
 public class Wms {
 
+
     /**
      * 下达出库指令
      *
@@ -148,4 +149,60 @@ public class Wms {
         SQLFactory.createUpdateSQL(controller, "st_stockbill_items").setValue("wmsuploadflag", 2).setWhere("st_stockbill_itemsid", stockbillitemsRows.toArrayList("st_stockbill_itemsid"));
     }
 
+
+    /**
+     * 立体仓库指令查询
+     *
+     * @param outplace
+     */
+    public static Rows queryOrder(String outplace) throws YosException {
+        Rows rows = new Rows();
+        switch (outplace) {
+            case "谈桥": {
+                DBConnect tqwms = new DBConnect("TQWMS");
+                rows = tqwms.runSqlQuery("select OutPlanID,BillNo,BillType,CreateDate,IsDeleted,OutDate,SellCompany,SellPerson,Selladdress,Sellphone,Status,createby,ShortName from TOutInt where status=0");
+
+                QuerySQL outDetailIntQuery = SQLFactory.createQuerySQL(tqwms, "TOutDetailInt", "OutPlanID,BillNo,CreateDate,IsDeleted,OutDate,MaterialCode,PlanOutQuantity,OutQuantity,Status");
+                outDetailIntQuery.setWhere("OutPlanID", rows.toArrayList("OutPlanID"));
+                RowsMap outDetailIntMap = outDetailIntQuery.query().toRowsMap("OutPlanID");
+                for (Row row : rows) {
+                    row.put("detail", outDetailIntMap.get(row.getString("OutPlanID")));
+                }
+                break;
+            }
+            case "马桥": {
+                DBConnect mqwms = new DBConnect("U8-YUNl_DB");
+                rows = mqwms.runSqlQuery("select cCode,rowno,cInvCode,iQuantity,dDate,fagentnum,fagentname,fcontact,fphonenumber,faddress from Wms_Rdrecord32 where WMSstatus=0");
+                break;
+            }
+        }
+        return rows;
+    }
+
+    /**
+     * 谈桥指令删除
+     *
+     * @param OutPlanID
+     * @throws YosException
+     */
+    public static void deleteTQOrder(long OutPlanID) throws YosException {
+        DBConnect tqwms = new DBConnect("TQWMS");
+        if (tqwms.runSqlQuery("select * from TOutInt where OutPlanID=" + OutPlanID + " and status=0").isNotEmpty()) {
+            ArrayList<String> sqlist = new ArrayList<>();
+            sqlist.add("delete from TOutInt where OutPlanID=" + OutPlanID);
+            sqlist.add("delete from TOutDetailInt where OutPlanID=" + OutPlanID);
+            tqwms.runSqlUpdate(sqlist);
+        }
+    }
+
+    /**
+     * 马桥指令删除
+     *
+     * @param billno 单号
+     * @param rowno  行号
+     * @throws YosException
+     */
+    public static void deleteMQOrder(String billno, int rowno) throws YosException {
+        new DBConnect("U8-YUNl_DB").runSqlUpdate("delete from Wms_Rdrecord32 where WMSstatus=0 and billno=" + billno + " and rowno='" + rowno + "'");
+    }
 }