From cdc0ee4c7019f8466327e713153a1cd147a152c0 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期二, 07 六月 2022 10:02:43 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WarM/条码打印/Sc_ICMOToBarCode.cs                              |   27 +++++---
 Pub_Class/CustomerCls/ClsXt_SystemParameter.cs             |    8 ++
 WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs |   18 +++---
 Model/车间管理/ClsSc_ProcessExchangeBillMain.cs                |    1 
 WebAPI/Controllers/WebAPIController.cs                     |   13 ++-
 BLL/公用模块/FrmLogin.cs                                       |   49 +++++++++-------
 Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs         |    2 
 DAL/车间管理/ClsSc_ProcessExchangeBill.cs                      |    7 +-
 WarM/条码打印/Gy_BarCodeBill.cs                                |    4 
 9 files changed, 77 insertions(+), 52 deletions(-)

diff --git "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs" "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
index 00253fd..af3aed1 100644
--- "a/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
+++ "b/BLL/\345\205\254\347\224\250\346\250\241\345\235\227/FrmLogin.cs"
@@ -22,7 +22,7 @@
         private void SetCmbAccount(string sServer)//cmb涓缃笎濂�  //Lock
         {
             ClsCNmaster oCn = new ClsCNmaster();
-            DataSet DS ;
+            DataSet DS;
             try
             {
                 DS = oCn.RunProcReturn("select * from HDSystem_DataBases where YNuse=1 ", "HDSystem_DataBases", ref ClsPub.sExeReturnInfo);
@@ -40,7 +40,7 @@
                 {
                     cmbAccount.SelectedIndex = 0;
                     ClsIni oIni = new ClsIni();
-                    string sNumber = ClsIni.ReadIni("Erp", "DataBaseNumber",DBUtility.ClsPub.AppPath + @"/HXErp.ini");
+                    string sNumber = ClsIni.ReadIni("Erp", "DataBaseNumber", DBUtility.ClsPub.AppPath + @"/HXErp.ini");
                     for (int j = 0; j < cmbAccount.Items.Count; j++)
                     {
                         if (sNumber.Trim() == cmbAccount.Items[j].ToString().Trim())
@@ -56,7 +56,7 @@
 
         private bool CheckServer()//妫�鏌ユ湇鍔″櫒鍚嶆纭��  //Lock
         {
-            ClsCN oCn=new ClsCN(); 
+            ClsCN oCn = new ClsCN();
             if (oCn.CheckOpen())
             {
                 lblStatus.Text = "鏈嶅姟鍣ㄨ繛鎺ユ垚鍔�";
@@ -109,19 +109,19 @@
             string sDataBase_K3 = "";
             string sDataBase_K32 = "";
             string sDataBase_K33 = "";
-            sDataBase = oCn.GetDataBase(cmbAccount.Text.Trim(),ref sDataBase_K3);       
+            sDataBase = oCn.GetDataBase(cmbAccount.Text.Trim(), ref sDataBase_K3);
             ClsIni oIni = new ClsIni();
             ClsIni.WriteIni("Erp", "DataBase", sDataBase.Trim(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             ClsIni.WriteIni("K3Erp", "DataBase", sDataBase_K3.Trim(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             DAL.ClsUser oUser = new DAL.ClsUser();
-            
-            ds = oUser.CheckCzymc(cmbUser.Text.Trim(),ClsPub.StrToPsd( txtPsd.Text.Trim()));
-            if (ds ==null)
+
+            ds = oUser.CheckCzymc(cmbUser.Text.Trim(), ClsPub.StrToPsd(txtPsd.Text.Trim()));
+            if (ds == null)
             {
                 MessageBox.Show("閫夋嫨鐨勫笎濂椾笉瀛樺湪锛�", "鎻愮ず");
                 return;
             }
-            if (ds.Tables[0].Rows.Count >0)
+            if (ds.Tables[0].Rows.Count > 0)
             {
                 ClsPub.CurUserID = ds.Tables[0].Rows[0]["Czybm"].ToString();
                 this.Close();
@@ -135,7 +135,7 @@
             //寰楀埌褰撳墠浼氳鏈熼棿
             int sYear = 0;
             int sPeriod = 0;
-            if (!ClsPub.Sub_GetCurPeriod(ref sYear,ref sPeriod))
+            if (!ClsPub.Sub_GetCurPeriod(ref sYear, ref sPeriod))
             {
                 MessageBox.Show("寰楀埌褰撳墠浼氳鏈熼棿澶辫触锛�", "鎻愮ず", MessageBoxButtons.OK, MessageBoxIcon.Error);
                 isOk = false;
@@ -162,18 +162,18 @@
             }
             foreach (string eachStr in listStr)
             {
-                UserName = UserName+eachStr + ",";
+                UserName = UserName + eachStr + ",";
             }
             UserName = UserName.Remove(UserName.LastIndexOf(","), 1);
             //
-            ClsIni.WriteIni("UserInfo", "UserName", UserName, DBUtility.ClsPub.AppPath + @"/HXERP.ini"); 
+            ClsIni.WriteIni("UserInfo", "UserName", UserName, DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             ClsIni.WriteIni("UserInfo", "HOrgName", cmbHOrg.Text.ToString(), DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             ClsPub.CurUserName = cmbUser.Text.Trim();
             ClsPub.AppPath = System.Environment.CurrentDirectory;
             ClsPub.HOrgID = ClsPub.get_ORGANIZATIONSIDByName(ClsPub.isStrNull(cmbHOrg.Text));
             ClsPub.HOrgNumber = ClsPub.get_ORGANIZATIONSNOByName(ClsPub.isStrNull(cmbHOrg.Text));
             ClsPub.HOrgName = ClsPub.isStrNull(cmbHOrg.Text);
-            if(chkRemember.Checked==true  ) 
+            if (chkRemember.Checked == true)
             {
                 ClsIni.WriteIni("UserInfo", "UserPsd", "", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                 ClsIni.WriteIni("UserInfo", "Remember", "1", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
@@ -183,7 +183,7 @@
                 ClsIni.WriteIni("UserInfo", "UserPsd", "", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
                 ClsIni.WriteIni("UserInfo", "Remember", "0", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             }
-            
+
         }
 
         private void txtUser_KeyUp(object sender, KeyEventArgs e)
@@ -194,8 +194,8 @@
 
         private void txtPsd_KeyUp(object sender, KeyEventArgs e)
         {
-            if (e.KeyValue == 13)  
-            this.btnOK_Click(sender,e);
+            if (e.KeyValue == 13)
+                this.btnOK_Click(sender, e);
         }
 
         private void timer1_Tick(object sender, EventArgs e)
@@ -207,7 +207,7 @@
             }
             ClsIni oIni = new ClsIni();
             //
-            UserName = ClsIni.ReadIni("UserInfo", "UserName",DBUtility.ClsPub.AppPath +  @"/HXERP.ini");
+            UserName = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
 
             string[] strArr = UserName.Split(',');
             foreach (string str in strArr)
@@ -216,7 +216,7 @@
             }
             cmbUser.SelectedIndex = 0;
             //
-            txtUser.Text = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath +  @"/HXERP.ini");
+            txtUser.Text = ClsIni.ReadIni("UserInfo", "UserName", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
             if (ClsIni.ReadIni("UserInfo", "Remember", DBUtility.ClsPub.AppPath + @"/HXERP.ini") == "1")
             {
                 txtPsd.Text = ClsIni.ReadIni("UserInfo", "UserPsd", DBUtility.ClsPub.AppPath + @"/HXERP.ini");
@@ -224,8 +224,8 @@
             }
             else
             {
-                txtPsd.Text ="";
-                chkRemember.Checked = false ;
+                txtPsd.Text = "";
+                chkRemember.Checked = false;
             }
         }
 
@@ -319,8 +319,8 @@
         public DataSet get_ORGANIZATIONSList()
         {
             try
-            { 
-                return  ClsPub.get_ORGANIZATIONSList();
+            {
+                return ClsPub.get_ORGANIZATIONSList();
             }
             catch (Exception e)
             {
@@ -335,7 +335,7 @@
 
         private void label4_Click(object sender, EventArgs e)
         {
-            if (MessageBox.Show("纭畾瑕佹墜鍔ㄦ洿鏂扮▼搴忓悧锛熸湰绋嬪簭灏嗚嚜鍔ㄥ叧闂紒","鎻愮ず",MessageBoxButtons.OKCancel)==DialogResult.OK)
+            if (MessageBox.Show("纭畾瑕佹墜鍔ㄦ洿鏂扮▼搴忓悧锛熸湰绋嬪簭灏嗚嚜鍔ㄥ叧闂紒", "鎻愮ず", MessageBoxButtons.OKCancel) == DialogResult.OK)
             {
                 string strFileName = ClsPub.AppPath + @"/HX_Update.exe";
                 System.Diagnostics.Process.Start(strFileName);
@@ -347,6 +347,11 @@
         {
             //textBox1.Focus();
             string HPassWord = textBox1.Text.Trim().ToString();
+            if (HPassWord == null || HPassWord == "")
+            {
+                MessageBox.Show("璇峰埛鍗�");
+                return;
+            }
             //MessageBox.Show(HPassWord);
             SQLHelper.ClsCN oCn1 = new SQLHelper.ClsCN();
             //1.鏌ユ壘鏁版嵁搴撴搷浣滃憳绠$悊琛ㄩ噷闈㈡槸鍚︽湁瀵瑰簲杩欎釜鍔犲瘑瀛楃涓插搴旂殑璁板綍
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 847bfa4..b6d37ed 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"
@@ -117,6 +117,7 @@
                 ",HMaterTexture='" + omodel.HMaterTexture + "'" +
                 ",HProductNum='" + omodel.HProductNum + "'" +
                 ",HVerNum='" + omodel.HVerNum + "'" +
+                ",WorkBillSortNo='" + omodel.WorkBillSortNo + "'" +
                 //鍔犲叆鐢熶骇绫诲瀷
                 ",HWorkTypeNum='" + omodel.HWorkTypeNum + "'" +
                 " where HInterID=" + lngBillKey.ToString());
@@ -291,7 +292,7 @@
                 ",HProdMaterName,HCusName,HWorkRemark,HImportNote,HMaterNumber_A" +
                 ",HMaterNumber_B,HMaterNumber_C,HMaterNumber_D,HProdType,HMaterShortName" +
                 ",HMaterIDA,HMaterIDB,HMaterIDC,HMaterIDD,HICMOEntryID" +
-                ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag" +
+                ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,WorkBillSortNo" +
                 ") " +
                 " 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 + "'" +
@@ -303,8 +304,8 @@
                 ",'" + omodel.HProdMaterName + "','" + omodel.HCusName + "','" + omodel.HWorkRemark + "','" + omodel.HImportNote + "','" + omodel.HMaterNumber_A + "'" +
                 ",'" + omodel.HMaterNumber_B + "','" + omodel.HMaterNumber_C + "','" + omodel.HMaterNumber_D + "','" + omodel.HProdType + "','" + omodel.HMaterShortName + "'" +
                 ",'" + omodel.HMaterIDA + "','" + omodel.HMaterIDB + "','" + omodel.HMaterIDC + "','" + omodel.HMaterIDD + "'," + omodel.HICMOEntryID +
-                ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','"+omodel.HBLFlag+"'" +
-                ") ");
+                ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','"+omodel.HBLFlag+"','" + omodel.WorkBillSortNo + 
+                "') ");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl)
                 {
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 4334547..e481a7d 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"
@@ -66,5 +66,6 @@
         public string HVerNum;//版本
         public string HSeOrderEntryID;
         public string HSeOrderInterID;
+        public string WorkBillSortNo;
     }
 }
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
index e95380d..7fc3709 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameter.cs
@@ -406,6 +406,10 @@
                     {
                         omodel.Kf_OtherInBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_OtherInBillCheck_MustQtyCtl")
+                    {
+                        omodel.Kf_OtherInBillCheck_MustQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
                     //其他出库单
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_OtherOutBill_AutoCheck")
                     {
@@ -423,6 +427,10 @@
                     {
                         omodel.Kf_OtherOutBill_BillTypeOneScan = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
                     }
+                    if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_OtherOutBillCheck_MustQtyCtl")
+                    {
+                        omodel.Kf_OtherOutBillCheck_MustQtyCtl = ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HValue"]);
+                    }
                     //调拨单
                     if (ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HKey"]) == "Kf_MoveStockBill_AutoCheck")
                     {
diff --git a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
index c920232..92fa632 100644
--- a/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
+++ b/Pub_Class/CustomerCls/ClsXt_SystemParameterMain.cs
@@ -98,12 +98,14 @@
         public string Kf_OtherInBill_MustQtyCtl;
         public string Kf_OtherInBill_BarCodeMustSameSourceBill;   // 条码必须同源单一致
         public string Kf_OtherInBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
+        public string Kf_OtherInBillCheck_MustQtyCtl;   //校验数量控制
         //其他出库
         public string Kf_OtherOutBill_AutoCheck;
         public string Kf_OtherOutBill_ERPMode;
         public string Kf_OtherOutBill_MustQtyCtl;
         public string Kf_OtherOutBill_BarCodeMustSameSourceBill;   // 条码必须同源单一致
         public string Kf_OtherOutBill_BillTypeOneScan;//本单据类型内只允许一次扫码(唯一码,含缓存列表)
+        public string Kf_OtherOutBillCheck_MustQtyCtl;   //校验数量控制
         //调拨
         public string Kf_MoveStockBill_AutoCheck;
         public string Kf_MoveStockBill_ERPMode;
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
index 76eab56..4e69093 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
@@ -1073,7 +1073,7 @@
                                     ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " +
                                     ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " +
                                     ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID,HEntryID " +
-                                    ",HGiveAwayFlag,HSeOrderSEQ " +
+                                    ",HGiveAwayFlag,HSeOrderSEQ,HInitSourceEntryID " +
                                     ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " +
                                     ") values ("
                                     + "'" + HBarCode + "','" + HBarCodeType + "'," + HMaterID.ToString() + "," + HUnitID.ToString() + "," + HQty2.ToString()
@@ -1082,7 +1082,7 @@
                                     + ", " + HBarcodeQtys.ToString() + "," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + "," + HWhID.ToString() + "," + HSPID.ToString() + ",'" + HRemark + "'"
                                     + ", " + HCusID.ToString() + ",'" + HCusType + "','" + HEndDate.ToShortDateString() + "','" + HWorkLineName + "','" + sDate + "'"
                                     + ", " + HOrgID.ToString() + "," + HOrgID.ToString() + ",'" + HSeOrderBillNo + "'," + HInterID.ToString() + "," + HEntryID.ToString() + ""
-                                    + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString()
+                                    + ", " + DBUtility.ClsPub.BoolToString(HGiveAwayFlag) + "," + HSeOrderSEQ.ToString() + "," + HSourceEntryID.ToString()
                                     + ",'" + HMaterName + "','" + HMaterModel + "','" + HPinfan + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "','" + HInnerBillNo + "')");
 
 
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 ab43982..23d3fb3 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"
@@ -228,7 +228,7 @@
 
             DataSet DSet;
 
-            DSet = oCn.RunProcReturn("Select * from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
+            DSet = oCn.RunProcReturn("Select HEmpID from gy_czygl Where czymc='" + HUserName + "'", "gy_czygl", ref DBUtility.ClsPub.sExeReturnInfo);
             
             if (DSet == null)
             //if (DSet == null|| DSet.Tables[0].Rows.Count == 0)
@@ -244,7 +244,7 @@
                 {
 
 
-                    txtHEmpID.Tag = DBUtility.ClsPub.isInt(DSet.Tables[0].Rows[0]["HEmpID"]);
+                    txtHEmpID.Tag = DBUtility.ClsPub.isStrNull(DSet.Tables[0].Rows[0]["HEmpID"]);
                 }
                 else
                 {
@@ -1022,18 +1022,19 @@
                 {
                     if (HZXQty > DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value))
                     {
-                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
-                        return;
+                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+
+                        //MessageBox.Show("璇风偣鍑昏秴棰濈敓浜ф寜閽敓鎴愭潯鐮侊紒");
+                        //return;
                     }
                     else
                     {
-                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
+                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = HZXQty;
                         //
 
-                        HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
-                        grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        //HZXQty = HZXQty - DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
+                        //grdMain.Rows[i].Cells["鏈鏁伴噺"].Value = DBUtility.ClsPub.isDoule(grdMain.Rows[i].Cells["鐢熶骇璁㈠崟鏁伴噺"].Value);
                     }
                 }
                 else
@@ -1700,14 +1701,17 @@
         private void cmdHSourceID_Click(object sender, EventArgs e)
         {
             Int64 HEmpID = 0;
-            HEmpID = ClsPub.isLong(txtHEmpID.Tag);
+            HEmpID = Convert.ToInt64(txtHEmpID.Tag);
+
+           
+            //MessageBox.Show(ClsPub.isStrNull(HEmpID));
             //string HEmpName = "";
             //HEmpName = ClsPub.isStrNull(txtHEmpID.Text);
 
             DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
             if (HEmpID != 0)
             {
-                if (oSource.GetInfoByID(HEmpID))
+                if (oSource.GetInfoByID_AoBang(HEmpID))
                 {
                     this.txtHSourceID.Text = oSource.oModel.HName;
                     this.txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
@@ -1925,6 +1929,7 @@
             grdList.DataSource = null;
             grdSub.DataSource = null;
             grdMain.DataSource = null;
+            txtHEmpID.Tag = 0;
         }
 
         private void button2_Click(object sender, EventArgs e)
diff --git a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
index 6e9855f..51bce5f 100644
--- a/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_ComplementGoodBillController.cs
@@ -394,14 +394,14 @@
                             return objJsonResult;
                         }
 
-                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
-                   $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
+                        ds = oCN.RunProcReturn("select sum(d.HQty) HQty from JIT_CallGoodsBackRequestBillSub c inner join JIT_CallGoodsBackBillSub d on c.HInterID = d.HSourceInterID and c.HEntryID = d.HSourceEntryID and c.HMaterID = d.HMaterID " +
+                   $"where c.HSourceInterID={listCa[i].HSouceInterID} and c.HSourceEntryID ={listCa[i].HSourceEntryID} and c.HSourceBillNo = '{listCa[i].HSourceBillNo}' and c.HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
 
                         if ((double.Parse(ds.Tables[0].Rows[0][0].ToString()==""?"0": ds.Tables[0].Rows[0][0].ToString()) +listCa[i].閫�鏂欐暟閲�) > listCa[i].宸插彨鏂欐暟閲�)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
-                            objJsonResult.Message = $"宸茬粡閫�鏂欑敵璇锋暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
+                            objJsonResult.Message = $"宸茬粡閫�鏂欐暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
@@ -531,14 +531,14 @@
                             return objJsonResult;
                         }
 
-                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
-                $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
+                        ds = oCN.RunProcReturn("select sum(d.HQty) HQty from JIT_CallGoodsBackRequestBillSub c inner join JIT_CallGoodsBackBillSub d on c.HInterID = d.HSourceInterID and c.HEntryID = d.HSourceEntryID and c.HMaterID = d.HMaterID " +
+                   $"where c.HSourceInterID={listCa[i].HSouceInterID} and c.HSourceEntryID ={listCa[i].HSourceEntryID} and c.HSourceBillNo = '{listCa[i].HSourceBillNo}' and c.HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
 
                         if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].閫�鏂欐暟閲�) > listCa[i].宸插彨鏂欐暟閲�)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
-                            objJsonResult.Message = $"宸茬粡閫�鏂欑敵璇锋暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
+                            objJsonResult.Message = $"宸茬粡閫�鏂欐暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
@@ -628,14 +628,14 @@
                             return objJsonResult;
                         }
 
-                        ds = oCN.RunProcReturn("select sum(HQty) from JIT_CallGoodsBackRequestBillSub " +
-               $"where HSourceInterID={listCa[i].HSouceInterID} and HSourceEntryID ={listCa[i].HSourceEntryID} and HSourceBillNo = '{listCa[i].HSourceBillNo}' and HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
+                        ds = oCN.RunProcReturn("select sum(d.HQty) HQty from JIT_CallGoodsBackRequestBillSub c inner join JIT_CallGoodsBackBillSub d on c.HInterID = d.HSourceInterID and c.HEntryID = d.HSourceEntryID and c.HMaterID = d.HMaterID " +
+                   $"where c.HSourceInterID={listCa[i].HSouceInterID} and c.HSourceEntryID ={listCa[i].HSourceEntryID} and c.HSourceBillNo = '{listCa[i].HSourceBillNo}' and c.HMaterID={listCa[i].HMaterialID}", "JIT_CallGoodsBackRequestBillSub");
 
                         if ((double.Parse(ds.Tables[0].Rows[0][0].ToString() == "" ? "0" : ds.Tables[0].Rows[0][0].ToString()) + listCa[i].閫�鏂欐暟閲�) > listCa[i].宸插彨鏂欐暟閲�)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
-                            objJsonResult.Message = $"宸茬粡閫�鏂欑敵璇锋暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
+                            objJsonResult.Message = $"宸茬粡閫�鏂欐暟閲�:{double.Parse(ds.Tables[0].Rows[0][0].ToString())},鍙��鏂欐暟閲忎负:{(listCa[i].宸插彨鏂欐暟閲� - double.Parse(ds.Tables[0].Rows[0][0].ToString()))}!";
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 95a5aeb..dfa6370 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -832,23 +832,26 @@
             }
         }
 
+
         /// <summary>
         /// 鑾峰彇渚涘簲鍟嗗垪琛�
         /// </summary>
         /// <returns></returns>
         [Route("Web/GetSupplierList_Json")]
         [HttpGet]
-        public object GetSupplierList_Json(string Supplier)
+        public object GetSupplierList_Json(string Supplier, Int64 HOrgID)
         {
-            sWhere = " Where HStopFlag=0  and HEndFlag=1";
+            sWhere = " Where HStopFlag=0  and HEndFlag=1 and HUSEORGID =" + HOrgID + "";
             //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
             if (Supplier != "")
             {
-                sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' ) ";
+                sWhere = sWhere + " and ( HNumber like '%" + Supplier + "%' or HName like '%" + Supplier + "%' or HUSEORGID like '%" + Supplier + "%' ) ";
             }
             try
             {
-                ds = webserver.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+                WebS.WebService1 oWeb = new WebS.WebService1();
+                ds = oWeb.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+                //ds = webserver.GetSupplierList(sWhere, ref DBUtility.ClsPub.sErrInfo);
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objjson.code = "0";
@@ -1231,7 +1234,7 @@
             //sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
             if (sWhere != "")
             {
-                sWhere = sWhere + " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
+                sWhere = " and ( HNumber like '%" + sWhere + "%' or HName like '%" + sWhere + "%' ) ";
             }
             try
             {

--
Gitblit v1.9.1