From 1bd28f657ff5c92af328e616af06495affcab80f Mon Sep 17 00:00:00 2001 From: JilingLee <18850011309@139.com> Date: Mon, 18 Sep 2023 09:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=86=8C=E7=AE=A1=E7=90=86-=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=9D=A1=E7=A0=81=E5=80=BC=E6=9F=A5=E6=89=BE=E8=A3=85?= =?UTF-8?q?=E5=86=8C=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/packages/PackagesController.java | 8 ++++++++ .../archives/dal/mysql/packages/PackagesMapper.java | 5 +++++ .../module/archives/service/packages/PackagesService.java | 8 ++++++++ .../archives/service/packages/PackagesServiceImpl.java | 5 +++++ 4 files changed, 26 insertions(+) diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/packages/PackagesController.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/packages/PackagesController.java index ca0ab5d4..700e8405 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/packages/PackagesController.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/controller/admin/packages/PackagesController.java @@ -70,6 +70,14 @@ public class PackagesController { return success(PackagesConvert.INSTANCE.convert(packages)); } + @GetMapping("/getByCodeValue") + @Operation(summary = "获得装册") + @Parameter(name = "id", description = "条码值", required = true, example = "1-2-3") + public CommonResult getByCodeValue(@RequestParam("codeValue") String codeValue) { + PackagesDO packages = packagesService.getByCodeValue(codeValue); + return success(PackagesConvert.INSTANCE.convert(packages)); + } + @GetMapping("/list") @Operation(summary = "获得装册列表") @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/packages/PackagesMapper.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/packages/PackagesMapper.java index e5d52818..beca8589 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/packages/PackagesMapper.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/dal/mysql/packages/PackagesMapper.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.archives.dal.dataobject.packages.PackagesDO; import org.apache.ibatis.annotations.Mapper; import cn.iocoder.yudao.module.archives.controller.admin.packages.vo.*; +import org.apache.ibatis.annotations.Select; /** * 装册 Mapper @@ -77,4 +78,8 @@ public interface PackagesMapper extends BaseMapperX { .orderByDesc(PackagesDO::getId)); } + @Select("SELECT id, depot_id, depot_name, cabinet_id, cabinet_name, record_id, company_id, company, year, period, manege_name, case_num, catalog_num, files_num, flow_id, status, remark, package_time, dept_id, user_id, dept_name, attr1, attr2, attr3, attr4, create_by, code_url, code_value, package_num " + +" FROM archives_package WHERE code_value = #{codeValue} ORDER BY create_time DESC LIMIT 1") + PackagesDO getByCodeValue(String codeValue); + } diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesService.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesService.java index 29ad24cc..be6daf99 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesService.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesService.java @@ -59,6 +59,14 @@ public interface PackagesService { */ PageResult getPackagesPage(PackagesPageReqVO pageReqVO); + /** + * 根据条码值获得装册详情 + * + * @param codeValue 条码值 + * @return 装册分页 + */ + PackagesDO getByCodeValue(String codeValue); + /** * 获得装册列表, 用于 Excel 导出 * diff --git a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java index cf4c7513..5693c4e4 100644 --- a/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java +++ b/yudao-module-archives/yudao-module-archives-biz/src/main/java/cn/iocoder/yudao/module/archives/service/packages/PackagesServiceImpl.java @@ -106,6 +106,11 @@ public class PackagesServiceImpl implements PackagesService { return packagesMapper.selectBatchIds(ids); } + @Override + public PackagesDO getByCodeValue(String codeValue) { + return packagesMapper.getByCodeValue(codeValue); + } + @Override public PageResult getPackagesPage(PackagesPageReqVO pageReqVO) { return packagesMapper.selectPage(pageReqVO);