From d9d0587b8ae82785a97b874a4d2b0fff9d3e0882 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 16 八月 2023 14:48:24 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/项目管理/项目阶段/Gy_ProjectStageController.cs | 387 ++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 254 insertions(+), 133 deletions(-)
diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
index 4ae9117..cf3e5c9 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\351\241\271\347\233\256\351\230\266\346\256\265/Gy_ProjectStageController.cs"
@@ -106,7 +106,7 @@
{
oCN.BeginTran();
string sql = "Insert into Gy_ProjectStage" +
- " (HNumber,HName,HShortNumber,HParentID,HLevel,HEndFlag,HStopflag,HRemark,HHelpCode,HMakeEmp,HUSEORGID,HStageNote,HRelationGoods,HIsKey,HRate) " +
+ " (HNumber,HName,HShortNumber,HParentID,HLevel,HEndFlag,HStopflag,HRemark,HHelpCode,HMakeEmp,HCREATEORGID,HStageNote,HRelationGoods,HIsKey,HRate) " +
" Values(" +
"'" + HNumber + "'" +
",'" + HName + "'" +
@@ -146,8 +146,8 @@
",HHelpCode='" + HHelpCode + "'" +
",HMakeEmp='" + HMakeEmp + "'" +
",HModifyEmp = '" + HModifyEmp + "'" +
- ",HModifyTime = getDate()" +
- ",HUSEORGID=" + HUSEORGID + "" +
+ ",HModifyTime = getDate()" +
+ ",HCREATEORGID=" + HUSEORGID + "" +
",HStageNote='" + HStageNote + "'" +
",HRelationGoods='" + HRelationGoods + "'" +
",HIsKey=" + Convert.ToString(HIsKey ? 1 : 0) + "" +
@@ -203,13 +203,13 @@
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from Gy_ProjectStage order by HNumber ", "Gy_ProjectStage");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_ProjectStage order by 闃舵缂栫爜 ", "h_v_Gy_ProjectStage");
}
else
{
- string sql1 = "select * from Gy_ProjectStage where 1 = 1 ";
- string sql = sql1 + sWhere + " order by HNumber ";
- ds = oCN.RunProcReturn(sql, "Gy_ProjectStage");
+ string sql1 = "select * from h_v_Gy_ProjectStage where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 闃舵缂栫爜 ";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_ProjectStage");
}
//娣诲姞鍒楀悕
@@ -846,13 +846,13 @@
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from PM_ProjectStageBillMain order by HBillNo desc ", "PM_ProjectStageBillMain");
+ ds = oCN.RunProcReturn("select * from h_v_PM_ProjectStageBill order by 鍗曟嵁鍙� desc", "h_v_PM_ProjectStageBill");
}
else
{
- string sql1 = "select * from PM_ProjectStageBillMain where 1 = 1 ";
- string sql = sql1 + sWhere + " order by HBillNo desc ";
- ds = oCN.RunProcReturn(sql, "PM_ProjectStageBillMain");
+ string sql1 = "select * from h_v_PM_ProjectStageBill where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+ ds = oCN.RunProcReturn(sql, "h_v_PM_ProjectStageBill");
}
//娣诲姞鍒楀悕
@@ -998,85 +998,103 @@
/// <returns></returns>
[Route("PM_ProjectStageBill/AuditPM_ProjectStageBill")]
[HttpGet]
- public object AuditPM_ProjectStageBill(int HInterID, int IsAudit, string CurUserName)
+ public object AuditPM_ProjectStageBill(string HInterID, int Type, string user)
{
try
{
- //瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Pm_ProjectStageBill_Check", 1, false, CurUserName))
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Pm_ProjectStageBill_Check", 1, false, user))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.Message = "鏃犳潈闄愬鏍�!";
objJsonResult.data = null;
return objJsonResult;
}
- var ds = oCN.RunProcReturn("select * from PM_ProjectStageBillMain where HInterID=" + HInterID, "PM_ProjectStageBillMain");
- if (ds.Tables[0].Rows.Count > 0)
+ if (string.IsNullOrWhiteSpace(HInterID))
{
- if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ BillOld.MvarItemKey = "PM_ProjectStageBillMain";
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
- if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!";
objJsonResult.data = null;
return objJsonResult;
}
}
- if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ //瀹℃牳鍗曟嵁
+ if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
- if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
}
}
else
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //鍙嶅鏍稿崟鎹�
+ if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
- oCN.BeginTran();
+ oCN.Commit();//鎻愪氦浜嬪姟
- if (IsAudit == 0) //瀹℃牳鍒ゆ柇
- {
- oCN.RunProc("update PM_ProjectStageBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "瀹℃牳鎴愬姛";
- objJsonResult.data = null;
- }
- if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
- {
- oCN.RunProc("update PM_ProjectStageBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID);
-
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶅鏍告垚鍔�";
- objJsonResult.data = null;
- }
- oCN.Commit();
-
- return objJsonResult;
}
catch (Exception e)
{
- oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -1303,7 +1321,10 @@
public int HInterID;
public string HBillNo;
public string HDate;
+ public int HProID;
public string HProNumber;
+ public string HMainSourceBillNo;
+ public string HMainSourceBillType;
public int HProjectStageID;
public string HProjectStageName;
public string HStageNote;
@@ -1416,6 +1437,9 @@
objJsonResult.data = null;
return objJsonResult;
}
+ }else if (OperationType == 4)
+ {
+
}
msg2 = "[" + msg2.ToString() + "]";
@@ -1430,7 +1454,10 @@
int HInterID = mainList[0].HInterID;
string HBillNo = mainList[0].HBillNo;
string HDate = mainList[0].HDate;
+ int HProID = mainList[0].HProID;
string HProNumber = mainList[0].HProNumber;
+ string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
+ string HMainSourceBillType = mainList[0].HMainSourceBillType;
int HProjectStageID = mainList[0].HProjectStageID;
string HStageNote = mainList[0].HStageNote;
string HRelationGoods = mainList[0].HRelationGoods;
@@ -1447,7 +1474,7 @@
string HMakerDate = mainList[0].HMakerDate;
string HUpdater = mainList[0].HUpdater;
string HUpdaterDate = mainList[0].HUpdaterDate;
-
+
if (OperationType == 2)
{
@@ -1534,9 +1561,48 @@
//璁板綍鏃ュ織
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 ) //涓嬫帹-鏂板
+ {
+ string sql = "insert into PM_ProjectReportBillMain" +
+ "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" +
+ ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
+ "values(" +
+ "" + HYear +
+ "," + HPeriod +
+ ",'" + HBillType +
+ "','" + HBillSubType +
+ "'," + HInterID +
+ ",'" + HDate +
+ "','" + HBillNo +
+ "'," + HBillStatus +
+ ",'" + HRemark +
+ "','" + HMaker +
+ "','" + HMakerDate +
+ "','" + HProNumber +
+ "'," + HProjectStageID +
+ ",'" + HStageNote +
+ "','" + HRelationGoods +
+ "'," + HIsKey +
+ "," + HReportEmpID +
+ ",'" + HReportNote +
+ "','" + HReportGoods +
+ "','" + HReceiveEmp +
+ "','" + HCopyEmp +
+ "'," + HRate +
+ "," + HOrgID +
+ "," + HProID +
+ "," + HProjectStageID +
+ ",'" + HMainSourceBillType +
+ "','" + HMainSourceBillNo +
+ "')";
+
+ //涓昏〃
+ oCN.RunProc(sql);
+ 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);
}
//淇濆瓨瀛愯〃
- objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType);
+ objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo);
if (objJsonResult.code == "0")
{
@@ -1564,36 +1630,73 @@
}
#endregion
#region 娣诲姞椤圭洰闃舵娓呭崟 瀛愯〃
- public json AddBillSub_ProjectReportBill(string msg3, long HInterID, string HBillNo, int OperationType)
+ public json AddBillSub_ProjectReportBill(string msg3, long HInterID, string HBillNo, int OperationType, int HSourceInterID, int HSourceEntryID, string HSourceBillType, string HSourceBillNo)
{
List<PM_ProjectReportBill_Sub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PM_ProjectReportBill_Sub>>(msg3);
int i = 0; //浣滀负瀛愯〃鍐呯爜
- foreach (PM_ProjectReportBill_Sub oSub in DetailColl)
+ if(OperationType == 4)
{
- i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+ foreach (PM_ProjectReportBill_Sub oSub in DetailColl)
+ {
+ i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
- int HEntryID = i;
- int HEmpID = oSub.HEmpID;
- int HIsPM = oSub.HIsPM?1:0;
- double HRate = oSub.HRate;
- double HAvgMoney = oSub.HAvgMoney;
- double HCountMoney = oSub.HCountMoney;
- string HRemarkSub = oSub.HRemarkSub;
- string sql = "insert into PM_ProjectReportBillSub" +
- "(HInterID,HBillNo_bak,HEntryID,HRemark,HEmpID,HIsPM,HRate,HAvgMoney,HCountMoney) " +
- "values(" +
- "" + HInterID +
- ",'" + HBillNo +
- "'," + HEntryID +
- ",'" + HRemarkSub +
- "'," + HEmpID +
- "," + HIsPM +
- "," + HRate +
- "," + HAvgMoney +
- "," + HCountMoney +
- ")";
- oCN.RunProc(sql);
+ int HEntryID = i;
+ int HEmpID = oSub.HEmpID;
+ int HIsPM = oSub.HIsPM ? 1 : 0;
+ double HRate = oSub.HRate;
+ double HAvgMoney = oSub.HAvgMoney;
+ double HCountMoney = oSub.HCountMoney;
+ string HRemarkSub = oSub.HRemarkSub;
+ string sql = "insert into PM_ProjectReportBillSub" +
+ "(HInterID,HBillNo_bak,HEntryID,HRemark,HEmpID,HIsPM,HRate,HAvgMoney,HCountMoney,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " +
+ "values(" +
+ "" + HInterID +
+ ",'" + HBillNo +
+ "'," + HEntryID +
+ ",'" + HRemarkSub +
+ "'," + HEmpID +
+ "," + HIsPM +
+ "," + HRate +
+ "," + HAvgMoney +
+ "," + HCountMoney +
+ "," + HSourceInterID +
+ "," + HSourceEntryID +
+ ",'" + HSourceBillType +
+ "','" + HSourceBillNo +
+ "')";
+ oCN.RunProc(sql);
+ }
}
+ else
+ {
+ foreach (PM_ProjectReportBill_Sub oSub in DetailColl)
+ {
+ i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+
+ int HEntryID = i;
+ int HEmpID = oSub.HEmpID;
+ int HIsPM = oSub.HIsPM ? 1 : 0;
+ double HRate = oSub.HRate;
+ double HAvgMoney = oSub.HAvgMoney;
+ double HCountMoney = oSub.HCountMoney;
+ string HRemarkSub = oSub.HRemarkSub;
+ string sql = "insert into PM_ProjectReportBillSub" +
+ "(HInterID,HBillNo_bak,HEntryID,HRemark,HEmpID,HIsPM,HRate,HAvgMoney,HCountMoney) " +
+ "values(" +
+ "" + HInterID +
+ ",'" + HBillNo +
+ "'," + HEntryID +
+ ",'" + HRemarkSub +
+ "'," + HEmpID +
+ "," + HIsPM +
+ "," + HRate +
+ "," + HAvgMoney +
+ "," + HCountMoney +
+ ")";
+ oCN.RunProc(sql);
+ }
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -1629,13 +1732,13 @@
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from PM_ProjectReportBillMain order by HBillNo desc ", "PM_ProjectReportBillMain");
+ ds = oCN.RunProcReturn("select * from h_v_PM_ProjectReportBillList order by 鍗曟嵁鍙� ", "h_v_PM_ProjectReportBillList");
}
else
{
- string sql1 = "select * from PM_ProjectReportBillMain where 1 = 1 ";
- string sql = sql1 + sWhere + " order by HBillNo desc ";
- ds = oCN.RunProcReturn(sql, "PM_ProjectReportBillMain");
+ string sql1 = "select * from h_v_PM_ProjectReportBillList where 1 = 1 ";
+ string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� ";
+ ds = oCN.RunProcReturn(sql, "h_v_PM_ProjectReportBillList");
}
//娣诲姞鍒楀悕
@@ -1781,85 +1884,103 @@
/// <returns></returns>
[Route("PM_ProjectReportBill/AuditPM_ProjectReportBill")]
[HttpGet]
- public object AuditPM_ProjectReportBill(int HInterID, int IsAudit, string CurUserName)
+ public object AuditPM_ProjectReportBill(string HInterID, int Type, string user)
{
try
{
- //瀹℃牳鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Pm_ProjectReportBill_Check", 1, false, CurUserName))
+ //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Pm_ProjectReportBill_Check", 1, false, user))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.Message = "鏃犳潈闄愬鏍�!";
objJsonResult.data = null;
return objJsonResult;
}
- var ds = oCN.RunProcReturn("select * from PM_ProjectReportBillMain where HInterID=" + HInterID, "PM_ProjectReportBillMain");
- if (ds.Tables[0].Rows.Count > 0)
+ if (string.IsNullOrWhiteSpace(HInterID))
{
- if (IsAudit == 0) //瀹℃牳鍒ゆ柇
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ BillOld.MvarItemKey = "PM_ProjectReportBillMain";
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
- if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+ if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!";
objJsonResult.data = null;
return objJsonResult;
}
}
- if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
+ //瀹℃牳鍗曟嵁
+ if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
- if (ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
}
}
else
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
- objJsonResult.data = null;
- return objJsonResult;
+ //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+ DataSet ds;
+ string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+ ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+ if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ //鍙嶅鏍稿崟鎹�
+ if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
- oCN.BeginTran();
+ oCN.Commit();//鎻愪氦浜嬪姟
- if (IsAudit == 0) //瀹℃牳鍒ゆ柇
- {
- oCN.RunProc("update PM_ProjectReportBillMain set HChecker='" + CurUserName + "',HCheckDate=getdate() where HInterID=" + HInterID);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "瀹℃牳鎴愬姛";
- objJsonResult.data = null;
- }
- if (IsAudit == 1) //鍙嶅鏍稿垽鏂�
- {
- oCN.RunProc("update PM_ProjectReportBillMain set HChecker='',HCheckDate=null where HInterID=" + HInterID);
-
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶅鏍告垚鍔�";
- objJsonResult.data = null;
- }
- oCN.Commit();
-
- return objJsonResult;
}
catch (Exception e)
{
- oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "瀹℃牳澶辫触鎴栬�呭弽瀹℃牳澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
--
Gitblit v1.9.1