Merge branch 'master' of http://60.209.125.238:20010/chenjingyong/ds8-solution-pro
commit
3e93d27519
@ -0,0 +1,42 @@
|
||||
using DS.Module.Core;
|
||||
using DS.WMS.Core.Code.Dtos;
|
||||
using DS.WMS.Core.System.Dtos;
|
||||
|
||||
namespace DS.WMS.Core.Code.Interface;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IColumnSetService
|
||||
{
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
DataResult<List<ColumnSetRes>> GetListByPage(PageRequest request);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
DataResult EditColumnSet(ColumnSetReq model);
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
DataResult<ColumnSetRes> GetColumnSetInfo(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 按模块获取列表设置详情
|
||||
/// </summary>
|
||||
/// <param name="permissionId">权限模块id</param>
|
||||
/// <param name="columnNo">列表序号</param>
|
||||
/// <returns></returns>
|
||||
DataResult<ColumnSetRes> GetColumnSetInfoByModule(string permissionId,int columnNo = 0);
|
||||
|
||||
}
|
Binary file not shown.
@ -0,0 +1,70 @@
|
||||
using System.Reflection;
|
||||
using DS.Module.Core;
|
||||
using DS.Module.Core.Extensions;
|
||||
using DS.Module.ExcelModule.Model;
|
||||
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 Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using SqlSugar.IOC;
|
||||
using Xunit;
|
||||
|
||||
namespace Ds.WMS.Test;
|
||||
|
||||
public class ExcelTest
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly SqlSugarScope db;
|
||||
private readonly ISaasDbService saasService;
|
||||
//private readonly IExcelService _ExcelService;
|
||||
public ExcelTest(IServiceProvider serviceProvider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
db = (SqlSugarScope)_serviceProvider.GetRequiredService<ISqlSugarClient>();
|
||||
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
|
||||
//_ExcelService = _serviceProvider.GetRequiredService<IExcelService>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取Json打印信息
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetExportExcleInfo()
|
||||
{
|
||||
List<UserColumnSet> set = new List<UserColumnSet>();
|
||||
set.Add(new UserColumnSet
|
||||
{
|
||||
DataIndex = "stlCode",
|
||||
Title = "结算方式代码",
|
||||
});
|
||||
set.Add(new UserColumnSet
|
||||
{
|
||||
DataIndex = "stlName",
|
||||
Title = "结算方式",
|
||||
});
|
||||
string JsonDataStr = "[{\"id\":\"1767428411736854528\",\"stlCode\":\"1\",\"stlName\":\"支票\",\"enName\":\"Check\",\"financeSoftCode\":\"01\",\"status\":0,\"note\":\"\",\"createTime\":\"2024-03-12 13:52:25\"},{\"id\":\"1767428557304369152\",\"stlCode\":\"2\",\"stlName\":\"汇款\",\"enName\":\"Remittance\",\"financeSoftCode\":\"02\",\"status\":0,\"note\":\"\",\"createTime\":\"2024-03-12 13:53:00\"}]";
|
||||
var values = new List<Dictionary<string, object>>();
|
||||
var data = JArray.Parse(JsonDataStr);
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
var temp = data[i];
|
||||
for (int n = 0; n < set.Count; n++)
|
||||
{
|
||||
var columnSet = set[n];
|
||||
var key = columnSet.DataIndex;
|
||||
var info = new Dictionary<string, object>
|
||||
{
|
||||
{ columnSet.Title, temp[key] },
|
||||
};
|
||||
values.Add(info);
|
||||
}
|
||||
}
|
||||
Console.WriteLine(values);
|
||||
Assert.True(true);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue