Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
namespace Tnb.EquipMgr.Entities.Dto
|
||||
{
|
||||
public class RepairApplyOutRegisterInput
|
||||
{
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际维修供应商id
|
||||
/// </summary>
|
||||
public string? real_supplier_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
public string? attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 费用
|
||||
/// </summary>
|
||||
public decimal? cost { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修复时间
|
||||
/// </summary>
|
||||
public DateTime? repair_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 维修耗时
|
||||
/// </summary>
|
||||
public decimal? repair_take_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 维修备注
|
||||
/// </summary>
|
||||
public string? repair_remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 报修申请id
|
||||
/// </summary>
|
||||
public string repair_apply_id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using SqlSugar;
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 保养项目
|
||||
/// 设备保养项目
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_item")]
|
||||
public partial class EqpMaintainItem : BaseEntity<string>
|
||||
@@ -34,25 +34,20 @@ public partial class EqpMaintainItem : BaseEntity<string>
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型
|
||||
/// </summary>
|
||||
public string? equip_type_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目编码
|
||||
/// </summary>
|
||||
public string? item_code { get; set; }
|
||||
public string? code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目名称
|
||||
/// </summary>
|
||||
public string? item_name { get; set; }
|
||||
public string? name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养类型
|
||||
/// </summary>
|
||||
public int? maintain_type { get; set; }
|
||||
public string maintain_type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养内容
|
||||
@@ -74,79 +69,9 @@ public partial class EqpMaintainItem : BaseEntity<string>
|
||||
/// </summary>
|
||||
public int? ordinal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public int? enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend01 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend02 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend03 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend04 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend05 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend06 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend07 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend08 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend09 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TODO
|
||||
/// </summary>
|
||||
public string? extend10 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除用户
|
||||
/// </summary>
|
||||
public string? delete_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除时间
|
||||
/// </summary>
|
||||
public DateTime? delete_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 删除标志
|
||||
/// </summary>
|
||||
public short? deleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
92
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainRecordD.cs
Normal file
92
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainRecordD.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养执行记录子表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_record_d")]
|
||||
public partial class EqpMaintainRecordD : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainRecordD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备保养执行记录id
|
||||
/// </summary>
|
||||
public string maintain_record_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养检项id
|
||||
/// </summary>
|
||||
public string maintain_item_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string? code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string? name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 结果 1 通过 2 不通过
|
||||
/// </summary>
|
||||
public string? result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public long ordinal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养设备模板id
|
||||
/// </summary>
|
||||
public string? maintain_tem_equip_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否通过
|
||||
/// </summary>
|
||||
public string? is_pass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养项描述
|
||||
/// </summary>
|
||||
public string? descrip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养类型
|
||||
/// </summary>
|
||||
public string maintain_type { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 保养内容
|
||||
/// </summary>
|
||||
public string? maintain_content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 保养结果描述
|
||||
/// </summary>
|
||||
public string? maintain_descrip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核 1 通过 2 不通过
|
||||
/// </summary>
|
||||
public string? repeat_result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核结果描述
|
||||
/// </summary>
|
||||
public string? repeat_descrip { get; set; }
|
||||
|
||||
}
|
||||
167
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainRecordH.cs
Normal file
167
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainRecordH.cs
Normal file
@@ -0,0 +1,167 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养执行记录主表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_record_h")]
|
||||
public partial class EqpMaintainRecordH : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainRecordH()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? create_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public DateTime? modify_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备id
|
||||
/// </summary>
|
||||
public string equip_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养设备模板id
|
||||
/// </summary>
|
||||
public string maintain_tem_equip_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 结果1 合格2不合格
|
||||
/// </summary>
|
||||
public string? result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 点巡检结果备注
|
||||
/// </summary>
|
||||
public string? result_remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行时间
|
||||
/// </summary>
|
||||
public DateTime? execute_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 1待执行 2 待复核 3 已完成
|
||||
/// </summary>
|
||||
public string? status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行人id
|
||||
/// </summary>
|
||||
public string? execute_user_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型id
|
||||
/// </summary>
|
||||
public string? equip_type_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 不合格推送
|
||||
/// </summary>
|
||||
public int? is_send { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送时间
|
||||
/// </summary>
|
||||
public DateTime? send_date_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送人id
|
||||
/// </summary>
|
||||
public string? send_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string? code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量
|
||||
/// </summary>
|
||||
public int? plan_run_notice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_run_notice_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间
|
||||
/// </summary>
|
||||
public int? plan_delay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_delay_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核岗位id
|
||||
/// </summary>
|
||||
public string? repeat_post_info_user_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任岗位id
|
||||
/// </summary>
|
||||
public string? send_post_info_user_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否复核
|
||||
/// </summary>
|
||||
public string? is_repeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核时间
|
||||
/// </summary>
|
||||
public DateTime? repeat_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核备注
|
||||
/// </summary>
|
||||
public string? repeat_remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核人id
|
||||
/// </summary>
|
||||
public string? repeat_user_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仅用于关联表字段查询用不存储数据
|
||||
/// </summary>
|
||||
public string? query_info { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
public string? attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核结果
|
||||
/// </summary>
|
||||
public string? repeat_result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
}
|
||||
27
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemD.cs
Normal file
27
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemD.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养模板子表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_tem_d")]
|
||||
public partial class EqpMaintainTemD : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainTemD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备保养模板主表id
|
||||
/// </summary>
|
||||
public string maintain_tem_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养项id
|
||||
/// </summary>
|
||||
public string maintain_item_id { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养设备模板子表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_tem_equip_d")]
|
||||
public partial class EqpMaintainTemEquipD : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainTemEquipD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 设备保养设备模板主表id
|
||||
/// </summary>
|
||||
public string maintain_tem_equip_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养项id
|
||||
/// </summary>
|
||||
public string maintain_item_id { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
137
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs
Normal file
137
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemEquipH.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养设备模板主表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_tem_equip_h")]
|
||||
public partial class EqpMaintainTemEquipH : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainTemEquipH()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime create_time { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public DateTime? modify_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养模板表id
|
||||
/// </summary>
|
||||
public string? maintain_tem_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备id
|
||||
/// </summary>
|
||||
public string? equip_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int ordinal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 周期
|
||||
/// </summary>
|
||||
public int plan_cycle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 周期方式 1 单次 2 循环
|
||||
/// </summary>
|
||||
public string? plan_cycle_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量
|
||||
/// </summary>
|
||||
public int? plan_run_notice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_run_notice_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间
|
||||
/// </summary>
|
||||
public int? plan_delay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_delay_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用时间
|
||||
/// </summary>
|
||||
public DateTime start_time { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public string is_start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否复核
|
||||
/// </summary>
|
||||
public string is_repeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核岗位id
|
||||
/// </summary>
|
||||
public string repeat_post_info_user_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 不合格推送 0 不推送 1 推送
|
||||
/// </summary>
|
||||
public int is_send { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送人id
|
||||
/// </summary>
|
||||
public string? send_post_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任岗位id
|
||||
/// </summary>
|
||||
public string send_post_info_user_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
}
|
||||
132
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs
Normal file
132
EquipMgr/Tnb.EquipMgr.Entities/Entity/EqpMaintainTemH.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.EquipMgr.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 设备保养模板主表
|
||||
/// </summary>
|
||||
[SugarTable("eqp_maintain_tem_h")]
|
||||
public partial class EqpMaintainTemH : BaseEntity<string>
|
||||
{
|
||||
public EqpMaintainTemH()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? create_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public DateTime? modify_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备类型id
|
||||
/// </summary>
|
||||
public string? equip_type_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编码
|
||||
/// </summary>
|
||||
public string code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 周期
|
||||
/// </summary>
|
||||
public int plan_cycle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 周期方式 1 单次 2 循环
|
||||
/// </summary>
|
||||
public string plan_cycle_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量
|
||||
/// </summary>
|
||||
public int? plan_run_notice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 计划执行通知提前量单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_run_notice_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间
|
||||
/// </summary>
|
||||
public int? plan_delay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 执行滞后推送时间单位 1 小时 2 天 3 周
|
||||
/// </summary>
|
||||
public string? plan_delay_unit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启用时间
|
||||
/// </summary>
|
||||
public DateTime start_time { get; set; } = DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public int is_start { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否复核
|
||||
/// </summary>
|
||||
public int is_repeat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 复核岗位id
|
||||
/// </summary>
|
||||
public string repeat_post_info_user_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string? remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int? ordinal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 不合格推送 0 不推送 1 推送
|
||||
/// </summary>
|
||||
public int is_send { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 推送人id
|
||||
/// </summary>
|
||||
public string? send_post_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 责任岗位id
|
||||
/// </summary>
|
||||
public string send_post_info_user_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public partial class EqpRepairApply : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public string? equip_id { get; set; }
|
||||
public string equip_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 申请用户ID
|
||||
|
||||
@@ -113,5 +113,27 @@ public partial class EqpRepairOutApply : BaseEntity<string>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
public string? attachment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 实际维修供应商
|
||||
/// </summary>
|
||||
public string? real_supplier_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "f_flowid")]
|
||||
public string? flow_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程任务id
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "f_flowtaskid")]
|
||||
public string? flow_task_id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public partial class EqpSpotInsItem : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; } = string.Empty;
|
||||
public string? unit_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 点巡检方法
|
||||
|
||||
@@ -72,7 +72,7 @@ public partial class EqpSpotInsRecordD : BaseEntity<string>
|
||||
/// <summary>
|
||||
/// 单位id
|
||||
/// </summary>
|
||||
public string unit_id { get; set; } = string.Empty;
|
||||
public string? unit_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 点巡检方法
|
||||
@@ -108,5 +108,10 @@ public partial class EqpSpotInsRecordD : BaseEntity<string>
|
||||
/// 是否通过
|
||||
/// </summary>
|
||||
public string? is_pass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属组织
|
||||
/// </summary>
|
||||
public string? org_id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Tnb.EquipMgr.Interfaces
|
||||
{
|
||||
public interface IEqpMaintainTemEquipService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 停止计划
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
/// <returns></returns>
|
||||
public Task Stop(Dictionary<string, string> parameters);
|
||||
}
|
||||
}
|
||||
12
EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemService.cs
Normal file
12
EquipMgr/Tnb.EquipMgr.Interfaces/IEqpMaintainTemService.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
namespace Tnb.EquipMgr.Interfaces
|
||||
{
|
||||
public interface IEqpMaintainTemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
public Task<string> Publish(SpotInsTemPublishInput input);
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,23 @@ namespace Tnb.EquipMgr.Interfaces
|
||||
public interface IEqpRepairOutApplyService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取外修申请信息
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
public Task<EqpRepairOutApply> GetInfo(Dictionary<string,string> dic);
|
||||
|
||||
/// <summary>
|
||||
/// 外修申请
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
public Task<string> OutApply(RepairOutApplyInput input);
|
||||
|
||||
/// <summary>
|
||||
/// 外修登记
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
public Task<string> Register(RepairApplyOutRegisterInput input);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,6 @@ namespace Tnb.EquipMgr.Interfaces
|
||||
{
|
||||
public interface IEquSpotInsTemEquipService
|
||||
{
|
||||
// /// <summary>
|
||||
// /// 获取数
|
||||
// /// </summary>
|
||||
// /// <param name="dic"></param>
|
||||
// /// <returns></returns>
|
||||
// public Task<dynamic> GetTree();
|
||||
|
||||
/// <summary>
|
||||
/// 停止计划
|
||||
/// </summary>
|
||||
|
||||
52
EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs
Normal file
52
EquipMgr/Tnb.EquipMgr/EqpMaintainTemEquipService.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备保养设备模板
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class EqpMaintainTemEquipService : IEqpMaintainTemEquipService, IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly ISqlSugarRepository<EqpMaintainTemEquipH> _repository;
|
||||
|
||||
public EqpMaintainTemEquipService(ISqlSugarRepository<EqpMaintainTemEquipH> repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task Stop(Dictionary<string, string> parameters)
|
||||
{
|
||||
string id = parameters["id"];
|
||||
DbResult<bool> result = await _repository.AsSugarClient().Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpMaintainTemEquipH()
|
||||
{
|
||||
is_start = "0"
|
||||
}, x => x.id == id);
|
||||
List<string> ids = await _repository.AsSugarClient().Queryable<EqpMaintainRecordH>()
|
||||
.Where(x => x.maintain_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED)
|
||||
.Select(x => x.id).ToListAsync();
|
||||
await _repository.AsSugarClient().Deleteable<EqpMaintainRecordH>()
|
||||
.Where(x => x.maintain_tem_equip_id == id && x.status == SpotInsRecordExecutionStatus.TOBEEXECUTED).ExecuteCommandAsync();
|
||||
|
||||
await _repository.AsSugarClient().Deleteable<EqpMaintainRecordD>()
|
||||
.Where(x => ids.Contains(x.maintain_record_id)).ExecuteCommandAsync();
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
}
|
||||
}
|
||||
}
|
||||
119
EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs
Normal file
119
EquipMgr/Tnb.EquipMgr/EqpMaintainTemService.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
using Tnb.EquipMgr.Interfaces;
|
||||
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备保养检模板管理
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
public class EqpMaintainTemService : IEqpMaintainTemService, IDynamicApiController, ITransient
|
||||
{
|
||||
private const string ModuleId = "26123080740885";
|
||||
private readonly ISqlSugarRepository<EqpMaintainTemH> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
public EqpMaintainTemService(ISqlSugarRepository<EqpMaintainTemH> repository,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_userManager = userManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据模板id发布到设备
|
||||
/// </summary>
|
||||
/// <param name="dic"></param>
|
||||
[HttpPost]
|
||||
public async Task<string> Publish(SpotInsTemPublishInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
EqpMaintainTemH eqpMaintainTemH = await _repository.GetSingleAsync(x => x.id == input.id);
|
||||
List<EqpMaintainTemD> eqpMaintainTemDs = await db.Queryable<EqpMaintainTemD>().Where(x=>x.maintain_tem_id==input.id).ToListAsync();
|
||||
|
||||
if (input.equipIds != null && input.equipIds.Length > 0)
|
||||
{
|
||||
List<EqpMaintainTemEquipH> insertEqpMaintainTemEquipHs = new List<EqpMaintainTemEquipH>();
|
||||
List<EqpMaintainTemEquipD> insertEqpMaintainTemEquipDs = new List<EqpMaintainTemEquipD>();
|
||||
foreach (var equipId in input.equipIds)
|
||||
{
|
||||
string id = SnowflakeIdHelper.NextId();
|
||||
string code = $"{DateTime.Now.ToString("yyyyMMdd") + equipId}";
|
||||
EqpMaintainTemEquipH eqpMaintainTemEquipH = new EqpMaintainTemEquipH()
|
||||
{
|
||||
id = id,
|
||||
code = code,
|
||||
name = eqpMaintainTemH.name+equipId,
|
||||
plan_cycle = eqpMaintainTemH.plan_cycle,
|
||||
plan_cycle_unit = eqpMaintainTemH.plan_cycle_unit,
|
||||
plan_run_notice = eqpMaintainTemH.plan_run_notice,
|
||||
plan_delay = eqpMaintainTemH.plan_delay,
|
||||
start_time = eqpMaintainTemH.start_time,
|
||||
is_start = eqpMaintainTemH.is_start.ToString(),
|
||||
is_repeat = eqpMaintainTemH.is_repeat.ToString(),
|
||||
is_send = eqpMaintainTemH.is_send,
|
||||
maintain_tem_id = input.id,
|
||||
equip_id = equipId,
|
||||
remark = eqpMaintainTemH.remark,
|
||||
plan_run_notice_unit = eqpMaintainTemH.plan_run_notice_unit,
|
||||
plan_delay_unit = eqpMaintainTemH.plan_delay_unit,
|
||||
repeat_post_info_user_id = eqpMaintainTemH.repeat_post_info_user_id,
|
||||
send_post_info_user_id = eqpMaintainTemH.send_post_info_user_id,
|
||||
send_post_id = eqpMaintainTemH.send_post_id,
|
||||
org_id = eqpMaintainTemH.org_id,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
};
|
||||
insertEqpMaintainTemEquipHs.Add(eqpMaintainTemEquipH);
|
||||
|
||||
if (eqpMaintainTemDs != null && eqpMaintainTemDs.Count > 0)
|
||||
{
|
||||
foreach (var eqpMaintainTem in eqpMaintainTemDs)
|
||||
{
|
||||
EqpMaintainTemEquipD eqpMaintainTemEquipD = new EqpMaintainTemEquipD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
maintain_item_id = eqpMaintainTem.maintain_item_id,
|
||||
maintain_tem_equip_id = id,
|
||||
};
|
||||
insertEqpMaintainTemEquipDs.Add(eqpMaintainTemEquipD);
|
||||
}
|
||||
}
|
||||
|
||||
EqpMaintainTemEquipH oldMaintainTemEquipH = await db.Queryable<EqpMaintainTemEquipH>().Where(x => x.maintain_tem_id == input.id && x.equip_id == equipId).FirstAsync();
|
||||
await db.Deleteable<EqpMaintainTemEquipH>().Where(x => x.maintain_tem_id == input.id && x.equip_id==equipId).ExecuteCommandAsync();
|
||||
if(oldMaintainTemEquipH!=null)
|
||||
await db.Deleteable<EqpMaintainTemEquipD>().Where(x => x.maintain_tem_equip_id==oldMaintainTemEquipH.id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
if (insertEqpMaintainTemEquipHs != null && insertEqpMaintainTemEquipHs.Count > 0)
|
||||
{
|
||||
await db.Insertable(insertEqpMaintainTemEquipHs).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
if (insertEqpMaintainTemEquipDs != null && insertEqpMaintainTemEquipDs.Count > 0)
|
||||
{
|
||||
await db.Insertable(insertEqpMaintainTemEquipDs).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
return result.IsSuccess ? "发布成功" : result.ErrorMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Models.WorkFlow;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.WorkFlow.Interfaces.Service;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
using Tnb.EquipMgr.Entities.Dto;
|
||||
@@ -21,36 +24,50 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
private readonly ISqlSugarRepository<EqpRepairOutApply> _repository;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IFlowTaskService _flowTaskService;
|
||||
private const string flowId = "26299060075302";
|
||||
|
||||
public EqpRepairOutApplyService(ISqlSugarRepository<EqpRepairOutApply> repository,
|
||||
IFlowTaskService flowTaskService,
|
||||
IUserManager userManager)
|
||||
{
|
||||
_repository = repository;
|
||||
_userManager = userManager;
|
||||
_flowTaskService = flowTaskService;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<EqpRepairOutApply> GetInfo(Dictionary<string, string> dic)
|
||||
{
|
||||
string id = dic["id"];
|
||||
EqpRepairApply eqpRepairApply = await _repository.AsSugarClient().Queryable<EqpRepairApply>().SingleAsync(x => x.id == id);
|
||||
return await _repository.GetSingleAsync(x => x.repair_apply_id==eqpRepairApply.id);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> OutApply(RepairOutApplyInput input)
|
||||
{
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
string id = string.IsNullOrEmpty(input.id) ? SnowflakeIdHelper.NextId() : input.id;
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(input.id))
|
||||
{
|
||||
await _repository.InsertAsync(new EqpRepairOutApply
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
repair_apply_id = input.repair_apply_id,
|
||||
equip_id = input.equip_id,
|
||||
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,
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now,
|
||||
approve_status = RepairOutApplyStatus.TOBEAPPROVE,
|
||||
});
|
||||
// await _repository.InsertAsync(new EqpRepairOutApply
|
||||
// {
|
||||
// id = id,
|
||||
// repair_apply_id = input.repair_apply_id,
|
||||
// equip_id = input.equip_id,
|
||||
// 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,
|
||||
// create_id = _userManager.UserId,
|
||||
// create_time = DateTime.Now,
|
||||
// approve_status = RepairOutApplyStatus.TOBEAPPROVE,
|
||||
// });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -73,10 +90,62 @@ namespace Tnb.EquipMgr
|
||||
.SetColumns(x=>x.status == RepairApplyStatus.OUTAPPLYAPPROVE)
|
||||
.Where(x=>x.id==input.repair_apply_id).ExecuteCommandAsync();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
|
||||
//todo 退回流程
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
_flowTaskService.Create(new FlowTaskSubmitModel()
|
||||
{
|
||||
flowId = flowId,
|
||||
parentId = "0",
|
||||
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;
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<string> Register(RepairApplyOutRegisterInput input)
|
||||
{
|
||||
|
||||
var db = _repository.AsSugarClient();
|
||||
DbResult<bool> result = await db.Ado.UseTranAsync(async () =>
|
||||
{
|
||||
await _repository.UpdateAsync(x => new EqpRepairOutApply()
|
||||
{
|
||||
real_supplier_id = input.real_supplier_id,
|
||||
cost = input.cost,
|
||||
repair_time = input.repair_time,
|
||||
repair_take_time = input.repair_take_time,
|
||||
repair_remark = input.repair_remark,
|
||||
attachment = input.attachment,
|
||||
}, x => x.id == input.id);
|
||||
|
||||
await db.Updateable<EqpRepairApply>().SetColumns(x => x.status == RepairApplyStatus.COMPLETED)
|
||||
.Where(x => x.id == input.repair_apply_id).ExecuteCommandAsync();
|
||||
});
|
||||
if(!result.IsSuccess) throw Oops.Oh(ErrorCode.COM1008);
|
||||
|
||||
return result.IsSuccess ? "登记成功" : result.ErrorMessage;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace Tnb.EquipMgr
|
||||
{
|
||||
repeat_result = input.repeat_result,
|
||||
repeat_remark = input.repeat_remark,
|
||||
repeat_post_info_user_id = _userManager.UserId,
|
||||
repeat_user_id = _userManager.UserId,
|
||||
repeat_time = DateTime.Now,
|
||||
status = SpotInsRecordExecutionStatus.COMPLETED
|
||||
}, x => x.id == input.id);
|
||||
|
||||
@@ -11,7 +11,7 @@ using Tnb.EquipMgr.Entities;
|
||||
namespace Tnb.EquipMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备管理
|
||||
/// 点巡检设备模板
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Tag = ModuleConsts.Tag, Area = ModuleConsts.Area, Order = 700)]
|
||||
[Route("api/[area]/[controller]/[action]")]
|
||||
@@ -24,26 +24,7 @@ namespace Tnb.EquipMgr
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
// public async Task<dynamic> GetTree()
|
||||
// {
|
||||
// List<EqpEquipment> eqpEquipments =
|
||||
// var data = _repository.AsSugarClient().Queryable<EqpEquipType>()
|
||||
// .Where(x => x.status == 1)
|
||||
// .Select((x) => new TreeModel
|
||||
// {
|
||||
// id = x.id,
|
||||
// parentId = "-1",
|
||||
// hasChildren = SqlFunc.Subqueryable<EqpEquipment>().Where(y=>y.eqp_type_id==x.id).Any(),
|
||||
// isLeaf = false,
|
||||
// num = SqlFunc.Subqueryable<EqpEquipment>().Where(y=>y.eqp_type_id==x.id).Count(),
|
||||
// children = SqlFunc.Subqueryable<EqpEquipment>().Where(y=>y.eqp_type_id==x.id).Select(y=>new TreeModel()
|
||||
// {
|
||||
//
|
||||
// }).ToList(model => ),
|
||||
// });
|
||||
// return new { list = 1 };
|
||||
// }
|
||||
|
||||
[HttpPost]
|
||||
public async Task Stop(Dictionary<string, string> parameters)
|
||||
{
|
||||
string id = parameters["id"];
|
||||
|
||||
@@ -13,60 +13,60 @@ namespace Microsoft.Extensions.DependencyInjection;
|
||||
/// </summary>
|
||||
public static class ConfigureSqlSugarExtensions
|
||||
{
|
||||
public static IServiceCollection ConfigureSqlSugar(this IServiceCollection services)
|
||||
{
|
||||
// 获取选项
|
||||
ConnectionStringsOptions conn = App.GetConfig<ConnectionStringsOptions>("ConnectionStrings", true);
|
||||
|
||||
List<ConnectionConfig> connectConfigList = new List<ConnectionConfig>();
|
||||
var DBType = (DbType)Enum.Parse(typeof(DbType), conn.DBType);
|
||||
// 默认数据库
|
||||
connectConfigList.Add(new ConnectionConfig
|
||||
public static IServiceCollection ConfigureSqlSugar(this IServiceCollection services)
|
||||
{
|
||||
ConnectionString = string.Format(conn.DefaultConnection, conn.Host, conn.Port, conn.DBName, conn.UserName, conn.Password),
|
||||
DbType = DBType,
|
||||
IsAutoCloseConnection = true,
|
||||
ConfigId = conn.ConfigId,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsAutoRemoveDataCache = true // 自动清理缓存
|
||||
},
|
||||
});
|
||||
// 获取选项
|
||||
ConnectionStringsOptions conn = App.GetConfig<ConnectionStringsOptions>("ConnectionStrings", true);
|
||||
|
||||
services.AddSqlSugar(connectConfigList, client =>
|
||||
{
|
||||
//connectConfigList.ForEach(config =>
|
||||
//{
|
||||
// var db = ((SqlSugarScope)client).GetConnectionScope((string)config.ConfigId);
|
||||
List<ConnectionConfig> connectConfigList = new List<ConnectionConfig>();
|
||||
var DBType = (DbType)Enum.Parse(typeof(DbType), conn.DBType);
|
||||
// 默认数据库
|
||||
connectConfigList.Add(new ConnectionConfig
|
||||
{
|
||||
ConnectionString = string.Format(conn.DefaultConnection, conn.Host, conn.Port, conn.DBName, conn.UserName, conn.Password),
|
||||
DbType = DBType,
|
||||
IsAutoCloseConnection = true,
|
||||
ConfigId = conn.ConfigId,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
MoreSettings = new ConnMoreSettings()
|
||||
{
|
||||
IsAutoRemoveDataCache = true // 自动清理缓存
|
||||
},
|
||||
});
|
||||
|
||||
// // 设置超时时间
|
||||
// db.Ado.CommandTimeOut = 30;
|
||||
// db.Aop.OnLogExecuted = (sql, pars) =>
|
||||
// {
|
||||
// var oldColor = Console.ForegroundColor;
|
||||
// Console.ForegroundColor = ConsoleColor.Green;
|
||||
// var finalSql = UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars);
|
||||
// Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{db.Ado.SqlExecutionTime.TotalMilliseconds} ms");
|
||||
// Console.WriteLine(finalSql);
|
||||
// Console.ForegroundColor = oldColor;
|
||||
// if (db.Ado.SqlExecutionTime.TotalMilliseconds > 3000)
|
||||
// {
|
||||
// Log.Warning($"慢查询: {db.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql);
|
||||
// }
|
||||
// Console.WriteLine();
|
||||
// };
|
||||
// db.Aop.OnError = (ex) =>
|
||||
// {
|
||||
// Log.Error(UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres));
|
||||
// };
|
||||
//});
|
||||
});
|
||||
services.AddConfigurableOptions<ConnectionStringsOptions>();
|
||||
services.AddConfigurableOptions<TenantOptions>();
|
||||
services.AddUnitOfWork<SqlSugarUnitOfWork>();
|
||||
services.AddSqlSugar(connectConfigList, client =>
|
||||
{
|
||||
connectConfigList.ForEach(config =>
|
||||
{
|
||||
var db = ((SqlSugarScope)client).GetConnectionScope((string)config.ConfigId);
|
||||
|
||||
// 设置超时时间
|
||||
db.Ado.CommandTimeOut = 30;
|
||||
//db.Aop.OnLogExecuted = (sql, pars) =>
|
||||
//{
|
||||
// var oldColor = Console.ForegroundColor;
|
||||
// Console.ForegroundColor = ConsoleColor.Green;
|
||||
// var finalSql = UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, sql, pars);
|
||||
// Console.WriteLine($"【{DateTime.Now.ToString("HH:mm:ss.fff")}——SQL执行完成】{db.Ado.SqlExecutionTime.TotalMilliseconds} ms");
|
||||
// Console.WriteLine(finalSql);
|
||||
// Console.ForegroundColor = oldColor;
|
||||
// if (db.Ado.SqlExecutionTime.TotalMilliseconds > 3000)
|
||||
// {
|
||||
// Log.Warning($"慢查询: {db.Ado.SqlExecutionTime.TotalMilliseconds}ms, SQL: " + finalSql);
|
||||
// }
|
||||
// Console.WriteLine();
|
||||
//};
|
||||
//db.Aop.OnError = (ex) =>
|
||||
//{
|
||||
// Log.Error(UtilMethods.GetSqlString(db.CurrentConnectionConfig.DbType, ex.Sql, (SugarParameter[])ex.Parametres));
|
||||
//};
|
||||
});
|
||||
});
|
||||
services.AddConfigurableOptions<ConnectionStringsOptions>();
|
||||
services.AddConfigurableOptions<TenantOptions>();
|
||||
services.AddUnitOfWork<SqlSugarUnitOfWork>();
|
||||
|
||||
|
||||
return services;
|
||||
}
|
||||
return services;
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,18 @@ public class UserManager : IUserManager, IScoped
|
||||
/// </summary>
|
||||
public string UserOrigin
|
||||
{
|
||||
get => _httpContext?.Request.Headers["jnpf-origin"];
|
||||
//modifyby zhoukeda 调用发起工作流接口取不到pc还是app 改成默认pc
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return _httpContext?.Request.Headers["jnpf-origin"] ?? "pc";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "pc";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.Logging;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using SqlSugar;
|
||||
using Tnb.EquipMgr.Entities;
|
||||
|
||||
namespace JNPF.TaskScheduler.Listener
|
||||
{
|
||||
/// <summary>
|
||||
/// 生成设备保养计划
|
||||
/// </summary>
|
||||
public class GenerateMaintainPlanTimeWorker : ISpareTimeWorker
|
||||
{
|
||||
private ISqlSugarRepository<EqpMaintainTemEquipH> _repository => App.GetService<ISqlSugarRepository<EqpMaintainTemEquipH>>();
|
||||
// public GenerateSpotInspectionPlanTimeWorker(ISqlSugarRepository<EqpMaintainTemEquipH> repository)
|
||||
// {
|
||||
// _repository = repository;
|
||||
// }
|
||||
|
||||
[SpareTime("0 0 0 * * ?", "生成设备保养计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)]
|
||||
public void GenerateSpotInspectionPlan(SpareTimer timer, long count)
|
||||
{
|
||||
Log.Information("----------------------开始生成设备保养计划----------------------");
|
||||
|
||||
try
|
||||
{
|
||||
List<EqpMaintainTemEquipH> eqpSpotInsTemEquipHsByOne = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "1");
|
||||
List<EqpMaintainTemEquipH> eqpSpotInsTemEquipHsByCirculate = _repository.GetList(x => x.is_start=="1" && x.plan_cycle_unit == "2");
|
||||
List<EqpMaintainRecordH> tobeCreateList = new List<EqpMaintainRecordH>();
|
||||
List<EqpMaintainTemEquipH> tobeCreateTemplets = new List<EqpMaintainTemEquipH>();
|
||||
var db = _repository.AsSugarClient();
|
||||
|
||||
foreach (var item in eqpSpotInsTemEquipHsByOne)
|
||||
{
|
||||
if (item.start_time.AddHours((double)item.plan_cycle).ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd"))
|
||||
{
|
||||
tobeCreateTemplets.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (eqpSpotInsTemEquipHsByCirculate != null && eqpSpotInsTemEquipHsByCirculate.Count > 0)
|
||||
{
|
||||
|
||||
//整除表示一个周期到了
|
||||
foreach (var item in eqpSpotInsTemEquipHsByCirculate)
|
||||
{
|
||||
TimeSpan ts1 = new TimeSpan(Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")).Ticks);
|
||||
TimeSpan ts2 = new TimeSpan(Convert.ToDateTime(item.start_time.ToString("yyyy-MM-dd")).Ticks);
|
||||
TimeSpan ts3 = ts1.Subtract(ts2).Duration();
|
||||
if (ts3.TotalDays * 10 % (10 * (double)item.plan_cycle)==0)
|
||||
{
|
||||
tobeCreateTemplets.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tobeCreateTemplets != null && tobeCreateTemplets.Count > 0)
|
||||
{
|
||||
List<EqpEquipment> equipments = db.Queryable<EqpEquipment>().Where(x => x.life==Tnb.EquipMgr.EquipmentLife.ENABLE).ToList();
|
||||
int index = 1;
|
||||
foreach (var item in tobeCreateTemplets)
|
||||
{
|
||||
//只有启用设备才生成计划
|
||||
if (equipments.FirstOrDefault(x => x.id == item.equip_id) == null)
|
||||
continue;
|
||||
|
||||
string code = $"{DateTime.Now.ToString("yyyyMMdd")+(index++).ToString().PadLeft(3,'0')}";
|
||||
tobeCreateList.Add(new EqpMaintainRecordH()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
code = code,
|
||||
// equip_type_id = item.equip_type_id,
|
||||
equip_id = item.equip_id,
|
||||
maintain_tem_equip_id = item.id,
|
||||
plan_run_notice = item.plan_run_notice,
|
||||
plan_run_notice_unit = item.plan_run_notice_unit,
|
||||
plan_delay = item.plan_delay,
|
||||
plan_delay_unit = item.plan_delay_unit,
|
||||
send_post_info_user_id = item.send_post_info_user_id,
|
||||
is_repeat = item.is_repeat,
|
||||
repeat_post_info_user_id = item.repeat_post_info_user_id,
|
||||
is_send = item.is_send,
|
||||
create_time = DateTime.Now,
|
||||
status = Tnb.EquipMgr.SpotInsRecordExecutionStatus.TOBEEXECUTED
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (tobeCreateList != null && tobeCreateList.Count > 0)
|
||||
{
|
||||
List<string> templetIDs = tobeCreateList.Select(x => x.maintain_tem_equip_id).ToList();
|
||||
List<EqpMaintainTemEquipD> spotInsTemEquipDs = db.Queryable<EqpMaintainTemEquipD>().Where(x => templetIDs.Contains(x.maintain_tem_equip_id)).ToList();
|
||||
List<string> spotInsItemIDs = spotInsTemEquipDs.Select(x => x.maintain_item_id).ToList();
|
||||
List<EqpMaintainItem> spotCheckItems = db.Queryable<EqpMaintainItem>().Where(x => spotInsItemIDs.Contains(x.id)).ToList();
|
||||
|
||||
|
||||
foreach (var tobeCreatePlan in tobeCreateList)
|
||||
{
|
||||
List<EqpMaintainRecordD> spotInsRecordDs = new List<EqpMaintainRecordD>();
|
||||
List<string> spotInsItems = spotInsTemEquipDs
|
||||
.Where(x => x.maintain_tem_equip_id == tobeCreatePlan.maintain_tem_equip_id)
|
||||
.Select(x => x.maintain_item_id).ToList();
|
||||
List<EqpMaintainItem> tobeCreateItems = spotCheckItems.Where(x => spotInsItems.Contains(x.id)).ToList();
|
||||
foreach (var tobeCreateItem in tobeCreateItems)
|
||||
{
|
||||
spotInsRecordDs.Add(new EqpMaintainRecordD()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId(),
|
||||
maintain_record_id = tobeCreatePlan.id,
|
||||
maintain_tem_equip_id = tobeCreatePlan.maintain_tem_equip_id,
|
||||
maintain_item_id = tobeCreateItem.id,
|
||||
code = tobeCreateItem.code,
|
||||
name = tobeCreateItem.name,
|
||||
maintain_type = tobeCreateItem.maintain_type,
|
||||
maintain_content = tobeCreateItem.maintain_content,
|
||||
descrip = tobeCreateItem.descrip,
|
||||
remark = tobeCreateItem.remark
|
||||
});
|
||||
}
|
||||
|
||||
var dbResult = db.Ado.UseTran(() =>
|
||||
{
|
||||
if (tobeCreateList != null && tobeCreateList.Count > 0)
|
||||
{
|
||||
db.Insertable<EqpMaintainRecordH>(tobeCreateList).ExecuteCommand();
|
||||
}
|
||||
|
||||
if (spotInsRecordDs != null && spotInsRecordDs.Count > 0)
|
||||
{
|
||||
db.Insertable<EqpMaintainRecordD>(spotInsRecordDs).ExecuteCommand();
|
||||
}
|
||||
});
|
||||
if (!dbResult.IsSuccess)
|
||||
{
|
||||
Console.WriteLine(dbResult.ErrorMessage);
|
||||
Log.Error(dbResult.ErrorMessage);
|
||||
}
|
||||
Log.Information($"---------------生成{tobeCreateList.Count}个计划---------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
Log.Error(e.Message);
|
||||
}
|
||||
|
||||
|
||||
Log.Information("----------------------结束生成设备保养计划----------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace JNPF.TaskScheduler.Listener
|
||||
// _repository = repository;
|
||||
// }
|
||||
|
||||
//[SpareTime("0 0,30 * * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)]
|
||||
[SpareTime("0 0,30 * * * ?", "生成点巡检计划", ExecuteType = SpareTimeExecuteTypes.Serial,StartNow = false)]
|
||||
public void GenerateSpotInspectionPlan(SpareTimer timer, long count)
|
||||
{
|
||||
Log.Information("----------------------开始生成点巡检计划----------------------");
|
||||
|
||||
@@ -6,6 +6,7 @@ using JNPF.FriendlyException;
|
||||
using JNPF.WorkFlow.Entitys.Model;
|
||||
using JNPF.WorkFlow.Interfaces.Manager;
|
||||
using JNPF.WorkFlow.Interfaces.Service;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace JNPF.WorkFlow.Service;
|
||||
|
||||
Reference in New Issue
Block a user