| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using CoreFS.CA06;
- using System.Data;
- using System.Collections;
- using Core.Mes.Client.Common;
- namespace Core.LgMes.Client.lgBll.lgResMgt
- {
- public class CommonAtomStlCcmMgt
- {
- private ClientParam _cParam = null;
-
- public CommonAtomStlCcmMgt(ClientParam param)
- {
- this._cParam = param;
- }
- public CommonAtomStlCcmMgt()
- {
-
- }
- /// <summary>
- /// 获取连铸实绩数据
- /// </summary>
- /// <param name="param"></param>
- /// <returns></returns>
- public DataSet returnDsOfCcmInfo(ClientParamWithSqlConditionAndOpenBase param)
- {
- DataSet ds = new DataSet();
- try
- {
- ds = DbCommon.returnDataSet(CommonAtomForLgResMgt.returnSqlOfStl_Ccm_Optinfo(param.sqlCondition), param.ob);
- }
- catch
- {
- }
- return ds;
-
- }
- /// <summary>
- /// 获取连铸实绩数据
- /// </summary>
- /// <param name="sqlConditon"></param>
- /// <returns></returns>
- public DataSet returnDsOfCcmInfo(string sqlConditon)
- {
- DataSet ds = new DataSet();
- try
- {
- ds = DbCommon.returnDataSet(CommonAtomForLgResMgt.returnSqlOfStl_Ccm_Optinfo(sqlConditon),_cParam.ob);
- }
- catch
- {
- }
- return ds;
- }
- /// <summary>
- /// 获取带有包晶数据的连铸实绩数据
- /// </summary>
- /// <param name="param"></param>
- /// <returns></returns>
- public DataSet returnDsOfCcmChemInfo(ClientParamWithSqlConditionAndOpenBase param)
- {
- DataSet ds = new DataSet();
- try
- {
- ds = DbCommon.returnDataSet(CommonAtomForLgResMgt.returnSqlOfCcmChemInfo(param.sqlCondition), param.ob);
- }
- catch
- {
- }
- return ds;
- }
- /// <summary>
- /// 获取某一炉号在该浇次中实绩冶炼顺序
- /// </summary>
- /// <param name="castNo"></param>
- /// <returns></returns>
- public int returnHeatSeqByCastSeq(string heatNo)
- {
- string planSqlConditon = string.Format(" and CHARGE_NO = '{0}'", heatNo);
- ClientParam param = new ClientParam("",planSqlConditon, _cParam.ob);
- string castNo = "";
- int index = 0;
- int rowCount = 0;
- bool isExist = false;
- try
- {
- castNo = Core.LgMes.Client.lgBll.lgPlanMgt.CommonLgPlanMgt.return3qCastNoByHeatNo(param);
- }
- catch
- {
-
- }
-
- if (castNo.Length > 0)
- {
- try
- {
- ArrayList list = Core.LgMes.Client.lgBll.lgPlanMgt.CommonLgPlanMgt.returnHeatNoListByCastNo(new ClientParam("", string.Format(" and CAST_NO = '{0}'", castNo), _cParam.ob));
- DataSet dsCcm = returnDsOfCcmInfo(lgCommon.returnSqlWhereConditionByColumnListAndColumnName(list,"HEATNO"));
- DataSet dsSortByOPTDATE = lgCommon.returnDsByAscOrderFromSourceDataSet(dsCcm, "OPTDATE");
- if (!lgCommon.isDataSetDataFoundCheck(dsSortByOPTDATE))
- return 1;
- rowCount = dsSortByOPTDATE.Tables[0].Rows.Count;
- for (int i = rowCount - 1; i >= 0; i--)
- {
- index = i + 1;
- if (dsSortByOPTDATE.Tables[0].Rows[i]["HEATNO"].ToString() == heatNo)
- {
- isExist = true;
- break;
- }
- }
-
- }
- catch
- {
- }
- }
- return (index == 0) ? 1 : (!isExist)? index + 1 : index;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="heatNo">炉号</param>
- /// <param name="vCastNo">浇次号</param>
- /// <returns></returns>
- public int returnHeatSeqByCastSeq(string heatNo,string vCastNo)
- {
-
-
- string castNo = vCastNo;
- int index = 0;
- int rowCount = 0;
- bool isExist = false;
- if (castNo.Length > 0)
- {
- try
- {
- DataSet dsCcm = returnDsOfCcmInfo(string.Format(" and MOULDNO = '{0}'", castNo));
- DataSet dsSortByOPTDATE = lgCommon.returnDsByAscOrderFromSourceDataSet(dsCcm, "OPTDATE");
- if (dsSortByOPTDATE == null & dsSortByOPTDATE.Tables.Count == 0)
- return 1;
- rowCount = dsSortByOPTDATE.Tables[0].Rows.Count;
- if (rowCount == 0)
- return 1;
- for (int i = rowCount - 1; i >= 0; i--)
- {
- index = i + 1;
- if (dsSortByOPTDATE.Tables[0].Rows[i]["HEATNO"].ToString() == heatNo)
- {
- isExist = true;
- break;
- }
- }
- }
- catch
- {
- }
- }
- return (index == 0) ? 1 : (!isExist) ? index + 1 : index;
- }
- }
- }
|