jianghaiqing 2 months ago
commit 9f6cfa81b3

@ -1505,10 +1505,14 @@ public static class MultiLanguageConst
#region 关联任务
[Description("此任务已存在,请勿重复提交")]
public const string TaskExists = "Task_Exists";
[Description("未能找到任务")]
public const string TaskNotExists = "Task_Not_Exists";
[Description("此任务已完成")]
public const string TaskCompleted = "Task_Completed";
[Description("此任务已取消")]
public const string TaskCancelled = "Task_Cancelled";
[Description("任务数据与已提交数据条数不匹配")]
public const string TaskCountNotMatch = "Task_Count_Not_Match";
[Description("当前任务状态不支持此操作")]
public const string TaskStatusNotSupported = "Task_Status_Not_Supported";
[Description("当前任务状态不正确,无法提交审核")]

@ -563,7 +563,7 @@ namespace DS.WMS.Core.Fee.Method
});
if (!result.Succeeded)
list.AddRange(fees.Where(x => ids.Contains(x.Id)).Select(x => x.FeeName));
list.Add(result.Message);
}
else
{
@ -583,7 +583,7 @@ namespace DS.WMS.Core.Fee.Method
}
if (list.Count > 0)
return DataResult.Failed($"{MultiLanguageConst.Operation_Failed}{string.Join("", list)}");
return DataResult.Failed(string.Join("、", list));
}
return DataResult.Success;

@ -209,8 +209,6 @@ public class FlowRuntime
{
return ChildNodes.Where(x => x.Id == "end").First().Id;
}
// return ChildNodes.Where(x => x.Pid == nodeId).First().Id;
}
}
@ -233,86 +231,15 @@ public class FlowRuntime
}
else
{
var conditions = conditionNodes[i].Conditions;
var conditionalCollections = new List<ConditionalCollections>();
if (conditions.LogicalOperator == "and")
{
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>();
foreach (var item in conditions.Conditions)
{
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.And,
new ConditionalModel
{
FieldName = item.Field,
ConditionalType = GetConditionalType(item.Operator),
FieldValue = item.Value
})
);
}
if (conditionList.Count > 0)
{
conditionalCollections.Add(new ConditionalCollections
{
ConditionalList = conditionList
}
)
;
}
var nodeSection = conditionNodes[i].Conditions;
var list = new List<ConditionalCollections>();
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>(nodeSection.Conditions.Count);
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
foreach (var group in conditions.Groups)
{
if (group.LogicalOperator == "and")
{
foreach (var item1 in group.Conditions)
{
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.And,
new ConditionalModel
{
FieldName = item1.Field,
ConditionalType = GetConditionalType(item1.Operator),
FieldValue = item1.Value
})
);
}
}
else
{
foreach (var item1 in group.Conditions)
{
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.Or,
new ConditionalModel
{
FieldName = item1.Field,
ConditionalType = GetConditionalType(item1.Operator),
FieldValue = item1.Value
})
);
}
}
}
if (groupList.Count > 0)
{
conditionalCollections.Add(new ConditionalCollections
{
ConditionalList = groupList
}
)
;
}
}
else
{
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>();
foreach (var item in conditions.Conditions)
var whereType = Enum.Parse<WhereType>(nodeSection.LogicalOperator, true);
foreach (var item in nodeSection.Conditions)
{
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.Or,
(whereType,
new ConditionalModel
{
FieldName = item.Field,
@ -324,23 +251,21 @@ public class FlowRuntime
if (conditionList.Count > 0)
{
conditionalCollections.Add(new ConditionalCollections
list.Add(new ConditionalCollections
{
ConditionalList = conditionList
}
)
;
});
}
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
foreach (var group in conditions.Groups)
{
if (group.LogicalOperator == "and")
foreach (var group in nodeSection.Groups)
{
foreach (var item1 in group.Conditions)
WhereType whereType2 = Enum.Parse<WhereType>(group.LogicalOperator, true);
for (int j = 0; j < group.Conditions.Count; j++)
{
var item1 = group.Conditions[j];
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.And,
(j == 0 ? whereType : whereType2,
new ConditionalModel
{
FieldName = item1.Field,
@ -350,38 +275,22 @@ public class FlowRuntime
);
}
}
else
{
foreach (var item1 in group.Conditions)
{
groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
(WhereType.Or,
new ConditionalModel
{
FieldName = item1.Field,
ConditionalType = GetConditionalType(item1.Operator),
FieldValue = item1.Value
})
);
}
}
}
if (groupList.Count > 0)
{
conditionalCollections.Add(new ConditionalCollections
list.Add(new ConditionalCollections
{
ConditionalList = groupList
}
)
;
}
});
}
var conditionalModels = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(JsonConvert.SerializeObject(conditionalCollections));
if (conditionalModels.Count == 0) //跳过默认条件
if (list.Count == 0) //跳过默认条件
continue;
//string json = JsonConvert.SerializeObject(list);
//db.Utilities.JsonToConditionalModels(json);
List<IConditionalModel> conditionalModels = [.. list];
ISqlSugarClient sugarClient = tenantDb ?? db;
var exists = sugarClient.Queryable<object>().AS(ColumnView).Where("Id=@Id", new { Id = BusinessId }).Where(conditionalModels).Any();
if (exists)

@ -197,7 +197,7 @@ public class ClientInfoRes
/// <summary>
/// 审批意见
/// </summary>
public string AuditNote { get; set; }
public string? AuditNote { get; set; }
/// <summary>
/// Desc:默认付费方式

@ -58,14 +58,14 @@ public interface IClientInfoService
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task<DataResult> EditClientInfoAsync(ClientInfoReq model);
Task<DataResult> EditAsync(ClientInfoReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<ClientInfoRes> GetClientInfo(string id);
Task<DataResult<ClientInfoRes>> GetAsync(string id);
/// <summary>
/// 批量删除发票抬头

@ -357,7 +357,7 @@ public class ClientInfoService : ServiceBase, IClientInfoService
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
public async Task<DataResult> EditClientInfoAsync(ClientInfoReq req)
public async Task<DataResult> EditAsync(ClientInfoReq req)
{
var data = req.Adapt<InfoClient>();
data.Status = (int)StatusEnum.Disable;
@ -417,22 +417,22 @@ public class ClientInfoService : ServiceBase, IClientInfoService
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataResult<ClientInfoRes> GetClientInfo(string id)
public async Task<DataResult<ClientInfoRes>> GetAsync(string id)
{
var entity = TenantDb.Queryable<InfoClient>()
var entity = await TenantDb.Queryable<InfoClient>()
.Where(a => a.Id == long.Parse(id))
.First();
.FirstAsync();
if (entity == null)
return DataResult<ClientInfoRes>.Success(null);
var data = entity.Adapt<ClientInfoRes>();
data.ServiceItemCodes = entity.ServiceItem?.Split(',', StringSplitOptions.RemoveEmptyEntries);
var tag = TenantDb.Queryable<InfoClientTag>().Select<ClientTagRes>()
.First(a => a.ClientId == long.Parse(id));
var tag = await TenantDb.Queryable<InfoClientTag>().Select<ClientTagRes>()
.FirstAsync(a => a.ClientId == long.Parse(id));
data.ClientTag = tag;
data.InvoiceHeaders ??= TenantDb.Queryable<InvoiceHeader>().Where(x => x.RelativeId == data.Id).ToList();
data.InvoiceHeaders ??= await TenantDb.Queryable<InvoiceHeader>().Where(x => x.RelativeId == data.Id).ToListAsync();
return DataResult<ClientInfoRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}

@ -164,7 +164,8 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (strList.Count == 0)
return DataResult.Success;
return DataResult.Failed(string.Format(MultiLanguageConst.OrderTaskSubmitted, string.Join("、", strList)));
return DataResult.Failed(string.Format(
MultiLanguageConst.GetDescription(MultiLanguageConst.OrderTaskSubmitted), string.Join("、", strList)));
}
/// <summary>
@ -737,7 +738,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
var tasks = await TenantDb.Queryable<BusinessTask>().Where(x => x.TaskType == request.TaskType && request.Ids.Contains(x.BusinessId))
.WhereIF(request.BusinessType.HasValue, x => x.BusinessType == request.BusinessType.Value).ToListAsync();
if (tasks.Count == 0)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.EmptyData));
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskNotExists));
if (tasks.Count != request.Ids.Length)
return DataResult.FailedWithDesc(nameof(MultiLanguageConst.TaskCountNotMatch));
if (tasks.Exists(x => x.TaskStatus == TaskStatusEnum.Complete))
{

@ -110,7 +110,7 @@ public class ClientInfoController : ApiController
[HttpPost, Route("EditClientInfo")]
public async Task<DataResult> EditClientInfoAsync([FromBody] ClientInfoReq req)
{
var res = await _invokeService.EditClientInfoAsync(req);
var res = await _invokeService.EditAsync(req);
return res;
}
@ -121,10 +121,9 @@ public class ClientInfoController : ApiController
/// <returns></returns>
[HttpGet]
[Route("GetClientInfo")]
public DataResult<ClientInfoRes> GetClientInfo([FromQuery] string id)
public async Task<DataResult<ClientInfoRes>> GetClientInfoAsync([FromQuery] string id)
{
var res = _invokeService.GetClientInfo(id);
return res;
return await _invokeService.GetAsync(id);
}
/// <summary>

Loading…
Cancel
Save