Merge remote-tracking branch 'origin/develop-hlq20260421mpm' into develop

This commit is contained in:
10001392 2026-05-19 10:19:53 +08:00
commit 17e72e3ba5
1 changed files with 13 additions and 1 deletions

View File

@ -83,8 +83,20 @@ public class MaterialZipImportProcessor implements BasicProcessor {
WmsMaterial old = materialService.getCurrent(materialNo);
if (Objects.isNull(old) || StrUtil.isNotBlank(old.getImage())) {
omsLogger.info("添加图纸");
// 计算新版本号
String newVersion;
if (Objects.isNull(old)) {
newVersion = "1";
} else {
try {
int versionNum = Integer.parseInt(old.getVersion());
newVersion = String.valueOf(versionNum + 1);
} catch (NumberFormatException e) {
newVersion = old.getVersion() + ".1";
}
}
WmsMaterial material = new WmsMaterial()
.setVersion(Objects.isNull(old) ? 1 : old.getVersion() + 1)
.setVersion(newVersion)
.setNo(bomMaterialDTO.getMaterialNo())
.setDescribe(bomMaterialDTO.getMaterialDesc())
.setDrawingNo(bomMaterialDTO.getDrawingNo())