From 099c78d289f33f38faceeecaeb86d92f1e6c9945 Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期三, 02 七月 2025 16:20:58 +0800 Subject: [PATCH] 新增PDA装箱、组托、拆箱、拆托模块相关调用方法,凯贝超聚变客户条码生成规则变更 --- WebAPI/DLL/ClsGy_Material_Ctl.cs | 64 +++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 1 deletions(-) diff --git a/WebAPI/DLL/ClsGy_Material_Ctl.cs b/WebAPI/DLL/ClsGy_Material_Ctl.cs index 300ac4d..17640f7 100644 --- a/WebAPI/DLL/ClsGy_Material_Ctl.cs +++ b/WebAPI/DLL/ClsGy_Material_Ctl.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Text; using System.Data; +using System.Reflection; +using System.Linq; namespace WebAPI.DLL { @@ -30,7 +32,7 @@ ",HMaterRuleType,HColorNo,HPieceMaxQty,HCommonUseFlag,HAvgStockPrice,HFootPrice,HTaxCost,HNoTaxCost,HOnceRightRate" + ",HHeight_M,HInches_M,HAl1Long_M,HDensity_M,HTela_M,HUnderTela_M,HSizing_M,HQtyDec,HPriceDec,HMoneyDec,HTaxRate,HProfitRate" + ",HLotcardQty" + - ",HProjectBillMainID,HDivisionID,HCubicleQty" + + ",HProjectBillMainID,HDivisionID,HCubicleQty,HMakeEmp" + ") " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + ", " + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'" + @@ -57,6 +59,7 @@ ",'" + oModel.HProjectBillMainID + "','" + oModel.HDivisionID + "','" + oModel.HCubicleQty + + "','" + oModel.HMakeEmp + "')", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); @@ -245,6 +248,65 @@ throw (e); } } + + /// <summary> + /// 鏍规嵁瀛楁鍊煎姩鎬佹洿鏂版暟鎹簱 + /// </summary> + /// <param name="sItemID"></param> + /// <returns></returns> + public bool ModifyByIDDynamic(Int64 sItemID) + { + var sql = "Update " + MvarItemKey + " set "; + string[] excludeNames = { "HErpclsID", "HEntryID", "HInterID", "HReadonly", "HItemID", "HModifyEmp"}; + foreach (var fInfo in oModel.GetType().GetFields() + .Where(field => !excludeNames.Contains(field.Name)) + .ToArray()) + { + string fieldName = fInfo.Name; + var fieldValue = fInfo.GetValue(oModel); + + if (fieldValue != null) + { + sql += (fieldName + "='" + fieldValue.ToString() + "',"); + } + } + sql = sql.Substring(0, sql.Length - 1); + sql+= (" Where HItemID = " + sItemID); + LogService.Write(sql); + + oCn.BeginTran(); + oCn.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); + //淇敼瀛愰」鐩唬鐮� + oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + // + oCn.Commit(); + return true; + } + + public bool ModifyByIDListDynamic(string HItemID_List, string paramStr, List<Models.ClsGy_Material_Model> models) + { + var sql = "Update " + MvarItemKey + " set "; + sql += paramStr; + sql += (" Where HItemID in " + HItemID_List); + // 杈撳嚭 淇敼璇彞鍒版棩蹇楁枃浠� + LogService.Write("Update: " + sql); + oCn.BeginTran(); + oCn.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo); + foreach (var model in models) + { + // 杈撳嚭 淇敼鍓嶅璞� 鍒� 鏃ュ織鏂囦欢 + LogService.Write(model); + //淇敼瀛愰」鐩唬鐮� + oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + model.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); + //灏嗕笂绾� 涓洪潪鏈骇 + oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + model.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); + } + oCn.Commit(); + return true; + } + //鏍规嵁浠g爜鍒ゆ柇淇℃伅 public override bool HavParentCode(string sCode, Int64 sItemID) { -- Gitblit v1.9.1