This commit is contained in:
2023-11-23 15:52:03 +08:00
parent c18e5cd2d1
commit fda9ec5e72

View File

@@ -30,6 +30,7 @@ namespace Tnb.ProductionMgr
private readonly IUserManager _userManager;
private readonly IPrdMoTaskService _prdMoTaskService;
private readonly IBillRullService _billRullService;
private readonly IDictionaryDataService _dictionaryDataService;
// private readonly WmsSignForDeliveryService _wmsSignForDeliveryService;
@@ -39,6 +40,7 @@ namespace Tnb.ProductionMgr
IBillRullService billRullService,
IPrdMoTaskService prdMoTaskService,
// WmsSignForDeliveryService wmsSignForDeliveryService,
IDictionaryDataService dictionaryDataService,
IUserManager userManager
)
{
@@ -46,6 +48,7 @@ namespace Tnb.ProductionMgr
_userManager = userManager;
_prdMoTaskService = prdMoTaskService;
// _wmsSignForDeliveryService = _wmsSignForDeliveryService;
_dictionaryDataService = dictionaryDataService;
_billRullService = billRullService;
}
@@ -522,7 +525,9 @@ namespace Tnb.ProductionMgr
string? status = queryJson.ContainsKey("status") ? queryJson["status"].ToString() : "";
// DateTime? start_time = queryJson.ContainsKey("start_time") ? queryJson["start_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["start_time"]) : null;
// DateTime? end_time = queryJson.ContainsKey("end_time") ? queryJson["end_time"].ToString() == "" ? null : Convert.ToDateTime(queryJson["end_time"]) : null;
Dictionary<string, object> dic = await _dictionaryDataService.GetDicByKey(DictConst.DOCUMENTSTATU);
if (string.IsNullOrEmpty(input.sidx))
{
input.sidx = "create_time";
@@ -564,7 +569,7 @@ namespace Tnb.ProductionMgr
type = "0",
create_name = b.RealName,
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
status = e.FullName
status = SqlFunc.IsNull(e.FullName,a.status)
});
var queryable2 = db.Queryable<PrdOutstockH>()
@@ -582,11 +587,18 @@ namespace Tnb.ProductionMgr
type = a.type,
create_name = b.RealName,
create_time = a.create_time==null ? "" : a.create_time.Value.ToString(DbTimeFormat.SS),
status = e.FullName
status = SqlFunc.IsNull(e.FullName,a.status)
});
var result = await db.UnionAll(queryable1,queryable2)
.MergeTable()
.OrderBy($"{input.sidx} {input.sort}")
.Mapper(a =>
{
if (dic.ContainsKey(a.status))
{
a.status = dic[a.status].ToString();
}
})
.ToPagedListAsync(input.currentPage, input.pageSize);
return PageResult<FeedingRecordListOutput>.SqlSugarPageResult(result);