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()); }