修正
This commit is contained in:
parent
1f17ff190a
commit
9f3bfdf236
@ -3,6 +3,7 @@ using DOAN.Model.PBL.Dto;
|
|||||||
using DOAN.Model.PBL;
|
using DOAN.Model.PBL;
|
||||||
using DOAN.Service.PBL.IPBLService;
|
using DOAN.Service.PBL.IPBLService;
|
||||||
using DOAN.Admin.WebApi.Filters;
|
using DOAN.Admin.WebApi.Filters;
|
||||||
|
using Infrastructure.Converter;
|
||||||
|
|
||||||
//创建时间:2024-11-01
|
//创建时间:2024-11-01
|
||||||
namespace DOAN.Admin.WebApi.Controllers.PBL
|
namespace DOAN.Admin.WebApi.Controllers.PBL
|
||||||
@ -33,6 +34,9 @@ namespace DOAN.Admin.WebApi.Controllers.PBL
|
|||||||
[ActionPermissionFilter(Permission = "lightlog:list")]
|
[ActionPermissionFilter(Permission = "lightlog:list")]
|
||||||
public IActionResult QueryLightLog([FromQuery] LightLogQueryDto parm)
|
public IActionResult QueryLightLog([FromQuery] LightLogQueryDto parm)
|
||||||
{
|
{
|
||||||
|
parm.TimeRange[0]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[0]??DateTime.MinValue);
|
||||||
|
parm.TimeRange[1]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[1]??DateTime.MinValue);
|
||||||
|
|
||||||
var response = _LightLogService.GetList(parm);
|
var response = _LightLogService.GetList(parm);
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using DOAN.Model.PBL.Dto;
|
|||||||
using DOAN.Model.PBL;
|
using DOAN.Model.PBL;
|
||||||
using DOAN.Service.PBL.IPBLService;
|
using DOAN.Service.PBL.IPBLService;
|
||||||
using DOAN.Admin.WebApi.Filters;
|
using DOAN.Admin.WebApi.Filters;
|
||||||
|
using Infrastructure.Converter;
|
||||||
|
|
||||||
//创建时间:2024-11-01
|
//创建时间:2024-11-01
|
||||||
namespace DOAN.Admin.WebApi.Controllers.PBL
|
namespace DOAN.Admin.WebApi.Controllers.PBL
|
||||||
@ -33,6 +34,11 @@ namespace DOAN.Admin.WebApi.Controllers.PBL
|
|||||||
[ActionPermissionFilter(Permission = "mesinterationlog:list")]
|
[ActionPermissionFilter(Permission = "mesinterationlog:list")]
|
||||||
public IActionResult QueryMesInterationLog([FromQuery] MesInterationLogQueryDto parm)
|
public IActionResult QueryMesInterationLog([FromQuery] MesInterationLogQueryDto parm)
|
||||||
{
|
{
|
||||||
|
parm.TimeRange[0]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[0]??DateTime.MinValue);
|
||||||
|
parm.TimeRange[1]= DOANConvertDateTime.ConvertLocalDateTime(parm.TimeRange[1]??DateTime.MinValue);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var response = _MesInterationLogService.GetList(parm);
|
var response = _MesInterationLogService.GetList(parm);
|
||||||
return SUCCESS(response);
|
return SUCCESS(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ namespace DOAN.Model.PBL.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class LightLogQueryDto : PagerInfo
|
public class LightLogQueryDto : PagerInfo
|
||||||
{
|
{
|
||||||
|
public DateTime?[] TimeRange { get; set; }=new DateTime?[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -6,6 +6,8 @@ namespace DOAN.Model.PBL.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class MesInterationLogQueryDto : PagerInfo
|
public class MesInterationLogQueryDto : PagerInfo
|
||||||
{
|
{
|
||||||
|
public string Workorder { get; set; }
|
||||||
|
public DateTime?[] TimeRange { get; set; }=new DateTime?[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -71,7 +71,10 @@ namespace DOAN.Service.PBL
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static Expressionable<LightLog> QueryExp(LightLogQueryDto parm)
|
private static Expressionable<LightLog> QueryExp(LightLogQueryDto parm)
|
||||||
{
|
{
|
||||||
var predicate = Expressionable.Create<LightLog>();
|
var predicate = Expressionable.Create<LightLog>()
|
||||||
|
.AndIF(parm.TimeRange[0]>DateTime.MinValue, it => it.CreatedTime >=parm.TimeRange[0])
|
||||||
|
.AndIF(parm.TimeRange[1]>DateTime.MinValue, it => it.CreatedTime <=parm.TimeRange[1])
|
||||||
|
;
|
||||||
|
|
||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using DOAN.Model.PBL.Dto;
|
|||||||
using DOAN.Model.PBL;
|
using DOAN.Model.PBL;
|
||||||
using DOAN.Repository;
|
using DOAN.Repository;
|
||||||
using DOAN.Service.PBL.IPBLService;
|
using DOAN.Service.PBL.IPBLService;
|
||||||
|
using SqlSugar.SplitTableExtensions;
|
||||||
|
|
||||||
namespace DOAN.Service.PBL
|
namespace DOAN.Service.PBL
|
||||||
{
|
{
|
||||||
@ -71,7 +72,11 @@ namespace DOAN.Service.PBL
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static Expressionable<MesInterationLog> QueryExp(MesInterationLogQueryDto parm)
|
private static Expressionable<MesInterationLog> QueryExp(MesInterationLogQueryDto parm)
|
||||||
{
|
{
|
||||||
var predicate = Expressionable.Create<MesInterationLog>();
|
var predicate = Expressionable.Create<MesInterationLog>()
|
||||||
|
.AndIF(string.IsNullOrEmpty(parm.Workorder),it=>it.Workorder.Contains(parm.Workorder))
|
||||||
|
.AndIF(parm.TimeRange[0]>DateTime.MinValue, it => it.CreatedTime >=parm.TimeRange[0])
|
||||||
|
.AndIF(parm.TimeRange[1]>DateTime.MinValue, it => it.CreatedTime <=parm.TimeRange[1])
|
||||||
|
;
|
||||||
|
|
||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
|||||||
38
Infrastructure/Converter/DOANConvertDateTime.cs
Normal file
38
Infrastructure/Converter/DOANConvertDateTime.cs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Infrastructure.Converter;
|
||||||
|
|
||||||
|
public class DOANConvertDateTime
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 日期转本地日期
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="handleDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DateTime ConvertLocalDateTime(DateTime handleDate)
|
||||||
|
{
|
||||||
|
if (handleDate.Kind == DateTimeKind.Utc)
|
||||||
|
{
|
||||||
|
handleDate = handleDate.ToLocalTime();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return handleDate.Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 日期转本地日期
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="handleDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static DateTime ConvertLocalDate(DateTime handleDate)
|
||||||
|
{
|
||||||
|
if (handleDate.Kind == DateTimeKind.Utc)
|
||||||
|
{
|
||||||
|
handleDate = handleDate.ToLocalTime();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return handleDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user