任务转交调整

usertest
zhangxiaofeng 3 months ago
parent d4f4d85be4
commit 9ae873a954

@ -347,7 +347,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
string[] ids = FlowInstanceService.GetMarkers(instance);
//变更任务接收人为所有审批执行人
var users = await FillInUserInfoAsync(ids.Select(long.Parse).ToArray());
result = await ManagerService.TransferTask(task.BusinessId, task.TaskType, users);
result = await ManagerService.TransferTask(task.BusinessId, task.TaskType, users, TenantDb);
if (result.Succeeded)
{
task.RecvUsers = string.Join(",", ids);

@ -3,6 +3,7 @@ using DS.Module.DjyServiceStatus;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using Microsoft.AspNetCore.Http;
using SqlSugar;
using System.Linq.Expressions;
namespace DS.WMS.Core.TaskPlat.Interface
@ -66,7 +67,7 @@ namespace DS.WMS.Core.TaskPlat.Interface
/// <param name="bsno">业务主键</param>
/// <param name="taskBaseTypeEnum">业务类型</param>
/// <param name="userInfos">要转交的人员信息列表</param>
Task<DataResult> TransferTask(long bsno, TaskBaseTypeEnum taskBaseTypeEnum, List<RecvUserInfo> userInfos);
Task<DataResult> TransferTask(long bsno, TaskBaseTypeEnum taskBaseTypeEnum, List<RecvUserInfo> userInfos, SqlSugarScopeProvider? tenantDb = null);
/// <summary>

@ -558,12 +558,24 @@ namespace DS.WMS.Core.TaskPlat.Method
// 如果任务状态为已完成,则查询任务完成时任务对应模块的配置中要设置的业务状态,然后进行设置
if (taskStatusEnum == TaskStatusEnum.Complete && bsno != null)
if (taskStatusEnum == TaskStatusEnum.Complete)
{
string? statusCode = await tenantDb.Queryable<TaskFlowModule>().Where(x => x.ModuleType == 2 && x.TaskType == taskInfo.TASK_TYPE).Select(x => x.BusinessStatusCode).FirstAsync();
if (!string.IsNullOrEmpty(statusCode))
long? orderId = bsno;
if (orderId == null)
{
if (long.TryParse(taskInfo.BOOK_ORDER_NO, out long temp))
{
orderId = temp;
}
}
if (orderId != null)
{
await seaExportCommonService.Value.SetGoodsStatus(statusCode, (long)bsno, tenantDb);
string? statusCode = await tenantDb.Queryable<TaskFlowModule>().Where(x => x.ModuleType == 2 && x.TaskType == taskInfo.TASK_TYPE).Select(x => x.BusinessStatusCode).FirstAsync();
if (!string.IsNullOrEmpty(statusCode))
{
await seaExportCommonService.Value.SetGoodsStatus(statusCode, (long)orderId, tenantDb);
}
}
}

@ -146,9 +146,9 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <param name="bsno">业务主键</param>
/// <param name="taskBaseTypeEnum">业务类型</param>
/// <param name="userInfos">要转交的人员信息列表</param>
public async Task<DataResult> TransferTask(long bsno, TaskBaseTypeEnum taskBaseTypeEnum, List<RecvUserInfo> userInfos)
public async Task<DataResult> TransferTask(long bsno, TaskBaseTypeEnum taskBaseTypeEnum, List<RecvUserInfo> userInfos, SqlSugarScopeProvider? tenantDb = null)
{
SqlSugarScopeProvider tenantDb = saasDbService.GetBizDbScopeById(user.TenantId);
tenantDb ??= saasDbService.GetBizDbScopeById(user.TenantId);
try
{
var taskId = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId))
@ -165,9 +165,9 @@ namespace DS.WMS.Core.TaskPlat.Method
logger.LogInformation("接收到任务转交报文 任务主键={id} 转交人员列表={userinfo}", taskId, JsonConvert.SerializeObject(userInfos));
//await tenantDb.Ado.BeginTranAsync();
await tenantDb.Ado.BeginTranAsync();
await tenantDb.Deleteable<TaskBaseAllocation>(x => x.TaskId == taskId).ExecuteCommandHasChangeAsync();
await tenantDb.Deleteable<TaskBaseAllocation>().Where(x => x.TaskId == taskId).ExecuteCommandAsync();
var allocationList = userInfos.Select(x => new TaskBaseAllocation
{
@ -179,7 +179,7 @@ namespace DS.WMS.Core.TaskPlat.Method
}).ToList();
await tenantDb.Insertable(allocationList).ExecuteCommandAsync();
//await tenantDb.Ado.CommitTranAsync();
await tenantDb.Ado.CommitTranAsync();
return DataResult.Successed("操作成功!", MultiLanguageConst.DataUpdateSuccess);
}
catch (Exception)
@ -1652,9 +1652,8 @@ namespace DS.WMS.Core.TaskPlat.Method
var taskNo = await tenantDb.Queryable<TaskBaseInfo>().ClearFilter(typeof(IOrgId)).Where(a => a.Id == taskInfo.Id).Select(a => a.TASK_NO).FirstAsync();
//回写任务号
var result = new DataResult(ResultCode.Success, "新增任务成功", data: taskNo);
var result = new DataResult(ResultCode.Success, "新增任务成功", data: taskInfo.TASK_NO);
return await Task.FromResult(result);
}
@ -2730,7 +2729,7 @@ namespace DS.WMS.Core.TaskPlat.Method
/// <summary>
/// 测试用

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>D:\Code\ds8-solution-pro\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>

Loading…
Cancel
Save