| | |
| | | private readonly ILiaotianService _liaotianService; |
| | | private readonly IConfiguration _configuration; |
| | | private readonly IHttpClientFactory _clientFactory; |
| | | |
| | | private readonly IHrPositionService _hrPositionService; |
| | | private readonly IHrDeptService _hrDeptService; |
| | | private readonly IAdmSigninService _admSigninService; |
| | | |
| | | public TongjiBaoBiaoController(ILogger<TongjiBaoBiaoController> logger |
| | | , IAdmAttendanceRuleService attendanceRuleService |
| | |
| | | , ICusFangwenjiluService cusFangwenjiluService |
| | | ,ILiaotianService liaotianService |
| | | , IConfiguration configuration |
| | | , IHttpClientFactory clientFactory) |
| | | , IHttpClientFactory clientFactory |
| | | , IHrPositionService hrPositionService |
| | | , IHrDeptService hrDeptService |
| | | , IAdmSigninService admSigninService |
| | | ) |
| | | { |
| | | _logger = logger; |
| | | _attendanceRuleService = attendanceRuleService; |
| | |
| | | _liaotianService = liaotianService; |
| | | _configuration = configuration; |
| | | _clientFactory = clientFactory; |
| | | _hrPositionService = hrPositionService; |
| | | _hrDeptService = hrDeptService; |
| | | _admSigninService = admSigninService; |
| | | } |
| | | |
| | | public async Task<IActionResult> IndexAsync(string Tongjitime="") |
| | |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | |
| | | DateTime chauxnshijian = DateTime.Now; |
| | | DateTime chauxnshijian = DateTime.Now.Date; |
| | | if (!string.IsNullOrEmpty(Tongjitime)) |
| | | { |
| | | DateTime.TryParse(Tongjitime, out chauxnshijian); |
| | |
| | | { |
| | | var userDTO = userDTOs.Where(x=>x.Id == Userid).FirstOrDefault(); |
| | | string position = userDTO.HrPosition; |
| | | |
| | | var hrPositionDTO = _hrPositionService.Get(userDTO.HrPosition); |
| | | |
| | | var deptDTO = _hrDeptService.Get(userDTO.DeptId); |
| | | var admSignInDTO = _admSigninService.GetByUserAndDate(Userid, chauxnshijian); |
| | | |
| | | var hrJixiaotichengThis = hrJixiaotichengDTOs.Where(x => x.PostId == position).ToList(); |
| | | |
| | |
| | | tongjibaobiaobaobiaoDTO.ziliaoweihuDTOs = ziliaoweihuDTOs; |
| | | tongjibaobiaobaobiaoDTO.xiangmushishiDTOs = xiangmushishiDTOs; |
| | | tongjibaobiaobaobiaoDTO.dingdanDTOsCount = dingdanDTOsCount; |
| | | tongjibaobiaobaobiaoDTO.UserName = userDTO.UserName; |
| | | tongjibaobiaobaobiaoDTO.UserName = ""; |
| | | if (deptDTO != null) |
| | | { |
| | | tongjibaobiaobaobiaoDTO.UserName += "部门:" + deptDTO.DeptName + " "; |
| | | } |
| | | tongjibaobiaobaobiaoDTO.UserName = "姓名:" + userDTO.UserName + " "; |
| | | if (hrPositionDTO != null) |
| | | { |
| | | tongjibaobiaobaobiaoDTO.UserName += "职务:" + hrPositionDTO.PostName + " "; |
| | | } |
| | | if (admSignInDTO != null) |
| | | { |
| | | tongjibaobiaobaobiaoDTO.UserName += "打卡时间:上午 " + (admSignInDTO.MorningIn.HasValue? admSignInDTO.MorningIn.Value.ToString("HH:mm:ss"):"") + "-" + (admSignInDTO.MorningOut.HasValue ? admSignInDTO.MorningOut.Value.ToString("HH:mm:ss") : "") |
| | | + "下午 " + (admSignInDTO.AfternoonIn.HasValue ? admSignInDTO.AfternoonIn.Value.ToString("HH:mm:ss") : "") + "-" + (admSignInDTO.AfternoonOut.HasValue ? admSignInDTO.AfternoonOut.Value.ToString("HH:mm:ss") : "") |
| | | + "加班 " + (admSignInDTO.OvertimeIn.HasValue ? admSignInDTO.OvertimeIn.Value.ToString("HH:mm:ss") : "") + "-" + (admSignInDTO.OvertimeOut.HasValue ? admSignInDTO.OvertimeOut.Value.ToString("HH:mm:ss") : ""); |
| | | } |
| | | |
| | | tongjibaobiaobaobiaoDTOs.Add(tongjibaobiaobaobiaoDTO); |
| | | |