去除warn
This commit is contained in:
@@ -32,30 +32,30 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipDaqList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (input!=null && !string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
}
|
||||
var result = await db.Queryable<EqpDaq>()
|
||||
.LeftJoin<UserEntity>((a,b)=>a.create_id==b.Id)
|
||||
.Where(a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("data_source"),a=>a.data_source==queryJson["data_source"])
|
||||
.WhereIF(queryJson.ContainsKey("label_name"),a=>a.label_name.Contains(queryJson["label_name"]))
|
||||
.WhereIF(queryJson.ContainsKey("label_point"),a=>a.label_point.Contains(queryJson["label_point"]))
|
||||
.WhereIF(input!=null,a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("data_source"),a=>a.data_source==queryJson["data_source"])
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("label_name"),a=>a.label_name.Contains(queryJson["label_name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("label_point"),a=>a.label_point.Contains(queryJson["label_point"]))
|
||||
.Select((a,b) => new EquipDaqQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
data_source = a.data_source,
|
||||
create_id = b.RealName,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
data_type = a.data_type,
|
||||
enabled = a.enabled==1 ? "是" : "否",
|
||||
equip_id = a.equip_id,
|
||||
label_name = a.label_name,
|
||||
label_point = a.label_point,
|
||||
remark = a.remark
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
||||
|
||||
return PageResult<EquipDaqQueryOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipFileList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -89,14 +89,14 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<UserEntity >((a, b,c) => a.modify_id == c.Id)
|
||||
.LeftJoin<EqpEquipment >((a, b,c,d) => a.equip_id == d.id)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("file_name"),(a,b,c,d)=>a.file_name.Contains(queryJson["file_name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("file_name"),(a,b,c,d)=>a.file_name.Contains(queryJson["file_name"]))
|
||||
.Select((a, b, c,d) => new EquipFileQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_id = b.RealName,
|
||||
create_id_id = a.create_id,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
equip_id=d.name,
|
||||
equip_id_id= a.equip_id,
|
||||
file_name=a.file_name,
|
||||
|
||||
@@ -14,6 +14,7 @@ using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备备品备件
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
@@ -34,20 +35,23 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
List<EqpEquipSpareParts> oldList = await _repository.GetListAsync(x => x.equip_id == input.equip_id);
|
||||
List<EqpEquipSpareParts> list = new List<EqpEquipSpareParts>();
|
||||
string orgId = _userManager.GetUserInfo().Result.organizeId;
|
||||
foreach (var spare_parts_id in input.spare_parts_ids)
|
||||
string orgId = _userManager?.GetUserInfo().Result.organizeId ?? "";
|
||||
if (input != null && input.spare_parts_ids != null)
|
||||
{
|
||||
if (oldList.Any(x => x.spare_parts_id == spare_parts_id))
|
||||
continue;
|
||||
list.Add(new EqpEquipSpareParts()
|
||||
foreach (var spare_parts_id in input.spare_parts_ids)
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = input.equip_id,
|
||||
spare_parts_id = spare_parts_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = orgId,
|
||||
});
|
||||
if (oldList.Any(x => x.spare_parts_id == spare_parts_id))
|
||||
continue;
|
||||
list.Add(new EqpEquipSpareParts()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = input.equip_id,
|
||||
spare_parts_id = spare_parts_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
org_id = orgId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.InsertRangeAsync(list);
|
||||
@@ -57,7 +61,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipSparePartsList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -67,8 +71,8 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c) => c.EnCode == Tnb.BasicData.DictConst.SparePartsType && c.DeleteMark == null)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b,c,d) => d.DictionaryTypeId == c.Id && b.type_id == d.EnCode)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("code"),(a,b,c,d)=>b.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson.ContainsKey("name"),(a,b,c,d)=>b.name.Contains(queryJson["name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>b.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>b.name.Contains(queryJson["name"]))
|
||||
.Select((a, b, c,d) => new EquipSparePartsQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetRepairRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -156,7 +156,7 @@ namespace Tnb.EquipMgr
|
||||
is_ugent = a.is_ugent==1 ? "是" : "否",
|
||||
description = a.description,
|
||||
repair_description = a.repair_description,
|
||||
complete_time = a.complete_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
complete_time = a.complete_time==null ? null : a.complete_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repairer_id = c.RealName
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 维修延期
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Delay(RepairDelayInput input)
|
||||
{
|
||||
@@ -43,7 +42,7 @@ namespace Tnb.EquipMgr
|
||||
EqpRepairDelay repairDelay = new EqpRepairDelay()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
equip_id = eqpRepairApply.equip_id,
|
||||
equip_id = eqpRepairApply?.equip_id ?? "",
|
||||
repair_apply_id = input.repair_apply_id,
|
||||
delay_reason = input.delay_reason,
|
||||
expected_time = input.expected_time,
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.id))
|
||||
{
|
||||
_flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
await _flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
@@ -127,26 +127,30 @@ namespace Tnb.EquipMgr
|
||||
else
|
||||
{
|
||||
var entity = await _repository.GetSingleAsync(x=>x.id==input.id);
|
||||
_flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
if (entity != null)
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity.flow_task_id,
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
await _flowTaskService.Update("",new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
id = entity?.flow_task_id??"",
|
||||
formData = new JObject()
|
||||
{
|
||||
{"id",id},
|
||||
{"repair_apply_id",input.repair_apply_id},
|
||||
{"equip_id",input.equip_id},
|
||||
{"create_id",_userManager.UserId},
|
||||
{"supplier_id",input.supplier_id},
|
||||
{"estimated_cost",input.estimated_cost},
|
||||
{"construction_period_requirement",input.construction_period_requirement},
|
||||
{"out_apply_reason",input.out_apply_reason},
|
||||
{"remark",input.remark},
|
||||
{"approve_status",RepairOutApplyStatus.TOBEAPPROVE},
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.IsSuccess ? "操作成功" : result.ErrorMessage;
|
||||
|
||||
@@ -37,19 +37,22 @@ namespace Tnb.EquipMgr
|
||||
throw Oops.Bah("该设备已存在检验计划");
|
||||
}
|
||||
|
||||
if (entity.warn_unit == "1")//月
|
||||
if (entity != null)
|
||||
{
|
||||
entity.next_check_time = entity.end_time.Value.AddMonths(-entity.warm_time.Value);
|
||||
}else if (entity.warn_unit == "2")//天
|
||||
{
|
||||
entity.next_check_time = entity.end_time.Value.AddDays(-entity.warm_time.Value);
|
||||
}
|
||||
if (entity.warn_unit == "1")//月
|
||||
{
|
||||
entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value);
|
||||
}else if (entity.warn_unit == "2")//天
|
||||
{
|
||||
entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value);
|
||||
}
|
||||
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
entity.create_time = DateTime.Now;
|
||||
entity.create_id = _userManager.UserId;
|
||||
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.InsertAsync(entity);
|
||||
entity.id = SnowflakeIdHelper.NextId();
|
||||
entity.create_time = DateTime.Now;
|
||||
entity.create_id = _userManager.UserId;
|
||||
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
|
||||
await _repository.InsertAsync(entity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
@@ -86,7 +85,7 @@ namespace Tnb.EquipMgr
|
||||
EqpSpotInsTemEquipD eqpSpotInsTemEquipD = new EqpSpotInsTemEquipD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
spot_ins_item_id = eqpSpotInsTem.spot_ins_item_id,
|
||||
spot_ins_item_id = eqpSpotInsTem?.spot_ins_item_id ?? "",
|
||||
spot_ins_tem_equip_id = id,
|
||||
};
|
||||
insertEqpSpotInsTemEquipDs.Add(eqpSpotInsTemEquipD);
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetSubEquipList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -43,19 +43,19 @@ namespace Tnb.EquipMgr
|
||||
.LeftJoin<UserEntity >((a, b,c) => a.modify_id == c.Id)
|
||||
.LeftJoin<EqpEquipment >((a, b,c,d) => a.equip_id == d.id)
|
||||
.Where((a,b,c,d)=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("code"),(a,b,c,d)=>a.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson.ContainsKey("name"),(a,b,c,d)=>a.name.Contains(queryJson["name"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("code"),(a,b,c,d)=>a.code.Contains(queryJson["code"]))
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),(a,b,c,d)=>a.name.Contains(queryJson["name"]))
|
||||
.Select((a, b, c,d) => new SubEquipQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
create_id = b.RealName,
|
||||
create_id_id = a.create_id,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd"),
|
||||
equip_id=d.name,
|
||||
equip_id_id= a.equip_id,
|
||||
code = a.code,
|
||||
modify_id = c.RealName,
|
||||
modify_time = a.modify_time.Value.ToString("yyyy-MM-dd"),
|
||||
modify_time = a.modify_time==null ? null : a.modify_time.Value.ToString("yyyy-MM-dd"),
|
||||
name = a.name,
|
||||
org_id = a.org_id,
|
||||
specification = a.specification,
|
||||
|
||||
@@ -31,21 +31,21 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetEquipTechnologyParameterList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (input!=null && !string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input?.queryJson ?? "");
|
||||
}
|
||||
var result = await db.Queryable<EqpTechnologyParameter>()
|
||||
.Where(a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson["name"]))
|
||||
.WhereIF(input!=null,a=>a.equip_id==input.equip_id)
|
||||
.WhereIF(queryJson!=null && queryJson.ContainsKey("name"),a=>a.name.Contains(queryJson["name"]))
|
||||
.Select(a => new EquipTechnologyParameterQueryOutput
|
||||
{
|
||||
id = a.id,
|
||||
name = a.name,
|
||||
definition = a.definition,
|
||||
remark = a.remark
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
}).ToPagedListAsync((input?.currentPage??1), (input?.pageSize??50));
|
||||
|
||||
return PageResult<EquipTechnologyParameterQueryOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 执行设备保养计划
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> ExecuteMaintain(SpotInsRecordExecuteInput input)
|
||||
@@ -75,13 +74,16 @@ namespace Tnb.EquipMgr
|
||||
execute_user_id = _userManager.UserId
|
||||
}, x => x.id == input.id);
|
||||
|
||||
foreach (var item in input.details)
|
||||
if (input != null && input.details != null)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item.ContainsKey("maintain_descrip"),x=>x.maintain_descrip==item["maintain_descrip"])
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item.ContainsKey("maintain_descrip"),x=>x.maintain_descrip==item["maintain_descrip"])
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +116,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 复核设备保养计划
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<string> RepeatMaintain(MaintainRecordRepeatInput input)
|
||||
@@ -123,22 +124,28 @@ namespace Tnb.EquipMgr
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
|
||||
foreach (var item in input.details)
|
||||
if (input != null && input.details != null)
|
||||
{
|
||||
await db.Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x => x.repeat_descrip == item["repeat_descrip"])
|
||||
.SetColumns(x => x.repeat_result == item["repeat_result"])
|
||||
.Where(x => x.id == item["id"]).ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await db.Updateable<EqpMaintainRecordD>()
|
||||
.SetColumns(x => x.repeat_descrip == item["repeat_descrip"])
|
||||
.SetColumns(x => x.repeat_result == item["repeat_result"])
|
||||
.Where(x => x.id == item["id"]).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
await _repository.UpdateAsync(x => new EqpMaintainRecordH()
|
||||
|
||||
if (input != null)
|
||||
{
|
||||
repeat_result = input.repeat_result,
|
||||
repeat_remark = input.repeat_remark,
|
||||
repeat_user_id = _userManager.UserId,
|
||||
repeat_time = DateTime.Now,
|
||||
status = SpotInsRecordExecutionStatus.COMPLETED
|
||||
}, x => x.id == input.id);
|
||||
await _repository.UpdateAsync(x => new EqpMaintainRecordH()
|
||||
{
|
||||
repeat_result = input.repeat_result,
|
||||
repeat_remark = input.repeat_remark,
|
||||
repeat_user_id = _userManager.UserId,
|
||||
repeat_time = DateTime.Now,
|
||||
status = SpotInsRecordExecutionStatus.COMPLETED
|
||||
}, x => x.id == input.id);
|
||||
}
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
@@ -149,7 +156,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetMaintainRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -163,17 +170,17 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
equip_id = b.code,
|
||||
equip_id_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_user_id = d.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
maintain_tem_equip_id = a.maintain_tem_equip_id,
|
||||
execute_time = a.execute_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
execute_time = a.execute_time==null ? null : a.execute_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
execute_user_id = c.RealName,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 执行点巡检
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> ExecuteSpotIns(SpotInsRecordExecuteInput input)
|
||||
@@ -75,13 +74,16 @@ namespace Tnb.EquipMgr
|
||||
spot_record_user_id = _userManager.UserId
|
||||
}, x => x.id == input.id);
|
||||
|
||||
foreach (var item in input.details)
|
||||
if(input!=null && input.details!=null)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpSpotInsRecordD>().
|
||||
SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item["judge_type"]=="1",x=>x.real_value==Convert.ToDouble(item["real_value"]))
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
foreach (var item in input.details)
|
||||
{
|
||||
await _repository.AsSugarClient().Updateable<EqpSpotInsRecordD>().
|
||||
SetColumns(x=>x.result==item["result"])
|
||||
.SetColumnsIF(item["judge_type"]=="1",x=>x.real_value==Convert.ToDouble(item["real_value"]))
|
||||
.Where(x=>x.id==item["id"])
|
||||
.ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +116,6 @@ namespace Tnb.EquipMgr
|
||||
/// <summary>
|
||||
/// 复核点巡检
|
||||
/// </summary>
|
||||
/// <param name="pageInput"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task RepeatSpotIns(SpotInsRecordRepeatInput input)
|
||||
@@ -133,7 +134,7 @@ namespace Tnb.EquipMgr
|
||||
public async Task<dynamic> GetSpotInsRecordList(EquipQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
Dictionary<string, string> queryJson = new Dictionary<string, string>();
|
||||
Dictionary<string, string>? queryJson = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(input.queryJson))
|
||||
{
|
||||
queryJson = JsonConvert.DeserializeObject<Dictionary<string, string>>(input.queryJson);
|
||||
@@ -145,16 +146,16 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
id = a.id,
|
||||
attachment = a.attachment,
|
||||
create_time = a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
create_time = a.create_time==null ? null : a.create_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
equip_id = a.equip_id,
|
||||
repeat_remark = a.repeat_remark,
|
||||
repeat_result = a.repeat_result=="1"?"合格":"不合格",
|
||||
repeat_time = a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_time = a.repeat_time==null ? null : a.repeat_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
repeat_user_id = b.RealName,
|
||||
result = a.result=="1"?"合格":"不合格",
|
||||
result_remark = a.result_remark,
|
||||
spot_ins_tem_equip_id = a.spot_ins_tem_equip_id,
|
||||
spot_record_date_time = a.spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
spot_record_date_time = a.spot_record_date_time==null ? null :a.spot_record_date_time.Value.ToString("yyyy-MM-dd HH:mm"),
|
||||
spot_record_user_id = a.spot_record_user_id,
|
||||
status = SqlFunc.IF(a.status.Equals("1")).Return("待执行").ElseIF(a.status.Equals("2")).Return("待复核").ElseIF(a.status.Equals("3")).Return("已完成").End("")
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
Reference in New Issue
Block a user