diff --git a/yudao-module-erp/yudao-module-erp-api/src/main/java/cn/iocoder/yudao/module/erp/enums/ErrorCodeConstants.java b/yudao-module-erp/yudao-module-erp-api/src/main/java/cn/iocoder/yudao/module/erp/enums/ErrorCodeConstants.java index f0b716957..211d3ec74 100644 --- a/yudao-module-erp/yudao-module-erp-api/src/main/java/cn/iocoder/yudao/module/erp/enums/ErrorCodeConstants.java +++ b/yudao-module-erp/yudao-module-erp-api/src/main/java/cn/iocoder/yudao/module/erp/enums/ErrorCodeConstants.java @@ -98,6 +98,9 @@ public interface ErrorCodeConstants { ErrorCode STOCK_IN_APPROVE_FAIL = new ErrorCode(1_030_401_003, "审核失败,只有未审核的入库单才能审核"); ErrorCode STOCK_IN_NO_EXISTS = new ErrorCode(1_030_401_004, "生成入库单失败,请重新提交"); ErrorCode STOCK_IN_UPDATE_FAIL_APPROVE = new ErrorCode(1_030_401_005, "其它入库单({})已审核,无法修改"); + ErrorCode STOCK_ALERADY_IN = new ErrorCode(1_030_401_005, "模具({})已经入库,无法继续操作入库"); + ErrorCode STOCK_ALERADY_OUT = new ErrorCode(1_030_401_005, "模具({})已经出库,无法继续操作出库"); + // ========== ERP 其它出库单 1-030-402-000 ========== ErrorCode STOCK_OUT_NOT_EXISTS = new ErrorCode(1_030_402_000, "其它出库单不存在"); diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/ErpProductController.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/ErpProductController.java index 8d7ef6c4e..4498bf635 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/ErpProductController.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/controller/admin/product/ErpProductController.java @@ -110,8 +110,8 @@ public class ErpProductController { } @GetMapping("/simple-list-all") @Operation(summary = "获得所有精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项") - public CommonResult> getAllSimpleList() { - List list = productService.getProductVOListByStatus(CommonStatusEnum.ENABLE.getStatus()); + public CommonResult> getAllSimpleList(@RequestParam(name = "categoryId", required = false) Integer categoryId) { + List list = productService.getProductVOListByStatus(CommonStatusEnum.ENABLE.getStatus(),categoryId); return success(convertList(list, product -> new ErpProductRespVO().setId(product.getId()) .setName(product.getName()).setBarCode(product.getBarCode()) .setCategoryId(product.getCategoryId()).setCategoryName(product.getCategoryName()) diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/stock/ErpStockOutDO.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/stock/ErpStockOutDO.java index c7ba013f9..8b99e1ba3 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/stock/ErpStockOutDO.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/dataobject/stock/ErpStockOutDO.java @@ -74,5 +74,4 @@ public class ErpStockOutDO extends BaseDO { * 附件 URL */ private String fileUrl; - } \ No newline at end of file diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/product/ErpProductMapper.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/product/ErpProductMapper.java index b3f319246..a8fbdc205 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/product/ErpProductMapper.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/dal/mysql/product/ErpProductMapper.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.erp.dal.mysql.product; +import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; @@ -66,10 +67,16 @@ public interface ErpProductMapper extends BaseMapperX { ErpProductDO::getCategoryId, categoryId); } /**查询不同类型的产品**/ - default List selectByCategorys(List categoryIds){ - return selectList(new QueryWrapper() - .eq("status", 0) - .in("category_id" ,categoryIds)); + default List selectByCategorys(List categoryIds) { + + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ErpProductDO::getStatus, 0); + + if (CollUtil.isNotEmpty(categoryIds)) { + wrapper.in(ErpProductDO::getCategoryId, categoryIds); + } + + return selectList(wrapper); } default List selectListByNameIn(Collection names) { diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductService.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductService.java index 66bc03d8f..0153a3fdf 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductService.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductService.java @@ -68,7 +68,7 @@ public interface ErpProductService { * @param status 状态 * @return 产品 VO 列表 */ - List getProductVOListByStatus(Integer status); + List getProductVOListByStatus(Integer status,Integer categoryId); List getProductVOListByCategory(Integer categoryId); List buildProductVOList(List list); /** diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductServiceImpl.java index cfbc400fe..2811d662c 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/product/ErpProductServiceImpl.java @@ -158,8 +158,8 @@ public class ErpProductServiceImpl implements ErpProductService { } @Override - public List getProductVOListByStatus(Integer status) { - List list = productMapper.selectListByStatus(status); + public List getProductVOListByStatus(Integer status,Integer categoryId) { + List list = productMapper.selectByCategorys(Collections.singletonList(categoryId)); return buildProductVOList(list); } @Override diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockInServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockInServiceImpl.java index 36fb28975..7000f86a7 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockInServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockInServiceImpl.java @@ -83,11 +83,11 @@ public class ErpStockInServiceImpl implements ErpStockInService { // 2.2 插入入库单项 stockInItems.forEach(o -> o.setInId(stockIn.getId())); stockInItemMapper.insertBatch(stockInItems); - for (ErpStockInItemDO item : stockInItems) { - MoldDO moldDO = moldService.getMold(item.getProductId()); - moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 - moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); - } +// for (ErpStockInItemDO item : stockInItems) { +// MoldDO moldDO = moldService.getMold(item.getProductId()); +// moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 +// moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); +// } return stockIn.getId(); } @@ -149,11 +149,18 @@ public class ErpStockInServiceImpl implements ErpStockInService { bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime())); } }); + // 更改状态 if (Objects.equals(stockIn.getInType(), "模具入库")) { for (ErpStockInItemDO item : stockInItems) { if (item.getProductId() != null) { MoldDO moldDO = moldService.getMold(item.getProductId()); + + // 已经在库 + if (Objects.equals(moldDO.getStatus(), 1)) { + throw exception(STOCK_ALERADY_IN,moldDO.getCode() + "-" + moldDO.getName()); + } + moldDO.setStatus(1); // 在库 moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); } diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockOutServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockOutServiceImpl.java index 4b5daa402..d440563c9 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockOutServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockOutServiceImpl.java @@ -89,11 +89,11 @@ public class ErpStockOutServiceImpl implements ErpStockOutService { // 2.2 插入出库单项 stockOutItems.forEach(o -> o.setOutId(stockOut.getId())); stockOutItemMapper.insertBatch(stockOutItems); - for (ErpStockOutItemDO item : stockOutItems) { - MoldDO moldDO = moldService.getMold(item.getProductId()); - moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 - moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); - } +// for (ErpStockOutItemDO item : stockOutItems) { +// MoldDO moldDO = moldService.getMold(item.getProductId()); +// moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 +// moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); +// } return stockOut.getId(); } @@ -106,7 +106,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService { throw exception(STOCK_OUT_UPDATE_FAIL_APPROVE, stockOut.getNo()); } // 1.2 校验客户 - customerService.validateCustomer(updateReqVO.getCustomerId()); +// customerService.validateCustomer(updateReqVO.getCustomerId()); // 1.3 校验出库项的有效性 List stockOutItems = validateStockOutItems(updateReqVO.getItems(),updateReqVO.getOutType()); @@ -162,6 +162,11 @@ public class ErpStockOutServiceImpl implements ErpStockOutService { for (ErpStockOutItemDO item : stockOutItems) { if (item.getProductId() != null) { MoldDO moldDO = moldService.getMold(item.getProductId()); + // 已经出库 + if (Objects.equals(moldDO.getStatus(), 3)) { + throw exception(STOCK_ALERADY_OUT,moldDO.getCode() + "-" + moldDO.getName()); + } + moldDO.setStatus(3); // 在途 moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); } diff --git a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockServiceImpl.java b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockServiceImpl.java index d3bc9d92b..f949feaab 100644 --- a/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockServiceImpl.java +++ b/yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/stock/ErpStockServiceImpl.java @@ -74,18 +74,18 @@ public class ErpStockServiceImpl implements ErpStockService { stockMapper.insert(stock); } // 1.2 校验库存是否充足 - if (!NEGATIVE_STOCK_COUNT_ENABLE && stock.getCount().add(count).compareTo(BigDecimal.ZERO) < 0) { - throw exception(STOCK_COUNT_NEGATIVE, productService.getProduct(productId).getName(), - warehouseService.getWarehouse(warehouseId).getName(), stock.getCount(), count); - } +// if (!NEGATIVE_STOCK_COUNT_ENABLE && stock.getCount().add(count).compareTo(BigDecimal.ZERO) < 0) { +// throw exception(STOCK_COUNT_NEGATIVE, productService.getProduct(productId).getName(), +// warehouseService.getWarehouse(warehouseId).getName(), stock.getCount(), count); +// } // 2. 库存变更 - int updateCount = stockMapper.updateCountIncrement(stock.getId(), count, NEGATIVE_STOCK_COUNT_ENABLE); - if (updateCount == 0) { - // 此时不好去查询最新库存,所以直接抛出该提示,不提供具体库存数字 - throw exception(STOCK_COUNT_NEGATIVE2, productService.getProduct(productId).getName(), - warehouseService.getWarehouse(warehouseId).getName()); - } +// int updateCount = stockMapper.updateCountIncrement(stock.getId(), count, NEGATIVE_STOCK_COUNT_ENABLE); +// if (updateCount == 0) { +// // 此时不好去查询最新库存,所以直接抛出该提示,不提供具体库存数字 +// throw exception(STOCK_COUNT_NEGATIVE2, productService.getProduct(productId).getName(), +// warehouseService.getWarehouse(warehouseId).getName()); +// } // 3. 返回最新库存 return stock.getCount().add(count); diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeRespVO.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeRespVO.java index d8bc8473a..22d0e86c7 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeRespVO.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeRespVO.java @@ -65,4 +65,6 @@ public class RecipeRespVO { @Schema(description = "关联产品ID", example = "1001") private Long productId; + @Schema(description = "关联产品分类ID", example = "1001") + private Long productCategoryId; } \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeSaveReqVO.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeSaveReqVO.java index 7132459a4..85d0318a1 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeSaveReqVO.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipe/vo/RecipeSaveReqVO.java @@ -46,4 +46,7 @@ public class RecipeSaveReqVO { @Schema(description = "关联产品ID", example = "1001") private Long productId; + @Schema(description = "关联产品分类ID", example = "1001") + private Long productCategoryId; + } \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipepoint/RecipePointController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipepoint/RecipePointController.java index 6ce8572be..5f20d6312 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipepoint/RecipePointController.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/recipepoint/RecipePointController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.iot.controller.admin.recipepoint; +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -24,6 +25,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import cn.iocoder.yudao.module.iot.controller.admin.recipepoint.vo.*; import cn.iocoder.yudao.module.iot.dal.dataobject.recipepoint.RecipePointDO; @@ -98,6 +100,7 @@ public class RecipePointController { @PreAuthorize("@ss.hasPermission('iot:recipe-point:query')") public CommonResult> getRecipePointList(@RequestParam("id") Long recipeId) { List list = recipePointService.getRecipePointPageList(recipeId); + return success(BeanUtils.toBean(list, RecipePointRespVO.class)); } diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/recipe/RecipeDO.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/recipe/RecipeDO.java index 342d8246e..82bbc2336 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/recipe/RecipeDO.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/recipe/RecipeDO.java @@ -69,12 +69,15 @@ public class RecipeDO extends BaseDO { * 关联产品ID */ private Long productId; - + /** * 关联配方类型ID */ private Long recipeTypeId; - + /** + * 关联产品分类ID + */ + private Long productCategoryId; } \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/devicewarinningrecord/DeviceWarinningRecordServiceImpl.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/devicewarinningrecord/DeviceWarinningRecordServiceImpl.java index b34ea7646..c44ddb764 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/devicewarinningrecord/DeviceWarinningRecordServiceImpl.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/devicewarinningrecord/DeviceWarinningRecordServiceImpl.java @@ -78,12 +78,12 @@ public class DeviceWarinningRecordServiceImpl implements DeviceWarinningRecordSe @Override public List getList(Long id) { - if (id == null) { - return Collections.emptyList(); - } +// if (id == null) { +// return Collections.emptyList(); +// } return deviceWarinningRecordMapper.selectList( Wrappers.lambdaQuery() - .eq(DeviceWarinningRecordDO::getDeviceId, id) + .eq(id != null, DeviceWarinningRecordDO::getDeviceId, id) .orderByDesc(DeviceWarinningRecordDO::getCreateTime) .last("LIMIT 100")// 限制 100 条 ); 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 c0d2b0d37..bd6df2bfa 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 @@ -35,6 +35,7 @@ import cn.iocoder.yudao.module.mes.service.moldticketmanagement.MoldTicketManage 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.ticketmanagement.TicketManagementService; +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; @@ -476,7 +477,7 @@ public class DashboardController { queryWrapper.select("brand_id as brandId", "COUNT(*) as count") .groupBy("brand_id") .orderByDesc("count") - .last("LIMIT 5"); + .last("LIMIT 10"); List> result = moldMapper.selectMaps(queryWrapper); List xAxis = new ArrayList<>(); List series = new ArrayList<>(); @@ -563,7 +564,8 @@ public class DashboardController { List taskVOList = new ArrayList<>(); // 设备保养 点检 - List ticketManagementDOList = ticketManagementService.getList(); + List ticketManagementDOList = ticketManagementService.getLatestList(); + for (TicketManagementDO ticketManagementDO : ticketManagementDOList) { TaskVO taskVO = new TaskVO(); taskVO.setCode(ticketManagementDO.getPlanNo()); @@ -579,7 +581,7 @@ public class DashboardController { } // 设备维修 - List dvRepairDOList = dvRepairService.getList(); + List dvRepairDOList = dvRepairService.getLatestList(); for (DvRepairDO dvRepairDO : dvRepairDOList) { TaskVO taskVO = new TaskVO(); taskVO.setCode(dvRepairDO.getRepairCode()); @@ -591,7 +593,7 @@ public class DashboardController { } // 模具保养 点检 - List moldTicketManagementDOList = moldTicketManagementService.getList(); + List moldTicketManagementDOList = moldTicketManagementService.getLatestList(); for (MoldTicketManagementDO moldTicketManagementDO : moldTicketManagementDOList) { TaskVO taskVO = new TaskVO(); taskVO.setCode(moldTicketManagementDO.getPlanNo()); @@ -607,7 +609,7 @@ public class DashboardController { } // 模具维修 - List moldRepairDOList = moldRepairService.getList(); + List moldRepairDOList = moldRepairService.getLatestList(); for (MoldRepairDO moldRepairDO : moldRepairDOList) { TaskVO taskVO = new TaskVO(); taskVO.setCode(moldRepairDO.getRepairCode()); diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/producereport/ViewReportUserDateSummary.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/producereport/ViewReportUserDateSummary.java index bdafd49bc..0c65cf8d5 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/producereport/ViewReportUserDateSummary.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/producereport/ViewReportUserDateSummary.java @@ -1,9 +1,6 @@ package cn.iocoder.yudao.module.mes.dal.dataobject.producereport; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.*; import java.math.BigDecimal; @@ -23,6 +20,7 @@ import java.math.BigDecimal; public class ViewReportUserDateSummary { @TableId(type = IdType.NONE) + @TableField(exist = false) private String id; /** diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/task/ViewTaskProductSummary.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/task/ViewTaskProductSummary.java index 4fbbc1adf..83f0f05d9 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/task/ViewTaskProductSummary.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/task/ViewTaskProductSummary.java @@ -1,9 +1,6 @@ package cn.iocoder.yudao.module.mes.dal.dataobject.task; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.*; /** @@ -20,7 +17,8 @@ import lombok.*; @AllArgsConstructor public class ViewTaskProductSummary { - @TableId(type = IdType.NONE) // 告诉 MyBatis-Plus 这个类没有主键 + @TableId(type = IdType.NONE) + @TableField(exist = false) private Long id; /** diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/workreportplan/ReportPlanSummaryDO.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/workreportplan/ReportPlanSummaryDO.java index 6bc42d5ea..954a15a57 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/workreportplan/ReportPlanSummaryDO.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/workreportplan/ReportPlanSummaryDO.java @@ -1,9 +1,6 @@ package cn.iocoder.yudao.module.mes.dal.dataobject.workreportplan; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.*; import java.math.BigDecimal; @@ -23,6 +20,7 @@ import java.math.BigDecimal; public class ReportPlanSummaryDO { @TableId(type = IdType.NONE) + @TableField(exist = false) private String id; /** diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairService.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairService.java index 7e58b8a09..2b09e42b4 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairService.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairService.java @@ -80,4 +80,6 @@ public interface DvRepairService { void selectCountDeviceRepair(EventStatisticsVO eventStatisticsVO); List getList(); + + List getLatestList(); } \ No newline at end of file diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairServiceImpl.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairServiceImpl.java index 1f855915f..0bcdb9512 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/dvrepair/DvRepairServiceImpl.java @@ -299,6 +299,15 @@ public class DvRepairServiceImpl implements DvRepairService { return dvRepairMapper.selectList(); } + @Override + public List getLatestList() { + return dvRepairMapper.selectList( + new LambdaQueryWrapper() + .orderByDesc(DvRepairDO::getCreateTime) + .last("LIMIT 100") + ); + } + private LocalDateTime parseToLocalDateTime(String timeStr) { if (StringUtils.isBlank(timeStr)) { diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairService.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairService.java index b0f90f4e8..5258bae31 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairService.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairService.java @@ -83,5 +83,7 @@ public interface MoldRepairService { void selectCountMoldRepair(EventStatisticsVO eventStatisticsVO); List getList(); + + List getLatestList(); } diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairServiceImpl.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairServiceImpl.java index 3a21b1ab6..6f9cec155 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldrepair/MoldRepairServiceImpl.java @@ -446,4 +446,13 @@ public class MoldRepairServiceImpl implements MoldRepairService { public List getList() { return moldRepairMapper.selectList(); } + + @Override + public List getLatestList() { + return moldRepairMapper.selectList( + new LambdaQueryWrapper() + .orderByDesc(MoldRepairDO::getCreateTime) + .last("LIMIT 100") + ); + } } \ No newline at end of file diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementService.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementService.java index 80a5e754b..3bafecfd0 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementService.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementService.java @@ -73,4 +73,6 @@ public interface MoldTicketManagementService { void selectCountMoldMaintenance(EventStatisticsVO eventStatisticsVO); List getList(); + + List getLatestList(); } \ No newline at end of file diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementServiceImpl.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementServiceImpl.java index 7411bbdae..e076d5749 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/moldticketmanagement/MoldTicketManagementServiceImpl.java @@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.common.dal.dataobject.moldticketresults.MoldTicke import cn.iocoder.yudao.module.common.dal.mysql.moldticketresults.MoldTicketResultsMapper; import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper; import com.alibaba.excel.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.context.annotation.Lazy; @@ -190,4 +191,13 @@ public class MoldTicketManagementServiceImpl implements MoldTicketManagementServ return moldTicketManagementMapper.selectList(); } + @Override + public List getLatestList() { + return moldTicketManagementMapper.selectList( + new LambdaQueryWrapper() + .orderByDesc(MoldTicketManagementDO::getCreateTime) + .last("LIMIT 100") + ); + } + } \ No newline at end of file diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementService.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementService.java index 73beb11a1..51ec72cb9 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementService.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementService.java @@ -74,4 +74,6 @@ public interface TicketManagementService { void selectCountDeviceMaintenance(EventStatisticsVO eventStatisticsVO); List getList(); + + List getLatestList(); } \ No newline at end of file diff --git a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementServiceImpl.java b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementServiceImpl.java index 3c8291eca..eb8bc2180 100644 --- a/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementServiceImpl.java +++ b/yudao-module-mes/yudao-module-mes-biz/src/main/java/cn/iocoder/yudao/module/mes/service/ticketmanagement/TicketManagementServiceImpl.java @@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.ticketresults.TicketResultsDO; import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper; import cn.iocoder.yudao.module.mes.dal.mysql.ticketresults.TicketResultsMapper; import com.alibaba.excel.util.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.context.annotation.Lazy; @@ -177,6 +178,15 @@ public class TicketManagementServiceImpl implements TicketManagementService { return ticketManagementMapper.selectList(); } + @Override + public List getLatestList() { + return ticketManagementMapper.selectList( + new LambdaQueryWrapper() + .orderByDesc(TicketManagementDO::getCreateTime) + .last("LIMIT 100") + ); + } + /** * 解析逗号分隔的ID字符串