update - 物料加型号

master
yinq 11 months ago
parent f535efc23b
commit 4470afbf33

@ -48,9 +48,9 @@ public class BaseMaterialInfo extends BaseEntity
@Excel(name = "MATKL") @Excel(name = "MATKL")
private String materialMatkl; private String materialMatkl;
/** 物料规格 */ /** 物料型号 */
@Excel(name = "物料规格") @Excel(name = "物料型号")
private Long materialSpecifications; private String materialSpecifications;
/** 所属工厂编号 */ /** 所属工厂编号 */
@Excel(name = "所属工厂编号") @Excel(name = "所属工厂编号")
@ -183,11 +183,11 @@ public class BaseMaterialInfo extends BaseEntity
this.materialMatkl = materialMatkl; this.materialMatkl = materialMatkl;
} }
public Long getMaterialSpecifications() { public String getMaterialSpecifications() {
return materialSpecifications; return materialSpecifications;
} }
public void setMaterialSpecifications(Long materialSpecifications) { public void setMaterialSpecifications(String materialSpecifications) {
this.materialSpecifications = materialSpecifications; this.materialSpecifications = materialSpecifications;
} }

@ -2,6 +2,7 @@ package com.aucma.base.service.impl;
import java.util.List; import java.util.List;
import com.aucma.base.utils.MaterialConstants;
import com.aucma.common.utils.DateUtils; import com.aucma.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -54,6 +55,22 @@ public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService
@Override @Override
public int insertBaseMaterialInfo(BaseMaterialInfo baseMaterialInfo) 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()); baseMaterialInfo.setCreatedTime(DateUtils.getNowDate());
return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo); return baseMaterialInfoMapper.insertBaseMaterialInfo(baseMaterialInfo);
} }

Loading…
Cancel
Save