From e4647b3bc4aca9690261df83f9055abdf8c17406 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期四, 13 四月 2023 15:36:27 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs           |   10 
 WarM/条码打印/Sc_ICMOToBarCode.cs                                  |   60 ++--
 WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs            |  322 +++++++++++++++++++++++++++++
 WebAPI/Controllers/POStockInBackBillController.cs              |    1 
 Pub_Class/CustomerCls/ClsXt_SystemParameter.cs                 |   12 +
 WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs   |    2 
 Model/车间管理/ClsSc_ProcessExchangeBillMain.cs                    |    4 
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs         |   32 +-
 WebAPI/Controllers/基础资料/基础资料/Gy_MaterTypeBillController.cs     |   95 ++++++++
 WebAPI/Controllers/WebAPIController.cs                         |   65 +++++
 Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs             |    3 
 DAL/车间管理/ClsSc_ProcessExchangeBill.cs                          |   22 +
 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs          |    2 
 WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs         |   20 -
 WebAPI/Controllers/BaseSet/Gy_CustomerController.cs            |    4 
 WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs |    2 
 WebAPI/Web.config                                              |    3 
 17 files changed, 580 insertions(+), 79 deletions(-)

diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
index 53370d7..5fc5c66 100644
--- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
+++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs"
@@ -87,6 +87,8 @@
                 ",HExplanation='" + omodel.HExplanation + "'" +
                 ",HInnerBillNo='" + omodel.HInnerBillNo + "'" +
                 ",HSupID=" + omodel.HSupID.ToString() +
+                ",HEmpID=" + omodel.HEmpID.ToString() +
+                ",HCusID=" + omodel.HCusID.ToString() +
                 ",HMainMaterID=" + omodel.HMainMaterID.ToString() +
                 ",HKeyMaterID=" + omodel.HKeyMaterID.ToString() +
                 ",HWorkShopID=" + omodel.HWorkShopID.ToString() +
@@ -96,6 +98,8 @@
                 ",HBLFlag='" + (omodel.HBLFlag ? 1 : 0) + "'" +
                 ",HXTNumber='" + omodel.HXTNumber  + "'" +
                 ",HXTModel='" + omodel.HXTModel + "'" +
+                ",HRemark2='" + omodel.HRemark2 + "'" +
+                ",HRemark3='" + omodel.HRemark3 + "'" +
                 ",HCusNumber='" + omodel.HCusNumber + "'" +
                 ",HMaterModel='" + omodel.HMaterModel + "'" +
                 ",HWidth='" + omodel.HWidth + "'" +
@@ -314,7 +318,8 @@
                 ",HMaterIDA,HMaterIDB,HMaterIDC,HMaterIDD,HICMOEntryID" +       
 ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,HCusNumber,HPickLabel,HPickLabelNumber,HXTNumber,HXTModel,HWorkBillSortNo" +
                ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" +
-               ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate) " +
+               ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" +
+               ",HRemark2,HRemark3,HEmpID,HCusID) " +
                 " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" +
                 "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() +
@@ -327,7 +332,8 @@
                 ",'" + omodel.HMaterIDA + "','" + omodel.HMaterIDB + "','" + omodel.HMaterIDC + "','" + omodel.HMaterIDD + "'," + omodel.HICMOEntryID +
                 ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','" + (omodel.HBLFlag ? 1 : 0) + "','" + omodel.HCusNumber + "','" + omodel.HPickLabel + "','" + omodel.HPickLabelNumber + "','" + omodel.HXTNumber + "','" + omodel.HXTModel + "','" + omodel.HWorkBillSortNo + 
                 "',"+ omodel.HRoutingBillID + ",'"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" +
-                ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "')");
+                ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" +
+                ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ")");
                 sErr = sErr + "1;";
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl)
@@ -543,6 +549,18 @@
                 omodel.HAuxQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HAuxQty"]);
                 omodel.HAuxUnit = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HAuxUnit"]);
                 omodel.HSplitNo = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HSplitNo"]);
+                omodel.HRemark2 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark2"]);
+                omodel.HRemark3 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark3"]);
+                omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"].ToString());
+                omodel.HHeight = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HHeight"]);
+                omodel.HInches = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInches"]);
+                omodel.HAl1Long = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HAl1Long"]);
+                omodel.HDensity = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HDensity"]);
+                omodel.HTela = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HTela"]);
+                omodel.HUnderTela = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HUnderTela"]);
+                omodel.HSizing = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSizing"]);
+                omodel.HSellDate = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSellDate"]);
+                omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"].ToString());
                 //
                 //寰幆
                 DataSet DsSub;
diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
index 095b62a..875bfa7 100644
--- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
+++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs"
@@ -40,6 +40,7 @@
         public Int64 HEquipMentID;//设备模具
         public string HProjectNum;//项目号
         public Int64 HEmpID;//职员
+        public Int64 HCusID;//客户
         public string HProdMaterCode;
         public string HSeOrderBillNo;
         public string HCusShortName;
@@ -89,5 +90,8 @@
         public double HAuxQty;//辅数量
         public int HAuxUnit;//辅助单位
         public int HSplitNo;//拆分号
+
+        public string HRemark2;//备注2
+        public string HRemark3;//底部备注
     }
 }
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
index 1ae32d6..8694e72 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -2857,6 +2857,13 @@
                     {
                         omodel.MES_StationInBill_DeleteRelationCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    //本道进站数量不能大于上道出站合格数量
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationInBill_PreQtyCtl")
+                    {
+                        omodel.MES_StationInBill_PreQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
+
+
 
                     //===============工序出站汇报单
                     //自动新增
@@ -2899,6 +2906,11 @@
                     {
                         omodel.MES_StationOutBill_InStockType = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    //本道出站数量不允许小于下道进站数量
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "MES_StationOutBill_NextQtyCtl")
+                    {
+                        omodel.MES_StationOutBill_NextQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
 
 
                     //=====不良评审单
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
index 9306d23..3b7e5f4 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -375,6 +375,8 @@
         public string MES_StationInBill_ShowUSERProcess;         //进站接收单只显示用户对应工序
         public string MES_StationInBill_SaveAutoAddnew;         //保存后变为新增状态
         public string MES_StationInBill_DeleteRelationCtl;              //进站接收单删除时是否进行关联控制
+        public string MES_StationInBill_PreQtyCtl;              //本道进站数量不能大于上道出站合格数量
+
         //工序出站汇报单
         public string MES_StationOutBill_QtyCtl;                //出站数量不能大于本道进站汇总数
         public string MES_StationOutBill_QtyPreQtyCtl;                //出站数量(合格数量或总数量)汇总不能大于上道合格汇总数
@@ -390,6 +392,7 @@
         public string MES_StationOutBill_ShowUSERProcess;         //出站汇报单只显示用户对应工序
         public string MES_StationOutBill_SaveAutoAddnew;            //保存后变为新增状态
         public string MES_StationOutBill_DeleteRelationCtl;              //出站汇报单删除时是否进行关联控制
+        public string MES_StationOutBill_NextQtyCtl;                //本道出站数量不允许小于下道进站数量
 
         //不良品评审单
         public string QC_NoPassProdCheckBill_QtyCtl;            //不良品数不能大于出站单报废数量
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
index 587564b..f90e6ff 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Sc_ICMOToBarCode.cs"
@@ -119,7 +119,7 @@
                 //鎶婂綋鍓嶅崟鎹甀D 瀛樺埌涓�涓寜閽噷闈�   鍒锋柊鏃舵瘡娆″瓨涓�閬�
                 if (DSet.Tables[0].Rows.Count > 0)
                 {
-                    txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+                    txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                     txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
                     //txtHMaterID.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡缂栫爜"].Value);
                     txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
@@ -143,7 +143,7 @@
             //    }
             //}
             //鍐荤粨
-            //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
+            //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
             //string s = frmCondition.cmbHComplete.Text;
             //DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s,FrCol);
             //鐢荤嚎
@@ -229,7 +229,7 @@
             string HUserName = "";
             HUserName = ClsPub.isStrNull(DBUtility.ClsPub.CurUserName);
             Int64 HUserID = 0;
-            HUserID = ClsPub.isInt(DBUtility.ClsPub.CurUserID);
+            HUserID = ClsPub.isLong(DBUtility.ClsPub.CurUserID);
 
             DataSet DSet;
 
@@ -781,7 +781,7 @@
                 string HTMNumber = "";
                 string HOrgNumber = "";
                 DataSet Ds;
-                int LSH = 0;                //娴佹按鍙�
+                Int64 LSH = 0;                //娴佹按鍙�
                 string LSH2 = "";           //娴佹按鍙疯浆鎹㈡垚瀛楃
 
 
@@ -802,7 +802,7 @@
                 //绠卞彿
                 string HXH = "";
                 //绠卞彿娴佹按鍙�
-                int LSH3 = 0;                //娴佹按鍙�
+                Int64 LSH3 = 0;                //娴佹按鍙�
                 string LSH4 = "";           //娴佹按鍙疯浆鎹㈡垚瀛楃
                 //鏈哄彴
                 string HJT = "";
@@ -888,7 +888,7 @@
                     a = a + 1;
                 }
                 DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
-                Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
+                Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
 
 
                 sPackBarCode = sPackStr + TTM_LSH.ToString();
@@ -923,7 +923,7 @@
                 //        HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                 //        string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
                 //        DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
-                //        Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
+                //        Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                 //        sPackBarCode = sPackStr + TTM_LSH.ToString();
                 //        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                 //    }
@@ -943,7 +943,7 @@
                 //        HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                 //        string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
                 //        DataSet DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
-                //        Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
+                //        Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                 //        sPackBarCode = sPackStr + TTM_LSH.ToString() + "+" ;
                 //        oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
                 //    }
@@ -964,7 +964,7 @@
                 //HTMaterID = ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HMaterID")].Value);
                 //string sPackStr = "ZXM" + HYear + HPeriod + HDay + HTMaterID; //澶栫鐮� 鍓嶇紑
                 //DataSet  DsTM = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sPackStr + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿                                                                                          //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'");
-                //Int64 TTM_LSH = ClsPub.isInt(DsTM.Tables[0].Rows[0][0]) + 1;
+                //Int64 TTM_LSH = ClsPub.isLong(DsTM.Tables[0].Rows[0][0]) + 1;
                 //string sPackBarCode = sPackStr + TTM_LSH.ToString();
                 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sPackStr + "'");
 
@@ -995,19 +995,19 @@
                         HJT = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("璁惧")].Value);
                         HXH = HYear + HPeriod + HDay + HBC + HJT + HMaterNumber;
                         Ds99 = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HXH + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LSH3 = ClsPub.isInt(Ds99.Tables[0].Rows[0][0]) + 1;
+                        LSH3 = ClsPub.isLong(Ds99.Tables[0].Rows[0][0]) + 1;
                         LSH4 = LSH3.ToString();
 
 
 
-                        //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+                        //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                         HZXQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("鏈鏁伴噺")].Value);
                         HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鏁伴噺")].Value);
                         HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鍙�")].Value);
 
                         HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                         n = 0;
                         LSH2 = LSH.ToString();
                         while (LSH2.Length < LSHlen)  //濡傛灉娴佹按鍙峰皬浜�6浣嶆暟鍓嶉潰琛�0
@@ -1086,7 +1086,7 @@
                         HWorkLineName = "";
                         HSeOrderBillNo = "";
                         HInnerBillNo = sPackBarCode;
-                        HSourceID = ClsPub.isInt(txtHSourceID.Tag);
+                        HSourceID = ClsPub.isLong(txtHSourceID.Tag);
                         oCn.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty,HMaterialMQty" +
                                             ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" +
                                             ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " +
@@ -1327,7 +1327,7 @@
             string HTMNumber = "";
             string HOrgNumber = "";
             DataSet Ds;
-            int LSH = 0;                //娴佹按鍙�
+            Int64 LSH = 0;                //娴佹按鍙�
             string LSH2 = "";           //娴佹按鍙疯浆鎹㈡垚瀛楃
             double HZXQty = 0;         //瑁呯鏁伴噺
             double HDDQty = 0;         //璁㈠崟鏁伴噺
@@ -1350,7 +1350,7 @@
                 HOrgNumber = ClsPub.HOrgNumber;
 
 
-                //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+                //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                 HZXQty = ClsPub.isDoule(txtHZXQty.Text);
                 HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("璁㈠崟鏁伴噺")].Value);
 
@@ -1359,7 +1359,7 @@
                 {
                     HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                     Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                    LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                    LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                 }
                 else if (cmbHBarCodeType.Text == "鎵规鏉$爜")
                 {
@@ -1490,7 +1490,7 @@
             string HTMNumber = "";
             string HOrgNumber = "";
             DataSet Ds;
-            int LSH = 0;                //娴佹按鍙�
+            Int64 LSH = 0;                //娴佹按鍙�
             string LSH2 = "";           //娴佹按鍙疯浆鎹㈡垚瀛楃
             double HZXQty = 0;         //瑁呯鏁伴噺
             double HDDQty = 0;         //璁㈠崟鏁伴噺
@@ -1513,7 +1513,7 @@
                 HOrgNumber = ClsPub.HOrgNumber;
 
 
-                //HBQty = HBQty + ClsPub.isInt(txtHBQty.Text);
+                //HBQty = HBQty + ClsPub.isLong(txtHBQty.Text);
                 HZXQty = ClsPub.isDoule(txtHZXQty.Text);
                 HDDQty = DBUtility.ClsPub.isDoule(grdMain.Rows[j].Cells[Fun_GetCol("璁㈠崟鏁伴噺")].Value);
                 HICMOBillNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[j].Cells[Fun_GetCol("鐢熶骇璁㈠崟鍙�")].Value);
@@ -1522,7 +1522,7 @@
                 {
                     HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                     Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                    LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                    LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                 }
                 else if (cmbHBarCodeType.Text == "鎵规鏉$爜")
                 {
@@ -1552,7 +1552,7 @@
                         HDay = HDay.Substring(HDay.Length - 2, 2);
                         HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                         TM = HTMNumber + LSH2;
                     }
                     else
@@ -1565,7 +1565,7 @@
                         HDay = HDay.Substring(HDay.Length - 2, 2);
                         HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                         Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                        LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                        LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                         TM = HTMNumber + LSH2 + "+"; 
                     }
                     //HYear = ClsPub.isDate(HDate).Year.ToString().Substring(2, 2);
@@ -1575,7 +1575,7 @@
                     //HDay = HDay.Substring(HDay.Length - 2, 2);
                     //HTMNumber = HOrgNumber + HMaterNumber + HYear + HPeriod + HDay;
                     //Ds = oCn.RunProcReturn("exec h_p_WMS_GetMaxNo '" + HTMNumber + "'", "h_p_WMS_GetMaxNo");    //鑾峰彇鏈�澶ф祦姘村彿
-                    //LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]);
+                    //LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]);
                 }
                 //if (cmbHBarCodeType.Text == "鍞竴鏉$爜")
                 //{
@@ -1701,7 +1701,7 @@
 
         private void DisplayTM()
         {
-            //HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
+            //HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
             DataSet DSet = oCn.RunProcReturn("select * from h_v_IF_BarCodeBillList_test Where HinterID=" + HInterID.ToString() + " and 鏉$爜绫诲瀷 = '鎵樼洏鏉$爜' order by HItemID", "h_v_IF_BarCodeBillList_test", ref DBUtility.ClsPub.sExeReturnInfo);
             //鐢熸垚棣栬鏍囬
             if (DSet == null)
@@ -1861,7 +1861,7 @@
             //
             grdSub.DataSource = DSet.Tables[0].DefaultView;
             //鍐荤粨
-            //int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
+            //int FrCol = DBUtility.ClsPub.isLong(frmCondition.txtFrozenCol.Text);
             //string s = frmCondition.cmbHComplete.Text;
             //DBUtility.Xt_BaseBillFun.DisplayGrid(grdSub, this.Name, s, FrCol);
             //鐢荤嚎
@@ -2109,13 +2109,13 @@
         {
             //鑾峰彇缃戞牸绗竴琛孒InterID鐨勫��
             Int64 HInterID = 0;
-            HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
+            HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
             DataSet DSBefore;
             DSBefore =  SubCn.RunProcReturn("exec h_p_PreviousMater "+ HInterID, "h_p_PreviousMater", ref DBUtility.ClsPub.sExeReturnInfo);
             grdMain.DataSource = DSBefore.Tables[0].DefaultView;
             //if (DSBefore.Tables[0].Rows.Count > 0)
             //{
-            //    txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+            //    txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
             //}
             //else
             //{
@@ -2130,7 +2130,7 @@
             else
             {
                 grdMain.DataSource = DSBefore.Tables[0].DefaultView;
-                txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+                txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                 txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
                 txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
                 txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡鍚嶇О"].Value);
@@ -2144,8 +2144,8 @@
         {
             //鏍规嵁
             Int64 HInterID = 0;
-            //HInterID = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
-            HInterID = DBUtility.ClsPub.isInt(txtHMaterID.Tag);
+            //HInterID = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells[Fun_GetCol("HInterID")].Value);
+            HInterID = DBUtility.ClsPub.isLong(txtHMaterID.Tag);
             DataSet DSBefore;
             DSBefore = SubCn.RunProcReturn("exec h_p_NextMater " + HInterID, "h_p_NextMater", ref DBUtility.ClsPub.sExeReturnInfo);
             if (DSBefore == null || DSBefore.Tables[0].Rows.Count == 0)
@@ -2157,7 +2157,7 @@
             else
             {
                 grdMain.DataSource = DSBefore.Tables[0].DefaultView;
-                txtHMaterID.Tag = DBUtility.ClsPub.isInt(grdMain.Rows[0].Cells["HInterID"].Value);
+                txtHMaterID.Tag = DBUtility.ClsPub.isLong(grdMain.Rows[0].Cells["HInterID"].Value);
                 txtHMiniQty.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鏍囧噯瑁呯"].Value);
                 txtHMaterModel.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["瑙勬牸鍨嬪彿"].Value);
                 txtHMaterName.Text = DBUtility.ClsPub.isStrNull(grdMain.Rows[0].Cells["鐗╂枡鍚嶇О"].Value);
diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
index 4445410..f362ec6 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
@@ -300,7 +300,7 @@
                     ",HEmpID,HCreditDate,HCreditRatingDate,HMaxCreditRatingDate" +
                     ",HMonthUseQty,HForecastCreditRating,HCreditLevelID,HCountAccrualRating" +
                     ",HSubsidyAccrualRating,HCreditRating,HMaxCreditRating" +
-                    ",HCusTypeID) " +
+                    ",HCusTypeID,HCREATEORGID,HUSEORGID) " +
                     " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID +
                     ", " + HLevel + ",0,'" + HStopflag + "','" + HRemark + "'" +
                     ",'" + HShortName + "','" + HAddress + "','" + HLinkMan + "','" + HLinkPhone + "','" + HMobilePhone + "'" +
@@ -310,7 +310,7 @@
                     "," + HEmpID + "," + HCreditDate + "," + HCreditRatingDate + "," + HMaxCredRatingDate +
                     "," + HMonthUseQty + "," + HForecastCreditRating + "," + HCreditLevelID + "," + HCountAccrualRating +
                     "," + HSubsidyAccrualRating + "," + HCreditRating + "," + HMaxCreditRating +
-                    ", " + HCusTypeID + ")");
+                    ", " + HCusTypeID + ","+ HCreateOrgID + ","+ HUseOrgID + ")");
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 oCN.RunProc("Update Gy_Customer set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 oCN.Commit();
diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
index 5bc4ed7..80f8aee 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -396,7 +396,7 @@
                 }
 
                 //寰楀埌淇℃伅锛堝澶栨爣璁颁负0鏃讹紝娴佽浆鏍囪涓�1鏃讹級
-                ds = oCN.RunProcReturn("select top 2 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + sBillNo + "' and 涓嬮亾娴佽浆宸ュ簭<>'杞�' and 濮斿鏍囪=0 and 娴佽浆鏍囪=1  and 宸ュ簭鍙�<='" + sProcNo + "' order by cast(宸ュ簭鍙� as int) desc", "h_v_Sc_ProcessExchangeBillList");
+                ds = oCN.RunProcReturn("select top 2 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + sBillNo + "' and 涓嬮亾娴佽浆宸ュ簭<>'杞�' and 濮斿鏍囪=0 and 娴佽浆鏍囪=1  and cast(宸ュ簭鍙� as int)<='" + sProcNo + "' order by cast(宸ュ簭鍙� as int) desc", "h_v_Sc_ProcessExchangeBillList");
                 //Ds = oCn.RunProcReturn("select top 1 * from h_v_Sc_ProcessExchangeBillList  where 鍗曟嵁鍙�= '" + sBillNo + "' and 宸ュ簭鍙�='" + sProcNo + "' and 濮斿鏍囪=0 and 娴佽浆鏍囪=1 ", "h_v_Sc_ProcessExchangeBillList");
                 //鍐欏叆淇℃伅
                 if (ds == null || ds.Tables[0].Rows.Count == 0)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 59c7d30..79fcc6f 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -176,14 +176,14 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                if (HEmpID == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鎿嶄綔鍛樻病鏈夐�夋嫨锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //if (HEmpID == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鎿嶄綔鍛樻病鏈夐�夋嫨锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
                 //if (HQCCheckID == 0)
                 //{
                 //    objJsonResult.code = "0";
@@ -192,14 +192,14 @@
                 //    objJsonResult.data = null;
                 //    return objJsonResult;
                 //}
-                //if (HSourceID == 0)
-                //{
-                //    objJsonResult.code = "0";
-                //    objJsonResult.count = 0;
-                //    objJsonResult.Message = "鐢熶骇璧勬簮娌℃湁閫夋嫨锛�";
-                //    objJsonResult.data = null;
-                //    return objJsonResult;
-                //}
+                if (HSourceID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鐢熶骇璧勬簮娌℃湁閫夋嫨锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
                 //if (HCenterID == 0)
                 //{
                 //    objJsonResult.code = "0";
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs
index 75fefaa..13811d8 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcExchRecordBackBillController.cs
@@ -77,7 +77,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql = string.Format(@"select top 2 * from h_v_Sc_ProcessExchangeBillQuerySub");
-                ds = oCN.RunProcReturn(sql + sWhere+ " order by 娴佹按鍙� ", "h_v_Sc_ProcessExchangeBillQuerySub");
+                ds = oCN.RunProcReturn(sql + sWhere+ " order by cast(娴佹按鍙� as int) ", "h_v_Sc_ProcessExchangeBillQuerySub");
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs
index 75b1bec..5f2b4d0 100644
--- a/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs
+++ b/WebAPI/Controllers/CJGL/Sc_ProcExchWorkBackBillController.cs
@@ -77,7 +77,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql = string.Format(@"select top 2 * from h_v_Sc_ProcessExchangeBillQuerySub");
-                ds = oCN.RunProcReturn(sql + sWhere + " order by 娴佹按鍙� ", "h_v_Sc_ProcessExchangeBillQuerySub");
+                ds = oCN.RunProcReturn(sql + sWhere + " order by cast(娴佹按鍙� as int) ", "h_v_Sc_ProcessExchangeBillQuerySub");
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
diff --git a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
index 5b7a717..7635a40 100644
--- a/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
+++ b/WebAPI/Controllers/JHGL/Gy_RoutingBillController.cs
@@ -238,12 +238,34 @@
                     {
                         if (oSystemParameter.omodel.Gy_RoutingBill_SaveAutoLastProc == "Y" && OperationType == 1)
                         {
+                            ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
+
+                            if (ds.Tables[0].Rows.Count == 0)
+                            {
+                                objJsonResult.code = "0";
+                                objJsonResult.count = 0;
+                                objJsonResult.Message = "鏈缃浆宸ュ簭!";
+                                objJsonResult.data = null;
+                                return objJsonResult;
+                            }
+
                             //璁剧疆杞伐搴�
                             oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                         }
                     }
                     else if (IsProNo == 1 && OperationType == 1)
                     {
+                        ds = oCN.RunProcReturn("select * from Gy_Process Where HTProcessFlag = 1 and HNumber='9999' ", "Gy_Process");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鏈缃浆宸ュ簭!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
                         //璁剧疆杞伐搴�
                         oCN.RunProc("exec Gy_RoutingBill_LastProNo " + HInterID);
                     }
@@ -886,5 +908,305 @@
             }
         }
         #endregion
+
+        #region  宸ヨ壓璺嚎 瀹℃牳銆佸弽瀹℃牳
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_RoutingBill/AuditGy_RoutingBill")]
+        [HttpGet]
+        public object AuditGy_RoutingBill(string HInterID, int IsAudit, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingBill_Check", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HInterID=" + HInterID, "Gy_RoutingBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsAudit == 0)  //瀹℃牳鍒ゆ柇
+                {
+                    oCN.RunProc("update Gy_RoutingBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "瀹℃牳鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+                {
+                    oCN.RunProc("update Gy_RoutingBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅鏍告垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region  宸ヨ壓璺嚎 鍏抽棴銆佸弽鍏抽棴
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_RoutingBill/CloseGy_RoutingBill")]
+        [HttpGet]
+        public object CloseGy_RoutingBill(string HInterID, int IsAudit, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_RoutingBill_Close", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_RoutingBillMain where HInterID=" + HInterID, "Gy_RoutingBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsAudit == 0)  //鍏抽棴鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆鍏抽棴锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶅叧闂垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈叧闂�!涓嶉渶瑕佸弽鍏抽棴!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsAudit == 0)  //鍏抽棴鍒ゆ柇
+                {
+                    oCN.RunProc("update Gy_RoutingBillMain set HCloseMan='" + CurUserName + "',HCloseDate=getdate() where HInterID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍏抽棴鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsAudit == 1) //鍙嶅叧闂垽鏂�
+                {
+                    oCN.RunProc("update Gy_RoutingBillMain set HCloseMan='',HCloseDate=null where HInterID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶅叧闂垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍏抽棴澶辫触鎴栬�呭弽鍏抽棴澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ヨ壓璺嚎鍒楄〃 涓昏〃
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_RoutingBill/Gy_RoutingBillQuery")]
+        [HttpGet]
+        public object Gy_RoutingBillQuery(string sWhere, string user)
+        {
+            DataSet ds;
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                //if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_Query", 1, false, user))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuery where 1 = 1 ";
+                string sql = sql1 + sWhere + " order by hmainid desc";
+                ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillQuery");
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
+        #region 宸ヨ壓璺嚎鍒楄〃 瀛愯〃
+        /// <summary>
+        /// 杩斿洖宸ヨ壓璺嚎鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_RoutingBill/Gy_RoutingBillQuerySub")]
+        [HttpGet]
+        public object Gy_RoutingBillQuerySub(string sWhere)
+        {
+            DataSet ds;
+            try
+            {
+                
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql1 = "select  top 1000 * from h_v_Gy_RoutingBillQuerySub where 1 = 1 and hmainid=" + sWhere;
+                string sql = sql1  + " order by hmainid desc,cast(宸ュ簭鍙� as int)";
+                ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillQuerySub");
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            return GetObjectJson(ds);
+        }
+
+        #endregion
+
+        ///<summary>
+        ///灏佽鐘舵�佺爜鍙婅繑鍥炰俊鎭殑鍏敤鏂规硶銆�
+        ///鍙傛暟锛欴ataSet銆�
+        ///杩斿洖鍊硷細json銆�
+        ///</summary>
+        public object GetObjectJson(DataSet ds)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
     }
 }
\ No newline at end of file
diff --git a/WebAPI/Controllers/POStockInBackBillController.cs b/WebAPI/Controllers/POStockInBackBillController.cs
index 42115fc..b631e31 100644
--- a/WebAPI/Controllers/POStockInBackBillController.cs
+++ b/WebAPI/Controllers/POStockInBackBillController.cs
@@ -490,6 +490,7 @@
                 websLsmain.HEmpID = lsmain[0].HEmpID;
                 websLsmain.HRemark = lsmain[0].HRemark;
                 websLsmain.HMaker = lsmain[0].HMaker;
+                websLsmain.HBillType = "1239";
 
                 if (webserver.set_SavePOStockInBackBill_New(websLsmain, sSourceBillType, ref DBUtility.ClsPub.sErrInfo))
                 {
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 1319651..e94b3a7 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -1632,12 +1632,12 @@
             //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
             if (sWhere != "")
             {
-                sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+                sWhere = " and ( p.HNumber like '%" + sWhere + "%' or p.HName like '%" + sWhere + "%' ) ";
             }
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                ds = oCN.RunProcReturn("Select HItemID,HNumber 宸ュ簭浠g爜,HName 宸ュ簭 from Gy_Process where HStopflag=0 " + sWhere + " Order by HItemID ", "Gy_Process");
+                ds = oCN.RunProcReturn("Select p.HItemID,p.HNumber 宸ュ簭浠g爜,p.HName 宸ュ簭,w.HItemID 宸ヤ綔涓績ID,w.HNumber 宸ヤ綔涓績浠g爜,w.HName 宸ヤ綔涓績,d.HItemID 閮ㄩ棬ID,d.HNumber 閮ㄩ棬浠g爜,d.HName 閮ㄩ棬 from Gy_Process p left join Gy_WorkCenter w on p.HWorkCenterID = w.HItemID left join Gy_Department d on p.HDeptID = d.HItemID where p.HStopflag = 0 " + sWhere + " Order by HItemID ", "Gy_Process");
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objjson.code = "0";
@@ -3984,6 +3984,67 @@
             }
         }
 
+        /// <summary>
+        /// 浜у搧鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        [Route("Web/chanpinruk1")]
+        [HttpGet]
+        public object chanpinruk1(string HBillType, string sHMaker, Int64 HOrgID)
+        {
+            WebS.WebService1 oWebs = new WebS.WebService1();
+            try
+            {
+                ds = oWebs.GetKf_PonderationBillMain_TempList_New(HBillType, sHMaker, HOrgID);
+
+                if (ds == null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+
+                }
+
+                List<object> columnNameList = new List<object>();
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
+                {
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+                }
+
+                if (ds == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
 
         #region PDA鍏朵粬鍏ュ簱鍒楄〃妯″潡
         /// <summary>
diff --git "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs" "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
index e51f6fc..cb0f9a4 100644
--- "a/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
+++ "b/WebAPI/Controllers/\344\273\223\345\255\230\347\256\241\347\220\206/\346\235\241\347\240\201\347\224\237\346\210\220/Sc_BarCodeController.cs"
@@ -415,6 +415,7 @@
                 ordrlist.HPinfan = dt.Rows[i]["HPinfan"].ToString();
                 ordrlist.HSourceName = dt.Rows[i]["鐢熶骇绾�"].ToString();
                 ordrlist.HEndDate = dt.Rows[i]["璁″垝瀹屽伐鏃ユ湡"].ToString();//鍗氭棩 鐢熶骇璁㈠崟 澶辨晥鏃ユ湡
+                ordrlist.HMinQty = dt.Rows[i]["鏈�灏忓寘瑁呮暟"].ToString();
                 if (HBarCodeType == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�")
                 {
                     ordrlist.HMinQty = dt.Rows[i]["鏈敓鎴愭潯鐮佹暟閲�"].ToString();
@@ -457,9 +458,12 @@
                 ordrlist.HRemark = dt.Rows[i]["澶囨敞"].ToString();
                 ordrlist.HMTONo = dt.Rows[i]["璁″垝璺熻釜鍙�"].ToString();
 
-                ordrlist.HFurnaceNO = dt.Rows[i]["鐐夊彿"].ToString();
-                ordrlist.HCoilNO = dt.Rows[i]["閽㈠嵎鎹嗗寘鍙�"].ToString();
-                ordrlist.HheatNO = dt.Rows[i]["鐑鐞�"].ToString();
+                if(HSourceBillType == "鏀舵枡閫氱煡鍗�")
+                {
+                    ordrlist.HFurnaceNO = dt.Rows[i]["鐐夊彿"].ToString();
+                    ordrlist.HCoilNO = dt.Rows[i]["閽㈠嵎鎹嗗寘鍙�"].ToString();
+                    ordrlist.HheatNO = dt.Rows[i]["鐑鐞�"].ToString();
+                }
 
                 if (HBarCodeType == "浠櫒澶栬喘浠舵潯鐮佸鍣ㄨ鍒�")
                 {
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaterTypeBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaterTypeBillController.cs"
index ad6e613..b290f2b 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaterTypeBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaterTypeBillController.cs"
@@ -357,6 +357,101 @@
         }
         #endregion
 
+        #region 鐗╂枡鍒嗙被绂佺敤銆佸弽绂佺敤
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">绂佺敤(0),鍙嶇鐢�(1)</param>
+        /// <param name="CurUserName">瀹℃牳浜�</param>
+        /// <returns></returns>
+        [Route("Gy_MaterType/StopGy_MaterType")]
+        [HttpGet]
+        public object StopGy_MaterType(int HInterID, int IsAudit, string CurUserName)
+        {
+            try
+            {
+                //瀹℃牳鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_MaterType_Check", 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                var ds = oCN.RunProcReturn("select * from Gy_MaterType where HItemID=" + HInterID, "Gy_MaterType");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    if (IsAudit == 0)  //绂佺敤鍒ゆ柇
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    if (IsAudit == 1) //鍙嶇鐢ㄥ垽鏂�
+                    {
+                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.BeginTran();
+
+                if (IsAudit == 0)  //绂佺敤鍒ゆ柇
+                {
+                    oCN.RunProc("update Gy_MaterType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "绂佺敤鎴愬姛";
+                    objJsonResult.data = null;
+                }
+                if (IsAudit == 1) //鍙嶇鐢ㄥ垽鏂�
+                {
+                    oCN.RunProc("update Gy_MaterType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+                    objJsonResult.data = null;
+                }
+                oCN.Commit();
+
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 鐗╂枡鍒嗙被 鏍戝舰鍥�
         public class TreeModel
         {
diff --git "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs" "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
index 06c9b44..28f469b 100644
--- "a/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
+++ "b/WebAPI/Controllers/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillController.cs"
@@ -508,26 +508,6 @@
         {
             ClsSc_ICMOBillSub oSub = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsSc_ICMOBillSub>(msg3);
 
-            //瀹㈡埛鍒跺畾
-            string sErr = "";
-            if (oSystemParameter.ShowBill(ref sErr))
-            {
-                if (oSystemParameter.omodel.WMS_CampanyName == "涔斾竴")
-                {
-
-                }
-                else
-                {
-                    if (oSub.HDeptID == 0)
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鐢熶骇杞﹂棿涓嶈兘涓虹┖";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
-                }
-            }
 
             if (oSub.HQty <= 0 || oSub.HQty == null)
             {
diff --git a/WebAPI/Web.config b/WebAPI/Web.config
index 0b65f4f..ccc39e9 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -20,7 +20,7 @@
 	<appSettings>
 		<!--鏈嶅姟鍣ㄦ枃浠禝P鍦板潃-->
 		<!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
-		<add key="FileIP" value="http://localhost:8080/" />
+		<!--<add key="FileIP" value="http://localhost:8080/" />-->
 		<!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
 		<add key="sUrl" value="http://192.168.63.3/WEBS-WMS/WebService1.asmx"/>	<!--棰滃彴寮忔満-->
 		<!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> 澶忓疂-->
@@ -33,6 +33,7 @@
 		<!--<add key="sUrl" value="http://122.227.133.186:8090/WEBS/WebService1.asmx"/>	-->
 		<!--<add key="sUrl" value="http://192.168.80.90:9090/WEBS-WMS/WebService1.asmx"/>     瀹夌憺鏈嶅姟鍣�-->
 		<!--<add key="sUrl" value="http://47.96.97.237/WEBS-WMS/WebService1.asmx"/>    娴嬭瘯鏈嶅姟鍣�-->
+		<add key="sUrl" value="http://localhost:8082/WEBS/WebService1.asmx"/>    <!--鏈湴-->
 		<add key="webpages:Version" value="3.0.0.0" />
 		<add key="webpages:Enabled" value="false" />
 		<add key="ClientValidationEnabled" value="true" />

--
Gitblit v1.9.1