/// <summary> /// 统计图标出工打卡人数统计 /// </summary> /// <param name="Model"></param> /// <returns></returns> public List <CheckDatePerson> GetPunchCardData(DebtChartMoneyModel Model) { List <CheckDatePerson> list = new List <CheckDatePerson>(); CheckDatePerson rCheck = new CheckDatePerson(); List <DateTime> timeList = HCQ2_Common.DateHelper.GetDateDetail(Convert.ToDateTime(Model.startDate), Convert.ToDateTime(Model.endDate)); if (timeList == null) { return(null); } StringBuilder sbSql = new StringBuilder(); foreach (var item in timeList) { rCheck = new HCQ2_Model.APPModel.ResultApiModel.CheckDatePerson(); sbSql = new StringBuilder(); sbSql.AppendFormat("select COUNT(distinct(PersonID)) from A02 where YEAR(A0201)={0} ", item.Year); sbSql.AppendFormat(" and MONTH(A0201)={0} and DAY(A0201)={1}", item.Month, item.Day); rCheck.check_date = item.ToString("yyyy.MM.dd"); rCheck.check_num = Convert.ToInt32(HCQ2_Common.SQL.SqlHelper.ExecuteScalar(sbSql.ToString())); list.Add(rCheck); } return(list); }
public object GetPunchCardData(DebtChartMoneyModel model) { if (!ModelState.IsValid) { return(operateContext.RedirectWebApi(WebResultCode.Exception, GlobalConstant.参数异常.ToString(), false)); } var data = operateContext.bllSession.A02.GetPunchCardData(model); return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.操作成功.ToString(), data)); }