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