From 9c4bc2154d1f811e310f1a6ea89937e453a52ce8 Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Fri, 7 Mar 2025 11:05:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SGGLDB_V2025-03-05-001-gaofei.sql | 68 ++++ .../API/CQMS/APIQuantityManagementService.cs | 252 ++++++++++++++ SGGL/BLL/BLL.csproj | 1 + .../CQMS/QuantityManagement/DayInput.aspx | 2 +- .../CQMS/QuantityManagement/DayInput.aspx.cs | 6 +- SGGL/FineUIPro.Web/common/mainProject.aspx | 12 +- SGGL/Model/APIItem/BaseInfoItem.cs | 9 + SGGL/Model/APIItem/CQMS/DayInputItem.cs | 30 ++ SGGL/Model/APIItem/CQMS/DrawingItem.cs | 14 + SGGL/Model/APIItem/TeamGroupItem.cs | 14 + SGGL/Model/Model.cs | 323 ++++++++++++++++++ SGGL/Model/Model.csproj | 3 + .../CQMS/QuantityManagementController.cs | 166 +++++++++ SGGL/WebAPI/WebAPI.csproj | 1 + 14 files changed, 889 insertions(+), 12 deletions(-) create mode 100644 SGGL/BLL/API/CQMS/APIQuantityManagementService.cs create mode 100644 SGGL/Model/APIItem/CQMS/DayInputItem.cs create mode 100644 SGGL/Model/APIItem/CQMS/DrawingItem.cs create mode 100644 SGGL/Model/APIItem/TeamGroupItem.cs create mode 100644 SGGL/WebAPI/Controllers/CQMS/QuantityManagementController.cs diff --git a/DataBase/版本日志/SGGLDB_V2025-03-05-001-gaofei.sql b/DataBase/版本日志/SGGLDB_V2025-03-05-001-gaofei.sql index 9da48a6..7203d5e 100644 --- a/DataBase/版本日志/SGGLDB_V2025-03-05-001-gaofei.sql +++ b/DataBase/版本日志/SGGLDB_V2025-03-05-001-gaofei.sql @@ -185,4 +185,72 @@ GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) VALUES('CE235B20-C6BB-4A34-A11C-70F90921B803','Ŀݻܱ','CQMS/QuantityManagement/ProjectContentStatistics.aspx',30,'C1CEE66F-FBDD-4B8B-BF7E-DF04A839E06C','Menu_Server',0,1,1) +GO + +ALTER VIEW [dbo].[View_QuantityManagement_WorkTeamStatistics] +AS +/********弰ܱ********/ + +select distinct C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent+','+isnull(t.TeamGroupName,'') as Id, C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,ba.State, + ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId + from QuantityManagement_DayInput C + left join QuantityManagement_Base ba on ba.BaseId=C.BaseId + left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId + left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major + left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId + left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major + left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam +union +select C.ProjectId+','+(case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end)+','+ProjectContent+','+isnull(t.TeamGroupName,'') as Id,C.ProjectId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,C.State, + ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId + from QuantityManagement_Base C + left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId + left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major + left join QuantityManagement_Change b on b.ChangeId=C.DrawingId + left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major + left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam + + +GO + +ALTER VIEW [dbo].[View_QuantityManagement_ProjectContentStatistics] +AS +/********弰ܱ********/ + +select distinct C.ProjectId+','+ProjectContent+','+isnull(t.TeamGroupName,'') as Id, C.ProjectId,ba.State, + ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId + from QuantityManagement_DayInput C + left join QuantityManagement_Base ba on ba.BaseId=C.BaseId + left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId + left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major + left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId + left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major + left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam +union +select C.ProjectId+','+ProjectContent+','+isnull(t.TeamGroupName,'') as Id,C.ProjectId,C.State, + ProjectContent,Unit,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId + from QuantityManagement_Base C + left join QuantityManagement_Drawing a on a.DrawingId=C.DrawingId + left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major + left join QuantityManagement_Change b on b.ChangeId=C.DrawingId + left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major + left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam + + +GO + +CREATE VIEW [dbo].[View_QuantityManagement_DayInputList] +AS +/********ճͳƱ********/ +select C.DayInputId,C.BaseId,C.ProjectId,ba.DrawingId,case when a.DrawingNo is not null then a.WorkSection else b.WorkSection end as WorkSection,case when a.DrawingNo is not null then a.DrawingNo else b.ChangeNo end as DrawingNo, + case when a.DrawingName is not null then a.DrawingName else b.ChangeName end as DrawingName,ba.State, + case when a.DrawingNo is not null then ca.ProfessionalName else cb.ProfessionalName end as Major, + Part,ProjectContent,Unit,Amount,t.TeamGroupName as WorkTeam,C.WorkTeam as WorkTeamId,C.Date,C.DayAmount + from QuantityManagement_DayInput C + left join QuantityManagement_Base ba on ba.BaseId=C.BaseId + left join QuantityManagement_Drawing a on a.DrawingId=ba.DrawingId + left join Base_CNProfessional ca on ca.CNProfessionalId=a.Major + left join QuantityManagement_Change b on b.ChangeId=ba.DrawingId + left join Base_CNProfessional cb on cb.CNProfessionalId=b.Major + left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam GO \ No newline at end of file diff --git a/SGGL/BLL/API/CQMS/APIQuantityManagementService.cs b/SGGL/BLL/API/CQMS/APIQuantityManagementService.cs new file mode 100644 index 0000000..7acc392 --- /dev/null +++ b/SGGL/BLL/API/CQMS/APIQuantityManagementService.cs @@ -0,0 +1,252 @@ +using Model; +using Model.APIItem; +using NPOI.SS.Formula.Eval; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.Security; +using System.Web.UI; + +namespace BLL +{ + public class APIQuantityManagementService + { + public static Model.ResponeData DayInputList(string projectId, string drawingNo, string part, string projectContent, int page, int pageSize) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.View_QuantityManagement_DayInputList where x.ProjectId == projectId select x; + if (!string.IsNullOrEmpty(drawingNo)) + { + q = q.Where(x => x.DrawingNo.Contains(drawingNo)); + } + if (!string.IsNullOrEmpty(part)) + { + q = q.Where(x => x.Part.Contains(part)); + } + if (!string.IsNullOrEmpty(projectContent)) + { + q = q.Where(x => x.ProjectContent.Contains(projectContent)); + } + List dayInputItems = new List(); + var list = q.OrderByDescending(x => x.Date).ToList(); + if (list.Count > 0) + { + foreach (var x in list) + { + DayInputItem dayInputItem = new DayInputItem(); + dayInputItem.DayInputId = x.DayInputId; + dayInputItem.ProjectId = x.ProjectId; + dayInputItem.WorkSection = x.WorkSection; + dayInputItem.DrawingNo = x.DrawingNo; + dayInputItem.DrawingName = x.DrawingName; + dayInputItem.Part = x.Part; + dayInputItem.ProjectContent = x.ProjectContent; + dayInputItem.Unit = x.Unit; + dayInputItem.Amount = x.Amount; + dayInputItem.WorkTeam = x.WorkTeam; + dayInputItem.Date = x.Date; + if (x.Date != null) + { + dayInputItem.DateStr = string.Format("{0:yyyy-MM-dd}", x.Date); + } + dayInputItem.DayAmount = x.DayAmount; + dayInputItems.Add(dayInputItem); + } + } + dayInputItems = dayInputItems.Skip(page * pageSize).Take(pageSize).ToList(); + respone.data = dayInputItems; + } + return respone; + } + + public static Model.ResponeData getDayInputById(string dayInputId) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + View_QuantityManagement_DayInputList dayInput = (from x in db.View_QuantityManagement_DayInputList where x.DayInputId == dayInputId select x).FirstOrDefault(); + + DayInputItem dayInputItem = new DayInputItem(); + dayInputItem.DayInputId = dayInput.DayInputId; + dayInputItem.ProjectId = dayInput.ProjectId; + dayInputItem.WorkSection = dayInput.WorkSection; + dayInputItem.DrawingId = dayInput.DrawingId; + dayInputItem.DrawingNo = dayInput.DrawingNo; + dayInputItem.DrawingName = dayInput.DrawingName; + dayInputItem.Part = dayInput.Part; + dayInputItem.ProjectContent = dayInput.ProjectContent; + dayInputItem.Unit = dayInput.Unit; + dayInputItem.Amount = dayInput.Amount; + dayInputItem.WorkTeam = dayInput.WorkTeam; + dayInputItem.WorkTeamId = dayInput.WorkTeamId; + dayInputItem.Date = dayInput.Date; + if (dayInput.Date != null) + { + dayInputItem.DateStr = string.Format("{0:yyyy-MM-dd}", dayInput.Date); + } + dayInputItem.DayAmount = dayInput.DayAmount; + var file = db.AttachFile.FirstOrDefault(x => x.ToKeyId == dayInput.DayInputId); + if (file != null) + { + dayInputItem.Url = file.AttachUrl; + } + respone.data = dayInputItem; + } + return respone; + } + + public static Model.ResponeData addDayInput(DayInputItem dayInput) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + QuantityManagement_DayInput newDayInput = new QuantityManagement_DayInput(); + if (string.IsNullOrEmpty(dayInput.DayInputId)) + { + newDayInput.DayInputId = Guid.NewGuid().ToString(); + db.QuantityManagement_DayInput.InsertOnSubmit(newDayInput); + } + else + { + newDayInput = db.QuantityManagement_DayInput.FirstOrDefault(x => x.DayInputId == dayInput.DayInputId); + } + newDayInput.ProjectId = dayInput.ProjectId; + newDayInput.BaseId = dayInput.BaseId; + newDayInput.Date = Funs.GetNewDateTimeOrNow(dayInput.DateStr); + newDayInput.DayAmount = Funs.GetNewDecimal(dayInput.DayAmount.ToString()); + newDayInput.WorkTeam = dayInput.WorkTeamId; + newDayInput.CompileMan = dayInput.CompileMan; + newDayInput.CompileDate = DateTime.Now; + db.SubmitChanges(); + SaveUrl(dayInput.DayInputId, BLL.Const.DayInputMenuId, dayInput.Url); + } + return respone; + } + + public static void SaveUrl(string dayInputId, string menuId, string url) + { + Model.ToDoItem toDoItem = new Model.ToDoItem + { + MenuId = menuId, + DataId = dayInputId, + UrlStr = url, + }; + APIUpLoadFileService.SaveAttachUrl(toDoItem); + } + + public static Model.ResponeData getDrawingNoList(string projectId) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = BLL.DrawingService.GetDrawingChangeListByProjectId(projectId); + List res = new List(); + foreach (var p in q) + { + DrawingItem item = new DrawingItem(); + item.DrawingId = p.Value; + item.DrawingNo = p.Text; + res.Add(item); + } + + respone.data = res; + } + return respone; + } + + public static Model.ResponeData getTeamGroupList(string projectId) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = from x in db.ProjectData_TeamGroup + where x.ProjectId == projectId + orderby x.TeamGroupCode + select x; + List res = new List(); + foreach (var p in q) + { + TeamGroupItem item = new TeamGroupItem(); + item.TeamGroupId = p.TeamGroupId; + item.TeamGroupName = p.TeamGroupName; + res.Add(item); + } + + respone.data = res; + } + return respone; + } + + public static Model.ResponeData getPartList(string drawingId) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = (from x in db.QuantityManagement_Base + where x.DrawingId == drawingId && x.State == BLL.Const.Base_Complete + orderby x.Part + select x.Part).Distinct().ToList(); + List res = new List(); + foreach (var p in q) + { + BaseInfoItem item = new BaseInfoItem(); + item.BaseInfoId = p; + item.BaseInfoName = p; + res.Add(item); + } + + respone.data = res; + } + return respone; + } + + public static Model.ResponeData getProjectContentList(string drawingId, string part) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = (from x in db.QuantityManagement_Base + where x.DrawingId == drawingId && x.Part == part && x.State == BLL.Const.Base_Complete + orderby x.ProjectContent + select x).ToList(); + List res = new List(); + foreach (var p in q) + { + BaseInfoItem item = new BaseInfoItem(); + item.BaseInfoId = p.BaseId; + item.BaseInfoName = p.ProjectContent; + res.Add(item); + } + + respone.data = res; + } + return respone; + } + + public static Model.ResponeData getBase(string baseId) + { + Model.ResponeData respone = new ResponeData(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var q = db.QuantityManagement_Base.FirstOrDefault(e => e.BaseId == baseId); + BaseInfoItem res = new BaseInfoItem(); + if (q != null) + { + decimal usedAmount = (from x in db.QuantityManagement_DayInput where x.BaseId == baseId select x).ToList().Sum(x => x.DayAmount ?? 0); + if (q.Amount != null) + { + res.Remark = q.Unit; + res.Amount = q.Amount - usedAmount; + res.BaseInfoId = q.WorkTeam; + } + } + + respone.data = res; + } + return respone; + } + } +} diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index c23fab7..5abdaa4 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -174,6 +174,7 @@ + diff --git a/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx b/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx index e945ae9..c3315f8 100644 --- a/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx +++ b/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx @@ -15,7 +15,7 @@ diff --git a/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx.cs b/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx.cs index 5ad009e..89f95b5 100644 --- a/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/QuantityManagement/DayInput.aspx.cs @@ -29,11 +29,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement /// public void BindGrid() { - string strSql = @"select DayInputId,C.ProjectId,a.WorkSection,DrawingNo,DrawingName,Part,ProjectContent,Unit,Amount,t.TeamGroupName as WorkTeam,C.Date,C.DayAmount - from QuantityManagement_DayInput C - left join QuantityManagement_Base b on b.BaseId=C.BaseId - left join QuantityManagement_Drawing a on a.DrawingId=b.DrawingId - left join ProjectData_TeamGroup t on t.TeamGroupId=C.WorkTeam + string strSql = @"select * from View_QuantityManagement_DayInputList C where C.ProjectId = @ProjectId"; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); diff --git a/SGGL/FineUIPro.Web/common/mainProject.aspx b/SGGL/FineUIPro.Web/common/mainProject.aspx index 98f2627..e64727e 100644 --- a/SGGL/FineUIPro.Web/common/mainProject.aspx +++ b/SGGL/FineUIPro.Web/common/mainProject.aspx @@ -170,17 +170,17 @@
-
5
+
0
-
5
+
0
-
5
+
0
@@ -193,21 +193,21 @@

-
294
+
0

-
294
+
0

-
294
+
0
diff --git a/SGGL/Model/APIItem/BaseInfoItem.cs b/SGGL/Model/APIItem/BaseInfoItem.cs index ecb44e6..63acc82 100644 --- a/SGGL/Model/APIItem/BaseInfoItem.cs +++ b/SGGL/Model/APIItem/BaseInfoItem.cs @@ -60,5 +60,14 @@ namespace Model get; set; } + + /// + /// 数量 + /// + public decimal? Amount + { + get; + set; + } } } diff --git a/SGGL/Model/APIItem/CQMS/DayInputItem.cs b/SGGL/Model/APIItem/CQMS/DayInputItem.cs new file mode 100644 index 0000000..fd53e6d --- /dev/null +++ b/SGGL/Model/APIItem/CQMS/DayInputItem.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class DayInputItem + { + public string DayInputId { get; set; } + public string ProjectId { get; set; } + public string BaseId { get; set; } + public string WorkSection { get; set; } + public string DrawingId { get; set; } + public string DrawingNo { get; set; } + public string DrawingName { get; set; } + public string Part { get; set; } + public string ProjectContent { get; set; } + public string Unit { get; set; } + public decimal? Amount { get; set; } + public string WorkTeam { get; set; } + public string WorkTeamId { get; set; } + public DateTime? Date { get; set; } + public string DateStr { get; set; } + public decimal? DayAmount { get; set; } + public string Url { get; set; } + public string CompileMan { get; set; } + } +} diff --git a/SGGL/Model/APIItem/CQMS/DrawingItem.cs b/SGGL/Model/APIItem/CQMS/DrawingItem.cs new file mode 100644 index 0000000..7ff6f7e --- /dev/null +++ b/SGGL/Model/APIItem/CQMS/DrawingItem.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class DrawingItem + { + public string DrawingId { get; set; } + public string DrawingNo { get; set; } + } +} diff --git a/SGGL/Model/APIItem/TeamGroupItem.cs b/SGGL/Model/APIItem/TeamGroupItem.cs new file mode 100644 index 0000000..5d1f64b --- /dev/null +++ b/SGGL/Model/APIItem/TeamGroupItem.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class TeamGroupItem + { + public string TeamGroupId { get; set; } + public string TeamGroupName { get; set; } + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 60c75e1..da4f40b 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -10709,6 +10709,14 @@ namespace Model } } + public System.Data.Linq.Table View_QuantityManagement_DayInputList + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table View_QuantityManagement_ProjectContentStatistics { get @@ -456206,6 +456214,321 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_QuantityManagement_DayInputList")] + public partial class View_QuantityManagement_DayInputList + { + + private string _DayInputId; + + private string _BaseId; + + private string _ProjectId; + + private string _DrawingId; + + private string _WorkSection; + + private string _DrawingNo; + + private string _DrawingName; + + private string _State; + + private string _Major; + + private string _Part; + + private string _ProjectContent; + + private string _Unit; + + private System.Nullable _Amount; + + private string _WorkTeam; + + private string _WorkTeamId; + + private System.Nullable _Date; + + private System.Nullable _DayAmount; + + public View_QuantityManagement_DayInputList() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DayInputId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string DayInputId + { + get + { + return this._DayInputId; + } + set + { + if ((this._DayInputId != value)) + { + this._DayInputId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BaseId", DbType="NVarChar(50)")] + public string BaseId + { + get + { + return this._BaseId; + } + set + { + if ((this._BaseId != value)) + { + this._BaseId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingId", DbType="NVarChar(50)")] + public string DrawingId + { + get + { + return this._DrawingId; + } + set + { + if ((this._DrawingId != value)) + { + this._DrawingId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkSection", DbType="NVarChar(100)")] + public string WorkSection + { + get + { + return this._WorkSection; + } + set + { + if ((this._WorkSection != value)) + { + this._WorkSection = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingNo", DbType="NVarChar(100)")] + public string DrawingNo + { + get + { + return this._DrawingNo; + } + set + { + if ((this._DrawingNo != value)) + { + this._DrawingNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingName", DbType="NVarChar(100)")] + public string DrawingName + { + get + { + return this._DrawingName; + } + set + { + if ((this._DrawingName != value)) + { + this._DrawingName = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="Char(1)")] + public string State + { + get + { + return this._State; + } + set + { + if ((this._State != value)) + { + this._State = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Major", DbType="NVarChar(30)")] + public string Major + { + get + { + return this._Major; + } + set + { + if ((this._Major != value)) + { + this._Major = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Part", DbType="NVarChar(100)")] + public string Part + { + get + { + return this._Part; + } + set + { + if ((this._Part != value)) + { + this._Part = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectContent", DbType="NVarChar(100)")] + public string ProjectContent + { + get + { + return this._ProjectContent; + } + set + { + if ((this._ProjectContent != value)) + { + this._ProjectContent = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Unit", DbType="NVarChar(50)")] + public string Unit + { + get + { + return this._Unit; + } + set + { + if ((this._Unit != value)) + { + this._Unit = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Amount", DbType="Decimal(18,2)")] + public System.Nullable Amount + { + get + { + return this._Amount; + } + set + { + if ((this._Amount != value)) + { + this._Amount = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkTeam", DbType="NVarChar(50)")] + public string WorkTeam + { + get + { + return this._WorkTeam; + } + set + { + if ((this._WorkTeam != value)) + { + this._WorkTeam = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkTeamId", DbType="NVarChar(50)")] + public string WorkTeamId + { + get + { + return this._WorkTeamId; + } + set + { + if ((this._WorkTeamId != value)) + { + this._WorkTeamId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Date", DbType="DateTime")] + public System.Nullable Date + { + get + { + return this._Date; + } + set + { + if ((this._Date != value)) + { + this._Date = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DayAmount", DbType="Decimal(18,2)")] + public System.Nullable DayAmount + { + get + { + return this._DayAmount; + } + set + { + if ((this._DayAmount != value)) + { + this._DayAmount = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_QuantityManagement_ProjectContentStatistics")] public partial class View_QuantityManagement_ProjectContentStatistics { diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index 0d13be5..113b8bd 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -82,6 +82,8 @@ + + @@ -191,6 +193,7 @@ + diff --git a/SGGL/WebAPI/Controllers/CQMS/QuantityManagementController.cs b/SGGL/WebAPI/Controllers/CQMS/QuantityManagementController.cs new file mode 100644 index 0000000..51504d7 --- /dev/null +++ b/SGGL/WebAPI/Controllers/CQMS/QuantityManagementController.cs @@ -0,0 +1,166 @@ +using BLL.API; +using Model; +using Model.APIItem; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; +using BLL; + +namespace WebAPI.Controllers +{ + public class QuantityManagementController : ApiController + { + [HttpGet] + public Model.ResponeData dayInputList(string projectId, string drawingNo, string part, string projectContent, int page, int pageSize) + { + Model.ResponeData respone = new ResponeData(); + try + { + if (string.IsNullOrEmpty(drawingNo) || drawingNo == "null") + { + drawingNo = ""; + } + if (string.IsNullOrEmpty(part) || part == "null") + { + part = ""; + } + if (string.IsNullOrEmpty(projectContent) || projectContent == "null") + { + projectContent = ""; + } + return APIQuantityManagementService.DayInputList(projectId, drawingNo, part, projectContent, page, pageSize); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + } + + [HttpGet] + public Model.ResponeData getDayInputById(string dayInputId) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getDayInputById(dayInputId); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + } + + [HttpPost] + public Model.ResponeData addDayInput([FromBody] DayInputItem dayInput) + { + Model.ResponeData respone = new ResponeData(); + try + { + return APIQuantityManagementService.addDayInput(dayInput); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + } + + [HttpGet] + public Model.ResponeData getDrawingNoList(string projectId) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getDrawingNoList(projectId); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + + } + + [HttpGet] + public Model.ResponeData getTeamGroupList(string projectId) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getTeamGroupList(projectId); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + + } + + [HttpGet] + public Model.ResponeData getPartList(string drawingId) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getPartList(drawingId); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + + } + + [HttpGet] + public Model.ResponeData getProjectContentList(string drawingId, string part) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getProjectContentList(drawingId, part); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + + } + + [HttpGet] + public Model.ResponeData getBase(string baseId) + { + Model.ResponeData respone = new ResponeData(); + try + { + + return APIQuantityManagementService.getBase(baseId); + } + catch (Exception e) + { + respone.code = 0; + respone.message = e.Message; + } + return respone; + + } + } +} \ No newline at end of file diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 9be0e4b..5095af3 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -153,6 +153,7 @@ +