服务项目联动更新主单VGM\舱单、报关、派车状态

dev
cjy 1 month ago
parent 814536a06e
commit 1b3dce9bb6

@ -14,6 +14,14 @@ namespace DS.WMS.Core.Op.Interface
{
public interface ISeaExportCommonService
{
/// <summary>
/// 更新手动更新海运出口派车报关标识
/// </summary>
/// <param name="id"></param>
/// <param name="code"></param>
/// <param name="type">类型 true 勾选保存 false 勾选取消</param>
public void UpdateSeaExportTag(long id, string code, bool type = true);
/// <summary>
/// 海运出口差异日志
/// </summary>

@ -33,6 +33,8 @@ using DS.Module.Core.Data;
using Masuit.Tools.Models;
using System.ComponentModel;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.Invoice.Dtos;
using NPOI.SS.Formula.Functions;
namespace DS.WMS.Core.Op.Method
{
@ -62,6 +64,59 @@ namespace DS.WMS.Core.Op.Method
_djyServiceStatusService = _serviceProvider.GetRequiredService<IDjyServiceStatusService>();
}
/// <summary>
/// 更新手动更新海运出口派车报关标识
/// </summary>
/// <param name="id"></param>
/// <param name="code"></param>
/// <param name="type">类型 true 勾选保存 false 勾选取消</param>
public async void UpdateSeaExportTag(long id,string code,bool type = true) {
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var order = tenantDb.Queryable<SeaExport>().Filter(null, true).First(x => x.Id == id);
var oldOrder = order.Adapt<SeaExport>();
if (type)
{
if (code == "YPC")
{
order.IsLand = true;
}
if (code == "BG")
{
order.IsCustoms = true;
}
}
else
{
if (code == "YPC")
{
order.IsLand = false;
}
if (code == "BG")
{
order.IsCustoms = false;
}
}
//order.Note = "更新主单货物状态";
await tenantDb.Updateable(order)
.UpdateColumnsIF(code == "YPC", x => new { x.IsLand })
.UpdateColumnsIF(code == "BG", x => new { x.IsCustoms })
.EnableDiffLogEvent().ExecuteCommandAsync();
// 记录日志
await SaveSeaExportLogAsync(new SeaExportSaveLog()
{
OperateType = "Update",
OldOrder = oldOrder,
NewOrder = order,
SourceCode = "UpdateSeaExportTag",
SourceName = "手动更新海运出口标识",
}, tenantDb);
}
#region 海运出口差异日志
/// <summary>
/// 忽略的字段
@ -1001,13 +1056,20 @@ namespace DS.WMS.Core.Op.Method
var oldOrder = order.Adapt<SeaExport>();
order.BusinessStatusName = status.StatusName;
order.BusinessStatus = status.SystemCode;
order.IsVGM = status.SystemCode == "YFVGM" ? true : false;
order.IsBooking = status.SystemCode == "YFCD" ? true : false;
if (status.SystemCode == "YPC")
order.IsLand = true;
if(status.SystemCode == "BG")
order.IsCustoms = true;
if (status.SystemCode == "YFVGM")
order.IsVGM = true;
if (status.SystemCode == "YFCD")
order.IsBooking = true;
//order.Note = "更新主单货物状态";
await tenantDb.Updateable(order).UpdateColumns(x => new { x.BusinessStatusName, x.BusinessStatus })
.UpdateColumnsIF(status.SystemCode == "YFVGM", x => new { x.IsVGM })
.UpdateColumnsIF(status.SystemCode == "YFCD", x => new { x.IsBooking })
.UpdateColumnsIF(status.SystemCode == "YPC", x => new { x.IsLand })
.UpdateColumnsIF(status.SystemCode == "BG", x => new { x.IsCustoms })
.EnableDiffLogEvent().ExecuteCommandAsync();
// 记录日志
await SaveSeaExportLogAsync(new SeaExportSaveLog()

@ -6,6 +6,7 @@ using DS.Module.PrintModule;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskPlat.Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@ -23,6 +24,8 @@ namespace DS.WMS.OpApi.Controllers
private readonly IUser user;
private readonly ISaasDbService saasDbService;
private readonly ISeaExportCommonService _seaComService;
/// <summary>
/// 构造函数
/// </summary>
@ -35,6 +38,7 @@ namespace DS.WMS.OpApi.Controllers
this.serviceProvider = serviceProvider;
this.user = user;
this.saasDbService = saasDbService;
this._seaComService = serviceProvider.GetRequiredService<ISeaExportCommonService>();
}
/// <summary>
@ -129,6 +133,10 @@ namespace DS.WMS.OpApi.Controllers
[Route("SaveServiceStatus")]
public async Task<DjyResult> SaveServiceStatus([FromBody] EmbedServiceProjectStatusDto req)
{
if (req.StatusCodes[0].StatusCode.Contains("BG")|| req.StatusCodes[0].StatusCode.Contains("YPC"))
{
_seaComService.UpdateSeaExportTag(long.Parse(req.businessId), req.StatusCodes[0].StatusCode,true);
}
return await _invokeService.SaveServiceStatus(req);
}
@ -142,6 +150,10 @@ namespace DS.WMS.OpApi.Controllers
[Route("CancelServiceStatus")]
public async Task<DjyResult> CancelServiceStatus([FromBody] EmbedServiceProjectStatusDto req)
{
if (req.StatusCodes[0].StatusCode.Contains("BG") || req.StatusCodes[0].StatusCode.Contains("YPC"))
{
_seaComService.UpdateSeaExportTag(long.Parse(req.businessId), req.StatusCodes[0].StatusCode, false);
}
return await _invokeService.CancelServiceStatus(req);
}

Loading…
Cancel
Save