|
|
|
@ -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<OtherDO> pageResult = otherService.getOtherPage(pageVO);
|
|
|
|
|
PageResult<OtherRespVO> otherRespVOPageResult = OtherConvert.INSTANCE.convertPage(pageResult);
|
|
|
|
|
String jsonString = JSONObject.toJSONString(otherRespVOPageResult);
|
|
|
|
|
passwordsService.jsonToXmlConverter(response,pageVO.getInputPassword(),jsonString);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|