/// <summary> /// APP根据单位,查询时间获取欠薪图表截止月数据汇总 /// </summary> /// <param name="model"></param> /// <returns></returns> public List <DebtMoneyModel> GetDebtChartEndMonthDataByOrg(DebtSelGrantModel model) { string[] start = model.startDate.Split('-'); string[] end = model.endDate.Split('-'); int startYear = Helper.ToInt(start[0]), endYear = Helper.ToInt(end[0]); int startMonth = Helper.ToInt(start[1]), //开始月 endMonth = Helper.ToInt(end[1]); //结束月 int temp = Helper.ToInt(end[0]) - Helper.ToInt(start[0]); int month = Helper.ToInt(start[1]); List <DebtMoneyModel> list = new List <DebtMoneyModel>(); for (int i = month; i <= (temp * 12 + Helper.ToInt(end[1])); i++) { if (i % 12 == 0) { month = 1; startYear++; } _param.Clear(); _param.Add("@UnitID", model.orgid); _param.Add("@startDate", ""); string str = (month > 9) ? month.ToString() : "0" + month.ToString(); _param.Add("@endDate", startYear + "-" + str + "-" + DateTime.DaysInMonth(startYear, month)); //_param.Add("@endDate", startYear + "-" + str + "-" + Helper.DayByMonth(month)); DataTable dt = SqlHelper.ExecuteDataTable("exec P_GetQianXin_Detail @UnitID,@startDate,@endDate", CommandType.Text, SqlHelper.GetParameters(_param)); list.Add(HCQ2_Common.Data.DataTableHelper.DataTableToIList <DebtMoneyModel>(dt).FirstOrDefault()); month++; } return(list); }
/// <summary> /// APP根据单位,时间条件查询欠薪数据汇总 /// </summary> /// <param name="model"></param> /// <returns></returns> public List <DebtDataModel> GetDebtCountDataByOrg(DebtSelGrantModel model) { _param.Clear(); _param.Add("@UnitID", model.orgid); if (!string.IsNullOrEmpty(model.startDate)) { _param.Add("@startDate", model.startDate + "-01"); } else { _param.Add("@startDate", ""); } if (!string.IsNullOrEmpty(model.endDate)) { _param.Add("@endDate", model.endDate + "-" + DateTime.DaysInMonth(Helper.ToInt(model.endDate.Split('-')[0]), Helper.ToInt(model.endDate.Split('-')[1]))); } //_param.Add("@endDate", model.endDate+"-"+ Helper.DayByMonth(Helper.ToInt(model.endDate.Split('-')[1]))); else { _param.Add("@endDate", ""); } DataTable dt = SqlHelper.ExecuteDataTable("exec P_GetQianXin_Detail @UnitID,@startDate,@endDate", CommandType.Text, SqlHelper.GetParameters(_param)); return(HCQ2_Common.Data.DataTableHelper.DataTableToIList <DebtDataModel>(dt)); }
public object GetDebtDataByUnit(DebtSelGrantModel model) { if (!ModelState.IsValid) { return(operateContext.RedirectWebApi(WebResultCode.Exception, GlobalConstant.参数异常.ToString(), false)); } List <DebtDataModel> uModel = operateContext.bllSession.View_QXTJ.GetDebtCountDataByOrg(model); if (null == uModel || uModel.Count <= 0) { return(operateContext.RedirectWebApi(WebResultCode.Error, GlobalConstant.数据获取失败.ToString(), "")); } return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.操作成功.ToString(), uModel)); }
public object GetGrantInfoByUnit(DebtSelGrantModel model) { if (!ModelState.IsValid) { return(operateContext.RedirectWebApi(WebResultCode.Exception, GlobalConstant.参数异常.ToString(), false)); } List <DebtWGJG01Model> uModel = operateContext.bllSession.WGJG01.GetGrantInfoByUnit(model); if (null == uModel) { return(operateContext.RedirectWebApi(WebResultCode.Error, GlobalConstant.数据获取失败.ToString(), "")); } return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.操作成功.ToString(), uModel)); }
public List <DebtWGJG01Model> GetGrantInfoByUnit(DebtSelGrantModel model) { _param.Clear(); _param.Add("@orgid", model.orgid); StringBuilder sb = new StringBuilder(); sb.Append(string.Format(@"SELECT CONVERT(varchar(100), wg.WGJG0107, 23) as WGJG0102,WGJG0103,code.CodeItemName as WGJG0101 FROM (SELECT WGJG0107,WGJG0103,WGJG0101 FROM dbo.WGJG01 WHERE UnitID=@orgid) wg LEFT JOIN (SELECT item1.*,item2.* FROM (SELECT item_id,item_code FROM dbo.T_ItemCode WHERE item_code='GDBS') item1 INNER JOIN (SELECT code_name AS CodeItemName,code_value AS CodeItemValue,item_id AS id FROM dbo.T_ItemCodeMenum) item2 ON item1.item_id = item2.id) code ON wg.WGJG0101=code.CodeItemValue")); DataTable dt = SqlHelper.ExecuteDataTable(sb.ToString(), CommandType.Text, SqlHelper.GetParameters(_param)); return(HCQ2_Common.Data.DataTableHelper.DataTableToIList <DebtWGJG01Model>(dt)); }
public object GetDebtMonthMoney(DebtSelGrantModel model) { if (!ModelState.IsValid) { return(operateContext.RedirectWebApi(WebResultCode.Exception, GlobalConstant.参数异常.ToString(), false)); } List <DebtMoneyModel> uMonth = operateContext.bllSession.View_QXTJ.GetDebtChartMonthDataByOrg(model); List <DebtMoneyModel> uEndMonth = operateContext.bllSession.View_QXTJ.GetDebtChartEndMonthDataByOrg(model); Dictionary <string, List <DebtMoneyModel> > obj = new Dictionary <string, List <DebtMoneyModel> >(); obj.Add("dtmonth", uMonth); //月欠薪金额 obj.Add("allMoney", uEndMonth); //总欠薪金额 if (uMonth == null || uEndMonth == null) { return(operateContext.RedirectWebApi(WebResultCode.Error, GlobalConstant.数据获取失败.ToString(), obj)); } return(operateContext.RedirectWebApi(WebResultCode.Ok, GlobalConstant.数据获取成功.ToString(), obj)); }
public List <DebtWGJG01Model> GetGrantInfoByUnit(DebtSelGrantModel model) { return(DBSession.IWGJG01DAL.GetGrantInfoByUnit(model)); }
/// <summary> /// APP根据单位,查询时间获取欠薪图表截止月数据汇总 /// </summary> /// <param name="model"></param> /// <returns></returns> public List <DebtMoneyModel> GetDebtChartEndMonthDataByOrg(DebtSelGrantModel model) { return(DBSession.IView_QXTJDAL.GetDebtChartEndMonthDataByOrg(model)); }
/// <summary> /// APP根据单位,时间条件查询欠薪数据汇总 /// </summary> /// <param name="model"></param> /// <returns></returns> public List <DebtDataModel> GetDebtCountDataByOrg(DebtSelGrantModel model) { return(DBSession.IView_QXTJDAL.GetDebtCountDataByOrg(model)); }