From 3cf649ca92121b7640e070ae2d81c15563e717f8 Mon Sep 17 00:00:00 2001 From: kkk-ops <1050738955@qq.com> Date: Tue, 27 Jan 2026 17:47:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dashboard/DashboardController.java | 73 +++++++++- .../dashboard/vo/DeviceTypePieOptionsVO.java | 17 +++ .../controller/admin/plan/PlanController.java | 135 ++++++++++++++++-- .../admin/plan/vo/DayCapacityVO.java | 23 +++ .../admin/plan/vo/PlanWeekTrendVO.java | 30 ++++ .../controller/admin/plan/vo/WeekDayEnum.java | 65 +++++++++ .../mes/service/plan/PlanServiceImpl.java | 7 +- 7 files changed, 338 insertions(+), 12 deletions(-) create mode 100644 yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/vo/DeviceTypePieOptionsVO.java create mode 100644 yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/DayCapacityVO.java create mode 100644 yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/PlanWeekTrendVO.java create mode 100644 yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/WeekDayEnum.java diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/DashboardController.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/DashboardController.java index c9c3d78bd8..83f5e9a934 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/DashboardController.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/DashboardController.java @@ -5,9 +5,14 @@ import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO; +import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO; +import cn.iocoder.yudao.module.erp.dal.mysql.mold.MoldMapper; +import cn.iocoder.yudao.module.erp.service.mold.MoldBrandService; import cn.iocoder.yudao.module.erp.service.product.ErpProductService; +import cn.iocoder.yudao.module.iot.dal.mysql.device.DeviceMapper; import cn.iocoder.yudao.module.mes.controller.admin.dashboard.vo.*; import cn.iocoder.yudao.module.mes.controller.admin.plan.vo.PlanRespVO; +import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO; import cn.iocoder.yudao.module.mes.dal.dataobject.dvrepair.DvRepairDO; import cn.iocoder.yudao.module.mes.dal.dataobject.moldrepair.MoldRepairDO; import cn.iocoder.yudao.module.mes.dal.dataobject.moldticketmanagement.MoldTicketManagementDO; @@ -15,12 +20,12 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.organization.OrganizationDO; import cn.iocoder.yudao.module.mes.dal.dataobject.plan.PlanDO; import cn.iocoder.yudao.module.mes.dal.dataobject.task.TaskDO; import cn.iocoder.yudao.module.mes.dal.dataobject.ticketmanagement.TicketManagementDO; +import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper; import cn.iocoder.yudao.module.mes.dal.mysql.dvrepair.DvRepairMapper; import cn.iocoder.yudao.module.mes.dal.mysql.plan.PlanMapper; import cn.iocoder.yudao.module.mes.dal.mysql.task.TaskMapper; -import cn.iocoder.yudao.module.mes.dal.mysql.ticketmanagement.TicketManagementMapper; import cn.iocoder.yudao.module.mes.service.deviceledger.DeviceLedgerService; -import cn.iocoder.yudao.module.mes.service.deviceledger.DeviceLedgerServiceImpl; +import cn.iocoder.yudao.module.mes.service.devicetype.DeviceTypeService; import cn.iocoder.yudao.module.mes.service.dvrepair.DvRepairService; import cn.iocoder.yudao.module.mes.service.mold.MoldService; import cn.iocoder.yudao.module.mes.service.moldrepair.MoldRepairService; @@ -45,7 +50,6 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.*; -import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; @@ -93,8 +97,23 @@ public class DashboardController { @Resource private TaskMapper taskMapper; + @Resource + private DeviceLedgerMapper deviceLedgerMapper; + + @Resource + private MoldMapper moldMapper; + + @Resource + private MoldBrandService moldBrandService; + + @Resource + private DeviceTypeService deviceTypeService; + + @Resource + private DeviceMapper deviceMapper; + @GetMapping("/getProduction") @Operation(summary = "获得整体生产概况") @Parameter(name = "id", description = "编号", required = true, example = "1024") @@ -418,4 +437,52 @@ public class DashboardController { deviceRepairLineOptionsVO.setSeries(matchedCounts); return success(deviceRepairLineOptionsVO); } + + @GetMapping("/getDeviceTypePieOptions") + @Operation(summary = "获得设备分类统计") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('mes:bom:query')") + public CommonResult> getDeviceTypePieOptions() { + List deviceTypePieOptionsVOList = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("device_type as deviceType", "COUNT(*) as count") + .groupBy("device_type") + .orderByDesc("count") + .last("LIMIT 5"); + List> result = deviceLedgerMapper.selectMaps(queryWrapper); + for (Map map : result) { + DeviceTypePieOptionsVO vo = new DeviceTypePieOptionsVO(); + // 手动设置属性 + vo.setName(deviceTypeService.getDeviceType(((Number) map.get("deviceType")).longValue()).getName()); + vo.setValue(Integer.parseInt(map.get("count").toString())); + deviceTypePieOptionsVOList.add(vo); + + } + return success(deviceTypePieOptionsVOList); + } + + @GetMapping("/getMoldTypeBarOptions") + @Operation(summary = "获得模具分类分布统计") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('mes:bom:query')") + public CommonResult getMoldTypeBarOptions() { + DeviceRepairLineOptionsVO deviceRepairLineOptionsVO = new DeviceRepairLineOptionsVO(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.select("brand_id as brandId", "COUNT(*) as count") + .groupBy("brand_id") + .orderByDesc("count") + .last("LIMIT 5"); + List> result = moldMapper.selectMaps(queryWrapper); + List xAxis = new ArrayList<>(); + List series = new ArrayList<>(); + for (Map map : result) { + DeviceTypePieOptionsVO vo = new DeviceTypePieOptionsVO(); + // 手动设置属性 + xAxis.add(moldBrandService.getMoldBrand(((Number) map.get("brandId")).longValue()).getName()); + series.add(Integer.parseInt(map.get("count").toString())); + } + deviceRepairLineOptionsVO.setXAxis(xAxis); + deviceRepairLineOptionsVO.setSeries(series); + return success(deviceRepairLineOptionsVO); + } } diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/vo/DeviceTypePieOptionsVO.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/vo/DeviceTypePieOptionsVO.java new file mode 100644 index 0000000000..51807a8127 --- /dev/null +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dashboard/vo/DeviceTypePieOptionsVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.mes.controller.admin.dashboard.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 首页设备分类统计 Response VO") +@Data +@ExcelIgnoreUnannotated +public class DeviceTypePieOptionsVO { + @Schema(description = "name") + private String name; + + + @Schema(description = "value") + private Integer value; +} diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/PlanController.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/PlanController.java index eaec37ed9f..240d9671af 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/PlanController.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/PlanController.java @@ -10,11 +10,14 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO; import cn.iocoder.yudao.module.iot.framework.mqtt.utils.DateUtils; +import cn.iocoder.yudao.module.mes.controller.admin.dashboard.vo.DeviceTypePieOptionsVO; import cn.iocoder.yudao.module.mes.controller.admin.itemrequisition.vo.ItemRequisitionRespVO; import cn.iocoder.yudao.module.mes.controller.admin.itemrequisition.vo.ItemRequisitionSaveReqVO; import cn.iocoder.yudao.module.mes.controller.admin.plan.vo.*; import cn.iocoder.yudao.module.mes.controller.admin.zjproductrecord.vo.ZjProductRecordRespVO; import cn.iocoder.yudao.module.mes.controller.admin.zjproductrecord.vo.ZjProductRecordSaveReqVO; +import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO; +import cn.iocoder.yudao.module.mes.dal.dataobject.dvrepair.DvRepairDO; import cn.iocoder.yudao.module.mes.dal.dataobject.itemrequisition.ItemRequisitionDO; import cn.iocoder.yudao.module.mes.dal.dataobject.organization.OrganizationDO; import cn.iocoder.yudao.module.mes.dal.dataobject.plan.PlanDO; @@ -27,6 +30,8 @@ import cn.iocoder.yudao.module.mes.service.organization.OrganizationService; import cn.iocoder.yudao.module.mes.service.plan.PlanService; import cn.iocoder.yudao.module.mes.service.zjproduct.ZjProductService; import cn.iocoder.yudao.module.mes.service.zjproductrecord.ZjProductRecordService; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -40,15 +45,16 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.time.DayOfWeek; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.*; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; +import static org.apache.ibatis.ognl.OgnlOps.getIntValue; @Tag(name = "管理后台 - 生产计划") @RestController @@ -129,6 +135,7 @@ public class PlanController { PageResult pageResult = planService.getPlanPage(pageReqVO); return success(new PageResult<>(buildVOList(pageResult.getList()), pageResult.getTotal())); } + private List buildVOList(List list) { if (CollUtil.isEmpty(list)) { return Collections.emptyList(); @@ -174,6 +181,7 @@ public class PlanController { planService.arrangePlan(saveReqVO, planDO, list); return success(true); } + @PutMapping("/typePaigong") @Operation(summary = "工序派工") //@PreAuthorize("@ss.hasPermission('mes:plan:update')") @@ -208,7 +216,7 @@ public class PlanController { // 入库 else if ("store".equals(statusUpdateVO.getCode())) { planDO.setStatus(PlanStatusEnum.已入库.getValue()); - planService.createPlanStockIn(statusUpdateVO,planDO); + planService.createPlanStockIn(statusUpdateVO, planDO); } planMapper.updateById(planDO); return success(true); @@ -235,6 +243,7 @@ public class PlanController { List proList = planService.getProductByPlanStatus(status); return success(proList); } + @GetMapping("/getByStatus") @Operation(summary = "获得生产计划") @Parameter(name = "status", description = "状态", required = true, example = "1024") @@ -250,6 +259,24 @@ public class PlanController { return success(planRespVOList); } + @GetMapping("/getProductPlans") + @Operation(summary = "获得生产计划") + @Parameter(name = "status", description = "状态", required = true, example = "1024") + public CommonResult> getProductPlans() { + List statusList = new ArrayList<>(); + statusList.add(PlanStatusEnum.试产.getValue()); + statusList.add(PlanStatusEnum.量产.getValue()); + statusList.add(PlanStatusEnum.暂停.getValue()); + statusList.add(PlanStatusEnum.待入库.getValue()); + //statusList.add(PlanStatusEnum.开工.getValue()); +// statusList.add(PlanStatusEnum.派工.getValue()); +// statusList.add(PlanStatusEnum.计划.getValue()); +// statusList.add(PlanStatusEnum.暂停.getValue()); + List proList = planService.getPlanByStatus(statusList); + List planRespVOList = planService.buildVOList(proList); + return success(planRespVOList); + } + @GetMapping("/getByTicketType") @Operation(summary = "获得质检工单下拉") @Parameter(name = "status", description = "状态", required = true, example = "1024") @@ -258,9 +285,9 @@ public class PlanController { List statusList = new ArrayList<>(); statusList.add(status); statusList.add(PlanStatusEnum.已排产.getValue()); - statusList.add(PlanStatusEnum.试产.getValue()); - statusList.add(PlanStatusEnum.量产.getValue()); - statusList.add(PlanStatusEnum.暂停.getValue()); + statusList.add(PlanStatusEnum.试产.getValue()); + statusList.add(PlanStatusEnum.量产.getValue()); + statusList.add(PlanStatusEnum.暂停.getValue()); List proList = planService.getPlanByStatus(statusList); List planRespVOList = planService.buildVOList(proList); return success(planRespVOList); @@ -285,5 +312,97 @@ public class PlanController { return success(true); } + @GetMapping("/getWeekTrend") + @Operation(summary = "综合大屏-周生产趋势") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getWeekTrend() { + PlanWeekTrendVO planWeekTrendVO = new PlanWeekTrendVO(); + LocalDate today = LocalDate.now(); + // 获取本周一 + LocalDate start = today.with(DayOfWeek.MONDAY); + // 获取本周日 + LocalDate end = today.with(DayOfWeek.SUNDAY); + + // 转换为 Date + Date monday = Date.from(start.atStartOfDay(ZoneId.systemDefault()).toInstant()); + Date sunday = Date.from(end.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant()); + List> result = planMapper.selectMaps( + new QueryWrapper() + .select( + "DATE(create_time) as date", + "DAYOFWEEK(create_time) as weekday", + "SUM(plan_number) as planCount", + "SUM(wangong_number) as wangongCount" + ) + .ge("create_time", monday) + .le("create_time", sunday) + .groupBy("DATE(create_time), DAYOFWEEK(create_time)") + .orderByAsc("DATE(create_time)") + ); + List weekDays = new ArrayList<>(Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日")); + List weekPlan = new ArrayList<>(Collections.nCopies(7, 0)); + List weekReal = new ArrayList<>(Collections.nCopies(7, 0)); + for (Map map : result) { + Object weekdayObj = map.get("weekday"); + // 确定星期字符串 + String weekdayStr = null; + if (weekdayObj instanceof Integer) { + int dayCode = (Integer) weekdayObj; + weekdayStr = WeekDayEnum.getNameByCode(dayCode); // 使用枚举转换 + } else if (weekdayObj instanceof String) { + weekdayStr = (String) weekdayObj; + } else if (weekdayObj != null) { + weekdayStr = weekdayObj.toString(); + } + // 匹配并填充数据 + if (weekdayStr != null) { + int index = weekDays.indexOf(weekdayStr); + if (index != -1) { + int plan = Math.max(getIntValue(map.get("planCount")), 0); + int real = Math.max(getIntValue(map.get("wangongCount")), 0); + + weekPlan.set(index, plan); + weekReal.set(index, real); + weekReal.set(index, real); + } + } + + } + planWeekTrendVO.setWeekDays(weekDays); + planWeekTrendVO.setWeekPlan(weekPlan); + planWeekTrendVO.setWeekReal(weekReal); + return success(planWeekTrendVO); + } + + @GetMapping("/getDayCapacity") + @Operation(summary = "综合大屏-日产能达成情况") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult getDayCapacity() { + DayCapacityVO dayCapacityVO = new DayCapacityVO(); + List statusList = new ArrayList<>(Collections.singletonList(PlanStatusEnum.已排产.getValue())); + List planDOList = planService.getPlanByStatus(statusList); + // 排产单数量 + dayCapacityVO.setOrders(planDOList.size()); + // 排产数量 + int plan = 0; + for (PlanDO planDO : planDOList) { + if (planDO.getPlanNumber() != null) { + plan = plan + planDO.getPlanNumber().intValue(); + } + } + dayCapacityVO.setPlan(plan); + // 已生产数量 + statusList = Arrays.asList(PlanStatusEnum.已入库.getValue(),PlanStatusEnum.待入库.getValue());; + planDOList = planService.getPlanByStatus(statusList); + int finish = 0; + for (PlanDO planDO : planDOList) { + if (planDO.getWangongNumber() != null) { + finish = finish + planDO.getWangongNumber().intValue(); + } + } + dayCapacityVO.setPending(finish); + return success(dayCapacityVO); + + } } diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/DayCapacityVO.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/DayCapacityVO.java new file mode 100644 index 0000000000..fe30575449 --- /dev/null +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/DayCapacityVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.mes.controller.admin.plan.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + + +@Schema(description = "综合大屏 - 周生产趋势 Resp VO") +@Data +public class DayCapacityVO { + @Schema(description = "orders") + private Integer orders; + + @Schema(description = "plan") + private Integer plan; + + @Schema(description = "pending") + private Integer pending; + + @Schema(description = "rate") + private Double rate; +} diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/PlanWeekTrendVO.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/PlanWeekTrendVO.java new file mode 100644 index 0000000000..0f4109927e --- /dev/null +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/PlanWeekTrendVO.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.mes.controller.admin.plan.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "综合大屏 - 周生产趋势 Resp VO") +@Data +@ToString(callSuper = true) +public class PlanWeekTrendVO { + @Schema(description = "X轴") + private List weekDays; + + @Schema(description = "计划数量") + private List weekPlan; + + @Schema(description = "完工数量") + private List weekReal; + +} + diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/WeekDayEnum.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/WeekDayEnum.java new file mode 100644 index 0000000000..853ae4c139 --- /dev/null +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/plan/vo/WeekDayEnum.java @@ -0,0 +1,65 @@ +package cn.iocoder.yudao.module.mes.controller.admin.plan.vo; + +/** + * 星期枚举 - 简单版 + * 对应 MySQL DAYOFWEEK() 函数返回值 + */ +public enum WeekDayEnum { + + SUNDAY(1, "周日"), + MONDAY(2, "周一"), + TUESDAY(3, "周二"), + WEDNESDAY(4, "周三"), + THURSDAY(5, "周四"), + FRIDAY(6, "周五"), + SATURDAY(7, "周六"); + + private final int code; + private final String name; + + // 静态映射表 + private static final WeekDayEnum[] VALUES = values(); + + WeekDayEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public int getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 根据 DAYOFWEEK() 返回值获取星期名称 + */ + public static String getNameByCode(int code) { + for (WeekDayEnum day : VALUES) { + if (day.code == code) { + return day.name; + } + } + return "未知"; + } + + /** + * 根据 DAYOFWEEK() 返回值获取枚举 + */ + public static WeekDayEnum getByCode(int code) { + for (WeekDayEnum day : VALUES) { + if (day.code == code) { + return day; + } + } + return null; + } + + @Override + public String toString() { + return name; + } + +} diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/plan/PlanServiceImpl.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/plan/PlanServiceImpl.java index 3051282b5a..62a4e00d54 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/plan/PlanServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/plan/PlanServiceImpl.java @@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.mes.controller.admin.itemrequisition.vo.ItemRequi import cn.iocoder.yudao.module.mes.controller.admin.plan.vo.*; import cn.iocoder.yudao.module.mes.controller.admin.task.vo.TaskStatusEnum; import cn.iocoder.yudao.module.mes.dal.dataobject.itemrequisition.ItemRequisitionDetailDO; +import cn.iocoder.yudao.module.mes.dal.dataobject.organization.OrganizationDO; import cn.iocoder.yudao.module.mes.dal.dataobject.paigongrecord.PaigongRecordDO; import cn.iocoder.yudao.module.mes.dal.dataobject.plan.PlanDO; import cn.iocoder.yudao.module.mes.dal.dataobject.task.TaskDO; @@ -253,7 +254,8 @@ public class PlanServiceImpl implements PlanService { convertSet(list, PlanDO::getProductionManagerId)); Map taskMap = taskService.getMap( convertSet(list, PlanDO::getTaskId)); - + Map organizationMap = organizationService.getMap( + convertSet(list, PlanDO::getFeedingPipeline)); return BeanUtils.toBean(list, PlanRespVO.class, item -> { MapUtils.findAndThen(map, item.getProductId(), product -> item.setProductName(product.getName())); @@ -263,6 +265,9 @@ public class PlanServiceImpl implements PlanService { MapUtils.findAndThen(taskMap, item.getTaskId(), task -> item.setTaskCode(task.getCode())); + + MapUtils.findAndThen(organizationMap, item.getFeedingPipeline(), + organization -> item.setFeedingPipelineName(organization.getName())); }); } @Override