@@ -112,7 +112,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult AssStatusData() | |||
{ | |||
List<Ass_AssetsInfoItemEntity> data = assAssetsInfoItemIbll.GetLists("{\"a\":\"false\"}").ToList(); | |||
var list = data.GroupBy(a => a.AIIsScrap).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
var list = data.GroupBy(a => a.AIASSState==2).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
List<object> list2 = new List<object>(); | |||
List<String> list1 = new List<String>(); | |||
foreach (var item in list) | |||
@@ -130,7 +130,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
public ActionResult AssStatusList() | |||
{ | |||
List<Ass_AssetsInfoItemEntity> data = assAssetsInfoItemIbll.GetLists("{\"a\":\"false\"}").ToList(); | |||
var list =data.GroupBy(a => a.AIIsScrap).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
var list =data.GroupBy(a => a.AIASSState == 2).Select(a => new { a.Key, price = a.Sum(b => b.AIAssValue), num = a.Count() }).ToList(); | |||
List<object> list2 = new List<object>(); | |||
foreach (var item in list) | |||
{ | |||
@@ -223,26 +223,30 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
public void ModifyStatusByProcessId(int pastatus, string processId) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
var entity = this.BaseRepository().FindEntity<Ass_ScrapEntity>(a => a.SPProcessId == processId); | |||
entity.SPStatus = pastatus; | |||
this.BaseRepository().Update(entity); | |||
db.Update(entity); | |||
if (pastatus == 2) | |||
{ | |||
var listScrapItem = this.BaseRepository().FindList<Ass_ScrapItemEntity>(a => a.SPId == entity.SPID); | |||
var listScrapItem = db.FindList<Ass_ScrapItemEntity>(a => a.SPId == entity.SPID); | |||
foreach (var item in listScrapItem) | |||
{ | |||
var assInfo = this.BaseRepository().FindEntity<Ass_AssetsInfoEntity>(a => a.AId == item.AAIAId); | |||
var assInfoItem = this.BaseRepository().FindEntity<Ass_AssetsInfoItemEntity>(a => a.AId == item.AAIAId); | |||
var assInfoItem = db.FindEntity<Ass_AssetsInfoItemEntity>(a => a.AIId == item.AAIAId); | |||
var assInfo = db.FindEntity<Ass_AssetsInfoEntity>(a => a.AId == assInfoItem.AId); | |||
if (assInfoItem.AIIsInStorage == true) | |||
{ | |||
assInfoItem.AIIsInStorage = false; | |||
assInfo.AStock = assInfo.AStock - 1; | |||
assInfoItem.AIASSState = 1; | |||
if (assInfo != null) | |||
{ | |||
assInfo.AStock = assInfo.AStock - 1; | |||
db.Update(assInfo); | |||
} | |||
assInfoItem.AIASSState = 2; | |||
this.BaseRepository().Update(assInfoItem); | |||
this.BaseRepository().Update(assInfo); | |||
db.Update(assInfoItem); | |||
} | |||
@@ -250,10 +254,12 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception e) | |||
{ | |||
db.Rollback(); | |||
if (e is ExceptionEx) | |||
{ | |||
throw; | |||
@@ -229,7 +229,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
infoItem.AId = assInfoEntity.AId; | |||
infoItem.AICode = assInfoEntity.ACode + "_" + codeNum.ToString(); | |||
infoItem.AICodeNum = codeNum; | |||
infoItem.AIIsScrap = false; | |||
} | |||
this.BaseRepository().Update(assInfoItemList2); | |||
@@ -316,7 +316,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = assinfoitem.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
insertassinfoitem.AISpecification = assitemapp.AAISpecification; | |||
@@ -371,7 +370,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
if (insertassinfoitem.AIIsInStorage == false) | |||
{ | |||
insertassinfoitem.AIIsInStorage = true; | |||
insertassinfoitem.AIIsScrap = false; | |||
db.Update(insertassinfoitem); | |||
} | |||
} | |||
@@ -417,7 +415,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = insertAss_AssetsInfo.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIAssType = assinfoapp.AAAssType; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
@@ -475,7 +472,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
insertassinfoitem.AICodeNumJY = insertAss_AssetsInfo.ACode + "_" + insertassinfoitem.AICodeNum.ToString(); | |||
insertassinfoitem.AIASSName = assitemapp.AAIName; | |||
insertassinfoitem.AIIStorageId = assitemapp.AAIStorageId; | |||
insertassinfoitem.AIIsScrap = false; | |||
insertassinfoitem.AIAssType = assinfoapp.AAAssType; | |||
insertassinfoitem.AIIStoragePosition = assitemapp.AAIStoragePosition; | |||
insertassinfoitem.AIIsInStorage = true; | |||
@@ -15,37 +15,37 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// AIId | |||
/// ID | |||
/// </summary> | |||
[Column("AIID")] | |||
public string AIId { get; set; } | |||
/// <summary> | |||
/// AId | |||
/// 资产ID | |||
/// </summary> | |||
[Column("AID")] | |||
public string AId { get; set; } | |||
/// <summary> | |||
/// AICodeNum | |||
/// 编号 | |||
/// </summary> | |||
[Column("AICODENUM")] | |||
public int? AICodeNum { get; set; } | |||
/// <summary> | |||
/// AICode | |||
/// 资产明细编号 | |||
/// </summary> | |||
[Column("AICODE")] | |||
public string AICode { get; set; } | |||
/// <summary> | |||
/// AIIStorageId | |||
/// 所在库房Id | |||
/// </summary> | |||
[Column("AIISTORAGEID")] | |||
public string AIIStorageId { get; set; } | |||
/// <summary> | |||
/// AIIStoragePosition | |||
/// 所在库位 | |||
/// </summary> | |||
[Column("AIISTORAGEPOSITION")] | |||
public string AIIStoragePosition { get; set; } | |||
/// <summary> | |||
/// AIIsInStorage | |||
/// 是否在库 | |||
/// </summary> | |||
[Column("AIISINSTORAGE")] | |||
public bool? AIIsInStorage { get; set; } | |||
@@ -100,7 +100,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
[Column("AIASSCLASS")] | |||
public string AIASSClass { get; set; } | |||
/// <summary> | |||
/// 资产状态 | |||
/// 资产状态 0 正常使用 2 报废 | |||
/// </summary> | |||
[Column("AIASSSTATE")] | |||
public int? AIASSState { get; set; } | |||
@@ -209,11 +209,6 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// </summary> | |||
[Column("AIUSE")] | |||
public string AIUse { get; set; } | |||
/// <summary> | |||
/// 是否报废 | |||
/// </summary> | |||
[Column("AIISSCRAP")] | |||
public bool? AIIsScrap { get; set; } | |||
/// <summary> | |||
/// 资产类别 | |||