|
|
|
@ -2,6 +2,7 @@ using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Dtos;
|
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
using DS.WMS.Core.Op.Interface;
|
|
|
|
@ -9,6 +10,7 @@ using DS.WMS.Core.System.Interface;
|
|
|
|
|
using DS.WMS.Core.System.Method;
|
|
|
|
|
using Mapster;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Org.BouncyCastle.Ocsp;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Op.Method;
|
|
|
|
@ -141,4 +143,74 @@ public class SeaExportService : ISeaExportService
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 业务单据复制
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">业务Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult SeaExportCopy(string id)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var info = tenantDb.Queryable<SeaExport>().Where(x => x.Id == long.Parse(id)).First();
|
|
|
|
|
if (info.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
|
|
|
|
|
}
|
|
|
|
|
//获取表单复制模板
|
|
|
|
|
var template = tenantDb.Queryable<CodeFormCopy>().Where(x=>x.PermissionId == 1772509201441099776).First();
|
|
|
|
|
|
|
|
|
|
var entity = new SeaExport();
|
|
|
|
|
if (template.IsNullOrEmpty()) {
|
|
|
|
|
|
|
|
|
|
var sequence = commonService.GetSequenceNext<SeaExport>();
|
|
|
|
|
if (!sequence.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
return DataResult.Failed(sequence.Message, MultiLanguageConst.SequenceSetNotExist);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
entity = info.Adapt(entity);
|
|
|
|
|
entity.Id = 0;
|
|
|
|
|
entity.ParentId = 0;
|
|
|
|
|
entity.IsBusinessLocking = false;
|
|
|
|
|
entity.IsFeeLocking = false;
|
|
|
|
|
entity.CustomerNo = sequence.Data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info.IsFeeLocking = true;
|
|
|
|
|
|
|
|
|
|
var partList = tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 费用锁定
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">业务Id</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public DataResult SeaExportFeeLook(string id)
|
|
|
|
|
{
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
var info = tenantDb.Queryable<SeaExport>().Where(x => x.Id == long.Parse(id)).First();
|
|
|
|
|
if (info.IsNullOrEmpty()) {
|
|
|
|
|
return DataResult.Failed("海运出口信息不存在!", MultiLanguageConst.SeaExportNotExist);
|
|
|
|
|
}
|
|
|
|
|
if ((bool)info.IsFeeLocking) {
|
|
|
|
|
return DataResult.Failed("海运出口信息费用已锁定!", MultiLanguageConst.SeaExportFeeLock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info.IsFeeLocking = true;
|
|
|
|
|
|
|
|
|
|
var partList= tenantDb.Queryable<SeaExport>().Where(x => x.ParentId == long.Parse(id)).ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|