leiy 1 éve%!(EXTRA string=óta)
szülő
commit
98d0377813

+ 14 - 23
OASystem/OASystem.Api/Controllers/PersonnelModuleController.cs

@@ -99,7 +99,7 @@ namespace OASystem.API.Controllers
             string startDt = yearMonthDt.AddDays(-1).ToString("yyyy-MM") + "-28",
                    endDt = yearMonth + "-27";
 
-            //应发合计 = 基本工资 +绩效工资 + 岗位津贴 + 员工的岗位津贴 + 服装洗理补贴 + 通讯补贴 + 交通补贴 + 保密费 + 操作奖金+ 其他补贴 + 部门集体团建费 + 代扣保险 + 代扣公积金 + 餐补 
+            //应发合计 = 基本工资 +绩效工资 + 岗位津贴 + 保密费 + 其他补贴  + 餐补
 
             //事假  病假 合计
 
@@ -224,20 +224,22 @@ namespace OASystem.API.Controllers
             sw.Start();
             //参数处理
             string ymFormat = "yyyy-MM";
-            DateTime yearMonthDt;
-            bool yearMonthDttIsValid = DateTime.TryParseExact(dto.yearMonth, ymFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out yearMonthDt);
+            string dtFormat = "yyyy-MM-dd";
+            DateTime yearMonthDt,startDt,endDt;
+            bool yearMonthDtIsValid = DateTime.TryParseExact(dto.yearMonth, ymFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out yearMonthDt);
+            bool startDtIsValid = DateTime.TryParseExact(dto.startDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt);
+            bool endDtIsValid = DateTime.TryParseExact(dto.endDt, dtFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt);
 
-            if (!yearMonthDttIsValid)
-            {
-                return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM  "));
-            }
+            if (!yearMonthDtIsValid) return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM  "));
+            if (!startDtIsValid) return Ok(JsonView(false, "开始日期格式错误!正确时间格式:yyyy-MM-dd  "));
+            if (!endDtIsValid) return Ok(JsonView(false, "结束格式错误!正确时间格式:yyyy-MM-dd  "));
 
             string thisYearMonth = dto.yearMonth;
             string preYearMonth = yearMonthDt.AddMonths(-1).ToString("yyyy-MM");
 
             //计算本月工资起止时间
-            DateTime thisStartDt = Convert.ToDateTime(preYearMonth  + "-28");
-            DateTime thisEndDt = Convert.ToDateTime(thisYearMonth + "-27");
+            DateTime thisStartDt = startDt;
+            DateTime thisEndDt = endDt;
 
             //本月工资是否有数据 有数据则不计算
             result = await _wageSheetRep.Get_WageSheet_ListByYearMonthAsync(thisYearMonth);
@@ -322,22 +324,11 @@ namespace OASystem.API.Controllers
             bool startDtIsValid = DateTime.TryParseExact(dto.StartDate, ymdFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out startDt);
             bool endDtIsValid = DateTime.TryParseExact(dto.EndDate, ymdFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out endDt);
 
-            if (!yearMonthDtIsValid)
-                return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM  "));
-
-            if (!startDtIsValid)
-                return Ok(JsonView(false, "开始时间格式错误!正确时间格式:yyyy-MM-dd  "));
+            if (!yearMonthDtIsValid) return Ok(JsonView(false, "年月格式错误!正确时间格式:yyyy-MM  "));
 
-            if (!yearMonthDtIsValid)
-                return Ok(JsonView(false, "结束时间格式错误!正确时间格式:yyyy-MM-dd  "));
-
-            //本月工资是否有数据 有数据则不计算
-            //result = await _wageSheetRep.Get_WageSheet_ListByYearMonthAsync(dto.YearMonth);
-            //if (result.Code == 0)
-            //{
-            //    return Ok(JsonView(false, dto.YearMonth + " 工资数据已存在,若无人员工资请手动添加!"));
-            //}
+            if (!startDtIsValid) return Ok(JsonView(false, "开始时间格式错误!正确时间格式:yyyy-MM-dd  "));
 
+            if (!yearMonthDtIsValid) return Ok(JsonView(false, "结束时间格式错误!正确时间格式:yyyy-MM-dd  "));
 
             List<Pm_WageSheet> wageSheets = new List<Pm_WageSheet>();
             Pm_WageSheet wageSheet = _mapper.Map<Pm_WageSheet>(dto);

+ 2 - 3
OASystem/OASystem.Api/OAMethodLib/PayrollComputation.cs

@@ -112,8 +112,7 @@ namespace OASystem.API.OAMethodLib
                 #region 计算日工资 正常日薪 事假日薪 病假日薪
 
                 //月 - 应发工资
-                decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.GarmentWashSubsidies + pm_wsInfo.CommunicationSubsidies +
-                    pm_wsInfo.TrafficSubsidies + pm_wsInfo.InformationSecurityFee + pm_wsInfo.OperationBonus + pm_wsInfo.OtherSubsidies + pm_wsInfo.GroupCost;
+                decimal amountPayable = pm_wsInfo.Basic + pm_wsInfo.Floats + pm_wsInfo.PostAllowance + pm_wsInfo.InformationSecurityFee + pm_wsInfo.OtherSubsidies;
 
                 // 日薪 = *计算方式:日平均工资 = 月工资/当月应出勤天数。
                 decimal dailyWage = ConvertToDecimal(amountPayable / work_days);
@@ -608,7 +607,7 @@ namespace OASystem.API.OAMethodLib
                 #region 应发合计 实发合计 扣款合计(假勤扣款,其他扣款,社保扣款,公积金代扣,个税扣款)
 
                 decimal mealTotal = meal_subsidy - meal_deduction;  //餐补
-                decimal salaryTotal = amountPayable + mealTotal + pm_wsInfo.SpecialAllowance;    //应发合计
+                decimal salaryTotal = amountPayable + mealTotal;    //应发合计
 
                 //扣款合计 不含个税
                 decimal eductionTotal = sickLeaveTotal + personalLeaveTotal + beLate_deduction + early_deduction + absenteeism_deduction + unprinted_deduction + other_deduction +

+ 18 - 92
OASystem/OASystem.Domain/Dtos/PersonnelModule/WageSheetDto.cs

@@ -88,62 +88,31 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public decimal PostAllowance { get; set; }
 
-        /// <summary>
-        /// 服装洗理补贴
-        /// </summary>
-        public decimal GarmentWashSubsidies { get; set; }
-
-        /// <summary>
-        /// 通讯补贴
-        /// </summary>
-        public decimal CommunicationSubsidies { get; set; }
-
-        /// <summary>
-        /// 交通补贴
-        /// </summary>
-        public decimal TrafficSubsidies { get; set; }
-
         /// <summary>
         /// 保密费
         /// </summary>
         public decimal InformationSecurityFee { get; set; }
 
         /// <summary>
-        /// 操作奖金
+        /// 月度补贴/其他补贴
         /// </summary>
-        public decimal OperationBonus { get; set; }
-
-        /// <summary>
-        /// 特殊津贴
-        /// </summary>
-        public decimal SpecialAllowance { get; set; }
+        public decimal OtherSubsidies { get; set; }
 
         /// <summary>
-        /// 其他补贴
+        /// 餐补
         /// </summary>
-        public decimal OtherSubsidies { get; set; }
+        public decimal Mealsupplement { get; set; }
 
         /// <summary>
         /// 代扣保险
         /// </summary>
         public decimal WithholdingInsurance { get; set; }
 
-        /// <summary>
-        /// 餐补
-        /// </summary>
-        public decimal Mealsupplement { get; set; }
-
         /// <summary>
         /// 代扣公积金
         /// </summary>
         public decimal ReservedFunds { get; set; }
 
-
-        /// <summary>
-        /// 部门集体团建费
-        /// </summary>
-        public decimal GroupCost { get; set; }
-
         /// <summary>
         /// 病假
         /// </summary>
@@ -187,32 +156,6 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public string? Ex_ItemsRemark { get; set; }
 
-        /// <summary>
-        /// 应发合计
-        /// </summary>
-        public decimal Should { get; set; }
-
-        /// <summary>
-        /// 扣款合计
-        /// </summary>
-        public decimal TotalDeductions { get; set; }
-
-        /// <summary>
-        /// 实发合计
-        /// </summary>
-        public decimal TotalRealHair { get; set; }
-
-        /// <summary>
-        /// 代扣个税
-        /// </summary>
-        public decimal WithholdingTax { get; set; }
-
-        /// <summary>
-        /// 税后工资
-        /// </summary>
-        public decimal AfterTax { get; set; }
-
-
     }
 
     /// <summary>
@@ -243,8 +186,21 @@ namespace OASystem.Domain.Dtos.PersonnelModule
 
         /// <summary>
         /// 年月
+        /// eg 2023-10
         /// </summary>
         public string? yearMonth { get; set; }
+
+        /// <summary>
+        ///开始日期
+        /// eg 2023-10-01
+        /// </summary>
+        public string? startDt { get; set; }
+
+        /// <summary>
+        /// 结束日期
+        /// eg 2023-10-01
+        /// </summary>
+        public string? endDt { get; set; }
     }
 
     /// <summary>
@@ -287,38 +243,13 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public decimal PostAllowance { get; set; }
 
-        /// <summary>
-        /// 服装洗理补贴
-        /// </summary>
-        public decimal GarmentWashSubsidies { get; set; }
-
-        /// <summary>
-        /// 通讯补贴
-        /// </summary>
-        public decimal CommunicationSubsidies { get; set; }
-
-        /// <summary>
-        /// 交通补贴
-        /// </summary>
-        public decimal TrafficSubsidies { get; set; }
-
         /// <summary>
         /// 保密费
         /// </summary>
         public decimal InformationSecurityFee { get; set; }
 
         /// <summary>
-        /// 操作奖金
-        /// </summary>
-        public decimal OperationBonus { get; set; }
-
-        /// <summary>
-        /// 特殊津贴
-        /// </summary>
-        public decimal SpecialAllowance { get; set; }
-
-        /// <summary>
-        /// 其他补贴
+        /// 月度补贴/其他补贴
         /// </summary>
         public decimal OtherSubsidies { get; set; }
 
@@ -327,11 +258,6 @@ namespace OASystem.Domain.Dtos.PersonnelModule
         /// </summary>
         public decimal Mealsupplement { get; set; }
 
-        /// <summary>
-        /// 部门集体团建费
-        /// </summary>
-        public decimal GroupCost { get; set; }
-
         /// <summary>
         /// 个税
         /// </summary>

+ 21 - 20
OASystem/OASystem.Domain/Entities/PersonnelModule/Pm_WageSheet.cs

@@ -43,6 +43,12 @@ namespace OASystem.Domain.Entities.PersonnelModule
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal Basic { get; set; }
 
+        /// <summary>
+        /// 岗位津贴
+        /// </summary>
+        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
+        public decimal PostAllowance { get; set; }
+
         /// <summary>
         /// 绩效工资
         /// </summary>
@@ -50,66 +56,61 @@ namespace OASystem.Domain.Entities.PersonnelModule
         public decimal Floats { get; set; }
 
         /// <summary>
-        /// 岗位津贴
+        /// 保密费
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
-        public decimal PostAllowance { get; set; }
+        public decimal InformationSecurityFee { get; set; }
 
         /// <summary>
-        /// 服装洗理补贴
+        /// 服装洗理补贴 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal GarmentWashSubsidies { get; set; }
 
         /// <summary>
-        /// 通讯补贴
+        /// 通讯补贴 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal CommunicationSubsidies { get; set; }
 
         /// <summary>
-        /// 交通补贴
+        /// 交通补贴 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal TrafficSubsidies { get; set; }
 
-        /// <summary>
-        /// 保密费
-        /// </summary>
-        [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
-        public decimal InformationSecurityFee { get; set; }
+
 
         /// <summary>
-        /// 操作奖金
+        /// 操作奖金 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal OperationBonus { get; set; }
 
         /// <summary>
-        /// 过节费
-        /// 不纳入计算日工资
+        /// 过节费 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal SpecialAllowance { get; set; } = 0.00M;
 
         /// <summary>
-        /// 其他补贴
+        /// 月度补贴/其他补贴
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal OtherSubsidies { get; set; }
 
         /// <summary>
-        /// 代扣保险
+        /// 餐补
+        /// 不纳入日工资计算
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
-        public decimal WithholdingInsurance { get; set; }
+        public decimal Mealsupplement { get; set; }
 
         /// <summary>
-        /// 餐补
-        /// 不纳入日工资计算
+        /// 代扣保险
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
-        public decimal Mealsupplement { get; set; }
+        public decimal WithholdingInsurance { get; set; }
 
         /// <summary>
         /// 代扣公积金
@@ -118,7 +119,7 @@ namespace OASystem.Domain.Entities.PersonnelModule
         public decimal ReservedFunds { get; set; }
 
         /// <summary>
-        /// 部门集体团建费
+        /// 部门集体团建费 弃用
         /// </summary>
         [SugarColumn(IsNullable = true, ColumnDataType = "decimal(8,2)")]
         public decimal GroupCost { get; set; }

+ 4 - 65
OASystem/OASystem.Domain/ViewModels/PersonnelModule/WageSheetView.cs

@@ -63,62 +63,32 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
         /// </summary>
         public decimal PostAllowance { get; set; }
 
-        /// <summary>
-        /// 服装洗理补贴
-        /// </summary>
-        public decimal GarmentWashSubsidies { get; set; }
-
-        /// <summary>
-        /// 通讯补贴
-        /// </summary>
-        public decimal CommunicationSubsidies { get; set; }
-
-        /// <summary>
-        /// 交通补贴
-        /// </summary>
-        public decimal TrafficSubsidies { get; set; }
-
         /// <summary>
         /// 保密费
         /// </summary>
         public decimal InformationSecurityFee { get; set; }
 
-        /// <summary>
-        /// 操作奖金
-        /// </summary>
-        public decimal OperationBonus { get; set; }
 
         /// <summary>
-        /// 特殊津
+        /// 月度补贴/其他补贴
         /// </summary>
-        public decimal SpecialAllowance { get; set; }
+        public decimal OtherSubsidies { get; set; }
 
         /// <summary>
-        /// 其他补贴
+        /// 餐补
         /// </summary>
-        public decimal OtherSubsidies { get; set; }
+        public decimal Mealsupplement { get; set; }
 
         /// <summary>
         /// 代扣保险
         /// </summary>
         public decimal WithholdingInsurance { get; set; }
 
-        /// <summary>
-        /// 餐补
-        /// </summary>
-        public decimal Mealsupplement { get; set; }
-
         /// <summary>
         /// 代扣公积金
         /// </summary>
         public decimal ReservedFunds { get; set; }
 
-
-        /// <summary>
-        /// 部门集体团建费
-        /// </summary>
-        public decimal GroupCost { get; set; }
-
         /// <summary>
         /// 病假
         /// </summary>
@@ -185,11 +155,6 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
         /// </summary>
         public decimal AfterTax { get; set; }
 
-        ///// <summary>
-        ///// 锁定标识
-        ///// </summary>
-        //public decimal IsLock { get; set; }
-
         /// <summary>
         /// 最后操作人
         /// </summary>
@@ -259,32 +224,6 @@ namespace OASystem.Domain.ViewModels.PersonnelModule
         /// </summary>
         public string? Ex_ItemsRemark { get; set; }
 
-        ///// <summary>
-        ///// 假勤  / 打卡补卡 明细 对象
-        ///// </summary>
-        //public List<Ex_Items>? Ex_Items
-        //{
-        //    get;set;
-        //}
-
-        ///// <summary>
-        ///// 假勤  / 打卡补卡 明细 对象
-        ///// </summary>
-        //public List<Ex_Items>? Ex_Items
-        //{
-        //    get
-        //    {
-        //        List<Ex_Items>? data = new List<Ex_Items>();
-
-        //        if (!string.IsNullOrEmpty(Ex_ItemsRemark))
-        //        {
-        //            data = JsonConvert.DeserializeObject<List<Ex_Items>>(Ex_ItemsRemark);
-        //        }
-
-        //        return data;
-        //    }
-        //}
-
         /// <summary>
         /// 实发合计
         /// </summary>

+ 3 - 2
OASystem/OASystem.Infrastructure/Repositories/Login/LoginRepository.cs

@@ -157,7 +157,8 @@ namespace OASystem.Infrastructure.Repositories.Login
 
 
             result.Code = 0;
-            result.Msg = string.Format("账号:{0}\r\n密码:{1}\r\n申请成功!\r\n人事主管审核后,即可登录OA!", number, registerDto.Password);
+            //result.Msg = string.Format("账号:{0}\r\n密码:{1}\r\n申请成功!\r\n人事主管审核后,即可登录OA!", number, registerDto.Password);
+            result.Msg = string.Format("账号:{0}\r\n申请成功!\r\n人事主管审核后,即可登录OA!", number);
             return result;
         }
         
@@ -169,7 +170,7 @@ namespace OASystem.Infrastructure.Repositories.Login
         public async Task<string> CreateNumber(int depId) {
             string number = string.Empty;
 
-            string userSql = string.Format("Select * From  Sys_Users Where IsDel= 0 And DepId = {0} And Number != '' Order By Id Desc", depId);
+            string userSql = string.Format("Select * From  Sys_Users Where DepId = {0} And Number != '' Order By Id Desc", depId);
             var userData = await _sqlSugar.SqlQueryable<Sys_Users>(userSql).ToListAsync();
             if (userData.Count <= 0) return number;
 

+ 5 - 16
OASystem/OASystem.Infrastructure/Repositories/PersonnelModule/WageSheetRepository.cs

@@ -54,18 +54,7 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
                 _result.Msg = "暂无数据!";
                 return _result;
             }
-            //wageSheetList = wageSheetList.Select(it => {
-
-            //    if (!string.IsNullOrEmpty(it.Ex_ItemsRemark))
-            //    {
-            //        List<Ex_Items>? data = new List<Ex_Items>();
-            //        data = JsonConvert.DeserializeObject<List<Ex_Items>>(it.Ex_ItemsRemark);
-            //        it.Ex_Items = data;
-            //    }
-
-            //    return it;
-                
-            //}).ToList();   
+
             _result.Code = 0;
             _result.Msg = "查询成功!";
             _result.Data = wageSheetList;
@@ -107,16 +96,16 @@ namespace OASystem.Infrastructure.Repositories.PersonnelModule
 
             #region 计算工资
 
-            //应发合计 //计算日工资
-            decimal salary = pm_WageSheet.Basic + pm_WageSheet.Floats + pm_WageSheet.PostAllowance + pm_WageSheet.GarmentWashSubsidies + pm_WageSheet.CommunicationSubsidies + pm_WageSheet.GroupCost +
-                             pm_WageSheet.TrafficSubsidies + pm_WageSheet.InformationSecurityFee + pm_WageSheet.OperationBonus + pm_WageSheet.OtherSubsidies;
+            //应发合计 
+            decimal salary = pm_WageSheet.Basic + pm_WageSheet.Floats + pm_WageSheet.PostAllowance + pm_WageSheet.InformationSecurityFee + pm_WageSheet.OtherSubsidies;
             //扣款合计
             decimal totalDeduction = pm_WageSheet.SickLeave + pm_WageSheet.SomethingFalse + pm_WageSheet.LateTo + pm_WageSheet.LeaveEarly + pm_WageSheet.Absenteeism + pm_WageSheet.NotPunch +
                                      pm_WageSheet.ReservedFunds + pm_WageSheet.WithholdingInsurance + pm_WageSheet.OtherDeductions + pm_WageSheet.OtherDeductions;
 
             //实发合计 不含个税
+            salary = salary + pm_WageSheet.Mealsupplement;
             decimal actualTotal = salary - totalDeduction;
-            pm_WageSheet.Should = salary + pm_WageSheet.SpecialAllowance + pm_WageSheet.Mealsupplement;
+            pm_WageSheet.Should = salary ;
             pm_WageSheet.TotalDeductions = totalDeduction;
             pm_WageSheet.TotalRealHair = actualTotal;
             pm_WageSheet.AfterTax = actualTotal - pm_WageSheet.WithholdingTax;