|
|
@ -6,12 +6,15 @@ using System.Data;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
using Mesnac.Codd.Session;
|
|
|
|
|
|
|
|
using Mesnac.Controls.Default;
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.LjMaterial;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class SelectAction : ChemicalWeighingAction, IAction
|
|
|
|
public class SelectAction : ChemicalWeighingAction, IAction
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//public static event EventHandler OnSelect;
|
|
|
|
|
|
|
|
|
|
|
|
private DbMCControl _materialGridControl = null; //物料列表控件
|
|
|
|
private DbMCControl _materialGridControl = null; //物料列表控件
|
|
|
|
private RuntimeParameter _runtime;
|
|
|
|
private RuntimeParameter _runtime;
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
@ -27,6 +30,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
StringBuilder sbSql = new StringBuilder(@" select Id, PlanName, PlanNo, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable, FormulaId, FormulaName,'' as StatusName
|
|
|
|
StringBuilder sbSql = new StringBuilder(@" select Id, PlanName, PlanNo, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable, FormulaId, FormulaName,'' as StatusName
|
|
|
|
,ClassName from lj_planning where IsEnable=1");
|
|
|
|
,ClassName from lj_planning where IsEnable=1");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
|
|
|
|
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
|
|
|
|
|
|
|
|
|
|
|
|
IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
|
|
|
|
IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl;
|
|
|
@ -51,14 +58,60 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
|
|
|
|
ICSharpCode.Core.LoggingService<SelectAction>.Debug("{榄菊计划报表查询} 缺少key值为enddate的时间查询条件...");
|
|
|
|
ICSharpCode.Core.LoggingService<SelectAction>.Debug("{榄菊计划报表查询} 缺少key值为enddate的时间查询条件...");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sbSql.Append(" ORDER BY CreateTime desc");
|
|
|
|
MCCombobox PlanStatus = mcControllist.FirstOrDefault(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey == "PlanStatus").BaseControl as MCCombobox;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Convert.ToString(PlanStatus.MCValue) != "-2")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
sbSql.Append(@" and Status = " + PlanStatus.MCValue);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sbSql.Append(@" ORDER BY CreateTime desc");
|
|
|
|
|
|
|
|
|
|
|
|
dbHelper.CommandText = sbSql.ToString();
|
|
|
|
dbHelper.CommandText = sbSql.ToString();
|
|
|
|
dbHelper.CommandType = System.Data.CommandType.Text;
|
|
|
|
dbHelper.CommandType = System.Data.CommandType.Text;
|
|
|
|
DataTable table = dbHelper.ToDataTable();
|
|
|
|
DataTable table = dbHelper.ToDataTable();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (table.Columns["StatusName"].ReadOnly)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
table.Columns["StatusName"].ReadOnly = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
table.Columns["StatusName"].MaxLength = 20;
|
|
|
|
|
|
|
|
//-1 任务暂停 0 新建任务 1 任务下发 2 重发 3执行中 10 任务完成 11 放弃 20 异常
|
|
|
|
|
|
|
|
foreach (DataRow tableRow in table.Rows)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int status = Convert.ToInt32(tableRow["Status"].ToString());
|
|
|
|
|
|
|
|
string statusName = "";
|
|
|
|
|
|
|
|
switch (status)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case -1:
|
|
|
|
|
|
|
|
statusName = "任务暂停";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
statusName = "新建任务";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
statusName = "任务下发";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
statusName = "重发";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
statusName = "执行中";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 10:
|
|
|
|
|
|
|
|
statusName = "任务完成";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 20:
|
|
|
|
|
|
|
|
statusName = "异常";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tableRow["StatusName"] = statusName;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_materialGridControl.BaseControl.BindDataSource = table;
|
|
|
|
_materialGridControl.BaseControl.BindDataSource = table;
|
|
|
|
|
|
|
|
|
|
|
|