From d8de78b09da94b54f105bb4a74cf4701128e7bf8 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 22 四月 2024 17:26:23 +0800
Subject: [PATCH] 1.工程项目的编辑页面,增加 工程信息 页签; 页签里 增加字段 项目类别HProjectClassID,状态,建设单位HBuildComp,地点HBuildAddress,任务编号HWorkNo,受理日期HReDate,图纸编号HPicNo,任务下达HWorkTask,项目内容HProjectNote ; 2.仓储流程的测试并完善功能; 分步式调出单-》分布式调入单 直接调拨单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 )

---
 WebAPI/DLL/ClsOA_ErrMsgBackBill.cs |   96 ++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 88 insertions(+), 8 deletions(-)

diff --git a/WebAPI/DLL/ClsOA_ErrMsgBackBill.cs b/WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
index f2b911d..397b06f 100644
--- a/WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
+++ b/WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
@@ -10,11 +10,12 @@
         public Models.ClsOA_ErrMsgBackBillMain omodel = new Models.ClsOA_ErrMsgBackBillMain();
         public List<Models.ClsOA_ErrMsgBackBillSub> DetailColl = new List<Models.ClsOA_ErrMsgBackBillSub>();
         public List<Models.ClsOA_ErrMsgBackBillSub2> DetailColl2 = new List<Models.ClsOA_ErrMsgBackBillSub2>();
+        public Models.ClsOA_ErrMsgBackBillSub DetailReply = new Models.ClsOA_ErrMsgBackBillSub();
 
         public ClsOA_ErrMsgBackBill()
         {
             base.MvarItemKeySub = "OA_ErrMsgBackBillSub";
-            base.MvarItemKeySub2 = "";
+            base.MvarItemKeySub2 = "OA_ErrMsgBackBillSub2";
             base.MvarItemKeySub3 = "";
             base.MvarItemKeySub4 = "";
             base.MvarItemKey="OA_ErrMsgBackBillMain";
@@ -64,12 +65,15 @@
                 ",HDescription='" + omodel.HDescription + "'" +
                 ",HHasten=" + omodel.HHasten.ToString() +
                 ",HQty=" + omodel.HQty.ToString() +
-                
+                ",HRecDeptID=" + omodel.HRecDeptID.ToString() +
+                ",HMaterNumber='" + omodel.HMaterNumber + "'" +
+
                 " where HInterID=" + lngBillKey.ToString());
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
                 //鍒犻櫎瀛愯〃
                 DeleteBillSub(lngBillKey);
+                DeleteBillSub2(lngBillKey);
                 //鎻掑叆瀛愯〃
                 omodel.HInterID = lngBillKey;
                 foreach (Models.ClsOA_ErrMsgBackBillSub oSub in DetailColl)
@@ -88,12 +92,10 @@
                 foreach (Models.ClsOA_ErrMsgBackBillSub2 oSubSec in DetailColl2)
                 {
                     oCn.RunProc("Insert into OA_ErrMsgBackBillSub2 " +
-                      " (HInterID,HEntryID" +                      
-                      ",HReceiveMan,HReadFlag" +
+                      " (HInterID,HEntryID,HReceiveMan,HReadFlag" +
                       ")" +
                       " values("
-                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HRemark + "'" +
-                      ",'" + oSubSec.HReceiveMan + "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) +
+                      + omodel.HInterID.ToString() + "," + oSubSec.HEntryID.ToString() + ",'" + oSubSec.HReceiveMan + "'," + Convert.ToString(oSubSec.HReadFlag ? 1 : 0) +
                       ") ");
                 }
 
@@ -125,7 +127,7 @@
             try
             {
                 //寰楀埌mainid
-                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
                 oCn.BeginTran();
                 //涓昏〃
@@ -135,7 +137,7 @@
                 ",HContext,HDeptID,HDescription,HSendMan,HReceiveMan" +
                 ",HCopyMan,HHasten,HLevel,HReTransmitMan,HBillTypeName"+
                 ",HPlanBillNo,HMaterName,HMaterModel,HQty,HSendType"+
-                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" +
+                ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRecDeptID,HMaterNumber,HErrMsgBackTypeID" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
@@ -143,6 +145,7 @@
                 ",'" + omodel.HCopyMan + "'," + omodel.HHasten.ToString() + ",'" + omodel.HLevel + "','" + omodel.HReTransmitMan + "','" + omodel.HBillTypeName + "'" +
                 ",'" + omodel.HPlanBillNo + "','" + omodel.HMaterName + "','" + omodel.HMaterModel + "'," + omodel.HQty.ToString() + ",'" + omodel.HSendType + "'" +
                 ",'" + omodel.HMainSourceInterID + "','" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'" +
+                "," + omodel.HRecDeptID + ",'" + omodel.HMaterNumber + "'," + omodel.HErrMsgBackTypeID +
                 ") ");
                 //鎻掑叆瀛愯〃
                 //foreach (Models.ClsOA_ErrMsgBackBillSub oSub in DetailColl)
@@ -192,6 +195,83 @@
                 throw (e);
             }
         }
+
+        public bool ReplyBill(ref string sReturn)
+        {
+            try
+            {
+               
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCn.BeginTran();
+
+
+                DataSet Ds = oCn.RunProcReturn("select count(HInterID) as num from OA_ErrMsgBackBillSub where HInterID = " + DetailReply.HInterID + " group by HInterID ", "OA_ErrMsgBackBillSub");
+
+                Int64 num = 0;
+
+                if (Ds.Tables[0].Rows.Count == 0)
+                {
+                    num = 1;
+                }
+                else
+                {
+                    num = Convert.ToInt64(Ds.Tables[0].Rows[0]["num"]) + 1;
+                }
+
+                //涓昏〃
+                oCn.RunProc("Insert Into OA_ErrMsgBackBillSub   " +
+                "(HInterID,HEntryID,HRemark,HSendStatus,HSendMan" +
+                ",HDescriptionSub,HDate" +
+                ",HCloseMan,HEntryCloseDate,HCloseType,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                ") " +
+                " values(" + DetailReply.HInterID + "," + num + ",'" + DetailReply.HRemark + "'," + 1 + ",'" + DetailReply.HSendMan + "'" +
+                ",'" + DetailReply.HDescriptionSub + "','" + DetailReply.HDate + "','" + DetailReply.HCloseMan + "','" + "" + "'" +
+                "," + 0 + "," + DetailReply.HSourceInterID + "," + DetailReply.HSourceEntryID + ",'" + DetailReply.HSourceBillNo + "'" +
+                ",'" + DetailReply.HSourceBillType + "'," + DetailReply.HRelationQty + "," + DetailReply.HRelationMoney +
+                ") ");
+
+                sReturn = omodel.HInterID.ToString();
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
+        //鍒犻櫎鍗曟嵁
+        public virtual bool DeleteBill(Int64 lngBillKey,string HEntryID, ref string sReturn)
+        {
+            try
+            {
+                oCn.BeginTran();
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                string sql = string.Format(@"select *  from "+MvarItemKeySub+ " where HInterID=" + lngBillKey.ToString() + " and HEntryID='" + HEntryID + "'");
+                var dataSet = oCN.RunProcReturn(sql, ""+ MvarItemKeySub + "");               
+                //鍒犻櫎鍏宠仈
+                DeleteRelation(ref sReturn, lngBillKey);
+                //鍒犻櫎鏄庣粏琛�
+                oCn.RunProc("Delete From " + MvarItemKeySub + "  where HInterID=" + lngBillKey.ToString()+" and HEntryID='"+HEntryID+"'");
+                //鍒犻櫎涓昏〃
+                if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
+                {
+                    DeleteBillMain(lngBillKey);
+                }
+                sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+                oCn.Commit();
+                return true;
+            }
+            catch (Exception e)
+            {
+                sReturn = e.Message;
+                oCn.RollBack();
+                throw (e);
+            }
+        }
+
         //鏄剧ず鍗曟嵁
         public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
         {

--
Gitblit v1.9.1