From c043313d3bfada3cc16b9511e155b5d64e5e4469 Mon Sep 17 00:00:00 2001 From: daixiaogang <2510234660@qq.com> Date: Mon, 4 Sep 2023 16:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=94=80=E8=AE=A2=E5=8D=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BF=94=E5=9B=9E=E4=BD=93=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spi/order/SearchDsOrderListService.java | 2 - .../java/com/ms/web/OrderTestController.java | 69 ++++++++----------- 2 files changed, 27 insertions(+), 44 deletions(-) diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java index 2194c30d..7d862849 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/order/SearchDsOrderListService.java @@ -35,8 +35,6 @@ public class SearchDsOrderListService extends SPIBaseService implements Extensio if (dto.checkParams()) { return R.ok(Ret.fail("参数不合法")); } - - dto.checkParams(); dto.setAuthShopIds(shopId.intValue()); SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto); Pager pager = purchaseOrderService.searchDsOrderList(shopId.toString(), dto.getPage(), dto.getPageSize(), filter, true, true); diff --git a/ms-web/src/main/java/com/ms/web/OrderTestController.java b/ms-web/src/main/java/com/ms/web/OrderTestController.java index dbcc3d80..2d6b107f 100644 --- a/ms-web/src/main/java/com/ms/web/OrderTestController.java +++ b/ms-web/src/main/java/com/ms/web/OrderTestController.java @@ -14,20 +14,21 @@ import com.ms.api.common.Ret; import com.ms.api.consts.AppConst; import com.ms.api.consts.DsOrderConst; import com.ms.api.consts.PurchaseOrderConst; +import com.ms.api.dto.order.ManualRsyncDdOrdersDTO; +import com.ms.api.dto.order.RsyncAfterSaleRequestDTO; import com.ms.api.dto.order.RsyncFullOrderRequestDTO; import com.ms.api.dto.order.SearchDsOrderFilterDTO; import com.ms.api.dto.order.SearchDsOrderListRequestDTO; import com.ms.api.service.OpOrderService; import com.ms.api.service.PurchaseOrderService; -import com.ms.api.tool.CommonTool; import com.ms.api.util.OrderUtil; import com.ms.api.util.PurchaseOrderUtil; -import com.ms.dal.entity.OpOrderExt; import com.ms.dal.mapper.OpOrderExtMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** @@ -37,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController; */ @Slf4j @RestController -@RequestMapping("api/order/") +@RequestMapping(value = "/", produces = "application/json; charset=utf-8") public class OrderTestController { @Resource @@ -55,31 +56,28 @@ public class OrderTestController { @Resource private OpOrderService opOrderService; - @GetMapping("/searchDsOrderList") - public BaseResponse> searchDsOrderList() { + @PostMapping("/searchDsOrderList") + public BaseResponse searchDsOrderList(@RequestBody SearchDsOrderListRequestDTO dto) { String shopId = AppConst.TEST_SHOP_ID; - SearchDsOrderListRequestDTO dto = new SearchDsOrderListRequestDTO(); - dto.setPurchaseOrderTab("waitPurchase"); - dto.setOrderStartTime("2023-08-01"); - dto.setOrderEndTime("2023-09-01"); dto.setAuthShopIds(Integer.valueOf(shopId)); - dto.checkParams(); + if (dto.checkParams()) { + return R.ok(Ret.fail("参数不合法")); + } + SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto); Pager pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true); - return R.ok(pager); + return R.ok(Ret.success(pager.toMap())); } - @GetMapping("/checkRsyncDataFinished") + @PostMapping("/checkRsyncDataFinished") public BaseResponse checkRsyncDataFinished() { String shopId = AppConst.TEST_SHOP_ID; return R.ok(Ret.success(opOrderService.checkRsyncDataFinished(Arrays.asList(shopId)))); } - @GetMapping("/rsyncFullOrder") - public BaseResponse rsyncFullOrder() { + @PostMapping("/rsyncFullOrder") + public BaseResponse rsyncFullOrder(@RequestBody RsyncFullOrderRequestDTO dto) { String shopId = AppConst.TEST_SHOP_ID; - RsyncFullOrderRequestDTO dto = new RsyncFullOrderRequestDTO(); - dto.setRsyncOrderDate("7"); ApiResult ret = orderUtil.rsyncFullOrder(shopId, dto.getRsyncOrderDate(), true); if (!ret.isSuccess()) { return R.ok(Ret.fail(ret.getMsg())); @@ -87,21 +85,24 @@ public class OrderTestController { return R.ok(Ret.success()); } - @GetMapping("/rsyncAfterSale") - public BaseResponse rsyncAfterSale(@RequestParam("aftersaleIds") String aftersaleIds) { + @PostMapping("/rsyncAfterSale") + public BaseResponse rsyncAfterSale(@RequestBody RsyncAfterSaleRequestDTO dto) { String shopId = AppConst.TEST_SHOP_ID; - ApiResult ret = orderUtil.rsyncAfterSale(shopId, aftersaleIds); + ApiResult ret = orderUtil.rsyncAfterSale(shopId, dto.getAftersaleIds()); if (!ret.isSuccess()) { return R.ok(Ret.fail(ret.getMsg())); } return R.ok(Ret.success()); } - @GetMapping("/getDsOrderCount") - public BaseResponse getDsOrderCount() { + @PostMapping("/getDsOrderCount") + public BaseResponse getDsOrderCount(@RequestBody SearchDsOrderListRequestDTO dto) { String shopId = AppConst.TEST_SHOP_ID; - SearchDsOrderListRequestDTO dto = new SearchDsOrderListRequestDTO(); dto.setAuthShopIds(Integer.valueOf(shopId)); + if (dto.checkParams()) { + return R.ok(Ret.fail("参数不合法")); + } + Map counts = purchaseOrderUtil.getDsTabAndOrderCountMap(dto); dto.setIsReceiverAddressChanged(true); @@ -130,25 +131,9 @@ public class OrderTestController { return R.ok(Ret.success(result)); } - @GetMapping("/testSql") - public void testSql() { - OpOrderExt ext = new OpOrderExt(); - ext.setOpOrderExtId(0L); - ext.setOrderId(""); - ext.setShopId(0L); - ext.setShopNote(""); - ext.setIsIsolation(0); - ext.setFilterPurchaseStatus(0); - ext.setFilterItemCount(0); - ext.setFilterItemTotal(0); - ext.setFilterRefund(0); - ext.setHasFreeProduct(0); - opOrderExtMapper.selectByConditions(ext); - } - - @GetMapping("/rsyncOrder") - public BaseResponse rsyncOrder(String orderIdList) { - ApiResult apiResult = orderUtil.rsyncOrder(AppConst.TEST_SHOP_ID, CommonTool.splitWithComma(orderIdList)); + @PostMapping("/rsyncOrder") + public BaseResponse rsyncOrder(@RequestBody ManualRsyncDdOrdersDTO dto) { + ApiResult apiResult = orderUtil.rsyncOrder(AppConst.TEST_SHOP_ID, dto.getOrderIds()); if (!apiResult.isSuccess()) { return R.fail(apiResult.getMsg()); }