|
|
@@ -3,15 +3,28 @@ package com.ydtech.modules.inv.controller;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ydtech.constants.enums.inv.InvPayMethodEnum;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.core.page.PageResult;
|
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
+import com.ydtech.modules.inv.dao.InvAccountExcelMapper;
|
|
|
import com.ydtech.modules.inv.model.InvAccountExcel;
|
|
|
+import com.ydtech.modules.inv.model.excel.InvDisburseExcel;
|
|
|
+import com.ydtech.modules.inv.model.po.InvSettlementSource;
|
|
|
+import com.ydtech.modules.inv.model.vo.InvAccountExcelVo;
|
|
|
+import com.ydtech.modules.inv.model.vo.InvSettlementSourceQueryVo;
|
|
|
import com.ydtech.modules.inv.service.InvAccountExcelService;
|
|
|
+import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.IOException;
|
|
|
+import java.nio.file.Files;
|
|
|
+import java.nio.file.Path;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -28,12 +41,34 @@ public class invAccountExcelController {
|
|
|
@Autowired
|
|
|
private InvAccountExcelService invAccountExcelService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private InvAccountExcelMapper invAccountExcelMapper;
|
|
|
+
|
|
|
+ @Value("${upload.file.path}")
|
|
|
+ private String uploadPath;
|
|
|
+
|
|
|
+ @Value("${upload.file.url}")
|
|
|
+ private String uploadUrl;
|
|
|
+
|
|
|
@PostMapping("excel")
|
|
|
@ApiOperation("导出资金申请模板")
|
|
|
public HttpResult excelAccountOperate(@RequestBody List<String> idList) {
|
|
|
return invAccountExcelService.excelAccount(idList);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("deriveReport")
|
|
|
+ @ApiOperation("导出支出报表")
|
|
|
+ public HttpResult deriveReport(@RequestBody List<String> idList) throws IOException {
|
|
|
+ List<InvAccountExcel> insAccountExcels = invAccountExcelMapper.selectBatchIds(idList);
|
|
|
+ String uploadPath = this.uploadPath + "/excel/";
|
|
|
+ Path path = Paths.get(uploadPath);
|
|
|
+ if (!Files.exists(path)) {
|
|
|
+ Files.createDirectories(path);
|
|
|
+ }
|
|
|
+ String fileName = EasyExcelUtils.downExcel(uploadPath, "支出报表", InvDisburseExcel.class, insAccountExcels);
|
|
|
+ return HttpResult.ok(uploadUrl + "excel/" + fileName);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("insert")
|
|
|
@ApiOperation("插入资金模板信息")
|
|
|
public HttpResult invertAccount(@RequestBody InvAccountExcel invAccountExcel) {
|
|
|
@@ -113,6 +148,13 @@ public class invAccountExcelController {
|
|
|
return invAccountExcelService.selectAccountExcel(invAccountExcel);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("支出报表查看")
|
|
|
+ @PostMapping("getDisburse")
|
|
|
+ public HttpResult getDisburse(@RequestBody InvAccountExcelVo invAccountExcelVo) {
|
|
|
+ return invAccountExcelService.selectDisburse(invAccountExcelVo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@ApiOperation("删除资金模板")
|
|
|
@DeleteMapping("{excelAccountOperateId}")
|
|
|
public HttpResult deleteAccountExcel(@PathVariable("excelAccountOperateId") String excelAccountOperateId) {
|