新增dou商品拉取、关联
This commit is contained in:
parent
e62d17cf56
commit
b145e7e082
|
|
@ -1,67 +1,14 @@
|
|||
package com.qihang.common.api;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ShopApiParams {
|
||||
private String appKey;
|
||||
private String appSecret;
|
||||
private String accessToken;
|
||||
private String apiRequestUrl;
|
||||
private String tokenRequestUrl;
|
||||
private String redirectUrl;
|
||||
private String serverUrl;
|
||||
private String sellerId;
|
||||
private Long sellerShopId;
|
||||
|
||||
public String getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
public void setSellerId(String sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
public String getServerUrl() {
|
||||
return serverUrl;
|
||||
}
|
||||
|
||||
public void setServerUrl(String serverUrl) {
|
||||
this.serverUrl = serverUrl;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package com.qihang.common.common;
|
|||
*/
|
||||
public enum ResultVoEnum {
|
||||
SUCCESS("成功", 0),
|
||||
TokenFail("Token失效",401),
|
||||
TokenFail("Token失效",1401),
|
||||
NotFound("NotFound", 404),//没有找到
|
||||
Unable("Unable", 403),//无法处理
|
||||
// NotLogin("未登录", 400),//未登录
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -25,79 +25,16 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-web</artifactId>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-tomcat</artifactId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-undertow</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <!–SpringCloud Alibaba nacos 服务发现依赖–>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.qihang</groupId>-->
|
||||
<!-- <artifactId>security</artifactId>-->
|
||||
<!-- <version>1.0-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>mysql</groupId>-->
|
||||
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||
<!-- <version>8.0.33</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baomidou</groupId>-->
|
||||
<!-- <artifactId>mybatis-plus-spring-boot3-starter</artifactId>-->
|
||||
<!-- <version>3.5.5</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>doudian</groupId>
|
||||
<artifactId>doudian-sdk-java</artifactId>
|
||||
<version>1.1.0-20240217120650</version>
|
||||
<artifactId>dou-api</artifactId>
|
||||
<version>0.3</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/doudian-sdk-java-1.1.0-20240217120650.jar</systemPath>
|
||||
<systemPath>${project.basedir}/libs/dou-api-0.3.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.projectlombok</groupId>-->
|
||||
<!-- <artifactId>lombok</artifactId>-->
|
||||
<!-- <version>1.18.30</version>-->
|
||||
<!-- <scope>provided</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
<!-- <dependencyManagement>-->
|
||||
<!-- <dependencies>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-dependencies</artifactId>-->
|
||||
<!-- <version>${spring-boot.version}</version>-->
|
||||
<!-- <type>pom</type>-->
|
||||
<!-- <scope>import</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-alibaba-dependencies</artifactId>-->
|
||||
<!-- <version>${spring-cloud-alibaba.version}</version>-->
|
||||
<!-- <type>pom</type>-->
|
||||
<!-- <scope>import</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- </dependencies>-->
|
||||
<!-- </dependencyManagement>-->
|
||||
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.qihang.dou.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@MapperScan("com.qihang.dou.mapper")
|
||||
public class MybatisPlusConfig {
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); //注意使用哪种数据库
|
||||
return interceptor;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.qihang.dou.controller;
|
||||
|
||||
import cn.qihangerp.open.dou.common.ApiResultVo;
|
||||
import com.qihang.common.api.ShopApiParams;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.EnumShopType;
|
||||
import com.qihang.dou.service.SShopPlatformService;
|
||||
import com.qihang.dou.service.SShopService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.java.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Log
|
||||
@Component
|
||||
public class DouApiHelper {
|
||||
private final SShopService shopService;
|
||||
private final SShopPlatformService platformService;
|
||||
|
||||
public ApiResultVo<ShopApiParams> checkBefore(Long shopId) {
|
||||
log.info("/**************主动更新dou 参数检查****************/");
|
||||
var shop = shopService.selectShopById(shopId);
|
||||
|
||||
if (shop == null) return ApiResultVo.error(ResultVoEnum.ParamsError.getIndex(), "参数错误,没有找到店铺");
|
||||
|
||||
if (shop.getPlatform() != EnumShopType.DOU.getIndex())
|
||||
return ApiResultVo.error(ResultVoEnum.ParamsError.getIndex(), "参数错误,店铺不是dou店铺");
|
||||
|
||||
if(shop.getSellerShopId()==null || shop.getSellerShopId()<=0) return ApiResultVo.error(ResultVoEnum.ParamsError.getIndex(), "店铺配置错误,请配置店铺平台shop_id");
|
||||
|
||||
var thirdConfig = platformService.getById(shop.getPlatform().longValue());
|
||||
if (thirdConfig == null) return ApiResultVo.error(ResultVoEnum.SystemException.getIndex(), "系统错误,没有找到第三方平台的配置信息");
|
||||
else if (StringUtils.isEmpty(thirdConfig.getAppKey()))
|
||||
return ApiResultVo.error(ResultVoEnum.SystemException.getIndex(), "系统错误,第三方平台配置信息不完整,缺少appkey");
|
||||
else if (StringUtils.isEmpty(thirdConfig.getAppSecret()))
|
||||
return ApiResultVo.error(ResultVoEnum.SystemException.getIndex(), "系统错误,第三方平台配置信息不完整,缺少appSecret");
|
||||
// else if (StringUtils.isEmpty(thirdConfig.getServerUrl()))
|
||||
// return new ApiResult<>(ResultVoEnum.SystemException.getIndex(), "系统错误,第三方平台配置信息不完整,缺少server_url");
|
||||
|
||||
ShopApiParams params = new ShopApiParams();
|
||||
params.setAppKey(thirdConfig.getAppKey());
|
||||
params.setAppSecret(thirdConfig.getAppSecret());
|
||||
params.setAccessToken(shop.getAccessToken());
|
||||
params.setServerUrl(thirdConfig.getServerUrl());
|
||||
params.setRedirectUrl(thirdConfig.getRedirectUrl());
|
||||
params.setSellerShopId(shop.getSellerShopId());
|
||||
if (!StringUtils.hasText(shop.getAccessToken()))
|
||||
return ApiResultVo.error(ResultVoEnum.TokenFail.getIndex(), "Token已过期,请重新授权",params);
|
||||
|
||||
return ApiResultVo.success(params);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.qihang.dou.controller;
|
||||
|
||||
|
||||
import cn.qihangerp.open.dou.DouGoodsApiHelper;
|
||||
import cn.qihangerp.open.dou.DouTokenApiHelper;
|
||||
import cn.qihangerp.open.dou.common.ApiResultVo;
|
||||
import cn.qihangerp.open.dou.model.GoodsListResultVo;
|
||||
import cn.qihangerp.open.dou.model.Token;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.common.enums.HttpStatus;
|
||||
import com.qihang.dou.domain.OmsDouGoods;
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.qihang.dou.domain.bo.DouRequest;
|
||||
import com.qihang.dou.service.OmsDouGoodsService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
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;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/goods")
|
||||
@RestController
|
||||
public class DouGoodsApiController {
|
||||
private static Logger logger = LoggerFactory.getLogger(DouGoodsApiController.class);
|
||||
private final DouApiHelper douApiHelper;
|
||||
private final OmsDouGoodsService goodsService;
|
||||
|
||||
@RequestMapping(value = "/pull_goods", method = RequestMethod.POST)
|
||||
public AjaxResult getOrderList(@RequestBody DouRequest req) throws Exception {
|
||||
if (req.getShopId() == null || req.getShopId() <= 0) {
|
||||
return AjaxResult.error(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||
}
|
||||
var checkResult = douApiHelper.checkBefore(req.getShopId());
|
||||
if (checkResult.getCode() != ResultVoEnum.SUCCESS.getIndex()) {
|
||||
return AjaxResult.error(checkResult.getCode(), checkResult.getMsg(), checkResult.getData());
|
||||
}
|
||||
String accessToken = checkResult.getData().getAccessToken();
|
||||
String url = checkResult.getData().getServerUrl();
|
||||
String appKey = checkResult.getData().getAppKey();
|
||||
String appSercet = checkResult.getData().getAppSecret();
|
||||
|
||||
ApiResultVo<Token> token = DouTokenApiHelper.getToken(appKey, appSercet,checkResult.getData().getSellerShopId());
|
||||
if(token.getCode()==0) {
|
||||
accessToken = token.getData().getAccessToken();
|
||||
}else{
|
||||
return AjaxResult.error(token.getMsg());
|
||||
}
|
||||
|
||||
int insertSuccess = 0;//新增成功的订单
|
||||
int totalError = 0;
|
||||
int hasExistOrder = 0;//已存在的订单数
|
||||
ApiResultVo<GoodsListResultVo> apiResultVo = DouGoodsApiHelper.getGoodsList(appKey, appSercet, accessToken, 1, 10);
|
||||
if (apiResultVo.getCode() != 0) return AjaxResult.error(apiResultVo.getCode(), apiResultVo.getMsg());
|
||||
//成功
|
||||
if (apiResultVo.getData().getGoodsList() != null) {
|
||||
for (var g : apiResultVo.getData().getGoodsList()) {
|
||||
OmsDouGoods goods = new OmsDouGoods();
|
||||
BeanUtils.copyProperties(g, goods);
|
||||
// TODO:转换goods
|
||||
goods.setShopId(req.getShopId());
|
||||
goods.setPullTime(new Date());
|
||||
List<OmsDouGoodsSku> skuList = new ArrayList<>();
|
||||
for (var s : g.getSkuList()) {
|
||||
OmsDouGoodsSku sku = new OmsDouGoodsSku();
|
||||
BeanUtils.copyProperties(s, sku);
|
||||
sku.setShopId(req.getShopId());
|
||||
sku.setName(g.getName());
|
||||
sku.setImg(g.getImg());
|
||||
skuList.add(sku);
|
||||
}
|
||||
goods.setSkuList(skuList);
|
||||
|
||||
int result = goodsService.saveAndUpdateGoods(req.getShopId(), goods);
|
||||
if (result == ResultVoEnum.DataExist.getIndex()) {
|
||||
//已经存在
|
||||
hasExistOrder++;
|
||||
} else if (result == ResultVoEnum.SUCCESS.getIndex()) {
|
||||
insertSuccess++;
|
||||
} else {
|
||||
totalError++;
|
||||
}
|
||||
}
|
||||
}
|
||||
String msg = "成功,总共找到:" + apiResultVo.getData().getGoodsList().size() + "条商品数据,新增:" + insertSuccess + "条,添加错误:" + totalError + "条,更新:" + hasExistOrder + "条";
|
||||
logger.info(msg);
|
||||
// return new ApiResult<>(EnumResultVo.SUCCESS.getIndex(), msg);
|
||||
return AjaxResult.success(msg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package com.qihang.dou.controller;
|
||||
|
||||
|
||||
import com.qihang.common.bo.LinkErpGoodsSkuBo;
|
||||
import com.qihang.common.common.AjaxResult;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.TableDataInfo;
|
||||
import com.qihang.dou.domain.OmsDouGoods;
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.qihang.dou.service.OmsDouGoodsService;
|
||||
import com.qihang.dou.service.OmsDouGoodsSkuService;
|
||||
import com.qihang.security.common.BaseController;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RequestMapping("/goods")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class DouGoodsController extends BaseController {
|
||||
private final OmsDouGoodsService goodsService;
|
||||
private final OmsDouGoodsSkuService skuService;
|
||||
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
||||
public TableDataInfo goodsList(OmsDouGoods bo, PageQuery pageQuery) {
|
||||
PageResult<OmsDouGoods> result = goodsService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/skuList", method = RequestMethod.GET)
|
||||
public TableDataInfo skuList(OmsDouGoodsSku bo, PageQuery pageQuery) {
|
||||
PageResult<OmsDouGoodsSku> result = skuService.queryPageList(bo, pageQuery);
|
||||
|
||||
return getDataTable(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺订单详细信息
|
||||
*/
|
||||
@GetMapping(value = "/sku/{id}")
|
||||
public AjaxResult getSkuInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(skuService.getById(id));
|
||||
}
|
||||
@PostMapping(value = "/sku/linkErp")
|
||||
public AjaxResult linkErp(@RequestBody LinkErpGoodsSkuBo bo)
|
||||
{
|
||||
OmsDouGoodsSku sku = new OmsDouGoodsSku();
|
||||
sku.setId(bo.getId());
|
||||
sku.setErpGoodsSkuId(Long.parseLong(bo.getErpGoodsSkuId()));
|
||||
skuService.updateById(sku);
|
||||
return success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +1,5 @@
|
|||
package com.qihang.dou.controller;
|
||||
|
||||
import com.doudian.open.api.order_searchList.OrderSearchListRequest;
|
||||
import com.doudian.open.api.order_searchList.OrderSearchListResponse;
|
||||
import com.doudian.open.api.order_searchList.param.OrderSearchListParam;
|
||||
import com.doudian.open.api.token_create.TokenCreateRequest;
|
||||
import com.doudian.open.api.token_create.TokenCreateResponse;
|
||||
import com.doudian.open.api.token_create.param.TokenCreateParam;
|
||||
import com.doudian.open.core.AccessToken;
|
||||
import com.doudian.open.core.AccessTokenBuilder;
|
||||
import com.doudian.open.core.GlobalConfig;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -18,40 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
public class HomeController {
|
||||
@GetMapping("/")
|
||||
public String home() {
|
||||
//设置appKey和appSecret,全局设置一次
|
||||
String appkey = "7005157746437834253";
|
||||
String appSecret = "8104c8b8-9085-4a80-9248-629759b4f1a3";
|
||||
appkey = "7344938657423296019";
|
||||
appSecret = "4e704882-832a-42e5-845f-6af991ce0ce2";
|
||||
GlobalConfig.initAppKey(appkey);
|
||||
GlobalConfig.initAppSecret(appSecret);
|
||||
//获取access_token方法
|
||||
AccessToken accessToken = AccessTokenBuilder.build(90158786L); //入参为shopId 4463798L
|
||||
|
||||
if ("50002".equals(accessToken.getCode())) {
|
||||
return accessToken.getSubMsg();
|
||||
}
|
||||
|
||||
OrderSearchListRequest request = new OrderSearchListRequest();
|
||||
OrderSearchListParam param = request.getParam();
|
||||
param.setProduct("3473196049974326153");
|
||||
param.setBType(2L);
|
||||
param.setAfterSaleStatusDesc("refund_success");
|
||||
param.setTrackingNo("435435");
|
||||
param.setPresellType(1L);
|
||||
param.setOrderType(1L);
|
||||
// param.setCreateTimeStart(1617355413L);
|
||||
// param.setCreateTimeEnd(1617355413L);
|
||||
param.setAbnormalOrder(1L);
|
||||
param.setTradeType(1L);
|
||||
param.setUpdateTimeStart(1709222400L);
|
||||
param.setUpdateTimeEnd(System.currentTimeMillis()/1000);
|
||||
param.setSize(20L);
|
||||
param.setPage(0L);
|
||||
param.setOrderBy("create_time");
|
||||
param.setOrderAsc(false);
|
||||
param.setFulfilStatus("no_accept");
|
||||
OrderSearchListResponse response = request.execute(accessToken);
|
||||
return "{'code':0,'msg':'dou-api请通过api访问'}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 抖店商品表
|
||||
* @TableName oms_dou_goods
|
||||
*/
|
||||
@Data
|
||||
public class OmsDouGoods implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品ID,抖店系统生成,店铺下唯一
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品类型;0-普通;1-新客商品;3-虚拟;6-玉石闪购;7-云闪购 ;127-其他类型;
|
||||
*/
|
||||
private Integer productType;
|
||||
|
||||
/**
|
||||
* 商品标题。
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品主图的第一张图
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 商品审核状态: 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架;
|
||||
*/
|
||||
private Integer checkStatus;
|
||||
|
||||
/**
|
||||
* 商品在店铺中状态: 0-在线;1-下线;2-删除;
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商品规格,全局唯一
|
||||
*/
|
||||
private Long specId;
|
||||
|
||||
/**
|
||||
* 商品创建时间,unix时间戳,单位:秒;
|
||||
*/
|
||||
private Integer createTime;
|
||||
|
||||
/**
|
||||
* 商品更新时间,unix时间戳,单位:秒;
|
||||
*/
|
||||
private Integer updateTime;
|
||||
|
||||
/**
|
||||
* 商品详情,最大支持50张图片,单张详情图宽高比不超2000*2000px,大小5M内,仅支持jpg/jpeg/png格式;
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 类目详情;商品类目id可使用【/shop/getShopCategory】查询
|
||||
*/
|
||||
private String categoryDetail;
|
||||
|
||||
/**
|
||||
* 外部商家编码,商家自定义字段,支持最多 255个字符
|
||||
*/
|
||||
private String outerProductId;
|
||||
|
||||
/**
|
||||
* 是否是组合商品,true-是,false-不是;
|
||||
*/
|
||||
private String isPackageProduct;
|
||||
|
||||
/**
|
||||
* erp商品id
|
||||
*/
|
||||
private Long erpGoodsId;
|
||||
|
||||
/**
|
||||
* 拉取时间
|
||||
*/
|
||||
private Date pullTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<OmsDouGoodsSku> skuList;
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 抖店商品Sku表
|
||||
* @TableName oms_dou_goods_sku
|
||||
*/
|
||||
@Data
|
||||
public class OmsDouGoodsSku implements Serializable {
|
||||
/**
|
||||
* 商品sku_id;抖店系统生成。
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 商品ID;抖店系统生成。
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 规格ID
|
||||
*/
|
||||
private Long specId;
|
||||
|
||||
/**
|
||||
* sku外部编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 库存类型;0-普通;1-区域库存;10-阶梯库存;
|
||||
*/
|
||||
private Integer skuType;
|
||||
|
||||
/**
|
||||
* sku状态 true上架 false下架
|
||||
*/
|
||||
private String skuStatus;
|
||||
|
||||
/**
|
||||
* 外部的skuId;商家自定义;未设置返回为0。
|
||||
*/
|
||||
private Long outSkuId;
|
||||
|
||||
/**
|
||||
* 第一级子规格
|
||||
*/
|
||||
private Long specDetailId1;
|
||||
|
||||
/**
|
||||
* 第二级子规格
|
||||
*/
|
||||
private Long specDetailId2;
|
||||
|
||||
/**
|
||||
*
|
||||
第三级子规格
|
||||
*/
|
||||
private Long specDetailId3;
|
||||
|
||||
/**
|
||||
* 第一级子规格名
|
||||
*/
|
||||
private String specDetailName1;
|
||||
|
||||
/**
|
||||
* 第二级子规格名
|
||||
*/
|
||||
private String specDetailName2;
|
||||
|
||||
/**
|
||||
*
|
||||
第三级子规格名
|
||||
*/
|
||||
private String specDetailName3;
|
||||
|
||||
/**
|
||||
* 商品价格,单位:分
|
||||
*/
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 创建时间,时间戳:单位秒;
|
||||
*/
|
||||
private Integer createTime;
|
||||
|
||||
/**
|
||||
* ku_type=0时,表示普通库存数量 ;sku_type=1时,使用stock_map,表示区域库存数量
|
||||
*/
|
||||
private Integer stockNum;
|
||||
|
||||
/**
|
||||
* sku_type=0时,表示预占库存数量; sku_type=1时,表示区域库存数量,使用prehold_stock_map
|
||||
*/
|
||||
private Integer preholdStockNum;
|
||||
|
||||
/**
|
||||
* 活动库存
|
||||
*/
|
||||
private Integer promStockNum;
|
||||
|
||||
/**
|
||||
*
|
||||
阶梯库存
|
||||
*/
|
||||
private Integer stepStockNum;
|
||||
|
||||
/**
|
||||
* 预占阶梯库存
|
||||
*/
|
||||
private Integer preholdStepStockNum;
|
||||
|
||||
/**
|
||||
* 活动阶梯库存
|
||||
*/
|
||||
private Integer promStepStockNum;
|
||||
|
||||
/**
|
||||
* 库存模型V2新增 普通库存 非活动可售
|
||||
*/
|
||||
private Integer normalStockNum;
|
||||
|
||||
/**
|
||||
* 库存模型V2新增 渠道库存
|
||||
*/
|
||||
private Integer channelStockNum;
|
||||
|
||||
/**
|
||||
* 销售属性,代替spec_detail_id123、spec_detail_name123
|
||||
*/
|
||||
private String sellProperties;
|
||||
|
||||
/**
|
||||
* 商品id(o_goods外键)
|
||||
*/
|
||||
private Long erpGoodsId;
|
||||
|
||||
/**
|
||||
* 商品skuid(o_goods_sku外键)
|
||||
*/
|
||||
private Long erpGoodsSkuId;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品标题。
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品主图的第一张图
|
||||
*/
|
||||
private String img;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
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 platform;
|
||||
|
||||
/**
|
||||
* 店铺url
|
||||
*/
|
||||
private String shopUrl;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Integer isDelete;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 第三方平台店铺id
|
||||
*/
|
||||
private Long sellerShopId;
|
||||
|
||||
/**
|
||||
* Appkey(微信视频号小店专用)
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* Appsercet(微信视频号小店专用)
|
||||
*/
|
||||
private String appSercet;
|
||||
|
||||
/**
|
||||
* 第三方平台sessionKey(access_token)
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
/**
|
||||
* accessToken到期(秒)
|
||||
*/
|
||||
private Long accessExpiresIn;
|
||||
|
||||
/**
|
||||
* access_token开始时间
|
||||
*/
|
||||
private Long accessTokenBegin;
|
||||
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
private String refreshToken;
|
||||
|
||||
/**
|
||||
* 刷新token过期时间
|
||||
*/
|
||||
private Long refreshTokenTimeout;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 电商平台配置表
|
||||
* @TableName s_shop_platform
|
||||
*/
|
||||
@Data
|
||||
public class SShopPlatform implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 平台名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* appKey
|
||||
*/
|
||||
private String appKey;
|
||||
|
||||
/**
|
||||
* appSecret
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 服务url
|
||||
*/
|
||||
private String serverUrl;
|
||||
|
||||
/**
|
||||
* 回调url
|
||||
*/
|
||||
private String redirectUrl;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 店铺更新最后时间记录
|
||||
* @TableName s_shop_pull_lasttime
|
||||
*/
|
||||
@Data
|
||||
public class SShopPullLasttime 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;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.qihang.dou.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 店铺更新日志表
|
||||
* @TableName s_shop_pull_logs
|
||||
*/
|
||||
@Data
|
||||
public class SShopPullLogs implements Serializable {
|
||||
/**
|
||||
* 主键Id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 平台id
|
||||
*/
|
||||
private Integer shopType;
|
||||
|
||||
/**
|
||||
* 类型(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;
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package com.qihang.dou.domain.bo;
|
||||
|
||||
public class DouRequest {
|
||||
private Long shopId;//店铺Id
|
||||
private Long orderId;//订单id
|
||||
private Integer updType;//更新类型0拉取新订单1更新订单
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Integer getUpdType() {
|
||||
return updType;
|
||||
}
|
||||
|
||||
public void setUpdType(Integer updType) {
|
||||
this.updType = updType;
|
||||
}
|
||||
|
||||
public Long getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Long shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.OmsDouGoods;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods(抖店商品表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
* @Entity com.qihang.dou.domain.OmsDouGoods
|
||||
*/
|
||||
public interface OmsDouGoodsMapper extends BaseMapper<OmsDouGoods> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods_sku(抖店商品Sku表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
* @Entity com.qihang.dou.domain.OmsDouGoodsSku
|
||||
*/
|
||||
public interface OmsDouGoodsSkuMapper extends BaseMapper<OmsDouGoodsSku> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.SShop;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
* @Entity com.qihang.dou.domain.SShop
|
||||
*/
|
||||
public interface SShopMapper extends BaseMapper<SShop> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.SShopPlatform;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
* @Entity com.qihang.dou.domain.SShopPlatform
|
||||
*/
|
||||
public interface SShopPlatformMapper extends BaseMapper<SShopPlatform> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.SShopPullLasttime;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_lasttime(店铺更新最后时间记录)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
* @Entity com.qihang.dou.domain.SShopPullLasttime
|
||||
*/
|
||||
public interface SShopPullLasttimeMapper extends BaseMapper<SShopPullLasttime> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.qihang.dou.mapper;
|
||||
|
||||
import com.qihang.dou.domain.SShopPullLogs;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_logs(店铺更新日志表)】的数据库操作Mapper
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
* @Entity com.qihang.dou.domain.SShopPullLogs
|
||||
*/
|
||||
public interface SShopPullLogsMapper extends BaseMapper<SShopPullLogs> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.dou.domain.OmsDouGoods;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods(抖店商品表)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
*/
|
||||
public interface OmsDouGoodsService extends IService<OmsDouGoods> {
|
||||
PageResult<OmsDouGoods> queryPageList(OmsDouGoods bo, PageQuery pageQuery);
|
||||
|
||||
int saveAndUpdateGoods(Long shopId,OmsDouGoods goods);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods_sku(抖店商品Sku表)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
*/
|
||||
public interface OmsDouGoodsSkuService extends IService<OmsDouGoodsSku> {
|
||||
PageResult<OmsDouGoodsSku> queryPageList(OmsDouGoodsSku bo, PageQuery pageQuery);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.dou.domain.SShopPlatform;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
public interface SShopPlatformService extends IService<SShopPlatform> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.dou.domain.SShopPullLasttime;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_lasttime(店铺更新最后时间记录)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
public interface SShopPullLasttimeService extends IService<SShopPullLasttime> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.dou.domain.SShopPullLogs;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_logs(店铺更新日志表)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
public interface SShopPullLogsService extends IService<SShopPullLogs> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.qihang.dou.service;
|
||||
|
||||
import com.qihang.dou.domain.SShop;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Service
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
public interface SShopService extends IService<SShop> {
|
||||
SShop selectShopById(Long shopId);
|
||||
void updateSessionKey(Integer shopId, String ownerId, String sessionKey, String refreshToken, Long expiresIn);
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.common.common.ResultVoEnum;
|
||||
import com.qihang.dou.domain.OmsDouGoods;
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.qihang.dou.mapper.OmsDouGoodsSkuMapper;
|
||||
import com.qihang.dou.service.OmsDouGoodsService;
|
||||
import com.qihang.dou.mapper.OmsDouGoodsMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods(抖店商品表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsDouGoodsServiceImpl extends ServiceImpl<OmsDouGoodsMapper, OmsDouGoods>
|
||||
implements OmsDouGoodsService{
|
||||
private final OmsDouGoodsMapper mapper;
|
||||
private final OmsDouGoodsSkuMapper skuMapper;
|
||||
@Override
|
||||
public PageResult<OmsDouGoods> queryPageList(OmsDouGoods bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsDouGoods> queryWrapper = new LambdaQueryWrapper<OmsDouGoods>()
|
||||
.eq(bo.getShopId()!=null,OmsDouGoods::getShopId,bo.getShopId());
|
||||
|
||||
Page<OmsDouGoods> goodsPage = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
return PageResult.build(goodsPage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveAndUpdateGoods(Long shopId, OmsDouGoods goods) {
|
||||
List<OmsDouGoods> goodsList = mapper.selectList(new LambdaQueryWrapper<OmsDouGoods>().eq(OmsDouGoods::getProductId, goods.getProductId()));
|
||||
if(goodsList!=null && goodsList.size()>0){
|
||||
// 存在,更新
|
||||
goods.setShopId(shopId);
|
||||
goods.setId(goodsList.get(0).getId());
|
||||
goods.setModifyTime(new Date());
|
||||
mapper.updateById(goods);
|
||||
|
||||
// 删除sku
|
||||
skuMapper.delete(new LambdaQueryWrapper<OmsDouGoodsSku>().eq(OmsDouGoodsSku::getProductId,goods.getProductId()));
|
||||
|
||||
// 重新插入sku
|
||||
if(goods.getSkuList()!=null) {
|
||||
for (var sku : goods.getSkuList()) {
|
||||
sku.setShopId(shopId);
|
||||
sku.setImg(goods.getImg());
|
||||
sku.setName(goods.getName());
|
||||
sku.setErpGoodsId(0L);
|
||||
sku.setErpGoodsSkuId(0L);
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
// if(StringUtils.isNotEmpty(sku.getCode())) {
|
||||
// ErpGoodsSpecVo erpGoodsSpecVo = skuMapper.selectGoodsSpecBySpecNum(sku.getCode());
|
||||
// if(erpGoodsSpecVo!=null ){
|
||||
// sku.setErpGoodsId(erpGoodsSpecVo.getGoodsId());
|
||||
// sku.setErpGoodsSkuId(erpGoodsSpecVo.getId());
|
||||
//// sku.setErpSupplierId(erpGoodsSpecVo.getSupplierId());
|
||||
// }
|
||||
// }
|
||||
skuMapper.insert(sku);
|
||||
}
|
||||
}
|
||||
return ResultVoEnum.DataExist.getIndex();
|
||||
}else {
|
||||
// 不存在,新增
|
||||
goods.setShopId(shopId);
|
||||
goods.setPullTime(new Date());
|
||||
mapper.insert(goods);
|
||||
// 插入sku
|
||||
if(goods.getSkuList()!=null) {
|
||||
for (var sku : goods.getSkuList()) {
|
||||
sku.setShopId(shopId);
|
||||
sku.setImg(goods.getImg());
|
||||
sku.setName(goods.getName());
|
||||
sku.setErpGoodsId(0L);
|
||||
sku.setErpGoodsSkuId(0L);
|
||||
// 根据OuterId查找ERP系统中的skuid
|
||||
// if(StringUtils.isNotEmpty(sku.getCode())) {
|
||||
// ErpGoodsSpecVo erpGoodsSpecVo = skuMapper.selectGoodsSpecBySpecNum(sku.getCode());
|
||||
// if(erpGoodsSpecVo!=null ){
|
||||
// sku.setErpGoodsId(erpGoodsSpecVo.getGoodsId());
|
||||
// sku.setErpGoodsSkuId(erpGoodsSpecVo.getId());
|
||||
//// sku.setErpSupplierId(erpGoodsSpecVo.getSupplierId());
|
||||
// }
|
||||
// }
|
||||
skuMapper.insert(sku);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.common.common.PageQuery;
|
||||
import com.qihang.common.common.PageResult;
|
||||
import com.qihang.dou.domain.OmsDouGoodsSku;
|
||||
import com.qihang.dou.service.OmsDouGoodsSkuService;
|
||||
import com.qihang.dou.mapper.OmsDouGoodsSkuMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【oms_dou_goods_sku(抖店商品Sku表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:49:40
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class OmsDouGoodsSkuServiceImpl extends ServiceImpl<OmsDouGoodsSkuMapper, OmsDouGoodsSku>
|
||||
implements OmsDouGoodsSkuService{
|
||||
private final OmsDouGoodsSkuMapper mapper;
|
||||
@Override
|
||||
public PageResult<OmsDouGoodsSku> queryPageList(OmsDouGoodsSku bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OmsDouGoodsSku> queryWrapper = new LambdaQueryWrapper<OmsDouGoodsSku>()
|
||||
.eq(bo.getShopId()!=null,OmsDouGoodsSku::getShopId,bo.getShopId());
|
||||
|
||||
Page<OmsDouGoodsSku> goodsSkuPage = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
return PageResult.build(goodsSkuPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.dou.domain.SShopPlatform;
|
||||
import com.qihang.dou.service.SShopPlatformService;
|
||||
import com.qihang.dou.mapper.SShopPlatformMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
@Service
|
||||
public class SShopPlatformServiceImpl extends ServiceImpl<SShopPlatformMapper, SShopPlatform>
|
||||
implements SShopPlatformService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.dou.domain.SShopPullLasttime;
|
||||
import com.qihang.dou.service.SShopPullLasttimeService;
|
||||
import com.qihang.dou.mapper.SShopPullLasttimeMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_lasttime(店铺更新最后时间记录)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
@Service
|
||||
public class SShopPullLasttimeServiceImpl extends ServiceImpl<SShopPullLasttimeMapper, SShopPullLasttime>
|
||||
implements SShopPullLasttimeService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.dou.domain.SShopPullLogs;
|
||||
import com.qihang.dou.service.SShopPullLogsService;
|
||||
import com.qihang.dou.mapper.SShopPullLogsMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop_pull_logs(店铺更新日志表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
@Service
|
||||
public class SShopPullLogsServiceImpl extends ServiceImpl<SShopPullLogsMapper, SShopPullLogs>
|
||||
implements SShopPullLogsService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.qihang.dou.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.qihang.dou.domain.SShop;
|
||||
import com.qihang.dou.service.SShopService;
|
||||
import com.qihang.dou.mapper.SShopMapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author TW
|
||||
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Service实现
|
||||
* @createDate 2024-06-11 14:40:36
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Service
|
||||
public class SShopServiceImpl extends ServiceImpl<SShopMapper, SShop>
|
||||
implements SShopService{
|
||||
private SShopMapper mapper;
|
||||
@Override
|
||||
public SShop selectShopById(Long shopId) {
|
||||
return mapper.selectById(shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSessionKey(Integer shopId, String ownerId, String sessionKey, String refreshToken, Long expiresIn) {
|
||||
SShop shop = new SShop();
|
||||
shop.setId(shopId);
|
||||
shop.setAccessToken(sessionKey);
|
||||
shop.setRefreshToken(refreshToken);
|
||||
shop.setAccessExpiresIn(expiresIn);
|
||||
shop.setAccessTokenBegin(System.currentTimeMillis() / 1000);
|
||||
mapper.updateById(shop);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.qihang.dou.mapper.OmsDouGoodsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.OmsDouGoods">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="BIGINT"/>
|
||||
<result property="productId" column="product_id" jdbcType="BIGINT"/>
|
||||
<result property="productType" column="product_type" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="img" column="img" jdbcType="VARCHAR"/>
|
||||
<result property="checkStatus" column="check_status" jdbcType="INTEGER"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
<result property="specId" column="spec_id" jdbcType="BIGINT"/>
|
||||
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="INTEGER"/>
|
||||
<result property="description" column="description" jdbcType="VARCHAR"/>
|
||||
<result property="categoryDetail" column="category_detail" jdbcType="VARCHAR"/>
|
||||
<result property="outerProductId" column="outer_product_id" jdbcType="VARCHAR"/>
|
||||
<result property="isPackageProduct" column="is_package_product" jdbcType="VARCHAR"/>
|
||||
<result property="erpGoodsId" column="erp_goods_id" jdbcType="BIGINT"/>
|
||||
<result property="pullTime" column="pull_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modifyTime" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,product_id,
|
||||
product_type,name,img,
|
||||
check_status,status,spec_id,
|
||||
create_time,update_time,description,
|
||||
category_detail,outer_product_id,is_package_product,
|
||||
erp_goods_id,pull_time,modify_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<?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.dou.mapper.OmsDouGoodsSkuMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.OmsDouGoodsSku">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="productId" column="product_id" jdbcType="BIGINT"/>
|
||||
<result property="specId" column="spec_id" jdbcType="BIGINT"/>
|
||||
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||
<result property="skuType" column="sku_type" jdbcType="INTEGER"/>
|
||||
<result property="skuStatus" column="sku_status" jdbcType="VARCHAR"/>
|
||||
<result property="outSkuId" column="out_sku_id" jdbcType="BIGINT"/>
|
||||
<result property="specDetailId1" column="spec_detail_id1" jdbcType="BIGINT"/>
|
||||
<result property="specDetailId2" column="spec_detail_id2" jdbcType="BIGINT"/>
|
||||
<result property="specDetailId3" column="spec_detail_id3" jdbcType="BIGINT"/>
|
||||
<result property="specDetailName1" column="spec_detail_name1" jdbcType="VARCHAR"/>
|
||||
<result property="specDetailName2" column="spec_detail_name2" jdbcType="VARCHAR"/>
|
||||
<result property="specDetailName3" column="spec_detail_name3" jdbcType="VARCHAR"/>
|
||||
<result property="price" column="price" jdbcType="INTEGER"/>
|
||||
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
|
||||
<result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
|
||||
<result property="preholdStockNum" column="prehold_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="promStockNum" column="prom_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="stepStockNum" column="step_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="preholdStepStockNum" column="prehold_step_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="promStepStockNum" column="prom_step_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="normalStockNum" column="normal_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="channelStockNum" column="channel_stock_num" jdbcType="INTEGER"/>
|
||||
<result property="sellProperties" column="sell_properties" jdbcType="VARCHAR"/>
|
||||
<result property="erpGoodsId" column="erp_goods_id" jdbcType="BIGINT"/>
|
||||
<result property="erpGoodsSkuId" column="erp_goods_sku_id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="img" column="img" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,product_id,spec_id,
|
||||
code,sku_type,sku_status,
|
||||
out_sku_id,spec_detail_id1,spec_detail_id2,
|
||||
spec_detail_id3,spec_detail_name1,spec_detail_name2,
|
||||
spec_detail_name3,price,create_time,
|
||||
stock_num,prehold_stock_num,prom_stock_num,
|
||||
step_stock_num,prehold_step_stock_num,prom_step_stock_num,
|
||||
normal_stock_num,channel_stock_num,sell_properties,
|
||||
erp_goods_id,erp_goods_sku_id,shop_id,
|
||||
name,img
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?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.dou.mapper.SShopMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.SShop">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
|
||||
<result property="ename" column="ename" jdbcType="VARCHAR"/>
|
||||
<result property="company" column="company" jdbcType="VARCHAR"/>
|
||||
<result property="platform" column="platform" jdbcType="INTEGER"/>
|
||||
<result property="shopUrl" column="shop_url" jdbcType="VARCHAR"/>
|
||||
<result property="orderNum" column="order_num" jdbcType="INTEGER"/>
|
||||
<result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="sellerShopId" column="seller_shop_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="accessExpiresIn" column="access_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="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,nick_name,
|
||||
ename,company,platform,
|
||||
shop_url,order_num,is_delete,
|
||||
remark,seller_shop_id,app_key,
|
||||
app_sercet,access_token,access_expires_in,
|
||||
access_token_begin,refresh_token,refresh_token_timeout,
|
||||
create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?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.dou.mapper.SShopPlatformMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.SShopPlatform">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="serverUrl" column="server_url" jdbcType="VARCHAR"/>
|
||||
<result property="redirectUrl" column="redirect_url" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,name,app_key,
|
||||
app_secret,remark,server_url,
|
||||
redirect_url,create_time,update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -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.dou.mapper.SShopPullLasttimeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.SShopPullLasttime">
|
||||
<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>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?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.dou.mapper.SShopPullLogsMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qihang.dou.domain.SShopPullLogs">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="shopType" column="shop_type" 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,shop_type,
|
||||
pull_type,pull_way,pull_params,
|
||||
pull_result,pull_time,duration
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
@ -86,12 +86,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpGoodsSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="skuStatus" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.skuStatus === false">已下架</el-tag>
|
||||
<el-tag size="small" v-if="scope.row.skuStatus === true">销售中</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="状态" align="center" prop="skuStatus" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-tag size="small" v-if="scope.row.skuStatus === false">已下架</el-tag>-->
|
||||
<!-- <el-tag size="small" v-if="scope.row.skuStatus === true">销售中</el-tag>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -117,8 +117,8 @@
|
|||
<!-- 添加或修改商品管理对话框 -->
|
||||
<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 label="ERP商品SkuId" prop="erpGoodsSkuId">
|
||||
<el-input v-model.number="form.erpGoodsSkuId" placeholder="请输入ERP商品SkuId" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
|
@ -134,7 +134,7 @@
|
|||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
import {listShop} from "@/api/shop/shop";
|
||||
import {pullGoodsList,listGoodsSku} from "@/api/dou/goods";
|
||||
import {pullGoodsList, listGoodsSku, getGoodsSku, linkErpGoodsSkuId} from "@/api/dou/goods";
|
||||
import {MessageBox} from "element-ui";
|
||||
import {isRelogin} from "@/utils/request";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue