设置表单模板公共标识

usertest
cjy 3 months ago
parent 2f9f2a2a0a
commit 8bfa19896f

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Code.Dtos
{
/// <summary>
/// 租户表单设置公共标识请求实体
/// </summary>
public class CodeFormSetPublicStatusReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 是否公共标识
/// </summary>
public bool IsPublic { get; set; } = false;
}
}

@ -55,4 +55,12 @@ public interface IFormSetService
/// <returns></returns> /// <returns></returns>
public Task<DataResult<List<CodeFormSetRes>>> GetFormSetListByModule(string permissionId); public Task<DataResult<List<CodeFormSetRes>>> GetFormSetListByModule(string permissionId);
/// <summary>
/// 表单设置公共标识
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult SetPublicFormSet(CodeFormSetPublicStatusReq req);
} }

@ -144,5 +144,25 @@ public class CodeFormSetService : IFormSetService
} }
return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess); return DataResult.Successed("删除成功!", MultiLanguageConst.DataDelSuccess);
} }
/// <summary>
/// 表单设置公共标识
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public DataResult SetPublicFormSet(CodeFormSetPublicStatusReq req)
{
var tenantDb = saasService.GetBizDbScopeById(user.TenantId);
var info = tenantDb.Queryable<CodeFormSet>().Where(x => x.Id == req.Id).First();
if (info.IsNotNull())
{
return DataResult.Failed("表单设置不存在!", MultiLanguageConst.FormSetNotExist);
}
info.IsPublic = req.IsPublic;
tenantDb.Updateable(info).UpdateColumns(x => new { x.IsPublic }).ExecuteCommand();
return DataResult.Successed("更新成功!", MultiLanguageConst.DataUpdateSuccess);
}
} }

@ -100,4 +100,17 @@ public class FormSetController : ApiController
var res = _invokeService.BatchDelFormSet(req); var res = _invokeService.BatchDelFormSet(req);
return res; return res;
} }
/// <summary>
/// 设置表单公共标识
/// </summary>
/// <param name="req">req</param>
/// <returns></returns>
[HttpPost]
[Route("SetPublicFormSet")]
public DataResult SetPublicFormSet([FromBody] CodeFormSetPublicStatusReq req)
{
var res = _invokeService.SetPublicFormSet(req);
return res;
}
} }
Loading…
Cancel
Save