wet 1 year ago
commit 8606441a02

@ -124,6 +124,16 @@ namespace Myshipping.Application.EDI
{ {
return new KeyValuePair<bool, string>(false, "中创站代码未配置"); return new KeyValuePair<bool, string>(false, "中创站代码未配置");
} }
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
#region 港联捷场站 #region 港联捷场站
if (order.YARDID == yardCodeGLJ.Value) if (order.YARDID == yardCodeGLJ.Value)
@ -162,14 +172,6 @@ namespace Myshipping.Application.EDI
StringBuilder sbData = new StringBuilder(); StringBuilder sbData = new StringBuilder();
sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次 sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
// 12:提单号:中转港:目的港:货代代码:船公司:HPL参考号:特殊说明 // 12:提单号:中转港:目的港:货代代码:船公司:HPL参考号:特殊说明
sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{ExchangeStr(order.YARDREMARK)}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注 sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLJ")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{ExchangeStr(order.YARDREMARK)}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注
//2021-8-17报文中不能体现英文字符①【:】②【,】,以空格代替 //2021-8-17报文中不能体现英文字符①【:】②【,】,以空格代替
@ -511,7 +513,7 @@ namespace Myshipping.Application.EDI
listJoinStr.Add("00:IFCSUM:BK:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyyyMMddHHmm") + ":2.1'"); listJoinStr.Add("00:IFCSUM:BK:" + filerole + ":" + ftpset.SENDCODE + ":" + ftpset.RECEIVECODE + ":" + DateTime.Now.ToString("yyyyMMddHHmm") + ":2.1'");
//提单号 //提单号
listJoinStr.Add("02:" + order.Id.ToString() + ":" + order.MBLNO.Trim() + ":" + order.SERVICE + ":" + ftpset.SENDNAME + ":" + ftpset.RECEIVECODE + "::::::::::" + order.CONTRACTNO + "::'"); listJoinStr.Add("02:" + order.Id.ToString() + ":" + order.MBLNO.Trim() + ":" + order.SERVICE + ":" + ftpset.SENDNAME + ":" + ftpset.RECEIVECODE + "::::::::::" + order.CONTRACTNO + ":" + (order.CARRIERID == hlcCode ? order.CUSTNO : "") + ":'");
//提单地址 //提单地址
var ISSUETYPE = ""; var ISSUETYPE = "";
@ -757,15 +759,6 @@ namespace Myshipping.Application.EDI
StringBuilder sbData = new StringBuilder(); StringBuilder sbData = new StringBuilder();
sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次 sbData.AppendLine($"01:{order.VESSEL}:{order.VOYNO}"); //船名 航次
//针对和川这种公共库不同的船司代码,需要匹配转换为当前的船司代码才能逻辑判断
var hlcCode = "HLC";
var mapCodeHLC = mappingCarrierLetterYard.FirstOrDefault(x => x.MapCode == "HLC");
if (mapCodeHLC != null)
{
hlcCode = mapCodeHLC.Code;
}
sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLX")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{order.PORTDISCHARGE}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注 sbData.AppendLine($"12:{order.MBLNO}:{order.TRANSPORTID}:{order.PORTDISCHARGEID}:{paraXHZ.ItemCode}:{GetCarrierEDICode(order.CARRIERID, "XHZ_GLX")}:{(order.CARRIERID == hlcCode ? order.CUSTNO : "")}:{order.PORTDISCHARGE}"); //主提单 中转港代码 目的港代码 货代代码 船公司 HPL参考号 备注
var despStr = ExchangeStr(order.DESCRIPTION.Replace(":", " ").Replace(",", " ")).Replace("\r\n", " ").Replace("\n", " "); var despStr = ExchangeStr(order.DESCRIPTION.Replace(":", " ").Replace(",", " ")).Replace("\r\n", " ").Replace("\n", " ");
if (despStr.Length > 100) if (despStr.Length > 100)

@ -13,7 +13,7 @@ namespace Myshipping.Application.Entity
/// </summary> /// </summary>
[SugarTable("booking_auto_yard_import")] [SugarTable("booking_auto_yard_import")]
[Description("场站自动引入信息")] [Description("场站自动引入信息")]
public class Booking_AutoYardImport public class BookingAutoYardImport
{ {
/// <summary> /// <summary>
/// 主键 /// 主键
@ -40,5 +40,21 @@ namespace Myshipping.Application.Entity
/// 比对数据时填写的箱信息JSON /// 比对数据时填写的箱信息JSON
/// </summary> /// </summary>
public string CtnJson { get; set; } public string CtnJson { get; set; }
/// <summary>
/// 只读标志
/// </summary>
public bool IsRead { get; set; }
/// <summary>
/// 读取时间
/// </summary>
public DateTime? ReadTime { get; set; }
/// <summary>
/// 读取人
/// </summary>
public string ReadUser { get; set; }
} }
} }

@ -129,7 +129,7 @@ namespace Myshipping.Application
private readonly IBookingGoodsStatusConfigService _GoodsConfig; private readonly IBookingGoodsStatusConfigService _GoodsConfig;
private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig; private readonly SqlSugarRepository<BookingLineOpMgrConfig> _repLineOpMgrConfig;
private readonly SqlSugarRepository<SysEmp> _repSysEmp; private readonly SqlSugarRepository<SysEmp> _repSysEmp;
private readonly SqlSugarRepository<Booking_AutoYardImport> _repAutoYard; private readonly SqlSugarRepository<BookingAutoYardImport> _repAutoYard;
private readonly SqlSugarRepository<BookingExtendState> _repextendstate; private readonly SqlSugarRepository<BookingExtendState> _repextendstate;
@ -156,7 +156,7 @@ namespace Myshipping.Application
SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig, SqlSugarRepository<BookingExcelTemplate> excelrep, SqlSugarRepository<DjyUserMailAccount> repUserMail, SqlSugarRepository<BookingGoodsStatus> goodsStatus, SqlSugarRepository<BookingGoodsStatusConfig> goodsStatusConfig,
SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem, SqlSugarRepository<SysTenant> repTenant, SqlSugarRepository<BookingStatus> repBookingStatus, SqlSugarRepository<BookingEDIExt> bookingEDIExt, SqlSugarRepository<BookingServiceItem> serviceItem,
SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository, SqlSugarRepository<ParaContractNoInfo> paraContractNoInfoRepository, IHttpContextAccessor httpContextAccessor, IBookingGoodsStatusConfigService GoodsConfig, SqlSugarRepository<DjyWebsiteAccountConfig> djyWebsiteAccountConfigRepository,
ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp, SqlSugarRepository<Booking_AutoYardImport> repAutoYard, ISysOrgService orgService, SqlSugarRepository<BookingLineOpMgrConfig> repLineOpMgrConfig, SqlSugarRepository<SysEmp> repSysEmp, SqlSugarRepository<BookingAutoYardImport> repAutoYard,
IServiceWorkFlowManageService serviceWorkFlowManageService) IServiceWorkFlowManageService serviceWorkFlowManageService)
{ {
this._logger = logger; this._logger = logger;
@ -453,7 +453,7 @@ namespace Myshipping.Application
var itgoodsStatus = new List<ITGoodsStatusDto>(); var itgoodsStatus = new List<ITGoodsStatusDto>();
var itconfigs = new List<ITConfigsDto>(); var itconfigs = new List<ITConfigsDto>();
List <ServiceProjectStatusDto> statusList = new List<ServiceProjectStatusDto>(); List<ServiceProjectStatusDto> statusList = new List<ServiceProjectStatusDto>();
if (App.Configuration["ServiceStatusOpenAuto"] == "1") if (App.Configuration["ServiceStatusOpenAuto"] == "1")
{ {
QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch QueryServiceProjectWithStatusBatch batchQuery = new QueryServiceProjectWithStatusBatch
@ -596,9 +596,9 @@ namespace Myshipping.Application
{ {
var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList(); var currStatusList = statusList.Where(a => long.Parse(a.BusiId) == item.Id).ToList();
if(currStatusList.Count > 0) if (currStatusList.Count > 0)
{ {
if(currStatusList.Any(a=>a.StatusSKUCode.Equals("YFVGM",StringComparison.OrdinalIgnoreCase) && a.IsYield)) if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield))
{ {
item.IsVGM = currStatusList.FirstOrDefault(a => item.IsVGM = currStatusList.FirstOrDefault(a =>
a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value;
@ -616,15 +616,15 @@ namespace Myshipping.Application
item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo) item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo)
.Select(a => new GoodsStatusList .Select(a => new GoodsStatusList
{ {
FinishTime = a.ActDate, FinishTime = a.ActDate,
IsLast = a.IsEnd, IsLast = a.IsEnd,
Sort = a.ActSortNo, Sort = a.ActSortNo,
StatusName = a.ShowName, StatusName = a.ShowName,
SystemCode = a.StatusSKUCode, SystemCode = a.StatusSKUCode,
ExtData = !string.IsNullOrWhiteSpace(a.ActVal)? a.ActVal:string.Empty, ExtData = !string.IsNullOrWhiteSpace(a.ActVal) ? a.ActVal : string.Empty,
Remark = !string.IsNullOrWhiteSpace(a.ActRemark)? a.ActRemark:string.Empty Remark = !string.IsNullOrWhiteSpace(a.ActRemark) ? a.ActRemark : string.Empty
}).ToList(); }).ToList();
} }
else else
{ {
@ -906,9 +906,9 @@ namespace Myshipping.Application
var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync(); var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync();
var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true); var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true);
_logger.LogInformation("保存权限范围:"+rightlist.ToJsonString()); _logger.LogInformation("保存权限范围:" + rightlist.ToJsonString());
//除现有配置权限外 操作和本人具有编辑权限 //除现有配置权限外 操作和本人具有编辑权限
if (rightlist!=null&&!( if (rightlist != null && !(
mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString() || mlist.OPID == UserManager.UserId.ToString() || mlist.OP == UserManager.Name.ToString() ||
mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() || mlist.DOCID == UserManager.UserId.ToString() || mlist.DOC == UserManager.Name.ToString() ||
mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.CUSTSERVICE == UserManager.Name.ToString() || mlist.CUSTSERVICEID == UserManager.UserId.ToString() || mlist.CUSTSERVICE == UserManager.Name.ToString() ||
@ -7929,12 +7929,15 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
} }
_logger.LogInformation($"{bookId}({order.MBLNO})的箱封号自动引入完成"); _logger.LogInformation($"{bookId}({order.MBLNO})的箱封号自动引入完成");
}
//写入提示
await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson());
//写入提示
await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson());
}
else
{
//写入提示
await SaveAutoYardData(bookId, true, $"已自动引入", ctns.ToJson(), rtn.ToJson(), read: true);
}
} }
} }
@ -7943,17 +7946,23 @@ HLCUTA12307DPXJ3 以这票为例 6个柜
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[NonAction] [NonAction]
private async Task SaveAutoYardData(long bookId, bool success, string content, string ctnJson, string yardJson) private async Task SaveAutoYardData(long bookId, bool success, string content, string ctnJson, string yardJson, bool read = false)
{ {
await _repAutoYard.DeleteAsync(x => x.Id == bookId); await _repAutoYard.DeleteAsync(x => x.Id == bookId);
//写入提示 //写入提示
var autoYard = new Booking_AutoYardImport(); var autoYard = new BookingAutoYardImport();
autoYard.Id = bookId; autoYard.Id = bookId;
autoYard.Status = success ? "已导入" : "未导入"; autoYard.Status = success ? "已导入" : "未导入";
autoYard.Content = content; autoYard.Content = content;
autoYard.CtnJson = ctnJson; autoYard.CtnJson = ctnJson;
autoYard.YardJson = yardJson; autoYard.YardJson = yardJson;
if (read) //未开启自动写入的用户,自动已读
{
autoYard.IsRead = true;
autoYard.ReadTime = DateTime.Now;
autoYard.ReadUser = "系统";
}
await _repAutoYard.InsertAsync(autoYard); await _repAutoYard.InsertAsync(autoYard);
} }

@ -627,6 +627,40 @@ namespace Myshipping.Application
}); });
} }
/*
2023-08-14
+
*/
var lastBookingTruckModel = _bookingTruckRepository.AsQueryable()
.Where(a => a.BookingId == bookingId && !a.IsDeleted)
.OrderBy(a => a.CreatedTime).First();
if (lastBookingTruckModel != null)
{
if (lastBookingTruckModel.KGS.HasValue)
model.KGS = lastBookingTruckModel.KGS;
if(!string.IsNullOrWhiteSpace(lastBookingTruckModel.PayMethod))
model.PayMethod = lastBookingTruckModel.PayMethod;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.PayMethodName))
model.PayMethodName = lastBookingTruckModel.PayMethodName;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.Remark))
model.Remark = lastBookingTruckModel.Remark;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.FactoryContact))
model.FactoryContact = lastBookingTruckModel.FactoryContact;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.FactoryAddr))
model.FactoryAddr = lastBookingTruckModel.FactoryAddr;
if (!string.IsNullOrWhiteSpace(lastBookingTruckModel.FactoryName))
model.FactoryName = lastBookingTruckModel.FactoryName;
}
return model; return model;
} }
@ -980,9 +1014,10 @@ namespace Myshipping.Application
/// 撤销派车 /// 撤销派车
/// </summary> /// </summary>
/// <param name="id">派车主键</param> /// <param name="id">派车主键</param>
/// <param name="isAfterDelete">是否撤销后自动删除 true-删除 false-不删除</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
[HttpGet("/BookingTruck/Cancel")] [HttpGet("/BookingTruck/Cancel")]
public async Task<TaskManageOrderResultDto> Cancel(long id) public async Task<TaskManageOrderResultDto> Cancel([FromQuery]long id, [FromQuery] bool isAfterDelete = false)
{ {
/* /*
@ -1090,8 +1125,9 @@ namespace Myshipping.Application
/// </summary> /// </summary>
/// <param name="id">派车主键</param> /// <param name="id">派车主键</param>
/// <param name="batchNo">批次号</param> /// <param name="batchNo">批次号</param>
/// <param name="isAfterDelete">是否撤销后自动删除 true-删除 false-不删除</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
private async Task<TaskManageOrderResultDto> InnerCancel(long id, string batchNo) private async Task<TaskManageOrderResultDto> InnerCancel(long id, string batchNo,bool isAfterDelete = false)
{ {
/* /*
@ -1187,6 +1223,12 @@ namespace Myshipping.Application
model.UpdatedUserName = UserManager.Name; model.UpdatedUserName = UserManager.Name;
model.TaskNo = null; model.TaskNo = null;
//是否删除
if (isAfterDelete)
{
model.IsDeleted = true;
}
await _bookingTruckRepository.AsUpdateable(model).UpdateColumns(it => new await _bookingTruckRepository.AsUpdateable(model).UpdateColumns(it => new
{ {
it.Status, it.Status,
@ -1197,6 +1239,7 @@ namespace Myshipping.Application
}).ExecuteCommandAsync(); }).ExecuteCommandAsync();
result.succ = true; result.succ = true;
result.msg = "撤销成功"; result.msg = "撤销成功";
} }

@ -81,8 +81,9 @@ namespace Myshipping.Application
/// 撤销派车 /// 撤销派车
/// </summary> /// </summary>
/// <param name="id">派车主键</param> /// <param name="id">派车主键</param>
/// <param name="isAfterDelete">是否撤销后自动删除 true-删除 false-不删除</param>
/// <returns>返回回执</returns> /// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> Cancel(long id); Task<TaskManageOrderResultDto> Cancel(long id, bool isAfterDelete = false);
/// <summary> /// <summary>
/// 批量撤销派车 /// 批量撤销派车

Loading…
Cancel
Save