|
|
@@ -1,13 +1,11 @@
|
|
|
package com.sckw.payment.controller;
|
|
|
|
|
|
-import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.model.vo.TableTop;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.payment.model.constant.LedgerEnum;
|
|
|
import com.sckw.payment.model.constant.TradeUnitType;
|
|
|
-import com.sckw.payment.model.dto.LedgerPurchaseDto;
|
|
|
-import com.sckw.payment.model.dto.LedgerSellDto;
|
|
|
+import com.sckw.payment.model.dto.LedgerTradeDto;
|
|
|
import com.sckw.payment.model.vo.req.*;
|
|
|
import com.sckw.payment.model.vo.res.LedgerTradeVo;
|
|
|
import com.sckw.payment.service.KwpLedgerTradeService;
|
|
|
@@ -142,7 +140,7 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("sellCount")
|
|
|
- public HttpResult sellCount(@RequestBody TradeReq tradeReq) {
|
|
|
+ public HttpResult sellCount(@RequestBody TradeReq tradeReq) {
|
|
|
tradeReq.setUnitType(TradeUnitType.PURCHASE);
|
|
|
tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
|
|
|
return HttpResult.ok(kwpLedgerTradeService.orderCount(tradeReq));
|
|
|
@@ -154,7 +152,7 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("purchaseCount")
|
|
|
- public HttpResult purchaseCount(@RequestBody TradeReq tradeReq) {
|
|
|
+ public HttpResult purchaseCount(@RequestBody TradeReq tradeReq) {
|
|
|
tradeReq.setUnitType(TradeUnitType.SELL);
|
|
|
tradeReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
|
|
|
List<TableTop> tableTops = kwpLedgerTradeService.orderCount(tradeReq);
|
|
|
@@ -242,18 +240,10 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("sellExport")
|
|
|
- public HttpResult sellExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
|
|
|
- List<LedgerSellDto> list;
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
|
|
|
- tradeReq.setPage(0);
|
|
|
- tradeReq.setPageSize(0);
|
|
|
- PageRes<LedgerSellDto> pageResult = kwpLedgerTradeService.sellList(tradeReq);
|
|
|
- list = pageResult.getList();
|
|
|
- } else {
|
|
|
- list = kwpLedgerTradeService.selectSellList(tradeReq.getIdList());
|
|
|
- }
|
|
|
-
|
|
|
+ public HttpResult sellExport(HttpServletResponse response, @RequestBody TradeReq tradeReq) {
|
|
|
+ tradeReq.setUnitType(TradeUnitType.PURCHASE);
|
|
|
+ tradeReq.setUnitTypeTwo(TradeUnitType.SELL);
|
|
|
+ List<LedgerTradeDto> list = kwpLedgerTradeService.exportList(tradeReq, tradeReq.getIdList());
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return HttpResult.error("没有可导出的数据");
|
|
|
}
|
|
|
@@ -274,17 +264,10 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("purchaseExport")
|
|
|
- public HttpResult purchaseExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
|
|
|
- List<LedgerPurchaseDto> list;
|
|
|
- if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
|
|
|
- tradeReq.setPage(0);
|
|
|
- tradeReq.setPageSize(0);
|
|
|
- PageRes<LedgerPurchaseDto> pageResult = kwpLedgerTradeService.purchaseList(tradeReq);
|
|
|
- list = pageResult.getList();
|
|
|
- } else {
|
|
|
- list = kwpLedgerTradeService.selectPurchaseList(tradeReq.getIdList());
|
|
|
- }
|
|
|
-
|
|
|
+ public HttpResult purchaseExport(HttpServletResponse response, @RequestBody TradeReq tradeReq) {
|
|
|
+ tradeReq.setUnitType(TradeUnitType.SELL);
|
|
|
+ tradeReq.setUnitTypeTwo(TradeUnitType.PURCHASE);
|
|
|
+ List<LedgerTradeDto> list = kwpLedgerTradeService.exportList(tradeReq, tradeReq.getIdList());
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return HttpResult.error("没有可导出的数据");
|
|
|
}
|