From 4e9b0d5aafdab84c4b6aec9d7f0095bc692b3600 Mon Sep 17 00:00:00 2001
From: 杨乐 <yang.le.192@qq.com>
Date: 星期二, 25 一月 2022 21:29:36 +0800
Subject: [PATCH] 权限添加 2056
---
WebAPI/DLL/ClsSc_ICMOReportBill.cs | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 100 insertions(+), 9 deletions(-)
diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 57ff176..937b973 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -8,9 +8,9 @@
{
public class ClsSc_ICMOReportBill:DBUtility.ClsXt_BaseBill
{
- public Model.ClsSc_ICMOReportBillMain omodel = new Model.ClsSc_ICMOReportBillMain();
- public Model.ClsSc_ICMOReportBillSub oSub = new Model.ClsSc_ICMOReportBillSub();
- public List<Model.ClsSc_ICMOReportBillSub> DetailColl = new List<Model.ClsSc_ICMOReportBillSub>();
+ public Models.ClsSc_ICMOReportBillMain omodel = new Models.ClsSc_ICMOReportBillMain();
+ public Models.ClsSc_ICMOReportBillSub oSub = new Models.ClsSc_ICMOReportBillSub();
+ public List<Models.ClsSc_ICMOReportBillSub> DetailColl = new List<Models.ClsSc_ICMOReportBillSub>();
public ClsSc_ICMOReportBill()
{
@@ -51,6 +51,11 @@
",HUpDater='" + omodel.HMaker + "'" +
",HUpDateDate=getdate()" +
//========================================
+ ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
+ ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() +
+ ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() +
+ ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() +
+
",HDeptID=" + omodel.HDeptID.ToString() +
",HDeptNumber='" + omodel.HDeptNumber +"'"+
",HEmpID=" + omodel.HEmpID.ToString() +
@@ -64,7 +69,7 @@
DeleteBillSub(lngBillKey);
//鎻掑叆瀛愯〃
omodel.HInterID = lngBillKey;
- foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl)
+ foreach (Models.ClsSc_ICMOReportBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_ICMOReportBillSub " +
" (HInterID,HEntryID,HMaterID,HMaterNumber" +
@@ -150,13 +155,15 @@
"(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" +
",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" +
",HGroupID,HDeptID,HDeptNumber" +
+ ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" +
") " +
" values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker+ "',getdate()" +
"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HEmpID.ToString() + "','" + omodel.HEmpNumber +
- "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber + "'"+
+ "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber +
+ "','" + omodel.HMainSourceBillNo.ToString() + "'," + omodel.HMainSourceInterID.ToString() + ",'" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillType + "'" +
") ");
//鎻掑叆瀛愯〃
- foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl)
+ foreach (Models.ClsSc_ICMOReportBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_ICMOReportBillSub " +
" (HInterID,HEntryID,HMaterID,HMaterNumber" +
@@ -254,7 +261,7 @@
DetailColl.Clear();//娓呯┖
for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
{
- Model.ClsSc_ICMOReportBillSub oSub = new Model.ClsSc_ICMOReportBillSub();
+ Models.ClsSc_ICMOReportBillSub oSub = new Models.ClsSc_ICMOReportBillSub();
// 鍥哄畾璧嬪��===============================================
oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
@@ -300,6 +307,90 @@
}
}
+ //瀹℃牳
+ public bool CheckBill(Int64 lngBillKey, ref string sReturn)
+ {
+
+ try
+ {
+ string HChecker = DBUtility.ClsPub.CurUserName;
+ string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+ oCn.BeginTran();
+ oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='2',HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
+
+ sReturn = "瀹℃牳鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+
+ sReturn = "";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+ //鍙嶅鏍�
+ public bool AbandonCheck(Int64 lngBillKey, ref string sReturn)
+ {
+
+ try
+ {
+ string HChecker = DBUtility.ClsPub.CurUserName;
+ string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
+ oCn.BeginTran();
+ //杩樺師鍗曟嵁鐘舵�佷负鏈鏍哥姸鎬�
+ oCn.RunProc(" Update " + MvarItemKey + " set HBillStatus='1',HChecker='',HCheckDate='' Where HInterID=" + lngBillKey.ToString());
+ sReturn = "鍙嶅鏍稿崟鎹垚鍔燂紒";
+ oCn.Commit();
+ sReturn = "";
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ throw (e);
+ }
+ }
+
+ //鍒犻櫎鍗曟嵁
+ public virtual bool DeleteBill(Int64 lngBillKey, ref string sReturn)
+ {
+ try
+ {
+ oCn.BeginTran();
+ //鏌ヨ鐢熶骇姹囨姤鍗曡〃鏁伴噺
+ DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
+ string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
+ //
+ //鏇存柊浜ч噺姹囨姤涓存椂琛ㄦ槸鍚︽姤妫�鐢宠鐘舵��
+ string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'");
+ oCn.RunProc(sql1);
+
+ //鍒犻櫎鍏宠仈
+ DeleteRelation(ref sReturn, lngBillKey);
+ //鍒犻櫎鏄庣粏琛�
+ DeleteBillSub(lngBillKey);
+ //鍒犻櫎涓昏〃
+ DeleteBillMain(lngBillKey);
+
+ sReturn = "鍒犻櫎鍗曟嵁鎴愬姛锛�";
+ oCn.Commit();
+ return true;
+ }
+ catch (Exception e)
+ {
+ sReturn = e.Message;
+ oCn.RollBack();
+ throw (e);
+ }
+ }
+
+
+
//鎵爜鐢熸垚浜ч噺姹囨姤鍗曪紙鏃犳潯鐮佸嚭鍏ュ簱璁板綍锛�
public bool AddBill_PDA2(ref string sReturn)
{
@@ -329,7 +420,7 @@
"," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() +
") ");
//鎻掑叆瀛愯〃
- foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl)
+ foreach (Models.ClsSc_ICMOReportBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_ICMOReportBillSub " +
" (HInterID,HEntryID,HMaterID" +
@@ -405,7 +496,7 @@
"," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HCheckType + "'" +
") ");
//鎻掑叆瀛愯〃
- foreach (Model.ClsSc_ICMOReportBillSub oSub in DetailColl)
+ foreach (Models.ClsSc_ICMOReportBillSub oSub in DetailColl)
{
oCn.RunProc("Insert into Sc_ICMOReportBillSub " +
" (HInterID,HEntryID,HMaterID" +
--
Gitblit v1.9.1