feat(wms): 添加材料卷厚度差计算功能
- 在WmsMaterialCoilAllExportVo中新增厚度差字段 - 在导出列配置中添加厚度差映射 - 实现厚度差计算逻辑:理论厚度减去实际厚度 - 添加数字格式异常处理避免程序崩溃 - 支持厚度差数据的Excel导出功能
This commit is contained in:
@@ -211,6 +211,7 @@ public class WmsMaterialCoilController extends BaseController {
|
|||||||
columns.put("theoreticalLength", "理论长度");
|
columns.put("theoreticalLength", "理论长度");
|
||||||
columns.put("rawMaterialThickness", "原料厚度");
|
columns.put("rawMaterialThickness", "原料厚度");
|
||||||
columns.put("chromePlateCoilNo", "镀铬卷号");
|
columns.put("chromePlateCoilNo", "镀铬卷号");
|
||||||
|
columns.put("thicknessDifference", "厚度差");
|
||||||
return R.ok(columns);
|
return R.ok(columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -245,4 +245,7 @@ public class WmsMaterialCoilAllExportVo {
|
|||||||
|
|
||||||
@ExcelProperty(value = "实测宽度")
|
@ExcelProperty(value = "实测宽度")
|
||||||
private String actualWidth;
|
private String actualWidth;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "厚度差")
|
||||||
|
private String thicknessDifference;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3807,6 +3807,17 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
|||||||
String isRelatedText = vo.getIsRelatedToOrder() == 0 ? "否" : "是";
|
String isRelatedText = vo.getIsRelatedToOrder() == 0 ? "否" : "是";
|
||||||
vo.setIsRelatedToOrderText(isRelatedText);
|
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) {
|
||||||
|
// 解析失败则留空
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user