Merge branch 'master' of https://gitee.com/frane-yang/SGGL_CWCEC
This commit is contained in:
commit
ab09cf21d2
|
@ -0,0 +1,3 @@
|
|||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('638B5540-73B8-4A6C-BBB7-81961CE7336B','0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A','ɾ³ý',3)
|
||||
GO
|
|
@ -513,7 +513,9 @@ GO
|
|||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A','¿¼ÊԼǼ','HSSE/EduTrain/TestRecord.aspx',70,'6A0506EB-05CE-4BB3-9BA9-866389F01E1C','Menu_HSSE',0,1,1)
|
||||
GO
|
||||
|
||||
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
|
||||
VALUES('638B5540-73B8-4A6C-BBB7-81961CE7336B','0EEB138D-84F9-4686-8CBB-CAEAA6CF1B2A','ɾ³ý',3)
|
||||
GO
|
||||
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
|
||||
VALUES('6FF941C1-8A00-4A74-8111-C892FC30A8DA','¿¼ÊÔͳ¼Æ','HSSE/EduTrain/TestStatistics.aspx',80,'6A0506EB-05CE-4BB3-9BA9-866389F01E1C','Menu_HSSE',0,1,1)
|
||||
GO
|
||||
|
|
|
@ -87,17 +87,18 @@ namespace BLL
|
|||
string type = obj["Type"].ToString();
|
||||
string code = obj["Code"].ToString();
|
||||
string fromprojectId = obj["DepartId"].ToString();
|
||||
string OtherDepartId = obj["OtherDepartId"].ToString();
|
||||
JArray arr = JArray.Parse(obj["Data"].ToString());
|
||||
string projectId = string.Empty;
|
||||
////根据传值项目主键
|
||||
var getProjectByFromProjectId = Funs.DB.Base_Project.FirstOrDefault(x => x.FromProjectId == fromprojectId);
|
||||
var getProjectByFromProjectId = Funs.DB.Base_Project.FirstOrDefault(x => x.FromProjectId == fromprojectId && x.ProjectCode== OtherDepartId);
|
||||
if (getProjectByFromProjectId != null)
|
||||
{
|
||||
projectId = getProjectByFromProjectId.ProjectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
string OtherDepartId = obj["OtherDepartId"].ToString();
|
||||
|
||||
var getPByCode= Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectCode == OtherDepartId);
|
||||
if (getPByCode != null)
|
||||
{
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
|
@ -22,11 +23,8 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
if (this.CurrUser.UserId == BLL.Const.sysglyId)
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
///更新没有结束时间且超时的考试记录
|
||||
GetDataService.UpdateTestPlanStates();
|
||||
// 绑定表格
|
||||
|
@ -127,7 +125,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
|
@ -138,7 +135,6 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
|
@ -301,6 +297,29 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TestRecordPrint.aspx?TestRecordId={0}", Grid1.SelectedRowID, "编辑 - "), "考试试卷", 900, 650));
|
||||
//}
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTestRecordMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
|
|
|
@ -15,12 +15,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 人员考勤集合
|
||||
/// </summary>
|
||||
public static List<Model.View_SitePerson_Checking> viewCheckings = new List<Model.View_SitePerson_Checking>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
|
@ -54,11 +49,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
{
|
||||
this.hdFileName.Text = string.Empty;
|
||||
this.hdCheckResult.Text = string.Empty;
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (viewCheckings != null)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
}
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
}
|
||||
|
@ -84,11 +75,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (viewCheckings!=null)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
|
@ -171,8 +158,8 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
{
|
||||
var units = from x in Funs.DB.Base_Unit select x;
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == this.ProjectId select x;
|
||||
|
||||
where x.ProjectId == this.ProjectId
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string col0 = pds.Rows[i][0].ToString().Trim();
|
||||
|
@ -198,14 +185,7 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
result += "第" + (i + 2).ToString() + "行," + "单位" + "," + "[" + col0 + "]不在单位表中!" + "|";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(col1))
|
||||
{
|
||||
var person = sitePersons.FirstOrDefault(e => e.PersonName == col1);
|
||||
if (person == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在人员信息表中!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(col2))
|
||||
{
|
||||
var person = sitePersons.FirstOrDefault(e => e.IdentityCard == col2);
|
||||
|
@ -216,8 +196,26 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "身份证号码" + "," + "此项为必填项!" + "|";
|
||||
if (!string.IsNullOrEmpty(col1))
|
||||
{
|
||||
var person = sitePersons.FirstOrDefault(e => e.PersonName == col1);
|
||||
if (person == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在人员信息表中!" + "|";
|
||||
}
|
||||
|
||||
var personOut = sitePersons.FirstOrDefault(e => e.PersonName == col1 && (!e.OutTime.HasValue || e.OutTime > DateTime.Now));
|
||||
if (personOut == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "姓名" + "," + "[" + col1 + "]不在岗!" + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "身份证号码/姓名" + "," + "不能都为空!" + "|";
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(col3))
|
||||
{
|
||||
if (col3 != "进" && col3 != "出")
|
||||
|
@ -335,6 +333,10 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
/// <summary>
|
||||
/// 人员考勤集合
|
||||
/// </summary>
|
||||
public static List<Model.View_SitePerson_Checking> viewCheckings = new List<Model.View_SitePerson_Checking>();
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
|
@ -345,13 +347,13 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
/// <returns></returns>
|
||||
private bool AddDatasetToSQL2(DataTable pds)
|
||||
{
|
||||
viewCheckings.Clear();
|
||||
viewCheckings.Clear();
|
||||
int ir = pds.Rows.Count;
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
var units = from x in Funs.DB.Base_Unit select x;
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person where x.ProjectId == this.ProjectId select x;
|
||||
|
||||
{
|
||||
var sitePersons = from x in Funs.DB.SitePerson_Person
|
||||
where x.ProjectId == this.ProjectId && !x.OutTime.HasValue
|
||||
select x;
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
string col0 = pds.Rows[i][0].ToString().Trim();
|
||||
|
@ -369,14 +371,14 @@ namespace FineUIPro.Web.HSSE.SitePerson
|
|||
IntoOut = col3 == "进" ? "1" : "0",
|
||||
IntoOutTime = Convert.ToDateTime(col4)
|
||||
};
|
||||
var person = BLL.PersonService.GetPersonByIdentityCard( this.ProjectId, checking.IdentityCard);
|
||||
var person = sitePersons.FirstOrDefault(x => x.IdentityCard == checking.IdentityCard);
|
||||
if (person != null)
|
||||
{
|
||||
checking.PersonId = person.PersonId;
|
||||
checking.ProjectId = person.ProjectId;
|
||||
}
|
||||
checking.CheckingId = SQLHelper.GetNewID();
|
||||
viewCheckings.Add(checking);
|
||||
checking.CheckingId = SQLHelper.GetNewID();
|
||||
viewCheckings.Add(checking);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (viewCheckings.Count > 0)
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
|||
if (!string.IsNullOrEmpty(idText))
|
||||
{
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(this.drpProject.SelectedValue);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getList = returnCardList();
|
||||
|
@ -418,7 +418,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
|||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
|
@ -470,7 +470,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
|||
int count = 0;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
var getIdentityCards = (from x in Funs.DB.SitePerson_Person
|
||||
|
@ -515,7 +515,7 @@ namespace FineUIPro.Web.ZHGL.RealName
|
|||
string message = string.Empty;
|
||||
string projectId = this.drpProject.SelectedValue;
|
||||
string proCode = ProjectService.GetJTProjectCodeByProjectId(projectId);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.JTproCode == proCode);
|
||||
var getRProjects = Funs.DB.RealName_Project.FirstOrDefault(x => x.ProCode == proCode);
|
||||
if (getRProjects != null && !string.IsNullOrEmpty(getRProjects.JTproCode))
|
||||
{
|
||||
message= SynchroSetService.updatePersonsExitTime(getRProjects.JTproCode);
|
||||
|
|
|
@ -239,13 +239,31 @@ namespace WebAPI.Controllers
|
|||
{
|
||||
string projectId = facerecord.ProjectId;
|
||||
string personName = facerecord.EmployName;
|
||||
var getPersonByIdCard = db.SitePerson_Person.Where(x => x.IdentityCard == facerecord.EmployNO).OrderByDescending(x => x.InTime).FirstOrDefault();
|
||||
if (getPersonByIdCard != null)
|
||||
{
|
||||
personName = getPersonByIdCard.PersonName;
|
||||
projectId = getPersonByIdCard.ProjectId;
|
||||
}
|
||||
|
||||
string ProjectId_19261 = "1be62038-2b94-4ac2-9b5f-80cef85deeb2";
|
||||
string ProjectId_20041 = "e9fe4b89-f62d-4b3a-a40c-57c87010aa92";
|
||||
if (projectId == ProjectId_19261 || projectId == ProjectId_20041)
|
||||
{
|
||||
var getPersonByIdCard = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == facerecord.EmployNO && (x.ProjectId == ProjectId_19261 || x.ProjectId == ProjectId_20041) && !x.OutTime.HasValue);
|
||||
if (getPersonByIdCard != null)
|
||||
{
|
||||
personName = getPersonByIdCard.PersonName;
|
||||
projectId = getPersonByIdCard.ProjectId;
|
||||
}
|
||||
}
|
||||
|
||||
string ProjectId_20197 = "310e790e-5ede-4345-98a4-8bd0866e69ef";
|
||||
string ProjectId_21126 = "a7f692aa-4bd5-4fb3-87f8-ba1ab8f94cc2";
|
||||
if (projectId == ProjectId_20197 || projectId == ProjectId_21126)
|
||||
{
|
||||
var getPersonByIdCard = db.SitePerson_Person.FirstOrDefault(x => x.IdentityCard == facerecord.EmployNO && (x.ProjectId == ProjectId_20197 || x.ProjectId == ProjectId_21126) && !x.OutTime.HasValue);
|
||||
if (getPersonByIdCard != null)
|
||||
{
|
||||
personName = getPersonByIdCard.PersonName;
|
||||
projectId = getPersonByIdCard.ProjectId;
|
||||
}
|
||||
}
|
||||
|
||||
var getFacerecord = db.T_d_facerecord.FirstOrDefault(x => x.ID == facerecord.ID && x.ProjectId == projectId && x.RoleID == facerecord.RoleID);
|
||||
if (getFacerecord == null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue