From 28161a2db7a593c30ca53e5c1e59103cd7591fe7 Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 27 四月 2026 09:47:32 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |  158 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 132 insertions(+), 26 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index c55dcbc..e8b6fb5 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -239,19 +239,20 @@
                     }
 
                     //鍒ゆ柇瀹㈡埛涓嶄负榫欏北姹介厤
-                    if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤" && oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�" && oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧" && oSystemParameter.omodel.WMS_CampanyName != "娴疯瘹") //绯荤粺鍙傛暟                      
-                    {
-                        if (HSourceID == 0)
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "[0000-2-006]鐢熶骇璧勬簮娌℃湁閫夋嫨锛�";
-                            objJsonResult.data = null;
-                            return objJsonResult;
-                        }
-                    }
-                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
-                    else if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
+                    //if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤" && oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�" && oSystemParameter.omodel.WMS_CampanyName != "娣诲悍绉戞妧" && oSystemParameter.omodel.WMS_CampanyName != "娴疯瘹") //绯荤粺鍙傛暟                      
+                    //{
+                    //    if (HSourceID == 0)
+                    //    {
+                    //        objJsonResult.code = "0";
+                    //        objJsonResult.count = 0;
+                    //        objJsonResult.Message = "[0000-2-006]鐢熶骇璧勬簮娌℃湁閫夋嫨锛�";
+                    //        objJsonResult.data = null;
+                    //        return objJsonResult;
+                    //    }
+                    //}
+                    ////鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
+                    //else 
+                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
                     {
                         //鍒ゆ柇鏄惁涓哄宸ヤ綅
                         ds = oCN.RunProcReturn("select * from h_v_GetStationOutBill_Detail where 宸ュ簭ID = " + HProcID + " and 鐗╂枡ID = " + HMaterID + " and 娴佽浆鍗″彿 = '" + HProcExchBillNo + "'", "h_v_GetStationOutBill_Detail");
@@ -1408,12 +1409,12 @@
                     return objJsonResult;
                 }
 
-                if (totalWeight <= 0)
+                if (totalWeight < 0)
                 {
                     oCN.RollBack();
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
-                    objJsonResult.Message = "淇濆瓨澶辫触锛侀噸閲忓繀椤诲ぇ浜�0";
+                    objJsonResult.Message = "淇濆瓨澶辫触锛侀噸閲忓繀椤诲ぇ浜庣瓑浜�0";
                     objJsonResult.data = 1;
                     return objJsonResult;
                 }
@@ -2655,14 +2656,17 @@
                         objJsonResult.data = null;
                         return objJsonResult;
                     }
-                    if (oBill.omodel.HChecker != "")
+                    if (oSystemParameter.omodel.WMS_CampanyName != "鍗庤垷")
                     {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "[0000-1-013]鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
+                        if (oBill.omodel.HChecker != "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "[0000-1-013]鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }                    
 
                     ds = oCn.RunProcReturn($"exec h_p_DelOutInBill {HInterID},'MES_StationOutBill_DeleteRelationCtl'", "h_p_DelOutInBill");
 
@@ -3792,15 +3796,15 @@
         #region 宸ュ簭姹囨姤鍗曡幏鍙栧搴旀墍浠ュ簭鍒�
         [Route("Cj_StationOutBill/getAllHSEQ")]
         [HttpGet]
-        public object getAllHSEQ(string HInterID)
+        public object getAllHSEQ(int HInterID)
         {
             try
             {
                 //寰楀埌淇℃伅锛堝澶栨爣璁颁负0鏃讹紝娴佽浆鏍囪涓�1鏃�
-                ds = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillSEQ  where HInterID= " + HInterID, "Sc_ProcessExchangeBillSEQ");
+                DataSet DS = oCN.RunProcReturn("select * from Sc_ProcessExchangeBillSEQ  where HInterID= " + HInterID, "Sc_ProcessExchangeBillSEQ");
                 
                 //鍐欏叆淇℃伅
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                if (DS == null || DS.Tables[0].Rows.Count == 0)
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -3811,7 +3815,7 @@
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "[0000-1-037]Sucess锛�";
-                objJsonResult.data = ds.Tables[0];
+                objJsonResult.data = DS.Tables[0];
                 return objJsonResult;
             }
             catch (Exception e)
@@ -4879,6 +4883,7 @@
 
         #endregion
 
+        #region 宸ュ簭姹囨姤锛屽鏍稿墠淇敼
         //瀹℃牳锛屽甫缂栬緫鍔熻兘
         [Route("Cj_StationOutBill/setOtherProperty")]
         [HttpPost]
@@ -5031,5 +5036,106 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
+        #region 宸ュ簭姹囨姤鑷姩鐢熸垚杩涚珯鎺ユ敹鍗�
+        //宸ュ簭姹囨姤寮�宸ユ寜閽嚜鍔ㄥ紑宸�
+        [Route("Cj_StationOutBill/startTranslating")]
+        [HttpGet]
+        public object startTranslating(int HProcExchInterID,int HProcExchEntryID,int HOrgID,int HProcNo,string user)
+        {
+            try
+            {
+                oCN.BeginTran();
+                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Cj_StationInBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "[3790-2-003]寮�宸ュ崟鏃犵紪杈戞潈闄�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                string HBillType = "3790";
+                string HBillNo = "";
+                Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                HInterID = DBUtility.ClsPub.CreateBillID(HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                HBillNo = DBUtility.ClsPub.CreateBillCode(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+                int HBillStatus = 0;
+                string HMaker = user;
+                int HYear = DateTime.Now.Year;
+                double HPeriod = DateTime.Now.Month;
+                string HRemark = "鍑烘垬姹囨姤鍗曡嚜鍔ㄥ紑宸�";//澶囨敞
+                long HICMOInterID = 0;//浠诲姟鍗旾D
+                string HICMOBillNo = "";//浠诲姟鍗�
+                long HProcPlanInterID = 0;
+                long HProcPlanEntryID = 0;
+                string HProcPlanBillNo = "";
+                long HMaterID = 1;//浜у搧ID
+                long HProcID = 1;//褰撳墠宸ュ簭
+                double HICMOQty = 0;//浠诲姟鍗曟暟閲�
+                double HPlanQty = 0;//娴佽浆鍗℃暟閲�
+                long HSourceID = 0;//鐢熶骇璧勬簮ID
+                long HGroupID = 0;//鐝粍ID
+                long HDeptID = 0;
+                long HEmpID = 0;//鎺ユ敹浜篒D
+                string HBarCode = "";//鏉″舰鐮�
+                string HAddr = "";
+                string HBarCodeMaker = "";
+                long HSupID = 0;
+                double HQty = 0;//鎺ユ敹鏁伴噺
+                double HPrice = 0;
+                double HMoney = 0;
+                double HPieceQty = 0;//鎺ユ敹浠舵暟
+                string HSourceName = "";//鐢熶骇璧勬簮鍚嶇О
+                long HCenterID = 0;//宸ヤ綔涓績ID
+                string HOrderProcNO = "";//璁㈠崟璺熻釜鍙�
+                long HPRDOrgID = HOrgID;//缁勭粐ID
+                double HmaterOutqty = 0;//鐧藉澂鍙戝竷
+                string HProcExchBillNo = "";//涓婃枡闃查敊鍗曞崟鎹彿
+                int HMainInterID = 0;//鐧藉澂鍙戝竷
+                oCN.RunProc("Insert Into Sc_StationInBillMain " +
+                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
+                    ",HYear,HPeriod,HRemark" +
+                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
+                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationInTime,HSourceID" +
+                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
+                    ",HSupID,HQty,HPrice,HMoney,HPieceQty,HSourceName,HCenterID" +
+                    ",HProcNo,HOrderProcNO,HMainInterID,HPRDOrgID" +
+                    ",HmaterOutqty" +
+                    ") " +
+                    " values('" + HBillType + "','" + (HBillType) + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
+                    "," + HYear + "," + HPeriod + ",'" + HRemark + "'" +
+                    "," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
+                    ",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID +
+                    "," + HGroupID + "," + HDeptID + "," + HEmpID + ",'" + HBarCode + "','" + HAddr + "','" + HBarCodeMaker + "',getdate()" +
+                    "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty + ",'" + HSourceName + "'," + HCenterID +
+                    ",'" + HProcNo + "','" + HOrderProcNO + "','" + HMainInterID + "'," + HPRDOrgID +
+                    "," + HmaterOutqty + ") ");
+
+
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+
+
+
+                
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "寮�宸ュけ璐ワ紒" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1