公共类

booking_auth_dev
wet 2 years ago
commit 544c32a97f

@ -0,0 +1,67 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 下货纸
/// </summary>
[SugarTable("booking_letter_yard")]
[Description("下货纸")]
public class BookingLetteryard : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { 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 string Description { get; set; }
/// <summary>
/// 截单时间
/// </summary>
public DateTime? CloseDocTime { get; set; }
/// <summary>
/// 截港时间
/// </summary>
public DateTime? ClosingTime { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
public DateTime? VgmTime { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -0,0 +1,31 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱链接
/// </summary>
[SugarTable("booking_order_url")]
[Description("订舱链接")]
public class BookingOrderUrl : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { get; set; }
/// <summary>
/// 提箱小票链接
/// </summary>
public string UrlTxxp { get; set; }
/// <summary>
/// VGM链接
/// </summary>
public string UrlVgm { get; set; }
/// <summary>
/// VGM&SI链接
/// </summary>
public string UrlVgmSi { get; set; }
}
}

@ -0,0 +1,55 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 订舱样单
/// </summary>
[SugarTable("booking_sample_bill")]
[Description("订舱样单")]
public class BookingSampleBill : DBEntityTenant
{
/// <summary>
/// 订舱ID
/// </summary>
public long? BookingId { 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 string Description { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

@ -1435,6 +1435,76 @@
租户
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingLetteryard">
<summary>
下货纸
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.ToName">
<summary>
TO
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Attn">
<summary>
ATTN
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.AttnTel">
<summary>
ATTN电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.AttnMail">
<summary>
ATTN邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromName">
<summary>
FROM
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromTel">
<summary>
FROM电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.FromMail">
<summary>
FROM邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Description">
<summary>
描述
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.CloseDocTime">
<summary>
截单时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.ClosingTime">
<summary>
截港时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.VgmTime">
<summary>
截VGM时间
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingLetteryard.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingLog">
<summary>
舱单日志
@ -2220,6 +2290,27 @@
主单ID
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingOrderUrl">
<summary>
订舱链接
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.UrlTxxp">
<summary>
提箱小票链接
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingOrderUrl.UrlVgm">
<summary>
VGM链接
</summary>
</member>
<!-- Badly formed XML comment ignored for member "P:Myshipping.Application.Entity.BookingOrderUrl.UrlVgmSi" -->
<member name="T:Myshipping.Application.Entity.BookingPrintTemplate">
<summary>
订舱打印模板
@ -2265,6 +2356,61 @@
订舱备注
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingSampleBill">
<summary>
订舱样单
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.BookingId">
<summary>
订舱ID
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.ToName">
<summary>
TO
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Attn">
<summary>
ATTN
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.AttnTel">
<summary>
ATTN电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.AttnMail">
<summary>
ATTN邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromName">
<summary>
FROM
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromTel">
<summary>
FROM电话
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.FromMail">
<summary>
FROM邮箱
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Description">
<summary>
描述
</summary>
</member>
<member name="P:Myshipping.Application.Entity.BookingSampleBill.Remark">
<summary>
备注
</summary>
</member>
<member name="T:Myshipping.Application.Entity.BookingStatusLog">
<summary>
货运跟踪
@ -3166,11 +3312,21 @@
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.GetBookingStatusLog(System.Int64)">
<summary>
获取货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.SendTrace(System.String,System.String,System.String,System.String)">
<summary>
调用运踪接口
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.AddBookingStatusLog(System.Collections.Generic.List{Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto})">
<summary>
插入货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.GenReportJson(System.Int64)">
<summary>
获取用户报表的json
@ -3185,16 +3341,6 @@
<param name="type">类型,对应字典中的【订舱打印模板类型】</param>
<returns></returns>
</member>
<member name="M:Myshipping.Application.BookingOrderService.GetBookingStatusLog(System.Int64)">
<summary>
获取货运动态
</summary>
</member>
<member name="M:Myshipping.Application.BookingOrderService.AddBookingStatusLog(System.Collections.Generic.List{Myshipping.Application.Service.BookingOrder.Dto.BookingStatusLogDto})">
<summary>
插入货运动态
</summary>
</member>
<member name="P:Myshipping.Application.Service.BookingOrder.Dto.BookingLogDto.Type">
<summary>
操作类型(新增,编辑)

@ -80,6 +80,7 @@ namespace Myshipping.Application
this._statuslogdetail = statuslogdetail;
}
#region 主表和箱信息
/// <summary>
/// 分页查询订舱主表
/// </summary>
@ -402,7 +403,9 @@ namespace Myshipping.Application
}
return list;
}
#endregion
#region 日志、备注、附件、货运动态等
/// <summary>
/// 获取日志明细
/// </summary>
@ -520,6 +523,27 @@ namespace Myshipping.Application
return list;
}
/// <summary>
/// 获取货运动态
/// </summary>
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
{
var statuslog = await _statuslog.AsQueryable().Where(x => x.BookingId == Id).ToListAsync();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
foreach (var item in dto)
{
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
item.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
}
return dto;
}
#endregion
#region 运踪
/// <summary>
/// 调用运踪接口
/// </summary>
@ -550,6 +574,60 @@ namespace Myshipping.Application
_logger.LogInformation("提单号:" + MBLNO + " 调用运踪接口返回" + html.ToJsonString());
}
/// <summary>
/// 插入货运动态
/// </summary>
[AllowAnonymous]
[SqlSugarUnitOfWork]
public async Task AddBookingStatusLog(List<BookingStatusLogDto> all)
{
foreach (var item in all)
{
//清空原有数据
var old = await _statuslog.AsQueryable().Where(x => x.BookingId == item.BookingId && x.Gategory == "ship").ToListAsync();
await _statuslog.DeleteAsync(x => x.BookingId == item.BookingId && x.Gategory == "ship");
foreach (var ot in old)
{
await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id);
}
//新增数据
var bookingStatusLog = new BookingStatusLog();
bookingStatusLog.BookingId = item.BookingId;
bookingStatusLog.Gategory = "ship";
bookingStatusLog.CreatedTime = DateTime.Now;
bookingStatusLog.Status = item.Status;
bookingStatusLog.OpTiem = item.OpTiem;
bookingStatusLog.MBLNO = item.MBLNO;
var id = await _statuslog.InsertReturnSnowflakeIdAsync(bookingStatusLog);
if (item.detail != null && item.detail.Count > 0)
{
foreach (var dt in item.detail)
{
var BookingStatusLogDetail = new BookingStatusLogDetail();
BookingStatusLogDetail.PId = id;
BookingStatusLogDetail.Status = dt.Status;
BookingStatusLogDetail.CNTRNO = dt.CNTRNO;
BookingStatusLogDetail.OPTime = dt.OPTime;
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
}
}
}
}
#endregion
#region 下货纸
#endregion
#region 样单
#endregion
#region 其他
/// <summary>
/// 获取用户报表的json
/// </summary>
@ -645,69 +723,6 @@ namespace Myshipping.Application
}
}
//[HttpGet("/BookingPrintTemplate/test")]
//public async Task<string> Test(long id)
//{
// var rtn = XiahuozhiHelpler.Send(id, "9", out string msg);
// return $"{rtn} {msg}";
//}
/// <summary>
/// 获取货运动态
/// </summary>
public async Task<List<BookingStatusLogDto>> GetBookingStatusLog(long Id)
{
var statuslog = await _statuslog.AsQueryable().Where(x => x.BookingId == Id).ToListAsync();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
foreach (var item in dto)
{
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == item.Id).ToListAsync();
item.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
}
return dto;
}
/// <summary>
/// 插入货运动态
/// </summary>
[AllowAnonymous]
[SqlSugarUnitOfWork]
[HttpPost("/BookingOrder/AddBookingStatusLog")]
public async Task AddBookingStatusLog(List<BookingStatusLogDto> all)
{
foreach (var item in all)
{
//清空原有数据
var old = await _statuslog.AsQueryable().Where(x => x.BookingId == item.BookingId && x.Gategory == "ship").ToListAsync();
await _statuslog.DeleteAsync(x => x.BookingId == item.BookingId && x.Gategory == "ship");
foreach (var ot in old)
{
await _statuslogdetail.DeleteAsync(x => x.PId == ot.Id);
}
//新增数据
var bookingStatusLog = new BookingStatusLog();
bookingStatusLog.BookingId = item.BookingId;
bookingStatusLog.Gategory = "ship";
bookingStatusLog.CreatedTime = DateTime.Now;
bookingStatusLog.Status = item.Status;
bookingStatusLog.OpTiem = item.OPTime;
bookingStatusLog.MBLNO = item.MBLNO;
var id = await _statuslog.InsertReturnSnowflakeIdAsync(bookingStatusLog);
if (item.detail != null && item.detail.Count > 0)
{
foreach (var dt in item.detail)
{
var BookingStatusLogDetail = new BookingStatusLogDetail();
BookingStatusLogDetail.PId = id;
BookingStatusLogDetail.Status = dt.Status;
BookingStatusLogDetail.CNTRNO = dt.CNTRNO;
BookingStatusLogDetail.OPTime = dt.OPTime;
await _statuslogdetail.InsertAsync(BookingStatusLogDetail);
}
}
}
}
#endregion
}
}

@ -0,0 +1,31 @@
using System;
using SqlSugar;
using System.ComponentModel;
using Myshipping.Core.Entity;
namespace Myshipping.Application.Entity
{
/// <summary>
/// 钉钉客服通知群配置
/// </summary>
[SugarTable("djy_dingtalk_group_config")]
[Description("钉钉客服通知群配置")]
public class DjyDingtalkGroupConfig : DEntityBase
{
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 说明
/// </summary>
public string Desp { get; set; }
/// <summary>
/// Url
/// </summary>
public string Url { get; set; }
/// <summary>
/// 关键
/// </summary>
public string Keyword { get; set; }
}
}

@ -7908,6 +7908,156 @@
备注
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyDingtalkGroupConfigService">
<summary>
钉钉客服通知群配置服务
</summary>
</member>
<member name="M:Myshipping.Core.Service.DjyDingtalkGroupConfigService.Page(Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput)">
<summary>
分页查询钉钉客服通知群配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyDingtalkGroupConfigService.Add(Myshipping.Core.Service.AddDjyDingtalkGroupConfigInput)">
<summary>
增加钉钉客服通知群配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyDingtalkGroupConfigService.Update(Myshipping.Core.Service.UpdateDjyDingtalkGroupConfigInput)">
<summary>
更新钉钉客服通知群配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyDingtalkGroupConfigService.Delete(Myshipping.Core.Service.GetDjyDingtalkGroupConfigInput)">
<summary>
删除钉钉客服通知群配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyDingtalkGroupConfigService.Get(Myshipping.Core.Service.GetDjyDingtalkGroupConfigInput)">
<summary>
获取钉钉客服通知群配置
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Myshipping.Core.Service.DjyDingtalkGroupConfigInput">
<summary>
钉钉客服通知群配置输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigInput.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigInput.Desp">
<summary>
说明
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigInput.Url">
<summary>
Url
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigInput.Keyword">
<summary>
关键
</summary>
</member>
<member name="T:Myshipping.Core.Service.AddDjyDingtalkGroupConfigInput">
<summary>
钉钉客服通知群配置新增输入参数
</summary>
</member>
<member name="T:Myshipping.Core.Service.UpdateDjyDingtalkGroupConfigInput">
<summary>
钉钉客服通知群配置修改输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.UpdateDjyDingtalkGroupConfigInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.GetDjyDingtalkGroupConfigInput">
<summary>
钉钉客服通知群配置获取(删除)输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.GetDjyDingtalkGroupConfigInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="T:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput">
<summary>
钉钉客服通知群配置查询输入参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput.Desp">
<summary>
说明
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput.Url">
<summary>
Url
</summary>
</member>
<member name="P:Myshipping.Core.Service.QueryDjyDingtalkGroupConfigInput.Keyword">
<summary>
关键
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput">
<summary>
钉钉客服通知群配置输出参数
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput.Id">
<summary>
主键Id
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput.Desp">
<summary>
说明
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput.Url">
<summary>
Url
</summary>
</member>
<member name="P:Myshipping.Core.Service.DjyDingtalkGroupConfigOutput.Keyword">
<summary>
关键
</summary>
</member>
<member name="T:Myshipping.Core.Service.DjyEdiSettingService">
<summary>
EDI参数设置服务
@ -8561,7 +8711,7 @@
</member>
<member name="M:Myshipping.Core.Service.DjyWebsiteAccountConfigService.Add(Myshipping.Core.Service.AddDjyWebsiteAccountConfigInput)">
<summary>
增加网站账号维护(同一用户、同类型账号不会重复插入
增加网站账号维护(同一用户、同类型账号不允许重复
</summary>
<param name="input"></param>
<returns></returns>
@ -14503,6 +14653,31 @@
<param name="node"></param>
<param name="childNodeLists"></param>
</member>
<member name="T:Myshipping.Application.Entity.DjyDingtalkGroupConfig">
<summary>
钉钉客服通知群配置
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyDingtalkGroupConfig.Code">
<summary>
代码
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyDingtalkGroupConfig.Desp">
<summary>
说明
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyDingtalkGroupConfig.Url">
<summary>
Url
</summary>
</member>
<member name="P:Myshipping.Application.Entity.DjyDingtalkGroupConfig.Keyword">
<summary>
关键
</summary>
</member>
<member name="T:Myshipping.Application.Entity.DjyUserMailAccount">
<summary>
用户邮箱账号

@ -0,0 +1,116 @@
using Myshipping.Core;
using Furion.DependencyInjection;
using Furion.DynamicApiController;
using Mapster;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using System.Linq;
using System.Threading.Tasks;
using Myshipping.Application.Entity;
using Microsoft.Extensions.Logging;
using Furion.FriendlyException;
namespace Myshipping.Core.Service
{
/// <summary>
/// 钉钉客服通知群配置服务
/// </summary>
[ApiDescriptionSettings(Name = "DjyDingtalkGroupConfig", Order = 1)]
public class DjyDingtalkGroupConfigService : IDjyDingtalkGroupConfigService, IDynamicApiController, ITransient
{
private readonly SqlSugarRepository<DjyDingtalkGroupConfig> _rep;
private readonly ILogger<DjyDingtalkGroupConfig> _logger;
public DjyDingtalkGroupConfigService(SqlSugarRepository<DjyDingtalkGroupConfig> rep, ILogger<DjyDingtalkGroupConfig> logger)
{
_rep = rep;
_logger = logger;
}
/// <summary>
/// 分页查询钉钉客服通知群配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyDingtalkGroupConfig/page")]
public async Task<dynamic> Page([FromQuery] QueryDjyDingtalkGroupConfigInput input)
{
var entities = await _rep.AsQueryable()
.WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code == input.Code)
.WhereIF(!string.IsNullOrWhiteSpace(input.Desp), u => u.Desp.Contains(input.Desp.Trim()))
.WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), u => u.Keyword.Contains(input.Keyword.Trim()))
.ToPagedListAsync(input.PageNo, input.PageSize);
return entities.XnPagedResult();
}
/// <summary>
/// 增加钉钉客服通知群配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyDingtalkGroupConfig/add")]
public async Task Add(AddDjyDingtalkGroupConfigInput input)
{
var cc = _rep.Count(x => x.Code == input.Code);
if (cc > 0)
{
throw Oops.Bah("代码重复");
}
var entity = input.Adapt<DjyDingtalkGroupConfig>();
await _rep.InsertAsync(entity);
}
/// <summary>
/// 更新钉钉客服通知群配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyDingtalkGroupConfig/edit")]
public async Task Update(UpdateDjyDingtalkGroupConfigInput input)
{
var cc = _rep.Count(x => x.Code == input.Code && x.Id != input.Id);
if (cc > 0)
{
throw Oops.Bah("代码重复");
}
var entity = input.Adapt<DjyDingtalkGroupConfig>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}
/// <summary>
/// 删除钉钉客服通知群配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyDingtalkGroupConfig/delete")]
public async Task Delete(GetDjyDingtalkGroupConfigInput input)
{
var entity = await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
await _rep.DeleteAsync(entity);
}
/// <summary>
/// 获取钉钉客服通知群配置
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpGet("/DjyDingtalkGroupConfig/detail")]
public async Task<DjyDingtalkGroupConfig> Get([FromQuery] GetDjyDingtalkGroupConfigInput input)
{
return await _rep.FirstOrDefaultAsync(u => u.Id == input.Id);
}
///// <summary>
///// 获取钉钉客服通知群配置列表
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpGet("/DjyDingtalkGroupConfig/list")]
//public async Task<dynamic> List([FromQuery] QueryDjyDingtalkGroupConfigInput input)
//{
// return await _rep.ToListAsync();
//}
}
}

@ -0,0 +1,98 @@
using Myshipping.Core;
using System;
using System.ComponentModel.DataAnnotations;
namespace Myshipping.Core.Service
{
/// <summary>
/// 钉钉客服通知群配置输入参数
/// </summary>
public class DjyDingtalkGroupConfigInput
{
/// <summary>
/// 代码
/// </summary>
public virtual string Code { get; set; }
/// <summary>
/// 说明
/// </summary>
public virtual string Desp { get; set; }
/// <summary>
/// Url
/// </summary>
public virtual string Url { get; set; }
/// <summary>
/// 关键
/// </summary>
public virtual string Keyword { get; set; }
}
/// <summary>
/// 钉钉客服通知群配置新增输入参数
/// </summary>
public class AddDjyDingtalkGroupConfigInput : DjyDingtalkGroupConfigInput
{
}
/// <summary>
/// 钉钉客服通知群配置修改输入参数
/// </summary>
public class UpdateDjyDingtalkGroupConfigInput : DjyDingtalkGroupConfigInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 钉钉客服通知群配置获取(删除)输入参数
/// </summary>
public class GetDjyDingtalkGroupConfigInput
{
/// <summary>
/// 主键Id
/// </summary>
[Required(ErrorMessage = "主键Id不能为空")]
public long Id { get; set; }
}
/// <summary>
/// 钉钉客服通知群配置查询输入参数
/// </summary>
public class QueryDjyDingtalkGroupConfigInput : PageInputBase
{
/// <summary>
/// 主键Id
/// </summary>
public virtual long Id { get; set; }
/// <summary>
/// 代码
/// </summary>
public virtual string Code { get; set; }
/// <summary>
/// 说明
/// </summary>
public virtual string Desp { get; set; }
/// <summary>
/// Url
/// </summary>
public virtual string Url { get; set; }
/// <summary>
/// 关键
/// </summary>
public virtual string Keyword { get; set; }
}
}

@ -0,0 +1,36 @@
using System;
namespace Myshipping.Core.Service
{
/// <summary>
/// 钉钉客服通知群配置输出参数
/// </summary>
public class DjyDingtalkGroupConfigOutput
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 代码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 说明
/// </summary>
public string Desp { get; set; }
/// <summary>
/// Url
/// </summary>
public string Url { get; set; }
/// <summary>
/// 关键
/// </summary>
public string Keyword { get; set; }
}
}

@ -0,0 +1,16 @@
using Myshipping.Core;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Myshipping.Application.Entity;
namespace Myshipping.Core.Service
{
public interface IDjyDingtalkGroupConfigService
{
Task<dynamic> Page([FromQuery] QueryDjyDingtalkGroupConfigInput input);
Task Add(AddDjyDingtalkGroupConfigInput input);
Task Update(UpdateDjyDingtalkGroupConfigInput input);
Task Delete(GetDjyDingtalkGroupConfigInput input);
Task<DjyDingtalkGroupConfig> Get([FromQuery] GetDjyDingtalkGroupConfigInput input);
//Task<dynamic> List([FromQuery] QueryDjyDingtalkGroupConfigInput input);
}
}

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading.Tasks;
using Myshipping.Core.Entity;
using Microsoft.Extensions.Logging;
using Furion.FriendlyException;
namespace Myshipping.Core.Service
{
@ -42,24 +43,21 @@ namespace Myshipping.Core.Service
}
/// <summary>
/// 增加网站账号维护(同一用户、同类型账号不会重复插入
/// 增加网站账号维护(同一用户、同类型账号不允许重复
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("/DjyWebsiteAccountConfig/add")]
public async Task Add(AddDjyWebsiteAccountConfigInput input)
{
var entity = _rep.FirstOrDefault(x => x.TypeCode == input.TypeCode && x.CreatedUserId == UserManager.UserId);
if (entity == null)
var cc = _rep.Count(x => x.TypeCode == input.TypeCode && x.CreatedUserId == UserManager.UserId);
if (cc > 0)
{
entity = input.Adapt<DjyWebsiteAccountConfig>();
await _rep.InsertAsync(entity);
}
else
{
entity = input.Adapt(entity);
await _rep.UpdateAsync(entity);
throw Oops.Bah("已存在同类型账号");
}
var entity = input.Adapt<DjyWebsiteAccountConfig>();
await _rep.InsertAsync(entity);
}
/// <summary>
@ -70,6 +68,12 @@ namespace Myshipping.Core.Service
[HttpPost("/DjyWebsiteAccountConfig/edit")]
public async Task Update(UpdateDjyWebsiteAccountConfigInput input)
{
var cc = _rep.Count(x => x.TypeCode == input.TypeCode && x.CreatedUserId == UserManager.UserId && x.Id != input.Id);
if (cc > 0)
{
throw Oops.Bah("已存在同类型账号");
}
var entity = input.Adapt<DjyWebsiteAccountConfig>();
await _rep.AsUpdateable(entity).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
}

@ -110,5 +110,8 @@
"RulesEngineAuthKey": "clova3dXNnBldkM4bzVyUkxNcjVIS0lhUTNja2xmRVI4SDZDMkIzRURBMitKamJPb0tIRkMxemF5VlZOQ0wxUDdNeGNuTzF1NnEyOS9FS1VpeDBDZWFya0VucFR4ZE1Ca1JaUXZVb3lhdGs9",
"RulesEngineSender": "NewOceanBooking",
"RulesEngineSenderName": "新海运订舱平台",
"RulesEngineProjects": "OCEAN_BOOKING"
"RulesEngineProjects": "OCEAN_BOOKING",
"FriendlyExceptionSettings": {
"HideErrorCode": true
}
}
Loading…
Cancel
Save