提单历史引入及相关修改

usertest
cjy 5 months ago
parent cf26578add
commit 6fdb2317a4

@ -0,0 +1,110 @@
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 BillManageHistoryListRes
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary>
/// 分提单号
/// </summary>
public string HBLNO { get; set; }
/// <summary>
/// 船名 t_code_vessel
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 船名Id t_code_vessel
/// </summary>
public long VesselId { get; set; }
/// <summary>
/// 航次
/// </summary>
public string Voyno { get; set; }
/// <summary>
/// 开船日期
/// </summary>
public DateTime? ETD { get; set; }
/// <summary>
/// 装货港代码
/// </summary>
public long LoadPortId { get; set; }
/// <summary>
/// 装货港
/// </summary>
public string LoadPort { get; set; }
/// <summary>
/// 卸货港代码
/// </summary>
public long DischargePortId { get; set; }
/// <summary>
/// 卸货港
/// </summary>
public string DischargePort { get; set; }
/// <summary>
/// 发货人 t_info_client CUSTNAME
/// </summary>
public long? ShipperId { get; set; }
/// <summary>
/// 发货人内容
/// </summary>
public string ShipperContent { get; set; }
/// <summary>
/// 收货人 t_info_client CUSTNAME
/// </summary>
public long? ConsigneeId { get; set; }
/// <summary>
/// 收货人内容
/// </summary>
public string ConsigneeContent { get; set; }
/// <summary>
/// 代理人 t_info_client CUSTNAME
/// </summary>
public long? AgentId { get; set; }
/// <summary>
/// 代理人内容
/// </summary>
public string AgentContent { get; set; }
/// <summary>
/// 录入日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 录入人Id
/// </summary>
public long CreateBy { get; set; }
/// <summary>
/// 录入人
/// </summary>
public string CreateByName { get; set; }
}
}

@ -46,6 +46,10 @@ namespace DS.WMS.Core.Op.Dtos
} }
public class BookingStatusLogDetailDto public class BookingStatusLogDetailDto
{ {
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary> /// <summary>
/// 主单id /// 主单id
/// </summary> /// </summary>

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Dtos
{
/// <summary>
/// 货运动态
/// </summary>
public class BookingStatusLogRes
{
public long Id { get; set; }
/// <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; }
public List<BookingStatusLogDetailDto> detail { get; set; }
}
}

@ -36,10 +36,10 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary> /// </summary>
public string HBLNO { get; set; } public string HBLNO { get; set; }
/// <summary> ///// <summary>
/// 模板Id ///// 模板Id
/// </summary> ///// </summary>
public long TemplateId { get; set; } //public long TemplateId { get; set; }
/// <summary> /// <summary>
/// 提单类型 /// 提单类型

@ -21,16 +21,19 @@ namespace DS.WMS.Core.Op.Dtos
/// 业务Id /// 业务Id
/// </summary> /// </summary>
public long BusinessId { get; set; } public long BusinessId { get; set; }
/// <summary>
/// 主提单号
/// </summary>
public string MBLNO { get; set; }
/// <summary> /// <summary>
/// 分提单号 /// 分提单号
/// </summary> /// </summary>
public string HBLNO { get; set; } public string HBLNO { get; set; }
/// <summary> ///// <summary>
/// 模板Id ///// 模板Id
/// </summary> ///// </summary>
public long TemplateId { get; set; } //public long TemplateId { get; set; }
/// <summary> /// <summary>
/// 提单类型 /// 提单类型

@ -1325,4 +1325,23 @@ public class SeaExport : BaseOrgModel<long>
/// </summary> /// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "车队联系人Id", IsNullable = false, DefaultValue = "0")] [SqlSugar.SugarColumn(ColumnDescription = "车队联系人Id", IsNullable = false, DefaultValue = "0")]
public long CarrierContactId { get; set; } public long CarrierContactId { get; set; }
/// <summary>
/// 云港通ETD
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "云港通ETD", IsNullable = true)]
public DateTime? YgtETD { get; set; }
/// <summary>
/// StartATA
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "StartATA", IsNullable = true)]
public DateTime? StartATA { get; set; }
/// <summary>
/// StartETA
/// </summary>
[SqlSugar.SugarColumn(ColumnDescription = "StartETA", IsNullable = true)]
public DateTime? StartETA { get; set; }
} }

@ -29,11 +29,11 @@ public class SeaExportBillManage : BaseOrgModel<long>
[SqlSugar.SugarColumn(ColumnDescription = "分提单号", IsNullable = true, Length = 30)] [SqlSugar.SugarColumn(ColumnDescription = "分提单号", IsNullable = true, Length = 30)]
public string HBLNO { get; set; } public string HBLNO { get; set; }
/// <summary> ///// <summary>
/// 模板Id ///// 模板Id
/// </summary> ///// </summary>
[SugarColumn(ColumnDescription = "模板Id")] //[SugarColumn(ColumnDescription = "模板Id")]
public long TemplateId { get; set; } //public long TemplateId { get; set; }
/// <summary> /// <summary>
/// 提单类型 /// 提单类型

@ -56,5 +56,19 @@ namespace DS.WMS.Core.Op.Interface
/// <param name="req">主表Id及箱信息Ids</param> /// <param name="req">主表Id及箱信息Ids</param>
/// <returns></returns> /// <returns></returns>
public DataResult BatchDelBillManageCtn(IdModel req); public DataResult BatchDelBillManageCtn(IdModel req);
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList(PageRequest request);
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
public Task<DataResult> ImportBillManageHistory(IdModel req);
} }
} }

@ -174,4 +174,12 @@ public interface ISeaExportService
/// <returns></returns> /// <returns></returns>
public Task<DataResult<RuleEngineResult>> ExcuteRuleEngine(string id); public Task<DataResult<RuleEngineResult>> ExcuteRuleEngine(string id);
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request);
} }

@ -371,42 +371,42 @@ namespace DS.WMS.Core.Op.Method
// } // }
//} //}
} }
//else if (item.Status == "ETD") else if (item.Status == "ETD")
//{ {
// if (order != null && item.OpTime != null && order.YgtETD != item.OpTime) if (order != null && item.OpTime != null && order.YgtETD != item.OpTime)
// { {
// order.YgtETD = item.OpTime; order.YgtETD = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new await tenantDb.Updateable(order).UpdateColumns(x => new
// { {
// x.YgtETD x.YgtETD
// }).EnableDiffLogEvent().ExecuteCommandAsync(); }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// } }
//} }
//else if (item.Status == "ATA") else if (item.Status == "ATA")
//{ {
// if (order != null && item.OpTime != null && order.StartATA != item.OpTime) if (order != null && item.OpTime != null && order.StartATA != item.OpTime)
// { {
// order.StartATA = item.OpTime; order.StartATA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new await tenantDb.Updateable(order).UpdateColumns(x => new
// { {
// x.StartATA x.StartATA
// }).EnableDiffLogEvent().ExecuteCommandAsync(); }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// } }
//} }
//else if (item.Status == "ETA") else if (item.Status == "ETA")
//{ {
// if (order != null && item.OpTime != null && order.StartETA != item.OpTime) if (order != null && item.OpTime != null && order.StartETA != item.OpTime)
// { {
// order.StartETA = item.OpTime; order.StartETA = item.OpTime;
// await tenantDb.Updateable(order).UpdateColumns(x => new await tenantDb.Updateable(order).UpdateColumns(x => new
// { {
// x.StartETA x.StartETA
// }).EnableDiffLogEvent().ExecuteCommandAsync(); }).EnableDiffLogEvent().ExecuteCommandAsync();
// //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期"); //await _bookingorderservice.SaveLog(newOrder, oldOrder, "运踪更新船期");
// } }
//} }
else if (item.Status == "MDGETA") else if (item.Status == "MDGETA")
{ {
if (order != null && item.OpTime != null && order.ETA != item.OpTime) if (order != null && item.OpTime != null && order.ETA != item.OpTime)

@ -14,6 +14,10 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DS.Module.Core.Data; using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Entity;
using Microsoft.AspNet.SignalR.Hubs;
namespace DS.WMS.Core.Op.Method namespace DS.WMS.Core.Op.Method
{ {
@ -175,5 +179,76 @@ namespace DS.WMS.Core.Op.Method
} }
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
} }
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var users = db.Queryable<SysUser>().Select(x => new { x.Id, x.UserName }).ToList();
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var data = tenantDb.Queryable<SeaExportBillManage>()
.Where(whereList)
.Select<BillManageHistoryListRes>()
.Mapper(it =>
{
it.CreateByName = users.Find(x => x.Id == it.CreateBy).UserName;
})
.ToQueryPage(request.PageCondition);
return data;
}
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
public async Task<DataResult> ImportBillManageHistory(IdModel req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = await tenantDb.Queryable<SeaExport>().Where(x => x.Id ==long.Parse(req.Id)).FirstAsync();
if (info.IsNull())
return await Task.FromResult(DataResult.Failed("不存在的海运出口信息!", MultiLanguageConst.SeaExportExist));
if (!tenantDb.Queryable<SeaExportBillManage>().Where(x => req.Ids.Contains(x.Id)).Any())
return DataResult.Failed("提单信息不存在", MultiLanguageConst.ShippingBillManageNotExist);
var list = await tenantDb.Queryable<SeaExportBillManage>().Where(x => req.Ids.Contains(x.Id)).ToListAsync();
var newList = new List<SeaExportBillManage>();
foreach (var item in list)
{
var temp = new SeaExportBillManage()
{
BusinessId = long.Parse(req.Id),
ShipperContent = item.ShipperContent,
ShipperCode = item.ShipperCode,
ShipperCountry = item.ShipperCountry,
ShipperEmail = item.ShipperEmail,
ShipperTel = item.ShipperTel,
ConsigneeContent = item.ConsigneeContent,
ConsigneeCode = item.ConsigneeCode,
ConsigneeCountry = item.ConsigneeCountry,
ConsigneeEmail = item.ConsigneeEmail,
ConsigneeTel = item.ConsigneeTel,
NotifyPartyContent = item.NotifyPartyContent,
NotifyPartyCode = item.NotifyPartyCode,
NotifyPartyCountry = item.NotifyPartyCountry,
NotifyPartyEmail = item.NotifyPartyEmail,
NotifyPartyTel = item.NotifyPartyTel,
Marks = item.Marks,
Description = item.Description,
};
newList.Add(temp);
}
await tenantDb.Insertable(newList).ExecuteCommandAsync();
return await Task.FromResult(DataResult.Successed("导入成功",MultiLanguageConst.DataImportSuccess));
}
} }
} }

@ -806,6 +806,9 @@ public partial class SeaExportService : ISeaExportService
} }
#region 删除 #region 删除
@ -1018,4 +1021,25 @@ public partial class SeaExportService : ISeaExportService
return entity; return entity;
} }
#endregion #endregion
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var result = await tenantDb.Queryable<BookingStatusLog>()
.Select<BookingStatusLogRes>()
.Mapper(async it =>
{
it.detail = await tenantDb.Queryable<BookingStatusLogDetail>().Where(x => x.PId == it.Id).Select<BookingStatusLogDetailDto>().ToListAsync();
}
).Where(whereList).ToQueryPageAsync(request.PageCondition);
return result;
}
} }

@ -100,4 +100,31 @@ public class SeaExportBillManageController : ApiController
var res = _invokeService.BatchDelBillManageCtn(req); var res = _invokeService.BatchDelBillManageCtn(req);
return res; return res;
} }
/// <summary>
/// 历史引入查询列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBillManageHistoryList")]
public DataResult<List<BillManageHistoryListRes>> GetBillManageHistoryList([FromBody] PageRequest request)
{
var res = _invokeService.GetBillManageHistoryList(request);
return res;
}
/// <summary>
/// 历史引入提单信息
/// </summary>
/// <param name="req">主表Id及历史提单Ids</param>
/// <returns></returns>
[HttpPost]
[Route("ImportBillManageHistory")]
public async Task<DataResult> ImportBillManageHistory([FromBody] IdModel req)
{
var res = await _invokeService.ImportBillManageHistory(req);
return res;
}
} }

@ -402,4 +402,18 @@ public class SeaExportController : ApiController
{ {
return await _invokeService.ExcuteRuleEngine(id); return await _invokeService.ExcuteRuleEngine(id);
} }
/// <summary>
/// 订单及货运动态
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetBookingStatusLogList")]
public async Task<DataResult<List<BookingStatusLogRes>>> GetBookingStatusLogList([FromBody] PageRequest request)
{
var res = await _invokeService.GetBookingStatusLogList(request);
return res;
}
} }
Loading…
Cancel
Save