优化附加费计算逻辑,新增复制功能及调整费用类型选择
This commit is contained in:
@@ -78,7 +78,7 @@ public final class LblSurchargeRules
|
||||
}
|
||||
if (name.contains("签名") || name.contains("重复") || name.contains("未预报") || name.contains("重新贴"))
|
||||
{
|
||||
fee.setCalcRule("ITEM");
|
||||
fee.setCalcRule(MANUAL);
|
||||
return;
|
||||
}
|
||||
String postcodes = postcodeParam(desc);
|
||||
@@ -104,10 +104,10 @@ public final class LblSurchargeRules
|
||||
}
|
||||
if (blob.contains("固定收取") || "固定收取".equals(fee.getChargeTiming()))
|
||||
{
|
||||
fee.setCalcRule("ITEM");
|
||||
fee.setCalcRule(ALWAYS);
|
||||
return;
|
||||
}
|
||||
fee.setCalcRule("ITEM");
|
||||
fee.setCalcRule(MANUAL);
|
||||
}
|
||||
|
||||
public static boolean matchesPostcode(String param, String postcode)
|
||||
|
||||
@@ -99,6 +99,7 @@ public class LblWorkbookParser
|
||||
}
|
||||
attachImilePostcodes(workbook, preview.getProducts());
|
||||
attachCatalogRates(workbook, preview.getProducts());
|
||||
clearImportedSurcharges(preview.getProducts());
|
||||
LblZonePostcodeAttach.attach(workbook, preview.getProducts());
|
||||
LblBandNormalizer.normalize(preview);
|
||||
return preview;
|
||||
@@ -202,8 +203,9 @@ public class LblWorkbookParser
|
||||
? "没有工作表能对上产品字典"
|
||||
: "文件里没有「" + selected.trim() + "」这张工作表");
|
||||
}
|
||||
report(listener, 92, "正在整理附加费");
|
||||
attachWorkbookRates(workbook, preview.getProducts());
|
||||
// 打单导入暂不自动识别产品表附加费用表,由操作人手动添加
|
||||
report(listener, 92, "跳过附加费自动识别");
|
||||
clearImportedSurcharges(preview.getProducts());
|
||||
LblZonePostcodeAttach.attach(workbook, preview.getProducts());
|
||||
preview.setSkippedSheets(skipped);
|
||||
report(listener, 96, "工作表解析完成");
|
||||
@@ -795,6 +797,27 @@ public class LblWorkbookParser
|
||||
}
|
||||
}
|
||||
|
||||
/** 清空导入过程中自动识别出的附加费,改由操作人手动添加。 */
|
||||
private static void clearImportedSurcharges(List<LblProduct> products)
|
||||
{
|
||||
if (products == null || products.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (LblProduct product : products)
|
||||
{
|
||||
if (product == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (product.getSurcharges() != null)
|
||||
{
|
||||
product.getSurcharges().clear();
|
||||
}
|
||||
product.setSurchargeCount(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只导入其中一张产品表时,同一本里的高风险国家表仍挂回提到它的产品。
|
||||
* 整本目录解析走关联字段,不从这里再挂一次。
|
||||
@@ -1208,6 +1231,11 @@ public class LblWorkbookParser
|
||||
row++;
|
||||
}
|
||||
readFuelMark(grid, product);
|
||||
// 打单价卡导入:不落库产品表「附加费用/收费标准」等自动识别结果
|
||||
if (product.getSurcharges() != null)
|
||||
{
|
||||
product.getSurcharges().clear();
|
||||
}
|
||||
if (product.getWeightBands().isEmpty() && product.getSurcharges().isEmpty() && product.getExtraLines().isEmpty()
|
||||
&& postcodeHits(grid) >= 5)
|
||||
{
|
||||
@@ -3474,10 +3502,14 @@ public class LblWorkbookParser
|
||||
return;
|
||||
}
|
||||
String rule = fee.getCalcRule() == null ? "" : fee.getCalcRule().trim();
|
||||
if (rule.isEmpty() || LblSurchargeRules.MANUAL.equalsIgnoreCase(rule)
|
||||
|| LblSurchargeRules.ALWAYS.equalsIgnoreCase(rule))
|
||||
// 计费条件默认每票都收;旧 ITEM/等同义也归为 ALWAYS
|
||||
if (rule.isEmpty())
|
||||
{
|
||||
fee.setCalcRule("ITEM");
|
||||
fee.setCalcRule(LblSurchargeRules.ALWAYS);
|
||||
}
|
||||
else if ("ITEM".equalsIgnoreCase(rule) || "FLAT".equalsIgnoreCase(rule) || "FIXED".equalsIgnoreCase(rule))
|
||||
{
|
||||
fee.setCalcRule(LblSurchargeRules.ALWAYS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user