物料拓展功能实现

This commit is contained in:
潘荣晟
2025-12-30 17:55:08 +08:00
parent 6c9cb29af2
commit 791fe644bf
10 changed files with 346 additions and 31 deletions

View File

@@ -55,4 +55,6 @@ public interface ErrorCodeConstants {
ErrorCode ERP_CONTRACT_NOT_EXISTS = new ErrorCode(1_016_000_001, "ERP合同数据不存在"); ErrorCode ERP_CONTRACT_NOT_EXISTS = new ErrorCode(1_016_000_001, "ERP合同数据不存在");
ErrorCode ERP_PRODUCTIVE_ORDER_NOT_EXISTS = new ErrorCode(1_017_000_001, "ERP生产订单数据不存在"); ErrorCode ERP_PRODUCTIVE_ORDER_NOT_EXISTS = new ErrorCode(1_017_000_001, "ERP生产订单数据不存在");
ErrorCode MATERIAL_ERROR = new ErrorCode( 1_017_000_009, "主物料信息错误");
} }

View File

@@ -38,7 +38,6 @@ public class ErpMaterialController {
@Resource @Resource
private ErpMaterialService erpMaterialService; private ErpMaterialService erpMaterialService;
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建ERP物料数据") @Operation(summary = "创建ERP物料数据")
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')") @PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
@@ -121,8 +120,8 @@ public class ErpMaterialController {
@PostMapping("/createErpMaterialCorr") @PostMapping("/createErpMaterialCorr")
@Operation(summary = "创建ERP物料关系") @Operation(summary = "创建ERP物料关系")
@PreAuthorize("@ss.hasPermission('sply:erp-material:create')") @PreAuthorize("@ss.hasPermission('sply:erp-material:create')")
public CommonResult<List<ErpMaterialRespVO>> createErpMaterialCorr(@Valid @RequestBody List<ErpMaterialCorrSaveReqVO> erpMaterialCorrSaveReqVOS) { public CommonResult<List<ErpMaterialRespVO>> createErpMaterialCorr(@Valid @RequestBody ErpMaterialCorrSaveReqVO erpMaterialCorrSaveReqVO) {
return success(erpMaterialService.createErpMaterialCorr(erpMaterialCorrSaveReqVOS)); return success(erpMaterialService.createErpMaterialCorr(erpMaterialCorrSaveReqVO));
} }
//删除物料关系 //删除物料关系
@DeleteMapping("/deleteErpMaterialCorr") @DeleteMapping("/deleteErpMaterialCorr")

View File

@@ -1,11 +1,12 @@
package com.zt.plat.module.erp.controller.admin.erp.vo; package com.zt.plat.module.erp.controller.admin.erp.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
import java.util.List;
@Schema(description = "管理后台 - 物料拓展关系 Request VO") @Schema(description = "管理后台 - 物料拓展关系 Request VO")
@Data @Data
public class ErpMaterialCorrSaveReqVO { public class ErpMaterialCorrSaveReqVO {
@@ -22,19 +23,25 @@ public class ErpMaterialCorrSaveReqVO {
@NotNull(message = "拓展关系主物料不能为空") @NotNull(message = "拓展关系主物料不能为空")
private Long materialParentId; private Long materialParentId;
/**
* 物料ID
*/
@Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED)
private Long materialId;
/** /**
* 拓展关系主物料编号 * 拓展关系主物料编号
*/ */
@Schema(description = "拓展关系主物料编号") @Schema(description = "拓展关系主物料编号")
private String materialParentCode; private String materialParentCode;
/** /**
* 物料编码 * 拓展关系物料
*/ */
@Schema(description = "拓展关系物料编号") @Schema(description = "拓展关系物料")
private String materialCode; private List<Materials> materials;
@Data
@Schema(description = "拓展关系物料")
public static class Materials {
@Schema(description = "物料ID", requiredMode = Schema.RequiredMode.REQUIRED)
private Long materialId;
@Schema(description = "物料编码")
private String materialCode;
}
} }

View File

@@ -0,0 +1,211 @@
package com.zt.plat.module.erp.controller.admin.erp.vo;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
import lombok.Getter;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*;
import java.util.stream.Collectors;
/**
* 物料扩展属性安全取值工具类(适配所有属性编码)
*/
public class MaterialAttributeUtils {
/**
* 物料属性编码枚举统一管理所有属性code
* 关联属性编码、名称、数据类型
*/
@Getter
public enum MaterialAttrCode {
MTRL_BASE_UNIT_CODE("mtrlBaseUnitCode", "基本计量单位编码", DataType.STRING),
MTRL_BASE_UNIT_NAME("mtrlBaseUnitName", "基本计量单位描述", DataType.STRING),
MTRL_SHORT_DESC("mtrlShortDesc", "短描述", DataType.STRING),
MTRL_LONG_DESC("mtrlLongDesc", "长描述", DataType.STRING),
MTRL_CHALCO_CODE("mtrlChalcoCode", "中铝编码", DataType.STRING),
MTRL_ZHONGTONG_CODE("mtrlZhongtongCode", "中铜编码", DataType.STRING),
MTRL_SPECIFICATION("mtrlSpecification", "规格", DataType.STRING),
MTRL_TEXTURE("mtrlTexture", "材质", DataType.STRING),
MTRL_RECORD_TIME("mtrlRecordTime", "记录时间", DataType.DATETIME),
MTRL_DRAWING_NUMBER("mtrlDrawingNumber", "图号", DataType.STRING),
MTRL_ORDER_NUMBER("mtrlOrderNumber", "订货号", DataType.STRING),
MTRL_OTHER_PARAMETERS("mtrlOtherParameters", "其它参数", DataType.STRING),
MTRL_EQUIPMENT_CATEGORY("mtrlEquipmentCategory", "设备类别", DataType.STRING),
MTRL_MANUFACTURER("mtrlManufacturer", "主机生产商", DataType.STRING),
MTRL_SOURCE("mtrlSource", "来源", DataType.STRING),
MTRL_MODEL("mtrlModel", "型号", DataType.STRING),
MTRL_ELEMENT("mtrlElement", "金属元素", DataType.TEXT),
MTRL_DECIMAL("mtrlDecimal", "小数位数", DataType.NUMBER);
private final String code;
private final String name;
private final DataType dataType;
MaterialAttrCode(String code, String name, DataType dataType) {
this.code = code;
this.name = name;
this.dataType = dataType;
}
// 根据code获取枚举容错
public static MaterialAttrCode getByCode(String code) {
if (code == null || code.isEmpty()) {
return null;
}
for (MaterialAttrCode attrCode : values()) {
if (attrCode.code.equals(code)) {
return attrCode;
}
}
return null;
}
// 获取所有属性编码列表
public static List<String> getAllCodes() {
return Arrays.stream(values())
.map(MaterialAttrCode::getCode)
.collect(Collectors.toList());
}
}
/**
* 数据类型枚举
*/
public enum DataType {
STRING, NUMBER, TEXT, DATETIME
}
/**
* 物料属性封装RecordJava 16+
* 包含所有属性的安全取值
*/
public record MaterialAttribute(
// 基础属性
String mtrlBaseUnitCode,
String mtrlBaseUnitName,
String mtrlShortDesc,
String mtrlLongDesc,
String mtrlChalcoCode,
String mtrlZhongtongCode,
String mtrlSpecification,
String mtrlTexture,
LocalDateTime mtrlRecordTime,
// 扩展属性
String mtrlDrawingNumber,
String mtrlOrderNumber,
String mtrlOtherParameters,
String mtrlEquipmentCategory,
String mtrlManufacturer,
String mtrlSource,
String mtrlModel,
String mtrlElement,
Integer mtrlDecimal // 小数位数(数字类型)
) {
// 空值默认构造器避免NPE
public static MaterialAttribute empty() {
return new MaterialAttribute(
null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null
);
}
}
/**
* 从DTO中安全提取所有物料属性
* @param dto 物料信息DTO
* @return 封装后的物料属性Record
*/
public static MaterialAttribute safeExtractAllAttributes(MaterialInfomationRespDTO dto) {
// 1. 空值校验
if (dto == null || dto.getFlatAttributes() == null) {
return MaterialAttribute.empty();
}
Map<String, Object> attrs = dto.getFlatAttributes();
// 2. 按数据类型安全取值
return new MaterialAttribute(
getTypedValue(attrs, MaterialAttrCode.MTRL_BASE_UNIT_CODE),
getTypedValue(attrs, MaterialAttrCode.MTRL_BASE_UNIT_NAME),
getTypedValue(attrs, MaterialAttrCode.MTRL_SHORT_DESC),
getTypedValue(attrs, MaterialAttrCode.MTRL_LONG_DESC),
getTypedValue(attrs, MaterialAttrCode.MTRL_CHALCO_CODE),
getTypedValue(attrs, MaterialAttrCode.MTRL_ZHONGTONG_CODE),
getTypedValue(attrs, MaterialAttrCode.MTRL_SPECIFICATION),
getTypedValue(attrs, MaterialAttrCode.MTRL_TEXTURE),
getTypedValue(attrs, MaterialAttrCode.MTRL_RECORD_TIME),
getTypedValue(attrs, MaterialAttrCode.MTRL_DRAWING_NUMBER),
getTypedValue(attrs, MaterialAttrCode.MTRL_ORDER_NUMBER),
getTypedValue(attrs, MaterialAttrCode.MTRL_OTHER_PARAMETERS),
getTypedValue(attrs, MaterialAttrCode.MTRL_EQUIPMENT_CATEGORY),
getTypedValue(attrs, MaterialAttrCode.MTRL_MANUFACTURER),
getTypedValue(attrs, MaterialAttrCode.MTRL_SOURCE),
getTypedValue(attrs, MaterialAttrCode.MTRL_MODEL),
getTypedValue(attrs, MaterialAttrCode.MTRL_ELEMENT),
getTypedValue(attrs, MaterialAttrCode.MTRL_DECIMAL)
);
}
/**
* 通用类型安全取值方法
* @param attrs 属性Map
* @param attrCode 属性编码枚举
* @return 对应类型的值(空/类型不匹配返回null
*/
@SuppressWarnings("unchecked")
private static <T> T getTypedValue(Map<String, Object> attrs, MaterialAttrCode attrCode) {
if (attrCode == null) {
return null;
}
Object value = attrs.get(attrCode.getCode());
if (value == null || value.toString().trim().isEmpty()) {
return null;
}
String strValue = value.toString().trim();
try {
// 根据数据类型转换
return switch (attrCode.getDataType()) {
case STRING, TEXT -> (T) strValue;
case NUMBER -> (T) Integer.valueOf(strValue);
case DATETIME -> (T) LocalDateTime.parse(strValue);
};
} catch (NumberFormatException | DateTimeParseException | ClassCastException e) {
// 类型转换失败返回null可添加日志
return null;
}
}
/**
* 单独获取某个属性值(按需取值)
* @param dto 物料DTO
* @param attrCode 属性编码枚举
* @return 对应类型的值
*/
public static <T> T getSingleAttribute(MaterialInfomationRespDTO dto, MaterialAttrCode attrCode) {
if (dto == null || dto.getFlatAttributes() == null || attrCode == null) {
return null;
}
return getTypedValue(dto.getFlatAttributes(), attrCode);
}
/**
* 获取flatAttributes中存在的所有属性编码过滤空值
* @param dto 物料DTO
* @return 非空属性编码列表
*/
public static List<String> getExistAttributeCodes(MaterialInfomationRespDTO dto) {
if (dto == null || dto.getFlatAttributes() == null) {
return Collections.emptyList();
}
return dto.getFlatAttributes().entrySet().stream()
.filter(entry -> entry.getValue() != null && !entry.getValue().toString().trim().isEmpty())
.map(Map.Entry::getKey)
.filter(key -> MaterialAttrCode.getByCode(key) != null) // 只保留枚举中定义的编码
.collect(Collectors.toList());
}
}

View File

@@ -0,0 +1,16 @@
package com.zt.plat.module.erp.framework.rpc.config;
import com.zt.plat.module.base.api.materialinfomation.MaterialInfomationApi;
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.system.api.dept.DeptApi;
import com.zt.plat.module.system.api.sequence.SequenceApi;
import com.zt.plat.module.system.api.user.AdminUserApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(value = "erpRpcConfiguration", proxyBeanMethods = false)
@EnableFeignClients(clients = {DeptApi.class, SequenceApi.class, AdminUserApi.class, BusinessFileApi.class, FileApi.class, MaterialInfomationApi.class})
public class RpcConfiguration {
}

View File

@@ -13,6 +13,6 @@ import java.util.List;
* @author 后台管理 * @author 后台管理
*/ */
public interface ErpErpMaterialCorrService { public interface ErpErpMaterialCorrService {
List<ErpMaterialCorrRspVO> create(@Valid List<ErpMaterialCorrSaveReqVO> reqVO); List<ErpMaterialCorrRspVO> create(@Valid ErpMaterialCorrSaveReqVO reqVO);
void deleteBatch(BatchDeleteReqVO reqVO); void deleteBatch(BatchDeleteReqVO reqVO);
} }

View File

@@ -10,6 +10,7 @@ import jakarta.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
@@ -19,10 +20,18 @@ public class ErpErpMaterialCorrServiceImpl implements ErpErpMaterialCorrService{
private ErpErpMaterialCorrMapper erpErpMaterialCorrMapper; private ErpErpMaterialCorrMapper erpErpMaterialCorrMapper;
@Override @Override
public List<ErpMaterialCorrRspVO> create(List<ErpMaterialCorrSaveReqVO> reqVO) { public List<ErpMaterialCorrRspVO> create(ErpMaterialCorrSaveReqVO reqVO) {
List<ErpMaterialCorrDO> bean = BeanUtils.toBean(reqVO, ErpMaterialCorrDO.class); List<ErpMaterialCorrDO> erpMaterialCorrDOS=new ArrayList<>();
erpErpMaterialCorrMapper.insertBatch(bean); reqVO.getMaterials().forEach(materials -> {
return BeanUtils.toBean(bean, ErpMaterialCorrRspVO.class); erpMaterialCorrDOS.add(ErpMaterialCorrDO.builder()
.materialParentId(reqVO.getMaterialParentId())
.materialParentCode(reqVO.getMaterialParentCode())
.materialId(materials.getMaterialId())
.materialCode(materials.getMaterialCode())
.build());
});
erpErpMaterialCorrMapper.insertBatch(erpMaterialCorrDOS);
return BeanUtils.toBean(erpMaterialCorrDOS, ErpMaterialCorrRspVO.class);
} }
@Override @Override

View File

@@ -269,6 +269,11 @@ public class ErpFactoryServiceImpl implements ErpFactoryService {
private void saveData(ProcessingResult result) { private void saveData(ProcessingResult result) {
// 批量新增和更新 // 批量新增和更新
if (!result.toInsert.isEmpty()) { if (!result.toInsert.isEmpty()) {
//自动绑定工厂
result.toInsert.forEach(r->{
r.setRelName(r.getName());
r.setRelnumber(r.getNumber());
});
erpFactoryMapper.insertBatch(result.toInsert); erpFactoryMapper.insertBatch(result.toInsert);
// 批量查询刚插入数据的id提升效率 // 批量查询刚插入数据的id提升效率
List<String> insertedNumbers = result.toInsert.stream() List<String> insertedNumbers = result.toInsert.stream()

View File

@@ -70,7 +70,7 @@ public interface ErpMaterialService {
String getMaterialUnit(String materialNumber); String getMaterialUnit(String materialNumber);
List<ErpMaterialRespVO> createErpMaterialCorr(List<ErpMaterialCorrSaveReqVO> erpMaterialCorrSaveReqVOS); List<ErpMaterialRespVO> createErpMaterialCorr(ErpMaterialCorrSaveReqVO erpMaterialCorrSaveReqVO);
void deleteErpMaterialCorr(BatchDeleteReqVO reqVO); void deleteErpMaterialCorr(BatchDeleteReqVO reqVO);
} }

View File

@@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.annotation.XxlJob;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.api.BaseApi; import com.zt.plat.module.api.BaseApi;
import com.zt.plat.module.api.dto.MaterialOtherDTO; import com.zt.plat.module.api.dto.MaterialOtherDTO;
import com.zt.plat.module.base.api.materialinfomation.MaterialInfomationApi;
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
import com.zt.plat.module.erp.api.dto.ErpMaterialDTO; import com.zt.plat.module.erp.api.dto.ErpMaterialDTO;
import com.zt.plat.module.erp.controller.admin.erp.vo.*; import com.zt.plat.module.erp.controller.admin.erp.vo.*;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO; import com.zt.plat.module.erp.dal.dataobject.erp.ErpWarehouseDO;
@@ -19,16 +22,14 @@ import com.zt.plat.module.erp.enums.OftenEnum;
import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO; import com.zt.plat.module.erp.dal.dataobject.erp.ErpMaterialDO;
import com.zt.plat.module.erp.dal.mysql.erp.ErpMaterialMapper; import com.zt.plat.module.erp.dal.mysql.erp.ErpMaterialMapper;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.validation.constraints.NotNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -54,6 +55,8 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
private ErpConfig erpConfig; private ErpConfig erpConfig;
@Resource @Resource
private ErpErpMaterialCorrService erpMaterialCorrService; private ErpErpMaterialCorrService erpMaterialCorrService;
@Resource
private MaterialInfomationApi materialInfomationApi;
@Override @Override
public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) { public ErpMaterialRespVO createErpMaterial(ErpMaterialSaveReqVO createReqVO) {
@@ -184,16 +187,66 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
} }
@Override @Override
public List<ErpMaterialRespVO> createErpMaterialCorr(List<ErpMaterialCorrSaveReqVO> erpMaterialCorrSaveReqVOS) { public List<ErpMaterialRespVO> createErpMaterialCorr(ErpMaterialCorrSaveReqVO erpMaterialCorrSaveReqVO) {
List<ErpMaterialCorrRspVO> erpMaterialCorrRspVOS = erpMaterialCorrService.create(erpMaterialCorrSaveReqVOS); List<ErpMaterialCorrRspVO> erpMaterialCorrRspVOS = erpMaterialCorrService.create(erpMaterialCorrSaveReqVO);
return erpMaterialCorrRspVOS.stream().map(erpMaterialCorrRspVO -> { List<ErpMaterialRespVO> erpMaterialRespVOS = new ArrayList<>();
//TODO 通过物料id返回物料信息 Set<Long> parentIds = erpMaterialCorrRspVOS.stream().map(ErpMaterialCorrRspVO::getMaterialParentId).filter(Objects::nonNull).collect(Collectors.toSet());
ErpMaterialRespVO erpMaterialRespVO = new ErpMaterialRespVO(); Set<Long> materialIds = erpMaterialCorrRspVOS.stream().map(ErpMaterialCorrRspVO::getMaterialId).filter(Objects::nonNull).collect(Collectors.toSet());
BeanUtils.copyProperties(erpMaterialCorrRspVO, erpMaterialRespVO); if (parentIds.size() != 1) {
return erpMaterialRespVO; throw exception(MATERIAL_ERROR);
}).collect(Collectors.toList()); }
ErpMaterialRespVO erpMaterialParent = buildErpMaterialRespDataById(parentIds.iterator().next());
erpMaterialRespVOS.add(erpMaterialParent);
if (!materialIds.isEmpty()) {
for (Long materialId : materialIds) {
ErpMaterialRespVO erpMaterialRespVO = buildErpMaterialRespDataById(materialId);
erpMaterialRespVOS.add(erpMaterialRespVO);
}
}
return erpMaterialRespVOS;
} }
private ErpMaterialRespVO buildErpMaterialRespDataById(Long id) {
CommonResult<MaterialInfomationRespDTO> materialInfomation = materialInfomationApi.getMaterialInfomation(id);
return BeanUtils.toBean(buildErpMaterialDOData(materialInfomation), ErpMaterialRespVO.class);
}
public ErpMaterialDO buildErpMaterialDOData(CommonResult<MaterialInfomationRespDTO> materialInfomation) {
if (materialInfomation.getData() == null) {
return new ErpMaterialDO();
}
ErpMaterialDO erpMaterialDO = new ErpMaterialDO();
MaterialInfomationRespDTO data = materialInfomation.getData();
MaterialAttributeUtils.MaterialAttribute materialAttribute = MaterialAttributeUtils.safeExtractAllAttributes(data);
// 有对应关系的字段赋值
erpMaterialDO.setId(data.getId()); // 主键
erpMaterialDO.setMaterialName(data.getName()); // 物料名称
erpMaterialDO.setDownCenterNumber(materialAttribute.mtrlZhongtongCode()); // 中铜物料编码
erpMaterialDO.setCenterNumber(materialAttribute.mtrlChalcoCode()); // 中铝物料编码
erpMaterialDO.setUnit(materialAttribute.mtrlBaseUnitCode()); // 计量单位编码
erpMaterialDO.setUnitDescription(materialAttribute.mtrlBaseUnitName()); // 计量单位描述
erpMaterialDO.setMaterialLengthDescription(materialAttribute.mtrlLongDesc()); // 物料长描述
if (materialAttribute.mtrlDecimal() != null) {
erpMaterialDO.setDecimalValue(materialAttribute.mtrlDecimal().longValue()); // 小数位数
}
erpMaterialDO.setAbbreviation(materialAttribute.mtrlElement()); // 金属元素缩写
erpMaterialDO.setCreateDate(materialAttribute.mtrlRecordTime()); // 创建日期(物料记录时间)
// 无对应关系的字段(暂未赋值,需根据业务补充映射规则)
// erpMaterialDO.setMaterialType(null); // 物料类型
// erpMaterialDO.setMaterialGroupDate(null); // 物料大类组
// erpMaterialDO.setExternalMaterialGroupDate(null); // 外部物料小类组
// erpMaterialDO.setMaterialTypeDescription(null); // 物料类型描述
// erpMaterialDO.setMaterialGroupDescription(null); // 物料组描述
// erpMaterialDO.setExternalMaterialGroupDescription(null); // 外部物料小类组描述
// erpMaterialDO.setType(null); // 类型TP
// erpMaterialDO.setName(null); // 金属元素名称NAME字段需区分物料名称
// erpMaterialDO.setCoding(null); // 金属元素编码
// erpMaterialDO.setGradeUnit(null); // 品位单位
return erpMaterialDO;
}
@Override @Override
public void deleteErpMaterialCorr(BatchDeleteReqVO reqVO) { public void deleteErpMaterialCorr(BatchDeleteReqVO reqVO) {
erpMaterialCorrService.deleteBatch(reqVO); erpMaterialCorrService.deleteBatch(reqVO);
@@ -321,4 +374,17 @@ public class ErpMaterialServiceImpl implements ErpMaterialService {
.collect(Collectors.toList()); .collect(Collectors.toList());
myRedisConfig.updateRedisCache(key, existingNumbers); myRedisConfig.updateRedisCache(key, existingNumbers);
} }
public record MaterialAttribute(
String baseUnitCode, // 基础单位编码
String baseUnitName, // 基础单位名称
String shortDesc, // 物料短描述
String longDesc, // 物料长描述
String chalcoCode, // 中铝编码
String zhongtongCode, // 中铜编码
String specification, // 规格
String texture, // 材质
String recordTime// 记录时间
) {
}
} }