feat(wms): 添加材料卷厚度差计算功能

- 在WmsMaterialCoilAllExportVo中新增厚度差字段
- 在导出列配置中添加厚度差映射
- 实现厚度差计算逻辑:理论厚度减去实际厚度
- 添加数字格式异常处理避免程序崩溃
- 支持厚度差数据的Excel导出功能
This commit is contained in:
2026-06-26 11:00:14 +08:00
parent 238e0d2963
commit 230b18eee6
3 changed files with 15 additions and 0 deletions

View File

@@ -211,6 +211,7 @@ public class WmsMaterialCoilController extends BaseController {
columns.put("theoreticalLength", "理论长度");
columns.put("rawMaterialThickness", "原料厚度");
columns.put("chromePlateCoilNo", "镀铬卷号");
columns.put("thicknessDifference", "厚度差");
return R.ok(columns);
}

View File

@@ -245,4 +245,7 @@ public class WmsMaterialCoilAllExportVo {
@ExcelProperty(value = "实测宽度")
private String actualWidth;
@ExcelProperty(value = "厚度差")
private String thicknessDifference;
}

View File

@@ -3807,6 +3807,17 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
String isRelatedText = vo.getIsRelatedToOrder() == 0 ? "" : "";
vo.setIsRelatedToOrderText(isRelatedText);
}
// 计算厚度差:理论厚度 - 实际厚度
if (vo.getTheoreticalThickness() != null && vo.getActualThickness() != null) {
try {
BigDecimal theory = new BigDecimal(vo.getTheoreticalThickness());
BigDecimal actual = new BigDecimal(vo.getActualThickness());
vo.setThicknessDifference(theory.subtract(actual).toString());
} catch (NumberFormatException ignored) {
// 解析失败则留空
}
}
}
}