diff --git a/SGGL/BLL/API/HJGL/APIHJGLIndexService.cs b/SGGL/BLL/API/HJGL/APIHJGLIndexService.cs new file mode 100644 index 00000000..37d17258 --- /dev/null +++ b/SGGL/BLL/API/HJGL/APIHJGLIndexService.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Model; +namespace BLL +{ + public class APIHJGLIndexService + { + public static Model.HJGLIndexItem GetJGLIndexItem(string projectid) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Model.HJGLIndexItem hJGLIndexItem = new Model.HJGLIndexItem(); + var PipeRate1 = BLL.HJGL_WeldingReportService.GetPipeRate_finished(projectid); + var PipeRate2 = BLL.HJGL_WeldingReportService.GetPipeRate_unfinished(projectid); + + var getCH_CheckItemList = (from x in Funs.DB.HJGL_Batch_NDEItem + join y in Funs.DB.HJGL_Batch_BatchTrustItem on x.TrustBatchItemId equals y.TrustBatchItemId + join z in Funs.DB.View_HJGL_WeldJoint on y.WeldJointId equals z.WeldJointId + join line in Funs.DB.HJGL_Pipeline on z.PipelineId equals line.PipelineId + where z.ProjectId == projectid + select new Model.sp_index_HJGLItem + { + ProjectId = line.ProjectId, + ID = x.NDEItemID, + UnitId = line.UnitId, ///重定义单位 + UnitName = z.UnitName, + WorkAreaId = line.UnitId, /// 重定义区域 + MaterialId = line.UnitWorkId, ///重定义材质 + CHT_TotalFilm = x.TotalFilm, + CHT_PassFilm = x.PassFilm, + Specification = z.Specification, + WeldTypeCode = z.WeldTypeCode, + JointAttribute = z.JointAttribute, + UnitWorkName = z.UnitWorkName, + MaterialCode = z.MaterialCode + }).ToList(); + var tb_type06 = getCH_CheckItemList.GroupBy(x => x.JointAttribute).Select(x => new { + JointAttribute = x.Key, + Current_pass_film = x.Sum(m => m.CHT_PassFilm) ?? 0, + Cht_totalfilm = x.Sum(m => m.CHT_TotalFilm) ?? 0 + }); + var GC_model = tb_type06.Where(x => x.JointAttribute == "预制口").FirstOrDefault(); + var XC_model = tb_type06.Where(x => x.JointAttribute == "安装口").FirstOrDefault(); + double PassRate1 = 0; + double PassRate2 = 0; + if (GC_model!=null &&GC_model.Cht_totalfilm>0) + { + PassRate1 = Math.Round((100 * GC_model.Current_pass_film * 1.0) / GC_model.Cht_totalfilm, 1); + } + if (XC_model!=null&& XC_model.Cht_totalfilm > 0) + { + PassRate2 = Math.Round((100 * XC_model.Current_pass_film * 1.0) / XC_model.Cht_totalfilm, 1); + } + hJGLIndexItem.GCFirstPassRate = PassRate1.ToString()+" %"; + hJGLIndexItem.XCFirstPassRate = PassRate2.ToString()+" %"; + + hJGLIndexItem.GCProgress = BLL.HJGL_WeldingReportService.GetGCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 1).ToString() + " DIN"; + hJGLIndexItem.XCProgress = BLL.HJGL_WeldingReportService.GetXCRate_finished(projectid).ToString() + "/" + HJGL_WeldingReportService.GetSumSize(projectid, 2).ToString() + " DIN"; + + if (PipeRate1 + PipeRate2 == 0) + { + hJGLIndexItem.PipePrefabricationRate = "0 %"; + } + else + { + hJGLIndexItem.PipePrefabricationRate = Math.Floor(Math.Round(decimal.Parse((PipeRate1 / (PipeRate1 + PipeRate2)).ToString("0.000")), 2) * 100).ToString()+" %"; + + + } + hJGLIndexItem.GCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_GC(projectid).ToString()+" DIN/天"; + hJGLIndexItem.XCWelderEfficacy = HJGL_WeldingReportService.GetWelderEfficacy_XC(projectid).ToString()+" DIN/天"; + + return hJGLIndexItem; + } + + } + } +} diff --git a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs index 36fdf88c..6d2edd1b 100644 --- a/SGGL/BLL/API/HJGL/APIPackagingManageService.cs +++ b/SGGL/BLL/API/HJGL/APIPackagingManageService.cs @@ -10,7 +10,7 @@ namespace BLL { public class APIPackagingManageService { - public static List GetPackagingManageList(string projectId) + public static List GetPackagingManageList(string projectId,int pagesize,int pageindex) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { @@ -28,8 +28,9 @@ namespace BLL ContactName = x.ContactName, ContactPhone = x.ContactPhone, StackingPosition = x.StackingPosition, + State= x.State, }).Distinct(); - return q.ToList(); + return q.Take(pagesize*pageindex).Skip(pageindex).ToList(); } } @@ -50,6 +51,7 @@ namespace BLL ContactName = x.ContactName, ContactPhone = x.ContactPhone, StackingPosition = x.StackingPosition, + State =x.State }).FirstOrDefault(); var tb_packing = (from x in db.HJGL_PackagingManage where x.PackagingManageId==packagingManageId select x ).FirstOrDefault() ; var PipelineComponentIdList = tb_packing.PipelineComponentId.Split(','); diff --git a/SGGL/BLL/API/HJGL/APIPipelineComponentService.cs b/SGGL/BLL/API/HJGL/APIPipelineComponentService.cs new file mode 100644 index 00000000..d66aa67d --- /dev/null +++ b/SGGL/BLL/API/HJGL/APIPipelineComponentService.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class APIPipelineComponentService + { + } +} diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 085a5278..ace51f53 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -145,10 +145,12 @@ + + diff --git a/SGGL/BLL/HJGL/WeldingManage/HJGL_WeldingReportService.cs b/SGGL/BLL/HJGL/WeldingManage/HJGL_WeldingReportService.cs index ea1002bc..8a5b030f 100644 --- a/SGGL/BLL/HJGL/WeldingManage/HJGL_WeldingReportService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/HJGL_WeldingReportService.cs @@ -46,7 +46,7 @@ namespace BLL return result; } /// - /// 工厂预制完成率 + /// 工厂预制完成数 /// /// /// @@ -72,7 +72,7 @@ namespace BLL return result; } /// - /// 工厂预制未完成率 + /// 工厂预制未完成数 /// /// /// @@ -83,7 +83,7 @@ namespace BLL return result; } /// - /// 现场安装完成率 + /// 现场安装完成数 /// /// /// @@ -109,7 +109,7 @@ namespace BLL return result; } /// - /// 现场安装未完成率 + /// 现场安装未完成数 /// /// /// @@ -120,7 +120,7 @@ namespace BLL return result; } /// - /// 管道完成预制率 + /// 管道完成预制数 /// /// /// @@ -131,7 +131,7 @@ namespace BLL return result; } /// - /// 管道未完成预制率 + /// 管道未完成预制数 /// /// /// @@ -141,6 +141,11 @@ namespace BLL result = GetSumSize(projectId, 0) - GetPipeRate_finished(projectId); return result; } + /// + /// 焊工功效 + /// + /// + /// public static decimal GetWelderEfficacy(string projectId) { decimal result = 0; @@ -160,6 +165,48 @@ namespace BLL } + return decimal.Truncate(result); + } + public static decimal GetWelderEfficacy_GC(string projectId) + { + decimal result = 0; + var db = Funs.DB; + var q = (from x in db.HJGL_WeldJoint + join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId + where x.ProjectId == projectId && x.JointAttribute=="预制口" + group x by x.ProjectId into g + select new + { + TotalDin = g.Sum(x => x.Size), + worktime = g.Select(x => x.WeldingDailyId).Distinct().Count(), + }); + foreach (var item in q) + { + result = decimal.Divide((decimal)item.TotalDin, item.worktime); + + } + + return decimal.Truncate(result); + } + public static decimal GetWelderEfficacy_XC(string projectId) + { + decimal result = 0; + var db = Funs.DB; + var q = (from x in db.HJGL_WeldJoint + join y in db.HJGL_WeldingDaily on x.WeldingDailyId equals y.WeldingDailyId + where x.ProjectId == projectId && x.JointAttribute == "安装口" + group x by x.ProjectId into g + select new + { + TotalDin = g.Sum(x => x.Size), + worktime = g.Select(x => x.WeldingDailyId).Distinct().Count(), + }); + foreach (var item in q) + { + result = decimal.Divide((decimal)item.TotalDin, item.worktime); + + } + return decimal.Truncate(result); } } diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/MaterialCodeLib.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/MaterialCodeLib.xlsx index 1d62630a..d03e27fb 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/MaterialCodeLib.xlsx and b/SGGL/FineUIPro.Web/File/Excel/DataIn/MaterialCodeLib.xlsx differ diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx index 68cbaa81..0aac678a 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLib.aspx @@ -49,16 +49,16 @@ TextAlign="Left" SortField="MaterialCode"> - - + --%> diff --git a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs index 21af2ed2..276504bc 100644 --- a/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/BaseInfo/MaterialCodeLibIn.aspx.cs @@ -128,7 +128,7 @@ namespace FineUIPro.Web.HJGL.BaseInfo return; } - DataRow[] dv = ds.Tables[0].Select("采购码 <>'' and 元件类型 <>''"); + DataRow[] dv = ds.Tables[0].Select("元件编码 <>'' and 类型 <>''"); //导入数据库 if (dv.Length > 0) { @@ -137,20 +137,20 @@ namespace FineUIPro.Web.HJGL.BaseInfo HJGL_MaterialCodeLib item = new HJGL_MaterialCodeLib(); #region 数据验证和赋值 - if (dv[i]["采购码"] != null && !string.IsNullOrEmpty(dv[i]["采购码"].ToString())) + if (dv[i]["元件编码"] != null && !string.IsNullOrEmpty(dv[i]["元件编码"].ToString())) { - item.MaterialCode = dv[i]["采购码"].ToString(); + item.MaterialCode = dv[i]["元件编码"].ToString(); } else { - errorInfos += (i + 2) + "Line, [采购码] 不能为空
"; + errorInfos += (i + 2) + "Line, [元件编码] 不能为空
"; } item.MaterialDef = dv[i]["材料描述"].ToString(); item.MaterialSpec = dv[i]["规格"].ToString(); - item.MaterialMade = dv[i]["材质"].ToString(); + // item.MaterialMade = dv[i]["材质"].ToString(); item.MaterialUnit = dv[i]["单位"].ToString(); - item.MaterialName = dv[i]["元件类型"].ToString(); - item.PipeGrade = dv[i]["管道等级"].ToString(); + item.MaterialName = dv[i]["类型"].ToString(); + //item.PipeGrade = dv[i]["管道等级"].ToString(); //item.ProjectId = CurrUser.LoginProjectId; //= SQLHelper.GetNewID(typeof(Model.Editor_CostReport)); if (!codeLib.Select(x => x.MaterialCode).Contains(item.MaterialCode)) diff --git a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx index 334fd323..afd641fa 100644 --- a/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx +++ b/SGGL/FineUIPro.Web/HJGL/DataImport/MaterialInformation.aspx @@ -116,12 +116,12 @@ FieldType="String" HeaderText="规格" HeaderTextAlign="Center" TextAlign="Left"> - - + --%> - - + --%> - diff --git a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReviewEdit2.aspx.cs b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReviewEdit2.aspx.cs index 86d3877a..e89130f1 100644 --- a/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReviewEdit2.aspx.cs +++ b/SGGL/FineUIPro.Web/PHTGL/BiddingManagement/SetSubReviewEdit2.aspx.cs @@ -46,7 +46,7 @@ namespace FineUIPro.Web.PHTGL.BiddingManagement PHTGL_BidApproveUserReviewService.InitGetBidCompleteDropDownList(DropBidCode, true); Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.DropConstructionManager, null, Const.UnitId_SEDIN, null, true); Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.DropProjectManager, null, Const.UnitId_SEDIN, null, true); - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropApproval_Construction, CurrUser.UnitId, Const.ConstructionMinister, Const.ConstructionViceMinister, false); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropApproval_Construction, null, CurrUser.UnitId, Const.ConstructionMinister + "," + Const.ConstructionViceMinister, false); BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(DropDeputyGeneralManager, null, this.CurrUser.UnitId, Const.DeputyGeneralManager, false); if (PHTGL_ActionPlanReviewService.IsSpecialProject(this.CurrUser.LoginProjectId)) { diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx b/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx index 07c0c843..c8a71ad8 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx @@ -12,14 +12,14 @@ text-align: center; min-width: 0.75rem; margin-right: 0.02083rem; - font-size: revert; + font-size: smaller; color: #6ceff1; } .real-time-echarts02 { text-align: center; min-width: 0.75rem; margin-right: 0.02083rem; - font-size: revert; + font-size: smaller; color: rgb(6 247 192 / 85%); } .real-time-echarts02-unit { diff --git a/SGGL/Model/APIItem/HJGL/HJGLIndexItem.cs b/SGGL/Model/APIItem/HJGL/HJGLIndexItem.cs new file mode 100644 index 00000000..847a9dc5 --- /dev/null +++ b/SGGL/Model/APIItem/HJGL/HJGLIndexItem.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class HJGLIndexItem + { + /// + /// 工厂焊接一次合格率 + /// + public string GCFirstPassRate { get; set; } + /// + /// 现场焊接一次合格率 + /// + public string XCFirstPassRate { get; set; } + /// + /// 工厂预制进度 + /// + public string GCProgress { get; set; } + /// + /// 现场预制进度 + /// + public string XCProgress { get; set; } + /// + /// 工厂焊工功效 + /// + public string GCWelderEfficacy { get; set; } + /// + /// 现场焊工功效 + /// + public string XCWelderEfficacy { get; set; } + /// + /// 管道实时预制率 + /// + public string PipePrefabricationRate { get; set; } + + + + } +} diff --git a/SGGL/Model/HJGL/PackagingManageItem.cs b/SGGL/Model/HJGL/PackagingManageItem.cs index 9053d68d..aff7930a 100644 --- a/SGGL/Model/HJGL/PackagingManageItem.cs +++ b/SGGL/Model/HJGL/PackagingManageItem.cs @@ -14,6 +14,8 @@ namespace Model public string ContactName { get; set; } public string ContactPhone { get; set; } public string StackingPosition { get; set; } + + public int? State { get; set; } } public class PackagingPrepipeItem diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index b9e9474d..7920e6e0 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -63,6 +63,7 @@ + diff --git a/SGGL/WebAPI/Controllers/HJGL/HJGLIndexController.cs b/SGGL/WebAPI/Controllers/HJGL/HJGLIndexController.cs new file mode 100644 index 00000000..aea521a0 --- /dev/null +++ b/SGGL/WebAPI/Controllers/HJGL/HJGLIndexController.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Http; +using System.Web.Mvc; + +namespace WebAPI.Controllers +{ + /// + /// + /// + public class HJGLIndexController : ApiController + { + /// + /// 获取首页数据分析 + /// + /// + /// + public Model.ResponeData GetJGLIndexItem(string projectId) + { + var responeData = new Model.ResponeData(); + try + { + responeData.data = BLL.APIHJGLIndexService.GetJGLIndexItem(projectId); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + + return responeData; + } + } +} \ No newline at end of file diff --git a/SGGL/WebAPI/Controllers/HJGL/PackagingManageController.cs b/SGGL/WebAPI/Controllers/HJGL/PackagingManageController.cs index e6b714d4..35ef68e5 100644 --- a/SGGL/WebAPI/Controllers/HJGL/PackagingManageController.cs +++ b/SGGL/WebAPI/Controllers/HJGL/PackagingManageController.cs @@ -13,12 +13,12 @@ namespace WebAPI.Controllers /// public class PackagingManageController : ApiController { - public Model.ResponeData GetPackagingInformationList(string projectid) + public Model.ResponeData GetPackagingInformationList(string projectid, int pagesize, int pageindex) { var responeData = new Model.ResponeData(); try { - responeData.data = BLL.APIPackagingManageService.GetPackagingManageList(projectid); + responeData.data = BLL.APIPackagingManageService.GetPackagingManageList(projectid, pagesize,pageindex); } catch (Exception ex) { diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 9324051f..6379af06 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -169,6 +169,7 @@ + @@ -293,6 +294,7 @@ +