保养
This commit is contained in:
parent
7e152e7585
commit
059e11f95d
@ -227,7 +227,7 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id">device_task_execute表的主键</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("bind_device/{id}")]
|
||||
[HttpGet("get_bind_device/{id}")]
|
||||
public IActionResult AchieveTaskbindDevice(string id)
|
||||
{
|
||||
|
||||
@ -245,14 +245,14 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// </summary>
|
||||
/// <param name="fk_device_id">device_rel_account_inspect表的fk_account_id 属性</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("bind_inspect/{fk_account_id}")]
|
||||
public IActionResult AchieveDevicebindInspect(int? fk_account_id)
|
||||
[HttpGet("get_bind_inspect")]
|
||||
public IActionResult AchieveDevicebindInspect(int? fk_account_id,string fkPlanId,int planType)
|
||||
{
|
||||
if (fk_account_id == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
var response = _DeviceTaskExecuteService.AchieveDevicebindInspect(fk_account_id ?? 0);
|
||||
var response = _DeviceTaskExecuteService.AchieveDevicebindInspect(fk_account_id ?? 0, fkPlanId, planType);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
@ -39,6 +39,12 @@ namespace DOAN.Model.MES.dev
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 1:检查 2:保养
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
|
||||
@ -12,6 +12,8 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
public string Name { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
|
||||
public int Type { get; set; }
|
||||
}
|
||||
public class DeviceInspectQueryDto2 : PagerInfo
|
||||
{
|
||||
@ -29,6 +31,8 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public int Isbind { get; set; }
|
||||
|
||||
public int Type { get; set; }
|
||||
|
||||
}
|
||||
public class DeviceInspectQueryDto3
|
||||
{
|
||||
@ -46,7 +50,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
public int Id { get; set; }
|
||||
public string Image { get; set; }
|
||||
|
||||
public string Type { get; set; }
|
||||
public int? Type { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
|
||||
@ -133,7 +133,7 @@ namespace DOAN.Service.JobKanban
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 完成工单
|
||||
/// 完成工单和报工
|
||||
/// </summary>
|
||||
/// <param name="workorder"></param>
|
||||
/// <param name="num">完成数量</param>
|
||||
|
||||
@ -32,7 +32,9 @@ namespace DOAN.Service.MES.dev
|
||||
var predicate = Expressionable.Create<DeviceInspect>();
|
||||
|
||||
predicate.AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
|
||||
.AndIF(parm.Status >= 0, it => it.Status == parm.Status);
|
||||
.AndIF(parm.Status >= 0, it => it.Status == parm.Status)
|
||||
.AndIF(parm.Type >= 0, it => it.Type == parm.Type)
|
||||
;
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
@ -53,10 +55,12 @@ namespace DOAN.Service.MES.dev
|
||||
{
|
||||
int[] binded = Context.Queryable<DeviceRelAccountInspect>()
|
||||
.Where(it => it.FkAccountId == parm.FkAccountId)
|
||||
|
||||
.Select(it => it.FkInspectId.Value).ToArray();
|
||||
|
||||
var exp = Expressionable.Create<DeviceInspect>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name),it=>it.Name.Contains(parm.Name))
|
||||
.AndIF(parm.Type > 0,it=>it.Type==parm.Type)
|
||||
.And(it=>it.Status==1);
|
||||
return Context.Queryable<DeviceInspect>()
|
||||
.Where(it => !binded.Contains(it.Id))
|
||||
@ -70,6 +74,7 @@ namespace DOAN.Service.MES.dev
|
||||
|
||||
var exp = Expressionable.Create<DeviceRelAccountInspect, DeviceInspect>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.Name), (r, i) => i.Name.Contains(parm.Name))
|
||||
.AndIF(parm.Type > 0, (r, i) => i.Type == parm.Type)
|
||||
.And((r, i) => i.Status == 1);
|
||||
// 获取绑定
|
||||
return Context.Queryable<DeviceRelAccountInspect>()
|
||||
|
||||
@ -419,14 +419,36 @@ namespace DOAN.Service.MES.dev
|
||||
/// <summary>
|
||||
/// 获取设备绑定的检查项
|
||||
/// </summary>
|
||||
public List<DeviceInspect> AchieveDevicebindInspect(int fk_device_id)
|
||||
/// <param name="fk_device_id">设备id</param>
|
||||
/// <param name="fkPlanId">计划id</param>
|
||||
/// <param name="planType">计划类型</param>
|
||||
/// <returns></returns>
|
||||
public List<DeviceInspect> AchieveDevicebindInspect(int fk_device_id, string fkPlanId, int planType)
|
||||
{
|
||||
|
||||
// 判断是保养/检查吗
|
||||
int check_type = 1;
|
||||
if(planType == 1)
|
||||
{
|
||||
check_type= Context.Queryable<DeviceRouteInspectionPlan>().Where(it => it.Id == fkPlanId)
|
||||
.Where(it => it.InnerType == planType).Select(it => it.InnerType.Value).First();
|
||||
|
||||
}else if (planType == 2)
|
||||
{
|
||||
check_type = Context.Queryable<DevicePointInspectionPlan>().Where(it => it.Id == fkPlanId)
|
||||
.Where(it => it.InnerType == planType).Select(it => it.InnerType.Value).First();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<DeviceInspect> resul = null;
|
||||
|
||||
resul = Context
|
||||
.Queryable<DeviceRelAccountInspect>()
|
||||
.LeftJoin<DeviceInspect>((r, i) => r.FkInspectId == i.Id)
|
||||
.Where(r => r.FkAccountId == fk_device_id)
|
||||
.Where((r,i)=>i.Type==check_type)
|
||||
.Select((r, i) => i)
|
||||
.ToList();
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ namespace DOAN.Service.MES.dev.IService
|
||||
|
||||
List<DeviceAccount> AchieveTaskbindDevice(string id);
|
||||
|
||||
List<DeviceInspect> AchieveDevicebindInspect(int fk_device_id);
|
||||
List<DeviceInspect> AchieveDevicebindInspect(int fk_device_id, string fkPlanId, int planType);
|
||||
|
||||
List<DeviceFormConfig> AchieveInspectbindForm(int fk_device_inspect_id);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user