diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java index d55466c8..dc98c86c 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/VoucherController.java @@ -3,8 +3,13 @@ package cn.iocoder.yudao.module.accounting.controller.admin.voucher; import cn.iocoder.yudao.module.accounting.controller.admin.attachment.vo.AttachmentCreateReqVO; import cn.iocoder.yudao.module.accounting.controller.admin.attachment.vo.AttachmentExportReqVO; import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.BankSlipExportReqVO; +import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.BankSlipPageReqVO; +import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.BankSlipRespVO; import cn.iocoder.yudao.module.accounting.controller.admin.flow.vo.FlowExportReqVO; import cn.iocoder.yudao.module.accounting.controller.admin.invoices.vo.InvoicesExportReqVO; +import cn.iocoder.yudao.module.accounting.controller.admin.invoices.vo.InvoicesRespVO; +import cn.iocoder.yudao.module.accounting.convert.bankslip.BankSlipConvert; +import cn.iocoder.yudao.module.accounting.convert.invoices.InvoicesConvert; import cn.iocoder.yudao.module.accounting.dal.dataobject.attachment.AttachmentDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO; import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO; @@ -13,6 +18,8 @@ import cn.iocoder.yudao.module.accounting.service.attachment.AttachmentService; import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService; import cn.iocoder.yudao.module.accounting.service.flow.FlowService; import cn.iocoder.yudao.module.accounting.service.invoices.InvoicesService; +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; @@ -60,6 +67,9 @@ public class VoucherController { @Resource private FlowService flowService; + @Resource + private PasswordsService passwordsService; + @PostMapping("/create") @Operation(summary = "创建会计凭证") @@ -109,6 +119,16 @@ public class VoucherController { return success(VoucherConvert.INSTANCE.convertList(list)); } + @GetMapping("/downloadXml") + @Operation(summary = "获得会计凭证分页Xml") + @PreAuthorize("@ss.hasPermission('accounting:voucher:query')") + public void downloadXml(@Valid VoucherPageReqVO pageVO, HttpServletResponse response) throws IOException { + PageResult pageResult = voucherService.getVoucherPage(pageVO); + PageResult voucherRespVOPageResult = VoucherConvert.INSTANCE.convertPage(pageResult); + String jsonString = JSONObject.toJSONString(voucherRespVOPageResult); + passwordsService.jsonToXmlConverter(response,pageVO.getInputPassword(),jsonString); + } + @GetMapping("/page") @Operation(summary = "获得会计凭证分页") @PreAuthorize("@ss.hasPermission('accounting:voucher:query')") diff --git a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/vo/VoucherPageReqVO.java b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/vo/VoucherPageReqVO.java index 4671f2a4..1a43af59 100644 --- a/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/vo/VoucherPageReqVO.java +++ b/yudao-module-accounting/yudao-module-accounting-biz/src/main/java/cn/iocoder/yudao/module/accounting/controller/admin/voucher/vo/VoucherPageReqVO.java @@ -108,4 +108,7 @@ public class VoucherPageReqVO extends PageParam { @Schema(description = "档案柜ID", example = "1586") private Long cabinetId; + @Schema(description = "密码", example = "1586") + private String inputPassword; + }