diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java index 28a7e0dd..106a4fb7 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/supplier/controller/admin/BaseSupplierController.java @@ -1,15 +1,13 @@ package cn.iocoder.yudao.module.supplier.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.module.label.vo.LabelPageReqVO; -import cn.iocoder.yudao.module.label.vo.LabelRespVO; import cn.iocoder.yudao.module.supplier.entity.BaseSupplier; import cn.iocoder.yudao.module.supplier.service.BaseSupplierService; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierPageReqVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierRespVO; import cn.iocoder.yudao.module.supplier.vo.BaseSupplierSaveReqVO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.v3.oas.annotations.Operation; @@ -123,8 +121,20 @@ public class BaseSupplierController { **/ @GetMapping("/list") @Operation(summary = "获得所有供应商") -// @PreAuthorize("@ss.hasPermission('supplier:base-supplier:query')") public CommonResult getBaseSupplierList(){ return success(baseSupplierService.list()); } + + /** + * 根据输入名称模糊查询供应商 + * @author 小李 + * @date 9:23 2024/9/13 + **/ + @GetMapping("/searchList") + @Operation(summary = "根据输入名称模糊查询供应商") + public CommonResult searchList(String name){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .like(BaseSupplier::getName,name); + return success(baseSupplierService.list(queryWrapper)); + } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java index 58848131..c1c3a3b7 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/common/RepairCons.java @@ -16,4 +16,6 @@ public class RepairCons { public static final String DICT_REPAIR_RECORDS_TYPE = "repair_records_type"; /**数据字典常量-repair_type-*/ public static final String DICT_REPAIR_TYPE = "repair_type"; + /**数据字典常量-repair_unit-*/ + public static final String DICT_REPAIR_UNIT = "repair_unit"; } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java index 8975a29f..d4cc0054 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTwItemServiceImpl.java @@ -4,9 +4,10 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.service.RepairWaresService; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import cn.iocoder.yudao.module.tickets.entity.DlTwItem; import cn.iocoder.yudao.module.tickets.mapper.DlTwItemMapper; -import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService; import cn.iocoder.yudao.module.tickets.service.DlTwItemService; import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO; import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO; @@ -20,6 +21,8 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import static cn.iocoder.yudao.common.RepairCons.DICT_REPAIR_UNIT; + /** * 针对表【dl_tw_item(工单配件申请/退回子表)】的数据库操作Service实现 * @@ -32,10 +35,8 @@ public class DlTwItemServiceImpl extends ServiceImpl @Resource private RepairWaresService repairWaresService; - @Resource - @Lazy - private DlTicketWaresService ticketWaresService; + private DictDataApi dictDataApi; @Resource @Lazy private RepairWaresService waresService; @@ -57,6 +58,9 @@ public class DlTwItemServiceImpl extends ServiceImpl for(Map map:typeMapList){ typeMap.put(map.get("id"),map.get("name")); } + // 单位字典 + List recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT); + Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); // 查配件详情 List ids = dlTwItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(ids)){ @@ -68,6 +72,7 @@ public class DlTwItemServiceImpl extends ServiceImpl .findFirst() .ifPresent(bean::setWares); bean.setTypeName(typeMap.get(bean.getWares().getType())); + bean.getWares().setUnit(unitMap.get(bean.getWares().getUnit())); return bean; }).collect(Collectors.toList()); }