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
public static ResultInfo MISSION_ERROR = new ResultInfo { Code = "10047", Msg = "该单据正在任务中或已有物资出入库" };
public static ResultInfo MISSION_EXIST = new ResultInfo { Code = "10048", Msg = "存在进行中的任务" };
public static ResultInfo ORDER_START = new ResultInfo { Code = "10049", Msg = "物资与单据状态不匹配" };
public static ResultInfo ACTION_LIMIT = new ResultInfo { Code = "10050", Msg = "接口访问次数上限,请稍后再试" };
}
/// <summary>
......
......@@ -8,6 +8,7 @@
<Compile Remove="Model\DataContext\DbContextExtensions.cs" />
<Compile Remove="Model\DataContext\IJunmppolicesqlContextProcedures.cs" />
<Compile Remove="Model\DataContext\JunmppolicesqlContextProcedures.cs" />
<Compile Remove="Model\UseCountResult.cs" />
</ItemGroup>
<ItemGroup>
......
......@@ -14,11 +14,13 @@ namespace JmpModel.Model
{
BaseJpBagMaps = new HashSet<BaseJpBagMap>();
BaseJpEquipmentSizes = new HashSet<BaseJpEquipmentSize>();
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpSupplierEquipments = new HashSet<BaseJpSupplierEquipment>();
CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>();
CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>();
......@@ -82,6 +84,8 @@ namespace JmpModel.Model
public virtual ICollection<BaseJpBagMap> BaseJpBagMaps { get; set; }
[InverseProperty(nameof(BaseJpEquipmentSize.Detail))]
public virtual ICollection<BaseJpEquipmentSize> BaseJpEquipmentSizes { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.EquipmentDetail))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(BaseJpSupplierEquipment.Equipment))]
public virtual ICollection<BaseJpSupplierEquipment> BaseJpSupplierEquipments { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Equipment))]
......@@ -92,6 +96,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.EquipmentDetail))]
public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.EquipmentDetail))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentCodeNavigation))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentThreshold.EquipmentDetail))]
......
......@@ -12,10 +12,12 @@ namespace JmpModel.Model
{
public BaseJpEquipmentSize()
{
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
CommonJpBorrowReturnDetailEstimates = new HashSet<CommonJpBorrowReturnDetailEstimate>();
CommonJpBorrowReturnDetailRealities = new HashSet<CommonJpBorrowReturnDetailReality>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
CommonJpFixReceiveApplyDetails = new HashSet<CommonJpFixReceiveApplyDetail>();
......@@ -61,6 +63,8 @@ namespace JmpModel.Model
[ForeignKey(nameof(DetailId))]
[InverseProperty(nameof(BaseJpEquipmentDetail.BaseJpEquipmentSizes))]
public virtual BaseJpEquipmentDetail Detail { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.EquipmentSize))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailEstimate.Size))]
public virtual ICollection<CommonJpBorrowReturnDetailEstimate> CommonJpBorrowReturnDetailEstimates { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnDetailReality.Size))]
......@@ -69,6 +73,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.Size))]
public virtual ICollection<CommonJpEquipmentBoxMark> CommonJpEquipmentBoxMarks { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.EquipmentSize))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.EquipmentSizecodeNavigation))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[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
BaseJpBags = new HashSet<BaseJpBag>();
BaseJpCabinetOutinlogs = new HashSet<BaseJpCabinetOutinlog>();
BaseJpCabinets = new HashSet<BaseJpCabinet>();
BaseJpMessageReminderConfigs = new HashSet<BaseJpMessageReminderConfig>();
BaseJpModels = new HashSet<BaseJpModel>();
BaseJpOrganizationOrderCounts = new HashSet<BaseJpOrganizationOrderCount>();
BaseJpPolicemen = new HashSet<BaseJpPoliceman>();
......@@ -22,6 +23,8 @@ namespace JmpModel.Model
CommonJpBorrowReturnApplies = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentFailWarehouseStateFailOrgs = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentFailWarehouseStateTrueOrgs = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
CommonJpEquipmentThresholds = new HashSet<CommonJpEquipmentThreshold>();
......@@ -109,6 +112,8 @@ namespace JmpModel.Model
public virtual ICollection<BaseJpCabinetOutinlog> BaseJpCabinetOutinlogs { get; set; }
[InverseProperty(nameof(BaseJpCabinet.Organization))]
public virtual ICollection<BaseJpCabinet> BaseJpCabinets { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderConfig.Org))]
public virtual ICollection<BaseJpMessageReminderConfig> BaseJpMessageReminderConfigs { get; set; }
[InverseProperty(nameof(BaseJpModel.Org))]
public virtual ICollection<BaseJpModel> BaseJpModels { get; set; }
[InverseProperty(nameof(BaseJpOrganizationOrderCount.Org))]
......@@ -123,6 +128,10 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecord.Org))]
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))]
public virtual ICollection<CommonJpEquipmentInventory> CommonJpEquipmentInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentState.Org))]
......
......@@ -13,12 +13,14 @@ namespace JmpModel.Model
public BaseJpPoliceman()
{
BaseJpCabinetPolicemen = new HashSet<BaseJpCabinetPoliceman>();
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpPolicefingers = new HashSet<BaseJpPolicefinger>();
CommonJpBorrowReturnApplyApplies = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturnApplyApprovalPersonNavigations = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturnApplyPolices = new HashSet<CommonJpBorrowReturnApply>();
CommonJpBorrowReturns = new HashSet<CommonJpBorrowReturn>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
......@@ -99,6 +101,8 @@ namespace JmpModel.Model
public virtual BaseJpOrganization OrgizationCodeNavigation { get; set; }
[InverseProperty(nameof(BaseJpCabinetPoliceman.Policeman))]
public virtual ICollection<BaseJpCabinetPoliceman> BaseJpCabinetPolicemen { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.BorrowPolice))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(BaseJpPolicefinger.Police))]
public virtual ICollection<BaseJpPolicefinger> BaseJpPolicefingers { get; set; }
[InverseProperty(nameof(CommonJpBorrowReturnApply.Apply))]
......@@ -111,6 +115,8 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpBorrowReturn> CommonJpBorrowReturns { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecord.Police))]
public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.Police))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentHistory.OperatorNavigation))]
public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.PoliceCodeNavigation))]
......
......@@ -12,6 +12,8 @@ namespace JmpModel.Model
{
public BaseJpWarehouse()
{
BaseJpMessageReminderLogDetailOriginalWarehouses = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpMessageReminderLogDetailWarehouses = new HashSet<BaseJpMessageReminderLogDetail>();
BaseJpShelfInfos = new HashSet<BaseJpShelfInfo>();
BaseJpWarehouseDevHistories = new HashSet<BaseJpWarehouseDevHistory>();
BaseJpWarehouseDevs = new HashSet<BaseJpWarehouseDev>();
......@@ -22,6 +24,8 @@ namespace JmpModel.Model
CommonJpChannelCfgs = new HashSet<CommonJpChannelCfg>();
CommonJpChannelMonitorRecords = new HashSet<CommonJpChannelMonitorRecord>();
CommonJpEquipmentBoxMarks = new HashSet<CommonJpEquipmentBoxMark>();
CommonJpEquipmentFailWarehouseStateFailWarehouses = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentFailWarehouseStateTrueWarehouses = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentHistories = new HashSet<CommonJpEquipmentHistory>();
CommonJpEquipmentInventories = new HashSet<CommonJpEquipmentInventory>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
......@@ -101,6 +105,10 @@ namespace JmpModel.Model
[ForeignKey(nameof(OrgizationId))]
[InverseProperty(nameof(BaseJpOrganization.BaseJpWarehouses))]
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))]
public virtual ICollection<BaseJpShelfInfo> BaseJpShelfInfos { get; set; }
[InverseProperty(nameof(BaseJpWarehouseDevHistory.Warehouse))]
......@@ -121,6 +129,10 @@ namespace JmpModel.Model
public virtual ICollection<CommonJpChannelMonitorRecord> CommonJpChannelMonitorRecords { get; set; }
[InverseProperty(nameof(CommonJpEquipmentBoxMark.Warehouse))]
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))]
public virtual ICollection<CommonJpEquipmentHistory> CommonJpEquipmentHistories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentInventory.WarehouseCodeNavigation))]
......
......@@ -100,6 +100,11 @@ namespace JmpModel.Model
[Column("file_url")]
[StringLength(255)]
public string FileUrl { get; set; }
/// <summary>
/// 是否绑定单警柜(领用)
/// </summary>
[Column("is_bind_cabinet")]
public bool? IsBindCabinet { get; set; }
[ForeignKey(nameof(ApplyId))]
[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
{
public CommonJpEquipmentInventory()
{
BaseJpMessageReminderLogDetails = new HashSet<BaseJpMessageReminderLogDetail>();
CommonJpChannelMonitorRecordInventories = new HashSet<CommonJpChannelMonitorRecordInventory>();
CommonJpEquipmentFailWarehouseStates = new HashSet<CommonJpEquipmentFailWarehouseState>();
CommonJpEquipmentStates = new HashSet<CommonJpEquipmentState>();
CommonJpInventoryDetails = new HashSet<CommonJpInventoryDetail>();
}
......@@ -203,8 +205,12 @@ namespace JmpModel.Model
[ForeignKey(nameof(WarehouseCode))]
[InverseProperty(nameof(BaseJpWarehouse.CommonJpEquipmentInventories))]
public virtual BaseJpWarehouse WarehouseCodeNavigation { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderLogDetail.Inventory))]
public virtual ICollection<BaseJpMessageReminderLogDetail> BaseJpMessageReminderLogDetails { get; set; }
[InverseProperty(nameof(CommonJpChannelMonitorRecordInventory.Inventory))]
public virtual ICollection<CommonJpChannelMonitorRecordInventory> CommonJpChannelMonitorRecordInventories { get; set; }
[InverseProperty(nameof(CommonJpEquipmentFailWarehouseState.Inventory))]
public virtual ICollection<CommonJpEquipmentFailWarehouseState> CommonJpEquipmentFailWarehouseStates { get; set; }
[InverseProperty(nameof(CommonJpEquipmentState.Eqiupment))]
public virtual ICollection<CommonJpEquipmentState> CommonJpEquipmentStates { get; set; }
[InverseProperty(nameof(CommonJpInventoryDetail.Inv))]
......
......@@ -12,6 +12,7 @@ namespace JmpModel.Model
{
public CommonJpUser()
{
BaseJpMessageReminderConfigs = new HashSet<BaseJpMessageReminderConfig>();
BaseJpTempFiles = new HashSet<BaseJpTempFile>();
CommonJpInventoryTables = new HashSet<CommonJpInventoryTable>();
CommonJpPoliceShiftJobsApplies = new HashSet<CommonJpPoliceShiftJobsApply>();
......@@ -77,6 +78,8 @@ namespace JmpModel.Model
[ForeignKey(nameof(PoliceId))]
[InverseProperty(nameof(BaseJpPoliceman.CommonJpUsers))]
public virtual BaseJpPoliceman Police { get; set; }
[InverseProperty(nameof(BaseJpMessageReminderConfig.UpdateUser))]
public virtual ICollection<BaseJpMessageReminderConfig> BaseJpMessageReminderConfigs { get; set; }
[InverseProperty(nameof(BaseJpTempFile.UploadUser))]
public virtual ICollection<BaseJpTempFile> BaseJpTempFiles { get; set; }
[InverseProperty(nameof(CommonJpInventoryTable.User))]
......
using JmpModel.Model;
using JmpModel.Model.DataContext;
using JmpModel.TempModel;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
......
......@@ -9,10 +9,16 @@ namespace JmpModel.Model
{
public partial class ViewEquipment
{
[Column("nameJc")]
[StringLength(64)]
public string NameJc { get; set; }
[Required]
[Column("org_id")]
[StringLength(36)]
public string OrgId { get; set; }
[Column("sortCode")]
[StringLength(36)]
public string SortCode { get; set; }
[Required]
[Column("org_name")]
[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.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
namespace JmpModel.Model
namespace JmpModel.TempModel
{
[Table("useCount")]
public partial class useCountResult
{
[Column("result")]
......
......@@ -8,6 +8,7 @@
"ModelNamespace": null,
"OutputContextPath": "Model\/DataContext",
"OutputPath": "Model",
"PreserveCasingWithRegex": true,
"ProjectRootNamespace": "JmpModel",
"Schemas": null,
"SelectedHandlebarsLanguage": 0,
......@@ -78,6 +79,18 @@
"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]",
"ObjectType": 0
},
......@@ -194,6 +207,10 @@
"ObjectType": 0
},
{
"Name": "[dbo].[common_jp_equipment_fail_warehouse_state]",
"ObjectType": 0
},
{
"Name": "[dbo].[common_jp_equipment_history]",
"ObjectType": 0
},
......@@ -418,7 +435,7 @@
"ObjectType": 3
}
],
"UiHint": "PC.junmppolicesql1115_3",
"UiHint": "pc.junmppolicesqldev.dbo",
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDbContextSplitting": false,
......@@ -435,5 +452,6 @@
"UseNodaTime": false,
"UseNullableReferences": 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;
using JmpModel.Model;
using JmpModel.Model.Repository;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters;
......@@ -34,13 +35,13 @@ namespace JunmpPoliceStation.App_Start
private readonly INacosNamingClient _serverNamingClient;
private readonly IHttpClientFactory _clientFactory;
public IConfiguration Configuration { get; }
private ILogger<PrintController> _logger;
private ILogger<AuthLoginAttribute> _logger;
private Boolean flg;
ApiConfig apicfg;
string urlGetSecretKey = string.Empty;//获取seckey的路由
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;
this.apicfg = apicfg;
......@@ -48,6 +49,7 @@ namespace JunmpPoliceStation.App_Start
this._serverNamingClient = _serverNamingClient;
this._clientFactory = _clientFactory;
this.Configuration = configuration;
this._logger = _logger;
_serverNamingClient.RegisterInstanceAsync(new RegisterInstanceRequest
{
ServiceName = apicfg.serviceName,
......@@ -190,7 +192,6 @@ namespace JunmpPoliceStation.App_Start
context.Result = new JsonResult(ex.ToString());
}
}
}
public class PlaInfo
{
......
......@@ -750,6 +750,7 @@ namespace JunmpPoliceStation.Controllers
var entity = JsonManager.GetJsonEntity(jdata);
string id = entity?.id ?? "";
bool bExpectedTime = DateTime.TryParse(entity?.expectedTime ?? "", out DateTime expectedTime);
bool bIsBindCabinet = bool.TryParse(entity?.isBindCabinet ?? "", out bool isBindCabinet);
if (entity == null)
{
return JsonManager.SimpleCustResponse($"model is null");
......@@ -795,6 +796,7 @@ namespace JunmpPoliceStation.Controllers
order.PoliceNote = entity.policeNote;
order.PoliceId = entity.policeId;
order.FileUrl = string.IsNullOrEmpty(entity.fileUrl) ? null : entity.fileUrl;
order.IsBindCabinet = isBindCabinet;
List<string> tmpList = JsonManager.GetDetails(entity.detailList);
List<string> tmpList2 = JsonManager.GetDetailIds(entity.detailList);
......@@ -959,7 +961,8 @@ namespace JunmpPoliceStation.Controllers
Note = entity.note,
PoliceNote = entity.policeNote,
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)
......@@ -1409,7 +1412,7 @@ namespace JunmpPoliceStation.Controllers
order.ApplyUser = entity.applyId;
order.ApplyUserName = entity.applyName;
order.PoliceNote = entity.policeNote;
order.PoliceId = entity.policeId;
order.PoliceId = string.IsNullOrEmpty(entity.policeId) ? null : entity.policeId;
order.ExpectedReturnTime = expectedTime;
......@@ -1558,7 +1561,7 @@ namespace JunmpPoliceStation.Controllers
ProcessCurrentId = processCurrentId,
ExpectedReturnTime = expectedTime,
PoliceNote = entity.policeNote,
PoliceId = entity.policeId
PoliceId = string.IsNullOrEmpty(entity.policeId) ? null : entity.policeId
};
List<CommonJpBorrowReturnDetailEstimate> detailsList = new List<CommonJpBorrowReturnDetailEstimate>();
foreach (var item in entity.detailList)
......@@ -2018,7 +2021,8 @@ namespace JunmpPoliceStation.Controllers
t.PoliceId,
policeName = t.Police?.Name,
processActionType = t.ProcessCurrent?.ActionType,
fileUrl= t.FileUrl,
fileUrl = t.FileUrl,
isBindCabinet = t.IsBindCabinet,
historyList = t.ProcessCurrent?.CommonJpProcessHistories?.Select(x => new
{
x.Id,
......
......@@ -285,7 +285,7 @@ namespace JunmpPoliceStation.Controllers
{
var entity = JsonManager.GetJsonEntity(jdata);
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[]
{
"Cabinet",
......@@ -294,7 +294,7 @@ namespace JunmpPoliceStation.Controllers
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
if (!bType|| type>2)
if (!bType || type > 2)
{
return JsonManager.SimpleStatusResponse(ResultCode.REQUEST_DATA_ERROR);
}
......@@ -969,7 +969,9 @@ namespace JunmpPoliceStation.Controllers
// stateCode = s.CurrentState,
// epc = s.Epc
//}).ToList(),
equList = cab.CommonJpEquipmentInventories?.Select(s => new
equList = cab.CommonJpEquipmentInventories?
.Where(s => s.CurrentState == 3 || s.CurrentState == 7)
.Select(s => new
{
id = s.Id,
name = s.EquipmentCodeNavigation?.Name,
......@@ -2777,7 +2779,7 @@ namespace JunmpPoliceStation.Controllers
editEpcEquipment = EpcEquipments.Where(p => p.Epc.Contains(rfid)).FirstOrDefault();
if (editEpcEquipment == null )
if (editEpcEquipment == null)
{
continue;
}
......@@ -2889,7 +2891,7 @@ namespace JunmpPoliceStation.Controllers
}
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();
equipmentDic.State = "rebind";
equipmentDic.Msg = "";
......@@ -2902,7 +2904,7 @@ namespace JunmpPoliceStation.Controllers
{
if (!Rfids.Contains(item.Epc))
{
if (item.PoliceCode==policeman.Id)
if (item.PoliceCode == policeman.Id)
{
item.PoliceCode = null;
OutEpc.Add(item);
......@@ -2923,7 +2925,7 @@ namespace JunmpPoliceStation.Controllers
}
if (invBind.Count>0)
if (invBind.Count > 0)
{
foreach (var item in invBind)
{
......@@ -2973,10 +2975,16 @@ namespace JunmpPoliceStation.Controllers
equipmentDic.UserName = policeman?.Name;
foreach (var item in OutsideEI)
{
if (item.PoliceCodeNavigation?.CabinetId == cabinet.Id)
{
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);
}
}
......
......@@ -2103,7 +2103,9 @@ namespace JunmpPoliceStation.Controllers
else
{
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)
{
return JsonManager.SimpleCustResponse("invalid policeId");
......
......@@ -12,6 +12,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using StackExchange.Redis;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -652,12 +653,21 @@ namespace JunmpPoliceStation.Controllers
{
detail.State = 1;
}
//江北仓库特殊处理
if (order.OrgId == "E05CC28D-C189-4389-8081-DD0D6E483B40")
{
//生成流水表
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);
......@@ -1032,11 +1042,21 @@ namespace JunmpPoliceStation.Controllers
{
detail.State = 1;
}
//江北仓库特殊处理
if (orderInfo.OrgId == "E05CC28D-C189-4389-8081-DD0D6E483B40")
{
//生成流水表
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, isLost);
UpdateInvState(orderInfo.CommonJpFixReceiveApplyDetails?.Select(x => x.Epc).ToList(), orderInfo.Action, orderInfo.OrderCode, false);
}
}
......
......@@ -615,6 +615,15 @@ namespace JunmpPoliceStation.Controllers
if (string.IsNullOrEmpty(entity.cabinetId))
{
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
{
......
......@@ -19,6 +19,7 @@ using System.Net.Http;
using System.Net.WebSockets;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Internal;
using JmpModel.TempModel;
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))
......@@ -805,7 +806,7 @@ namespace JunmpPoliceStation.Controllers
equipmentCode = c.Key,
equipmentName = c.FirstOrDefault().EquipmentCodeNavigation.Name,
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())
}).OrderByDescending(f => f.syCount).ToList();
......@@ -1007,16 +1008,28 @@ namespace JunmpPoliceStation.Controllers
int newpage = page * size;
int newsize = size;
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();
//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
//{
// totalElements = data.Count(),
// 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);
}
else
......
......@@ -956,6 +956,7 @@ namespace JunmpPoliceStation.Extensions
InsideItem.EquipmentLocation = 0;
InsideItem.UpdateUser = policeId;
InsideItem.WarehouseCode = warehouseId;
InsideItem.PoliceCode = null; //借用归还清空人员绑定
if (borrowIntoRealDetailEpcItem.InsideRealCount == null)
{
borrowIntoRealDetailEpcItem.InsideRealCount = 0;
......@@ -1069,9 +1070,30 @@ namespace JunmpPoliceStation.Extensions
{
brCount++;
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;//外出
invenItem.PoliceCode = realityItem.Reality?.Apply?.PoliceId;
}
}
else
{
invenItem.CurrentState = 8;
invenItem.EquipmentLocation = 3;//外出
}
invenItem.UpdateUser = policeId;
if (reRealEpcDetailList.Count.Equals(0))
{
......
......@@ -58,6 +58,8 @@
<ItemGroup>
<PackageReference Include="AspNetCoreRateLimit" Version="3.2.2" />
<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="LitJson" Version="0.18.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="3.1.10" />
......@@ -117,7 +119,7 @@
<ProjectReference Include="..\JmpMsgService\JmpMsgService.csproj" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
<ProjectExtensions><VisualStudio><UserProperties properties_4launchsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>
{
"iisSettings": {
"windowsAuthentication": false,
"windowsAuthentication": true,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53692/",
"sslPort": 44399
"applicationUrl": "http://localhost:5000",
"sslPort": 5000
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger/index.html",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "http://192.168.3.1:5000;http://192.168.10.88:5000;http://localhost:5001;http://localhost:5000;"
},
"JunmpPoliceStation": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger/index.html",
"environmentVariables": {
"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;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Hangfire.MemoryStorage.Entities;
using Hangfire;
using Hangfire.MemoryStorage;
using JmpModel.Model;
using JmpModel.Model.DataContext;
using JmpModel.Model.Repository;
......@@ -32,6 +35,7 @@ using Nacos.AspNetCore;
using NLog.Extensions.Logging;
using Rextec.SOA.Infrastructure;
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
using Microsoft.AspNetCore.HttpOverrides;
namespace JunmpPoliceStation
{
......@@ -139,6 +143,20 @@ namespace JunmpPoliceStation
//});
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
});
//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 =>
//{
// routes.MapRoute(
......
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论