|
|
@ -64,13 +64,17 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("接收到任务状态修改报文 任务主键={id} 状态设置={status}", taskInfo.Id, taskStatusEnum.ToString());
|
|
|
|
_logger.LogInformation("接收到任务状态修改报文 任务主键={id} 状态设置={status}", taskInfo.Id, taskStatusEnum.ToString());
|
|
|
|
taskInfo.STATUS = taskStatusEnum.ToString();
|
|
|
|
taskInfo.STATUS = taskStatusEnum.ToString();
|
|
|
|
|
|
|
|
taskInfo.RealUserId = long.Parse(user.UserId);
|
|
|
|
|
|
|
|
taskInfo.RealUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable(taskInfo).UpdateColumns(x => new
|
|
|
|
await tenantDb.Updateable(taskInfo).UpdateColumns(x => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x.UpdateBy,
|
|
|
|
x.UpdateBy,
|
|
|
|
x.UpdateTime,
|
|
|
|
x.UpdateTime,
|
|
|
|
x.UpdateUserName,
|
|
|
|
x.UpdateUserName,
|
|
|
|
x.STATUS
|
|
|
|
x.STATUS,
|
|
|
|
|
|
|
|
x.RealUserId,
|
|
|
|
|
|
|
|
x.RealUserName
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
}).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.DataUpdateSuccess)));
|
|
|
|
return DataResult.Successed(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.DataUpdateSuccess)));
|
|
|
@ -156,37 +160,57 @@ namespace DS.WMS.Core.TaskPlat.Method
|
|
|
|
BATCH_STATIC = info.Main.BatchStatic,
|
|
|
|
BATCH_STATIC = info.Main.BatchStatic,
|
|
|
|
DJYUserId = info.Head.DJYUserId,
|
|
|
|
DJYUserId = info.Head.DJYUserId,
|
|
|
|
OUT_BS_NO = info.Head.BSNO,
|
|
|
|
OUT_BS_NO = info.Head.BSNO,
|
|
|
|
|
|
|
|
CreateTime = DateTime.Now,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
long taskReqUserId = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 人员字段说明:
|
|
|
|
|
|
|
|
// TaskBaseInfo.CreateBy 创建人:谁创建的,只有一个人(可能是某个租户的管理员,因为任务可以由外部(邮件)创建,无法为每个人创建接口授权信息)
|
|
|
|
|
|
|
|
// TaskBaseInfo.TASK_REQ_USERID 制单人:只有一个人,使用任务创建报文中传入的TaskUserId
|
|
|
|
|
|
|
|
// TaskBaseAllocation.UserId 任务关系:任务属于谁,谁能够查看并处理,可能是多个人(可能是多个人一起处理);取值优先级:TaskBaseInfo.TASK_REQ_USERID>关联订单>TaskBaseInfo.CreateBy
|
|
|
|
|
|
|
|
// TaskBaseInfo.RealUserId 实际操作人:谁实际处理的,只有一个人
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建人
|
|
|
|
|
|
|
|
taskInfo.CreateBy = long.Parse(user.UserId);
|
|
|
|
|
|
|
|
taskInfo.CreateUserName = user.UserName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 制单人
|
|
|
|
|
|
|
|
long taskReqUserId = 0;
|
|
|
|
if (!string.IsNullOrWhiteSpace(info.Main.TaskUserId))
|
|
|
|
if (!string.IsNullOrWhiteSpace(info.Main.TaskUserId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (long.TryParse(info.Main.TaskUserId, out taskReqUserId))
|
|
|
|
if (long.TryParse(info.Main.TaskUserId, out taskReqUserId))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
taskInfo.TASK_REQ_USERID = taskReqUserId;
|
|
|
|
taskInfo.TASK_REQ_USERID = taskReqUserId;
|
|
|
|
|
|
|
|
taskInfo.TASK_REQ_USERNAME = info.Main.TaskUserName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 忽略
|
|
|
|
_logger.LogInformation("批次={no} 获取登录人详情 recvUserId={recvUserId} UserId={UserId}", batchNo,
|
|
|
|
taskInfo.CreateBy = long.Parse(user.UserId);
|
|
|
|
info.Main.RecvUserId,
|
|
|
|
taskInfo.CreateTime = DateTime.Now;
|
|
|
|
user.UserId);
|
|
|
|
|
|
|
|
|
|
|
|
//taskInfo.CreatedUserId = userTendInfo.userId;
|
|
|
|
|
|
|
|
//taskInfo.CreatedUserName = userTendInfo.userName;
|
|
|
|
|
|
|
|
//taskInfo.TenantId = userTendInfo.tendId;
|
|
|
|
|
|
|
|
//taskInfo.TenantName = userTendInfo.tenantName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info.Main.TaskType == TaskBaseTypeEnum.TRUCK_DISPATCH || info.Main.TaskType == TaskBaseTypeEnum.CAUTION_NOTICE)
|
|
|
|
// 任务所属人员列表
|
|
|
|
|
|
|
|
// 如果明确指出接收人(接收人列表),则将任务作为个人任务
|
|
|
|
|
|
|
|
if (info.Main.RecvUserInfoList?.Count > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 接收人列表 recvUserList={recvUserList} ", batchNo,
|
|
|
|
|
|
|
|
JsonConvert.SerializeObject(info.Main.RecvUserInfoList));
|
|
|
|
|
|
|
|
|
|
|
|
taskInfo.IS_PUBLIC = 0;
|
|
|
|
taskInfo.IS_PUBLIC = 0;
|
|
|
|
|
|
|
|
var allocationList = info.Main.RecvUserInfoList.Select(x => new TaskBaseAllocation
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskId = taskInfo.Id,
|
|
|
|
|
|
|
|
UserId = x.RecvUserId,
|
|
|
|
|
|
|
|
UserName = x.RecvUserName
|
|
|
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
await tenantDb.Insertable(allocationList).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 否则判断任务关联订单,如果能关联到,则判断任务设置的角色;如果有设置,则将任务挂载到订单的指定角色上;如果没关联到或者没有设置,则作为公共任务
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
taskInfo.IS_PUBLIC = 1;
|
|
|
|
taskInfo.IS_PUBLIC = 1;
|
|
|
|
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_logger.LogInformation("批次={no} 获取登录人详情 userid={userid} UserId={UserId}", batchNo,
|
|
|
|
|
|
|
|
info.Main.RecvUserId,
|
|
|
|
|
|
|
|
user.UserId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue)
|
|
|
|
if (info.Main != null && info.Main.TruckInfo != null && info.Main.TruckInfo.NeedArriveTime.HasValue)
|
|
|
|
{
|
|
|
|
{
|
|
|
|