修改服务项目

dev
jianghaiqing 1 week ago
parent 7e54b13360
commit 56ac55c62c

@ -1870,6 +1870,30 @@ public static class MultiLanguageConst
[Description("服务项目获取失败,请服务项目信息是否存在")]
public const string ServiceProjectEntityPartNull = "ServiceProject_EntityPartNull";
/// <summary>
/// 服务流程代码或名称不能为空
/// </summary>
[Description("服务流程代码或名称不能为空")]
public const string ServiceWorkFlowBaseSaveNameNull = "ServiceWorkFlowBase_SaveNameNull";
/// <summary>
/// 服务流程不能为空
/// </summary>
[Description("服务流程不能为空")]
public const string ServiceWorkFlowBaseSaveEntityNull = "ServiceWorkFlowBase_SaveEntityNull";
/// <summary>
/// 服务流程代码已存在不能重复保存
/// </summary>
[Description("服务流程代码已存在不能重复保存")]
public const string ServiceWorkFlowBaseSaveCodeExists = "ServiceProject_SaveCodeExists";
/// <summary>
/// 状态已选择包含子状态,子状态列表不能为空
/// </summary>
[Description("状态已选择包含子状态,子状态列表不能为空")]
public const string ServiceWorkFlowBaseSaveIsSub = "ServiceProject_SaveIsSub";
#endregion
}

@ -44,6 +44,7 @@ namespace DS.WMS.Core.Op.Method
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
}
/*
#region 保存
/// <summary>
@ -74,14 +75,18 @@ namespace DS.WMS.Core.Op.Method
{
if (string.IsNullOrWhiteSpace(entity.SERVICE_WORKFLOW_CODE) || string.IsNullOrWhiteSpace(entity.SERVICE_WORKFLOW_NAME))
{
throw Oops.Oh($"服务流程代码或名称不能为空", typeof(InvalidOperationException));
//服务流程代码或名称不能为空
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.ServiceWorkFlowBaseSaveNameNull)));
}
entity.IS_ENABLE = 1;
}
if (entity == null)
throw Oops.Oh($"服务流程不能为空", typeof(InvalidOperationException));
{
//服务流程不能为空
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.ServiceWorkFlowBaseSaveEntityNull)));
}
if (entity.BELONG_TENANT_ID == 0)
{
@ -94,8 +99,8 @@ namespace DS.WMS.Core.Op.Method
if (tenantDb.Queryable<ServiceWorkFlowBaseInfo>().Any(a => a.SERVICE_WORKFLOW_CODE.Equals(info.ServiceWorkflowCode) && a.PK_ID != info.PKId))
{
Logger.Log(NLog.LogLevel.Info, $"服务流程代码已存在不能重复保存");
throw Oops.Oh($"服务流程代码已存在不能重复保存", typeof(InvalidOperationException));
//服务流程代码已存在不能重复保存
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.ServiceWorkFlowBaseSaveCodeExists)));
}
}
@ -103,14 +108,21 @@ namespace DS.WMS.Core.Op.Method
{
if (info.StatusSkuList.Any(a => a.IsContainsSub == 1 && (a.SubList == null || a.SubList.Count == 0)))
{
throw Oops.Oh($"状态已选择包含子状态,子状态列表不能为空", typeof(InvalidOperationException));
//状态已选择包含子状态,子状态列表不能为空
throw new Exception(MultiLanguageConst.GetDescription(nameof(MultiLanguageConst.ServiceWorkFlowBaseSaveIsSub)));
}
if (info.StatusSkuList.Any(a => a.SortNo == 0))
throw Oops.Oh($"状态必需指定大于零的顺序号", typeof(InvalidOperationException));
{
//状态必需指定大于零的顺序号
}
throw Oops.Oh($"状态必需指定大于零的顺序号", typeof(InvalidOperationException));
if (info.StatusSkuList.GroupBy(a => a.SortNo).Any(a => a.ToList().Count > 1))
throw Oops.Oh($"状态顺序号不能重复", typeof(InvalidOperationException));
{
//状态顺序号不能重复
}
throw Oops.Oh($"状态顺序号不能重复", typeof(InvalidOperationException));
info.StatusSkuList = info.StatusSkuList.OrderBy(a => a.SortNo).Select((a, idx) =>
{
@ -469,6 +481,6 @@ namespace DS.WMS.Core.Op.Method
/// <param name="isAvoidCache">是否重新加载缓存</param>
/// <returns></returns>
Task<DataResult<List<DictTreeOutput>>> GetEnableStatusDictTreeList(bool isAvoidCache = false);
}*/
*/
}
}

@ -28,7 +28,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="info">服务项目详情</param>
/// <returns>返回回执</returns>
[HttpPost("/ServiceProject/Save")]
[HttpPost("Save")]
public async Task<DataResult<string>> Save([FromBody] ServiceProjectBaseDto info)
{
return await _serviceProjectService.Save(info);
@ -41,7 +41,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="info">服务项目详情</param>
/// <returns>返回回执</returns>
[HttpPost("/ServiceProject/SaveAndEnable")]
[HttpPost("SaveAndEnable")]
public async Task<DataResult<string>> SaveAndEnable([FromBody] ServiceProjectBaseDto info)
{
return await _serviceProjectService.SaveAndEnable(info);
@ -54,7 +54,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="pkIds">服务项目主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/ServiceProject/SetEnable")]
[HttpPost("SetEnable")]
public async Task<DataResult<string>> SetEnable([FromBody] string[] pkIds)
{
return await _serviceProjectService.SetEnable(pkIds);
@ -67,7 +67,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="pkIds">服务项目主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/ServiceProject/SetUnEnable")]
[HttpPost("SetUnEnable")]
public async Task<DataResult<string>> SetUnEnable([FromBody] string[] pkIds)
{
return await _serviceProjectService.SetUnEnable(pkIds);
@ -80,7 +80,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="pkIds">服务项目主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/ServiceProject/Delete")]
[HttpPost("Delete")]
public async Task<DataResult<string>> Delete([FromBody] string[] pkIds)
{
return await _serviceProjectService.Delete(pkIds);
@ -93,7 +93,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="pkId">服务项目主键</param>
/// <returns>返回回执</returns>
[HttpGet("/ServiceProject/GetInfo")]
[HttpGet("GetInfo")]
public async Task<DataResult<ServiceProjectBaseShowDto>> GetInfo([FromQuery] string pkId)
{
return await _serviceProjectService.GetInfo(pkId);
@ -107,7 +107,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="queryItem">检索值</param>
/// <param name="topNum">最大返回行数默认15</param>
/// <returns>返回回执</returns>
[HttpGet("/ServiceProject/QueryList")]
[HttpGet("QueryList")]
public async Task<DataResult<List<ServiceProjectBaseDto>>> QueryList([FromQuery] string queryItem, [FromQuery] int topNum = 15)
{
return await _serviceProjectService.QueryList(queryItem, topNum);
@ -120,7 +120,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="querySearch">服务项目台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/ServiceProject/GetPage")]
[HttpPost("GetPage")]
public async Task<DataResult<List<ServiceProjectBasePageDto>>> GetPageAsync([FromBody] PageRequest querySearch)
{
return await _serviceProjectService.GetPageAsync(querySearch);

@ -25,7 +25,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="info">状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/StatusSkuBase/Save")]
[HttpPost("Save")]
public async Task<DataResult<string>> Save([FromBody] StatusSkuBaseDto info)
{
return await _statusSkuBaseService.Save(info);
@ -38,7 +38,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="info">状态详情</param>
/// <returns>返回回执</returns>
[HttpPost("/StatusSkuBase/SaveAndEnable")]
[HttpPost("SaveAndEnable")]
public async Task<DataResult<string>> SaveAndEnable([FromBody] StatusSkuBaseDto info)
{
return await _statusSkuBaseService.SaveAndEnable(info);
@ -51,7 +51,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="ids">状态主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/StatusSkuBase/SetEnable")]
[HttpPost("SetEnable")]
public async Task<DataResult<string>> SetEnable([FromBody] string[] ids)
{
return await _statusSkuBaseService.SetEnable(ids);
@ -64,7 +64,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="ids">状态主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/StatusSkuBase/SetUnEnable")]
[HttpPost("SetUnEnable")]
public async Task<DataResult<string>> SetUnEnable([FromBody] string[] ids)
{
return await _statusSkuBaseService.SetUnEnable(ids);
@ -77,7 +77,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="ids">状态主键数组</param>
/// <returns>返回回执</returns>
[HttpPost("/StatusSkuBase/Delete")]
[HttpPost("Delete")]
public async Task<DataResult<string>> Delete([FromBody] string[] ids)
{
return await _statusSkuBaseService.Delete(ids);
@ -90,7 +90,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="id">状态主键</param>
/// <returns>返回回执</returns>
[HttpGet("/StatusSkuBase/GetInfo")]
[HttpGet("GetInfo")]
public async Task<DataResult<StatusSkuBaseShowDto>> GetInfo(string id)
{
return await _statusSkuBaseService.GetInfo(id);
@ -104,7 +104,7 @@ namespace DS.WMS.OpApi.Controllers
/// <param name="queryItem">检索值</param>
/// <param name="topNum">最大返回行数默认15</param>
/// <returns>返回回执</returns>
[HttpGet("/StatusSkuBase/QueryList")]
[HttpGet("QueryList")]
public async Task<DataResult<List<StatusSkuBaseDto>>> QueryList([FromQuery] string queryItem, [FromQuery] int topNum = 15)
{
return await _statusSkuBaseService.QueryList(queryItem, topNum);
@ -117,7 +117,7 @@ namespace DS.WMS.OpApi.Controllers
/// </summary>
/// <param name="querySearch">状态台账查询请求</param>
/// <returns>返回结果</returns>
[HttpPost("/StatusSkuBase/GetPage")]
[HttpPost("GetPage")]
public async Task<DataResult<List<StatusSkuBasePageDto>>> GetPageAsync([FromBody] PageRequest querySearch)
{
return await _statusSkuBaseService.GetPageAsync(querySearch);

Loading…
Cancel
Save