|
|
@ -14,20 +14,21 @@ import com.ms.api.common.Ret;
|
|
|
|
import com.ms.api.consts.AppConst;
|
|
|
|
import com.ms.api.consts.AppConst;
|
|
|
|
import com.ms.api.consts.DsOrderConst;
|
|
|
|
import com.ms.api.consts.DsOrderConst;
|
|
|
|
import com.ms.api.consts.PurchaseOrderConst;
|
|
|
|
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.RsyncFullOrderRequestDTO;
|
|
|
|
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
|
|
|
|
import com.ms.api.dto.order.SearchDsOrderFilterDTO;
|
|
|
|
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
|
|
|
|
import com.ms.api.dto.order.SearchDsOrderListRequestDTO;
|
|
|
|
import com.ms.api.service.OpOrderService;
|
|
|
|
import com.ms.api.service.OpOrderService;
|
|
|
|
import com.ms.api.service.PurchaseOrderService;
|
|
|
|
import com.ms.api.service.PurchaseOrderService;
|
|
|
|
import com.ms.api.tool.CommonTool;
|
|
|
|
|
|
|
|
import com.ms.api.util.OrderUtil;
|
|
|
|
import com.ms.api.util.OrderUtil;
|
|
|
|
import com.ms.api.util.PurchaseOrderUtil;
|
|
|
|
import com.ms.api.util.PurchaseOrderUtil;
|
|
|
|
import com.ms.dal.entity.OpOrderExt;
|
|
|
|
|
|
|
|
import com.ms.dal.mapper.OpOrderExtMapper;
|
|
|
|
import com.ms.dal.mapper.OpOrderExtMapper;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
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.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -37,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("api/order/")
|
|
|
|
@RequestMapping(value = "/", produces = "application/json; charset=utf-8")
|
|
|
|
public class OrderTestController {
|
|
|
|
public class OrderTestController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -55,31 +56,28 @@ public class OrderTestController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private OpOrderService opOrderService;
|
|
|
|
private OpOrderService opOrderService;
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/searchDsOrderList")
|
|
|
|
@PostMapping("/searchDsOrderList")
|
|
|
|
public BaseResponse<Pager<JSONObject>> searchDsOrderList() {
|
|
|
|
public BaseResponse<Ret> searchDsOrderList(@RequestBody SearchDsOrderListRequestDTO dto) {
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
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.setAuthShopIds(Integer.valueOf(shopId));
|
|
|
|
dto.checkParams();
|
|
|
|
if (dto.checkParams()) {
|
|
|
|
|
|
|
|
return R.ok(Ret.fail("参数不合法"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto);
|
|
|
|
SearchDsOrderFilterDTO filter = purchaseOrderUtil.searchDsOrderFilter(dto);
|
|
|
|
Pager<JSONObject> pager = purchaseOrderService.searchDsOrderList(shopId, dto.getPage(), dto.getPageSize(), filter, true, true);
|
|
|
|
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() {
|
|
|
|
public BaseResponse<Ret> checkRsyncDataFinished() {
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
return R.ok(Ret.success(opOrderService.checkRsyncDataFinished(Arrays.asList(shopId))));
|
|
|
|
return R.ok(Ret.success(opOrderService.checkRsyncDataFinished(Arrays.asList(shopId))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/rsyncFullOrder")
|
|
|
|
@PostMapping("/rsyncFullOrder")
|
|
|
|
public BaseResponse<Ret> rsyncFullOrder() {
|
|
|
|
public BaseResponse<Ret> rsyncFullOrder(@RequestBody RsyncFullOrderRequestDTO dto) {
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
RsyncFullOrderRequestDTO dto = new RsyncFullOrderRequestDTO();
|
|
|
|
|
|
|
|
dto.setRsyncOrderDate("7");
|
|
|
|
|
|
|
|
ApiResult ret = orderUtil.rsyncFullOrder(shopId, dto.getRsyncOrderDate(), true);
|
|
|
|
ApiResult ret = orderUtil.rsyncFullOrder(shopId, dto.getRsyncOrderDate(), true);
|
|
|
|
if (!ret.isSuccess()) {
|
|
|
|
if (!ret.isSuccess()) {
|
|
|
|
return R.ok(Ret.fail(ret.getMsg()));
|
|
|
|
return R.ok(Ret.fail(ret.getMsg()));
|
|
|
@ -87,21 +85,24 @@ public class OrderTestController {
|
|
|
|
return R.ok(Ret.success());
|
|
|
|
return R.ok(Ret.success());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/rsyncAfterSale")
|
|
|
|
@PostMapping("/rsyncAfterSale")
|
|
|
|
public BaseResponse<Ret> rsyncAfterSale(@RequestParam("aftersaleIds") String aftersaleIds) {
|
|
|
|
public BaseResponse<Ret> rsyncAfterSale(@RequestBody RsyncAfterSaleRequestDTO dto) {
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
ApiResult<Void> ret = orderUtil.rsyncAfterSale(shopId, aftersaleIds);
|
|
|
|
ApiResult<Void> ret = orderUtil.rsyncAfterSale(shopId, dto.getAftersaleIds());
|
|
|
|
if (!ret.isSuccess()) {
|
|
|
|
if (!ret.isSuccess()) {
|
|
|
|
return R.ok(Ret.fail(ret.getMsg()));
|
|
|
|
return R.ok(Ret.fail(ret.getMsg()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return R.ok(Ret.success());
|
|
|
|
return R.ok(Ret.success());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getDsOrderCount")
|
|
|
|
@PostMapping("/getDsOrderCount")
|
|
|
|
public BaseResponse<Ret> getDsOrderCount() {
|
|
|
|
public BaseResponse<Ret> getDsOrderCount(@RequestBody SearchDsOrderListRequestDTO dto) {
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
String shopId = AppConst.TEST_SHOP_ID;
|
|
|
|
SearchDsOrderListRequestDTO dto = new SearchDsOrderListRequestDTO();
|
|
|
|
|
|
|
|
dto.setAuthShopIds(Integer.valueOf(shopId));
|
|
|
|
dto.setAuthShopIds(Integer.valueOf(shopId));
|
|
|
|
|
|
|
|
if (dto.checkParams()) {
|
|
|
|
|
|
|
|
return R.ok(Ret.fail("参数不合法"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Integer> counts = purchaseOrderUtil.getDsTabAndOrderCountMap(dto);
|
|
|
|
Map<String, Integer> counts = purchaseOrderUtil.getDsTabAndOrderCountMap(dto);
|
|
|
|
|
|
|
|
|
|
|
|
dto.setIsReceiverAddressChanged(true);
|
|
|
|
dto.setIsReceiverAddressChanged(true);
|
|
|
@ -130,25 +131,9 @@ public class OrderTestController {
|
|
|
|
return R.ok(Ret.success(result));
|
|
|
|
return R.ok(Ret.success(result));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/testSql")
|
|
|
|
@PostMapping("/rsyncOrder")
|
|
|
|
public void testSql() {
|
|
|
|
public BaseResponse<Ret> rsyncOrder(@RequestBody ManualRsyncDdOrdersDTO dto) {
|
|
|
|
OpOrderExt ext = new OpOrderExt();
|
|
|
|
ApiResult apiResult = orderUtil.rsyncOrder(AppConst.TEST_SHOP_ID, dto.getOrderIds());
|
|
|
|
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));
|
|
|
|
|
|
|
|
if (!apiResult.isSuccess()) {
|
|
|
|
if (!apiResult.isSuccess()) {
|
|
|
|
return R.fail(apiResult.getMsg());
|
|
|
|
return R.fail(apiResult.getMsg());
|
|
|
|
}
|
|
|
|
}
|
|
|
|