public string AgainOrder(POM_TEMP_ORDER model) { try { POM_TEMP_ORDER list = tempOrderBO.GetEntity(Convert.ToInt32(model.PomTempOrderPK)); return(tempOrderBO.CreateOrder(list)); } catch (Exception e) { return("工单创建异常:" + e.Message); } }
/// <summary> /// 导入工单排产(Excel) /// </summary> /// <param name="filePath"></param> /// <returns></returns> public string InputExcel_Order(string filePath, string userID) { try { List <POM_TEMP_ORDER_QueryParam> importList = tempOrderBO.InputExcel_Order(filePath); POM_TEMP_ORDER tempOrder = new POM_TEMP_ORDER(); if (importList == null || importList.Count == 0) { return("文件不存在或数据非法");//文件不存在或无数据 } IList <POM_TEMP_ORDER> failList = new List <POM_TEMP_ORDER>(); for (int i = 0; i < importList.Count; i++) { tempOrder.PomOrderID = importList[i].PomOrderID; tempOrder.SapOrderID = importList[i].SapOrderID; tempOrder.Quantity = Convert.ToInt32(importList[i].MesQuantity); tempOrder.LineID = importList[i].LineID; tempOrder.SalesOrderID = importList[i].SalesOrderID; tempOrder.SalesOrderSeq = importList[i].SalesOrderSeq; tempOrder.SapOrderType = importList[i].SapOrderType; tempOrder.DefID = importList[i].DefID; tempOrder.DefVer = ""; tempOrder.DefDescript = importList[i].DefDescript; tempOrder.DepartID = importList[i].DepartID; tempOrder.PlanStartDate = importList[i].PlanStartDate; tempOrder.PlanEndDate = importList[i].PlanEndDate; tempOrder.PlanPlant = importList[i].PlanPlant; tempOrder.ProductPlant = importList[i].ProductPlant; tempOrder.OrderStatus = importList[i].OrderStatus; tempOrder.SapOperator = importList[i].SapOperator; tempOrder.NamePlateStart = importList[i].NamePlateStart; tempOrder.PackNote = importList[i].PackNote; tempOrder.IsSmallOrder = importList[i].IsSmallOrder; tempOrder.Status = 0; tempOrder.Message = importList[i].Message; tempOrder.CreatedBy = userID; //排产人 tempOrder.CreatedOn = importList[i].CreatedOn; tempOrder.UpdatedBy = ""; tempOrder.UpdatedOn = importList[i].CreatedOn; tempOrder.Intiger1 = importList[i].Intiger1; tempOrder.Intiger2 = importList[i].Intiger2; tempOrder.Intiger3 = importList[i].Intiger3; tempOrder.Datetime1 = importList[i].Datetime1; tempOrder.Datetime2 = importList[i].Datetime2; tempOrder.Datetime3 = importList[i].Datetime3; tempOrder.Attribute01 = importList[i].Attribute01; tempOrder.Attribute02 = importList[i].Attribute02; tempOrder.Attribute03 = importList[i].Attribute03; tempOrder.Attribute04 = importList[i].Attribute04; tempOrder.Attribute05 = importList[i].Attribute05; tempOrder.Attribute06 = importList[i].Attribute06; tempOrder.Attribute07 = importList[i].Attribute07; tempOrder.Attribute08 = importList[i].Attribute08; tempOrder.Attribute09 = importList[i].Attribute09; tempOrder.Attribute10 = importList[i].Attribute10; tempOrder.PomOrderSequence = importList[i].PomOrderSequence; tempOrder.IsNeedCrtedSn = importList[i].IsNeedCrtedSn; //2018.11.5新增 try { tempOrderBO.Insert(tempOrder); } catch (Exception ex) { throw new Exception("插入POM_ORDER_TEMP表异常:" + ex.Message); } //更新TEMP_ORDER_ERP表中对应的工单排产状态 string sqlstr = @"UPDATE POM_TEMP_ERP_ORDER SET Status=1 WHERE SapOrderID='{0}'"; sqlstr = string.Format(sqlstr, importList[i].SapOrderID); co_BSC_BO.ExecuteNonQueryBySql(sqlstr); } //END FOR return("导入成功"); } catch (Exception ex2) { throw new Exception("导入异常:" + ex2.Message); } }