jianghaiqing 2 months ago
commit 9f6cfa81b3

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

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

@ -209,8 +209,6 @@ public class FlowRuntime
{ {
return ChildNodes.Where(x => x.Id == "end").First().Id; return ChildNodes.Where(x => x.Id == "end").First().Id;
} }
// return ChildNodes.Where(x => x.Pid == nodeId).First().Id; // return ChildNodes.Where(x => x.Pid == nodeId).First().Id;
} }
} }
@ -233,155 +231,66 @@ public class FlowRuntime
} }
else else
{ {
var conditions = conditionNodes[i].Conditions; var nodeSection = conditionNodes[i].Conditions;
var conditionalCollections = new List<ConditionalCollections>(); var list = new List<ConditionalCollections>();
if (conditions.LogicalOperator == "and") var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>(nodeSection.Conditions.Count);
{
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) var whereType = Enum.Parse<WhereType>(nodeSection.LogicalOperator, true);
{ foreach (var item in nodeSection.Conditions)
conditionalCollections.Add(new ConditionalCollections {
{ conditionList.Add(new KeyValuePair<WhereType, ConditionalModel>
ConditionalList = conditionList (whereType,
} new ConditionalModel
)
;
}
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> FieldName = item.Field,
(WhereType.Or, ConditionalType = GetConditionalType(item.Operator),
new ConditionalModel FieldValue = item.Value
{ })
FieldName = item1.Field, );
ConditionalType = GetConditionalType(item1.Operator), }
FieldValue = item1.Value
})
);
}
}
}
if (groupList.Count > 0) if (conditionList.Count > 0)
{
list.Add(new ConditionalCollections
{ {
conditionalCollections.Add(new ConditionalCollections ConditionalList = conditionList
{ });
ConditionalList = groupList
}
)
;
}
} }
else
var groupList = new List<KeyValuePair<WhereType, ConditionalModel>>();
foreach (var group in nodeSection.Groups)
{ {
var conditionList = new List<KeyValuePair<WhereType, ConditionalModel>>(); WhereType whereType2 = Enum.Parse<WhereType>(group.LogicalOperator, true);
foreach (var item in conditions.Conditions) for (int j = 0; j < group.Conditions.Count; j++)
{ {
conditionList.Add(new KeyValuePair<WhereType, ConditionalModel> var item1 = group.Conditions[j];
(WhereType.Or, groupList.Add(new KeyValuePair<WhereType, ConditionalModel>
(j == 0 ? whereType : whereType2,
new ConditionalModel new ConditionalModel
{ {
FieldName = item.Field, FieldName = item1.Field,
ConditionalType = GetConditionalType(item.Operator), ConditionalType = GetConditionalType(item1.Operator),
FieldValue = item.Value FieldValue = item1.Value
}) })
); );
} }
}
if (conditionList.Count > 0) if (groupList.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 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
{ });
ConditionalList = groupList
}
)
;
}
} }
var conditionalModels = db.ConfigQuery.Context.Utilities.JsonToConditionalModels(JsonConvert.SerializeObject(conditionalCollections)); if (list.Count == 0) //跳过默认条件
if (conditionalModels.Count == 0) //跳过默认条件
continue; continue;
//string json = JsonConvert.SerializeObject(list);
//db.Utilities.JsonToConditionalModels(json);
List<IConditionalModel> conditionalModels = [.. list];
ISqlSugarClient sugarClient = tenantDb ?? db; ISqlSugarClient sugarClient = tenantDb ?? db;
var exists = sugarClient.Queryable<object>().AS(ColumnView).Where("Id=@Id", new { Id = BusinessId }).Where(conditionalModels).Any(); var exists = sugarClient.Queryable<object>().AS(ColumnView).Where("Id=@Id", new { Id = BusinessId }).Where(conditionalModels).Any();
if (exists) if (exists)
@ -414,7 +323,7 @@ public class FlowRuntime
return ChildNodes.Where(x => x.Id == childId).First(); //下一个节点 return ChildNodes.Where(x => x.Id == childId).First(); //下一个节点
} }
//todo:前端组织JSON结构有误加入临时修复代码待前端改正后移除 //todo:前端组织JSON结构有误加入临时修复代码待前端改正后移除
else if (nextChild.Type == null) else if (nextChild.Type == null)
{ {
nextChild.Id = nextChild.Type = FlowChild.END; nextChild.Id = nextChild.Type = FlowChild.END;
nextChild.Name = "结束"; nextChild.Name = "结束";

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

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

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

@ -163,8 +163,9 @@ namespace DS.WMS.Core.Op.Method.TaskInteraction
if (strList.Count == 0) if (strList.Count == 0)
return DataResult.Success; 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> /// <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)) 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(); .WhereIF(request.BusinessType.HasValue, x => x.BusinessType == request.BusinessType.Value).ToListAsync();
if (tasks.Count == 0) 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)) if (tasks.Exists(x => x.TaskStatus == TaskStatusEnum.Complete))
{ {

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

Loading…
Cancel
Save