提交 44e8b201 authored 作者: douxy's avatar douxy

增加店内执行计划导出/入功能:处理数据-修改执行判断条件

上级 20fcb1ae
......@@ -38,7 +38,7 @@ public class NormalDisplayExportStrategyImpl implements IExportApExcelStrategy {
ExportColumnConfig actualMainShelfType = new ExportColumnConfig("actualMainShelfType", "主货架形式(实际)", "", ExcelStyleUtils.ExcelStyle.LIGHT_BLUE_BG);
actualMainShelfType.setValidationValidOptions(Arrays.asList("3纵", "4纵", "5纵", "6纵", "7纵", "8纵及以上"));
actualMainShelfType.setValidationErrorTitle("输入错误");
actualMainShelfType.setValidationErrorMsg("主货架形式必须输入”3纵、4纵、5纵、6纵、7纵、8纵及以上“之一!");
actualMainShelfType.setValidationErrorMsg("主货架形式必须输入“3纵、4纵、5纵、6纵、7纵、8纵及以上”之一!");
actualMainShelfType.setConditionalStyling(true);
//主货架数量-实际
......
......@@ -208,14 +208,43 @@ public class NormalDisplayImportStrategyImpl implements IImportApExcelStrategy<S
updateDisplay.setRemark(dto.getRemark());
// 主货架执行状态计算
if (updateDisplay.getPlannedMainShelfType() != null && updateDisplay.getPlannedMainShelfQty() != null
&& dto.getActualMainShelfType() != null && dto.getActualMainShelfQty() != null) {
boolean mainShelfTypeMatch = dto.getActualMainShelfType().equals(updateDisplay.getPlannedMainShelfType());
boolean mainShelfQtySufficient = dto.getActualMainShelfQty() >= updateDisplay.getPlannedMainShelfQty();
updateDisplay.setActualMainShelfExecuted((mainShelfTypeMatch && mainShelfQtySufficient) ? "执行" : "未执行");
// 提取计划值中的数字(如“7纵”→7)
String plannedType = updateDisplay.getPlannedMainShelfType().trim();
Integer plannedNum = null;
if (plannedType.endsWith("纵")) {
try {
plannedNum = Integer.parseInt(plannedType.replace("纵", ""));
} catch (NumberFormatException e) {
log.warn("计划主货架类型格式错误,无法提取数字:{}", plannedType);
}
}
// 提取实际值中的数字(如“8纵”→8)
String actualType = dto.getActualMainShelfType().trim();
Integer actualNum = null;
if (actualType.endsWith("纵")) {
try {
actualNum = Integer.parseInt(actualType.replace("纵", ""));
} catch (NumberFormatException e) {
log.warn("实际主货架类型格式错误,无法提取数字:{}", actualType);
}
}
// 仅当数字提取成功时,判断“实际≥计划”+数量充足
if (plannedNum != null && actualNum != null) {
// 实际纵数≥计划纵数
boolean mainShelfTypeMatch = actualNum >= plannedNum;
boolean mainShelfQtySufficient = dto.getActualMainShelfQty() >= updateDisplay.getPlannedMainShelfQty();
updateDisplay.setActualMainShelfExecuted((mainShelfTypeMatch && mainShelfQtySufficient) ? "执行" : "未执行");
} else {
// 格式错误,清空执行状态
updateDisplay.setActualMainShelfExecuted("未执行");
}
} else {
updateDisplay.setActualMainShelfExecuted(null);
// 计划/实际值不全,清空执行状态
updateDisplay.setActualMainShelfExecuted("未执行");
}
// 2. 端架执行状态计算
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论