Commit f4fbd11d by zxw

消息提醒

parent 162e7717
...@@ -14,11 +14,13 @@ namespace JmpModel.Model ...@@ -14,11 +14,13 @@ namespace JmpModel.Model
{ {
BaseJpBagMaps = new HashSet<BaseJpBagMap>(); BaseJpBagMaps = new HashSet<BaseJpBagMap>();
BaseJpEquipmentSizes = new HashSet<BaseJpEquipmentSize>(); BaseJpEquipmentSizes = new HashSet<BaseJpEquipmentSize>();
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpSupplierEquipments = new HashSet<BaseJpSupplierEquipment>(); BaseJpSupplierEquipments = new HashSet<BaseJpSupplierEquipment>();
CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>(); CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>();
CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>(); CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>(); CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>(); CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>(); CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>(); CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>(); CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>();
...@@ -82,6 +84,8 @@ namespace JmpModel.Model ...@@ -82,6 +84,8 @@ namespace JmpModel.Model
public virtual ICollection<BaseJpBagMap> BaseJpBagMaps { get; set; } public virtual ICollection<BaseJpBagMap> BaseJpBagMaps { get; set; }
[InverseProperty(nameof(BaseJpEquipmentSize.Detail))] [InverseProperty(nameof(BaseJpEquipmentSize.Detail))]
public virtual ICollection<BaseJpEquipmentSize> BaseJpEquipmentSizes { get; set; } public virtual ICollection<BaseJpEquipmentSize> BaseJpEquipmentSizes { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.EquipmentDetail))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(BaseJpSupplierEquipment.Equipment))] [InverseProperty(nameof(BaseJpSupplierEquipment.Equipment))]
public virtual ICollection<BaseJpSupplierEquipment> BaseJpSupplierEquipments { get; set; } public virtual ICollection<BaseJpSupplierEquipment> BaseJpSupplierEquipments { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Equipment))] [InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Equipment))]
...@@ -92,6 +96,8 @@ namespace JmpModel.Model ...@@ -92,6 +96,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; } public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.EquipmentDetail))] [InverseProperty(nameof(CommonJpEquipmentBoxMark.EquipmentDetail))]
public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; } public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.EquipmentDetail))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentCodeNavigation))] [InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentCodeNavigation))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; } public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentThreshold.EquipmentDetail))] [InverseProperty(nameof(CommonJpEquipmentThreshold.EquipmentDetail))]
......
...@@ -12,10 +12,12 @@ namespace JmpModel.Model ...@@ -12,10 +12,12 @@ namespace JmpModel.Model
{ {
public BaseJpEquipmentSize() public BaseJpEquipmentSize()
{ {
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>(); CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>();
CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>(); CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>(); CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>(); CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>(); CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>(); CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>(); CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>();
...@@ -61,6 +63,8 @@ namespace JmpModel.Model ...@@ -61,6 +63,8 @@ namespace JmpModel.Model
[ForeignKey(nameof(DetailId))] [ForeignKey(nameof(DetailId))]
[InverseProperty(nameof(BaseJpEquipmentDetail.BaseJpEquipmentSizes))] [InverseProperty(nameof(BaseJpEquipmentDetail.BaseJpEquipmentSizes))]
public virtual BaseJpEquipmentDetail Detail { get; set; } public virtual BaseJpEquipmentDetail Detail { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.EquipmentSize))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Size))] [InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Size))]
public virtual ICollection<CommonJpBorrowReturnDetailEstimate> CommonJpBorrowReturnDetailEstimates { get; set; } public virtual ICollection<CommonJpBorrowReturnDetailEstimate> CommonJpBorrowReturnDetailEstimates { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailReality.Size))] [InverseProperty(nameof(CommonJpBorrowReturnDetailReality.Size))]
...@@ -69,6 +73,8 @@ namespace JmpModel.Model ...@@ -69,6 +73,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; } public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.Size))] [InverseProperty(nameof(CommonJpEquipmentBoxMark.Size))]
public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; } public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.EquipmentSize))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentSizecodeNavigation))] [InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentSizecodeNavigation))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; } public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentThreshold.EquipmentSize))] [InverseProperty(nameof(CommonJpEquipmentThreshold.EquipmentSize))]
......
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
#nullable disable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace JmpModel.Model
{
[Table("base_jp_message_reminder_config")]
public partial class BaseJpMessageReminderConfig
{
[Key]
[Column("id")]
[StringLength(36)]
public string Id { get; set; }
[Column("createTime", TypeName = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 组织机构id
/// </summary>
[Required]
[Column("orgId")]
[StringLength(36)]
public string OrgId { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column("updateTime", TypeName = "datetime")]
public DateTime? UpdateTime { get; set; }
/// <summary>
/// 更新用户id
/// </summary>
[Column("updateUserId")]
[StringLength(36)]
public string UpdateUserId { get; set; }
/// <summary>
/// 更新用户名称
/// </summary>
[Column("updateUserName")]
[StringLength(255)]
public string UpdateUserName { get; set; }
/// <summary>
/// 是否推送上级:超期未报废
/// </summary>
[Column("isPushParentWithFixed")]
public bool IsPushParentWithFixed { get; set; }
/// <summary>
/// 是否推送上级:超期未还
/// </summary>
[Column("isPushParentWithBorrow")]
public bool IsPushParentWithBorrow { get; set; }
/// <summary>
/// 是否推送上级:非本仓库装备
/// </summary>
[Column("isPushParentWithFailWarehouse")]
public bool IsPushParentWithFailWarehouse { get; set; }
/// <summary>
/// 装备配置json
/// </summary>
[Column("equipmentJson", TypeName = "text")]
public string EquipmentJson { get; set; }
/// <summary>
/// 是否启用
/// </summary>
[Column("enable")]
public bool Enable { get; set; }
[ForeignKey(nameof(OrgId))]
[InverseProperty(nameof(BaseJpOrganization.BaseJpMessageReminderConfigs))]
public virtual BaseJpOrganization Org { get; set; }
[ForeignKey(nameof(UpdateUserId))]
[InverseProperty(nameof(CommonJpUser.BaseJpMessageReminderConfigs))]
public virtual CommonJpUser UpdateUser { get; set; }
}
}
\ No newline at end of file
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
#nullable disable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace JmpModel.Model
{
[Table("base_jp_message_reminder_log")]
public partial class BaseJpMessageReminderLog
{
public BaseJpMessageReminderLog()
{
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
}
[Key]
[Column("id")]
[StringLength(36)]
public string Id { get; set; }
[Column("createTime", TypeName = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 消息提醒类型:
/// 已超期未报废 0
/// 超期未归还 1
/// 非本仓库装备 2
/// </summary>
[Column("type")]
public int Type { get; set; }
/// <summary>
/// 组织机构id
/// </summary>
[Column("orgId")]
[StringLength(36)]
public string OrgId { get; set; }
/// <summary>
/// 组织机构名称
/// </summary>
[Column("orgName")]
[StringLength(255)]
public string OrgName { get; set; }
/// <summary>
/// 装备数量
/// </summary>
[Column("equCount")]
public int EquCount { get; set; }
/// <summary>
/// 配置id
/// </summary>
[Column("configId")]
[StringLength(36)]
public string ConfigId { get; set; }
/// <summary>
/// 是否推送上级
/// </summary>
[Column("isNeedPushParent")]
public bool IsNeedPushParent { get; set; }
/// <summary>
/// 上级组织机构id
/// </summary>
[Column("parentOrgId")]
[StringLength(36)]
public string ParentOrgId { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.Log))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
}
}
\ No newline at end of file
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
#nullable disable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace JmpModel.Model
{
[Table("base_jp_message_reminder_log_detail")]
public partial class BaseJpMessageReminderLogDetail
{
[Key]
[Column("id")]
[StringLength(36)]
public string Id { get; set; }
[Column("createTime", TypeName = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 提醒记录id
/// </summary>
[Column("logId")]
[StringLength(36)]
public string LogId { get; set; }
/// <summary>
/// 装备id
/// </summary>
[Column("inventoryId")]
[StringLength(36)]
public string InventoryId { get; set; }
/// <summary>
/// epc
/// </summary>
[Column("epc")]
[StringLength(255)]
public string Epc { get; set; }
/// <summary>
/// 装备类型id
/// </summary>
[Column("equipmentDetailId")]
[StringLength(36)]
public string EquipmentDetailId { get; set; }
/// <summary>
/// 装备类型名称
/// </summary>
[Column("equipmentDetailName")]
[StringLength(255)]
public string EquipmentDetailName { get; set; }
/// <summary>
/// 装备号型id
/// </summary>
[Column("equipmentSizeId")]
[StringLength(36)]
public string EquipmentSizeId { get; set; }
/// <summary>
/// 装备号型名称
/// </summary>
[Column("equipmentSizeName")]
[StringLength(255)]
public string EquipmentSizeName { get; set; }
/// <summary>
/// 仓库id
/// </summary>
[Column("warehouseId")]
[StringLength(36)]
public string WarehouseId { get; set; }
/// <summary>
/// 仓库名称
/// </summary>
[Column("warehouseName")]
[StringLength(255)]
public string WarehouseName { get; set; }
/// <summary>
/// 借用警员id(超期未还)
/// </summary>
[Column("borrowPoliceId")]
[StringLength(36)]
public string BorrowPoliceId { get; set; }
/// <summary>
/// 借用警员姓名(超期未还)
/// </summary>
[Column("borrowPoliceName")]
[StringLength(255)]
public string BorrowPoliceName { get; set; }
/// <summary>
/// 错误入库仓库id(非本仓库装备)
/// </summary>
[Column("failWarehouseId")]
[StringLength(36)]
public string FailWarehouseId { get; set; }
/// <summary>
/// 错误入库仓库名称(非本仓库装备)
/// </summary>
[Column("failWarehouseName")]
[StringLength(255)]
public string FailWarehouseName { get; set; }
[ForeignKey(nameof(BorrowPoliceId))]
[InverseProperty(nameof(BaseJpPoliceman.BaseJpMessageReminderLogDetails))]
public virtual BaseJpPoliceman BorrowPolice { get; set; }
[ForeignKey(nameof(EquipmentDetailId))]
[InverseProperty(nameof(BaseJpEquipmentDetail.BaseJpMessageReminderLogDetails))]
public virtual BaseJpEquipmentDetail EquipmentDetail { get; set; }
[ForeignKey(nameof(EquipmentSizeId))]
[InverseProperty(nameof(BaseJpEquipmentSize.BaseJpMessageReminderLogDetails))]
public virtual BaseJpEquipmentSize EquipmentSize { get; set; }
[ForeignKey(nameof(FailWarehouseId))]
[InverseProperty(nameof(BaseJpWarehouse.BaseJpMessageReminderLogDetailFailWarehouses))]
public virtual BaseJpWarehouse FailWarehouse { get; set; }
[ForeignKey(nameof(InventoryId))]
[InverseProperty(nameof(CommonJpEquipmentInventory.BaseJpMessageReminderLogDetails))]
public virtual CommonJpEquipmentInventory Inventory { get; set; }
[ForeignKey(nameof(LogId))]
[InverseProperty(nameof(BaseJpMessageReminderLog.BaseJpMessageReminderLogDetails))]
public virtual BaseJpMessageReminderLog Log { get; set; }
[ForeignKey(nameof(WarehouseId))]
[InverseProperty(nameof(BaseJpWarehouse.BaseJpMessageReminderLogDetailWarehouses))]
public virtual BaseJpWarehouse Warehouse { get; set; }
}
}
\ No newline at end of file
...@@ -15,6 +15,7 @@ namespace JmpModel.Model ...@@ -15,6 +15,7 @@ namespace JmpModel.Model
BaseJpBags = new HashSet<BaseJpBag>(); BaseJpBags = new HashSet<BaseJpBag>();
BaseJpCabinetOutinlogs = new HashSet<BaseJpCabinetOutinlog>(); BaseJpCabinetOutinlogs = new HashSet<BaseJpCabinetOutinlog>();
BaseJpCabinets = new HashSet<BaseJpCabinet>(); BaseJpCabinets = new HashSet<BaseJpCabinet>();
BaseJpMessageReminderConfigs = new HashSet<BaseJpMessageReminderConfig>();
BaseJpModels = new HashSet<BaseJpModel>(); BaseJpModels = new HashSet<BaseJpModel>();
BaseJpOrganizationOrderCounts = new HashSet<BaseJpOrganizationOrderCount>(); BaseJpOrganizationOrderCounts = new HashSet<BaseJpOrganizationOrderCount>();
BaseJpPolicemen = new HashSet<BaseJpPoliceman>(); BaseJpPolicemen = new HashSet<BaseJpPoliceman>();
...@@ -22,6 +23,8 @@ namespace JmpModel.Model ...@@ -22,6 +23,8 @@ namespace JmpModel.Model
CommonJpBorrowReturnApplies = new HashSet<CommonJpBorrowReturnApply>(); CommonJpBorrowReturnApplies = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>(); CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>(); CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentFailWarehouseStateFailOrgs = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentFailWarehouseStateTrueOrgs = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>(); CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>(); CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>(); CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
...@@ -109,6 +112,8 @@ namespace JmpModel.Model ...@@ -109,6 +112,8 @@ namespace JmpModel.Model
public virtual ICollection<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; } public virtual ICollection<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; }
[InverseProperty(nameof(BaseJpCabinet.Organization))] [InverseProperty(nameof(BaseJpCabinet.Organization))]
public virtual ICollection<BaseJpCabinet> BaseJpCabinets { get; set; } public virtual ICollection<BaseJpCabinet> BaseJpCabinets { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderConfig.Org))]
public virtual ICollection<BaseJpMessageReminderConfig> BaseJpMessageReminderConfigs { get; set; }
[InverseProperty(nameof(BaseJpModel.Org))] [InverseProperty(nameof(BaseJpModel.Org))]
public virtual ICollection<BaseJpModel> BaseJpModels { get; set; } public virtual ICollection<BaseJpModel> BaseJpModels { get; set; }
[InverseProperty(nameof(BaseJpOrganizationOrderCount.Org))] [InverseProperty(nameof(BaseJpOrganizationOrderCount.Org))]
...@@ -123,6 +128,10 @@ namespace JmpModel.Model ...@@ -123,6 +128,10 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; } public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecord.Org))] [InverseProperty(nameof(CommonJpChannelMonitorRecord.Org))]
public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; } public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.FailOrg))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStateFailOrgs { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.TrueOrg))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStateTrueOrgs { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.Org))] [InverseProperty(nameof(CommonJpEquipmentInventory.Org))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; } public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentState.Org))] [InverseProperty(nameof(CommonJpEquipmentState.Org))]
......
...@@ -13,12 +13,14 @@ namespace JmpModel.Model ...@@ -13,12 +13,14 @@ namespace JmpModel.Model
public BaseJpPoliceman() public BaseJpPoliceman()
{ {
BaseJpCabinetPolicemen = new HashSet<BaseJpCabinetPoliceman>(); BaseJpCabinetPolicemen = new HashSet<BaseJpCabinetPoliceman>();
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpPolicefingers = new HashSet<BaseJpPolicefinger>(); BaseJpPolicefingers = new HashSet<BaseJpPolicefinger>();
CommonJpBorrowReturnApplyApplies = new HashSet<CommonJpBorrowReturnApply>(); CommonJpBorrowReturnApplyApplies = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturnApplyApprovalPersonNavigations = new HashSet<CommonJpBorrowReturnApply>(); CommonJpBorrowReturnApplyApprovalPersonNavigations = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturnApplyPolices = new HashSet<CommonJpBorrowReturnApply>(); CommonJpBorrowReturnApplyPolices = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>(); CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>(); CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>(); CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>(); CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>(); CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
...@@ -99,6 +101,8 @@ namespace JmpModel.Model ...@@ -99,6 +101,8 @@ namespace JmpModel.Model
public virtual BaseJpOrganization OrgizationCodeNavigation { get; set; } public virtual BaseJpOrganization OrgizationCodeNavigation { get; set; }
[InverseProperty(nameof(BaseJpCabinetPoliceman.Policeman))] [InverseProperty(nameof(BaseJpCabinetPoliceman.Policeman))]
public virtual ICollection<BaseJpCabinetPoliceman> BaseJpCabinetPolicemen { get; set; } public virtual ICollection<BaseJpCabinetPoliceman> BaseJpCabinetPolicemen { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.BorrowPolice))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(BaseJpPolicefinger.Police))] [InverseProperty(nameof(BaseJpPolicefinger.Police))]
public virtual ICollection<BaseJpPolicefinger> BaseJpPolicefingers { get; set; } public virtual ICollection<BaseJpPolicefinger> BaseJpPolicefingers { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnApply.Apply))] [InverseProperty(nameof(CommonJpBorrowReturnApply.Apply))]
...@@ -111,6 +115,8 @@ namespace JmpModel.Model ...@@ -111,6 +115,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; } public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecord.Police))] [InverseProperty(nameof(CommonJpChannelMonitorRecord.Police))]
public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; } public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.Police))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentHistory.OperatorNavigation))] [InverseProperty(nameof(CommonJpEquipmentHistory.OperatorNavigation))]
public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; } public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.PoliceCodeNavigation))] [InverseProperty(nameof(CommonJpEquipmentInventory.PoliceCodeNavigation))]
......
...@@ -12,6 +12,8 @@ namespace JmpModel.Model ...@@ -12,6 +12,8 @@ namespace JmpModel.Model
{ {
public BaseJpWarehouse() public BaseJpWarehouse()
{ {
BaseJpMessageReminderLogDetailFailWarehouses = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpMessageReminderLogDetailWarehouses = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpShelfInfos = new HashSet<BaseJpShelfInfo>(); BaseJpShelfInfos = new HashSet<BaseJpShelfInfo>();
BaseJpWarehouseDevHistories = new HashSet<BaseJpWarehouseDevHistory>(); BaseJpWarehouseDevHistories = new HashSet<BaseJpWarehouseDevHistory>();
BaseJpWarehouseDevs = new HashSet<BaseJpWarehouseDev>(); BaseJpWarehouseDevs = new HashSet<BaseJpWarehouseDev>();
...@@ -22,6 +24,8 @@ namespace JmpModel.Model ...@@ -22,6 +24,8 @@ namespace JmpModel.Model
CommonJpChannelCfgs = new HashSet<CommonJpChannelCfg>(); CommonJpChannelCfgs = new HashSet<CommonJpChannelCfg>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>(); CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>(); CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStateFailWarehouses = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentFailWarehouseStateTrueWarehouses = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>(); CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>(); CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>(); CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
...@@ -101,6 +105,10 @@ namespace JmpModel.Model ...@@ -101,6 +105,10 @@ namespace JmpModel.Model
[ForeignKey(nameof(OrgizationId))] [ForeignKey(nameof(OrgizationId))]
[InverseProperty(nameof(BaseJpOrganization.BaseJpWarehouses))] [InverseProperty(nameof(BaseJpOrganization.BaseJpWarehouses))]
public virtual BaseJpOrganization Orgization { get; set; } public virtual BaseJpOrganization Orgization { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.FailWarehouse))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetailFailWarehouses { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.Warehouse))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetailWarehouses { get; set; }
[InverseProperty(nameof(BaseJpShelfInfo.Warehouse))] [InverseProperty(nameof(BaseJpShelfInfo.Warehouse))]
public virtual ICollection<BaseJpShelfInfo> BaseJpShelfInfos { get; set; } public virtual ICollection<BaseJpShelfInfo> BaseJpShelfInfos { get; set; }
[InverseProperty(nameof(BaseJpWarehouseDevHistory.Warehouse))] [InverseProperty(nameof(BaseJpWarehouseDevHistory.Warehouse))]
...@@ -121,6 +129,10 @@ namespace JmpModel.Model ...@@ -121,6 +129,10 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; } public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.Warehouse))] [InverseProperty(nameof(CommonJpEquipmentBoxMark.Warehouse))]
public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; } public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.FailWarehouse))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStateFailWarehouses { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.TrueWarehouse))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStateTrueWarehouses { get; set; }
[InverseProperty(nameof(CommonJpEquipmentHistory.WarehouseNavigation))] [InverseProperty(nameof(CommonJpEquipmentHistory.WarehouseNavigation))]
public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; } public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.WarehouseCodeNavigation))] [InverseProperty(nameof(CommonJpEquipmentInventory.WarehouseCodeNavigation))]
......
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
#nullable disable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace JmpModel.Model
{
[Table("common_jp_equipment_fail_warehouse_state")]
public partial class CommonJpEquipmentFailWarehouseState
{
[Key]
[Column("id")]
[StringLength(36)]
public string Id { get; set; }
[Column("createTime", TypeName = "datetime")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 装备id
/// </summary>
[Column("inventoryId")]
[StringLength(36)]
public string InventoryId { get; set; }
/// <summary>
/// epc
/// </summary>
[Column("epc")]
[StringLength(255)]
public string Epc { get; set; }
/// <summary>
/// 装备类型id
/// </summary>
[Column("equipmentDetailId")]
[StringLength(36)]
public string EquipmentDetailId { get; set; }
/// <summary>
/// 装备类型名称
/// </summary>
[Column("equipmentDetailName")]
[StringLength(255)]
public string EquipmentDetailName { get; set; }
/// <summary>
/// 装备号型id
/// </summary>
[Column("equipmentSizeId")]
[StringLength(36)]
public string EquipmentSizeId { get; set; }
/// <summary>
/// 装备号型名称
/// </summary>
[Column("equipmentSizeName")]
[StringLength(255)]
public string EquipmentSizeName { get; set; }
/// <summary>
/// 警员id
/// </summary>
[Column("policeId")]
[StringLength(36)]
public string PoliceId { get; set; }
/// <summary>
/// 警员姓名
/// </summary>
[Column("policeName")]
[StringLength(255)]
public string PoliceName { get; set; }
/// <summary>
/// 出入库类型:
/// 出库 0
/// 入库 1
///
/// </summary>
[Column("outInState")]
public int? OutInState { get; set; }
/// <summary>
/// 错误仓库id
/// </summary>
[Column("failWarehouseId")]
[StringLength(36)]
public string FailWarehouseId { get; set; }
/// <summary>
/// 错误仓库名称
/// </summary>
[Column("failWarehouseName")]
[StringLength(255)]
public string FailWarehouseName { get; set; }
/// <summary>
/// 错误组织机构id
/// </summary>
[Column("failOrgId")]
[StringLength(36)]
public string FailOrgId { get; set; }
/// <summary>
/// 错误组织机构名称
/// </summary>
[Column("failOrgName")]
[StringLength(255)]
public string FailOrgName { get; set; }
/// <summary>
/// 正确仓库id
/// </summary>
[Column("trueWarehouseId")]
[StringLength(36)]
public string TrueWarehouseId { get; set; }
/// <summary>
/// 正确仓库名称
/// </summary>
[Column("trueWarehouseName")]
[StringLength(255)]
public string TrueWarehouseName { get; set; }
/// <summary>
/// 正确组织机构id
/// </summary>
[Column("trueOrgId")]
[StringLength(36)]
public string TrueOrgId { get; set; }
/// <summary>
/// 正确组织机构名称
/// </summary>
[Column("trueOrgName")]
[StringLength(255)]
public string TrueOrgName { get; set; }
/// <summary>
/// 抓拍照片
/// </summary>
[Column("picUrl")]
[StringLength(255)]
public string PicUrl { get; set; }
/// <summary>
/// 是否已完成(完成一次完整出入库)
/// </summary>
[Column("isCompleted")]
public bool IsCompleted { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column("updateTime", TypeName = "datetime")]
public DateTime? UpdateTime { get; set; }
[ForeignKey(nameof(EquipmentDetailId))]
[InverseProperty(nameof(BaseJpEquipmentDetail.CommonJpEquipmentFailWarehouseStates))]
public virtual BaseJpEquipmentDetail EquipmentDetail { get; set; }
[ForeignKey(nameof(EquipmentSizeId))]
[InverseProperty(nameof(BaseJpEquipmentSize.CommonJpEquipmentFailWarehouseStates))]
public virtual BaseJpEquipmentSize EquipmentSize { get; set; }
[ForeignKey(nameof(FailOrgId))]
[InverseProperty(nameof(BaseJpOrganization.CommonJpEquipmentFailWarehouseStateFailOrgs))]
public virtual BaseJpOrganization FailOrg { get; set; }
[ForeignKey(nameof(FailWarehouseId))]
[InverseProperty(nameof(BaseJpWarehouse.CommonJpEquipmentFailWarehouseStateFailWarehouses))]
public virtual BaseJpWarehouse FailWarehouse { get; set; }
[ForeignKey(nameof(InventoryId))]
[InverseProperty(nameof(CommonJpEquipmentInventory.CommonJpEquipmentFailWarehouseStates))]
public virtual CommonJpEquipmentInventory Inventory { get; set; }
[ForeignKey(nameof(PoliceId))]
[InverseProperty(nameof(BaseJpPoliceman.CommonJpEquipmentFailWarehouseStates))]
public virtual BaseJpPoliceman Police { get; set; }
[ForeignKey(nameof(TrueOrgId))]
[InverseProperty(nameof(BaseJpOrganization.CommonJpEquipmentFailWarehouseStateTrueOrgs))]
public virtual BaseJpOrganization TrueOrg { get; set; }
[ForeignKey(nameof(TrueWarehouseId))]
[InverseProperty(nameof(BaseJpWarehouse.CommonJpEquipmentFailWarehouseStateTrueWarehouses))]
public virtual BaseJpWarehouse TrueWarehouse { get; set; }
}
}
\ No newline at end of file
...@@ -12,7 +12,9 @@ namespace JmpModel.Model ...@@ -12,7 +12,9 @@ namespace JmpModel.Model
{ {
public CommonJpEquipmentInventory() public CommonJpEquipmentInventory()
{ {
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>(); CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>(); CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
CommonJpInventoryDetails = new HashSet<CommonJpInventoryDetail>(); CommonJpInventoryDetails = new HashSet<CommonJpInventoryDetail>();
} }
...@@ -203,8 +205,12 @@ namespace JmpModel.Model ...@@ -203,8 +205,12 @@ namespace JmpModel.Model
[ForeignKey(nameof(WarehouseCode))] [ForeignKey(nameof(WarehouseCode))]
[InverseProperty(nameof(BaseJpWarehouse.CommonJpEquipmentInventories))] [InverseProperty(nameof(BaseJpWarehouse.CommonJpEquipmentInventories))]
public virtual BaseJpWarehouse WarehouseCodeNavigation { get; set; } public virtual BaseJpWarehouse WarehouseCodeNavigation { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.Inventory))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecordInventory.Inventory))] [InverseProperty(nameof(CommonJpChannelMonitorRecordInventory.Inventory))]
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; } public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.Inventory))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentState.Eqiupment))] [InverseProperty(nameof(CommonJpEquipmentState.Eqiupment))]
public virtual ICollection<CommonJpEquipmentState> CommonJpEquipmentStates { get; set; } public virtual ICollection<CommonJpEquipmentState> CommonJpEquipmentStates { get; set; }
[InverseProperty(nameof(CommonJpInventoryDetail.Inv))] [InverseProperty(nameof(CommonJpInventoryDetail.Inv))]
......
...@@ -12,6 +12,7 @@ namespace JmpModel.Model ...@@ -12,6 +12,7 @@ namespace JmpModel.Model
{ {
public CommonJpUser() public CommonJpUser()
{ {
BaseJpMessageReminderConfigs = new HashSet<BaseJpMessageReminderConfig>();
BaseJpTempFiles = new HashSet<BaseJpTempFile>(); BaseJpTempFiles = new HashSet<BaseJpTempFile>();
CommonJpInventoryTables = new HashSet<CommonJpInventoryTable>(); CommonJpInventoryTables = new HashSet<CommonJpInventoryTable>();
CommonJpPoliceShiftJobsApplies = new HashSet<CommonJpPoliceShiftJobsApply>(); CommonJpPoliceShiftJobsApplies = new HashSet<CommonJpPoliceShiftJobsApply>();
...@@ -77,6 +78,8 @@ namespace JmpModel.Model ...@@ -77,6 +78,8 @@ namespace JmpModel.Model
[ForeignKey(nameof(PoliceId))] [ForeignKey(nameof(PoliceId))]
[InverseProperty(nameof(BaseJpPoliceman.CommonJpUsers))] [InverseProperty(nameof(BaseJpPoliceman.CommonJpUsers))]
public virtual BaseJpPoliceman Police { get; set; } public virtual BaseJpPoliceman Police { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderConfig.UpdateUser))]
public virtual ICollection<BaseJpMessageReminderConfig> BaseJpMessageReminderConfigs { get; set; }
[InverseProperty(nameof(BaseJpTempFile.UploadUser))] [InverseProperty(nameof(BaseJpTempFile.UploadUser))]
public virtual ICollection<BaseJpTempFile> BaseJpTempFiles { get; set; } public virtual ICollection<BaseJpTempFile> BaseJpTempFiles { get; set; }
[InverseProperty(nameof(CommonJpInventoryTable.User))] [InverseProperty(nameof(CommonJpInventoryTable.User))]
......
...@@ -23,7 +23,6 @@ namespace JmpModel.Model.DataContext ...@@ -23,7 +23,6 @@ namespace JmpModel.Model.DataContext
public virtual DbSet<BaseCharge> BaseCharges { get; set; } public virtual DbSet<BaseCharge> BaseCharges { get; set; }
public virtual DbSet<BaseJpBag> BaseJpBags { get; set; } public virtual DbSet<BaseJpBag> BaseJpBags { get; set; }
public virtual DbSet<BaseJpBagMap> BaseJpBagMaps { get; set; } public virtual DbSet<BaseJpBagMap> BaseJpBagMaps { get; set; }
public virtual DbSet<useCountResult> useCountResult { get; set; }
public virtual DbSet<BaseJpCabinet> BaseJpCabinets { get; set; } public virtual DbSet<BaseJpCabinet> BaseJpCabinets { get; set; }
public virtual DbSet<BaseJpCabinetInvErrorMsg> BaseJpCabinetInvErrorMsgs { get; set; } public virtual DbSet<BaseJpCabinetInvErrorMsg> BaseJpCabinetInvErrorMsgs { get; set; }
public virtual DbSet<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; } public virtual DbSet<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; }
...@@ -35,6 +34,9 @@ namespace JmpModel.Model.DataContext ...@@ -35,6 +34,9 @@ namespace JmpModel.Model.DataContext
public virtual DbSet<BaseJpEquipmentSize> BaseJpEquipmentSizes { get; set; } public virtual DbSet<BaseJpEquipmentSize> BaseJpEquipmentSizes { get; set; }
public virtual DbSet<BaseJpKeyValue> BaseJpKeyValues { get; set; } public virtual DbSet<BaseJpKeyValue> BaseJpKeyValues { get; set; }
public virtual DbSet<BaseJpLog> BaseJpLogs { get; set; } public virtual DbSet<BaseJpLog> BaseJpLogs { get; set; }
public virtual DbSet<BaseJpMessageReminderConfig> BaseJpMessageReminderConfigs { get; set; }
public virtual DbSet<BaseJpMessageReminderLog> BaseJpMessageReminderLogs { get; set; }
public virtual DbSet<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
public virtual DbSet<BaseJpModel> BaseJpModels { get; set; } public virtual DbSet<BaseJpModel> BaseJpModels { get; set; }
public virtual DbSet<BaseJpOrganization> BaseJpOrganizations { get; set; } public virtual DbSet<BaseJpOrganization> BaseJpOrganizations { get; set; }
public virtual DbSet<BaseJpOrganizationOrderCount> BaseJpOrganizationOrderCounts { get; set; } public virtual DbSet<BaseJpOrganizationOrderCount> BaseJpOrganizationOrderCounts { get; set; }
...@@ -64,6 +66,7 @@ namespace JmpModel.Model.DataContext ...@@ -64,6 +66,7 @@ namespace JmpModel.Model.DataContext
public virtual DbSet<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; } public virtual DbSet<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
public virtual DbSet<CommonJpEpcGscode> CommonJpEpcGscodes { get; set; } public virtual DbSet<CommonJpEpcGscode> CommonJpEpcGscodes { get; set; }
public virtual DbSet<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; } public virtual DbSet<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
public virtual DbSet<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
public virtual DbSet<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; } public virtual DbSet<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; }
public virtual DbSet<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; } public virtual DbSet<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
public virtual DbSet<CommonJpEquipmentState> CommonJpEquipmentStates { get; set; } public virtual DbSet<CommonJpEquipmentState> CommonJpEquipmentStates { get; set; }
...@@ -126,7 +129,7 @@ namespace JmpModel.Model.DataContext ...@@ -126,7 +129,7 @@ namespace JmpModel.Model.DataContext
if (!optionsBuilder.IsConfigured) if (!optionsBuilder.IsConfigured)
{ {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
optionsBuilder.UseSqlServer("Data Source=192.168.3.188;Initial Catalog=junmppolicesql1115_3;Persist Security Info=True;User ID=sa;Password=Junmp123"); optionsBuilder.UseSqlServer("Data Source=192.168.3.188;Initial Catalog=junmppolicesqldev;Persist Security Info=True;User ID=sa;Password=Junmp123");
} }
} }
...@@ -470,6 +473,168 @@ namespace JmpModel.Model.DataContext ...@@ -470,6 +473,168 @@ namespace JmpModel.Model.DataContext
entity.Property(e => e.Username).IsUnicode(false); entity.Property(e => e.Username).IsUnicode(false);
}); });
modelBuilder.Entity<BaseJpMessageReminderConfig>(entity =>
{
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.Enable).HasComment("是否启用");
entity.Property(e => e.EquipmentJson).HasComment("装备配置json");
entity.Property(e => e.IsPushParentWithBorrow).HasComment("是否推送上级:超期未还");
entity.Property(e => e.IsPushParentWithFailWarehouse).HasComment("是否推送上级:非本仓库装备");
entity.Property(e => e.IsPushParentWithFixed).HasComment("是否推送上级:超期未报废");
entity.Property(e => e.OrgId)
.IsUnicode(false)
.HasComment("组织机构id");
entity.Property(e => e.UpdateTime).HasComment("更新时间");
entity.Property(e => e.UpdateUserId)
.IsUnicode(false)
.HasComment("更新用户id");
entity.Property(e => e.UpdateUserName)
.IsUnicode(false)
.HasComment("更新用户名称");
entity.HasOne(d => d.Org)
.WithMany(p => p.BaseJpMessageReminderConfigs)
.HasForeignKey(d => d.OrgId)
.OnDelete(DeleteBehavior.ClientSetNull)
.HasConstraintName("FK__base_jp_m__orgId__2AC04CAA");
entity.HasOne(d => d.UpdateUser)
.WithMany(p => p.BaseJpMessageReminderConfigs)
.HasForeignKey(d => d.UpdateUserId)
.HasConstraintName("FK__base_jp_m__updat__2BB470E3");
});
modelBuilder.Entity<BaseJpMessageReminderLog>(entity =>
{
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.ConfigId)
.IsUnicode(false)
.HasComment("配置id");
entity.Property(e => e.EquCount).HasComment("装备数量");
entity.Property(e => e.IsNeedPushParent).HasComment("是否推送上级");
entity.Property(e => e.OrgId)
.IsUnicode(false)
.HasComment("组织机构id");
entity.Property(e => e.OrgName)
.IsUnicode(false)
.HasComment("组织机构名称");
entity.Property(e => e.ParentOrgId)
.IsUnicode(false)
.HasComment("上级组织机构id");
entity.Property(e => e.Type).HasComment(@"消息提醒类型:
已超期未报废 0
超期未归还 1
非本仓库装备 2");
});
modelBuilder.Entity<BaseJpMessageReminderLogDetail>(entity =>
{
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.BorrowPoliceId)
.IsUnicode(false)
.HasComment("借用警员id(超期未还)");
entity.Property(e => e.BorrowPoliceName)
.IsUnicode(false)
.HasComment("借用警员姓名(超期未还)");
entity.Property(e => e.Epc)
.IsUnicode(false)
.HasComment("epc");
entity.Property(e => e.EquipmentDetailId)
.IsUnicode(false)
.HasComment("装备类型id");
entity.Property(e => e.EquipmentDetailName)
.IsUnicode(false)
.HasComment("装备类型名称");
entity.Property(e => e.EquipmentSizeId)
.IsUnicode(false)
.HasComment("装备号型id");
entity.Property(e => e.EquipmentSizeName)
.IsUnicode(false)
.HasComment("装备号型名称");
entity.Property(e => e.FailWarehouseId)
.IsUnicode(false)
.HasComment("错误入库仓库id(非本仓库装备)");
entity.Property(e => e.FailWarehouseName)
.IsUnicode(false)
.HasComment("错误入库仓库名称(非本仓库装备)");
entity.Property(e => e.InventoryId)
.IsUnicode(false)
.HasComment("装备id");
entity.Property(e => e.LogId)
.IsUnicode(false)
.HasComment("提醒记录id");
entity.Property(e => e.WarehouseId)
.IsUnicode(false)
.HasComment("仓库id");
entity.Property(e => e.WarehouseName)
.IsUnicode(false)
.HasComment("仓库名称");
entity.HasOne(d => d.BorrowPolice)
.WithMany(p => p.BaseJpMessageReminderLogDetails)
.HasForeignKey(d => d.BorrowPoliceId)
.HasConstraintName("FK__base_jp_m__borro__335592AB");
entity.HasOne(d => d.EquipmentDetail)
.WithMany(p => p.BaseJpMessageReminderLogDetails)
.HasForeignKey(d => d.EquipmentDetailId)
.HasConstraintName("FK__base_jp_m__equip__30792600");
entity.HasOne(d => d.EquipmentSize)
.WithMany(p => p.BaseJpMessageReminderLogDetails)
.HasForeignKey(d => d.EquipmentSizeId)
.HasConstraintName("FK__base_jp_m__equip__316D4A39");
entity.HasOne(d => d.FailWarehouse)
.WithMany(p => p.BaseJpMessageReminderLogDetailFailWarehouses)
.HasForeignKey(d => d.FailWarehouseId)
.HasConstraintName("FK__base_jp_m__failW__3449B6E4");
entity.HasOne(d => d.Inventory)
.WithMany(p => p.BaseJpMessageReminderLogDetails)
.HasForeignKey(d => d.InventoryId)
.HasConstraintName("FK__base_jp_m__inven__2F8501C7");
entity.HasOne(d => d.Log)
.WithMany(p => p.BaseJpMessageReminderLogDetails)
.HasForeignKey(d => d.LogId)
.HasConstraintName("FK__base_jp_m__logId__2E90DD8E");
entity.HasOne(d => d.Warehouse)
.WithMany(p => p.BaseJpMessageReminderLogDetailWarehouses)
.HasForeignKey(d => d.WarehouseId)
.HasConstraintName("FK__base_jp_m__wareh__32616E72");
});
modelBuilder.Entity<BaseJpModel>(entity => modelBuilder.Entity<BaseJpModel>(entity =>
{ {
entity.Property(e => e.Id).IsUnicode(false); entity.Property(e => e.Id).IsUnicode(false);
...@@ -926,10 +1091,7 @@ Smart:智能货架 ...@@ -926,10 +1091,7 @@ Smart:智能货架
entity.Property(e => e.ParentName).IsUnicode(false); entity.Property(e => e.ParentName).IsUnicode(false);
}); });
modelBuilder.Entity<useCountResult>(entity =>
{
entity.HasNoKey();
});
modelBuilder.Entity<ColumnConfig>(entity => modelBuilder.Entity<ColumnConfig>(entity =>
{ {
entity.Property(e => e.ColumnName).IsUnicode(false); entity.Property(e => e.ColumnName).IsUnicode(false);
...@@ -1418,6 +1580,128 @@ Smart:智能货架 ...@@ -1418,6 +1580,128 @@ Smart:智能货架
.HasConstraintName("FK__common_jp__wareh__7A1D154F"); .HasConstraintName("FK__common_jp__wareh__7A1D154F");
}); });
modelBuilder.Entity<CommonJpEquipmentFailWarehouseState>(entity =>
{
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.Epc)
.IsUnicode(false)
.HasComment("epc");
entity.Property(e => e.EquipmentDetailId)
.IsUnicode(false)
.HasComment("装备类型id");
entity.Property(e => e.EquipmentDetailName)
.IsUnicode(false)
.HasComment("装备类型名称");
entity.Property(e => e.EquipmentSizeId)
.IsUnicode(false)
.HasComment("装备号型id");
entity.Property(e => e.EquipmentSizeName)
.IsUnicode(false)
.HasComment("装备号型名称");
entity.Property(e => e.FailOrgId)
.IsUnicode(false)
.HasComment("错误组织机构id");
entity.Property(e => e.FailOrgName)
.IsUnicode(false)
.HasComment("错误组织机构名称");
entity.Property(e => e.FailWarehouseId)
.IsUnicode(false)
.HasComment("错误仓库id");
entity.Property(e => e.FailWarehouseName)
.IsUnicode(false)
.HasComment("错误仓库名称");
entity.Property(e => e.InventoryId)
.IsUnicode(false)
.HasComment("装备id");
entity.Property(e => e.IsCompleted).HasComment("是否已完成(完成一次完整出入库)");
entity.Property(e => e.OutInState).HasComment(@"出入库类型:
出库 0
入库 1
");
entity.Property(e => e.PicUrl)
.IsUnicode(false)
.HasComment("抓拍照片");
entity.Property(e => e.PoliceId)
.IsUnicode(false)
.HasComment("警员id");
entity.Property(e => e.PoliceName)
.IsUnicode(false)
.HasComment("警员姓名");
entity.Property(e => e.TrueOrgId)
.IsUnicode(false)
.HasComment("正确组织机构id");
entity.Property(e => e.TrueOrgName)
.IsUnicode(false)
.HasComment("正确组织机构名称");
entity.Property(e => e.TrueWarehouseId)
.IsUnicode(false)
.HasComment("正确仓库id");
entity.Property(e => e.TrueWarehouseName)
.IsUnicode(false)
.HasComment("正确仓库名称");
entity.Property(e => e.UpdateTime).HasComment("更新时间");
entity.HasOne(d => d.EquipmentDetail)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStates)
.HasForeignKey(d => d.EquipmentDetailId)
.HasConstraintName("FK__common_jp__equip__3EC74557");
entity.HasOne(d => d.EquipmentSize)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStates)
.HasForeignKey(d => d.EquipmentSizeId)
.HasConstraintName("FK__common_jp__equip__3FBB6990");
entity.HasOne(d => d.FailOrg)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStateFailOrgs)
.HasForeignKey(d => d.FailOrgId)
.HasConstraintName("FK__common_jp__failO__4297D63B");
entity.HasOne(d => d.FailWarehouse)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStateFailWarehouses)
.HasForeignKey(d => d.FailWarehouseId)
.HasConstraintName("FK__common_jp__failW__41A3B202");
entity.HasOne(d => d.Inventory)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStates)
.HasForeignKey(d => d.InventoryId)
.HasConstraintName("FK__common_jp__inven__3DD3211E");
entity.HasOne(d => d.Police)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStates)
.HasForeignKey(d => d.PoliceId)
.HasConstraintName("FK__common_jp__polic__40AF8DC9");
entity.HasOne(d => d.TrueOrg)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStateTrueOrgs)
.HasForeignKey(d => d.TrueOrgId)
.HasConstraintName("FK__common_jp__trueO__44801EAD");
entity.HasOne(d => d.TrueWarehouse)
.WithMany(p => p.CommonJpEquipmentFailWarehouseStateTrueWarehouses)
.HasForeignKey(d => d.TrueWarehouseId)
.HasConstraintName("FK__common_jp__trueW__438BFA74");
});
modelBuilder.Entity<CommonJpEquipmentHistory>(entity => modelBuilder.Entity<CommonJpEquipmentHistory>(entity =>
{ {
entity.Property(e => e.EquipmentCode).IsUnicode(false); entity.Property(e => e.EquipmentCode).IsUnicode(false);
...@@ -3264,6 +3548,8 @@ Warehouse:仓库"); ...@@ -3264,6 +3548,8 @@ Warehouse:仓库");
entity.Property(e => e.Name).IsUnicode(false); entity.Property(e => e.Name).IsUnicode(false);
entity.Property(e => e.NameJc).IsUnicode(false);
entity.Property(e => e.OrgCode).IsUnicode(false); entity.Property(e => e.OrgCode).IsUnicode(false);
entity.Property(e => e.OrgId).IsUnicode(false); entity.Property(e => e.OrgId).IsUnicode(false);
...@@ -3274,6 +3560,8 @@ Warehouse:仓库"); ...@@ -3274,6 +3560,8 @@ Warehouse:仓库");
entity.Property(e => e.SizeName).IsUnicode(false); entity.Property(e => e.SizeName).IsUnicode(false);
entity.Property(e => e.SortCode).IsUnicode(false);
entity.Property(e => e.TypeName).IsUnicode(false); entity.Property(e => e.TypeName).IsUnicode(false);
entity.Property(e => e.TypeOneId).IsUnicode(false); entity.Property(e => e.TypeOneId).IsUnicode(false);
......
...@@ -9,10 +9,16 @@ namespace JmpModel.Model ...@@ -9,10 +9,16 @@ namespace JmpModel.Model
{ {
public partial class ViewEquipment public partial class ViewEquipment
{ {
[Column("nameJc")]
[StringLength(64)]
public string NameJc { get; set; }
[Required] [Required]
[Column("org_id")] [Column("org_id")]
[StringLength(36)] [StringLength(36)]
public string OrgId { get; set; } public string OrgId { get; set; }
[Column("sortCode")]
[StringLength(36)]
public string SortCode { get; set; }
[Required] [Required]
[Column("org_name")] [Column("org_name")]
[StringLength(255)] [StringLength(255)]
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"ModelNamespace": null, "ModelNamespace": null,
"OutputContextPath": "Model\/DataContext", "OutputContextPath": "Model\/DataContext",
"OutputPath": "Model", "OutputPath": "Model",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "JmpModel", "ProjectRootNamespace": "JmpModel",
"Schemas": null, "Schemas": null,
"SelectedHandlebarsLanguage": 0, "SelectedHandlebarsLanguage": 0,
...@@ -78,6 +79,18 @@ ...@@ -78,6 +79,18 @@
"ObjectType": 0 "ObjectType": 0
}, },
{ {
"Name": "[dbo].[base_jp_message_reminder_config]",
"ObjectType": 0
},
{
"Name": "[dbo].[base_jp_message_reminder_log]",
"ObjectType": 0
},
{
"Name": "[dbo].[base_jp_message_reminder_log_detail]",
"ObjectType": 0
},
{
"Name": "[dbo].[base_jp_model]", "Name": "[dbo].[base_jp_model]",
"ObjectType": 0 "ObjectType": 0
}, },
...@@ -194,6 +207,10 @@ ...@@ -194,6 +207,10 @@
"ObjectType": 0 "ObjectType": 0
}, },
{ {
"Name": "[dbo].[common_jp_equipment_fail_warehouse_state]",
"ObjectType": 0
},
{
"Name": "[dbo].[common_jp_equipment_history]", "Name": "[dbo].[common_jp_equipment_history]",
"ObjectType": 0 "ObjectType": 0
}, },
...@@ -418,7 +435,7 @@ ...@@ -418,7 +435,7 @@
"ObjectType": 3 "ObjectType": 3
} }
], ],
"UiHint": "PC.junmppolicesql1115_3", "UiHint": "pc.junmppolicesqldev.dbo",
"UseBoolPropertiesWithoutDefaultSql": false, "UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false, "UseDatabaseNames": false,
"UseDbContextSplitting": false, "UseDbContextSplitting": false,
...@@ -435,5 +452,6 @@ ...@@ -435,5 +452,6 @@
"UseNodaTime": false, "UseNodaTime": false,
"UseNullableReferences": false, "UseNullableReferences": false,
"UseSchemaFolders": false, "UseSchemaFolders": false,
"UseSpatial": false "UseSpatial": false,
"UseT4": false
} }
\ No newline at end of file
...@@ -19,6 +19,7 @@ using System.Net.Http; ...@@ -19,6 +19,7 @@ using System.Net.Http;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using JunmpPoliceStation.App_Start; using JunmpPoliceStation.App_Start;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Rextec.SOA.Infrastructure; using Rextec.SOA.Infrastructure;
using static JmpModel.Model.Enumerates.BorrowEnum; using static JmpModel.Model.Enumerates.BorrowEnum;
...@@ -6534,7 +6535,9 @@ namespace JunmpPoliceStation.Controllers ...@@ -6534,7 +6535,9 @@ namespace JunmpPoliceStation.Controllers
string policeId = entity.policeId; string policeId = entity.policeId;
string warehouseId = entity.warehouseId; string warehouseId = entity.warehouseId;
string currentState = entity.currentState; string currentState = entity.currentState;
var warehouseInfo = _unitOfWork.WarehouseRepository.Get(p => p.Id == warehouseId); var warehouseInfo = _unitOfWork.DbContext.BaseJpWarehouses
.Include(p => p.Orgization)
.FirstOrDefault(p => p.Id == warehouseId);
if (warehouseInfo.IsLocked == true)//检查仓库是否被锁 if (warehouseInfo.IsLocked == true)//检查仓库是否被锁
{ {
return JsonManager.SimpleStatusResponse(ResultCode.WAREHOUSE_LOCK); return JsonManager.SimpleStatusResponse(ResultCode.WAREHOUSE_LOCK);
...@@ -7216,9 +7219,83 @@ namespace JunmpPoliceStation.Controllers ...@@ -7216,9 +7219,83 @@ namespace JunmpPoliceStation.Controllers
WarehouseName = warehouseInfo.Name, WarehouseName = warehouseInfo.Name,
}); });
} }
} }
#endregion #endregion
//处理非本仓库物资
var failWarehouseInvList = _unitOfWork.EquipmentInventoryRepository
.GetList(x =>
Rfids.Contains(x.Epc) && x.InventoryState != "loss"
&& x.CurrentState != 1 && x.CurrentState != 6 &&
x.WarehouseCode != warehouseId, includes: new[]
{
"EquipmentCodeNavigation",
"EquipmentSizecodeNavigation",
"WarehouseCodeNavigation",
"Org",
});
BaseJpPoliceman police = null;
if (!string.IsNullOrEmpty(policeId))
{
police = _unitOfWork.PolicemanRepository.Get(policeId);
}
foreach (var inventory in failWarehouseInvList)
{
if (currentState.Equals("1"))
{
//入库,无脑存
_unitOfWork.DbContext.CommonJpEquipmentFailWarehouseStates.Add(
new CommonJpEquipmentFailWarehouseState
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
Epc = inventory.Epc,
EquipmentDetailId = inventory.EquipmentCode,
EquipmentDetailName = inventory.EquipmentCodeNavigation?.Name,
EquipmentSizeId = inventory.EquipmentSizecode,
EquipmentSizeName = inventory.EquipmentSizecodeNavigation?.SizeName,
PoliceId = police?.Id,
PoliceName = police?.Name,
OutInState = 1,
FailWarehouseId = warehouseId,
FailWarehouseName = warehouseInfo.Name,
FailOrgId = warehouseInfo.OrgizationId,
FailOrgName = warehouseInfo.Orgization?.Name,
TrueWarehouseId = inventory.WarehouseCode,
TrueWarehouseName = inventory.WarehouseCodeNavigation?.Name,
TrueOrgId = inventory.OrgId,
TrueOrgName = inventory.Org?.Name,
PicUrl = picUrl
});
}
if (currentState.Equals("0"))
{
//出库 判断之前是否有记录
var oldstate = _unitOfWork.DbContext.CommonJpEquipmentFailWarehouseStates
.Where(x => x.Epc == inventory.Epc && x.FailWarehouseId == warehouseId)
.OrderByDescending(x => x.CreateTime)
.FirstOrDefault();
if (oldstate==null)
{
//无之前入库记录,认为误读,过滤
continue;
}
if (oldstate.OutInState==0)
{
//出库 重复出库 过滤
continue;
}
else
{
//入库 出库物资,正常出库并记录
oldstate.IsCompleted = true;
}
}
}
bool errorResult = false; bool errorResult = false;
if (ErrorState.Count > 0) if (ErrorState.Count > 0)
{ {
......
using JmpCommon;
using JmpCommon.Tools;
using JmpModel.Model;
using JmpModel.Model.Enumerates;
using JmpModel.Model.Repository;
using JunmpPoliceStation.App_Start;
using JunmpPoliceStation.Models.Repository;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace JunmpPoliceStation.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class MessageReminderController : ControllerBase
{
private ILogger<MessageReminderController> _logger;
UnitOfWork _unitOfWork;
public MessageReminderController(ILogger<MessageReminderController> logger, UnitOfWork unitOfWork)
{
_logger = logger;
_unitOfWork = unitOfWork;
}
/// <summary>
/// 获取当前组织机构下全部消息推送设置
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "orgId":""
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetMessageReminderConfigByOrgId")]
public async Task<HttpResponseMessage> GetMessageReminderConfigByOrgId([FromBody] JObject jdata)
{
return await Task.Run(() =>
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
string orgId = entity.orgId;
if (string.IsNullOrEmpty(orgId))
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
var org = _unitOfWork.OrganizationRepository.Get(orgId);
if (org == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
var config = _unitOfWork.DbContext
.BaseJpMessageReminderConfigs
.FirstOrDefault(x => x.OrgId == orgId);
if (config == null)
{
//创建默认配置
config = new BaseJpMessageReminderConfig
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
OrgId = orgId,
IsPushParentWithFixed = false,
IsPushParentWithBorrow = false,
IsPushParentWithFailWarehouse = false,
Enable = true
};
_unitOfWork.DbContext.BaseJpMessageReminderConfigs.Add(config);
_unitOfWork.SaveChanges();
}
return JsonManager.ReturnSuccessResponse(new
{
config.Id,
createTime = config.CreateTime,
config.OrgId,
config.UpdateTime,
config.UpdateUserId,
config.UpdateUserName,
config.IsPushParentWithFixed,
config.IsPushParentWithBorrow,
config.IsPushParentWithFailWarehouse,
config.EquipmentJson,
config.Enable
});
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception ex)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
});
}
/// <summary>
/// 保存消息推送设置
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "id":""
/// "orgId":""
/// "updateUserId":""
/// "updateUserName":""
/// "isPushParentWithFixed":""
/// "isPushParentWithBorrow":""
/// "isPushParentWithFailWarehouse":""
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("AddAndUpdateMessageReminderConfig")]
public async Task<HttpResponseMessage> AddAndUpdateMessageReminderConfig([FromBody] JObject jdata)
{
return await Task.Run(() =>
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
string id = entity.id;
string orgId = entity.orgId;
string updateUserId = entity.updateUserId;
string updateUserName = entity.updateUserName;
string equipmentJson = entity.equipmentJson;
bool.TryParse(entity.isPushParentWithFixed, out bool isPushParentWithFixed);
bool.TryParse(entity.isPushParentWithBorrow, out bool isPushParentWithBorrow);
bool.TryParse(entity.isPushParentWithFailWarehouse, out bool isPushParentWithFailWarehouse);
bool.TryParse(entity.enable, out bool enable);
if (string.IsNullOrEmpty(orgId))
{
return JsonManager.SimpleCustResponse("orgId is require");
}
if (string.IsNullOrEmpty(updateUserId))
{
return JsonManager.SimpleCustResponse("updateUserId is require");
}
if (!string.IsNullOrEmpty(id))
{
var old = _unitOfWork.DbContext.BaseJpMessageReminderConfigs.FirstOrDefault(x => x.Id == id);
if (old == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
old.UpdateTime = DateTime.Now;
old.UpdateUserId = updateUserId;
old.UpdateUserName = updateUserName;
old.IsPushParentWithFixed = isPushParentWithFixed;
old.IsPushParentWithBorrow = isPushParentWithBorrow;
old.IsPushParentWithFailWarehouse = isPushParentWithFailWarehouse;
old.Enable = enable;
old.EquipmentJson = equipmentJson;
_unitOfWork.DbContext.BaseJpMessageReminderConfigs.Update(old);
if (_unitOfWork.SaveChanges() > 0)
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
}
else
{
_unitOfWork.DbContext.BaseJpMessageReminderConfigs.Add(new BaseJpMessageReminderConfig
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
OrgId = orgId,
UpdateTime = DateTime.Now,
UpdateUserId = updateUserId,
UpdateUserName = updateUserName,
IsPushParentWithFixed = isPushParentWithFixed,
IsPushParentWithBorrow = isPushParentWithBorrow,
IsPushParentWithFailWarehouse = isPushParentWithFailWarehouse,
Enable = enable,
EquipmentJson= equipmentJson,
});
if (_unitOfWork.SaveChanges() > 0)
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception ex)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
});
}
///// <summary>
///// 保存装备配置json
///// </summary>
///// <remarks>
/////
///// ## 例子
/////
///// {
///// "id":""
///// "equipmentJson":""
///// }
/////
///// </remarks>
///// <param name="jdata"></param>
///// <returns></returns>
//[HttpPost("SaveMessageReminderConfigEquipmentJson")]
//public async Task<HttpResponseMessage> SaveMessageReminderConfigEquipmentJson([FromBody] JObject jdata)
//{
// return await Task.Run(() =>
// {
// try
// {
// if (jdata != null)
// {
// var entity = JsonManager.GetJsonEntity(jdata);
// string id = entity.id;
// string equipmentJson = entity.equipmentJson;
// if (string.IsNullOrEmpty(id))
// {
// return JsonManager.SimpleCustResponse("id is require");
// }
// if (string.IsNullOrEmpty(equipmentJson))
// {
// return JsonManager.SimpleCustResponse("equipmentJson is require");
// }
// var obj = _unitOfWork.DbContext
// .BaseJpMessageReminderConfigs
// .FirstOrDefault(x => x.Id == id);
// if (obj == null)
// {
// return JsonManager.SimpleCustResponse("id is require");
// }
// else
// {
// obj.EquipmentJson = equipmentJson;
// _unitOfWork.DbContext.BaseJpMessageReminderConfigs.Update(obj);
// }
// if (_unitOfWork.SaveChanges() > 0)
// {
// return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_SUCCESS);
// }
// else
// {
// return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
// }
// }
// else
// {
// return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
// }
// }
// catch (Exception ex)
// {
// //_logger.LogError("Login/SignIn 错误:" + ex.ToString());
// return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
// }
// });
//}
/// <summary>
/// 获取当前组织机构下全部消息推送设置
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "orgId":""
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetMessageReminderLog")]
public async Task<HttpResponseMessage> GetMessageReminderLog([FromBody] JObject jdata)
{
return await Task.Run(() =>
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
string orgId = entity.orgId;
if (string.IsNullOrEmpty(orgId))
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
var bjLogList = _unitOfWork.DbContext
.BaseJpMessageReminderLogs
.Where(x => x.OrgId == orgId)
.ToList();
var xjLogList = _unitOfWork.DbContext
.BaseJpMessageReminderLogs
.Where(x => x.ParentOrgId == orgId && x.IsNeedPushParent)
.ToList();
return JsonManager.ReturnSuccessResponse(new
{
bj = bjLogList.Select(x => new
{
id = x.Id,
createTime = x.CreateTime,
type = x.Type,
orgId = x.OrgId,
orgName = x.OrgName,
equCount = x.EquCount,
configId = x.ConfigId,
}),
xj = xjLogList.Select(x => new
{
id = x.Id,
createTime = x.CreateTime,
type = x.Type,
orgId = x.OrgId,
orgName = x.OrgName,
equCount = x.EquCount,
configId = x.ConfigId,
})
});
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception ex)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
});
}
}
}
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using JmpCommon;
using JmpModel.Model;
using JmpModel.Model.DataContext;
using JmpModel.Model.Repository;
using JunmpPoliceStation.Controllers;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Org.BouncyCastle.Asn1.Ocsp;
using NLog.Fluent;
using Z.EntityFramework.Plus;
namespace JunmpPoliceStation.Extensions
{
public class CronJob
{
JunmppolicesqlContext _dbContext;
private IConfiguration Configuration;
private ILogger<CronJob> _logger;
public CronJob(JunmppolicesqlContext dbContext, IConfiguration configuration, ILogger<CronJob> logger)
{
_dbContext = dbContext;
Configuration = configuration;
_logger = logger;
}
public Tuple<string, string> UpdateMessageReminderData()
{
try
{
var configList = _dbContext.BaseJpMessageReminderConfigs
.Include(x => x.Org)
.ToList();
foreach (var config in configList)
{
if (string.IsNullOrEmpty(config.EquipmentJson) || config.Enable == false)
{
//清除老的记录(如果有)
var oldLogs = _dbContext.BaseJpMessageReminderLogs
.Include(x => x.BaseJpMessageReminderLogDetails)
.Where(x => x.OrgId == config.OrgId)
.ToList();
foreach (var log in oldLogs)
{
log.BaseJpMessageReminderLogDetails.Clear();
log.EquCount = 0;
}
_dbContext.BaseJpMessageReminderLogs.UpdateRange(oldLogs);
_dbContext.SaveChanges();
continue;
}
var equConfig = JsonConvert.DeserializeObject<List<MessageReminderConfigEquipment>>(config.EquipmentJson) ?? new List<MessageReminderConfigEquipment>();
//已超期未报废
var chaoqiLog = _dbContext.BaseJpMessageReminderLogs
.Include(x => x.BaseJpMessageReminderLogDetails)
.FirstOrDefault(x => x.OrgId == config.OrgId && x.Type == 0);
if (chaoqiLog == null)
{
chaoqiLog = new BaseJpMessageReminderLog
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
Type = 0,
OrgId = config.OrgId,
OrgName = config.Org.Name,
IsNeedPushParent = config.IsPushParentWithFixed,
ParentOrgId = config.IsPushParentWithFixed ? config.Org.ParentId : null,
ConfigId = config.Id,
EquCount = 0,
};
_dbContext.BaseJpMessageReminderLogs.Add(chaoqiLog);
_dbContext.SaveChanges();
}
var chaoqiEqu = _dbContext.CommonJpEquipmentInventories
.Include(x => x.EquipmentCodeNavigation)
.Include(x => x.EquipmentSizecodeNavigation)
.Include(x => x.WarehouseCodeNavigation)
.Where(x => x.OrgId == config.OrgId && x.SafeLevel == 2 && x.CurrentState != 6 &&
x.InventoryState != "loss")
.ToList();
chaoqiEqu = chaoqiEqu
.Where(x => equConfig.Where(y => y.IsNeedRemind)
.Select(y => y.EquipmentDetailId)
.Contains(x.EquipmentCode))
.ToList();
chaoqiLog.BaseJpMessageReminderLogDetails.Clear();
if (chaoqiEqu.Count > 0)
{
foreach (var item in chaoqiEqu)
{
chaoqiLog.BaseJpMessageReminderLogDetails.Add(new BaseJpMessageReminderLogDetail()
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
LogId = config.Id,
InventoryId = item.Id,
Epc = item.Epc,
EquipmentDetailId = item.EquipmentCode,
EquipmentDetailName = item.EquipmentCodeNavigation.Name,
EquipmentSizeId = item.EquipmentSizecode,
EquipmentSizeName = item.EquipmentSizecodeNavigation.SizeName,
WarehouseId = item.WarehouseCode,
WarehouseName = item.WarehouseCodeNavigation.Name,
});
}
chaoqiLog.EquCount = chaoqiLog.BaseJpMessageReminderLogDetails.Count;
}
else
{
chaoqiLog.EquCount = 0;
}
_dbContext.BaseJpMessageReminderLogs.Update(chaoqiLog);
//超期未还
var borrowLog = _dbContext.BaseJpMessageReminderLogs
.Include(x => x.BaseJpMessageReminderLogDetails)
.FirstOrDefault(x => x.OrgId == config.OrgId && x.Type == 1);
if (borrowLog == null)
{
borrowLog = new BaseJpMessageReminderLog
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
Type = 1,
OrgId = config.OrgId,
OrgName = config.Org.Name,
IsNeedPushParent = config.IsPushParentWithBorrow,
ParentOrgId = config.IsPushParentWithBorrow ? config.Org.ParentId : null,
ConfigId = config.Id,
EquCount = 0,
};
_dbContext.BaseJpMessageReminderLogs.Add(borrowLog);
_dbContext.SaveChanges();
}
borrowLog.EquCount = 0;
var borrowView = _dbContext.VBorrowViews
.Where(x => x.OrgId == config.OrgId && x.ExpectedTime < DateTime.Now).ToList();
foreach (var view in borrowView)
{
var borrow = _dbContext.CommonJpBorrowReturnApplies
.Include(x => x.CommonJpBorrowReturnDetailRealities)
.FirstOrDefault(x => x.Id == view.Id);
foreach (var reality in borrow.CommonJpBorrowReturnDetailRealities.Where(x => x.State != 2))
{
var equConfigSingle = equConfig.FirstOrDefault(x => x.EquipmentDetailId == reality.EquipmentDetailId);
if (equConfigSingle != null && equConfigSingle.OverdueBorrowDay != -1)
{
//计算是否超期未还
if (view.ExpectedTime < DateTime.Now.AddDays(-equConfigSingle.OverdueBorrowDay))
{
//超期
borrowLog.EquCount += reality.InsideRealCount ?? 0 - reality.RealCount ?? 0;
}
}
}
}
_dbContext.BaseJpMessageReminderLogs.Update(borrowLog);
//非本仓库物资
var failWarehouseLog = _dbContext.BaseJpMessageReminderLogs
.Include(x => x.BaseJpMessageReminderLogDetails)
.FirstOrDefault(x => x.OrgId == config.OrgId && x.Type == 2);
if (failWarehouseLog == null)
{
failWarehouseLog = new BaseJpMessageReminderLog
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
Type = 2,
OrgId = config.OrgId,
OrgName = config.Org.Name,
IsNeedPushParent = config.IsPushParentWithFailWarehouse,
ParentOrgId = config.IsPushParentWithFailWarehouse ? config.Org.ParentId : null,
ConfigId = config.Id,
EquCount = 0,
};
_dbContext.BaseJpMessageReminderLogs.Add(failWarehouseLog);
_dbContext.SaveChanges();
}
var failWarehouse = _dbContext.CommonJpEquipmentFailWarehouseStates
.Where(x => x.TrueOrgId == config.OrgId && x.IsCompleted == false)
.ToList();
failWarehouseLog.BaseJpMessageReminderLogDetails.Clear();
if (failWarehouse.Count > 0)
{
foreach (var state in failWarehouse)
{
failWarehouseLog.BaseJpMessageReminderLogDetails.Add(new BaseJpMessageReminderLogDetail
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
LogId = config.Id,
InventoryId = state.InventoryId,
Epc = state.Epc,
EquipmentDetailId = state.EquipmentDetailId,
EquipmentDetailName = state.EquipmentDetailName,
EquipmentSizeId = state.EquipmentSizeId,
EquipmentSizeName = state.EquipmentSizeName,
WarehouseId = state.TrueWarehouseId,
WarehouseName = state.TrueWarehouseName,
FailWarehouseId = state.FailWarehouseId,
FailWarehouseName = state.FailWarehouseName
});
}
failWarehouseLog.EquCount = failWarehouseLog.BaseJpMessageReminderLogDetails.Count;
}
else
{
failWarehouseLog.EquCount = 0;
}
_dbContext.BaseJpMessageReminderLogs.Update(failWarehouseLog);
//每次循环保存一次
_dbContext.SaveChanges();
}
return new Tuple<string, string>("10000", "操作成功");
}
catch (Exception e)
{
_logger.LogError(e, "定时任务工作异常");
return new Tuple<string, string>("19999", "操作失败");
}
}
}
public class respone<T>
{
public int code { get; set; }
public string msg { get; set; }
public T data { get; set; }
}
public class MessageReminderConfigEquipment
{
/// <summary>
/// 装备类型id
/// </summary>
public string EquipmentDetailId { get; set; }
/// <summary>
/// 是否需要提醒(超期未报废)
/// </summary>
public bool IsNeedRemind { get; set; }
/// <summary>
/// 超期未还x天后提醒(-1不提醒)
/// </summary>
public int OverdueBorrowDay { get; set; }
}
}
\ No newline at end of file
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="3.2.2" /> <PackageReference Include="AspNetCoreRateLimit" Version="3.2.2" />
<PackageReference Include="EntityFrameworkProfiler.Appender" Version="6.0.6031" /> <PackageReference Include="EntityFrameworkProfiler.Appender" Version="6.0.6031" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.32" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.7.0" />
<PackageReference Include="LiteDB" Version="5.0.9" /> <PackageReference Include="LiteDB" Version="5.0.9" />
<PackageReference Include="LitJson" Version="0.18.0" /> <PackageReference Include="LitJson" Version="0.18.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="3.1.10" /> <PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="3.1.10" />
......
...@@ -6,6 +6,9 @@ using System.Net.WebSockets; ...@@ -6,6 +6,9 @@ using System.Net.WebSockets;
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Hangfire.MemoryStorage.Entities;
using Hangfire;
using Hangfire.MemoryStorage;
using JmpModel.Model; using JmpModel.Model;
using JmpModel.Model.DataContext; using JmpModel.Model.DataContext;
using JmpModel.Model.Repository; using JmpModel.Model.Repository;
...@@ -139,6 +142,11 @@ namespace JunmpPoliceStation ...@@ -139,6 +142,11 @@ namespace JunmpPoliceStation
//}); //});
services.AddSingleton<MQTTServer>(); services.AddSingleton<MQTTServer>();
services.AddHangfire(configuration => configuration
.UseMemoryStorage());//使用内存
services.AddHangfireServer();//添加hangfire服务
services.AddScoped<CronJob>();//注册执行类
} }
} }
...@@ -188,6 +196,14 @@ namespace JunmpPoliceStation ...@@ -188,6 +196,14 @@ namespace JunmpPoliceStation
}); });
//hangfire
app.UseHangfireDashboard();
using (var scope = app.ApplicationServices.CreateScope())
{
var cronJob = scope.ServiceProvider.GetRequiredService<CronJob>();
RecurringJob.AddOrUpdate(() => cronJob.UpdateMessageReminderData(), "0 0 2 1/1 * *", TimeZoneInfo.Local);
}
//app.UseMvc(routes => //app.UseMvc(routes =>
//{ //{
// routes.MapRoute( // routes.MapRoute(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论