安灯报警记录修改
This commit is contained in:
parent
dda5841865
commit
59d54b20a5
@ -19,17 +19,12 @@ namespace ZR.Model.MES.andon
|
||||
[SugarColumn(ColumnName = "alarm_code")]
|
||||
public string AlarmCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产线
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "line_code")]
|
||||
public string LineCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产线名称
|
||||
/// 报警类型编码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "line_name")]
|
||||
public string LineName { get; set; }
|
||||
[SugarColumn(ColumnName = "alarm_type_code")]
|
||||
public string AlarmTypeCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报警类型
|
||||
@ -112,8 +107,5 @@ namespace ZR.Model.MES.andon
|
||||
[SugarColumn(ColumnName = "updated_time")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
[SugarColumn(ColumnName = "sequcence")]
|
||||
public int Sequcence { get; set; }
|
||||
}
|
||||
}
|
||||
@ -21,9 +21,7 @@ namespace ZR.Model.MES.andon.Dto
|
||||
|
||||
public string AlarmCode { get; set; }
|
||||
|
||||
public string LineCode { get; set; }
|
||||
|
||||
public string LineName { get; set; }
|
||||
public string AlarmTypeCode { get; set; }
|
||||
|
||||
public string AlarmType { get; set; }
|
||||
|
||||
|
||||
@ -284,18 +284,18 @@ namespace ZR.Service.mes.andon
|
||||
public AndonAlarmRecord CreateAndonAlarmRecord(AndonAlarmRecord model)
|
||||
{
|
||||
string strDay = DateTime.Now.ToString("yyyyMMdd");
|
||||
int Sequcence = 1;
|
||||
int Sequence = 1;
|
||||
AndonAlarmRecord item = Queryable()
|
||||
.Where(it => it.AlarmCode.Contains(strDay)).OrderByDescending(it => it.Sequcence).First();
|
||||
.Where(it => it.AlarmCode.Contains(strDay)).OrderByDescending(it => it.Sequence).First();
|
||||
if (item != null)
|
||||
{
|
||||
Sequcence = item.Sequcence;
|
||||
Sequcence += 1;
|
||||
Sequence = (int)item.Sequence;
|
||||
Sequence += 1;
|
||||
}
|
||||
string formattedSequence = Sequcence.ToString("D4");
|
||||
string formattedSequence = Sequence.ToString("D4");
|
||||
string strAlarmCode = "Alarm" + strDay + formattedSequence;
|
||||
model.AlarmCode = strAlarmCode;
|
||||
model.Sequcence = Sequcence;
|
||||
model.Sequence = Sequence;
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user