|
|
|
|
using System.Reflection;
|
|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.Module.Core.Extensions;
|
|
|
|
|
using DS.Module.PrintModule;
|
|
|
|
|
using DS.Module.SqlSugar;
|
|
|
|
|
using DS.WMS.Core.Code.Interface;
|
|
|
|
|
using DS.WMS.Core.System.Entity;
|
|
|
|
|
using DS.WMS.Core.System.Interface;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using SqlSugar;
|
|
|
|
|
using SqlSugar.IOC;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Ds.WMS.Test;
|
|
|
|
|
|
|
|
|
|
public class PrintTest
|
|
|
|
|
{
|
|
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
|
private readonly SqlSugarScope db;
|
|
|
|
|
private readonly ISaasDbService saasService;
|
|
|
|
|
private readonly IPrintService _printService;
|
|
|
|
|
public PrintTest(IServiceProvider serviceProvider)
|
|
|
|
|
{
|
|
|
|
|
_serviceProvider = serviceProvider;
|
|
|
|
|
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
|
|
|
|
|
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
|
|
|
|
_printService = _serviceProvider.GetRequiredService<IPrintService>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>ȡ<EFBFBD><C8A1>ӡģ<D3A1><C4A3><EFBFBD>б<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Fact]
|
|
|
|
|
public void GetOpenPrintModuleList()
|
|
|
|
|
{
|
|
|
|
|
var data = _printService.GetOpenPrintModuleList();
|
|
|
|
|
Assert.True(data.Succeeded);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>ȡ<EFBFBD><C8A1>ӡģ<D3A1><C4A3><EFBFBD>б<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Fact]
|
|
|
|
|
public void GetOpenPrintTemplateList()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var data = _printService.GetOpenPrintTemplateList("1777229219986804736");
|
|
|
|
|
Assert.True(data.Succeeded);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><>ȡJson<6F><6E>ӡ<EFBFBD><D3A1>Ϣ
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Fact]
|
|
|
|
|
public void GetOpenJsonPrintInfo()
|
|
|
|
|
{
|
|
|
|
|
var req = new OpenJsonPrintReq()
|
|
|
|
|
{
|
|
|
|
|
TemplateId = 1777232318486941696,
|
|
|
|
|
JsonDataStr = "{\"GID\":\"52fc4ecf-5c88-49a8-aa1f-08da84ccc2d3\",\"BILLTYPE\":false,\"TRUCKNO\":\"³A789\",\"BoxWeigth\":10540,\"BoxCode\":\"A124\",\"BoxCode2\":null,\"ISTwoBox\":false,\"CORPID\":null,\"CreateDate\":\"2023-12-22T09:55:43.0332931+08:00\",\"CreateID\":null,\"Creator\":null,\"TURNOVERDATE\":\"2023-12-22T09:55:43.0333166+08:00\",\"Modifier\":null,\"ModifyDate\":null,\"ModifyID\":null,\"REMARK\":null}"
|
|
|
|
|
};
|
|
|
|
|
var data = _printService.GetOpenJsonPrintInfo(req);
|
|
|
|
|
Assert.True(data.Succeeded);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|