|
@@ -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);
|