From 0484048734d67b9bde2cf69d47b4e169449382dc Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期三, 22 五月 2024 17:32:23 +0800
Subject: [PATCH] 器具档案 增加 子表 和网格; Gy_MouldFileSub_SubMater 用来显示 这个 器具的 的 子配件(或子器具); (子表 非必录,允许为空)
---
DAL/工资管理/ClsHR_EmployeeSkillBill.cs | 4 ++
DAL/基础资料/公用基础资料/ClsGy_MouldFile.cs | 2
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 52 ++++++++++++++++++++++++--
WebAPI/Models/Gy_MouldFileSub_SubMater.cs | 29 ++++++++++++++
WebAPI/WebAPI.csproj | 1
WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs | 6 ++-
6 files changed, 87 insertions(+), 7 deletions(-)
diff --git "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFile.cs" "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFile.cs"
index 1369a0a..38062c5 100644
--- "a/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFile.cs"
+++ "b/DAL/\345\237\272\347\241\200\350\265\204\346\226\231/\345\205\254\347\224\250\345\237\272\347\241\200\350\265\204\346\226\231/ClsGy_MouldFile.cs"
@@ -15,7 +15,7 @@
{
base.MvarItemKeySub = "Gy_MouldFileSub";
base.MvarItemKeySub2 = "Gy_MouldFileSub2";
- base.MvarItemKeySub3 = "";
+ base.MvarItemKeySub3 = "Gy_MouldFileSub_SubMater";
base.MvarItemKeySub4 = "";
base.MvarItemKey="Gy_MouldFileMain";
base.MvarReportTitle="妯″叿妗f";
diff --git "a/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_EmployeeSkillBill.cs" "b/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_EmployeeSkillBill.cs"
index d8979e5..b67b9b5 100644
--- "a/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_EmployeeSkillBill.cs"
+++ "b/DAL/\345\267\245\350\265\204\347\256\241\347\220\206/ClsHR_EmployeeSkillBill.cs"
@@ -49,7 +49,11 @@
",HUpDateDate=getdate()" +
//========================================
",HDeptID='" + omodel.HDeptID.ToString() +
+ "',HEmpID='" + omodel.HEmpID.ToString() +
"',HPostID='" + omodel.HPostID.ToString() +
+ "',HCheckEmpID='" + omodel.HCheckEmpID.ToString() +
+ "',HManagerEmpID ='" + omodel.HManagerEmpID.ToString() +
+ "',HInnerBillNo='" + omodel.HInnerBillNo +
"',HMaterID='" + omodel.HMaterID.ToString() +
"',HProcID='" + omodel.HProcID.ToString() +
"',HOrgID='" + omodel.HOrgID.ToString() + "'" +
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 02ff4d3..a4843a3 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1031,7 +1031,7 @@
return objJsonResult;
}
//淇濆瓨涓昏〃
- objJsonResult = AddBillMain(msg2);
+ objJsonResult = AddBillMain(msg1);
if (objJsonResult.code == "0")
{
oCN.RollBack();
@@ -1048,8 +1048,13 @@
return objJsonResult;
}
- public json AddBillMain(string msg2)
+ public json AddBillMain(string msg1)
{
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
+ string msg4 = sArray[2].ToString();//褰撳墠浜�
+ string msg5 = sArray[3].ToString();//瀛愯〃鏁版嵁
try
{
msg2 = "[" + msg2.ToString() + "]";
@@ -1130,7 +1135,6 @@
",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ") ");
-
//瀛愯〃
oCN.RunProc("Insert into Gy_MouldFileSub " +
" (HInterID,HEntryID,HRemark" +
@@ -1139,6 +1143,8 @@
" values('" + HInterID + "',0,''" +
",0,0,'','',0,0 " +
") ");
+
+ objJsonResult = AddBillSub(msg5,HInterID, HBillNo);
if (objJsonResult.code == "0")
{
@@ -1181,6 +1187,7 @@
string msg2 = sArray[0].ToString();
string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
string msg4 = sArray[2].ToString();//褰撳墠浜�
+ string msg5 = sArray[3].ToString();//瀛愯〃鏁版嵁
try
{
if (!DBUtility.ClsPub.Security_Log(msg3, 1, false, msg4))
@@ -1311,7 +1318,11 @@
//oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
//灏嗕笂绾� 涓洪潪鏈骇
// oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
- //
+
+ oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
+
+ objJsonResult = AddBillSub(msg5, HInterID, HBillNo);
+
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -1330,6 +1341,39 @@
}
}
+ public json AddBillSub(string msg5, long HInterID, string HBillNo)
+ {
+ List<Gy_MouldFileSub_SubMater> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_MouldFileSub_SubMater>>(msg5);
+ int i = 0; //浣滀负瀛愯〃鍐呯爜
+ foreach (Gy_MouldFileSub_SubMater oSub in DetailColl)
+ {
+ i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+
+ int HEntryID = i;
+ string HRemark = oSub.HRemark;
+ int HMouldFileID = oSub.HMouldFileID;
+ DateTime HUnionDate = oSub.HUnionDate;
+
+ string sql = "insert into Gy_MouldFileSub_SubMater" +
+ "(HInterID,HBillNo_bak,HEntryID,HRemark,HMouldFileID,HUnionDate) " +
+ "values(" +
+ "" + HInterID +
+ ",'" + HBillNo +
+ "'," + HEntryID +
+ ",'" + HRemark +
+ "','" + HMouldFileID +
+ "','" + HUnionDate +
+ "')";
+
+ oCN.RunProc(sql);
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = null;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
/// <summary>
/// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍
diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
index e6009d5..500cb9a 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
@@ -285,7 +285,8 @@
//璁板綍鏃ュ織
LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼宸ヤ綔浠诲姟:" + HBillNo);
oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼宸ヤ綔浠诲姟锛�" + HBillNo + "','LMES-宸ヤ綔浠诲姟妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
- }else if (OperationType == 4 && ds.Tables[0].Rows.Count == 0) //涓嬫帹
+ }
+ else if (OperationType == 4 && ds.Tables[0].Rows.Count == 0) //涓嬫帹
{
string sql = "insert into PM_WorkTaskBillMain" +
"(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" +
@@ -1446,7 +1447,8 @@
//璁板綍鏃ュ織
LogService.Write("鐢ㄦ埛:" + user + ",鏃ユ湡:" + DateTime.Now + ",淇敼椤圭洰闃舵娓呭崟:" + HBillNo);
oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "淇敼椤圭洰闃舵娓呭崟锛�" + HBillNo + "','LMES-椤圭洰闃舵娓呭崟妯″潡','" + DBUtility.ClsPub.IPAddress + "','淇敼鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
- }else if(OperationType == 4 && ds.Tables[0].Rows.Count == 0) //涓嬫帹
+ }
+ else if(OperationType == 4 && ds.Tables[0].Rows.Count == 0) //涓嬫帹
{
string sql = "insert into PM_WorkTaskReportBillMain" +
"(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate,HOrgID,HReportEmpID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
diff --git a/WebAPI/Models/Gy_MouldFileSub_SubMater.cs b/WebAPI/Models/Gy_MouldFileSub_SubMater.cs
new file mode 100644
index 0000000..d4dfef4
--- /dev/null
+++ b/WebAPI/Models/Gy_MouldFileSub_SubMater.cs
@@ -0,0 +1,29 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+ public class Gy_MouldFileSub_SubMater
+ {
+ public long HInterID { get; set; }//
+ public long HEntryID { get; set; }//
+ public string HCloseMan { get; set; }//
+ public DateTime HEntryCloseDate { get; set; }//
+ public string HCloseType { get; set; }//
+ public string HRemark { get; set; }//
+ public long HSourceInterID { get; set; }//
+ public long HSourceEntryID { get; set; }//
+
+ public string HSourceBillNo { get; set; }//
+ public string HSourceBillType { get; set; }//
+ public double HRelationQty { get; set; }//
+
+ public double HRelationMoney { get; set; }//
+ public int HItemSubID { get; set; }
+ public int HMouldFileID { get; set; }
+ public DateTime HUnionDate { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 2e1c1a6..f25dea4 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -734,6 +734,7 @@
<Compile Include="Models\ClsGy_SupMaterial.cs" />
<Compile Include="Models\ClsSc_AssemblyBillMain.cs" />
<Compile Include="Models\ClsSc_AssemblyBillSub.cs" />
+ <Compile Include="Models\Gy_MouldFileSub_SubMater.cs" />
<Compile Include="Models\鍩虹璧勬枡\Gy_ColorClass.cs" />
<Compile Include="Models\Employee.cs" />
<Compile Include="Models\Gy_UserCustomer.cs" />
--
Gitblit v1.9.1