Commit 497a1a28 by zxw

装备表新增UpdateTime字段 新增or修改currentstate时更新

三方接口中增加本仓库出入库业务
parent 5c072baa
......@@ -174,6 +174,11 @@ namespace JmpModel.Model
[Column("tid")]
[StringLength(255)]
public string Tid { get; set; }
/// <summary>
/// 更新时间
/// </summary>
[Column("update_time", TypeName = "datetime")]
public DateTime? UpdateTime { get; set; }
[ForeignKey(nameof(BagInventoryId))]
[InverseProperty(nameof(CommonJpBagInventory.CommonJpEquipmentInventories))]
......
......@@ -11,15 +11,11 @@ namespace JmpModel.Model.DataContext
{
public JunmppolicesqlContext()
{
//60秒超时
this.Database.SetCommandTimeout(60);
}
public JunmppolicesqlContext(DbContextOptions<JunmppolicesqlContext> options)
: base(options)
{
//60秒超时
this.Database.SetCommandTimeout(60);
}
public virtual DbSet<AlipayConfig> AlipayConfigs { get; set; }
......@@ -333,19 +329,6 @@ namespace JmpModel.Model.DataContext
.HasConstraintName("base_jp_cabinet_policeman_ibfk_2");
});
modelBuilder.Entity<BaseJpCabinetPolicemanMultiple>(entity =>
{
entity.Property(e => e.Id).IsFixedLength();
entity.Property(e => e.BoxNo).IsFixedLength();
entity.Property(e => e.CabinetRealId).IsFixedLength();
entity.Property(e => e.UserId).IsFixedLength();
entity.Property(e => e.UserName).IsFixedLength();
});
modelBuilder.Entity<BaseJpCabinetWorklog>(entity =>
{
entity.Property(e => e.Id).IsUnicode(false);
......@@ -1165,6 +1148,12 @@ Smart:智能货架
entity.HasIndex(e => e.CurrentState)
.HasName("IX_common_jp_borrow_return");
entity.HasIndex(e => new { e.WarehouseId, e.OrderCode, e.OrgId, e.CreateTime, e.IsWork, e.CurrentState, e.ActionType, e.ApplyId, e.Id })
.HasName("_dta_index_common_jp_borrow_return_9_1013578649__K4_K5_K12_K1_6_8_9_11_14");
entity.HasIndex(e => new { e.Sort, e.PolicemanId, e.CurrentState, e.ActionType, e.WarehouseId, e.OutTime, e.OrderCode, e.OrgId, e.CreateUser, e.CreateTime, e.IsAfter, e.IsWork, e.UpdateUser, e.ApplyId, e.Id })
.HasName("_dta_index_common_jp_borrow_return_5_1013578649__K12_K1_2_3_4_5_6_7_8_9_10_11_13_14_15");
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.ApplyId).IsUnicode(false);
......@@ -1205,6 +1194,9 @@ Smart:智能货架
modelBuilder.Entity<CommonJpBorrowReturnApply>(entity =>
{
entity.HasIndex(e => new { e.ProcessCurrentId, e.ActionType })
.HasName("_dta_index_common_jp_borrow_return_apply_5_1029578706__K22_K4");
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.ApplyId).IsUnicode(false);
......@@ -1317,6 +1309,9 @@ Smart:智能货架
modelBuilder.Entity<CommonJpBorrowReturnDetailReality>(entity =>
{
entity.HasIndex(e => new { e.RealityId, e.EquipmentDetailId })
.HasName("_dta_index_common_jp_borrow_return_detail_r_9_1061578820__K2_K7");
entity.Property(e => e.Id).IsUnicode(false);
entity.Property(e => e.EquipmentDetailId).IsUnicode(false);
......@@ -1778,6 +1773,9 @@ Smart:智能货架
entity.HasIndex(e => new { e.Id, e.SupplierCode, e.WarrantyCycle, e.UseTime, e.EquipmentCode, e.WarehouseCode, e.CabinetId, e.EquipmentSizecode, e.CurrentState })
.HasName("_dta_index_common_jp_equipment_inventory_8_1109578991__K6_K8_K9_K10_K12_1_3_20_23");
entity.HasIndex(e => new { e.CurrentState, e.CreateTime, e.Price, e.SafeLevel, e.IsFixed, e.OrgId, e.InventoryState, e.EquipmentSizecode, e.EquipmentCode, e.WarehouseCode })
.HasName("_dta_index_common_jp_equipment_inventory_9_1109578991__K41_K31_K10_K6_K8_12_15_24_36_42");
entity.HasIndex(e => new { e.Sort, e.SupplierCode, e.Epc, e.PoliceCode, e.EquipmentCode, e.Wzdm, e.CabinetId, e.EquipmentSizecode, e.EquipmentLocation, e.OutTime, e.ReturnTime, e.CreateTime, e.FirstUseTime, e.FixCount, e.CreateUser, e.UpdateUser, e.WarrantyCycle, e.RepairCycle, e.ProductTime, e.UseTime, e.Price, e.UseDirection, e.CurrentState, e.Id, e.WarehouseCode })
.HasName("_dta_index_common_jp_equipment_inventory_8_1109578991__K12_K1_K8_2_3_4_5_6_7_9_10_11_13_14_15_16_17_18_19_20_21_22_23_24_25");
......@@ -1854,6 +1852,8 @@ Smart:智能货架
.IsUnicode(false)
.HasComment("标签TID");
entity.Property(e => e.UpdateTime).HasComment("更新时间");
entity.Property(e => e.UpdateUser).IsUnicode(false);
entity.Property(e => e.WarehouseCode).IsUnicode(false);
......
......@@ -435,9 +435,11 @@
"ObjectType": 3
}
],
"UiHint": "PC.junmppolicesqldev",
"UiHint": "pc.junmppolicesqldev.dbo",
"UncountableWords": null,
"UseBoolPropertiesWithoutDefaultSql": false,
"UseDatabaseNames": false,
"UseDateOnlyTimeOnly": false,
"UseDbContextSplitting": false,
"UseFluentApiOnly": false,
"UseHandleBars": false,
......@@ -445,9 +447,7 @@
"UseInflector": true,
"UseLegacyPluralizer": false,
"UseManyToManyEntity": false,
"UseNoConstructor": false,
"UseNoDefaultConstructor": false,
"UseNoNavigations": false,
"UseNoObjectFilter": false,
"UseNodaTime": false,
"UseNullableReferences": false,
......
......@@ -323,6 +323,8 @@ namespace JunmpPoliceStation.Controllers
{
inventory.CabinetId = null;
inventory.CurrentState = 8;
//更新时间
inventory.UpdateTime = DateTime.Now;
updateInvs.Add(inventory);
}
}
......@@ -331,6 +333,8 @@ namespace JunmpPoliceStation.Controllers
{
Inv.CabinetId = null;
Inv.CurrentState = 8;
//更新时间
Inv.UpdateTime = DateTime.Now;
updateInvs.Add(Inv);
}
}
......@@ -1267,6 +1271,16 @@ namespace JunmpPoliceStation.Controllers
}
}
var newInvList = _unitOfWork.DbContext.ChangeTracker.Entries()
.Where(x => x.Entity is CommonJpEquipmentInventory)
.Select(x => x.Entity as CommonJpEquipmentInventory)
.ToList();
foreach (var inventory in newInvList)
{
inventory.UpdateTime = DateTime.Now;
}
bool result = true;
if (OutEpc.Count > 0)
{
......@@ -1563,6 +1577,16 @@ namespace JunmpPoliceStation.Controllers
}
}
var newInvList = _unitOfWork.DbContext.ChangeTracker.Entries()
.Where(x => x.Entity is CommonJpEquipmentInventory)
.Select(x => x.Entity as CommonJpEquipmentInventory)
.ToList();
foreach (var inventory in newInvList)
{
inventory.UpdateTime = DateTime.Now;
}
bool result = true;
if (OutEpc.Count > 0)
{
......@@ -2225,6 +2249,16 @@ namespace JunmpPoliceStation.Controllers
}
}
}
var newInvList = _unitOfWork.DbContext.ChangeTracker.Entries()
.Where(x => x.Entity is CommonJpEquipmentInventory)
.Select(x => x.Entity as CommonJpEquipmentInventory)
.ToList();
foreach (var inventory in newInvList)
{
inventory.UpdateTime = DateTime.Now;
}
bool result = true;
if (OutEpc.Count > 0)
{
......@@ -2560,6 +2594,16 @@ namespace JunmpPoliceStation.Controllers
}
}
}
var newInvList = _unitOfWork.DbContext.ChangeTracker.Entries()
.Where(x => x.Entity is CommonJpEquipmentInventory)
.Select(x => x.Entity as CommonJpEquipmentInventory)
.ToList();
foreach (var inventory in newInvList)
{
inventory.UpdateTime = DateTime.Now;
}
bool result = true;
if (OutEpc.Count > 0)
{
......@@ -2958,6 +3002,15 @@ namespace JunmpPoliceStation.Controllers
}
var newInvList = _unitOfWork.DbContext.ChangeTracker.Entries()
.Where(x => x.Entity is CommonJpEquipmentInventory)
.Select(x => x.Entity as CommonJpEquipmentInventory)
.ToList();
foreach (var inventory in newInvList)
{
inventory.UpdateTime = DateTime.Now;
}
bool result = true;
if (InsertState.Count > 0)
......@@ -3751,6 +3804,7 @@ namespace JunmpPoliceStation.Controllers
item.CurrentState = 7;
item.PoliceCode = null;
item.CabinetId = null;
item.UpdateTime = DateTime.Now;
EqInv.Add(item);
}
_unitOfWork.EquipmentInventoryRepository.Update(EqInv, false);
......@@ -3999,6 +4053,7 @@ namespace JunmpPoliceStation.Controllers
item.CurrentState = 7;
item.PoliceCode = null;
item.CabinetId = null;
item.UpdateTime = DateTime.Now;
EqInv.Add(item);
}
_unitOfWork.EquipmentInventoryRepository.Update(EqInv, false);
......
......@@ -1292,6 +1292,7 @@ namespace JunmpPoliceStation.Controllers
//单警柜解绑
x.CabinetId = null;
x.PoliceCode = null;
x.UpdateTime=DateTime.Now;
_unitOfWork.EquipmentInventoryRepository.Update(x, false);
});
......@@ -1370,6 +1371,7 @@ namespace JunmpPoliceStation.Controllers
x.EquipmentLocation = 0;
x.IsFixed = true;
x.UpdateTime = DateTime.Now;
_unitOfWork.EquipmentInventoryRepository.Update(x, false);
});
......
......@@ -1032,6 +1032,7 @@ namespace JunmpPoliceStation.Controllers
x.WarehouseCode = null;
x.OrgId = orgId;
x.PoliceCode = policeId;
x.UpdateTime=DateTime.Now;
_unitOfWork.EquipmentInventoryRepository.Update(x, false);
});
......
......@@ -1541,7 +1541,8 @@ namespace JunmpPoliceStation.Controllers
RepairCycle = repairCycle,
IsBorrowed = false,
InstantiationState = 2,
OrgId = warehouse?.OrgizationId
OrgId = warehouse?.OrgizationId,
UpdateTime = DateTime.Now
};
res = _unitOfWork.EquipmentInventoryRepository.Insert(ent);
}
......@@ -1713,7 +1714,8 @@ namespace JunmpPoliceStation.Controllers
RepairCycle = repairCycle,
IsBorrowed = false,
InstantiationState = 2,
OrgId = warehouse?.OrgizationId
OrgId = warehouse?.OrgizationId,
UpdateTime = DateTime.Now
};
if (!string.IsNullOrEmpty(shelfId))
......@@ -1951,7 +1953,8 @@ namespace JunmpPoliceStation.Controllers
RepairCycle = repairCycle,
IsBorrowed = false,
InstantiationState = 2,
OrgId = warehouse?.OrgizationId
OrgId = warehouse?.OrgizationId,
UpdateTime = DateTime.Now
};
_unitOfWork.EquipmentInventoryRepository.Insert(ent, false);
}
......@@ -2170,7 +2173,8 @@ namespace JunmpPoliceStation.Controllers
IsInBox = true,
BoxMarkId = boxMark.Id,
InstantiationState = 1,
OrgId = warehouse?.OrgizationId
OrgId = warehouse?.OrgizationId,
UpdateTime = DateTime.Now
};
if (!string.IsNullOrEmpty(shelfId))
{
......@@ -2389,7 +2393,8 @@ namespace JunmpPoliceStation.Controllers
InstantiationState = 1,
BoxMarkId = boxMark.Id,
IsInBox = true,
OrgId = warehouse?.OrgizationId
OrgId = warehouse?.OrgizationId,
UpdateTime = DateTime.Now
};
if (!string.IsNullOrEmpty(shelfId))
{
......@@ -2613,6 +2618,7 @@ namespace JunmpPoliceStation.Controllers
ShelfRow = epcObj.ShelfRow,
ShelfColumn = epcObj.ShelfColumn,
OrgId = epcObj.Detail?.Order?.OrgId,
UpdateTime = DateTime.Now
}, false);
epcObj.CurrentState = 2;
purchaseCount++;
......@@ -3054,6 +3060,7 @@ namespace JunmpPoliceStation.Controllers
invNew.UseTime = DateTime.Now;
invNew.ProductTime = DateTime.Parse(item.生产日期);
invNew.OrgId = warehouseName?.OrgizationId;
invNew.UpdateTime=DateTime.Now;
//var ent = new CommonJpEquipmentInventory
//{
// Id = Guid.NewGuid().ToString(),
......@@ -3933,6 +3940,7 @@ namespace JunmpPoliceStation.Controllers
old.BoxMarkId = boxMarkId;
old.InstantiationState = instantiationState;
old.OrgId = warehouse?.OrgizationId;
old.UpdateTime=DateTime.Now;
updateList.Add(old);
}
if (editType == "ADD")
......@@ -3968,6 +3976,7 @@ namespace JunmpPoliceStation.Controllers
IsInBox = isInBox,
BoxMarkId = boxMarkId,
InstantiationState = instantiationState,
UpdateTime = DateTime.Now
});
}
if (editType == "DELETE")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论