|
@@ -49,6 +49,30 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#region 工资表单
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 工资表单 基础数据源
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> GetWageSheetBasicsDataSource()
|
|
|
+ {
|
|
|
+
|
|
|
+ //获取OA系统内所有用户
|
|
|
+ var nameData = await _usersRep.GetUserNameList(1);
|
|
|
+ if (nameData.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, nameData.Msg));
|
|
|
+ }
|
|
|
+
|
|
|
+ var data = new {
|
|
|
+ userNames = nameData.Data
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ return Ok(JsonView(true, "查询成功!", data));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 获取工资表单
|
|
|
/// </summary>
|
|
@@ -58,7 +82,6 @@ namespace OASystem.API.Controllers
|
|
|
[ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
public async Task<IActionResult> GetWageSheetList(WageSheetListDto dto)
|
|
|
{
|
|
|
-
|
|
|
//参数处理
|
|
|
string ymFormat = "yyyy-MM";
|
|
|
DateTime yearMonthDt;
|
|
@@ -74,7 +97,7 @@ namespace OASystem.API.Controllers
|
|
|
string startDt = yearMonthDt.AddDays(-1).ToString("yyyy-MM") + "-28",
|
|
|
endDt = yearMonth + "-27";
|
|
|
|
|
|
- //应发合计 = 基本工资 +绩效工资 + 岗位津贴 + 员工的岗位津贴 + 服装洗理补贴 + 通讯补贴 + 交通补贴 + 保密费 + 操作奖金+ 其他补贴 + 部门集体团建费 + 代扣保险 + 代扣公积金 + 餐补 - 个税
|
|
|
+ //应发合计 = 基本工资 +绩效工资 + 岗位津贴 + 员工的岗位津贴 + 服装洗理补贴 + 通讯补贴 + 交通补贴 + 保密费 + 操作奖金+ 其他补贴 + 部门集体团建费 + 代扣保险 + 代扣公积金 + 餐补
|
|
|
|
|
|
//事假 病假 合计
|
|
|
|
|
@@ -132,6 +155,34 @@ namespace OASystem.API.Controllers
|
|
|
return Ok(JsonView(true, _result.Msg, _result.Data));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 人事模块 工资表单 删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost]
|
|
|
+ [ProducesResponseType(typeof(JsonView), StatusCodes.Status200OK)]
|
|
|
+ public async Task<IActionResult> PostWageSheetDel(WageDelDto dto)
|
|
|
+ {
|
|
|
+ try
|
|
|
+ {
|
|
|
+ _result = await _wageSheetRep.Post_WageSheet_DelAsync(dto);
|
|
|
+ if (_result.Code != 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, _result.Msg));
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ return Ok(JsonView(false, ex.Message));
|
|
|
+ }
|
|
|
+
|
|
|
+ return Ok(JsonView(true, _result.Msg, _result.Data));
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 人事模块 工资表单 添加 Or 修改
|
|
|
/// </summary>
|
|
@@ -205,7 +256,7 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
//获取OA系统内所有用户
|
|
|
var nameData = await _usersRep.GetUserNameList(1);
|
|
|
- List<UserNameView> userNames = nameData.Data;
|
|
|
+ List<UserNameView>? userNames = nameData.Data;
|
|
|
|
|
|
//获取所有打卡数据
|
|
|
CheckInView checkIn = await _qiYeWeChatApiService.GetCheckin_MonthDataAsync(startDt, endDt); //时间段内所有 打卡数据
|
|
@@ -221,7 +272,6 @@ namespace OASystem.API.Controllers
|
|
|
DateTime sp_centerDt = sp_startDt.AddDays(30);
|
|
|
DateTime sp_endDt = endDt.AddDays(10);
|
|
|
|
|
|
-
|
|
|
List<Sp_Info> sp_Infos = new List<Sp_Info>();
|
|
|
string redisName = "ApprovalData_" + sp_startDt.Year + "_" + sp_startDt.Month;
|
|
|
string sp_InfosString = await RedisRepository.RedisFactory
|
|
@@ -267,7 +317,6 @@ namespace OASystem.API.Controllers
|
|
|
Pm_WageSheet pm_wsInfo = new Pm_WageSheet();
|
|
|
pm_wsInfo = _mapper.Map<Pm_WageSheet>(item);
|
|
|
|
|
|
-
|
|
|
//补贴 金额
|
|
|
decimal meal_subsidy = 0.00M; // 午餐(午餐10元/天) 补贴 * 计算方式:单日上午请假时长(小时)大于或者等于三小时 没有餐补
|
|
|
|
|
@@ -292,14 +341,11 @@ namespace OASystem.API.Controllers
|
|
|
decimal meal_deduction = 0.00M; // 餐补 扣款金额
|
|
|
decimal reissuecard_deduction = 0.00M; // 补卡 扣款金额
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//打卡数据
|
|
|
Data? checkInData = checkInDatas.Where(it => it.base_info.name == item.Name).FirstOrDefault();
|
|
|
if (checkInData == null) { continue; }
|
|
|
string acctid = checkInData.base_info.acctid; //用户Id
|
|
|
|
|
|
-
|
|
|
//当月总计数据
|
|
|
Summary_Info? summary_Info = checkInData.summary_info;
|
|
|
if (summary_Info == null ) { continue; }
|
|
@@ -365,29 +411,44 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
List<Sp_Info> sp_leave_item_infosData = sp_leave_InfosData.Where(it => it.spname == "请假" && it.apply_name == item.Name).ToList();
|
|
|
|
|
|
+ List<Ex_Items> ex_Items = new List<Ex_Items>();//假勤 And 打卡备注集合
|
|
|
+ Ex_Items ex_Items_jq = new Ex_Items() { Type = "假勤" }; //假勤
|
|
|
+ List<Ex_Item> ex_ItemInfos = new List<Ex_Item>();
|
|
|
+
|
|
|
foreach (Sp_Info sp_item in sp_leave_item_infosData)
|
|
|
{
|
|
|
Leave? sp_leave = sp_item.leave;
|
|
|
if (sp_leave != null)
|
|
|
{
|
|
|
- //leave_type 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他
|
|
|
|
|
|
+ //请假时长
|
|
|
+ double leaveLength = (sp_leave.end_time_dt - sp_leave.start_time_dt).TotalHours;
|
|
|
+
|
|
|
+ string typeName = string.Empty;
|
|
|
+ //leave_type 1年假;2事假;3病假;4调休假;5婚假;6产假;7陪产假;8其他
|
|
|
switch (sp_leave.leave_type)
|
|
|
{
|
|
|
case 1: //年假
|
|
|
+ typeName = "年假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3)
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case 2: //事假 需调整
|
|
|
+ typeName = "事假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
@@ -395,14 +456,19 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3)
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
- personalLeaveTotal += dailyWage;
|
|
|
+ }
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 3: //病假 需调整
|
|
|
+ typeName = "病假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
@@ -410,75 +476,123 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3) //7.5小时 一天
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
- sickLeaveTotal += sickLeave_deduction;
|
|
|
+ }
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 4: //调休假
|
|
|
+ typeName = "调休假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3) //7.5小时 一天
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
+ }
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
case 5: //婚假
|
|
|
+ typeName = "婚假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3) //7.5小时 一天
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case 6: //产假
|
|
|
+ typeName = "产假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3) //7.5小时 一天
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
case 7: //陪产假
|
|
|
+ typeName = "陪产假";
|
|
|
if (sp_leave.timeunit == 0) //半天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
else if (sp_leave.timeunit == 1) //小时
|
|
|
{
|
|
|
- if (sp_leave.duration >= 3) //7.5小时 一天
|
|
|
+ if (sp_leave.duration >= 3 && sp_leave.duration <= 7.5) //7.5小时 一天
|
|
|
{
|
|
|
meal_deduction += 10;
|
|
|
}
|
|
|
+ else if (sp_leave.duration > 7.5)
|
|
|
+ {
|
|
|
+ decimal daysPrice = Convert.ToDecimal(sp_leave.duration / 7.5 * 10);
|
|
|
+ meal_deduction += daysPrice;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
+ Ex_Item ex_Item = new Ex_Item() {
|
|
|
+ SubTypeId = sp_leave.leave_type,
|
|
|
+ SubType = typeName,
|
|
|
+ Start_time_dt = sp_leave.start_time_dt,
|
|
|
+ End_time_dt = sp_leave.end_time_dt,
|
|
|
+ Duration = sp_leave.duration,
|
|
|
+ Reason = sp_leave.reason,
|
|
|
+ Apply_time_dt = sp_item.apply_time_dt,
|
|
|
+ Approval_name = sp_item.approval_name,
|
|
|
+ };
|
|
|
+ ex_ItemInfos.Add(ex_Item);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (ex_ItemInfos.Count > 0)
|
|
|
+ {
|
|
|
+ ex_Items_jq.Ex_ItemInfo = ex_ItemInfos.OrderBy(it => it.SubTypeId).ThenBy(it => it.Start_time_dt).ToList();
|
|
|
+ ex_Items.Add(ex_Items_jq);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
- #region 补卡 处理
|
|
|
+ #region 打卡补卡 处理
|
|
|
|
|
|
if (reissueCardNum == 3)
|
|
|
{
|
|
@@ -491,10 +605,13 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ Ex_Items ex_Items_dk = new Ex_Items() { Type = "打卡" }; //打卡
|
|
|
+ //List<Ex_Item> ex_reissuecard_Items = new List<Ex_Item>();
|
|
|
+ List<dynamic> ex_reissuecard_Items = new List<dynamic>();
|
|
|
+ List<Sp_Info> sp_reissuecard_item_InfosData = sp_reissuecard_InfosData.Where(it => it.apply_name == item.Name).ToList();
|
|
|
|
|
|
- #endregion
|
|
|
+ #region 打卡异常处理 统计 1-迟到;2-早退;3-缺卡;4-旷工;5-地点异常;6-设备异常;
|
|
|
|
|
|
- //打卡异常处理 统计 1-迟到;2-早退;3-缺卡;4-旷工;5-地点异常;6-设备异常;
|
|
|
int beLateNum = 0, // 1-迟到;
|
|
|
leaveEarlyNum = 0, // 2-早退;
|
|
|
dummyDeckNum = 0, // 3-缺卡;
|
|
@@ -516,6 +633,146 @@ namespace OASystem.API.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ foreach (Sp_Info sp_reissuecard_item in sp_reissuecard_item_InfosData)
|
|
|
+ {
|
|
|
+ DateTime apply_time_dt = sp_reissuecard_item.apply_time_dt; //申请时间
|
|
|
+ List<string>? approval_name = sp_reissuecard_item.approval_name; //审核人
|
|
|
+
|
|
|
+ Comm sp_comm = sp_reissuecard_item.comm;
|
|
|
+ if (sp_comm != null)
|
|
|
+ {
|
|
|
+ if (sp_comm.applydata != null )
|
|
|
+ {
|
|
|
+ List<ApplyInfo> applyInfos = sp_comm.applydata;
|
|
|
+ if (applyInfos.Count > 0)
|
|
|
+ {
|
|
|
+ //Ex_Item ex_reissuecard_Item = new Ex_Item();
|
|
|
+ dynamic ex_reissuecard_Item = null;
|
|
|
+ string text = applyInfos.Where(it => it.type == "text").FirstOrDefault().value.ToString(); //异常状态
|
|
|
+ DateTime? datehour = applyInfos.Where(it => it.type == "datehour").FirstOrDefault().valueDt;//补卡时间
|
|
|
+ string textarea = applyInfos.Where(it => it.type == "textarea").FirstOrDefault().value.ToString();//补卡事由
|
|
|
+ if (text.Contains("未打卡"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 0,
|
|
|
+ SubType = "未打卡",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("迟到"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 1,
|
|
|
+ SubType = "迟到",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null? "": Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("早退"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 2,
|
|
|
+ SubType = "早退",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("缺卡"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 3,
|
|
|
+ SubType = "缺卡",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("旷工"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 4,
|
|
|
+ SubType = "旷工",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("地点异常"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 5,
|
|
|
+ SubType = "地点异常",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ else if (text.Contains("设备异常"))
|
|
|
+ {
|
|
|
+ ex_reissuecard_Item = new
|
|
|
+ {
|
|
|
+ SubTypeId = 6,
|
|
|
+ SubType = "设备异常",
|
|
|
+ title = text,
|
|
|
+ datehour = datehour == null ? "" : Convert.ToDateTime(datehour).ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
+ textarea = textarea,
|
|
|
+ apply_time_dt = apply_time_dt,
|
|
|
+ approval_name = approval_name
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (ex_reissuecard_Item != null)
|
|
|
+ {
|
|
|
+ ex_reissuecard_Items.Add(ex_reissuecard_Item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ex_reissuecard_Items.Count>0)
|
|
|
+ {
|
|
|
+ ex_Items_dk.Ex_ItemInfo = ex_reissuecard_Items.OrderBy(it => it.SubTypeId).ThenBy(it => it.datehour).ToList();
|
|
|
+ ex_Items.Add(ex_Items_dk);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 应发合计 实发合计 扣款合计(假勤扣款,其他扣款,社保扣款,公积金代扣,个税扣款)
|
|
|
+
|
|
|
+ decimal mealTotal = meal_subsidy - meal_deduction; //餐补
|
|
|
+ decimal salaryTotal = amountPayable + mealTotal; //应发合计
|
|
|
+
|
|
|
+ //扣款合计 不含个税
|
|
|
+ decimal eductionTotal = sickLeaveTotal + personalLeaveTotal + beLate_deduction + early_deduction + absenteeism_deduction + unprinted_deduction + other_deduction +
|
|
|
+ pm_wsInfo.WithholdingInsurance + pm_wsInfo.ReservedFunds;
|
|
|
+ decimal actualReleaseTotal = salaryTotal - eductionTotal; //实发合计 * 不含个税
|
|
|
+
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 处理当月工资数据
|
|
|
pm_wsInfo.YearMonth = thisYearMonth;
|
|
|
pm_wsInfo.StartDate = startDt.ToString("yyyy-MM-dd");
|
|
@@ -528,13 +785,13 @@ namespace OASystem.API.Controllers
|
|
|
pm_wsInfo.Absenteeism = absenteeism_deduction; //旷工
|
|
|
pm_wsInfo.NotPunch = unprinted_deduction; //未打卡
|
|
|
pm_wsInfo.OtherDeductions = other_deduction; //其他
|
|
|
+ pm_wsInfo.Ex_ItemsRemark = JsonConvert.SerializeObject(ex_Items); //
|
|
|
+ pm_wsInfo.Mealsupplement = mealTotal; //餐补
|
|
|
|
|
|
- pm_wsInfo.Mealsupplement = meal_subsidy - meal_deduction; //餐补
|
|
|
-
|
|
|
-
|
|
|
- decimal salaryTotal = amountPayable; //应发合计
|
|
|
- //decimal eductionTotal = ;
|
|
|
- decimal actualReleaseTotal = 0.00M; //实发合计
|
|
|
+ pm_wsInfo.Should = salaryTotal; //应发合计
|
|
|
+ pm_wsInfo.TotalDeductions = eductionTotal; //扣款合计
|
|
|
+ pm_wsInfo.TotalRealHair = actualReleaseTotal; //实发合计
|
|
|
+ pm_wsInfo.AfterTax = actualReleaseTotal - pm_wsInfo.WithholdingTax; //税后工资
|
|
|
|
|
|
pm_wsInfo.LastUpdateUserId = dto.UserId;
|
|
|
pm_wsInfo.LastUpdateDt = DateTime.Now;
|
|
@@ -546,11 +803,38 @@ namespace OASystem.API.Controllers
|
|
|
|
|
|
wageSheets.Add(pm_wsInfo);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
-
|
|
|
+ #region 批量添加
|
|
|
+ var add = await _wageSheetRep._sqlSugar.Insertable(wageSheets).ExecuteCommandAsync();
|
|
|
+ if (add <= 0)
|
|
|
+ {
|
|
|
+ return Ok(JsonView(false, "操作失败!"));
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 处理返回数据
|
|
|
+
|
|
|
+ List <WageSheetItemInfoView> wageSheetItems = new List<WageSheetItemInfoView>();
|
|
|
+ wageSheetItems = _mapper.Map<List<WageSheetItemInfoView>>(wageSheets);
|
|
|
+ wageSheetItems = wageSheetItems.Select(it =>
|
|
|
+ {
|
|
|
+ UserNameView? uName1 = new UserNameView();
|
|
|
+ UserNameView? uName2 = new UserNameView();
|
|
|
+ uName1 = userNames.Where(it1 => it.UserId == it1.Id).FirstOrDefault();
|
|
|
+ if (uName1 != null) it.Name = uName1.CnName;
|
|
|
+
|
|
|
+ uName2 = userNames.Where(it1 => it.LastUpdateUserId == it1.Id).FirstOrDefault();
|
|
|
+ if (uName2 != null) it.LastUpdateUserName = uName2.CnName;
|
|
|
+
|
|
|
+ return it; }
|
|
|
+ ).ToList();
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- return Ok(JsonView(true,"操作成功!", wageSheets));
|
|
|
+ return Ok(JsonView(true,"操作成功!", wageSheetItems));
|
|
|
}
|
|
|
|
|
|
/// <summary>
|