This commit is contained in:
启航 2024-03-13 18:34:18 +08:45
parent 4258bb05a4
commit 4563cd9df3
24 changed files with 1401 additions and 17 deletions

View File

@ -6,6 +6,7 @@ import com.pdd.pop.sdk.http.PopHttpClient;
import com.pdd.pop.sdk.http.api.pop.request.PddOrderListGetRequest; import com.pdd.pop.sdk.http.api.pop.request.PddOrderListGetRequest;
import com.pdd.pop.sdk.http.api.pop.response.PddOrderListGetResponse; import com.pdd.pop.sdk.http.api.pop.response.PddOrderListGetResponse;
import com.qihang.common.common.ApiResult; import com.qihang.common.common.ApiResult;
import com.qihang.pdd.service.SysShopService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -18,12 +19,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class AjaxOrderPddController { public class AjaxOrderPddController {
private static Logger log = LoggerFactory.getLogger(AjaxOrderPddController.class); private static Logger log = LoggerFactory.getLogger(AjaxOrderPddController.class);
// @Autowired
// private ServerConfig serverConfig;
@Autowired @Autowired
private ServerConfig serverConfig; private SysShopService shopService;
@Autowired // @Autowired
private IShopService shopService; // private IPddOrderService pddOrderService;
@Autowired
private IPddOrderService pddOrderService;
/** /**
* 接口拉取订单 * 接口拉取订单
@ -34,16 +35,15 @@ public class AjaxOrderPddController {
* @throws Exception * @throws Exception
*/ */
@RequestMapping(value = "/order/pull_order", method = RequestMethod.GET) @RequestMapping(value = "/order/pull_order", method = RequestMethod.GET)
public ApiResult<Object> getOrderList(DouRequest reqData) public ApiResult<Object> getOrderList(OpenApiRequest reqData)
throws Exception { throws Exception {
Integer updType = reqData.getUpdType();//更新类型0拉取新订单1更新订单 Integer updType = reqData.getUpdType();//更新类型0拉取新订单1更新订单
String startDate = reqData.getStartDate();//reqData.getString("startTime"); String startDate = reqData.getStartDate();//reqData.getString("startTime");
String endDate = reqData.getEndDate();//reqData.getString("endTime"); String endDate = reqData.getEndDate();//reqData.getString("endTime");
Long shopId = reqData.getShopId();// 拼多多shopId var shop = shopService.selectShopById(reqData.getShopId());
var shop = shopService.selectShopById(shopId);
if(shop == null) return new ApiResult<>(EnumResultVo.Fail.getIndex(), "店铺不存在!"); if(shop == null) return new ApiResult<>(EnumResultVo.Fail.getIndex(), "店铺不存在!");
String appKey = shop.getAppkey(); String appKey = shop.getAppKey();
String appSercet = shop.getAppSercet(); String appSercet = shop.getAppSercet();
if(!StringUtils.hasText(appKey) || !StringUtils.hasText(appSercet)) return new ApiResult<>(EnumResultVo.Fail.getIndex(), "参数错误请设置appkey和serecet"); if(!StringUtils.hasText(appKey) || !StringUtils.hasText(appSercet)) return new ApiResult<>(EnumResultVo.Fail.getIndex(), "参数错误请设置appkey和serecet");

View File

@ -1,7 +1,7 @@
package com.qihang.pdd.controller; package com.qihang.pdd.controller;
public class DouRequest { public class OpenApiRequest {
private Long shopId;//店铺Id private Integer shopId;//店铺Id
private Long orderId;//订单id private Long orderId;//订单id
private Integer updType;//更新类型0拉取新订单1更新订单 private Integer updType;//更新类型0拉取新订单1更新订单
private String startDate; private String startDate;
@ -39,11 +39,11 @@ public class DouRequest {
this.orderId = orderId; this.orderId = orderId;
} }
public Long getShopId() { public Integer getShopId() {
return shopId; return shopId;
} }
public void setShopId(Long shopId) { public void setShopId(Integer shopId) {
this.shopId = shopId; this.shopId = shopId;
} }
} }

View File

@ -0,0 +1,49 @@
package com.qihang.pdd.controller;
public class ShopApiParams {
private String appKey;
private String appSecret;
private String accessToken;
private String apiRequestUrl;
private String tokenRequestUrl;
public String getTokenRequestUrl() {
return tokenRequestUrl;
}
public void setTokenRequestUrl(String tokenRequestUrl) {
this.tokenRequestUrl = tokenRequestUrl;
}
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;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getApiRequestUrl() {
return apiRequestUrl;
}
public void setApiRequestUrl(String apiRequestUrl) {
this.apiRequestUrl = apiRequestUrl;
}
}

View File

@ -0,0 +1,197 @@
package com.qihang.pdd.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();
}
}

View File

@ -0,0 +1,417 @@
package com.qihang.pdd.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;
/**
* 第三方平台sessionKeyaccess_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;
}
/**
* 第三方平台sessionKeyaccess_token
*/
public String getAccessToken() {
return accessToken;
}
/**
* 第三方平台sessionKeyaccess_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();
}
}

View File

@ -0,0 +1,176 @@
package com.qihang.pdd.domain;
import java.io.Serializable;
import java.util.Date;
/**
* 店铺更新最后时间记录
* @TableName sys_shop_pull_lasttime
*/
public class SysShopPullLasttime implements Serializable {
/**
*
*/
private Integer id;
/**
* 店铺id
*/
private Integer shopId;
/**
* 类型ORDER:订单REFUND:退款
*/
private Object pullType;
/**
* 最后更新时间
*/
private Date lasttime;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private static final long serialVersionUID = 1L;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 店铺id
*/
public Integer getShopId() {
return shopId;
}
/**
* 店铺id
*/
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
/**
* 类型ORDER:订单REFUND:退款
*/
public Object getPullType() {
return pullType;
}
/**
* 类型ORDER:订单REFUND:退款
*/
public void setPullType(Object pullType) {
this.pullType = pullType;
}
/**
* 最后更新时间
*/
public Date getLasttime() {
return lasttime;
}
/**
* 最后更新时间
*/
public void setLasttime(Date lasttime) {
this.lasttime = lasttime;
}
/**
* 创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 更新时间
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* 更新时间
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
SysShopPullLasttime other = (SysShopPullLasttime) 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.getPullType() == null ? other.getPullType() == null : this.getPullType().equals(other.getPullType()))
&& (this.getLasttime() == null ? other.getLasttime() == null : this.getLasttime().equals(other.getLasttime()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
}
@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 + ((getPullType() == null) ? 0 : getPullType().hashCode());
result = prime * result + ((getLasttime() == null) ? 0 : getLasttime().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", pullType=").append(pullType);
sb.append(", lasttime=").append(lasttime);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,220 @@
package com.qihang.pdd.domain;
import java.io.Serializable;
import java.util.Date;
/**
* 更新日志表
* @TableName sys_shop_pull_logs
*/
public class SysShopPullLogs implements Serializable {
/**
* 主键Id
*/
private Long id;
/**
* 店铺id
*/
private Integer shopId;
/**
* 类型ORDER订单GOODS商品REFUND退款
*/
private Object pullType;
/**
* 拉取方式主动拉取定时任务
*/
private String pullWay;
/**
* 拉取参数
*/
private String pullParams;
/**
* 拉取结果
*/
private String pullResult;
/**
* 拉取时间
*/
private Date pullTime;
/**
* 耗时毫秒
*/
private Long duration;
private static final long serialVersionUID = 1L;
/**
* 主键Id
*/
public Long getId() {
return id;
}
/**
* 主键Id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 店铺id
*/
public Integer getShopId() {
return shopId;
}
/**
* 店铺id
*/
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
/**
* 类型ORDER订单GOODS商品REFUND退款
*/
public Object getPullType() {
return pullType;
}
/**
* 类型ORDER订单GOODS商品REFUND退款
*/
public void setPullType(Object pullType) {
this.pullType = pullType;
}
/**
* 拉取方式主动拉取定时任务
*/
public String getPullWay() {
return pullWay;
}
/**
* 拉取方式主动拉取定时任务
*/
public void setPullWay(String pullWay) {
this.pullWay = pullWay;
}
/**
* 拉取参数
*/
public String getPullParams() {
return pullParams;
}
/**
* 拉取参数
*/
public void setPullParams(String pullParams) {
this.pullParams = pullParams;
}
/**
* 拉取结果
*/
public String getPullResult() {
return pullResult;
}
/**
* 拉取结果
*/
public void setPullResult(String pullResult) {
this.pullResult = pullResult;
}
/**
* 拉取时间
*/
public Date getPullTime() {
return pullTime;
}
/**
* 拉取时间
*/
public void setPullTime(Date pullTime) {
this.pullTime = pullTime;
}
/**
* 耗时毫秒
*/
public Long getDuration() {
return duration;
}
/**
* 耗时毫秒
*/
public void setDuration(Long duration) {
this.duration = duration;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
SysShopPullLogs other = (SysShopPullLogs) 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.getPullType() == null ? other.getPullType() == null : this.getPullType().equals(other.getPullType()))
&& (this.getPullWay() == null ? other.getPullWay() == null : this.getPullWay().equals(other.getPullWay()))
&& (this.getPullParams() == null ? other.getPullParams() == null : this.getPullParams().equals(other.getPullParams()))
&& (this.getPullResult() == null ? other.getPullResult() == null : this.getPullResult().equals(other.getPullResult()))
&& (this.getPullTime() == null ? other.getPullTime() == null : this.getPullTime().equals(other.getPullTime()))
&& (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()));
}
@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 + ((getPullType() == null) ? 0 : getPullType().hashCode());
result = prime * result + ((getPullWay() == null) ? 0 : getPullWay().hashCode());
result = prime * result + ((getPullParams() == null) ? 0 : getPullParams().hashCode());
result = prime * result + ((getPullResult() == null) ? 0 : getPullResult().hashCode());
result = prime * result + ((getPullTime() == null) ? 0 : getPullTime().hashCode());
result = prime * result + ((getDuration() == null) ? 0 : getDuration().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(", pullType=").append(pullType);
sb.append(", pullWay=").append(pullWay);
sb.append(", pullParams=").append(pullParams);
sb.append(", pullResult=").append(pullResult);
sb.append(", pullTime=").append(pullTime);
sb.append(", duration=").append(duration);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,18 @@
package com.qihang.pdd.mapper;
import com.qihang.pdd.domain.SysPlatform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表sys_platform的数据库操作Mapper
* @createDate 2024-03-13 17:43:42
* @Entity com.qihang.pdd.domain.SysPlatform
*/
public interface SysPlatformMapper extends BaseMapper<SysPlatform> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.pdd.mapper;
import com.qihang.pdd.domain.SysShop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表sys_shop(数据中心-店铺)的数据库操作Mapper
* @createDate 2024-03-13 17:43:42
* @Entity com.qihang.pdd.domain.SysShop
*/
public interface SysShopMapper extends BaseMapper<SysShop> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.pdd.mapper;
import com.qihang.pdd.domain.SysShopPullLasttime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表sys_shop_pull_lasttime(店铺更新最后时间记录)的数据库操作Mapper
* @createDate 2024-03-13 17:43:42
* @Entity com.qihang.pdd.domain.SysShopPullLasttime
*/
public interface SysShopPullLasttimeMapper extends BaseMapper<SysShopPullLasttime> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.pdd.mapper;
import com.qihang.pdd.domain.SysShopPullLogs;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表sys_shop_pull_logs(更新日志表)的数据库操作Mapper
* @createDate 2024-03-13 17:43:42
* @Entity com.qihang.pdd.domain.SysShopPullLogs
*/
public interface SysShopPullLogsMapper extends BaseMapper<SysShopPullLogs> {
}

View File

@ -0,0 +1,13 @@
package com.qihang.pdd.service;
import com.qihang.pdd.domain.SysPlatform;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表sys_platform的数据库操作Service
* @createDate 2024-03-13 17:43:42
*/
public interface SysPlatformService extends IService<SysPlatform> {
}

View File

@ -0,0 +1,13 @@
package com.qihang.pdd.service;
import com.qihang.pdd.domain.SysShopPullLasttime;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表sys_shop_pull_lasttime(店铺更新最后时间记录)的数据库操作Service
* @createDate 2024-03-13 17:43:42
*/
public interface SysShopPullLasttimeService extends IService<SysShopPullLasttime> {
}

View File

@ -0,0 +1,13 @@
package com.qihang.pdd.service;
import com.qihang.pdd.domain.SysShopPullLogs;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表sys_shop_pull_logs(更新日志表)的数据库操作Service
* @createDate 2024-03-13 17:43:42
*/
public interface SysShopPullLogsService extends IService<SysShopPullLogs> {
}

View File

@ -0,0 +1,15 @@
package com.qihang.pdd.service;
import com.qihang.pdd.domain.SysShop;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表sys_shop(数据中心-店铺)的数据库操作Service
* @createDate 2024-03-13 17:43:42
*/
public interface SysShopService extends IService<SysShop> {
SysShop selectShopById(Integer shopId);
void updateSessionKey(Integer shopId,String sessionKey);
}

View File

@ -1,4 +0,0 @@
package com.qihang.pdd.service;
public class a {
}

View File

@ -0,0 +1,22 @@
package com.qihang.pdd.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.pdd.domain.SysPlatform;
import com.qihang.pdd.service.SysPlatformService;
import com.qihang.pdd.mapper.SysPlatformMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表sys_platform的数据库操作Service实现
* @createDate 2024-03-13 17:43:42
*/
@Service
public class SysPlatformServiceImpl extends ServiceImpl<SysPlatformMapper, SysPlatform>
implements SysPlatformService{
}

View File

@ -0,0 +1,22 @@
package com.qihang.pdd.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.pdd.domain.SysShopPullLasttime;
import com.qihang.pdd.service.SysShopPullLasttimeService;
import com.qihang.pdd.mapper.SysShopPullLasttimeMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表sys_shop_pull_lasttime(店铺更新最后时间记录)的数据库操作Service实现
* @createDate 2024-03-13 17:43:42
*/
@Service
public class SysShopPullLasttimeServiceImpl extends ServiceImpl<SysShopPullLasttimeMapper, SysShopPullLasttime>
implements SysShopPullLasttimeService{
}

View File

@ -0,0 +1,22 @@
package com.qihang.pdd.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.pdd.domain.SysShopPullLogs;
import com.qihang.pdd.service.SysShopPullLogsService;
import com.qihang.pdd.mapper.SysShopPullLogsMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表sys_shop_pull_logs(更新日志表)的数据库操作Service实现
* @createDate 2024-03-13 17:43:42
*/
@Service
public class SysShopPullLogsServiceImpl extends ServiceImpl<SysShopPullLogsMapper, SysShopPullLogs>
implements SysShopPullLogsService{
}

View File

@ -0,0 +1,37 @@
package com.qihang.pdd.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.pdd.domain.SysShop;
import com.qihang.pdd.service.SysShopService;
import com.qihang.pdd.mapper.SysShopMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表sys_shop(数据中心-店铺)的数据库操作Service实现
* @createDate 2024-03-13 17:43:42
*/
@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);
}
}

View File

@ -0,0 +1,22 @@
<?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.pdd.mapper.SysPlatformMapper">
<resultMap id="BaseResultMap" type="com.qihang.pdd.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>

View File

@ -0,0 +1,35 @@
<?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.pdd.mapper.SysShopMapper">
<resultMap id="BaseResultMap" type="com.qihang.pdd.domain.SysShop">
<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="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"/>
</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
</sql>
</mapper>

View File

@ -0,0 +1,20 @@
<?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.pdd.mapper.SysShopPullLasttimeMapper">
<resultMap id="BaseResultMap" type="com.qihang.pdd.domain.SysShopPullLasttime">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="pullType" column="pull_type" jdbcType="OTHER"/>
<result property="lasttime" column="lasttime" jdbcType="TIMESTAMP"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,shop_id,pull_type,
lasttime,create_time,update_time
</sql>
</mapper>

View File

@ -0,0 +1,23 @@
<?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.pdd.mapper.SysShopPullLogsMapper">
<resultMap id="BaseResultMap" type="com.qihang.pdd.domain.SysShopPullLogs">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="pullType" column="pull_type" jdbcType="OTHER"/>
<result property="pullWay" column="pull_way" jdbcType="VARCHAR"/>
<result property="pullParams" column="pull_params" jdbcType="VARCHAR"/>
<result property="pullResult" column="pull_result" jdbcType="VARCHAR"/>
<result property="pullTime" column="pull_time" jdbcType="TIMESTAMP"/>
<result property="duration" column="duration" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id,shop_id,pull_type,
pull_way,pull_params,pull_result,
pull_time,duration
</sql>
</mapper>