public string RY_ZC_SELECT(string datastring) { string token = AppClass.GetSession("token").ToString(); HR_RY_ZC model = Newtonsoft.Json.JsonConvert.DeserializeObject <HR_RY_ZC>(datastring); HR_RY_ZC_SELECT result = hrmodels.RY_RYINFO_RSDA.RY_ZC_SELECT(model, token); return(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
public MES_RETURN_UI ZC_UPDATE(HR_RY_ZC model, string ptoken) { MES_RETURN mr = client.ZC_UPDATE(model, ptoken); MES_RETURN_UI mrui = new MES_RETURN_UI(); mrui.TYPE = mr.TYPE; mrui.MESSAGE = mr.MESSAGE; return(mrui); }
public string EXPOST_TJBB_RY_ZC_SELECT(string datastring) { MES_RETURN_UI rst = new MES_RETURN_UI(); string token = AppClass.GetSession("token").ToString(); int STAFFID = Convert.ToInt32(AppClass.GetSession("STAFFID")); HR_RY_ZC model = Newtonsoft.Json.JsonConvert.DeserializeObject <HR_RY_ZC>(datastring); HR_RY_ZC_SELECT result = hrmodels.RY_RYINFO_RSDA.RY_ZC_SELECT(model, token); if (result.MES_RETURN.TYPE == "E") { return(Newtonsoft.Json.JsonConvert.SerializeObject(result.MES_RETURN)); } try { FileStream file = new FileStream(Server.MapPath("~") + @"/Areas/HR/ExportFile/导出模版.xlsx", FileMode.Open, FileAccess.Read); IWorkbook workbook = new XSSFWorkbook(file); ISheet sheet = workbook.GetSheetAt(0); int rowcount = 0; string tt = "来源,职称名称,职称系列,获取日期,机关(部门),证件编号,复审日期,聘用日期,聘用系列,聘用等级,工号,姓名,公司,归属部门,备注"; string[] ttlist = tt.Split(','); IRow rowtt = sheet.CreateRow(rowcount++); int cellIndex = 0; for (int a = 0; a < ttlist.Length; a++) { rowtt.CreateCell(cellIndex++).SetCellValue(ttlist[a]); } DataTable dtinfo = result.DATALIST; for (int i = 0; i < dtinfo.Rows.Count; i++) { cellIndex = 0; IRow row = sheet.CreateRow(rowcount++); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCLBNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCXLNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCDATE"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCJGBM"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["ZCNO"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["FSDATE"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["PYRQ"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["PYXLNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["PYLEVELNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["GH"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["YGNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["GSNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["GSBMNAME"].ToString()); row.CreateCell(cellIndex++).SetCellValue(dtinfo.Rows[i]["REMARK"].ToString()); } string now = DateTime.Now.ToString("yyyyMMddHHmmss.fff"); FileStream file1 = new FileStream(string.Format(@"{0}/Areas/HR/ExportFile/{1}.xlsx", Server.MapPath("~"), now), FileMode.Create); workbook.Write(file1); file1.Close(); rst.TYPE = "S"; rst.MESSAGE = now; } catch { rst.TYPE = "E"; rst.MESSAGE = "生成文件失败!"; } return(Newtonsoft.Json.JsonConvert.SerializeObject(rst)); }
public HR_RY_ZC_SELECT RY_ZC_SELECT(HR_RY_ZC model, string ptoken) { return(client.RY_ZC_SELECT(model, ptoken)); }