|
@@ -225,7 +225,8 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
EndRowTags = dto.EndRowTags,
|
|
|
Description = dto.Description,
|
|
|
CreateTime = now,
|
|
|
- Enabled = dto.Enabled
|
|
|
+ Enabled = dto.Enabled,
|
|
|
+ ItemTypeId = dto.ItemTypeId
|
|
|
};
|
|
|
|
|
|
var rules = dto.Rules.CopyList<Finance_ServiceBillResolveSolutionRule>().ToList();
|
|
@@ -496,7 +497,7 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
string billTypeCode = solution.BillTypeCode;
|
|
|
ServiceBillResolveApplyResult result = new ServiceBillResolveApplyResult { Success = true };
|
|
|
|
|
|
- Finance_ServiceBillResolveApply apply = CreateResolveSolutionApply(serviceProviderId, billTypeCode, solution.Id, rawFileUrl, billName, batchFileName, description);
|
|
|
+ Finance_ServiceBillResolveApply apply = CreateResolveSolutionApply(solution.ItemTypeId, serviceProviderId, billTypeCode, solution.Id, rawFileUrl, billName, batchFileName, description);
|
|
|
long applyId = await _solutionApplyRepotitory.InsertAsync(apply);
|
|
|
int applyId32 = (int)applyId;
|
|
|
ServiceBillResolveParam resolveParam = CreateResolveParam(solution, billTime, financialTime, billFile, rules, sheetNames, endRowTags);
|
|
@@ -504,7 +505,8 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
List<ServiceBillResolveResult> resultResult = null;
|
|
|
try
|
|
|
{
|
|
|
- resultResult = _serviceBillResolver.Resolve(resolveParam);
|
|
|
+ resultResult = _serviceBillResolver.
|
|
|
+ Resolve(resolveParam);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
@@ -573,7 +575,6 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
var dataDivideRules = rules.Where(r => r.EnableDataDivide.HasValue && r.EnableDataDivide.Value == true);
|
|
|
if (dataDivideRules?.Any() == true)
|
|
|
{
|
|
|
-
|
|
|
var ruleIds = dataDivideRules.Select(r => r.Id).ToList();
|
|
|
var targetResults = resultEntities.Where(r => ruleIds.Contains(r.RuleId));
|
|
|
if (targetResults?.Any() == true)
|
|
@@ -616,6 +617,7 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
|
|
|
/// <summary>
|
|
|
/// 补全SytemNo
|
|
|
+ /// 增加检验,未补全时,警告
|
|
|
/// </summary>
|
|
|
/// <param name="resultEntities"></param>
|
|
|
private async Task FixSystemNo(IList<Finance_ServiceBillResolveResult> resultEntities)
|
|
@@ -631,6 +633,10 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
Dictionary<string, OrderNumberInfo> numberPairs = await GetOrderSystemNoByTransferNumber(trackingNumbers.Distinct(), g.Key);
|
|
|
if (numberPairs?.Any() == true)
|
|
|
{
|
|
|
+ if (numberPairs.Count != trackingNumbers.Count())
|
|
|
+ throw new Exception("匹配到系统单号小于表格单号数量,请检查单号数据!");
|
|
|
+ if (numberPairs.Any(x => string.IsNullOrEmpty(x.Value.OrderChannelUniqueId)))
|
|
|
+ throw new Exception("有订单未匹配到下单渠道,请尝试同步最新的下单渠道");
|
|
|
foreach (var i in g)
|
|
|
{
|
|
|
if (numberPairs.TryGetValue(i.Number, out OrderNumberInfo? info))
|
|
@@ -639,6 +645,12 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
i.OrderChannelUniqueId = info.OrderChannelUniqueId;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ throw new Exception("未匹配到系统单号,请检查数据与映射!");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -756,7 +768,7 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
return resolveParam;
|
|
|
}
|
|
|
|
|
|
- private Finance_ServiceBillResolveApply CreateResolveSolutionApply(int serviceProviderId, string billTypeCode, int resolveSolutionId, string fileUrl, string billName, string batchFileName, string description)
|
|
|
+ private Finance_ServiceBillResolveApply CreateResolveSolutionApply(int? itemTypeId, int serviceProviderId, string billTypeCode, int resolveSolutionId, string fileUrl, string billName, string batchFileName, string description)
|
|
|
{
|
|
|
Finance_ServiceBillResolveApply apply = new Finance_ServiceBillResolveApply
|
|
|
{
|
|
@@ -769,7 +781,8 @@ namespace SMP.Service.ServiceBillResolve
|
|
|
ServiceProviderId = serviceProviderId,
|
|
|
BillTypeCode = billTypeCode,
|
|
|
BatchFileName = batchFileName,
|
|
|
- Type = BillResolveApplyType.自动解析
|
|
|
+ Type = BillResolveApplyType.自动解析,
|
|
|
+ ItemTypeId = itemTypeId
|
|
|
};
|
|
|
return apply;
|
|
|
}
|