|
|
@ -6,8 +6,11 @@ using DS.Module.UserModule;
|
|
|
|
using DS.WMS.Core.Code.Dtos;
|
|
|
|
using DS.WMS.Core.Code.Dtos;
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
using DS.WMS.Core.Code.Entity;
|
|
|
|
using DS.WMS.Core.Code.Interface;
|
|
|
|
using DS.WMS.Core.Code.Interface;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Invoice.Dtos;
|
|
|
|
|
|
|
|
using DS.WMS.Core.Sys.Dtos;
|
|
|
|
using Mapster;
|
|
|
|
using Mapster;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using SqlSugar;
|
|
|
|
using SqlSugar;
|
|
|
|
namespace DS.WMS.Core.Code.Method
|
|
|
|
namespace DS.WMS.Core.Code.Method
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -94,6 +97,50 @@ namespace DS.WMS.Core.Code.Method
|
|
|
|
.First();
|
|
|
|
.First();
|
|
|
|
return DataResult<ColumnSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
return DataResult<ColumnSetRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 更新列表设置字段长度
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="req"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
public async Task<DataResult> UpdateColumnSetField(UpdateColumnFieldReq req) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
|
|
|
|
|
|
|
|
var columnSet = await tenantDb.Queryable<CodeColumnSet>()
|
|
|
|
|
|
|
|
.Where(x => x.PermissionId == req.PermissionId && x.ColumnNo == req.ColumnNo && x.CreateBy == long.Parse(user.UserId) && x.Status == StatusEnum.Enable)
|
|
|
|
|
|
|
|
.FirstAsync();
|
|
|
|
|
|
|
|
if (columnSet.IsNull())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return DataResult.Failed("列表字段设置不存在!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var content = JsonConvert.DeserializeObject<ColumnSetContent>(columnSet.Content);
|
|
|
|
|
|
|
|
if (content.IsNull() || content.Columns.Count == 0 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed("列表字段设置内容不存在!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var columns = content.Columns;
|
|
|
|
|
|
|
|
var column = columns.Where(x=>x.DataIndex == req.Field).FirstOrDefault();
|
|
|
|
|
|
|
|
if (column.IsNull()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Failed("列表字段不存在!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach (var item in columns)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (item.DataIndex == req.Field)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.Width = req.Width;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var columnStr = JsonConvert.SerializeObject(columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
columnSet.Content = columnStr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await tenantDb.Updateable(columnSet).UpdateColumns(x=> new { x.Content }).ExecuteCommandAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return DataResult.Success;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 列表
|
|
|
|
/// 列表
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|