update - 小修改

dep_nodyang
wangsr 1 year ago
parent 1f219d415c
commit c32d14d2f9

@ -169,6 +169,10 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
break;
case 2:
@ -237,6 +241,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
plc.PlcWriteByDataKey(plc.Plan1_Start, new object[] { 1 });
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
break;
case 3:
@ -292,6 +297,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
plc.PlcWriteByDataKey(plc.Plan2_Start, new object[] { 1 });
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
break;
case 4:
@ -352,6 +358,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
plc.PlcWriteByDataKey(plc.Plan3_Start, new object[] { 1 });
//把状态变成执行
LjPlanningDb.UpdateStatus(1, ljPlanningView.Id);
LjPlanningDb.UpdateBeginTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ljPlanningView.Id);
break;
}

@ -77,7 +77,7 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
/// <returns></returns>
public static int GetStatusById(int id)
{
string sql = $"select Id, No, Status from lj_planning where id={id}";
string sql = $"select Status from lj_planning where id={id}";
DataTable dt = GetTable(sql);
if (dt.Rows.Count == 1)
{
@ -94,11 +94,21 @@ namespace Mesnac.Action.ChemicalWeighing.LjPlanning
ExecuteNonQuery(sql);
return 1;
}
public static int UpdateBeginTime(string begTime, int id)
{
string sql = $"update lj_planning set BegTime='{begTime}' where id={id}";
ExecuteNonQuery(sql);
return 1;
}
//
public static LjPlanningView GetById(int id)
{
string sql = $"select Id, PlanNo, Status, CreateTime, UpdateTime, BegTime, EndTime, NumCar, Unit, Remark, IsEnable, FormulaId, FormulaName, PlanName, ClassName from lj_planning where Id = " + id;

Loading…
Cancel
Save