From cbff3bc3a629c74a3d72f5986721ed0b2716ac13 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 18 十月 2021 13:51:36 +0800
Subject: [PATCH] 提交
---
zhengcaioa/IServices/IAdmAttendanceDtlService.cs | 2
zhengcaioa/zhengcaioa/Views/ExpertTestTopic/Edit.cshtml | 11 +
zhengcaioa/Services/AdmAttendanceDtlService.cs | 55 +++++++++++
zhengcaioa/zhengcaioa/Views/AdmAttendance/Index.cshtml | 120 ++++++++++++++++++++++++
zhengcaioa/DTO/AdmAttendanceDTO.cs | 3
zhengcaioa/zhengcaioa/Controllers/admin/AdmAttendanceController.cs | 71 ++++++++++++++
zhengcaioa/Services/AdmAttendanceService.cs | 2
7 files changed, 262 insertions(+), 2 deletions(-)
diff --git a/zhengcaioa/DTO/AdmAttendanceDTO.cs b/zhengcaioa/DTO/AdmAttendanceDTO.cs
index a0d2955..a6e445e 100644
--- a/zhengcaioa/DTO/AdmAttendanceDTO.cs
+++ b/zhengcaioa/DTO/AdmAttendanceDTO.cs
@@ -41,5 +41,8 @@
public string Userid { get; set; }
+ public string YearMonth222 { get; set; }
+
+ public string YearMonth { get; set; }
}
}
diff --git a/zhengcaioa/IServices/IAdmAttendanceDtlService.cs b/zhengcaioa/IServices/IAdmAttendanceDtlService.cs
index 7fdcb06..620ec2e 100644
--- a/zhengcaioa/IServices/IAdmAttendanceDtlService.cs
+++ b/zhengcaioa/IServices/IAdmAttendanceDtlService.cs
@@ -17,5 +17,7 @@
ResultEntity ModifyStatus(string id, string userid);
+ ResultDataEntity<AdmAttendanceDtlDTO> SearchByPaging(AdmAttendanceDtlDTOSearch searchEntity);
+
}
}
diff --git a/zhengcaioa/Services/AdmAttendanceDtlService.cs b/zhengcaioa/Services/AdmAttendanceDtlService.cs
index e9978d4..8856b4f 100644
--- a/zhengcaioa/Services/AdmAttendanceDtlService.cs
+++ b/zhengcaioa/Services/AdmAttendanceDtlService.cs
@@ -167,5 +167,60 @@
return query;
}
+
+
+
+ /// <summary>
+ /// 鑾峰彇鎵�鏈夋湁鏁堢鐩�
+ /// </summary>
+ /// <returns></returns>
+ public ResultDataEntity<AdmAttendanceDtlDTO> SearchByPaging(AdmAttendanceDtlDTOSearch searchEntity)
+ {
+ ResultDataEntity<AdmAttendanceDtlDTO> data = new ResultDataEntity<AdmAttendanceDtlDTO>();
+
+
+ var query = (from a in _context.AdmAttendanceDtls//.Where(x => x.RecStatus == "A")
+
+
+
+ where a.RecStatus == "A"
+ && (string.IsNullOrWhiteSpace(searchEntity.AttendanceId) || a.AttendanceId == searchEntity.AttendanceId.Trim())
+ && (!searchEntity.SgninDate.HasValue || a.SgninDate == searchEntity.SgninDate)
+
+ select new AdmAttendanceDtlDTO
+ {
+ Id = a.Id,
+ AttendanceId = a.AttendanceId,
+ SgninDate = a.SgninDate,
+ MorningIn = a.MorningIn,
+
+ MorningOut = a.MorningOut,
+ AfternoonIn = a.AfternoonIn,
+ AfternoonOut = a.AfternoonOut,
+ OvertimeIn = a.OvertimeIn,
+ OvertimeOut = a.OvertimeOut,
+ Qingjia = a.Qingjia,
+ Xiaojia = a.Xiaojia,
+ RecStatus = a.RecStatus,
+ Creater = a.Creater,
+ Createtime = a.Createtime,
+ Modifier = a.Modifier,
+ Modifytime = a.Modifytime,
+
+ Shangwuchidaofenzhong = a.Shangwuchidaofenzhong,
+ Xiawuchidaofenzhong = a.Xiawuchidaofenzhong,
+ Shangwuzaotuifenzhong = a.Shangwuzaotuifenzhong,
+ Xiawuzaotuifenzhong = a.Xiawuzaotuifenzhong,
+ Kuanggongtianshu = a.Kuanggongtianshu,
+ Iswork = a.Iswork
+ }).OrderBy(x => x.SgninDate).ToList();
+
+ //if (searchEntity.totalrows == 0)
+ searchEntity.totalrows = query.Count();
+ var rolelist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
+
+ data.LoadData(searchEntity, rolelist);
+ return data;
+ }
}
}
diff --git a/zhengcaioa/Services/AdmAttendanceService.cs b/zhengcaioa/Services/AdmAttendanceService.cs
index e0ddddc..d536dad 100644
--- a/zhengcaioa/Services/AdmAttendanceService.cs
+++ b/zhengcaioa/Services/AdmAttendanceService.cs
@@ -118,6 +118,8 @@
&& (string.IsNullOrWhiteSpace(searchEntity.DeptId) || b.DeptId == searchEntity.DeptId.Trim())
&& (string.IsNullOrWhiteSpace(searchEntity.Userid) || b.DeptId == searchEntity.Userid.Trim())
&& (string.IsNullOrWhiteSpace(searchEntity.UserName) || b.UserName.Contains(searchEntity.UserName.Trim()))
+ && (string.IsNullOrWhiteSpace(searchEntity.YearMonth) || a.Year == DateTime.Parse(searchEntity.YearMonth.Trim()+"-01").Year)
+ && (string.IsNullOrWhiteSpace(searchEntity.YearMonth) || a.Month == DateTime.Parse(searchEntity.YearMonth.Trim() + "-01").Month)
select new AdmAttendanceDTO
{
Id = a.Id,
diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmAttendanceController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAttendanceController.cs
new file mode 100644
index 0000000..9931e54
--- /dev/null
+++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmAttendanceController.cs
@@ -0,0 +1,71 @@
+锘縰sing DTO;
+using IServices;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Transactions;
+using zhengcaioa.Models;
+namespace zhengcaioa.Controllers.admin
+{
+ public class AdmAttendanceController : Controller
+ {
+ private readonly IHrDeptService _hrDeptService;
+ private readonly ILogger<AdmAttendanceController> _logger;
+ private readonly IAdmAttendanceService _admAttendanceService;
+
+
+ public AdmAttendanceController(ILogger<AdmAttendanceController> logger
+ , IAdmAttendanceService admAttendanceService
+ , IHrDeptService hrDeptService
+ )
+ {
+ _logger = logger;
+ _hrDeptService = hrDeptService;
+ _admAttendanceService = admAttendanceService;
+
+ }
+ public IActionResult Index()
+ {
+ List<ActionEntity> actionlist = new List<ActionEntity>();
+ ActionEntity actionEntity = new ActionEntity();
+ actionEntity.OpenType = 0;
+ actionEntity.ActionUrl = "";
+ actionEntity.ActionFun = "Search";
+ actionEntity.PageIco = "fa fa-search";
+ actionEntity.ActionName = "鏌ヨ";
+ actionlist.Add(actionEntity);
+
+
+
+ ViewBag.editBtn = false;
+
+ ViewData["ActionInfo"] = actionlist;
+
+ //ViewBag.dept = _hrDeptService.GetList().Select(x => new { code = x.Id, label = x.DeptName }).ToList();
+
+ return View();
+ }
+
+
+ /// <summary>
+ /// 鍒楄〃鍐呭
+ /// </summary>
+ /// <param name="search"></param>
+ /// <returns></returns>
+ public IActionResult GetList(AdmAttendanceDTOSearch search)
+ {
+ //_hrSalaryService.AutoCheck();
+ if (!string.IsNullOrEmpty(search.YearMonth222))
+ {
+ search.YearMonth = search.YearMonth222;
+ }
+
+ return new JsonResult(_admAttendanceService.SearchByPaging(search));
+ }
+ }
+}
diff --git a/zhengcaioa/zhengcaioa/Views/AdmAttendance/Index.cshtml b/zhengcaioa/zhengcaioa/Views/AdmAttendance/Index.cshtml
new file mode 100644
index 0000000..3d63f05
--- /dev/null
+++ b/zhengcaioa/zhengcaioa/Views/AdmAttendance/Index.cshtml
@@ -0,0 +1,120 @@
+锘緻{
+ ViewBag.Title = "宸ヨ祫鏍稿噯";
+ Layout = "~/Views/Shared/_Layout_Search.cshtml";
+}
+
+<link href="~/css/jquery-confirm.css" rel="stylesheet">
+<script src="~/js/jquery-confirm.js" type="text/javascript"></script>
+
+@section headerStyle{
+
+ <script type="text/javascript">
+
+ @*var dept = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.dept))';*@
+
+ //gridConfig = { multiselect: false, selectcol: "Id" };
+ //shrinkToFit = false;
+ //footerrow = false;
+
+ dataCol = [
+ { label: '搴忓彿', name: 'Id', labtype: 'txt', hidden: true },
+ {
+ label: '濮撳悕', name: 'UserName', labtype: 'txt', hidden: false, width: 80
+ },
+ { label: '骞�', name: 'Year', labtype: 'txt', hidden: false, width: 60 },
+ { label: '鏈�', name: 'Month', labtype: 'txt', hidden: false, width: 60 },
+
+ { label: '搴斿嚭鍕�', name: 'Yingchuqin', labtype: 'txt', hidden: false, width: 80 },
+ { label: '鏀惧亣', name: 'Offdays', labtype: 'txt', hidden: false, width: 60 },
+ { label: '瀹為檯鍑哄嫟', name: 'Shijichuqin', labtype: 'txt', hidden: false, width: 60 },
+ { label: '璇峰亣', name: 'Qingjia', labtype: 'txt', hidden: false, width: 60 },
+ { label: '鍔犵彮', name: 'Jiaban', labtype: 'txt', hidden: false, width: 60 },
+ { label: '閿�鍋�', name: 'Xiaojia', labtype: 'txt', hidden: false, width: 60 },
+ { label: '杩熷埌', name: 'Chidao', labtype: 'txt', hidden: false, width: 60 },
+ { label: '鏃╅��', name: 'Zaotui', labtype: 'txt', hidden: false, width: 60 },
+ { label: '鏃峰伐', name: 'Kuanggong', labtype: 'txt', hidden: false, width: 60 },
+
+ ];
+ dataUrl = "/AdmAttendance/GetList?YearMonth222=" + getNowFormatDate();
+ searchCol = [
+ { label: '鏈堜唤', name: 'YearMonth', labtype: 'monthdate', hidden: false, cwidth: '5%', cccwidth: '8%' },
+ //{ label: '宸ヤ綔閮ㄩ棬', name: 'DeptId', labtype: 'combox', hidden: false, data: JSON.parse(dept) },
+ { label: '鑱屽伐濮撳悕', name: 'UserName', labtype: 'txt', hidden: false },
+ ];
+ //var _pageSearch = function () {
+ // $("#jqGrid").jqGrid('setGridParam', {
+ // url: '/AdmAttendance/GetList', postData: jsons, page: 1
+ // }); //閲嶆柊杞藉叆
+ // var jsons = GetSearchEnd();
+ // if (jsons == false) {
+ // msg.info("璇峰綍鍏ユ煡璇㈡潯浠�");
+ // return false;
+ // }
+ // LoadGrid(jsons);
+ //}
+
+ $(function () {
+ $("#PBSYearMonth").val(getNowFormatDate());
+ $("#PBSYearMonth").attr("readonly", "readonly")//灏唅nput鍏冪礌璁剧疆涓簉eadonly
+ //$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ 'overflow-x': 'scroll' });
+
+ //jQuery("#jqGrid").jqGrid('setGroupHeaders', {
+ // useColSpanStyle: true,
+ // groupHeaders: [
+ // { startColumnName: 'Jibengongzi', numberOfColumns: 12, titleText: '搴斿彂宸ヨ祫' },
+ // { startColumnName: 'Shebaokou', numberOfColumns: 8, titleText: '搴旀墸宸ヨ祫' }
+ // ]
+ //});
+
+ });
+
+ var _pageSearch = function () {
+ $("#jqGrid").jqGrid('setGridParam', {
+ url: '/AdmAttendance/GetList', postData: jsons, page: 1
+ }); //閲嶆柊杞藉叆
+ var jsons = GetSearchEnd();
+ if (jsons == false) {
+ msg.info("璇峰綍鍏ユ煡璇㈡潯浠�");
+ return false;
+ }
+ LoadGrid(jsons);
+ }
+
+
+
+ function getNowFormatDate() {
+ var date = new Date();
+ var seperator1 = "-";
+ var year = date.getFullYear();
+ var month = date.getMonth();
+ var strDate = date.getDate();
+ if (month >= 1 && month <= 9) {
+ month = "0" + month;
+ }
+ if (strDate >= 0 && strDate <= 9) {
+ strDate = "0" + strDate;
+ }
+ var currentdate = year + seperator1 + month;//+ seperator1 + strDate;
+ return currentdate;
+ }
+
+
+ var _afterSave = function (result) {
+ if (result) {
+ toastr.success("淇濆瓨鎴愬姛");
+ } else {
+ toastr.error("淇濆瓨澶辫触");
+ }
+ }
+
+ var _afterDel = function (result) {
+ if (result) {
+ toastr.success("鍒犻櫎鎴愬姛");
+ } else {
+ /**/
+ toastr.error("鍒犻櫎鎴愬姛");
+ /**/
+ }
+ }
+ </script>
+}
diff --git a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/Edit.cshtml
index 1b2af21..987d696 100644
--- a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/Edit.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/Edit.cshtml
@@ -736,8 +736,15 @@
if (data.Result) {
// parent._afterSave(true);
- parent.layer.msg('淇濆瓨鎴愬姛', { icon: 6 });
- _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶
+ parent.layer.msg('鎴愬姛淇濆瓨', { icon: 6 });
+ var Topictype = $("#Topictype").val();
+ var Zhishitype = $("#Zhishitype").val();
+ var Area = $("#Area").val();
+
+ window.location = "/ExpertTestTopic/Edit?Topictype=" + Topictype + "&Zhishitype=" + Zhishitype + "&Area=" + Area + ""
+ if ($.isNumber(imgLoad)) {
+ parent.layer.close(imgLoad);
+ }
}
else {
if ($.isNumber(imgLoad)) {
--
Gitblit v1.9.1