|
|
@@ -70,7 +70,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
var strSql = new StringBuilder(); |
|
|
|
strSql.Append(" SELECT t.*,u.F_Account,u.F_RealName FROM WageSchedule t "); |
|
|
|
strSql.Append($" left join {baseDataName}.dbo.LR_Base_User u on t.empname=u.F_RealName "); |
|
|
|
strSql.Append(" where 1=1 "); |
|
|
|
strSql.Append(" where 1=1 and u.F_Description='教师' and u.F_DeleteMark = 0"); |
|
|
|
var userInfo = LoginUserInfo.Get(); |
|
|
|
var queryParam = queryJson.ToJObject(); |
|
|
|
// 虚拟参数 |
|
|
@@ -354,22 +354,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
try |
|
|
|
{ |
|
|
|
//检测是否有空值 |
|
|
|
if (dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "" || dr[6].ToString() == "" || dr[26].ToString() == "" || dr[35].ToString() == "") |
|
|
|
if (dr[1].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "" || dr[6].ToString() == "" || dr[26].ToString() == "" || dr[35].ToString() == "") |
|
|
|
{ |
|
|
|
throw (new Exception("行内必填项数据有空值,不能为空!")); |
|
|
|
} |
|
|
|
if (dr[36].ToString() == "" || dr[37].ToString() == "") |
|
|
|
{ |
|
|
|
throw (new Exception("发放年月不能为空")); |
|
|
|
} |
|
|
|
if (EmpInfoEntities.Count(m => m.EmpName.ToUpper() == dr[1].ToString().ToUpper()) == 0) |
|
|
|
{ |
|
|
|
throw (new Exception("【姓名】不存在,请核对!")); |
|
|
|
} |
|
|
|
|
|
|
|
if (dr[2].ToString() == "") |
|
|
|
{ |
|
|
|
throw (new Exception("【工资卡号】不能为空")); |
|
|
|
} |
|
|
|
if (dr[36].ToString() == "" || dr[37].ToString() == "") |
|
|
|
{ |
|
|
|
throw (new Exception("发放【年、月】不能为空")); |
|
|
|
} |
|
|
|
if (wageScheduleEntityList.Count(x => x.IssueYear == dr[37].ToString() && x.IssueMonth == dr[36].ToInt() && x.EmpName == dr[1].ToString()) > 0) |
|
|
|
{ |
|
|
|
throw (new Exception("当月信息已重复,信息已忽略")); |
|
|
|
throw (new Exception("导入信息已重复,信息已忽略")); |
|
|
|
} |
|
|
|
|
|
|
|
//写入要导入的数据 |
|
|
@@ -418,8 +421,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
}; |
|
|
|
|
|
|
|
wageScheduleEntityList.Add(wageScheduleEntity); |
|
|
|
//删除表中原有姓名,月份,年的数据 |
|
|
|
//db.Delete<WageScheduleEntity>(x => x.EmpName == wageScheduleEntity.EmpName && x.IssueMonth == wageScheduleEntity.IssueMonth && x.IssueYear == wageScheduleEntity.IssueYear); |
|
|
|
//删除表中旧数据 及同年同月同名同姓之人 |
|
|
|
db.Delete<WageScheduleEntity>(x => x.EmpName == wageScheduleEntity.EmpName && x.IssueMonth == wageScheduleEntity.IssueMonth && x.IssueYear == wageScheduleEntity.IssueYear); |
|
|
|
snum++; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|