新增扣费

usertest
jianghaiqing 3 months ago
parent 96c0caa843
commit 3ae47d212f

@ -0,0 +1,117 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
///
/// </summary>
public class DJYChargeFeeBaseDto
{
/// <summary>
/// 请求主键
/// </summary>
public string runId { get; set; }
/// <summary>
/// 大简云用户注册ID
/// </summary>
public string userId { get; set; }
/// <summary>
/// 模块
/// </summary>
public string module { get; set; }
/// <summary>
/// 业务类型
/// </summary>
public string bsType { get; set; }
/// <summary>
/// 请求类型
/// </summary>
public string sendType { get; set; }
/// <summary>
/// 时间戳
/// </summary>
public long timestamp { get; set; }
/// <summary>
/// MD5
/// </summary>
public string md5 { get; set; }
/// <summary>
///
/// </summary>
public DJYChargeFeeDataDto Data { get; set; }
}
public class DJYChargeFeeDataDto
{
/// <summary>
/// 业务主键
/// </summary>
public string BSNO { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 箱信息
/// </summary>
public string CtnrInfo { get; set; }
/// <summary>
/// 箱量
/// </summary>
public int CtnrCount { get; set; }
/// <summary>
/// 大简云用户ID
/// </summary>
public string LURURENID { get; set; }
/// <summary>
/// 大简云用户ID
/// </summary>
public string SENDUSERID { get; set; }
/// <summary>
/// 船名
/// </summary>
public string VESSEL { get; set; }
/// <summary>
/// 航次
/// </summary>
public string VOYNO { get; set; }
/// <summary>
/// 预计离港如果有ATD优先填ATD
/// </summary>
public Nullable<DateTime> ETD { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string CARRIER { get; set; }
/// <summary>
///
/// </summary>
public int IsCredit { get; set; }
}
}

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
///
/// </summary>
public class DJYChargeFeeRequestDto
{
/// <summary>
/// 扣费业务类型
/// </summary>
public ChargeFeeBSTypeEnum BSType { get; set; }
/// <summary>
/// 发送类型
/// </summary>
public ChargeFeeSendTypeEnum SendType { get; set; }
/// <summary>
/// 业务ID
/// </summary>
public List<long> BusinessIdList { get; set; }
}
}

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 扣费回执
/// </summary>
public class DJYChargeFeeResultDto
{
/// <summary>
/// 执行时间
/// </summary>
public DateTime ExcuteDate { get; set; }
/// <summary>
/// 执行结果明细
/// </summary>
public List<DJYChargeFeeResultDetailDto> ExcuteDetail { get; set; }
}
public class DJYChargeFeeResultDetailDto
{
/// <summary>
/// 业务主键
/// </summary>
public long BillId { get; set;}
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 消息
/// </summary>
public string Message { get; set; }
}
}

@ -0,0 +1,203 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 大简云扣费 SendType 枚举
/// </summary>
public enum ChargeFeeSendTypeEnum
{
/// <summary>
/// 新增
/// </summary>
[Description("新增")]
ADD = 0,
}
/// <summary>
/// 大简云扣费 bstype 业务类型枚举
/// </summary>
public enum ChargeFeeBSTypeEnum
{
/// <summary>
/// 舱单申报
/// </summary>
[Description("舱单申报")]
MANIFEST_BOOKING = 0,
/// <summary>
/// VGM申报
/// </summary>
[Description("VGM申报")]
VGM_BOOKING = 1,
/// <summary>
/// 拼箱申请单申报
/// </summary>
[Description("拼箱申请单申报")]
LCL_APPL_FORM_BOOKING = 2,
/// <summary>
/// Maersk Spot运价订阅
/// </summary>
[Description("Maersk Spot运价订阅")]
MSK_SPOT_FREIGHT_RATE_SUBSCRIBE = 3,
/// <summary>
/// Maersk Spot订舱
/// </summary>
[Description("Maersk Spot订舱")]
MSK_SPOT_BOOKING = 4,
/// <summary>
/// 提箱小票(按量)
/// </summary>
[Description("提箱小票(按量)")]
TAKE_CTN_RECEIPT = 5,
/// <summary>
/// 提箱小票链接
/// </summary>
[Description("提箱小票链接")]
TAKE_CTN_LINK = 6,
/// <summary>
/// 账单中心账单处理费
/// </summary>
[Description("账单中心账单处理费")]
BILL_CENTER_HANDLE_FEE = 7,
/// <summary>
/// CMA运价订阅
/// </summary>
[Description("CMA运价订阅")]
CMA_FREIGHT_RATE_SUBSCRIBE = 8,
/// <summary>
/// CMA自动化DRAFT包干
/// </summary>
[Description("CMA自动化DRAFT包干")]
CMA_AUTOMATE_DRAFT_INCLUSIVE = 9,
/// <summary>
/// CMA-DRAFT(包干减小票)
/// </summary>
[Description("CMA-DRAFT(包干减小票)")]
CMA_AUTOMATE_DRAFT_INCLUSIVE_NO_TAKECTN = 91,
/// <summary>
/// 账单中心账单处理费(补扣)
/// </summary>
[Description("账单中心账单处理费(补扣)")]
BILL_CENTER_HANDLE_FEE_RESTOCK = 1001,
/// <summary>
/// 起运港运踪订阅费
/// </summary>
[Description("起运港运踪订阅费")]
POL_TRACE_SUBSCRIBE = 10,
/// <summary>
/// 目的港运踪订阅费
/// </summary>
[Description("目的港运踪订阅费")]
POD_TRACE_SUBSCRIBE = 11,
/// <summary>
/// 账单自动下载
/// </summary>
[Description("账单自动下载")]
BILL_AUTO_DOWNLOAD = 12,
/// <summary>
/// 大简云报关
/// </summary>
[Description("大简云报关")]
DJY_CUSTOMS_DECLARE = 13,
/// <summary>
/// 提箱小票自动刷小票
/// </summary>
[Description("提箱小票自动刷小票")]
TAKE_CTN_AUTO_REFRESH = 14,
/// <summary>
/// AMS申报
/// </summary>
[Description("AMS申报")]
AMS_BOOKING = 15,
/// <summary>
/// ISF申报
/// </summary>
[Description("ISF申报")]
ISF_BOOKING = 16,
/// <summary>
/// 报表推送
/// </summary>
[Description("报表推送")]
REPORT_PUSH = 17,
/// <summary>
/// 入货通知
/// </summary>
[Description("入货通知")]
CARRY_CARGO_IN = 18,
/// <summary>
/// 下货纸
/// </summary>
[Description("下货纸")]
SHIPPING_ORDER = 19,
/// <summary>
/// DRAFT下载
/// </summary>
[Description("DRAFT下载")]
DRAFT_DOWNLOAD = 20,
/// <summary>
/// 正本提单下载
/// </summary>
[Description("正本提单下载")]
ORIGINAL_BILL_DOWNLOAD = 21,
/// <summary>
/// 进口运踪
/// </summary>
[Description("进口运踪")]
IMPORT_TRACE = 22,
/// <summary>
/// 报关平台使用费
/// </summary>
[Description("报关平台使用费")]
CUSTOMS_DECLARE_PLAT_FEE = 23,
/// <summary>
/// IR/CSR回写
/// </summary>
[Description("IR/CSR回写")]
IR_CSR_NUMBER_WRITE_BACK = 24,
/// <summary>
/// 提单号回写
/// </summary>
[Description("提单号回写")]
BILL_NUMBER_WRITE_BACK = 25,
/// <summary>
/// ISF-bond使用费
/// </summary>
[Description("ISF-bond使用费")]
ISF_BOND_USE_FEE = 26,
/// <summary>
/// AFR申报
/// </summary>
[Description("AFR申报")]
AFR_BOOKING = 27,
/// <summary>
/// 订舱台账
/// </summary>
[Description("订舱台账")]
BOOKING_PAGE = 28,
/// <summary>
/// VGM通道费
/// </summary>
[Description("VGM通道费")]
VGM_CHANNEL_FEE = 29,
/// <summary>
/// 委托结算
/// </summary>
[Description("委托结算")]
SETTLE_ORDER = 30,
/// <summary>
/// ECTN
/// </summary>
[Description("ECTN")]
ECTN = 31,
/// <summary>
/// 订舱通道
/// </summary>
[Description("订舱通道")]
BOOKING_CHANNEL_FEE = 32,
}
}

@ -0,0 +1,82 @@
using DS.Module.Core.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Entity
{
/// <summary>
/// 大简云扣费记录表
/// </summary>
[SqlSugar.SugarTable("djy_charge_fee", "大简云扣费记录表")]
public class DJYChargeFee : BaseModel<long>
{
/// <summary>
/// 单据ID
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "单据ID", IsNullable = true)]
public long BillId { get; set; }
/// <summary>
/// 提单号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "提单号", Length = 50, IsNullable = true)]
public string MBLNO { get; set; }
/// <summary>
/// 费用类型
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "费用类型", Length = 20, IsNullable = true)]
public string FeeType { get; set; }
/// <summary>
/// 金额
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "金额", Length = 18, DecimalDigits = 2, IsNullable = true)]
public Nullable<decimal> Amount { get; set; }
/// <summary>
/// 单价
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "单价", Length = 18, DecimalDigits = 2, IsNullable = true)]
public Nullable<decimal> Price { get; set; }
/// <summary>
/// 费用类型
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务类型", Length = 50, IsNullable = true)]
public string BSType { get; set; }
/// <summary>
/// 费用类型
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "发送类型", Length = 50, IsNullable = true)]
public string SendType { get; set; }
/// <summary>
/// 批次号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "批次号", Length = 64, IsNullable = true)]
public string BatchNo { get; set; }
/// <summary>
/// MD5
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "MD5", Length = 64, IsNullable = true)]
public string MD5 { get; set; }
/// <summary>
/// 状态
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态", Length = 64, IsNullable = true)]
public string Status { get; set; }
/// <summary>
/// 回执消息
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "回执消息", Length = 200, IsNullable = true)]
public string ResultNote { get; set; }
}
}

@ -0,0 +1,31 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Interface
{
/// <summary>
/// 扣费
/// </summary>
public interface IDJYChargeFeeService
{
/// <summary>
/// 扣费
/// </summary>
/// <param name="model">扣费请求</param>
/// <returns>返回回执</returns>
Task<DataResult<DJYChargeFeeResultDto>> ChargeFee(DJYChargeFeeRequestDto model);
/// <summary>
/// 扣费前校验
/// </summary>
/// <param name="model">扣费请求</param>
/// <returns>返回回执</returns>
Task<DataResult<string>> CheckChargeFee(DJYChargeFeeRequestDto model);
}
}

@ -0,0 +1,297 @@
using DS.Module.Core;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using NLog;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DS.Module.Core.Extensions;
using LogicExtensions;
using DS.Module.Core.Helpers;
using Newtonsoft.Json.Linq;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Code.Interface;
namespace DS.WMS.Core.Op.Method
{
public class DJYChargeFeeService: IDJYChargeFeeService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly IConfigService _configService;
private readonly ICodeThirdPartyService _codeThirdPartyService;
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
public DJYChargeFeeService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_configService = serviceProvider.GetRequiredService<IConfigService>();
_codeThirdPartyService = serviceProvider.GetRequiredService<ICodeThirdPartyService>();
}
#region 扣费
/// <summary>
/// 扣费
/// </summary>
/// <param name="model">扣费请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult<DJYChargeFeeResultDto>> ChargeFee(DJYChargeFeeRequestDto model)
{
/*
1URL
2
3KEY
4ID,IDID
5
6
*/
Logger.Log(NLog.LogLevel.Info, $"收到订舱扣费请求,{JsonConvert.SerializeObject(model)}");
var batchId = DateTime.Now.Ticks.ToString();
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear<IOrgId>();
//提取扣费URL
var feeUrl = db.Queryable<SysConfig>().Filter(null, true)
.Where(x => x.Code == "djyFeeApiUrl" && x.TenantId == 1288018625843826688).Select(x => x.Value).First();
if(string.IsNullOrWhiteSpace(feeUrl))
{
Logger.Log(NLog.LogLevel.Info, $"未配置大简云扣费接口地址,请联系管理员");
return DataResult<DJYChargeFeeResultDto>.Failed("未配置大简云扣费接口地址,请联系管理员");
}
var orderList = tenantDb.Queryable<SeaExport>().Filter(null, true).Where(a => model.BusinessIdList.Contains(a.Id)).ToList();
DateTime nowDate = DateTime.Now;
DJYChargeFeeResultDto resultDto = new DJYChargeFeeResultDto
{
ExcuteDate = nowDate,
ExcuteDetail = new List<DJYChargeFeeResultDetailDto>()
};
foreach (var id in model.BusinessIdList)
{
DJYChargeFeeResultDetailDto detail = new DJYChargeFeeResultDetailDto {
BillId = id,
};
var orderInfo = orderList.FirstOrDefault(a => a.Id == id);
var userInfo = db.Queryable<SysUser>().Filter(null, true).First(x => x.Id == orderInfo.OperatorId && x.TenantId == long.Parse(user.TenantId));
string djyUserId = userInfo?.DjyUserId;
if (string.IsNullOrWhiteSpace(djyUserId))
{
var defaultDJYUserId = _configService.GetConfig("DJY_CHARGE_FEE_DEFAULT_USERID", long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value;
djyUserId = defaultDJYUserId;
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-调用扣费,当前操作OP={userInfo?.UserName}没有绑定大简云用户ID,试用系统默认的大简云用户ID={defaultDJYUserId}");
}
if (string.IsNullOrWhiteSpace(djyUserId))
{
detail.Status = "FAILURE";
detail.Message = $"当前操作OP={userInfo?.UserName}没有绑定大简云用户ID,请联系管理员";
continue;
}
var webAccountConfig = _codeThirdPartyService.GetCodeThirdPartyInfoWithCompany("DJYChargeFeeAuth").GetAwaiter().GetResult()?.Data;
//未配置公司或个人的第三方账户维护-MSK API合约请联系管理员
if (webAccountConfig == null)
{
detail.Status = "FAILURE";
detail.Message = $"未配置大简云扣费授权,请在接口账户维护";
continue;
}
string feeUserId = webAccountConfig.AppKey;
string feeUserKey = webAccountConfig.AppSecret;
var runId = Guid.NewGuid().ToString();
var seconds = DateTime.Now.ToTimestamp();
var srcBeforMD5 = $"{runId}{feeUserId}expend{(int)model.BSType}{(int)model.SendType}{id}{orderInfo.MBLNO}{seconds}{feeUserKey}";
var md5 = MD5Helper.Encrypt(srcBeforMD5);
var reqModel = new DJYChargeFeeBaseDto
{
runId = runId,
userId = feeUserId,
module = "expend",//固定
bsType = ((int)model.BSType).ToString(),
sendType = ((int)model.SendType).ToString(),
timestamp = seconds,//秒级时间戳
md5 = md5,// 加密字符串小写 RunId + UserId + Module + BsType + SendType+Timestamp+ Key
Data = new DJYChargeFeeDataDto {
BSNO = orderInfo.Id.ToString(),
MBLNO = orderInfo.MBLNO,
HBLNO = orderInfo.HBLNO,
CtnrInfo = "",
CtnrCount = 1,
IsCredit = 1,//是否是信用支付 1 信用支付 0不允许信用支付默认值为0,
LURURENID = djyUserId,
SENDUSERID = djyUserId,
VESSEL = orderInfo.Vessel,
VOYNO = orderInfo.InnerVoyno,
ETD = orderInfo.ATD,
CARRIER = orderInfo.Carrier
}
};
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-调用扣费,请求报文:{JsonConvert.SerializeObject(reqModel)}");
var record = new DJYChargeFee
{
BillId = id,
BatchNo = batchId,
BSType = model.BSType.ToString(),
SendType = model.SendType.ToString(),
FeeType = $"{(int)model.BSType}_{(int)model.SendType}",
MBLNO = orderInfo.MBLNO,
};
try
{
var jsonBody = JsonConvert.SerializeObject(reqModel);
var res = RequestHelper.Post(jsonBody, feeUrl);
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-调用扣费,返回结果:{res}");
var jobjApiRtn = JObject.Parse(res);
var code = jobjApiRtn.GetIntValue("code");
var jobjApiRtnData = jobjApiRtn.GetValue("data") as JObject;
if (code == 200 || code == 450)
{
var jobjApiRtnDataPayInfo = jobjApiRtnData.GetValue("payInfo") as JObject;
var price = Convert.ToDecimal(jobjApiRtnDataPayInfo.GetValue("price").ToString());
var total = Convert.ToDecimal(jobjApiRtnDataPayInfo.GetValue("total").ToString());
var msg = jobjApiRtn.GetValue("message").ToString();
record.Amount = total;
record.Price = price;
record.ResultNote = msg;
record.Status = "SUCC";
detail.Status = "SUCC";
tenantDb.Insertable<DJYChargeFee>(record).ExecuteCommand();
}
else
{
var msg = jobjApiRtn.GetValue("message").ToString();
record.ResultNote = msg;
record.Status = "FAILURE";
detail.Status = "FAILURE";
detail.Message = msg;
tenantDb.Insertable<DJYChargeFee>(record).ExecuteCommand();
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-扣费失败,原因:{msg}");
//DingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", errMsg);
}
}
catch (Exception ex)
{
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-扣费异常,原因:{ex.Message}");
record.ResultNote = ex.Message.Length > 200? ex.Message.Substring(0,200): ex.Message;
record.Status = "EXCEPTION";
detail.Status = "EXCEPTION";
detail.Message = ex.Message;
}
resultDto.ExcuteDetail.Add(detail);
}
return DataResult<DJYChargeFeeResultDto>.Success(resultDto);
}
#endregion
/// <summary>
/// 扣费前校验
/// </summary>
/// <param name="model">扣费请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult<string>> CheckChargeFee(DJYChargeFeeRequestDto model)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear<IOrgId>();
//提取扣费URL
var feeUrl = db.Queryable<SysConfig>().Filter(null, true)
.Where(x => x.Code == "djyFeeApiUrl" && x.TenantId == 1288018625843826688).Select(x => x.Value).First();
if (string.IsNullOrWhiteSpace(feeUrl))
{
Logger.Log(NLog.LogLevel.Info, $"未配置大简云扣费接口地址,请联系管理员");
return DataResult<string>.Failed("未配置大简云扣费接口地址,请联系管理员");
}
var orderList = tenantDb.Queryable<SeaExport>().Filter(null,true).Where(a => model.BusinessIdList.Contains(a.Id)).ToList();
List<long> opUserIdList = orderList.Select(a => a.OperatorId).Distinct().ToList();
var userList = db.Queryable<SysUser>().Filter(null, true).Where(x => opUserIdList.Contains(x.Id) && x.TenantId == long.Parse(user.TenantId)).ToList();
var defaultDJYUserId = _configService.GetConfig("DJY_CHARGE_FEE_DEFAULT_USERID", long.Parse(user.TenantId), false).GetAwaiter().GetResult()?.Data?.Value;
//校验是否有大简云账户
if (userList.Any(a=> string.IsNullOrWhiteSpace(a.DjyUserId)) && string.IsNullOrWhiteSpace(defaultDJYUserId))
{
return DataResult<string>.Failed($"操作={string.Join(",", userList.Where(a => string.IsNullOrWhiteSpace(a.DjyUserId)).Select(a => a.UserName).ToArray())}未绑定大简云账户ID,请联系管理员");
}
Dictionary<long, Tuple<string, string>> dict = new Dictionary<long, Tuple<string, string>>();
//校验是否已有扣费记录
foreach (var order in orderList)
{
var record = tenantDb.Queryable<DJYChargeFee>().Filter(null, true)
.First(a => a.BillId == order.Id && a.FeeType == $"{(int)model.BSType}_{(int)model.SendType}" && a.Deleted == false);
if (record != null)
{
dict.Add(order.Id, new Tuple<string, string>(!string.IsNullOrWhiteSpace(order.MBLNO) ? $"提单号:{order.MBLNO}" : $"委托编号:{order.CustomerNo}", "已有扣费记录"));
}
}
if (dict.Count > 0)
{
return DataResult<string>.Failed($"{string.Join(",", dict.Select(a => a.Value.Item1).ToArray())} 已有扣费记录");
}
return DataResult<string>.Success(string.Empty);
}
}
}

@ -211,9 +211,28 @@ namespace DS.WMS.Core.TaskPlat.Method
{
var taskAllocList = tenantDb.Queryable<TaskBaseAllocation>().Where(a => a.TaskId == taskPKId).ToList();
if (taskAllocList.Count > 0)
if (taskAllocList.Count == 0)
{
var searchAllotUserRlt = _taskAllocationService.GetAllotUserBySeaExportId(TaskBaseTypeEnum.POL_CTN_NOT_PICKUP, orderInfo.currOrder.Id).GetAwaiter().GetResult();
if (searchAllotUserRlt.Succeeded && searchAllotUserRlt.Data?.Count > 0)
{
//写入
searchAllotUserRlt.Data.ForEach(b =>
{
var alloc = new TaskBaseAllocation
{
Status = baseInfo.STATUS,
StatusName = baseInfo.STATUS_NAME,
TaskId = taskPKId,
StatusTime = nowDate,
UserId = b.RecvUserId,
UserName = b.RecvUserName
};
tenantDb.Insertable<TaskBaseAllocation>(alloc).ExecuteCommand();
});
}
}
}
@ -258,8 +277,8 @@ namespace DS.WMS.Core.TaskPlat.Method
return DataResult.Failed(result.Message);
}
//await SetTaskCompleteAsync(context.TaskInfo,
// context.ServiceProvider.GetRequiredService<ITaskService>(), LogService);
//发送完邮件,自动标记任务状态为完成
await SetTaskStatus(taskPKId, TaskBaseTypeEnum.POL_CTN_NOT_PICKUP, TaskStatusEnum.Complete, DateTime.Now, null);
return DataResult.Successed(result.Message);
}

Loading…
Cancel
Save