Selaa lähdekoodia

【修改】月常规工作绩效:导入功能;

应县
dyy 7 kuukautta sitten
vanhempi
commit
b9c4dbdbde
3 muutettua tiedostoa jossa 83 lisäystä ja 51 poistoa
  1. BIN
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls
  2. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  3. +82
    -51
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs

BIN
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls Näytä tiedosto


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Näytä tiedosto

@@ -8156,6 +8156,7 @@
<Content Include="Areas\EducationalAdministration\Views\JobPerformance\Index.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\JobPerformance\IndexMy.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\JobPerformance\IndexPrint.cshtml" />
<Content Include="Content\excel\JobPerformanceImport.xls" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 82
- 51
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs Näytä tiedosto

@@ -316,7 +316,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
private ICache cache = CacheFactory.CaChe();
private string cacheKey = "Learun_adms_excelError_"; // +公司主键
#endregion
/// <summary>
/// 工作绩效导入
/// </summary>
@@ -347,75 +347,106 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
//检测是否有空值
if (dr[1].ToString() == "" || dr[3].ToString() == "" || dr[6].ToString() == "" || dr[26].ToString() == "" || dr[35].ToString() == "")
if (string.IsNullOrEmpty(dr["发放年份"].ToString()))
{
throw (new Exception("发放年份不能为空!"));
}
if (string.IsNullOrEmpty(dr["发放月份"].ToString()))
{
throw (new Exception("发放月份不能为空!"));
}
if (string.IsNullOrEmpty(dr["姓名"].ToString()))
{
throw (new Exception("行内必填项数据有空值,不能为空!"));
throw (new Exception("姓名不能为空!"));
}
if (EmpInfoEntities.Count(m => m.EmpName.ToUpper() == dr[1].ToString().ToUpper()) == 0)
if (string.IsNullOrEmpty(dr["身份证号"].ToString()))
{
throw (new Exception("【姓名】不存在,请核对!"));
throw (new Exception("身份证号不能为空!"));
}
if (dr[2].ToString() == "")
//检测发放年份
decimal year = 0;
bool yearParseResult = decimal.TryParse(dr["发放年份"].ToString(), out year);
if (!yearParseResult || dr["发放年份"].ToString().Length != 4)
{
throw (new Exception("【工资卡号】不能为空"));
throw (new Exception("发放年份数据无效!"));
}
if (dr[36].ToString() == "" || dr[37].ToString() == "")
//检测发放月份
int month = 0;
bool monthParseResult = int.TryParse(dr["发放月份"].ToString(), out month);
if (!monthParseResult)
{
throw (new Exception("发放【年、月】不能为空"));
throw (new Exception("发放月份必须为数字!"));
}
if (jobPerformanceEntityList.Count(x => x.IssueYear == dr[37].ToString() && x.IssueMonth == dr[36].ToInt() && x.EmpName == dr[1].ToString()) > 0)
if (month <= 0 || month > 12)
{
throw (new Exception("导入信息已重复,信息已忽略"));
throw (new Exception("发放月份必须为1-12中间的数字!"));
}
//检测姓名
var empinfoEntity = EmpInfoEntities.FirstOrDefault(x => x.IdentityCardNo == dr["身份证号"].ToString());
if (empinfoEntity == null)
{
throw (new Exception("【身份证号】不存在,请核对!"));
}
//检测重复
if (jobPerformanceEntityList.Count(x => x.IssueYear == dr["发放年份"].ToString() && x.IssueMonth == dr["发放月份"].ToInt() && x.EmpName == empinfoEntity.EmpName && x.EmpNo == empinfoEntity.EmpNo) > 0)
{
throw (new Exception("导入信息已重复,信息已忽略!"));
}

//写入要导入的数据
JobPerformanceEntity jobPerformanceEntity = new JobPerformanceEntity
{
Id = Guid.NewGuid().ToString(),
//No = dr[0].ToString(),
//EmpName = dr[1].ToString(),
//WageCardNo = dr[2].ToString(),
//PeopleType = dr[3].ToString(),
//PostType = dr[4].ToString(),
//PayGrade = dr[5].ToString(),
//TotalGrossPay = dr[6].ToDecimalOrNull(),
//PostWage = dr[7].ToDecimalOrNull(),
//PayGradeWage = dr[8].ToDecimalOrNull(),
//TenPercent = dr[9].ToDecimalOrNull(),
//BasicsPerformance = dr[10].ToDecimalOrNull(),
//AwardPerformance = dr[11].ToDecimalOrNull(),
//SeparateBasicsPerformance = dr[12].ToDecimalOrNull(),
//SeparateAwardPerformance = dr[13].ToDecimalOrNull(),
//RoughEdgeAllowance = dr[14].ToDecimalOrNull(),
//NationAllowance = dr[15].ToDecimalOrNull(),
//TeachAllowance = dr[16].ToDecimalOrNull(),
//SuperfineTeacherResearch = dr[17].ToDecimalOrNull(),
//Transportation = dr[18].ToDecimalOrNull(),
//RealeState = dr[19].ToDecimalOrNull(),
//WorkKeep = dr[20].ToDecimalOrNull(),
//GirlStaffSanitation = dr[21].ToDecimalOrNull(),
//TeacherAndTown = dr[22].ToDecimalOrNull(),
//HousingAllowance = dr[23].ToDecimalOrNull(),
//HousingFundAllowance = dr[24].ToDecimalOrNull(),
//OtherOne = dr[25].ToDecimalOrNull(),
//DeductionsSubtotal = dr[26].ToDecimalOrNull(),
//AccumulationFund = dr[27].ToDecimalOrNull(),
//EndowmentInsurance = dr[28].ToDecimalOrNull(),
//OccupationalAnnuities = dr[29].ToDecimalOrNull(),
//MedicalInsurance = dr[30].ToDecimalOrNull(),
//UnemploymentInsurance = dr[31].ToDecimalOrNull(),
//LaborUnionWage = dr[32].ToDecimalOrNull(),
//PersonalIncomeTax = dr[33].ToDecimalOrNull(),
//Other = dr[34].ToDecimalOrNull(),
//NetCombined = dr[35].ToDecimalOrNull(),
IssueMonth = dr[36].ToInt(),
IssueYear = dr[37].ToString(),
IssueYear = year.ToString(),
IssueMonth = month,
EmpNo = empinfoEntity.EmpNo,
EmpName = empinfoEntity.EmpName,
Department = dr[2].ToString(),
Post = dr[5].ToString(),
AdminPosition = dr[6].ToDecimalOrNull(),
LeagueSecretary = dr[7].ToDecimalOrNull(),
CenterPeople = dr[8].ToDecimalOrNull(),
TeachingPosition = dr[9].ToDecimalOrNull(),
Director = dr[10].ToDecimalOrNull(),
TeacherWorkRoom = dr[11].ToDecimalOrNull(),
MajorPeople = dr[12].ToDecimalOrNull(),
WorkLeader = dr[13].ToDecimalOrNull(),
TrainAdmin = dr[14].ToDecimalOrNull(),
CommitteeMember = dr[15].ToDecimalOrNull(),
LessonNum = dr[16].ToIntOrNull(),
LessonHour = dr[17].ToDecimalOrNull(),
MorningStudyNum = dr[18].ToIntOrNull(),
MorningStudyHour = dr[19].ToDecimalOrNull(),
NightStudyNum = dr[20].ToIntOrNull(),
NightStudyHour = dr[21].ToDecimalOrNull(),
TwoExerciseNum = dr[22].ToIntOrNull(),
TwoExerciseHour = dr[23].ToDecimalOrNull(),
TempWorkDay = dr[24].ToDecimalOrNull(),
TempWorkScore = dr[25].ToDecimalOrNull(),
OffWorkDay = dr[26].ToIntOrNull(),
OffWorkMinusScore = dr[27].ToDecimalOrNull(),
OnDutyDay = dr[28].ToDecimalOrNull(),
OnDutyScore = dr[29].ToDecimalOrNull(),
ShouldWorkDay = dr[30].ToDecimalOrNull(),
WorkBasicScore = dr[31].ToDecimalOrNull(),
WorkOffCount = dr[32].ToIntOrNull(),
WorkMinusScore = dr[33].ToDecimalOrNull(),
BigActivityMinusScore = dr[34].ToDecimalOrNull(),
AbsenteeismDay = dr[35].ToDecimalOrNull(),
AbsenteeismMinusScore = dr[36].ToDecimalOrNull(),
WorkRemark = dr[37].ToString(),
RoutineBasicScore = dr[38].ToDecimalOrNull(),
RoutineMinusScore = dr[39].ToDecimalOrNull(),
RoutineRemark = dr[40].ToString(),
PerformanceTotalScore = dr[41].ToDecimalOrNull(),
HolidayJobPerformance = dr[42].ToString(),
CreateUser = LoginUserInfo.Get().userId,
CreateTime = DateTime.Now,
F_EnabledMark = "0"
};

jobPerformanceEntityList.Add(jobPerformanceEntity);
//删除表中旧数据 及同年同月同名同姓之人
db.Delete<JobPerformanceEntity>(x => x.EmpName == jobPerformanceEntity.EmpName && x.IssueMonth == jobPerformanceEntity.IssueMonth && x.IssueYear == jobPerformanceEntity.IssueYear);
db.Delete<JobPerformanceEntity>(x => x.EmpName == jobPerformanceEntity.EmpName && x.EmpNo == jobPerformanceEntity.EmpNo && x.IssueMonth == jobPerformanceEntity.IssueMonth && x.IssueYear == jobPerformanceEntity.IssueYear);
snum++;
}
catch (Exception ex)


Ladataan…
Peruuta
Tallenna