From a348593630e7e3f382f963387de077781414fa6f Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 22 八月 2025 22:27:20 +0800 Subject: [PATCH] 迦南:自动装箱 --- WebAPI/Controllers/仓存管理/条码生成/Sc_BarCodeController.cs | 96 ++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 81 insertions(+), 15 deletions(-) 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 e8bdc10..d16815a 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" @@ -132,6 +132,10 @@ list.Add("鍞竴鏉$爜"); list.Add("鎵规鏉$爜"); } + else if (sCapName == "娴疯瘹") + { + list.Add("鍝佺鏉$爜"); + } else { list.Add("鍞竴鏉$爜"); @@ -589,6 +593,16 @@ ordrlist.HGiveAwayFlag = 0; } } + if (HSourceBillType == "鏀舵枡閫氱煡鍗�" || HSourceBillType == "閲囪喘璁㈠崟") + { + if (oSystemParameter.omodel.WMS_CampanyName == "娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + ordrlist.HSourceBillSEQ = dt.Rows[i]["HSEQ"].ToString(); + ordrlist.HFactory = dt.Rows[i]["瀹㈡埛缂栧彿"].ToString(); + ordrlist.HCoilNO = dt.Rows[i]["娆惧彿"].ToString(); + ordrlist.HFurnaceNO = dt.Rows[i]["鍒嗙粍"].ToString(); + } + } } if (HSourceBillType == "閫�璐ч�氱煡鍗�") { @@ -621,7 +635,7 @@ //鏍规嵁TABLE鍐欏叆鐣岄潰(鍑哄叆搴撳崟鎹�) private object Sub_WriteInForm_InOut(DataTable dt, HSouceOrderList ordrlist, string HBarCodeType, string HSourceBillType) { - + oSystemParameter.ShowBill(ref DBUtility.ClsPub.sExeReturnInfo); for (int i = 0; i < dt.Rows.Count; i++) { ordrlist.HQty = dt.Rows[i]["鍙敓鎴愭潯鐮佹暟閲�"].ToString(); @@ -654,6 +668,20 @@ ordrlist.HMTONo = dt.Rows[i]["璁″垝璺熻釜鍙�"].ToString(); ordrlist.HDate = dt.Rows[i]["鏃ユ湡"].ToString(); ordrlist.HShowDate = DateTime.Now.ToString(); + + if(HSourceBillType=="閲囪喘鍏ュ簱鍗�") + { + if(oSystemParameter.omodel.WMS_CampanyName=="娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� 绌虹櫧涓洪�氱敤 + { + ordrlist.HInnerBillNo = dt.Rows[i]["閲囪喘璁㈠崟鍙�"].ToString(); + ordrlist.HSupID = dt.Rows[i]["HSupID"].ToString(); + ordrlist.HSupNumber = dt.Rows[i]["渚涘簲鍟嗕唬鐮�"].ToString(); + ordrlist.HSupName = dt.Rows[i]["渚涘簲鍟�"].ToString(); + ordrlist.HFactory = dt.Rows[i]["瀹㈡埛缂栧彿"].ToString(); + ordrlist.HCoilNO = dt.Rows[i]["娆惧彿"].ToString(); + ordrlist.HFurnaceNO = dt.Rows[i]["鍒嗙粍"].ToString(); + } + } } return ordrlist; } @@ -801,12 +829,13 @@ long HMaterID = DBUtility.ClsPub.isLong(ordrlist[i].HMaterID); // 鐗╂枡鍐呯爜 string HBatchNo = DBUtility.ClsPub.isStrNull(ordrlist[i].HBatchNo); // 鎵瑰彿 long HAuxPropID = DBUtility.ClsPub.isLong(ordrlist[i].HAuxPropID); // 杈呭姪灞炴�D + string HMTONo = DBUtility.ClsPub.isStrNull(ordrlist[i].HMTONo); //璁″垝璺熻釜鍙� double HSourceQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 婧愬崟鏁伴噺 double HQty = DBUtility.ClsPub.isDoule(ordrlist[i].HQty); // 鏁伴噺 double HMinQty = DBUtility.ClsPub.isDoule(ordrlist[i].HMinQty); // 鏈�灏忓寘瑁呮暟 if (HMaterID != 0) { - DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + "," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck"); + DataSet oDsCheck = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_AddCheck_New " + HSno.ToString() + ",'" + HBarCodeType + "','" + HSourceBillNo + "'," + HMaterID.ToString() + ",'" + HBatchNo + "'," + HAuxPropID.ToString() + ",'" + HMTONo + "'," + HSourceQty.ToString() + "," + HQty.ToString() + "," + HMinQty.ToString() + "," + HOrgID.ToString() + ",'" + SourceQtyCtl + "'", "h_p_Gy_BarCodeBill_AddCheck_New"); if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -845,7 +874,7 @@ int HBQty = 0; //绠辨暟 double HQty = 0; //鏁伴噺 string WeiShu = ""; //灏炬暟 - int LSH = 0; //娴佹按鍙� + Int64 LSH = 0; //娴佹按鍙� string LSH2 = ""; //娴佹按鍙疯浆鎹㈡垚瀛楃 string sDate = ""; //鏃ユ湡 string sYear = ""; //骞� @@ -935,7 +964,7 @@ sTMNumber = HNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } else if (CampanyName == "椋為緳") { @@ -952,7 +981,7 @@ sTMNumber = HWorksNumber + HNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } else if (CampanyName == "鐟炰笌绁�") { var date = DateTime.Now.ToString("yyMMdd");//鏃ユ湡 @@ -977,7 +1006,7 @@ //sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-" + date + "-" + ordrlist[j].HSupNumber + "-"; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } else if (HSourceBillTypeName == "鐢熶骇鍏ュ簱鍗�") { @@ -1011,13 +1040,13 @@ //sTMNumber = ordrlist[j].HMaterNumber + "-鍖呰鏍囪瘑-"+ date + "-缁勭粐浠g爜-"; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } else { sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } } else //閫氱敤鏂规硶 @@ -1026,7 +1055,7 @@ sTMNumber = HOrgNumber + HNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } } else if (HSelectBarCodeType == "鍝佺鏉$爜") @@ -1050,7 +1079,7 @@ sTMNumber = HMaterNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); LSHlen = 4; } else if (HSelectBarCodeType == "浠櫒鎴愬搧鏉$爜瑙勫垯") //鍙﹀澶勭悊浜� @@ -1067,7 +1096,7 @@ sTMNumber = HMaterNumber + HBatchNo; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); LSHlen = 6; } else if (HSelectBarCodeType == "鍐呴攢鏈烘潯鐮�") @@ -1077,7 +1106,7 @@ sTMNumber = "1" + HModelName + HBarCodeDate + HBarCodeBatchNo + HYasuoji + "00"; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); LSHlen = 5; if (sTMNumber.Length != 16) { @@ -1094,7 +1123,7 @@ sTMNumber = HMaterNumber.Replace(".", "") + HBarCodeDate + HBarCodeBatchNo; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); LSHlen = 5; if (sTMNumber.Length != 18) { @@ -1110,7 +1139,7 @@ sTMNumber = HICMOBillNo; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 //oCn.RunProc("exec h_p_WMS_SetMaxNo '" + sTMNumber + "'"); - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); LSHlen = 5; } else if (HSelectBarCodeType == "鎵樼洏鏉$爜") @@ -1119,7 +1148,7 @@ //鏉$爜鍓嶇紑 = 鐗╂枡鍐呯爜 + 骞� + 鏈� + 鏃� sTMNumber = HNumber + sYear + sPeriod + sDay; Ds = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //鑾峰彇鏈�澶ф祦姘村彿 - LSH = ClsPub.isInt(Ds.Tables[0].Rows[0][0]); + LSH = ClsPub.isLong(Ds.Tables[0].Rows[0][0]); } else { @@ -1184,6 +1213,40 @@ return objJsonResult; } HBarCodeList barcode = new HBarCodeList(); + + if (CampanyName == "娴疯瘹") //绯荤粺鍙傛暟 瀹㈡埛瀹氬埗鍖栧悕绉� + { + string sHMTONo = ""; //璁″垝璺熻釜鍙� + string sHSourceBillNo = ""; //婧愬崟鍗曞彿 + string sHSourceBillSEQ = ""; //婧愬崟琛屽彿 + string sHSourceEntryID = ""; //婧愬崟瀛怚D + string sSupNumber = ""; //渚涘簲鍟嗕唬鐮� + string sHQty = ""; //鏁伴噺 + + sHMTONo = DBUtility.ClsPub.isStrNull(ordrlist[j].HMTONo); + sHSourceBillNo = DBUtility.ClsPub.isStrNull(ordrlist[j].HBillNo); + sHSourceBillSEQ = DBUtility.ClsPub.isStrNull(ordrlist[j].HSourceBillSEQ); + sHSourceEntryID = DBUtility.ClsPub.isStrNull(ordrlist[j].HSubID); + sSupNumber = DBUtility.ClsPub.isStrNull(ordrlist[j].HSupNumber); + sHQty = DBUtility.ClsPub.isStrNull(HMinQty); + + if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1102") //婧愬崟锛氶噰璐鍗� + { + //鏉$爜瑙勫垯锛氶噰璐鍗曞崟鍙稝琛屽彿@鐗╂枡浠g爜@MTO@鏁伴噺@渚涘簲鍟嗕唬鐮� + TM = sHSourceBillNo + "@" + sHSourceBillSEQ + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber; + } + else if (DBUtility.ClsPub.isStrNull(ordrlist[j].HBillType) == "1103") //婧愬崟锛氭敹鏂欓�氱煡鍗� + { + //鏉$爜瑙勫垯锛氭敹鏂欓�氱煡鍗曞彿@鍗曟嵁瀛愬唴鐮丂鐗╂枡浠g爜@MTO@鏁伴噺@渚涘簲鍟嗕唬鐮� + TM = sHSourceBillNo + "@" + sHSourceEntryID + "@" + HMaterNumber + "@" + sHMTONo + "@" + sHQty + "@" + sSupNumber; + } + else + { + //鏉$爜瑙勫垯锛氱墿鏂欏唴鐮丂MTO@鎵规鍙稝鏁伴噺 + TM = HNumber + "@" + sHMTONo.Replace(" ","") + "@" + HBatchNo.Replace(" ","") + "@" + sHQty; + } + } + barcode.HBarCode2 = TM; barcode.HEntryID2 = ClsPub.isStrNull(j + 1); barcode.HMaterID2 = ordrlist[j].HMaterID; @@ -2113,6 +2176,9 @@ //澧炲姞 鏉$爜瓒呰繃鏈敓鎴愬姛鑳芥帶鍒� // + //鑷姩瑁呯 + string sql_autoForBoxBill = "exec h_v_Gy_BarCode_AutoProductBarCodeBox " + HInterID.ToString(); + oCN.RunProc(sql_autoForBoxBill); oCN.Commit(); List<Object> listobj = ListRows.ConvertAll(s => (object)s);//List瀹炰綋绫昏浆鎹负object -- Gitblit v1.9.1