完善jd订单拉取
This commit is contained in:
parent
322f2f4fb9
commit
b49abfbb0a
1883
docs/qihang-erp.sql
1883
docs/qihang-erp.sql
File diff suppressed because it is too large
Load Diff
|
|
@ -22,55 +22,12 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-web</artifactId>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-undertow</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!–SpringCloud Alibaba nacos 服务发现依赖–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.qihang</groupId>-->
|
||||
<!-- <artifactId>security</artifactId>-->
|
||||
<!-- <version>1.0-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>mysql</groupId>-->
|
||||
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||
<!-- <version>8.0.33</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baomidou</groupId>-->
|
||||
<!-- <artifactId>mybatis-plus-spring-boot3-starter</artifactId>-->
|
||||
<!-- <version>3.5.5</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>jd</groupId>
|
||||
<artifactId>open-api-sdk</artifactId>
|
||||
<version>2.0-2024-03-04</version>
|
||||
<groupId>cn.qihangerp.open.jd</groupId>
|
||||
<artifactId>jd-api</artifactId>
|
||||
<version>1.5.4</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/open-api-sdk-2.0-2024-03-04.jar</systemPath>
|
||||
<systemPath>${project.basedir}/libs/jd-api-1.5.4.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
|
|
|
|||
|
|
@ -1,187 +0,0 @@
|
|||
package com.qihang.jd.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.jd.open.api.sdk.DefaultJdClient;
|
||||
import com.jd.open.api.sdk.JdClient;
|
||||
import com.jd.open.api.sdk.JdException;
|
||||
import com.jd.open.api.sdk.domain.ware.SkuReadService.response.searchSkuList.Sku;
|
||||
import com.jd.open.api.sdk.domain.ware.WareReadService.response.searchWare4Valid.Ware;
|
||||
import com.jd.open.api.sdk.request.order.OrderGetRequest;
|
||||
import com.jd.open.api.sdk.request.order.PopOrderEnSearchRequest;
|
||||
import com.jd.open.api.sdk.request.order.PopOrderSearchRequest;
|
||||
import com.jd.open.api.sdk.request.refundapply.PopAfsRefundapplyQuerybyidRequest;
|
||||
import com.jd.open.api.sdk.request.refundapply.PopAfsRefundapplyQuerylistRequest;
|
||||
import com.jd.open.api.sdk.request.ware.SkuReadSearchSkuListRequest;
|
||||
import com.jd.open.api.sdk.request.ware.WareReadSearchWare4ValidRequest;
|
||||
import com.jd.open.api.sdk.response.order.OrderGetResponse;
|
||||
import com.jd.open.api.sdk.response.order.PopOrderEnSearchResponse;
|
||||
import com.jd.open.api.sdk.response.order.PopOrderSearchResponse;
|
||||
import com.jd.open.api.sdk.response.refundapply.PopAfsRefundapplyQuerybyidResponse;
|
||||
import com.jd.open.api.sdk.response.refundapply.PopAfsRefundapplyQuerylistResponse;
|
||||
import com.jd.open.api.sdk.response.ware.SkuReadSearchSkuListResponse;
|
||||
import com.jd.open.api.sdk.response.ware.WareReadSearchWare4ValidResponse;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.jd.domain.JdGoods;
|
||||
import com.qihang.jd.domain.JdGoodsSku;
|
||||
import com.qihang.jd.domain.SysShopPullLogs;
|
||||
import com.qihang.jd.openApi.ApiCommon;
|
||||
import com.qihang.jd.openApi.PullRequest;
|
||||
import com.qihang.jd.service.JdGoodsService;
|
||||
import com.qihang.jd.service.SysShopPullLogsService;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/goods")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class GoodsApiController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final JdGoodsService goodsService;
|
||||
private final SysShopPullLogsService pullLogsService;
|
||||
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
Date currDateTime = new Date();
|
||||
long startTime = System.currentTimeMillis();
|
||||
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||
if (checkResult.getCode() != HttpStatus.SUCCESS) {
|
||||
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();
|
||||
|
||||
// String accessToken = "8abd974c62c34778935b34b5952e6f68izdk";
|
||||
// String appKey="FB4CC3688E6F9065D4FF510A53BB60FF";
|
||||
// String appSecret="40e8c8b2427f4e6db8f4a39af27d719e";
|
||||
JdClient client=new DefaultJdClient(serverUrl,accessToken,appKey,appSecret);
|
||||
//https://open.jd.com/home/home/#/doc/api?apiCateId=55&apiId=4246&apiName=jingdong.pop.order.search
|
||||
// PopOrderSearchRequest request=new PopOrderSearchRequest();
|
||||
// request.setStartDate("2024-2-14 10:00:00");
|
||||
// request.setEndDate("2024-3-4 12:00:00");
|
||||
// request.setOrderState("TRADE_CANCELED");
|
||||
// request.setOptionalFields("itemInfoList,orderId,isShipmenttype,scDT,idSopShipmenttype,orderStartTime,consigneeInfo");
|
||||
// request.setPage("1");
|
||||
// request.setPageSize("20");
|
||||
// request.setSortType(1);
|
||||
// request.setDateType(0);
|
||||
// PopOrderSearchResponse response=client.execute(request);
|
||||
// System.out.println(response);
|
||||
// PopOrderEnSearchRequest request=new PopOrderEnSearchRequest();
|
||||
// request.setStartDate("2020-04-04 00:20:35");
|
||||
// request.setEndDate("2020-04-04 00:20:35");
|
||||
// request.setOrderState("21");
|
||||
//// request.setOptionalFields("orderId,venderId");
|
||||
//// request.setSourceId("JOS");
|
||||
// request.setOptionalFields("itemInfoList,orderId,isShipmenttype,scDT,idSopShipmenttype,orderStartTime,consigneeInfo");
|
||||
// request.setPage("1");
|
||||
// request.setPageSize("10");
|
||||
// request.setSortType(1);
|
||||
// request.setDateType(0);
|
||||
// PopOrderEnSearchResponse response=client.execute(request);
|
||||
|
||||
//https://open.jd.com/home/home/#/doc/api?apiCateId=48&apiId=1587&apiName=jingdong.ware.read.searchWare4Valid
|
||||
WareReadSearchWare4ValidRequest request=new WareReadSearchWare4ValidRequest();
|
||||
request.setField("jdPrice,wareId,title,spuId,images,itemNum,outerId,logo,weight,width,height,length,modified,created,offlineTime,onlineTime,mobileDesc,afterSales,marketPrice,costPrice,brandName,stockNum,sellPoint,afterSaleDesc,categoryId");
|
||||
request.setWareStatusValue("8");
|
||||
request.setPageNo(1);
|
||||
request.setPageSize(100);
|
||||
WareReadSearchWare4ValidResponse response=client.execute(request);
|
||||
int successTotal = 0;
|
||||
if(response != null && response.getPage()!= null && response.getPage().getData()!=null){
|
||||
for (var ware: response.getPage().getData()){
|
||||
JdGoods jdGoods = new JdGoods();
|
||||
BeanUtils.copyProperties(ware,jdGoods);
|
||||
List<JdGoodsSku> skuList = new ArrayList<>();
|
||||
// 获取sku
|
||||
SkuReadSearchSkuListRequest request1=new SkuReadSearchSkuListRequest();
|
||||
request1.setWareId(ware.getWareId().toString());
|
||||
request1.setField("skuId,categoryId,stockNum,wareTitle,status,multiCateProps,outerId,jdPrice,logo,skuName,parentId,modified,created,saleAttrs,imgTag,currencySpuId");
|
||||
SkuReadSearchSkuListResponse response1=client.execute(request1);
|
||||
// System.out.println(response1);
|
||||
if(response1 != null && response1.getPage()!= null && response1.getPage().getData()!=null){
|
||||
for(var s : response1.getPage().getData()){
|
||||
JdGoodsSku sku = new JdGoodsSku();
|
||||
BeanUtils.copyProperties(s,sku);
|
||||
sku.setSaleAttrs(JSON.toJSONString(s.getSaleAttrs()));
|
||||
skuList.add(sku);
|
||||
}
|
||||
}
|
||||
jdGoods.setSkuList(skuList);
|
||||
goodsService.saveGoods(params.getShopId(),jdGoods);
|
||||
successTotal++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SysShopPullLogs logs = new SysShopPullLogs();
|
||||
|
||||
|
||||
logs.setShopId(params.getShopId());
|
||||
logs.setShopType(EnumShopType.JD.getIndex());
|
||||
logs.setPullType("GOODS");
|
||||
logs.setPullWay("主动拉取");
|
||||
logs.setPullParams("{WareStatusValue:8,PageNo:1,PageSize:100}");
|
||||
logs.setPullResult("{successTotal:"+successTotal+"}");
|
||||
logs.setPullTime(currDateTime);
|
||||
logs.setDuration(System.currentTimeMillis() - startTime);
|
||||
pullLogsService.save(logs);
|
||||
|
||||
//https://open.jd.com/home/home/#/doc/api?apiCateId=48&apiId=1227&apiName=jingdong.sku.read.searchSkuList
|
||||
// SkuReadSearchSkuListRequest request1=new SkuReadSearchSkuListRequest();
|
||||
|
||||
// request1.setWareId("10223753529");
|
||||
// request1.setField("skuId,categoryId,stockNum,wareTitle,status,multiCateProps,outerId,jdPrice,logo,skuName,parentId,modified,created,saleAttrs,imgTag,currencySpuId");
|
||||
// SkuReadSearchSkuListResponse response1=client.execute(request1);
|
||||
// System.out.println(response1);
|
||||
// SpuGetModelOrItemNumListRequest request=new SpuGetModelOrItemNumListRequest();
|
||||
// request.setUniqueCodeType(1);
|
||||
// request.setCategoryId(1233);
|
||||
// request.setPageNo(1);
|
||||
// request.setPageSize(10);
|
||||
// request.setBrandId(1122);
|
||||
// request.setAppId("1784");
|
||||
// request.setAppName("app名称");
|
||||
// request.setBusinessIdentity("JOS");
|
||||
// request.setIp("192.168.1.1");
|
||||
// request.setUserAgent("zhangsan");
|
||||
// SpuGetModelOrItemNumListResponse response=client.execute(request);
|
||||
|
||||
// //https://open.jd.com/home/home/#/doc/api?apiCateId=71&apiId=307&apiName=jingdong.pop.afs.refundapply.querylist
|
||||
// PopAfsRefundapplyQuerylistRequest request2=new PopAfsRefundapplyQuerylistRequest();
|
||||
//// request2.setStatus("1");
|
||||
//// request2.setId("111");
|
||||
//// request2.setOrderId("1234");
|
||||
//// request2.setBuyerId("abc");
|
||||
//// request2.setBuyerName("abc");
|
||||
//// request2.setApplyTimeStart("2023-12-01 16:11:40");
|
||||
//// request2.setApplyTimeEnd("2023-12-31 16:11:40");
|
||||
//// request2.setCheckTimeStart("2023-12-01 16:11:40");
|
||||
//// request2.setCheckTimeEnd("2023-12-31 16:11:40");
|
||||
// request2.setPageIndex(1);
|
||||
// request2.setPageSize(10);
|
||||
// PopAfsRefundapplyQuerylistResponse response2=client.execute(request2);
|
||||
// System.out.println(request2);
|
||||
|
||||
// PopAfsRefundapplyQuerybyidRequest request3=new PopAfsRefundapplyQuerybyidRequest();
|
||||
// request3.setRaId(23454754437L);
|
||||
// PopAfsRefundapplyQuerybyidResponse response3=client.execute(request3);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -22,10 +22,10 @@ public class HomeController {
|
|||
|
||||
@GetMapping("/")
|
||||
public String home(){
|
||||
MqMessage mqVo = MqMessage.build(EnumShopType.JD,1,"288531622338");
|
||||
|
||||
mqUtils.sendMessage("channel",mqVo);
|
||||
mqUtils.sendMessage("ApiMessage",mqVo);
|
||||
// MqMessage mqVo = MqMessage.build(EnumShopType.JD,1,"288531622338");
|
||||
//
|
||||
// mqUtils.sendMessage("channel",mqVo);
|
||||
// mqUtils.sendMessage("ApiMessage",mqVo);
|
||||
return "{'code':0,'msg':'请通过api访问'}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,47 @@
|
|||
package com.qihang.jd.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.common.enums.EnumShopType;
|
||||
import com.qihang.common.mq.MqMessage;
|
||||
import com.qihang.common.mq.MqType;
|
||||
import com.qihang.common.mq.MqUtils;
|
||||
import com.qihang.jd.domain.JdOrderAfter;
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
import com.qihang.jd.domain.bo.JdOrderPushBo;
|
||||
import com.qihang.jd.service.JdOrderAfterService;
|
||||
import com.qihang.jd.service.JdOrderService;
|
||||
import com.qihang.jd.service.JdRefundService;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/after")
|
||||
public class OrderAfterController extends BaseController {
|
||||
private final JdOrderService orderService;
|
||||
private final JdRefundService refundService;
|
||||
private final JdOrderAfterService afterService;
|
||||
private final MqUtils mqUtils;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo goodsList(JdAfterBo bo, PageQuery pageQuery) {
|
||||
PageResult<JdOrderAfter> result = afterService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
@PostMapping("/push_oms")
|
||||
@ResponseBody
|
||||
public AjaxResult pushOms(@RequestBody JdOrderPushBo bo) {
|
||||
// TODO:需要优化消息格式
|
||||
if(bo!=null && bo.getIds()!=null) {
|
||||
for(String id: bo.getIds()) {
|
||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, id));
|
||||
}
|
||||
}
|
||||
return success();
|
||||
}
|
||||
}
|
||||
//package com.qihang.jd.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.common.enums.EnumShopType;
|
||||
//import com.qihang.common.mq.MqMessage;
|
||||
//import com.qihang.common.mq.MqType;
|
||||
//import com.qihang.common.mq.MqUtils;
|
||||
//import com.qihang.jd.domain.JdOrderAfter;
|
||||
//import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
//import com.qihang.jd.domain.bo.JdOrderPushBo;
|
||||
//import com.qihang.jd.service.JdOrderAfterService;
|
||||
//import com.qihang.jd.service.JdOrderService;
|
||||
//import com.qihang.jd.service.JdRefundService;
|
||||
//import com.qihang.security.common.BaseController;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//@AllArgsConstructor
|
||||
//@RestController
|
||||
//@RequestMapping("/after")
|
||||
//public class OrderAfterController extends BaseController {
|
||||
// private final JdOrderService orderService;
|
||||
// private final JdRefundService refundService;
|
||||
// private final JdOrderAfterService afterService;
|
||||
// private final MqUtils mqUtils;
|
||||
// @RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
// public TableDataInfo goodsList(JdAfterBo bo, PageQuery pageQuery) {
|
||||
// PageResult<JdOrderAfter> result = afterService.queryPageList(bo, pageQuery);
|
||||
//
|
||||
// return getDataTable(result);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/push_oms")
|
||||
// @ResponseBody
|
||||
// public AjaxResult pushOms(@RequestBody JdOrderPushBo bo) {
|
||||
// // TODO:需要优化消息格式
|
||||
// if(bo!=null && bo.getIds()!=null) {
|
||||
// for(String id: bo.getIds()) {
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, id));
|
||||
// }
|
||||
// }
|
||||
// return success();
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,32 @@
|
|||
package com.qihang.jd.controller;
|
||||
|
||||
import cn.qihangerp.open.jd.OrderApiHelper;
|
||||
import cn.qihangerp.open.jd.common.ApiResultVo;
|
||||
import cn.qihangerp.open.jd.model.OrderInfo;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.common.mq.MqType;
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.qihang.jd.domain.OmsJdOrder;
|
||||
import com.qihang.jd.domain.OmsJdOrderItem;
|
||||
import com.qihang.jd.domain.SysShopPullLasttime;
|
||||
import com.qihang.jd.domain.SysShopPullLogs;
|
||||
import com.qihang.jd.openApi.ApiCommon;
|
||||
import com.qihang.jd.openApi.OrderApiHelper;
|
||||
import com.qihang.jd.openApi.PullRequest;
|
||||
import com.qihang.common.mq.MqMessage;
|
||||
import com.qihang.common.mq.MqUtils;
|
||||
import com.qihang.jd.service.JdOrderService;
|
||||
import com.qihang.jd.service.OmsJdOrderService;
|
||||
import com.qihang.jd.service.SysShopPullLasttimeService;
|
||||
import com.qihang.jd.service.SysShopPullLogsService;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -36,7 +38,7 @@ public class OrderApiController {
|
|||
private final ApiCommon apiCommon;
|
||||
// private final RedisCache redisCache;
|
||||
private final MqUtils mqUtils;
|
||||
private final JdOrderService orderService;
|
||||
private final OmsJdOrderService orderService;
|
||||
private final SysShopPullLasttimeService pullLasttimeService;
|
||||
private final SysShopPullLogsService pullLogsService;
|
||||
|
||||
|
|
@ -72,14 +74,35 @@ public class OrderApiController {
|
|||
endTime = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
//获取
|
||||
ApiResultVo<OrderInfo> upResult = OrderApiHelper.pullOrder(startTime,endTime,appKey,appSecret,accessToken);
|
||||
if(upResult.getCode()!=0) return AjaxResult.error(upResult.getMsg());
|
||||
|
||||
//第一次获取
|
||||
ResultVo<JdOrder> upResult = OrderApiHelper.pullOrder(startTime,endTime,1L,100L,serverUrl,appKey,appSecret,accessToken);
|
||||
int insertSuccess = 0;//新增成功的订单
|
||||
int totalError = 0;
|
||||
int hasExistOrder = 0;//已存在的订单数
|
||||
//循环插入订单数据到数据库
|
||||
for (var order : upResult.getList()) {
|
||||
for (var orderInfo : upResult.getList()) {
|
||||
//插入订单数据
|
||||
OmsJdOrder order = new OmsJdOrder();
|
||||
BeanUtils.copyProperties(orderInfo, order);
|
||||
order.setFullname(orderInfo.getConsigneeInfo().getFullname());
|
||||
order.setFullAddress(orderInfo.getConsigneeInfo().getFullAddress());
|
||||
order.setTelephone(orderInfo.getConsigneeInfo().getTelephone());
|
||||
order.setMobile(orderInfo.getConsigneeInfo().getMobile());
|
||||
order.setProvince(orderInfo.getConsigneeInfo().getProvince());
|
||||
order.setProvinceId(orderInfo.getConsigneeInfo().getProvinceId());
|
||||
order.setCity(orderInfo.getConsigneeInfo().getCity());
|
||||
order.setCityId(orderInfo.getConsigneeInfo().getCityId());
|
||||
order.setTown(orderInfo.getConsigneeInfo().getTown());
|
||||
order.setTownId(orderInfo.getConsigneeInfo().getTownId());
|
||||
List<OmsJdOrderItem> itemList = new ArrayList<>();
|
||||
for(var orderInfoItem :orderInfo.getItemInfoList()) {
|
||||
OmsJdOrderItem jdOrderItem = new OmsJdOrderItem();
|
||||
BeanUtils.copyProperties(orderInfoItem, jdOrderItem);
|
||||
itemList.add(jdOrderItem);
|
||||
}
|
||||
order.setItemList(itemList);
|
||||
//插入订单数据
|
||||
var result = orderService.saveOrder(params.getShopId(), order);
|
||||
if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import com.qihang.common.enums.EnumShopType;
|
|||
import com.qihang.common.mq.MqMessage;
|
||||
import com.qihang.common.mq.MqType;
|
||||
import com.qihang.common.mq.MqUtils;
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.qihang.jd.domain.OmsJdOrder;
|
||||
import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
import com.qihang.jd.domain.bo.JdOrderPushBo;
|
||||
import com.qihang.jd.service.JdOrderService;
|
||||
import com.qihang.jd.service.OmsJdOrderService;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -20,11 +20,11 @@ import org.springframework.web.bind.annotation.*;
|
|||
@RestController
|
||||
@RequestMapping("/order")
|
||||
public class OrderController extends BaseController {
|
||||
private final JdOrderService orderService;
|
||||
private final OmsJdOrderService orderService;
|
||||
private final MqUtils mqUtils;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo orderList(JdOrderBo bo, PageQuery pageQuery) {
|
||||
PageResult<JdOrder> result = orderService.queryPageList(bo, pageQuery);
|
||||
PageResult<OmsJdOrder> result = orderService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,240 +1,240 @@
|
|||
package com.qihang.jd.controller;
|
||||
|
||||
import com.jd.open.api.sdk.DefaultJdClient;
|
||||
import com.jd.open.api.sdk.JdClient;
|
||||
import com.jd.open.api.sdk.request.refundapply.PopAfsRefundapplyQuerylistRequest;
|
||||
import com.jd.open.api.sdk.request.shangjiashouhou.AscQueryListRequest;
|
||||
import com.jd.open.api.sdk.request.shangjiashouhou.AscQueryViewRequest;
|
||||
import com.jd.open.api.sdk.request.shangjiashouhou.AscServiceAndRefundViewRequest;
|
||||
import com.jd.open.api.sdk.request.shangjiashouhou.AscSyncListRequest;
|
||||
import com.jd.open.api.sdk.response.refundapply.PopAfsRefundapplyQuerylistResponse;
|
||||
import com.jd.open.api.sdk.response.shangjiashouhou.AscQueryListResponse;
|
||||
import com.jd.open.api.sdk.response.shangjiashouhou.AscQueryViewResponse;
|
||||
import com.jd.open.api.sdk.response.shangjiashouhou.AscServiceAndRefundViewResponse;
|
||||
import com.jd.open.api.sdk.response.shangjiashouhou.AscSyncListResponse;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.common.mq.MqMessage;
|
||||
import com.qihang.common.mq.MqType;
|
||||
import com.qihang.common.mq.MqUtils;
|
||||
import com.qihang.jd.domain.JdOrderAfter;
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.qihang.jd.domain.SysShopPullLasttime;
|
||||
import com.qihang.jd.domain.SysShopPullLogs;
|
||||
import com.qihang.jd.openApi.ApiCommon;
|
||||
import com.qihang.jd.openApi.PullRequest;
|
||||
import com.qihang.jd.service.JdOrderAfterService;
|
||||
import com.qihang.jd.service.JdRefundService;
|
||||
import com.qihang.jd.service.SysShopPullLasttimeService;
|
||||
import com.qihang.jd.service.SysShopPullLogsService;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
@RequestMapping("/refund")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class RefundApiController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final SysShopPullLogsService pullLogsService;
|
||||
private final JdRefundService refundService;
|
||||
private final MqUtils mqUtils;
|
||||
private final SysShopPullLasttimeService pullLasttimeService;
|
||||
private final JdOrderAfterService afterService;
|
||||
|
||||
/**
|
||||
* 拉取售后数据
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@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() != HttpStatus.SUCCESS) {
|
||||
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();
|
||||
String sellerId = checkResult.getData().getSellerId();
|
||||
|
||||
// 获取最后更新时间
|
||||
LocalDateTime startTime = null;
|
||||
LocalDateTime endTime = null;
|
||||
SysShopPullLasttime lasttime = pullLasttimeService.getLasttimeByShop(params.getShopId(), "REFUND");
|
||||
if (lasttime == null) {
|
||||
endTime = LocalDateTime.now();
|
||||
startTime = endTime.minusDays(1);
|
||||
} else {
|
||||
startTime = lasttime.getLasttime().minusHours(1);//取上次结束一个小时前
|
||||
endTime = startTime.plusDays(1);//取24小时
|
||||
if (endTime.isAfter(LocalDateTime.now())) {
|
||||
endTime = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
|
||||
String startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
String endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
JdClient client = new DefaultJdClient(serverUrl, accessToken, appKey, appSecret);
|
||||
|
||||
// 用于更新状态
|
||||
// https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2171&apiName=jingdong.asc.sync.list
|
||||
|
||||
|
||||
// https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2136&apiName=jingdong.asc.query.list
|
||||
AscQueryListRequest request = new AscQueryListRequest();
|
||||
request.setBuId(sellerId);
|
||||
request.setOperatePin("testPin");
|
||||
request.setOperateNick("testPin");
|
||||
request.setApplyTimeBegin(Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
request.setApplyTimeEnd(Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
request.setPageNumber(1);
|
||||
request.setPageSize(100);
|
||||
AscQueryListResponse response = client.execute(request);
|
||||
int insertSuccess = 0;
|
||||
int totalError = 0;
|
||||
int hasExist = 0;
|
||||
if (response != null && response.getPageResult() != null) {
|
||||
if (response.getPageResult().getData() != null) {
|
||||
for (var item : response.getPageResult().getData()) {
|
||||
JdOrderAfter after = new JdOrderAfter();
|
||||
BeanUtils.copyProperties(item, after);
|
||||
// // 详情 https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2118&apiName=jingdong.asc.query.view
|
||||
// AscQueryViewRequest request2=new AscQueryViewRequest();
|
||||
// request2.setBuId("10706");
|
||||
// request2.setOperatePin("testPin");
|
||||
// request2.setOperateNick("testPin");
|
||||
// request2.setServiceId(item.getServiceId());
|
||||
// request2.setOrderId(item.getOrderId());
|
||||
// AscQueryViewResponse response2=client.execute(request2);
|
||||
after.setShopId(params.getShopId());
|
||||
var result = afterService.saveAfter(params.getShopId(), after);
|
||||
if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||
//已经存在
|
||||
hasExist++;
|
||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, item.getServiceId().toString()));
|
||||
} else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
insertSuccess++;
|
||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, item.getServiceId().toString()));
|
||||
} else {
|
||||
totalError++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lasttime == null) {
|
||||
// 新增
|
||||
SysShopPullLasttime insertLasttime = new SysShopPullLasttime();
|
||||
insertLasttime.setShopId(params.getShopId());
|
||||
insertLasttime.setCreateTime(new Date());
|
||||
insertLasttime.setLasttime(endTime);
|
||||
insertLasttime.setPullType("REFUND");
|
||||
pullLasttimeService.save(insertLasttime);
|
||||
|
||||
} else {
|
||||
// 修改
|
||||
SysShopPullLasttime updateLasttime = new SysShopPullLasttime();
|
||||
updateLasttime.setId(lasttime.getId());
|
||||
updateLasttime.setUpdateTime(new Date());
|
||||
updateLasttime.setLasttime(endTime);
|
||||
pullLasttimeService.updateById(updateLasttime);
|
||||
}
|
||||
SysShopPullLogs logs = new SysShopPullLogs();
|
||||
logs.setShopId(params.getShopId());
|
||||
logs.setShopType(EnumShopType.JD.getIndex());
|
||||
logs.setPullType("REFUND");
|
||||
logs.setPullWay("主动拉取");
|
||||
logs.setPullParams("{ApplyTimeBegin:" + startTimeStr + ",ApplyTimeEnd:" + endTimeStr + ",PageIndex:1,PageSize:100}");
|
||||
logs.setPullResult("{total:" + insertSuccess + ",hasExist:" + hasExist + ",totalError:" + totalError + "}");
|
||||
logs.setPullTime(currDateTime);
|
||||
logs.setDuration(System.currentTimeMillis() - beginTime);
|
||||
pullLogsService.save(logs);
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,item.getId()));
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pull_update_status", method = RequestMethod.POST)
|
||||
public AjaxResult pullUpdateStatus(@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() != HttpStatus.SUCCESS) {
|
||||
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();
|
||||
String sellerId = checkResult.getData().getSellerId();
|
||||
|
||||
// 取24小时内的数据
|
||||
LocalDateTime endTime = LocalDateTime.now();
|
||||
LocalDateTime startTime = endTime.minusDays(1);
|
||||
|
||||
|
||||
String startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
String endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
JdClient client = new DefaultJdClient(serverUrl, accessToken, appKey, appSecret);
|
||||
|
||||
// 用于更新状态
|
||||
// https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2171&apiName=jingdong.asc.sync.list
|
||||
AscSyncListRequest request1 = new AscSyncListRequest();
|
||||
request1.setBuId(sellerId);
|
||||
request1.setOperatePin("testPin");
|
||||
request1.setOperateNick("testPin");
|
||||
request1.setUpdateTimeBegin(Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
request1.setUpdateTimeEnd(Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
request1.setPageNumber(1);
|
||||
request1.setPageSize(100);
|
||||
AscSyncListResponse response = client.execute(request1);
|
||||
if (response != null && response.getPageResult() != null) {
|
||||
if (response.getPageResult().getData() != null) {
|
||||
for (var item : response.getPageResult().getData()) {
|
||||
JdOrderAfter after = new JdOrderAfter();
|
||||
BeanUtils.copyProperties(item, after);
|
||||
after.setShopId(params.getShopId());
|
||||
var result = afterService.updateAfterStatusByServiceId(after);
|
||||
if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
// 更新成功,发送通知
|
||||
mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,result.getData().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SysShopPullLogs logs = new SysShopPullLogs();
|
||||
logs.setShopId(params.getShopId());
|
||||
logs.setShopType(EnumShopType.JD.getIndex());
|
||||
logs.setPullType("REFUND");
|
||||
logs.setPullWay("主动更新状态");
|
||||
logs.setPullParams("{ApplyTimeBegin:" + startTimeStr + ",ApplyTimeEnd:" + endTimeStr + ",PageIndex:1,PageSize:100}");
|
||||
logs.setPullResult("{total:,hasExist: ,totalError: }");
|
||||
logs.setPullTime(currDateTime);
|
||||
logs.setDuration(System.currentTimeMillis() - beginTime);
|
||||
pullLogsService.save(logs);
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,item.getId()));
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
//package com.qihang.jd.controller;
|
||||
//
|
||||
//import com.jd.open.api.sdk.DefaultJdClient;
|
||||
//import com.jd.open.api.sdk.JdClient;
|
||||
//import com.jd.open.api.sdk.request.refundapply.PopAfsRefundapplyQuerylistRequest;
|
||||
//import com.jd.open.api.sdk.request.shangjiashouhou.AscQueryListRequest;
|
||||
//import com.jd.open.api.sdk.request.shangjiashouhou.AscQueryViewRequest;
|
||||
//import com.jd.open.api.sdk.request.shangjiashouhou.AscServiceAndRefundViewRequest;
|
||||
//import com.jd.open.api.sdk.request.shangjiashouhou.AscSyncListRequest;
|
||||
//import com.jd.open.api.sdk.response.refundapply.PopAfsRefundapplyQuerylistResponse;
|
||||
//import com.jd.open.api.sdk.response.shangjiashouhou.AscQueryListResponse;
|
||||
//import com.jd.open.api.sdk.response.shangjiashouhou.AscQueryViewResponse;
|
||||
//import com.jd.open.api.sdk.response.shangjiashouhou.AscServiceAndRefundViewResponse;
|
||||
//import com.jd.open.api.sdk.response.shangjiashouhou.AscSyncListResponse;
|
||||
//import com.qihang.common.common.AjaxResult;
|
||||
//import com.qihang.common.common.ResultVoEnum;
|
||||
//import com.qihang.common.enums.EnumShopType;
|
||||
//import com.qihang.common.enums.HttpStatus;
|
||||
//import com.qihang.common.mq.MqMessage;
|
||||
//import com.qihang.common.mq.MqType;
|
||||
//import com.qihang.common.mq.MqUtils;
|
||||
//import com.qihang.jd.domain.JdOrderAfter;
|
||||
//import com.qihang.jd.domain.JdRefund;
|
||||
//import com.qihang.jd.domain.SysShopPullLasttime;
|
||||
//import com.qihang.jd.domain.SysShopPullLogs;
|
||||
//import com.qihang.jd.openApi.ApiCommon;
|
||||
//import com.qihang.jd.openApi.PullRequest;
|
||||
//import com.qihang.jd.service.JdOrderAfterService;
|
||||
//import com.qihang.jd.service.JdRefundService;
|
||||
//import com.qihang.jd.service.SysShopPullLasttimeService;
|
||||
//import com.qihang.jd.service.SysShopPullLogsService;
|
||||
//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;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import java.time.LocalDateTime;
|
||||
//import java.time.ZoneId;
|
||||
//import java.time.ZoneOffset;
|
||||
//import java.time.format.DateTimeFormatter;
|
||||
//import java.util.Date;
|
||||
//
|
||||
//@RequestMapping("/refund")
|
||||
//@RestController
|
||||
//@AllArgsConstructor
|
||||
//public class RefundApiController {
|
||||
// private final ApiCommon apiCommon;
|
||||
// private final SysShopPullLogsService pullLogsService;
|
||||
// private final JdRefundService refundService;
|
||||
// private final MqUtils mqUtils;
|
||||
// private final SysShopPullLasttimeService pullLasttimeService;
|
||||
// private final JdOrderAfterService afterService;
|
||||
//
|
||||
// /**
|
||||
// * 拉取售后数据
|
||||
// *
|
||||
// * @param params
|
||||
// * @return
|
||||
// * @throws Exception
|
||||
// */
|
||||
// @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() != HttpStatus.SUCCESS) {
|
||||
// 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();
|
||||
// String sellerId = checkResult.getData().getSellerId();
|
||||
//
|
||||
// // 获取最后更新时间
|
||||
// LocalDateTime startTime = null;
|
||||
// LocalDateTime endTime = null;
|
||||
// SysShopPullLasttime lasttime = pullLasttimeService.getLasttimeByShop(params.getShopId(), "REFUND");
|
||||
// if (lasttime == null) {
|
||||
// endTime = LocalDateTime.now();
|
||||
// startTime = endTime.minusDays(1);
|
||||
// } else {
|
||||
// startTime = lasttime.getLasttime().minusHours(1);//取上次结束一个小时前
|
||||
// endTime = startTime.plusDays(1);//取24小时
|
||||
// if (endTime.isAfter(LocalDateTime.now())) {
|
||||
// endTime = LocalDateTime.now();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// String startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
// String endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
// JdClient client = new DefaultJdClient(serverUrl, accessToken, appKey, appSecret);
|
||||
//
|
||||
// // 用于更新状态
|
||||
// // https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2171&apiName=jingdong.asc.sync.list
|
||||
//
|
||||
//
|
||||
// // https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2136&apiName=jingdong.asc.query.list
|
||||
// AscQueryListRequest request = new AscQueryListRequest();
|
||||
// request.setBuId(sellerId);
|
||||
// request.setOperatePin("testPin");
|
||||
// request.setOperateNick("testPin");
|
||||
// request.setApplyTimeBegin(Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
// request.setApplyTimeEnd(Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
// request.setPageNumber(1);
|
||||
// request.setPageSize(100);
|
||||
// AscQueryListResponse response = client.execute(request);
|
||||
// int insertSuccess = 0;
|
||||
// int totalError = 0;
|
||||
// int hasExist = 0;
|
||||
// if (response != null && response.getPageResult() != null) {
|
||||
// if (response.getPageResult().getData() != null) {
|
||||
// for (var item : response.getPageResult().getData()) {
|
||||
// JdOrderAfter after = new JdOrderAfter();
|
||||
// BeanUtils.copyProperties(item, after);
|
||||
//// // 详情 https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2118&apiName=jingdong.asc.query.view
|
||||
//// AscQueryViewRequest request2=new AscQueryViewRequest();
|
||||
//// request2.setBuId("10706");
|
||||
//// request2.setOperatePin("testPin");
|
||||
//// request2.setOperateNick("testPin");
|
||||
//// request2.setServiceId(item.getServiceId());
|
||||
//// request2.setOrderId(item.getOrderId());
|
||||
//// AscQueryViewResponse response2=client.execute(request2);
|
||||
// after.setShopId(params.getShopId());
|
||||
// var result = afterService.saveAfter(params.getShopId(), after);
|
||||
// if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
|
||||
// //已经存在
|
||||
// hasExist++;
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, item.getServiceId().toString()));
|
||||
// } else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
// insertSuccess++;
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE, item.getServiceId().toString()));
|
||||
// } else {
|
||||
// totalError++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (lasttime == null) {
|
||||
// // 新增
|
||||
// SysShopPullLasttime insertLasttime = new SysShopPullLasttime();
|
||||
// insertLasttime.setShopId(params.getShopId());
|
||||
// insertLasttime.setCreateTime(new Date());
|
||||
// insertLasttime.setLasttime(endTime);
|
||||
// insertLasttime.setPullType("REFUND");
|
||||
// pullLasttimeService.save(insertLasttime);
|
||||
//
|
||||
// } else {
|
||||
// // 修改
|
||||
// SysShopPullLasttime updateLasttime = new SysShopPullLasttime();
|
||||
// updateLasttime.setId(lasttime.getId());
|
||||
// updateLasttime.setUpdateTime(new Date());
|
||||
// updateLasttime.setLasttime(endTime);
|
||||
// pullLasttimeService.updateById(updateLasttime);
|
||||
// }
|
||||
// SysShopPullLogs logs = new SysShopPullLogs();
|
||||
// logs.setShopId(params.getShopId());
|
||||
// logs.setShopType(EnumShopType.JD.getIndex());
|
||||
// logs.setPullType("REFUND");
|
||||
// logs.setPullWay("主动拉取");
|
||||
// logs.setPullParams("{ApplyTimeBegin:" + startTimeStr + ",ApplyTimeEnd:" + endTimeStr + ",PageIndex:1,PageSize:100}");
|
||||
// logs.setPullResult("{total:" + insertSuccess + ",hasExist:" + hasExist + ",totalError:" + totalError + "}");
|
||||
// logs.setPullTime(currDateTime);
|
||||
// logs.setDuration(System.currentTimeMillis() - beginTime);
|
||||
// pullLogsService.save(logs);
|
||||
//// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,item.getId()));
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
//
|
||||
// @RequestMapping(value = "/pull_update_status", method = RequestMethod.POST)
|
||||
// public AjaxResult pullUpdateStatus(@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() != HttpStatus.SUCCESS) {
|
||||
// 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();
|
||||
// String sellerId = checkResult.getData().getSellerId();
|
||||
//
|
||||
// // 取24小时内的数据
|
||||
// LocalDateTime endTime = LocalDateTime.now();
|
||||
// LocalDateTime startTime = endTime.minusDays(1);
|
||||
//
|
||||
//
|
||||
// String startTimeStr = startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
// String endTimeStr = endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
// JdClient client = new DefaultJdClient(serverUrl, accessToken, appKey, appSecret);
|
||||
//
|
||||
// // 用于更新状态
|
||||
// // https://open.jd.com/home/home/#/doc/api?apiCateId=241&apiId=2171&apiName=jingdong.asc.sync.list
|
||||
// AscSyncListRequest request1 = new AscSyncListRequest();
|
||||
// request1.setBuId(sellerId);
|
||||
// request1.setOperatePin("testPin");
|
||||
// request1.setOperateNick("testPin");
|
||||
// request1.setUpdateTimeBegin(Date.from(startTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
// request1.setUpdateTimeEnd(Date.from(endTime.atZone(ZoneId.systemDefault()).toInstant()));
|
||||
// request1.setPageNumber(1);
|
||||
// request1.setPageSize(100);
|
||||
// AscSyncListResponse response = client.execute(request1);
|
||||
// if (response != null && response.getPageResult() != null) {
|
||||
// if (response.getPageResult().getData() != null) {
|
||||
// for (var item : response.getPageResult().getData()) {
|
||||
// JdOrderAfter after = new JdOrderAfter();
|
||||
// BeanUtils.copyProperties(item, after);
|
||||
// after.setShopId(params.getShopId());
|
||||
// var result = afterService.updateAfterStatusByServiceId(after);
|
||||
// if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
// // 更新成功,发送通知
|
||||
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,result.getData().toString()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// SysShopPullLogs logs = new SysShopPullLogs();
|
||||
// logs.setShopId(params.getShopId());
|
||||
// logs.setShopType(EnumShopType.JD.getIndex());
|
||||
// logs.setPullType("REFUND");
|
||||
// logs.setPullWay("主动更新状态");
|
||||
// logs.setPullParams("{ApplyTimeBegin:" + startTimeStr + ",ApplyTimeEnd:" + endTimeStr + ",PageIndex:1,PageSize:100}");
|
||||
// logs.setPullResult("{total:,hasExist: ,totalError: }");
|
||||
// logs.setPullTime(currDateTime);
|
||||
// logs.setDuration(System.currentTimeMillis() - beginTime);
|
||||
// pullLogsService.save(logs);
|
||||
//// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD, MqType.REFUND_MESSAGE,item.getId()));
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,74 +0,0 @@
|
|||
package com.qihang.jd.controller;
|
||||
|
||||
import com.jd.open.api.sdk.DefaultJdClient;
|
||||
import com.jd.open.api.sdk.JdClient;
|
||||
import com.jd.open.api.sdk.request.delivery.GetVenderAllDeliveryCompanyRequest;
|
||||
import com.jd.open.api.sdk.response.delivery.GetVenderAllDeliveryCompanyResponse;
|
||||
import com.qihang.common.api.ShopApiParams;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.jd.domain.SysLogisticsCompany;
|
||||
import com.qihang.jd.openApi.ApiCommon;
|
||||
import com.qihang.jd.openApi.PullRequest;
|
||||
import com.qihang.jd.service.SysLogisticsCompanyService;
|
||||
import com.qihang.jd.service.SysPlatformService;
|
||||
import com.qihang.jd.service.SysShopService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Log
|
||||
@RequestMapping("/shopApi")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class ShopApiController {
|
||||
private final ApiCommon apiCommon;
|
||||
private final SysPlatformService platformService;
|
||||
private final SysShopService shopService;
|
||||
private final SysLogisticsCompanyService logisticsCompanyService;
|
||||
|
||||
@RequestMapping(value = "/pull_logistics_companies", method = RequestMethod.POST)
|
||||
public AjaxResult pullLogisticsList(@RequestBody PullRequest params) throws Exception {
|
||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
var checkResult = apiCommon.checkBefore(params.getShopId());
|
||||
if (checkResult.getCode() != HttpStatus.SUCCESS) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg());
|
||||
}
|
||||
|
||||
ShopApiParams shopApiParams = checkResult.getData();
|
||||
String accessToken = shopApiParams.getAccessToken();
|
||||
String url = shopApiParams.getServerUrl();
|
||||
String appKey = shopApiParams.getAppKey();
|
||||
String appSecret = shopApiParams.getAppSecret();
|
||||
JdClient client=new DefaultJdClient(url,accessToken,appKey,appSecret);
|
||||
GetVenderAllDeliveryCompanyRequest request=new GetVenderAllDeliveryCompanyRequest();
|
||||
request.setFields("id,name,description");
|
||||
GetVenderAllDeliveryCompanyResponse response=client.execute(request);
|
||||
|
||||
if(response.getDeliveryList() !=null) {
|
||||
for (var item : response.getDeliveryList()) {
|
||||
SysLogisticsCompany lc = new SysLogisticsCompany();
|
||||
lc.setPlatformId(EnumShopType.JD.getIndex());
|
||||
lc.setShopId(params.getShopId());
|
||||
lc.setCode(item.getId() + "");
|
||||
lc.setName(item.getName());
|
||||
lc.setLogisticsId(item.getId());
|
||||
lc.setRemark(item.getDescription());
|
||||
logisticsCompanyService.insert(lc);
|
||||
log.info("=====添加快递公司JD=====");
|
||||
}
|
||||
|
||||
}else{
|
||||
AjaxResult.error(response.getMsg());
|
||||
}
|
||||
// System.out.println(rsp.getBody());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,307 +0,0 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName jd_order_item
|
||||
*/
|
||||
public class JdOrderItem implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 外键id(jd_order表id)
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 京东内部SKU的ID
|
||||
*/
|
||||
private String skuId;
|
||||
|
||||
/**
|
||||
* SKU外部ID(极端情况下不保证返回,建议从商品接口获取
|
||||
*/
|
||||
private String outerSkuId;
|
||||
|
||||
/**
|
||||
* 商品的名称+SKU规格
|
||||
*/
|
||||
private String skuName;
|
||||
|
||||
/**
|
||||
* SKU的京东价
|
||||
*/
|
||||
private String jdPrice;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
private String giftPoint;
|
||||
|
||||
/**
|
||||
* 京东内部商品ID(极端情况下不保证返回,建议从商品接口获取)
|
||||
*/
|
||||
private String wareId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String itemTotal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String productNo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String serviceName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String newStoreId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 外键id(jd_order表id)
|
||||
*/
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 外键id(jd_order表id)
|
||||
*/
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 京东内部SKU的ID
|
||||
*/
|
||||
public String getSkuId() {
|
||||
return skuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 京东内部SKU的ID
|
||||
*/
|
||||
public void setSkuId(String skuId) {
|
||||
this.skuId = skuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* SKU外部ID(极端情况下不保证返回,建议从商品接口获取
|
||||
*/
|
||||
public String getOuterSkuId() {
|
||||
return outerSkuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* SKU外部ID(极端情况下不保证返回,建议从商品接口获取
|
||||
*/
|
||||
public void setOuterSkuId(String outerSkuId) {
|
||||
this.outerSkuId = outerSkuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品的名称+SKU规格
|
||||
*/
|
||||
public String getSkuName() {
|
||||
return skuName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品的名称+SKU规格
|
||||
*/
|
||||
public void setSkuName(String skuName) {
|
||||
this.skuName = skuName;
|
||||
}
|
||||
|
||||
/**
|
||||
* SKU的京东价
|
||||
*/
|
||||
public String getJdPrice() {
|
||||
return jdPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* SKU的京东价
|
||||
*/
|
||||
public void setJdPrice(String jdPrice) {
|
||||
this.jdPrice = jdPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
public String getGiftPoint() {
|
||||
return giftPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
public void setGiftPoint(String giftPoint) {
|
||||
this.giftPoint = giftPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* 京东内部商品ID(极端情况下不保证返回,建议从商品接口获取)
|
||||
*/
|
||||
public String getWareId() {
|
||||
return wareId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 京东内部商品ID(极端情况下不保证返回,建议从商品接口获取)
|
||||
*/
|
||||
public void setWareId(String wareId) {
|
||||
this.wareId = wareId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
public String getItemTotal() {
|
||||
return itemTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
public void setItemTotal(String itemTotal) {
|
||||
this.itemTotal = itemTotal;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getProductNo() {
|
||||
return productNo;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setProductNo(String productNo) {
|
||||
this.productNo = productNo;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getNewStoreId() {
|
||||
return newStoreId;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setNewStoreId(String newStoreId) {
|
||||
this.newStoreId = newStoreId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
JdOrderItem other = (JdOrderItem) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
|
||||
&& (this.getSkuId() == null ? other.getSkuId() == null : this.getSkuId().equals(other.getSkuId()))
|
||||
&& (this.getOuterSkuId() == null ? other.getOuterSkuId() == null : this.getOuterSkuId().equals(other.getOuterSkuId()))
|
||||
&& (this.getSkuName() == null ? other.getSkuName() == null : this.getSkuName().equals(other.getSkuName()))
|
||||
&& (this.getJdPrice() == null ? other.getJdPrice() == null : this.getJdPrice().equals(other.getJdPrice()))
|
||||
&& (this.getGiftPoint() == null ? other.getGiftPoint() == null : this.getGiftPoint().equals(other.getGiftPoint()))
|
||||
&& (this.getWareId() == null ? other.getWareId() == null : this.getWareId().equals(other.getWareId()))
|
||||
&& (this.getItemTotal() == null ? other.getItemTotal() == null : this.getItemTotal().equals(other.getItemTotal()))
|
||||
&& (this.getProductNo() == null ? other.getProductNo() == null : this.getProductNo().equals(other.getProductNo()))
|
||||
&& (this.getServiceName() == null ? other.getServiceName() == null : this.getServiceName().equals(other.getServiceName()))
|
||||
&& (this.getNewStoreId() == null ? other.getNewStoreId() == null : this.getNewStoreId().equals(other.getNewStoreId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
|
||||
result = prime * result + ((getSkuId() == null) ? 0 : getSkuId().hashCode());
|
||||
result = prime * result + ((getOuterSkuId() == null) ? 0 : getOuterSkuId().hashCode());
|
||||
result = prime * result + ((getSkuName() == null) ? 0 : getSkuName().hashCode());
|
||||
result = prime * result + ((getJdPrice() == null) ? 0 : getJdPrice().hashCode());
|
||||
result = prime * result + ((getGiftPoint() == null) ? 0 : getGiftPoint().hashCode());
|
||||
result = prime * result + ((getWareId() == null) ? 0 : getWareId().hashCode());
|
||||
result = prime * result + ((getItemTotal() == null) ? 0 : getItemTotal().hashCode());
|
||||
result = prime * result + ((getProductNo() == null) ? 0 : getProductNo().hashCode());
|
||||
result = prime * result + ((getServiceName() == null) ? 0 : getServiceName().hashCode());
|
||||
result = prime * result + ((getNewStoreId() == null) ? 0 : getNewStoreId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", orderId=").append(orderId);
|
||||
sb.append(", skuId=").append(skuId);
|
||||
sb.append(", outerSkuId=").append(outerSkuId);
|
||||
sb.append(", skuName=").append(skuName);
|
||||
sb.append(", jdPrice=").append(jdPrice);
|
||||
sb.append(", giftPoint=").append(giftPoint);
|
||||
sb.append(", wareId=").append(wareId);
|
||||
sb.append(", itemTotal=").append(itemTotal);
|
||||
sb.append(", productNo=").append(productNo);
|
||||
sb.append(", serviceName=").append(serviceName);
|
||||
sb.append(", newStoreId=").append(newStoreId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName jd_refund
|
||||
*/
|
||||
public class JdRefund implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 退款单id
|
||||
*/
|
||||
private String refundId;
|
||||
|
||||
/**
|
||||
* 客户帐号
|
||||
*/
|
||||
private String buyerId;
|
||||
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
private String buyerName;
|
||||
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
private String checkTime;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private String applyTime;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private String applyRefundSum;
|
||||
|
||||
/**
|
||||
* 审核状态: 0代表未审核, 1代表审核通过 2代表审核不通过 3代表京东财务审核通过;4代表京东财务审核不通过
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String checkUsername;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款单id
|
||||
*/
|
||||
public String getRefundId() {
|
||||
return refundId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款单id
|
||||
*/
|
||||
public void setRefundId(String refundId) {
|
||||
this.refundId = refundId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户帐号
|
||||
*/
|
||||
public String getBuyerId() {
|
||||
return buyerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户帐号
|
||||
*/
|
||||
public void setBuyerId(String buyerId) {
|
||||
this.buyerId = buyerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
public String getBuyerName() {
|
||||
return buyerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
public void setBuyerName(String buyerName) {
|
||||
this.buyerName = buyerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
public String getCheckTime() {
|
||||
return checkTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核日期
|
||||
*/
|
||||
public void setCheckTime(String checkTime) {
|
||||
this.checkTime = checkTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
public String getApplyTime() {
|
||||
return applyTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
public void setApplyTime(String applyTime) {
|
||||
this.applyTime = applyTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
public String getApplyRefundSum() {
|
||||
return applyRefundSum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
public void setApplyRefundSum(String applyRefundSum) {
|
||||
this.applyRefundSum = applyRefundSum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核状态: 0代表未审核, 1代表审核通过 2代表审核不通过 3代表京东财务审核通过;4代表京东财务审核不通过
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核状态: 0代表未审核, 1代表审核通过 2代表审核不通过 3代表京东财务审核通过;4代表京东财务审核不通过
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
public String getCheckUsername() {
|
||||
return checkUsername;
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
public void setCheckUsername(String checkUsername) {
|
||||
this.checkUsername = checkUsername;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
JdRefund other = (JdRefund) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
|
||||
&& (this.getRefundId() == null ? other.getRefundId() == null : this.getRefundId().equals(other.getRefundId()))
|
||||
&& (this.getBuyerId() == null ? other.getBuyerId() == null : this.getBuyerId().equals(other.getBuyerId()))
|
||||
&& (this.getBuyerName() == null ? other.getBuyerName() == null : this.getBuyerName().equals(other.getBuyerName()))
|
||||
&& (this.getCheckTime() == null ? other.getCheckTime() == null : this.getCheckTime().equals(other.getCheckTime()))
|
||||
&& (this.getApplyTime() == null ? other.getApplyTime() == null : this.getApplyTime().equals(other.getApplyTime()))
|
||||
&& (this.getApplyRefundSum() == null ? other.getApplyRefundSum() == null : this.getApplyRefundSum().equals(other.getApplyRefundSum()))
|
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
|
||||
&& (this.getCheckUsername() == null ? other.getCheckUsername() == null : this.getCheckUsername().equals(other.getCheckUsername()))
|
||||
&& (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
|
||||
result = prime * result + ((getRefundId() == null) ? 0 : getRefundId().hashCode());
|
||||
result = prime * result + ((getBuyerId() == null) ? 0 : getBuyerId().hashCode());
|
||||
result = prime * result + ((getBuyerName() == null) ? 0 : getBuyerName().hashCode());
|
||||
result = prime * result + ((getCheckTime() == null) ? 0 : getCheckTime().hashCode());
|
||||
result = prime * result + ((getApplyTime() == null) ? 0 : getApplyTime().hashCode());
|
||||
result = prime * result + ((getApplyRefundSum() == null) ? 0 : getApplyRefundSum().hashCode());
|
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
|
||||
result = prime * result + ((getCheckUsername() == null) ? 0 : getCheckUsername().hashCode());
|
||||
result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", shopId=").append(shopId);
|
||||
sb.append(", refundId=").append(refundId);
|
||||
sb.append(", buyerId=").append(buyerId);
|
||||
sb.append(", buyerName=").append(buyerName);
|
||||
sb.append(", checkTime=").append(checkTime);
|
||||
sb.append(", applyTime=").append(applyTime);
|
||||
sb.append(", applyRefundSum=").append(applyRefundSum);
|
||||
sb.append(", status=").append(status);
|
||||
sb.append(", checkUsername=").append(checkUsername);
|
||||
sb.append(", orderId=").append(orderId);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 京东商品表
|
||||
* @TableName oms_jd_goods
|
||||
*/
|
||||
@Data
|
||||
public class OmsJdGoods implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long wareId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 商品状态 -1:删除 1:从未上架 2:自主下架 4:系统下架 8:上架 513:从未上架待审 514:自主下架待审 516:系统下架待审 520:上架待审核 1028:系统下架审核失败
|
||||
*/
|
||||
private Integer wareStatus;
|
||||
|
||||
/**
|
||||
* 商品外部ID,商家自行设置的ID(便于关联京东商品)
|
||||
*/
|
||||
private String outerId;
|
||||
|
||||
/**
|
||||
* 商品货号
|
||||
*/
|
||||
private String itemNum;
|
||||
|
||||
/**
|
||||
* 商品的条形码.UPC码,SN码,PLU码统称为条形码
|
||||
*/
|
||||
private String barCode;
|
||||
|
||||
/**
|
||||
* 商品最后一次修改时间
|
||||
*/
|
||||
private String modified;
|
||||
|
||||
/**
|
||||
* 商品创建时间,只读属性
|
||||
*/
|
||||
private String created;
|
||||
|
||||
/**
|
||||
* 最后下架时间
|
||||
*/
|
||||
private Date offlineTime;
|
||||
|
||||
/**
|
||||
* 最后上架时间
|
||||
*/
|
||||
private Date onlineTime;
|
||||
|
||||
/**
|
||||
* 发货地
|
||||
*/
|
||||
private String delivery;
|
||||
|
||||
/**
|
||||
* 包装清单
|
||||
*/
|
||||
private String packListing;
|
||||
|
||||
/**
|
||||
* 包装规格
|
||||
*/
|
||||
private String wrap;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Double weight;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer width;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer height;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer length;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String mobileDesc;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String afterSales;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal marketPrice;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal costPrice;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal jdPrice;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String brandName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
* 店铺id(sys_shop表id)
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String sellPoint;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String afterSaleDesc;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String spuId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 京东商品SKU表
|
||||
* @TableName oms_jd_goods_sku
|
||||
*/
|
||||
@Data
|
||||
public class OmsJdGoodsSku implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long wareId;
|
||||
|
||||
/**
|
||||
* skuid
|
||||
*/
|
||||
private Long skuId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private BigDecimal jdPrice;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String outerId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String barCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String saleAttrs;
|
||||
|
||||
/**
|
||||
* sku属性名称
|
||||
*/
|
||||
private String attrs;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String skuName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date modified;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date created;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String currencySpuId;
|
||||
|
||||
/**
|
||||
* erp商品id
|
||||
*/
|
||||
private Long erpGoodsId;
|
||||
|
||||
/**
|
||||
* erp商品sku id
|
||||
*/
|
||||
private Long erpGoodsSkuId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 京东订单表
|
||||
* @TableName oms_jd_order
|
||||
*/
|
||||
@Data
|
||||
public class OmsJdOrder implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单id(京东平台)
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商家id
|
||||
*/
|
||||
private String venderId;
|
||||
|
||||
/**
|
||||
* 订单类型(22 SOP;75 LOC) 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String orderType;
|
||||
|
||||
/**
|
||||
* 支付方式(1货到付款, 2邮局汇款, 3自提, 4在线支付, 5公司转账, 6银行卡转账)
|
||||
*/
|
||||
private String payType;
|
||||
|
||||
/**
|
||||
* 订单总金额。总金额=订单金额(不减优惠,不加运费服务费税费)
|
||||
*/
|
||||
private String orderTotalPrice;
|
||||
|
||||
/**
|
||||
* 订单货款金额(订单总金额-商家优惠金额)
|
||||
*/
|
||||
private String orderSellerPrice;
|
||||
|
||||
/**
|
||||
* 用户应付金额。应付款=货款-用户优惠-余额+运费+税费+服务费。
|
||||
*/
|
||||
private String orderPayment;
|
||||
|
||||
/**
|
||||
* 商品的运费
|
||||
*/
|
||||
private String freightPrice;
|
||||
|
||||
/**
|
||||
* 商家优惠金额
|
||||
*/
|
||||
private String sellerDiscount;
|
||||
|
||||
/**
|
||||
* 1)WAIT_SELLER_STOCK_OUT 等待出库 2)WAIT_GOODS_RECEIVE_CONFIRM 等待确认收货 3)WAIT_SELLER_DELIVERY等待发货(只适用于海外购商家,含义为'等待境内发货'标签下的订单,非海外购商家无需使用) 4) POP_ORDER_PAUSE POP暂停 5)FINISHED_L 完成 6)TRADE_CANCELED 取消 7)LOCKED 已锁定 8)WAIT_SEND_CODE 等待发码
|
||||
*/
|
||||
private String orderState;
|
||||
|
||||
/**
|
||||
* 订单状态说明(中文)
|
||||
*/
|
||||
private String orderStateRemark;
|
||||
|
||||
/**
|
||||
* 送货(日期)类型(1-只工作日送货(双休日、假日不用送);2-只双休日、假日送货(工作日不用送);3-工作日、双休日与假日均可送货;其他值-返回“任意时间”)
|
||||
*/
|
||||
private String deliveryType;
|
||||
|
||||
/**
|
||||
* 发票信息 “invoice_info: 不需要开具发票”下无需开具发票;其它返回值请正常开具发票 。(没有电子发票具体信息)
|
||||
*/
|
||||
private String invoiceInfo;
|
||||
|
||||
/**
|
||||
* 普通发票纳税人识别码
|
||||
*/
|
||||
private String invoiceCode;
|
||||
|
||||
/**
|
||||
* 买家下单时订单备注
|
||||
*/
|
||||
private String orderRemark;
|
||||
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
private String orderStartTime;
|
||||
|
||||
/**
|
||||
* 结单时间 如返回信息为“0001-01-01 00:00:00”和“1970-01-01 00:00:00”,可认为此订单为未完成状态。
|
||||
*/
|
||||
private String orderEndTime;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String fullname;
|
||||
|
||||
/**
|
||||
* 固定电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String fullAddress;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String county;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String town;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String provinceId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String cityId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String countyId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String townId;
|
||||
|
||||
/**
|
||||
* 商家订单备注(不大于500字符) 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String venderRemark;
|
||||
|
||||
/**
|
||||
* 余额支付金额 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String balanceUsed;
|
||||
|
||||
/**
|
||||
* 买家的账号信息
|
||||
*/
|
||||
private String pin;
|
||||
|
||||
/**
|
||||
* 售后订单标记 0:不是换货订单 1返修发货,直接赔偿,客服补件 2售后调货 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String returnOrder;
|
||||
|
||||
/**
|
||||
* 付款确认时间 如果没有付款时间 默认返回0001-01-01 00:00:00 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String paymentConfirmTime;
|
||||
|
||||
/**
|
||||
* 运单号(当厂家自送时运单号可为空,不同物流公司的运单号用|分隔,如果同一物流公司有多个运单号,则用英文逗号分隔) 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String waybill;
|
||||
|
||||
/**
|
||||
* 物流公司ID 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String logisticsId;
|
||||
|
||||
/**
|
||||
* 订单更新时间
|
||||
*/
|
||||
private String modified;
|
||||
|
||||
/**
|
||||
* 直接父订单号 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String directParentOrderId;
|
||||
|
||||
/**
|
||||
* 根父订单号 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String parentOrderId;
|
||||
|
||||
/**
|
||||
* 订单来源。如:移动端订单
|
||||
*/
|
||||
private String orderSource;
|
||||
|
||||
/**
|
||||
* 京仓订单/云仓订单/空“”
|
||||
*/
|
||||
private String storeOrder;
|
||||
|
||||
/**
|
||||
* 是否京配。68=京配,69=京配自提
|
||||
*/
|
||||
private String idSopShipmenttype;
|
||||
|
||||
/**
|
||||
* 买家的账号信息(区分大小写) 可选字段,需要在输入参数optional_fields中写入才能返回
|
||||
*/
|
||||
private String realPin;
|
||||
|
||||
/**
|
||||
* 买家的账号信息
|
||||
*/
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
* 买家的账号信息(区分大小写) 可选字段
|
||||
*/
|
||||
private String openIdBuyer;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 订单审核状态(0待审核1已审核)
|
||||
*/
|
||||
private Integer auditStatus;
|
||||
|
||||
/**
|
||||
* 订单审核时间
|
||||
*/
|
||||
private Date auditTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<OmsJdOrderItem> itemList;
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 京东订单明细表
|
||||
* @TableName oms_jd_order_item
|
||||
*/
|
||||
@Data
|
||||
public class OmsJdOrderItem implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单id(京东平台)
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 京东内部SKU的ID
|
||||
*/
|
||||
private String skuId;
|
||||
|
||||
/**
|
||||
* SKU外部ID(极端情况下不保证返回,建议从商品接口获取
|
||||
*/
|
||||
private String outerSkuId;
|
||||
|
||||
/**
|
||||
* 商品的名称+SKU规格
|
||||
*/
|
||||
private String skuName;
|
||||
|
||||
/**
|
||||
* SKU的京东价
|
||||
*/
|
||||
private String jdPrice;
|
||||
|
||||
/**
|
||||
* 赠送积分
|
||||
*/
|
||||
private String giftPoint;
|
||||
|
||||
/**
|
||||
* 京东内部商品ID(极端情况下不保证返回,建议从商品接口获取)
|
||||
*/
|
||||
private String wareId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String itemTotal;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String productNo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String serviceName;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String newStoreId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据中心-店铺
|
||||
* @TableName s_shop
|
||||
*/
|
||||
@Data
|
||||
public class SShop implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 店铺别名
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
private String ename;
|
||||
|
||||
/**
|
||||
* 店铺主题
|
||||
*/
|
||||
private String company;
|
||||
|
||||
/**
|
||||
* 对应第三方平台Id
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 店铺url
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer ordernum;
|
||||
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Integer isdelete;
|
||||
|
||||
/**
|
||||
* 是否显示(0:是1否)
|
||||
*/
|
||||
private Integer isshow;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Long modifyOn;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 第三方平台店铺id,淘宝天猫开放平台使用
|
||||
*/
|
||||
private Long selleruserid;
|
||||
|
||||
/**
|
||||
* 卖家userId
|
||||
*/
|
||||
private String selleruseridstr;
|
||||
|
||||
/**
|
||||
* 第三方平台sessionKey(access_token)
|
||||
*/
|
||||
private String sessionkey;
|
||||
|
||||
/**
|
||||
* Appkey
|
||||
*/
|
||||
private String appkey;
|
||||
|
||||
/**
|
||||
* Appsercet
|
||||
*/
|
||||
private String appsercet;
|
||||
|
||||
/**
|
||||
* 到期
|
||||
*/
|
||||
private Long expiresIn;
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
private Long accessTokenBegin;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
private String refreshToken;
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
private Long refreshTokenTimeout;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
private String apiRequestUrl;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 第三方平台设置
|
||||
* @TableName s_shop_setting
|
||||
*/
|
||||
@Data
|
||||
public class SShopSetting implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 配置名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* appKey
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* appSecret
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 阿里access token
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 到期
|
||||
*/
|
||||
private Long expiresIn;
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
private Long accessTokenBegin;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
private String refreshToken;
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
private Long refreshTokenTimeout;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Long modifyOn;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
private String requestUrl;
|
||||
|
||||
/**
|
||||
* 第三方店铺id
|
||||
*/
|
||||
private String thirdId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -1,197 +0,0 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName sys_platform
|
||||
*/
|
||||
public class SysPlatform implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 平台名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 平台编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 平台回调uri
|
||||
*/
|
||||
private String redirectUri;
|
||||
|
||||
/**
|
||||
* 接口访问地址
|
||||
*/
|
||||
private String serverUrl;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台编码
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台编码
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getAppKey() {
|
||||
return appKey;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setAppKey(String appKey) {
|
||||
this.appKey = appKey;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public String getAppSecret() {
|
||||
return appSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setAppSecret(String appSecret) {
|
||||
this.appSecret = appSecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台回调uri
|
||||
*/
|
||||
public String getRedirectUri() {
|
||||
return redirectUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台回调uri
|
||||
*/
|
||||
public void setRedirectUri(String redirectUri) {
|
||||
this.redirectUri = redirectUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口访问地址
|
||||
*/
|
||||
public String getServerUrl() {
|
||||
return serverUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 接口访问地址
|
||||
*/
|
||||
public void setServerUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SysPlatform other = (SysPlatform) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
|
||||
&& (this.getAppKey() == null ? other.getAppKey() == null : this.getAppKey().equals(other.getAppKey()))
|
||||
&& (this.getAppSecret() == null ? other.getAppSecret() == null : this.getAppSecret().equals(other.getAppSecret()))
|
||||
&& (this.getRedirectUri() == null ? other.getRedirectUri() == null : this.getRedirectUri().equals(other.getRedirectUri()))
|
||||
&& (this.getServerUrl() == null ? other.getServerUrl() == null : this.getServerUrl().equals(other.getServerUrl()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
|
||||
result = prime * result + ((getAppKey() == null) ? 0 : getAppKey().hashCode());
|
||||
result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().hashCode());
|
||||
result = prime * result + ((getRedirectUri() == null) ? 0 : getRedirectUri().hashCode());
|
||||
result = prime * result + ((getServerUrl() == null) ? 0 : getServerUrl().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", code=").append(code);
|
||||
sb.append(", appKey=").append(appKey);
|
||||
sb.append(", appSecret=").append(appSecret);
|
||||
sb.append(", redirectUri=").append(redirectUri);
|
||||
sb.append(", serverUrl=").append(serverUrl);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,417 +0,0 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据中心-店铺
|
||||
* @TableName sys_shop
|
||||
*/
|
||||
public class SysShop implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 店铺名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 对应第三方平台Id
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 店铺url
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态(1正常2已删除)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Long modifyOn;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 第三方平台店铺id,淘宝天猫开放平台使用
|
||||
*/
|
||||
private Long sellerId;
|
||||
|
||||
/**
|
||||
* Appkey
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* Appsercet
|
||||
*/
|
||||
private String appSercet;
|
||||
|
||||
/**
|
||||
* 第三方平台sessionKey(access_token)
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* 到期
|
||||
*/
|
||||
private Long expiresIn;
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
private Long accessTokenBegin;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
private String refreshToken;
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
private Long refreshTokenTimeout;
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
// private String apiRequestUrl;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺名
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺名
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应第三方平台Id
|
||||
*/
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应第三方平台Id
|
||||
*/
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺url
|
||||
*/
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺url
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态(1正常2已删除)
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态(1正常2已删除)
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
public Long getModifyOn() {
|
||||
return modifyOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
public void setModifyOn(Long modifyOn) {
|
||||
this.modifyOn = modifyOn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方平台店铺id,淘宝天猫开放平台使用
|
||||
*/
|
||||
public Long getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方平台店铺id,淘宝天猫开放平台使用
|
||||
*/
|
||||
public void setSellerId(Long sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appkey
|
||||
*/
|
||||
public String getAppKey() {
|
||||
return appKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appkey
|
||||
*/
|
||||
public void setAppKey(String appKey) {
|
||||
this.appKey = appKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appsercet
|
||||
*/
|
||||
public String getAppSercet() {
|
||||
return appSercet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appsercet
|
||||
*/
|
||||
public void setAppSercet(String appSercet) {
|
||||
this.appSercet = appSercet;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方平台sessionKey(access_token)
|
||||
*/
|
||||
public String getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第三方平台sessionKey(access_token)
|
||||
*/
|
||||
public void setAccessToken(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 到期
|
||||
*/
|
||||
public Long getExpiresIn() {
|
||||
return expiresIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 到期
|
||||
*/
|
||||
public void setExpiresIn(Long expiresIn) {
|
||||
this.expiresIn = expiresIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
public Long getAccessTokenBegin() {
|
||||
return accessTokenBegin;
|
||||
}
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
public void setAccessTokenBegin(Long accessTokenBegin) {
|
||||
this.accessTokenBegin = accessTokenBegin;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
public String getRefreshToken() {
|
||||
return refreshToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
public void setRefreshToken(String refreshToken) {
|
||||
this.refreshToken = refreshToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
public Long getRefreshTokenTimeout() {
|
||||
return refreshTokenTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
public void setRefreshTokenTimeout(Long refreshTokenTimeout) {
|
||||
this.refreshTokenTimeout = refreshTokenTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求url
|
||||
*/
|
||||
// public String getApiRequestUrl() {
|
||||
// return apiRequestUrl;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 请求url
|
||||
// */
|
||||
// public void setApiRequestUrl(String apiRequestUrl) {
|
||||
// this.apiRequestUrl = apiRequestUrl;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SysShop other = (SysShop) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getUrl() == null ? other.getUrl() == null : this.getUrl().equals(other.getUrl()))
|
||||
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
|
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
|
||||
&& (this.getModifyOn() == null ? other.getModifyOn() == null : this.getModifyOn().equals(other.getModifyOn()))
|
||||
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
|
||||
&& (this.getSellerId() == null ? other.getSellerId() == null : this.getSellerId().equals(other.getSellerId()))
|
||||
&& (this.getAppKey() == null ? other.getAppKey() == null : this.getAppKey().equals(other.getAppKey()))
|
||||
&& (this.getAppSercet() == null ? other.getAppSercet() == null : this.getAppSercet().equals(other.getAppSercet()))
|
||||
&& (this.getAccessToken() == null ? other.getAccessToken() == null : this.getAccessToken().equals(other.getAccessToken()))
|
||||
&& (this.getExpiresIn() == null ? other.getExpiresIn() == null : this.getExpiresIn().equals(other.getExpiresIn()))
|
||||
&& (this.getAccessTokenBegin() == null ? other.getAccessTokenBegin() == null : this.getAccessTokenBegin().equals(other.getAccessTokenBegin()))
|
||||
&& (this.getRefreshToken() == null ? other.getRefreshToken() == null : this.getRefreshToken().equals(other.getRefreshToken()))
|
||||
&& (this.getRefreshTokenTimeout() == null ? other.getRefreshTokenTimeout() == null : this.getRefreshTokenTimeout().equals(other.getRefreshTokenTimeout()));
|
||||
// && (this.getApiRequestUrl() == null ? other.getApiRequestUrl() == null : this.getApiRequestUrl().equals(other.getApiRequestUrl()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getUrl() == null) ? 0 : getUrl().hashCode());
|
||||
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
|
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
|
||||
result = prime * result + ((getModifyOn() == null) ? 0 : getModifyOn().hashCode());
|
||||
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
|
||||
result = prime * result + ((getSellerId() == null) ? 0 : getSellerId().hashCode());
|
||||
result = prime * result + ((getAppKey() == null) ? 0 : getAppKey().hashCode());
|
||||
result = prime * result + ((getAppSercet() == null) ? 0 : getAppSercet().hashCode());
|
||||
result = prime * result + ((getAccessToken() == null) ? 0 : getAccessToken().hashCode());
|
||||
result = prime * result + ((getExpiresIn() == null) ? 0 : getExpiresIn().hashCode());
|
||||
result = prime * result + ((getAccessTokenBegin() == null) ? 0 : getAccessTokenBegin().hashCode());
|
||||
result = prime * result + ((getRefreshToken() == null) ? 0 : getRefreshToken().hashCode());
|
||||
result = prime * result + ((getRefreshTokenTimeout() == null) ? 0 : getRefreshTokenTimeout().hashCode());
|
||||
// result = prime * result + ((getApiRequestUrl() == null) ? 0 : getApiRequestUrl().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", name=").append(name);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", url=").append(url);
|
||||
sb.append(", sort=").append(sort);
|
||||
sb.append(", status=").append(status);
|
||||
sb.append(", modifyOn=").append(modifyOn);
|
||||
sb.append(", remark=").append(remark);
|
||||
sb.append(", sellerId=").append(sellerId);
|
||||
sb.append(", appKey=").append(appKey);
|
||||
sb.append(", appSercet=").append(appSercet);
|
||||
sb.append(", accessToken=").append(accessToken);
|
||||
sb.append(", expiresIn=").append(expiresIn);
|
||||
sb.append(", accessTokenBegin=").append(accessTokenBegin);
|
||||
sb.append(", refreshToken=").append(refreshToken);
|
||||
sb.append(", refreshTokenTimeout=").append(refreshTokenTimeout);
|
||||
// sb.append(", apiRequestUrl=").append(apiRequestUrl);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
|
@ -8,16 +10,17 @@ import java.util.Date;
|
|||
* 店铺更新最后时间记录
|
||||
* @TableName sys_shop_pull_lasttime
|
||||
*/
|
||||
@TableName("s_shop_pull_lasttime")
|
||||
public class SysShopPullLasttime implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 类型(ORDER:订单,REFUND:退款)
|
||||
|
|
@ -44,28 +47,28 @@ public class SysShopPullLasttime implements Serializable {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public Integer getId() {
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.qihang.jd.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -7,6 +9,7 @@ import java.util.Date;
|
|||
* 更新日志表
|
||||
* @TableName sys_shop_pull_logs
|
||||
*/
|
||||
@TableName("s_shop_pull_logs")
|
||||
public class SysShopPullLogs implements Serializable {
|
||||
/**
|
||||
* 主键Id
|
||||
|
|
@ -16,7 +19,7 @@ public class SysShopPullLogs implements Serializable {
|
|||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
private Long shopId;
|
||||
private Integer shopType;
|
||||
|
||||
/**
|
||||
|
|
@ -68,14 +71,14 @@ public class SysShopPullLogs implements Serializable {
|
|||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public Integer getShopId() {
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
public void setShopId(Integer shopId) {
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ import java.io.Serializable;
|
|||
|
||||
@Data
|
||||
public class JdOrderBo implements Serializable {
|
||||
/**
|
||||
* 商品标题
|
||||
*/
|
||||
private String orderId;
|
||||
private Integer shopId;
|
||||
private String orderState;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.JdOrderItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order_item】的数据库操作Mapper
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
* @Entity com.qihang.jd.domain.JdOrderItem
|
||||
*/
|
||||
public interface JdOrderItemMapper extends BaseMapper<JdOrderItem> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order(京东订单表)】的数据库操作Mapper
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
* @Entity com.qihang.jd.domain.JdOrder
|
||||
*/
|
||||
public interface JdOrderMapper extends BaseMapper<JdOrder> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_refund】的数据库操作Mapper
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
* @Entity com.qihang.jd.domain.JdRefund
|
||||
*/
|
||||
public interface JdRefundMapper extends BaseMapper<JdRefund> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdGoods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods(京东商品表)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
* @Entity com.qihang.jd.domain.OmsJdGoods
|
||||
*/
|
||||
public interface OmsJdGoodsMapper extends BaseMapper<OmsJdGoods> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods_sku(京东商品SKU表)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
* @Entity com.qihang.jd.domain.OmsJdGoodsSku
|
||||
*/
|
||||
public interface OmsJdGoodsSkuMapper extends BaseMapper<OmsJdGoodsSku> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdOrderItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order_item(京东订单明细表)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
* @Entity com.qihang.jd.domain.OmsJdOrderItem
|
||||
*/
|
||||
public interface OmsJdOrderItemMapper extends BaseMapper<OmsJdOrderItem> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order(京东订单表)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
* @Entity com.qihang.jd.domain.OmsJdOrder
|
||||
*/
|
||||
public interface OmsJdOrderMapper extends BaseMapper<OmsJdOrder> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.SShop;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
* @Entity com.qihang.jd.domain.SShop
|
||||
*/
|
||||
public interface SShopMapper extends BaseMapper<SShop> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.SShopSetting;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Mapper
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
* @Entity com.qihang.jd.domain.SShopSetting
|
||||
*/
|
||||
public interface SShopSettingMapper extends BaseMapper<SShopSetting> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.SysPlatform;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_platform】的数据库操作Mapper
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
* @Entity com.qihang.jd.domain.SysPlatform
|
||||
*/
|
||||
public interface SysPlatformMapper extends BaseMapper<SysPlatform> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.jd.mapper;
|
||||
|
||||
import com.qihang.jd.domain.SysShop;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Mapper
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
* @Entity com.qihang.jd.domain.SysShop
|
||||
*/
|
||||
public interface SysShopMapper extends BaseMapper<SysShop> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -4,9 +4,9 @@ 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.jd.domain.SysPlatform;
|
||||
import com.qihang.jd.service.SysPlatformService;
|
||||
import com.qihang.jd.service.SysShopService;
|
||||
import com.qihang.jd.domain.SShopSetting;
|
||||
import com.qihang.jd.service.SShopService;
|
||||
import com.qihang.jd.service.SShopSettingService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -14,8 +14,8 @@ import org.springframework.util.StringUtils;
|
|||
@AllArgsConstructor
|
||||
@Component
|
||||
public class ApiCommon {
|
||||
private final SysShopService shopService;
|
||||
private final SysPlatformService platformService;
|
||||
private final SShopService shopService;
|
||||
private final SShopSettingService platformService;
|
||||
// private final ServerConfig serverConfig;
|
||||
/**
|
||||
* 更新前的检查
|
||||
|
|
@ -24,7 +24,7 @@ public class ApiCommon {
|
|||
* @return
|
||||
* @throws
|
||||
*/
|
||||
public ResultVo<ShopApiParams> checkBefore(Integer shopId) {
|
||||
public ResultVo<ShopApiParams> checkBefore(Long shopId) {
|
||||
var shop = shopService.selectShopById(shopId);
|
||||
if (shop == null) {
|
||||
// return new ApiResult<>(EnumResultVo.ParamsError.getIndex(), "参数错误,没有找到店铺");
|
||||
|
|
@ -34,7 +34,7 @@ public class ApiCommon {
|
|||
if (shop.getType() != EnumShopType.JD.getIndex()) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是JD店铺");
|
||||
}
|
||||
SysPlatform platform = platformService.selectById(EnumShopType.JD.getIndex());
|
||||
SShopSetting platform = platformService.getById(EnumShopType.JD.getIndex());
|
||||
|
||||
if (!StringUtils.hasText(platform.getAppKey())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
||||
|
|
@ -42,12 +42,12 @@ public class ApiCommon {
|
|||
if (!StringUtils.hasText(platform.getAppSecret())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
||||
}
|
||||
if (!StringUtils.hasText(platform.getRedirectUri())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到RedirectUri");
|
||||
}
|
||||
if (!StringUtils.hasText(platform.getServerUrl())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||
}
|
||||
// if (!StringUtils.hasText(platform.getRedirectUri())) {
|
||||
// return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到RedirectUri");
|
||||
// }
|
||||
// if (!StringUtils.hasText(platform.getServerUrl())) {
|
||||
// return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||
// }
|
||||
|
||||
// if(shop.getSellerId() == null || shop.getSellerId() <= 0) {
|
||||
// return com.qihang.tao.common.ApiResult.build(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到SellerUserId");
|
||||
|
|
@ -56,12 +56,12 @@ public class ApiCommon {
|
|||
ShopApiParams params = new ShopApiParams();
|
||||
params.setAppKey(platform.getAppKey());
|
||||
params.setAppSecret(platform.getAppSecret());
|
||||
params.setAccessToken(shop.getAccessToken());
|
||||
params.setTokenRequestUrl(platform.getRedirectUri());
|
||||
params.setApiRequestUrl(platform.getServerUrl());
|
||||
params.setServerUrl(platform.getServerUrl());
|
||||
params.setSellerId(shop.getSellerId().toString());
|
||||
if (!StringUtils.hasText(shop.getAccessToken())) {
|
||||
params.setAccessToken(shop.getSessionkey());
|
||||
// params.setTokenRequestUrl(platform.getRedirectUri());
|
||||
// params.setApiRequestUrl(platform.getServerUrl());
|
||||
// params.setServerUrl(platform.getServerUrl());
|
||||
params.setSellerId(shop.getSelleruserid().toString());
|
||||
if (!StringUtils.hasText(shop.getSessionkey())) {
|
||||
|
||||
return ResultVo.error(HttpStatus.UNAUTHORIZED, "Token已过期,请重新授权", params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,239 +0,0 @@
|
|||
package com.qihang.jd.openApi;
|
||||
|
||||
import com.jd.open.api.sdk.DefaultJdClient;
|
||||
import com.jd.open.api.sdk.JdClient;
|
||||
import com.jd.open.api.sdk.request.order.PopOrderEnSearchRequest;
|
||||
import com.jd.open.api.sdk.response.order.PopOrderEnSearchResponse;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.qihang.jd.domain.JdOrderItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
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 ResultVo<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 ResultVo.error(HttpStatus.ERROR, "接口调用错误" );
|
||||
}
|
||||
if(!response.getSearchorderinfoResult().getApiResult().getSuccess()){
|
||||
return ResultVo.error(HttpStatus.ERROR, "接口调用错误:"+ response.getSearchorderinfoResult().getApiResult().getChineseErrCode());
|
||||
}
|
||||
if(response.getSearchorderinfoResult().getOrderTotal() == 0){
|
||||
return ResultVo.success(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 ResultVo.success(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);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
@ -4,5 +4,5 @@ import lombok.Data;
|
|||
|
||||
@Data
|
||||
public class PullRequest {
|
||||
private Integer shopId;//店铺Id
|
||||
private Long shopId;//店铺Id
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.qihang.common.common.PageResult;
|
|||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.JdGoods;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.qihang.jd.domain.bo.JdGoodsBo;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import com.qihang.common.common.PageResult;
|
|||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.JdOrderAfter;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.JdOrderItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order_item】的数据库操作Service
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
public interface JdOrderItemService extends IService<JdOrderItem> {
|
||||
|
||||
}
|
||||
//package com.qihang.jd.service;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_order_item】的数据库操作Service
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//public interface JdOrderItemService extends IService<JdOrderItem> {
|
||||
//
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.JdOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order(京东订单表)】的数据库操作Service
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
public interface JdOrderService extends IService<JdOrder> {
|
||||
PageResult<JdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery);
|
||||
ResultVo<Integer> saveOrder(Integer shopId, JdOrder order);
|
||||
}
|
||||
//package com.qihang.jd.service;
|
||||
//
|
||||
//import com.qihang.common.common.PageQuery;
|
||||
//import com.qihang.common.common.PageResult;
|
||||
//import com.qihang.common.common.ResultVo;
|
||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
||||
//import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_order(京东订单表)】的数据库操作Service
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//public interface JdOrderService extends IService<JdOrder> {
|
||||
// PageResult<JdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery);
|
||||
// ResultVo<Integer> saveOrder(Integer shopId, JdOrder order);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_refund】的数据库操作Service
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
public interface JdRefundService extends IService<JdRefund> {
|
||||
PageResult<JdRefund> queryPageList(JdAfterBo bo, PageQuery pageQuery);
|
||||
ResultVo<Integer> saveRefund(Integer shopId, JdRefund refund);
|
||||
}
|
||||
//package com.qihang.jd.service;
|
||||
//
|
||||
//import com.qihang.common.common.PageQuery;
|
||||
//import com.qihang.common.common.PageResult;
|
||||
//import com.qihang.common.common.ResultVo;
|
||||
//import com.baomidou.mybatisplus.extension.service.IService;
|
||||
//import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_refund】的数据库操作Service
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//public interface JdRefundService extends IService<JdRefund> {
|
||||
// PageResult<JdRefund> queryPageList(JdAfterBo bo, PageQuery pageQuery);
|
||||
// ResultVo<Integer> saveRefund(Integer shopId, JdRefund refund);
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdGoods;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods(京东商品表)】的数据库操作Service
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
public interface OmsJdGoodsService extends IService<OmsJdGoods> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods_sku(京东商品SKU表)】的数据库操作Service
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
public interface OmsJdGoodsSkuService extends IService<OmsJdGoodsSku> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.OmsJdOrderItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order_item(京东订单明细表)】的数据库操作Service
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
*/
|
||||
public interface OmsJdOrderItemService extends IService<OmsJdOrderItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.jd.domain.OmsJdOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order(京东订单表)】的数据库操作Service
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
*/
|
||||
public interface OmsJdOrderService extends IService<OmsJdOrder> {
|
||||
PageResult<OmsJdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery);
|
||||
ResultVo<Integer> saveOrder(Long shopId, OmsJdOrder order);
|
||||
OmsJdOrder queryDetailById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.SShop;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
*/
|
||||
public interface SShopService extends IService<SShop> {
|
||||
SShop selectShopById(Long shopId);
|
||||
void updateSessionKey(Long shopId, String sessionKey);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.SShopSetting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Service
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
*/
|
||||
public interface SShopSettingService extends IService<SShopSetting> {
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.SysPlatform;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_platform】的数据库操作Service
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
*/
|
||||
public interface SysPlatformService extends IService<SysPlatform> {
|
||||
SysPlatform selectById(Integer id);
|
||||
}
|
||||
|
|
@ -9,5 +9,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @createDate 2024-03-10 12:15:10
|
||||
*/
|
||||
public interface SysShopPullLasttimeService extends IService<SysShopPullLasttime> {
|
||||
SysShopPullLasttime getLasttimeByShop(Integer shopId,String pullType);
|
||||
SysShopPullLasttime getLasttimeByShop(Long shopId,String pullType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package com.qihang.jd.service;
|
||||
|
||||
import com.qihang.jd.domain.SysShop;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Service
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
*/
|
||||
public interface SysShopService extends IService<SysShop> {
|
||||
SysShop selectShopById(Integer shopId);
|
||||
|
||||
void updateSessionKey(Integer shopId,String sessionKey);
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ import com.qihang.common.common.PageResult;
|
|||
import com.qihang.common.common.ResultVo;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.jd.domain.JdOrderAfter;
|
||||
import com.qihang.jd.domain.JdRefund;
|
||||
import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
import com.qihang.jd.service.JdOrderAfterService;
|
||||
import com.qihang.jd.mapper.JdOrderAfterMapper;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.JdOrderItem;
|
||||
import com.qihang.jd.service.JdOrderItemService;
|
||||
import com.qihang.jd.mapper.JdOrderItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order_item】的数据库操作Service实现
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
@Service
|
||||
public class JdOrderItemServiceImpl extends ServiceImpl<JdOrderItemMapper, JdOrderItem>
|
||||
implements JdOrderItemService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//package com.qihang.jd.service.impl;
|
||||
//
|
||||
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
//import com.qihang.jd.service.JdOrderItemService;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_order_item】的数据库操作Service实现
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//@Service
|
||||
//public class JdOrderItemServiceImpl extends ServiceImpl<JdOrderItemMapper, JdOrderItem>
|
||||
// implements JdOrderItemService{
|
||||
//
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,107 +1,103 @@
|
|||
package com.qihang.jd.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.jd.domain.JdOrder;
|
||||
import com.qihang.jd.domain.JdOrderItem;
|
||||
import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
import com.qihang.jd.mapper.JdOrderItemMapper;
|
||||
import com.qihang.jd.service.JdOrderService;
|
||||
import com.qihang.jd.mapper.JdOrderMapper;
|
||||
|
||||
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.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_order(京东订单表)】的数据库操作Service实现
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class JdOrderServiceImpl extends ServiceImpl<JdOrderMapper, JdOrder>
|
||||
implements JdOrderService{
|
||||
private final JdOrderMapper mapper;
|
||||
private final JdOrderItemMapper itemMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<JdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<JdOrder> queryWrapper = new LambdaQueryWrapper<JdOrder>()
|
||||
.eq(bo.getShopId()!=null,JdOrder::getShopId,bo.getShopId())
|
||||
.eq(StringUtils.hasText(bo.getOrderId()),JdOrder::getOrderId,bo.getOrderId())
|
||||
;
|
||||
|
||||
Page<JdOrder> taoGoodsPage = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
if(taoGoodsPage.getRecords()!=null){
|
||||
for (var order:taoGoodsPage.getRecords()) {
|
||||
order.setItems(itemMapper.selectList(new LambdaQueryWrapper<JdOrderItem>().eq(JdOrderItem::getOrderId,order.getId())));
|
||||
}
|
||||
}
|
||||
return PageResult.build(taoGoodsPage);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultVo<Integer> saveOrder(Integer shopId, JdOrder order) {
|
||||
try {
|
||||
List<JdOrder> jdOrders = mapper.selectList(new LambdaQueryWrapper<JdOrder>().eq(JdOrder::getOrderId, order.getOrderId()));
|
||||
if (jdOrders != null && jdOrders.size() > 0) {
|
||||
// 存在,修改
|
||||
JdOrder update = new JdOrder();
|
||||
update.setId(jdOrders.get(0).getId());
|
||||
update.setOrderState(order.getOrderState());
|
||||
update.setOrderStateRemark(order.getOrderStateRemark());
|
||||
update.setInvoiceCode(order.getInvoiceCode());
|
||||
update.setOrderEndTime(order.getOrderEndTime());
|
||||
update.setModified(order.getModified());
|
||||
update.setVenderRemark(order.getVenderRemark());
|
||||
update.setReturnOrder(order.getReturnOrder());
|
||||
update.setPaymentConfirmTime(order.getPaymentConfirmTime());
|
||||
update.setWaybill(order.getWaybill());
|
||||
update.setLogisticsId(order.getLogisticsId());
|
||||
mapper.updateById(update);
|
||||
// 更新item
|
||||
for (var item : order.getItems()) {
|
||||
List<JdOrderItem> taoOrderItems = itemMapper.selectList(new LambdaQueryWrapper<JdOrderItem>().eq(JdOrderItem::getSkuId, item.getSkuId()));
|
||||
if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
||||
// 不处理
|
||||
} else {
|
||||
// 新增
|
||||
item.setOrderId(update.getId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
}
|
||||
return ResultVo.error(ResultVoEnum.DataExist, "订单已经存在,更新成功");
|
||||
} else {
|
||||
// 不存在,新增
|
||||
order.setShopId(shopId);
|
||||
order.setCreateTime(new Date());
|
||||
mapper.insert(order);
|
||||
// 添加item
|
||||
for (var item : order.getItems()) {
|
||||
item.setOrderId(order.getId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
return ResultVo.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//package com.qihang.jd.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.jd.domain.bo.JdOrderBo;
|
||||
//import com.qihang.jd.service.JdOrderService;
|
||||
//
|
||||
//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.util.Date;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_order(京东订单表)】的数据库操作Service实现
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//@AllArgsConstructor
|
||||
//@Service
|
||||
//public class JdOrderServiceImpl extends ServiceImpl<JdOrderMapper, JdOrder>
|
||||
// implements JdOrderService{
|
||||
// private final JdOrderMapper mapper;
|
||||
// private final JdOrderItemMapper itemMapper;
|
||||
//
|
||||
// @Override
|
||||
// public PageResult<JdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery) {
|
||||
// LambdaQueryWrapper<JdOrder> queryWrapper = new LambdaQueryWrapper<JdOrder>()
|
||||
// .eq(bo.getShopId()!=null,JdOrder::getShopId,bo.getShopId())
|
||||
// .eq(StringUtils.hasText(bo.getOrderId()),JdOrder::getOrderId,bo.getOrderId())
|
||||
// ;
|
||||
//
|
||||
// Page<JdOrder> taoGoodsPage = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
// if(taoGoodsPage.getRecords()!=null){
|
||||
// for (var order:taoGoodsPage.getRecords()) {
|
||||
// order.setItems(itemMapper.selectList(new LambdaQueryWrapper<JdOrderItem>().eq(JdOrderItem::getOrderId,order.getId())));
|
||||
// }
|
||||
// }
|
||||
// return PageResult.build(taoGoodsPage);
|
||||
// }
|
||||
//
|
||||
// @Transactional
|
||||
// @Override
|
||||
// public ResultVo<Integer> saveOrder(Integer shopId, JdOrder order) {
|
||||
// try {
|
||||
// List<JdOrder> jdOrders = mapper.selectList(new LambdaQueryWrapper<JdOrder>().eq(JdOrder::getOrderId, order.getOrderId()));
|
||||
// if (jdOrders != null && jdOrders.size() > 0) {
|
||||
// // 存在,修改
|
||||
// JdOrder update = new JdOrder();
|
||||
// update.setId(jdOrders.get(0).getId());
|
||||
// update.setOrderState(order.getOrderState());
|
||||
// update.setOrderStateRemark(order.getOrderStateRemark());
|
||||
// update.setInvoiceCode(order.getInvoiceCode());
|
||||
// update.setOrderEndTime(order.getOrderEndTime());
|
||||
// update.setModified(order.getModified());
|
||||
// update.setVenderRemark(order.getVenderRemark());
|
||||
// update.setReturnOrder(order.getReturnOrder());
|
||||
// update.setPaymentConfirmTime(order.getPaymentConfirmTime());
|
||||
// update.setWaybill(order.getWaybill());
|
||||
// update.setLogisticsId(order.getLogisticsId());
|
||||
// mapper.updateById(update);
|
||||
// // 更新item
|
||||
// for (var item : order.getItems()) {
|
||||
// List<JdOrderItem> taoOrderItems = itemMapper.selectList(new LambdaQueryWrapper<JdOrderItem>().eq(JdOrderItem::getSkuId, item.getSkuId()));
|
||||
// if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
||||
// // 不处理
|
||||
// } else {
|
||||
// // 新增
|
||||
// item.setOrderId(update.getId());
|
||||
// itemMapper.insert(item);
|
||||
// }
|
||||
// }
|
||||
// return ResultVo.error(ResultVoEnum.DataExist, "订单已经存在,更新成功");
|
||||
// } else {
|
||||
// // 不存在,新增
|
||||
// order.setShopId(shopId);
|
||||
// order.setCreateTime(new Date());
|
||||
// mapper.insert(order);
|
||||
// // 添加item
|
||||
// for (var item : order.getItems()) {
|
||||
// item.setOrderId(order.getId());
|
||||
// itemMapper.insert(item);
|
||||
// }
|
||||
// return ResultVo.success();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,71 +1,69 @@
|
|||
package com.qihang.jd.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.jd.domain.JdRefund;
|
||||
import com.qihang.jd.domain.bo.JdAfterBo;
|
||||
import com.qihang.jd.service.JdRefundService;
|
||||
import com.qihang.jd.mapper.JdRefundMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【jd_refund】的数据库操作Service实现
|
||||
* @createDate 2024-03-09 11:29:59
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class JdRefundServiceImpl extends ServiceImpl<JdRefundMapper, JdRefund>
|
||||
implements JdRefundService{
|
||||
private final JdRefundMapper mapper;
|
||||
|
||||
@Override
|
||||
public PageResult<JdRefund> queryPageList(JdAfterBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<JdRefund> queryWrapper = new LambdaQueryWrapper<JdRefund>()
|
||||
.eq(bo.getShopId()!=null,JdRefund::getShopId,bo.getShopId());
|
||||
|
||||
Page<JdRefund> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
|
||||
return PageResult.build(page);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultVo<Integer> saveRefund(Integer shopId, JdRefund refund) {
|
||||
try {
|
||||
List<JdRefund> jdRefunds = mapper.selectList(new LambdaQueryWrapper<JdRefund>().eq(JdRefund::getRefundId, refund.getRefundId()));
|
||||
if (jdRefunds != null && jdRefunds.size() > 0) {
|
||||
// 存在,修改
|
||||
JdRefund update = new JdRefund();
|
||||
update.setId(jdRefunds.get(0).getId());
|
||||
update.setCheckTime(refund.getCheckTime());
|
||||
update.setCheckUsername(refund.getCheckUsername());
|
||||
update.setStatus(refund.getStatus());
|
||||
mapper.updateById(update);
|
||||
return ResultVo.error(ResultVoEnum.DataExist, "退款已经存在,更新成功");
|
||||
} else {
|
||||
// 不存在,新增
|
||||
refund.setShopId(shopId);
|
||||
mapper.insert(refund);
|
||||
return ResultVo.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//package com.qihang.jd.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.jd.domain.bo.JdAfterBo;
|
||||
//import com.qihang.jd.service.JdRefundService;
|
||||
//import lombok.AllArgsConstructor;
|
||||
//import org.springframework.stereotype.Service;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
//* @author qilip
|
||||
//* @description 针对表【jd_refund】的数据库操作Service实现
|
||||
//* @createDate 2024-03-09 11:29:59
|
||||
//*/
|
||||
//@AllArgsConstructor
|
||||
//@Service
|
||||
//public class JdRefundServiceImpl extends ServiceImpl<JdRefundMapper, JdRefund>
|
||||
// implements JdRefundService{
|
||||
// private final JdRefundMapper mapper;
|
||||
//
|
||||
// @Override
|
||||
// public PageResult<JdRefund> queryPageList(JdAfterBo bo, PageQuery pageQuery) {
|
||||
// LambdaQueryWrapper<JdRefund> queryWrapper = new LambdaQueryWrapper<JdRefund>()
|
||||
// .eq(bo.getShopId()!=null,JdRefund::getShopId,bo.getShopId());
|
||||
//
|
||||
// Page<JdRefund> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
//
|
||||
// return PageResult.build(page);
|
||||
// }
|
||||
//
|
||||
// @Transactional
|
||||
// @Override
|
||||
// public ResultVo<Integer> saveRefund(Integer shopId, JdRefund refund) {
|
||||
// try {
|
||||
// List<JdRefund> jdRefunds = mapper.selectList(new LambdaQueryWrapper<JdRefund>().eq(JdRefund::getRefundId, refund.getRefundId()));
|
||||
// if (jdRefunds != null && jdRefunds.size() > 0) {
|
||||
// // 存在,修改
|
||||
// JdRefund update = new JdRefund();
|
||||
// update.setId(jdRefunds.get(0).getId());
|
||||
// update.setCheckTime(refund.getCheckTime());
|
||||
// update.setCheckUsername(refund.getCheckUsername());
|
||||
// update.setStatus(refund.getStatus());
|
||||
// mapper.updateById(update);
|
||||
// return ResultVo.error(ResultVoEnum.DataExist, "退款已经存在,更新成功");
|
||||
// } else {
|
||||
// // 不存在,新增
|
||||
// refund.setShopId(shopId);
|
||||
// mapper.insert(refund);
|
||||
// return ResultVo.success();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
// return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.OmsJdGoods;
|
||||
import com.qihang.jd.service.OmsJdGoodsService;
|
||||
import com.qihang.jd.mapper.OmsJdGoodsMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods(京东商品表)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
@Service
|
||||
public class OmsJdGoodsServiceImpl extends ServiceImpl<OmsJdGoodsMapper, OmsJdGoods>
|
||||
implements OmsJdGoodsService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.OmsJdGoodsSku;
|
||||
import com.qihang.jd.service.OmsJdGoodsSkuService;
|
||||
import com.qihang.jd.mapper.OmsJdGoodsSkuMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_goods_sku(京东商品SKU表)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 10:56:39
|
||||
*/
|
||||
@Service
|
||||
public class OmsJdGoodsSkuServiceImpl extends ServiceImpl<OmsJdGoodsSkuMapper, OmsJdGoodsSku>
|
||||
implements OmsJdGoodsSkuService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.OmsJdOrderItem;
|
||||
import com.qihang.jd.service.OmsJdOrderItemService;
|
||||
import com.qihang.jd.mapper.OmsJdOrderItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order_item(京东订单明细表)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
*/
|
||||
@Service
|
||||
public class OmsJdOrderItemServiceImpl extends ServiceImpl<OmsJdOrderItemMapper, OmsJdOrderItem>
|
||||
implements OmsJdOrderItemService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
package com.qihang.jd.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.jd.domain.OmsJdOrder;
|
||||
import com.qihang.jd.domain.OmsJdOrderItem;
|
||||
import com.qihang.jd.domain.bo.JdOrderBo;
|
||||
import com.qihang.jd.mapper.OmsJdGoodsSkuMapper;
|
||||
import com.qihang.jd.mapper.OmsJdOrderItemMapper;
|
||||
import com.qihang.jd.service.OmsJdOrderService;
|
||||
import com.qihang.jd.mapper.OmsJdOrderMapper;
|
||||
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.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_jd_order(京东订单表)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 10:54:06
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsJdOrderServiceImpl extends ServiceImpl<OmsJdOrderMapper, OmsJdOrder>
|
||||
implements OmsJdOrderService{
|
||||
private final OmsJdOrderMapper mapper;
|
||||
private final OmsJdGoodsSkuMapper jdGoodsSkuMapper;
|
||||
private final OmsJdOrderItemMapper itemMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<OmsJdOrder> queryPageList(JdOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsJdOrder> queryWrapper = new LambdaQueryWrapper<OmsJdOrder>()
|
||||
.eq(bo.getShopId()!=null,OmsJdOrder::getShopId,bo.getShopId())
|
||||
.eq(StringUtils.hasText(bo.getOrderId()),OmsJdOrder::getOrderId,bo.getOrderId())
|
||||
.eq(StringUtils.hasText(bo.getOrderState()),OmsJdOrder::getOrderState,bo.getOrderState())
|
||||
;
|
||||
|
||||
Page<OmsJdOrder> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
if(page.getRecords()!=null){
|
||||
for (var order:page.getRecords()) {
|
||||
order.setItemList(itemMapper.selectList(new LambdaQueryWrapper<OmsJdOrderItem>().eq(OmsJdOrderItem::getOrderId,order.getOrderId())));
|
||||
}
|
||||
}
|
||||
return PageResult.build(page);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ResultVo<Integer> saveOrder(Long shopId, OmsJdOrder order) {
|
||||
try {
|
||||
List<OmsJdOrder> jdOrders = mapper.selectList(new LambdaQueryWrapper<OmsJdOrder>().eq(OmsJdOrder::getOrderId, order.getOrderId()));
|
||||
if (jdOrders != null && jdOrders.size() > 0) {
|
||||
// 存在,修改
|
||||
OmsJdOrder update = new OmsJdOrder();
|
||||
update.setId(jdOrders.get(0).getId());
|
||||
update.setOrderState(order.getOrderState());
|
||||
update.setOrderStateRemark(order.getOrderStateRemark());
|
||||
update.setInvoiceCode(order.getInvoiceCode());
|
||||
update.setOrderEndTime(order.getOrderEndTime());
|
||||
update.setModified(order.getModified());
|
||||
update.setVenderRemark(order.getVenderRemark());
|
||||
update.setReturnOrder(order.getReturnOrder());
|
||||
update.setPaymentConfirmTime(order.getPaymentConfirmTime());
|
||||
update.setWaybill(order.getWaybill());
|
||||
update.setLogisticsId(order.getLogisticsId());
|
||||
|
||||
//临时
|
||||
update.setFullname(order.getFullname());
|
||||
update.setFullAddress(order.getFullAddress());
|
||||
update.setProvince(order.getProvince());
|
||||
update.setCity(order.getCity());
|
||||
update.setTown(order.getTown());
|
||||
update.setMobile(order.getMobile());
|
||||
update.setTelephone(order.getTelephone());
|
||||
|
||||
mapper.updateById(update);
|
||||
// 更新item
|
||||
for (var item : order.getItemList()) {
|
||||
List<OmsJdOrderItem> taoOrderItems = itemMapper.selectList(new LambdaQueryWrapper<OmsJdOrderItem>().eq(OmsJdOrderItem::getSkuId, item.getSkuId()));
|
||||
if (taoOrderItems != null && taoOrderItems.size() > 0) {
|
||||
// 不处理
|
||||
} else {
|
||||
// 新增
|
||||
item.setOrderId(jdOrders.get(0).getOrderId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
}
|
||||
return ResultVo.error(ResultVoEnum.DataExist, "订单已经存在,更新成功");
|
||||
} else {
|
||||
// 不存在,新增
|
||||
order.setShopId(shopId);
|
||||
order.setCreateTime(new Date());
|
||||
mapper.insert(order);
|
||||
// 添加item
|
||||
for (var item : order.getItemList()) {
|
||||
item.setOrderId(order.getOrderId());
|
||||
itemMapper.insert(item);
|
||||
}
|
||||
|
||||
// 添加优惠信息
|
||||
// if(order.getCoupons()!= null){
|
||||
// for (var coupon:order.getCoupons()) {
|
||||
// if(coupon.getOrderId()==null){
|
||||
// coupon.setOrderId(Long.parseLong(order.getOrderId()));
|
||||
// }
|
||||
// couponMapper.insert(coupon);
|
||||
// }
|
||||
// }
|
||||
return ResultVo.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
e.printStackTrace();
|
||||
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OmsJdOrder queryDetailById(Long id) {
|
||||
OmsJdOrder orderDetail = mapper.selectById(id);
|
||||
orderDetail.setItemList(itemMapper.selectList(new LambdaQueryWrapper<OmsJdOrderItem>().eq(OmsJdOrderItem::getOrderId,orderDetail.getOrderId())));
|
||||
return orderDetail;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.SShop;
|
||||
import com.qihang.jd.service.SShopService;
|
||||
import com.qihang.jd.mapper.SShopMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class SShopServiceImpl extends ServiceImpl<SShopMapper, SShop>
|
||||
implements SShopService{
|
||||
private final SShopMapper mapper;
|
||||
@Override
|
||||
public SShop selectShopById(Long shopId) {
|
||||
return mapper.selectById(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSessionKey(Long shopId, String sessionKey) {
|
||||
SShop shop = new SShop();
|
||||
shop.setId(shopId);
|
||||
shop.setSessionkey(sessionKey);
|
||||
mapper.updateById(shop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.SShopSetting;
|
||||
import com.qihang.jd.service.SShopSettingService;
|
||||
import com.qihang.jd.mapper.SShopSettingMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Service实现
|
||||
* @createDate 2024-05-10 11:07:56
|
||||
*/
|
||||
@Service
|
||||
public class SShopSettingServiceImpl extends ServiceImpl<SShopSettingMapper, SShopSetting>
|
||||
implements SShopSettingService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.SysPlatform;
|
||||
import com.qihang.jd.service.SysPlatformService;
|
||||
import com.qihang.jd.mapper.SysPlatformMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_platform】的数据库操作Service实现
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class SysPlatformServiceImpl extends ServiceImpl<SysPlatformMapper, SysPlatform>
|
||||
implements SysPlatformService{
|
||||
private final SysPlatformMapper mapper;
|
||||
@Override
|
||||
public SysPlatform selectById(Integer id) {
|
||||
return mapper.selectById(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ public class SysShopPullLasttimeServiceImpl extends ServiceImpl<SysShopPullLastt
|
|||
private final SysShopPullLasttimeMapper mapper;
|
||||
|
||||
@Override
|
||||
public SysShopPullLasttime getLasttimeByShop(Integer shopId, String pullType) {
|
||||
public SysShopPullLasttime getLasttimeByShop(Long shopId, String pullType) {
|
||||
List<SysShopPullLasttime> sysShopPullLasttimes = mapper.selectList(new LambdaQueryWrapper<SysShopPullLasttime>().eq(SysShopPullLasttime::getShopId, shopId).eq(SysShopPullLasttime::getPullType, pullType));
|
||||
if(sysShopPullLasttimes != null && !sysShopPullLasttimes.isEmpty()) return sysShopPullLasttimes.get(0);
|
||||
else return null;
|
||||
|
|
|
|||
|
|
@ -1,36 +0,0 @@
|
|||
package com.qihang.jd.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.jd.domain.SysShop;
|
||||
import com.qihang.jd.service.SysShopService;
|
||||
import com.qihang.jd.mapper.SysShopMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Service实现
|
||||
* @createDate 2024-03-04 18:43:05
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class SysShopServiceImpl extends ServiceImpl<SysShopMapper, SysShop>
|
||||
implements SysShopService{
|
||||
private SysShopMapper mapper;
|
||||
@Override
|
||||
public SysShop selectShopById(Integer shopId) {
|
||||
return mapper.selectById(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSessionKey(Integer shopId, String sessionKey) {
|
||||
SysShop shop = new SysShop();
|
||||
shop.setId(shopId);
|
||||
shop.setAccessToken(sessionKey);
|
||||
mapper.updateById(shop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?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.jd.mapper.JdRefundMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.JdRefund">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="refundId" column="refund_id" jdbcType="VARCHAR"/>
|
||||
<result property="buyerId" column="buyer_id" jdbcType="VARCHAR"/>
|
||||
<result property="buyerName" column="buyer_name" jdbcType="VARCHAR"/>
|
||||
<result property="checkTime" column="check_time" jdbcType="VARCHAR"/>
|
||||
<result property="applyTime" column="apply_time" jdbcType="VARCHAR"/>
|
||||
<result property="applyRefundSum" column="apply_refund_sum" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="VARCHAR"/>
|
||||
<result property="checkUsername" column="check_username" jdbcType="VARCHAR"/>
|
||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,refund_id,
|
||||
buyer_id,buyer_name,check_time,
|
||||
apply_time,apply_refund_sum,status,
|
||||
check_username,order_id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?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.jd.mapper.OmsJdGoodsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.OmsJdGoods">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="wareId" column="ware_id" jdbcType="BIGINT"/>
|
||||
<result property="title" column="title" jdbcType="VARCHAR"/>
|
||||
<result property="wareStatus" column="ware_status" jdbcType="INTEGER"/>
|
||||
<result property="outerId" column="outer_id" jdbcType="VARCHAR"/>
|
||||
<result property="itemNum" column="item_num" jdbcType="VARCHAR"/>
|
||||
<result property="barCode" column="bar_code" jdbcType="VARCHAR"/>
|
||||
<result property="modified" column="modified" jdbcType="VARCHAR"/>
|
||||
<result property="created" column="created" jdbcType="VARCHAR"/>
|
||||
<result property="offlineTime" column="offline_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="onlineTime" column="online_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="delivery" column="delivery" jdbcType="VARCHAR"/>
|
||||
<result property="packListing" column="pack_listing" jdbcType="VARCHAR"/>
|
||||
<result property="wrap" column="wrap" jdbcType="VARCHAR"/>
|
||||
<result property="weight" column="weight" jdbcType="FLOAT"/>
|
||||
<result property="width" column="width" jdbcType="INTEGER"/>
|
||||
<result property="height" column="height" jdbcType="INTEGER"/>
|
||||
<result property="length" column="length" jdbcType="INTEGER"/>
|
||||
<result property="mobileDesc" column="mobile_desc" jdbcType="VARCHAR"/>
|
||||
<result property="introduction" column="introduction" jdbcType="VARCHAR"/>
|
||||
<result property="afterSales" column="after_sales" jdbcType="VARCHAR"/>
|
||||
<result property="logo" column="logo" jdbcType="VARCHAR"/>
|
||||
<result property="marketPrice" column="market_price" jdbcType="DECIMAL"/>
|
||||
<result property="costPrice" column="cost_price" jdbcType="DECIMAL"/>
|
||||
<result property="jdPrice" column="jd_price" jdbcType="DECIMAL"/>
|
||||
<result property="brandName" column="brand_name" jdbcType="VARCHAR"/>
|
||||
<result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="sellPoint" column="sell_point" jdbcType="VARCHAR"/>
|
||||
<result property="afterSaleDesc" column="after_sale_desc" jdbcType="VARCHAR"/>
|
||||
<result property="spuId" column="spu_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,ware_id,title,
|
||||
ware_status,outer_id,item_num,
|
||||
bar_code,modified,created,
|
||||
offline_time,online_time,delivery,
|
||||
pack_listing,wrap,weight,
|
||||
width,height,length,
|
||||
mobile_desc,introduction,after_sales,
|
||||
logo,market_price,cost_price,
|
||||
jd_price,brand_name,stock_num,
|
||||
shop_id,sell_point,after_sale_desc,
|
||||
spu_id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?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.jd.mapper.OmsJdGoodsSkuMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.OmsJdGoodsSku">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="wareId" column="ware_id" jdbcType="BIGINT"/>
|
||||
<result property="skuId" column="sku_id" jdbcType="BIGINT"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="jdPrice" column="jd_price" jdbcType="DECIMAL"/>
|
||||
<result property="outerId" column="outer_id" jdbcType="VARCHAR"/>
|
||||
<result property="barCode" column="bar_code" jdbcType="VARCHAR"/>
|
||||
<result property="logo" column="logo" jdbcType="VARCHAR"/>
|
||||
<result property="saleAttrs" column="sale_attrs" jdbcType="VARCHAR"/>
|
||||
<result property="attrs" column="attrs" jdbcType="VARCHAR"/>
|
||||
<result property="skuName" column="sku_name" jdbcType="VARCHAR"/>
|
||||
<result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
|
||||
<result property="modified" column="modified" jdbcType="TIMESTAMP"/>
|
||||
<result property="created" column="created" jdbcType="TIMESTAMP"/>
|
||||
<result property="currencySpuId" column="currency_spu_id" 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,ware_id,
|
||||
sku_id,status,jd_price,
|
||||
outer_id,bar_code,logo,
|
||||
sale_attrs,attrs,sku_name,
|
||||
stock_num,modified,created,
|
||||
currency_spu_id,erp_goods_id,erp_goods_sku_id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.jd.mapper.JdOrderItemMapper">
|
||||
<mapper namespace="com.qihang.jd.mapper.OmsJdOrderItemMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.JdOrderItem">
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.OmsJdOrderItem">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="orderId" column="order_id" jdbcType="BIGINT"/>
|
||||
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.jd.mapper.JdOrderMapper">
|
||||
<mapper namespace="com.qihang.jd.mapper.OmsJdOrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.JdOrder">
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.OmsJdOrder">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
||||
|
|
@ -33,9 +33,9 @@
|
|||
<result property="county" column="county" jdbcType="VARCHAR"/>
|
||||
<result property="town" column="town" jdbcType="VARCHAR"/>
|
||||
<result property="provinceId" column="province_id" jdbcType="VARCHAR"/>
|
||||
<result property="cityId" column="city_id" jdbcType="INTEGER"/>
|
||||
<result property="countyId" column="county_id" jdbcType="INTEGER"/>
|
||||
<result property="townId" column="town_id" jdbcType="INTEGER"/>
|
||||
<result property="cityId" column="city_id" jdbcType="VARCHAR"/>
|
||||
<result property="countyId" column="county_id" jdbcType="VARCHAR"/>
|
||||
<result property="townId" column="town_id" jdbcType="VARCHAR"/>
|
||||
<result property="venderRemark" column="vender_remark" jdbcType="VARCHAR"/>
|
||||
<result property="balanceUsed" column="balance_used" jdbcType="VARCHAR"/>
|
||||
<result property="pin" column="pin" jdbcType="VARCHAR"/>
|
||||
|
|
@ -53,6 +53,8 @@
|
|||
<result property="openId" column="open_id" jdbcType="VARCHAR"/>
|
||||
<result property="openIdBuyer" column="open_id_buyer" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="auditStatus" column="audit_status" jdbcType="INTEGER"/>
|
||||
<result property="auditTime" column="audit_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
|
|
@ -71,6 +73,7 @@
|
|||
waybill,logistics_id,modified,
|
||||
direct_parent_order_id,parent_order_id,order_source,
|
||||
store_order,id_sop_shipmenttype,real_pin,
|
||||
open_id,open_id_buyer,create_time
|
||||
open_id,open_id_buyer,create_time,
|
||||
audit_status,audit_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?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.jd.mapper.SShopMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.SShop">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="nickname" column="nickName" jdbcType="VARCHAR"/>
|
||||
<result property="ename" column="ename" jdbcType="VARCHAR"/>
|
||||
<result property="company" column="company" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="url" column="url" jdbcType="VARCHAR"/>
|
||||
<result property="ordernum" column="orderNum" jdbcType="INTEGER"/>
|
||||
<result property="isdelete" column="isDelete" jdbcType="INTEGER"/>
|
||||
<result property="isshow" column="isShow" jdbcType="INTEGER"/>
|
||||
<result property="modifyOn" column="modify_on" jdbcType="BIGINT"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="selleruserid" column="sellerUserId" jdbcType="BIGINT"/>
|
||||
<result property="selleruseridstr" column="sellerUserIdStr" jdbcType="VARCHAR"/>
|
||||
<result property="sessionkey" column="sessionKey" jdbcType="VARCHAR"/>
|
||||
<result property="appkey" column="appkey" jdbcType="VARCHAR"/>
|
||||
<result property="appsercet" column="appSercet" jdbcType="VARCHAR"/>
|
||||
<result property="expiresIn" column="expires_in" jdbcType="BIGINT"/>
|
||||
<result property="accessTokenBegin" column="access_token_begin" jdbcType="BIGINT"/>
|
||||
<result property="refreshToken" column="refresh_token" jdbcType="VARCHAR"/>
|
||||
<result property="refreshTokenTimeout" column="refresh_token_timeout" jdbcType="BIGINT"/>
|
||||
<result property="apiRequestUrl" column="api_request_url" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,nickName,
|
||||
ename,company,type,
|
||||
url,orderNum,isDelete,
|
||||
isShow,modify_on,remark,
|
||||
sellerUserId,sellerUserIdStr,sessionKey,
|
||||
appkey,appSercet,expires_in,
|
||||
access_token_begin,refresh_token,refresh_token_timeout,
|
||||
api_request_url
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -2,34 +2,29 @@
|
|||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.jd.mapper.SysShopMapper">
|
||||
<mapper namespace="com.qihang.jd.mapper.SShopSettingMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.SysShop">
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.SShopSetting">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="url" column="url" jdbcType="VARCHAR"/>
|
||||
<result property="sort" column="sort" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="modifyOn" column="modify_on" jdbcType="BIGINT"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="sellerId" column="seller_id" jdbcType="BIGINT"/>
|
||||
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||
<result property="appSercet" column="app_sercet" jdbcType="VARCHAR"/>
|
||||
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
|
||||
<result property="accessToken" column="access_token" jdbcType="VARCHAR"/>
|
||||
<result property="expiresIn" column="expires_in" jdbcType="BIGINT"/>
|
||||
<result property="accessTokenBegin" column="access_token_begin" jdbcType="BIGINT"/>
|
||||
<result property="refreshToken" column="refresh_token" jdbcType="VARCHAR"/>
|
||||
<result property="refreshTokenTimeout" column="refresh_token_timeout" jdbcType="BIGINT"/>
|
||||
<result property="apiRequestUrl" column="api_request_url" jdbcType="VARCHAR"/>
|
||||
<result property="modifyOn" column="modify_on" jdbcType="BIGINT"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="requestUrl" column="request_url" jdbcType="VARCHAR"/>
|
||||
<result property="thirdId" column="third_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,type,
|
||||
url,sort,status,
|
||||
modify_on,remark,seller_id,
|
||||
app_key,app_sercet,access_token,
|
||||
expires_in,access_token_begin,refresh_token,
|
||||
refresh_token_timeout,api_request_url
|
||||
id,name,app_key,
|
||||
app_secret,access_token,expires_in,
|
||||
access_token_begin,refresh_token,refresh_token_timeout,
|
||||
modify_on,remark,request_url,
|
||||
third_id
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?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.jd.mapper.SysPlatformMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.jd.domain.SysPlatform">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
|
||||
<result property="redirectUri" column="redirect_uri" jdbcType="VARCHAR"/>
|
||||
<result property="serverUrl" column="server_url" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,code,
|
||||
app_key,app_secret,redirect_uri,
|
||||
server_url
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -159,7 +159,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
listShop({type:2}).then(response => {
|
||||
listShop({type:3}).then(response => {
|
||||
this.shopList = response.rows;
|
||||
});
|
||||
this.getList();
|
||||
|
|
|
|||
Loading…
Reference in New Issue