From 4470afbf3329126a908c468511ce3d1146ab1f42 Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 14 Dec 2023 10:27:25 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E7=89=A9=E6=96=99=E5=8A=A0?= =?UTF-8?q?=E5=9E=8B=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/aucma/base/domain/BaseMaterialInfo.java | 10 +++++----- .../impl/BaseMaterialInfoServiceImpl.java | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/aucma-base/src/main/java/com/aucma/base/domain/BaseMaterialInfo.java b/aucma-base/src/main/java/com/aucma/base/domain/BaseMaterialInfo.java index 8623da2..0ff0889 100644 --- a/aucma-base/src/main/java/com/aucma/base/domain/BaseMaterialInfo.java +++ b/aucma-base/src/main/java/com/aucma/base/domain/BaseMaterialInfo.java @@ -48,9 +48,9 @@ public class BaseMaterialInfo extends BaseEntity @Excel(name = "MATKL") private String materialMatkl; - /** 物料规格 */ - @Excel(name = "物料规格") - private Long materialSpecifications; + /** 物料型号 */ + @Excel(name = "物料型号") + private String materialSpecifications; /** 所属工厂编号 */ @Excel(name = "所属工厂编号") @@ -183,11 +183,11 @@ public class BaseMaterialInfo extends BaseEntity this.materialMatkl = materialMatkl; } - public Long getMaterialSpecifications() { + public String getMaterialSpecifications() { return materialSpecifications; } - public void setMaterialSpecifications(Long materialSpecifications) { + public void setMaterialSpecifications(String materialSpecifications) { this.materialSpecifications = materialSpecifications; } diff --git a/aucma-base/src/main/java/com/aucma/base/service/impl/BaseMaterialInfoServiceImpl.java b/aucma-base/src/main/java/com/aucma/base/service/impl/BaseMaterialInfoServiceImpl.java index aa496ef..e045064 100644 --- a/aucma-base/src/main/java/com/aucma/base/service/impl/BaseMaterialInfoServiceImpl.java +++ b/aucma-base/src/main/java/com/aucma/base/service/impl/BaseMaterialInfoServiceImpl.java @@ -2,6 +2,7 @@ package com.aucma.base.service.impl; import java.util.List; +import com.aucma.base.utils.MaterialConstants; import com.aucma.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -54,6 +55,22 @@ public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService @Override public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo) { + //维护物料型号 + String materialName = baseMaterialInfo.getMaterialName(); + String materialSubclass = baseMaterialInfo.getMaterialSubclass(); + if (materialSubclass.equals(MaterialConstants.FP_MATERIAL_TYPE)){ + String[] split = materialName.split(","); + if (split.length > 0 && split[0].startsWith("BC")){ + baseMaterialInfo.setMaterialSpecifications(split[0]); + }else { + baseMaterialInfo.setMaterialSpecifications(split[0].substring(1)); + } + }else { + String[] split = materialName.split(","); + if (split.length > 1){ + baseMaterialInfo.setMaterialSpecifications(split[1]); + } + } baseMaterialInfo.setCreatedTime(DateUtils.getNowDate()); return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo); }