public List <crtRes> crtBGD([FromBody] crtPrm prm) { var model = new BorgWarnerMisSQLContext(); var testData = model.Database.SqlQuery <crtRes>($"EXECUTE dbo.QforCreateBGD @workNo='{prm.workNo}',@crtMan='{prm.crtMan}',@crtDate='{prm.crtDate}'").ToList(); return(testData); }
public List <orderRes> createData([FromBody] crtPrm prm) { var model = new BorgWarnerMisSQLContext(); FileStream fs = new FileStream(prm.fs, FileMode.Open); IWorkbook workbook = WorkbookFactory.Create(fs); List <ArrayList> res = new List <ArrayList>(); ISheet sheet = null; for (var i = 0; i < workbook.NumberOfSheets; i++) { sheet = workbook.GetSheetAt(i); if (sheet.SheetName == prm.sn) { break; } } //获取标题行列数 int index = sheet.GetRow(0).Cells.Count; IRow row = null; var td = new DataTable(); for (int i = 1; i <= sheet.LastRowNum; i++) { row = (dynamic)sheet.GetRow(i); var container = new ctr(); ICell c1 = (dynamic)row.GetCell(0); container.ordNo = (c1 == null)?"":c1.ToString().Trim(); ICell c2 = (dynamic)row.GetCell(1); container.wlNo = (c2 == null)?"":c2.ToString().Trim(); ICell c3 = (dynamic)row.GetCell(2); container.wlDesc = (c3 == null)?"":c3.ToString().Trim(); ICell c4 = (dynamic)row.GetCell(3); container.ordNum = int.Parse(c4.ToString().Trim()); ICell c5 = (dynamic)row.GetCell(4); container.sTime = c5.DateCellValue; ICell c6 = (dynamic)row.GetCell(5); container.eTime = c6.DateCellValue; ICell c7 = (dynamic)row.GetCell(6); container.ordTime = c7.DateCellValue; ICell c8 = (dynamic)row.GetCell(7); container.station = (c8 == null)?"":c8.ToString().Trim(); ICell c9 = (dynamic)row.GetCell(8); container.status = (c9 == null)?"":c9.ToString().Trim(); ICell c10 = (dynamic)row.GetCell(9); container.ordType = (c10 == null)?"":c10.ToString().Trim(); ICell c11 = (dynamic)row.GetCell(10); container.tip = (c11 == null)?"":(c11).ToString().Trim(); //TODO.. //重复订单号检验!!! td = model.Database.SqlQuery($"EXECUTE dbo.QforWebNewOrder @ordNo='{container.ordNo}',@wlNo='{container.wlNo}',@wlDesc='{container.wlDesc}',@ordNum='{container.ordNum}',@sTime='{container.sTime}',@eTime='{container.eTime}',@ordTime='{container.ordTime}',@station='{container.station}',@status='{container.status}',@ordType='{container.ordType}',@tip='{container.tip}' "); } if (System.IO.File.Exists(prm.sn)) { System.IO.File.Delete(prm.sn); } var testData = model.Database.SqlQuery <orderRes>($"EXECUTE dbo.QforWebOrderRelease @prodLine='{prm.pline}',@srh='{prm.srhCont}' ").ToList(); return(testData); }