运踪订阅相关接口

master
ZR20090193-陈敬勇 7 months ago
parent 33c977785a
commit e407e2df4c

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.System.Dtos;
@ -38,5 +39,11 @@ public interface IColumnSetService
/// <param name="columnNo">列表序号</param>
/// <returns></returns>
DataResult<ColumnSetRes> GetColumnSetInfoByModule(string permissionId,int columnNo = 0);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelColumnSet(IdModel req);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.System.Dtos;
@ -27,4 +28,11 @@ public interface IFormCopyService
/// <param name="id"></param>
/// <returns></returns>
DataResult<CodeFormCopyRes> GetFormCopyInfo(string id);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelFormCopy(IdModel req);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.System.Dtos;
@ -40,5 +41,12 @@ public interface IFormSetService
public DataResult<CodeFormSetRes> GetFormSetInfoByModule(string permissionId, int formNo = 0);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelFormSet(IdModel req);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.System.Dtos;
@ -45,4 +46,11 @@ public interface IQuerySetService
/// <param name="id"></param>
/// <returns></returns>
DataResult DelQuerySet(string id);
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult BatchDelQuerySet(IdModel req);
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -101,4 +102,15 @@ public class CodeFormCopyService : IFormCopyService
.First();
return DataResult<CodeFormCopyRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
public DataResult BatchDelFormCopy(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeFormCopy>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}

@ -1,10 +1,12 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Entity;
using DS.WMS.Core.System.Interface;
@ -117,4 +119,16 @@ public class CodeFormSetService : IFormSetService
return DataResult<CodeFormSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
public DataResult BatchDelFormSet(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeFormSet>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -128,4 +129,15 @@ public class CodeQuerySetService : IQuerySetService
db.Deleteable(info).ExecuteCommand();
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
public DataResult BatchDelQuerySet(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeQuerySet>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
@ -108,5 +109,16 @@ namespace DS.WMS.Core.Code.Method
.Select<ColumnSetRes>().ToQueryPage(request.PageCondition);
return data;
}
public DataResult BatchDelColumnSet(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var list = tenantDb.Queryable<CodeColumnSet>().Where(x => req.Ids.Contains(x.Id)).ToList();
if (list.Count > 0)
{
tenantDb.Deleteable(list).ExecuteCommand();
}
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
}
}
}

@ -34,6 +34,11 @@ public class FeeRecordReq
/// 费用名称
/// </summary>
public string FeeName { get; set; }
/// <summary>
/// 费用英文名称
/// </summary>
public string FeeEnName { get; set; }
/// <summary>
/// 费用对象
/// </summary>

@ -36,6 +36,10 @@ public class FeeRecordRes
/// </summary>
public string FeeName { get; set; }
/// <summary>
/// 费用英文名称
/// </summary>
public string FeeEnName { get; set; }
/// <summary>
/// 费用对象
/// </summary>
public string CustomerName { get; set; }

@ -42,6 +42,11 @@ namespace DS.WMS.Core.Fee.Entity
[SugarColumn(ColumnDescription = "费用名称", Length = 100, IsNullable = true)]
public string FeeName { get; set; }
/// <summary>
/// 费用英文名称
/// </summary>
[SugarColumn(ColumnDescription = "费用英文名称", Length = 100, IsNullable = true)]
public string FeeEnName { get; set; }
/// <summary>
/// 费用对象
/// </summary>
[SugarColumn(ColumnDescription = "费用对象", Length = 100, IsNullable = true)]

@ -0,0 +1,107 @@
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 BillTraceReq
{
/// <summary>
/// 业务主键
/// </summary>
public string BusinessId { get; set; }
/// <summary>
/// 提单号ONEYTA3ZR0262300
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 场站名称,例:外运场站
/// </summary>
public string YARD { get; set; }
/// <summary>
/// 场站代码,例WYCZ
/// </summary>
public string YardCode { get; set; }
/// <summary>
/// 船公司代号ONE
/// </summary>
public string CARRIERID { get; set; }
/// <summary>
/// 船公司名称ONE
/// </summary>
public string CARRIER { get; set; }
/// <summary>
/// 是否订阅港后的运踪默认为false
/// </summary>
public bool isBook { get; set; }
/// <summary>
/// 是否订阅港前运踪默认为true
/// </summary>
public bool IsFrontPort { get; set; }
}
public class BillTraceMain
{
/// <summary>
/// 接口调用授权Key用于运踪模块接口鉴权
/// </summary>
public string Key { get; set; }
/// <summary>
/// 接口调用授权密钥 (用于运踪模块接口鉴权)
/// </summary>
public string PWD { get; set; }
/// <summary>
/// 操作人员信息的主键
/// </summary>
public string Gid { get; set; }
/// <summary>
/// 运踪信息回推时的调用地址如http://40.147.147.147:22222/DataSync/AddBookingStatusLog
/// </summary>
public string url { get; set; }
/// <summary>
/// 订阅的列表
/// </summary>
public List<BillTraceReq> Children { get; set; }
/// <summary>
/// 运踪信息回推时的授权Key用于对接方接口鉴权
/// </summary>
public string PushBackKey { get; set; }
/// <summary>
/// 运踪信息回推时的授权Secret用于对接方接口鉴权
/// </summary>
public string PushBackSecret { get; set; }
}
/// <summary>
/// 运踪退订-调用大简云运踪模块的Dto类
/// </summary>
public class BillTraceUnsubscribeDto
{
public string Key { get; set; }
public string PWD { get; set; }
public string Gid { get; set; }
public List<BillTraceUnsubscribeList> Children { get; set; }
}
public class BillTraceUnsubscribeList
{
public BillTraceUnsubscribeList()
{ }
public BillTraceUnsubscribeList(string businessId, string mBLNO)
{
BusinessId = businessId;
MBLNO = mBLNO;
}
public string MBLNO { get; set; }
public string BusinessId { get; set; }
}
}

@ -0,0 +1,32 @@
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 BillTraceRes
{
/// <summary>
/// 是否成功
/// </summary>
public bool Success { get; set; }
/// <summary>
/// 提示消息
/// </summary>
public string Message { get; set; }
/// <summary>
/// 结果编码。0成功
/// </summary>
public string Code { get; set; }
/// <summary>
/// 返回数据
/// </summary>
public string Data { get; set; }
}
}

@ -0,0 +1,63 @@
using DS.Module.Core;
using DS.WMS.Core.Code.Dtos;
using FluentValidation;
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 BookingGoodsStatusConfigReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 系统编码
/// </summary>
public string SystemCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string StatusName { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}
/// <summary>
/// 验证
/// </summary>
public class BookingStatusConfigReqValidator : AbstractValidator<BookingGoodsStatusConfigReq>
{
/// <summary>
/// 构造函数
/// </summary>
public BookingStatusConfigReqValidator()
{
this.RuleFor(o => o.SystemCode)
.NotEmpty().WithName("系统编码");
this.RuleFor(o => o.StatusName)
.NotEmpty().WithName("状态名称");
}
}
}

@ -0,0 +1,50 @@
using DS.Module.Core;
using SqlSugar;
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 BookingGoodsStatusConfigRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 系统编码
/// </summary>
public string SystemCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
public string StatusName { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
}

@ -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
{
public class BookingStatusLogReq
{
public long Id { get; set; }
/// <summary>
/// 订舱记录主键
/// </summary>
public long BookingId { get; set; }
/// <summary>
/// 业务id
/// </summary>
public string BusinessId { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OpTime { get; set; }
/// <summary>
/// 类别
/// </summary>
public string Category { get; set; }
/// <summary>
/// 状态分类
/// </summary>
public string Type { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBLNO { get; set; }
public List<BookingStatusLogDetailDto> detail { get; set; }
}
public class BookingStatusLogDetailDto
{
/// <summary>
/// 主单id
/// </summary>
public long? PId { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string CNTRNO { get; set; }
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OPTime { get; set; }
}
}

@ -28,6 +28,15 @@ public class SeaExportRes
/// </summary>
public int BillFeeStatus { get; set; }
/// <summary>
/// 业务状态名称
/// </summary>
public string BusinessStatusName { get; set; }
/// <summary>
/// 单据费用状态名称
/// </summary>
public string BillFeeStatusName { get; set; }
/// <summary>
/// 单据费用状态时间
/// </summary>
@ -174,6 +183,10 @@ public class SeaExportRes
/// </summary>
public DateTime? ATD { get; set; }
/// <summary>
/// ATA 实际到港(目的港)时间
/// </summary>
public DateTime? ATA { get; set; }
/// <summary>
/// 截港日期
/// </summary>
@ -1042,5 +1055,10 @@ public class SeaExportRes
/// Desc:整票提交状态
/// </summary>
public AuditStatusEnum BillSubmitStatus { get; set; }
/// <summary>
/// 是否订阅运踪 0 没有订阅 1 订阅起运港 2 订阅目的港 3 订阅起运港目的港
/// </summary>
public string IsBookingYZ { get; set; }
}

@ -0,0 +1,69 @@
using DS.Module.Core.Data;
using SqlSugar;
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("op_booking_goods_status", "订舱货物状态")]
public class BookingGoodsStatus : BaseModel<long>
{
/// <summary>
/// 业务id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务id", IsNullable = false)]
public long? BusinessId { get; set; }
/// <summary>
/// 货物状态配置ID 雪花id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "货物状态id", IsNullable = false)]
public long? ConfigId { get; set; }
/// <summary>
/// 状态代码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态代码", IsNullable = true, Length = 100)]
public string StatusCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态名称", IsNullable = true, Length = 100)]
public string StatusName { get; set; }
/// <summary>
/// 状态时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态时间", IsNullable = true)]
public DateTime? StatusTime { get; set; }
/// <summary>
/// 完成时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态时间", IsNullable = true)]
public DateTime? FinishTime { get; set; }
/// <summary>
/// 完成人
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "完成人", IsNullable = true, Length = 100)]
public string FinishUserName { get; set; }
/// <summary>
/// 完成人ID
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "完成人ID", IsNullable = true)]
public long? FinishBy { get; set; }
/// <summary>
/// 是否公开
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "是否公开", IsNullable = true,DefaultValue ="0")]
public bool IsPublic { get; set; }
/// <summary>
/// 附加数据
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "附加数据", IsNullable = true, ColumnDataType = StaticConfig.CodeFirst_BigString)]
public string ExtData { get; set; }
}
}

@ -0,0 +1,47 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using SqlSugar;
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("op_booking_goods_status_config", "订舱货物状态管理")]
public class BookingGoodsStatusConfig : BaseModel<long>
{
/// <summary>
/// 系统编码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "系统编码", IsNullable = false, Length = 100)]
public string SystemCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态名称", IsNullable = false, Length = 100)]
public string StatusName { get; set; }
/// <summary>
/// 排序
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "排序", IsNullable = true)]
public int? OrderNo { get; set; } = 100;
/// <summary>
/// 备注
/// </summary>
[SugarColumn(ColumnDescription = "备注", Length = 100, IsNullable = true)]
public string Note { get; set; }
/// <summary>
/// 状态 0启用 1禁用
/// </summary>
[SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
}
}

@ -0,0 +1,44 @@
using DS.Module.Core.Data;
using SqlSugar;
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("op_booking_status", "订舱状态")]
public class BookingStatus : BaseModel<long>
{
/// <summary>
/// 业务id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务id", IsNullable = false)]
public long? BusinessId { get; set; }
/// <summary>
/// 状态代码
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态代码", IsNullable = true, Length = 100)]
public string StatusCode { get; set; }
/// <summary>
/// 状态名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态名称", IsNullable = true, Length = 100)]
public string StatusName { get; set; }
/// <summary>
/// 状态时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态时间", IsNullable = true)]
public DateTime? StatusTime { get; set; }
/// <summary>
/// 状态分组
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态分组", IsNullable = true, Length = 100)]
public string StatusGroup { get; set; }
}
}

@ -0,0 +1,42 @@
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("op_booking_status_log", "货运跟踪")]
public class BookingStatusLog : BaseModel<long>
{
/// <summary>
/// 业务id
/// </summary>
public long? BusinessId { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 状态时间
/// </summary>
public DateTime? OpTime { get; set; }
/// <summary>
/// 类别
/// </summary>
public string Group { get; set; }
/// <summary>
/// 状态分类
/// </summary>
public string Type { get; set; }
/// <summary>
/// 提单号
/// </summary>
public string MBLNO { get; set; }
}
}

@ -0,0 +1,38 @@
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("op_booking_status_log_detail", "货运状态详情")]
public class BookingStatusLogDetail : BaseModel<long>
{
/// <summary>
/// 主单id
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "主单id", IsNullable = false)]
public long PId { get; set; }
/// <summary>
/// 状态
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态", IsNullable = true, Length = 100)]
public string Status { get; set; }
/// <summary>
/// 状态时间
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "状态时间", IsNullable = true)]
public DateTime? OpTime { get; set; }
/// <summary>
/// 箱号
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "箱号", IsNullable = true, Length = 100)]
public string CNTRNO { get; set; }
}
}

@ -21,13 +21,21 @@ public class SeaExport : BaseOrgModel<long>
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务状态", IsNullable = false, DefaultValue = "0")]
public int BusinessStatus { get; set; }
/// <summary>
/// 业务状态名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "业务状态名称", IsNullable = false, Length = 50)]
public string BusinessStatusName { get; set; }
/// <summary>
/// 单据费用状态
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "单据费用状态", IsNullable = false, DefaultValue = "0")]
public int BillFeeStatus { get; set; }
/// <summary>
/// 单据费用状态名称
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "单据费用状态名称", IsNullable = false, Length = 50)]
public string BillFeeStatusName { get; set; }
/// <summary>
/// 单据费用状态时间
/// </summary>
@ -197,11 +205,15 @@ public class SeaExport : BaseOrgModel<long>
public DateTime? ETA { get; set; }
/// <summary>
/// ATD
/// ATD 实际开船时间
/// </summary>
[SugarColumn(ColumnDescription = "ATD", IsNullable = true)]
public DateTime? ATD { get; set; }
/// <summary>
/// ATA 实际到港(目的港)时间
/// </summary>
[SugarColumn(ColumnDescription = "ATA", IsNullable = true)]
public DateTime? ATA { get; set; }
/// <summary>
/// 截港日期
/// </summary>
@ -1255,5 +1267,11 @@ public class SeaExport : BaseOrgModel<long>
/// Desc:整票提交状态
/// </summary>
[SugarColumn(ColumnDescription = "整票提交状态", IsNullable = true, DefaultValue = "-1")]
public AuditStatusEnum BillSubmitStatus { get; set; }
public AuditStatusEnum BillSubmitStatus { get; set; }
/// <summary>
/// 是否订阅运踪 0 没有订阅 1 订阅起运港 2 订阅目的港 3 订阅起运港目的港
/// </summary>
[SugarColumn(ColumnDescription = "是否订阅运踪", IsNullable = true, DefaultValue = "0",Length =10)]
public string IsBookingYZ { get; set; }
}

@ -0,0 +1,49 @@
using DS.Module.Core.Data;
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
{
public interface IBookingGoodsStatusConfigService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
DataResult<List<BookingGoodsStatusConfigRes>> GetListByPage(PageRequest request);
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
DataResult EditBookingGoodsStatusConfig(BookingGoodsStatusConfigReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<BookingGoodsStatusConfigRes> GetBookingGoodsStatusConfigInfo(string id);
///// <summary>
///// 删除
///// </summary>
///// <param name="id"></param>
///// <returns></returns>
//public DataResult DelBookingStatusConfig(string id);
///// <summary>
///// 批量删除
///// </summary>
///// <param name="req"></param>
///// <returns></returns>
//public DataResult BatchDelBookingStatusConfig(IdModel req);
}
}

@ -0,0 +1,22 @@
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 IDataCallBackService
{
/// <summary>
/// 插入货运动态
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public Task AddBookingStatusLog(List<BookingStatusLogReq> req);
}
}

@ -84,4 +84,17 @@ public interface ISeaExportService
/// <returns></returns>
public Task<DataResult<string>> GetYardData(string id, bool isWeb = false);
/// <summary>
/// 发起运踪订阅或者更新提单号
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public Task<DataResult<string>> SendOrUpdateTrace(List<BillTraceReq> req);
/// <summary>
/// 运踪退订
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public Task<DataResult<string>> UnsubscribeBillTrace(List<BillTraceUnsubscribeList> req);
}

@ -0,0 +1,79 @@
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 Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using DS.Module.Core.Extensions;
using Mapster;
using Org.BouncyCastle.Ocsp;
namespace DS.WMS.Core.Op.Method
{
/// <summary>
///
/// </summary>
public class BookingGoodsStatusConfigService: IBookingGoodsStatusConfigService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public BookingGoodsStatusConfigService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
public DataResult EditBookingGoodsStatusConfig(BookingGoodsStatusConfigReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
if (req.Id == 0)
{
var data = req.Adapt<BookingGoodsStatusConfig>();
var entity = tenantDb.Insertable(data).ExecuteReturnEntity();
return DataResult.Successed("添加成功!", entity.Id, MultiLanguageConst.DataCreateSuccess);
}
else
{
var info = tenantDb.Queryable<BookingGoodsStatusConfig>().Where(x => x.Id == req.Id).First();
info = req.Adapt(info);
tenantDb.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
}
public DataResult<BookingGoodsStatusConfigRes> GetBookingGoodsStatusConfigInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var data = tenantDb.Queryable<BookingGoodsStatusConfig>()
.Where(a => a.Id == long.Parse(id))
.Select<BookingGoodsStatusConfigRes>()
.First();
return DataResult<BookingGoodsStatusConfigRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
public DataResult<List<BookingGoodsStatusConfigRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<BookingGoodsStatusConfig>()
.Where(whereList)
.Select<BookingGoodsStatusConfigRes>().ToQueryPage(request.PageCondition);
return data;
}
}
}

@ -0,0 +1,420 @@
using Amazon.Runtime.Internal.Util;
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.System.Entity;
using DS.WMS.Core.System.Interface;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using NLog;
using NLog.Web;
using DS.Module.Core.Extensions;
using Logger = NLog.Logger;
using Mapster;
namespace DS.WMS.Core.Op.Method
{
public class DataCallBackService : IDataCallBackService
{
private readonly IServiceProvider _serviceProvider;
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly ICommonService commonService;
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
/// <summary>
///
/// </summary>
/// <param name="serviceProvider"></param>
public DataCallBackService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
commonService = _serviceProvider.GetRequiredService<ICommonService>();
}
/// <summary>
/// 插入货运动态
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task AddBookingStatusLog(List<BookingStatusLogReq> req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
try
{
if (req.Count == 0)
{
return;
}
else
{
//订舱状态
var dicList = db.Queryable<SysDictData>().Where(x => x.TypeId == 1788810332945387520).ToList();
foreach (var item in req)
{
// 当BusinessId不为空时将BusinessId的值转为订舱主键否则仍然使用BookingId作为订舱记录主键
if (!string.IsNullOrEmpty(item.BusinessId))
{
if (long.TryParse(item.BusinessId, out long itemBusinessId))
{
item.BookingId = itemBusinessId;
}
else
{
_logger.Error($"在将item.BusinessId转为BookingId时发生异常货运动态插入失败item.BusinessId的值为{item.BusinessId}");
continue;
}
}
var businessId = item.BookingId;
var list = await tenantDb.Queryable<BookingStatus>().Filter(null, true)
.InnerJoin<SysDictData>((d, t) => d.StatusCode == t.Value && d.StatusGroup == "booking_status_group_billtrace" && d.BusinessId == businessId).Select((d, t) => new
{
BusinessId = d.BusinessId,
StatusCode = d.StatusCode,
StatusName = d.StatusName,
StatusTime = d.StatusTime,
Name = t.Name,
Value = t.Value
}).ToListAsync();
var oldLog = await tenantDb.Queryable<BookingStatusLog>().Where(x => x.BusinessId == businessId && x.Group == "yunzong").FirstAsync();
//删除日志详情和日志
var oldLogDetails = await tenantDb.Queryable<BookingStatusLogDetail>().Where(x => x.PId == oldLog.Id).ToListAsync();
await tenantDb.Deleteable(oldLogDetails).ExecuteCommandAsync();
await tenantDb.Deleteable(oldLog).ExecuteCommandAsync();
#region 日志
//新增数据
var statusLog = new BookingStatusLog()
{
BusinessId = businessId,
Group = "yunzong",
Status = item.Status,
OpTime = item.OpTime,
MBLNO = item.MBLNO
};
await tenantDb.Insertable(statusLog).ExecuteCommandAsync();
if (item.detail != null && item.detail.Count > 0)
{
foreach (var dt in item.detail)
{
var logDetail = new BookingStatusLogDetail()
{
PId = statusLog.Id,
Status = dt.Status,
CNTRNO = dt.CNTRNO,
OpTime = dt.OPTime
};
await tenantDb.Insertable(logDetail).ExecuteCommandAsync();
}
}
if (item.Status == "提箱")
{
//自动引入场站箱型箱量数据
//await _bookingorderservice.AutoYardData(item.BookingId);
//#region 推送已提箱状态
////2023-12-28 JHQ 增加提箱推送状态
//DateTime opTime = DateTime.MinValue;
//if (item.detail != null && item.detail.Count > 0 && item.detail.Any(x => x.OPTime.HasValue))
// opTime = item.detail.Where(x => x.OPTime.HasValue).Max(x => x.OPTime.Value);
//var pushModel = new ModifyServiceProjectStatusDto
//{
// BookingId = businessId,
// SourceType = TrackingSourceTypeEnum.AUTO,
// StatusCodes = new List<ModifyServiceProjectStatusDetailDto> {
// new ModifyServiceProjectStatusDetailDto { StatusCode = "YTX" } }
//};
//if (opTime != DateTime.MinValue)
//{
// pushModel.StatusCodes[0].SetActDate = opTime;
//}
//var saveStatusRlt = await _bookingValueAddedService.SaveServiceStatus(pushModel);
//_logger.Info("请求JSON={json} 异步推送服务状态完成,结果={rlt}", JSON.Serialize(pushModel), JSON.Serialize(saveStatusRlt));
//#endregion
}
#endregion
#region 订舱状态
if (item.Status == "舱单")
{
if (list.Where(x => x.Value == "status_cangdan").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_cangdan",
StatusName = dicList.Where(x => x.Value == "status_cangdan").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
//2023-12-28 JHQ 增加舱单放行推送状态
await SetGoodsStatus("CDFX", item.BookingId);
}
}
if (item.Status == "海关放行")
{
if (list.Where(x => x.Value == "status_haifang").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_haifang",
StatusName = dicList.Where(x => x.Value == "status_haifang").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
await SetGoodsStatus("BG", item.BookingId);
}
}
if (item.Status == "装载")
{
if (list.Where(x => x.Value == "status_zhuangzai").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_zhuangzai",
StatusName = dicList.Where(x => x.Value == "status_zhuangzai").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
await SetGoodsStatus("ZZFX", item.BookingId);
}
}
if (item.Status == "码放")
{
if (list.Where(x => x.Value == "status_mafang").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_mafang",
StatusName = dicList.Where(x => x.Value == "status_mafang").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
await SetGoodsStatus("MTFX", item.BookingId);
}
}
if (item.Status == "装船")
{
if (list.Where(x => x.Value == "status_zhuangchuan").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_zhuangchuan",
StatusName = dicList.Where(x => x.Value == "status_zhuangchuan").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
}
}
if (item.Status == "ATD")
{
if (list.Where(x => x.Value == "status_atd").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_atd",
StatusName = dicList.Where(x => x.Value == "status_atd").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
}
}
if (item.Status == "MDGETA")
{
if (list.Where(x => x.Value == "status_mdgeta").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_mdgeta",
StatusName = dicList.Where(x => x.Value == "status_mdgeta").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
}
var order = tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => x.Id == businessId && x.Deleted == false).First();
if (order.ETA != item.OpTime && item.OpTime != null)
{
order.ETA = item.OpTime;
await tenantDb.Updateable(order).EnableDiffLogEvent().ExecuteCommandAsync();
}
}
if (item.Status == "MDGATA")
{
if (list.Where(x => x.Value == "status_mdgata").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_mdgata",
StatusName = dicList.Where(x => x.Value == "status_mdgata").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
}
var order = tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => x.Id == businessId && x.Deleted == false).First();
if (order.ATA != item.OpTime && item.OpTime != null)
{
order.ATA = item.OpTime;
await tenantDb.Updateable(order).EnableDiffLogEvent().ExecuteCommandAsync();
}
}
#region 入港时间
if (item.Status == "入港")
{
if (list.Where(x => x.Value == "status_rugang").FirstOrDefault() == null)
{
var bookingStatus = new BookingStatus()
{
BusinessId = businessId,
StatusCode = "status_rugang",
StatusName = dicList.Where(x => x.Value == "status_rugang").Select(x => x.Name).First(),
StatusTime = item.OpTime,
StatusGroup = "booking_status_group_billtrace"
};
await tenantDb.Insertable(bookingStatus).ExecuteCommandAsync();
await SetGoodsStatus("YRG", item.BookingId);
}
}
#endregion
#endregion
}
}
}
catch (Exception ex)
{
_logger.Error(ex.Message);
_logger.Error(ex.StackTrace);
}
}
/// <summary>
/// 设置货物状态完成
/// </summary>
/// <param name="code"></param>
/// <param name="bookingId"></param>
/// <returns></returns>
public async Task SetGoodsStatus(string code, long bookingId)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var CreatedUserId = tenantDb.Queryable<SeaExport>().Filter(null, true).Where(x => x.Id == bookingId).Select(x => x.CreateBy).First();
if (CreatedUserId != null)
{
var gsCfg = tenantDb.Queryable<BookingGoodsStatusConfig>().First(x => x.SystemCode == code && x.CreateBy == (long)CreatedUserId);
if (gsCfg != null)
{
_logger.Info($"检查{code}货物状态:{bookingId}");
var gs = tenantDb.Queryable<BookingGoodsStatus>().First(x => x.ConfigId == gsCfg.Id && x.BusinessId == bookingId);
if (gs == null)
{
gs = new BookingGoodsStatus()
{
BusinessId = bookingId,
ConfigId = gsCfg.Id,
FinishTime = DateTime.Now,
FinishUserName = user.UserId.IsNull() ? "超级管理员" : user.UserId,
FinishBy = user.UserId.IsNull() ? 0 : long.Parse(user.UserId),
StatusCode = gsCfg.SystemCode,
StatusName = gsCfg.StatusName,
};
await tenantDb.Insertable(gs).ExecuteCommandAsync();
_logger.Info($"发送{code}后自动完成货物状态,Id{bookingId}");
//更新货物状态
await SetBookingOrderGoodsStatus(bookingId);
}
}
}
}
/// <summary>
/// 更新主单货物状态
/// </summary>
/// <param name="bookingId"></param>
/// <returns></returns>
public async Task SetBookingOrderGoodsStatus(long bookingId)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var order = tenantDb.Queryable<SeaExport>().Filter(null, true).First(x => x.Id == bookingId);
var createUserid = order.CreateBy;
//获取当前用户已经录入的货物状态
var list = await tenantDb.Queryable<BookingGoodsStatus>().LeftJoin(tenantDb.Queryable<BookingGoodsStatusConfig>(),
(goods, config) => config.Id == goods.ConfigId).Where((goods, config) => config.CreateBy == createUserid && goods.BusinessId == bookingId).
OrderBy((goods, config) => config.OrderNo).
Select((goods, config) => new
{
ConfigId = config.Id,
SystemCode = config.SystemCode,
StatusName = config.StatusName,
FinishTime = goods.FinishTime,
FinishUser = goods.FinishUserName,
FinishUserId = goods.FinishBy,
IsPublic = goods.IsPublic,
ExtData = goods.ExtData,
Remark = goods.Note,
OrderNo = config.OrderNo
}).ToListAsync();
if (list != null)
{
//回写主单状态
var StatusName = list.Where(x => x.FinishTime.HasValue).OrderByDescending(x => x.OrderNo).Select(x => x.StatusName).FirstOrDefault();
if (StatusName == null)
{
StatusName = "";
}
order.BusinessStatusName = StatusName;
await tenantDb.Updateable(order).EnableDiffLogEvent().ExecuteCommandAsync();
// 记录日志
//var newOrder = order.Adapt<SeaExport>();
//newOrder.BSSTATUSNAME = StatusName;
//await SaveLog(newOrder, order, "自动更新货物状态");
}
}
}
}

@ -8,7 +8,6 @@ using DS.WMS.Core.Op.Interface;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using DS.Module.Core.Extensions;
using AngleSharp.Dom;
using Mapster;
namespace DS.WMS.Core.Op.Method

@ -1,3 +1,4 @@
using Amazon.Runtime.Internal.Util;
using AngleSharp.Dom;
using DS.Module.Core;
using DS.Module.Core.Data;
@ -14,10 +15,12 @@ using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.System.Entity;
using DS.WMS.Core.System.Interface;
using Mapster;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SqlSugar;
using System.Security.Policy;
namespace DS.WMS.Core.Op.Method;
@ -505,42 +508,42 @@ public class SeaExportService : ISeaExportService
MBLNO = order.MBLNO,
IsWeb = isWeb
};
{
var rtn = await GetYardData(req);
//if (!rtn.Key)
//{
// throw Oops.Bah(rtn.Value);
//}
//场站引入的数据,转换为订舱箱型,且带上箱型代码
var ctnList = tenantDb.Queryable<CodeCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var mapCtn = tenantDb.Queryable<MappingCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var listRtn = JsonConvert.DeserializeObject<List<YardCtnImportRes>>(rtn.Data);
var rtn = await GetYardData(req);
//if (!rtn.Key)
//{
// throw Oops.Bah(rtn.Value);
//}
//场站引入的数据,转换为订舱箱型,且带上箱型代码
var ctnList = tenantDb.Queryable<CodeCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var mapCtn = tenantDb.Queryable<MappingCtn>().Where(x => x.Status == StatusEnum.Enable).ToList();
var listRtn = JsonConvert.DeserializeObject<List<YardCtnImportRes>>(rtn.Data);
foreach (var item in listRtn)
foreach (var item in listRtn)
{
var ctnall = item.CTNALL;
var findMap = mapCtn.FirstOrDefault(x => x.Module == "YardData" && x.MapCode == ctnall);
var findCtn = ctnList.FirstOrDefault(x => x.CtnName == ctnall);
if (findMap != null)
{
var ctnall = item.CTNALL;
var findMap = mapCtn.FirstOrDefault(x => x.Module == "YardData" && x.MapCode == ctnall);
var findCtn = ctnList.FirstOrDefault(x => x.CtnName == ctnall);
if (findMap != null)
{
item.CtnCode = findMap.Code;
item.CtnCode = findMap.Code;
findCtn = ctnList.First(c => c.EdiCode == findMap.Code);
item.CTNALL = findCtn.CtnName; //名称显示维护的箱型
}
else if (findCtn != null)
{
item.CtnCode = findCtn.EdiCode;
item.CTNALL = findCtn.CtnName; //名称显示维护的箱型
}
else
{
return await Task.FromResult(DataResult<List<YardCtnImportRes>>.Failed($"未找到箱型{ctnall}的场站引入配置"));
}
findCtn = ctnList.First(c => c.EdiCode == findMap.Code);
item.CTNALL = findCtn.CtnName; //名称显示维护的箱型
}
else if (findCtn != null)
{
item.CtnCode = findCtn.EdiCode;
item.CTNALL = findCtn.CtnName; //名称显示维护的箱型
}
else
{
return await Task.FromResult(DataResult<List<YardCtnImportRes>>.Failed($"未找到箱型{ctnall}的场站引入配置"));
}
return await Task.FromResult(DataResult<List<YardCtnImportRes>>.Success(listRtn));
}
return await Task.FromResult(DataResult<List<YardCtnImportRes>>.Success(listRtn));
}
/// <summary>
@ -592,7 +595,7 @@ public class SeaExportService : ISeaExportService
var rtnObj = JObject.Parse(res);
if (rtnObj.GetIntValue("code") != 200)
{
return await Task.FromResult(DataResult<string>.Failed("$\"获取场站数失败:{rtnObj.GetStringValue(\"msg\")}\"!"));
return await Task.FromResult(DataResult<string>.Failed("$\"获取场站数失败:{rtnObj.GetStringValue(\"msg\")}\"!"));
}
else
{
@ -623,4 +626,188 @@ public class SeaExportService : ISeaExportService
return subhtml;
}
#region 运踪相关
/// <summary>
/// 发起运踪订阅或者更新提单号
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task<DataResult<string>> SendOrUpdateTrace(List<BillTraceReq> req)
{
if (req.Count == 0)
{
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
}
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userKey").First().Value;
var userPwd = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userPwd").First().Value;
var userId = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userId").First().Value;
var reqUrl = db.Queryable<SysConfig>().Where(x => x.Code == "request_seae_billtraceurl").First().Value;
var resUrl = db.Queryable<SysConfig>().Where(x => x.Code == "response_seae_billtraceurl").First().Value;
BillTraceMain billdto = new BillTraceMain();
List<BillTraceReq> billTraceList = new List<BillTraceReq>();
foreach (var item in req)
{
if (!string.IsNullOrWhiteSpace(item.CARRIERID))
{
var et = await tenantDb.Queryable<BookingStatus>().Where(x => x.StatusCode == "status_mudigang" && x.BusinessId == Convert.ToInt64(item.BusinessId)).FirstAsync();
if (et != null)
{
return await Task.FromResult(DataResult<string>.Failed("\"提单号\" + item.MBLNO + \"已订阅!"));
}
}
if (!string.IsNullOrWhiteSpace(item.YardCode))
{
var et = await tenantDb.Queryable<BookingStatus>().Where(x => x.StatusCode == "status_qiyungang" && x.BusinessId == Convert.ToInt64(item.BusinessId)).FirstAsync();
if (et != null)
{
return await Task.FromResult(DataResult<string>.Failed("\"提单号\" + item.MBLNO + \"已订阅!"));
}
}
if (item.isBook && (string.IsNullOrWhiteSpace(item.CARRIERID) || string.IsNullOrWhiteSpace(item.CARRIER) || string.IsNullOrWhiteSpace(item.MBLNO)))
{
return await Task.FromResult(DataResult<string>.Failed("订阅目的港船公司或提单号不能为空!"));
}
if (!item.isBook && (string.IsNullOrWhiteSpace(item.YARD) || string.IsNullOrWhiteSpace(item.YardCode) || string.IsNullOrWhiteSpace(item.MBLNO)))
{
return await Task.FromResult(DataResult<string>.Failed("订阅港前数据提单号或场站不能为空!"));
}
var yardMap = tenantDb.Queryable<MappingYard>().Where(x => x.Code == item.YardCode && x.Module == "BillTrace").First();
if (yardMap.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed($"场站代号配置未找到:{item.YardCode}"));
}
billTraceList.Add(new BillTraceReq
{
BusinessId = item.BusinessId,
MBLNO = item.MBLNO,
YARD = item.YARD == "" ? null : item.YARD,
YardCode = yardMap.MapCode == "" ? null : yardMap.MapCode,
CARRIER = item.CARRIER == "" ? null : item.CARRIER,
CARRIERID = item.CARRIERID == "" ? null : item.CARRIERID,
isBook = item.isBook
});
var status = string.Empty;
var IsBookingYZ = String.Empty;
if (!string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID))
{
status = "订阅起运港,目的港";
IsBookingYZ = "3";
}
else if (string.IsNullOrWhiteSpace(item.YardCode) && !string.IsNullOrWhiteSpace(item.CARRIERID))
{
status = "订阅目的港";
IsBookingYZ = "2";
}
else if (!string.IsNullOrWhiteSpace(item.YardCode) && string.IsNullOrWhiteSpace(item.CARRIERID))
{
status = "订阅起运港";
IsBookingYZ = "1";
}
else
{
IsBookingYZ = "0";
}
//TODO 添加booking日志
//更新运踪标识
var info = tenantDb.Queryable<SeaExport>().First(x => x.Id == Convert.ToInt64(item.BusinessId));
info.IsBookingYZ = IsBookingYZ;
await tenantDb.Updateable(info).ExecuteCommandAsync();
}
billdto.Children = billTraceList;
billdto.Key = userKey;
billdto.PWD = userPwd;
billdto.url = resUrl;
billdto.Gid = userId;
var json = billdto.ToJsonString();
if (!reqUrl.EndsWith("/"))
{
reqUrl += "/";
}
reqUrl += "BillTrace/UpdateMblno";
var result = RequestHelper.Post(json, reqUrl);
var res = JsonConvert.DeserializeObject<BillTraceRes>(result);
if (!res.Success)
{
return await Task.FromResult(DataResult<string>.Failed($"发起运踪订阅或者更新提单号失败:{res.Message}"));
}
else
{
return await Task.FromResult(DataResult<string>.Success(res.Data));
}
}
/// <summary>
/// 运踪退订
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task<DataResult<string>> UnsubscribeBillTrace(List<BillTraceUnsubscribeList> req)
{
if (req.Count == 0)
{
return await Task.FromResult(DataResult<string>.Failed("未传入正确参数!"));
}
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var userKey = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userKey").First().Value;
var userPwd = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userPwd").First().Value;
var userId = db.Queryable<SysConfig>().Where(x => x.Code == "seae_billtraceurl_userId").First().Value;
var reqUrl = db.Queryable<SysConfig>().Where(x => x.Code == "request_seae_billtraceurl").First().Value;
var resUrl = db.Queryable<SysConfig>().Where(x => x.Code == "response_seae_billtraceurl").First().Value;
BillTraceUnsubscribeDto reqDto = new BillTraceUnsubscribeDto()
{
Children = new List<BillTraceUnsubscribeList>(),
Key = userKey,
PWD = userPwd,
Gid = userId
};
foreach (var item in req)
{
if (string.IsNullOrEmpty(item.BusinessId))
{
return await Task.FromResult(DataResult<string>.Failed("订舱记录主键不能为空!!"));
}
reqDto.Children.Add(new BillTraceUnsubscribeList(item.BusinessId, item.MBLNO));
//TODO 添加booking日志
//更新运踪标识
var info = tenantDb.Queryable<SeaExport>().First(x => x.Id == Convert.ToInt64(item.BusinessId));
info.IsBookingYZ = "0";
await tenantDb.Updateable(info).ExecuteCommandAsync();
}
var json = reqDto.ToJsonString();
if (!reqUrl.EndsWith("/"))
{
reqUrl += "/";
}
reqUrl += "BillTrace/UnsubscribeBillTrace";
var result = RequestHelper.Post(json, reqUrl);
var res = JsonConvert.DeserializeObject<BillTraceRes>(result);
if (!res.Success)
{
return await Task.FromResult(DataResult<string>.Failed($"运踪退订失败:{res.Message}"));
}
else
{
return await Task.FromResult(DataResult<string>.Success(res.Data));
}
}
#endregion
}

@ -0,0 +1,67 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 订舱货物状态管理 服务
/// </summary>
public class BookingGoodsStatusConfigController : ApiController
{
private readonly IBookingGoodsStatusConfigService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public BookingGoodsStatusConfigController(IBookingGoodsStatusConfigService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBookingGoodsStatusConfigList")]
public DataResult<List<BookingGoodsStatusConfigRes>> GetBookingGoodsStatusConfigList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditBookingGoodsStatusConfig")]
public DataResult EditBookingGoodsStatusConfig([FromBody] BookingGoodsStatusConfigReq model)
{
var res = _invokeService.EditBookingGoodsStatusConfig(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetBookingGoodsStatusConfigInfo")]
public DataResult<BookingGoodsStatusConfigRes> GetBookingGoodsStatusConfigInfo([FromQuery] string id)
{
var res = _invokeService.GetBookingGoodsStatusConfigInfo(id);
return res;
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Dtos;
@ -74,5 +75,16 @@ public class ColumnSetController : ApiController
var res = _invokeService.GetColumnSetInfoByModule(permissionId, columnNo);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req">req</param>
/// <returns></returns>
[HttpGet]
[Route("BatchDelColumnSet")]
public DataResult BatchDelColumnSet([FromBody] IdModel req)
{
var res = _invokeService.BatchDelColumnSet(req);
return res;
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Dtos;
@ -61,4 +62,16 @@ public class FormCopyController : ApiController
var res = _invokeService.GetFormCopyInfo(id);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req">req</param>
/// <returns></returns>
[HttpGet]
[Route("BatchDelFormCopy")]
public DataResult BatchDelFormCopy([FromBody] IdModel req)
{
var res = _invokeService.BatchDelFormCopy(req);
return res;
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Dtos;
@ -74,5 +75,16 @@ public class FormSetController : ApiController
var res = _invokeService.GetFormSetInfoByModule(permissionId, formNo);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req">req</param>
/// <returns></returns>
[HttpGet]
[Route("BatchDelFormSet")]
public DataResult BatchDelFormSet([FromBody] IdModel req)
{
var res = _invokeService.BatchDelFormSet(req);
return res;
}
}

@ -1,4 +1,5 @@
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.System.Dtos;
@ -75,16 +76,29 @@ public class QuerySetController : ApiController
}
///// <summary>
///// 删除
///// </summary>
///// <param name="id">Id</param>
///// <returns></returns>
//[HttpGet]
//[Route("DelQuerySet")]
//public DataResult DelQuerySet([FromQuery] string id)
//{
// var res = _invokeService.DelQuerySet(id);
// return res;
//}
/// <summary>
/// 删除
/// 批量删除
/// </summary>
/// <param name="id">Id</param>
/// <param name="req">req</param>
/// <returns></returns>
[HttpGet]
[Route("DelQuerySet")]
public DataResult DelQuerySet([FromQuery] string id)
[Route("BatchDelQuerySet")]
public DataResult BatchDelQuerySet([FromBody]IdModel req)
{
var res = _invokeService.DelQuerySet(id);
var res = _invokeService.BatchDelQuerySet(req);
return res;
}

@ -0,0 +1,37 @@
using DS.Module.Core;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 数据回调-服务
/// </summary>
public class DataCallBackController : ApiController
{
private readonly IDataCallBackService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public DataCallBackController(IDataCallBackService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 插入货运动态
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("AddBookingStatusLog")]
public async Task AddBookingStatusLog([FromBody]List<BookingStatusLogReq> req)
{
await _invokeService.AddBookingStatusLog(req);
}
}
}

@ -7,6 +7,7 @@ using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Interface;
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Ocsp;
namespace DS.WMS.OpApi.Controllers;
@ -113,5 +114,32 @@ public class SeaExportController : ApiController
public async Task<DataResult<string>> GetYardData([FromQuery] string id, bool isWeb = false)
{
return await _invokeService.GetYardData(id, isWeb);
}
}
/// <summary>
/// 发起运踪订阅或者更新提单号
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SendOrUpdateTrace")]
public async Task<DataResult<string>> SendOrUpdateTrace([FromBody]List<BillTraceReq> req)
{
return await _invokeService.SendOrUpdateTrace(req);
}
/// <summary>
/// 运踪退订
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("UnsubscribeBillTrace")]
public async Task<DataResult<string>> UnsubscribeBillTrace([FromBody]List<BillTraceUnsubscribeList> req)
{
return await _invokeService.UnsubscribeBillTrace(req);
}
}
Loading…
Cancel
Save