dengyu 1 month ago
commit e17e500b97

@ -18,7 +18,7 @@ public abstract class BaseOrgModel<TKey> : BaseModel<TKey>, IOrgId
/// <summary>
/// 机构Id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "机构Id")]
[SqlSugar.SugarColumn(ColumnDescription = "机构Id", IsOnlyIgnoreUpdate = true)]
public long OrgId { get; set; } = 0;
}

@ -105,10 +105,9 @@ public class FlowInstanceController : ApiController
/// <returns></returns>
[HttpPost]
[Route("AuditFlowInstance")]
public DataResult AuditFlowInstance([FromBody] FlowInstanceAuditReq req)
public async Task<DataResult> AuditFlowInstance([FromBody] FlowInstanceAuditReq req)
{
var res = _invokeService.AuditAsync(req);
return res;
return await _invokeService.AuditAsync(req);
}
/// <summary>

@ -47,9 +47,16 @@ public class CodeFormSetService : IFormSetService
public DataResult<List<CodeFormSetRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<CodeFormSet>()
var data = query
.Where(whereList)
.Select<CodeFormSetRes>().ToQueryPage(request.PageCondition);
return data;
@ -63,15 +70,20 @@ public class CodeFormSetService : IFormSetService
public DataResult EditFormSet(CodeFormSetReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//var orgId = user.GetOrgId();
if (req.Id == 0)
{
if (tenantDb.Queryable<CodeFormSet>()
.Where(x => x.OrgId == user.OrgId && x.PermissionId == req.PermissionId && x.FormNo == req.FormNo &&x.TaskStatus == req.TaskStatus).Any())
{
return DataResult.Failed("表单设置已存在!", MultiLanguageConst.FormSetExist);
}
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
if (query
.Where(x => x.PermissionId == req.PermissionId && x.FormNo == req.FormNo && x.TaskStatus == req.TaskStatus && x.Id != req.Id).Any())
{
return DataResult.Failed("表单设置已存在!", MultiLanguageConst.FormSetExist);
}
if (req.Id == 0)
{
var data = req.Adapt<CodeFormSet>();
data.DefaultContent = req.Content;
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
@ -80,11 +92,11 @@ public class CodeFormSetService : IFormSetService
}
else
{
var info = tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == req.Id).First();
var info = query.Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns("DefaultContent").IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
tenantDb.Updateable(info).IgnoreColumns("DefaultContent").ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
@ -97,7 +109,14 @@ public class CodeFormSetService : IFormSetService
public DataResult<CodeFormSetRes> GetFormSetInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<CodeFormSet>()
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var data = query
.Where(x => x.Id == long.Parse(id) && x.Status == StatusEnum.Enable)
.Select<CodeFormSetRes>()
.First();
@ -157,7 +176,14 @@ public class CodeFormSetService : IFormSetService
public async Task<DataResult<List<CodeFormSetRes>>> GetFormSetListByModule(string permissionId)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = await tenantDb.Queryable<CodeFormSet>()
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var data = await query
.Where(x => x.PermissionId == long.Parse(permissionId) && x.Status == StatusEnum.Enable)
.Select<CodeFormSetRes>()
.ToListAsync();
@ -167,7 +193,14 @@ public class CodeFormSetService : IFormSetService
public DataResult BatchDelFormSet(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeFormSet>().Where(x => req.Ids.Contains(x.Id)).ToList();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var list = query.Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
@ -182,7 +215,14 @@ public class CodeFormSetService : IFormSetService
public DataResult SetPublicFormSet(CodeFormSetPublicStatusReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == req.Id).First();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var info = query.Where(x => x.Id == req.Id).First();
if (info.IsNull())
{
@ -204,7 +244,14 @@ public class CodeFormSetService : IFormSetService
public async Task<DataResult> FormSetCopy(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = await tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == long.Parse(id)).FirstAsync();
#region 添加系统参数 是否租户共享信息
var query = tenantDb.Queryable<CodeFormSet>();
var config = db.Queryable<SysConfig>().Where(x => x.Status == StatusEnum.Enable && x.Code == "IsTenantShareInfo").First();
if (config.IsNotNull() && config.Value == "TRUE")
query.ClearFilter<IOrgId>();
#endregion
var info = await query.Where(x => x.Id == long.Parse(id)).FirstAsync();
var data = info.Adapt<CodeFormSet>();
data.Id = 0;

@ -263,7 +263,7 @@ public class FlowRuntime
var scalar = sugarClient.Ado.GetScalar(conditionNode.SQLText,
new SugarParameter($"@{nameof(BaseModel<long>.Id)}", BusinessId));
if (scalar != null && (scalar is int count && count > 0 || scalar is bool boolValue && boolValue))
if (scalar.ObjToInt() > 0 || scalar.ObjToBool())
{
conditionId = conditionNode.Id;
break;

@ -0,0 +1,69 @@
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 BookingOrderToSlotDto
{
/// <summary>
/// 提单号
/// </summary>
public string SlotBookingNo { get; set; }
/// <summary>
/// 订单ID
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 委托客户ID
/// </summary>
public Nullable<long> CustomerId { get; set; }
/// <summary>
/// 委托客户名称
/// </summary>
public string CustomerName { get; set; }
/// <summary>
/// 销售ID
/// </summary>
public Nullable<long> SaleId { get; set; }
/// <summary>
/// 销售名称
/// </summary>
public string SaleName { get; set; }
/// <summary>
/// 操作ID
/// </summary>
public Nullable<long> OpId { get; set; }
/// <summary>
/// 操作名称
/// </summary>
public string OpName { get; set; }
/// <summary>
/// 单证ID
/// </summary>
public Nullable<long> DocId { get; set; }
/// <summary>
/// 单证名称
/// </summary>
public string DocName { get; set; }
/// <summary>
/// 委托编号
/// </summary>
public string CustomerNo { get; set; }
}
}

@ -457,6 +457,31 @@ namespace DS.WMS.Core.Op.Dtos
/// 提单类型MBL-Master单,HBL-House单
/// </summary>
public string BLIssueType { get; set; }
/// <summary>
/// 委托编号
/// </summary>
public string CustomerNo { get; set; }
/// <summary>
/// 销售机构部门id
/// </summary>
public Nullable<long> SaleOrgId { get; set; }
/// <summary>
/// 销售机构部门
/// </summary>
public string SaleOrgName { get; set; }
/// <summary>
/// 销售部门id
/// </summary>
public Nullable<long> SaleDeptId { get; set; }
/// <summary>
/// 销售部门
/// </summary>
public string SaleDeptName { get; set; }
}
/// <summary>

@ -17,6 +17,16 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
[Description("新增")]
ADD = 0,
/// <summary>
/// VOLTA订舱
/// </summary>
[Description("VOLTA订舱")]
VOLTA_SO = 1104,
/// <summary>
/// VOLTA截单
/// </summary>
[Description("VOLTA截单")]
VOLTA_SI = 1105
}
/// <summary>

@ -453,5 +453,9 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
[Description("通知人")]
public string NotifyParty { get; set; }
/// <summary>
/// 集装箱
/// </summary>
public string CntrTotal { get; set; }
}
}

@ -459,5 +459,9 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
[Description("通知人")]
public string NotifyParty { get; set; }
/// <summary>
/// 集装箱
/// </summary>
public string CntrTotal { get; set; }
}
}

@ -442,5 +442,34 @@ namespace DS.WMS.Core.Op.Entity
[SqlSugar.SugarColumn(ColumnDescription = "状态名称", Length = 20, IsNullable = true)]
public string StatusName { get; set; }
/// <summary>
/// 委托编号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "委托编号", Length = 20, IsNullable = true)]
public string CustomerNo { get; set; }
/// <summary>
/// 销售机构部门id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "销售机构部门id", IsNullable = true)]
public Nullable<long> SaleOrgId { get; set; }
/// <summary>
/// 销售机构部门
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "销售机构部门", Length = 20, IsNullable = true)]
public string SaleOrgName { get; set; }
/// <summary>
/// 销售部门id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "销售部门id", Length = 20, IsNullable = true)]
public Nullable<long> SaleDeptId { get; set; }
/// <summary>
/// 销售部门
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "销售部门", Length = 20, IsNullable = true)]
public string SaleDeptName { get; set; }
}
}

@ -530,4 +530,10 @@ public class SeaExportBillManage : BaseOrgModel<long>
[Description("通知人")]
[SqlSugar.SugarColumn(ColumnDescription = "通知人", IsNullable = true, Length = 100)]
public string NotifyParty { get; set; }
/// <summary>
/// 集装箱
/// </summary>
[Description("集装箱")]
[SugarColumn(ColumnDescription = "集装箱", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string CntrTotal { get; set; }
}

@ -271,5 +271,11 @@ namespace DS.WMS.Core.Op.Interface
/// <returns>返回回执</returns>
Task<DataResult> BookingSlotOpenEdit(BookingSlotOpenEditReq req);
/// <summary>
/// 同步订单更新舱位
/// </summary>
/// <param name="req">同步订单更新舱位请求</param>
/// <returns>返回回执</returns>
Task<DataResult> SyncBookingOrderToSlot(BookingOrderToSlotDto req);
}
}

@ -63,6 +63,7 @@ using System.ComponentModel;
using Masuit.Tools.Systems;
using System.Threading;
using NPOI.OpenXmlFormats.Wordprocessing;
using DS.WMS.Core.Invoice.Dtos;
namespace DS.WMS.Core.Op.Method
{
@ -3113,6 +3114,22 @@ namespace DS.WMS.Core.Op.Method
Logger.Log(NLog.LogLevel.Info, $"引入失败,更新海运出口失败,原因:{saveSeaExportRlt.Message}");
}
//这里生成完订单后,需要将订单的委托号回填到舱位上
var order = tenantDb.Queryable<SeaExport>().Where(x => x.Id == model.bookingOrderId).First();
//这里把订单的委托号同步到舱位
if (order != null)
{
foreach (var slot in latestSlotList)
{
slot.CustomerNo = order.CustomerNo;
tenantDb.Updateable<BookingSlotBase>(slot).UpdateColumns(x => new
{
x.CustomerNo
}).ExecuteCommand();
}
}
// if (generateModel.CtnList == null)
//{
@ -3885,7 +3902,7 @@ namespace DS.WMS.Core.Op.Method
row = sheet.CreateRow(rowIndex);
}
for (int i = 0; i <= 35; i++)
for (int i = 0; i <= 36; i++)
{
var cell = row.GetCell(i);
if (cell == null)
@ -3930,6 +3947,7 @@ namespace DS.WMS.Core.Op.Method
33 => "",
34 => item.Remark,
35 => item.PriceCalculationDate?.ToString(dateStr),
36 => item.CustomerNo,
_ => ""
};
cell.SetCellValue(value);
@ -3945,7 +3963,7 @@ namespace DS.WMS.Core.Op.Method
{
row2 = sheet.CreateRow(rowIndex);
}
for (int i = 36; i <= 42; i++)
for (int i = 37; i <= 43; i++)
{
var cell2 = row2.GetCell(i);
if (cell2 == null)
@ -3954,13 +3972,13 @@ namespace DS.WMS.Core.Op.Method
}
var value2 = i switch
{
36 => saleItem.CustomerName,
37 => saleItem.CustService,
38 => saleItem.Sale,
39 => saleItem.Shipper,
40 => saleItem.GoodsName,
41 => saleItem.SellingPrice?.ToString(),
42 => saleItem.SaleTime?.ToString(dateTimeStr),
37 => saleItem.CustomerName,
38 => saleItem.CustService,
39 => saleItem.Sale,
40 => saleItem.Shipper,
41 => saleItem.GoodsName,
42 => saleItem.SellingPrice?.ToString(),
43 => saleItem.SaleTime?.ToString(dateTimeStr),
_ => ""
};
cell2.SetCellValue(value2);
@ -4848,7 +4866,81 @@ namespace DS.WMS.Core.Op.Method
}
#endregion
#region 同步
#region 同步订单更新舱位
/// <summary>
/// 同步订单更新舱位
/// </summary>
/// <param name="req">同步订单更新舱位请求</param>
/// <returns>返回回执</returns>
public async Task<DataResult> SyncBookingOrderToSlot(BookingOrderToSlotDto req)
{
try
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
/*
1
2
*/
var allocList = await tenantDb.Queryable<BookingSlotAllocation>().Where(a => a.BookingId == req.BookingId && a.Deleted == false).ToListAsync();
if (allocList.Count > 0)
{
foreach (var alloc in allocList)
{
alloc.CustomerId = req.CustomerId;
alloc.CustomerName = req.CustomerName;
if (req.SaleId.HasValue)
alloc.SaleId = req.SaleId.Value.ToString();
alloc.Sale = req.SaleName;
if (req.OpId.HasValue)
alloc.OpId = req.OpId.Value.ToString();
alloc.Op = req.OpName;
if (req.DocId.HasValue)
alloc.DocId = req.DocId.Value.ToString();
alloc.Doc = req.DocName;
await tenantDb.Updateable<BookingSlotAllocation>(alloc).UpdateColumns(x => new
{
x.CustomerId,
x.CustomerName,
x.SaleId,
x.Sale,
x.OpId,
x.Op,
x.DocId,
x.Doc
}).ExecuteCommandAsync();
var slot = await tenantDb.Queryable<BookingSlotBase>().FirstAsync(b => b.Id == alloc.BookingSlotId);
if (slot != null)
{
slot.CustomerNo = req.CustomerNo;
await tenantDb.Updateable<BookingSlotBase>(slot).UpdateColumns(x => new
{
x.CustomerNo,
}).ExecuteCommandAsync();
}
}
}
}
catch(Exception ex)
{
}
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
}
#endregion
}

@ -23,6 +23,8 @@ using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Utils;
using NPOI.SS.Formula.PTG;
namespace DS.WMS.Core.Op.Method
{
@ -34,6 +36,7 @@ namespace DS.WMS.Core.Op.Method
private readonly ISaasDbService saasService;
private readonly IConfigService _configService;
private readonly ICodeThirdPartyService _codeThirdPartyService;
private readonly IDingTalkGroupHelper _dingTalkGroupHelper;
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
@ -42,6 +45,10 @@ namespace DS.WMS.Core.Op.Method
_serviceProvider = serviceProvider;
_configService = serviceProvider.GetRequiredService<IConfigService>();
_codeThirdPartyService = serviceProvider.GetRequiredService<ICodeThirdPartyService>();
_dingTalkGroupHelper = serviceProvider.GetRequiredService<IDingTalkGroupHelper>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
user = _serviceProvider.GetRequiredService<IUser>();
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
}
#region 扣费
@ -131,6 +138,13 @@ namespace DS.WMS.Core.Op.Method
string feeUserId = webAccountConfig.AppKey;
string feeUserKey = webAccountConfig.AppSecret;
var c = tenantDb.Queryable<DJYChargeFee>().Filter(null, true).Count(x => x.Id == id);
if (c > 0)
{
Logger.Log(NLog.LogLevel.Info, $"{batchId}-已存在扣费记录id{id},提单号:{orderInfo.MBLNO}");
continue;
}
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}";
@ -214,7 +228,7 @@ namespace DS.WMS.Core.Op.Method
Logger.Log(NLog.LogLevel.Info, $"批次号={batchId}-扣费失败,原因:{msg}");
//DingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", errMsg);
_dingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", msg);
}
}
catch (Exception ex)
@ -226,6 +240,8 @@ namespace DS.WMS.Core.Op.Method
detail.Status = "EXCEPTION";
detail.Message = ex.Message;
_dingTalkGroupHelper.SendDingTalkGroupMessage("bookingFeeNotify", "扣费失败提醒", record.ResultNote);
}
resultDto.ExcuteDetail.Add(detail);

@ -1820,6 +1820,8 @@ namespace DS.WMS.Core.Op.Method
if (ediRouteEnum == EDIRouteEnum.TSL)
{
sendStatus = await InnerSendBookingOrClosingEDIToPOST(result.ExtraData1.ToString(), postSpiderUrl, userWebAccountConfig);
}
else
{
@ -1853,6 +1855,25 @@ namespace DS.WMS.Core.Op.Method
}
}
if (sendStatus.Succeeded)
{
if (ediRouteEnum == EDIRouteEnum.VOLTA)
{
var feeRlt = await _dJYChargeFeeService.ChargeFee(new DJYChargeFeeRequestDto
{
BSType = ChargeFeeBSTypeEnum.BOOKING_CHANNEL_FEE,
SendType = req.SendType.Equals("B") ? ChargeFeeSendTypeEnum.VOLTA_SO : ChargeFeeSendTypeEnum.VOLTA_SI,
BusinessIdList = new List<long> {
order.Id
}
});
_logger.Info($"批次={batchNo} 扣费完成,结果{JsonConvert.SerializeObject(feeRlt)}");
}
}
_logger.Info("批次={no} 扣费", batchNo, result.ExtraData1.ToString());
DateTime eDate = DateTime.Now;
TimeSpan ts = eDate.Subtract(bDate);
var timeDiff = ts.TotalMilliseconds;

@ -7,6 +7,7 @@ using DS.Module.UserModule;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Sys.Entity;
@ -338,11 +339,15 @@ namespace DS.WMS.Core.Op.Method
info.IsCustoms = false;
info.IsLand = false;
info.IsVGM = false;
info.BusinessStatus = "";
info.BusinessStatusName = "";
info.BusinessStatus = string.Empty;
info.BusinessStatusName = string.Empty;
info.OrderProgress = "0";
await tenantDb.Updateable(info).UpdateColumns(x => new { x.CustomerNo,x.IsBooking,x.IsCustoms,x.IsLand,x.IsVGM,x.OrderProgress }).ExecuteCommandAsync();
await tenantDb.Updateable(info).UpdateColumns(x => new {
x.CustomerNo,
x.IsBooking,x.IsCustoms,x.IsLand,x.IsVGM,x.OrderProgress,
x.BusinessStatus, x.BusinessStatusName
}).ExecuteCommandAsync();
var oldOrder = entity.Adapt<SeaExport>();
entity.IsChangeETD = true;
@ -610,6 +615,14 @@ namespace DS.WMS.Core.Op.Method
if (!res.Succeeded)
return await Task.FromResult(DataResult.Failed(res.Message));
// 订舱完成推送Cargoo
var cargooService = _serviceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
return DataResult.Success;
}

@ -50,6 +50,9 @@ public partial class SeaExportService : ISeaExportService
private readonly ISysCacheService _sysCacheService;
private readonly IRabbitMQService _rabbitMQService;
private readonly IRedisService _redisBaseService;
private readonly IDJYChargeFeeService _dJYChargeFeeService;
//private readonly IBookingSlotService _bookingSlotService;
private readonly Lazy<ITaskManageBaseService> _taskManageBaseService;
@ -87,6 +90,9 @@ public partial class SeaExportService : ISeaExportService
_configService = _serviceProvider.GetRequiredService<IConfigService>();
_rabbitMQService = _serviceProvider.GetRequiredService<IRabbitMQService>();
_redisBaseService = _serviceProvider.GetRequiredService<IRedisService>();
_dJYChargeFeeService = _serviceProvider.GetRequiredService<IDJYChargeFeeService>();
//_bookingSlotService = _serviceProvider.GetRequiredService<IBookingSlotService>();
_taskManageBaseService = _serviceProvider.GetRequiredService<Lazy<ITaskManageBaseService>>();
}
@ -347,7 +353,13 @@ public partial class SeaExportService : ISeaExportService
//开启事务
await tenantDb.Ado.BeginTranAsync();
info.Note = "正常编辑";
await tenantDb.Updateable(info).EnableDiffLogEvent().ExecuteCommandAsync();//.IgnoreColumns(ignoreAllNullColumns: true)
await tenantDb.Updateable(info).IgnoreColumns(it => new
{
it.BusinessStatus,
it.BusinessStatusName,
it.IsVGM,it.IsBooking,it.IsLand,it.IsCustoms,
it.IsChangeETD,it.IsRefund
}).EnableDiffLogEvent().ExecuteCommandAsync();//.IgnoreColumns(ignoreAllNullColumns: true)
_logger.Info("执行完订单比对");
@ -480,6 +492,7 @@ public partial class SeaExportService : ISeaExportService
part.CBM = info.CBM;
part.TotalNo = info.TotalNo;
part.CntrNo = info.CntrNo;
//part.CntrTotal = info.CntrTotal;
await tenantDb.Updateable(part).ExecuteCommandAsync();
}
#endregion
@ -499,6 +512,21 @@ public partial class SeaExportService : ISeaExportService
//return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
await tenantDb.Ado.CommitTranAsync();
////保存会同步舱位
//await _bookingSlotService.SyncBookingOrderToSlot(new BookingOrderToSlotDto {
// BookingId = info.Id,
// CustomerId = info.CustomerId,
// CustomerName = info.CustomerName,
// CustomerNo = info.CustomerNo,
// DocId = info.Doc,
// DocName = info.DocName,
// SaleId = info.SaleId,
// SaleName = info.Sale,
// OpId = info.OperatorId,
// OpName = info.OperatorName
//});
return await Task.FromResult(DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess));
}
catch (Exception ex)

@ -8,12 +8,24 @@ namespace DS.WMS.Core.TaskInteraction.Dtos
/// </summary>
public class ActionExecutionContext
{
/// <summary>
/// 动作执行管理器
/// </summary>
public IActionManagerService ActionManager { get; set; }
/// <summary>
/// 任务信息
/// </summary>
public BusinessTask TaskInfo { get; internal set; }
/// <summary>
/// DI容器
/// </summary>
public IServiceProvider ServiceProvider { get; internal set; }
/// <summary>
/// 任务参数
/// </summary>
public IDictionary<string, object?> AdditionalData { get; set; } = new Dictionary<string, object?>();
}
}

@ -0,0 +1,40 @@
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Interface;
using DS.WMS.Core.TaskPlat.Interface;
using Microsoft.Extensions.DependencyInjection;
namespace DS.WMS.Core.TaskInteraction.Method.ActionExecutor.BLConfirm
{
/// <summary>
/// 分单提单确认
/// </summary>
public class SubBLConfirmActionExecutor : ServiceBase, IActionExecutor
{
ITaskManageBCService bCService;
ISeaExportTaskService taskService;
ITaskLogService logService;
/// <summary>
/// 初始化
/// </summary>
/// <param name="provider"></param>
public SubBLConfirmActionExecutor(IServiceProvider provider) : base(provider)
{
bCService = provider.GetRequiredService<ITaskManageBCService>();
taskService = provider.GetRequiredService<ISeaExportTaskService>();
logService = provider.GetRequiredService<ITaskLogService>();
}
/// <summary>
/// 执行动作
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public async Task ExecuteAsync(ActionExecutionContext context)
{
}
}
}

@ -1,5 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskInteraction.Dtos;
using Microsoft.Extensions.DependencyInjection;
@ -49,6 +50,14 @@ namespace DS.WMS.Core.TaskInteraction.Method.ActionExecutor.Booking
var task = context.TaskInfo;
task.TaskType = TaskBaseTypeEnum.WAIT_BOOKING;
await SetTaskCompleteAsync(task, TaskService, LogService);
// 订舱完成推送Cargoo
var cargooService = context.ServiceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
}
}
}

@ -1,4 +1,6 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos.Cargoo;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Entity;
using DS.WMS.Core.TaskInteraction.Interface;
@ -77,6 +79,14 @@ namespace DS.WMS.Core.TaskInteraction.Method.ActionExecutor.Booking
var task = context.TaskInfo;
task.TaskType = TaskBaseTypeEnum.WAIT_BOOKING;
await SetTaskCompleteAsync(task, TaskService, LogService);
// 订舱完成推送Cargoo
var cargooService = context.ServiceProvider.GetRequiredService<ICargooService>();
await cargooService.SendCargoo(new CargooShipmentReqDto()
{
bookingId = task.BusinessId,
cargooStatusEnum = CargooStatusEnum.Confirmed
});
}
}

@ -305,7 +305,16 @@ namespace DS.WMS.Core.TaskInteraction.Method
}
IActionExecutor? currentExecutor = null;
object instance = t.CreateInstance();
object? instance;
try
{
instance = t.CreateInstance(ServiceProvider);
}
catch
{
instance = t.CreateInstance();
}
if (instance is IActionSelector selector)
{
currentExecutor = await selector.GetActionExecutor(context);

@ -0,0 +1,135 @@
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;
using System.Text.Json.Nodes;
namespace DS.WMS.Core.Utils
{
public class DingTalkGroupHelper : IDingTalkGroupHelper
{
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly IConfigService _configService;
private readonly ICodeThirdPartyService _codeThirdPartyService;
public DingTalkGroupHelper(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_configService = serviceProvider.GetRequiredService<IConfigService>();
_codeThirdPartyService = serviceProvider.GetRequiredService<ICodeThirdPartyService>();
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
}
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
public async Task SendDingTalkGroupMessage(string code, string title, string content)
{
var dingdingCfg = db.Queryable<SysConfig>().Filter(null, true)
.Where(x => x.Code == code && x.TenantId == 1288018625843826688).First();
var postdata = new
{
text =
new
{
content = $"【{title}】\r\n{content}\r\n----{dingdingCfg.Note}"
},
msgtype = "text"
};
Logger.Log(NLog.LogLevel.Info, $"准备发送钉钉消息:{postdata.ToJsonString()}");
var rtn = RequestHelper.Post(JsonConvert.SerializeObject(postdata), dingdingCfg.Value);
Logger.Log(NLog.LogLevel.Info, $"发送钉钉消息返回:{rtn}");
}
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="atAll">@所有人</param>
/// <param name="atMobiles">@手机号数组</param>
/// <param name="atUserIds">@用户id数组</param>
public async Task SendDingTalkGroupMessage(string code, string title, string content, bool atAll, string[] atMobiles, string[] atUserIds)
{
var dingdingCfg = db.Queryable<SysConfig>().Filter(null, true)
.Where(x => x.Code == code && x.TenantId == 1288018625843826688).First();
var postdata = new
{
text =
new
{
content = $"【{title}】\r\n{content}\r\n----{dingdingCfg.Note}"
},
msgtype = "text",
at = new
{
isAtAll = atAll,
atMobiles = atMobiles,
atUserIds = atUserIds
}
};
Logger.Log(NLog.LogLevel.Info, $"准备发送钉钉消息:{postdata.ToJsonString()}");
var rtn = RequestHelper.Post(JsonConvert.SerializeObject(postdata), dingdingCfg.Value);
Logger.Log(NLog.LogLevel.Info, $"发送钉钉消息返回:{rtn}");
}
}
public interface IDingTalkGroupHelper
{
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
Task SendDingTalkGroupMessage(string code, string title, string content);
/// <summary>
/// 发送钉钉客服群组消息通知
/// </summary>
/// <param name="code">钉钉群配置code</param>
/// <param name="title">标题</param>
/// <param name="content">内容</param>
/// <param name="atAll">@所有人</param>
/// <param name="atMobiles">@手机号数组</param>
/// <param name="atUserIds">@用户id数组</param>
Task SendDingTalkGroupMessage(string code, string title, string content, bool atAll, string[] atMobiles, string[] atUserIds);
}
}

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Utils
{
public class ExportFileHelper
{
/// <summary>
/// 导出
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="list"></param>
/// <param name="colDicts"></param>
/// <returns></returns>
public async Task<string> Export<T>(List<T> dataLiist, Dictionary<string,string> colDicts)
{
string filePath = string.Empty;
try
{
}
catch(Exception ex)
{
}
return filePath;
}
}
}

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-10-25T02:29:26.9218878Z||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;</History>
<History>True|2024-10-25T07:09:27.7029075Z||;True|2024-10-25T10:29:26.9218878+08:00||;True|2024-10-22T17:58:39.9582805+08:00||;True|2024-10-21T17:57:21.7047579+08:00||;True|2024-10-21T14:30:54.4520206+08:00||;True|2024-10-21T10:19:05.7405749+08:00||;True|2024-10-18T16:11:05.4049685+08:00||;True|2024-10-18T14:59:49.1162741+08:00||;True|2024-10-16T16:29:15.3185348+08:00||;True|2024-10-16T14:12:58.1754214+08:00||;True|2024-10-16T14:08:06.5805581+08:00||;True|2024-10-16T11:55:29.8273176+08:00||;True|2024-10-15T17:39:40.4090324+08:00||;True|2024-10-15T17:06:43.0181578+08:00||;True|2024-10-15T15:07:38.9601925+08:00||;True|2024-10-12T13:33:32.4412583+08:00||;True|2024-10-11T17:00:54.0916209+08:00||;True|2024-10-11T10:54:50.3307087+08:00||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>
Loading…
Cancel
Save