wet 2 years ago
commit 7ba4b91a45

@ -416,10 +416,14 @@ namespace Myshipping.Application.EDI.PIL
return error;
}
if (string.IsNullOrEmpty(bill.GOODSNAME))
//2023-04-14 经韩工查看东胜的PIL逻辑订舱时货物品名非必填这里判断改为只截单时提醒
if (InttrEdi.filetype.Equals("E", StringComparison.OrdinalIgnoreCase))
{
error = error + "<br />提单号:" + bill.MBLNO + "货物品名不能为空";
return error;
if (string.IsNullOrEmpty(bill.GOODSNAME))
{
error = error + "<br />提单号:" + bill.MBLNO + "货物品名不能为空";
return error;
}
}
if (string.IsNullOrEmpty(bill.PORTDISCHARGEID))

@ -118,6 +118,7 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<BookingTemplate> _bookingTemplate;
private readonly SqlSugarRepository<ParaGoodsInfo> _paraGoodsInfoRepository;
private readonly SqlSugarRepository<ParaContractNoInfo> _paraContractNoInfoRepository;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IBookingGoodsStatusConfigService _GoodsConfig;
const string CONST_MAPPING_MODULE = "BOOK_OR_CLOSING";
@ -4086,7 +4087,31 @@ namespace Myshipping.Application
primaryModel.OpTel = ediExtModel.OpTel;
primaryModel.OpEmail = ediExtModel.OpEmail;
primaryModel.GOODSNAME = ediExtModel.GoodsName;
/*
2023-04-14 ,EDIGOODS_CODE
PIL
//primaryModel.GOODSNAME = ediExtModel.GoodsName;
*/
if (ediRouteEnum == EDIRouteEnum.PIL && model.sendType.Equals("E", StringComparison.OrdinalIgnoreCase))
{
if (!string.IsNullOrWhiteSpace(order.GOODSCODE))
{
var pGoods = _paraGoodsInfoRepository.AsQueryable().First(x => x.GOODS_CODE == order.GOODSCODE);
if (pGoods == null)
{
_logger.LogInformation("批次={no} 提取商品名称失败 GOODSCODE={code}", batchNo, order.GOODSCODE);
throw Oops.Bah($"商品分类编码{order.GOODSCODE}对应商品名称未找到");
}
else
{
primaryModel.GOODSNAME = pGoods.GOODS_NAME_EN;
_logger.LogInformation("批次={no} 提取商品名称失败 code={code} name={name}", batchNo, order.GOODSCODE, pGoods.GOODS_NAME_EN);
}
}
}
primaryModel.cKHI = ediExtModel.CKHI;
primaryModel.cNCM = ediExtModel.CNCM;

@ -1,12 +1,252 @@
using System;
using Furion;
using Furion.DependencyInjection;
using Furion.DistributedIDGenerator;
using Furion.DynamicApiController;
using Furion.FriendlyException;
using Furion.JsonSerialization;
using Furion.RemoteRequest.Extensions;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core;
using Myshipping.Core.Entity;
using Myshipping.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
internal class BookingTruckService
/// <summary>
/// 派车服务
/// </summary>
[ApiDescriptionSettings("Application", Name = "BookingTruck", Order = 9)]
public class BookingTruckService : IBookingTruckService, IDynamicApiController, ITransient
{
private readonly ISysCacheService _cache;
private readonly ILogger<BookingTruckService> _logger;
private readonly SqlSugarRepository<BookingTruck> _bookingTruckRepository;
private readonly SqlSugarRepository<BookingTruckCtn> _bookingTruckContaRepository;
public BookingTruckService(ISysCacheService cache, ILogger<BookingTruckService> logger,
SqlSugarRepository<BookingTruck> bookingTruckRepository,
SqlSugarRepository<BookingTruckCtn> bookingTruckContaRepository)
{
_cache = cache;
_logger = logger;
_bookingTruckRepository = bookingTruckRepository;
_bookingTruckContaRepository = bookingTruckContaRepository;
}
/// <summary>
/// 保存派车
/// </summary>
/// <param name="info">派车信息</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> Save(BookingTruckDto info)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch(Exception ex)
{
}
return result;
}
/// <summary>
/// 提交派车
/// </summary>
/// <param name="info">派车信息</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> Submit(BookingTruckDto info)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 批量提交派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SubmitBatch(long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 撤销派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> Cancel(long id)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 批量撤销派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelBatch(long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 打印派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> Print(long id)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 批量派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> SendDispatchBatch(long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 取消派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelDispatch(long id)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
/// <summary>
/// 批量取消派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> CancelDispatchBatch(long[] ids)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
public async Task<TaskManageOrderResultDto> GetInfo(long id)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
}
catch (Exception ex)
{
}
return result;
}
}
}

@ -0,0 +1,24 @@
using Mapster;
using Myshipping.Application.EDI;
using Myshipping.Application.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Myshipping.Application
{
public class BookingTrucMapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<BookingTruck, BookingTruckDto>()
.Map(dest => dest.Id, src => src.Id)
.Map(dest => dest.BookingId, src => src.BookingId)
;
}
}
}

@ -1,12 +1,100 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
internal class BookingTruckCtnDto
/// <summary>
/// 集装箱
/// </summary>
public class BookingTruckCtnDto
{
/// <summary>
/// 箱型代码
/// </summary>
public string CTNCODE { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string CTNALL { get; set; }
/// <summary>
/// 箱量
/// </summary>
public Nullable<int> CTNNUM { get; set; }
/// <summary>
/// TEU
/// </summary>
public Nullable<int> TEU { get; set; }
/// <summary>
/// 箱号
/// </summary>
public string CNTRNO { get; set; }
/// <summary>
/// 封号
/// </summary>
public string SEALNO { get; set; }
/// <summary>
/// 件数
/// </summary>
public Nullable<int> PKGS { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KINDPKGS { get; set; }
/// <summary>
/// 毛重
/// </summary>
public Nullable<decimal> KGS { get; set; }
/// <summary>
/// 尺码
/// </summary>
public Nullable<decimal> CBM { get; set; }
/// <summary>
/// 皮重
/// </summary>
public Nullable<decimal> TAREWEIGHT { get; set; }
/// <summary>
/// 箱状态
/// </summary>
public string CTNSTATUS { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WEIGHTYPE { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WEIGHKGS { get; set; }
/// <summary>
/// 称重联系人
/// </summary>
public string WEIGHATTN { get; set; }
/// <summary>
/// VGM联系公司
/// </summary>
public string VGMCONNCOM { get; set; }
/// <summary>
/// VGM联系电话
/// </summary>
public string WEIGHTEL { get; set; }
/// <summary>
/// 称重日期
/// </summary>
public string WEIGHDATE { get; set; }
/// <summary>
/// VGM地址
/// </summary>
public string VGMADDR { get; set; }
/// <summary>
/// VGM邮箱
/// </summary>
public string VGMEMAIL { get; set; }
/// <summary>
/// 备注
/// </summary>
public string REMARK { get; set; }
}
}

@ -1,12 +1,180 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
internal class BookingTruckDto
/// <summary>
/// 派车信息
/// </summary>
public class BookingTruckDto
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BookingId { get; set; }
/// <summary>
/// 车队ID
/// </summary>
public Nullable<long> TruckId { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckCode { get; set; }
/// <summary>
/// 车队代码
/// </summary>
public string TruckName { get; set; }
/// <summary>
/// TO
/// </summary>
public string ToName { get; set; }
/// <summary>
/// ATTN
/// </summary>
public string Attn { get; set; }
/// <summary>
/// ATTN电话
/// </summary>
public string AttnTel { get; set; }
/// <summary>
/// ATTN邮箱
/// </summary>
public string AttnMail { get; set; }
/// <summary>
/// FROM
/// </summary>
public string FromName { get; set; }
/// <summary>
/// FROM电话
/// </summary>
public string FromTel { get; set; }
/// <summary>
/// FROM邮箱
/// </summary>
public string FromMail { get; set; }
/// <summary>
/// 吨数
/// </summary>
public Nullable<decimal> KGS { get; set; }
/// <summary>
/// 陆运费
/// </summary>
public Nullable<decimal> Fee { get; set; }
/// <summary>
/// 支付方式
/// </summary>
public string PayMethod { get; set; }
/// <summary>
/// 支付方式名称
/// </summary>
public string PayMethodName { get; set; }
/// <summary>
/// 派车日期
/// </summary>
public Nullable<DateTime> TruckTime { get; set; }
/// <summary>
/// 提箱场站ID
/// </summary>
public string YARDID { get; set; }
/// <summary>
/// 提箱场站
/// </summary>
public string YARD { get; set; }
/// <summary>
/// 场站联系人
/// </summary>
public string YARDCONTRACT { get; set; }
/// <summary>
/// 场站联系人电话
/// </summary>
public string YARDCONTRACTTEL { get; set; }
/// <summary>
/// 工厂ID
/// </summary>
public string FactoryId { get; set; }
/// <summary>
/// 工厂代码
/// </summary>
public string FactoryCode { get; set; }
/// <summary>
/// 工厂名称
/// </summary>
public string FactoryName { get; set; }
/// <summary>
/// 工厂联系人
/// </summary>
public string FactoryContact { get; set; }
/// <summary>
/// 工厂联系电话
/// </summary>
public string FactoryTel { get; set; }
/// <summary>
/// 返场时间
/// </summary>
public Nullable<DateTime> ReturnTime { get; set; }
/// <summary>
/// 入货场站ID
/// </summary>
public string InYardID { get; set; }
/// <summary>
/// 入货场站
/// </summary>
public string InYard { get; set; }
/// <summary>
/// 入货联系人
/// </summary>
public string InYardContact { get; set; }
/// <summary>
/// 入货联系人电话
/// </summary>
public string InYardContractTel { get; set; }
/// <summary>
/// 要求到达时间
/// </summary>
public Nullable<DateTime> NeedArriveTime { get; set; }
/// <summary>
/// 截港日期
/// </summary>
public Nullable<DateTime> ClosingTime { get; set; }
/// <summary>
/// 提货日期
/// </summary>
public Nullable<DateTime> PickUpTime { get; set; }
/// <summary>
/// 是否挂机
/// </summary>
public bool IsGuaJi { get; set; }
/// <summary>
/// 状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 注意事项
/// </summary>
public string Attention { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 调度ID
/// </summary>
public string DispatcherId { get; set; }
/// <summary>
/// 调度名称
/// </summary>
public string DispatcherName { get; set; }
/// <summary>
/// 集装箱列表
/// </summary>
public List<BookingTruckCtnDto> ContaList { get; set; }
}
}

@ -6,7 +6,79 @@ using System.Threading.Tasks;
namespace Myshipping.Application
{
internal interface IBookingTruckService
/// <summary>
///
/// </summary>
public interface IBookingTruckService
{
/// <summary>
/// 保存派车
/// </summary>
/// <param name="info">派车信息</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> Save(BookingTruckDto info);
/// <summary>
/// 获取派车详情
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> GetInfo(long id);
/// <summary>
/// 提交派车
/// </summary>
/// <param name="info">派车信息</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> Submit(BookingTruckDto info);
/// <summary>
/// 批量提交派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SubmitBatch(long[] ids);
/// <summary>
/// 撤销派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> Cancel(long id);
/// <summary>
/// 批量撤销派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelBatch(long[] ids);
/// <summary>
/// 打印派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> Print(long id);
/// <summary>
/// 批量派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SendDispatchBatch(long[] ids);
/// <summary>
/// 取消派车
/// </summary>
/// <param name="id">派车主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelDispatch(long id);
/// <summary>
/// 批量取消派车
/// </summary>
/// <param name="ids">派车主键组</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> CancelDispatchBatch(long[] ids);
}
}

@ -136,6 +136,16 @@ namespace Myshipping.Application
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 目的港代码
/// </summary>
public string DestinationId { get; set; }
/// <summary>
/// 目的港
/// </summary>
public string Destination { get; set; }
/// <summary>
/// 件数
/// </summary>

@ -30,6 +30,8 @@ namespace Myshipping.Application
.Map(dest => dest.Transport, src => src.TRANSPORT)
.Map(dest => dest.PlaceDeliveryId, src => src.PLACEDELIVERYID)
.Map(dest => dest.PlaceDelivery, src => src.PLACEDELIVERY)
.Map(dest => dest.DestinationId, src => src.DESTINATIONID)
.Map(dest => dest.Destination, src => src.DESTINATION)
.Map(dest => dest.PKGs, src => src.PKGS)
.Map(dest => dest.KGs, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM);

@ -13,6 +13,8 @@ using Myshipping.Report.DB;
using Myshipping.Application.Entity;
using System.Text;
using Myshipping.Core.Entity;
using System.Management;
using Microsoft.Ajax.Utilities;
namespace Myshipping.Report.Controllers
{
@ -135,6 +137,131 @@ namespace Myshipping.Report.Controllers
return Json(resp);
}
/// <summary>
/// 打印报表文件
/// </summary>
/// <returns></returns>
[HttpPost]
public ActionResult PrintReport()
{
var resp = new RespCommonData();
var printType = Request.Form["printType"];
if (printType != "pdf"
&& printType != "xlsx"
&& printType != "docx")
{
resp.Success = false;
resp.Message = $"打印类型不正确:{printType}应该为pdf、xlsx、docx中的一个";
return Json(resp);
}
var dicJson = new Dictionary<string, string>();
Request.Form.AllKeys
.Where(x => x.StartsWith("dataJson"))
.ForEach(x =>
{
dicJson.Add(x.Replace("dataJson", ""), Request.Form[x]);
});
if (Request.Files.Count > 0)
{
try
{
var savePath = ConfigurationManager.AppSettings["ReportFileSavePath"];
if (string.IsNullOrEmpty(savePath)) //未配置保存路径时,使用当前目录
{
savePath = Server.MapPath("~/ReportFiles");
}
if (!Directory.Exists(savePath))
{
Directory.CreateDirectory(savePath);
}
var fileExt = Path.GetExtension(Request.Files[0].FileName).ToLower();
if (fileExt != ".frx")
{
resp.Success = false;
resp.Message = $"文件类型不正确:{fileExt}";
return Json(resp);
}
var tmpFile = Path.Combine(savePath, $"{Guid.NewGuid()}{fileExt}");
Request.Files[0].SaveAs(tmpFile);
log.Debug($"临时保存模板文件:{tmpFile}");
//生成报表
FastReport.Report report = new FastReport.Report();
report.Load(tmpFile);
foreach (FastReport.Data.JsonConnection.JsonDataSourceConnection conn in report.Dictionary.Connections)
{
if (dicJson.ContainsKey(conn.Name))
{
conn.ConnectionString = $"Json={Convert.ToBase64String(Encoding.UTF8.GetBytes(dicJson[conn.Name]))};Encoding=utf-8";
}
}
report.Prepare();
if (printType == "pdf") //pdf
{
var fileName = $"{DateTime.Now.Ticks}.pdf";
var saveFile = Path.Combine(savePath, fileName);
PDFExport pdfExport = new PDFExport();
pdfExport.Export(report, saveFile);
resp.Success = true;
resp.Message = "生成成功";
resp.Data = fileName;
}
else if (printType == "xlsx") //
{
var fileName = $"{DateTime.Now.Ticks}.xlsx";
var saveFile = Path.Combine(savePath, fileName);
Excel2007Export excelExport = new Excel2007Export();
excelExport.Export(report, saveFile);
resp.Success = true;
resp.Message = "生成成功";
resp.Data = fileName;
}
else if (printType == "docx") //
{
var fileName = $"{DateTime.Now.Ticks}.docx";
var saveFile = Path.Combine(savePath, fileName);
Word2007Export excelExport = new Word2007Export();
excelExport.Export(report, saveFile);
resp.Success = true;
resp.Message = "生成成功";
resp.Data = fileName;
}
else
{
resp.Success = false;
resp.Message = "类型参数不正确";
}
return Json(resp);
}
catch (Exception ex)
{
resp.Success = false;
resp.Message = ex.Message;
log.Error(ex.Message);
log.Error(ex.StackTrace);
}
}
else
{
resp.Success = false;
resp.Message = "未上传模板文件";
}
return Json(resp);
}
/// <summary>
/// 根据文件名获取文件
/// </summary>

Loading…
Cancel
Save