质检任务
This commit is contained in:
@@ -71,10 +71,10 @@ namespace Tnb.QcMgr.Entities.Dto
|
|||||||
}
|
}
|
||||||
public class Data {
|
public class Data {
|
||||||
public string extype { get; set; }
|
public string extype { get; set; }
|
||||||
public string excontent { get; set; }
|
public Excontent excontent { get; set; }
|
||||||
public string check { get; set; }
|
public string check { get; set; }
|
||||||
public string[] errorcause { get; set; }
|
public string[] errorcause { get; set; }
|
||||||
public string errorlevel { get; set; }
|
public string[] errorlevel { get; set; }
|
||||||
public string remark { get; set; }
|
public string remark { get; set; }
|
||||||
public string attachment { get; set; }
|
public string attachment { get; set; }
|
||||||
public string customer { get; set; }
|
public string customer { get; set; }
|
||||||
|
|||||||
@@ -75,10 +75,10 @@ namespace Tnb.QcMgr.Entities
|
|||||||
public class PlanItemData
|
public class PlanItemData
|
||||||
{
|
{
|
||||||
public string extype { get; set; }
|
public string extype { get; set; }
|
||||||
public string excontent { get; set; }
|
public Excontent excontent { get; set; }
|
||||||
public string check { get; set; }
|
public string check { get; set; }
|
||||||
public string[] errorcause { get; set; }
|
public string[] errorcause { get; set; }
|
||||||
public string errorlevel { get; set; }
|
public string[] errorlevel { get; set; }
|
||||||
public string remark { get; set; }
|
public string remark { get; set; }
|
||||||
public string attachment { get; set; }
|
public string attachment { get; set; }
|
||||||
public string customer { get; set; }
|
public string customer { get; set; }
|
||||||
|
|||||||
115
QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs
Normal file
115
QcMgr/Tnb.QcMgr.Entities/Dto/CheckTask.cs
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Entities.Dto
|
||||||
|
{
|
||||||
|
public class CheckTaskOut
|
||||||
|
{
|
||||||
|
public string mainid { get; set; }
|
||||||
|
public string workid { get; set; }
|
||||||
|
public string workname { get; set; }
|
||||||
|
public string wareid { get; set; }
|
||||||
|
public List<CheckExecTypeOut> checktypes { get; set; }
|
||||||
|
}
|
||||||
|
public class CheckExecTypeOut
|
||||||
|
{
|
||||||
|
public string checktypeid { get; set; }
|
||||||
|
public string checktypename { get; set; }
|
||||||
|
public List<ExecItemOut> items { get; set; }
|
||||||
|
}
|
||||||
|
public class ExecItemOut
|
||||||
|
{
|
||||||
|
public string itemid { get; set; }
|
||||||
|
public string code { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public string itemdid { get; set; }
|
||||||
|
public ExecItemShow setShow { get; set; }
|
||||||
|
public ExecItemData setData { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
public class ExecItemShow
|
||||||
|
{
|
||||||
|
public bool extype { get; set; }
|
||||||
|
public bool excontent { get; set; }
|
||||||
|
public bool check { get; set; }
|
||||||
|
public bool errorcause { get; set; }
|
||||||
|
public bool errorlevel { get; set; }
|
||||||
|
public bool remark { get; set; }
|
||||||
|
public bool attachment { get; set; }
|
||||||
|
public bool customer { get; set; }
|
||||||
|
public bool isexec { get; set; }
|
||||||
|
}
|
||||||
|
public class ExecItemData
|
||||||
|
{
|
||||||
|
public string extype { get; set; }
|
||||||
|
public Excontent excontent { get; set; }
|
||||||
|
public string check { get; set; }
|
||||||
|
public List<Error> errorcause { get; set; }
|
||||||
|
public List<Error> errorlevel { get; set; }
|
||||||
|
public string remark { get; set; }
|
||||||
|
public string attachment { get; set; }
|
||||||
|
public string customer { get; set; }
|
||||||
|
public IsexecE isexec { get; set; }
|
||||||
|
}
|
||||||
|
public class Excontent
|
||||||
|
{
|
||||||
|
public string excontentType { get; set; }
|
||||||
|
public string excontentNum { get; set; }
|
||||||
|
public string amongMaxNum { get; set; }
|
||||||
|
public string amongMinNum { get; set; }
|
||||||
|
public string amongMinUnit { get; set; }
|
||||||
|
public string gapValue { get; set; }
|
||||||
|
public string greaterThanValue { get; set; }
|
||||||
|
public string lessThanValue { get; set; }
|
||||||
|
public string excontentText { get; set; }
|
||||||
|
public List<ExcontentOption> excontentOptions { get; set; }
|
||||||
|
}
|
||||||
|
public class ExcontentOption
|
||||||
|
{
|
||||||
|
public string value { get; set; }
|
||||||
|
}
|
||||||
|
public class Error
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
}
|
||||||
|
public class IsexecE
|
||||||
|
{
|
||||||
|
public bool remark { get; set; }
|
||||||
|
public bool attachment { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CheckTaskInput
|
||||||
|
{
|
||||||
|
public string mainid { get; set; }
|
||||||
|
public string checknum { get; set; }
|
||||||
|
public string status { get; set; }
|
||||||
|
public string result { get; set; }
|
||||||
|
|
||||||
|
public List<CheckExexTypeInput> checktypes { get; set; }
|
||||||
|
}
|
||||||
|
public class CheckExexTypeInput
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public List<ExecItemInput> items { get; set; }
|
||||||
|
}
|
||||||
|
public class ExecItemInput
|
||||||
|
{
|
||||||
|
public string itemdid { get; set; }
|
||||||
|
|
||||||
|
public string itemid { get; set; }
|
||||||
|
public string extype { get; set; }
|
||||||
|
public string excontent { get; set; }
|
||||||
|
public string check { get; set; }
|
||||||
|
public string errorcause { get; set; }
|
||||||
|
public string errorlevel { get; set; }
|
||||||
|
public string remark { get; set; }
|
||||||
|
public string attachment { get; set; }
|
||||||
|
public string isexec { get; set; }
|
||||||
|
public string customer { get; set; }
|
||||||
|
public string result { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
108
QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs
Normal file
108
QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecD.cs
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Entities
|
||||||
|
{/// <summary>
|
||||||
|
/// 质检执行子表
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("qc_check_exec_d")]
|
||||||
|
public partial class QcCheckExecD : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public QcCheckExecD()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 质检执行主表编号
|
||||||
|
/// </summary>
|
||||||
|
public string? mainid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行项格式
|
||||||
|
/// </summary>
|
||||||
|
public string? extype { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行项内容
|
||||||
|
/// </summary>
|
||||||
|
public string? excontent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 抽检类型
|
||||||
|
/// </summary>
|
||||||
|
public string? check { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不良原因
|
||||||
|
/// </summary>
|
||||||
|
public string? errorcause { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不良等级
|
||||||
|
/// </summary>
|
||||||
|
public string? errorlevel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 附件
|
||||||
|
/// </summary>
|
||||||
|
public string? attachment { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行时操作
|
||||||
|
/// </summary>
|
||||||
|
public string? isexec { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 客户
|
||||||
|
/// </summary>
|
||||||
|
public string? custom { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质检项分类编号
|
||||||
|
/// </summary>
|
||||||
|
public string? typeid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质检项编号
|
||||||
|
/// </summary>
|
||||||
|
public string? itemid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 结论
|
||||||
|
/// </summary>
|
||||||
|
public string? result { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
102
QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs
Normal file
102
QcMgr/Tnb.QcMgr.Entities/Entity/QcCheckExecH.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Entities
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质检执行主表
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("qc_check_exec_h")]
|
||||||
|
public partial class QcCheckExecH : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public QcCheckExecH()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 物料编号
|
||||||
|
/// </summary>
|
||||||
|
public string? materialid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质检类型
|
||||||
|
/// </summary>
|
||||||
|
public string? checktype { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工序编号
|
||||||
|
/// </summary>
|
||||||
|
public string? processid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工位编号
|
||||||
|
/// </summary>
|
||||||
|
public string? workid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 仓库库位编号
|
||||||
|
/// </summary>
|
||||||
|
public string? wareid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 抽样数
|
||||||
|
/// </summary>
|
||||||
|
public string? checknum { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public string? status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 结论
|
||||||
|
/// </summary>
|
||||||
|
public string? result { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 任务生成时间
|
||||||
|
/// </summary>
|
||||||
|
public string? tasktime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 质检人
|
||||||
|
/// </summary>
|
||||||
|
public string? execuser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行时间
|
||||||
|
/// </summary>
|
||||||
|
public string? exectime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扩展
|
||||||
|
/// </summary>
|
||||||
|
public string? extras { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
69
QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs
Normal file
69
QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorCause.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Entities
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 不良原因字典
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("qc_error_cause")]
|
||||||
|
public partial class QcErrorCause : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public QcErrorCause()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 编号
|
||||||
|
/// </summary>
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public string? status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扩展
|
||||||
|
/// </summary>
|
||||||
|
public string? extras { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
67
QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs
Normal file
67
QcMgr/Tnb.QcMgr.Entities/Entity/QcErrorLevel.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using JNPF.Common.Contracts;
|
||||||
|
using JNPF.Common.Security;
|
||||||
|
using SqlSugar;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Entities.Entity
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 不良等级
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("qc_error_level")]
|
||||||
|
public partial class QcErrorLevel : BaseEntity<string>
|
||||||
|
{
|
||||||
|
public QcErrorLevel()
|
||||||
|
{
|
||||||
|
id = SnowflakeIdHelper.NextId();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 编号
|
||||||
|
/// </summary>
|
||||||
|
public string? code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string? name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 状态
|
||||||
|
/// </summary>
|
||||||
|
public string? status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string? remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建用户
|
||||||
|
/// </summary>
|
||||||
|
public string? create_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? create_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改用户
|
||||||
|
/// </summary>
|
||||||
|
public string? modify_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 修改时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime? modify_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扩展
|
||||||
|
/// </summary>
|
||||||
|
public string? extras { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
26
QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs
Normal file
26
QcMgr/Tnb.QcMgr.Interfaces/IQcCheckTaskService.cs
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Tnb.QcMgr.Entities.Dto;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr.Interfaces
|
||||||
|
{
|
||||||
|
public interface IQcCheckTaskService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取任务执行明细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task<dynamic> GetTaskItems(string id);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="CheckTaskInput"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task SaveData(CheckTaskInput CheckTaskInput);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -148,11 +148,12 @@ namespace Tnb.QcMgr
|
|||||||
Item.name = QcCheckItems.Where(p => p.id == QcCheckItemsR.itemid).First().name!;
|
Item.name = QcCheckItems.Where(p => p.id == QcCheckItemsR.itemid).First().name!;
|
||||||
Item.setData = new Data();
|
Item.setData = new Data();
|
||||||
Item.setData.extype = item.extype!;
|
Item.setData.extype = item.extype!;
|
||||||
Item.setData.excontent = item.excontent!;
|
Item.setData.excontent = JSON.Deserialize<Excontent>(item.excontent!);
|
||||||
Item.setData.check = item.check!;
|
Item.setData.check = item.check!;
|
||||||
if (!string.IsNullOrEmpty(item.errorcause))
|
if (!string.IsNullOrEmpty(item.errorcause))
|
||||||
Item.setData.errorcause = item.errorcause!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
Item.setData.errorcause = item.errorcause!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
Item.setData.errorlevel = item.errorlevel!;
|
if (!string.IsNullOrEmpty(item.errorlevel))
|
||||||
|
Item.setData.errorlevel = item.errorlevel!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
Item.setData.remark = item.remark!;
|
Item.setData.remark = item.remark!;
|
||||||
Item.setData.attachment = item.attachment!;
|
Item.setData.attachment = item.attachment!;
|
||||||
Item.setData.customer = item.custom!;
|
Item.setData.customer = item.custom!;
|
||||||
@@ -160,10 +161,10 @@ namespace Tnb.QcMgr
|
|||||||
Item.setData.isexec = JSON.Deserialize<Isexec>(item.isexec!);
|
Item.setData.isexec = JSON.Deserialize<Isexec>(item.isexec!);
|
||||||
Item.setShow = new Show();
|
Item.setShow = new Show();
|
||||||
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
||||||
Item.setShow.excontent = !string.IsNullOrEmpty(Item.setData.excontent);
|
Item.setShow.excontent = !string.IsNullOrEmpty(item.excontent);
|
||||||
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
||||||
Item.setShow.errorcause = Item.setData.errorcause == null ? false : true;
|
Item.setShow.errorcause = Item.setData.errorcause == null ? false : true;
|
||||||
Item.setShow.errorlevel = !string.IsNullOrEmpty(Item.setData.errorlevel);
|
Item.setShow.errorlevel = Item.setData.errorlevel == null ? false : true;
|
||||||
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
||||||
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
||||||
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
||||||
@@ -206,7 +207,7 @@ namespace Tnb.QcMgr
|
|||||||
excontent = item.excontent,
|
excontent = item.excontent,
|
||||||
check = item.check,
|
check = item.check,
|
||||||
errorcause = item.errorcause.Replace("\"","").Trim(),
|
errorcause = item.errorcause.Replace("\"","").Trim(),
|
||||||
errorlevel = item.errorlevel,
|
errorlevel = item.errorlevel.Replace("\"", "").Trim(),
|
||||||
remark = item.remark,
|
remark = item.remark,
|
||||||
attachment = item.attachment,
|
attachment = item.attachment,
|
||||||
isexec = item.isexec,
|
isexec = item.isexec,
|
||||||
|
|||||||
@@ -83,11 +83,12 @@ namespace Tnb.QcMgr
|
|||||||
Item.name = QcCheckItems.Where(p => p.id == QcCheckPlanD.itemid).First().name!;
|
Item.name = QcCheckItems.Where(p => p.id == QcCheckPlanD.itemid).First().name!;
|
||||||
Item.setData = new PlanItemData();
|
Item.setData = new PlanItemData();
|
||||||
Item.setData.extype = QcCheckPlanD.extype!;
|
Item.setData.extype = QcCheckPlanD.extype!;
|
||||||
Item.setData.excontent = QcCheckPlanD.excontent!;
|
Item.setData.excontent = JSON.Deserialize<Excontent>(QcCheckPlanD.excontent!);
|
||||||
Item.setData.check = QcCheckPlanD.check!;
|
Item.setData.check = QcCheckPlanD.check!;
|
||||||
if (!string.IsNullOrEmpty(QcCheckPlanD.errorcause))
|
if (!string.IsNullOrEmpty(QcCheckPlanD.errorcause))
|
||||||
Item.setData.errorcause = QcCheckPlanD.errorcause!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
Item.setData.errorcause = QcCheckPlanD.errorcause!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
Item.setData.errorlevel = QcCheckPlanD.errorlevel!;
|
if (!string.IsNullOrEmpty(QcCheckPlanD.errorlevel))
|
||||||
|
Item.setData.errorlevel = QcCheckPlanD.errorlevel!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
Item.setData.remark = QcCheckPlanD.remark!;
|
Item.setData.remark = QcCheckPlanD.remark!;
|
||||||
Item.setData.attachment = QcCheckPlanD.attachment!;
|
Item.setData.attachment = QcCheckPlanD.attachment!;
|
||||||
Item.setData.customer = QcCheckPlanD.custom!;
|
Item.setData.customer = QcCheckPlanD.custom!;
|
||||||
@@ -95,10 +96,10 @@ namespace Tnb.QcMgr
|
|||||||
Item.setData.isexec = JSON.Deserialize<IsexecP>(QcCheckPlanD.isexec!);
|
Item.setData.isexec = JSON.Deserialize<IsexecP>(QcCheckPlanD.isexec!);
|
||||||
Item.setShow = new PlanItemShow();
|
Item.setShow = new PlanItemShow();
|
||||||
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
||||||
Item.setShow.excontent = !string.IsNullOrEmpty(Item.setData.excontent);
|
Item.setShow.excontent = !string.IsNullOrEmpty(QcCheckPlanD.excontent);
|
||||||
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
||||||
Item.setShow.errorcause = Item.setData.errorcause == null ? false : true;
|
Item.setShow.errorcause = Item.setData.errorcause == null ? false : true;
|
||||||
Item.setShow.errorlevel = !string.IsNullOrEmpty(Item.setData.errorlevel);
|
Item.setShow.errorlevel = Item.setData.errorlevel == null ? false : true;
|
||||||
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
||||||
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
||||||
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
||||||
@@ -129,8 +130,11 @@ namespace Tnb.QcMgr
|
|||||||
TriggerPlan.code = triggerPlan.code!;
|
TriggerPlan.code = triggerPlan.code!;
|
||||||
TriggerPlan.type = triggerPlan.type!;
|
TriggerPlan.type = triggerPlan.type!;
|
||||||
TriggerPlan.cycle = triggerPlan.cycle!;
|
TriggerPlan.cycle = triggerPlan.cycle!;
|
||||||
TriggerPlan.trieventid = triggerPlan.trievent!.Replace("[", "").Replace("]", "").Replace("\r\n", "").Replace("\"", "").Replace(" ","").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
if (!string.IsNullOrEmpty(triggerPlan.trievent))
|
||||||
TriggerPlan.trievent = QcTriggerEvents.Where(p => TriggerPlan.trieventid.Contains(p.id)).Select(p => p.name!).ToArray();
|
{
|
||||||
|
TriggerPlan.trieventid = triggerPlan.trievent!.Replace("[", "").Replace("]", "").Replace("\r\n", "").Replace("\"", "").Replace(" ", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
TriggerPlan.trievent = QcTriggerEvents.Where(p => TriggerPlan.trieventid.Contains(p.id)).Select(p => p.name!).ToArray();
|
||||||
|
}
|
||||||
TriggerPlans.Add(TriggerPlan);
|
TriggerPlans.Add(TriggerPlan);
|
||||||
}
|
}
|
||||||
return TriggerPlans;
|
return TriggerPlans;
|
||||||
@@ -167,8 +171,8 @@ namespace Tnb.QcMgr
|
|||||||
QcCheckPlanD.extype = item.extype;
|
QcCheckPlanD.extype = item.extype;
|
||||||
QcCheckPlanD.excontent = item.excontent;
|
QcCheckPlanD.excontent = item.excontent;
|
||||||
QcCheckPlanD.check = item.check;
|
QcCheckPlanD.check = item.check;
|
||||||
QcCheckPlanD.errorcause = item.errorcause;
|
QcCheckPlanD.errorcause = item.errorcause.Replace("\"", "").Trim();
|
||||||
QcCheckPlanD.errorlevel = item.errorlevel;
|
QcCheckPlanD.errorlevel = item.errorlevel.Replace("\"", "").Trim();
|
||||||
QcCheckPlanD.remark = item.remark;
|
QcCheckPlanD.remark = item.remark;
|
||||||
QcCheckPlanD.attachment = item.attachment;
|
QcCheckPlanD.attachment = item.attachment;
|
||||||
QcCheckPlanD.isexec = item.isexec;
|
QcCheckPlanD.isexec = item.isexec;
|
||||||
|
|||||||
192
QcMgr/Tnb.QcMgr/QcCheckTaskService.cs
Normal file
192
QcMgr/Tnb.QcMgr/QcCheckTaskService.cs
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Aspose.Cells.Drawing;
|
||||||
|
using JNPF.Common.Core.Manager;
|
||||||
|
using JNPF.Common.Enums;
|
||||||
|
using JNPF.DependencyInjection;
|
||||||
|
using JNPF.DynamicApiController;
|
||||||
|
using JNPF.FriendlyException;
|
||||||
|
using JNPF.JsonSerialization;
|
||||||
|
using JNPF.Systems.Entitys.Permission;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using SqlSugar;
|
||||||
|
using Tnb.QcMgr.Entities;
|
||||||
|
using Tnb.QcMgr.Entities.Dto;
|
||||||
|
using Tnb.QcMgr.Entities.Entity;
|
||||||
|
using Tnb.QcMgr.Interfaces;
|
||||||
|
|
||||||
|
namespace Tnb.QcMgr
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 质检任务模块
|
||||||
|
/// </summary>
|
||||||
|
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 800)]
|
||||||
|
[Route("api/[area]/[controller]/[action]")]
|
||||||
|
public class QcCheckTaskService : IQcCheckTaskService, IDynamicApiController, ITransient
|
||||||
|
{
|
||||||
|
private readonly ISqlSugarRepository<QcCheckExecH> _repository;
|
||||||
|
private readonly IUserManager _userManager;
|
||||||
|
public QcCheckTaskService(ISqlSugarRepository<QcCheckExecH> repository, IUserManager userManager)
|
||||||
|
{
|
||||||
|
_repository = repository;
|
||||||
|
_userManager = userManager;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取任务执行明细
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public async Task<dynamic> GetTaskItems(string id)
|
||||||
|
{
|
||||||
|
var db = _repository.AsSugarClient();
|
||||||
|
|
||||||
|
string planid = "26813180898837";
|
||||||
|
var lists= await db.Queryable<QcCheckExecD>().Where(p => p.mainid == id).ToListAsync();
|
||||||
|
if (lists.Count == 0)
|
||||||
|
{
|
||||||
|
var QcCheckPlanDs = await db.Queryable<QcCheckPlanD>().Where(p => p.mainid == planid).ToListAsync();
|
||||||
|
List<QcCheckExecD> NewQcCheckExecDs = new List<QcCheckExecD>();
|
||||||
|
foreach (var QcCheckPlanD in QcCheckPlanDs)
|
||||||
|
{
|
||||||
|
QcCheckExecD QcCheckExecD = new QcCheckExecD();
|
||||||
|
QcCheckExecD.mainid = id;
|
||||||
|
QcCheckExecD.extype = QcCheckPlanD.extype;
|
||||||
|
QcCheckExecD.excontent = QcCheckPlanD.excontent;
|
||||||
|
QcCheckExecD.check = QcCheckPlanD.check;
|
||||||
|
QcCheckExecD.errorcause = QcCheckPlanD.errorcause;
|
||||||
|
QcCheckExecD.errorlevel = QcCheckPlanD.errorlevel;
|
||||||
|
QcCheckExecD.remark = QcCheckPlanD.remark;
|
||||||
|
QcCheckExecD.attachment = QcCheckPlanD.attachment;
|
||||||
|
QcCheckExecD.isexec = QcCheckPlanD.isexec;
|
||||||
|
QcCheckExecD.custom = QcCheckPlanD.custom;
|
||||||
|
QcCheckExecD.typeid = QcCheckPlanD.typeid;
|
||||||
|
QcCheckExecD.itemid = QcCheckPlanD.itemid;
|
||||||
|
NewQcCheckExecDs.Add(QcCheckExecD);
|
||||||
|
}
|
||||||
|
await db.Insertable<QcCheckExecD>(NewQcCheckExecDs).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
var QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == id).FirstAsync();
|
||||||
|
var QcCheckExecDs = await db.Queryable<QcCheckExecD>().Where(p => p.mainid == id).ToListAsync();
|
||||||
|
var QcCheckItems = await db.Queryable<QcCheckItem>().ToListAsync();
|
||||||
|
var QcCheckTypes = await db.Queryable<QcCheckType>().ToListAsync();
|
||||||
|
var QcErrorCauses = await db.Queryable<QcErrorCause>().ToListAsync();
|
||||||
|
var QcErrorLevels = await db.Queryable<QcErrorLevel>().ToListAsync();
|
||||||
|
|
||||||
|
CheckTaskOut CheckTaskOut = new CheckTaskOut();
|
||||||
|
CheckTaskOut.mainid = id;
|
||||||
|
CheckTaskOut.wareid = QcCheckExecH.wareid!;
|
||||||
|
CheckTaskOut.workid = QcCheckExecH.workid!;
|
||||||
|
if (!string.IsNullOrEmpty(CheckTaskOut.workid))
|
||||||
|
CheckTaskOut.workname = db.Queryable<OrganizeEntity>().Where(p => p.Id == CheckTaskOut.workid).First().FullName;
|
||||||
|
CheckTaskOut.checktypes = new List<CheckExecTypeOut>();
|
||||||
|
foreach (var QcCheckExecD in QcCheckExecDs)
|
||||||
|
{
|
||||||
|
if (CheckTaskOut.checktypes.Where(p => p.checktypeid == QcCheckExecD.typeid).ToList().Count == 0)
|
||||||
|
{
|
||||||
|
CheckExecTypeOut checkType = new CheckExecTypeOut();
|
||||||
|
checkType.checktypeid = QcCheckExecD.typeid!;
|
||||||
|
checkType.checktypename = QcCheckTypes.Where(p => p.id == QcCheckExecD.typeid).First().name!;
|
||||||
|
checkType.items = new List<ExecItemOut>();
|
||||||
|
CheckTaskOut.checktypes.Add(checkType);
|
||||||
|
}
|
||||||
|
ExecItemOut Item = new ExecItemOut();
|
||||||
|
Item.itemid = QcCheckExecD.itemid!;
|
||||||
|
Item.itemdid = QcCheckExecD.id!;
|
||||||
|
Item.code = QcCheckItems.Where(p => p.id == QcCheckExecD.itemid).First().code!;
|
||||||
|
Item.name = QcCheckItems.Where(p => p.id == QcCheckExecD.itemid).First().name!;
|
||||||
|
Item.setData = new ExecItemData();
|
||||||
|
Item.setData.extype = QcCheckExecD.extype!;
|
||||||
|
Item.setData.excontent = JSON.Deserialize<Excontent>(QcCheckExecD.excontent!);
|
||||||
|
Item.setData.check = QcCheckExecD.check!;
|
||||||
|
if (!string.IsNullOrEmpty(QcCheckExecD.errorcause))
|
||||||
|
{
|
||||||
|
var strs = QcCheckExecD.errorcause!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
Item.setData.errorcause = new List<Error>();
|
||||||
|
foreach (var str in strs)
|
||||||
|
{
|
||||||
|
Item.setData.errorcause.Add(new Error { id = str, name = QcErrorCauses.Where(p => p.id == str).First().name! });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(QcCheckExecD.errorlevel))
|
||||||
|
{
|
||||||
|
var strs = QcCheckExecD.errorlevel!.Replace("[", "").Replace("]", "").Split(',', StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
Item.setData.errorlevel = new List<Error>();
|
||||||
|
foreach (var str in strs)
|
||||||
|
{
|
||||||
|
Item.setData.errorlevel.Add(new Error { id = str, name = QcErrorLevels.Where(p => p.id == str).First().name! });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item.setData.remark = QcCheckExecD.remark!;
|
||||||
|
Item.setData.attachment = QcCheckExecD.attachment!;
|
||||||
|
Item.setData.customer = QcCheckExecD.custom!;
|
||||||
|
if (!string.IsNullOrEmpty(QcCheckExecD.isexec))
|
||||||
|
Item.setData.isexec = JSON.Deserialize<IsexecE>(QcCheckExecD.isexec!);
|
||||||
|
Item.setShow = new ExecItemShow();
|
||||||
|
Item.setShow.extype = !string.IsNullOrEmpty(Item.setData.extype);
|
||||||
|
Item.setShow.excontent = !string.IsNullOrEmpty(QcCheckExecD.excontent);
|
||||||
|
Item.setShow.check = !string.IsNullOrEmpty(Item.setData.check);
|
||||||
|
Item.setShow.errorcause = Item.setData.errorcause.Count == 0 ? false : true;
|
||||||
|
Item.setShow.errorlevel = Item.setData.errorlevel.Count == 0 ? false : true;
|
||||||
|
Item.setShow.remark = !string.IsNullOrEmpty(Item.setData.remark);
|
||||||
|
Item.setShow.attachment = !string.IsNullOrEmpty(Item.setData.attachment);
|
||||||
|
Item.setShow.customer = !string.IsNullOrEmpty(Item.setData.customer);
|
||||||
|
Item.setShow.isexec = Item.setData.isexec == null ? false : true;
|
||||||
|
CheckTaskOut.checktypes.Where(p => p.checktypeid == QcCheckExecD.typeid).First().items.Add(Item);
|
||||||
|
}
|
||||||
|
return CheckTaskOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行任务
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="CheckTaskInput"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task SaveData(CheckTaskInput CheckTaskInput)
|
||||||
|
{
|
||||||
|
var db = _repository.AsSugarClient();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var QcCheckExecH = await db.Queryable<QcCheckExecH>().Where(p => p.id == CheckTaskInput.mainid).FirstAsync();
|
||||||
|
QcCheckExecH.checknum = CheckTaskInput.checknum;
|
||||||
|
QcCheckExecH.status = CheckTaskInput.status;
|
||||||
|
QcCheckExecH.result = CheckTaskInput.result;
|
||||||
|
QcCheckExecH.execuser = _userManager.UserId;
|
||||||
|
QcCheckExecH.exectime = DateTime.Now.ToString();
|
||||||
|
var QcCheckExecDs = await db.Queryable<QcCheckExecD>().Where(p => p.mainid == CheckTaskInput.mainid).ToListAsync();
|
||||||
|
foreach (var checktype in CheckTaskInput.checktypes)
|
||||||
|
{
|
||||||
|
foreach (var item in checktype.items)
|
||||||
|
{
|
||||||
|
var QcCheckExecD = QcCheckExecDs.Where(p => p.id == item.itemdid).FirstOrDefault();
|
||||||
|
if (QcCheckExecD == null)
|
||||||
|
continue;
|
||||||
|
QcCheckExecD.excontent = item.excontent;
|
||||||
|
QcCheckExecD.check = item.check;
|
||||||
|
QcCheckExecD.errorcause = item.errorcause;
|
||||||
|
QcCheckExecD.errorlevel = item.errorlevel;
|
||||||
|
QcCheckExecD.remark = item.remark;
|
||||||
|
QcCheckExecD.attachment = item.attachment;
|
||||||
|
QcCheckExecD.isexec = item.isexec;
|
||||||
|
QcCheckExecD.custom = item.customer;
|
||||||
|
QcCheckExecD.result = item.result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await db.Ado.BeginTranAsync();
|
||||||
|
await db.Updateable(QcCheckExecH).ExecuteCommandAsync();
|
||||||
|
await db.Updateable(QcCheckExecDs).ExecuteCommandAsync();
|
||||||
|
await db.Ado.CommitTranAsync();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw Oops.Oh(ErrorCode.COM1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user