From b3a5b6f1ed1621d15c73a5d913a79738f71a2e31 Mon Sep 17 00:00:00 2001 From: JiilingLee <462362@qq.com> Date: Fri, 20 Oct 2023 10:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E5=85=B6=E4=BB=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E5=85=83=E6=95=B0=E6=8D=AE=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/other/OtherController.java | 19 +++++++++++++++++++ .../admin/other/vo/OtherPageReqVO.java | 3 +++ 2 files changed, 22 insertions(+) diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java index 8407fc3d..731565dc 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/OtherController.java @@ -1,9 +1,15 @@ package cn.iocoder.yudao.module.accounting.controller.admin.other; import cn.hutool.core.io.IoUtil; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherPageReqVO; +import cn.iocoder.yudao.module.accounting.controller.admin.voucher.vo.VoucherRespVO; +import cn.iocoder.yudao.module.accounting.convert.voucher.VoucherConvert; +import cn.iocoder.yudao.module.accounting.dal.dataobject.voucher.VoucherDO; import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.FilePageReqVO; import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO; import cn.iocoder.yudao.module.infra.service.file.FileService; +import cn.iocoder.yudao.module.setting.service.passwords.PasswordsService; +import com.alibaba.fastjson.JSONObject; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -44,6 +50,9 @@ public class OtherController { @Resource private FileService fileService; + @Resource + private PasswordsService passwordsService; + @PostMapping("/create") @Operation(summary = "创建其他资料") @PreAuthorize("@ss.hasPermission('accounting:other:create')") @@ -119,4 +128,14 @@ public class OtherController { ExcelUtils.write(response, "其他资料.xls", "数据", OtherExcelVO.class, datas); } + @GetMapping("/downloadXml") + @Operation(summary = "获得其他资料Xml") + @PreAuthorize("@ss.hasPermission('accounting:other:query')") + public void downloadXml(@Valid OtherPageReqVO pageVO, HttpServletResponse response) throws IOException { + PageResult pageResult = otherService.getOtherPage(pageVO); + PageResult otherRespVOPageResult = OtherConvert.INSTANCE.convertPage(pageResult); + String jsonString = JSONObject.toJSONString(otherRespVOPageResult); + passwordsService.jsonToXmlConverter(response,pageVO.getInputPassword(),jsonString); + } + } diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java index 93ef9d1d..74a814f7 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/other/vo/OtherPageReqVO.java @@ -79,4 +79,7 @@ public class OtherPageReqVO extends PageParam { @Schema(description = "备注", example = "你猜") private String remark; + @Schema(description = "密码", example = "1586") + private String inputPassword; + }