jianghaiqing 2 years ago
commit b6f457427f

@ -3341,6 +3341,21 @@
租户名称 租户名称
</summary> </summary>
</member> </member>
<member name="T:Myshipping.Application.Entity.BookingPrinttemplateRight">
<summary>
订舱打印模板权限表
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingPrinttemplateRight.SysUserId">
<summary>
人员id
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingPrinttemplateRight.PrintTemplateId">
<summary>
模板id
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingRemark"> <member name="T:Myshipping.Application.Entity.BookingRemark">
<summary> <summary>
订舱备注 订舱备注
@ -6803,6 +6818,11 @@
主单ID 主单ID
</summary> </summary>
</member> </member>
<member name="P:Myshipping.Application.Service.BookingPrintTemplate.Dto.BookingPrinttemplateRightDto.SysUserId">
<summary>
人员id
</summary>
</member>
<member name="T:Myshipping.Application.BookingEDIExtDto"> <member name="T:Myshipping.Application.BookingEDIExtDto">
<summary> <summary>
EDI扩展 EDI扩展
@ -8942,6 +8962,19 @@
<param name="id"></param> <param name="id"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Myshipping.Application.BookingPrintTemplateService.AddPrinttemplateRight(Myshipping.Application.Service.BookingPrintTemplate.Dto.BookingPrinttemplateRightDto)">
<summary>
新增打印模板权限
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingPrintTemplateService.GetPrinttemplateRightList(System.Int64)">
<summary>
获取打印模板权限
</summary>
<returns></returns>
</member>
<member name="T:Myshipping.Application.BookingPrintTemplateInput"> <member name="T:Myshipping.Application.BookingPrintTemplateInput">
<summary> <summary>
订舱打印模板输入参数 订舱打印模板输入参数

@ -365,7 +365,13 @@ namespace Myshipping.Application
var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}"); var groupList = input.ctnInputs.Where(x => x.CTNNUM > 0).GroupBy(c => c.CTNALL).Select(g => $"{g.Key}*{g.Sum(gg => gg.CTNNUM)}");
input.CNTRTOTAL = string.Join(" / ", groupList); input.CNTRTOTAL = string.Join(" / ", groupList);
} }
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID).FirstAsync();
if (et != null)
{
throw Oops.Bah("当前数据已存在,不能重复录入");
}
var entity = input.Adapt<BookingOrder>(); var entity = input.Adapt<BookingOrder>();
//entity.TOTALNO = NumberToUpper.ToUpper(entity.PKGS == null ? 0 : entity.PKGS); //entity.TOTALNO = NumberToUpper.ToUpper(entity.PKGS == null ? 0 : entity.PKGS);
await _rep.InsertAsync(entity); await _rep.InsertAsync(entity);
@ -473,6 +479,15 @@ namespace Myshipping.Application
input.CNTRTOTAL = string.Join(" / ", groupList); input.CNTRTOTAL = string.Join(" / ", groupList);
} }
var main = await _rep.AsQueryable().Where(x => x.Id == input.Id).FirstAsync(); var main = await _rep.AsQueryable().Where(x => x.Id == input.Id).FirstAsync();
var et = await _rep.Where(x => x.MBLNO == input.MBLNO && x.TenantId == UserManager.TENANT_ID && x.Id != input.Id).FirstAsync();
if (et != null)
{
throw Oops.Bah("当前数据已存在,不能重复录入");
}
var entity = input.Adapt<BookingOrder>(); var entity = input.Adapt<BookingOrder>();
//entity.TOTALNO = NumberToUpper.ToUpper(entity.PKGS == null ? 0 : entity.PKGS); //entity.TOTALNO = NumberToUpper.ToUpper(entity.PKGS == null ? 0 : entity.PKGS);
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync(); await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
@ -877,9 +892,9 @@ namespace Myshipping.Application
/// 调用运踪接口 /// 调用运踪接口
/// </summary> /// </summary>
[HttpPost("/BookingOrder/SendTrace")] [HttpPost("/BookingOrder/SendTrace")]
[SqlSugarUnitOfWork]
public async Task SendTrace(List<BillTraceList> dto) public async Task SendTrace(List<BillTraceList> dto)
{ {
if (dto == null) if (dto == null)
{ {
throw Oops.Bah("未传入正确参数!"); throw Oops.Bah("未传入正确参数!");
@ -887,14 +902,32 @@ namespace Myshipping.Application
var key = _webAccountConfig.GetAccountConfig("seae_billtraceurl", UserManager.UserId).Result; var key = _webAccountConfig.GetAccountConfig("seae_billtraceurl", UserManager.UserId).Result;
if (key == null) if (key == null)
{ {
throw Oops.Bah("调用运踪接口相关账号未维护!"); throw Oops.Bah("调用运踪接口相关账号未维护!");
} }
var url = _cache.GetAllDictData().Result; var url = _cache.GetAllDictData().Result;
BillTraceDto billdto = new BillTraceDto(); BillTraceDto billdto = new BillTraceDto();
List<BillTraceList> billTraceList = new List<BillTraceList>(); List<BillTraceList> billTraceList = new List<BillTraceList>();
var dicdatalist = _cache.GetAllDictData().Result;
foreach (var item in dto) foreach (var item in dto)
{ {
if (item.CARRIERID != "")
{
var et = _repBookingStatus.Where(x => x.StaCode == "sta_mudigang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync();
if (et != null)
{
throw Oops.Bah("提单号"+item.MBLNO+"已订阅!");
}
}
if (item.YardCode != "")
{
var et = _repBookingStatus.Where(x => x.StaCode == "sta_qiyungang" && x.BookingId == Convert.ToInt64(item.BusinessId)).FirstAsync();
if (et != null)
{
throw Oops.Bah("提单号" + item.MBLNO + "已订阅!");
}
}
_logger.LogInformation("调用运踪接口提单号:" + item.MBLNO + " 调用运踪接口"); _logger.LogInformation("调用运踪接口提单号:" + item.MBLNO + " 调用运踪接口");
billTraceList.Add(new BillTraceList billTraceList.Add(new BillTraceList
{ {
@ -906,6 +939,46 @@ namespace Myshipping.Application
CARRIERID = item.CARRIERID == "" ? null : item.CARRIERID, CARRIERID = item.CARRIERID == "" ? null : item.CARRIERID,
isBook = item.isBook isBook = item.isBook
}); });
var bookingStatusLog = new BookingStatusLog();
bookingStatusLog.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatusLog.Category = "ship";
bookingStatusLog.CreatedTime = DateTime.Now;
if (item.YardCode == "" && item.CARRIERID != "")
{
bookingStatusLog.Status = "订阅目的港";
}
if (item.YardCode != "" && item.CARRIERID == "")
{
bookingStatusLog.Status = "订阅起运港";
}
if (item.YardCode != "" && item.CARRIERID != "")
{
bookingStatusLog.Status = "订阅起运港,目的港";
}
bookingStatusLog.OpTime = DateTime.Now;
bookingStatusLog.MBLNO = item.MBLNO;
await _repStatuslog.InsertAsync(bookingStatusLog);
if (item.CARRIERID != "")
{
BookingStatus bookingStatus = new BookingStatus();
bookingStatus.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatus.StaCode = "sta_mudigang";
bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_mudigang").Select(x => x.Value).FirstOrDefault();
bookingStatus.StaTime = DateTime.Now;
bookingStatus.StaCate = "book_sta_cate_billtrace";
await _repBookingStatus.InsertAsync(bookingStatus);
}
if (item.YardCode != "")
{
BookingStatus bookingStatus = new BookingStatus();
bookingStatus.BookingId = Convert.ToInt64(item.BusinessId);
bookingStatus.StaCode = "sta_qiyungang";
bookingStatus.StaName = dicdatalist.Where(x => x.Code == "sta_qiyungang").Select(x => x.Value).FirstOrDefault();
bookingStatus.StaTime = DateTime.Now;
bookingStatus.StaCate = "book_sta_cate_billtrace";
await _repBookingStatus.InsertAsync(bookingStatus);
}
} }
billdto.Children = billTraceList; billdto.Children = billTraceList;
billdto.Key = key.Account; billdto.Key = key.Account;
@ -916,8 +989,11 @@ namespace Myshipping.Application
_logger.LogInformation("调用运踪接口发送josn" + json); _logger.LogInformation("调用运踪接口发送josn" + json);
var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>(); var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "request_seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
_logger.LogInformation("调用运踪接口返回" + html.ToJsonString()); _logger.LogInformation("调用运踪接口返回" + html.ToJsonString());
if (html.Success != true)
{
_logger.LogError("调用运踪接口返回:" + html.ToJsonString());
throw Oops.Bah(html.Message);
}
} }
/// <summary> /// <summary>
@ -1555,7 +1631,7 @@ namespace Myshipping.Application
{ {
//当前公司所有已配置的模板 //当前公司所有已配置的模板
var allList = await _repPrintTemplate.AsQueryable() var allList = await _repPrintTemplate.AsQueryable()
.Filter(null, true).InnerJoin<BookingPrinttemplateRight>((d,t)=>d.Id==t.PrintTemplateId&&t.SysUserId==UserManager.UserId) .Filter(null, true)//.InnerJoin<BookingPrinttemplateRight>((d,t)=>d.Id==t.PrintTemplateId&&t.SysUserId==UserManager.UserId)
.Where(x => x.TenantId == UserManager.TENANT_ID) .Where(x => x.TenantId == UserManager.TENANT_ID)
.Select(x => new .Select(x => new
{ {

@ -123,8 +123,7 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
} }
await _sysUserDataScopeRep.DeleteAsync(x => x.SysUserId == input.UserId); await _sysUserDataScopeRep.DeleteAsync(x => x.SysUserId == input.UserId);
foreach (var item in input.childrens)
{
var list = new List<SysUserDataScope>(); var list = new List<SysUserDataScope>();
input.childrens.ForEach(u => input.childrens.ForEach(u =>
{ {
@ -134,15 +133,13 @@ public class SysDataUserMenuService : ISysDataUserMenu, IDynamicApiController,IT
SysUserId = input.UserId, SysUserId = input.UserId,
SysMenuId=u.MenuId, SysMenuId=u.MenuId,
SysOrgId=u.OrgId SysOrgId=u.OrgId
}); });
}); });
await _sysUserDataScopeRep.InsertAsync(list); await _sysUserDataScopeRep.InsertAsync(list);
//var userdatalist = _rep.AsQueryable().ToListAsync(); //var userdatalist = _rep.AsQueryable().ToListAsync();
//_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, userdatalist); //_sysCache.Set(CommonConst.CACHE_KEY_USERDATASCOPE, userdatalist);
}
} }
catch (System.Exception) catch (System.Exception)

Loading…
Cancel
Save