优化视频号订单相关功能;测试视频号电子面单打印
This commit is contained in:
parent
54a86c9ea7
commit
d99743e84f
|
|
@ -0,0 +1,9 @@
|
|||
package com.qihang.wei.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PullRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Long orderId;//订单编号
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.qihang.wei.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ShopOrderConfirmBo {
|
||||
private String[] ids;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.qihang.wei.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WeiOrderConfirmBo {
|
||||
private String id;
|
||||
/**
|
||||
* 收货人的姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 收货人的手机号码
|
||||
*/
|
||||
private String telNumber;
|
||||
|
||||
/**
|
||||
* 收货人的电话号码
|
||||
*/
|
||||
private String detailInfo;
|
||||
|
||||
/**
|
||||
* 数据库更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
}
|
||||
|
|
@ -1,18 +1,17 @@
|
|||
package com.qihang.wei.controller;
|
||||
|
||||
import cn.qihangerp.open.wei.bo.GoodsDetailApiBo;
|
||||
import cn.qihangerp.open.wei.bo.GoodsListApiBo;
|
||||
import cn.qihangerp.open.wei.service.GoodsApiService;
|
||||
import cn.qihangerp.open.wei.vo.GoodsDetailVo;
|
||||
import cn.qihangerp.open.wei.vo.GoodsListVo;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.wei.bo.PullRequest;
|
||||
import com.qihang.wei.domain.WeiGoods;
|
||||
import com.qihang.wei.domain.WeiGoodsSku;
|
||||
import com.qihang.wei.openApi.ApiCommon;
|
||||
import com.qihang.wei.openApi.PullRequest;
|
||||
import com.qihang.wei.openApi.bo.GoodsDetailApiBo;
|
||||
import com.qihang.wei.openApi.bo.GoodsListApiBo;
|
||||
import com.qihang.wei.openApi.service.GoodsApiService;
|
||||
import com.qihang.wei.openApi.vo.GoodsDetailVo;
|
||||
import com.qihang.wei.openApi.vo.GoodsListVo;
|
||||
import com.qihang.wei.service.WeiGoodsService;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -30,7 +29,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class GoodsApiController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final WeiApiCommon apiCommon;
|
||||
private final WeiGoodsService weiGoodsService;
|
||||
|
||||
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
||||
|
|
|
|||
|
|
@ -1,26 +1,19 @@
|
|||
package com.qihang.wei.controller;
|
||||
|
||||
import cn.qihangerp.open.wei.OrderApiHelper;
|
||||
import cn.qihangerp.open.wei.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.model.Order;
|
||||
import cn.qihangerp.open.wei.model.OrderDetailDeliverInfoAddress;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.common.mq.MqUtils;
|
||||
import com.qihang.wei.domain.WeiOrder;
|
||||
import com.qihang.wei.domain.WeiOrderItem;
|
||||
import com.qihang.wei.mapper.WeiOrderItemMapper;
|
||||
import com.qihang.wei.openApi.ApiCommon;
|
||||
import com.qihang.wei.openApi.PullRequest;
|
||||
import com.qihang.wei.openApi.bo.CreateTimeRangeBo;
|
||||
import com.qihang.wei.openApi.bo.OrderDetailBo;
|
||||
import com.qihang.wei.openApi.bo.OrderListBo;
|
||||
import com.qihang.wei.openApi.service.OrderApiService;
|
||||
import com.qihang.wei.openApi.vo.OrderDetailVo;
|
||||
import com.qihang.wei.openApi.vo.OrderListVo;
|
||||
import com.qihang.wei.openApi.vo.OrderVoDeliverInfoAddress;
|
||||
import com.qihang.wei.service.WeiOrderService;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import com.qihang.wei.bo.PullRequest;
|
||||
import com.qihang.wei.domain.OmsWeiOrder;
|
||||
import com.qihang.wei.domain.OmsWeiOrderItem;
|
||||
import com.qihang.wei.service.OmsWeiOrderService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
|
@ -28,67 +21,61 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/order")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class OrderApiController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final MqUtils mqUtils;
|
||||
private final WeiOrderService weiOrderService;
|
||||
public class OrderApiController extends BaseController {
|
||||
private final WeiApiCommon apiCommon;
|
||||
private final OmsWeiOrderService weiOrderService;
|
||||
|
||||
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||
/**
|
||||
* 拉取订单
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/pull_order", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
|
||||
Date currDateTime = new Date();
|
||||
long beginTime = System.currentTimeMillis();
|
||||
|
||||
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(),checkResult.getData());
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
String serverUrl = checkResult.getData().getServerUrl();
|
||||
String appKey = checkResult.getData().getAppKey();
|
||||
String appSecret = checkResult.getData().getAppSecret();
|
||||
OrderApiService remoting = RemoteUtil.Remoting(serverUrl, OrderApiService.class);
|
||||
OrderListBo apiBo = new OrderListBo();
|
||||
apiBo.setPage_size(100);
|
||||
CreateTimeRangeBo tbo= new CreateTimeRangeBo();
|
||||
tbo.setStart_time(1710864001L);
|
||||
tbo.setEnd_time(1710917798L);
|
||||
apiBo.setCreate_time_range(tbo);
|
||||
|
||||
OrderListVo orderList = remoting.getOrderList(accessToken, apiBo);
|
||||
if(orderList.getErrcode() == 0) {
|
||||
// String appKey = checkResult.getData().getAppKey();
|
||||
// String appSecret = checkResult.getData().getAppSecret();
|
||||
LocalDateTime endTime = LocalDateTime.now();
|
||||
LocalDateTime startTime = endTime.minusHours(1);
|
||||
ApiResultVo<Order> apiResultVo = OrderApiHelper.pullOrderList(startTime, endTime, accessToken);
|
||||
int insertSuccess = 0;//新增成功的订单
|
||||
int totalError = 0;
|
||||
int hasExistOrder = 0;//已存在的订单数
|
||||
if(apiResultVo.getCode() == 0){
|
||||
if(apiResultVo.getList()!=null) {
|
||||
// 拉取到了数据 拉取详情
|
||||
if(orderList.getOrder_id_list()!=null&&orderList.getOrder_id_list().length>0) {
|
||||
for (var orderId : orderList.getOrder_id_list()) {
|
||||
OrderDetailBo bo = new OrderDetailBo();
|
||||
bo.setOrder_id(orderId.toString());
|
||||
OrderDetailVo orderDetail = remoting.getOrderDetail(accessToken, bo);
|
||||
if(orderDetail.getErrcode() == 0){
|
||||
WeiOrder order = new WeiOrder();
|
||||
order.setOrderId(orderDetail.getOrder().getOrder_id());
|
||||
order.setShopId(params.getShopId());
|
||||
order.setOpenid(orderDetail.getOrder().getOpenid());
|
||||
order.setCreateTime(orderDetail.getOrder().getCreate_time());
|
||||
order.setUpdateTime(orderDetail.getOrder().getUpdate_time());
|
||||
order.setUnionid(orderDetail.getOrder().getUnionid());
|
||||
order.setStatus(orderDetail.getOrder().getStatus());
|
||||
order.setAftersaleDetail(JSONObject.toJSONString(orderDetail.getOrder().getAftersale_detail()));
|
||||
order.setPayInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getPay_info()));
|
||||
order.setProductPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("product_price"));
|
||||
order.setOrderPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("order_price"));
|
||||
order.setFreight(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("freight"));
|
||||
order.setDiscountedPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("discounted_price"));
|
||||
for (var orderInfo : apiResultVo.getList()) {
|
||||
|
||||
OrderVoDeliverInfoAddress addressInfo = orderDetail.getOrder().getOrder_detail().getDelivery_info().getAddress_info();
|
||||
OmsWeiOrder order = new OmsWeiOrder();
|
||||
order.setOrderId(orderInfo.getOrder_id());
|
||||
order.setShopId(params.getShopId());
|
||||
order.setOpenid(orderInfo.getOpenid());
|
||||
order.setCreateTime(orderInfo.getCreate_time());
|
||||
order.setUpdateTime(orderInfo.getUpdate_time());
|
||||
order.setUnionid(orderInfo.getUnionid());
|
||||
order.setStatus(orderInfo.getStatus());
|
||||
order.setAftersaleDetail(JSONObject.toJSONString(orderInfo.getAftersale_detail()));
|
||||
order.setPayInfo(JSONObject.toJSONString(orderInfo.getOrder_detail().getPay_info()));
|
||||
order.setProductPrice(orderInfo.getOrder_detail().getPrice_info().getInteger("product_price"));
|
||||
order.setOrderPrice(orderInfo.getOrder_detail().getPrice_info().getInteger("order_price"));
|
||||
order.setFreight(orderInfo.getOrder_detail().getPrice_info().getInteger("freight"));
|
||||
order.setDiscountedPrice(orderInfo.getOrder_detail().getPrice_info().getInteger("discounted_price"));
|
||||
|
||||
OrderDetailDeliverInfoAddress addressInfo = orderInfo.getOrder_detail().getDelivery_info().getAddress_info();
|
||||
order.setUserName(addressInfo.getUser_name());
|
||||
order.setPostalCode(addressInfo.getPostal_code());
|
||||
order.setProvinceName(addressInfo.getProvince_name());
|
||||
|
|
@ -102,16 +89,18 @@ public class OrderApiController {
|
|||
order.setUseTelNumber(addressInfo.getUse_tel_number());
|
||||
order.setHashCode(addressInfo.getHash_code());
|
||||
|
||||
order.setDeliveryProductInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getDelivery_info().getDelivery_product_info()));
|
||||
order.setDeliveryProductInfo(JSONObject.toJSONString(orderInfo.getOrder_detail().getDelivery_info().getDelivery_product_info()));
|
||||
|
||||
order.setShipDoneTime(orderDetail.getOrder().getOrder_detail().getDelivery_info().getShip_done_time());
|
||||
order.setEwaybillOrderCode(orderDetail.getOrder().getOrder_detail().getDelivery_info().getEwaybill_order_code());
|
||||
order.setShipDoneTime(orderInfo.getOrder_detail().getDelivery_info().getShip_done_time());
|
||||
order.setEwaybillOrderCode(orderInfo.getOrder_detail().getDelivery_info().getEwaybill_order_code());
|
||||
|
||||
order.setSettleInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getSettle_info()));
|
||||
order.setSettleInfo(JSONObject.toJSONString(orderInfo.getOrder_detail().getSettle_info()));
|
||||
|
||||
List<WeiOrderItem> itemList = new ArrayList<>();
|
||||
for (var item:orderDetail.getOrder().getOrder_detail().getProduct_infos()) {
|
||||
WeiOrderItem oi = new WeiOrderItem();
|
||||
List<OmsWeiOrderItem> itemList = new ArrayList<>();
|
||||
for (var item:orderInfo.getOrder_detail().getProduct_infos()) {
|
||||
OmsWeiOrderItem oi = new OmsWeiOrderItem();
|
||||
oi.setOrderId(order.getOrderId());
|
||||
oi.setShopId(params.getShopId());
|
||||
oi.setProductId(item.getProduct_id());
|
||||
oi.setSkuId(item.getSku_id());
|
||||
oi.setThumbImg(item.getThumb_img());
|
||||
|
|
@ -139,18 +128,122 @@ public class OrderApiController {
|
|||
itemList.add(oi);
|
||||
}
|
||||
order.setItems(itemList);
|
||||
weiOrderService.saveOrder(params.getShopId(),order);
|
||||
var result = weiOrderService.saveOrder(params.getShopId(),order);
|
||||
if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||
//已经存在
|
||||
hasExistOrder++;
|
||||
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
insertSuccess++;
|
||||
} else {
|
||||
totalError++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
// 获取最后更新时间
|
||||
LocalDateTime startTime = null;
|
||||
LocalDateTime endTime = null;
|
||||
|
||||
/**
|
||||
* 拉取订单详情
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/pull_order_detail", method = RequestMethod.POST)
|
||||
public AjaxResult pullDetail(@RequestBody PullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
if (params.getOrderId()==null || params.getOrderId()==0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有订单编号");
|
||||
}
|
||||
|
||||
|
||||
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
ApiResultVo<Order> apiResultVo = OrderApiHelper.pullOrderDetail(params.getOrderId(), accessToken);
|
||||
if(apiResultVo.getCode() == 0) {
|
||||
if (apiResultVo.getData() != null) {
|
||||
|
||||
OmsWeiOrder order = new OmsWeiOrder();
|
||||
order.setOrderId(apiResultVo.getData().getOrder_id());
|
||||
order.setShopId(params.getShopId());
|
||||
order.setOpenid(apiResultVo.getData().getOpenid());
|
||||
order.setCreateTime(apiResultVo.getData().getCreate_time());
|
||||
order.setUpdateTime(apiResultVo.getData().getUpdate_time());
|
||||
order.setUnionid(apiResultVo.getData().getUnionid());
|
||||
order.setStatus(apiResultVo.getData().getStatus());
|
||||
order.setAftersaleDetail(JSONObject.toJSONString(apiResultVo.getData().getAftersale_detail()));
|
||||
order.setPayInfo(JSONObject.toJSONString(apiResultVo.getData().getOrder_detail().getPay_info()));
|
||||
order.setProductPrice(apiResultVo.getData().getOrder_detail().getPrice_info().getInteger("product_price"));
|
||||
order.setOrderPrice(apiResultVo.getData().getOrder_detail().getPrice_info().getInteger("order_price"));
|
||||
order.setFreight(apiResultVo.getData().getOrder_detail().getPrice_info().getInteger("freight"));
|
||||
order.setDiscountedPrice(apiResultVo.getData().getOrder_detail().getPrice_info().getInteger("discounted_price"));
|
||||
|
||||
OrderDetailDeliverInfoAddress addressInfo = apiResultVo.getData().getOrder_detail().getDelivery_info().getAddress_info();
|
||||
order.setUserName(addressInfo.getUser_name());
|
||||
order.setPostalCode(addressInfo.getPostal_code());
|
||||
order.setProvinceName(addressInfo.getProvince_name());
|
||||
order.setCityName(addressInfo.getCity_name());
|
||||
order.setCountyName(addressInfo.getCounty_name());
|
||||
order.setDetailInfo(addressInfo.getDetail_info());
|
||||
order.setTelNumber(addressInfo.getTel_number());
|
||||
order.setHouseNumber(addressInfo.getHouse_number());
|
||||
order.setVirtualOrderTelNumber(addressInfo.getVirtual_order_tel_number());
|
||||
order.setTelNumberExtInfo(JSONObject.toJSONString(addressInfo.getTel_number_ext_info()));
|
||||
order.setUseTelNumber(addressInfo.getUse_tel_number());
|
||||
order.setHashCode(addressInfo.getHash_code());
|
||||
|
||||
order.setDeliveryProductInfo(JSONObject.toJSONString(apiResultVo.getData().getOrder_detail().getDelivery_info().getDelivery_product_info()));
|
||||
|
||||
order.setShipDoneTime(apiResultVo.getData().getOrder_detail().getDelivery_info().getShip_done_time());
|
||||
order.setEwaybillOrderCode(apiResultVo.getData().getOrder_detail().getDelivery_info().getEwaybill_order_code());
|
||||
|
||||
order.setSettleInfo(JSONObject.toJSONString(apiResultVo.getData().getOrder_detail().getSettle_info()));
|
||||
|
||||
List<OmsWeiOrderItem> itemList = new ArrayList<>();
|
||||
for (var item : apiResultVo.getData().getOrder_detail().getProduct_infos()) {
|
||||
OmsWeiOrderItem oi = new OmsWeiOrderItem();
|
||||
oi.setOrderId(order.getOrderId());
|
||||
oi.setShopId(params.getShopId());
|
||||
oi.setProductId(item.getProduct_id());
|
||||
oi.setSkuId(item.getSku_id());
|
||||
oi.setThumbImg(item.getThumb_img());
|
||||
oi.setSkuCnt(item.getSku_cnt());
|
||||
oi.setSalePrice(item.getSale_price());
|
||||
oi.setTitle(item.getTitle());
|
||||
oi.setOnAftersaleSkuCnt(item.getOn_aftersale_sku_cnt());
|
||||
oi.setFinishAftersaleSkuCnt(item.getFinish_aftersale_sku_cnt());
|
||||
oi.setSkuCode(item.getSku_code());
|
||||
oi.setMarketPrice(item.getMarket_price());
|
||||
oi.setRealPrice(item.getReal_price());
|
||||
oi.setOutProductId(item.getOut_product_id());
|
||||
oi.setOutSkuId(item.getOut_sku_id());
|
||||
oi.setIsDiscounted(item.getIs_discounted() + "");
|
||||
oi.setEstimatePrice(item.getEstimate_price());
|
||||
oi.setIsChangePrice(item.getIs_change_price() + "");
|
||||
oi.setChangePrice(item.getChange_price());
|
||||
oi.setOutWarehouseId(item.getOut_warehouse_id());
|
||||
oi.setUseDeduction(item.getUse_deduction() + "");
|
||||
|
||||
oi.setSkuAttrs(JSONObject.toJSONString(item.getSku_attrs()));
|
||||
oi.setSkuDeliverInfo(JSONObject.toJSONString(item.getSku_deliver_info()));
|
||||
oi.setExtraService(JSONObject.toJSONString(item.getExtra_service()));
|
||||
oi.setOrderProductCouponInfoList(JSONObject.toJSONString(item.getOrder_product_coupon_info_list()));
|
||||
itemList.add(oi);
|
||||
}
|
||||
order.setItems(itemList);
|
||||
weiOrderService.saveOrder(params.getShopId(), order);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,152 @@
|
|||
//package com.qihang.wei.controller;
|
||||
//
|
||||
//import cn.qihangerp.open.wei.bo.CreateTimeRangeBo;
|
||||
//import cn.qihangerp.open.wei.bo.OrderDetailBo;
|
||||
//import cn.qihangerp.open.wei.bo.OrderListBo;
|
||||
//import cn.qihangerp.open.wei.service.OrderApiService;
|
||||
//import cn.qihangerp.open.wei.vo.OrderDetailVo;
|
||||
//import cn.qihangerp.open.wei.vo.OrderListVo;
|
||||
//import com.alibaba.fastjson2.JSONObject;
|
||||
//import com.qihang.common.common.AjaxResult;
|
||||
//import com.qihang.common.common.ResultVoEnum;
|
||||
//import com.qihang.common.enums.HttpStatus;
|
||||
//import com.qihang.common.mq.MqUtils;
|
||||
//import com.qihang.wei.bo.PullRequest;
|
||||
//import com.qihang.wei.domain.WeiOrder;
|
||||
//import com.qihang.wei.domain.WeiOrderItem;
|
||||
//import com.qihang.wei.service.WeiOrderService;
|
||||
//import com.qihang.wei.utils.RemoteUtil;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//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.open.wei.model.OrderDetailDeliverInfoAddress;
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.Date;
|
||||
//import java.util.List;
|
||||
//
|
||||
//@RequestMapping("/order")
|
||||
//@RestController
|
||||
//@AllArgsConstructor
|
||||
//public class OrderApiController1 {
|
||||
// private final WeiApiCommon apiCommon;
|
||||
// private final MqUtils mqUtils;
|
||||
// private final WeiOrderService weiOrderService;
|
||||
//
|
||||
// @RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
||||
// public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||
// if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
// return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
// }
|
||||
//
|
||||
// Date currDateTime = new Date();
|
||||
// long beginTime = System.currentTimeMillis();
|
||||
//
|
||||
// var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||
// if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
// return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(),checkResult.getData());
|
||||
// }
|
||||
// String accessToken = checkResult.getData().getAccessToken();
|
||||
// String serverUrl = checkResult.getData().getServerUrl();
|
||||
// String appKey = checkResult.getData().getAppKey();
|
||||
// String appSecret = checkResult.getData().getAppSecret();
|
||||
// OrderApiService remoting = RemoteUtil.Remoting(serverUrl, OrderApiService.class);
|
||||
// OrderListBo apiBo = new OrderListBo();
|
||||
// apiBo.setPage_size(100);
|
||||
// CreateTimeRangeBo tbo= new CreateTimeRangeBo();
|
||||
// tbo.setStart_time(1710864001L);
|
||||
// tbo.setEnd_time(1710917798L);
|
||||
// apiBo.setCreate_time_range(tbo);
|
||||
//
|
||||
// OrderListVo orderList = remoting.getOrderList(accessToken, apiBo);
|
||||
// if(orderList.getErrcode() == 0) {
|
||||
// // 拉取到了数据 拉取详情
|
||||
// if(orderList.getOrder_id_list()!=null&&orderList.getOrder_id_list().length>0) {
|
||||
// for (var orderId : orderList.getOrder_id_list()) {
|
||||
// OrderDetailBo bo = new OrderDetailBo();
|
||||
// bo.setOrder_id(orderId.toString());
|
||||
// OrderDetailVo orderDetail = remoting.getOrderDetail(accessToken, bo);
|
||||
// if(orderDetail.getErrcode() == 0){
|
||||
// WeiOrder order = new WeiOrder();
|
||||
// order.setOrderId(orderDetail.getOrder().getOrder_id());
|
||||
// order.setShopId(params.getShopId());
|
||||
// order.setOpenid(orderDetail.getOrder().getOpenid());
|
||||
// order.setCreateTime(orderDetail.getOrder().getCreate_time());
|
||||
// order.setUpdateTime(orderDetail.getOrder().getUpdate_time());
|
||||
// order.setUnionid(orderDetail.getOrder().getUnionid());
|
||||
// order.setStatus(orderDetail.getOrder().getStatus());
|
||||
// order.setAftersaleDetail(JSONObject.toJSONString(orderDetail.getOrder().getAftersale_detail()));
|
||||
// order.setPayInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getPay_info()));
|
||||
// order.setProductPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("product_price"));
|
||||
// order.setOrderPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("order_price"));
|
||||
// order.setFreight(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("freight"));
|
||||
// order.setDiscountedPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("discounted_price"));
|
||||
//
|
||||
// OrderDetailDeliverInfoAddress addressInfo = orderDetail.getOrder().getOrder_detail().getDelivery_info().getAddress_info();
|
||||
// order.setUserName(addressInfo.getUser_name());
|
||||
// order.setPostalCode(addressInfo.getPostal_code());
|
||||
// order.setProvinceName(addressInfo.getProvince_name());
|
||||
// order.setCityName(addressInfo.getCity_name());
|
||||
// order.setCountyName(addressInfo.getCounty_name());
|
||||
// order.setDetailInfo(addressInfo.getDetail_info());
|
||||
// order.setTelNumber(addressInfo.getTel_number());
|
||||
// order.setHouseNumber(addressInfo.getHouse_number());
|
||||
// order.setVirtualOrderTelNumber(addressInfo.getVirtual_order_tel_number());
|
||||
// order.setTelNumberExtInfo(JSONObject.toJSONString(addressInfo.getTel_number_ext_info()));
|
||||
// order.setUseTelNumber(addressInfo.getUse_tel_number());
|
||||
// order.setHashCode(addressInfo.getHash_code());
|
||||
//
|
||||
// order.setDeliveryProductInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getDelivery_info().getDelivery_product_info()));
|
||||
//
|
||||
// order.setShipDoneTime(orderDetail.getOrder().getOrder_detail().getDelivery_info().getShip_done_time());
|
||||
// order.setEwaybillOrderCode(orderDetail.getOrder().getOrder_detail().getDelivery_info().getEwaybill_order_code());
|
||||
//
|
||||
// order.setSettleInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getSettle_info()));
|
||||
//
|
||||
// List<WeiOrderItem> itemList = new ArrayList<>();
|
||||
// for (var item:orderDetail.getOrder().getOrder_detail().getProduct_infos()) {
|
||||
// WeiOrderItem oi = new WeiOrderItem();
|
||||
// oi.setProductId(item.getProduct_id());
|
||||
// oi.setSkuId(item.getSku_id());
|
||||
// oi.setThumbImg(item.getThumb_img());
|
||||
// oi.setSkuCnt(item.getSku_cnt());
|
||||
// oi.setSalePrice(item.getSale_price());
|
||||
// oi.setTitle(item.getTitle());
|
||||
// oi.setOnAftersaleSkuCnt(item.getOn_aftersale_sku_cnt());
|
||||
// oi.setFinishAftersaleSkuCnt(item.getFinish_aftersale_sku_cnt());
|
||||
// oi.setSkuCode(item.getSku_code());
|
||||
// oi.setMarketPrice(item.getMarket_price());
|
||||
// oi.setRealPrice(item.getReal_price());
|
||||
// oi.setOutProductId(item.getOut_product_id());
|
||||
// oi.setOutSkuId(item.getOut_sku_id());
|
||||
// oi.setIsDiscounted(item.getIs_discounted() + "");
|
||||
// oi.setEstimatePrice(item.getEstimate_price());
|
||||
// oi.setIsChangePrice(item.getIs_change_price() + "");
|
||||
// oi.setChangePrice(item.getChange_price());
|
||||
// oi.setOutWarehouseId(item.getOut_warehouse_id());
|
||||
// oi.setUseDeduction(item.getUse_deduction() + "");
|
||||
//
|
||||
// oi.setSkuAttrs(JSONObject.toJSONString(item.getSku_attrs()));
|
||||
// oi.setSkuDeliverInfo(JSONObject.toJSONString(item.getSku_deliver_info()));
|
||||
// oi.setExtraService(JSONObject.toJSONString(item.getExtra_service()));
|
||||
// oi.setOrderProductCouponInfoList(JSONObject.toJSONString(item.getOrder_product_coupon_info_list()));
|
||||
// itemList.add(oi);
|
||||
// }
|
||||
// order.setItems(itemList);
|
||||
// weiOrderService.saveOrder(params.getShopId(),order);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// // 获取最后更新时间
|
||||
// LocalDateTime startTime = null;
|
||||
// LocalDateTime endTime = null;
|
||||
//
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.qihang.wei.controller;
|
||||
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.TableDataInfo;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import com.qihang.wei.bo.WeiOrderConfirmBo;
|
||||
import com.qihang.wei.domain.OmsWeiOrder;
|
||||
import com.qihang.wei.service.OmsWeiOrderService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/order")
|
||||
public class OrderController extends BaseController {
|
||||
private final OmsWeiOrderService orderService;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo orderList(OmsWeiOrder bo, PageQuery pageQuery) {
|
||||
PageResult<OmsWeiOrder> result = orderService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(orderService.queryDetailById(id));
|
||||
}
|
||||
|
||||
// @PostMapping("/confirm")
|
||||
// @ResponseBody
|
||||
// public AjaxResult orderConfirm(@RequestBody ShopOrderConfirmBo bo) {
|
||||
// if(bo!=null && bo.getIds()!=null) {
|
||||
// ResultVo<Integer> resultVo = orderService.orderConfirm(bo.getIds());
|
||||
//
|
||||
// return success(resultVo.getData());
|
||||
// }else{
|
||||
// return AjaxResult.error("没有选择任何订单!");
|
||||
// }
|
||||
// }
|
||||
|
||||
@PostMapping("/confirmOrder")
|
||||
public AjaxResult confirmOrder(@RequestBody WeiOrderConfirmBo bo) throws InterruptedException {
|
||||
int result = orderService.confirmOrder(bo);
|
||||
if(result == -1) return new AjaxResult(501,"已确认过了!请勿重复确认!");
|
||||
else if(result == -2) return new AjaxResult(502,"订单已存在!请勿重复确认!");
|
||||
else if(result == -3) return new AjaxResult(503,"请指定发货方式!");
|
||||
else if(result == -4) return new AjaxResult(504,"发货方式不支持!");
|
||||
else if(result == -11) return new AjaxResult(511,"商品SKU编码不存在!");
|
||||
else if(result == -12) return new AjaxResult(512,"商品信息不存在!");
|
||||
|
||||
|
||||
return toAjax(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.qihang.wei.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.open.wei.TokenApiHelper;
|
||||
import cn.qihangerp.open.wei.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.vo.ShopApiParams;
|
||||
import cn.qihangerp.open.wei.vo.Token;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.wei.service.SShopService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Component
|
||||
public class WeiApiCommon {
|
||||
private final SShopService shopService;
|
||||
/**
|
||||
* 更新前的检查
|
||||
*
|
||||
* @param shopId
|
||||
* @return
|
||||
* @throws
|
||||
*/
|
||||
public ResultVo<ShopApiParams> checkBefore(Long shopId) {
|
||||
var shop = shopService.selectShopById(shopId);
|
||||
if (shop == null) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR,"参数错误,没有找到店铺");
|
||||
}
|
||||
if (shop.getType() != EnumShopType.WEI.getIndex()) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是JD店铺");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppkey())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppsercet())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
||||
}
|
||||
// var platform =skuService.selectShopSettingById(EnumShopType.WEI.getIndex());
|
||||
// if(!StringUtils.hasText(platform.getse())) {
|
||||
// return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||
// }
|
||||
|
||||
ShopApiParams params = new ShopApiParams();
|
||||
params.setAppKey(shop.getAppkey());
|
||||
params.setAppSecret(shop.getAppsercet());
|
||||
params.setAccessToken(shop.getSessionkey());
|
||||
params.setApiRequestUrl(shop.getApiRequestUrl());
|
||||
// params.setServerUrl(platform.getServerUrl());
|
||||
params.setSellerId(shop.getSelleruserid().toString());
|
||||
|
||||
|
||||
if (!StringUtils.hasText(params.getAccessToken())) {
|
||||
ApiResultVo<Token> token1 = TokenApiHelper.getToken(params.getAppKey(), params.getAppSecret());
|
||||
if(token1.getCode()==0){
|
||||
params.setAccessToken(token1.getData().getAccess_token());
|
||||
shopService.updateSessionKey(shopId, params.getAccessToken());
|
||||
return ResultVo.success(params);
|
||||
}else{
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, token1.getMsg());
|
||||
}
|
||||
}else {
|
||||
// 调用 店铺基本信息接口 验证Token
|
||||
ApiResultVo<Token> tokenApiResultVo = TokenApiHelper.checkToken(params.getAppKey(), params.getAppSecret(), params.getAccessToken());
|
||||
if(tokenApiResultVo.getCode()==0){
|
||||
// params.setAccessToken(tokenApiResultVo.getData().getAccess_token());
|
||||
// skuService.updateShopSessionByShopId(shopId, params.getAccessToken());
|
||||
return ResultVo.success(params);
|
||||
}else {
|
||||
ApiResultVo<Token> token2 = TokenApiHelper.getToken(params.getAppKey(), params.getAppSecret());
|
||||
if (token2.getCode() == 0) {
|
||||
params.setAccessToken(token2.getData().getAccess_token());
|
||||
shopService.updateSessionKey(shopId, params.getAccessToken());
|
||||
return ResultVo.success(params);
|
||||
} else {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, token2.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,16 +7,10 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.wei.bo.PullRequest;
|
||||
import com.qihang.wei.domain.WeiGoods;
|
||||
import com.qihang.wei.domain.WeiGoodsSku;
|
||||
import com.qihang.wei.openApi.ApiCommon;
|
||||
import com.qihang.wei.openApi.PullRequest;
|
||||
import com.qihang.wei.openApi.bo.GoodsDetailApiBo;
|
||||
import com.qihang.wei.openApi.bo.GoodsListApiBo;
|
||||
import com.qihang.wei.openApi.service.GoodsApiService;
|
||||
import com.qihang.wei.openApi.vo.GoodsDetailVo;
|
||||
import com.qihang.wei.openApi.vo.GoodsListVo;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
|
@ -32,7 +26,7 @@ import java.util.List;
|
|||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class eWayBillController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final WeiApiCommon apiCommon;
|
||||
@RequestMapping(value = "/get_deliver_list", method = RequestMethod.POST)
|
||||
public AjaxResult getDeliverList(@RequestBody PullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
|
|
@ -50,7 +44,7 @@ public class eWayBillController {
|
|||
String appKey = checkResult.getData().getAppKey();
|
||||
String appSecret = checkResult.getData().getAppSecret();
|
||||
|
||||
ApiResultVo<DeliveryVo> apiResultVo = EwaybillApiHelper.pullDeliveryList(appKey, appSecret, accessToken);
|
||||
ApiResultVo<DeliveryVo> apiResultVo = EwaybillApiHelper.getDeliveryList(appKey, appSecret, accessToken);
|
||||
|
||||
|
||||
return AjaxResult.success(apiResultVo.getList());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName oms_wei_goods
|
||||
*/
|
||||
@Data
|
||||
public class OmsWeiGoods implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 平台商品id
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 商家编码id
|
||||
*/
|
||||
private String outProductId;
|
||||
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String subTitle;
|
||||
|
||||
/**
|
||||
* 主图集合
|
||||
*/
|
||||
private String headImgs;
|
||||
|
||||
/**
|
||||
* 第一张主图
|
||||
*/
|
||||
private String headImg;
|
||||
|
||||
/**
|
||||
* 商品详情字符串
|
||||
*/
|
||||
private String descInfo;
|
||||
|
||||
/**
|
||||
* 属性字符串
|
||||
*/
|
||||
private String attrs;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 编辑状态
|
||||
*/
|
||||
private Integer editStatus;
|
||||
|
||||
/**
|
||||
* 商品 SKU 最小价格(单位:分)
|
||||
*/
|
||||
private Integer minPrice;
|
||||
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
private String spuCode;
|
||||
|
||||
/**
|
||||
* 商品类型。1: 小店普通自营商品;2: 福袋抽奖商品;3: 直播间闪电购商品。注意: 福袋抽奖、直播间闪电购类型的商品为只读数据,不支持编辑、上架操作,不支持用data_type=2的参数获取。
|
||||
*/
|
||||
private Integer productType;
|
||||
|
||||
/**
|
||||
* 商品草稿最近一次修改时间
|
||||
*/
|
||||
private Integer editTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName oms_wei_goods_sku
|
||||
*/
|
||||
@Data
|
||||
public class OmsWeiGoodsSku implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* skuID
|
||||
*/
|
||||
private String skuId;
|
||||
|
||||
/**
|
||||
* 商家自定义skuID。如果添加时没录入,回包可能不包含该字段
|
||||
*/
|
||||
private String outSkuId;
|
||||
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* sku小图
|
||||
*/
|
||||
private String thumbImg;
|
||||
|
||||
/**
|
||||
* 售卖价格,以分为单位
|
||||
*/
|
||||
private Integer salePrice;
|
||||
|
||||
/**
|
||||
* sku库存
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
* sku编码
|
||||
*/
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* sku状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* sku属性
|
||||
*/
|
||||
private String skuAttr;
|
||||
|
||||
/**
|
||||
* sku_attrs
|
||||
*/
|
||||
private String skuAttrs;
|
||||
|
||||
/**
|
||||
* sku_deliver_info
|
||||
*/
|
||||
private String skuDeliverInfo;
|
||||
|
||||
/**
|
||||
* erp系统商品id
|
||||
*/
|
||||
private Long erpGoodsId;
|
||||
|
||||
/**
|
||||
* erp系统商品skuid
|
||||
*/
|
||||
private Long erpGoodsSkuId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName oms_wei_order
|
||||
*/
|
||||
@Data
|
||||
public class OmsWeiOrder implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 买家身份标识
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 秒级时间戳
|
||||
*/
|
||||
private Integer createTime;
|
||||
|
||||
/**
|
||||
* 秒级时间戳
|
||||
*/
|
||||
private Integer updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String unionid;
|
||||
|
||||
/**
|
||||
* 状态10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 售后信息json
|
||||
*/
|
||||
private String aftersaleDetail;
|
||||
|
||||
/**
|
||||
* 支付信息json
|
||||
*/
|
||||
private String payInfo;
|
||||
|
||||
/**
|
||||
* 商品总价,单位为分
|
||||
*/
|
||||
private Integer productPrice;
|
||||
|
||||
/**
|
||||
* 订单金额,单位为分,order_price=original_order_price-discounted_price-deduction_price-change_down_price
|
||||
*/
|
||||
private Integer orderPrice;
|
||||
|
||||
/**
|
||||
* 运费,单位为分
|
||||
*/
|
||||
private Integer freight;
|
||||
|
||||
/**
|
||||
* 优惠券优惠金额,单位为分
|
||||
*/
|
||||
private Integer discountedPrice;
|
||||
|
||||
/**
|
||||
* 收货人姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
private String postalCode;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String provinceName;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String cityName;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String countyName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
private String detailInfo;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
|
||||
*/
|
||||
private String telNumber;
|
||||
|
||||
/**
|
||||
* 门牌号码
|
||||
*/
|
||||
private String houseNumber;
|
||||
|
||||
/**
|
||||
* 虚拟发货订单联系方式(deliver_method=1时返回)
|
||||
*/
|
||||
private String virtualOrderTelNumber;
|
||||
|
||||
/**
|
||||
* 额外的联系方式信息(虚拟号码相关)
|
||||
*/
|
||||
private String telNumberExtInfo;
|
||||
|
||||
/**
|
||||
* 0:不使用虚拟号码,1:使用虚拟号码
|
||||
*/
|
||||
private Integer useTelNumber;
|
||||
|
||||
/**
|
||||
* 标识当前店铺下一个唯一的用户收货地址
|
||||
*/
|
||||
private String hashCode;
|
||||
|
||||
/**
|
||||
* 发货物流信息JSON
|
||||
*/
|
||||
private String deliveryProductInfo;
|
||||
|
||||
/**
|
||||
* 发货完成时间,秒级时间戳
|
||||
*/
|
||||
private Integer shipDoneTime;
|
||||
|
||||
/**
|
||||
* 电子面单代发时的订单密文
|
||||
|
||||
*/
|
||||
private String ewaybillOrderCode;
|
||||
|
||||
/**
|
||||
* 结算信息json
|
||||
*/
|
||||
private String settleInfo;
|
||||
|
||||
/**
|
||||
* 订单审核状态(0待审核1已审核)
|
||||
*/
|
||||
private Integer auditStatus;
|
||||
|
||||
/**
|
||||
* 订单审核时间
|
||||
*/
|
||||
private Date auditTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<OmsWeiOrderItem> items;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName oms_wei_order_item
|
||||
*/
|
||||
@Data
|
||||
public class OmsWeiOrderItem implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单id(平台订单id)
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商品spuid
|
||||
*/
|
||||
private String productId;
|
||||
|
||||
/**
|
||||
* 商品skuid
|
||||
|
||||
*/
|
||||
private String skuId;
|
||||
|
||||
/**
|
||||
* sku小图
|
||||
*/
|
||||
private String thumbImg;
|
||||
|
||||
/**
|
||||
* sku数量
|
||||
*/
|
||||
private Integer skuCnt;
|
||||
|
||||
/**
|
||||
* 售卖单价(单位:分)
|
||||
*/
|
||||
private Integer salePrice;
|
||||
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 正在售后/退款流程中的 sku 数量
|
||||
*/
|
||||
private Integer onAftersaleSkuCnt;
|
||||
|
||||
/**
|
||||
* 完成售后/退款的 sku 数量
|
||||
*/
|
||||
private Integer finishAftersaleSkuCnt;
|
||||
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
private String skuCode;
|
||||
|
||||
/**
|
||||
* 市场单价(单位:分)
|
||||
*/
|
||||
private Integer marketPrice;
|
||||
|
||||
/**
|
||||
* sku属性JSON
|
||||
*/
|
||||
private String skuAttrs;
|
||||
|
||||
/**
|
||||
* sku实付总价,取estimate_price和change_price中较小值
|
||||
*/
|
||||
private Integer realPrice;
|
||||
|
||||
/**
|
||||
* 商品外部spuid
|
||||
*/
|
||||
private String outProductId;
|
||||
|
||||
/**
|
||||
* 商品外部skuid
|
||||
*/
|
||||
private String outSkuId;
|
||||
|
||||
/**
|
||||
* 是否有优惠金额,非必填,默认为false
|
||||
*/
|
||||
private String isDiscounted;
|
||||
|
||||
/**
|
||||
* 优惠后sku总价,非必填,is_discounted为true时有值
|
||||
*/
|
||||
private Integer estimatePrice;
|
||||
|
||||
/**
|
||||
* 是否修改过价格,非必填,默认为false
|
||||
*/
|
||||
private String isChangePrice;
|
||||
|
||||
/**
|
||||
* 改价后sku总价,非必填,is_change_price为true时有值
|
||||
*/
|
||||
private Integer changePrice;
|
||||
|
||||
/**
|
||||
* 区域库存id
|
||||
*/
|
||||
private String outWarehouseId;
|
||||
|
||||
/**
|
||||
* 商品发货信息JSON
|
||||
*/
|
||||
private String skuDeliverInfo;
|
||||
|
||||
/**
|
||||
* 商品额外服务信息JSON
|
||||
*/
|
||||
private String extraService;
|
||||
|
||||
/**
|
||||
* 是否使用了会员积分抵扣
|
||||
|
||||
*/
|
||||
private String useDeduction;
|
||||
|
||||
/**
|
||||
* 会员积分抵扣金额,单位为分
|
||||
*/
|
||||
private Integer deductionPrice;
|
||||
|
||||
/**
|
||||
* 商品优惠券信息,逐步替换 order.order_detail.coupon_info
|
||||
*/
|
||||
private String orderProductCouponInfoList;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ public class SShop implements Serializable {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺名
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ public class WeiGoods implements Serializable {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private Integer shopId;
|
||||
private String id;
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 平台商品id
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class WeiOrder implements Serializable {
|
|||
*
|
||||
*/
|
||||
private Long id;
|
||||
private Integer shopId;
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiGoods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
* @Entity com.qihang.wei.domain.OmsWeiGoods
|
||||
*/
|
||||
public interface OmsWeiGoodsMapper extends BaseMapper<OmsWeiGoods> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods_sku】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
* @Entity com.qihang.wei.domain.OmsWeiGoodsSku
|
||||
*/
|
||||
public interface OmsWeiGoodsSkuMapper extends BaseMapper<OmsWeiGoodsSku> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiOrderItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order_item】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
* @Entity com.qihang.wei.domain.OmsWeiOrderItem
|
||||
*/
|
||||
public interface OmsWeiOrderItemMapper extends BaseMapper<OmsWeiOrderItem> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
* @Entity com.qihang.wei.domain.OmsWeiOrder
|
||||
*/
|
||||
public interface OmsWeiOrderMapper extends BaseMapper<OmsWeiOrder> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
package com.qihang.wei.openApi;
|
||||
|
||||
import com.qihang.common.api.ShopApiParams;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
|
||||
import com.qihang.wei.openApi.service.ShopInfoApiService;
|
||||
import com.qihang.wei.openApi.service.TokenApiService;
|
||||
import com.qihang.wei.openApi.vo.ShopApiResultVo;
|
||||
import com.qihang.wei.openApi.vo.Token;
|
||||
import com.qihang.wei.service.SShopService;
|
||||
import com.qihang.wei.service.SShopSettingService;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Component
|
||||
public class ApiCommon {
|
||||
private final SShopService shopService;
|
||||
private final SShopSettingService platformService;
|
||||
/**
|
||||
* 更新前的检查
|
||||
*
|
||||
* @param shopId
|
||||
* @return
|
||||
* @throws
|
||||
*/
|
||||
public ResultVo<ShopApiParams> checkBefore(Integer shopId) {
|
||||
var shop = shopService.selectShopById(shopId);
|
||||
if (shop == null) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR,"参数错误,没有找到店铺");
|
||||
}
|
||||
if (shop.getType() != EnumShopType.WEI.getIndex()) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是视频号店铺");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppkey())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppsercet())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
||||
}
|
||||
var platform =platformService.getById(EnumShopType.WEI.getIndex());
|
||||
if(!StringUtils.hasText(platform.getRequestUrl())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||
}
|
||||
|
||||
ShopApiParams params = new ShopApiParams();
|
||||
params.setAppKey(shop.getAppkey());
|
||||
params.setAppSecret(shop.getAppsercet());
|
||||
params.setAccessToken(shop.getSessionkey());
|
||||
params.setApiRequestUrl(shop.getApiRequestUrl());
|
||||
params.setServerUrl(platform.getRequestUrl());
|
||||
params.setSellerId(shop.getSelleruserid().toString());
|
||||
if (!StringUtils.hasText(shop.getSessionkey())) {
|
||||
// String s = "/token?grant_type=client_credential&appid="+params.getAppKey()+"&secret="+params.getAppSecret();
|
||||
TokenApiService remoting = RemoteUtil.Remoting(params.getServerUrl(), TokenApiService.class);
|
||||
Token token = remoting.getToken("client_credential",params.getAppKey(),params.getAppSecret());
|
||||
params.setAccessToken(token.getAccess_token());
|
||||
shopService.updateSessionKey(shopId,token.getAccess_token());
|
||||
}else {
|
||||
// 调用 店铺基本信息接口 验证Token
|
||||
ShopInfoApiService remoting = RemoteUtil.Remoting(params.getServerUrl(), ShopInfoApiService.class);
|
||||
ShopApiResultVo shopInfo = remoting.getShopInfo(params.getAccessToken());
|
||||
if(shopInfo.getErrcode() == 42001){
|
||||
// Token过期
|
||||
TokenApiService remoting1 = RemoteUtil.Remoting(params.getServerUrl(), TokenApiService.class);
|
||||
Token token = remoting1.getToken("client_credential",params.getAppKey(),params.getAppSecret());
|
||||
if(token.getErrcode()==null) {
|
||||
params.setAccessToken(token.getAccess_token());
|
||||
shopService.updateSessionKey(shopId, token.getAccess_token());
|
||||
}else{
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, token.getErrmsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResultVo.success(params);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,231 +0,0 @@
|
|||
//package com.qihang.wei.openApi;
|
||||
//
|
||||
//import com.qihang.common.common.ApiResult;
|
||||
//import com.qihang.common.enums.HttpStatus;
|
||||
//
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import org.springframework.beans.BeanUtils;
|
||||
//
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.time.format.DateTimeFormatter;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//
|
||||
//public class OrderApiHelper {
|
||||
// private static Logger log = LoggerFactory.getLogger(OrderApiHelper.class);
|
||||
//
|
||||
// private static final String ORDER_FIELDS = "venderId,orderId,orderType,payType,orderTotalPrice,orderSellerPrice,orderPayment,freightPrice,sellerDiscount,orderState,orderStateRemark,deliveryType,invoiceCode,orderRemark,orderStartTime,orderEndTime,venderRemark,balanceUsed,pin,returnOrder,paymentConfirmTime,waybill,logisticsId,modified,directParentOrderId,parentOrderId,orderSource,storeOrder,realPin,open_id,open_id_buyer,invoiceInfo,invoiceEasyInfo,itemInfoList,isShipmenttype,scDT,idSopShipmenttype,orderStartTime,consigneeInfo,orderMarkDesc";
|
||||
//
|
||||
// /**
|
||||
// * 更新订单(循环分页)
|
||||
// *
|
||||
// * @param pageNo
|
||||
// * @param pageSize
|
||||
// * @param accessToken
|
||||
// * @return
|
||||
// */
|
||||
// public static ApiResult<JdOrder> pullOrder(LocalDateTime startTime,LocalDateTime endTime,Long pageNo, Long pageSize, String serverUrl, String appKey, String appSecret, String accessToken) throws Exception {
|
||||
// String startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
// String endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
//
|
||||
// log.info("=======开始全量JD拉取订单{},参数日期:{}-{}=========",LocalDateTime.now(),startTimeStr,endTimeStr);
|
||||
//
|
||||
// JdClient client=new DefaultJdClient(serverUrl,accessToken,appKey,appSecret);
|
||||
// PopOrderEnSearchRequest request =new PopOrderEnSearchRequest();
|
||||
// request.setStartDate(startTimeStr);
|
||||
// request.setEndDate(endTimeStr);
|
||||
//// request.setOrderState("WAIT_SELLER_STOCK_OUT,WAIT_GOODS_RECEIVE_CONFIRM,WAIT_SELLER_DELIVERY,PAUSE,FINISHED_L,TRADE_CANCELED,LOCKED,POP_ORDER_PAUSE");
|
||||
//// request.setOrderState("");
|
||||
// request.setOrderState("ALL");
|
||||
//// request.setOptionalFields("orderId,venderId");
|
||||
//// request.setSourceId("JOS");
|
||||
// request.setOptionalFields(ORDER_FIELDS);
|
||||
// request.setPage(pageNo.toString());
|
||||
// request.setPageSize(pageSize.toString());
|
||||
// request.setSortType(1);
|
||||
// request.setDateType(0);
|
||||
// PopOrderEnSearchResponse response=client.execute(request);
|
||||
// if(response.getSearchorderinfoResult() == null || response.getSearchorderinfoResult().getApiResult() == null) {
|
||||
// return ApiResult.build(HttpStatus.ERROR, "接口调用错误" );
|
||||
// }
|
||||
// if(!response.getSearchorderinfoResult().getApiResult().getSuccess()){
|
||||
// return ApiResult.build(HttpStatus.ERROR, "接口调用错误:"+ response.getSearchorderinfoResult().getApiResult().getChineseErrCode());
|
||||
// }
|
||||
// if(response.getSearchorderinfoResult().getOrderTotal() == 0){
|
||||
// return ApiResult.build(0, new ArrayList<>());
|
||||
// }
|
||||
// //组合的订单列表
|
||||
// List<JdOrder> orderList = new ArrayList<>();
|
||||
//
|
||||
// for (var trade : response.getSearchorderinfoResult().getOrderInfoList()) {
|
||||
// //组装订单
|
||||
//// var order = OrderAssembleHelper.assembleOrder(trade);
|
||||
// JdOrder order = new JdOrder();
|
||||
// BeanUtils.copyProperties(trade,order);
|
||||
// order.setProvince(trade.getConsigneeInfo().getProvince());
|
||||
// order.setProvinceId(trade.getConsigneeInfo().getProvinceId());
|
||||
// order.setCity(trade.getConsigneeInfo().getCity());
|
||||
// order.setCityId(trade.getConsigneeInfo().getCityId());
|
||||
// order.setCounty(trade.getConsigneeInfo().getCounty());
|
||||
// order.setCountyId(trade.getConsigneeInfo().getCountyId());
|
||||
// order.setTown(trade.getConsigneeInfo().getTown());
|
||||
// order.setTownId(trade.getConsigneeInfo().getTownId());
|
||||
// order.setFullAddress(trade.getConsigneeInfo().getFullAddress());
|
||||
// order.setFullname(trade.getConsigneeInfo().getFullname());
|
||||
// order.setTelephone(trade.getConsigneeInfo().getTelephone());
|
||||
// order.setMobile(trade.getConsigneeInfo().getMobile());
|
||||
// List<JdOrderItem> items = new ArrayList<>();
|
||||
// for (var item : trade.getItemInfoList()) {
|
||||
// JdOrderItem it = new JdOrderItem();
|
||||
// BeanUtils.copyProperties(item,it);
|
||||
// items.add(it);
|
||||
// }
|
||||
// order.setItems(items);
|
||||
//// order.setOrderId(trade.getOrderId());
|
||||
//// order.setVenderId(trade.getVenderId());
|
||||
//// order.setOrderType(trade.getOrderType());
|
||||
//// order.setPayType(trade.getPayType());
|
||||
//// order.setOrderTotalPrice(trade.getOrderTotalPrice());
|
||||
//// order.setOrderSellerPrice(trade.getOrderSellerPrice());
|
||||
//// order.setOrderPayment(trade.getOrderPayment());
|
||||
//// order.setFreightPrice(trade.getFreightPrice());
|
||||
//
|
||||
//
|
||||
// orderList.add(order);
|
||||
// }
|
||||
//
|
||||
// return ApiResult.build(response.getSearchorderinfoResult().getOrderTotal(), orderList);
|
||||
//
|
||||
//
|
||||
//// TradesSoldGetRequest req = new TradesSoldGetRequest();
|
||||
//// req.setFields(ORDER_FIELDS);
|
||||
////// req.setStartCreated(DateUtil.stringtoDate("2019-11-27 00:00:00"));
|
||||
////// req.setEndCreated(DateUtil.stringtoDate("2019-12-04 23:59:59"));
|
||||
////// req.setStatus("WAIT_SELLER_SEND_GOODS");
|
||||
////// req.setBuyerNick("美丽的你美丽的我");
|
||||
//// req.setType("fixed");//一口价
|
||||
////// req.setExtType("service");
|
||||
////// req.setRateStatus("RATE_UNBUYER");
|
||||
////// req.setTag("time_card");
|
||||
//// req.setPageNo(pageNo);
|
||||
//// req.setPageSize(pageSize);
|
||||
////// req.setUseHasNext(true);
|
||||
////// req.setBuyerOpenId("AAHm5d-EAAeGwJedwSHpg8bT");
|
||||
//// TradesSoldGetResponse rsp = client.execute(req, sessionKey);
|
||||
////// System.out.println(rsp.getBody());
|
||||
//// if(StringUtils.hasText(rsp.getErrorCode())){
|
||||
//// if(rsp.getErrorCode().equals("27")){
|
||||
////// return new ApiResult(HttpStatus.UNAUTHORIZED, "Token已过期,请重新授权");
|
||||
//// return ApiResult.build(HttpStatus.UNAUTHORIZED, "Token已过期,请重新授权");
|
||||
//// }
|
||||
//// }
|
||||
//// if (rsp.getTrades() == null) {
|
||||
//// //接口查询错误
|
||||
////// return new ApiResult(500, "接口调用错误:" + rsp.getMsg() + rsp.getSubMsg());
|
||||
//// return ApiResult.build(HttpStatus.ERROR, "接口调用错误:" + rsp.getMsg() + rsp.getSubMsg());
|
||||
//// }
|
||||
////
|
||||
//// //组合的订单列表
|
||||
//// List<TaoOrder> orderList = new ArrayList<>();
|
||||
////
|
||||
//// //有数据
|
||||
//// for (var trade : rsp.getTrades()) {
|
||||
//// try {
|
||||
//// //组装订单
|
||||
//// var order = OrderAssembleHelper.assembleOrder(trade);
|
||||
////
|
||||
////// TopOaidDecryptRequest req1 = new TopOaidDecryptRequest();
|
||||
////// List<TopOaidDecryptRequest.ReceiverQuery> list2 = new ArrayList<TopOaidDecryptRequest.ReceiverQuery>();
|
||||
//////
|
||||
////// TopOaidDecryptRequest.ReceiverQuery obj3 = new TopOaidDecryptRequest.ReceiverQuery();
|
||||
////// list2.add(obj3);
|
||||
////// obj3.setOaid("1bhibPTekQ9Vico6BCjHicSUS6j5e9RRZkeyPzqeo41ibibkp5UTVZQC2wdLEQ0BssjpbscJyZy");
|
||||
////// obj3.setTid("3796207345637527441");
|
||||
////// obj3.setScene("1006");
|
||||
////// obj3.setSecretNoDays(15L);
|
||||
//////
|
||||
////// req1.setQueryList(list2);
|
||||
////// TopOaidDecryptResponse rsp1 = client.execute(req1, sessionKey);
|
||||
////// System.out.println(rsp1.getBody());
|
||||
////
|
||||
//// orderList.add(order);
|
||||
////
|
||||
//// } catch (Exception e) {
|
||||
//// }
|
||||
//// }
|
||||
//
|
||||
//// return new ApiResult(rsp.getTotalResults().intValue(), orderList);
|
||||
//// return ApiResult.build(0, new ArrayList<>());
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 增量获取淘宝开放平台天猫订单
|
||||
// *
|
||||
// * @param pageNo
|
||||
// * @param pageSize
|
||||
// * @param sessionKey
|
||||
// * @return
|
||||
// * @throws ApiException
|
||||
// */
|
||||
//// public static ApiResult<TaoOrder> pullIncrementOrder(Long pageNo, Long pageSize, String url, String appKey, String appSecret, String sessionKey) throws ApiException {
|
||||
//// log.info("=======开增量拉取订单{}=========",LocalDateTime.now());
|
||||
//// // 取当前时间30分钟前
|
||||
//// LocalDateTime endTime = LocalDateTime.now();
|
||||
//// LocalDateTime startTime = endTime.minus(60*24, ChronoUnit.MINUTES);
|
||||
////
|
||||
////
|
||||
//// TaobaoClient client = new DefaultTaobaoClient(url, appKey, appSecret);
|
||||
//// TradesSoldIncrementGetRequest req = new TradesSoldIncrementGetRequest();
|
||||
//// req.setFields(ORDER_FIELDS);
|
||||
////
|
||||
//// req.setStartModified(Date.from(startTime.toInstant(ZoneOffset.UTC)));
|
||||
//// req.setEndModified(Date.from(endTime.toInstant(ZoneOffset.UTC)));
|
||||
//// req.setType("fixed");//一口价
|
||||
////// req.setExtType("service");
|
||||
////// req.setRateStatus("RATE_UNBUYER");
|
||||
////// req.setTag("time_card");
|
||||
//// req.setPageNo(pageNo);
|
||||
//// req.setPageSize(pageSize);
|
||||
//// req.setUseHasNext(true);
|
||||
////// req.setUseHasNext(true);
|
||||
////// req.setBuyerOpenId("AAHm5d-EAAeGwJedwSHpg8bT");
|
||||
//// TradesSoldIncrementGetResponse rsp = client.execute(req, sessionKey);
|
||||
////
|
||||
////
|
||||
//// if (rsp.getTrades() == null) {
|
||||
//// if (!StringUtils.isEmpty(rsp.getErrorCode())) {
|
||||
//// //接口查询错误
|
||||
////// return new ApiResult(500, "接口调用错误:" + rsp.getMsg() + rsp.getSubMsg());
|
||||
//// return ApiResult.build(HttpStatus.ERROR,"接口调用错误:" + rsp.getMsg() + rsp.getSubMsg());
|
||||
//// }
|
||||
//// log.info("========增量拉取订单:无订单,{}==========",LocalDateTime.now());
|
||||
////// return new ApiResult(0, new ArrayList());
|
||||
//// return ApiResult.build(0,new ArrayList<>());
|
||||
//// }
|
||||
////
|
||||
//// //组合的订单列表
|
||||
//// List<TaoOrder> orderList = new ArrayList<>();
|
||||
//// //有数据
|
||||
//// for (var trade : rsp.getTrades()) {
|
||||
//// //组装订单
|
||||
//// orderList.add(OrderAssembleHelper.assembleOrder(trade));
|
||||
//// }
|
||||
//// // 有分页,继续拉取
|
||||
//// while (rsp.getHasNext()) {
|
||||
//// pageNo++;
|
||||
//// req.setPageNo(pageNo);
|
||||
//// rsp = client.execute(req, sessionKey);
|
||||
//// //有数据
|
||||
//// for (var trade : rsp.getTrades()) {
|
||||
//// //组装订单
|
||||
//// orderList.add(OrderAssembleHelper.assembleOrder(trade));
|
||||
//// }
|
||||
//// }
|
||||
////// return new ApiResult(orderList.size(), orderList);
|
||||
//// return ApiResult.build(orderList.size(),orderList);
|
||||
//// }
|
||||
//
|
||||
// }
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.qihang.wei.openApi;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PullRequest {
|
||||
private Integer shopId;//店铺Id
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package com.qihang.wei.openApi.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CreateTimeRangeBo {
|
||||
private Long start_time;
|
||||
private Long end_time;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.qihang.wei.openApi.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GoodsDetailApiBo {
|
||||
private Integer data_type;
|
||||
private String product_id;
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package com.qihang.wei.openApi.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GoodsListApiBo {
|
||||
private Integer status;
|
||||
private Integer page_size;
|
||||
private String next_key;
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.qihang.wei.openApi.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderDetailBo {
|
||||
private String order_id;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.qihang.wei.openApi.bo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderListBo {
|
||||
private CreateTimeRangeBo create_time_range;
|
||||
private Integer page_size;
|
||||
private String next_key;
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.wei.openApi.service;
|
||||
|
||||
import com.qihang.wei.openApi.bo.GoodsDetailApiBo;
|
||||
import com.qihang.wei.openApi.bo.GoodsListApiBo;
|
||||
import com.qihang.wei.openApi.vo.GoodsDetailVo;
|
||||
import com.qihang.wei.openApi.vo.GoodsListVo;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.service.annotation.HttpExchange;
|
||||
import org.springframework.web.service.annotation.PostExchange;
|
||||
|
||||
@HttpExchange
|
||||
public interface GoodsApiService {
|
||||
@PostExchange("/channels/ec/product/list/get")
|
||||
GoodsListVo getGoodsList(@RequestParam String access_token, @RequestBody GoodsListApiBo bo);
|
||||
@PostExchange("/channels/ec/product/get")
|
||||
GoodsDetailVo getGoodsDetail(@RequestParam String access_token, @RequestBody GoodsDetailApiBo bo);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.qihang.wei.openApi.service;
|
||||
|
||||
import com.qihang.wei.openApi.bo.OrderDetailBo;
|
||||
import com.qihang.wei.openApi.bo.OrderListBo;
|
||||
import com.qihang.wei.openApi.vo.GoodsListVo;
|
||||
import com.qihang.wei.openApi.vo.OrderDetailVo;
|
||||
import com.qihang.wei.openApi.vo.OrderListVo;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.service.annotation.HttpExchange;
|
||||
import org.springframework.web.service.annotation.PostExchange;
|
||||
|
||||
@HttpExchange
|
||||
public interface OrderApiService {
|
||||
@PostExchange("/channels/ec/order/list/get")
|
||||
OrderListVo getOrderList(@RequestParam String access_token, @RequestBody OrderListBo bo);
|
||||
@PostExchange("/channels/ec/order/get")
|
||||
OrderDetailVo getOrderDetail(@RequestParam String access_token, @RequestBody OrderDetailBo bo);
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package com.qihang.wei.openApi.service;
|
||||
|
||||
import com.qihang.wei.openApi.vo.ShopApiResultVo;
|
||||
import com.qihang.wei.openApi.vo.Token;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.service.annotation.GetExchange;
|
||||
import org.springframework.web.service.annotation.HttpExchange;
|
||||
|
||||
@HttpExchange
|
||||
public interface ShopInfoApiService {
|
||||
@GetExchange("/channels/ec/basics/info/get")
|
||||
ShopApiResultVo getShopInfo(@RequestParam String access_token);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.qihang.wei.openApi.service;
|
||||
|
||||
|
||||
import com.qihang.wei.openApi.vo.Token;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.service.annotation.GetExchange;
|
||||
import org.springframework.web.service.annotation.HttpExchange;
|
||||
|
||||
@HttpExchange
|
||||
public interface TokenApiService {
|
||||
|
||||
@GetExchange("/cgi-bin/token")
|
||||
Token getToken(@RequestParam String grant_type, @RequestParam String appid, @RequestParam String secret);
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BaseResVo {
|
||||
private Integer errcode;
|
||||
private String errmsg;
|
||||
private String next_key;
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GoodsDetailVo extends BaseResVo {
|
||||
|
||||
private ProductVo product;
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GoodsListVo extends BaseResVo {
|
||||
|
||||
private Long[] product_ids;
|
||||
|
||||
private Integer total_num;
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderDetailVo extends BaseResVo {
|
||||
|
||||
private OrderVo order;
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderListVo extends BaseResVo {
|
||||
|
||||
private Long[] order_id_list;
|
||||
|
||||
private boolean has_more;
|
||||
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderVo {
|
||||
private Integer create_time;//秒级时间戳
|
||||
private Integer update_time;//秒级时间戳
|
||||
private String order_id ;//订单号
|
||||
private Integer status ;//订单状态,枚举值见OrderStatus
|
||||
private String openid ;//买家身份标识
|
||||
private String unionid ;//买家在开放平台的唯一标识符,若当前视频号小店已绑定到微信开放平台账号下,绑定成功后产生的订单会返回,详见UnionID 机制说明
|
||||
private OrderVoDetail order_detail ;// OrderDetail 订单详细数据信息
|
||||
private JSONObject aftersale_detail ;// AfterSaleDetail 售后信息
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderVoDeliverInfoAddress {
|
||||
|
||||
private String user_name ;//string 收货人姓名
|
||||
private String postal_code;// string 邮编
|
||||
private String province_name;// string 省份
|
||||
private String city_name;// string 城市
|
||||
private String county_name;// string 区
|
||||
private String detail_info;// string 详细地址
|
||||
private String national_code;// string 国家码,已废弃,请勿使用
|
||||
private String tel_number;// string 联系方式
|
||||
private String house_number;// string 门牌号码
|
||||
private String virtual_order_tel_number;// string 虚拟发货订单联系方式(deliver_method=1时返回)
|
||||
private JSONObject tel_number_ext_info;// TelNumberExtInfo 额外的联系方式信息(虚拟号码相关)
|
||||
private Integer use_tel_number;// number 0:不使用虚拟号码,1:使用虚拟号码
|
||||
private String hash_code;// string 标识当前店铺下一个唯一的用户收货地址
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderVoDeliveryInfo {
|
||||
|
||||
private OrderVoDeliverInfoAddress address_info;
|
||||
private JSONArray delivery_product_info;// array DeliveryProductInfo 发货物流信息
|
||||
private Integer ship_done_time;// number 发货完成时间,秒级时间戳
|
||||
private Integer deliver_method;// number 订单发货方式,0:普通物流,1:虚拟发货,由商品的同名字段决定
|
||||
private JSONObject address_under_review;// object AddressInfo 用户下单后申请修改收货地址,商家同意后该字段会覆盖订单地址信息
|
||||
private Integer address_apply_time;// number 修改地址申请时间,秒级时间戳
|
||||
private String ewaybill_order_code;// string 电子面单代发时的订单密文
|
||||
private Integer quality_inspect_type;// number 订单是否需要走新质检流程,1:需要,0:不需要, 本字段不存在时表示不需要
|
||||
private JSONObject quality_inspect_info;// object QualityInsepctInfo 质检信息,quality_inspect_type为1时返回
|
||||
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class OrderVoDetail {
|
||||
private List<OrderVoDetailProductInfo> product_infos;
|
||||
|
||||
private JSONObject price_info;// 价格信息
|
||||
private JSONObject pay_info;// 支付信息
|
||||
private OrderVoDeliveryInfo delivery_info;// 配送信息
|
||||
private JSONObject coupon_info;// 优惠券信息
|
||||
private JSONObject ext_info;// 额外信息
|
||||
private JSONArray commission_infos;// 分佣信息
|
||||
private JSONObject settle_info;// 结算信息
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderVoDetailProductInfo {
|
||||
|
||||
private String product_id ;//商品spuid
|
||||
private String sku_id ;// 商品skuid
|
||||
private String thumb_img ;// sku小图
|
||||
private Integer sku_cnt ;// sku数量
|
||||
private Integer sale_price ;// 售卖单价(单位:分)
|
||||
private String title ;// 商品标题
|
||||
private Integer on_aftersale_sku_cnt ;// 正在售后/退款流程中的 sku 数量
|
||||
private Integer finish_aftersale_sku_cnt ;// 完成售后/退款的 sku 数量
|
||||
private String sku_code ;// 商品编码
|
||||
private Integer market_price ;// 市场单价(单位:分)
|
||||
private JSONArray sku_attrs ;// sku属性
|
||||
private Integer real_price ;// sku实付总价,取estimate_price和change_price中较小值
|
||||
private String out_product_id ;// 商品外部spuid
|
||||
private String out_sku_id ;// 商品外部skuid
|
||||
private Boolean is_discounted ;// 是否有优惠金额,非必填,默认为false
|
||||
private Integer estimate_price ;// 优惠后sku总价,非必填,is_discounted为true时有值
|
||||
private Boolean is_change_price;// bool 是否修改过价格,非必填,默认为false
|
||||
private Integer change_price;// number 改价后sku总价,非必填,is_change_price为true时有值
|
||||
private String out_warehouse_id;// string 区域库存id
|
||||
private JSONObject sku_deliver_info;// SkuDeliverInfo 商品发货信息
|
||||
private JSONObject extra_service;// ProductExtraService 商品额外服务信息
|
||||
private Boolean use_deduction;// bool 是否使用了会员积分抵扣
|
||||
private Integer deduction_price;// number 会员积分抵扣金额,单位为分
|
||||
private JSONArray order_product_coupon_info_list;// array OrderProductCouponInfo 商品优惠券信息,逐步替换 order.order_detail.coupon_info
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ProductSkuVo {
|
||||
private String sku_id;
|
||||
private String out_sku_id;
|
||||
private String thumb_img;
|
||||
private String sku_code;
|
||||
private JSONArray sku_attrs;
|
||||
private Integer sale_price;
|
||||
private Integer stock_num;
|
||||
private Integer status;
|
||||
private JSONObject sku_deliver_info;
|
||||
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class ProductVo {
|
||||
private String product_id;
|
||||
private String out_product_id;
|
||||
private String title;
|
||||
private String sub_title;
|
||||
private JSONArray head_imgs;
|
||||
private JSONObject desc_info;
|
||||
private List<Map<String,String>> attrs;
|
||||
private Integer status;
|
||||
private Integer edit_status;
|
||||
private Integer min_price;
|
||||
private String spu_code;
|
||||
private List<ProductSkuVo> skus;
|
||||
private Integer product_type;
|
||||
private String edit_time;
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ShopApiResultVo extends BaseResVo{
|
||||
private ShopInfoVo info;
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ShopInfoVo {
|
||||
private String nickname;
|
||||
private String headimg_url;
|
||||
private String subject_type;
|
||||
private String status;
|
||||
private String username;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
package com.qihang.wei.openApi.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Token {
|
||||
private String access_token;
|
||||
private Long expires_in;
|
||||
private Integer errcode;
|
||||
private String errmsg;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiGoods;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods】的数据库操作Service
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
*/
|
||||
public interface OmsWeiGoodsService extends IService<OmsWeiGoods> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods_sku】的数据库操作Service
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
*/
|
||||
public interface OmsWeiGoodsSkuService extends IService<OmsWeiGoodsSku> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.OmsWeiOrderItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order_item】的数据库操作Service
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
*/
|
||||
public interface OmsWeiOrderItemService extends IService<OmsWeiOrderItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.wei.bo.WeiOrderConfirmBo;
|
||||
import com.qihang.wei.domain.OmsWeiOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order】的数据库操作Service
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
*/
|
||||
public interface OmsWeiOrderService extends IService<OmsWeiOrder> {
|
||||
PageResult<OmsWeiOrder> queryPageList(OmsWeiOrder bo, PageQuery pageQuery);
|
||||
ResultVo<Integer> saveOrder(Long shopId, OmsWeiOrder order);
|
||||
OmsWeiOrder queryDetailById(Long id);
|
||||
int confirmOrder(WeiOrderConfirmBo bo) throws InterruptedException;
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @createDate 2024-06-03 14:14:56
|
||||
*/
|
||||
public interface SShopService extends IService<SShop> {
|
||||
SShop selectShopById(Integer shopId);
|
||||
SShop selectShopById(Long shopId);
|
||||
|
||||
void updateSessionKey(Integer shopId,String sessionKey);
|
||||
void updateSessionKey(Long shopId,String sessionKey);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @createDate 2024-03-29 11:25:17
|
||||
*/
|
||||
public interface WeiGoodsService extends IService<WeiGoods> {
|
||||
int saveAndUpdateGoods(Integer shopId,WeiGoods goods);
|
||||
int saveAndUpdateGoods(Long shopId,WeiGoods goods);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @createDate 2024-03-29 16:44:51
|
||||
*/
|
||||
public interface WeiOrderService extends IService<WeiOrder> {
|
||||
ResultVo<Integer> saveOrder(Integer shopId, WeiOrder order);
|
||||
ResultVo<Integer> saveOrder(Long shopId, WeiOrder order);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.OmsWeiGoods;
|
||||
import com.qihang.wei.service.OmsWeiGoodsService;
|
||||
import com.qihang.wei.mapper.OmsWeiGoodsMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
*/
|
||||
@Service
|
||||
public class OmsWeiGoodsServiceImpl extends ServiceImpl<OmsWeiGoodsMapper, OmsWeiGoods>
|
||||
implements OmsWeiGoodsService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||
import com.qihang.wei.service.OmsWeiGoodsSkuService;
|
||||
import com.qihang.wei.mapper.OmsWeiGoodsSkuMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_goods_sku】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 16:51:29
|
||||
*/
|
||||
@Service
|
||||
public class OmsWeiGoodsSkuServiceImpl extends ServiceImpl<OmsWeiGoodsSkuMapper, OmsWeiGoodsSku>
|
||||
implements OmsWeiGoodsSkuService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.OmsWeiOrderItem;
|
||||
import com.qihang.wei.service.OmsWeiOrderItemService;
|
||||
import com.qihang.wei.mapper.OmsWeiOrderItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order_item】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
*/
|
||||
@Service
|
||||
public class OmsWeiOrderItemServiceImpl extends ServiceImpl<OmsWeiOrderItemMapper, OmsWeiOrderItem>
|
||||
implements OmsWeiOrderItemService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,319 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.wei.bo.WeiOrderConfirmBo;
|
||||
import com.qihang.wei.domain.OmsWeiOrder;
|
||||
import com.qihang.wei.domain.OmsWeiOrderItem;
|
||||
import com.qihang.wei.mapper.OmsWeiGoodsSkuMapper;
|
||||
import com.qihang.wei.mapper.OmsWeiOrderItemMapper;
|
||||
import com.qihang.wei.service.OmsWeiOrderService;
|
||||
import com.qihang.wei.mapper.OmsWeiOrderMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_wei_order】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 16:48:31
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsWeiOrderServiceImpl extends ServiceImpl<OmsWeiOrderMapper, OmsWeiOrder>
|
||||
implements OmsWeiOrderService{
|
||||
private final OmsWeiOrderMapper mapper;
|
||||
private final OmsWeiOrderItemMapper itemMapper;
|
||||
private final OmsWeiGoodsSkuMapper goodsSkuMapper;
|
||||
// private final MQClientService mqClientService;
|
||||
|
||||
@Override
|
||||
public PageResult<OmsWeiOrder> queryPageList(OmsWeiOrder bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsWeiOrder> queryWrapper = new LambdaQueryWrapper<OmsWeiOrder>()
|
||||
.eq(bo.getShopId()!=null,OmsWeiOrder::getShopId,bo.getShopId())
|
||||
.eq(StringUtils.hasText(bo.getOrderId()),OmsWeiOrder::getOrderId,bo.getOrderId())
|
||||
;
|
||||
|
||||
Page<OmsWeiOrder> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
if(page.getRecords()!=null){
|
||||
for (var order:page.getRecords()) {
|
||||
order.setItems(itemMapper.selectList(new LambdaQueryWrapper<OmsWeiOrderItem>().eq(OmsWeiOrderItem::getOrderId,order.getOrderId())));
|
||||
}
|
||||
}
|
||||
return PageResult.build(page);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultVo<Integer> saveOrder(Long shopId, OmsWeiOrder order) {
|
||||
try {
|
||||
List<OmsWeiOrder> orders = mapper.selectList(new LambdaQueryWrapper<OmsWeiOrder>().eq(OmsWeiOrder::getOrderId, order.getOrderId()));
|
||||
if (orders != null && orders.size() > 0) {
|
||||
// 存在,修改
|
||||
OmsWeiOrder update = new OmsWeiOrder();
|
||||
update.setId(orders.get(0).getId());
|
||||
update.setOrderId(order.getOrderId());
|
||||
update.setStatus(order.getStatus());
|
||||
update.setUpdateTime(order.getUpdateTime());
|
||||
update.setPayInfo(order.getPayInfo());
|
||||
update.setAftersaleDetail(order.getAftersaleDetail());
|
||||
update.setDeliveryProductInfo(order.getDeliveryProductInfo());
|
||||
|
||||
mapper.updateById(update);
|
||||
// 更新item
|
||||
for (var item : order.getItems()) {
|
||||
List<OmsWeiOrderItem> taoOrderItems = itemMapper.selectList(
|
||||
new LambdaQueryWrapper<OmsWeiOrderItem>().eq(OmsWeiOrderItem::getSkuId, item.getSkuId()).eq(OmsWeiOrderItem::getOrderId,order.getOrderId())
|
||||
);
|
||||
|
||||
if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
||||
// 不处理
|
||||
} else {
|
||||
// 新增
|
||||
item.setShopId(shopId);
|
||||
item.setOrderId(order.getOrderId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
}
|
||||
return ResultVo.error(ResultVoEnum.DataExist, "订单已经存在,更新成功");
|
||||
} else {
|
||||
// 不存在,新增
|
||||
order.setShopId(shopId);
|
||||
mapper.insert(order);
|
||||
// 添加item
|
||||
for (var item : order.getItems()) {
|
||||
item.setShopId(shopId);
|
||||
item.setOrderId(order.getOrderId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
return ResultVo.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OmsWeiOrder queryDetailById(Long id) {
|
||||
OmsWeiOrder weiOrder = mapper.selectById(id);
|
||||
if(weiOrder!=null){
|
||||
weiOrder.setItems(itemMapper.selectList(new LambdaQueryWrapper<OmsWeiOrderItem>().eq(OmsWeiOrderItem::getOrderId,weiOrder.getOrderId())));
|
||||
}
|
||||
return weiOrder;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public int confirmOrder(WeiOrderConfirmBo bo) throws InterruptedException {
|
||||
OmsWeiOrder original = mapper.selectById(bo.getId());;
|
||||
if(original.getAuditStatus()!=null && original.getAuditStatus() != 0) return -1;//无需审核
|
||||
|
||||
|
||||
// // 新增ErpOrder
|
||||
// // 确认订单(操作:插入数据到s_shop_order、s_shop_order_item)
|
||||
// ErpOrder so = new ErpOrder();
|
||||
// so.setOrderNum(original.getOrderId());
|
||||
// so.setOrderTime(DateUtil.stampToDateTime(original.getCreateTime().longValue()));
|
||||
// so.setShopId(original.getShopId());
|
||||
// so.setShopType(EnumShopType.WEI.getIndex());
|
||||
//// so.setRemark(original.getRemark());
|
||||
//// so.setBuyerMemo(original.getBuyerFeedback());
|
||||
//// so.setTag(original.getTag());
|
||||
// Integer orderStatus = null;
|
||||
// Integer refundStatus = null;
|
||||
// //状态 10 待付款;20 待发货;21 部分发货;30 待收货;100 完成;200 全部商品售后之后,订单取消;250 未付款用户主动取消或超时未付款订单自动取消;
|
||||
// if(original.getStatus() == 10){
|
||||
// so.setRefundStatus(1);
|
||||
// so.setOrderStatus(21);//订单状态1:待发货,2:已发货,3:已完成,11已取消;21待付款
|
||||
// orderStatus = 21;
|
||||
// refundStatus = 1;
|
||||
// } else if (original.getStatus() == 20 || original.getStatus() == 21) {
|
||||
// so.setRefundStatus(1);
|
||||
// so.setOrderStatus(1);
|
||||
// orderStatus = 1;
|
||||
// refundStatus = 1;
|
||||
// } else if (original.getStatus() == 30) {
|
||||
// so.setRefundStatus(1);
|
||||
// so.setOrderStatus(2);
|
||||
// orderStatus = 2;
|
||||
// refundStatus = 1;
|
||||
// } else if (original.getStatus() == 100) {
|
||||
// so.setRefundStatus(1);
|
||||
// so.setOrderStatus(3);
|
||||
// orderStatus = 3;
|
||||
// refundStatus = 1;
|
||||
// }else if (original.getStatus() == 200 || original.getStatus() == 250) {
|
||||
// so.setRefundStatus(4);
|
||||
// so.setOrderStatus(11);
|
||||
// orderStatus = 11;
|
||||
// refundStatus = 4;
|
||||
// }
|
||||
//
|
||||
// so.setShipStatus(0);
|
||||
//// so.setShipType(bo.getShipType());
|
||||
// so.setGoodsAmount(original.getProductPrice().doubleValue() /100);
|
||||
// if(original.getDiscountedPrice()!=null) {
|
||||
// so.setDiscountAmount(BigDecimal.valueOf(original.getDiscountedPrice().doubleValue() / 100));
|
||||
// }else{
|
||||
// so.setDiscountAmount(BigDecimal.ZERO);
|
||||
// }
|
||||
// so.setAmount(original.getOrderPrice().doubleValue()/100);
|
||||
// so.setPostage(BigDecimal.valueOf(original.getFreight()/100));
|
||||
//
|
||||
//// so.setPayTime(original.getPayTime());
|
||||
// so.setConfirmTime(new Date());
|
||||
// so.setCreateTime(new Date());
|
||||
// so.setCreateBy("确认订单");
|
||||
// so.setReceiverName(bo.getUserName());
|
||||
// so.setReceiverPhone(bo.getTelNumber());
|
||||
// so.setAddress(bo.getDetailInfo());
|
||||
// so.setCountry("中国");
|
||||
// so.setProvince(original.getProvinceName());
|
||||
// so.setCity(original.getCityName());
|
||||
// so.setTown(original.getCountyName());
|
||||
//
|
||||
// // 新增ErpOrderItem
|
||||
// List<OmsWeiOrderItem> weiOrderItems = itemMapper.selectList(new LambdaQueryWrapper<OmsWeiOrderItem>().eq(OmsWeiOrderItem::getOrderId, original.getOrderId()));
|
||||
//
|
||||
// if(weiOrderItems!=null && weiOrderItems.size()>0) {
|
||||
// List<ErpOrderItem> items = new ArrayList<>();
|
||||
//
|
||||
// for (var i : weiOrderItems) {
|
||||
//// if(com.qihang.common.utils.StringUtils.isEmpty(i.getSkuCode())) {
|
||||
//// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
//// return -11;
|
||||
//// }
|
||||
//// GoodsSpec spec = goodsSpecMapper.selectGoodsSpecBySpecNum(i.getSpecNumber());
|
||||
//// if (spec == null) {
|
||||
//// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
//// return -11;
|
||||
//// }
|
||||
//// Goods goods = goodsMapper.selectGoodsById(spec.getGoodsId());
|
||||
//// if(goods == null){
|
||||
//// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
//// return -12;
|
||||
//// }
|
||||
//
|
||||
// ErpOrderItem item = new ErpOrderItem();
|
||||
// item.setShipStatus(0);
|
||||
//// item.setShipType(bo.getShipType());
|
||||
// item.setShopId(original.getShopId());
|
||||
// item.setOrderId(so.getId());
|
||||
// item.setOriginalOrderId(original.getOrderId());
|
||||
// item.setOriginalOrderItemId(i.getId().toString());
|
||||
// item.setOriginalSkuId(i.getSkuId());
|
||||
//
|
||||
// Long erpGoodsId = 0L;
|
||||
// Long erpSkuId = 0L;
|
||||
//
|
||||
// List<OmsWeiGoodsSku> weiGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OmsWeiGoodsSku>().eq(OmsWeiGoodsSku::getSkuId, i.getSkuId()));
|
||||
// if (weiGoodsSkus != null && !weiGoodsSkus.isEmpty()) {
|
||||
// erpGoodsId = weiGoodsSkus.get(0).getErpGoodsId();
|
||||
// erpSkuId = weiGoodsSkus.get(0).getErpGoodsSkuId();
|
||||
// }
|
||||
// item.setGoodsId(erpGoodsId);
|
||||
// item.setSpecId(erpSkuId);
|
||||
// item.setGoodsTitle(i.getTitle());
|
||||
// item.setGoodsImg(i.getThumbImg());
|
||||
// item.setGoodsNum(i.getProductId());
|
||||
// item.setSpecNum(i.getSkuCode());
|
||||
// item.setGoodsSpec(i.getSkuAttrs());
|
||||
// item.setGoodsPrice(i.getSalePrice().doubleValue() / 100);
|
||||
//// item.setGoodsPurPrice(spec.getPurPrice());
|
||||
// item.setItemAmount(i.getRealPrice().doubleValue() / 100);
|
||||
// item.setQuantity(i.getSkuCnt());
|
||||
// item.setIsGift(0);
|
||||
// item.setRefundCount(0);
|
||||
// item.setRefundStatus(refundStatus);
|
||||
// item.setOrderStatus(orderStatus);
|
||||
// item.setCreateBy("确认订单");
|
||||
// item.setCreateTime(new Date());
|
||||
// items.add(item);
|
||||
// }
|
||||
// so.setItemList(items);
|
||||
// }
|
||||
//// // 添加了赠品
|
||||
////// if(taoOrder.getTaoOrderItemList()!=null && !taoOrder.getTaoOrderItemList().isEmpty()){
|
||||
////// for (var g:taoOrder.getTaoOrderItemList()) {
|
||||
////// if(com.qihang.common.utils.StringUtils.isEmpty(g.getSpecNumber())) {
|
||||
////// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
////// return -11;
|
||||
////// }
|
||||
////// GoodsSpec spec = goodsSpecMapper.selectGoodsSpecBySpecNum(g.getSpecNumber());
|
||||
////// if (spec == null) {
|
||||
////// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
////// return -11;
|
||||
////// }
|
||||
////// Goods goods = goodsMapper.selectGoodsById(spec.getGoodsId());
|
||||
////// if(goods == null) {
|
||||
////// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
////// return -12;
|
||||
////// }
|
||||
//////
|
||||
////// ErpOrderItem item = new ErpOrderItem();
|
||||
////// item.setShipStatus(0);
|
||||
////// item.setShipType(taoOrder.getShipType());
|
||||
////// item.setShopId(original.getShopId().intValue());
|
||||
////// item.setOrderId(so.getId());
|
||||
////// item.setOrderNum(original.getId());
|
||||
////// item.setOrderItemNum(original.getId()+"_");
|
||||
////// item.setSupplierId(goods.getSupplierId().intValue());
|
||||
////// item.setGoodsId(spec.getGoodsId());
|
||||
////// item.setSpecId(spec.getId());
|
||||
////// item.setGoodsTitle(g.getGoodsTitle());
|
||||
////// item.setGoodsImg(g.getProductImgUrl());
|
||||
////// item.setGoodsNum(g.getGoodsNumber());
|
||||
////// item.setSpecNum(g.getSpecNumber());
|
||||
////// item.setGoodsSpec(g.getSkuInfo());
|
||||
////// item.setGoodsPrice(g.getPrice().doubleValue());
|
||||
//////// item.setGoodsPurPrice(spec.getPurPrice());
|
||||
////// item.setItemAmount(g.getItemAmount().doubleValue());
|
||||
////// item.setQuantity(g.getQuantity().intValue());
|
||||
////// item.setIsGift(1);
|
||||
////// item.setRefundCount(0);
|
||||
////// item.setRefundStatus(1);
|
||||
////// item.setCreateBy(taoOrder.getUpdateBy());
|
||||
////// item.setCreateTime(new Date());
|
||||
////// items.add(item);
|
||||
////// }
|
||||
////// }
|
||||
//// erpOrderMapper.batchErpOrderItem(items);
|
||||
// // 远程调用
|
||||
// MQRequest<ErpOrder> req = new MQRequest<>();
|
||||
// req.setMqRequestType(MQRequestType.ORDER_CONFIRM);
|
||||
// req.setData(so);
|
||||
// ApiResult s = mqClientService.confirmOrder(req);
|
||||
// if(s.getResult()==ApiResultEnum.SUCCESS.getIndex()) {
|
||||
// //更新自己
|
||||
// OmsWeiOrder update = new OmsWeiOrder();
|
||||
// update.setId(original.getId());
|
||||
// update.setAuditStatus(1);
|
||||
// update.setAuditTime(new Date());
|
||||
// update.setUserName(bo.getUserName());
|
||||
// update.setTelNumber(bo.getTelNumber());
|
||||
// update.setDetailInfo(bo.getDetailInfo());
|
||||
// Long ut = (System.currentTimeMillis() / 1000);
|
||||
// update.setUpdateTime(ut.intValue());
|
||||
// mapper.updateById(update);
|
||||
// }
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -18,12 +18,12 @@ public class SShopServiceImpl extends ServiceImpl<SShopMapper, SShop>
|
|||
implements SShopService{
|
||||
private final SShopMapper mapper;
|
||||
@Override
|
||||
public SShop selectShopById(Integer shopId) {
|
||||
public SShop selectShopById(Long shopId) {
|
||||
return mapper.selectById(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSessionKey(Integer shopId, String sessionKey) {
|
||||
public void updateSessionKey(Long shopId, String sessionKey) {
|
||||
SShop shop = new SShop();
|
||||
shop.setId(shopId);
|
||||
shop.setSessionkey(sessionKey);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
// private final OGoodsSkuMapper goodsSkuMapper;
|
||||
|
||||
@Override
|
||||
public int saveAndUpdateGoods(Integer shopId, WeiGoods goods) {
|
||||
public int saveAndUpdateGoods(Long shopId, WeiGoods goods) {
|
||||
List<WeiGoods> goodsList = mapper.selectList(new LambdaQueryWrapper<WeiGoods>().eq(WeiGoods::getProductId, goods.getProductId()));
|
||||
if (goodsList != null && goodsList.size() > 0) {
|
||||
// 更新
|
||||
|
|
@ -42,7 +42,7 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
// 重新插入sku
|
||||
if(goods.getSkus()!=null) {
|
||||
for (var sku : goods.getSkus()) {
|
||||
sku.setWeiGoodsId(goods.getId());
|
||||
sku.setWeiGoodsId(Long.parseLong(goods.getId()));
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
// if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
// List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
|
|
@ -64,7 +64,7 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
// 插入sku
|
||||
if(goods.getSkus()!=null) {
|
||||
for (var sku : goods.getSkus()) {
|
||||
sku.setWeiGoodsId(goods.getId());
|
||||
sku.setWeiGoodsId(Long.parseLong(goods.getId()));
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
// if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
// List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class WeiOrderServiceImpl extends ServiceImpl<WeiOrderMapper, WeiOrder>
|
|||
private final WeiOrderItemMapper itemMapper;
|
||||
|
||||
@Override
|
||||
public ResultVo<Integer> saveOrder(Integer shopId, WeiOrder order) {
|
||||
public ResultVo<Integer> saveOrder(Long shopId, WeiOrder order) {
|
||||
try {
|
||||
List<WeiOrder> orders = mapper.selectList(new LambdaQueryWrapper<WeiOrder>().eq(WeiOrder::getOrderId, order.getOrderId()));
|
||||
if (orders != null && orders.size() > 0) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.wei.mapper.OmsWeiGoodsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OmsWeiGoods">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
|
||||
<result property="outProductId" column="out_product_id" jdbcType="VARCHAR"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="subTitle" column="sub_title" jdbcType="VARCHAR"/>
|
||||
<result property="headImgs" column="head_imgs" jdbcType="VARCHAR"/>
|
||||
<result property="headImg" column="head_img" jdbcType="VARCHAR"/>
|
||||
<result property="descInfo" column="desc_info" jdbcType="VARCHAR"/>
|
||||
<result property="attrs" column="attrs" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="editStatus" column="edit_status" jdbcType="INTEGER"/>
|
||||
<result property="minPrice" column="min_price" jdbcType="INTEGER"/>
|
||||
<result property="spuCode" column="spu_code" jdbcType="VARCHAR"/>
|
||||
<result property="productType" column="product_type" jdbcType="INTEGER"/>
|
||||
<result property="editTime" column="edit_time" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,product_id,
|
||||
out_product_id,title,sub_title,
|
||||
head_imgs,head_img,desc_info,
|
||||
attrs,status,edit_status,
|
||||
min_price,spu_code,product_type,
|
||||
edit_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.wei.mapper.OmsWeiGoodsSkuMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OmsWeiGoodsSku">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
|
||||
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
|
||||
<result property="outSkuId" column="out_sku_id" jdbcType="VARCHAR"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="thumbImg" column="thumb_img" jdbcType="VARCHAR"/>
|
||||
<result property="salePrice" column="sale_price" jdbcType="INTEGER"/>
|
||||
<result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
|
||||
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="skuAttr" column="sku_attr" jdbcType="VARCHAR"/>
|
||||
<result property="skuAttrs" column="sku_attrs" jdbcType="VARCHAR"/>
|
||||
<result property="skuDeliverInfo" column="sku_deliver_info" jdbcType="VARCHAR"/>
|
||||
<result property="erpGoodsId" column="erp_goods_id" jdbcType="BIGINT"/>
|
||||
<result property="erpGoodsSkuId" column="erp_goods_sku_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,product_id,
|
||||
sku_id,out_sku_id,title,
|
||||
thumb_img,sale_price,stock_num,
|
||||
sku_code,status,sku_attr,
|
||||
sku_attrs,sku_deliver_info,erp_goods_id,
|
||||
erp_goods_sku_id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.wei.mapper.OmsWeiOrderItemMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OmsWeiOrderItem">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
|
||||
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
|
||||
<result property="thumbImg" column="thumb_img" jdbcType="VARCHAR"/>
|
||||
<result property="skuCnt" column="sku_cnt" jdbcType="INTEGER"/>
|
||||
<result property="salePrice" column="sale_price" jdbcType="INTEGER"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="onAftersaleSkuCnt" column="on_aftersale_sku_cnt" jdbcType="INTEGER"/>
|
||||
<result property="finishAftersaleSkuCnt" column="finish_aftersale_sku_cnt" jdbcType="INTEGER"/>
|
||||
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
|
||||
<result property="marketPrice" column="market_price" jdbcType="INTEGER"/>
|
||||
<result property="skuAttrs" column="sku_attrs" jdbcType="VARCHAR"/>
|
||||
<result property="realPrice" column="real_price" jdbcType="INTEGER"/>
|
||||
<result property="outProductId" column="out_product_id" jdbcType="VARCHAR"/>
|
||||
<result property="outSkuId" column="out_sku_id" jdbcType="VARCHAR"/>
|
||||
<result property="isDiscounted" column="is_discounted" jdbcType="VARCHAR"/>
|
||||
<result property="estimatePrice" column="estimate_price" jdbcType="INTEGER"/>
|
||||
<result property="isChangePrice" column="is_change_price" jdbcType="VARCHAR"/>
|
||||
<result property="changePrice" column="change_price" jdbcType="INTEGER"/>
|
||||
<result property="outWarehouseId" column="out_warehouse_id" jdbcType="VARCHAR"/>
|
||||
<result property="skuDeliverInfo" column="sku_deliver_info" jdbcType="VARCHAR"/>
|
||||
<result property="extraService" column="extra_service" jdbcType="VARCHAR"/>
|
||||
<result property="useDeduction" column="use_deduction" jdbcType="VARCHAR"/>
|
||||
<result property="deductionPrice" column="deduction_price" jdbcType="INTEGER"/>
|
||||
<result property="orderProductCouponInfoList" column="order_product_coupon_info_list" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,order_id,
|
||||
product_id,sku_id,thumb_img,
|
||||
sku_cnt,sale_price,title,
|
||||
on_aftersale_sku_cnt,finish_aftersale_sku_cnt,sku_code,
|
||||
market_price,sku_attrs,real_price,
|
||||
out_product_id,out_sku_id,is_discounted,
|
||||
estimate_price,is_change_price,change_price,
|
||||
out_warehouse_id,sku_deliver_info,extra_service,
|
||||
use_deduction,deduction_price,order_product_coupon_info_list
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.wei.mapper.OmsWeiOrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OmsWeiOrder">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||
<result property="openid" column="openid" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="INTEGER"/>
|
||||
<result property="unionid" column="unionid" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="aftersaleDetail" column="aftersale_detail" jdbcType="VARCHAR"/>
|
||||
<result property="payInfo" column="pay_info" jdbcType="VARCHAR"/>
|
||||
<result property="productPrice" column="product_price" jdbcType="INTEGER"/>
|
||||
<result property="orderPrice" column="order_price" jdbcType="INTEGER"/>
|
||||
<result property="freight" column="freight" jdbcType="INTEGER"/>
|
||||
<result property="discountedPrice" column="discounted_price" jdbcType="INTEGER"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="postalCode" column="postal_code" jdbcType="VARCHAR"/>
|
||||
<result property="provinceName" column="province_name" jdbcType="VARCHAR"/>
|
||||
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
|
||||
<result property="countyName" column="county_name" jdbcType="VARCHAR"/>
|
||||
<result property="detailInfo" column="detail_info" jdbcType="VARCHAR"/>
|
||||
<result property="telNumber" column="tel_number" jdbcType="VARCHAR"/>
|
||||
<result property="houseNumber" column="house_number" jdbcType="VARCHAR"/>
|
||||
<result property="virtualOrderTelNumber" column="virtual_order_tel_number" jdbcType="VARCHAR"/>
|
||||
<result property="telNumberExtInfo" column="tel_number_ext_info" jdbcType="VARCHAR"/>
|
||||
<result property="useTelNumber" column="use_tel_number" jdbcType="INTEGER"/>
|
||||
<result property="hashCode" column="hash_code" jdbcType="VARCHAR"/>
|
||||
<result property="deliveryProductInfo" column="delivery_product_info" jdbcType="VARCHAR"/>
|
||||
<result property="shipDoneTime" column="ship_done_time" jdbcType="INTEGER"/>
|
||||
<result property="ewaybillOrderCode" column="ewaybill_order_code" jdbcType="VARCHAR"/>
|
||||
<result property="settleInfo" column="settle_info" jdbcType="VARCHAR"/>
|
||||
<result property="auditStatus" column="audit_status" jdbcType="INTEGER"/>
|
||||
<result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,order_id,
|
||||
openid,create_time,update_time,
|
||||
unionid,status,aftersale_detail,
|
||||
pay_info,product_price,order_price,
|
||||
freight,discounted_price,user_name,
|
||||
postal_code,province_name,city_name,
|
||||
county_name,detail_info,tel_number,
|
||||
house_number,virtual_order_tel_number,tel_number_ext_info,
|
||||
use_tel_number,hash_code,delivery_product_info,
|
||||
ship_done_time,ewaybill_order_code,settle_info,
|
||||
audit_status,audit_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 查询淘宝订单列表
|
||||
export function listOrder(query) {
|
||||
return request({
|
||||
url: '/wei-api/order/list',
|
||||
url: '/api/wei-api/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
|
|
@ -12,7 +12,7 @@ export function listOrder(query) {
|
|||
// 查询订单详细
|
||||
export function getOrder(id) {
|
||||
return request({
|
||||
url: '/wei-api/order/' + id,
|
||||
url: '/api/wei-api/order/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ export function getOrder(id) {
|
|||
// 接口拉取订单
|
||||
export function pullOrder(data) {
|
||||
return request({
|
||||
url: '/wei-api/order/pull_order',
|
||||
url: '/api/wei-api/order/pull_order',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
@ -30,7 +30,7 @@ export function pullOrder(data) {
|
|||
|
||||
export function pullOrderDetail(data) {
|
||||
return request({
|
||||
url: '/wei-api/order/pull_order_detail',
|
||||
url: '/api/wei-api/order/pull_order_detail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
@ -39,7 +39,7 @@ export function pullOrderDetail(data) {
|
|||
|
||||
export function confirmOrder(data) {
|
||||
return request({
|
||||
url: '/wei-api/order/confirmOrder',
|
||||
url: '/api/wei-api/order/confirmOrder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,16 +3,19 @@
|
|||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="天猫" name="taoOrder">
|
||||
<order-tao></order-tao>
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="京东" name="jdOrder" lazy>
|
||||
<order-jd></order-jd>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="拼多多" name="pddOrder" lazy>
|
||||
<order-pdd></order-pdd>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="抖店" name="douOrder" lazy>
|
||||
<order-dou></order-dou>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="拼多多" name="pddOrder" lazy>
|
||||
<order-pdd></order-pdd>
|
||||
<el-tab-pane label="视频号" name="weiOrder" lazy>
|
||||
<order-wei></order-wei>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
|
|
@ -24,9 +27,10 @@ import OrderTao from "@/views/tao/order/index";
|
|||
import OrderJd from "@/views/jd/order/index";
|
||||
import OrderDou from "@/views/dou/order/index";
|
||||
import OrderPdd from "@/views/pdd/order/index";
|
||||
import OrderWei from "@/views/shop/wei/order/index";
|
||||
export default {
|
||||
name: "Order",
|
||||
components:{OrderTao,OrderJd,OrderDou,OrderPdd},
|
||||
components:{OrderTao,OrderJd,OrderDou,OrderPdd,OrderWei},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'taoOrder'
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@
|
|||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
@click="handlePrintEwaybill"
|
||||
>打印电子面单</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
|
@ -249,6 +249,46 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
handlePrintEwaybill(){
|
||||
const ws = new WebSocket('ws://127.0.0.1:12705');
|
||||
ws.onopen = () => {
|
||||
console.log('与打印组件建立连接成功: ');
|
||||
ws.send(JSON.stringify({
|
||||
command: 'print',
|
||||
version: '2.0', // 必传
|
||||
requestID: '1234', // String, 调用方保证唯一
|
||||
taskList: [{
|
||||
taskID: '1234', // String, 调用方保证唯一
|
||||
printInfo: 'JTdCJTIycHJpbnREYXRhJTIyJTNBJTdCJTIyd2F5YmlsbElkJTIyJTNBJTIyNzM2MTE0NjI1MzgzODUlMjIlMkMlMjJwcmludFRpbWUlMjIlM0ElMjIyMDI0JTJGMDYlMkYwMyUyMDE4JTNBNDUlMjIlMkMlMjJzZXJ2aWNlcyUyMiUzQSU1QiU1RCUyQyUyMnJlY2VpdmVyTmFtZSUyMiUzQSUyMiVFNSVBRSVBMyoqJTIyJTJDJTIycmVjZWl2ZXJQaG9uZSUyMiUzQSUyMjEzNyoqKiozODQwJTIyJTJDJTIycmVjZWl2ZXJBZGRyZXNzJTIyJTNBJTIyJUU0JUI4JThBJUU2JUI1JUI3JUU1JUI4JTgyJUU0JUI4JThBJUU2JUI1JUI3JUU1JUI4JTgyJUU2JUI1JUE2JUU0JUI4JTlDJUU2JTk2JUIwJUU1JThDJUJBJUU1JUJDJUEwJUU2JUIxJTlGJUU5JTk1JTg3JUU1JUFEJTk5JUU2JUExJUE1JUU4JUI3JUFGMjM4JUU1JUJDJTg0MzAlRTUlOEYlQjcyMDIlRTUlQUUlQTQlMjIlMkMlMjJzZW5kZXJOYW1lJTIyJTNBJTIyJUU0JUI4JTgzJUU5JTg3JThDJUU1JTlEJUFBJTIyJTJDJTIyc2VuZGVyUGhvbmUlMjIlM0ElMjIxNTgxODU5MDExOSUyMiUyQyUyMnNlbmRlckFkZHJlc3MlMjIlM0ElMjIlRTUlQjklQkYlRTQlQjglOUMlRTclOUMlODElRTYlQjclQjElRTUlOUMlQjMlRTUlQjglODIlRTUlQUUlOUQlRTUlQUUlODklRTUlOEMlQkF4eHh4eDElRTUlOEYlQjclRTUlOEMlOTclRTklOTclQTglMjIlMkMlMjJzaXRlQ29kZSUyMiUzQSUyMjU1ODMwJTIyJTJDJTIyZXdheWJpbGxPcmRlcklkJTIyJTNBJTIyMzQ4NjYxMzA5Mzg5ODE0MTY5OSUyMiUyQyUyMmJhZ0FkZHIlMjIlM0ElMjIlRTYlQjIlQUElRTQlQjglOUMlMjIlMkMlMjJtYXJrJTIyJTNBJTIyMzEwLSUyMFA2JTIwMDMxJTIwJTVCQjMxJTVEJTIyJTJDJTIyc3RvcmVOYW1lJTIyJTNBJTIyJUU5JUFBJTg0JUU5JUI5JUJGJUU2JTlDJTlCJUU1JUIxJUIxJUU0JUI4JTkzJUU1JThEJTk2JUU1JUJBJTk3JTIyJTJDJTIyY3VzdG9tZXJOb3RlcyUyMiUzQSUyMiUyMiUyQyUyMm1lcmNoYW50Tm90ZXMlMjIlM0ElMjIlMjIlMkMlMjJvcmRlcklkJTIyJTNBJTIyMzcyMDI5MzQxNTUwOTk1NDgxNiUyMiU3RCUyQyUyMnRlbXBsYXRlJTIyJTNBJTdCJTIydGVtcGxhdGVJZCUyMiUzQSUyMnNpbmdsZSUyMiUyQyUyMnRlbXBsYXRlTmFtZSUyMiUzQSUyMiVFOSVCQiU5OCVFOCVBRSVBNCVFNyVBOSVCQSVFNiVBOCVBMSVFNiU5RCVCRiUyMiUyQyUyMnRlbXBsYXRlRGVzYyUyMiUzQSUyMiVFNCVCOCU4MCVFOCU4MSU5NCVFNSU4RCU5NSVFNiVBMCU4NyVFNSU4NyU4NiVFNiVBOCVBMSVFNiU5RCVCRiUyMiUyQyUyMnRlbXBsYXRlVHlwZSUyMiUzQSUyMnNpbmdsZSUyMiUyQyUyMm9wdGlvbkxpc3QlMjIlM0ElN0IlN0QlMkMlMjJvcHRpb25zJTIyJTNBJTVCJTVEJTJDJTIyY29kZSUyMiUzQTAlMkMlMjJkZWxpdmVyeUlkJTIyJTNBJTIyWlRPJTIyJTJDJTIydGVtcGxhdGVVcmwlMjIlM0ElMjJodHRwcyUzQSUyRiUyRm1tZWMtc2hvcC0xMjU4MzQ0NzA3LmNvcy5hcC1zaGFuZ2hhaS5teXFjbG91ZC5jb20lMkZzaG9wJTJGcHVibGljJTJGMjAyMy0xMC0yNSUyRjNlY2JiM2FhLTViY2YtNDA0ZC05NzJhLThhMDhhODE2MjIzYy5odG1sJTIyJTJDJTIyY3VzdG9tQ29uZmlnJTIyJTNBJTdCJTIyd2lkdGglMjIlM0E2NTYlMkMlMjJoZWlnaHQlMjIlM0EzMDAlMkMlMjJsZWZ0JTIyJTNBNjAlMkMlMjJ0b3AlMjIlM0E5MzAlN0QlMkMlMjJ3aWR0aCUyMiUzQTc2JTJDJTIyaGVpZ2h0JTIyJTNBMTMwJTdEJTdE', // String, [获取打印报文]接口返回的print_info
|
||||
printNum: {
|
||||
curNum: 1, // 打印计数-当前张数
|
||||
sumNum: 2, // 打印计数-总张数
|
||||
},
|
||||
splitControl: 0 ,// 可不传, 默认为0, 根据自定义内容自动分页;1,禁止分页;2;强制分页, 内容打印在第二页
|
||||
showDeliveryLogo: 0, // 可不传, 默认为1, 传0时不展示快递公司logo
|
||||
// 自定义模板信息,没有自定义模板需求可不传
|
||||
|
||||
// 面单补充信息,用来覆盖寄件人信息,没有这种需求可以不传
|
||||
|
||||
}],
|
||||
printType: 1, // Number 打印类型,默认为 1,打印固定高度的面单;如果为2,则打印任意自定义内容,需要传递 size 参数指定纸张尺寸,printInfo 改为传递 base64 格式的 html
|
||||
size: {
|
||||
width: 76, // 纸张尺寸,单位毫米,printType 为 2 时必传
|
||||
height: 130
|
||||
},
|
||||
printer: 'Microsoft Print to PDF', // 选中的打印机,printer.name
|
||||
}))
|
||||
};
|
||||
|
||||
ws.onmessage = (e) => {
|
||||
const resp = JSON.parse(e.data || '{}')
|
||||
if (resp.command === 'print') {
|
||||
console.log('打印结果: ', resp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,482 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="订单号" prop="tid">
|
||||
<el-input
|
||||
v-model="queryParams.tid"
|
||||
placeholder="请输入订单号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in shopList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="下单日期" prop="orderCreateTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.orderCreateTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择订单创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单状态" prop="statusStr">
|
||||
<el-input
|
||||
v-model="queryParams.statusStr"
|
||||
placeholder="请输入订单状态"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
:loading="pullLoading"
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取订单</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-success"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleConfirm"
|
||||
>确认订单</el-button>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="isRowSelectable" />
|
||||
<el-table-column label="订单号" align="center" prop="orderId" />
|
||||
<el-table-column label="店铺" align="center" prop="shopId" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{ shopList.find(x=>x.id === scope.row.shopId).name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品" width="350">
|
||||
<template slot-scope="scope">
|
||||
<el-row v-for="item in scope.row.items" :key="item.id" :gutter="20">
|
||||
|
||||
<div style="float: left;display: flex;align-items: center;" >
|
||||
<el-image style="width: 70px; height: 70px;" :src="item.thumbImg"></el-image>
|
||||
<div style="margin-left:10px">
|
||||
<p>{{item.title}}</p>
|
||||
<p>{{item.skuAttrs}} </p>
|
||||
<p>
|
||||
<el-tag size="small">数量: {{item.skuCnt}}</el-tag>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额" align="center" prop="orderPrice" :formatter="amountFormatter">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ amountFormatter(null,null,scope.row.orderPrice/100,null) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收件人信息" align="center" prop="userName" >
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.userName}}</span><br />
|
||||
<span> {{scope.row.provinceName}} {{scope.row.cityName}} {{scope.row.countyName}}
|
||||
</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="订单状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 10 " size="small">待付款</el-tag>
|
||||
<el-tag v-if="scope.row.status === 20 " size="small">待发货</el-tag>
|
||||
<el-tag v-if="scope.row.status === 30 " size="small">待收货</el-tag>
|
||||
<el-tag v-if="scope.row.status === 100 " size="small">完成</el-tag>
|
||||
<br/>
|
||||
<el-tag style="margin-top: 5px" type="warning" v-if="!scope.row.confirmStatus || scope.row.confirmStatus === 0 " size="small">待确认</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="快递单号" align="center" prop="logisticsCode" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-success"
|
||||
:loading="pullLoading"
|
||||
@click="handlePullUpdate(scope.row)"
|
||||
>更新订单</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['xhs:order:remove']"
|
||||
>详情</el-button>
|
||||
<el-row>
|
||||
<el-button
|
||||
v-if="!scope.row.auditStatus||scope.row.auditStatus === 0"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-success"
|
||||
@click="handleConfirm(scope.row)"
|
||||
v-hasPermi="['xhs:order:edit']"
|
||||
>确认订单</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 确认订单、订单详情对话框 -->
|
||||
<el-dialog :title="detailTitle" :visible.sync="detailOpen" width="1100px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px" inline>
|
||||
<el-descriptions title="订单信息">
|
||||
<el-descriptions-item label="ID">{{form.id}}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单号">{{form.orderId}}</el-descriptions-item>
|
||||
<el-descriptions-item label="店铺">
|
||||
<el-tag > {{ shopList.find(x=>x.id === form.shopId)?shopList.find(x=>x.id === form.shopId).name:'' }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ parseTime(form.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="订单状态">
|
||||
<el-tag v-if="form.status === 10 " size="small">待付款</el-tag>
|
||||
<el-tag v-if="form.status === 20 " size="small">待发货</el-tag>
|
||||
<el-tag v-if="form.status === 30 " size="small">待收货</el-tag>
|
||||
<el-tag v-if="form.status === 100 " size="small">完成</el-tag>
|
||||
<el-tag v-if="form.status === 250 " size="small">订单自动取消</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
</el-descriptions>
|
||||
<el-descriptions title="付款信息">
|
||||
|
||||
<el-descriptions-item label="商品总价">{{amountFormatter(null,null,form.productPrice /100,null)}}</el-descriptions-item>
|
||||
<el-descriptions-item label="优惠金额">{{amountFormatter(null,null,form.discountedPrice /100,null)}}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="运费">{{amountFormatter(null,null,form.freight / 100,null)}}</el-descriptions-item>
|
||||
<el-descriptions-item label="订单金额">{{amountFormatter(null,null,form.orderPrice / 100,null)}}</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
|
||||
<el-descriptions title="收货信息">
|
||||
<el-descriptions-item label="收件人姓名">{{form.userName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="收件人手机号">{{form.telNumber}}</el-descriptions-item>
|
||||
<el-descriptions-item label="省市区">{{form.provinceName}}{{form.cityName}}{{form.countyName}}</el-descriptions-item>
|
||||
<el-descriptions-item label="详细地址">{{form.detailInfo}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions title="发货信息">
|
||||
<!-- <el-descriptions-item label="发货方式">
|
||||
<el-tag v-if="form.shipType === 1" type="danger">供应商代发</el-tag>
|
||||
<el-tag v-if="form.shipType === 0" type="danger">仓库发货</el-tag>
|
||||
</el-descriptions-item> -->
|
||||
<el-descriptions-item label="物流公司">{{form.expressCompanyCode}}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流单号">{{form.expressTrackingNo}}</el-descriptions-item>
|
||||
<el-descriptions-item label="发货时间"></el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider content-position="center">订单商品</el-divider>
|
||||
<el-table :data="goodsList" style="margin-bottom: 10px;">
|
||||
<el-table-column label="序号" align="center" type="index" width="50"/>
|
||||
|
||||
<el-table-column label="商品图片" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.thumbImg"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品标题" prop="title" ></el-table-column>
|
||||
<el-table-column label="SKU属性" prop="skuAttrs" ></el-table-column>
|
||||
<el-table-column label="sku编码" prop="skuCode"></el-table-column>
|
||||
<el-table-column label="单价" prop="salePrice"></el-table-column>
|
||||
<el-table-column label="数量" prop="skuCnt"></el-table-column>
|
||||
<el-table-column label="子订单金额" prop="realPrice"></el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
|
||||
<el-divider content-position="center">订单商品</el-divider>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddXhsOrderItem">添加赠品</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteXhsOrderItem">删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="xhsOrderItemList" :row-class-name="rowXhsOrderItemIndex" @selection-change="handleXhsOrderItemSelectionChange" ref="xhsOrderItem" style="margin-bottom: 10px;">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="商品" prop="erpGoodsId" width="350" >
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.erpGoodsSpecId" filterable remote reserve-keyword placeholder="搜索商品" style="width: 330px;"
|
||||
:remote-method="searchSku" :loading="skuListLoading" @change="skuChanage(scope.row)">
|
||||
<el-option v-for="item in skuList" :key="item.id"
|
||||
:label="item.name + ' - ' + item.colorValue + ' ' + item.sizeValue + ' ' + item.styleValue"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图片" prop="itemImage" >
|
||||
<template slot-scope="scope">
|
||||
<el-image style="width: 70px; height: 70px" :src="scope.row.itemImage"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="SKU编码" prop="itemSpecCode" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.itemSpecCode" placeholder="请输入规格" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" prop="price">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.price" placeholder="请输入单价" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" prop="quantity" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.quantity" placeholder="请输入数量" @input="qtyChange(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" prop="itemAmount">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.itemAmount" placeholder="请输入总金额" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item label="收件人姓名" prop="userName" v-if="isAudit">
|
||||
<el-input v-model="form.userName" placeholder="请输入收件人姓名" style="width:250px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收件人电话" prop="telNumber" v-if="isAudit">
|
||||
<el-input v-model="form.telNumber" placeholder="请输入收件人电话" style="width:250px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="详细地址" prop="detailInfo" v-if="isAudit">
|
||||
<el-input v-model="form.detailInfo" placeholder="请输入收件地址" style="width:250px" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitConfirmForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { listShop } from "@/api/shop/shop";
|
||||
import { searchSku } from "@/api/goods/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "../../../../utils/request";
|
||||
import {listOrder,getOrder,confirmOrder,pullOrder,pullOrderDetail} from "@/api/wei/order";
|
||||
import {pcaTextArr} from "element-china-area-data";
|
||||
|
||||
export default {
|
||||
name: "OrderWei",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
pullLoading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 淘宝订单表格数据
|
||||
orderList: [],
|
||||
shopList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
shopId: null,
|
||||
tid: null,
|
||||
status: null
|
||||
},
|
||||
isAudit:false,
|
||||
detailOpen:false,
|
||||
detailTitle:'',
|
||||
goodsList:[],
|
||||
pcaTextArr,
|
||||
// 表单参数
|
||||
form: {
|
||||
},
|
||||
rules: {
|
||||
userName: [{ required: true, message: "收件人姓名不能为空", trigger: "blur" }],
|
||||
telNumber: [{ required: true, message: "收件人电话不能为空", trigger: "blur" }],
|
||||
detailInfo: [{ required: true, message: "收件人详情不能为空", trigger: "blur" }],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type: 2}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
if (this.shopList && this.shopList.length > 0) {
|
||||
this.queryParams.shopId = this.shopList[0].id
|
||||
}
|
||||
this.getList();
|
||||
});
|
||||
// this.getList();
|
||||
},
|
||||
methods: {
|
||||
amountFormatter(row, column, cellValue, index) {
|
||||
return '¥' + parseFloat(cellValue).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
|
||||
},
|
||||
/** 查询淘宝订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listOrder(this.queryParams).then(response => {
|
||||
this.orderList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.detailOpen = false;
|
||||
this.saleAfterOpen = false
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
shopId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
isRowSelectable(row, index) {
|
||||
return !row.confirmStatus || row.confirmStatus === 0 ;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handlePull() {
|
||||
if(this.queryParams.shopId){
|
||||
this.pullLoading = true
|
||||
pullOrder({shopId:this.queryParams.shopId}).then(response => {
|
||||
console.log('拉取订单接口返回=====',response)
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.pullLoading = false
|
||||
this.getList()
|
||||
})
|
||||
}else{
|
||||
this.$modal.msgSuccess("请先选择店铺");
|
||||
}
|
||||
|
||||
// this.$modal.msgSuccess("请先配置API");
|
||||
},
|
||||
handlePullUpdate(row) {
|
||||
// 接口拉取订单并更新
|
||||
this.pullLoading = true
|
||||
pullOrderDetail({shopId:row.shopId,orderId:row.orderId}).then(response => {
|
||||
console.log('拉取订单详情返回接口返回=====',response)
|
||||
this.$modal.msgSuccess(JSON.stringify(response));
|
||||
this.pullLoading = false
|
||||
})
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOrder(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.goodsList = response.data.items;
|
||||
this.detailOpen = true;
|
||||
this.detailTitle = "订单详情";
|
||||
this.isAudit = false
|
||||
});
|
||||
},
|
||||
// handleConfirm(row) {
|
||||
// const ids = row.id || this.ids;
|
||||
// console.log('批量确认订单:',ids)
|
||||
// this.$modal.confirm('是否批量确认订单?').then(function() {
|
||||
// return orderConfirm({ids:ids});
|
||||
// }).then(() => {
|
||||
// this.getList();
|
||||
// this.$modal.msgSuccess("确认成功");
|
||||
// }).catch(() => {});
|
||||
// },
|
||||
handleConfirm(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getOrder(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.goodsList = response.data.items;
|
||||
this.detailOpen = true;
|
||||
this.detailTitle = "确认订单";
|
||||
this.isAudit = true
|
||||
});
|
||||
},
|
||||
submitConfirmForm(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
// this.form.xhsOrderItemList = this.xhsOrderItemList;
|
||||
confirmOrder(this.form).then(response => {
|
||||
this.$modal.msgSuccess("确认成功");
|
||||
this.detailOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in shopList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="pullType">
|
||||
<el-select v-model="queryParams.pullType" placeholder="请选择类型" clearable @change="handleQuery">
|
||||
<el-option label="拉取订单" value="ORDER"></el-option>
|
||||
<el-option label="拉取退款" value="REFUND"></el-option>
|
||||
<el-option label="拉取商品" value="GOODS"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="lists" >
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="店铺" align="center" prop="shopId" />
|
||||
<el-table-column label="平台" align="center" prop="shopType" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.shopType === 1">天猫</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.shopType === 2">京东</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" align="center" prop="pullType" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.pullType === 'GOODS'">拉取商品</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.pullType === 'ORDER'">拉取订单</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.pullType === 'REFUND'">拉取退款</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="方式" align="center" prop="pullWay" />
|
||||
|
||||
<el-table-column label="参数" align="center" prop="pullParams" />
|
||||
<el-table-column label="结果" align="center" prop="pullResult" />
|
||||
<el-table-column label="耗时(ms)" align="center" prop="duration" />
|
||||
<el-table-column label="时间" align="center" prop="pullTime" />
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
data() {
|
||||
return {
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
lists:[],
|
||||
shopList:[],
|
||||
skuList:[],
|
||||
// 是否显示弹出层
|
||||
detailOpen:false,
|
||||
skuListLoading:false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pullType: 'ORDER'
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
erpGoodsSkuId:null,
|
||||
id:null
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
erpGoodsSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listShop({}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
});
|
||||
this.getList();
|
||||
},
|
||||
mounted() {
|
||||
if(this.$route.query.shopId){
|
||||
this.queryParams.shopId = this.$route.query.shopId
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询淘宝订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listShopPullLogs(this.queryParams).then(response => {
|
||||
this.lists = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue