wanghaomei 2 years ago
commit 5c2d948f15

@ -876,6 +876,11 @@ namespace Myshipping.Application.Entity
/// </summary>
public string LstShipOrderCompareRltName { get; set; }
/// <summary>
/// 最后下货纸比对方式 MANUAL-手动 AUTO-自动
/// </summary>
public string LstShipOrderCompareMode { get; set; }
/// <summary>
/// 是否占舱
/// </summary>

@ -211,5 +211,10 @@ namespace Myshipping.Application.Entity
/// </summary>
[Description("派车流水号")]
public string TruckFlowNo { get; set; }
/// <summary>
/// 任务流水号
/// </summary>
[Description("任务流水号")]
public string TaskNo { get; set; }
}
}

@ -65,71 +65,84 @@ namespace Myshipping.Application
try
{
BookingTruck entity = info.Adapt<BookingTruck>();
var id = InnerSave(info);
if(entity == null)
throw Oops.Oh($"派车信息不能为空");
result.succ = true;
result.msg = "保存成功";
result.ext = id;
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"保存派车异常,原因:{ex.Message}";
}
List<BookingTruckCtn> entityCtnList = info.ContaList.Adapt<List<BookingTruckCtn>>();
return result;
}
if (entity.Id == 0)
{
_bookingTruckRepository.Insert(entity);
if (entityCtnList.Count > 0)
{
entityCtnList.ForEach(async ctn =>
{
ctn.TruckId = entity.Id;
/// <summary>
/// 保存内部方法
/// </summary>
/// <param name="info">派车信息</param>
/// <returns>返回派车Id</returns>
private async Task<long> InnerSave(BookingTruckDto info)
{
BookingTruck entity = info.Adapt<BookingTruck>();
await _bookingTruckContaRepository.InsertAsync(ctn);
});
}
}
else
if (entity == null)
throw Oops.Oh($"派车信息不能为空");
List<BookingTruckCtn> entityCtnList = info.ContaList.Adapt<List<BookingTruckCtn>>();
if (entity.Id == 0)
{
_bookingTruckRepository.Insert(entity);
if (entityCtnList.Count > 0)
{
await _bookingTruckRepository.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckId,
it.TruckName,
it.TruckCode,
}).ExecuteCommandAsync();
if (entityCtnList.Count > 0)
entityCtnList.ForEach(async ctn =>
{
entityCtnList.ForEach(async ctn =>
{
ctn.TruckId = entity.Id;
ctn.TruckId = entity.Id;
await _bookingTruckContaRepository.AsUpdateable(ctn).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
}).ExecuteCommandAsync();
});
}
await _bookingTruckContaRepository.InsertAsync(ctn);
});
}
result.succ = true;
result.msg = "保存成功";
result.ext = entity.Id;
}
catch (Exception ex)
else
{
result.succ = false;
result.msg = $"保存派车异常,原因:{ex.Message}";
await _bookingTruckRepository.AsUpdateable(entity).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
it.BookingId,
it.TruckId,
it.TruckName,
it.TruckCode,
}).ExecuteCommandAsync();
if (entityCtnList.Count > 0)
{
entityCtnList.ForEach(async ctn =>
{
ctn.TruckId = entity.Id;
await _bookingTruckContaRepository.AsUpdateable(ctn).IgnoreColumns(it => new
{
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.IsDeleted,
}).ExecuteCommandAsync();
});
}
}
return result;
return entity.Id;
}
/// <summary>
@ -472,11 +485,19 @@ namespace Myshipping.Application
try
{
var model = InnerCreateTruckFromBookingOrder(bookingId);
result.succ = true;
if (model != null && model.ContaList != null && model.ContaList.Count > 0)
{
result.ext = model.ContaList;
}
}
catch (Exception ex)
{
result.succ = false;
result.msg = $"引入订舱详情生成派车信息异常,原因:{ex.Message}";
}
return result;
@ -492,9 +513,21 @@ namespace Myshipping.Application
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
/*
1
2
3ID
4
*/
try
{
//先保存
var id = InnerSave(info);
//更新派车订单为已提交
//推送新增派车任务接口
}
catch (Exception ex)
{
@ -514,6 +547,13 @@ namespace Myshipping.Application
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
/*
1
2
3ID
4
*/
try
{
@ -534,6 +574,14 @@ namespace Myshipping.Application
[HttpGet("/BookingTruck/Cancel")]
public async Task<TaskManageOrderResultDto> Cancel(long id)
{
/*
1
2
3
4
*/
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
@ -557,6 +605,13 @@ namespace Myshipping.Application
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
/*
1
2
3
4
*/
try
{

@ -96,5 +96,17 @@ namespace Myshipping.Application
/// 备注
/// </summary>
public string REMARK { get; set; }
/// <summary>
/// 车牌号
/// </summary>
public string CarNumber { get; set; }
/// <summary>
/// 司机
/// </summary>
public string CarDriver { get; set; }
/// <summary>
/// 司机电话
/// </summary>
public string CarDriverTel { get; set; }
}
}

@ -361,7 +361,8 @@ namespace Myshipping.Application
it.LstShipOrderCompareId,
it.LstShipOrderCompareDate,
it.LstShipOrderCompareRlt,
it.LstShipOrderCompareRltName
it.LstShipOrderCompareRltName,
it.LstShipOrderCompareMode
}).ExecuteCommandAsync();
//记录日志
@ -977,7 +978,8 @@ namespace Myshipping.Application
it.CreatedUserName,
it.LstShipOrderCompareId,
it.LstShipOrderCompareDate,
it.LstShipOrderCompareRltName
it.LstShipOrderCompareRltName,
it.LstShipOrderCompareMode
}).ExecuteCommandAsync();
var ctnlist = await _repCtn.AsQueryable().Where(x => x.BILLID == main.Id).Select(x => x.Id).ToListAsync();
await _repCtn.DeleteAsync(x => x.BILLID == main.Id);

@ -1,4 +1,5 @@
using System;
using Myshipping.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -116,5 +117,14 @@ namespace Myshipping.Application
/// <param name="QuerySearch">约号参数台账查询请求</param>
/// <returns>返回结果</returns>
Task<dynamic> GetParaContractNoPageAsync(QueryParaContractNoDto QuerySearch);
/// <summary>
/// 检索车队参数
/// </summary>
/// <param name="queryItem">检索值</param>
/// <param name="queryType">检索类型 fleet-车队默认customs_broker-报关行</param>
/// <param name="top">默认最大行数</param>
/// <returns>返回回执</returns>
//Task<List<DjyCustomerDto>> QuerytDjyCustomerInfo(string queryItem, string queryType = "fleet", int top = 10);
}
}

@ -135,8 +135,12 @@ namespace Myshipping.Application
if (orderInfo != null)
{
orderInfo.LstShipOrderCompareDate = bDate;
if (compareResult.succ)
{
orderInfo.LstShipOrderCompareMode = "MANUAL";
if (compareResult.extra.IsExistsDiff)
{
orderInfo.LstShipOrderCompareRlt = "DIFF";
@ -147,7 +151,6 @@ namespace Myshipping.Application
orderInfo.LstShipOrderCompareRlt = "NO_DIFF";
orderInfo.LstShipOrderCompareRltName = "正常";
}
orderInfo.LstShipOrderCompareDate = bDate;
}
else
{
@ -165,6 +168,7 @@ namespace Myshipping.Application
it.LstShipOrderCompareDate,
it.LstShipOrderCompareRlt,
it.LstShipOrderCompareRltName,
it.LstShipOrderCompareMode,
}).ExecuteCommandAsync();
}

@ -9922,6 +9922,15 @@
<param name="type">类型参考字典参数客户属性djy_cust_prop</param>
<returns></returns>
</member>
<member name="M:Myshipping.Core.Service.DjyCustomerService.QuerytDjyCustomerInfo(System.String,System.String[],System.Int32)">
<summary>
检索往来单位(包含车队)
</summary>
<param name="queryItem">检索值</param>
<param name="queryType">检索类型数组(可传多个) fleet-车队customs_broker-报关行</param>
<param name="top">默认最大行数</param>
<returns>返回回执</returns>
</member>
<member name="T:Myshipping.Core.Service.DjyCustomerContactDto">
<summary>
订舱客户联系人输出参数
@ -10772,6 +10781,15 @@
服务项目
</summary>
</member>
<member name="M:Myshipping.Core.Service.IDjyCustomerService.QuerytDjyCustomerInfo(System.String,System.String[],System.Int32)">
<summary>
检索车队参数
</summary>
<param name="queryItem">检索值</param>
<param name="queryType">检索类型数组(可传多个) fleet-车队customs_broker-报关行</param>
<param name="top">默认最大行数</param>
<returns>返回回执</returns>
</member>
<member name="T:Myshipping.Core.Service.DjyDingtalkGroupConfigService">
<summary>
钉钉客服通知群配置服务

@ -11,6 +11,9 @@ using System.Collections.Generic;
using Furion.FriendlyException;
using Furion.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Text.RegularExpressions;
using NPOI.Util;
namespace Myshipping.Core.Service
{
@ -203,5 +206,64 @@ namespace Myshipping.Core.Service
return entities.XnPagedResult();
}
/// <summary>
/// 检索往来单位(包含车队)
/// </summary>
/// <param name="queryItem">检索值</param>
/// <param name="queryType">检索类型数组(可传多个) fleet-车队customs_broker-报关行</param>
/// <param name="top">默认最大行数</param>
/// <returns>返回回执</returns>
[HttpGet("/DjyCustomer/QuerytDjyCustomerInfo")]
public async Task<List<DjyCustomerOutput>> QuerytDjyCustomerInfo([FromQuery] string queryItem, [FromQuery] string[] queryType, [FromQuery] int top = 10)
{
List<DjyCustomerOutput> list = new List<DjyCustomerOutput>();
try
{
string sqlWhere = "1=1";
if (!string.IsNullOrWhiteSpace(queryItem))
{
sqlWhere += $" and (CodeName like '%{queryItem.Trim()}%' or ShortName like '%{queryItem.Trim()}%' or FullName like '%{queryItem.Trim()}%')";
}
if (queryType.Length > 0)
{
sqlWhere += $" and PropString REGEXP '" + string.Join("|", queryType) + "'";
}
var entityList = await _rep.AsQueryable().Where(sqlWhere).Take(top).OrderBy(a => a.FullName)
.ToListAsync();
if (entityList.Count > 0)
{
list = entityList.Adapt<List<DjyCustomerOutput>>();
var custsArg = list.Select(a => a.Id).ToArray();
var contactList = _repContact.AsQueryable()
.Where(a => custsArg.Contains(a.CustomerId.Value)).ToList();
list = list.GroupJoin(contactList, l => l.Id, r => r.CustomerId.Value, (l, r) =>
{
var curList = r.ToList();
if (curList.Count > 0)
l.Contacts = curList.Adapt<List<DjyCustomerContactOutput>>();
return l;
}).ToList();
}
}
catch (Exception ex)
{
_logger.LogError("检索车队异常请求queryItem={0}queryType={1}top={2} 异常:{3}", queryItem, queryType, top, ex.Message);
throw Oops.Bah("检索车队异常,异常{msg}", ex.Message);
}
return list;
}
}
}

@ -15,5 +15,14 @@ namespace Myshipping.Core.Service
Task<DjyCustomerOutput> Detail([FromQuery] GetDjyCustomerInput input);
//Task<dynamic> List([FromQuery] QueryBookingCustomerInput input);
Task<List<DjyCustomerContactOutput>> ListContact(long customerId);
/// <summary>
/// 检索车队参数
/// </summary>
/// <param name="queryItem">检索值</param>
/// <param name="queryType">检索类型数组(可传多个) fleet-车队customs_broker-报关行</param>
/// <param name="top">默认最大行数</param>
/// <returns>返回回执</returns>
Task<List<DjyCustomerOutput>> QuerytDjyCustomerInfo(string queryItem, string[] queryType, int top = 10);
}
}

Loading…
Cancel
Save