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);