From 09302ffd04018e5b6958f2a44871980b1bbc454b Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 17 七月 2023 09:59:47 +0800
Subject: [PATCH] 项目管理:数据关联、 项目工程:下推(阶段汇报)、下推(任务汇报)
---
WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs | 144 +++++++++++++++++++++++++++++++++++++----------
1 files changed, 112 insertions(+), 32 deletions(-)
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 113e711..041f22e 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"
@@ -801,6 +801,10 @@
public class PM_WorkTaskReportBill_Main
{
public int HInterID;
+ public int HProID;
+ public int HProjectStageID;
+ public string HMainSourceBillNo;
+ public string HMainSourceBillType;
public string HBillNo;
public string HDate;
public string HRemark;
@@ -919,6 +923,10 @@
string HBillSubType = "";
int HBillStatus = 1;
int HInterID = mainList[0].HInterID;
+ int HProID = mainList[0].HProID;
+ int HProjectStageID = mainList[0].HProjectStageID;
+ string HMainSourceBillNo = mainList[0].HMainSourceBillNo;
+ string HMainSourceBillType = mainList[0].HMainSourceBillType;
string HBillNo = mainList[0].HBillNo;
string HDate = mainList[0].HDate;
string HRemark = mainList[0].HRemark;
@@ -996,9 +1004,37 @@
//璁板綍鏃ュ織
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_WorkTaskReportBillMain" +
+ "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate,HOrgID,HReportEmpID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " +
+ "values(" +
+ "" + HYear +
+ "," + HPeriod +
+ ",'" + HBillType +
+ "','" + HBillSubType +
+ "'," + HInterID +
+ ",'" + HDate +
+ "','" + HBillNo +
+ "'," + HBillStatus +
+ ",'" + HRemark +
+ "','" + HMaker +
+ "','" + HMakerDate +
+ "'," + HOrgID +
+ "," + HReportEmpID +
+ "," + 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_WorkTaskReportBill(msg3, HInterID, HBillNo, OperationType);
+ objJsonResult = AddBillSub_WorkTaskReportBill(msg3, HInterID, HBillNo, OperationType, HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo);
if (objJsonResult.code == "0")
{
@@ -1026,44 +1062,88 @@
}
#endregion
#region 娣诲姞椤圭洰闃舵娓呭崟 瀛愯〃
- public json AddBillSub_WorkTaskReportBill(string msg3, long HInterID, string HBillNo, int OperationType)
+ public json AddBillSub_WorkTaskReportBill(string msg3, long HInterID, string HBillNo, int OperationType, int HSourceInterID, int HSourceEntryID, string HSourceBillType, string HSourceBillNo)
{
List<PM_WorkTaskReportBill_Sub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PM_WorkTaskReportBill_Sub>>(msg3);
int i = 0; //浣滀负瀛愯〃鍐呯爜
- foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
- {
- i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+ if(OperationType == 4) {
+ foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
+ {
+ i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
- int HEntryID = i;
- string HProNumber = oSub.HProNumber;
- int HProjectStageID = oSub.HProjectStageID;
- string HName = oSub.HName;
- string HTaskNote = oSub.HTaskNote;
- string HType = oSub.HType;
- double HRelTimes = oSub.HRelTimes;
- string HReportNote = oSub.HReportNote;
- string HAdv = oSub.HAdv;
- string HRemark = oSub.HRemarkSub;
+ int HEntryID = i;
+ string HProNumber = oSub.HProNumber;
+ int HProjectStageID = oSub.HProjectStageID;
+ string HName = oSub.HName;
+ string HTaskNote = oSub.HTaskNote;
+ string HType = oSub.HType;
+ double HRelTimes = oSub.HRelTimes;
+ string HReportNote = oSub.HReportNote;
+ string HAdv = oSub.HAdv;
+ string HRemark = oSub.HRemarkSub;
- string sql = "insert into PM_WorkTaskReportBillSub" +
- "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv) " +
- "values(" +
- "" + HInterID +
- ",'" + HBillNo +
- "'," + HEntryID +
- ",'" + HRemark +
- "','" + HProNumber +
- "'," + HProjectStageID +
- ",'" + HName +
- "','" + HTaskNote +
- "','" + HType +
- "'," + HRelTimes +
- ",'" + HReportNote +
- "','" + HAdv +
- "')";
+ string sql = "insert into PM_WorkTaskReportBillSub" +
+ "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " +
+ "values(" +
+ "" + HInterID +
+ ",'" + HBillNo +
+ "'," + HEntryID +
+ ",'" + HRemark +
+ "','" + HProNumber +
+ "'," + HProjectStageID +
+ ",'" + HName +
+ "','" + HTaskNote +
+ "','" + HType +
+ "'," + HRelTimes +
+ ",'" + HReportNote +
+ "','" + HAdv +
+ "'," + HSourceInterID +
+ "," + HSourceEntryID +
+ ",'" + HSourceBillType +
+ "','" + HSourceBillNo +
+ "')";
- oCN.RunProc(sql);
+ oCN.RunProc(sql);
+ }
}
+ else
+ {
+ foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
+ {
+ i++; //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+
+ int HEntryID = i;
+ string HProNumber = oSub.HProNumber;
+ int HProjectStageID = oSub.HProjectStageID;
+ string HName = oSub.HName;
+ string HTaskNote = oSub.HTaskNote;
+ string HType = oSub.HType;
+ double HRelTimes = oSub.HRelTimes;
+ string HReportNote = oSub.HReportNote;
+ string HAdv = oSub.HAdv;
+ string HRemark = oSub.HRemarkSub;
+
+ string sql = "insert into PM_WorkTaskReportBillSub" +
+ "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv) " +
+ "values(" +
+ "" + HInterID +
+ ",'" + HBillNo +
+ "'," + HEntryID +
+ ",'" + HRemark +
+ "','" + HProNumber +
+ "'," + HProjectStageID +
+ ",'" + HName +
+ "','" + HTaskNote +
+ "','" + HType +
+ "'," + HRelTimes +
+ ",'" + HReportNote +
+ "','" + HAdv +
+ "')";
+
+ oCN.RunProc(sql);
+ }
+ }
+
objJsonResult.code = "1";
objJsonResult.count = 1;
--
Gitblit v1.9.1