Commit b0e649ce by zxw

Merge branch 'zxw'

parents ea5dfad7 99a8e7a9
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
...@@ -66,6 +66,7 @@ namespace JmpCommon ...@@ -66,6 +66,7 @@ namespace JmpCommon
public static ResultInfo MISSION_ERROR = new ResultInfo { Code = "10047", Msg = "该单据正在任务中或已有物资出入库" }; public static ResultInfo MISSION_ERROR = new ResultInfo { Code = "10047", Msg = "该单据正在任务中或已有物资出入库" };
public static ResultInfo MISSION_EXIST = new ResultInfo { Code = "10048", Msg = "存在进行中的任务" }; public static ResultInfo MISSION_EXIST = new ResultInfo { Code = "10048", Msg = "存在进行中的任务" };
public static ResultInfo ORDER_START = new ResultInfo { Code = "10049", Msg = "物资与单据状态不匹配" }; public static ResultInfo ORDER_START = new ResultInfo { Code = "10049", Msg = "物资与单据状态不匹配" };
public static ResultInfo ACTION_LIMIT = new ResultInfo { Code = "10050", Msg = "接口访问次数上限,请稍后再试" };
} }
/// <summary> /// <summary>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<Compile Remove="Model\DataContext\DbContextExtensions.cs" /> <Compile Remove="Model\DataContext\DbContextExtensions.cs" />
<Compile Remove="Model\DataContext\IJunmppolicesqlContextProcedures.cs" /> <Compile Remove="Model\DataContext\IJunmppolicesqlContextProcedures.cs" />
<Compile Remove="Model\DataContext\JunmppolicesqlContextProcedures.cs" /> <Compile Remove="Model\DataContext\JunmppolicesqlContextProcedures.cs" />
<Compile Remove="Model\UseCountResult.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -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>
[Required]
[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("originalWarehouseId")]
[StringLength(36)]
public string OriginalWarehouseId { get; set; }
/// <summary>
/// 原入库仓库名称(非本仓库装备)
/// </summary>
[Column("originalWarehouseName")]
[StringLength(255)]
public string OriginalWarehouseName { 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(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(OriginalWarehouseId))]
[InverseProperty(nameof(BaseJpWarehouse.BaseJpMessageReminderLogDetailOriginalWarehouses))]
public virtual BaseJpWarehouse OriginalWarehouse { 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()
{ {
BaseJpMessageReminderLogDetailOriginalWarehouses = 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.OriginalWarehouse))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetailOriginalWarehouses { 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))]
......
...@@ -100,6 +100,11 @@ namespace JmpModel.Model ...@@ -100,6 +100,11 @@ namespace JmpModel.Model
[Column("file_url")] [Column("file_url")]
[StringLength(255)] [StringLength(255)]
public string FileUrl { get; set; } public string FileUrl { get; set; }
/// <summary>
/// 是否绑定单警柜(领用)
/// </summary>
[Column("is_bind_cabinet")]
public bool? IsBindCabinet { get; set; }
[ForeignKey(nameof(ApplyId))] [ForeignKey(nameof(ApplyId))]
[InverseProperty(nameof(BaseJpPoliceman.CommonJpBorrowReturnApplyApplies))] [InverseProperty(nameof(BaseJpPoliceman.CommonJpBorrowReturnApplyApplies))]
......
// <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.InventoryId)
.IsUnicode(false)
.HasComment("装备id");
entity.Property(e => e.LogId)
.IsUnicode(false)
.HasComment("提醒记录id");
entity.Property(e => e.OriginalWarehouseId)
.IsUnicode(false)
.HasComment("原入库仓库id(非本仓库装备)");
entity.Property(e => e.OriginalWarehouseName)
.IsUnicode(false)
.HasComment("原入库仓库名称(非本仓库装备)");
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.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.OriginalWarehouse)
.WithMany(p => p.BaseJpMessageReminderLogDetailOriginalWarehouses)
.HasForeignKey(d => d.OriginalWarehouseId)
.HasConstraintName("FK__base_jp_m__failW__3449B6E4");
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);
...@@ -1059,6 +1221,8 @@ Smart:智能货架 ...@@ -1059,6 +1221,8 @@ Smart:智能货架
.IsUnicode(false) .IsUnicode(false)
.HasComment("单据附加文件地址(上传)"); .HasComment("单据附加文件地址(上传)");
entity.Property(e => e.IsBindCabinet).HasComment("是否绑定单警柜(领用)");
entity.Property(e => e.Note).IsUnicode(false); entity.Property(e => e.Note).IsUnicode(false);
entity.Property(e => e.OrderCode).IsUnicode(false); entity.Property(e => e.OrderCode).IsUnicode(false);
...@@ -1418,6 +1582,128 @@ Smart:智能货架 ...@@ -1418,6 +1582,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 +3550,8 @@ Warehouse:仓库"); ...@@ -3264,6 +3550,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 +3562,8 @@ Warehouse:仓库"); ...@@ -3274,6 +3562,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);
......
using JmpModel.Model; using JmpModel.Model;
using JmpModel.Model.DataContext; using JmpModel.Model.DataContext;
using JmpModel.TempModel;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Metadata.Internal;
......
...@@ -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)]
......
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using JmpModel.TempModel;
namespace JmpModel.Model.DataContext
{
public partial class JunmppolicesqlContext
{
partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
{
modelBuilder.Entity<useCountResult>(entity =>
{
entity.HasNoKey();
});
}
}
}
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated> using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace JmpModel.Model namespace JmpModel.TempModel
{ {
[Table("useCount")] [Table("useCount")]
public partial class useCountResult public partial class useCountResult
{ {
[Column("result")] [Column("result")]
......
...@@ -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
using Google.Protobuf.WellKnownTypes;
using JmpCommon;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace JunmpPoliceStation.App_Start
{
public class ActionLimitAttribute : ActionFilterAttribute
{
private ILogger<ActionLimitAttribute> _logger;
public static MemoryCache _cache = new MemoryCache(new MemoryCacheOptions());
public ActionLimitAttribute(ILogger<ActionLimitAttribute> logger)
{
_logger = logger;
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
try
{
//获取访问ip
var userHostAddress = filterContext.HttpContext.Connection.RemoteIpAddress?.MapToIPv4().ToString();
if (!string.IsNullOrEmpty(userHostAddress) && IsIP(userHostAddress))
{
//有效ip
var url = filterContext.ActionDescriptor.RouteValues["controller"] + "/" + filterContext.ActionDescriptor.RouteValues["action"];
_logger.LogDebug("获取访问ip:" + userHostAddress + "地址:api/" + url);
if (userHostAddress == "127.0.0.1")
{
//本地ip过滤
return;
}
var key = userHostAddress + url;
if (Exists(key))
{
int value = int.Parse(Get(key).ToString() ?? string.Empty);
if (value > 25) //每分钟上限访问25次
{
filterContext.Result = new JsonResult(ResultCode.ACTION_LIMIT);
return;
}
else
{
value += 1;
}
AddMemoryCache(key, value);
}
else
{
AddMemoryCache(key, 1);
}
}
}
catch (Exception e)
{
_logger.LogError("ActionLimitAttribute 错误:" + e.ToString());
filterContext.Result = new JsonResult(e.ToString());
}
}
/// <summary>
/// 检查IP地址格式
/// </summary>
/// <param name="ip"></param>
/// <returns></returns>
private static bool IsIP(string ip)
{
return System.Text.RegularExpressions.Regex.IsMatch(ip, @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$");
}
/// <summary>
/// 验证缓存项是否存在
/// </summary>
/// <param name="key">缓存Key</param>
/// <returns></returns>
public static bool Exists(string key)
{
if (key == null)
{
return false;
}
return _cache.TryGetValue(key, out _);
}
/// <summary>
/// 获取缓存
/// </summary>
/// <param name="key">缓存Key</param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
public static object Get(string key)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
if (!Exists(key))
throw new ArgumentNullException(nameof(key));
return _cache.Get(key);
}
/// <summary>
/// 添加缓存
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="ArgumentNullException"></exception>
public static bool AddMemoryCache(string key, object value)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
DateTimeOffset time = DateTimeOffset.Now.AddMinutes(1); //一分钟后过期
_cache.Set(key, value, time);
return Exists(key);
}
}
}
...@@ -3,6 +3,7 @@ using JmpCommon.Tools; ...@@ -3,6 +3,7 @@ using JmpCommon.Tools;
using JmpModel.Model; using JmpModel.Model;
using JmpModel.Model.Repository; using JmpModel.Model.Repository;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
...@@ -34,13 +35,13 @@ namespace JunmpPoliceStation.App_Start ...@@ -34,13 +35,13 @@ namespace JunmpPoliceStation.App_Start
private readonly INacosNamingClient _serverNamingClient; private readonly INacosNamingClient _serverNamingClient;
private readonly IHttpClientFactory _clientFactory; private readonly IHttpClientFactory _clientFactory;
public IConfiguration Configuration { get; } public IConfiguration Configuration { get; }
private ILogger<PrintController> _logger; private ILogger<AuthLoginAttribute> _logger;
private Boolean flg; private Boolean flg;
ApiConfig apicfg; ApiConfig apicfg;
string urlGetSecretKey = string.Empty;//获取seckey的路由 string urlGetSecretKey = string.Empty;//获取seckey的路由
string urlCheckApp = string.Empty;//获取审核的路由 string urlCheckApp = string.Empty;//获取审核的路由
public AuthLoginAttribute(IConfiguration configuration, ApiConfig apicfg, INacosServerManager _serverManager, INacosNamingClient _serverNamingClient, IHttpClientFactory _clientFactory, Boolean AuthFlg = true) public AuthLoginAttribute(IConfiguration configuration, ApiConfig apicfg, INacosServerManager _serverManager, INacosNamingClient _serverNamingClient, IHttpClientFactory _clientFactory, ILogger<AuthLoginAttribute> _logger, Boolean AuthFlg = true)
{ {
flg = AuthFlg; flg = AuthFlg;
this.apicfg = apicfg; this.apicfg = apicfg;
...@@ -48,6 +49,7 @@ namespace JunmpPoliceStation.App_Start ...@@ -48,6 +49,7 @@ namespace JunmpPoliceStation.App_Start
this._serverNamingClient = _serverNamingClient; this._serverNamingClient = _serverNamingClient;
this._clientFactory = _clientFactory; this._clientFactory = _clientFactory;
this.Configuration = configuration; this.Configuration = configuration;
this._logger = _logger;
_serverNamingClient.RegisterInstanceAsync(new RegisterInstanceRequest _serverNamingClient.RegisterInstanceAsync(new RegisterInstanceRequest
{ {
ServiceName = apicfg.serviceName, ServiceName = apicfg.serviceName,
...@@ -190,7 +192,6 @@ namespace JunmpPoliceStation.App_Start ...@@ -190,7 +192,6 @@ namespace JunmpPoliceStation.App_Start
context.Result = new JsonResult(ex.ToString()); context.Result = new JsonResult(ex.ToString());
} }
} }
} }
public class PlaInfo public class PlaInfo
{ {
......
...@@ -750,6 +750,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -750,6 +750,7 @@ namespace JunmpPoliceStation.Controllers
var entity = JsonManager.GetJsonEntity(jdata); var entity = JsonManager.GetJsonEntity(jdata);
string id = entity?.id ?? ""; string id = entity?.id ?? "";
bool bExpectedTime = DateTime.TryParse(entity?.expectedTime ?? "", out DateTime expectedTime); bool bExpectedTime = DateTime.TryParse(entity?.expectedTime ?? "", out DateTime expectedTime);
bool bIsBindCabinet = bool.TryParse(entity?.isBindCabinet ?? "", out bool isBindCabinet);
if (entity == null) if (entity == null)
{ {
return JsonManager.SimpleCustResponse($"model is null"); return JsonManager.SimpleCustResponse($"model is null");
...@@ -795,6 +796,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -795,6 +796,7 @@ namespace JunmpPoliceStation.Controllers
order.PoliceNote = entity.policeNote; order.PoliceNote = entity.policeNote;
order.PoliceId = entity.policeId; order.PoliceId = entity.policeId;
order.FileUrl = string.IsNullOrEmpty(entity.fileUrl) ? null : entity.fileUrl; order.FileUrl = string.IsNullOrEmpty(entity.fileUrl) ? null : entity.fileUrl;
order.IsBindCabinet = isBindCabinet;
List<string> tmpList = JsonManager.GetDetails(entity.detailList); List<string> tmpList = JsonManager.GetDetails(entity.detailList);
List<string> tmpList2 = JsonManager.GetDetailIds(entity.detailList); List<string> tmpList2 = JsonManager.GetDetailIds(entity.detailList);
...@@ -959,7 +961,8 @@ namespace JunmpPoliceStation.Controllers ...@@ -959,7 +961,8 @@ namespace JunmpPoliceStation.Controllers
Note = entity.note, Note = entity.note,
PoliceNote = entity.policeNote, PoliceNote = entity.policeNote,
PoliceId = entity.policeId, PoliceId = entity.policeId,
FileUrl = string.IsNullOrEmpty(entity.fileUrl) ? null : entity.fileUrl FileUrl = string.IsNullOrEmpty(entity.fileUrl) ? null : entity.fileUrl,
IsBindCabinet = isBindCabinet
}; };
//if (entity.police!=null) //if (entity.police!=null)
...@@ -1409,7 +1412,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -1409,7 +1412,7 @@ namespace JunmpPoliceStation.Controllers
order.ApplyUser = entity.applyId; order.ApplyUser = entity.applyId;
order.ApplyUserName = entity.applyName; order.ApplyUserName = entity.applyName;
order.PoliceNote = entity.policeNote; order.PoliceNote = entity.policeNote;
order.PoliceId = entity.policeId; order.PoliceId = string.IsNullOrEmpty(entity.policeId) ? null : entity.policeId;
order.ExpectedReturnTime = expectedTime; order.ExpectedReturnTime = expectedTime;
...@@ -1540,7 +1543,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -1540,7 +1543,7 @@ namespace JunmpPoliceStation.Controllers
string flowState = (string)entity.flowState.ToLower(); string flowState = (string)entity.flowState.ToLower();
bool processResult = _unitOfWork.AddProcess(processCurrentId, orderID, (string)entity.userType, (string)entity.userInfo, (string)entity.dataScope, (string)entity.nextStepId, (string)entity.currentStepName bool processResult = _unitOfWork.AddProcess(processCurrentId, orderID, (string)entity.userType, (string)entity.userInfo, (string)entity.dataScope, (string)entity.nextStepId, (string)entity.currentStepName
, (string)entity.flowType, (string)entity.flowName, (string)entity.flowId, flowState, (string)entity.orgId, (string)entity.note, (string)(string)entity.applyId, (string)entity.applyName, OrderCode); , (string)entity.flowType, (string)entity.flowName, (string)entity.flowId, flowState, (string)entity.orgId, (string)entity.note, (string)(string)entity.applyId, (string)entity.applyName, OrderCode);
//新增数据 //新增数据
CommonJpBorrowReturnApply order = new CommonJpBorrowReturnApply() CommonJpBorrowReturnApply order = new CommonJpBorrowReturnApply()
{ {
...@@ -1558,7 +1561,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -1558,7 +1561,7 @@ namespace JunmpPoliceStation.Controllers
ProcessCurrentId = processCurrentId, ProcessCurrentId = processCurrentId,
ExpectedReturnTime = expectedTime, ExpectedReturnTime = expectedTime,
PoliceNote = entity.policeNote, PoliceNote = entity.policeNote,
PoliceId = entity.policeId PoliceId = string.IsNullOrEmpty(entity.policeId) ? null : entity.policeId
}; };
List<CommonJpBorrowReturnDetailEstimate> detailsList = new List<CommonJpBorrowReturnDetailEstimate>(); List<CommonJpBorrowReturnDetailEstimate> detailsList = new List<CommonJpBorrowReturnDetailEstimate>();
foreach (var item in entity.detailList) foreach (var item in entity.detailList)
...@@ -1607,7 +1610,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -1607,7 +1610,7 @@ namespace JunmpPoliceStation.Controllers
borrowReturn.CreateTime = DateTime.Now; borrowReturn.CreateTime = DateTime.Now;
borrowReturn.CreateUser = entity.auditUser; borrowReturn.CreateUser = entity.auditUser;
borrowReturn.IsWork = false; borrowReturn.IsWork = false;
borrowReturn.PolicemanId = order.PoliceId; borrowReturn.PolicemanId = order.PoliceId;
foreach (var item in detailsList) foreach (var item in detailsList)
{ {
//int.TryParse(item.quantity, out int qty); //int.TryParse(item.quantity, out int qty);
...@@ -2018,7 +2021,8 @@ namespace JunmpPoliceStation.Controllers ...@@ -2018,7 +2021,8 @@ namespace JunmpPoliceStation.Controllers
t.PoliceId, t.PoliceId,
policeName = t.Police?.Name, policeName = t.Police?.Name,
processActionType = t.ProcessCurrent?.ActionType, processActionType = t.ProcessCurrent?.ActionType,
fileUrl= t.FileUrl, fileUrl = t.FileUrl,
isBindCabinet = t.IsBindCabinet,
historyList = t.ProcessCurrent?.CommonJpProcessHistories?.Select(x => new historyList = t.ProcessCurrent?.CommonJpProcessHistories?.Select(x => new
{ {
x.Id, x.Id,
......
...@@ -285,7 +285,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -285,7 +285,7 @@ namespace JunmpPoliceStation.Controllers
{ {
var entity = JsonManager.GetJsonEntity(jdata); var entity = JsonManager.GetJsonEntity(jdata);
string currentCabinetNum = entity?.currentCabinetNum ?? ""; string currentCabinetNum = entity?.currentCabinetNum ?? "";
bool bType = int.TryParse(entity?.type,out int type); bool bType = int.TryParse(entity?.type, out int type);
var param = new string[] var param = new string[]
{ {
"Cabinet", "Cabinet",
...@@ -294,7 +294,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -294,7 +294,7 @@ namespace JunmpPoliceStation.Controllers
{ {
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR); return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
} }
if (!bType|| type>2) if (!bType || type > 2)
{ {
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR); return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
} }
...@@ -969,14 +969,16 @@ namespace JunmpPoliceStation.Controllers ...@@ -969,14 +969,16 @@ namespace JunmpPoliceStation.Controllers
// stateCode = s.CurrentState, // stateCode = s.CurrentState,
// epc = s.Epc // epc = s.Epc
//}).ToList(), //}).ToList(),
equList = cab.CommonJpEquipmentInventories?.Select(s => new equList = cab.CommonJpEquipmentInventories?
{ .Where(s => s.CurrentState == 3 || s.CurrentState == 7)
id = s.Id, .Select(s => new
name = s.EquipmentCodeNavigation?.Name, {
size = s.Cabinet?.BaseJpPolicemen.First().Id == s.PoliceCode ? s.EquipmentSizecodeNavigation?.SizeName : s.EquipmentSizecodeNavigation?.SizeName + "(" + s.Cabinet?.BaseJpPolicemen.First().Name + ")", id = s.Id,
stateCode = s.CurrentState, name = s.EquipmentCodeNavigation?.Name,
epc = s.Epc size = s.Cabinet?.BaseJpPolicemen.First().Id == s.PoliceCode ? s.EquipmentSizecodeNavigation?.SizeName : s.EquipmentSizecodeNavigation?.SizeName + "(" + s.Cabinet?.BaseJpPolicemen.First().Name + ")",
}).ToList() stateCode = s.CurrentState,
epc = s.Epc
}).ToList()
}; };
return JsonManager.ReturnSuccessResponse(data); return JsonManager.ReturnSuccessResponse(data);
} }
...@@ -2715,7 +2717,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2715,7 +2717,7 @@ namespace JunmpPoliceStation.Controllers
ActionState = 5, ActionState = 5,
OutInState = 0, OutInState = 0,
OrgId = cabinet.OrganizationId, OrgId = cabinet.OrganizationId,
PoliceId = policeman != null ? policeman.Id : null PoliceId = policeman != null ? policeman.Id : null
}; };
InsertState.Add(history); InsertState.Add(history);
...@@ -2734,7 +2736,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2734,7 +2736,7 @@ namespace JunmpPoliceStation.Controllers
//{ //{
// editEquipment.PoliceCode = policeman != null ? policeman.Id : null; // editEquipment.PoliceCode = policeman != null ? policeman.Id : null;
//} //}
editEquipment.CabinetId = cabinet.Id; editEquipment.CabinetId = cabinet.Id;
editEquipment.OutTime = DateTime.Now; //todo 临时使用 editEquipment.OutTime = DateTime.Now; //todo 临时使用
CommonJpEquipmentState history = new CommonJpEquipmentState CommonJpEquipmentState history = new CommonJpEquipmentState
...@@ -2776,8 +2778,8 @@ namespace JunmpPoliceStation.Controllers ...@@ -2776,8 +2778,8 @@ namespace JunmpPoliceStation.Controllers
{ {
editEpcEquipment = EpcEquipments.Where(p => p.Epc.Contains(rfid)).FirstOrDefault(); editEpcEquipment = EpcEquipments.Where(p => p.Epc.Contains(rfid)).FirstOrDefault();
if (editEpcEquipment == null ) if (editEpcEquipment == null)
{ {
continue; continue;
} }
...@@ -2807,7 +2809,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2807,7 +2809,7 @@ namespace JunmpPoliceStation.Controllers
InsertState.Add(history); InsertState.Add(history);
} }
//SendMsg errEquipmentDic = new SendMsg(); //SendMsg errEquipmentDic = new SendMsg();
//errEquipmentDic.State = "error"; //errEquipmentDic.State = "error";
//errEquipmentDic.Time = time; //errEquipmentDic.Time = time;
...@@ -2850,7 +2852,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2850,7 +2852,7 @@ namespace JunmpPoliceStation.Controllers
//{ //{
// editEquipment.PoliceCode = policeman != null ? policeman.Id : null; // editEquipment.PoliceCode = policeman != null ? policeman.Id : null;
//} //}
editEquipment.OrgId = cabinet.OrganizationId; editEquipment.OrgId = cabinet.OrganizationId;
editEquipment.WarehouseCode = null; editEquipment.WarehouseCode = null;
OutEpc.Add(editEquipment); OutEpc.Add(editEquipment);
...@@ -2889,7 +2891,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2889,7 +2891,7 @@ namespace JunmpPoliceStation.Controllers
} }
if (rebind.Equals("true")) if (rebind.Equals("true"))
{ {
var CurrentBindEquipments = _unitOfWork.EquipmentInventoryRepository.GetList(t => t.InventoryState != "loss" && t.CabinetId.Equals(cabinet.Id), null, false, param);//单警柜的东西 var CurrentBindEquipments = _unitOfWork.EquipmentInventoryRepository.GetList(t => t.InventoryState != "loss" && (t.CabinetId.Equals(cabinet.Id) || t.PoliceCode == cabinet.BaseJpPolicemen.FirstOrDefault().Id), null, false, param);//单警柜的东西
SendMsg equipmentDic = new SendMsg(); SendMsg equipmentDic = new SendMsg();
equipmentDic.State = "rebind"; equipmentDic.State = "rebind";
equipmentDic.Msg = ""; equipmentDic.Msg = "";
...@@ -2902,7 +2904,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2902,7 +2904,7 @@ namespace JunmpPoliceStation.Controllers
{ {
if (!Rfids.Contains(item.Epc)) if (!Rfids.Contains(item.Epc))
{ {
if (item.PoliceCode==policeman.Id) if (item.PoliceCode == policeman.Id)
{ {
item.PoliceCode = null; item.PoliceCode = null;
OutEpc.Add(item); OutEpc.Add(item);
...@@ -2918,12 +2920,12 @@ namespace JunmpPoliceStation.Controllers ...@@ -2918,12 +2920,12 @@ namespace JunmpPoliceStation.Controllers
equipmentDic.EPC = string.IsNullOrEmpty(equipmentDic.EPC) ? item.Epc : equipmentDic.EPC + "," + item.Epc; equipmentDic.EPC = string.IsNullOrEmpty(equipmentDic.EPC) ? item.Epc : equipmentDic.EPC + "," + item.Epc;
equipmentDic.Name = string.IsNullOrEmpty(equipmentDic.Name) ? item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName : equipmentDic.Name + "," + item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName; equipmentDic.Name = string.IsNullOrEmpty(equipmentDic.Name) ? item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName : equipmentDic.Name + "," + item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName;
} }
} }
} }
if (invBind.Count>0) if (invBind.Count > 0)
{ {
foreach (var item in invBind) foreach (var item in invBind)
{ {
...@@ -2936,7 +2938,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -2936,7 +2938,7 @@ namespace JunmpPoliceStation.Controllers
} }
} }
} }
if (!string.IsNullOrEmpty(equipmentDic.EPC)) if (!string.IsNullOrEmpty(equipmentDic.EPC))
{ {
InvStates.Add(equipmentDic); InvStates.Add(equipmentDic);
} }
...@@ -2957,11 +2959,11 @@ namespace JunmpPoliceStation.Controllers ...@@ -2957,11 +2959,11 @@ namespace JunmpPoliceStation.Controllers
var CurrentEI = _unitOfWork.EquipmentInventoryRepository.GetList(p => p.InventoryState != "loss" && p.Cabinet.CabinetRealNum.Equals(cabinetID) && p.Cabinet.CabinetChildNum.Equals(Convert.ToInt32(cabinetChildID)), null, false, param); var CurrentEI = _unitOfWork.EquipmentInventoryRepository.GetList(p => p.InventoryState != "loss" && p.Cabinet.CabinetRealNum.Equals(cabinetID) && p.Cabinet.CabinetChildNum.Equals(Convert.ToInt32(cabinetChildID)), null, false, param);
var InsideEI = CurrentEI.Where(p => p.CurrentState.Equals(3)).ToList();//在单警柜中的物资 var InsideEI = CurrentEI.Where(p => p.CurrentState.Equals(3)).ToList();//在单警柜中的物资
var errReturnEI = InsideEI.Where(p => p.Cabinet.BaseJpPolicemen.FirstOrDefault().Id != p.PoliceCode).ToList(); var errReturnEI = InsideEI.Where(p => p.Cabinet.BaseJpPolicemen.FirstOrDefault().Id != p.PoliceCode).ToList();
var OutsideEI = CurrentEI.Where(p => p.CurrentState.Equals(7)).ToList();//在单警柜外的物资 var OutsideEI = CurrentEI.Where(p => p.CurrentState.Equals(7)).ToList();//在单警柜外的物资
if (rebind.Equals("false") && (InsertState.Where(p => p.ActionState.Equals(5) && p.OutInState.Equals(1)).ToList().Count > 0 && InsertState.Where(p => p.ActionState.Equals(5) if (rebind.Equals("false") && (InsertState.Where(p => p.ActionState.Equals(5) && p.OutInState.Equals(1)).ToList().Count > 0 && InsertState.Where(p => p.ActionState.Equals(5)
&& p.OutInState.Equals(0)).ToList().Count <= 0 && OutsideEI.Count() > 0))//放入了物资 少还了物资 && p.OutInState.Equals(0)).ToList().Count <= 0 && OutsideEI.Count() > 0))//放入了物资 少还了物资
{ {
if (policeman != null) if (policeman != null)
{ {
...@@ -2973,10 +2975,16 @@ namespace JunmpPoliceStation.Controllers ...@@ -2973,10 +2975,16 @@ namespace JunmpPoliceStation.Controllers
equipmentDic.UserName = policeman?.Name; equipmentDic.UserName = policeman?.Name;
foreach (var item in OutsideEI) foreach (var item in OutsideEI)
{ {
equipmentDic.EPC = string.IsNullOrEmpty(equipmentDic.EPC) ? item.Epc : equipmentDic.EPC + "," + item.Epc; if (item.PoliceCodeNavigation?.CabinetId == cabinet.Id)
equipmentDic.Name = string.IsNullOrEmpty(equipmentDic.Name) ? item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName : equipmentDic.Name + "," + item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName; {
equipmentDic.EPC = string.IsNullOrEmpty(equipmentDic.EPC) ? item.Epc : equipmentDic.EPC + "," + item.Epc;
equipmentDic.Name = string.IsNullOrEmpty(equipmentDic.Name) ? item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName : equipmentDic.Name + "," + item.EquipmentCodeNavigation.Name + "-" + item.EquipmentSizecodeNavigation.SizeName;
}
}
if (!string.IsNullOrEmpty(equipmentDic.EPC))
{
InvStates.Add(equipmentDic);
} }
InvStates.Add(equipmentDic);
} }
......
...@@ -2103,7 +2103,9 @@ namespace JunmpPoliceStation.Controllers ...@@ -2103,7 +2103,9 @@ namespace JunmpPoliceStation.Controllers
else else
{ {
Expression<Func<BaseJpPoliceman, bool>> expression = t => t.Id == policeId; Expression<Func<BaseJpPoliceman, bool>> expression = t => t.Id == policeId;
var policeInfo = _unitOfWork.DbContext.BaseJpPolicemen.FirstOrDefault(expression); var policeInfo = _unitOfWork.DbContext.BaseJpPolicemen
.Include(x => x.BaseJpPolicefingers)
.FirstOrDefault(expression);
if (policeInfo == null) if (policeInfo == null)
{ {
return JsonManager.SimpleCustResponse("invalid policeId"); return JsonManager.SimpleCustResponse("invalid policeId");
......
...@@ -12,6 +12,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; ...@@ -12,6 +12,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using StackExchange.Redis;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -652,12 +653,21 @@ namespace JunmpPoliceStation.Controllers ...@@ -652,12 +653,21 @@ namespace JunmpPoliceStation.Controllers
{ {
detail.State = 1; detail.State = 1;
} }
//生成流水表 //江北仓库特殊处理
GenerateRecord(order); if (order.OrgId == "E05CC28D-C189-4389-8081-DD0D6E483B40")
//反写库存状态 {
UpdateInvState(order.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), order.Action, order.OrderCode, false); //生成流水表
GenerateRecordMK2(order);
//反写库存状态
UpdateInvStateMK2(order.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), order.Action, order.OrderCode, false);
}
else
{
//生成流水表
GenerateRecord(order);
//反写库存状态
UpdateInvState(order.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), order.Action, order.OrderCode, false);
}
} }
bool result = _unitOfWork.FixReceiveApplyRepository.Insert(order, true); bool result = _unitOfWork.FixReceiveApplyRepository.Insert(order, true);
...@@ -1032,11 +1042,21 @@ namespace JunmpPoliceStation.Controllers ...@@ -1032,11 +1042,21 @@ namespace JunmpPoliceStation.Controllers
{ {
detail.State = 1; detail.State = 1;
} }
//生成流水表 //江北仓库特殊处理
GenerateRecord(orderInfo); if (orderInfo.OrgId == "E05CC28D-C189-4389-8081-DD0D6E483B40")
//反写库存状态 {
UpdateInvState(orderInfo.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), orderInfo.Action, orderInfo.OrderCode, isLost); //生成流水表
GenerateRecordMK2(orderInfo);
//反写库存状态
UpdateInvStateMK2(orderInfo.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), orderInfo.Action, orderInfo.OrderCode, false);
}
else
{
//生成流水表
GenerateRecord(orderInfo);
//反写库存状态
UpdateInvState(orderInfo.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), orderInfo.Action, orderInfo.OrderCode, false);
}
} }
......
...@@ -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,89 @@ namespace JunmpPoliceStation.Controllers ...@@ -7216,9 +7219,89 @@ 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",
}).ToList();
BaseJpPoliceman police = null;
if (!string.IsNullOrEmpty(policeId))
{
police = _unitOfWork.PolicemanRepository.Get(policeId);
}
foreach (var inventory in failWarehouseInvList)
{
if (currentState.Equals("1"))
{
//入库 如果之前不存在就添加
var oldstate = _unitOfWork.DbContext.CommonJpEquipmentFailWarehouseStates
.Where(x => x.Epc == inventory.Epc && x.FailWarehouseId == warehouseId && x.IsCompleted == false)
.FirstOrDefault();
if (oldstate == null)
{
_unitOfWork.DbContext.CommonJpEquipmentFailWarehouseStates.Add(
new CommonJpEquipmentFailWarehouseState
{
Id = Guid.NewGuid().ToString(),
CreateTime = DateTime.Now,
Epc = inventory.Epc,
InventoryId = inventory.Id,
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 && x.IsCompleted == false)
.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)
{ {
...@@ -9553,6 +9636,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -9553,6 +9636,7 @@ namespace JunmpPoliceStation.Controllers
}) })
.Select(x => new .Select(x => new
{ {
id = x.FirstOrDefault()?.Id,
orgizationCode = x.Key.OrgizationCode, orgizationCode = x.Key.OrgizationCode,
orgizationId = x.FirstOrDefault()?.OrgId, orgizationId = x.FirstOrDefault()?.OrgId,
orgizationName = x.FirstOrDefault()?.Org.Name, orgizationName = x.FirstOrDefault()?.Org.Name,
...@@ -9594,6 +9678,293 @@ namespace JunmpPoliceStation.Controllers ...@@ -9594,6 +9678,293 @@ namespace JunmpPoliceStation.Controllers
} }
/// <summary> /// <summary>
/// 获取本组织机构物资状态对应物资信息详情(group)
/// </summary>
/// <remarks>
///
/// ## 例子
///
/// {
/// "size":10,
/// "page":0,
/// "orgId":"当前组织机构代码",
/// "type":"物资状态,中文:装备总数、在库数量、调拨数量、领用数量、维修数量、报废数量、单警柜中、报废区数量、销毁数量",
/// "level":"本级、本级及下级",
/// "name":"装备名称",
/// "topTypeName":"九大类名称",
/// "safeLevel":"0:保质期内,1:即将过期,2:已过期",
/// "equipmentSizeId":"装备型号",
/// }
///
/// </remarks>
/// <param name="jdata"></param>
/// <returns></returns>
[HttpPost("GetGroupListEquipmentByOrgAndTypeDetailV2")]
//[NoSign]
public async Task<HttpResponseMessage> GetGroupListEquipmentByOrgAndTypeDetailV2([FromBody] JObject jdata)
{
return await Task.Run(() =>
{
try
{
if (jdata != null)
{
var entity = JsonManager.GetJsonEntity(jdata);
string orgCode = entity.orgId;
int.TryParse(entity.page, out int page);
int.TryParse(entity.size, out int size);
if (size == 0)
{
size = 10;
}
string OrgId = Guid.Empty.ToString();
if (String.IsNullOrEmpty(entity.orgId))
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
else
{
OrgId = entity.orgId;
}
var param = new string[] {
"EquipmentSizecodeNavigation" ,
"EquipmentSizecodeNavigation.Detail" ,
"EquipmentCodeNavigation" ,
"WarehouseCodeNavigation" ,
"Org",
"CommonJpEquipmentStates",
"SupplierCodeNavigation",
"Cabinet",
"Shelf",
"CommonJpEquipmentStates",
"CommonJpEquipmentStates.Transfer",
"CommonJpEquipmentStates.Transfer.Reality",
"CommonJpEquipmentStates.Transfer.Reality.SendWarehouse",
"CommonJpEquipmentStates.Transfer.Reality.ReceiveWarehouse",
};
ListEq = _unitOfWork.OrganizationRepository.GetList(t => t.State == 1, x => x.Code).ToList();
List<BaseJpOrganization> dataList = GetClassID(OrgId);
dataList = dataList.ToList().Concat(ListEq.Where(c => c.Id.Equals(OrgId))).ToList();
Expression<Func<CommonJpEquipmentInventory, bool>> expression;
if (!string.IsNullOrEmpty(entity.level))
{
if (!String.IsNullOrEmpty(entity.level))
{
if (entity.level == "本级")
{
expression = t => t.OrgId.Equals(OrgId);
}
else
{
expression = t => dataList.Select(c => c.Id).Contains(t.OrgId);
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
expression = LambdaExtensions.AndAlso(expression, t => t.InventoryState != "loss");
if (!String.IsNullOrEmpty(entity.type))
{
string type = entity.type;
switch (type)
{
case "装备总数":
{
//无过滤
break;
}
case "在库数量":
{
//0:库存内+3:单警柜
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState == 0 || t.CurrentState == 3);
break;
}
case "调拨数量":
{
//1:调拨中
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState == 1);
break;
}
case "领用数量":
{
//使用中=装备总数-(0:+3:在库数量)-1:调拨数量-4:维修数量-6:报废数量
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState != 0 && t.CurrentState != 3 && t.CurrentState != 1 && t.CurrentState != 4 && t.CurrentState != 6);
break;
}
case "维修数量":
{
//4:维修中
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState == 4);
break;
}
case "销毁数量":
case "报废数量":
{
//6:已报废
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState == 6);
break;
}
case "报废区数量":
{
//6:已报废
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState != 6 && t.IsFixed == true);
break;
}
case "单警柜中":
{
expression = LambdaExtensions.AndAlso(expression, t => t.CurrentState == 3 || t.CurrentState == 7);
break;
}
default:
break;
}
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
if (!String.IsNullOrEmpty(entity.equipmentSizeId))
{
string equipmentSizeId = entity.equipmentSizeId;
expression = LambdaExtensions.AndAlso(expression, t => t.EquipmentSizecode == equipmentSizeId);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
if (!string.IsNullOrEmpty(entity.safeLevel))
{
if (int.TryParse(entity.safeLevel, out int safeLevel))
{
expression = expression.AndAlso(t => t.CurrentState != 6 && t.SafeLevel == safeLevel);
}
}
if (!string.IsNullOrEmpty(entity.name))
{
string name = entity.name;
expression = expression.AndAlso(x => x.EquipmentSizecodeNavigation != null && x.EquipmentSizecodeNavigation.Detail != null && x.EquipmentSizecodeNavigation.Detail.Name.Contains(name));
}
if (!string.IsNullOrEmpty(entity.topTypeName))
{
string topTypeName = entity.topTypeName;
var topTypeInfo = _unitOfWork.EquipmentInfoRepository.Get(x => x.Name == topTypeName);
if (topTypeInfo == null)
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
//遍历下级(3级)
var secondInfoList =
_unitOfWork.EquipmentInfoRepository.GetList(x => x.ParentId == topTypeInfo.Id).ToList();
var threedInfoList = new List<BaseJpEquipmentInfo>();
foreach (var info in secondInfoList)
{
threedInfoList.AddRange(_unitOfWork.EquipmentInfoRepository.GetList(x => x.ParentId == info.Id).ToList());
}
var equIdList = threedInfoList.Select(x => x.Id);
expression = expression.AndAlso(x => x.EquipmentSizecodeNavigation != null && x.EquipmentSizecodeNavigation.Detail != null && equIdList.Contains(x.EquipmentSizecodeNavigation.Detail.EquipmentId));
}
var EquipmentList = _unitOfWork.EquipmentInventoryRepository.GetList(expression, c => c.CreateTime, false, param)
.ToList();
var datas = EquipmentList.Select(equipment => new
{
equipment.Id,
equipment.Epc,
equipment.UseDirection,
equipment.WarrantyCycle,
equipment.ProductTime,
equipment.UseTime,
equipment.CurrentState,
shelfId = equipment.ShelfId,
shelfCode = equipment.Shelf?.Code,
shelfName = equipment.Shelf?.Name,
shelf = equipment.Shelf == null ? null : new
{
equipment.Shelf.Id,
equipment.Shelf.CreateTime,
equipment.Shelf.Name,
equipment.Shelf.Code,
equipment.Shelf.Type,
equipment.Shelf.WarehouseId,
equipment.Shelf.Row,
equipment.Shelf.Column,
equipment.Shelf.Range,
},
range = equipment.ShelfRange,
row = equipment.ShelfRow,
column = equipment.ShelfColumn,
safeLevel = equipment.SafeLevel,
equipment.Address,
sizeName = equipment.EquipmentSizecodeNavigation?.SizeName,
equipment.EquipmentSizecode,
equipmentName = equipment.EquipmentCodeNavigation?.Name,
equipment.EquipmentCode,
warehouseName = equipment.WarehouseCodeNavigation?.Name,
equipment.WarehouseCode,
equipment.WarehouseCodeNavigation?.Orgization?.Name,
equipment.WarehouseCodeNavigation?.OrgizationId,
supplierName = equipment.SupplierCodeNavigation?.Name,
equipment.SupplierCode,
cabinetID = equipment.Cabinet?.Id,
CabinetChildNum = equipment.Cabinet?.CabinetChildNum + "号柜",
equipment.Cabinet?.CabinetNum,
equipment.Price,
equipment.RepairCycle
}
);
var content = new
{
totalElements = datas.Count(),
content = datas.Skip(page * size).Take(size).ToList()
};
return JsonManager.ReturnSuccessResponse(content);
// return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
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> /// </summary>
/// <remarks> /// <remarks>
......
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 && x.EquCount != 0)
.ToList();
var xjLogList = _unitOfWork.DbContext
.BaseJpMessageReminderLogs
.Where(x => x.ParentOrgId == orgId && x.IsNeedPushParent && x.EquCount != 0)
.ToList();
var message = new List<string>();
foreach (var log in bjLogList)
{
switch (log.Type)
{
case 0:
{
//已超期未报废
message.Add($"已超期未报废装备共{log.EquCount}件,请尽快处理");
break;
}
case 1:
{
//超期未归还
message.Add($"超期未归还装备共{log.EquCount}件,请尽快处理");
break;
}
case 2:
{
//非本仓库装备
message.Add($"本仓库存在其他仓库装备{log.EquCount}件,请尽快处理");
break;
}
}
}
return JsonManager.ReturnSuccessResponse(message);
}
else
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
}
catch (Exception ex)
{
//_logger.LogError("Login/SignIn 错误:" + ex.ToString());
return JsonManager.SimpleStatusResponse(ResultCode.OPERATE_FAILED);
}
});
}
}
}
...@@ -615,6 +615,15 @@ namespace JunmpPoliceStation.Controllers ...@@ -615,6 +615,15 @@ namespace JunmpPoliceStation.Controllers
if (string.IsNullOrEmpty(entity.cabinetId)) if (string.IsNullOrEmpty(entity.cabinetId))
{ {
updateObject.CabinetId = null; updateObject.CabinetId = null;
//解绑装备
var equList = _unitOfWork.EquipmentInventoryRepository
.GetList(x => x.PoliceCode == updateObject.Id && (x.CurrentState == 3 || x.CurrentState == 7))
.ToList();
foreach (var inventory in equList)
{
inventory.PoliceCode = null;
}
_unitOfWork.EquipmentInventoryRepository.Update(equList, false);
} }
else else
{ {
......
...@@ -19,6 +19,7 @@ using System.Net.Http; ...@@ -19,6 +19,7 @@ using System.Net.Http;
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Internal;
using JmpModel.TempModel;
namespace JunmpPoliceStation.Controllers namespace JunmpPoliceStation.Controllers
{ {
...@@ -606,7 +607,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -606,7 +607,7 @@ namespace JunmpPoliceStation.Controllers
dataList = GetClassID(orgizationCode); dataList = GetClassID(orgizationCode);
dataList = dataList.ToList().Concat(ListEq.Where(c => c.Id.Equals(orgizationCode))).ToList(); dataList = dataList.ToList().Concat(ListEq.Where(c => c.Id.Equals(orgizationCode))).ToList();
Expression<Func<ViewEquipment, bool>> expressionPoliceman = null; Expression<Func<ViewEquipment, bool>> expressionPoliceman = null;
string typeId = entity.typeId; string typeId = entity.typeId;
...@@ -633,7 +634,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -633,7 +634,7 @@ namespace JunmpPoliceStation.Controllers
} }
List<ViewEquipment> equipmentList = _unitOfWork.ViewEquipmentRepository.GetList(expressionPoliceman).OrderBy(c => c.FindCode.Length).ToList(); List<ViewEquipment> equipmentList = _unitOfWork.ViewEquipmentRepository.GetList(expressionPoliceman).OrderBy(c => c.FindCode.Length).ToList();
if (findcode.Length == 6) if (findcode.Length == 6)
{ {
var data = equipmentList.GroupBy(t => t.OrgName).Select(c => new var data = equipmentList.GroupBy(t => t.OrgName).Select(c => new
...@@ -755,7 +756,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -755,7 +756,7 @@ namespace JunmpPoliceStation.Controllers
/// <param name="jdata"></param> /// <param name="jdata"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("GetSyCountDetail")] [HttpPost("GetSyCountDetail")]
public async Task<HttpResponseMessage> GetSyCountDetail([FromBody] JObject jdata) public async Task<HttpResponseMessage> GetSyCountDetail([FromBody] JObject jdata)
{ {
return await Task.Run(() => return await Task.Run(() =>
...@@ -790,7 +791,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -790,7 +791,7 @@ namespace JunmpPoliceStation.Controllers
}; };
Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId==t.OrgId && (!t.InventoryState.Equals("loss")); Expression<Func<CommonJpEquipmentInventory, bool>> expression = t => OrgId == t.OrgId && (!t.InventoryState.Equals("loss"));
//装备名称 //装备名称
if (!String.IsNullOrEmpty(entity.equipmentCode)) if (!String.IsNullOrEmpty(entity.equipmentCode))
...@@ -805,7 +806,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -805,7 +806,7 @@ namespace JunmpPoliceStation.Controllers
equipmentCode = c.Key, equipmentCode = c.Key,
equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name, equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name,
sumCount = c.Count(), sumCount = c.Count(),
syCount =c.Sum(c=>c.Org.BaseJpCabinetOutinlogs.Where(p=>p.State=="out" && p.OperationTime >= Convert.ToDateTime(startTime) && p.OperationTime <= Convert.ToDateTime(endTime)).Count())+ c.Sum(c => c.CommonJpEquipmentStates.Where(f => (f.ActionState.Equals(2) || f.ActionState.Equals(3) || f.ActionState.Equals(5) || f.ActionState.Equals(14) || f.ActionState.Equals(15)) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count()), syCount = c.Sum(c => c.Org.BaseJpCabinetOutinlogs.Where(p => p.State == "out" && p.OperationTime >= Convert.ToDateTime(startTime) && p.OperationTime <= Convert.ToDateTime(endTime)).Count()) + c.Sum(c => c.CommonJpEquipmentStates.Where(f => (f.ActionState.Equals(2) || f.ActionState.Equals(3) || f.ActionState.Equals(5) || f.ActionState.Equals(14) || f.ActionState.Equals(15)) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count()),
wxCount = c.Sum(c => c.CommonJpEquipmentStates.Where(f => f.ActionState.Equals(6) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count()) wxCount = c.Sum(c => c.CommonJpEquipmentStates.Where(f => f.ActionState.Equals(6) && f.OutTime >= Convert.ToDateTime(startTime) && f.OutTime <= Convert.ToDateTime(endTime)).Count())
}).OrderByDescending(f => f.syCount).ToList(); }).OrderByDescending(f => f.syCount).ToList();
...@@ -940,7 +941,7 @@ namespace JunmpPoliceStation.Controllers ...@@ -940,7 +941,7 @@ namespace JunmpPoliceStation.Controllers
}; };
return JsonManager.ReturnSuccessResponse(content); return JsonManager.ReturnSuccessResponse(content);
} }
else else
{ {
...@@ -1007,16 +1008,28 @@ namespace JunmpPoliceStation.Controllers ...@@ -1007,16 +1008,28 @@ namespace JunmpPoliceStation.Controllers
int newpage = page * size; int newpage = page * size;
int newsize = size; int newsize = size;
List<useCountResult> data = _unitOfWork.ViewEquipmentRepository.Exec_UseCount(" EXEC useCount @orgid ='" + OrgId + "',@startTime ='" + startTime + "'" + List<useCountResult> data = _unitOfWork.ViewEquipmentRepository.Exec_UseCount(" EXEC useCount @orgid ='" + OrgId + "',@startTime ='" + startTime + "'" +
",@endTime ='" + endTime + "'"+ ",@eqcode ='" + equipmentCode + "'" + ",@newspage ='" + newpage + "'" + ",@pageSize ='" + newsize + "'").ToList(); ",@endTime ='" + endTime + "'" + ",@eqcode ='" + equipmentCode + "'" + ",@newspage ='" + newpage + "'" + ",@pageSize ='" + newsize + "'").ToList();
//var x= data[0].result.ToString(); //var x= data[0].result.ToString();
//JsonData requestData = JsonMapper.ToObject(x); //JsonData requestData = JsonMapper.ToObject(x);
var res=JsonConvert.DeserializeObject(data[0].result.ToString()); var res = JsonConvert.DeserializeObject(data[0]?.result?.ToString() ?? string.Empty);
//var content = new //var content = new
//{ //{
// totalElements = data.Count(), // totalElements = data.Count(),
// content = data.Skip(page * size).Take(size).ToList() // content = data.Skip(page * size).Take(size).ToList()
//}; //};
if (res == null)
{
res = new List<object>()
{
new
{
totalElements = 0,
content = new List<object>()
}
};
}
return JsonManager.ReturnSuccessResponse(res); return JsonManager.ReturnSuccessResponse(res);
} }
else else
......
...@@ -956,6 +956,7 @@ namespace JunmpPoliceStation.Extensions ...@@ -956,6 +956,7 @@ namespace JunmpPoliceStation.Extensions
InsideItem.EquipmentLocation = 0; InsideItem.EquipmentLocation = 0;
InsideItem.UpdateUser = policeId; InsideItem.UpdateUser = policeId;
InsideItem.WarehouseCode = warehouseId; InsideItem.WarehouseCode = warehouseId;
InsideItem.PoliceCode = null; //借用归还清空人员绑定
if (borrowIntoRealDetailEpcItem.InsideRealCount == null) if (borrowIntoRealDetailEpcItem.InsideRealCount == null)
{ {
borrowIntoRealDetailEpcItem.InsideRealCount = 0; borrowIntoRealDetailEpcItem.InsideRealCount = 0;
...@@ -1069,9 +1070,30 @@ namespace JunmpPoliceStation.Extensions ...@@ -1069,9 +1070,30 @@ namespace JunmpPoliceStation.Extensions
{ {
brCount++; brCount++;
invenItem.CurrentState = 8;
invenItem.EquipmentLocation = 3;//外出
invenItem.PoliceCode = realityItem.Reality?.Apply?.PoliceId; invenItem.PoliceCode = realityItem.Reality?.Apply?.PoliceId;
if (realityItem.Reality?.Apply?.IsBindCabinet == true)
{
var police = _unitOfWork.PolicemanRepository.Get(invenItem.PoliceCode);
if (police != null && !string.IsNullOrEmpty(police.CabinetId))
{
//绑定单警柜
invenItem.CabinetId = police.CabinetId;
invenItem.CurrentState = 7;
invenItem.EquipmentLocation = 3;//外出
}
else
{
//无效设置,不绑定单警柜
invenItem.CurrentState = 8;
invenItem.EquipmentLocation = 3;//外出
}
}
else
{
invenItem.CurrentState = 8;
invenItem.EquipmentLocation = 3;//外出
}
invenItem.UpdateUser = policeId; invenItem.UpdateUser = policeId;
if (reRealEpcDetailList.Count.Equals(0)) if (reRealEpcDetailList.Count.Equals(0))
{ {
......
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 += Convert.ToInt32(reality.RealCount) - Convert.ToInt32(reality.InsideRealCount);
}
}
}
}
_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.FailOrgId == 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.FailWarehouseId,
WarehouseName = state.FailWarehouseName,
OriginalWarehouseId = state.TrueWarehouseId,
OriginalWarehouseName = state.TrueWarehouseName
});
}
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" />
...@@ -117,7 +119,7 @@ ...@@ -117,7 +119,7 @@
<ProjectReference Include="..\JmpMsgService\JmpMsgService.csproj" /> <ProjectReference Include="..\JmpMsgService\JmpMsgService.csproj" />
</ItemGroup> </ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions> <ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project> </Project>
{ {
"iisSettings": { "iisSettings": {
"windowsAuthentication": false, "windowsAuthentication": true,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:53692/", "applicationUrl": "http://localhost:5000",
"sslPort": 44399 "sslPort": 5000
} }
}, },
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": { "profiles": {
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger/index.html",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} },
"applicationUrl": "http://192.168.3.1:5000;http://192.168.10.88:5000;http://localhost:5001;http://localhost:5000;"
}, },
"JunmpPoliceStation": { "JunmpPoliceStation": {
"commandName": "Project", "commandName": "Project",
"launchBrowser": true, "launchBrowser": true,
"launchUrl": "swagger/index.html",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
}, },
"applicationUrl": "http://192.168.3.74:5000;http://localhost:5000" "applicationUrl": "http://192.168.3.1:5000;http://192.168.10.88:5000;http://localhost:5001;http://localhost:5000;http://0.0.0.0:5001;"
},
"Docker": {
"commandName": "Docker",
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true,
"useSSL": true
} }
} }
} }
\ No newline at end of file
...@@ -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;
...@@ -32,6 +35,7 @@ using Nacos.AspNetCore; ...@@ -32,6 +35,7 @@ using Nacos.AspNetCore;
using NLog.Extensions.Logging; using NLog.Extensions.Logging;
using Rextec.SOA.Infrastructure; using Rextec.SOA.Infrastructure;
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment; using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
using Microsoft.AspNetCore.HttpOverrides;
namespace JunmpPoliceStation namespace JunmpPoliceStation
{ {
...@@ -139,6 +143,20 @@ namespace JunmpPoliceStation ...@@ -139,6 +143,20 @@ namespace JunmpPoliceStation
//}); //});
services.AddSingleton<MQTTServer>(); services.AddSingleton<MQTTServer>();
services.AddHangfire(configuration => configuration
.UseMemoryStorage());//使用内存
services.AddHangfireServer();//添加hangfire服务
services.AddScoped<CronJob>();//注册执行类
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
options.KnownNetworks.Clear();
options.KnownProxies.Clear();
});
services.AddScoped<ActionLimitAttribute>();
} }
} }
...@@ -188,6 +206,16 @@ namespace JunmpPoliceStation ...@@ -188,6 +206,16 @@ 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.UseForwardedHeaders();
//app.UseMvc(routes => //app.UseMvc(routes =>
//{ //{
// routes.MapRoute( // routes.MapRoute(
......
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论