|
|
|
@ -121,7 +121,7 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
//[UseTran]
|
|
|
|
|
public async Task<MessageModel> Submit(OrderSubmitDto inputDto)
|
|
|
|
|
public async Task<MessageModel<List<OrderSubmitResultDto>>> Submit(OrderSubmitDto inputDto)
|
|
|
|
|
{
|
|
|
|
|
var validator = new OrderSubmitDtoValidator();
|
|
|
|
|
validator.ValidateAndThrow(inputDto);
|
|
|
|
@ -150,9 +150,13 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
orderList.Add(order);
|
|
|
|
|
}
|
|
|
|
|
unitOfWorkManage.BeginTran();
|
|
|
|
|
var orderHasIdList = await orderService.AsInsertable(orderList.ToArray()).ExecuteCommandAsync();
|
|
|
|
|
//var orderIdList = orderHasIdList
|
|
|
|
|
//var orderIdList = await orderService.Add(orderList);
|
|
|
|
|
foreach (var item in orderList)
|
|
|
|
|
{
|
|
|
|
|
var id = await orderService.AsInsertable(item).ExecuteReturnSnowflakeIdAsync();
|
|
|
|
|
item.Id = id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var orderIdList = orderList.Select(x => x.Id).ToList();
|
|
|
|
|
|
|
|
|
|
// 附件关联信息保存
|
|
|
|
|
if (inputDto.AnnexIdList?.Count > 0)
|
|
|
|
@ -191,9 +195,11 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
// 查询所有待处理订单列表
|
|
|
|
|
var pendingOrderList = await orderService.Query(x => x.IsSend == false && orderIdList.Contains(x.Id));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = orderList.Select(x => new OrderSubmitResultDto() { OrderId = x.Id, Mblno = x.Mblno }).ToList();
|
|
|
|
|
if (pendingOrderList.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
return SuccessMsg();
|
|
|
|
|
return Success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string domainUrl = AppSettings.app(["Startup", "Domain"]);
|
|
|
|
@ -270,7 +276,7 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SuccessMsg();
|
|
|
|
|
return Success(result);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取订单附件信息列表
|
|
|
|
@ -445,30 +451,43 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
// 将更新后的状态及费用推送到消息队列
|
|
|
|
|
if (AppSettings.app("RabbitMQ", "Enabled").ObjToBool())
|
|
|
|
|
{
|
|
|
|
|
_ = Task.Run(() =>
|
|
|
|
|
_ = Task.Run(async () =>
|
|
|
|
|
{
|
|
|
|
|
string msg = $"Id:[{order.Id}],提单号:[{order.Mblno}],手动更新状态后推送队列";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
StatusPushDto pushDto = new()
|
|
|
|
|
{
|
|
|
|
|
OrderId = order.Id,
|
|
|
|
|
Mblno = order.Mblno,
|
|
|
|
|
MessageType = 1,
|
|
|
|
|
MessageDesc = "状态更新推送",
|
|
|
|
|
Remark = changeStatusDto.Remark,
|
|
|
|
|
Status = (int)changeStatusDto.Status,
|
|
|
|
|
StatusDesc = changeStatusDto.Status.ToString()
|
|
|
|
|
};
|
|
|
|
|
if (changeStatusDto.FeeList != null && changeStatusDto.FeeList.Count > 0)
|
|
|
|
|
var feeList = await orderFeeService.Query(x => x.OrderId == order.Id);
|
|
|
|
|
if (feeList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
pushDto.FeeList = changeStatusDto.FeeList.Select(x => new StatusPushDto.FeeDto()
|
|
|
|
|
pushDto.FeeList = feeList.Select(x => new StatusPushDto.FeeDto()
|
|
|
|
|
{
|
|
|
|
|
FeeId = x.Id,
|
|
|
|
|
FeeName = x.Name,
|
|
|
|
|
FeeAmount = x.Amount
|
|
|
|
|
}).ToList();
|
|
|
|
|
}
|
|
|
|
|
//if (changeStatusDto.FeeList != null && changeStatusDto.FeeList.Count > 0)
|
|
|
|
|
//{
|
|
|
|
|
// pushDto.FeeList = changeStatusDto.FeeList.Select(x => new StatusPushDto.FeeDto()
|
|
|
|
|
// {
|
|
|
|
|
// //Id = x.
|
|
|
|
|
// FeeName = x.Name,
|
|
|
|
|
// FeeAmount = x.Amount
|
|
|
|
|
// }).ToList();
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.SerializeObject(pushDto, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
|
|
|
|
|
queueService.Push(msg, json);
|
|
|
|
|
queueService.Push(msg, order.CompanyId, json);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -603,6 +622,8 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
{
|
|
|
|
|
BillPushDto pushDto = new()
|
|
|
|
|
{
|
|
|
|
|
OrderId = order.Id,
|
|
|
|
|
Mblno = order.Mblno,
|
|
|
|
|
AnnexIdList = bindDto.AnnexIdList,
|
|
|
|
|
};
|
|
|
|
|
if (bindDto.OperType == FileTypeEnum.账单)
|
|
|
|
@ -619,7 +640,7 @@ namespace EntrustSettle.Api.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.SerializeObject(pushDto, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
|
|
|
|
|
queueService.Push(msg, json);
|
|
|
|
|
queueService.Push(msg, order.CompanyId, json);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|