| | |
| | | import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemBatchConfigDO; |
| | | import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemDO; |
| | | import cn.iocoder.yudao.module.mdm.dal.dataobject.unit.MdmUnitMeasureDO; |
| | | import cn.iocoder.yudao.module.mdm.dal.mysql.category.MdmItemCategoryMapper; |
| | | import cn.iocoder.yudao.module.mdm.dal.mysql.item.MdmItemBatchConfigMapper; |
| | | import cn.iocoder.yudao.module.mdm.dal.mysql.item.MdmItemMapper; |
| | | import cn.iocoder.yudao.module.mdm.dal.mysql.unit.MdmUnitMeasureMapper; |
| | |
| | | private MesMdItemApi mesMdItemApi; |
| | | @Resource |
| | | private MdmItemBatchConfigMapper itemBatchConfigMapper; |
| | | |
| | | @Resource |
| | | private MdmItemCategoryMapper itemCategoryMapper; |
| | | |
| | | @Resource |
| | | private MdmUnitMeasureMapper unitMeasureMapper; |
| | |
| | | .createList(new ArrayList<>()).updateList(new ArrayList<>()) |
| | | .failureList(new LinkedHashMap<>()).build(); |
| | | |
| | | // 1. 预热:分类编码 -> ID、单位编码 -> ID |
| | | // 1. 预热:分类编码 -> ID(MES 物料分类,与物料表单下拉数据源一致)、单位编码 -> ID |
| | | Map<String, Long> categoryCodeIdMap = new HashMap<>(); |
| | | for (MdmItemCategoryDO category : itemCategoryMapper.selectList()) { |
| | | if (category.getCode() != null) { |
| | | categoryCodeIdMap.put(category.getCode(), category.getId()); |
| | | for (String categoryCode : importList.stream() |
| | | .map(MdmItemImportExcelVO::getCategoryCode).filter(StrUtil::isNotBlank).distinct().toList()) { |
| | | CommonResult<MesMdItemTypeRespDTO> categoryResult = mesMdItemTypeApi.getItemTypeByCode(categoryCode); |
| | | if (categoryResult != null && categoryResult.getData() != null) { |
| | | categoryCodeIdMap.put(categoryCode, categoryResult.getData().getId()); |
| | | } |
| | | } |
| | | Map<String, Long> unitCodeIdMap = new HashMap<>(); |