From c3e1f5baee5dff3298c87dd6758f16eb900c028c Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 18 Sep 2024 08:46:15 +0800 Subject: [PATCH 1/2] 1 --- .../yudao/module/project/service/RepairWaresService.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java index 4afe8b60..0c5b2d6d 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java @@ -18,10 +18,11 @@ public interface RepairWaresService extends IService { /** * 创建配件库 - * - * @param createReqVO 创建信息 - * @return 编号 - */ + * @author PQZ + * @date 18:24 2024/9/14 + * @param createReqVO TODO + * @return java.lang.String + **/ String createWares(RepairWaresSaveReqVO createReqVO); /** From 14c2aeb98033e092639e9cfaf7bf4611b421dcda Mon Sep 17 00:00:00 2001 From: PQZ Date: Wed, 18 Sep 2024 14:12:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=85=8D=E4=BB=B6=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/RepairWaresController.java | 12 ++-- .../module/project/entity/RepairWares.java | 4 ++ .../project/service/RepairWaresService.java | 52 ++++++++-------- .../service/impl/RepairWaresServiceImpl.java | 62 ++++++++++++++----- .../project/vo/RepairWaresPageReqVO.java | 15 ++--- .../module/project/vo/RepairWaresRespVO.java | 23 ++++--- .../project/vo/RepairWaresSaveReqVO.java | 10 ++- .../mapper/project/RepairWaresMapper.xml | 21 ++++++- 8 files changed, 123 insertions(+), 76 deletions(-) diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java index b8e296fa..344ca666 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/controller/admin/RepairWaresController.java @@ -1,8 +1,6 @@ package cn.iocoder.yudao.module.project.controller.admin; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.util.object.BeanUtils; -import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.service.RepairWaresService; import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO; @@ -41,8 +39,9 @@ public class RepairWaresController { @PostMapping("/create") @Operation(summary = "创建配件库") @PreAuthorize("@ss.hasPermission('repair:wares:create')") - public CommonResult createWares(@Valid @RequestBody RepairWaresSaveReqVO createReqVO) { - return success(waresService.createWares(createReqVO)); + public CommonResult createWares(@Valid @RequestBody RepairWaresSaveReqVO createReqVO) { + waresService.saveWares(createReqVO); + return success(true); } /** @@ -57,7 +56,7 @@ public class RepairWaresController { @Operation(summary = "更新配件库") @PreAuthorize("@ss.hasPermission('repair:wares:update')") public CommonResult updateWares(@Valid @RequestBody RepairWaresSaveReqVO updateReqVO) { - waresService.updateWares(updateReqVO); + waresService.saveWares(updateReqVO); return success(true); } @@ -91,8 +90,7 @@ public class RepairWaresController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('repair:wares:query')") public CommonResult getWares(@RequestParam("id") String id) { - RepairWares wares = waresService.getWares(id); - return success(BeanUtils.toBean(wares, RepairWaresRespVO.class)); + return success(waresService.getWares(id)); } /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairWares.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairWares.java index d81b5cce..ea7586f1 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairWares.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/entity/RepairWares.java @@ -98,5 +98,9 @@ public class RepairWares extends TenantBaseDO { * 备注 */ private String remark; + /**状态*/ + private String status; + /**数据来源*/ + private String dataForm; } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java index 0c5b2d6d..db3ca00b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/RepairWaresService.java @@ -1,6 +1,5 @@ package cn.iocoder.yudao.module.project.service; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.project.entity.RepairWares; import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO; @@ -16,43 +15,42 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface RepairWaresService extends IService { + /** - * 创建配件库 + * 保存配件库 + * + * @param saveReqVO RepairWaresSaveReqVO实体 * @author PQZ - * @date 18:24 2024/9/14 - * @param createReqVO TODO - * @return java.lang.String - **/ - String createWares(RepairWaresSaveReqVO createReqVO); + * @date 9:33 2024/9/18 + **/ + void saveWares(RepairWaresSaveReqVO saveReqVO); /** - * 更新配件库 - * - * @param updateReqVO 更新信息 - */ - void updateWares(RepairWaresSaveReqVO updateReqVO); - - /** - * 删除配件库 - * - * @param id 编号 - */ + * @param id 配件id + * @author PQZ + * @date 9:37 2024/9/18 + **/ void deleteWares(String id); /** - * 获得配件库 + * 根据id获取配件信息 * - * @param id 编号 - * @return 配件库 - */ - RepairWares getWares(String id); + * @param id id + * @return cn.iocoder.yudao.module.project.vo.RepairWaresRespVO + * @author PQZ + * @date 10:52 2024/9/18 + **/ + RepairWaresRespVO getWares(String id); /** - * 获得配件库分页 + * 分页获取配件库 * - * @param pageReqVO 分页查询 - * @return 配件库分页 - */ + * @param pageReqVO RepairWaresPageReqVO实体 + * @param page 分页信息 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 10:53 2024/9/18 + **/ IPage getWaresPage(RepairWaresPageReqVO pageReqVO, Page page); } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairWaresServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairWaresServiceImpl.java index 389b9272..ac61ae3f 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairWaresServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/service/impl/RepairWaresServiceImpl.java @@ -10,10 +10,12 @@ import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.Arrays; /** * 配件库 Service 实现类 @@ -27,37 +29,63 @@ public class RepairWaresServiceImpl extends ServiceImpl + * @author PQZ + * @date 10:53 2024/9/18 + **/ @Override public IPage getWaresPage(RepairWaresPageReqVO pageReqVO, Page page) { - return waresMapper.queryListPage(pageReqVO,page); + return waresMapper.queryListPage(pageReqVO, page); } } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresPageReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresPageReqVO.java index ce720e2e..92b30587 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresPageReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresPageReqVO.java @@ -1,20 +1,15 @@ package cn.iocoder.yudao.module.project.vo; -import cn.iocoder.yudao.module.project.entity.RepairProject; -import lombok.*; -import java.util.*; +import cn.iocoder.yudao.module.project.entity.RepairWares; import io.swagger.v3.oas.annotations.media.Schema; -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import java.math.BigDecimal; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; @Schema(description = "管理后台 - 配件库分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class RepairWaresPageReqVO extends RepairProject { +public class RepairWaresPageReqVO extends RepairWares { } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresRespVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresRespVO.java index 29cd604a..7179757c 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresRespVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresRespVO.java @@ -1,17 +1,24 @@ package cn.iocoder.yudao.module.project.vo; -import cn.iocoder.yudao.module.project.entity.RepairProject; +import cn.iocoder.yudao.module.project.entity.RepairWares; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import java.math.BigDecimal; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; @Schema(description = "管理后台 - 配件库 Response VO") @Data @ExcelIgnoreUnannotated -public class RepairWaresRespVO extends RepairProject { +public class RepairWaresRespVO extends RepairWares { + /**分公司*/ + private String corpNames; + /**类型名称*/ + private String typeName; + /**类型名称*/ + private String warehouseName; + /**关联子公司*/ + List corpIds = new ArrayList<>(); } \ No newline at end of file diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresSaveReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresSaveReqVO.java index 635d7045..ca431bdc 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresSaveReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/project/vo/RepairWaresSaveReqVO.java @@ -1,15 +1,13 @@ package cn.iocoder.yudao.module.project.vo; -import cn.iocoder.yudao.module.project.entity.RepairProject; +import cn.iocoder.yudao.module.project.entity.RepairWares; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.util.*; -import javax.validation.constraints.*; -import java.math.BigDecimal; +import lombok.Data; @Schema(description = "管理后台 - 配件库新增/修改 Request VO") @Data -public class RepairWaresSaveReqVO extends RepairProject { +public class RepairWaresSaveReqVO extends RepairWares { + } \ No newline at end of file diff --git a/dl-module-repair/src/main/resources/mapper/project/RepairWaresMapper.xml b/dl-module-repair/src/main/resources/mapper/project/RepairWaresMapper.xml index a20996c7..875e7da5 100644 --- a/dl-module-repair/src/main/resources/mapper/project/RepairWaresMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/project/RepairWaresMapper.xml @@ -9,6 +9,25 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> \ No newline at end of file