From ea43c7b135fb7e38278737c43b58063a9d02a2ab Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期三, 20 八月 2025 08:50:41 +0800
Subject: [PATCH] 不良top3问题报表添加部门查询维度,部门以下拉框的形式加载出来,放在月份过滤字段旁边。生产质量汇报单表头上有部门信息
---
WebAPI/DLL/ClsGy_Material_Ctl.cs | 61 ++++++++++++++++++++++++++++++
1 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/WebAPI/DLL/ClsGy_Material_Ctl.cs b/WebAPI/DLL/ClsGy_Material_Ctl.cs
index 2731cf4..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
{
@@ -246,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