优化:根据任务类型+海运出口订单Id查询任务分配的人员列表

usertest
zhangxiaofeng 4 months ago
parent 47d99da6dc
commit d60558ca01

@ -271,18 +271,17 @@ namespace DS.WMS.Core.TaskPlat.Method
}
// 查出涉及到的订单
SeaExport? order = null;
SeaExportRes? order = null;
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
if (dataContext.ContainsKey(TaskFlowDataNameConst.Business))
{
var orderDto = dataContext.Get<SeaExportRes>(TaskFlowDataNameConst.Business);
order = orderDto.Adapt<SeaExport>();
order = dataContext.Get<SeaExportRes>(TaskFlowDataNameConst.Business);
}
else
{
order = await tenantDb.Queryable<SeaExport>()
.Where(x => x.Id == seaExportId)
.Select(x => new SeaExport
.Select(x => new SeaExportRes
{
Id = x.Id,
MBLNO = x.MBLNO,
@ -402,18 +401,17 @@ namespace DS.WMS.Core.TaskPlat.Method
}
// 查出涉及到的订单
SeaExport? order = null;
SeaExportRes? order = null;
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
if (dataContext.ContainsKey(TaskFlowDataNameConst.Business))
{
var orderDto = dataContext.Get<SeaExportRes>(TaskFlowDataNameConst.Business);
order = orderDto.Adapt<SeaExport>();
order = dataContext.Get<SeaExportRes>(TaskFlowDataNameConst.Business);
}
else
{
order = await tenantDb.Queryable<SeaExport>()
.Where(x => x.Id == seaExportId)
.Select(x => new SeaExport
.Select(x => new SeaExportRes
{
Id = x.Id,
MBLNO = x.MBLNO,

@ -65,21 +65,21 @@ public class TaskAllocationController : ApiController
var user = serviceProvider.GetService<IUser>();
var tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
var order = await tenantDb.Queryable<SeaExport>().FirstAsync(x => x.Id == 1816649497120477184);
var order = await tenantDb.Queryable<SeaExport>().Select<Core.Op.Dtos.SeaExportRes>().FirstAsync(x => x.Id == 1816649497120477184);
TaskFlowDataContext dataContext = new(
(TaskFlowDataNameConst.Business, order)
);
// 分配测试
//var result = taskAllocationService.GetAllotUserBySeaExportId(new List<TaskBaseTypeEnum>() {
// TaskBaseTypeEnum.INVOICE_BILL_MAIL,
// TaskBaseTypeEnum.NOT_LOADED,
// TaskBaseTypeEnum.NOT_SHIPMENG,
//}, 1816649497120477184, dataContext);
var result = await taskAllocationService.GetAllotUserBySeaExportId(new List<TaskBaseTypeEnum>() {
TaskBaseTypeEnum.INVOICE_BILL_MAIL,
TaskBaseTypeEnum.NOT_LOADED,
TaskBaseTypeEnum.NOT_SHIPMENG,
}, 1816649497120477184, dataContext);
// 工作流节点测试
TaskFlowRuner runer = new TaskFlowRuner(tenantDb, serviceProvider);
//TaskFlowRuner runer = new TaskFlowRuner(tenantDb, serviceProvider);
//var result1 = await runer.GetWorkFlowNextConfig(dataContext, null); // 首位
//var result2 = await runer.GetWorkFlowNextConfig(dataContext, 20001); // 正常
//var result3 = await runer.GetWorkFlowNextConfig(dataContext, 20002); // 分支判断

Loading…
Cancel
Save