yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/controller/admin/item/MdmItemController.java
@@ -18,6 +18,7 @@
import cn.iocoder.yudao.module.mdm.service.item.MdmItemService;
import cn.iocoder.yudao.module.mdm.service.unit.MdmUnitMeasureService;
import cn.iocoder.yudao.module.mdm.service.warehouse.MdmWarehouseService;
import cn.iocoder.yudao.module.mes.api.item.MesMdItemApi;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -41,6 +42,9 @@
    @Resource
    private MdmItemService itemService;
    @Resource
    private MesMdItemApi mesMdItemApi;
    @Resource
    private MdmItemCategoryService itemCategoryService;
@@ -85,6 +89,15 @@
        return success(true);
    }
    @DeleteMapping("/delete-list")
    @Operation(summary = "批量删除物料")
    @Parameter(name = "ids", description = "编号列表", required = true, example = "1,2,3")
    @PreAuthorize("@ss.hasPermission('mdm:item:delete')")
    public CommonResult<Boolean> deleteItemList(@RequestParam("ids") List<Long> ids) {
        itemService.deleteItemList(ids);
        return success(true);
    }
    @GetMapping("/get")
    @Operation(summary = "获得物料")
    @Parameter(name = "id", description = "编号", required = true, example = "1")
@@ -96,6 +109,8 @@
            enrichItemRespVO(resp);
            // 填充批次属性配置
            enrichItemBatchConfig(resp);
            // 填充同步状态
            resp.setSyncedMes(mesMdItemApi.getSyncedMdmItemIds(Set.of(id)).contains(id));
        }
        return success(resp);
    }
@@ -113,6 +128,9 @@
                convertSet(pageResult.getList(), MdmItemDO::getUnitMeasureId));
        // 转换
        List<MdmItemRespVO> respList = BeanUtils.toBean(pageResult.getList(), MdmItemRespVO.class);
        // 批量查询同步状态
        Set<Long> allIds = convertSet(respList, MdmItemRespVO::getId);
        Set<Long> syncedIds = mesMdItemApi.getSyncedMdmItemIds(allIds);
        // 批量关联查询辅单位名称
        Set<Long> unitIds = new HashSet<>();
        respList.forEach(resp -> {
@@ -152,6 +170,8 @@
            if (warehouse != null) {
                resp.setWarehouseName(warehouse.getName());
            }
            // 同步状态
            resp.setSyncedMes(syncedIds.contains(resp.getId()));
        });
        return success(new PageResult<>(respList, pageResult.getTotal()));
    }