20221019 人员派遣功能实现

This commit is contained in:
2022-10-19 10:25:17 +08:00
parent 6e363ef6ae
commit 7b44a17117
15 changed files with 533 additions and 6438 deletions
@@ -1,5 +1,6 @@
using BLL;
using FastReport.Editor.Syntax;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
@@ -39,6 +40,20 @@ namespace FineUIPro.Web.Person
ViewState["SitePersonId"] = value;
}
}
/// <summary>
/// 人员分配类型 P-派遣 Shunt-分流
/// </summary>
public string Type
{
get
{
return (string)ViewState["Type"];
}
set
{
ViewState["Type"] = value;
}
}
#endregion
#region
@@ -51,6 +66,7 @@ namespace FineUIPro.Web.Person
{
if (!IsPostBack)
{
this.Type = Request.Params["Type"];
btnClose.OnClientClick = ActiveWindow.GetHideReference();
ProjectService.InitProjectDropDownList(this.drpProject, true);
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
@@ -72,6 +88,12 @@ namespace FineUIPro.Web.Person
else
{
this.InitDropDownListProject();
var getPersons = Person_PersonsService.GetPerson_PersonsById(Request.Params["PersonId"]);
if (getPersons != null)
{
SetPersonInfo(getPersons);
}
this.txtIdentityCard.Focus();
}
@@ -85,6 +107,10 @@ namespace FineUIPro.Web.Person
{
this.btnSave.Text = "提交在审";
}
if (this.Type == "P")
{
this.lbStates.Text = "派遣";
}
getInitGridCertificate();
getInitGridTestRecord();
@@ -130,103 +156,7 @@ namespace FineUIPro.Web.Person
var person = BLL.Person_PersonsService.GetPerson_PersonsByIdCard(idCard);
if (person != null)
{
this.PersonId = person.PersonId;
this.drpUnit.Readonly = true;
if (person.IsCardNoOK == true)
{
this.txtIdentityCard.Readonly = true;
}
#region
this.txtPersonName.Text = person.PersonName;
this.drpUnit.SelectedValue = person.UnitId;
if (string.IsNullOrEmpty(this.drpUnit.SelectedValue))
{
string name = UnitService.GetUnitNameByUnitId(person.UnitId);
Alert.ShowInParent("当前人员所属单位【" + name + "】不在该项目单位中,请查证!", MessageBoxIcon.Warning);
}
this.txtAccount.Text = person.Account;
if (person.IsForeign.HasValue)
{
this.ckIsForeign.Checked = person.IsForeign.Value;
}
this.rbPersonType.SelectedValue = person.PersonType;
if (!string.IsNullOrEmpty(person.IdcardType))
{
this.drpIdcardType.SelectedValue = person.IdcardType;
}
this.txtIdentityCard.Text = person.IdentityCard;
this.txtIdcardAddress.Text = person.IdcardAddress;
if (!string.IsNullOrEmpty(person.IdcardForever))
{
this.rblIdcardForever.SelectedValue = person.IdcardForever;
if (person.IdcardForever == "Y")
{
this.txtIdcardEndDate.ShowRedStar = false;
this.txtIdcardEndDate.Required = false;
}
}
this.txtIdcardStartDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardStartDate);
this.txtIdcardEndDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardEndDate);
if (!string.IsNullOrEmpty(person.Sex))
{
this.rblSex.SelectedValue = person.Sex;
}
if (person.Birthday.HasValue)
{
this.txtBirthday.Text = string.Format("{0:yyyy-MM-dd}", person.Birthday);
this.txtAge.Text = IDCardValid.CalculateAgeCorrect(person.Birthday.Value).ToString();
}
this.txtTelephone.Text = person.Telephone;
if (!string.IsNullOrEmpty(person.PhotoUrl))
{
imgPhoto.ImageUrl = ("~/" + person.PhotoUrl);
}
if (!string.IsNullOrEmpty(person.QRCodeAttachUrl))
{
imgQR.ImageUrl = ("~/" + person.QRCodeAttachUrl);
}
if (!string.IsNullOrEmpty(person.IDCardUrl))
{
imgIDCard.ImageUrl = ("~/" + person.IDCardUrl);
}
if (!string.IsNullOrEmpty(person.IDCardBackUrl))
{
imgIDCardBack.ImageUrl = ("~/" + person.IDCardBackUrl);
}
#endregion
#region
this.txtMajor.Text = person.Major;
this.txtForeignLanguage.Text = person.ForeignLanguage;
if (!string.IsNullOrEmpty(person.CountryCode))
{
this.drpCountryCode.SelectedValue = person.CountryCode;
CityService.InitCityDropDownList(this.drpProvinceCode, person.CountryCode, false);
}
if (!string.IsNullOrEmpty(person.ProvinceCode))
{
this.drpProvinceCode.SelectedValue = person.ProvinceCode;
}
if (!string.IsNullOrEmpty(person.Nation))
{
this.drpNation.SelectedValue = person.Nation;
}
if (!string.IsNullOrEmpty(person.PoliticsStatus))
{
this.drpPoliticsStatus.SelectedValue = person.PoliticsStatus;
}
if (!string.IsNullOrEmpty(person.EduLevel))
{
this.drpEduLevel.SelectedValue = person.EduLevel;
}
if (!string.IsNullOrEmpty(person.MaritalStatus))
{
this.drpMaritalStatus.SelectedValue = person.MaritalStatus;
}
this.txtRelativeName.Text = person.RelativeName;
this.txtRelativeTel.Text = person.RelativeTel;
this.txtAddress.Text = person.Address;
#endregion
SetPersonInfo(person);
}
else
{
@@ -234,6 +164,112 @@ namespace FineUIPro.Web.Person
}
}
}
/// <summary>
/// 设置人员信息
/// </summary>
/// <param name="person"></param>
private void SetPersonInfo(Model.Person_Persons person)
{
this.PersonId = person.PersonId;
this.drpUnit.Readonly = true;
if (person.IsCardNoOK == true)
{
this.txtIdentityCard.Readonly = true;
}
#region
this.txtPersonName.Text = person.PersonName;
this.drpUnit.SelectedValue = person.UnitId;
if (string.IsNullOrEmpty(this.drpUnit.SelectedValue))
{
string name = UnitService.GetUnitNameByUnitId(person.UnitId);
Alert.ShowInParent("当前人员所属单位【" + name + "】不在该项目单位中,请查证!", MessageBoxIcon.Warning);
}
this.txtAccount.Text = person.Account;
if (person.IsForeign.HasValue)
{
this.ckIsForeign.Checked = person.IsForeign.Value;
}
this.rbPersonType.SelectedValue = person.PersonType;
if (!string.IsNullOrEmpty(person.IdcardType))
{
this.drpIdcardType.SelectedValue = person.IdcardType;
}
this.txtIdentityCard.Text = person.IdentityCard;
this.txtIdcardAddress.Text = person.IdcardAddress;
if (!string.IsNullOrEmpty(person.IdcardForever))
{
this.rblIdcardForever.SelectedValue = person.IdcardForever;
if (person.IdcardForever == "Y")
{
this.txtIdcardEndDate.ShowRedStar = false;
this.txtIdcardEndDate.Required = false;
}
}
this.txtIdcardStartDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardStartDate);
this.txtIdcardEndDate.Text = string.Format("{0:yyyy-MM-dd}", person.IdcardEndDate);
if (!string.IsNullOrEmpty(person.Sex))
{
this.rblSex.SelectedValue = person.Sex;
}
if (person.Birthday.HasValue)
{
this.txtBirthday.Text = string.Format("{0:yyyy-MM-dd}", person.Birthday);
this.txtAge.Text = IDCardValid.CalculateAgeCorrect(person.Birthday.Value).ToString();
}
this.txtTelephone.Text = person.Telephone;
if (!string.IsNullOrEmpty(person.PhotoUrl))
{
imgPhoto.ImageUrl = ("~/" + person.PhotoUrl);
}
if (!string.IsNullOrEmpty(person.QRCodeAttachUrl))
{
imgQR.ImageUrl = ("~/" + person.QRCodeAttachUrl);
}
if (!string.IsNullOrEmpty(person.IDCardUrl))
{
imgIDCard.ImageUrl = ("~/" + person.IDCardUrl);
}
if (!string.IsNullOrEmpty(person.IDCardBackUrl))
{
imgIDCardBack.ImageUrl = ("~/" + person.IDCardBackUrl);
}
#endregion
#region
this.txtMajor.Text = person.Major;
this.txtForeignLanguage.Text = person.ForeignLanguage;
if (!string.IsNullOrEmpty(person.CountryCode))
{
this.drpCountryCode.SelectedValue = person.CountryCode;
CityService.InitCityDropDownList(this.drpProvinceCode, person.CountryCode, false);
}
if (!string.IsNullOrEmpty(person.ProvinceCode))
{
this.drpProvinceCode.SelectedValue = person.ProvinceCode;
}
if (!string.IsNullOrEmpty(person.Nation))
{
this.drpNation.SelectedValue = person.Nation;
}
if (!string.IsNullOrEmpty(person.PoliticsStatus))
{
this.drpPoliticsStatus.SelectedValue = person.PoliticsStatus;
}
if (!string.IsNullOrEmpty(person.EduLevel))
{
this.drpEduLevel.SelectedValue = person.EduLevel;
}
if (!string.IsNullOrEmpty(person.MaritalStatus))
{
this.drpMaritalStatus.SelectedValue = person.MaritalStatus;
}
this.txtRelativeName.Text = person.RelativeName;
this.txtRelativeTel.Text = person.RelativeTel;
this.txtAddress.Text = person.Address;
#endregion
}
#endregion
#region
@@ -790,6 +826,12 @@ namespace FineUIPro.Web.Person
newPerson.States = Const.ProjectPersonStates_1;
newPerson.AuditorDate = DateTime.Now;
}
if (this.Type == "P")
{
newPerson.AuditorId = newPerson.AuditorId ?? this.CurrUser.PersonId;
newPerson.States = Const.ProjectPersonStates_1;
newPerson.AuditorDate = DateTime.Now;
}
return newPerson;
}