添加视频号商铺拉取、关联
This commit is contained in:
parent
b145e7e082
commit
bcd29a614e
|
|
@ -32,7 +32,7 @@ public class GoodsApiController {
|
||||||
private final WeiApiCommon apiCommon;
|
private final WeiApiCommon apiCommon;
|
||||||
private final WeiGoodsService weiGoodsService;
|
private final WeiGoodsService weiGoodsService;
|
||||||
|
|
||||||
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
|
@RequestMapping(value = "/pull_goods_list", method = RequestMethod.POST)
|
||||||
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
|
||||||
if (params.getShopId() == null || params.getShopId() <= 0) {
|
if (params.getShopId() == null || params.getShopId() <= 0) {
|
||||||
// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
// return ApiResul new ApiResult(HttpStatus.PARAMS_ERROR, "参数错误,没有店铺Id");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.qihang.wei.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.security.common.BaseController;
|
||||||
|
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||||
|
import com.qihang.wei.service.OmsWeiGoodsSkuService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RequestMapping("/goods")
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class GoodsController extends BaseController {
|
||||||
|
private final OmsWeiGoodsSkuService skuService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/skuList", method = RequestMethod.GET)
|
||||||
|
public TableDataInfo skuList(OmsWeiGoodsSku bo, PageQuery pageQuery) {
|
||||||
|
PageResult<OmsWeiGoodsSku> 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)
|
||||||
|
{
|
||||||
|
OmsWeiGoodsSku sku = new OmsWeiGoodsSku();
|
||||||
|
sku.setId(bo.getId());
|
||||||
|
sku.setErpGoodsSkuId(Long.parseLong(bo.getErpGoodsSkuId()));
|
||||||
|
skuService.updateById(sku);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import cn.qihangerp.open.wei.vo.Token;
|
||||||
import com.qihang.common.common.ResultVo;
|
import com.qihang.common.common.ResultVo;
|
||||||
import com.qihang.common.enums.EnumShopType;
|
import com.qihang.common.enums.EnumShopType;
|
||||||
import com.qihang.common.enums.HttpStatus;
|
import com.qihang.common.enums.HttpStatus;
|
||||||
|
import com.qihang.wei.service.SShopPlatformService;
|
||||||
import com.qihang.wei.service.SShopService;
|
import com.qihang.wei.service.SShopService;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
@ -17,6 +18,7 @@ import org.springframework.util.StringUtils;
|
||||||
@Component
|
@Component
|
||||||
public class WeiApiCommon {
|
public class WeiApiCommon {
|
||||||
private final SShopService shopService;
|
private final SShopService shopService;
|
||||||
|
private final SShopPlatformService platformService;
|
||||||
/**
|
/**
|
||||||
* 更新前的检查
|
* 更新前的检查
|
||||||
*
|
*
|
||||||
|
|
@ -29,27 +31,26 @@ public class WeiApiCommon {
|
||||||
if (shop == null) {
|
if (shop == null) {
|
||||||
return ResultVo.error(HttpStatus.PARAMS_ERROR,"参数错误,没有找到店铺");
|
return ResultVo.error(HttpStatus.PARAMS_ERROR,"参数错误,没有找到店铺");
|
||||||
}
|
}
|
||||||
if (shop.getType() != EnumShopType.WEI.getIndex()) {
|
if (shop.getPlatform() != EnumShopType.WEI.getIndex()) {
|
||||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是JD店铺");
|
return ResultVo.error(HttpStatus.PARAMS_ERROR, "参数错误,店铺不是JD店铺");
|
||||||
}
|
}
|
||||||
if(!StringUtils.hasText(shop.getAppkey())) {
|
if(!StringUtils.hasText(shop.getAppKey())) {
|
||||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
return ResultVo.error(HttpStatus.PARAMS_ERROR, "平台配置错误,没有找到AppKey");
|
||||||
}
|
}
|
||||||
if(!StringUtils.hasText(shop.getAppsercet())) {
|
if(!StringUtils.hasText(shop.getAppSercet())) {
|
||||||
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到AppSercet");
|
||||||
}
|
}
|
||||||
// var platform =skuService.selectShopSettingById(EnumShopType.WEI.getIndex());
|
var platform =platformService.getById(EnumShopType.WEI.getIndex());
|
||||||
// if(!StringUtils.hasText(platform.getse())) {
|
if(!StringUtils.hasText(platform.getServerUrl())) {
|
||||||
// return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
return ResultVo.error(HttpStatus.PARAMS_ERROR, "第三方平台配置错误,没有找到ServerUrl");
|
||||||
// }
|
}
|
||||||
|
|
||||||
ShopApiParams params = new ShopApiParams();
|
ShopApiParams params = new ShopApiParams();
|
||||||
params.setAppKey(shop.getAppkey());
|
params.setAppKey(shop.getAppKey());
|
||||||
params.setAppSecret(shop.getAppsercet());
|
params.setAppSecret(shop.getAppSercet());
|
||||||
params.setAccessToken(shop.getSessionkey());
|
params.setAccessToken(shop.getAccessToken());
|
||||||
params.setApiRequestUrl(shop.getApiRequestUrl());
|
params.setServerUrl(platform.getServerUrl());
|
||||||
// params.setServerUrl(platform.getServerUrl());
|
params.setSellerId(shop.getSellerShopId().toString());
|
||||||
params.setSellerId(shop.getSelleruserid().toString());
|
|
||||||
|
|
||||||
|
|
||||||
if (!StringUtils.hasText(params.getAccessToken())) {
|
if (!StringUtils.hasText(params.getAccessToken())) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ public class OmsWeiGoodsSku implements Serializable {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺id
|
* 店铺id
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
package com.qihang.wei.domain;
|
package com.qihang.wei.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据中心-店铺
|
* 电商平台店铺表
|
||||||
* @TableName s_shop
|
* @TableName s_shop
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
|
@ -22,7 +23,7 @@ public class SShop implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 店铺别名
|
* 店铺别名
|
||||||
*/
|
*/
|
||||||
private String nickname;
|
private String nickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标识
|
* 标识
|
||||||
|
|
@ -37,32 +38,22 @@ public class SShop implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 对应第三方平台Id
|
* 对应第三方平台Id
|
||||||
*/
|
*/
|
||||||
private Integer type;
|
private Integer platform;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺url
|
* 店铺url
|
||||||
*/
|
*/
|
||||||
private String url;
|
private String shopUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序
|
* 排序
|
||||||
*/
|
*/
|
||||||
private Integer ordernum;
|
private Integer orderNum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除0否1是
|
* 是否删除0否1是
|
||||||
*/
|
*/
|
||||||
private Integer isdelete;
|
private Integer isDelete;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否显示(0:是1否)
|
|
||||||
*/
|
|
||||||
private Integer isshow;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Long modifyOn;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述
|
* 描述
|
||||||
|
|
@ -70,34 +61,29 @@ public class SShop implements Serializable {
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 第三方平台店铺id,淘宝天猫开放平台使用
|
* 第三方平台店铺id
|
||||||
*/
|
*/
|
||||||
private Long selleruserid;
|
private Long sellerShopId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 卖家userId
|
* Appkey(微信视频号小店专用)
|
||||||
*/
|
*/
|
||||||
private String selleruseridstr;
|
private String appKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appsercet(微信视频号小店专用)
|
||||||
|
*/
|
||||||
|
private String appSercet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 第三方平台sessionKey(access_token)
|
* 第三方平台sessionKey(access_token)
|
||||||
*/
|
*/
|
||||||
private String sessionkey;
|
private String accessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appkey
|
* accessToken到期(秒)
|
||||||
*/
|
*/
|
||||||
private String appkey;
|
private Long accessExpiresIn;
|
||||||
|
|
||||||
/**
|
|
||||||
* Appsercet
|
|
||||||
*/
|
|
||||||
private String appsercet;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 到期
|
|
||||||
*/
|
|
||||||
private Long expiresIn;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* access_token开始时间
|
* access_token开始时间
|
||||||
|
|
@ -115,9 +101,14 @@ public class SShop implements Serializable {
|
||||||
private Long refreshTokenTimeout;
|
private Long refreshTokenTimeout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求url
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
private String apiRequestUrl;
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.qihang.wei.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;
|
||||||
|
}
|
||||||
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TW
|
* @author TW
|
||||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Mapper
|
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Mapper
|
||||||
* @createDate 2024-06-03 14:14:56
|
* @createDate 2024-06-11 15:13:13
|
||||||
* @Entity com.qihang.wei.domain.SShop
|
* @Entity com.qihang.wei.domain.SShop
|
||||||
*/
|
*/
|
||||||
public interface SShopMapper extends BaseMapper<SShop> {
|
public interface SShopMapper extends BaseMapper<SShop> {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.qihang.wei.mapper;
|
||||||
|
|
||||||
|
import com.qihang.wei.domain.SShopPlatform;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Mapper
|
||||||
|
* @createDate 2024-06-11 15:13:13
|
||||||
|
* @Entity com.qihang.wei.domain.SShopPlatform
|
||||||
|
*/
|
||||||
|
public interface SShopPlatformMapper extends BaseMapper<SShopPlatform> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.qihang.wei.service;
|
package com.qihang.wei.service;
|
||||||
|
|
||||||
|
import com.qihang.common.common.PageQuery;
|
||||||
|
import com.qihang.common.common.PageResult;
|
||||||
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
|
@ -9,5 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
* @createDate 2024-06-03 16:51:29
|
* @createDate 2024-06-03 16:51:29
|
||||||
*/
|
*/
|
||||||
public interface OmsWeiGoodsSkuService extends IService<OmsWeiGoodsSku> {
|
public interface OmsWeiGoodsSkuService extends IService<OmsWeiGoodsSku> {
|
||||||
|
PageResult<OmsWeiGoodsSku> queryPageList(OmsWeiGoodsSku bo, PageQuery pageQuery);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.qihang.wei.service;
|
||||||
|
|
||||||
|
import com.qihang.wei.domain.SShopPlatform;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Service
|
||||||
|
* @createDate 2024-06-11 15:13:13
|
||||||
|
*/
|
||||||
|
public interface SShopPlatformService extends IService<SShopPlatform> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -5,11 +5,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TW
|
* @author TW
|
||||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service
|
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Service
|
||||||
* @createDate 2024-06-03 14:14:56
|
* @createDate 2024-06-11 15:13:13
|
||||||
*/
|
*/
|
||||||
public interface SShopService extends IService<SShop> {
|
public interface SShopService extends IService<SShop> {
|
||||||
SShop selectShopById(Long shopId);
|
SShop selectShopById(Long shopId);
|
||||||
|
void updateSessionKey(Long shopId, String sessionKey);
|
||||||
void updateSessionKey(Long shopId,String sessionKey);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
package com.qihang.wei.service.impl;
|
package com.qihang.wei.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.qihang.common.common.PageQuery;
|
||||||
|
import com.qihang.common.common.PageResult;
|
||||||
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
import com.qihang.wei.domain.OmsWeiGoodsSku;
|
||||||
import com.qihang.wei.service.OmsWeiGoodsSkuService;
|
import com.qihang.wei.service.OmsWeiGoodsSkuService;
|
||||||
import com.qihang.wei.mapper.OmsWeiGoodsSkuMapper;
|
import com.qihang.wei.mapper.OmsWeiGoodsSkuMapper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -11,10 +16,22 @@ import org.springframework.stereotype.Service;
|
||||||
* @description 针对表【oms_wei_goods_sku】的数据库操作Service实现
|
* @description 针对表【oms_wei_goods_sku】的数据库操作Service实现
|
||||||
* @createDate 2024-06-03 16:51:29
|
* @createDate 2024-06-03 16:51:29
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class OmsWeiGoodsSkuServiceImpl extends ServiceImpl<OmsWeiGoodsSkuMapper, OmsWeiGoodsSku>
|
public class OmsWeiGoodsSkuServiceImpl extends ServiceImpl<OmsWeiGoodsSkuMapper, OmsWeiGoodsSku>
|
||||||
implements OmsWeiGoodsSkuService{
|
implements OmsWeiGoodsSkuService{
|
||||||
|
private final OmsWeiGoodsSkuMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OmsWeiGoodsSku> queryPageList(OmsWeiGoodsSku bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<OmsWeiGoodsSku> queryWrapper = new LambdaQueryWrapper<OmsWeiGoodsSku>()
|
||||||
|
.eq(bo.getShopId()!=null,OmsWeiGoodsSku::getShopId,bo.getShopId())
|
||||||
|
;
|
||||||
|
|
||||||
|
Page<OmsWeiGoodsSku> page = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||||
|
|
||||||
|
return PageResult.build(page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.qihang.wei.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.qihang.wei.domain.SShopPlatform;
|
||||||
|
import com.qihang.wei.service.SShopPlatformService;
|
||||||
|
import com.qihang.wei.mapper.SShopPlatformMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TW
|
||||||
|
* @description 针对表【s_shop_platform(电商平台配置表)】的数据库操作Service实现
|
||||||
|
* @createDate 2024-06-11 15:13:13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SShopPlatformServiceImpl extends ServiceImpl<SShopPlatformMapper, SShopPlatform>
|
||||||
|
implements SShopPlatformService{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -9,8 +9,8 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author TW
|
* @author TW
|
||||||
* @description 针对表【s_shop(数据中心-店铺)】的数据库操作Service实现
|
* @description 针对表【s_shop(电商平台店铺表)】的数据库操作Service实现
|
||||||
* @createDate 2024-06-03 14:14:56
|
* @createDate 2024-06-11 15:13:13
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -26,7 +26,7 @@ public class SShopServiceImpl extends ServiceImpl<SShopMapper, SShop>
|
||||||
public void updateSessionKey(Long shopId, String sessionKey) {
|
public void updateSessionKey(Long shopId, String sessionKey) {
|
||||||
SShop shop = new SShop();
|
SShop shop = new SShop();
|
||||||
shop.setId(shopId);
|
shop.setId(shopId);
|
||||||
shop.setSessionkey(sessionKey);
|
shop.setAccessToken(sessionKey);
|
||||||
mapper.updateById(shop);
|
mapper.updateById(shop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,36 +7,33 @@
|
||||||
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.SShop">
|
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.SShop">
|
||||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
<result property="nickname" column="nickName" jdbcType="VARCHAR"/>
|
<result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
|
||||||
<result property="ename" column="ename" jdbcType="VARCHAR"/>
|
<result property="ename" column="ename" jdbcType="VARCHAR"/>
|
||||||
<result property="company" column="company" jdbcType="VARCHAR"/>
|
<result property="company" column="company" jdbcType="VARCHAR"/>
|
||||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
<result property="platform" column="platform" jdbcType="INTEGER"/>
|
||||||
<result property="url" column="url" jdbcType="VARCHAR"/>
|
<result property="shopUrl" column="shop_url" jdbcType="VARCHAR"/>
|
||||||
<result property="ordernum" column="orderNum" jdbcType="INTEGER"/>
|
<result property="orderNum" column="order_num" jdbcType="INTEGER"/>
|
||||||
<result property="isdelete" column="isDelete" jdbcType="INTEGER"/>
|
<result property="isDelete" column="is_delete" 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="remark" column="remark" jdbcType="VARCHAR"/>
|
||||||
<result property="selleruserid" column="sellerUserId" jdbcType="BIGINT"/>
|
<result property="sellerShopId" column="seller_shop_id" jdbcType="BIGINT"/>
|
||||||
<result property="selleruseridstr" column="sellerUserIdStr" jdbcType="VARCHAR"/>
|
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||||
<result property="sessionkey" column="sessionKey" jdbcType="VARCHAR"/>
|
<result property="appSercet" column="app_sercet" jdbcType="VARCHAR"/>
|
||||||
<result property="appkey" column="appkey" jdbcType="VARCHAR"/>
|
<result property="accessToken" column="access_token" jdbcType="VARCHAR"/>
|
||||||
<result property="appsercet" column="appSercet" jdbcType="VARCHAR"/>
|
<result property="accessExpiresIn" column="access_expires_in" jdbcType="BIGINT"/>
|
||||||
<result property="expiresIn" column="expires_in" jdbcType="BIGINT"/>
|
|
||||||
<result property="accessTokenBegin" column="access_token_begin" jdbcType="BIGINT"/>
|
<result property="accessTokenBegin" column="access_token_begin" jdbcType="BIGINT"/>
|
||||||
<result property="refreshToken" column="refresh_token" jdbcType="VARCHAR"/>
|
<result property="refreshToken" column="refresh_token" jdbcType="VARCHAR"/>
|
||||||
<result property="refreshTokenTimeout" column="refresh_token_timeout" jdbcType="BIGINT"/>
|
<result property="refreshTokenTimeout" column="refresh_token_timeout" jdbcType="BIGINT"/>
|
||||||
<result property="apiRequestUrl" column="api_request_url" jdbcType="VARCHAR"/>
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,name,nickName,
|
id,name,nick_name,
|
||||||
ename,company,type,
|
ename,company,platform,
|
||||||
url,orderNum,isDelete,
|
shop_url,order_num,is_delete,
|
||||||
isShow,modify_on,remark,
|
remark,seller_shop_id,app_key,
|
||||||
sellerUserId,sellerUserIdStr,sessionKey,
|
app_sercet,access_token,access_expires_in,
|
||||||
appkey,appSercet,expires_in,
|
|
||||||
access_token_begin,refresh_token,refresh_token_timeout,
|
access_token_begin,refresh_token,refresh_token_timeout,
|
||||||
api_request_url
|
create_time,update_time
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</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.wei.mapper.SShopPlatformMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.qihang.wei.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>
|
||||||
|
|
@ -43,3 +43,11 @@ export function pullGoodsList(data) {
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function linkErpGoodsSkuId(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wei-api/goods/sku/linkErp',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
<el-table-column label="销售价" align="center" prop="salePrice" >
|
<el-table-column label="销售价" align="center" prop="salePrice" >
|
||||||
<template slot-scope="scope">{{scope.row.salePrice / 100}}</template>
|
<template slot-scope="scope">{{scope.row.salePrice / 100}}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
|
<el-table-column label="ERP SKU ID" align="center" prop="erpGoodsSkuId" />
|
||||||
<el-table-column label="状态" align="center" prop="status" >
|
<el-table-column label="状态" align="center" prop="status" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag size="small" v-if="scope.row.status === 5">销售中</el-tag>
|
<el-tag size="small" v-if="scope.row.status === 5">销售中</el-tag>
|
||||||
|
|
@ -108,8 +108,8 @@
|
||||||
<!-- 添加或修改商品管理对话框 -->
|
<!-- 添加或修改商品管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<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 ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
|
<el-form-item label="ERP商品SkuId" prop="erpGoodsSkuId">
|
||||||
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
|
<el-input v-model.number="form.erpGoodsSkuId" placeholder="请输入ERP商品SkuId" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
|
|
||||||
import {listShop} from "@/api/shop/shop";
|
import {listShop} from "@/api/shop/shop";
|
||||||
import {pullGoodsList,listGoodsSku} from "@/api/wei/goods";
|
import {pullGoodsList,listGoodsSku,getGoodsSku,linkErpGoodsSkuId} from "@/api/wei/goods";
|
||||||
import {MessageBox} from "element-ui";
|
import {MessageBox} from "element-ui";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -167,7 +167,7 @@ export default {
|
||||||
id: [
|
id: [
|
||||||
{ required: true, message: "不能为空", trigger: "change" }
|
{ required: true, message: "不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
erpSkuId: [
|
erpGoodsSkuId: [
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
{ required: true, message: "不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue