diff --git a/Myshipping.Application/Entity/BookingCustomerOrder.cs b/Myshipping.Application/Entity/BookingCustomerOrder.cs
new file mode 100644
index 00000000..361e9c44
--- /dev/null
+++ b/Myshipping.Application/Entity/BookingCustomerOrder.cs
@@ -0,0 +1,192 @@
+using System;
+using SqlSugar;
+using System.ComponentModel;
+using Myshipping.Core.Entity;
+namespace Myshipping.Application.Entity
+{
+ ///
+ /// 客户订舱
+ ///
+ [SugarTable("booking_customer_order")]
+ [Description("客户订舱")]
+ public class BookingCustomerOrder : DBEntityTenant
+ {
+ ///
+ /// 业务状态
+ ///
+ public string BSSTATUS { get; set; }
+ ///
+ /// 业务日期
+ ///
+ public DateTime? BSDATE { get; set; }
+ ///
+ /// 系统编号
+ ///
+ public string BOOKINGNO { get; set; }
+ ///
+ /// 船名
+ ///
+ public string VESSEL { get; set; }
+ ///
+ /// 海关航次
+ ///
+ public string VOYNO { get; set; }
+ ///
+ /// 内部航次
+ ///
+ public string VOYNOINNER { get; set; }
+ ///
+ /// 场站代码
+ ///
+ public string YARDID { get; set; }
+ ///
+ /// 场站
+ ///
+ public string YARD { get; set; }
+ ///
+ /// 开船日期
+ ///
+ public DateTime? ETD { get; set; }
+ ///
+ /// 合约号
+ ///
+ public string CONTRACTNO { get; set; }
+ ///
+ /// 发货人
+ ///
+ public string SHIPPER { get; set; }
+ ///
+ /// 收货人
+ ///
+ public string CONSIGNEE { get; set; }
+ ///
+ /// 通知人
+ ///
+ public string NOTIFYPARTY { get; set; }
+ ///
+ /// 第二通知人
+ ///
+ public string NOTIFYPARTY2 { get; set; }
+ ///
+ /// 起运港代码
+ ///
+ public string PORTLOADID { get; set; }
+ ///
+ /// 起运港
+ ///
+ public string PORTLOAD { get; set; }
+ ///
+ /// 卸货港代码
+ ///
+ public string PORTDISCHARGEID { get; set; }
+ ///
+ /// 卸货港
+ ///
+ public string PORTDISCHARGE { get; set; }
+ ///
+ /// 运输条款
+ ///
+ public string SERVICE { get; set; }
+ ///
+ /// 付费方式
+ ///
+ public string BLFRT { get; set; }
+ ///
+ /// HS代码
+ ///
+ public string HSCODE { get; set; }
+ ///
+ /// 货描
+ ///
+ public string DESCRIPTION { get; set; }
+ ///
+ /// 件数
+ ///
+ public int? PKGS { get; set; }
+ ///
+ /// 包装
+ ///
+ public string KINDPKGS { get; set; }
+ ///
+ /// 毛重
+ ///
+ public decimal? KGS { get; set; }
+ ///
+ /// 尺码
+ ///
+ public decimal? CBM { get; set; }
+ ///
+ /// 件数大写
+ ///
+ public string TOTALNO { get; set; }
+ ///
+ /// 集装箱
+ ///
+ public string CNTRTOTAL { get; set; }
+ ///
+ /// 船公司代号
+ ///
+ public string CARRIERID { get; set; }
+ ///
+ /// 船公司
+ ///
+ public string CARRIER { get; set; }
+ ///
+ /// 货物标识
+ ///
+ public string CARGOID { get; set; }
+ ///
+ /// 危险品类别
+ ///
+ public string DCLASS { get; set; }
+ ///
+ /// 危险品编号
+ ///
+ public string DUNNO { get; set; }
+ ///
+ /// 危险品页号
+ ///
+ public string DPAGE { get; set; }
+ ///
+ /// 危险品标签
+ ///
+ public string DLABEL { get; set; }
+ ///
+ /// 危险品联系人
+ ///
+ public string LINKMAN { get; set; }
+ ///
+ /// 温度单位
+ ///
+ public string TEMPID { get; set; }
+ ///
+ /// 设置温度
+ ///
+ public string TEMPSET { get; set; }
+ ///
+ /// 通风度
+ ///
+ public string REEFERF { get; set; }
+ ///
+ /// 湿度
+ ///
+ public string HUMIDITY { get; set; }
+ ///
+ /// 最低温度
+ ///
+ public string TEMPMIN { get; set; }
+ ///
+ /// 最高温度
+ ///
+ public string TEMPMAX { get; set; }
+ ///
+ /// SO备注
+ ///
+ public string SOREMARK { get; set; }
+
+ ///
+ /// 租户名称
+ ///
+ public string TenantName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs
new file mode 100644
index 00000000..38e1a850
--- /dev/null
+++ b/Myshipping.Application/Service/BookingCustomerOrder/BookingCustomerOrderService.cs
@@ -0,0 +1,301 @@
+using Furion;
+using Furion.DependencyInjection;
+using Furion.DynamicApiController;
+using Furion.FriendlyException;
+using Mapster;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using Myshipping.Application.ConfigOption;
+using Myshipping.Application.Entity;
+using Myshipping.Core;
+using Myshipping.Core.Service;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web;
+using Yitter.IdGenerator;
+
+namespace Myshipping.Application
+{
+ ///
+ /// 客户订舱
+ ///
+ [ApiDescriptionSettings("Application", Name = "BookingCustomerOrder", Order = 1)]
+ public class BookingCustomerOrderService : IDynamicApiController, ITransient
+ {
+ private readonly SqlSugarRepository _rep;
+ private readonly SqlSugarRepository _repCtn;
+ private readonly ILogger _logger;
+ private readonly ISysCacheService _cache;
+ private readonly SqlSugarRepository _repFile;
+ private readonly SqlSugarRepository _repStatuslog;
+
+ public BookingCustomerOrderService(SqlSugarRepository rep, SqlSugarRepository repCtn,
+ ILogger logger, ISysCacheService cache, SqlSugarRepository repFile, SqlSugarRepository statuslog)
+ {
+ this._logger = logger;
+ this._rep = rep;
+ this._repCtn = repCtn;
+ this._cache = cache;
+ this._repFile = repFile;
+ this._repStatuslog = statuslog;
+
+ }
+
+ //查询台账
+ [HttpPost("/BookingCustomerOrder/PageData")]
+ public async Task> PageData(BookingCustomerOrderQueryInput input)
+ {
+ var query = _rep.AsQueryable();
+
+ var entities = await query.ToPagedListAsync(input.PageNo, input.PageSize);
+ var list = entities.Adapt>();
+
+ return list;
+ }
+
+ ///
+ /// 保存数据
+ ///
+ ///
+ ///
+ [HttpPost("/BookingCustomerOrder/Save")]
+ public async Task Save(BookingCustomerOrderSaveInput input)
+ {
+ if (input == null)
+ {
+ throw Oops.Bah("请传入正常数据!");
+ }
+ var ms = JsonUtil.TrimFields(input);
+ if (!string.IsNullOrEmpty(ms))
+ {
+ throw Oops.Bah(ms);
+ }
+
+ BookingCustomerOrder entity = null;
+ List ctnList = new List();
+ if (input.Id == 0)
+ {
+ entity = input.Adapt();
+ if (string.IsNullOrEmpty(entity.VOYNO))
+ {
+ entity.VOYNO = entity.VOYNOINNER;
+ }
+
+ entity.BSSTATUS = "已录入";
+ entity.BOOKINGNO = $"BK{YitIdHelper.NextId()}";
+ await _rep.InsertAsync(entity);
+
+ }
+ else
+ {
+ entity = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == input.Id);
+ if (entity.BSSTATUS != "已录入" || entity.BSSTATUS != "已驳回")
+ {
+ throw Oops.Bah("当前状态不允许修改");
+ }
+
+ if (string.IsNullOrEmpty(entity.VOYNO))
+ {
+ entity.VOYNO = entity.VOYNOINNER;
+ }
+
+ entity = input.Adapt(entity);
+
+ await _rep.UpdateAsync(entity);
+
+ await _repCtn.DeleteAsync(x => x.BILLID == input.Id);
+
+ }
+
+ //箱信息保存
+ if (input.CtnList != null)
+ {
+ foreach (var item in input.CtnList)
+ {
+ var ctnentity = item.Adapt();
+ ctnentity.BILLID = entity.Id;
+ await _repCtn.InsertAsync(ctnentity);
+ ctnList.Add(ctnentity);
+ }
+ }
+
+ //文件
+ var dbFiles = _repFile.AsQueryable().Where(x => x.BookingId == entity.Id).ToList();
+ var opt = App.GetOptions();
+ var dirAbs = string.Empty;
+ if (string.IsNullOrEmpty(opt.basePath))
+ {
+ dirAbs = Path.Combine(App.WebHostEnvironment.WebRootPath, opt.relativePath);
+ }
+ else
+ {
+ dirAbs = Path.Combine(opt.basePath, opt.relativePath);
+ }
+
+ if (!Directory.Exists(dirAbs))
+ Directory.CreateDirectory(dirAbs);
+
+ //临时文件转为正式文件
+ if (input.TempFileNames != null && input.TempFileNames.Count() > 0)
+ {
+ var optTempFile = App.GetOptions().Path;
+ foreach (var tmpFile in input.TempFileNames)
+ {
+ var tempPath = Path.Combine(optTempFile, tmpFile);
+ if (File.Exists(tempPath))
+ {
+ var saveFileName = $"{DateTime.Now.Ticks}{Path.GetExtension(tmpFile)}";
+ var fileRelaPath = Path.Combine(opt.relativePath, saveFileName).ToLower();
+ var fileAbsPath = Path.Combine(dirAbs, saveFileName).ToLower();
+
+ File.Copy(tempPath, fileAbsPath, true);
+
+ var newFile = new BookingFile
+ {
+ Id = YitIdHelper.NextId(),
+ FileName = Path.GetFileName(tmpFile),
+ FilePath = fileRelaPath,
+ TypeCode = "tuodan",
+ TypeName = "托单文件",
+ BookingId = entity.Id,
+
+ };
+ await _repFile.InsertAsync(newFile);
+ }
+ }
+ }
+
+ //清除前端已删除的文件
+ if (input.Files != null && input.Files.Count() > 0)
+ {
+ var delIds = dbFiles.Where(x => !input.Files.Contains(x.Id)).Select(x => x.Id);
+ await _repFile.DeleteAsync(x => delIds.Contains(x.Id));
+ }
+ else
+ {
+ await _repFile.DeleteAsync(x => x.BookingId == entity.Id);
+ }
+
+
+ //日志动态
+ var staLog = new BookingStatusLog();
+ staLog.Status = input.Id == 0 ? "已录入" : "已修改";
+ staLog.CreatedUserId = UserManager.UserId;
+ staLog.CreatedUserName = UserManager.Name;
+ staLog.CreatedTime = DateTime.Now;
+ staLog.OpTime = DateTime.Now;
+ staLog.BookingId = entity.Id;
+ _repStatuslog.Insert(staLog);
+
+ var outModel = entity.Adapt();
+ outModel.CtnList = ctnList.Adapt>();
+
+ var dicFile = new Dictionary();
+ _repFile.AsQueryable().Where(x => x.BookingId == entity.Id).ForEach(x => dicFile.Add(x.Id, x.FileName));
+ outModel.Files = dicFile;
+
+ outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt>();
+
+ return outModel;
+ }
+
+ ///
+ /// 获取详情
+ ///
+ ///
+ ///
+ [HttpPost("/BookingCustomerOrder/Get")]
+ public async Task Get(long id)
+ {
+ var entity = await _rep.AsQueryable().Filter(null, true).FirstAsync(x => x.Id == id);
+
+ var outModel = entity.Adapt();
+ outModel.CtnList = _repCtn.Where(x => x.BILLID == id).Adapt>();
+
+ var dicFile = new Dictionary();
+ _repFile.AsQueryable().Where(x => x.BookingId == entity.Id).ForEach(x => dicFile.Add(x.Id, x.FileName));
+ outModel.Files = dicFile;
+
+ outModel.LogList = _repStatuslog.AsQueryable().Where(x => x.BookingId == entity.Id).ToList().Adapt>();
+
+ return outModel;
+ }
+
+ ///
+ /// 上传临时文件
+ ///
+ ///
+ ///
+ [HttpPost("/BookingCustomerOrder/UploadTempFile")]
+ public async Task UploadTempFile(IFormFile file)
+ {
+ //未上传文件
+ if (file == null || file.Length == 0)
+ {
+ throw Oops.Bah("未上传任何文件");
+ }
+
+
+ var optTempFile = App.GetOptions().Path;
+ var tempFilePath = $"{DateTime.Now.Ticks}"; //临时存放目录
+ var tempSavePath = Path.Combine(optTempFile, tempFilePath);
+ Directory.CreateDirectory(tempSavePath);
+
+ var fileFullPath = Path.Combine(tempSavePath, file.FileName);//服务器路径
+
+ using (var stream = File.Create(fileFullPath))
+ {
+ await file.CopyToAsync(stream);
+ }
+
+ return Path.Combine(tempFilePath, file.FileName);
+ }
+
+ ///
+ /// 下载查看上传的文件
+ ///
+ ///
+ ///
+ [HttpGet("/BookingCustomerOrder/GetFile"), AllowAnonymous]
+ public async Task GetFile(long id)
+ {
+ var savedFile = await _repFile.AsQueryable().Filter(null, true).FirstAsync(u => u.Id == id);
+ if (savedFile == null)
+ {
+ throw Oops.Oh("文件不存在");
+ }
+ var opt = App.GetOptions();
+ var dirAbs = opt.basePath;
+ if (string.IsNullOrEmpty(dirAbs))
+ {
+ dirAbs = App.WebHostEnvironment.WebRootPath;
+ }
+
+ var fileFullPath = Path.Combine(dirAbs, savedFile.FilePath);
+ if (!File.Exists(fileFullPath))
+ {
+ throw Oops.Oh("文件不存在");
+ }
+
+ var fileName = HttpUtility.UrlEncode(savedFile.FileName, Encoding.GetEncoding("UTF-8"));
+ var result = new FileStreamResult(new FileStream(fileFullPath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
+ return result;
+ }
+
+ ///
+ /// 提交订舱
+ ///
+ ///
+ [HttpPost("/BookingCustomerOrder/Submit")]
+ public async Task Submit()
+ {
+
+ }
+ }
+}
diff --git a/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs
new file mode 100644
index 00000000..374a17d3
--- /dev/null
+++ b/Myshipping.Application/Service/BookingCustomerOrder/Dto/Dtos.cs
@@ -0,0 +1,282 @@
+using Myshipping.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Myshipping.Application
+{
+ public class BookingCustomerOrderQueryInput : PageInputBase
+ {
+ }
+
+ //dto
+ public class BookingCustomerOrderDto
+ {
+ ///
+ /// 主键
+ ///
+ public long Id { get; set; }
+ ///
+ /// 船名
+ ///
+ public string VESSEL { get; set; }
+ ///
+ /// 海关航次
+ ///
+ public string VOYNO { get; set; }
+ ///
+ /// 内部航次
+ ///
+ public string VOYNOINNER { get; set; }
+ ///
+ /// 场站代码
+ ///
+ public string YARDID { get; set; }
+ ///
+ /// 场站
+ ///
+ public string YARD { get; set; }
+ ///
+ /// 开船日期
+ ///
+ public DateTime? ETD { get; set; }
+ ///
+ /// 合约号
+ ///
+ public string CONTRACTNO { get; set; }
+ ///
+ /// 发货人
+ ///
+ public string SHIPPER { get; set; }
+ ///
+ /// 收货人
+ ///
+ public string CONSIGNEE { get; set; }
+ ///
+ /// 通知人
+ ///
+ public string NOTIFYPARTY { get; set; }
+ ///
+ /// 第二通知人
+ ///
+ public string NOTIFYPARTY2 { get; set; }
+ ///
+ /// 起运港代码
+ ///
+ public string PORTLOADID { get; set; }
+ ///
+ /// 起运港
+ ///
+ public string PORTLOAD { get; set; }
+ ///
+ /// 卸货港代码
+ ///
+ public string PORTDISCHARGEID { get; set; }
+ ///
+ /// 卸货港
+ ///
+ public string PORTDISCHARGE { get; set; }
+ ///
+ /// 运输条款
+ ///
+ public string SERVICE { get; set; }
+ ///
+ /// 付费方式
+ ///
+ public string BLFRT { get; set; }
+ ///
+ /// HS代码
+ ///
+ public string HSCODE { get; set; }
+ ///
+ /// 货描
+ ///
+ public string DESCRIPTION { get; set; }
+ ///
+ /// 件数
+ ///
+ public int? PKGS { get; set; }
+ ///
+ /// 包装
+ ///
+ public string KINDPKGS { get; set; }
+ ///
+ /// 毛重
+ ///
+ public decimal? KGS { get; set; }
+ ///
+ /// 尺码
+ ///
+ public decimal? CBM { get; set; }
+ ///
+ /// 件数大写
+ ///
+ public string TOTALNO { get; set; }
+ ///
+ /// 集装箱
+ ///
+ public string CNTRTOTAL { get; set; }
+ ///
+ /// 船公司代号
+ ///
+ public string CARRIERID { get; set; }
+ ///
+ /// 船公司
+ ///
+ public string CARRIER { get; set; }
+ ///
+ /// 货物标识
+ ///
+ public string CARGOID { get; set; }
+ ///
+ /// 危险品类别
+ ///
+ public string DCLASS { get; set; }
+ ///
+ /// 危险品编号
+ ///
+ public string DUNNO { get; set; }
+ ///
+ /// 危险品页号
+ ///
+ public string DPAGE { get; set; }
+ ///
+ /// 危险品标签
+ ///
+ public string DLABEL { get; set; }
+ ///
+ /// 危险品联系人
+ ///
+ public string LINKMAN { get; set; }
+ ///
+ /// 温度单位
+ ///
+ public string TEMPID { get; set; }
+ ///
+ /// 设置温度
+ ///
+ public string TEMPSET { get; set; }
+ ///
+ /// 通风度
+ ///
+ public string REEFERF { get; set; }
+ ///
+ /// 湿度
+ ///
+ public string HUMIDITY { get; set; }
+ ///
+ /// 最低温度
+ ///
+ public string TEMPMIN { get; set; }
+ ///
+ /// 最高温度
+ ///
+ public string TEMPMAX { get; set; }
+ ///
+ /// SO备注
+ ///
+ public string SOREMARK { get; set; }
+ }
+
+ //保存dto
+ public class BookingCustomerOrderSaveInput : BookingCustomerOrderDto
+ {
+ ///
+ /// 上传还未保存的文件
+ ///
+ public List TempFileNames { get; set; }
+
+ ///
+ /// 已保存过的需要保留的文件
+ ///
+ public List Files { get; set; }
+
+ ///
+ /// 箱信息
+ ///
+ public List CtnList { get; set; }
+ }
+
+ //台账返回dto
+ public class BookingCustomerOrderListOutput : BookingCustomerOrderDto
+ {
+ ///
+ /// 系统编号
+ ///
+ public string BOOKINGNO { get; set; }
+
+ }
+
+ //保存返回dto
+ public class BookingCustomerOrderSaveOutput : BookingCustomerOrderDto
+ {
+ ///
+ /// 系统编号
+ ///
+ public string BOOKINGNO { get; set; }
+
+ ///
+ /// 文件列表
+ ///
+ public Dictionary Files { get; set; }
+
+ ///
+ /// 箱信息
+ ///
+ public List CtnList { get; set; }
+
+ ///
+ /// 日志信息
+ ///
+ public List LogList { get; set; }
+ }
+
+ ///
+ /// 箱信息dto
+ ///
+ public class BookingCustomerCtnDto
+ {
+ ///
+ /// 主键
+ ///
+ public long? Id { get; set; }
+
+ ///
+ /// 箱型代码
+ ///
+ public string CTNCODE { get; set; }
+ ///
+ /// 箱型
+ ///
+ public string CTNALL { get; set; }
+
+ ///
+ /// 箱量
+ ///
+ public int? CTNNUM { get; set; }
+
+ }
+
+ ///
+ /// 日志信息dto
+ ///
+ public class BookingCustomerLogDto
+ {
+ ///
+ /// 状态
+ ///
+ public string Status { get; set; }
+ ///
+ /// 状态时间
+ ///
+ public DateTime? OpTime { get; set; }
+
+ ///
+ /// 创建者名称
+ ///
+ public virtual string CreatedUserName { get; set; }
+
+ }
+}
diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
index db0d869a..745ec3c9 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs
@@ -6319,6 +6319,16 @@ namespace Myshipping.Application
primaryModel.ORDERNO = order.BOOKINGNO;
}
+ //2023-06-15 按照沟通要求,如果主提单号为空,并且订舱编号不为空,可以去订舱编号填入主提单号
+ if (string.IsNullOrWhiteSpace(primaryModel.MBLNO))
+ {
+ if (!string.IsNullOrWhiteSpace(order.CUSTNO))
+ {
+ _logger.LogInformation("批次={no} 主题单号为空 MBLNO={mblno} 取订舱编号补到主提单号 custno={custno}", batchNo, primaryModel.MBLNO, order.CUSTNO);
+
+ primaryModel.MBLNO = order.CUSTNO;
+ }
+ }
var curBasePkgs = basePkgsList.FirstOrDefault(p => p.Name.Equals(order.KINDPKGS, StringComparison.OrdinalIgnoreCase));
diff --git a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs
index 8728ee51..df2f01bd 100644
--- a/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs
+++ b/Myshipping.Application/Service/BookingOrder/BookingValueAddedService.cs
@@ -1182,6 +1182,129 @@ namespace Myshipping.Application
}
#endregion
+ ///
+ /// 提交规则意见
+ ///
+ /// 规则意见详情
+ /// 返回回执
+ [HttpPost("/BookingValueAdded/SubmitRuleOpinion")]
+ public async Task SubmitRuleOpinion([FromBody] RulesEngineUserFeedBackDto model)
+ {
+ TaskManageOrderResultDto result = new TaskManageOrderResultDto();
+
+ string batchNo = IDGen.NextID().ToString();
+
+ DateTime nowDate = DateTime.Now;
+ try
+ {
+ RulesEngineUserFeedBackMessageInfo msgModel = new RulesEngineUserFeedBackMessageInfo();
+
+ msgModel.Head = new RulesEngineUserFeedBackHead
+ {
+ GID = batchNo,
+ MessageType = "BUSI_RULE",
+ SenderId = App.Configuration["RulesEngineSender"],
+ SenderName = App.Configuration["RulesEngineSenderName"],
+ SenderKey = App.Configuration["RulesEngineAuthKey"],
+ ReceiverId = "RulesEngine",
+ ReceiverName = "大简云规则引擎",
+ Version = "1.0",
+ RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss"),
+ RequestAction = "Add",
+ };
+
+ msgModel.Main = new RulesEngineUserFeedBackMain
+ {
+ ruleName = model.ruleName,
+ opinionType = model.opinionType,
+ opinionContent = model.opinionContent,
+ ruleNotice = model.ruleNotice,
+ submitUser = UserManager.Name
+ };
+
+ var rlt = await ExcuteRuleOpinion(App.Configuration["RulesEngineOpinionUrl"], msgModel, batchNo);
+
+ }
+ catch (Exception ex)
+ {
+ result.succ = false;
+ result.msg = $"提交规则意见失败,{ex.Message}";
+ }
+
+ return result;
+ }
+
+ ///
+ /// 查询规则意见历史
+ ///
+ /// 规则意见详情
+ /// 返回回执
+ [HttpPost("/BookingValueAdded/GetRuleOpinionLog")]
+ public async Task GetRuleOpinionLog([FromBody] RulesEngineUserFeedBackDto model)
+ {
+ TaskManageOrderResultDto result = new TaskManageOrderResultDto();
+
+ try
+ {
+
+ }
+ catch (Exception ex)
+ {
+ result.succ = false;
+ result.msg = $"查询规则意见历史失败,{ex.Message}";
+ }
+
+ return result;
+ }
+
+ #region 规则用户反馈请求远端
+ ///
+ /// 规则用户反馈请求远端
+ ///
+ /// 请求URL
+ /// 请求详情
+ /// 批次号
+ /// 返回结果
+ [NonAction]
+ private async Task ExcuteRuleOpinion(string url, RulesEngineUserFeedBackMessageInfo info, string batchNo)
+ {
+ RulesEngineWebApiResult model = null;
+ /*
+ 1、填充请求的类,并生成JSON报文
+ 2、POST请求接口,并记录回执。
+ 3、返回信息。
+ */
+ try
+ {
+ _logger.LogInformation("批次={no} 对应请求报文 request={res}", batchNo, JSON.Serialize(info));
+
+ var res = await url.OnClientCreating(client => {
+ // client 为 HttpClient 对象
+ client.Timeout = TimeSpan.FromMinutes(15); // 设置超时时间 15分钟
+ }).SetHttpMethod(HttpMethod.Post)
+ .SetBody(JSON.Serialize(info), "application/json")
+ .SetContentEncoding(Encoding.UTF8)
+ .PostAsync();
+
+ _logger.LogInformation("批次={no} 对应请求报文完成 res={res}", batchNo, JSON.Serialize(res));
+
+ if (res.StatusCode == System.Net.HttpStatusCode.OK)
+ {
+ var userResult = await res.Content.ReadAsStringAsync();
+
+ model = JSON.Deserialize(userResult);
+ }
+ }
+ catch (Exception ex)
+ {
+ //写日志
+ if (ex is HttpRequestException)
+ throw Oops.Oh(10000002);
+ }
+
+ return model;
+ }
+ #endregion
///
/// 获取个人或公司网站账户配置
diff --git a/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackDto.cs b/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackDto.cs
new file mode 100644
index 00000000..5066f170
--- /dev/null
+++ b/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackDto.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Myshipping.Application
+{
+ ///
+ /// 规则用户反馈
+ ///
+ public class RulesEngineUserFeedBackDto
+ {
+ ///
+ /// 规则名称
+ ///
+ public string ruleName { get; set; }
+
+ ///
+ /// 规则提示
+ ///
+ public string ruleNotice { get; set; }
+
+ ///
+ /// 规则反馈用户名
+ ///
+ public string submitUser { get; set; }
+
+ ///
+ /// 规则反馈意见类型
+ ///
+ public string opinionType { get; set; }
+
+ ///
+ /// 规则反馈意见内容
+ ///
+ public string opinionContent { get; set; }
+ }
+}
diff --git a/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackMessageInfo.cs b/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackMessageInfo.cs
new file mode 100644
index 00000000..1d86b294
--- /dev/null
+++ b/Myshipping.Application/Service/BookingOrder/Dto/RulesEngineUserFeedBackMessageInfo.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Myshipping.Application
+{
+ ///
+ /// 规则用户反馈报文详情
+ ///
+ public class RulesEngineUserFeedBackMessageInfo
+ {
+ ///
+ /// 表头
+ ///
+ public RulesEngineUserFeedBackHead Head { get; set; }
+
+ ///
+ /// 表体
+ ///
+ public RulesEngineUserFeedBackMain Main { get; set; }
+ }
+
+ ///
+ /// 报文表头
+ ///
+ public class RulesEngineUserFeedBackHead : WebAPIHeadBase
+ {
+ ///
+ /// 请求授权KEY
+ ///
+ /// FQbjpRF6vgrrGqxdcArDHtuQQqbXhefn+1KY28aeNUho7dL25glogc0n1uIJUwsCdsEhTdWM0w6qj7HgxWi9nD0r3aONCdP+nOYtRx2+BvA=
+ [Required(ErrorMessage = "必填")]
+ public string SenderKey { get; set; }
+ }
+
+ ///
+ /// 报文表体
+ ///
+ public class RulesEngineUserFeedBackMain
+ {
+ ///
+ /// 规则名称
+ ///
+ public string ruleName { get; set; }
+
+ ///
+ /// 规则提示
+ ///
+ public string ruleNotice { get; set; }
+
+ ///
+ /// 规则反馈用户名
+ ///
+ public string submitUser { get; set; }
+
+ ///
+ /// 规则反馈意见类型
+ ///
+ public string opinionType { get; set; }
+
+ ///
+ /// 规则反馈意见内容
+ ///
+ public string opinionContent { get; set; }
+ }
+}
diff --git a/Myshipping.Application/Service/BookingOrder/IBookingValueAddedService.cs b/Myshipping.Application/Service/BookingOrder/IBookingValueAddedService.cs
index 65dc2a2b..ce6848f2 100644
--- a/Myshipping.Application/Service/BookingOrder/IBookingValueAddedService.cs
+++ b/Myshipping.Application/Service/BookingOrder/IBookingValueAddedService.cs
@@ -57,5 +57,21 @@ namespace Myshipping.Application
/// 批量BC更新列表
/// 返回回执
Task BatchBCUpdate(List batchBCList);
+
+
+ ///
+ /// 提交规则意见
+ ///
+ /// 规则意见详情
+ /// 返回回执
+ Task SubmitRuleOpinion(RulesEngineUserFeedBackDto model);
+
+
+ ///
+ /// 查询规则意见历史
+ ///
+ /// 规则意见详情
+ /// 返回回执
+ Task GetRuleOpinionLog(RulesEngineUserFeedBackDto model);
}
}
diff --git a/Myshipping.Application/Service/Para/ParaService.cs b/Myshipping.Application/Service/Para/ParaService.cs
index ee5d0d50..4903ba8d 100644
--- a/Myshipping.Application/Service/Para/ParaService.cs
+++ b/Myshipping.Application/Service/Para/ParaService.cs
@@ -711,17 +711,17 @@ namespace Myshipping.Application
if (!string.IsNullOrWhiteSpace(lane))
{
- query = query.Where(t => t.LANE_CODE.Contains(lane));
+ query = query.Where(t => string.IsNullOrWhiteSpace(t.LANE_CODE) || t.LANE_CODE.Contains(lane));
}
if (!string.IsNullOrWhiteSpace(lanecname))
{
- query = query.Where(t => t.LANE_CNAME.Contains(lanecname));
+ query = query.Where(t => string.IsNullOrWhiteSpace(t.LANE_CNAME) || t.LANE_CNAME.Contains(lanecname));
}
if (!string.IsNullOrWhiteSpace(pod))
{
- query = query.Where(t => t.POD_CODE.Contains(pod));
+ query = query.Where(t => string.IsNullOrWhiteSpace(t.POD_CODE) || t.POD_CODE.Contains(pod));
}
query = query.OrderBy("CONTRACT_NO asc");
diff --git a/Myshipping.Web.Core/applicationconfig.json b/Myshipping.Web.Core/applicationconfig.json
index 22be0293..77c12f43 100644
--- a/Myshipping.Web.Core/applicationconfig.json
+++ b/Myshipping.Web.Core/applicationconfig.json
@@ -112,6 +112,8 @@
"RulesEngineSender": "NewOceanBooking",
"RulesEngineSenderName": "新海运订舱平台",
"RulesEngineProjects": "OCEAN_BOOKING",
+ "RulesEngineOpinionUrl": "http://60.209.125.238:35210/api/RulesEngineUserFeedBackManage/SubmitUserFeedBack",
+ "RulesEngineQueryOpinionUrl": "http://60.209.125.238:35210/api/RulesEngineUserFeedBackManage/QueryUserFeedBackLog",
"FriendlyExceptionSettings": {
"HideErrorCode": true
},