|
|
@@ -2,7 +2,6 @@ package com.sckw.payment.controller;
|
|
|
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
-import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.excel.utils.ExcelUtil;
|
|
|
import com.sckw.payment.model.dto.ILedger;
|
|
|
@@ -34,12 +33,10 @@ public class KwpLedgerTradeController {
|
|
|
private KwpLedgerTradeService kwpLedgerTradeService;
|
|
|
|
|
|
private void fill(TradeSendReq tradeSendReq) {
|
|
|
- String ids = tradeSendReq.getIds();
|
|
|
- List<Long> longs = StringUtils.splitStrToList(ids, Long.class);
|
|
|
- if (CollectionUtils.isEmpty(longs)) {
|
|
|
+ if (CollectionUtils.isEmpty(tradeSendReq.getIdList())) {
|
|
|
throw new BusinessException("销售订单不能为空");
|
|
|
}
|
|
|
- tradeSendReq.setOrders(longs);
|
|
|
+ tradeSendReq.setOrders(tradeSendReq.getIdList());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -137,7 +134,7 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@DeleteMapping("delete")
|
|
|
- public HttpResult delete(@NotBlank(message = "id不能为空")String id) {
|
|
|
+ public HttpResult delete(@NotBlank(message = "id不能为空") String id) {
|
|
|
return HttpResult.ok(kwpLedgerTradeService.remove(Long.valueOf(id)));
|
|
|
}
|
|
|
|
|
|
@@ -148,7 +145,7 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("back")
|
|
|
- public HttpResult back(@NotBlank(message = "id不能为空")@RequestParam("id") String id) {
|
|
|
+ public HttpResult back(@NotBlank(message = "id不能为空") @RequestParam("id") String id) {
|
|
|
return HttpResult.ok(kwpLedgerTradeService.backOrder(Long.valueOf(id)));
|
|
|
}
|
|
|
|
|
|
@@ -170,7 +167,7 @@ public class KwpLedgerTradeController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("queryBack")
|
|
|
- public HttpResult queryBack(@NotBlank(message = "id不能为空")@RequestParam("id") String id) {
|
|
|
+ public HttpResult queryBack(@NotBlank(message = "id不能为空") @RequestParam("id") String id) {
|
|
|
return HttpResult.ok(kwpLedgerTradeService.queryBack(Long.valueOf(id)));
|
|
|
}
|
|
|
|
|
|
@@ -209,14 +206,12 @@ public class KwpLedgerTradeController {
|
|
|
@PostMapping("sellExport")
|
|
|
public HttpResult sellExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
|
|
|
List<ILedger> list;
|
|
|
- String ids = tradeReq.getIds();
|
|
|
- List<Long> longs = StringUtils.splitStrToList(ids, Long.class);
|
|
|
|
|
|
- if (CollectionUtils.isEmpty(longs)) {
|
|
|
+ if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
|
|
|
PageRes<ILedger> pageResult = kwpLedgerTradeService.sellList(tradeReq);
|
|
|
list = pageResult.getList();
|
|
|
} else {
|
|
|
- list = kwpLedgerTradeService.selectSellList(longs);
|
|
|
+ list = kwpLedgerTradeService.selectSellList(tradeReq.getIdList());
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
@@ -241,14 +236,11 @@ public class KwpLedgerTradeController {
|
|
|
@PostMapping("purchaseExport")
|
|
|
public HttpResult purchaseExport(HttpServletResponse response, @RequestBody @Valid TradeReq tradeReq) {
|
|
|
List<ILedger> list;
|
|
|
- String ids = tradeReq.getIds();
|
|
|
- List<Long> longs = StringUtils.splitStrToList(ids, Long.class);
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(longs)) {
|
|
|
+ if (CollectionUtils.isEmpty(tradeReq.getIdList())) {
|
|
|
PageRes<ILedger> pageResult = kwpLedgerTradeService.purchaseList(tradeReq);
|
|
|
list = pageResult.getList();
|
|
|
} else {
|
|
|
- list = kwpLedgerTradeService.selectPurchaseList(longs);
|
|
|
+ list = kwpLedgerTradeService.selectPurchaseList(tradeReq.getIdList());
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|