测试wei电子面单相关接口
This commit is contained in:
parent
57605906e2
commit
54a86c9ea7
Binary file not shown.
|
|
@ -40,12 +40,12 @@ public class HomeController {
|
|||
param.setTrackingNo("435435");
|
||||
param.setPresellType(1L);
|
||||
param.setOrderType(1L);
|
||||
param.setCreateTimeStart(1617355413L);
|
||||
param.setCreateTimeEnd(1617355413L);
|
||||
// param.setCreateTimeStart(1617355413L);
|
||||
// param.setCreateTimeEnd(1617355413L);
|
||||
param.setAbnormalOrder(1L);
|
||||
param.setTradeType(1L);
|
||||
param.setUpdateTimeStart(1617355413L);
|
||||
param.setUpdateTimeEnd(1617355413L);
|
||||
param.setUpdateTimeStart(1709222400L);
|
||||
param.setUpdateTimeEnd(System.currentTimeMillis()/1000);
|
||||
param.setSize(20L);
|
||||
param.setPage(0L);
|
||||
param.setOrderBy("create_time");
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -76,6 +76,13 @@
|
|||
<!-- <version>1.18.30</version>-->
|
||||
<!-- <scope>provided</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>wei-api</groupId>
|
||||
<artifactId>wei-api</artifactId>
|
||||
<version>1.6.3</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/wei-api-1.6.3.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<!-- <dependencyManagement>-->
|
||||
<!-- <dependencies>-->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
package com.qihang.wei.controller;
|
||||
|
||||
import cn.qihangerp.open.wei.EwaybillApiHelper;
|
||||
import cn.qihangerp.open.wei.common.ApiResultVo;
|
||||
import cn.qihangerp.open.wei.vo.ewaybill.DeliveryVo;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.wei.domain.WeiGoods;
|
||||
import com.qihang.wei.domain.WeiGoodsSku;
|
||||
import com.qihang.wei.openApi.ApiCommon;
|
||||
import com.qihang.wei.openApi.PullRequest;
|
||||
import com.qihang.wei.openApi.bo.GoodsDetailApiBo;
|
||||
import com.qihang.wei.openApi.bo.GoodsListApiBo;
|
||||
import com.qihang.wei.openApi.service.GoodsApiService;
|
||||
import com.qihang.wei.openApi.vo.GoodsDetailVo;
|
||||
import com.qihang.wei.openApi.vo.GoodsListVo;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
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("/ewaybill")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class eWayBillController {
|
||||
private final ApiCommon apiCommon;
|
||||
@RequestMapping(value = "/get_deliver_list", method = RequestMethod.POST)
|
||||
public AjaxResult getDeliverList(@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() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
String serverUrl = checkResult.getData().getServerUrl();
|
||||
String appKey = checkResult.getData().getAppKey();
|
||||
String appSecret = checkResult.getData().getAppSecret();
|
||||
|
||||
ApiResultVo<DeliveryVo> apiResultVo = EwaybillApiHelper.pullDeliveryList(appKey, appSecret, accessToken);
|
||||
|
||||
|
||||
return AjaxResult.success(apiResultVo.getList());
|
||||
}
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 商品规格库存管理
|
||||
* @TableName o_goods_sku
|
||||
*/
|
||||
@Data
|
||||
public class OGoodsSku implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long erpGoodsId;
|
||||
|
||||
/**
|
||||
* skuId(唯一)
|
||||
*/
|
||||
private Long erpSkuId;
|
||||
|
||||
/**
|
||||
* 规格名
|
||||
*/
|
||||
private String skuName;
|
||||
|
||||
/**
|
||||
* 规格编码
|
||||
*/
|
||||
private String skuNum;
|
||||
|
||||
/**
|
||||
* 颜色id
|
||||
*/
|
||||
private Integer colorId;
|
||||
|
||||
/**
|
||||
* 颜色值
|
||||
*/
|
||||
private String colorValue;
|
||||
|
||||
/**
|
||||
* 颜色图片
|
||||
*/
|
||||
private String colorImage;
|
||||
|
||||
/**
|
||||
* 尺码id
|
||||
*/
|
||||
private Integer sizeId;
|
||||
|
||||
/**
|
||||
* 尺码值
|
||||
*/
|
||||
private String sizeValue;
|
||||
|
||||
/**
|
||||
* 款式id
|
||||
*/
|
||||
private Integer styleId;
|
||||
|
||||
/**
|
||||
* 款式值
|
||||
*/
|
||||
private String styleValue;
|
||||
|
||||
/**
|
||||
* 库存条形码
|
||||
*/
|
||||
private String barCode;
|
||||
|
||||
/**
|
||||
* 预计采购价
|
||||
*/
|
||||
private BigDecimal purPrice;
|
||||
|
||||
/**
|
||||
* 建议批发价
|
||||
*/
|
||||
private BigDecimal wholePrice;
|
||||
|
||||
/**
|
||||
* 建议零售价
|
||||
*/
|
||||
private BigDecimal retailPrice;
|
||||
|
||||
/**
|
||||
* 单位成本
|
||||
*/
|
||||
private BigDecimal unitCost;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 最低库存(预警)
|
||||
*/
|
||||
private Integer lowQty;
|
||||
|
||||
/**
|
||||
* 最高库存(预警)
|
||||
*/
|
||||
private Integer highQty;
|
||||
|
||||
/**
|
||||
* 0启用 1禁用
|
||||
*/
|
||||
private Integer disable;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 数据中心-店铺
|
||||
* @TableName s_shop
|
||||
*/
|
||||
@Data
|
||||
public class SShop implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer 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.wei.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,48 +0,0 @@
|
|||
package com.qihang.wei.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName sys_platform
|
||||
*/
|
||||
@Data
|
||||
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;
|
||||
}
|
||||
|
|
@ -1,417 +0,0 @@
|
|||
package com.qihang.wei.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,18 +0,0 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.OGoodsSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【o_goods_sku(商品规格库存管理)】的数据库操作Mapper
|
||||
* @createDate 2024-03-29 11:41:24
|
||||
* @Entity com.qihang.wei.domain.OGoodsSku
|
||||
*/
|
||||
public interface OGoodsSkuMapper extends BaseMapper<OGoodsSku> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.SShop;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
* @Entity com.qihang.wei.domain.SShop
|
||||
*/
|
||||
public interface SShopMapper extends BaseMapper<SShop> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.SShopSetting;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Mapper
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
* @Entity com.qihang.wei.domain.SShopSetting
|
||||
*/
|
||||
public interface SShopSettingMapper extends BaseMapper<SShopSetting> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.SysPlatform;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【sys_platform】的数据库操作Mapper
|
||||
* @createDate 2024-03-24 18:04:27
|
||||
* @Entity com.qihang.wei.domain.SysPlatform
|
||||
*/
|
||||
public interface SysPlatformMapper extends BaseMapper<SysPlatform> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.qihang.wei.mapper;
|
||||
|
||||
import com.qihang.wei.domain.SysShop;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Mapper
|
||||
* @createDate 2024-03-20 13:33:19
|
||||
* @Entity com.qihang.wei.domain.SysShop
|
||||
*/
|
||||
public interface SysShopMapper extends BaseMapper<SysShop> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ import com.qihang.wei.openApi.service.ShopInfoApiService;
|
|||
import com.qihang.wei.openApi.service.TokenApiService;
|
||||
import com.qihang.wei.openApi.vo.ShopApiResultVo;
|
||||
import com.qihang.wei.openApi.vo.Token;
|
||||
import com.qihang.wei.service.SysPlatformService;
|
||||
import com.qihang.wei.service.SysShopService;
|
||||
import com.qihang.wei.service.SShopService;
|
||||
import com.qihang.wei.service.SShopSettingService;
|
||||
import com.qihang.wei.utils.RemoteUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -19,8 +19,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;
|
||||
/**
|
||||
* 更新前的检查
|
||||
*
|
||||
|
|
@ -34,27 +34,27 @@ public class ApiCommon {
|
|||
return ResultVo.error(HttpStatus.PARAMS_ERROR,"参数错误,没有找到店铺");
|
||||
}
|
||||
if (shop.getType() != EnumShopType.WEI.getIndex()) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是JD店铺");
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是视频号店铺");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppKey())) {
|
||||
if(!StringUtils.hasText(shop.getAppkey())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
||||
}
|
||||
if(!StringUtils.hasText(shop.getAppSercet())) {
|
||||
if(!StringUtils.hasText(shop.getAppsercet())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
||||
}
|
||||
var platform =platformService.getById(EnumShopType.WEI.getIndex());
|
||||
if(!StringUtils.hasText(platform.getServerUrl())) {
|
||||
if(!StringUtils.hasText(platform.getRequestUrl())) {
|
||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||
}
|
||||
|
||||
ShopApiParams params = new ShopApiParams();
|
||||
params.setAppKey(shop.getAppKey());
|
||||
params.setAppSecret(shop.getAppSercet());
|
||||
params.setAccessToken(shop.getAccessToken());
|
||||
params.setAppKey(shop.getAppkey());
|
||||
params.setAppSecret(shop.getAppsercet());
|
||||
params.setAccessToken(shop.getSessionkey());
|
||||
params.setApiRequestUrl(shop.getApiRequestUrl());
|
||||
params.setServerUrl(platform.getServerUrl());
|
||||
params.setSellerId(shop.getSellerId().toString());
|
||||
if (!StringUtils.hasText(shop.getAccessToken())) {
|
||||
params.setServerUrl(platform.getRequestUrl());
|
||||
params.setSellerId(shop.getSelleruserid().toString());
|
||||
if (!StringUtils.hasText(shop.getSessionkey())) {
|
||||
// String s = "/token?grant_type=client_credential&appid="+params.getAppKey()+"&secret="+params.getAppSecret();
|
||||
TokenApiService remoting = RemoteUtil.Remoting(params.getServerUrl(), TokenApiService.class);
|
||||
Token token = remoting.getToken("client_credential",params.getAppKey(),params.getAppSecret());
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.OGoodsSku;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【o_goods_sku(商品规格库存管理)】的数据库操作Service
|
||||
* @createDate 2024-03-29 11:41:24
|
||||
*/
|
||||
public interface OGoodsSkuService extends IService<OGoodsSku> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.SShop;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
*/
|
||||
public interface SShopService extends IService<SShop> {
|
||||
SShop selectShopById(Integer shopId);
|
||||
|
||||
void updateSessionKey(Integer shopId,String sessionKey);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.SShopSetting;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Service
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
*/
|
||||
public interface SShopSettingService extends IService<SShopSetting> {
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.SysPlatform;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【sys_platform】的数据库操作Service
|
||||
* @createDate 2024-03-24 18:04:27
|
||||
*/
|
||||
public interface SysPlatformService extends IService<SysPlatform> {
|
||||
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.qihang.wei.service;
|
||||
|
||||
import com.qihang.wei.domain.SysShop;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Service
|
||||
* @createDate 2024-03-20 13:33:19
|
||||
*/
|
||||
public interface SysShopService extends IService<SysShop> {
|
||||
SysShop selectShopById(Integer shopId);
|
||||
|
||||
void updateSessionKey(Integer shopId,String sessionKey);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.OGoodsSku;
|
||||
import com.qihang.wei.service.OGoodsSkuService;
|
||||
import com.qihang.wei.mapper.OGoodsSkuMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【o_goods_sku(商品规格库存管理)】的数据库操作Service实现
|
||||
* @createDate 2024-03-29 11:41:24
|
||||
*/
|
||||
@Service
|
||||
public class OGoodsSkuServiceImpl extends ServiceImpl<OGoodsSkuMapper, OGoodsSku>
|
||||
implements OGoodsSkuService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.SShop;
|
||||
import com.qihang.wei.service.SShopService;
|
||||
import com.qihang.wei.mapper.SShopMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class SShopServiceImpl extends ServiceImpl<SShopMapper, SShop>
|
||||
implements SShopService{
|
||||
private final SShopMapper mapper;
|
||||
@Override
|
||||
public SShop selectShopById(Integer shopId) {
|
||||
return mapper.selectById(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSessionKey(Integer shopId, String sessionKey) {
|
||||
SShop shop = new SShop();
|
||||
shop.setId(shopId);
|
||||
shop.setSessionkey(sessionKey);
|
||||
mapper.updateById(shop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.SShopSetting;
|
||||
import com.qihang.wei.service.SShopSettingService;
|
||||
import com.qihang.wei.mapper.SShopSettingMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_setting(第三方平台设置)】的数据库操作Service实现
|
||||
* @createDate 2024-06-03 14:14:56
|
||||
*/
|
||||
@Service
|
||||
public class SShopSettingServiceImpl extends ServiceImpl<SShopSettingMapper, SShopSetting>
|
||||
implements SShopSettingService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.SysPlatform;
|
||||
import com.qihang.wei.service.SysPlatformService;
|
||||
import com.qihang.wei.mapper.SysPlatformMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author qilip
|
||||
* @description 针对表【sys_platform】的数据库操作Service实现
|
||||
* @createDate 2024-03-24 18:04:27
|
||||
*/
|
||||
@Service
|
||||
public class SysPlatformServiceImpl extends ServiceImpl<SysPlatformMapper, SysPlatform>
|
||||
implements SysPlatformService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.qihang.wei.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.wei.domain.SysShop;
|
||||
import com.qihang.wei.service.SysShopService;
|
||||
import com.qihang.wei.mapper.SysShopMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【sys_shop(数据中心-店铺)】的数据库操作Service实现
|
||||
* @createDate 2024-03-20 13:33:19
|
||||
*/
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -4,17 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.utils.StringUtils;
|
||||
import com.qihang.wei.domain.OGoodsSku;
|
||||
import com.qihang.wei.domain.WeiGoods;
|
||||
import com.qihang.wei.domain.WeiGoodsSku;
|
||||
import com.qihang.wei.mapper.OGoodsSkuMapper;
|
||||
import com.qihang.wei.mapper.WeiGoodsSkuMapper;
|
||||
import com.qihang.wei.service.WeiGoodsService;
|
||||
import com.qihang.wei.mapper.WeiGoodsMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +25,7 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
implements WeiGoodsService{
|
||||
private final WeiGoodsMapper mapper;
|
||||
private final WeiGoodsSkuMapper skuMapper;
|
||||
private final OGoodsSkuMapper goodsSkuMapper;
|
||||
// private final OGoodsSkuMapper goodsSkuMapper;
|
||||
|
||||
@Override
|
||||
public int saveAndUpdateGoods(Integer shopId, WeiGoods goods) {
|
||||
|
|
@ -47,13 +44,13 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
for (var sku : goods.getSkus()) {
|
||||
sku.setWeiGoodsId(goods.getId());
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
if(oGoodsSkus!=null && !oGoodsSkus.isEmpty()){
|
||||
sku.setErpGoodsId(oGoodsSkus.get(0).getErpGoodsId());
|
||||
sku.setErpGoodsSkuId(oGoodsSkus.get(0).getErpSkuId());
|
||||
}
|
||||
}
|
||||
// if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
// List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
// if(oGoodsSkus!=null && !oGoodsSkus.isEmpty()){
|
||||
// sku.setErpGoodsId(oGoodsSkus.get(0).getErpGoodsId());
|
||||
// sku.setErpGoodsSkuId(oGoodsSkus.get(0).getErpSkuId());
|
||||
// }
|
||||
// }
|
||||
skuMapper.insert(sku);
|
||||
}
|
||||
}
|
||||
|
|
@ -69,13 +66,13 @@ public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
|
|||
for (var sku : goods.getSkus()) {
|
||||
sku.setWeiGoodsId(goods.getId());
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
if(oGoodsSkus!=null && !oGoodsSkus.isEmpty()){
|
||||
sku.setErpGoodsId(oGoodsSkus.get(0).getErpGoodsId());
|
||||
sku.setErpGoodsSkuId(oGoodsSkus.get(0).getErpSkuId());
|
||||
}
|
||||
}
|
||||
// if(StringUtils.isNotEmpty(sku.getSkuCode())) {
|
||||
// List<OGoodsSku> oGoodsSkus = goodsSkuMapper.selectList(new LambdaQueryWrapper<OGoodsSku>().eq(OGoodsSku::getSkuNum, sku.getSkuCode()));
|
||||
// if(oGoodsSkus!=null && !oGoodsSkus.isEmpty()){
|
||||
// sku.setErpGoodsId(oGoodsSkus.get(0).getErpGoodsId());
|
||||
// sku.setErpGoodsSkuId(oGoodsSkus.get(0).getErpSkuId());
|
||||
// }
|
||||
// }
|
||||
|
||||
skuMapper.insert(sku);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +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.wei.mapper.OGoodsSkuMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.OGoodsSku">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="erpGoodsId" column="erp_goods_id" jdbcType="BIGINT"/>
|
||||
<result property="erpSkuId" column="erp_sku_id" jdbcType="BIGINT"/>
|
||||
<result property="skuName" column="sku_name" jdbcType="VARCHAR"/>
|
||||
<result property="skuNum" column="sku_num" jdbcType="VARCHAR"/>
|
||||
<result property="colorId" column="color_id" jdbcType="INTEGER"/>
|
||||
<result property="colorValue" column="color_value" jdbcType="VARCHAR"/>
|
||||
<result property="colorImage" column="color_image" jdbcType="VARCHAR"/>
|
||||
<result property="sizeId" column="size_id" jdbcType="INTEGER"/>
|
||||
<result property="sizeValue" column="size_value" jdbcType="VARCHAR"/>
|
||||
<result property="styleId" column="style_id" jdbcType="INTEGER"/>
|
||||
<result property="styleValue" column="style_value" jdbcType="VARCHAR"/>
|
||||
<result property="barCode" column="bar_code" jdbcType="VARCHAR"/>
|
||||
<result property="purPrice" column="pur_price" jdbcType="DECIMAL"/>
|
||||
<result property="wholePrice" column="whole_price" jdbcType="DECIMAL"/>
|
||||
<result property="retailPrice" column="retail_price" jdbcType="DECIMAL"/>
|
||||
<result property="unitCost" column="unit_cost" jdbcType="DECIMAL"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="TINYINT"/>
|
||||
<result property="lowQty" column="low_qty" jdbcType="INTEGER"/>
|
||||
<result property="highQty" column="high_qty" jdbcType="INTEGER"/>
|
||||
<result property="disable" column="disable" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,erp_goods_id,erp_sku_id,
|
||||
sku_name,sku_num,color_id,
|
||||
color_value,color_image,size_id,
|
||||
size_value,style_id,style_value,
|
||||
bar_code,pur_price,whole_price,
|
||||
retail_price,unit_cost,remark,
|
||||
status,low_qty,high_qty,
|
||||
disable
|
||||
</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.wei.mapper.SShopMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.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.wei.mapper.SysShopMapper">
|
||||
<mapper namespace="com.qihang.wei.mapper.SShopSettingMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.SysShop">
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.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.wei.mapper.SysPlatformMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.wei.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>
|
||||
|
|
@ -44,12 +44,16 @@ public class SysLoginController
|
|||
@PostMapping("/login")
|
||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
||||
{
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
try {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
// 生成令牌
|
||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||
loginBody.getUuid());
|
||||
ajax.put(Constants.TOKEN, token);
|
||||
return ajax;
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ mybatis-plus:
|
|||
# mapper-locations: classpath*:mappers/user/*.xml
|
||||
|
||||
spring:
|
||||
messages:
|
||||
# 国际化资源文件路径
|
||||
basename: i18n/messages
|
||||
cloud:
|
||||
loadbalancer:
|
||||
nacos:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 列表
|
||||
export function getDeliverList(data) {
|
||||
return request({
|
||||
url: '/api/wei-api/ewaybill/get_deliver_list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane label="视频号小店" name="ewaybillWei">
|
||||
<ewaybill-wei></ewaybill-wei>
|
||||
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="供应商代发货" name="supplierShip" lazy>-->
|
||||
<!-- <supplier-ship></supplier-ship>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ewaybillWei from "@/views/shop/wei/ewaybill/index.vue";
|
||||
|
||||
|
||||
export default {
|
||||
name: "ewaybillPrint",
|
||||
components:{ewaybillWei},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'ewaybillWei'
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<script>
|
||||
import TaoRefund from "@/views/tao/refund/index";
|
||||
import RefundJd from "@/views/jd/refund/index";
|
||||
import RefundWei from "@/views/wei/refund/index";
|
||||
import RefundWei from "@/views/shop/wei/refund/index";
|
||||
import DouRefund from "@/views/dou/refund/index.vue";
|
||||
import PddRefund from "@/views/pdd/refund/index.vue";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,234 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="店铺" prop="shopId">-->
|
||||
<!-- <el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in shopList"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<!-- <el-table-column label="ID" align="center" prop="id" />-->
|
||||
<el-table-column label="商品ID" align="center" prop="wareId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="sku名称" align="center" prop="skuName" />
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="商家编码" align="center" prop="outerId" />
|
||||
<el-table-column label="京东价" align="center" prop="jdPrice" />
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 1">销售中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">已下架</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleLink(scope.row)"
|
||||
>关联ERP</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
<!-- 添加或修改商品管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
|
||||
export default {
|
||||
name: "ewaybillWei",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// listShop({type:3}).then(response => {
|
||||
// this.shopList = response.rows;
|
||||
// });
|
||||
// this.getList();
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
erpSkuId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,254 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
|
||||
<el-form-item label="平台SkuId" prop="skuId">
|
||||
<el-input
|
||||
v-model="queryParams.skuId"
|
||||
placeholder="请输入平台SkuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家sku编码" prop="outerId">
|
||||
<el-input
|
||||
v-model="queryParams.outerId"
|
||||
placeholder="请输入商家sku编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="ERP skuId" prop="erpSkuId">
|
||||
<el-input
|
||||
v-model="queryParams.erpSkuId"
|
||||
placeholder="请输入ERP skuId"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="快递公司" prop="shopId">
|
||||
<el-select v-model="queryParams.shopId" placeholder="请选择快递公司" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in deliverList"
|
||||
:key="item.delivery_id"
|
||||
:label="item.delivery_name"
|
||||
:value="item.delivery_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button @click="getDeliverList"> 获取 </el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺" prop="shopId">
|
||||
<el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in shopList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handlePull"
|
||||
>API拉取商品数据</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<!-- <el-table-column label="ID" align="center" prop="id" />-->
|
||||
<el-table-column label="商品ID" align="center" prop="wareId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="sku名称" align="center" prop="skuName" />
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="商家编码" align="center" prop="outerId" />
|
||||
<el-table-column label="京东价" align="center" prop="jdPrice" />
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 1">销售中</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.status === 2">已下架</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleLink(scope.row)"
|
||||
>关联ERP</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
<!-- 添加或修改商品管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
import {getDeliverList} from "@/api/wei/ewaybill";
|
||||
|
||||
export default {
|
||||
name: "ewaybillWei",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 商品管理表格数据
|
||||
goodsList: [],
|
||||
shopList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
deliverList: [],
|
||||
supplierList: [],
|
||||
categoryList: [],
|
||||
categoryTree: [],
|
||||
// 表单校验
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "不能为空", trigger: "change" }
|
||||
],
|
||||
erpSkuId: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
// listShop({type:3}).then(response => {
|
||||
// this.shopList = response.rows;
|
||||
// });
|
||||
// this.getList();
|
||||
this.loading = false;
|
||||
},
|
||||
methods: {
|
||||
/** getDeliverList获取开通的快递公司 */
|
||||
getDeliverList(){
|
||||
getDeliverList({shopId:2}).then(response => {
|
||||
this.deliverList = response.data;
|
||||
});
|
||||
|
||||
},
|
||||
/** 查询商品管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGoodsSku(this.queryParams).then(response => {
|
||||
this.goodsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
erpSkuId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getGoodsSku(id).then(response => {
|
||||
console.log('=====00000000============',response)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
linkErpGoodsSkuId(this.form).then(response => {
|
||||
this.$modal.msgSuccess("关联成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue