fix:修复已知bug

hhk
HuangHuiKang 3 weeks ago
parent a516af0632
commit 8a4d5e68a4

@ -98,6 +98,9 @@ public interface ErrorCodeConstants {
ErrorCode STOCK_IN_APPROVE_FAIL = new ErrorCode(1_030_401_003, "审核失败,只有未审核的入库单才能审核"); 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_NO_EXISTS = new ErrorCode(1_030_401_004, "生成入库单失败,请重新提交");
ErrorCode STOCK_IN_UPDATE_FAIL_APPROVE = new ErrorCode(1_030_401_005, "其它入库单({})已审核,无法修改"); 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 ========== // ========== ERP 其它出库单 1-030-402-000 ==========
ErrorCode STOCK_OUT_NOT_EXISTS = new ErrorCode(1_030_402_000, "其它出库单不存在"); ErrorCode STOCK_OUT_NOT_EXISTS = new ErrorCode(1_030_402_000, "其它出库单不存在");

@ -110,8 +110,8 @@ public class ErpProductController {
} }
@GetMapping("/simple-list-all") @GetMapping("/simple-list-all")
@Operation(summary = "获得所有精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项") @Operation(summary = "获得所有精简列表", description = "只包含被开启的产品,主要用于前端的下拉选项")
public CommonResult<List<ErpProductRespVO>> getAllSimpleList() { public CommonResult<List<ErpProductRespVO>> getAllSimpleList(@RequestParam(name = "categoryId", required = false) Integer categoryId) {
List<ErpProductRespVO> list = productService.getProductVOListByStatus(CommonStatusEnum.ENABLE.getStatus()); List<ErpProductRespVO> list = productService.getProductVOListByStatus(CommonStatusEnum.ENABLE.getStatus(),categoryId);
return success(convertList(list, product -> new ErpProductRespVO().setId(product.getId()) return success(convertList(list, product -> new ErpProductRespVO().setId(product.getId())
.setName(product.getName()).setBarCode(product.getBarCode()) .setName(product.getName()).setBarCode(product.getBarCode())
.setCategoryId(product.getCategoryId()).setCategoryName(product.getCategoryName()) .setCategoryId(product.getCategoryId()).setCategoryName(product.getCategoryName())

@ -74,5 +74,4 @@ public class ErpStockOutDO extends BaseDO {
* URL * URL
*/ */
private String fileUrl; private String fileUrl;
} }

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.erp.dal.mysql.product; 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.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
@ -67,9 +68,15 @@ public interface ErpProductMapper extends BaseMapperX<ErpProductDO> {
} }
/**查询不同类型的产品**/ /**查询不同类型的产品**/
default List<ErpProductDO> selectByCategorys(List<Integer> categoryIds) { default List<ErpProductDO> selectByCategorys(List<Integer> categoryIds) {
return selectList(new QueryWrapper<ErpProductDO>()
.eq("status", 0) LambdaQueryWrapper<ErpProductDO> wrapper = new LambdaQueryWrapper<>();
.in("category_id" ,categoryIds)); wrapper.eq(ErpProductDO::getStatus, 0);
if (CollUtil.isNotEmpty(categoryIds)) {
wrapper.in(ErpProductDO::getCategoryId, categoryIds);
}
return selectList(wrapper);
} }
default List<ErpProductDO> selectListByNameIn(Collection<String> names) { default List<ErpProductDO> selectListByNameIn(Collection<String> names) {

@ -68,7 +68,7 @@ public interface ErpProductService {
* @param status * @param status
* @return VO * @return VO
*/ */
List<ErpProductRespVO> getProductVOListByStatus(Integer status); List<ErpProductRespVO> getProductVOListByStatus(Integer status,Integer categoryId);
List<ErpProductRespVO> getProductVOListByCategory(Integer categoryId); List<ErpProductRespVO> getProductVOListByCategory(Integer categoryId);
List<ErpProductRespVO> buildProductVOList(List<ErpProductDO> list); List<ErpProductRespVO> buildProductVOList(List<ErpProductDO> list);
/** /**

@ -158,8 +158,8 @@ public class ErpProductServiceImpl implements ErpProductService {
} }
@Override @Override
public List<ErpProductRespVO> getProductVOListByStatus(Integer status) { public List<ErpProductRespVO> getProductVOListByStatus(Integer status,Integer categoryId) {
List<ErpProductDO> list = productMapper.selectListByStatus(status); List<ErpProductDO> list = productMapper.selectByCategorys(Collections.singletonList(categoryId));
return buildProductVOList(list); return buildProductVOList(list);
} }
@Override @Override

@ -83,11 +83,11 @@ public class ErpStockInServiceImpl implements ErpStockInService {
// 2.2 插入入库单项 // 2.2 插入入库单项
stockInItems.forEach(o -> o.setInId(stockIn.getId())); stockInItems.forEach(o -> o.setInId(stockIn.getId()));
stockInItemMapper.insertBatch(stockInItems); stockInItemMapper.insertBatch(stockInItems);
for (ErpStockInItemDO item : stockInItems) { // for (ErpStockInItemDO item : stockInItems) {
MoldDO moldDO = moldService.getMold(item.getProductId()); // MoldDO moldDO = moldService.getMold(item.getProductId());
moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 // moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); // moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
} // }
return stockIn.getId(); return stockIn.getId();
} }
@ -149,11 +149,18 @@ public class ErpStockInServiceImpl implements ErpStockInService {
bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime())); bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime()));
} }
}); });
// 更改状态 // 更改状态
if (Objects.equals(stockIn.getInType(), "模具入库")) { if (Objects.equals(stockIn.getInType(), "模具入库")) {
for (ErpStockInItemDO item : stockInItems) { for (ErpStockInItemDO item : stockInItems) {
if (item.getProductId() != null) { if (item.getProductId() != null) {
MoldDO moldDO = moldService.getMold(item.getProductId()); MoldDO moldDO = moldService.getMold(item.getProductId());
// 已经在库
if (Objects.equals(moldDO.getStatus(), 1)) {
throw exception(STOCK_ALERADY_IN,moldDO.getCode() + "-" + moldDO.getName());
}
moldDO.setStatus(1); // 在库 moldDO.setStatus(1); // 在库
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
} }

@ -89,11 +89,11 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
// 2.2 插入出库单项 // 2.2 插入出库单项
stockOutItems.forEach(o -> o.setOutId(stockOut.getId())); stockOutItems.forEach(o -> o.setOutId(stockOut.getId()));
stockOutItemMapper.insertBatch(stockOutItems); stockOutItemMapper.insertBatch(stockOutItems);
for (ErpStockOutItemDO item : stockOutItems) { // for (ErpStockOutItemDO item : stockOutItems) {
MoldDO moldDO = moldService.getMold(item.getProductId()); // MoldDO moldDO = moldService.getMold(item.getProductId());
moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核 // moldDO.setStatus(ErpAuditStatus.PROCESS.getStatus()); // 未审核
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); // moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
} // }
return stockOut.getId(); return stockOut.getId();
} }
@ -106,7 +106,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
throw exception(STOCK_OUT_UPDATE_FAIL_APPROVE, stockOut.getNo()); throw exception(STOCK_OUT_UPDATE_FAIL_APPROVE, stockOut.getNo());
} }
// 1.2 校验客户 // 1.2 校验客户
customerService.validateCustomer(updateReqVO.getCustomerId()); // customerService.validateCustomer(updateReqVO.getCustomerId());
// 1.3 校验出库项的有效性 // 1.3 校验出库项的有效性
List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(updateReqVO.getItems(),updateReqVO.getOutType()); List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(updateReqVO.getItems(),updateReqVO.getOutType());
@ -162,6 +162,11 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
for (ErpStockOutItemDO item : stockOutItems) { for (ErpStockOutItemDO item : stockOutItems) {
if (item.getProductId() != null) { if (item.getProductId() != null) {
MoldDO moldDO = moldService.getMold(item.getProductId()); MoldDO moldDO = moldService.getMold(item.getProductId());
// 已经出库
if (Objects.equals(moldDO.getStatus(), 3)) {
throw exception(STOCK_ALERADY_OUT,moldDO.getCode() + "-" + moldDO.getName());
}
moldDO.setStatus(3); // 在途 moldDO.setStatus(3); // 在途
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class)); moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
} }

@ -74,18 +74,18 @@ public class ErpStockServiceImpl implements ErpStockService {
stockMapper.insert(stock); stockMapper.insert(stock);
} }
// 1.2 校验库存是否充足 // 1.2 校验库存是否充足
if (!NEGATIVE_STOCK_COUNT_ENABLE && stock.getCount().add(count).compareTo(BigDecimal.ZERO) < 0) { // if (!NEGATIVE_STOCK_COUNT_ENABLE && stock.getCount().add(count).compareTo(BigDecimal.ZERO) < 0) {
throw exception(STOCK_COUNT_NEGATIVE, productService.getProduct(productId).getName(), // throw exception(STOCK_COUNT_NEGATIVE, productService.getProduct(productId).getName(),
warehouseService.getWarehouse(warehouseId).getName(), stock.getCount(), count); // warehouseService.getWarehouse(warehouseId).getName(), stock.getCount(), count);
} // }
// 2. 库存变更 // 2. 库存变更
int updateCount = stockMapper.updateCountIncrement(stock.getId(), count, NEGATIVE_STOCK_COUNT_ENABLE); // int updateCount = stockMapper.updateCountIncrement(stock.getId(), count, NEGATIVE_STOCK_COUNT_ENABLE);
if (updateCount == 0) { // if (updateCount == 0) {
// 此时不好去查询最新库存,所以直接抛出该提示,不提供具体库存数字 // // 此时不好去查询最新库存,所以直接抛出该提示,不提供具体库存数字
throw exception(STOCK_COUNT_NEGATIVE2, productService.getProduct(productId).getName(), // throw exception(STOCK_COUNT_NEGATIVE2, productService.getProduct(productId).getName(),
warehouseService.getWarehouse(warehouseId).getName()); // warehouseService.getWarehouse(warehouseId).getName());
} // }
// 3. 返回最新库存 // 3. 返回最新库存
return stock.getCount().add(count); return stock.getCount().add(count);

@ -65,4 +65,6 @@ public class RecipeRespVO {
@Schema(description = "关联产品ID", example = "1001") @Schema(description = "关联产品ID", example = "1001")
private Long productId; private Long productId;
@Schema(description = "关联产品分类ID", example = "1001")
private Long productCategoryId;
} }

@ -46,4 +46,7 @@ public class RecipeSaveReqVO {
@Schema(description = "关联产品ID", example = "1001") @Schema(description = "关联产品ID", example = "1001")
private Long productId; private Long productId;
@Schema(description = "关联产品分类ID", example = "1001")
private Long productCategoryId;
} }

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.iot.controller.admin.recipepoint; 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 org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; 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 cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; 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.controller.admin.recipepoint.vo.*;
import cn.iocoder.yudao.module.iot.dal.dataobject.recipepoint.RecipePointDO; import cn.iocoder.yudao.module.iot.dal.dataobject.recipepoint.RecipePointDO;
@ -98,6 +100,7 @@ public class RecipePointController {
@PreAuthorize("@ss.hasPermission('iot:recipe-point:query')") @PreAuthorize("@ss.hasPermission('iot:recipe-point:query')")
public CommonResult<List<RecipePointRespVO>> getRecipePointList(@RequestParam("id") Long recipeId) { public CommonResult<List<RecipePointRespVO>> getRecipePointList(@RequestParam("id") Long recipeId) {
List<RecipePointDO> list = recipePointService.getRecipePointPageList(recipeId); List<RecipePointDO> list = recipePointService.getRecipePointPageList(recipeId);
return success(BeanUtils.toBean(list, RecipePointRespVO.class)); return success(BeanUtils.toBean(list, RecipePointRespVO.class));
} }

@ -75,6 +75,9 @@ public class RecipeDO extends BaseDO {
*/ */
private Long recipeTypeId; private Long recipeTypeId;
/**
* ID
*/
private Long productCategoryId;
} }

@ -78,12 +78,12 @@ public class DeviceWarinningRecordServiceImpl implements DeviceWarinningRecordSe
@Override @Override
public List<DeviceWarinningRecordDO> getList(Long id) { public List<DeviceWarinningRecordDO> getList(Long id) {
if (id == null) { // if (id == null) {
return Collections.emptyList(); // return Collections.emptyList();
} // }
return deviceWarinningRecordMapper.selectList( return deviceWarinningRecordMapper.selectList(
Wrappers.<DeviceWarinningRecordDO>lambdaQuery() Wrappers.<DeviceWarinningRecordDO>lambdaQuery()
.eq(DeviceWarinningRecordDO::getDeviceId, id) .eq(id != null, DeviceWarinningRecordDO::getDeviceId, id)
.orderByDesc(DeviceWarinningRecordDO::getCreateTime) .orderByDesc(DeviceWarinningRecordDO::getCreateTime)
.last("LIMIT 100")// 限制 100 条 .last("LIMIT 100")// 限制 100 条
); );

@ -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.organization.OrganizationService;
import cn.iocoder.yudao.module.mes.service.plan.PlanService; import cn.iocoder.yudao.module.mes.service.plan.PlanService;
import cn.iocoder.yudao.module.mes.service.ticketmanagement.TicketManagementService; 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 com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -476,7 +477,7 @@ public class DashboardController {
queryWrapper.select("brand_id as brandId", "COUNT(*) as count") queryWrapper.select("brand_id as brandId", "COUNT(*) as count")
.groupBy("brand_id") .groupBy("brand_id")
.orderByDesc("count") .orderByDesc("count")
.last("LIMIT 5"); .last("LIMIT 10");
List<Map<String, Object>> result = moldMapper.selectMaps(queryWrapper); List<Map<String, Object>> result = moldMapper.selectMaps(queryWrapper);
List<String> xAxis = new ArrayList<>(); List<String> xAxis = new ArrayList<>();
List<Integer> series = new ArrayList<>(); List<Integer> series = new ArrayList<>();
@ -563,7 +564,8 @@ public class DashboardController {
List<TaskVO> taskVOList = new ArrayList<>(); List<TaskVO> taskVOList = new ArrayList<>();
// 设备保养 点检 // 设备保养 点检
List<TicketManagementDO> ticketManagementDOList = ticketManagementService.getList(); List<TicketManagementDO> ticketManagementDOList = ticketManagementService.getLatestList();
for (TicketManagementDO ticketManagementDO : ticketManagementDOList) { for (TicketManagementDO ticketManagementDO : ticketManagementDOList) {
TaskVO taskVO = new TaskVO(); TaskVO taskVO = new TaskVO();
taskVO.setCode(ticketManagementDO.getPlanNo()); taskVO.setCode(ticketManagementDO.getPlanNo());
@ -579,7 +581,7 @@ public class DashboardController {
} }
// 设备维修 // 设备维修
List<DvRepairDO> dvRepairDOList = dvRepairService.getList(); List<DvRepairDO> dvRepairDOList = dvRepairService.getLatestList();
for (DvRepairDO dvRepairDO : dvRepairDOList) { for (DvRepairDO dvRepairDO : dvRepairDOList) {
TaskVO taskVO = new TaskVO(); TaskVO taskVO = new TaskVO();
taskVO.setCode(dvRepairDO.getRepairCode()); taskVO.setCode(dvRepairDO.getRepairCode());
@ -591,7 +593,7 @@ public class DashboardController {
} }
// 模具保养 点检 // 模具保养 点检
List<MoldTicketManagementDO> moldTicketManagementDOList = moldTicketManagementService.getList(); List<MoldTicketManagementDO> moldTicketManagementDOList = moldTicketManagementService.getLatestList();
for (MoldTicketManagementDO moldTicketManagementDO : moldTicketManagementDOList) { for (MoldTicketManagementDO moldTicketManagementDO : moldTicketManagementDOList) {
TaskVO taskVO = new TaskVO(); TaskVO taskVO = new TaskVO();
taskVO.setCode(moldTicketManagementDO.getPlanNo()); taskVO.setCode(moldTicketManagementDO.getPlanNo());
@ -607,7 +609,7 @@ public class DashboardController {
} }
// 模具维修 // 模具维修
List<MoldRepairDO> moldRepairDOList = moldRepairService.getList(); List<MoldRepairDO> moldRepairDOList = moldRepairService.getLatestList();
for (MoldRepairDO moldRepairDO : moldRepairDOList) { for (MoldRepairDO moldRepairDO : moldRepairDOList) {
TaskVO taskVO = new TaskVO(); TaskVO taskVO = new TaskVO();
taskVO.setCode(moldRepairDO.getRepairCode()); taskVO.setCode(moldRepairDO.getRepairCode());

@ -1,9 +1,6 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.producereport; package cn.iocoder.yudao.module.mes.dal.dataobject.producereport;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -23,6 +20,7 @@ import java.math.BigDecimal;
public class ViewReportUserDateSummary { public class ViewReportUserDateSummary {
@TableId(type = IdType.NONE) @TableId(type = IdType.NONE)
@TableField(exist = false)
private String id; private String id;
/** /**

@ -1,9 +1,6 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.task; package cn.iocoder.yudao.module.mes.dal.dataobject.task;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
/** /**
@ -20,7 +17,8 @@ import lombok.*;
@AllArgsConstructor @AllArgsConstructor
public class ViewTaskProductSummary { public class ViewTaskProductSummary {
@TableId(type = IdType.NONE) // 告诉 MyBatis-Plus 这个类没有主键 @TableId(type = IdType.NONE)
@TableField(exist = false)
private Long id; private Long id;
/** /**

@ -1,9 +1,6 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.workreportplan; package cn.iocoder.yudao.module.mes.dal.dataobject.workreportplan;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -23,6 +20,7 @@ import java.math.BigDecimal;
public class ReportPlanSummaryDO { public class ReportPlanSummaryDO {
@TableId(type = IdType.NONE) @TableId(type = IdType.NONE)
@TableField(exist = false)
private String id; private String id;
/** /**

@ -80,4 +80,6 @@ public interface DvRepairService {
void selectCountDeviceRepair(EventStatisticsVO eventStatisticsVO); void selectCountDeviceRepair(EventStatisticsVO eventStatisticsVO);
List<DvRepairDO> getList(); List<DvRepairDO> getList();
List<DvRepairDO> getLatestList();
} }

@ -299,6 +299,15 @@ public class DvRepairServiceImpl implements DvRepairService {
return dvRepairMapper.selectList(); return dvRepairMapper.selectList();
} }
@Override
public List<DvRepairDO> getLatestList() {
return dvRepairMapper.selectList(
new LambdaQueryWrapper<DvRepairDO>()
.orderByDesc(DvRepairDO::getCreateTime)
.last("LIMIT 100")
);
}
private LocalDateTime parseToLocalDateTime(String timeStr) { private LocalDateTime parseToLocalDateTime(String timeStr) {
if (StringUtils.isBlank(timeStr)) { if (StringUtils.isBlank(timeStr)) {

@ -83,5 +83,7 @@ public interface MoldRepairService {
void selectCountMoldRepair(EventStatisticsVO eventStatisticsVO); void selectCountMoldRepair(EventStatisticsVO eventStatisticsVO);
List<MoldRepairDO> getList(); List<MoldRepairDO> getList();
List<MoldRepairDO> getLatestList();
} }

@ -446,4 +446,13 @@ public class MoldRepairServiceImpl implements MoldRepairService {
public List<MoldRepairDO> getList() { public List<MoldRepairDO> getList() {
return moldRepairMapper.selectList(); return moldRepairMapper.selectList();
} }
@Override
public List<MoldRepairDO> getLatestList() {
return moldRepairMapper.selectList(
new LambdaQueryWrapper<MoldRepairDO>()
.orderByDesc(MoldRepairDO::getCreateTime)
.last("LIMIT 100")
);
}
} }

@ -73,4 +73,6 @@ public interface MoldTicketManagementService {
void selectCountMoldMaintenance(EventStatisticsVO eventStatisticsVO); void selectCountMoldMaintenance(EventStatisticsVO eventStatisticsVO);
List<MoldTicketManagementDO> getList(); List<MoldTicketManagementDO> getList();
List<MoldTicketManagementDO> getLatestList();
} }

@ -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.common.dal.mysql.moldticketresults.MoldTicketResultsMapper;
import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper; import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper;
import com.alibaba.excel.util.StringUtils; 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.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@ -190,4 +191,13 @@ public class MoldTicketManagementServiceImpl implements MoldTicketManagementServ
return moldTicketManagementMapper.selectList(); return moldTicketManagementMapper.selectList();
} }
@Override
public List<MoldTicketManagementDO> getLatestList() {
return moldTicketManagementMapper.selectList(
new LambdaQueryWrapper<MoldTicketManagementDO>()
.orderByDesc(MoldTicketManagementDO::getCreateTime)
.last("LIMIT 100")
);
}
} }

@ -74,4 +74,6 @@ public interface TicketManagementService {
void selectCountDeviceMaintenance(EventStatisticsVO eventStatisticsVO); void selectCountDeviceMaintenance(EventStatisticsVO eventStatisticsVO);
List<TicketManagementDO> getList(); List<TicketManagementDO> getList();
List<TicketManagementDO> getLatestList();
} }

@ -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.deviceledger.DeviceLedgerMapper;
import cn.iocoder.yudao.module.mes.dal.mysql.ticketresults.TicketResultsMapper; import cn.iocoder.yudao.module.mes.dal.mysql.ticketresults.TicketResultsMapper;
import com.alibaba.excel.util.StringUtils; 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.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
@ -177,6 +178,15 @@ public class TicketManagementServiceImpl implements TicketManagementService {
return ticketManagementMapper.selectList(); return ticketManagementMapper.selectList();
} }
@Override
public List<TicketManagementDO> getLatestList() {
return ticketManagementMapper.selectList(
new LambdaQueryWrapper<TicketManagementDO>()
.orderByDesc(TicketManagementDO::getCreateTime)
.last("LIMIT 100")
);
}
/** /**
* ID * ID

Loading…
Cancel
Save