From 964a84d26faa7708ae8905c3b8b92a8527c27787 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 10 八月 2021 15:45:29 +0800
Subject: [PATCH] 提交
---
zhengcaioa/Services/HrSalaryService.cs | 70 +++++++++++++++++++++++++++--------
1 files changed, 54 insertions(+), 16 deletions(-)
diff --git a/zhengcaioa/Services/HrSalaryService.cs b/zhengcaioa/Services/HrSalaryService.cs
index 01f2772..f5dd65a 100644
--- a/zhengcaioa/Services/HrSalaryService.cs
+++ b/zhengcaioa/Services/HrSalaryService.cs
@@ -93,7 +93,7 @@
return resultEntity;
}
- public ResultEntity SaveCheckSalary(HrSalaryDTO dto)
+ public ResultEntity SaveCheckSalary(HrSalaryUpDTO dto)
{
ResultEntity resultEntity = new ResultEntity();
try
@@ -101,6 +101,13 @@
var updatepltRole = _context.HrSalaries.Where(c=>c.Id==dto.Id).SingleOrDefault();
if(updatepltRole!=null)
{
+ //鏇存柊鐢佃瘽璐圭敤鐘舵��
+ var sim = _context.SimCost.Where(c => c.bill_year == updatepltRole.Year && c.bill_month <= updatepltRole.Month && c.user_id == updatepltRole.Userid && c.status == "0").ToList();
+ foreach(var item in sim)
+ {
+ item.status = "1";
+ }
+
var user = _context.PltUsers.Where(c => c.Id == updatepltRole.Userid).SingleOrDefault();
updatepltRole.Jiangjin = dto.Jiangjin;
@@ -373,7 +380,7 @@
- if (searchEntity.totalrows == 0)
+ //if (searchEntity.totalrows == 0)
searchEntity.totalrows = query.Count();
var rolelist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
@@ -403,14 +410,14 @@
// }
// );
- //int year = 0;
- //int month = 0;
- //if (string.IsNullOrWhiteSpace(searchEntity.YearMonth))
- //{
- // DateTime yearMonth = DateTime.Now;//.Parse(searchEntity.YearMonth + "-01");
- // year = yearMonth.Year;
- // month = yearMonth.Month;
- //}
+ int year = 0;
+ int month = 0;
+ if (!string.IsNullOrWhiteSpace(searchEntity.YearMonth))
+ {
+ DateTime yearMonth = DateTime.Parse(searchEntity.YearMonth + "-01");
+ year = yearMonth.Year;
+ month = yearMonth.Month;
+ }
var query = (from a in _context.HrSalaries//.Where(x => x.RecStatus == "A")
// join b in listCode.Where(x => x.CodeTable == "hr_jibengongzi" && x.CodeField == "dianhuabutie")
//on a.Dianhuabutie equals b.CodeSn
@@ -431,7 +438,7 @@
&& (string.IsNullOrWhiteSpace(searchEntity.Usernumber) || f.Usernumber == searchEntity.Usernumber.Trim())
&& (string.IsNullOrWhiteSpace(searchEntity.DeptId) || f.DeptId == searchEntity.DeptId.Trim())
&& (string.IsNullOrWhiteSpace(searchEntity.UserName) || f.UserName.Contains(searchEntity.UserName.Trim()))
- //&& (string.IsNullOrWhiteSpace(searchEntity.YearMonth) || ( a.Year == year && a.Month == month ))
+ && (string.IsNullOrWhiteSpace(searchEntity.YearMonth) || ( a.Year == year && a.Month == month ))
select new HrSalaryDTO
{
Id = a.Id,
@@ -505,7 +512,7 @@
- if (searchEntity.totalrows == 0)
+ //if (searchEntity.totalrows == 0)
searchEntity.totalrows = query.Count();
var rolelist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
@@ -546,6 +553,26 @@
return list;
}
+
+
+ /// <summary>
+ /// 鑾峰彇鎵�鏈夋湁鏁堣鑹�
+ /// </summary>
+ /// <returns></returns>
+ public HrSalaryDTO GetListByUser(string Userid, int year, int month)
+ {
+
+
+ var listPosition = _context.HrSalaries.Where(r => r.RecStatus == "A" && r.Userid == Userid && r.Year == year && r.Month == month).FirstOrDefault();
+
+ HrSalaryDTO hrSalaryDTO = null;
+ if (listPosition != null)
+ {
+ hrSalaryDTO = _mapper.Map<HrSalaryDTO>(listPosition);
+ }
+
+ return hrSalaryDTO;
+ }
/// <summary>
/// 宸ヨ祫鏍稿
/// </summary>
@@ -650,10 +677,13 @@
temp.reason = model.reason;
temp.amount = model.amount;
temp.basis = model.basis;
- temp.sub_time = DateTime.Now;
+ temp.shenpi_status = model.shenpi_status;
+
+
}
else
{
+ model.id = Guid.NewGuid().ToString();
model.sub_time = DateTime.Now;
model.status = "A";
_context.HrSalaryAppeal.Add(model);
@@ -678,12 +708,20 @@
/// <param name="id"></param>
/// <param name="user"></param>
/// <returns></returns>
- public HrSalaryAppeal GetAppeal(string id,string user)
+ public HrSalaryAppeal GetAppeal(string id = "", string user = "", string salaryId = "")
{
HrSalaryAppeal hd = new HrSalaryAppeal();
try
{
- hd = _context.HrSalaryAppeal.Where(e => e.salary_id == id && e.sub_user == user).SingleOrDefault();
+ if (!string.IsNullOrEmpty(salaryId))
+ {
+ hd = _context.HrSalaryAppeal.Where(e => e.salary_id == salaryId && e.sub_user == user && e.status == "A").FirstOrDefault();
+ }
+ else
+ {
+ hd = _context.HrSalaryAppeal.Where(e => e.id == id && e.status == "A").FirstOrDefault();
+ }
+
}
catch (Exception er)
{
@@ -792,7 +830,7 @@
}).OrderByDescending(x => x.Modifytime).ToList();
- if (searchEntity.totalrows == 0)
+ //if (searchEntity.totalrows == 0)
searchEntity.totalrows = list.Count();
var rolelist = list.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
--
Gitblit v1.9.1