|
|
|
@ -4299,392 +4299,218 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
if (regList[j].name.Equals("PORTLOADID",StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if(operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && dto.DataObj.PORTLOADID.Equals(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = CheckLabel("PORTLOADID", dto.DataObj.PORTLOADID, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && dto.DataObj.PORTLOADID.StartsWith(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && dto.DataObj.PORTLOADID.Contains(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && !dto.DataObj.PORTLOADID.Contains(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && !dto.DataObj.PORTLOADID.Equals(regList[j].val))
|
|
|
|
|
if(isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOADID) && !dto.DataObj.PORTLOADID.StartsWith(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (regList[j].name.Equals("PLACERECEIPT", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && dto.DataObj.PLACERECEIPT.Equals(regList[j].val))
|
|
|
|
|
isSucc = CheckLabel("PLACERECEIPT", dto.DataObj.PLACERECEIPT, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
if (isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && dto.DataObj.PLACERECEIPT.StartsWith(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
else if (regList[j].name.Equals("PORTLOAD", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && dto.DataObj.PLACERECEIPT.Contains(regList[j].val))
|
|
|
|
|
isSucc = CheckLabel("PORTLOAD", dto.DataObj.PORTLOAD, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
if (isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && !dto.DataObj.PLACERECEIPT.Contains(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
else if (regList[j].name.Equals("PORTDISCHARGEID", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && !dto.DataObj.PLACERECEIPT.Equals(regList[j].val))
|
|
|
|
|
isSucc = CheckLabel("PORTDISCHARGEID", dto.DataObj.PORTDISCHARGEID, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
if (isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACERECEIPT) && !dto.DataObj.PLACERECEIPT.StartsWith(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (regList[j].name.Equals("PORTLOAD", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
else if (regList[j].name.Equals("PORTDISCHARGE", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && dto.DataObj.PORTLOAD.Equals(regList[j].val))
|
|
|
|
|
isSucc = CheckLabel("PORTDISCHARGE", dto.DataObj.PORTDISCHARGE, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
if (isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && dto.DataObj.PORTLOAD.StartsWith(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
else if (regList[j].name.Equals("PLACEDELIVERY", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && dto.DataObj.PORTLOAD.Contains(regList[j].val))
|
|
|
|
|
isSucc = CheckLabel("PLACEDELIVERY", dto.DataObj.PLACEDELIVERY, regList[j].val, regList[j].master, operEnum);
|
|
|
|
|
|
|
|
|
|
if (isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && !dto.DataObj.PORTLOAD.Equals(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
if (regList[j].master)
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && !dto.DataObj.PORTLOAD.Contains(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTLOAD) && !dto.DataObj.PORTLOAD.StartsWith(regList[j].val))
|
|
|
|
|
|
|
|
|
|
if(isSucc)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_logger.LogInformation($"标签对应到有效规则,{labelList[i].Name}");
|
|
|
|
|
}
|
|
|
|
|
else if (regList[j].name.Equals("PORTDISCHARGEID", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && dto.DataObj.PORTDISCHARGEID.Equals(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && dto.DataObj.PORTDISCHARGEID.StartsWith(regList[j].val))
|
|
|
|
|
catch (Exception innEx)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
_logger.LogInformation($"标签对应失败,{labelList[i].Name},原因:{innEx.Message}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && dto.DataObj.PORTDISCHARGEID.Contains(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
|
|
|
|
|
if (ruleList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && !dto.DataObj.PORTDISCHARGEID.Equals(regList[j].val))
|
|
|
|
|
var name = _namedBookingLabelServiceProvider
|
|
|
|
|
.GetService<ITransient>(nameof(BookingLabelService));
|
|
|
|
|
|
|
|
|
|
var bindModel = new BindLabelDto
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
BusinessIdArray = new[] { id },
|
|
|
|
|
LabelIdArray = ruleList.Select(a => a.Id.Value).ToArray()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"标签绑定请求,{JSON.Serialize(bindModel)}");
|
|
|
|
|
|
|
|
|
|
await name.SetLabel(bindModel);
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"标签绑定请求完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && !dto.DataObj.PORTDISCHARGEID.Contains(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGEID) && !dto.DataObj.PORTDISCHARGEID.StartsWith(regList[j].val))
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
_logger.LogInformation($"自动生成舱位标签失败,原因:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (regList[j].name.Equals("PORTDISCHARGE", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private bool CheckLabel(string name,string val,string checkVal, bool isMaster, LabelRegexOperEnum operEnum)
|
|
|
|
|
{
|
|
|
|
|
if (operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && dto.DataObj.PORTDISCHARGE.Equals(regList[j].val))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val) && val.Equals(checkVal))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && dto.DataObj.PORTDISCHARGE.StartsWith(regList[j].val))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val) && val.StartsWith(checkVal))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && dto.DataObj.PORTDISCHARGE.Contains(regList[j].val))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val) && val.Contains(checkVal))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && !dto.DataObj.PORTDISCHARGE.Equals(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && !dto.DataObj.PORTDISCHARGE.Contains(regList[j].val))
|
|
|
|
|
if (!val.Equals(checkVal))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PORTDISCHARGE) && !dto.DataObj.PORTDISCHARGE.StartsWith(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
if (isMaster)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (regList[j].name.Equals("PLACEDELIVERY", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
if (operEnum == LabelRegexOperEnum.equal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && dto.DataObj.PLACEDELIVERY.Equals(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.startwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && dto.DataObj.PLACEDELIVERY.StartsWith(regList[j].val))
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.like)
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val))
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && dto.DataObj.PLACEDELIVERY.Contains(regList[j].val))
|
|
|
|
|
if (!val.Contains(checkVal))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notequal)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && !dto.DataObj.PLACEDELIVERY.Equals(regList[j].val))
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
if (isMaster)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notexists)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && !dto.DataObj.PLACEDELIVERY.Contains(regList[j].val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (operEnum == LabelRegexOperEnum.notstartwith)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dto.DataObj.PLACEDELIVERY) && !dto.DataObj.PLACEDELIVERY.StartsWith(regList[j].val))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(val))
|
|
|
|
|
{
|
|
|
|
|
ruleList.Add(labelList[i]);
|
|
|
|
|
isSucc = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isSucc)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"标签对应到有效规则,{labelList[i].Name}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception innEx)
|
|
|
|
|
if (!val.StartsWith(checkVal))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"标签对应失败,{labelList[i].Name},原因:{innEx.Message}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
if (isMaster)
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ruleList.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
var name = _namedBookingLabelServiceProvider
|
|
|
|
|
.GetService<ITransient>(nameof(BookingLabelService));
|
|
|
|
|
|
|
|
|
|
var bindModel = new BindLabelDto
|
|
|
|
|
{
|
|
|
|
|
BusinessIdArray = new[] { id },
|
|
|
|
|
LabelIdArray = ruleList.Select(a => a.Id.Value).ToArray()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"标签绑定请求,{JSON.Serialize(bindModel)}");
|
|
|
|
|
|
|
|
|
|
await name.SetLabel(bindModel);
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"标签绑定请求完成");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"自动生成舱位标签失败,原因:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|