diff --git a/DOAN.Admin.WebApi/Controllers/MES/dev/DeviceTaskExecuteController.cs b/DOAN.Admin.WebApi/Controllers/MES/dev/DeviceTaskExecuteController.cs
index 76dc5a6..03c4d9e 100644
--- a/DOAN.Admin.WebApi/Controllers/MES/dev/DeviceTaskExecuteController.cs
+++ b/DOAN.Admin.WebApi/Controllers/MES/dev/DeviceTaskExecuteController.cs
@@ -227,7 +227,7 @@ namespace DOAN.Admin.WebApi.Controllers
///
/// device_task_execute表的主键
///
- [HttpGet("bind_device/{id}")]
+ [HttpGet("get_bind_device/{id}")]
public IActionResult AchieveTaskbindDevice(string id)
{
@@ -245,14 +245,14 @@ namespace DOAN.Admin.WebApi.Controllers
///
/// device_rel_account_inspect表的fk_account_id 属性
///
- [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);
}
diff --git a/DOAN.Model/MES/dev/DeviceInspect.cs b/DOAN.Model/MES/dev/DeviceInspect.cs
index f3e174b..85f24a8 100644
--- a/DOAN.Model/MES/dev/DeviceInspect.cs
+++ b/DOAN.Model/MES/dev/DeviceInspect.cs
@@ -39,6 +39,12 @@ namespace DOAN.Model.MES.dev
///
public string Name { get; set; }
+ ///
+ /// 1:检查 2:保养
+ ///
+ [SugarColumn(ColumnName = "type")]
+ public int Type { get; set; }
+
///
/// 创建人
///
diff --git a/DOAN.Model/MES/dev/Dto/DeviceInspectDto.cs b/DOAN.Model/MES/dev/Dto/DeviceInspectDto.cs
index fd81b1a..4025e9b 100644
--- a/DOAN.Model/MES/dev/Dto/DeviceInspectDto.cs
+++ b/DOAN.Model/MES/dev/Dto/DeviceInspectDto.cs
@@ -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
///
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; }
diff --git a/DOAN.Service/JobKanban/LoginOrSetService.cs b/DOAN.Service/JobKanban/LoginOrSetService.cs
index d603d24..551cf97 100644
--- a/DOAN.Service/JobKanban/LoginOrSetService.cs
+++ b/DOAN.Service/JobKanban/LoginOrSetService.cs
@@ -133,7 +133,7 @@ namespace DOAN.Service.JobKanban
}
///
- /// 完成工单
+ /// 完成工单和报工
///
///
/// 完成数量
diff --git a/DOAN.Service/MES/dev/DeviceInspectService.cs b/DOAN.Service/MES/dev/DeviceInspectService.cs
index 4b5373c..3fba469 100644
--- a/DOAN.Service/MES/dev/DeviceInspectService.cs
+++ b/DOAN.Service/MES/dev/DeviceInspectService.cs
@@ -32,7 +32,9 @@ namespace DOAN.Service.MES.dev
var predicate = Expressionable.Create();
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()
.Where(it => it.FkAccountId == parm.FkAccountId)
+
.Select(it => it.FkInspectId.Value).ToArray();
var exp = Expressionable.Create()
.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()
.Where(it => !binded.Contains(it.Id))
@@ -70,6 +74,7 @@ namespace DOAN.Service.MES.dev
var exp = Expressionable.Create()
.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()
diff --git a/DOAN.Service/MES/dev/DeviceTaskExecuteService.cs b/DOAN.Service/MES/dev/DeviceTaskExecuteService.cs
index af0a17c..9feb8fb 100644
--- a/DOAN.Service/MES/dev/DeviceTaskExecuteService.cs
+++ b/DOAN.Service/MES/dev/DeviceTaskExecuteService.cs
@@ -419,14 +419,36 @@ namespace DOAN.Service.MES.dev
///
/// 获取设备绑定的检查项
///
- public List AchieveDevicebindInspect(int fk_device_id)
+ /// 设备id
+ /// 计划id
+ /// 计划类型
+ ///
+ public List AchieveDevicebindInspect(int fk_device_id, string fkPlanId, int planType)
{
+
+ // 判断是保养/检查吗
+ int check_type = 1;
+ if(planType == 1)
+ {
+ check_type= Context.Queryable().Where(it => it.Id == fkPlanId)
+ .Where(it => it.InnerType == planType).Select(it => it.InnerType.Value).First();
+
+ }else if (planType == 2)
+ {
+ check_type = Context.Queryable().Where(it => it.Id == fkPlanId)
+ .Where(it => it.InnerType == planType).Select(it => it.InnerType.Value).First();
+
+ }
+
+
+
List resul = null;
resul = Context
.Queryable()
.LeftJoin((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();
diff --git a/DOAN.Service/MES/dev/IService/IDeviceTaskExecuteService.cs b/DOAN.Service/MES/dev/IService/IDeviceTaskExecuteService.cs
index 469f432..b041621 100644
--- a/DOAN.Service/MES/dev/IService/IDeviceTaskExecuteService.cs
+++ b/DOAN.Service/MES/dev/IService/IDeviceTaskExecuteService.cs
@@ -34,7 +34,7 @@ namespace DOAN.Service.MES.dev.IService
List AchieveTaskbindDevice(string id);
- List AchieveDevicebindInspect(int fk_device_id);
+ List AchieveDevicebindInspect(int fk_device_id, string fkPlanId, int planType);
List AchieveInspectbindForm(int fk_device_inspect_id);