修改派车任务BUG

master
jianghaiqing 7 months ago
parent b10436f32e
commit 61974718a1

@ -0,0 +1,74 @@
using Myshipping.Core.Entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application
{
/// <summary>
/// 业务比对差异记录表
/// </summary>
[SugarTable("business_compare_diff_record", TableDescription = "业务比对差异记录表")]
public class BusinessCompareDiffRecord : DBEntityTenant
{
/// <summary>
/// 业务主键
/// </summary>
[SugarColumn(ColumnName = "BUSI_ID")]
[Description("业务主键")]
public long BUSI_ID { get; set; }
/// <summary>
/// 业务类型
/// </summary>
[SugarColumn(ColumnName = "BUSI_TYPE")]
[Description("业务类型")]
public long BUSI_TYPE { get; set; }
/// <summary>
/// 任务主键
/// </summary>
[SugarColumn(ColumnName = "TASK_ID")]
[Description("任务主键")]
public long TASK_ID { get; set; }
/// <summary>
/// 打印时间
/// </summary>
[SugarColumn(ColumnName = "PRINT_DATE")]
[Description("打印时间")]
public Nullable<DateTime> PRINT_DATE { get; set; }
/// <summary>
/// 比对类型 BC_MODIFY-BC变更比对
/// </summary>
[SugarColumn(ColumnName = "COMPARE_TYPE")]
[Description("比对类型")]
public string COMPARE_TYPE { get; set; }
/// <summary>
/// 比对结果JSON
/// </summary>
[SugarColumn(ColumnName = "COMPARE_RLT")]
[Description("比对结果JSON")]
public string COMPARE_RLT { get; set; }
/// <summary>
/// 比对差异项数
/// </summary>
[SugarColumn(ColumnName = "COMPARE_DIFF_NUM")]
[Description("比对差异项数")]
public Nullable<int> COMPARE_DIFF_NUM { get; set; }
/// <summary>
/// 比对批次号
/// </summary>
[SugarColumn(ColumnName = "COMPARE_BATCHNO")]
[Description("比对批次号")]
public string COMPARE_BATCHNO { get; set; }
}
}

@ -0,0 +1,73 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Myshipping.Application.Entity.TaskManagePlat
{
/// <summary>
/// 任务截单回执箱明细
/// </summary>
[SugarTable("task_si_submitted_ctn")]
[Description("任务截单回执箱明细")]
public class TaskSISubmittedCtn : TaskManageDbEntity
{
/// <summary>
/// 父主键
/// </summary>
public string P_PKID { get; set; }
/// <summary>
/// 箱型代码
/// </summary>
public string CTNCODE { get; set; }
/// <summary>
/// 箱型
/// </summary>
public string CTNALL { 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 string WEIGHTYPE { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WEIGHKGS { get; set; }
}
}

@ -1,5 +1,6 @@
using Mapster;
using Myshipping.Application.Entity;
using Myshipping.Application.Entity.TaskManagePlat;
using Myshipping.Application.Service.TaskManagePlat.Dtos;
using System;
using System.Collections.Generic;
@ -1026,7 +1027,33 @@ namespace Myshipping.Application
.Map(dest => dest.CARRIER, src => src.Carrier)
.Map(dest => dest.TAKE_ISSUETYPE_NAME, src => src.TakeIssueTypeName)
.Map(dest => dest.ISSUETYPE, src => src.IssueType)
.Map(dest => dest.NOTICE_DATE, src => src.NoticeDate);
.Map(dest => dest.NOTICE_DATE, src => src.NoticeDate)
.Map(dest => dest.SUBMITTED_DATE, src => src.SubmittedDate)
.Map(dest => dest.BILLOF_NUM, src => src.BillOfNum)
.Map(dest => dest.RELEASE_INSTRUCTION, src => src.ReleaseInstruction)
.Map(dest => dest.SI_SUBTYPE, src => src.SISubType)
.Map(dest => dest.SHIPPER, src => src.Shipper)
.Map(dest => dest.CONSIGNEE, src => src.Consignee)
.Map(dest => dest.NOTIFYPARTY, src => src.NotifyParty)
.Map(dest => dest.NOTIFYPARTY2, src => src.NotifyParty2)
.Map(dest => dest.HSCODE, src => src.HSCode)
.Map(dest => dest.DESCRIPTION, src => src.Description)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.KINDPKGS, src => src.KindPKGS)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM);
config.ForType<TaskManageOrderSIFeedBackContaInfo, TaskSISubmittedCtn>()
.Map(dest => dest.CNTRNO, src => src.ContaNo)
.Map(dest => dest.CTNCODE, src => src.ContaType)
.Map(dest => dest.CTNALL, src => src.ContaTypeName)
.Map(dest => dest.SEALNO, src => src.SealNo)
.Map(dest => dest.PKGS, src => src.PKGS)
.Map(dest => dest.KINDPKGS, src => src.KINDPKGS)
.Map(dest => dest.KGS, src => src.KGS)
.Map(dest => dest.CBM, src => src.CBM)
.Map(dest => dest.WEIGHTYPE, src => src.WeighType)
.Map(dest => dest.WEIGHKGS, src => src.WeighKGS);
config.ForType<TaskManageOrderDraftInfo, TaskDraftInfo>()
.Map(dest => dest.MBL_NO, src => src.MBlNo)

@ -52,5 +52,21 @@ namespace Myshipping.Application
/// </summary>
/// <example>20GP</example>
public string ContaTypeName { get; set; }
/// <summary>
/// 包装
/// </summary>
public string KINDPKGS { get; set; }
/// <summary>
/// 称重方式
/// </summary>
public string WeighType { get; set; }
/// <summary>
/// 称重重量
/// </summary>
public Nullable<decimal> WeighKGS { get; set; }
}
}

@ -39,5 +39,12 @@ namespace Myshipping.Application
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> SearchAndConnectBookingInfo(string taskPkId);
/// <summary>
/// 处理SI截单回执
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
Task<TaskManageOrderResultDto> ProcessSISubmitted(string taskPkId);
}
}

@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Myshipping.Application.Entity;
using Myshipping.Core;
using Myshipping.Core.Service;
using System;
using System.Collections.Generic;
using System.Linq;
@ -24,20 +25,29 @@ namespace Myshipping.Application
private readonly SqlSugarRepository<TaskSISubmitted> _taskSISubmittedRepository;
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseRepository;
private readonly SqlSugarRepository<BookingOrder> _bookingOrderRepository;
private readonly SqlSugarRepository<BusinessCompareDiffRecord> _businessCompareDiffRecordRepository;
private readonly ILogger<TaskManageSISubmittedService> _logger;
private readonly IBookingValueAddedService _bookingValueAddedService;
private readonly IDjyTenantParamService _djyTenantParamService;
//租户SI回执是否自动更新订舱
const string CONST_SI_SUBMITTED_DEFAULT_PARAM = "SI_SUBMITTED_AUTO_UPDATE_ORDER";
public TaskManageSISubmittedService(ILogger<TaskManageSISubmittedService> logger,
SqlSugarRepository<TaskSISubmitted> taskSISubmittedRepository,
SqlSugarRepository<TaskBaseInfo> taskBaseRepository,
SqlSugarRepository<BookingOrder> bookingOrderRepository,
IBookingValueAddedService bookingValueAddedService)
SqlSugarRepository<BusinessCompareDiffRecord> businessCompareDiffRecordRepository,
IBookingValueAddedService bookingValueAddedService, IDjyTenantParamService djyTenantParamService)
{
_logger = logger;
_taskSISubmittedRepository = taskSISubmittedRepository;
_taskBaseRepository = taskBaseRepository;
_bookingOrderRepository = bookingOrderRepository;
_bookingValueAddedService = bookingValueAddedService;
_djyTenantParamService = djyTenantParamService;
_businessCompareDiffRecordRepository = businessCompareDiffRecordRepository;
}
#region 获取截单回执详情
@ -165,7 +175,7 @@ namespace Myshipping.Application
#region 重新处理截单任务
/// <summary>
/// 重新处理截单任务
/// 对未匹配订舱订单的任务记录重新对应订订单
/// 对未匹配订舱订单的任务记录重新对应订订单
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
@ -190,7 +200,7 @@ namespace Myshipping.Application
string mblNo = siSubmitted.MBL_NO.ToUpper().Trim();
var bookingInfo = _bookingOrderRepository.AsQueryable().Filter(null, true)
.FirstAsync(a => a.MBLNO == mblNo && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0));
.FirstAsync(a => a.MBLNO == mblNo && a.IsDeleted == false && (a.ParentId == null || a.ParentId == 0) && a.TenantId == UserManager.TENANT_ID);
if(bookingInfo == null)
throw Oops.Oh($"提单号{mblNo}未提取有效的订舱订单");
@ -215,5 +225,70 @@ namespace Myshipping.Application
return result;
}
#endregion
#region 处理SI截单回执
/// <summary>
/// 处理SI截单回执
/// </summary>
/// <param name="taskPkId">截单回执任务主键</param>
/// <returns>返回回执</returns>
public async Task<TaskManageOrderResultDto> ProcessSISubmitted(string taskPkId)
{
TaskManageOrderResultDto result = new TaskManageOrderResultDto();
try
{
/*
1SI_SUBMITTED_AUTO_UPDATE_ORDER=ENABLE
2
3
*/
var taskBase = _taskBaseRepository.AsQueryable().First(a => a.PK_ID == taskPkId);
if (taskBase == null)
throw Oops.Oh($"任务主键{taskPkId}无法获取业务信息");
var siSubmitted = _taskSISubmittedRepository.AsQueryable().First(a => a.TASK_ID == taskBase.PK_ID);
if (siSubmitted == null)
throw Oops.Oh($"截单回执主键{taskPkId}无法获取业务信息");
if (siSubmitted.BOOKING_ID.HasValue)
throw Oops.Oh($"当前截单回执已有匹配的订舱订单");
DjyTenantParamValueOutput paramConfig = null;
var paramList = _djyTenantParamService.GetParaCodeWithValue(new[] { CONST_SI_SUBMITTED_DEFAULT_PARAM }).GetAwaiter().GetResult();
if (paramList != null && paramList.Count > 0)
{
paramConfig = paramList.FirstOrDefault(a => a.ParaCode.Equals(CONST_SI_SUBMITTED_DEFAULT_PARAM, StringComparison.OrdinalIgnoreCase));
}
if(paramConfig != null)
{
//更新前先比对一遍差异
//更新订舱数据
//更新任务的状态
//直接完成SI的回执任务
}
else
{
result.msg = "当前租户没开通自动SI回执是否自动更新订舱";
}
}
catch (Exception ex)
{
result.succ= false;
result.msg = ex.Message;
}
return result;
}
#endregion
}
}

@ -17,6 +17,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Extensions.Logging;
using Myshipping.Application.EDI;
using Myshipping.Application.Entity;
using Myshipping.Application.Entity.TaskManagePlat;
using Myshipping.Application.Helper;
using Myshipping.Application.Service.BookingOrder;
using Myshipping.Application.Service.BookingSlot.Dto;
@ -76,7 +77,7 @@ namespace Myshipping.Application
{
private readonly SqlSugarRepository<TaskBaseInfo> _taskBaseInfoRepository;
private readonly SqlSugarRepository<TaskSISubmitted> _taskSISubmittedRepository;
private readonly SqlSugarRepository<TaskSIFeedBackContaInfo> _taskSIFeedBackContaInfoRepository;
private readonly SqlSugarRepository<TaskSISubmittedCtn> _taskSISubmittedCtnRepository;
private readonly SqlSugarRepository<TaskBillFeeDetailInfo> _taskBillFeeDetailInfoRepository;
private readonly SqlSugarRepository<TaskFileInfo> _taskFileInfoRepository;
private readonly SqlSugarRepository<TaskEmailInfo> _taskEmailInfoRepository;
@ -140,7 +141,7 @@ namespace Myshipping.Application
public TaskManageService(SqlSugarRepository<TaskBaseInfo> taskBaseInfoRepository,
SqlSugarRepository<TaskSISubmitted> taskSISubmittedRepository,
SqlSugarRepository<TaskSIFeedBackContaInfo> taskSIFeedBackContaInfoRepository,
SqlSugarRepository<TaskSISubmittedCtn> taskSISubmittedCtnRepository,
SqlSugarRepository<TaskBillFeeDetailInfo> taskBillFeeDetailInfoRepository,
SqlSugarRepository<TaskFileInfo> taskFileInfoRepository,
SqlSugarRepository<TaskEmailInfo> taskEmailInfoRepository,
@ -186,7 +187,7 @@ namespace Myshipping.Application
{
_taskBaseInfoRepository = taskBaseInfoRepository;
_taskSISubmittedRepository = taskSISubmittedRepository;
_taskSIFeedBackContaInfoRepository = taskSIFeedBackContaInfoRepository;
_taskSISubmittedCtnRepository = taskSISubmittedCtnRepository;
_taskBillFeeDetailInfoRepository = taskBillFeeDetailInfoRepository;
_taskFileInfoRepository = taskFileInfoRepository;
_taskEmailInfoRepository = taskEmailInfoRepository;
@ -348,9 +349,18 @@ namespace Myshipping.Application
};
//这里只有派车不是公共任务,其他基本都是公共任务
if (info.Main.TaskType != TaskBaseTypeEnum.TRUCK_DISPATCH)
if (info.Main.TaskType == TaskBaseTypeEnum.TRUCK_DISPATCH)
{
userTendInfo = GetUserTendInfo(info.Main.RecvUserId);
taskInfo.IS_PUBLIC = 0;
}
else
{
taskInfo.IS_PUBLIC = 1;
}
}
else if (!string.IsNullOrWhiteSpace(info.Main.DJYRecvUserId) && string.IsNullOrWhiteSpace(info.Main.TaskUserId))
{
userTendInfo = GetUserTendInfoByDJYUserId(info.Main.DJYRecvUserId, info.Main.DJYRecvUserEmail);
@ -626,18 +636,18 @@ namespace Myshipping.Application
taskSISubmitted.TenantId = taskInfo.TenantId;
taskSISubmitted.TenantName = taskInfo.TenantName;
await _taskSISubmittedRepository.InsertAsync(taskSISubmitted);
_taskSISubmittedRepository.Insert(taskSISubmitted);
/*
//SI反馈箱信息入库
if (info.Main.SIFeedBack.ContaList != null && info.Main.SIFeedBack.ContaList.Count > 0)
{
info.Main.SIFeedBack.ContaList.ForEach(async ctn =>
{
var contaInfo = ctn.Adapt<TaskSIFeedBackContaInfo>();
var contaInfo = ctn.Adapt<TaskSISubmittedCtn>();
contaInfo.PK_ID = IDGen.NextID().ToString();
contaInfo.P_PKID = taskSIFeedBackInfo.PK_ID;
contaInfo.P_PKID = taskSISubmitted.PK_ID;
contaInfo.CreatedTime = taskInfo.CreatedTime;
contaInfo.UpdatedTime = taskInfo.CreatedTime;
@ -647,9 +657,11 @@ namespace Myshipping.Application
contaInfo.TenantId = taskInfo.TenantId;
contaInfo.TenantName = taskInfo.TenantName;
await _taskSIFeedBackContaInfoRepository.InsertAsync(contaInfo);
_taskSISubmittedCtnRepository.Insert(contaInfo);
});
}*/
}
//这里入库完成后执行SI的处理
}
#endregion

Loading…
Cancel
Save