分销订单列表返回体添加参数

20230922-ljl-fixBug
daixiaogang 1 year ago
parent bd3304e628
commit c043313d3b

@ -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<JSONObject> pager = purchaseOrderService.searchDsOrderList(shopId.toString(), dto.getPage(), dto.getPageSize(), filter, true, true);

@ -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<Pager<JSONObject>> searchDsOrderList() {
@PostMapping("/searchDsOrderList")
public BaseResponse<Ret> 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<JSONObject> 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<Ret> checkRsyncDataFinished() {
String shopId = AppConst.TEST_SHOP_ID;
return R.ok(Ret.success(opOrderService.checkRsyncDataFinished(Arrays.asList(shopId))));
}
@GetMapping("/rsyncFullOrder")
public BaseResponse<Ret> rsyncFullOrder() {
@PostMapping("/rsyncFullOrder")
public BaseResponse<Ret> 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<Ret> rsyncAfterSale(@RequestParam("aftersaleIds") String aftersaleIds) {
@PostMapping("/rsyncAfterSale")
public BaseResponse<Ret> rsyncAfterSale(@RequestBody RsyncAfterSaleRequestDTO dto) {
String shopId = AppConst.TEST_SHOP_ID;
ApiResult<Void> ret = orderUtil.rsyncAfterSale(shopId, aftersaleIds);
ApiResult<Void> 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<Ret> getDsOrderCount() {
@PostMapping("/getDsOrderCount")
public BaseResponse<Ret> 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<String, Integer> 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<Ret> rsyncOrder(@RequestBody ManualRsyncDdOrdersDTO dto) {
ApiResult apiResult = orderUtil.rsyncOrder(AppConst.TEST_SHOP_ID, dto.getOrderIds());
if (!apiResult.isSuccess()) {
return R.fail(apiResult.getMsg());
}

Loading…
Cancel
Save