using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEAWCS_Core.BaseRepository;
|
using WIDESEAWCS_Core.BaseServices;
|
using WIDESEAWCS_DTO.Telescopic;
|
using WIDESEAWCS_Model.Models;
|
|
namespace WIDESEAWCS_ITelescopicService
|
{
|
public class MaintenanceTeamService : ServiceBase<Dt_MaintenanceTeam, IRepository<Dt_MaintenanceTeam>>, IMaintenanceTeamService
|
{
|
public IRepository<Dt_MaintenanceTeam> Repository => BaseDal;
|
|
public MaintenanceTeamService(IRepository<Dt_MaintenanceTeam> BaseDal) : base(BaseDal)
|
{
|
|
}
|
|
|
<<<<<<< Updated upstream
|
=======
|
/// <summary>
|
/// 检修设置记录
|
/// </summary>
|
/// <returns></returns>
|
/// <exception cref="NotImplementedException"></exception>
|
public WebResponseContent MaintenanceSettingRecord(PaginationDTO pagination)
|
{
|
try
|
{
|
int totalCount = 0;
|
|
var sys = _user.Db.Queryable<Sys_User>();
|
var main = Db.Queryable<Dt_MaintenanceTeam>();
|
|
var query = sys.InnerJoin<Dt_MaintenanceTeam>((a, b) => a.UserTrueName == b.OperatorName);
|
if (!string .IsNullOrEmpty(pagination.searchKeyword))
|
{
|
|
query = query.Where((a, b) =>
|
b.OperatorName.Contains(pagination.searchKeyword) ||
|
b.TeamName.Contains(pagination.searchKeyword) ||
|
b.Modifier.Contains(pagination.searchKeyword)
|
);
|
}
|
if (pagination.startDate.HasValue&&pagination.endDate.HasValue)
|
{
|
query = query.Where((a, b) => b.DistributionTime >= pagination.startDate && b.DistributionTime <= pagination.endDate);
|
}
|
var result=query
|
.Select((a, b) => new
|
{
|
a.User_Id,
|
b.OperatorName,
|
b.TeamName,
|
a.HeadImageUrl,
|
b.DistributionTime,
|
b.Modifier,
|
}).ToPageList(pagination.pageIndex, pagination.pageSize, ref totalCount);
|
return new WebResponseContent
|
{
|
Status = true,
|
Data = new
|
{
|
TotalCount = totalCount,//总数
|
PageIndex = pagination.pageIndex,//页数
|
PageSize = pagination.pageSize,//一页多少个数据
|
Items = result
|
}
|
};
|
|
}
|
catch (Exception ex)
|
{
|
|
return new WebResponseContent { Status = false,Message="错误信息:"+ex.Message };
|
}
|
|
}
|
|
>>>>>>> Stashed changes
|
}
|
}
|