cjy 2 months ago
commit fec26482a2

@ -1519,7 +1519,8 @@ public static class MultiLanguageConst
public const string BookingTaskNotFound = "Booking_Task_NotFound";
[Description("此操作不支持多种业务类型同时提交")]
public const string MultiBusinessType = "Multi_Business_Type";
[Description("订单:{0} 已提交")]
public const string OrderTaskSubmitted = "Order_Task_Submitted";
[Description("任务邮件必须设置收件人")]
public const string TaskMailReceiverNotNull = "Task_Mail_Receiver_Not_Null";
[Description("任务邮件必须设置发件人")]

@ -78,4 +78,16 @@ public class CM_BaseInfoController : ApiController
return res;
}
/// <summary>
/// 处理附件
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("CM_DealExcel")]
public DataResult CM_DealExcel([FromBody] CM_DealExcelReq model)
{
var res = _invokeService.CM_DealExcel(model);
return res;
}
}

@ -0,0 +1,28 @@
using DS.Module.Core;
using DS.Module.Core.Enums;
using DS.WMS.ContainerManagement.Info.Entity;
using FluentValidation;
using Mapster;
using Masuit.Tools.Systems;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Dtos;
/// <summary>
/// 箱管_处理附件
/// </summary>
public class CM_DealExcelReq
{
/// <summary>
/// 主键编号
/// </summary>
public long Id { get; set; }
public string FormName { get; set; }
public string TableName { get; set; }
public long FileId { get; set; }
}

@ -118,4 +118,8 @@ public class VW_CM_RentOut_NeedRentRes
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
public string? CtnReleaseNo { get; set; }
}

@ -139,4 +139,9 @@ public class VW_CM_SellCtn_NeedSellRes
/// </summary>
public decimal? CtnValue_BuyingPrice { get; set; }
/// <summary>
/// Desc:关联放箱单号
/// </summary>
public string? CtnReleaseNo { get; set; }
}

@ -38,4 +38,12 @@ public interface ICM_BaseInfoService
/// <param name="id"></param>
/// <returns></returns>
DataResult<CM_CheckCntrnoRes> CM_CheckCntrno(CM_CheckCntrno model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult CM_DealExcel(CM_DealExcelReq model);
}

@ -16,6 +16,7 @@ using DS.WMS.Core.Op.View;
using DS.WMS.Core.Sys.Entity;
using Mapster;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using SqlSugar;
namespace DS.WMS.ContainerManagement.Info.Method;
@ -254,4 +255,33 @@ public class CM_BaseInfoService : ICM_BaseInfoService
return true;
}
/// <summary>
/// 处理附件
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult CM_DealExcel(CM_DealExcelReq req)
{
return DataResult.Successed($"调用成功!{JsonConvert.SerializeObject(req)}", MultiLanguageConst.DataUpdateSuccess);
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
}
/// <summary>
/// 处理附件
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult CM_CheckCtnBase(CM_DealExcelReq req)
{
return DataResult.Successed($"", MultiLanguageConst.DataUpdateSuccess);
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
}
}

@ -542,7 +542,7 @@ public class CM_CtnScrapService : CMServiceBase, ICM_CtnScrapService
/// <summary>
/// 租箱租入明细视图_列表
/// 报废箱 待取列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>

@ -421,8 +421,12 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
//如果没有填写提箱日期 则变动来源id设为租箱主单 变动日期设为业务日期
//如果填写了提箱日期 则变动来源id设为租箱主单 变动日期设为提箱日期
if (detail.PickupDate != null)
//20240911 改为通过明细中的提箱日期 或 开始计费日期(如果两者皆有,则优先使用提箱日期)来确定变动日期
if (detail.PickupDate != null|| detail.FeeStartDate != null)
{
var changedate = detail.PickupDate==null?detail.FeeStartDate:detail.PickupDate;
changerec.CtnStateId = CMCtnStateEnum.AV;
changerec.ChangeSourceDetailId = detail.Id;
changerec.CtnFlowStateId = CMCtnFlowStateEnum.;
@ -786,7 +790,7 @@ public class CM_RentInService : CMServiceBase, ICM_RentInService
/// <summary>
/// 租箱租入明细视图_列表
/// 租箱租入 退租待取用明细视图_列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>

@ -80,25 +80,4 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking
}
}
/// <summary>
/// 文件格式
/// </summary>
public enum FileFormat
{
/// <summary>
/// PDF
/// </summary>
PDF = 1,
/// <summary>
/// Excel
/// </summary>
Xlsx = 2,
/// <summary>
/// Word
/// </summary>
Docx = 3
}
}

@ -0,0 +1,71 @@
using DS.WMS.Core.Op.Dtos.TaskInteraction;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using Masuit.Tools;
using Masuit.Tools.Systems;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor
{
/// <summary>
/// 用于发送邮件的任务动作
/// </summary>
public class SendMailActionExecutor : DefaultActionExecutor
{
/// <summary>
/// 发送邮件
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public async override Task ExecuteAsync(ActionExecutionContext context)
{
var logService = context.ServiceProvider.GetRequiredService<ITaskLogService>();
var taskMailService = context.ServiceProvider.GetRequiredService<ITaskMailService>();
BusinessTaskMail? mailConfig = null;
if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Id), out var id))
{
if (id == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
return;
}
var idVal = (long)Convert.ChangeType(id, typeof(long));
mailConfig = (await taskMailService.GetAsync(idVal)).Data;
}
else if (context.AdditionalData.TryGetValue(nameof(BusinessTaskMail) + "." + nameof(BusinessTaskMail.Name), out var name))
{
var mailName = name as string;
if (mailName.IsNullOrEmpty())
{
await logService.WriteLogAsync(context.TaskInfo, $"未配置【{context.TaskInfo.TaskType.GetDescription()}】任务的邮件设置");
return;
}
mailConfig = await taskMailService.GetAsync(mailName);
}
if (mailConfig == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能根据任务配置值获取邮件模板设置");
return;
}
MailService mailService = new(context.ServiceProvider);
var model = await mailService.GetTemplateModelAsync(context.ActionManager, context.TaskInfo.BusinessId, context.TaskInfo.BusinessType);
if (model.Primary == null)
{
await logService.WriteLogAsync(context.TaskInfo, $"未能获取Id={context.TaskInfo.BusinessId} {context.TaskInfo.BusinessType.GetDescription()}的订单数据");
return;
}
var result = await mailService.SendAsync(mailConfig, model);
if (!result.Succeeded)
{
await logService.WriteLogAsync(context.TaskInfo, result.Message);
return;
}
}
}
}

@ -10,7 +10,6 @@ using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.Op.Entity.TaskInteraction;
using DS.WMS.Core.Op.Interface.TaskInteraction;
using DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor;
using DS.WMS.Core.Op.Method.TaskInteraction.ActionExecutor.Booking;
using DS.WMS.Core.Sys.Entity;
using Fasterflect;
using HtmlAgilityPack;
@ -330,7 +329,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
{
foreach (var item in templateModel.FileAttachments)
{
FileInfo file = new FileInfo(item.FilePath);
FileInfo file = new(item.FilePath);
if (!file.Exists)
return DataResult.Failed($"参数设置的附件路径:{file.FullName} 不存在");
@ -380,4 +379,25 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
}
}
/// <summary>
/// 文件格式
/// </summary>
public enum FileFormat
{
/// <summary>
/// PDF
/// </summary>
PDF = 1,
/// <summary>
/// Excel
/// </summary>
Xlsx = 2,
/// <summary>
/// Word
/// </summary>
Docx = 3
}
}

@ -146,19 +146,25 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var ids = request.Ids;
ids ??= [request.BusinessId];
if (ids.Length == 0)
return DataResult.FailedWithDesc(MultiLanguageConst.IllegalRequest);
List<string> strList = [];
DataResult result;
for (int i = 0; i < ids.Length; i++)
{
request.BusinessId = ids[i];
result = await CreateTaskAsync(request, useTransaction);
if (!result.Succeeded)
return result;
{
if (result.Data == null)
return result;
strList.Add(result.Data.ToString()!);
}
}
return DataResult.Success;
if (strList.Count == 0)
return DataResult.Success;
return DataResult.Failed(string.Format(MultiLanguageConst.OrderTaskSubmitted, string.Join("、", strList)));
}
/// <summary>
@ -180,6 +186,7 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
request.TaskTypeName = nextType.Value.ToString();
}
DataResult result = DataResult.Success;
bool updateFlag = false;
var task = await GetQuery(request.BusinessId, request.BusinessType, request.TaskType).FirstAsync();
if (task != null)
@ -191,11 +198,19 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
}
else //其他任务类型返回已存在提示
{
if (IsOrderType(request.TaskType))
{
string custNO = await TenantDb.Queryable<SeaExport>().Where(x => x.Id == request.BusinessId)
.Select(x => x.CustomerNo).FirstAsync();
result = DataResult.Failed(string.Format(MultiLanguageConst.OrderTaskSubmitted, custNO));
result.Data = custNO;
return result;
}
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskExists));
}
}
DataResult result = DataResult.Success;
if (request.TaskType == TaskBaseTypeEnum.WAIT_ORDER_AUDIT)
{
result = await CheckRulesAsync(request.BusinessId, request.BusinessType.Value, RuleEngineType.COMMON_ORDER_AUDIT);

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<NameOfLastUsedPublishProfile>E:\MyCode\Dongsheng8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<NameOfLastUsedPublishProfile>D:\Source\Repos\DS8\ds-wms-service\DS.WMS.OpApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>

Loading…
Cancel
Save