优化系统
This commit is contained in:
parent
99084e09cd
commit
2ef4b45ae2
|
|
@ -48,7 +48,8 @@ public class ShopController extends BaseController {
|
|||
@GetMapping("/platformList")
|
||||
public TableDataInfo platformList(Integer status) {
|
||||
LambdaQueryWrapper<OShopPlatform> qw = new LambdaQueryWrapper<OShopPlatform>()
|
||||
.eq(status!=null,OShopPlatform::getStatus,status);
|
||||
.eq(status!=null,OShopPlatform::getStatus,status)
|
||||
;
|
||||
qw.orderByAsc(OShopPlatform::getSort);
|
||||
List<OShopPlatform> list = platformService.list(qw);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package cn.qihangerp.oms.dou;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DouPullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Integer pullType;//拉取类型:0或不传全量;1更新(用于拉取商品的条件)
|
||||
private String orderId;
|
||||
}
|
||||
|
|
@ -7,11 +7,11 @@ import cn.qihangerp.model.entity.OShopPullLasttime;
|
|||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.DouGoods;
|
||||
import cn.qihangerp.model.entity.DouGoodsSku;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import cn.qihangerp.module.service.DouGoodsService;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.dou.DouApiCommon;
|
||||
import cn.qihangerp.oms.dou.DouPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.DouGoodsApiHelper;
|
||||
import cn.qihangerp.open.dou.model.GoodsListResultVo;
|
||||
|
|
@ -45,7 +45,7 @@ public class DouGoodsApiController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult pullSkuList(@RequestBody DouPullRequest params) throws Exception {
|
||||
public AjaxResult pullSkuList(@RequestBody GoodsPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ public class DouGoodsApiController {
|
|||
if(resultVo.getCode() !=0 ){
|
||||
OShopPullLogs logs = new OShopPullLogs();
|
||||
logs.setShopId(params.getShopId());
|
||||
logs.setShopType(EnumShopType.JD.getIndex());
|
||||
logs.setShopType(EnumShopType.DOU.getIndex());
|
||||
logs.setPullType("GOODS");
|
||||
logs.setPullWay("主动拉取商品sku");
|
||||
logs.setPullParams(pullParams);
|
||||
|
|
@ -119,7 +119,7 @@ public class DouGoodsApiController {
|
|||
// 添加拉取日志
|
||||
OShopPullLogs logs = new OShopPullLogs();
|
||||
logs.setShopId(params.getShopId());
|
||||
logs.setShopType(EnumShopType.JD.getIndex());
|
||||
logs.setShopType(EnumShopType.DOU.getIndex());
|
||||
logs.setPullType("GOODS");
|
||||
logs.setPullWay("主动拉取商品sku");
|
||||
logs.setPullParams(pullParams);
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import cn.qihangerp.common.ResultVoEnum;
|
|||
import cn.qihangerp.common.enums.EnumShopType;
|
||||
import cn.qihangerp.common.enums.HttpStatus;
|
||||
import cn.qihangerp.model.entity.OShopPlatform;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import cn.qihangerp.module.service.OShopPlatformService;
|
||||
import cn.qihangerp.module.service.OShopService;
|
||||
import cn.qihangerp.oms.dou.DouPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.DouTokenApiHelper;
|
||||
import cn.qihangerp.open.dou.model.Token;
|
||||
|
|
@ -24,7 +24,7 @@ public class DouOAuthController {
|
|||
|
||||
@PostMapping("/update_token")
|
||||
@ResponseBody
|
||||
public AjaxResult getToken(@RequestBody DouPullRequest req) {
|
||||
public AjaxResult getToken(@RequestBody GoodsPullRequest req) {
|
||||
if(req.getShopId()==null) return AjaxResult.error("缺少参数:shopId");
|
||||
|
||||
var shop = shopService.getById(req.getShopId());
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import cn.qihangerp.module.service.DouOrderService;
|
|||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.dou.DouApiCommon;
|
||||
import cn.qihangerp.oms.dou.DouPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.DouOrderApiHelper;
|
||||
import cn.qihangerp.open.dou.model.order.Order;
|
||||
|
|
@ -25,7 +24,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.qihangerp.model.request.OrderPullRequest;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
|
|
@ -56,7 +55,7 @@ public class DouOrderApiController {
|
|||
*/
|
||||
@PostMapping("/pull_order")
|
||||
@ResponseBody
|
||||
public AjaxResult pullOrder(@RequestBody DouPullRequest req) {
|
||||
public AjaxResult pullOrder(@RequestBody OrderPullRequest req) {
|
||||
log.info("/**************增量拉取dou订单****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
@ -229,7 +228,7 @@ public class DouOrderApiController {
|
|||
*/
|
||||
@PostMapping("/pull_order_detail")
|
||||
@ResponseBody
|
||||
public AjaxResult getOrderPullDetail(@RequestBody DouPullRequest req) {
|
||||
public AjaxResult getOrderPullDetail(@RequestBody OrderPullRequest req) {
|
||||
log.info("/**************主动更新dou订单by number****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import cn.qihangerp.common.mq.MqUtils;
|
|||
import cn.qihangerp.model.entity.OShopPullLasttime;
|
||||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.DouRefund;
|
||||
import cn.qihangerp.model.request.RefundPullRequest;
|
||||
import cn.qihangerp.module.service.DouRefundService;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.dou.DouApiCommon;
|
||||
import cn.qihangerp.oms.dou.DouPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.DouRefundApiHelper;
|
||||
import cn.qihangerp.open.dou.model.after.AfterSale;
|
||||
|
|
@ -52,7 +52,7 @@ public class DouRefundApiController {
|
|||
*/
|
||||
@PostMapping("/pull_list")
|
||||
@ResponseBody
|
||||
public AjaxResult pullRefundList(@RequestBody DouPullRequest req) {
|
||||
public AjaxResult pullRefundList(@RequestBody RefundPullRequest req) {
|
||||
log.info("/**************增量拉取dou退款****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import cn.qihangerp.common.enums.HttpStatus;
|
|||
import cn.qihangerp.model.entity.OShopPullLasttime;
|
||||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.JdGoodsSku;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import cn.qihangerp.module.service.JdGoodsService;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.jd.JdApiCommon;
|
||||
import cn.qihangerp.oms.jd.JdPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.jd.JdGoodsApiHelper;
|
||||
import cn.qihangerp.open.jd.response.JdGoodsSkuListResponse;
|
||||
|
|
@ -42,7 +42,7 @@ public class JdGoodsApiController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult pullSkuList(@RequestBody JdPullRequest params) throws Exception {
|
||||
public AjaxResult pullSkuList(@RequestBody GoodsPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ import cn.qihangerp.common.utils.DateUtils;
|
|||
import cn.qihangerp.model.entity.OShopPullLasttime;
|
||||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.JdRefund;
|
||||
import cn.qihangerp.model.request.RefundPullRequest;
|
||||
import cn.qihangerp.module.service.JdRefundService;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.jd.JdApiCommon;
|
||||
import cn.qihangerp.oms.jd.JdPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.jd.JdAfterSaleApiHelper;
|
||||
import cn.qihangerp.open.jd.model.AfterSale;
|
||||
|
|
@ -49,7 +49,7 @@ public class JdOrderAfterSaleApiController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_after_list", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody JdPullRequest params) throws Exception {
|
||||
public AjaxResult pullList(@RequestBody RefundPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import cn.qihangerp.module.service.JdOrderService;
|
|||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.oms.jd.JdApiCommon;
|
||||
import cn.qihangerp.oms.jd.JdPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.jd.JdOrderApiHelper;
|
||||
import cn.qihangerp.open.jd.response.JdOrderDetailResponse;
|
||||
|
|
@ -26,7 +25,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.qihangerp.model.request.OrderPullRequest;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
@ -46,7 +45,7 @@ public class JdOrderApiController {
|
|||
private final OShopPullLogsService pullLogsService;
|
||||
|
||||
@RequestMapping(value = "/pull_order_jd", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody JdPullRequest params) throws Exception {
|
||||
public AjaxResult pullList(@RequestBody OrderPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
@ -173,7 +172,7 @@ public class JdOrderApiController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_order_detail", method = RequestMethod.POST)
|
||||
public AjaxResult pullDetail(@RequestBody JdPullRequest params) throws Exception {
|
||||
public AjaxResult pullDetail(@RequestBody OrderPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package cn.qihangerp.oms.pdd;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PddPullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Integer pullType;//拉取类型:0或不传全量;1更新(用于拉取商品的条件)
|
||||
private String orderId;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
|
|
@ -11,10 +11,10 @@ import cn.qihangerp.module.service.OShopPullLasttimeService;
|
|||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.module.service.PddGoodsService;
|
||||
import cn.qihangerp.oms.pdd.PddApiCommon;
|
||||
import cn.qihangerp.oms.pdd.PddPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.pdd.PddGoodsApiHelper;
|
||||
import cn.qihangerp.open.pdd.model.GoodsResultVo;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -44,7 +44,7 @@ public class PddGoodsApiController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult pullSkuList(@RequestBody PddPullRequest params) throws Exception {
|
||||
public AjaxResult pullSkuList(@RequestBody GoodsPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import cn.qihangerp.module.service.OShopPullLasttimeService;
|
|||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.module.service.PddOrderService;
|
||||
import cn.qihangerp.oms.pdd.PddApiCommon;
|
||||
import cn.qihangerp.oms.pdd.PddPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.pdd.PddOrderApiHelper;
|
||||
import cn.qihangerp.open.pdd.model.OrderListResultVo;
|
||||
|
|
@ -25,7 +24,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import cn.qihangerp.model.request.OrderPullRequest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
@ -61,7 +60,7 @@ public class PddOrderApiController {
|
|||
*/
|
||||
@PostMapping("/pull_order")
|
||||
@ResponseBody
|
||||
public AjaxResult pullIncrementOrder(@RequestBody PddPullRequest req) throws Exception {
|
||||
public AjaxResult pullIncrementOrder(@RequestBody OrderPullRequest req) throws Exception {
|
||||
log.info("===============主动拉取pdd订单:{}", JSONObject.toJSONString(req));
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
@ -190,7 +189,7 @@ public class PddOrderApiController {
|
|||
*/
|
||||
@RequestMapping("/pull_order_detail")
|
||||
@ResponseBody
|
||||
public AjaxResult getOrderPullDetail(@RequestBody PddPullRequest req) throws Exception {
|
||||
public AjaxResult getOrderPullDetail(@RequestBody OrderPullRequest req) throws Exception {
|
||||
log.info("/**************主动更新pdd订单by number****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import cn.qihangerp.common.mq.MqUtils;
|
|||
import cn.qihangerp.model.entity.OShopPullLasttime;
|
||||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.PddRefund;
|
||||
import cn.qihangerp.model.request.RefundPullRequest;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.module.service.PddRefundService;
|
||||
import cn.qihangerp.oms.pdd.PddApiCommon;
|
||||
import cn.qihangerp.oms.pdd.PddPullRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.pdd.PddRefundApiHelper;
|
||||
import cn.qihangerp.open.pdd.model.AfterSale;
|
||||
|
|
@ -50,7 +50,7 @@ public class PddRefundApiController {
|
|||
*/
|
||||
@PostMapping("/pull_list")
|
||||
@ResponseBody
|
||||
public AjaxResult pullRefundList(@RequestBody PddPullRequest req) throws Exception {
|
||||
public AjaxResult pullRefundList(@RequestBody RefundPullRequest req) throws Exception {
|
||||
log.info("/**************增量拉取pdd退款****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
package cn.qihangerp.oms.tao;
|
||||
|
||||
public class TaoRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Long orderId;//订单id
|
||||
private Long refundId;
|
||||
private Integer updType;//更新类型0拉取新订单1更新订单
|
||||
|
||||
private Integer pullType;//拉取类型:0或不传全量;1更新(用于拉取商品的条件)
|
||||
|
||||
private String orderDate;
|
||||
|
||||
public String getOrderDate() {
|
||||
return orderDate;
|
||||
}
|
||||
|
||||
public void setOrderDate(String orderDate) {
|
||||
this.orderDate = orderDate;
|
||||
}
|
||||
|
||||
public Integer getPullType() {
|
||||
return pullType;
|
||||
}
|
||||
|
||||
public void setPullType(Integer pullType) {
|
||||
this.pullType = pullType;
|
||||
}
|
||||
|
||||
public Integer getUpdType() {
|
||||
return updType;
|
||||
}
|
||||
|
||||
public void setUpdType(Integer updType) {
|
||||
this.updType = updType;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public Long getRefundId() {
|
||||
return refundId;
|
||||
}
|
||||
|
||||
public void setRefundId(Long refundId) {
|
||||
this.refundId = refundId;
|
||||
}
|
||||
}
|
||||
|
|
@ -11,11 +11,11 @@ import cn.qihangerp.model.entity.OShopPullLasttime;
|
|||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.TaoGoods;
|
||||
import cn.qihangerp.model.entity.TaoGoodsSku;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.module.service.TaoGoodsService;
|
||||
import cn.qihangerp.oms.tao.TaoApiCommon;
|
||||
import cn.qihangerp.oms.tao.TaoRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
|
||||
import cn.qihangerp.open.tao.TaoGoodsApiHelper;
|
||||
|
|
@ -58,7 +58,7 @@ public class TaoGoodsApiController {
|
|||
}
|
||||
*/
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult pullGoodsList(@RequestBody TaoRequest req) throws Exception {
|
||||
public AjaxResult pullGoodsList(@RequestBody GoodsPullRequest req) throws Exception {
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
// return ApiResult.build(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import cn.qihangerp.module.service.OShopPullLogsService;
|
|||
import cn.qihangerp.module.service.TaoOrderService;
|
||||
import cn.qihangerp.oms.tao.OrderAssembleHelper;
|
||||
import cn.qihangerp.oms.tao.TaoApiCommon;
|
||||
import cn.qihangerp.oms.tao.TaoRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.tao.TaoOrderApiHelper;
|
||||
import cn.qihangerp.open.tao.response.TaoOrderDetailResponse;
|
||||
|
|
@ -30,7 +29,7 @@ import java.time.Duration;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
import cn.qihangerp.model.request.OrderPullRequest;
|
||||
/**
|
||||
* 淘系订单更新
|
||||
*/
|
||||
|
|
@ -53,7 +52,7 @@ public class TaoOrderApiController {
|
|||
*/
|
||||
@PostMapping("/pull_order_tao")
|
||||
@ResponseBody
|
||||
public AjaxResult pullIncrementOrder(@RequestBody TaoRequest req) throws IOException {
|
||||
public AjaxResult pullIncrementOrder(@RequestBody OrderPullRequest req) throws IOException {
|
||||
log.info("/**************增量拉取tao订单****************/");
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
@ -81,7 +80,7 @@ public class TaoOrderApiController {
|
|||
LocalDateTime endTime = null;
|
||||
OShopPullLasttime lasttime = null;
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
if(StringUtils.isEmpty(req.getOrderDate())) {
|
||||
if(StringUtils.isEmpty(req.getStartTime())) {
|
||||
lasttime = pullLasttimeService.getLasttimeByShop(req.getShopId(), "ORDER");
|
||||
if (lasttime == null) {
|
||||
endTime = LocalDateTime.now();
|
||||
|
|
@ -104,8 +103,8 @@ public class TaoOrderApiController {
|
|||
}else {
|
||||
// 使用条件传过来的时间
|
||||
// 将时间字符串转换为 LocalDateTime
|
||||
startTime = LocalDateTime.parse(req.getOrderDate() + " 00:00:01", formatter);
|
||||
endTime = LocalDateTime.parse(req.getOrderDate() + " 23:59:59", formatter);
|
||||
startTime = LocalDateTime.parse(req.getStartTime() + " 00:00:01", formatter);
|
||||
endTime = LocalDateTime.parse(req.getStartTime() + " 23:59:59", formatter);
|
||||
}
|
||||
|
||||
//第一次获取
|
||||
|
|
@ -190,12 +189,12 @@ public class TaoOrderApiController {
|
|||
*/
|
||||
@RequestMapping("/pull_order_detail")
|
||||
@ResponseBody
|
||||
public AjaxResult getOrderPullDetail(@RequestBody TaoRequest taoRequest) throws IOException {
|
||||
public AjaxResult getOrderPullDetail(@RequestBody OrderPullRequest taoRequest) throws IOException {
|
||||
log.info("/**************主动更新tao订单by number****************/");
|
||||
if (taoRequest.getShopId() == null || taoRequest.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
if (taoRequest.getOrderId() == null || taoRequest.getOrderId() <= 0) {
|
||||
if (StringUtils.isEmpty(taoRequest.getOrderId())) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,缺少orderId");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import cn.qihangerp.common.mq.MqUtils;
|
|||
import cn.qihangerp.model.entity.OShopPullLasttime;
|
||||
import cn.qihangerp.model.entity.OShopPullLogs;
|
||||
import cn.qihangerp.model.entity.TaoRefund;
|
||||
import cn.qihangerp.model.request.RefundPullRequest;
|
||||
import cn.qihangerp.module.service.OShopPullLasttimeService;
|
||||
import cn.qihangerp.module.service.OShopPullLogsService;
|
||||
import cn.qihangerp.module.service.TaoRefundService;
|
||||
import cn.qihangerp.oms.tao.TaoApiCommon;
|
||||
import cn.qihangerp.oms.tao.TaoRequest;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
|
||||
import cn.qihangerp.open.tao.TaoRefundApiHelper;
|
||||
|
|
@ -24,6 +24,7 @@ import lombok.AllArgsConstructor;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
|
@ -52,7 +53,7 @@ public class TaoRefundApiController {
|
|||
*/
|
||||
@RequestMapping("/pull_refund")
|
||||
@ResponseBody
|
||||
public AjaxResult refundOrderPull(@RequestBody TaoRequest taoRequest) throws IOException {
|
||||
public AjaxResult refundOrderPull(@RequestBody RefundPullRequest taoRequest) throws IOException {
|
||||
log.info("/**************主动更新tao退货订单****************/");
|
||||
if (taoRequest.getShopId() == null || taoRequest.getShopId() <= 0) {
|
||||
// return new ApiResult<>(EnumResultVo.ParamsError.getIndex(), "参数错误,没有店铺Id");
|
||||
|
|
@ -172,12 +173,12 @@ public class TaoRefundApiController {
|
|||
|
||||
@RequestMapping("/pull_refund_detail")
|
||||
@ResponseBody
|
||||
public AjaxResult refundDetailPull(@RequestBody TaoRequest taoRequest) throws IOException {
|
||||
public AjaxResult refundDetailPull(@RequestBody RefundPullRequest taoRequest) throws IOException {
|
||||
log.info("/**************主动更新tao退货订单****************/");
|
||||
if (taoRequest.getShopId() == null || taoRequest.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
if (taoRequest.getRefundId() == null || taoRequest.getRefundId() <= 0) {
|
||||
if (StringUtils.isEmpty(taoRequest.getRefundId())) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有refundId");
|
||||
}
|
||||
Date currDateTime = new Date();
|
||||
|
|
@ -196,7 +197,7 @@ public class TaoRefundApiController {
|
|||
String appSecret = checkResult.getData().getAppSecret();
|
||||
|
||||
//获取
|
||||
ApiResultVo<TaoRefundResponse> upResult = TaoRefundApiHelper.pullRefundDetail(taoRequest.getRefundId(), appKey, appSecret, sessionKey);
|
||||
ApiResultVo<TaoRefundResponse> upResult = TaoRefundApiHelper.pullRefundDetail(Long.parseLong(taoRequest.getRefundId()), appKey, appSecret, sessionKey);
|
||||
|
||||
if (upResult.getCode() != 0) {
|
||||
log.info("/**************主动更新tao退货订单:第一次获取结果失败:" + upResult.getMsg() + "****************/");
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
package cn.qihangerp.oms.wei;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Long orderId;//订单编号
|
||||
private Integer pullType;
|
||||
}
|
||||
|
|
@ -5,8 +5,8 @@ import cn.qihangerp.common.ResultVoEnum;
|
|||
import cn.qihangerp.common.enums.HttpStatus;
|
||||
import cn.qihangerp.model.entity.WeiGoods;
|
||||
import cn.qihangerp.model.entity.WeiGoodsSku;
|
||||
import cn.qihangerp.model.request.GoodsPullRequest;
|
||||
import cn.qihangerp.module.service.WeiGoodsService;
|
||||
import cn.qihangerp.oms.wei.PullRequest;
|
||||
import cn.qihangerp.oms.wei.WeiApiCommon;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.WeiGoodsApiService;
|
||||
|
|
@ -33,7 +33,7 @@ public class GoodsApiController {
|
|||
private final WeiGoodsService weiGoodsService;
|
||||
|
||||
@RequestMapping(value = "/pull_goods_list", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||
public AjaxResult pullList(@RequestBody GoodsPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import cn.qihangerp.common.enums.HttpStatus;
|
|||
import cn.qihangerp.model.entity.WeiOrder;
|
||||
import cn.qihangerp.model.entity.WeiOrderItem;
|
||||
import cn.qihangerp.module.service.WeiOrderService;
|
||||
import cn.qihangerp.oms.wei.PullRequest;
|
||||
import cn.qihangerp.oms.wei.WeiApiCommon;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.WeiOrderApiHelper;
|
||||
|
|
@ -15,11 +14,12 @@ import cn.qihangerp.open.wei.model.OrderDetailDeliverInfoAddress;
|
|||
import cn.qihangerp.security.common.BaseController;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.qihangerp.model.request.OrderPullRequest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -37,7 +37,7 @@ public class WeiOrderApiController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/pull_order", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) {
|
||||
public AjaxResult pullList(@RequestBody OrderPullRequest params) {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
@ -154,11 +154,11 @@ public class WeiOrderApiController extends BaseController {
|
|||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_order_detail", method = RequestMethod.POST)
|
||||
public AjaxResult pullDetail(@RequestBody PullRequest params) throws Exception {
|
||||
public AjaxResult pullDetail(@RequestBody OrderPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
if (params.getOrderId()==null || params.getOrderId()==0) {
|
||||
if (StringUtils.isEmpty(params.getOrderId())) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有订单编号");
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ public class WeiOrderApiController extends BaseController {
|
|||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
ApiResultVo<Order> apiResultVo = WeiOrderApiHelper.pullOrderDetail(params.getOrderId(), accessToken);
|
||||
ApiResultVo<Order> apiResultVo = WeiOrderApiHelper.pullOrderDetail(Long.parseLong(params.getOrderId()), accessToken);
|
||||
if(apiResultVo.getCode() == 0) {
|
||||
if (apiResultVo.getData() != null) {
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import cn.qihangerp.common.AjaxResult;
|
|||
import cn.qihangerp.common.ResultVoEnum;
|
||||
import cn.qihangerp.common.enums.HttpStatus;
|
||||
import cn.qihangerp.model.entity.WeiRefund;
|
||||
import cn.qihangerp.model.request.RefundPullRequest;
|
||||
import cn.qihangerp.module.service.WeiRefundService;
|
||||
import cn.qihangerp.oms.wei.PullRequest;
|
||||
import cn.qihangerp.oms.wei.WeiApiCommon;
|
||||
import cn.qihangerp.open.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.WeiRefundApiHelper;
|
||||
|
|
@ -29,7 +29,7 @@ public class WeiRefundApiController extends BaseController {
|
|||
private final WeiRefundService refundService;
|
||||
|
||||
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||
public AjaxResult pullList(@RequestBody RefundPullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package cn.qihangerp.oms.jd;
|
||||
package cn.qihangerp.model.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JdPullRequest {
|
||||
public class GoodsPullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Integer pullType;//拉取类型:0或不传全量;1更新(用于拉取商品的条件)
|
||||
private String orderId;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package cn.qihangerp.model.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderPullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
|
||||
private String orderId;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package cn.qihangerp.model.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RefundPullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private String orderId;
|
||||
private String refundId;
|
||||
private String createTime;
|
||||
private String updateTime;
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
<order-pdd v-if="item.id === 300"></order-pdd>
|
||||
<order-dou v-if="item.id === 400"></order-dou>
|
||||
<order-wei v-if="item.id === 500"></order-wei>
|
||||
<order-offline v-if="item.id === 999"></order-offline>
|
||||
<!-- <order-offline v-if="item.id === 999"></order-offline>-->
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="天猫" name="taoOrder">-->
|
||||
<!-- <order-tao></order-tao>-->
|
||||
|
|
@ -53,7 +53,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
listPlatform({status:0}).then(res => {
|
||||
this.typeList = res.rows;
|
||||
this.typeList = res.rows.filter(x=>x.id!==999);
|
||||
this.activeName = this.typeList[0].code
|
||||
})
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue