jianghaiqing 1 month ago
commit d852e35701

@ -235,9 +235,9 @@ namespace DS.Module.Core
#region 工作流--其他任务类型
/// <summary>
/// 退舱
/// 退舱确认
/// </summary>
[Description("退舱")]
[Description("退舱确认")]
RETURN_CABIN = 401,
/// <summary>
@ -245,6 +245,12 @@ namespace DS.Module.Core
/// </summary>
[Description("退舱审核")]
RETURN_CABIN_AUDIT = 402,
/// <summary>
/// 退舱入池
/// </summary>
[Description("退舱入池")]
RETURN_CABIN_POOL = 403,
#endregion
#region 基础数据审核
@ -278,9 +284,9 @@ namespace DS.Module.Core
[Description("费用删除")]
FEE_DELETE_AUDIT = 603,
/// <summary>
/// 费用整审核
/// 费用整审核
/// </summary>
[Description("费用整审核")]
[Description("费用整审核")]
FEE_BUSINESS_AUDIT = 604,
#endregion
@ -309,11 +315,11 @@ namespace DS.Module.Core
/// </summary>
[Description("SI提交驳回")]
WAIT_SI_REJECTED = -206,
/// <summary>
/// 退舱驳回
/// </summary>
[Description("退舱驳回")]
RETURN_CABIN_REJECTED = -401,
///// <summary>
///// 退舱驳回
///// </summary>
//[Description("退舱驳回")]
//RETURN_CABIN_REJECTED = -401,
/// <summary>
/// 退舱审核驳回
/// </summary>
@ -327,7 +333,7 @@ namespace DS.Module.Core
/// <summary>
/// 客户干系人审核驳回
/// </summary>
[Description("客户干系人审核")]
[Description("客户干系人审核驳回")]
CLIENT_STAKEHOLDER_REJECTED = -502,
/// <summary>
/// 费用审核驳回
@ -345,9 +351,9 @@ namespace DS.Module.Core
[Description("费用删除驳回")]
FEE_DELETE_REJECTED = -603,
/// <summary>
/// 费用整审核驳回
/// 费用整审核驳回
/// </summary>
[Description("费用整审核驳回")]
[Description("费用整审核驳回")]
FEE_BUSINESS_REJECTED = -604,
/// <summary>
/// 付费申请驳回

@ -434,6 +434,11 @@ namespace DS.WMS.Core.Fee.Dtos
/// 当票业务利润(应收-应付)是否为正数
/// </summary>
public bool IsPositiveProfit { get; set; }
/// <summary>
/// 是否为整票审核
/// </summary>
public bool IsBusinessAudit { get; set; }
}
/// <summary>

@ -80,13 +80,21 @@ public interface IFeeRecordService
Task<DataResult> WithdrawAsync(params long[] ids);
/// <summary>
/// 发起整审核
/// 发起整审核
/// </summary>
/// <param name="bid">业务ID</param>
/// <param name="type">业务类型</param>
/// <returns></returns>
Task<DataResult> SubmitBusinessAuditAsync(long bid, BusinessType type);
/// <summary>
/// 撤销整票审批
/// </summary>
/// <param name="bid">业务ID</param>
/// <param name="type">业务类型</param>
/// <returns></returns>
Task<DataResult> WithdrawBusinessAsync(long bid, BusinessType type);
/// <summary>
/// 回写业务表费用状态
/// </summary>

@ -29,7 +29,7 @@ namespace DS.WMS.Core.Fee.Method
public static readonly FeeStatus[] AuditStatusArray = [FeeStatus.AuditSubmitted, FeeStatus.ApplyDeletion, FeeStatus.ApplyModification];
//一键审核支持的类型
static readonly TaskBaseTypeEnum[] AuditTypes = [TaskBaseTypeEnum.FEE_AUDIT, TaskBaseTypeEnum.FEE_MODIFY_AUDIT, TaskBaseTypeEnum.FEE_DELETE_AUDIT];
static readonly TaskBaseTypeEnum[] AuditTypes = [TaskBaseTypeEnum.FEE_AUDIT, TaskBaseTypeEnum.FEE_MODIFY_AUDIT, TaskBaseTypeEnum.FEE_DELETE_AUDIT, TaskBaseTypeEnum.FEE_BUSINESS_AUDIT];
readonly IClientFlowInstanceService flowService;
readonly IFeeRecordService feeService;
@ -53,17 +53,26 @@ namespace DS.WMS.Core.Fee.Method
/// <returns></returns>
public async Task<DataResult<List<FeeAuditBusiness>>> GetListAsync(PageRequest<bool> request)
{
long[]? ids = null;
long[]? ids1 = null;
long[]? ids2 = null;
if (request.OtherQueryCondition)
{
ids = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).Distinct().ToArrayAsync();
var flows = await GetCurrentFlowsQuery(AuditTypes).Select(x => new
{
x.BusinessId,
x.BusinessType,
x.AuditType
}).ToListAsync();
//没有待审批的列表直接返回不再执行后续查询
if (ids.Length == 0)
if (flows.Count == 0)
return DataResult<List<FeeAuditBusiness>>.PageList(0, null, MultiLanguageConst.DataQuerySuccess);
ids1 = flows.Where(x => x.AuditType != TaskBaseTypeEnum.FEE_BUSINESS_AUDIT).Select(x => x.BusinessId).ToArray();
ids2 = flows.Where(x => x.AuditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT).Select(x => x.BusinessId).ToArray();
}
var queryList = CreateQuery(ids);
var queryList = CreateQuery(ids1, ids2);
if (!request.QueryCondition.IsNullOrEmpty())
{
@ -93,8 +102,13 @@ namespace DS.WMS.Core.Fee.Method
return result;
}
//创建各项费用数据的查询并集
internal ISugarQueryable<FeeAuditBusiness> CreateQuery(params long[]? feeIds)
/// <summary>
/// 创建各项费用数据的查询并集
/// </summary>
/// <param name="ids1">费用ID</param>
/// <param name="ids2">业务ID</param>
/// <returns></returns>
internal ISugarQueryable<FeeAuditBusiness> CreateQuery(long[]? ids1, long[]? ids2)
{
//海运出口
var query1 = TenantDb.Queryable<SeaExport, BusinessFeeStatus, FeeRecord, CodeSource, CodeSourceDetail>((s, b, f, cs, csd) => new JoinQueryInfos(
@ -103,7 +117,7 @@ namespace DS.WMS.Core.Fee.Method
JoinType.Left, s.SourceId == cs.Id,
JoinType.Left, s.SourceDetailId == csd.Id
))
.WhereIF(feeIds != null && feeIds.Length > 0, (s, b, f) => feeIds.Contains(f.Id))
.WhereIF(ids1 != null && ids1.Length > 0 || ids2 != null && ids2.Length > 0, (s, b, f) => ids1.Contains(f.Id) || ids2.Contains(s.Id))
.GroupBy(s => s.Id)
.Select((s, b, f, cs, csd) => new FeeAuditBusiness
{
@ -330,7 +344,7 @@ namespace DS.WMS.Core.Fee.Method
BusinessType = request.BusinessType,
Carrier = x.Carrier,
CustomerNo = x.CustomerNo,
CustomerName = x.CustomerName,
DischargePort = x.DischargePort,
ETA = x.ETA,
@ -343,14 +357,23 @@ namespace DS.WMS.Core.Fee.Method
if (pendingAudit != null)
{
long[] ids = [];
long[] ids1 = [];
long[] ids2 = [];
if (request.AuditOnly)
{
ids = await GetCurrentFlowsQuery(AuditTypes).Select(x => x.BusinessId).Distinct().ToArrayAsync();
var flows = await GetCurrentFlowsQuery(AuditTypes).Select(x => new
{
x.BusinessId,
x.BusinessType,
x.AuditType
}).ToListAsync();
//没有待审批的列表直接返回不再执行后续查询
if (ids.Length == 0)
if (flows.Count == 0)
return DataResult<PendingAuditFee>.Success(pendingAudit, MultiLanguageConst.DataQuerySuccess);
ids1 = flows.Where(x => x.AuditType != TaskBaseTypeEnum.FEE_BUSINESS_AUDIT).Select(x => x.BusinessId).ToArray();
ids2 = flows.Where(x => x.AuditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT).Select(x => x.BusinessId).ToArray();
}
var fees = await TenantDb.Queryable<FeeRecord>().Where(f => f.BusinessId == request.Id && f.BusinessType == request.BusinessType)
@ -362,11 +385,12 @@ namespace DS.WMS.Core.Fee.Method
}).ToListAsync();
pendingAudit.IsPositiveProfit = fees.Where(x => x.FeeType == FeeType.Receivable).Sum(x => x.Amount * (x.ExchangeRate ?? 1))
- fees.Where(x => x.FeeType == FeeType.Payable).Sum(x => x.Amount * (x.ExchangeRate ?? 1)) > 0;
pendingAudit.IsBusinessAudit = await flowService.Exists(TaskBaseTypeEnum.FEE_BUSINESS_AUDIT, request.BusinessType, null, request.Id);
var query1 = TenantDb.Queryable<FeeRecord>().Where(f => f.BusinessId == request.Id && f.BusinessType == request.BusinessType)
.InnerJoin<SeaExport>((f, s) => f.BusinessId == s.Id)
.LeftJoin<InfoClient>((f, s, i) => f.CustomerId == i.Id)
.WhereIF(ids.Length > 0, (f, s, i) => ids.Contains(f.Id) && AuditStatusArray.Contains(f.FeeStatus))
.WhereIF(ids1.Length > 0, (f, s, i) => (ids1.Contains(f.Id) || ids2.Contains(f.BusinessId)) && AuditStatusArray.Contains(f.FeeStatus))
.Select((f, s, i) => new FeeAuditItemQuery
{
Id = f.Id,
@ -521,6 +545,7 @@ namespace DS.WMS.Core.Fee.Method
/// <param name="remark">备注</param>
/// <param name="idArray">待审批的费用ID</param>
/// <returns></returns>
/// <remarks>核心审核方法</remarks>
public async Task<DataResult> AuditAsync(int yesOrNo, string? remark, params long[] idArray)
{
var fees = await TenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(x => new
@ -631,11 +656,11 @@ namespace DS.WMS.Core.Fee.Method
public async Task<DataResult> AuditAsync(BizAuditRequest request)
{
var ids = await GetCurrentFlowsQuery(TaskBaseTypeEnum.FEE_AUDIT).Select(x => x.BusinessId).ToArrayAsync();
var query = CreateQuery(ids);
var query = CreateQuery(ids, []);
if (!request.QueryCondition.IsNullOrEmpty())
{
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
var whereList = Db.Utilities.JsonToConditionalModels(request.QueryCondition);
query = query.Where(whereList);
}
@ -658,14 +683,14 @@ namespace DS.WMS.Core.Fee.Method
return await AuditAsync(request.Result, request.Remark, recordIds);
}
const TaskBaseTypeEnum BIZ_TASK_TYPE = TaskBaseTypeEnum.FEE_BUSINESS_AUDIT;
/// <summary>
/// 整审核
/// 整审核
/// </summary>
/// <param name="request">审批请求</param>
/// <returns></returns>
public async Task<DataResult> AuditBusinessAsync(BizAuditRequest request)
{
var taskType = TaskBaseTypeEnum.FEE_BUSINESS_AUDIT;
DataResult result;
bool hasAuthorized = await taskService.HasAuthorizedAsync();
var gpList = request.Items.GroupBy(x => x.BusinessType).ToList();
@ -692,7 +717,7 @@ namespace DS.WMS.Core.Fee.Method
Ids = ids,
Remark = request.Remark,
Result = request.Result,
TaskTypeName = taskType.ToString()
TaskTypeName = BIZ_TASK_TYPE.ToString()
});
if (!result.Succeeded)
@ -700,7 +725,7 @@ namespace DS.WMS.Core.Fee.Method
}
else
{
var flows = await flowService.GetInstanceByBSIdAsync(taskType, gp.Key, ids);
var flows = await flowService.GetInstanceByBSIdAsync(BIZ_TASK_TYPE, gp.Key, ids);
if (flows.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FlowNotFound));
@ -902,7 +927,7 @@ namespace DS.WMS.Core.Fee.Method
.SetColumns(x => x.AuditOperator == User.UserName)
.SetColumns(x => x.AuditDate == dtNow)
.Where(x => x.BusinessId == biz.BusinessId && x.BusinessType == biz.BusinessType &&
(x.FeeStatus == FeeStatus.Entering || x.FeeStatus == FeeStatus.RejectSubmission)).ExecuteCommandAsync();
x.FeeStatus != FeeStatus.PartialSettlement && x.FeeStatus != FeeStatus.SettlementCompleted).ExecuteCommandAsync();
break;
}
@ -930,9 +955,12 @@ namespace DS.WMS.Core.Fee.Method
}
finally
{
await feeService.WriteBackStatusAsync(
if (auditType != TaskBaseTypeEnum.FEE_BUSINESS_AUDIT)
{
await feeService.WriteBackStatusAsync(
auditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT ? biz.BusinessId : fee.BusinessId,
auditType == TaskBaseTypeEnum.FEE_BUSINESS_AUDIT ? biz.BusinessType : fee.BusinessType);
}
}
}
}

@ -708,11 +708,11 @@ namespace DS.WMS.Core.Fee.Method
/// <summary>
/// 撤销审批
/// </summary>
/// <param name="idArray">费用记录ID</param>
/// <param name="ids">费用记录ID</param>
/// <returns></returns>
public async Task<DataResult> WithdrawAsync(params long[] idArray)
public async Task<DataResult> WithdrawAsync(params long[] ids)
{
var fees = await TenantDb.Queryable<FeeRecord>().Where(x => idArray.Contains(x.Id)).Select(
var fees = await TenantDb.Queryable<FeeRecord>().Where(x => ids.Contains(x.Id)).Select(
x => new FeeRecord
{
Id = x.Id,
@ -775,7 +775,7 @@ namespace DS.WMS.Core.Fee.Method
else
{
//未在审批状态中
if (!await flowService.Exists(ids: idArray))
if (!await flowService.Exists(ids: ids))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
foreach (var g in groups)
@ -799,18 +799,17 @@ namespace DS.WMS.Core.Fee.Method
}
const TaskBaseTypeEnum BIZ_TASK_TYPE = TaskBaseTypeEnum.FEE_BUSINESS_AUDIT;
/// <summary>
/// 整审核
/// 整审核
/// </summary>
/// <param name="bid">业务ID</param>
/// <param name="type">业务类型</param>
/// <returns></returns>
public async Task<DataResult> SubmitBusinessAuditAsync(long bid, BusinessType type)
{
var taskType = TaskBaseTypeEnum.FEE_BUSINESS_AUDIT;
var entity = await TenantDb.Queryable<BusinessFeeStatus>().Where(x => x.BusinessId == bid &&
x.BusinessType == BusinessType.OceanShippingExport).Select(x => new BusinessFeeStatus
var entity = await TenantDb.Queryable<BusinessFeeStatus>().Where(x => x.BusinessId == bid && x.BusinessType == type)
.Select(x => new BusinessFeeStatus
{
Id = x.Id,
BusinessId = x.BusinessId,
@ -823,10 +822,10 @@ namespace DS.WMS.Core.Fee.Method
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessNotFound));
if (entity.IsFeeLocking.GetValueOrDefault())
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked));
if (entity.BillAuditStatus == BillAuditStatus.AuditPassed)
if (entity.BillAuditStatus == BillAuditStatus.AuditSubmitted || entity.BillAuditStatus == BillAuditStatus.AuditPassed)
return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription()));
if (await flowService.IsRunning(taskType, type, bid))
if (await flowService.IsRunning(BIZ_TASK_TYPE, type, bid))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeRecordIsAuditing));
DataResult result;
@ -835,16 +834,29 @@ namespace DS.WMS.Core.Fee.Method
{
if (await taskService.HasAuthorizedAsync())
{
result = await taskService.SubmitAuditAsync(new TaskRequest
string? bizNo = null;
switch (type)
{
case BusinessType.OceanShippingExport:
var order = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == bid).Select(x => new
{
x.CustomerNo,
}).FirstAsync();
bizNo = order?.CustomerNo;
break;
}
result = await taskService.CreateTaskAsync(new TaskCreationRequest
{
BusinessId = bid,
BusinessType = type,
TaskTypeName = taskType.ToString()
TaskTypeName = BIZ_TASK_TYPE.ToString(),
TaskTitle = $"【{BIZ_TASK_TYPE.GetDescription()}】【{type.GetDescription()}】{bizNo}"
}, false);
}
else
{
var template = await FindTemplateAsync(taskType);
var template = await FindTemplateAsync(BIZ_TASK_TYPE);
if (template == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TemplateNotFound));
@ -855,8 +867,8 @@ namespace DS.WMS.Core.Fee.Method
TemplateId = template.Id
});
//var instance = result.Data as FlowInstance;
//flowService.StartFlowInstance(instance.Id.ToString());
var instance = result.Data as FlowInstance;
flowService.StartFlowInstance(instance.Id.ToString());
}
if (!result.Succeeded)
@ -874,7 +886,7 @@ namespace DS.WMS.Core.Fee.Method
//修改关联费用状态为提交审核
await TenantDb.Updateable<FeeRecord>().Where(x => x.BusinessId == entity.BusinessId && x.BusinessType == entity.BusinessType)
.SetColumns(x => x.FeeStatus, FeeStatus.AuditSubmitted).ExecuteCommandAsync();
.SetColumns(x => x.FeeStatus == FeeStatus.AuditSubmitted).ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
@ -887,6 +899,55 @@ namespace DS.WMS.Core.Fee.Method
}
}
/// <summary>
/// 撤销整票审批
/// </summary>
/// <param name="bid">业务ID</param>
/// <param name="type">业务类型</param>
/// <returns></returns>
public async Task<DataResult> WithdrawBusinessAsync(long bid, BusinessType type)
{
var entity = await TenantDb.Queryable<BusinessFeeStatus>().Where(x => x.BusinessId == bid && x.BusinessType == type)
.Select(x => new BusinessFeeStatus
{
Id = x.Id,
BusinessId = x.BusinessId,
BusinessType = x.BusinessType,
IsFeeLocking = x.IsFeeLocking,
BillAuditStatus = x.BillAuditStatus
}).FirstAsync();
if (entity == null)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.BusinessNotFound));
if (entity.IsFeeLocking.GetValueOrDefault())
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.FeeLocked));
if (entity.BillAuditStatus != BillAuditStatus.AuditSubmitted)
return DataResult.Failed(string.Format(MultiLanguageConst.BusinessStatusError, entity.BillAuditStatus.GetDescription()));
DataResult result = DataResult.Success;
if (await taskService.HasAuthorizedAsync())
{
await taskService.WithdrawAsync(new TaskRequest
{
BusinessId = bid,
BusinessType = type,
TaskTypeName = BIZ_TASK_TYPE.ToString()
}, false);
}
else
{
//未在审批状态中
if (!await flowService.Exists(type: BIZ_TASK_TYPE, businessType: type, ids: [bid]))
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.NotInAudit));
result = await flowService.WithdrawAsync(BIZ_TASK_TYPE, [bid], type);
if (!result.Succeeded)
return result;
}
return result;
}
/// <summary>
/// 设置发票启用状态
/// </summary>

@ -0,0 +1,162 @@
namespace DS.WMS.Core.Info.Dtos
{
/// <summary>
/// 客户/供应商导入模型
/// </summary>
public class InfoClientModel
{
/// <summary>
/// 所属部门
/// </summary>
public string? DeptName { get; set; }
/// <summary>
/// 联系人电话
/// </summary>
public string? ContactTel { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string? Contact { get; set; }
/// <summary>
/// 协议期限
/// </summary>
public DateTime? AgreementTerm { get; set; }
/// <summary>
/// 认证状态
/// </summary>
public string? StatusText { get; set; }
/// <summary>
/// 地址
/// </summary>
public string? Address { get; set; }
/// <summary>
/// 中文名称
/// </summary>
public string? CNName { get; set; }
/// <summary>
/// 英文名称
/// </summary>
public string? ENName { get; set; }
/// <summary>
/// 简称
/// </summary>
public string? ShortName { get; set; }
/// <summary>
/// 纳税人识别号
/// </summary>
public string? TaxID { get; set; }
/// <summary>
/// 代码
/// </summary>
public string? Code { get; set; }
/// <summary>
/// 结算方式
/// </summary>
public string? StlType { get; set; }
/// <summary>
/// 客户等级
/// </summary>
public string? Class { get; set; }
/// <summary>
/// 客户属性
/// </summary>
public string? Attribute { get; set; }
/// <summary>
/// 商务
/// </summary>
public string? Business { get; set; }
/// <summary>
/// 操作
/// </summary>
public string? OP { get; set; }
/// <summary>
/// 销售
/// </summary>
public string? Sale { get; set; }
/// <summary>
/// 客服
/// </summary>
public string? CustomerService { get; set; }
/// <summary>
/// 认证人
/// </summary>
public string? Authenticator { get; set; }
/// <summary>
/// 预收人民币
/// </summary>
public decimal PrepaidRMB { get; set; }
/// <summary>
/// 预收美元
/// </summary>
public decimal PrepaidUSD { get; set; }
/// <summary>
/// 授信额度
/// </summary>
public decimal Quota { get; set; }
/// <summary>
/// 剩余额度
/// </summary>
public decimal RestQuota { get; set; }
/// <summary>
/// 手机
/// </summary>
public string? Phone { get; set; }
/// <summary>
/// 电话
/// </summary>
public string? Tel { get; set; }
/// <summary>
/// QQ
/// </summary>
public string? QQ { get; set; }
/// <summary>
/// 微信
/// </summary>
public string? Wechat { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string? Email { get; set; }
/// <summary>
/// 联系人姓名
/// </summary>
public string? ContactName { get; set; }
/// <summary>
/// 未跟进天数
/// </summary>
public int? NFDS { get; set; }
public bool IsCustomer { get; set; }
public bool IsSupplier { get; set; }
}
}

@ -442,29 +442,21 @@ public class InfoClient : SharedOrgModel<long>
[SugarColumn(ColumnDescription = "注册时间", IsNullable = true)]
public DateTime? RegistrationTime { get; set; }
///// <summary>
///// 往来单位标记
///// </summary>
//[Navigate(NavigateType.OneToOne, nameof(InfoClientTag.ClientId))]
//public InfoClientTag? Tag { get; set; }
///// <summary>
///// 账期
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientAccountDate.ClientId))]
//public List<InfoClientAccountDate>? Accounts { get; set; }
///// <summary>
///// 联系人
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientContact.ClientId))]
//public List<InfoClientContact>? Contacts { get; set; }
///// <summary>
///// 合同
///// </summary>
//[Navigate(NavigateType.OneToMany, nameof(InfoClientContract.ClientId))]
//public List<InfoClientContract>? Contracts { get; set; }
/// <summary>
/// 客户属性
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(InfoClientContact.ClientId))]
public InfoClientTag? ClientTag { get; set; }
/// <summary>
/// 账期
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(InfoClientContact.ClientId))]
public List<InfoClientAccountDate>? AccountDates { get; set; }
/// <summary>
/// 联系人
/// </summary>
[Navigate(NavigateType.OneToMany, nameof(InfoClientContact.ClientId))]
public List<InfoClientContact>? Contacts { get; set; }
}

@ -178,6 +178,30 @@ public class InfoClientTag : BaseModelV2<long>
[SugarColumn(ColumnDescription = "是否国外同行", DefaultValue = "0")]
public bool IsForeignCounterparts { get; set; }
/// <summary>
/// 是否国内直客
/// </summary>
[SugarColumn(ColumnDescription = "是否国内直客", DefaultValue = "0")]
public bool IsDirectCustomerCn { get; set; }
/// <summary>
/// 是否国外直客
/// </summary>
[SugarColumn(ColumnDescription = "是否国外直客", DefaultValue = "0")]
public bool IsDirectCustomer { get; set; }
/// <summary>
/// 是否指定货发货人
/// </summary>
[SugarColumn(ColumnDescription = "是否指定货发货人", DefaultValue = "0")]
public bool IsShipperZDH { get; set; }
/// <summary>
/// 是否个人
/// </summary>
[SugarColumn(ColumnDescription = "是否个人", DefaultValue = "0")]
public bool IsPersonal { get; set; }
/// <summary>
/// 机构Id
/// </summary>

@ -3,6 +3,7 @@ using DS.Module.Core.Data;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
namespace DS.WMS.Core.Info.Interface;
@ -39,6 +40,13 @@ public interface IClientInfoService
/// <returns></returns>
Task<DataResult> AuditCallbackAsync(FlowCallback callback);
/// <summary>
/// 导入
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
Task<DataResult> ImportAsync(List<InfoClientModel> list);
/// <summary>
/// 列表
/// </summary>

@ -251,6 +251,129 @@ public class ClientInfoService : ServiceBase, IClientInfoService
#endregion
/// <summary>
/// 导入
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public async Task<DataResult> ImportAsync(List<InfoClientModel> list)
{
long userId = long.Parse(User.UserId);
DateTime dtNow = DateTime.Now;
var attrbutes = list.Select(x => x.Attribute).Where(x => !string.IsNullOrEmpty(x)).Distinct();
var dicList = await Db.Queryable<SysDictData>().InnerJoin<SysDictType>((d, t) => d.TypeId == t.Id)
.Where((d, t) => t.Code == "infoclient-ArrclientTag" && attrbutes.Contains(d.Name))
.Select((d, t) => new
{
d.Name,
d.Value
}).ToListAsync();
var saleNames = list.Select(x => x.Sale);
var userNames = list.Select(x => x.Business)
.Union(list.Select(x => x.OP))
.Union(list.Select(x => x.CustomerService))
.Union(saleNames)
.Where(x => !string.IsNullOrEmpty(x))
.Distinct();
var users = await Db.Queryable<SysUser>().Where(x => userNames.Contains(x.UserName)).Select(x => new
{
x.Id,
x.UserName,
x.DefaultOrgId
}).ToListAsync();
List<InfoClient> clients = new List<InfoClient>(list.Count);
foreach (var model in list)
{
InfoClient client = new()
{
Address = model.Address,
AuditStatus = model.StatusText == "认证" ? AuditStatusEnum.Approve : AuditStatusEnum.NoAudit,
Status = model.StatusText == "认证" ? 0 : 1,
CodeName = model.Code,
CreateBy = userId,
CreateUserName = User.UserName,
CreateTime = dtNow,
CustomerService = users.Find(x => x.UserName == model.CustomerService)?.Id,
CustomerServiceName = model.CustomerService,
Email = model.Email,
EnFullName = model.ENName,
EnShortName = model.ENName,
Grade = model.Class,
IsCustomer = model.IsCustomer,
IsSupplier = model.IsSupplier,
OperatorId = users.Find(x => x.UserName == model.OP)?.Id,
OperatorName = model.OP,
Name = model.CNName,
OrgId = (users.Find(x => x.UserName == model.Sale)?.DefaultOrgId).GetValueOrDefault(),
Sale = model.Sale,
SaleId = users.Find(x => x.UserName == model.Sale)?.Id,
QQ = model.QQ,
ShortName = model.CNName,
Tel = model.Tel,
Note = "系统导入",
ClientTag = new InfoClientTag(),
AccountDates = [],
Contacts = []
};
var dicValue = dicList.Find(x => x.Name == model.Attribute)?.Value;
if (!string.IsNullOrEmpty(dicValue))
{
dicValue = dicValue.ToUpperCamelCase();
PropertyExtensions.SetPropertyValue(client.ClientTag, dicValue, true);
}
client.AccountDates.Add(new InfoClientAccountDate
{
AccountType = model.StlType,
BusinessType = ((int)BusinessType.OceanShippingExport).ToString(),
AllowAmount = model.Quota,
OrgId = client.OrgId,
CreateBy = userId,
CreateUserName = User.UserName,
CreateTime = dtNow,
});
client.Contacts.Add(new InfoClientContact
{
Name = model.ContactName,
Address = model.Address,
Email = model.Email,
Mobile = model.Phone,
Tel = model.Tel,
QQ = model.QQ,
IsDefault = true,
OrgId = client.OrgId
});
clients.Add(client);
}
await TenantDb.Ado.BeginTranAsync();
try
{
await TenantDb.Storageable(clients).WhereColumns(x => new { x.ShortName, x.Description }).ExecuteCommandAsync();
//await TenantDb.InsertNav(clients)
//.Include(x => x.ClientTag)
//.Include(x => x.AccountDates)
//.Include(x => x.Contacts)
//.ExecuteCommandAsync();
await TenantDb.Ado.CommitTranAsync();
return DataResult.Success;
}
catch (Exception ex)
{
await TenantDb.Ado.RollbackTranAsync();
await ex.LogAsync(Db);
return DataResult.Failed("导入失败:" + ex.Message);
}
}
/// <summary>
/// 列表
/// </summary>

@ -16,7 +16,10 @@ namespace DS.WMS.Core.Op.Dtos
/// </summary>
public long Id { get; set; }
/// <summary>
/// 订单进程 1.已审未出号 2.已出号未申报 3.已申报
/// </summary>
public string OrderProgress { get; set; }
/// <summary>
/// 改配原因
/// </summary>

@ -19,8 +19,16 @@ namespace DS.WMS.Core.Op.Dtos
/// <summary>
/// 是否保留费用 默认false
/// </summary>
public bool IsReserveFee { get; set; }
public bool IsReserveFee { get; set; } = false;
/// <summary>
/// 订单进程 1.已审未出号 2.已出号未申报 3.已申报
/// </summary>
public string OrderProgress { get; set; }
///// <summary>
///// 是否已放舱 默认false
///// </summary>
//public bool IsRelease { get; set; } = false;
/// <summary>
/// 退舱原因
/// </summary>

@ -1975,5 +1975,11 @@ public class SeaExport : BaseOrgModel<long>
/// 退舱备注
/// </summary>
[SugarColumn(ColumnDescription = "退舱备注", IsNullable = true, Length = 200)]
public string RefundRemark { get; set; }
public string RefundRemark { get; set; }
/// <summary>
/// 订单进程 0.未审单 1.已审未出号 2.已出号未申报 3.已申报
/// </summary>
[SugarColumn(ColumnDescription = "订单进程 0.未审单 1.已审未出号 2.已出号未申报 3.已申报", IsNullable = true, Length = 20,DefaultValue ="0")]
public string OrderProgress { get; set; }
}

@ -11,6 +11,21 @@ namespace DS.WMS.Core.Op.Interface
{
public interface ISeaExportRefundService
{
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<SeaExportListRes>> GetListByPage(PageRequest request);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<DataResult<SeaExportRes>> GetSeaExportRefundInfo(string id);
/// <summary>
/// 创建退舱审核任务
/// </summary>

@ -1,4 +1,6 @@
using DS.Module.Core;
using AngleSharp.Dom;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Enums;
using DS.Module.Core.Extensions;
using DS.Module.SqlSugar;
@ -15,6 +17,9 @@ using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Op.Method.TaskInteraction;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using DS.WMS.Core.Sys.Method;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Entity;
using LanguageExt;
@ -41,6 +46,7 @@ namespace DS.WMS.Core.Op.Method
private readonly ISqlSugarClient db;
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly ICommonService commonService;
readonly ITaskService taskService;
private readonly ISeaExportCommonService seaComService;
/// <summary>
@ -52,10 +58,116 @@ namespace DS.WMS.Core.Op.Method
_serviceProvider = serviceProvider;
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
user = _serviceProvider.GetRequiredService<IUser>();
commonService = _serviceProvider.GetRequiredService<ICommonService>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
seaComService = _serviceProvider.GetRequiredService<ISeaExportCommonService>();
taskService = serviceProvider.GetRequiredService<ITaskService>();
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<SeaExportListRes>> GetListByPage(PageRequest request)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
//启用海运出口列表可视数据权限
(ISugarQueryable<SeaExport> query, _) = await commonService.GetVisibleDataRuleFilter<SeaExport>(tenantDb);
var orgList = db.Queryable<SysOrg>().Where(x => x.Status == StatusEnum.Enable);
//序列化查询条件
var whereList = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
//var result = tenantDb.Queryable<SeaExport>()
var statusList = tenantDb.Queryable<BookingStatus>().Select<BookingStatusRes>().ToList();
var result = query.Where(a=>(a.IsRefund == true || a.IsChangeETD == true) )
.InnerJoin<BusinessFeeStatus>((a, b) => a.Id == b.BusinessId)
//.LeftJoin<SysOrg>((a, b, c) => a.SaleOrgId == c.Id, "shippingweb8_dev.sys_org")
//.LeftJoin<SysOrg>((a, b, c) => a.SaleDeptId == c.Id, "shippingweb8_dev.sys_org")
.Select((a, b) => new SeaExportRes()
{
//SaleDeptName = c.OrgName,
},
true)//true表示 其余字段自动映射,根据字段名字
//.Select<SeaExportRes>()
.MergeTable()
.Mapper(it =>
{
it.BookingStatus = statusList.Where(x => x.BusinessId == it.Id).ToList();
//it.BookingStatus = tenantDb.Queryable<BookingStatus>().Where(x => x.BusinessId == it.Id).Select<BookingStatusRes>().ToList();
})
.Where(whereList);
//.ToQueryPageAsync(request.PageCondition);
var list = result.ToList();
var data = await result.ToQueryPageAsync(request.PageCondition);
var totalData = new SeaExportDataTotalRes()
{
MainCount = list.Where(x => x.ParentId == 0).Count(),
PartCount = list.Where(x => x.ParentId != 0).Count(),
ReturnCount = 0,
TEU = list.Sum(x => x.TEU),
PKGS = list.Sum(x => x.PKGS),
CBM = list.Sum(x => x.CBM),
KGS = list.Sum(x => x.KGS),
Cntr1 = list.Sum(x => x.Cntr1),
Cntr2 = list.Sum(x => x.Cntr2),
Cntr3 = list.Sum(x => x.Cntr3),
Cntr4 = list.Sum(x => x.Cntr4),
Cntr5 = list.Sum(x => x.Cntr5),
Cntr6 = list.Sum(x => x.Cntr6),
Cntr7 = list.Sum(x => x.Cntr7),
Cntr8 = list.Sum(x => x.Cntr8),
Cntr9 = list.Sum(x => x.Cntr9),
Cntr10 = list.Sum(x => x.Cntr10),
OtherCntr = list.Sum(x => x.OtherCntr),
};
var res = new SeaExportListRes()
{
List = data.Data,
TotalCount = list.Count(),
DataTotal = totalData
};
return await Task.FromResult(DataResult<SeaExportListRes>.Success(res, MultiLanguageConst.DataQuerySuccess));
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public async Task<DataResult<SeaExportRes>> GetSeaExportRefundInfo(string id)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
tenantDb.QueryFilter.Clear<IOrgId>();
var data = await tenantDb.Queryable<SeaExport>()
.Where(a => a.Id == long.Parse(id))
.Select<SeaExportRes>()
.Mapper(it =>
{
var edi = tenantDb.Queryable<SeaExportEdi>().First(x => x.BusinessId == it.Id);
if (edi != null)
it.EdiInfo = edi.Adapt<SeaExportEdiRes>();
it.CtnInfo = tenantDb.Queryable<OpCtn>().Where(x => x.BSNO == it.Id.ToString()).Select<OpCtnRes>().ToList();
it.CtnPriceInfo = tenantDb.Queryable<BusinessCtnPrice>().Where(x => x.BusinessId == it.Id).Select<BusinessCtnPriceRes>().ToList();
it.BusinessLogList = tenantDb.Queryable<OpBusinessLog>().Where(x => x.BusinessId == it.Id)
.Select<OpBusinessLogRes>()
.Mapper(a =>
{
a.Details = tenantDb.Queryable<OpBusinessLogDetail>().Where(x => x.Pid == a.Id).ToList();
})
.ToList();
it.OrderContactList = tenantDb.Queryable<BusinessOrderContact>().Where(x => x.BusinessId == it.Id).Select<BusinessOrderContactRes>().ToList();
})
.FirstAsync();
return await Task.FromResult(DataResult<SeaExportRes>.Success(data, MultiLanguageConst.DataQuerySuccess));
}
#region 发起改配
/// <summary>
@ -72,17 +184,18 @@ namespace DS.WMS.Core.Op.Method
var task = await tenantDb.Queryable<BusinessTask>().Where(x => x.BusinessId == id && x.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT).FirstAsync();
if (task.IsNull())
{
return await Task.FromResult(DataResult<string>.Failed("此单未审,可直接编辑调整!"));
}
if (task.IsNotNull() && task.TaskStatus == TaskStatusEnum.Create)
{
return await Task.FromResult(DataResult<string>.Failed("此单未审,可直接编辑调整!"));
//return await Task.FromResult(DataResult<string>.Failed("此单未审,可直接编辑调整!"));
return await Task.FromResult(DataResult<string>.Success("未审单"));
}
//if (task.IsNotNull() && task.TaskStatus == TaskStatusEnum.Create)
//{
// return await Task.FromResult(DataResult<string>.Failed("此单未审,可直接编辑调整!"));
//}
if (info.ETD.IsNotNull() && info.ETD < DateTime.Now)
{
return await Task.FromResult(DataResult<string>.Failed("此单已开船,无法改配!"));
}
//if (info.ETD.IsNotNull() && info.ETD < DateTime.Now)
//{
// return await Task.FromResult(DataResult<string>.Failed("此单已开船,无法改配!"));
//}
if (task.TaskStatus == TaskStatusEnum.Complete && string.IsNullOrEmpty(info.MBLNO))
{
return await Task.FromResult(DataResult<string>.Success("已审未出号"));
@ -235,20 +348,23 @@ namespace DS.WMS.Core.Op.Method
info.IsCustoms = false;
info.IsLand = false;
info.IsVGM = false;
info.OrderProgress = "0";
await tenantDb.Updateable(info).UpdateColumns(x => new { x.CustomerNo,x.IsBooking,x.IsCustoms,x.IsLand,x.IsVGM }).ExecuteCommandAsync();
await tenantDb.Updateable(info).UpdateColumns(x => new { x.CustomerNo,x.IsBooking,x.IsCustoms,x.IsLand,x.IsVGM,x.OrderProgress }).ExecuteCommandAsync();
var oldOrder = entity.Adapt<SeaExport>();
entity.IsChangeETD = true;
entity.ChangeReason = req.ChangeReason;
entity.ChangeRemark = req.ChangeRemark;
entity.ChangeOrderId = req.Id;
entity.OrderProgress = req.OrderProgress;
int rows = await tenantDb.Updateable(entity).UpdateColumns(x => new
{
x.IsChangeETD,
x.ChangeReason,
x.ChangeRemark,
x.ChangeOrderId
x.ChangeOrderId,
x.OrderProgress,
}).ExecuteCommandAsync();
await seaComService.SaveSeaExportLogAsync(new SeaExportSaveLog()
{
@ -262,19 +378,39 @@ namespace DS.WMS.Core.Op.Method
if (req.IsRefund)
{
var taskReq = new TaskCreationRequest()
var userList = new List<long>();
if (req.OrderProgress =="2") //已出号未申报 发起退舱入池任务 推给当票商务
{
userList.Add(entity.LaneId);
var taskReq = new TaskCreationRequest()
{
BusinessId = newKey,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN_POOL.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN_POOL.GetDescription()}】{entity?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN_POOL.GetDescription()}】{entity?.CustomerNo}",
RecvUserIdList = userList.ToArray()
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
return await Task.FromResult(DataResult.Failed(result.Message));
}
else //退舱确认任务 推给当票操作
{
BusinessId = newKey,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
return await Task.FromResult(DataResult.Failed(result.Message));
userList.Add(info.OperatorId);
var taskReq = new TaskCreationRequest()
{
BusinessId = newKey,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{entity?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{entity?.CustomerNo}",
RecvUserIdList = userList.ToArray()
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
return await Task.FromResult(DataResult.Failed(result.Message));
}
//await seaComService.SetGoodsStatus("YFTC", req.Id, tenantDb);
}
@ -329,9 +465,10 @@ namespace DS.WMS.Core.Op.Method
info.RefundTag = RefundTagEnum.Normal;
info.RefundReason = req.RefundReason;
info.RefundRemark = req.RefundRemark;
info.OrderProgress = req.OrderProgress;
int rows = await tenantDb.Updateable(info).UpdateColumns(x => new
{
x.RefundTag,x.RefundReason,x.RefundRemark
x.RefundTag,x.RefundReason,x.RefundRemark,x.OrderProgress
}).ExecuteCommandAsync();
await seaComService.SetGoodsStatus("YFTC", req.Id, tenantDb);
@ -370,20 +507,42 @@ namespace DS.WMS.Core.Op.Method
if (callback.FlowStatus == FlowStatusEnum.Approve)
{
await seaComService.SetGoodsStatus("YSTC", callback.BusinessId, tenantDb);
//发起退舱确认任务
var taskReq = new TaskCreationRequest()
var userList = new List<long>();
if (info.OrderProgress =="2")//已出号未申报 发起退舱入池任务 推给当票商务
{
BusinessId = info.Id,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
{
return await Task.FromResult(DataResult.Failed(result.Message));
userList.Add(info.LaneId);
var taskReq = new TaskCreationRequest()
{
BusinessId = info.Id,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN_POOL.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN_POOL.GetDescription()}】{info?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN_POOL.GetDescription()}】{info?.CustomerNo}",
RecvUserIdList = userList.ToArray()
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
return await Task.FromResult(DataResult.Failed(result.Message));
}
else //退舱确认任务 推给当票操作
{
userList.Add(info.OperatorId);
//发起退舱确认任务
var taskReq = new TaskCreationRequest()
{
BusinessId = info.Id,
BusinessType = BusinessType.OceanShippingExport,
TaskTypeName = TaskBaseTypeEnum.RETURN_CABIN.ToString(),
TaskTitle = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
TaskDescription = $"【{TaskBaseTypeEnum.RETURN_CABIN.GetDescription()}】{info?.CustomerNo}",
RecvUserIdList = userList.ToArray()
};
var result = await taskService.CreateTaskAsync(taskReq, false);
if (!result.Succeeded)
{
return await Task.FromResult(DataResult.Failed(result.Message));
}
}
}
else
{

@ -186,14 +186,27 @@ namespace DS.WMS.FeeApi.Controllers
}
/// <summary>
/// 发起整审核
/// 发起整审核
/// </summary>
/// <param name="model">业务ID和类型</param>
/// <returns></returns>
[HttpPost, Route("ApplyBusinessAudit")]
public async Task<DataResult> ApplyBusinessAuditAsync(IdModel model)
{
if (model == null || !long.TryParse(model.Id, out long bid))
if (!long.TryParse(model.Id, out long bid) || model.BusinessType == null)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return await _feeService.SubmitBusinessAuditAsync(bid, (BusinessType)model.BusinessType.Value);
}
/// <summary>
/// 撤销整票审核
/// </summary>
/// <param name="model">业务ID和类型</param>
/// <returns></returns>
public async Task<DataResult> WithdrawBusinessAsync(IdModel model)
{
if (!long.TryParse(model.Id, out long bid) || model.BusinessType == null)
return DataResult.Failed("参数无效", MultiLanguageConst.IllegalRequest);
return await _feeService.SubmitBusinessAuditAsync(bid, (BusinessType)model.BusinessType.Value);

@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project>
<PropertyGroup>
<_PublishTargetUrl>D:\Publish\DS8\FeeApi</_PublishTargetUrl>
<History>True|2024-10-10T06:58:29.1228618Z||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;True|2024-07-23T17:41:01.7494842+08:00||;True|2024-07-23T17:25:11.8773492+08:00||;True|2024-07-23T17:07:16.5460273+08:00||;True|2024-07-22T08:59:23.3235603+08:00||;True|2024-07-12T17:35:11.1225017+08:00||;</History>
<History>True|2024-10-11T02:54:50.3307087Z||;True|2024-10-11T10:45:07.8181500+08:00||;True|2024-10-11T10:40:44.2066046+08:00||;True|2024-10-11T10:21:25.7226983+08:00||;True|2024-10-11T10:09:05.5257478+08:00||;True|2024-10-10T14:58:29.1228618+08:00||;True|2024-10-10T14:05:59.4501659+08:00||;True|2024-10-10T11:08:58.9765455+08:00||;True|2024-10-08T17:59:07.5583287+08:00||;True|2024-09-27T19:01:59.6945760+08:00||;True|2024-09-27T18:45:48.2812860+08:00||;True|2024-09-27T18:10:25.5697467+08:00||;True|2024-09-27T17:39:06.3169139+08:00||;True|2024-09-27T17:30:14.1043193+08:00||;True|2024-09-27T16:02:09.0703159+08:00||;True|2024-09-27T15:53:05.1789245+08:00||;True|2024-09-27T15:32:52.1934490+08:00||;True|2024-09-27T13:51:24.9197626+08:00||;True|2024-09-27T13:48:17.2817346+08:00||;True|2024-09-27T11:51:46.8193040+08:00||;True|2024-09-27T10:58:33.1059648+08:00||;True|2024-09-27T10:37:35.0336563+08:00||;False|2024-09-27T10:31:52.6302264+08:00||;True|2024-09-26T19:50:15.5513195+08:00||;True|2024-09-26T19:47:14.0781788+08:00||;True|2024-09-26T19:01:26.5428388+08:00||;True|2024-09-26T18:35:28.7455319+08:00||;True|2024-09-26T18:24:30.8084807+08:00||;True|2024-09-26T18:20:47.3005460+08:00||;True|2024-09-26T18:04:39.8012913+08:00||;True|2024-09-26T17:48:13.8526872+08:00||;True|2024-09-26T16:08:20.1746970+08:00||;True|2024-09-26T16:01:01.1501975+08:00||;False|2024-09-26T16:00:34.1516745+08:00||;True|2024-09-26T14:33:03.4007570+08:00||;True|2024-09-25T19:14:27.8906774+08:00||;True|2024-09-25T18:57:40.1435131+08:00||;True|2024-09-25T17:38:44.0915841+08:00||;True|2024-09-25T15:33:58.4630618+08:00||;True|2024-09-25T15:10:31.3022063+08:00||;False|2024-09-25T14:14:40.9640545+08:00||;True|2024-09-25T10:09:32.2558600+08:00||;True|2024-09-25T09:59:17.1525160+08:00||;False|2024-09-25T09:57:58.7265103+08:00||;False|2024-09-25T09:53:36.7732713+08:00||;False|2024-09-24T18:40:10.0166224+08:00||;True|2024-09-24T08:59:56.1995425+08:00||;True|2024-09-23T18:07:54.7222163+08:00||;True|2024-09-23T17:23:57.7568406+08:00||;True|2024-09-23T16:28:49.3169826+08:00||;True|2024-09-23T15:57:31.8052490+08:00||;True|2024-09-23T11:47:21.1445419+08:00||;True|2024-09-23T09:24:36.0732229+08:00||;True|2024-09-21T11:59:19.0549926+08:00||;True|2024-09-21T11:24:32.4451752+08:00||;True|2024-09-21T10:39:11.5297411+08:00||;True|2024-09-20T18:24:31.7827684+08:00||;True|2024-09-19T17:55:53.1666689+08:00||;True|2024-09-19T17:42:47.9061485+08:00||;True|2024-09-19T16:08:21.7225571+08:00||;False|2024-09-19T14:15:42.9318446+08:00||;True|2024-09-19T11:20:03.5567568+08:00||;True|2024-09-18T11:35:18.1509724+08:00||;True|2024-09-18T09:08:59.1152574+08:00||;True|2024-09-14T15:48:22.9374486+08:00||;True|2024-09-14T15:42:19.0503983+08:00||;True|2024-09-14T11:51:53.3339222+08:00||;True|2024-09-14T11:41:38.3542237+08:00||;True|2024-09-14T11:19:13.1037012+08:00||;True|2024-09-13T14:31:12.4598160+08:00||;True|2024-09-13T10:44:56.1241214+08:00||;False|2024-09-13T10:44:26.6088271+08:00||;False|2024-09-13T10:44:06.1615137+08:00||;False|2024-09-13T10:43:19.2432517+08:00||;False|2024-09-13T10:38:18.1663387+08:00||;True|2024-09-06T18:49:17.9435308+08:00||;True|2024-09-06T17:01:39.6646353+08:00||;True|2024-09-06T10:27:36.9990456+08:00||;True|2024-09-06T09:48:23.4236094+08:00||;True|2024-09-05T13:57:23.8452431+08:00||;True|2024-09-05T10:21:34.6675149+08:00||;True|2024-09-05T09:12:44.5610882+08:00||;True|2024-09-04T10:07:38.3707398+08:00||;True|2024-09-04T09:52:47.0574599+08:00||;True|2024-09-03T16:41:23.7516960+08:00||;True|2024-09-03T15:22:31.8718097+08:00||;True|2024-09-03T10:01:09.7656702+08:00||;False|2024-09-03T09:46:46.8956531+08:00||;True|2024-09-02T17:07:41.0268500+08:00||;True|2024-09-02T13:50:22.0203254+08:00||;True|2024-09-02T13:34:23.3441546+08:00||;True|2024-08-30T11:25:14.7431645+08:00||;True|2024-08-29T16:38:26.3491372+08:00||;True|2024-08-29T16:32:31.8580864+08:00||;False|2024-08-29T16:30:41.4763198+08:00||;True|2024-08-09T09:18:05.8484398+08:00||;True|2024-08-09T08:45:38.7858906+08:00||;True|2024-08-05T11:37:07.3133020+08:00||;True|2024-07-24T16:45:58.2272340+08:00||;True|2024-07-24T15:48:52.0128987+08:00||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>

@ -1,12 +1,15 @@
using DS.Module.Core;
using System.Text;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.Core.Enums;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Interface;
using Microsoft.AspNetCore.Mvc;
using Masuit.Tools.Systems;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Flow.Dtos;
using Microsoft.AspNetCore.Mvc;
using MiniExcelLibs;
namespace DS.WMS.MainApi.Controllers;
@ -185,7 +188,7 @@ public class ClientInfoController : ApiController
/// <param name="req"></param>
/// <returns></returns>
[HttpPost, Route("IsAvailable")]
public async Task<DataResult> IsAvailableAsync([FromBody] ClientInfoReq req)
public async Task<DataResult> IsAvailableAsync([FromBody] ClientInfoReq req)
{
return await _invokeService.IsAvailableAsync(req);
}
@ -196,13 +199,83 @@ public class ClientInfoController : ApiController
/// 导入客户/供应商
/// </summary>
/// <param name="type">类型1=客户2=供应商3=客户+供应商</param>
/// <param name="file"></param>
/// <returns></returns>
[HttpGet, Route("Import")]
public async Task<DataResult> ImportAsync([FromQuery] int type)
[HttpPost, Route("Import")]
public async Task<DataResult> ImportAsync([FromForm] int type, IFormFile file)
{
if (file == null)
return DataResult.Failed("请求未包含文件流");
var stream = file.OpenReadStream();
var rows = (await MiniExcel.QueryAsync(stream, excelType: ExcelType.XLSX, startCell: "A2")).ToList();
StringBuilder sb = new StringBuilder();
List<InfoClientModel> list = [];
try
{
foreach (IDictionary<string, object> item in rows)
{
var model = new InfoClientModel
{
DeptName = item["A"]?.ToString(),
ContactTel = item["C"]?.ToString(),
Contact = item["D"]?.ToString(),
AgreementTerm = item["E"] == null ? null : DateTime.Parse(item["E"].ToString()),
StatusText = item["F"]?.ToString(),
Address = item["G"]?.ToString(),
CNName = item["H"]?.ToString(),
ENName = item["I"]?.ToString(),
ShortName = item["J"]?.ToString(),
TaxID = item["K"]?.ToString(),
Code = item["L"]?.ToString(),
StlType = item["M"]?.ToString(),
Class = item["N"]?.ToString(),
Attribute = item["O"]?.ToString(),
Business = item["P"]?.ToString(),
OP = item["Q"]?.ToString(),
Sale = item["R"]?.ToString(),
CustomerService = item["S"]?.ToString(),
Authenticator = item["T"]?.ToString(),
PrepaidRMB = item["U"] == null ? 0 : decimal.Parse(item["U"].ToString()),
PrepaidUSD = item["V"] == null ? 0 : decimal.Parse(item["V"].ToString()),
Quota = item["W"] == null ? 0 : decimal.Parse(item["W"].ToString()),
RestQuota = item["X"] == null ? 0 : decimal.Parse(item["X"].ToString()),
Phone = item["AB"]?.ToString(),
Tel = item["AC"]?.ToString(),
QQ = item["AD"]?.ToString(),
Wechat = item["AE"]?.ToString(),
Email = item["AF"]?.ToString(),
ContactName = item["AG"]?.ToString(),
NFDS = item["AP"] == null ? null : int.Parse(item["AP"].ToString()),
};
//if (string.IsNullOrEmpty(model.DeptName))
// sb.Append($"行号:{rows.IndexOf(item) + 2} 未填写【所属部门】");
if (type == 3)
{
model.IsCustomer = model.IsSupplier = true;
}
else
{
model.IsCustomer = type == 1;
model.IsSupplier = type == 2;
}
list.Add(model);
}
if (sb.Length > 0)
return DataResult.Failed("导入失败:" + sb.ToString());
}
catch (Exception ex)
{
return DataResult.Failed("读取文件失败:" + ex.Message);
}
return DataResult.Success;
return await _invokeService.ImportAsync(list);
}

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.OpApi.Controllers
{
/// <summary>
/// 海运出口退舱服务
/// 海运出口改配退舱服务
/// </summary>
public class SeaExportRefundController : ApiController
{
@ -21,6 +21,31 @@ namespace DS.WMS.OpApi.Controllers
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetSeaExportRefundList")]
public async Task<DataResult<SeaExportListRes>> GetSeaExportRefundList([FromBody] PageRequest request)
{
var res = await _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetSeaExportRefundInfo")]
public async Task<DataResult<SeaExportRes>> GetSeaExportRefundInfo([FromQuery] string id)
{
var res = await _invokeService.GetSeaExportRefundInfo(id);
return res;
}
/// <summary>
/// 创建退舱审核任务

Loading…
Cancel
Save