|  |  | 
 |  |  |         Gy_RoutingBill_temporary omdelMian = new Gy_RoutingBill_temporary(); | 
 |  |  |         public string BillType = "3301"; | 
 |  |  |  | 
 |  |  |         #region 工艺路线 列表 | 
 |  |  |         #region 未知 | 
 |  |  |         /// <summary> | 
 |  |  |         /// 返回工艺路线列表 | 
 |  |  |         /// 未知 | 
 |  |  |         ///参数:string sql。 | 
 |  |  |         ///返回值:object。 | 
 |  |  |         /// </summary> | 
 |  |  | 
 |  |  |             { | 
 |  |  |                 if (sWhere == null || sWhere.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select * from h_v_MES_StationEntrustOutBillList " + sWhere, "h_v_MES_StationEntrustOutBillList"); | 
 |  |  |                     ds = oCN.RunProcReturn("select  * from h_v_MES_StationEntrustOutBillList " + sWhere, "h_v_MES_StationEntrustOutBillList"); | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_MES_StationEntrustOutBillList where 1 = 1 "; | 
 |  |  |                     string sql1 = "select  * from h_v_MES_StationEntrustOutBillList where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_MES_StationEntrustOutBillList"); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |                                 , 良率, 工序工价, 不合格单价, 报废单价, 本道固定开工天数, 本道开工余量, 上道等待天数 | 
 |  |  |                                 , 上道循环周期, 自动转移, 外协标记, 供应商代码, 供应商, 工艺参数, 图纸编号 | 
 |  |  |                                 , 本工序确认记录, 备注, 图号版本, 总装图号, 材质, 成品编号, 版本 | 
 |  |  |                                 , 模具编号, 程序号, 班产定额, 工艺路线名称, 时间单位)values | 
 |  |  |                                 , 模具编号, 程序号, 班产定额, 工艺路线名称, 时间单位,工艺路线代码)values | 
 |  |  |                                 ('" + tb2.Rows[i]["产品代码"].ToString() + "','" + tb2.Rows[i]["产品名称"].ToString() + "','" + tb2.Rows[i]["工序序号"].ToString() + "','" + tb2.Rows[i]["工序代码"].ToString() + "','" + tb2.Rows[i]["工序"].ToString() + "','" + tb2.Rows[i]["工作中心"].ToString() + "','" + tb2.Rows[i]["加工数量"].ToString() + "'" + | 
 |  |  |                                 ",'" + tb2.Rows[i]["良率"].ToString() + "','" + (tb2.Rows[i]["工序工价"].ToString()==""?"0": tb2.Rows[i]["工序工价"].ToString()) + "','" + tb2.Rows[i]["不合格单价"].ToString() + "','" + tb2.Rows[i]["报废单价"].ToString() + "','" + tb2.Rows[i]["本道固定开工天数"].ToString() + "','" + tb2.Rows[i]["本道开工余量"].ToString() + "','" + tb2.Rows[i]["上道等待天数"].ToString() + "'" + | 
 |  |  |                                 ",'" + tb2.Rows[i]["上道循环周期"].ToString() + "','" + tb2.Rows[i]["自动转移"].ToString() + "','" + tb2.Rows[i]["外协标记"].ToString() + "','" + tb2.Rows[i]["供应商代码"].ToString() + "','" + tb2.Rows[i]["供应商"].ToString() + "','" + tb2.Rows[i]["工艺参数"].ToString() + "','" + tb2.Rows[i]["图纸编号"].ToString() + "'" + | 
 |  |  |                                 ",'" + tb2.Rows[i]["本工序确认记录"].ToString() + "','" + tb2.Rows[i]["备注"].ToString() + "','" + tb2.Rows[i]["图号版本"].ToString() + "','" + tb2.Rows[i]["总装图号"].ToString() + "','" + tb2.Rows[i]["材质"].ToString() + "','" + tb2.Rows[i]["成品编号"].ToString() + "','" + tb2.Rows[i]["版本"].ToString() + "'" + | 
 |  |  |                                 ",'" + tb2.Rows[i]["模具编号"].ToString() + "','" + tb2.Rows[i]["程序号"].ToString() + "','" + tb2.Rows[i]["班产定额"].ToString() + "','" + tb2.Rows[i]["工艺路线名称"].ToString() + "','" + tb2.Rows[i]["时间单位"].ToString() + "')"); | 
 |  |  |                                 ",'" + tb2.Rows[i]["模具编号"].ToString() + "','" + tb2.Rows[i]["程序号"].ToString() + "','" + tb2.Rows[i]["班产定额"].ToString() + "','" + tb2.Rows[i]["工艺路线名称"].ToString() + "','" + tb2.Rows[i]["时间单位"].ToString() + "','" + tb2.Rows[i]["工艺路线代码"].ToString() + "')"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  | 
 |  |  |                 omdelMian = Newtonsoft.Json.JsonConvert.DeserializeObject<Gy_RoutingBill_temporary>(msg2); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 ds = oCN.RunProcReturn("select  distinct 产品代码 from  diyipi ", "diyipi"); | 
 |  |  |                 ds = oCN.RunProcReturn("select  distinct 产品代码,工艺路线代码 from  diyipi ", "diyipi"); | 
 |  |  |  | 
 |  |  |                 for (int i = 0; i < ds.Tables[0].Rows.Count; i++) | 
 |  |  |                 { | 
 |  |  |                     var HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true);//获得一个新的单据号 | 
 |  |  |                     var HBillNo = ds.Tables[0].Rows[i]["工艺路线代码"].ToString();//获得一个新的单据号 | 
 |  |  |                     var HInterID = DBUtility.ClsPub.CreateBillID_Prod(BillType, ref DBUtility.ClsPub.sExeReturnInfo);//获得一个新的id | 
 |  |  |                     oCN.RunProc($"exec Gy_RoutingBill_Excel '{ds.Tables[0].Rows[i]["产品代码"].ToString()}',{HInterID},'{HBillNo}','{user}',{omdelMian.HOrgID},{omdelMian.HTProcessFlag} "); | 
 |  |  |                 } |