/// <summary> /// 按计算单元编号计算洪水场次 /// </summary> /// <param name="ishavecc"></param> public static void RunBatchCalculateByUintID(string ishavecc, string unitid, int index, string year) { Console.WriteLine("进入方法的时间:" + DateTime.Now); try { if (ishavecc == "1") { HookHelper.IsHaveCC = ishavecc; DataTable dt_t = GetUnitSETime(unitid, "", year); for (int n = index; n < dt_t.Rows.Count; n++) { try { HookHelper.JS_StartTime = dt_t.Rows[n]["CStartTime"].ToString(); HookHelper.JS_EndTime = dt_t.Rows[n]["CEndTime"].ToString(); HookHelper.PubCode = dt_t.Rows[n]["ccode"].ToString() + unitid; ReadStartCondition.RunCalculateN(unitid, "60", true); Console.WriteLine("==============完成计算的场次:" + HookHelper.PubCode); Console.WriteLine("==============计算的第:" + (n + 1) + "个场次完成"); } catch (Exception) { n = n - 1; throw; } } } else { ReadStartCondition.RunCalculateN(unitid, "60", false); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 创建计算的数组 /// </summary> public static void RunBatchCalculate(string ishavecc, string year, string unitidst, int index) { int st_i = 0; int st_m = 0; if (unitidst != "0") { for (int i = 0; i < UnitClassList.Count; i++) { if (UnitClassList[i].unitids.Contains(unitidst)) { st_i = i; List <string> unitids = UnitClassList[i].unitids;//计算单元编号列表 for (int j = 0; j < unitids.Count; j++) { if (unitids[j] == unitidst) { st_m = j; } } } } } for (int i = st_i; i < UnitClassList.Count; i++) { List <string> unitids = UnitClassList[i].unitids;//计算单元编号列表 if (i != st_i) { st_m = 0; } for (int m = st_m; m < unitids.Count; m++) { string unitid = unitids[m].ToString(); Console.WriteLine(unitid + "开始计算的时间:" + DateTime.Now); try { if (ishavecc == "1") { HookHelper.IsHaveCC = ishavecc; DataTable dt_t = GetUnitSETime(unitid, "", year); int pugnum = 0; pugnum = index; if (m != st_m) { pugnum = 0; } for (int n = pugnum; n < dt_t.Rows.Count; n++) { try { HookHelper.JS_StartTime = dt_t.Rows[n]["CStartTime"].ToString(); HookHelper.JS_EndTime = dt_t.Rows[n]["CEndTime"].ToString(); HookHelper.PubCode = dt_t.Rows[n]["ccode"].ToString() + unitid; Console.WriteLine((n + 1) + " 场次:" + HookHelper.PubCode + " " + DateTime.Now); ReadStartCondition.RunCalculateN(unitid, "60", true); Console.WriteLine("==============完成计算的场次:" + HookHelper.PubCode); Console.WriteLine("==============计算的第:" + (n + 1) + "个场次完成"); } catch (Exception ex) { Console.WriteLine(" " + (n + 1) + "场次出现异常"); //n = n - 1; throw ex; //continue; } } } else { ReadStartCondition.RunCalculateN(unitid, "60", false); } } catch (Exception ex) { Console.WriteLine((m + 1) + " " + unitid + "单元出现异常"); throw ex; } } } }