diff --git a/DataBase/版本日志/SGGLDB_WH_2023-10-31.sql b/DataBase/版本日志/SGGLDB_WH_2023-10-31.sql new file mode 100644 index 00000000..735de1d1 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-10-31.sql @@ -0,0 +1,116 @@ +--ӳ +alter table CQMS_Performance add OutDay int null; +GO +--ӹ +alter table CQMS_Performance add Workloads decimal(18, 2) null; +GO +--ӹΧ +alter table CQMS_Performance add WorkRange nvarchar(200) null; +GO +--Ӵ +alter table CQMS_Performance add ScorMan nvarchar(50) null; +GO +--Ӳ˵ʩЧ +insert into sys_menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('F2133BD6-C786-407A-AD6F-3EEF613229A8','ʩЧ','ZHGL/Performance/PerformanceAllData.aspx',150, +'0','Menu_ZHGL','1','1','1') +GO + + +ALTER PROCEDURE [dbo].[Proc_CallWebApi] + -- Add the parameters for the stored procedure here + @userId NVARCHAR(2000),--ҪͶߵuseridŷָ + @thing2 nvarchar(2000),--͵Ϣ + @name1 nvarchar(50),-- + @date3 datetime,--͵ + @projectName nvarchar(200), + @ResponseText NVARCHAR(4000) OUTPUT +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + -- Insert statements for procedure here + DECLARE @data varchar(8000); + DECLARE @ApiUrl VARCHAR(200); + DECLARE @RequestType VARCHAR(5);--:POST,GET + DECLARE @date2 varchar(100); + set @date2 = CONVERT(varchar(100), @date3, 23) + --APIַ + set @ApiUrl='http://localhost:7040/api/Common/postSubscribeMessage'; + --set @ApiUrl='https://zhgd.cwcec.com/sgglapi_wx/api/Common/postSubscribeMessage'; + set @RequestType='POST'; + + -- + set @data='{ + "touser":"'+@userId+'", + "template_id":"1gT0FfTc2LwnnqUCU8h_nXDyv8VGtne1Iolo47gPA0c", + "page":"pages/index/index", + "data":{ + "thing3":{"value":"յʩЧδд"}, + "thing13":{"value":"ϵͳԱ"}, + "time5":{"value":"'+@date2+'"} + } + }'; -- + + Declare @Object as Int + Exec sp_OACreate 'Msxml2.ServerXMLHTTP.3.0', @Object OUT + Exec sp_OAMethod @Object, 'open', NULL, @RequestType,@ApiUrl,'false' + IF @RequestType='POST' + BEGIN + Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'Content-Type','application/json' + + END + Exec sp_OAMethod @Object, 'setRequestHeader', NULL, 'token','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0' + Exec sp_OAMethod @Object, 'send', NULL, @data -- + Exec sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT + --EXEC sp_OAGetErrorInfo @Object --쳣 + --Select @ResponseText as ResponseText + --Select * from [dbo].[ParseJSON](@ResponseText) + Exec sp_OADestroy @Object + +END + +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO + +--ÿ4㶨ʱִУѯʩЧûдݵˣȻ +ALTER PROCEDURE [dbo].[Sp_APP_PerformanceByTime] + +AS +BEGIN + declare @ResponseText NVARCHAR(4000); + DECLARE @PostUserid nvarchar(2000); + declare @UserOpenid nvarchar(50); + declare @Projectname nvarchar(200); + --αѯ + DECLARE @Userid nvarchar(50);--ûid + DECLARE @ProjectId nvarchar(50);-- + DECLARE My_Cursor CURSOR --α + FOR ( select Top 1 Child3.CreateMan,Perfor.ProjectId from CQMS_Performance_Child3 Child3 + LEFT JOIN CQMS_Performance as Perfor ON Perfor.PerformanceGid=Child3.PerformanceGid + + where Child3.WorkPlan='' + and CONVERT(varchar(100), Child3.CurrentDate, 23)=CONVERT(varchar(100), GETDATE(), 23) ) + OPEN My_Cursor;--α + FETCH NEXT FROM My_Cursor INTO @Userid,@ProjectId;--ȡһ + WHILE @@FETCH_STATUS=0 + --α״̬жϣΪ0֤αֵ + BEGIN + declare @dateNow datetime; + set @dateNow=getdate(); + select @UserOpenid=openid from sys_user where userid=@Userid; + select @Projectname=ShortName from Base_Project where projectid=@ProjectId; + --ִapi洢 + exec Proc_CallWebApi @UserOpenid,'յʩЧδд','ϵͳԱ',@dateNow,@Projectname,@ResponseText output; + FETCH NEXT + FROM + My_Cursor INTO @Userid,@ProjectId; + + END CLOSE My_Cursor;--رα + DEALLOCATE My_Cursor;--ͷα +END +GO \ No newline at end of file diff --git a/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs b/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs index a15c8e23..122af555 100644 --- a/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs +++ b/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs @@ -74,6 +74,36 @@ namespace BLL } } + /// + /// 用户下拉框 + /// + /// 下拉框名字 + /// 项目id + /// 是否显示请选择 + public static void InitUserDropDownListByUser(FineUIPro.DropDownList dropName, string projectId,string userId, bool isShowPlease) + { + dropName.DataValueField = "CreateMan"; + dropName.DataTextField = "CreateManName"; + dropName.DataSource = GetProjectUserListByProjectId(projectId, userId); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static void InitAllUserDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "CreateMan"; + dropName.DataTextField = "CreateManName"; + dropName.DataSource = GetProjectAllUserListByProjectId(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + public class PerformanceUser { public string CreateMan { get; set; } @@ -94,5 +124,39 @@ namespace BLL } } + public static List GetProjectUserListByProjectId(string projectId,string userId) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var list = (from x in db.CQMS_Performance + join y in db.Sys_User on x.CreateMan equals y.UserId + where x.ProjectId == projectId && x.States == "1" && x.ScorMan== userId + select new PerformanceUser + { + CreateMan = x.CreateMan, + CreateManName = BLL.UserService.GetUserByUserId(x.CreateMan).UserName + }).ToList(); + return list; + } + } + + + public static List GetProjectAllUserListByProjectId() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var list = (from x in db.CQMS_Performance + join y in db.Sys_User on x.CreateMan equals y.UserId + where x.States == "1" + select new PerformanceUser + { + CreateMan = x.CreateMan, + CreateManName = BLL.UserService.GetUserByUserId(x.CreateMan).UserName + }).Distinct().ToList(); + + return list; + } + } + } } diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 54226bc7..578500cd 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -1016,7 +1016,7 @@ 2.1.1 - 12.0.3 + 13.0.3 2.5.5 diff --git a/SGGL/BLL/CQMS/WBS/BreakdownProjectService.cs b/SGGL/BLL/CQMS/WBS/BreakdownProjectService.cs index 881910b2..3f902edf 100644 --- a/SGGL/BLL/CQMS/WBS/BreakdownProjectService.cs +++ b/SGGL/BLL/CQMS/WBS/BreakdownProjectService.cs @@ -421,5 +421,10 @@ namespace BLL return false; } } + + public static Model.WBS_BreakdownProject GetBreakdownProjectByName(string divisionProjectId, string breakdownName) + { + return Funs.DB.WBS_BreakdownProject.FirstOrDefault(x => x.DivisionProjectId == divisionProjectId && x.BreakdownName == breakdownName); + } } } diff --git a/SGGL/BLL/CQMS/WBS/DivisionProjectService.cs b/SGGL/BLL/CQMS/WBS/DivisionProjectService.cs index bcbb8004..d41674a0 100644 --- a/SGGL/BLL/CQMS/WBS/DivisionProjectService.cs +++ b/SGGL/BLL/CQMS/WBS/DivisionProjectService.cs @@ -189,5 +189,26 @@ namespace BLL return false; } } + + /// + /// 根据分部id获取下级项 + /// + /// + /// + public static List GetDivisionProjectBySupId(string divisionProjectId) + { + return (from x in Funs.DB.WBS_DivisionProject where x.SuperDivisionId == divisionProjectId select x).ToList(); + } + + /// + /// 根据分部名称获取信息 + /// + /// + /// + public static Model.WBS_DivisionProject GetDivisionProjectByName(string CNProfessionalId, string unitWorkId,string superDivisionId, string divisionName) + { + var q = Funs.DB.WBS_DivisionProject.FirstOrDefault(x => x.CNProfessionalId == CNProfessionalId && x.UnitWorkId == unitWorkId && x.SuperDivisionId==superDivisionId && x.DivisionName == divisionName); + return q; + } } } diff --git a/SGGL/BLL/HSSE/SitePerson/PersonService.cs b/SGGL/BLL/HSSE/SitePerson/PersonService.cs index 4dbd683d..ef763e16 100644 --- a/SGGL/BLL/HSSE/SitePerson/PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/PersonService.cs @@ -384,9 +384,9 @@ namespace BLL /// /// 单位Id /// 人员的数量 - public static int GetPersonCountByUnitId(string unitId, string projectId, bool isOutside) + public static int GetPersonCountByUnitId(string unitId, string projectId, DateTime inTime, bool isOutside) { - var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.IsUsed == true && x.IsOutside == isOutside select x).ToList(); + var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && x.InTime <= inTime && x.IsUsed == true && x.IsOutside == isOutside select x).ToList(); return q.Count(); } @@ -395,11 +395,12 @@ namespace BLL /// /// 单位Id /// HSE人员的数量 - public static int GetHSEPersonCountByUnitId(string unitId, string projectId) + public static int GetHSEPersonCountByUnitId(string unitId, string projectId, DateTime inTime) { var q = (from x in Funs.DB.SitePerson_Person join y in Funs.DB.Base_WorkPost on x.WorkPostId equals y.WorkPostId - where x.UnitId == unitId && x.ProjectId == projectId && y.IsHsse==true && x.IsUsed == true select x).ToList(); + where x.UnitId == unitId && x.ProjectId == projectId && x.InTime <= inTime && y.IsHsse == true && x.IsUsed == true + select x).ToList(); //var q = (from x in Funs.DB.SitePerson_Person where x.UnitId == unitId && x.ProjectId == projectId && (x.WorkPostId == BLL.Const.WorkPost_HSSEEngineer || x.WorkPostId == BLL.Const.WorkPost_SafetyManager) && x.IsUsed == true select x).ToList(); return q.Count(); } diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx new file mode 100644 index 00000000..2d9051bc --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx @@ -0,0 +1,48 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutDayEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.OutDayEdit" %> + + + + + + + 修改出差天数 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.cs new file mode 100644 index 00000000..053b0703 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.cs @@ -0,0 +1,48 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class OutDayEdit : PageBase + { + //主键 + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //主键 + PerformanceGid = Request.Params["PerformanceGid"]; + //根据主键加载主表 + var pModel = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + txtOutDay.Text = pModel.OutDay.ToString(); + txtWorkRange.Text = pModel.WorkRange; + } + } + + protected void btnEdit_Click(object sender, EventArgs e) + { + var pModel = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + pModel.OutDay = Convert.ToInt32(txtOutDay.Text); + pModel.WorkRange = txtWorkRange.Text.Trim(); + Funs.DB.SubmitChanges(); + ShowNotify("修改成功。", MessageBoxIcon.Success); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.designer.cs new file mode 100644 index 00000000..4e11b87d --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/OutDayEdit.aspx.designer.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class OutDayEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm2; + + /// + /// txtOutDay 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtOutDay; + + /// + /// txtWorkRange 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkRange; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx index a2040d55..e7d9a82e 100644 --- a/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx @@ -34,6 +34,10 @@ + + @@ -46,7 +50,7 @@ OnClick="btnWorkPlan"> - @@ -100,6 +104,13 @@ Title="编辑" EnableIFrame="true" Height="650px" Width="1200px"> + + + <%--