Selaa lähdekoodia

Merge branch '长阳分支中职' of http://8.141.155.183:3000/bjquanjiang/DigitalScholl into 长阳分支中职

应县
ndbs 7 kuukautta sitten
vanhempi
commit
7fa92fde63
8 muutettua tiedostoa jossa 123 lisäystä ja 209 poistoa
  1. +0
    -28
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js
  3. +33
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs
  4. BIN
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/JobPerformanceImport.xls
  5. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  6. +2
    -57
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs
  7. +2
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs
  8. +84
    -117
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceService.cs

+ 0
- 28
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/JobPerformanceController.cs Näytä tiedosto

@@ -70,34 +70,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
#endregion

#region 获取数据
/// <summary>
/// 人员类别
/// </summary>
/// <returns></returns>
public ActionResult PeopleType()
{
var data = jobPerformanceIBLL.GetPeopleType();
return Success(data);
}
/// <summary>
/// 岗位类别
/// </summary>
/// <returns></returns>
public ActionResult PostType()
{
var data = jobPerformanceIBLL.GetPostType();
return Success(data);
}
/// <summary>
/// 薪级
/// </summary>
/// <returns></returns>
public ActionResult PayGrade()
{
var data = jobPerformanceIBLL.GetPayGrade();
return Success(data);
}

/// <summary>
/// 获取列表数据
/// </summary>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/JobPerformance/ImportForm.js Näytä tiedosto

@@ -106,7 +106,7 @@ var bootstrap = function ($, learun) {
param['chunks'] = fileInfo[file.id].chunks;
param['ext'] = file.ext;
param['templateId'] = id;
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/SalarySheetImport", param, function (res) {
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/JobPerformanceImport", param, function (res) {
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id);
$fileItem.find('.lr-uploader-progress').remove();
if (res.code == learun.httpCode.success) {


+ 33
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/ExcelImportController.cs Näytä tiedosto

@@ -23,6 +23,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL();
private WageScheduleIBLL wageScheduleIBLL = new WageScheduleBLL();
private JobPerformanceIBLL jobPerformanceIBLL = new JobPerformanceBLL();

#region 视图功能
/// <summary>
@@ -352,6 +353,38 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers
return Fail("导入数据失败!");
}
}

/// <summary>
/// 工作绩效导入
/// </summary>
/// <param name="templateId">模板Id</param>
/// <param name="fileId">文件主键</param>
/// <param name="chunks">分片数</param>
/// <param name="ext">文件扩展名</param>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult JobPerformanceImport(string fileId, int chunks, string ext)
{
UserInfo userInfo = LoginUserInfo.Get();
string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo);
if (!string.IsNullOrEmpty(path))
{
DataTable dt = ExcelHelper.ExcelImport(path);
string res = jobPerformanceIBLL.JobPerformanceImport(dt, fileId);
var data = new
{
Success = res.Split('|')[0],
Fail = res.Split('|')[1]
};
return JsonResult(data);
}
else
{
return Fail("导入数据失败!");
}
}

/// <summary>
/// 下载文件(导入文件未被导入的数据)
/// </summary>


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" />


+ 2
- 57
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceBLL.cs Näytä tiedosto

@@ -92,61 +92,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public List<JobPerformanceEntity> GetPeopleType()
{
try
{
return jobPerformanceService.GetPeopleType().Select(x => new JobPerformanceEntity { }).Distinct().ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
public List<JobPerformanceEntity> GetPostType()
{
try
{
return jobPerformanceService.GetPostType().Select(x => new JobPerformanceEntity { }).Distinct().ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
public List<JobPerformanceEntity> GetPayGrade()
{
try
{
return jobPerformanceService.GetPayGrade().Select(x => new JobPerformanceEntity { }).Distinct().ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 提交数据
@@ -223,11 +168,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="dt"></param>
/// <param name="fileId"></param>
/// <returns></returns>
public string SalarySheelImport(DataTable dt, string fileId)
public string JobPerformanceImport(DataTable dt, string fileId)
{
try
{
return jobPerformanceService.SalarySheelImport(dt, fileId);
return jobPerformanceService.JobPerformanceImport(dt, fileId);
}
catch (Exception ex)
{


+ 2
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/JobPerformance/JobPerformanceIBLL.cs Näytä tiedosto

@@ -34,11 +34,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
/// <returns></returns>
JobPerformanceEntity GetEntity(string keyValue);

List<JobPerformanceEntity> GetPeopleType();
List<JobPerformanceEntity> GetPostType();
List<JobPerformanceEntity> GetPayGrade();

#endregion

#region 提交数据
@@ -63,7 +59,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="dt"></param>
/// <param name="fileId"></param>
/// <returns></returns>
string SalarySheelImport(DataTable dt, string fileId);
string JobPerformanceImport(DataTable dt, string fileId);
#endregion

}


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

@@ -134,71 +134,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}


public List<JobPerformanceEntity> GetPeopleType()
{
try
{
string sql = " select distinct PeopleType from JobPerformance where 1=1 and PeopleType is not null order by PeopleType asc ";
return this.BaseRepository("CollegeMIS").FindList<JobPerformanceEntity>(sql).ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public List<JobPerformanceEntity> GetPostType()
{
try
{
string sql = " select distinct PostType from JobPerformance where 1=1 and PostType is not null order by PostType asc ";
return this.BaseRepository("CollegeMIS").FindList<JobPerformanceEntity>(sql).ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 薪级
/// </summary>
/// <param name="PayGrade"></param>
/// <returns></returns>
public List<JobPerformanceEntity> GetPayGrade()
{
try
{
string sql = " select distinct PayGrade from JobPerformance where 1=1 and PayGrade is not null order by PayGrade asc";
return this.BaseRepository("CollegeMIS").FindList<JobPerformanceEntity>(sql).ToList();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

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