FkTaskId修改
This commit is contained in:
parent
cab818ef5b
commit
b0b7951f19
@ -18,6 +18,12 @@ namespace DOAN.Model.MES.dev
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "fk_task_id")]
|
||||
public string FkTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划类型(1是巡检,2是点检)
|
||||
/// </summary>
|
||||
|
||||
@ -12,6 +12,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// 任务名称
|
||||
/// </summary>
|
||||
public string TaskName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 时间范围
|
||||
/// </summary>
|
||||
@ -26,29 +27,32 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class DeviceTaskExecuteQueryDto2
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public int Status { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime UpdatedTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询表单结果
|
||||
/// </summary>
|
||||
public class DeviceTaskExecuteResult1QueryDto_TaskExecute
|
||||
{
|
||||
/// <summary>
|
||||
/// 任务id
|
||||
/// </summary>
|
||||
public string FkTaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 类型 (巡检、点检)
|
||||
/// </summary>
|
||||
public int? PlanType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 巡检计划或者点检计划id
|
||||
/// </summary>
|
||||
@ -85,10 +89,8 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
public string Value { get; set; }
|
||||
|
||||
public string[] Children { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 任务执行输入输出对象
|
||||
/// </summary>
|
||||
@ -130,7 +132,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
|
||||
[ExcelColumn(Name = "执行人")]
|
||||
[ExcelColumnName("执行人")]
|
||||
public string Person { get; set; }
|
||||
public string Person { get; set; }
|
||||
|
||||
[ExcelColumn(Name = "备注")]
|
||||
[ExcelColumnName("备注")]
|
||||
@ -151,8 +153,5 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
[ExcelColumn(Name = "更新时间", Format = "yyyy-MM-dd HH:mm:ss")]
|
||||
[ExcelColumnName("更新时间")]
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,26 +606,30 @@ namespace DOAN.Service.MES.dev
|
||||
.ToList();
|
||||
|
||||
int?[] config_type = all_config_list.Select(it => it.Type).Distinct().ToArray();
|
||||
DevicePointInspectionPlan handle_point_plan = Context.Queryable<DevicePointInspectionPlan>()
|
||||
.Where(it => it.Id == query.FkPlanId)
|
||||
.First();
|
||||
DeviceRouteInspectionPlan handle_rounte_plan= Context.Queryable<DeviceRouteInspectionPlan>()
|
||||
.Where(it => it.Id == query.FkPlanId)
|
||||
.First();
|
||||
DeviceAccount deviceAccount= Context.Queryable<DeviceAccount>()
|
||||
.Where(it => it.Id == query.FkDeviceId)
|
||||
.First();
|
||||
DeviceInspect inspect = Context.Queryable<DeviceInspect>()
|
||||
.Where(it => it.Id == query.FkInspectId)
|
||||
.First();
|
||||
DevicePointInspectionPlan handle_point_plan = Context
|
||||
.Queryable<DevicePointInspectionPlan>()
|
||||
.Where(it => it.Id == query.FkPlanId)
|
||||
.First();
|
||||
DeviceRouteInspectionPlan handle_rounte_plan = Context
|
||||
.Queryable<DeviceRouteInspectionPlan>()
|
||||
.Where(it => it.Id == query.FkPlanId)
|
||||
.First();
|
||||
DeviceAccount deviceAccount = Context
|
||||
.Queryable<DeviceAccount>()
|
||||
.Where(it => it.Id == query.FkDeviceId)
|
||||
.First();
|
||||
DeviceInspect inspect = Context
|
||||
.Queryable<DeviceInspect>()
|
||||
.Where(it => it.Id == query.FkInspectId)
|
||||
.First();
|
||||
if (config_type.Length > 0)
|
||||
{
|
||||
for (int i = 0; i < config_type.Length; i++)
|
||||
{
|
||||
|
||||
//在结果表里查看是否有结果
|
||||
DeviceTaskExecuteResult executeResult = Context
|
||||
.Queryable<DeviceTaskExecuteResult>()
|
||||
.Where(it => it.FkTaskId == query.FkTaskId)
|
||||
.Where(it => it.PlanType == query.PlanType)
|
||||
.Where(it => it.FkPlanId == query.FkPlanId)
|
||||
.Where(it => it.FkDeviceId == query.FkDeviceId)
|
||||
@ -636,25 +640,29 @@ namespace DOAN.Service.MES.dev
|
||||
if (executeResult != null)
|
||||
{
|
||||
DeviceTaskExecuteResult1_result item =
|
||||
new DeviceTaskExecuteResult1_result();
|
||||
|
||||
item.Id = executeResult.Id;
|
||||
item.Title = executeResult.FormTitle;
|
||||
item.Value = executeResult.FormName;
|
||||
item.Type = executeResult.FormType;
|
||||
item.Children = all_config_list
|
||||
.Where(it => it.Type == config_type[i])
|
||||
.Select(it => it.Content)
|
||||
.ToArray();
|
||||
new()
|
||||
{
|
||||
Id = executeResult.Id,
|
||||
Title = executeResult.FormTitle,
|
||||
Value = executeResult.FormName,
|
||||
Type = executeResult.FormType,
|
||||
Children = all_config_list
|
||||
.Where(it => it.Type == config_type[i])
|
||||
.Select(it => it.Content)
|
||||
.ToArray()
|
||||
};
|
||||
final_result_list.Add(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeviceTaskExecuteResult insertData = new DeviceTaskExecuteResult();
|
||||
|
||||
insertData.Id = SnowFlakeSingle.Instance.NextId().ToString();
|
||||
insertData.PlanType = query.PlanType;
|
||||
insertData.FkPlanId = query.FkPlanId;
|
||||
DeviceTaskExecuteResult insertData =
|
||||
new()
|
||||
{
|
||||
Id = SnowFlakeSingle.Instance.NextId().ToString(),
|
||||
FkTaskId = query.FkTaskId,
|
||||
PlanType = query.PlanType,
|
||||
FkPlanId = query.FkPlanId
|
||||
};
|
||||
//点检
|
||||
if (query.PlanType == 2)
|
||||
{
|
||||
@ -669,7 +677,7 @@ namespace DOAN.Service.MES.dev
|
||||
|
||||
insertData.InnerType = handle_rounte_plan?.InnerType;
|
||||
}
|
||||
|
||||
|
||||
insertData.FkDeviceId = query.FkDeviceId;
|
||||
insertData.DeviceName = deviceAccount.DeviceName;
|
||||
insertData.FkInspectId = query.FkInspectId;
|
||||
@ -682,16 +690,17 @@ namespace DOAN.Service.MES.dev
|
||||
|
||||
Context.Insertable(insertData).ExecuteReturnIdentity();
|
||||
DeviceTaskExecuteResult1_result item =
|
||||
new DeviceTaskExecuteResult1_result();
|
||||
|
||||
item.Id = insertData.Id;
|
||||
item.Title = insertData.FormTitle;
|
||||
item.Value = "";
|
||||
item.Type = insertData.FormType;
|
||||
item.Children = all_config_list
|
||||
.Where(it => it.Type == config_type[i])
|
||||
.Select(it => it.Content)
|
||||
.ToArray();
|
||||
new()
|
||||
{
|
||||
Id = insertData.Id,
|
||||
Title = insertData.FormTitle,
|
||||
Value = "",
|
||||
Type = insertData.FormType,
|
||||
Children = all_config_list
|
||||
.Where(it => it.Type == config_type[i])
|
||||
.Select(it => it.Content)
|
||||
.ToArray()
|
||||
};
|
||||
final_result_list.Add(item);
|
||||
}
|
||||
}
|
||||
@ -725,7 +734,7 @@ namespace DOAN.Service.MES.dev
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public int AddDeviceTaskExecute(string Id,string name)
|
||||
public int AddDeviceTaskExecute(string Id, string name)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now;
|
||||
return Context
|
||||
@ -733,7 +742,7 @@ namespace DOAN.Service.MES.dev
|
||||
.Where(it => it.Id == Id)
|
||||
.Where(it => it.StartTime == null)
|
||||
.SetColumns(it => it.StartTime == dateTime)
|
||||
.SetColumns (it => it.Person == name)
|
||||
.SetColumns(it => it.Person == name)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user