任务台分配相关

usertest
zhangxiaofeng 4 months ago
parent 672aaf80f7
commit 8b25a8a9d8

@ -30,7 +30,31 @@ namespace DS.WMS.Core.TaskPlat.Dtos
/// </summary>
public List<TaskTypeInfoDto> TaskTypeList { get; set; }
}
public class TaskAllocationtSetQueryListDto
{
///// <summary>
///// 船公司ID
///// </summary>
//public long? CarrierId { get; set; }
///// <summary>
///// 船公司代码
///// </summary>
//public string? CarrierCode { get; set; }
///// <summary>
///// 船公司
///// </summary>
//public string? Carrier { get; set; }
public List<TaskTypeInfoDto> OperatorTaskTypeList { get; set; }
public List<TaskTypeInfoDto> VouchingClerkTaskTypeList { get; set; }
public List<TaskTypeInfoDto> SaleTaskTypeList { get; set; }
public List<TaskTypeInfoDto> CustomTaskTypeList { get; set; }
public List<TaskTypeInfoDto> FinancialStaffTaskTypeList { get; set; }
public List<TaskTypeInfoDto> CustomerServiceTaskTypeList { get; set; }
public List<TaskTypeInfoDto> DriverTaskTypeList { get; set; }
public List<TaskTypeInfoDto> DispatcherTaskTypeList { get; set; }
}
public class TaskTypeInfoDto
{
/// <summary>

@ -14,7 +14,7 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// 获取任务分配列表
/// </summary>
/// <param name="carrierId">船公司Id可选</param>
Task<DataResult<List<TaskAllocationtSet>>> GetList(long? carrierId);
Task<DataResult<TaskAllocationtSetQueryListDto>> GetList(long? carrierId);
/// <summary>
/// 保存任务分配设置
/// </summary>

@ -32,14 +32,42 @@ namespace DS.WMS.Core.TaskPlat.Method
/// 获取任务分配列表
/// </summary>
/// <param name="carrierId">船公司Id可选</param>
public async Task<DataResult<List<TaskAllocationtSet>>> GetList(long? carrierId)
public async Task<DataResult<TaskAllocationtSetQueryListDto>> GetList(long? carrierId)
{
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var list = await tenantDb.Queryable<TaskAllocationtSet>()
.Where(x => x.CarrierId == carrierId)
.Where(x => x.CarrierId == carrierId &&
(x.IsAllotCustom
|| x.IsAllotCustomerService
|| x.IsAllotDispatcher
|| x.IsAllotOperator
|| x.IsAllotSale
|| x.IsAllotVouchingClerk
|| x.IsAllotFinancialStaff
|| x.IsAllotDriver))
.ToListAsync();
return DataResult<List<TaskAllocationtSet>>.Success(list);
Func<TaskAllocationtSet, TaskTypeInfoDto> selector = x => new TaskTypeInfoDto() { TaskTypeCode = x.TaskTypeCode, TaskTypeName = x.TaskTypeName };
TaskAllocationtSetQueryListDto result = new()
{
OperatorTaskTypeList = list.Where(x => x.IsAllotOperator).Select(selector).ToList(),
VouchingClerkTaskTypeList = list.Where(x => x.IsAllotVouchingClerk).Select(selector).ToList(),
SaleTaskTypeList = list.Where(x => x.IsAllotSale).Select(selector).ToList(),
CustomTaskTypeList = list.Where(x => x.IsAllotCustom).Select(selector).ToList(),
FinancialStaffTaskTypeList = list.Where(x => x.IsAllotFinancialStaff).Select(selector).ToList(),
CustomerServiceTaskTypeList = list.Where(x => x.IsAllotCustomerService).Select(selector).ToList(),
DriverTaskTypeList = list.Where(x => x.IsAllotDriver).Select(selector).ToList(),
DispatcherTaskTypeList = list.Where(x => x.IsAllotDispatcher).Select(selector).ToList(),
};
//if (carrierId != null && list.Count != 0)
//{
// result.CarrierId = list.First().CarrierId;
// result.Carrier = list.First().Carrier;
// result.CarrierCode = list.First().CarrierCode;
//}
return DataResult<TaskAllocationtSetQueryListDto>.Success(result);
}
/// <summary>

@ -1822,9 +1822,8 @@ namespace DS.WMS.Core.TaskPlat.Method
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (t.CreateBy == userId || a.UserId == userId)
&& a.Status == status);
//.WhereIF(taskStatLevel == TaskStatLevelEnum.EXCPTION, (t, a) => t.IS_EXCEPT == 1)
&& a.Status == status)
.OrderByDescending(t => t.Id);
}
/// <summary>
@ -1842,9 +1841,8 @@ namespace DS.WMS.Core.TaskPlat.Method
.WhereIF(taskStatLevel == TaskStatLevelEnum.PUBLIC, (t, a) => t.IS_PUBLIC == 1 && t.STATUS == status)
.WhereIF(taskStatLevel == TaskStatLevelEnum.PERSON, (t, a) => t.IS_PUBLIC == 0
&& (t.CreateBy == userId || a.UserId == userId)
&& a.Status == status);
//var sql = queryable.Select<dynamic>(t => t).Distinct().ToSqlString();
//.WhereIF(taskStatLevel == TaskStatLevelEnum.EXCPTION, (t, a) => t.IS_EXCEPT == 1)
&& a.Status == status)
.OrderByDescending(t => t.Id);
}
}

@ -23,7 +23,7 @@ public class TaskAllocationController : ApiController
/// </summary>
/// <param name="carrierId">船公司Id可选</param>
[HttpGet("GetList")]
public async Task<DataResult<List<TaskAllocationtSet>>> GetList(long? carrierId)
public async Task<DataResult<TaskAllocationtSetQueryListDto>> GetList(long? carrierId)
{
var result = await taskAllocationService.GetList(carrierId);
return result;

Loading…
Cancel
Save