Commit 97ba3478 by 纪旭 韦

人员字典添加时获取月份超出

parent 78453b6e
......@@ -281,7 +281,7 @@ public ApiResponse CreatePerson(PerEmployeeResponse request)
var entity = _mapper.Map<per_employee>(request);
var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId);
int day = DateTime.DaysInMonth(allot.Year, allot.Month);
int day = allot.Month <= 12 ? DateTime.DaysInMonth(allot.Year, allot.Month) : 30;
entity.Attendance = request.AttendanceDay / day;
entity.CreateTime = DateTime.Now;
entity.IsVerify = 1;
......@@ -373,7 +373,8 @@ public ApiResponse UpdatePerson(PerEmployeeResponse request)
// 出勤率
var allot = perallotRepository.GetEntity(t => t.ID == request.AllotId);
var day = (decimal)DateTime.DaysInMonth(allot.Year, allot.Month);
var day = allot.Month <= 12 ? (decimal)DateTime.DaysInMonth(allot.Year, allot.Month) : 30;
employee.Attendance = Math.Round((request.AttendanceDay ?? 0) / day, 4);
//CheckAccountingDept(request.HospitalId.Value, request.AccountingUnit, request.Department);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment