Merge branch 'dev' of https://git.tuotong-tech.com/tnb/tnb.server into dev
This commit is contained in:
@@ -8,8 +8,8 @@ namespace Tnb.BasicData.Entities.Dto
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public DateTime? start_time { get; set; }
|
||||
public string start_time { get; set; }
|
||||
|
||||
public DateTime? end_time { get; set; }
|
||||
public string end_time { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Filter;
|
||||
|
||||
namespace Tnb.BasicData.Interfaces
|
||||
@@ -20,6 +21,6 @@ namespace Tnb.BasicData.Interfaces
|
||||
/// 获取有效的已发布的工艺路线
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
public Task<dynamic> GetValidRouteList(PageInputBase pageInputBase);
|
||||
public Task<dynamic> GetValidRouteList(VisualDevDataFieldDataListInput pageInput);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
@@ -83,23 +84,23 @@ namespace Tnb.BasicData
|
||||
/// </summary>
|
||||
/// <param name="parameters"></param>
|
||||
[HttpPost]
|
||||
public async Task<dynamic> GetValidRouteList([FromBody]PageInputBase pageInputBase)
|
||||
public async Task<dynamic> GetValidRouteList([FromBody]VisualDevDataFieldDataListInput pageInput)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
var result = await db.Queryable<BasRouteH>()
|
||||
.Where(x => x.status == "1" && ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value>=DateTime.Now)
|
||||
|| (x.start_time==null && x.end_time>=DateTime.Now)
|
||||
|| (x.end_time==null && x.start_time<=DateTime.Now)
|
||||
|| (x.start_time == null && x.end_time == null)
|
||||
))
|
||||
.Select(x=>new VaildRouteOutput()
|
||||
.Where(x => x.status == "1"
|
||||
&& ((x.start_time != null && x.start_time.Value <= DateTime.Now && x.end_time != null && x.end_time.Value>=DateTime.Now)
|
||||
|| (x.start_time==null && x.end_time>=DateTime.Now)
|
||||
|| (x.end_time==null && x.start_time<=DateTime.Now)
|
||||
|| (x.start_time == null && x.end_time == null)
|
||||
)).Select(x=>new VaildRouteOutput()
|
||||
{
|
||||
id = x.id,
|
||||
code = x.code,
|
||||
name = x.name,
|
||||
start_time = x.start_time,
|
||||
end_time = x.end_time,
|
||||
}).ToPagedListAsync(pageInputBase.currentPage, pageInputBase.pageSize);
|
||||
start_time = x.start_time.Value.ToString("yyyy-MM-dd"),
|
||||
end_time = x.end_time.Value.ToString("yyyy-MM-dd"),
|
||||
}).ToPagedListAsync(pageInput.currentPage, pageInput.pageSize);
|
||||
return PageResult<VaildRouteOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user