新增视频号小店接口

This commit is contained in:
启航 2024-03-29 18:10:00 +08:00
parent adb9c65cf6
commit 555a7e1ee0
43 changed files with 3865 additions and 2991 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,27 +1,38 @@
package com.qihang.wei.controller;
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.GoodsApiBo;
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.service.WeiGoodsService;
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("/goods")
@RestController
@AllArgsConstructor
public class GoodsApiController {
private final ApiCommon apiCommon;
private final WeiGoodsService weiGoodsService;
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
if (params.getShopId() == null || params.getShopId() <= 0) {
@ -39,9 +50,40 @@ public class GoodsApiController {
String appKey = checkResult.getData().getAppKey();
String appSecret = checkResult.getData().getAppSecret();
GoodsApiService remoting = RemoteUtil.Remoting(serverUrl, GoodsApiService.class);
GoodsApiBo apiBo = new GoodsApiBo();
apiBo.setPage_size(10);
GoodsListApiBo apiBo = new GoodsListApiBo();
apiBo.setPage_size(30);
apiBo.setStatus(5);
GoodsListVo res = remoting.getGoodsList(accessToken, apiBo);
if(res.getErrcode() == 0){
// 拉取到了数据 拉取详情
if(res.getProduct_ids()!=null&&res.getProduct_ids().length>0){
for (var productId:res.getProduct_ids()) {
GoodsDetailApiBo apiBo1 = new GoodsDetailApiBo();
apiBo1.setProduct_id(productId.toString());
GoodsDetailVo goodsDetail = remoting.getGoodsDetail(accessToken, apiBo1);
if(goodsDetail.getErrcode()==0){
// 保存到数据库
WeiGoods goods = new WeiGoods();
BeanUtils.copyProperties(goodsDetail.getProduct(),goods);
goods.setHeadImg(goodsDetail.getProduct().getHead_imgs().getString(0));
goods.setHeadImgs(JSONObject.toJSONString(goodsDetail.getProduct().getHead_imgs()));
goods.setDescInfo(JSONObject.toJSONString(goodsDetail.getProduct().getDesc_info()));
goods.setAttrs(JSONObject.toJSONString(goodsDetail.getProduct().getAttrs()));
List<WeiGoodsSku> skuList = new ArrayList<>();
for (var sku:goodsDetail.getProduct().getSkus()) {
WeiGoodsSku goodsSku = new WeiGoodsSku();
BeanUtils.copyProperties(sku,goodsSku);
goodsSku.setSkuAttrs(JSONObject.toJSONString(sku.getSku_attrs()));
goodsSku.setSkuDeliverInfo(JSONObject.toJSONString(sku.getSku_deliver_info()));
skuList.add(goodsSku);
}
goods.setSkus(skuList);
weiGoodsService.saveAndUpdateGoods(params.getShopId(),goods);
}
}
}
}
return AjaxResult.success();

View File

@ -1,30 +1,35 @@
package com.qihang.wei.controller;
import com.alibaba.fastjson2.JSONObject;
import com.qihang.common.common.AjaxResult;
import com.qihang.common.common.ResultVoEnum;
import com.qihang.common.enums.EnumShopType;
import com.qihang.common.enums.HttpStatus;
import com.qihang.common.mq.MqMessage;
import com.qihang.common.mq.MqType;
import com.qihang.common.mq.MqUtils;
import com.qihang.wei.domain.WeiOrder;
import com.qihang.wei.domain.WeiOrderItem;
import com.qihang.wei.mapper.WeiOrderItemMapper;
import com.qihang.wei.openApi.ApiCommon;
import com.qihang.wei.openApi.PullRequest;
import com.qihang.wei.openApi.bo.CreateTimeRangeBo;
import com.qihang.wei.openApi.bo.GoodsApiBo;
import com.qihang.wei.openApi.bo.OrderDetailBo;
import com.qihang.wei.openApi.bo.OrderListBo;
import com.qihang.wei.openApi.service.GoodsApiService;
import com.qihang.wei.openApi.service.OrderApiService;
import com.qihang.wei.openApi.vo.GoodsListVo;
import com.qihang.wei.openApi.vo.OrderDetailVo;
import com.qihang.wei.openApi.vo.OrderListVo;
import com.qihang.wei.openApi.vo.OrderVoDeliverInfoAddress;
import com.qihang.wei.service.WeiOrderService;
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.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@RequestMapping("/order")
@RestController
@ -32,7 +37,7 @@ import java.util.Date;
public class OrderApiController {
private final ApiCommon apiCommon;
private final MqUtils mqUtils;
private final WeiOrderService weiOrderService;
@RequestMapping(value = "/pull_list", method = RequestMethod.POST)
public AjaxResult pullList(@RequestBody PullRequest params) throws Exception {
@ -44,14 +49,14 @@ public class OrderApiController {
long beginTime = System.currentTimeMillis();
var checkResult = apiCommon.checkBefore(params.getShopId());
if (checkResult.getCode() != HttpStatus.SUCCESS) {
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();
OrderApiService remoting = RemoteUtil.Remoting("https://api.weixin.qq.com", OrderApiService.class);
OrderApiService remoting = RemoteUtil.Remoting(serverUrl, OrderApiService.class);
OrderListBo apiBo = new OrderListBo();
apiBo.setPage_size(100);
CreateTimeRangeBo tbo= new CreateTimeRangeBo();
@ -60,69 +65,90 @@ public class OrderApiController {
apiBo.setCreate_time_range(tbo);
OrderListVo orderList = remoting.getOrderList(accessToken, apiBo);
if(orderList.getErrcode() == 0) {
// 拉取到了数据 拉取详情
if(orderList.getOrder_id_list()!=null&&orderList.getOrder_id_list().length>0) {
for (var orderId : orderList.getOrder_id_list()) {
OrderDetailBo bo = new OrderDetailBo();
bo.setOrder_id(orderId.toString());
OrderDetailVo orderDetail = remoting.getOrderDetail(accessToken, bo);
if(orderDetail.getErrcode() == 0){
WeiOrder order = new WeiOrder();
order.setOrderId(orderDetail.getOrder().getOrder_id());
order.setShopId(params.getShopId());
order.setOpenid(orderDetail.getOrder().getOpenid());
order.setCreateTime(orderDetail.getOrder().getCreate_time());
order.setUpdateTime(orderDetail.getOrder().getUpdate_time());
order.setUnionid(orderDetail.getOrder().getUnionid());
order.setStatus(orderDetail.getOrder().getStatus());
order.setAftersaleDetail(JSONObject.toJSONString(orderDetail.getOrder().getAftersale_detail()));
order.setPayInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getPay_info()));
order.setProductPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("product_price"));
order.setOrderPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("order_price"));
order.setFreight(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("freight"));
order.setDiscountedPrice(orderDetail.getOrder().getOrder_detail().getPrice_info().getInteger("discounted_price"));
OrderVoDeliverInfoAddress addressInfo = orderDetail.getOrder().getOrder_detail().getDelivery_info().getAddress_info();
order.setUserName(addressInfo.getUser_name());
order.setPostalCode(addressInfo.getPostal_code());
order.setProvinceName(addressInfo.getProvince_name());
order.setCityName(addressInfo.getCity_name());
order.setCountyName(addressInfo.getCounty_name());
order.setDetailInfo(addressInfo.getDetail_info());
order.setTelNumber(addressInfo.getTel_number());
order.setHouseNumber(addressInfo.getHouse_number());
order.setVirtualOrderTelNumber(addressInfo.getVirtual_order_tel_number());
order.setTelNumberExtInfo(JSONObject.toJSONString(addressInfo.getTel_number_ext_info()));
order.setUseTelNumber(addressInfo.getUse_tel_number());
order.setHashCode(addressInfo.getHash_code());
order.setDeliveryProductInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getDelivery_info().getDelivery_product_info()));
order.setShipDoneTime(orderDetail.getOrder().getOrder_detail().getDelivery_info().getShip_done_time());
order.setEwaybillOrderCode(orderDetail.getOrder().getOrder_detail().getDelivery_info().getEwaybill_order_code());
order.setSettleInfo(JSONObject.toJSONString(orderDetail.getOrder().getOrder_detail().getSettle_info()));
List<WeiOrderItem> itemList = new ArrayList<>();
for (var item:orderDetail.getOrder().getOrder_detail().getProduct_infos()) {
WeiOrderItem oi = new WeiOrderItem();
oi.setProductId(item.getProduct_id());
oi.setSkuId(item.getSku_id());
oi.setThumbImg(item.getThumb_img());
oi.setSkuCnt(item.getSku_cnt());
oi.setSalePrice(item.getSale_price());
oi.setTitle(item.getTitle());
oi.setOnAftersaleSkuCnt(item.getOn_aftersale_sku_cnt());
oi.setFinishAftersaleSkuCnt(item.getFinish_aftersale_sku_cnt());
oi.setSkuCode(item.getSku_code());
oi.setMarketPrice(item.getMarket_price());
oi.setRealPrice(item.getReal_price());
oi.setOutProductId(item.getOut_product_id());
oi.setOutSkuId(item.getOut_sku_id());
oi.setIsDiscounted(item.getIs_discounted() + "");
oi.setEstimatePrice(item.getEstimate_price());
oi.setIsChangePrice(item.getIs_change_price() + "");
oi.setChangePrice(item.getChange_price());
oi.setOutWarehouseId(item.getOut_warehouse_id());
oi.setUseDeduction(item.getUse_deduction() + "");
oi.setSkuAttrs(JSONObject.toJSONString(item.getSku_attrs()));
oi.setSkuDeliverInfo(JSONObject.toJSONString(item.getSku_deliver_info()));
oi.setExtraService(JSONObject.toJSONString(item.getExtra_service()));
oi.setOrderProductCouponInfoList(JSONObject.toJSONString(item.getOrder_product_coupon_info_list()));
itemList.add(oi);
}
order.setItems(itemList);
weiOrderService.saveOrder(params.getShopId(),order);
}
}
}
}
// 获取最后更新时间
LocalDateTime startTime = null;
LocalDateTime endTime = null;
// SysShopPullLasttime lasttime = pullLasttimeService.getLasttimeByShop(params.getShopId(), "ORDER");
// if(lasttime == null){
// endTime = LocalDateTime.now();
// startTime = endTime.minusDays(1);
// }else{
// startTime = lasttime.getLasttime().minusHours(1);//取上次结束一个小时前
// endTime = startTime.plusDays(1);//取24小时
// if(endTime.isAfter(LocalDateTime.now())){
// endTime = LocalDateTime.now();
// }
// }
//
// //第一次获取
// ApiResult<JdOrder> upResult = OrderApiHelper.pullOrder(startTime,endTime,1L,100L,serverUrl,appKey,appSecret,accessToken);
// int insertSuccess = 0;//新增成功的订单
// int totalError = 0;
// int hasExistOrder = 0;//已存在的订单数
// //循环插入订单数据到数据库
// for (var order : upResult.getList()) {
// //插入订单数据
// var result = orderService.saveOrder(params.getShopId(), order);
// if (result.getCode() == ResultVoEnum.DataExist.getIndex()) {
// //已经存在
// hasExistOrder++;
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD,MqType.ORDER_MESSAGE,order.getOrderId()));
// } else if (result.getCode() == ResultVoEnum.SUCCESS.getIndex()) {
// insertSuccess++;
// mqUtils.sendApiMessage(MqMessage.build(EnumShopType.JD,MqType.ORDER_MESSAGE,order.getOrderId()));
// } else {
// totalError++;
// }
// }
// if(lasttime == null){
// // 新增
// SysShopPullLasttime insertLasttime = new SysShopPullLasttime();
// insertLasttime.setShopId(params.getShopId());
// insertLasttime.setCreateTime(new Date());
// insertLasttime.setLasttime(endTime);
// insertLasttime.setPullType("ORDER");
// pullLasttimeService.save(insertLasttime);
//
// }else {
// // 修改
// SysShopPullLasttime updateLasttime = new SysShopPullLasttime();
// updateLasttime.setId(lasttime.getId());
// updateLasttime.setUpdateTime(new Date());
// updateLasttime.setLasttime(endTime);
// pullLasttimeService.updateById(updateLasttime);
// }
// SysShopPullLogs logs = new SysShopPullLogs();
// logs.setShopType(EnumShopType.JD.getIndex());
// logs.setShopId(params.getShopId());
// logs.setPullType("ORDER");
// logs.setPullWay("主动拉取");
// logs.setPullParams("{startTime:"+startTime+",endTime:"+endTime+"}");
// logs.setPullResult("{insertSuccess:"+insertSuccess+",hasExistOrder:"+hasExistOrder+",totalError:"+totalError+"}");
// logs.setPullTime(currDateTime);
// logs.setDuration(System.currentTimeMillis() - beginTime);
// pullLogsService.save(logs);
return AjaxResult.success();
}
}

View File

@ -0,0 +1,124 @@
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;
}

View File

@ -0,0 +1,93 @@
package com.qihang.wei.domain;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
*
* @TableName wei_goods
*/
@Data
public class WeiGoods implements Serializable {
/**
*
*/
private Long id;
private Integer shopId;
/**
* 平台商品id
*/
private String productId;
/**
* 商家编码id
*/
private String outProductId;
/**
* 商品标题
*/
private String title;
/**
*
*/
private String subTitle;
/**
* 主图集合
*/
private String headImgs;
/**
* 第一张主图
*/
private String headImg;
/**
* 商品详情字符串
*/
private String descInfo;
/**
* 属性字符串
*/
private String attrs;
/**
* 状态
*/
private Integer status;
/**
* 编辑状态
*/
private Integer editStatus;
/**
* 商品 SKU 最小价格单位
*/
private Integer minPrice;
/**
* 商品编码
*/
private String spuCode;
/**
* 商品类型1: 小店普通自营商品2: 福袋抽奖商品3: 直播间闪电购商品注意: 福袋抽奖直播间闪电购类型的商品为只读数据不支持编辑上架操作不支持用data_type=2的参数获取
*/
private Integer productType;
/**
* 商品草稿最近一次修改时间
*/
private Integer editTime;
@TableField(exist = false)
private List<WeiGoodsSku> skus;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,78 @@
package com.qihang.wei.domain;
import java.io.Serializable;
import lombok.Data;
/**
*
* @TableName wei_goods_sku
*/
@Data
public class WeiGoodsSku implements Serializable {
/**
*
*/
private Long id;
/**
* 外键id
*/
private Long weiGoodsId;
/**
* skuID
*/
private String skuId;
/**
* 商家自定义skuID如果添加时没录入回包可能不包含该字段
*/
private String outSkuId;
/**
* sku小图
*/
private String thumbImg;
/**
* 售卖价格以分为单位
*/
private Integer salePrice;
/**
* sku库存
*/
private Integer stockNum;
/**
* sku编码
*/
private String skuCode;
/**
* sku状态
*/
private Integer status;
/**
* sku_attrs
*/
private String skuAttrs;
/**
* sku_deliver_info
*/
private String skuDeliverInfo;
/**
* erp系统商品id
*/
private Long erpGoodsId;
/**
* erp系统商品skuid
*/
private Long erpGoodsSkuId;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,167 @@
package com.qihang.wei.domain;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
/**
*
* @TableName wei_order
*/
@Data
public class WeiOrder implements Serializable {
/**
*
*/
private Long id;
private Integer shopId;
/**
* 订单号
*/
private String orderId;
/**
* 买家身份标识
*/
private String openid;
/**
* 秒级时间戳
*/
private Integer createTime;
/**
* 秒级时间戳
*/
private Integer updateTime;
/**
*
*/
private String unionid;
/**
* 状态10 待付款20 待发货21 部分发货30 待收货100 完成200 全部商品售后之后订单取消250 未付款用户主动取消或超时未付款订单自动取消
*/
private Integer status;
/**
* 售后信息json
*/
private String aftersaleDetail;
/**
* 支付信息json
*/
private String payInfo;
/**
* 商品总价单位为分
*/
private Integer productPrice;
/**
* 订单金额单位为分order_price=original_order_price-discounted_price-deduction_price-change_down_price
*/
private Integer orderPrice;
/**
* 运费单位为分
*/
private Integer freight;
/**
* 优惠券优惠金额单位为分
*/
private Integer discountedPrice;
/**
* 收货人姓名
*/
private String userName;
/**
* 邮编
*/
private String postalCode;
/**
* 省份
*/
private String provinceName;
/**
* 城市
*/
private String cityName;
/**
*
*/
private String countyName;
/**
* 详细地址
*/
private String detailInfo;
/**
* 联系方式
*/
private String telNumber;
/**
* 门牌号码
*/
private String houseNumber;
/**
* 虚拟发货订单联系方式(deliver_method=1时返回)
*/
private String virtualOrderTelNumber;
/**
* 额外的联系方式信息虚拟号码相关
*/
private String telNumberExtInfo;
/**
* 0不使用虚拟号码1使用虚拟号码
*/
private Integer useTelNumber;
/**
* 标识当前店铺下一个唯一的用户收货地址
*/
private String hashCode;
/**
* 发货物流信息JSON
*/
private String deliveryProductInfo;
/**
* 发货完成时间秒级时间戳
*/
private Integer shipDoneTime;
/**
* 电子面单代发时的订单密文
*/
private String ewaybillOrderCode;
/**
* 结算信息json
*/
private String settleInfo;
@TableField(exist = false)
private List<WeiOrderItem> items;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,145 @@
package com.qihang.wei.domain;
import java.io.Serializable;
import lombok.Data;
/**
*
* @TableName wei_order_item
*/
@Data
public class WeiOrderItem implements Serializable {
/**
*
*/
private Long id;
/**
* 外键id
*/
private Long weiOrderId;
/**
* 商品spuid
*/
private String productId;
/**
* 商品skuid
*/
private String skuId;
/**
* sku小图
*/
private String thumbImg;
/**
* sku数量
*/
private Integer skuCnt;
/**
* 售卖单价单位
*/
private Integer salePrice;
/**
* 商品标题
*/
private String title;
/**
* 正在售后/退款流程中的 sku 数量
*/
private Integer onAftersaleSkuCnt;
/**
* 完成售后/退款的 sku 数量
*/
private Integer finishAftersaleSkuCnt;
/**
* 商品编码
*/
private String skuCode;
/**
* 市场单价单位
*/
private Integer marketPrice;
/**
* sku属性JSON
*/
private String skuAttrs;
/**
* sku实付总价取estimate_price和change_price中较小值
*/
private Integer realPrice;
/**
* 商品外部spuid
*/
private String outProductId;
/**
* 商品外部skuid
*/
private String outSkuId;
/**
* 是否有优惠金额非必填默认为false
*/
private String isDiscounted;
/**
* 优惠后sku总价非必填is_discounted为true时有值
*/
private Integer estimatePrice;
/**
* 是否修改过价格非必填默认为false
*/
private String isChangePrice;
/**
* 改价后sku总价非必填is_change_price为true时有值
*/
private Integer changePrice;
/**
* 区域库存id
*/
private String outWarehouseId;
/**
* 商品发货信息JSON
*/
private String skuDeliverInfo;
/**
* 商品额外服务信息JSON
*/
private String extraService;
/**
* 是否使用了会员积分抵扣
*/
private String useDeduction;
/**
* 会员积分抵扣金额单位为分
*/
private Integer deductionPrice;
/**
* 商品优惠券信息逐步替换 order.order_detail.coupon_info
*/
private String orderProductCouponInfoList;
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,18 @@
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> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.wei.mapper;
import com.qihang.wei.domain.WeiGoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表wei_goods的数据库操作Mapper
* @createDate 2024-03-29 11:25:17
* @Entity com.qihang.wei.domain.WeiGoods
*/
public interface WeiGoodsMapper extends BaseMapper<WeiGoods> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.wei.mapper;
import com.qihang.wei.domain.WeiGoodsSku;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表wei_goods_sku的数据库操作Mapper
* @createDate 2024-03-29 11:41:24
* @Entity com.qihang.wei.domain.WeiGoodsSku
*/
public interface WeiGoodsSkuMapper extends BaseMapper<WeiGoodsSku> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.wei.mapper;
import com.qihang.wei.domain.WeiOrderItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表wei_order_item的数据库操作Mapper
* @createDate 2024-03-29 16:44:51
* @Entity com.qihang.wei.domain.WeiOrderItem
*/
public interface WeiOrderItemMapper extends BaseMapper<WeiOrderItem> {
}

View File

@ -0,0 +1,18 @@
package com.qihang.wei.mapper;
import com.qihang.wei.domain.WeiOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author TW
* @description 针对表wei_order的数据库操作Mapper
* @createDate 2024-03-29 16:44:51
* @Entity com.qihang.wei.domain.WeiOrder
*/
public interface WeiOrderMapper extends BaseMapper<WeiOrder> {
}

View File

@ -68,8 +68,12 @@ public class ApiCommon {
// Token过期
TokenApiService remoting1 = RemoteUtil.Remoting(params.getServerUrl(), TokenApiService.class);
Token token = remoting1.getToken("client_credential",params.getAppKey(),params.getAppSecret());
params.setAccessToken(token.getAccess_token());
shopService.updateSessionKey(shopId,token.getAccess_token());
if(token.getErrcode()==null) {
params.setAccessToken(token.getAccess_token());
shopService.updateSessionKey(shopId, token.getAccess_token());
}else{
return ResultVo.error(HttpStatus.PARAMS_ERROR, token.getErrmsg());
}
}
}
return ResultVo.success(params);

View File

@ -0,0 +1,10 @@
package com.qihang.wei.openApi.bo;
import lombok.Data;
@Data
public class GoodsDetailApiBo {
private Integer data_type;
private String product_id;
}

View File

@ -3,7 +3,7 @@ package com.qihang.wei.openApi.bo;
import lombok.Data;
@Data
public class GoodsApiBo {
public class GoodsListApiBo {
private Integer status;
private Integer page_size;
private String next_key;

View File

@ -0,0 +1,8 @@
package com.qihang.wei.openApi.bo;
import lombok.Data;
@Data
public class OrderDetailBo {
private String order_id;
}

View File

@ -1,6 +1,8 @@
package com.qihang.wei.openApi.service;
import com.qihang.wei.openApi.bo.GoodsApiBo;
import com.qihang.wei.openApi.bo.GoodsDetailApiBo;
import com.qihang.wei.openApi.bo.GoodsListApiBo;
import com.qihang.wei.openApi.vo.GoodsDetailVo;
import com.qihang.wei.openApi.vo.GoodsListVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@ -10,5 +12,7 @@ import org.springframework.web.service.annotation.PostExchange;
@HttpExchange
public interface GoodsApiService {
@PostExchange("/channels/ec/product/list/get")
GoodsListVo getGoodsList(@RequestParam String access_token, @RequestBody GoodsApiBo bo);
GoodsListVo getGoodsList(@RequestParam String access_token, @RequestBody GoodsListApiBo bo);
@PostExchange("/channels/ec/product/get")
GoodsDetailVo getGoodsDetail(@RequestParam String access_token, @RequestBody GoodsDetailApiBo bo);
}

View File

@ -1,7 +1,9 @@
package com.qihang.wei.openApi.service;
import com.qihang.wei.openApi.bo.OrderDetailBo;
import com.qihang.wei.openApi.bo.OrderListBo;
import com.qihang.wei.openApi.vo.GoodsListVo;
import com.qihang.wei.openApi.vo.OrderDetailVo;
import com.qihang.wei.openApi.vo.OrderListVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@ -12,4 +14,6 @@ import org.springframework.web.service.annotation.PostExchange;
public interface OrderApiService {
@PostExchange("/channels/ec/order/list/get")
OrderListVo getOrderList(@RequestParam String access_token, @RequestBody OrderListBo bo);
@PostExchange("/channels/ec/order/get")
OrderDetailVo getOrderDetail(@RequestParam String access_token, @RequestBody OrderDetailBo bo);
}

View File

@ -0,0 +1,10 @@
package com.qihang.wei.openApi.vo;
import lombok.Data;
@Data
public class GoodsDetailVo extends BaseResVo {
private ProductVo product;
}

View File

@ -0,0 +1,11 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@Data
public class OrderDetailVo extends BaseResVo {
private OrderVo order;
}

View File

@ -0,0 +1,19 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import java.util.List;
@Data
public class OrderVo {
private Integer create_time;//秒级时间戳
private Integer update_time;//秒级时间戳
private String order_id ;//订单号
private Integer status ;//订单状态枚举值见OrderStatus
private String openid ;//买家身份标识
private String unionid ;//买家在开放平台的唯一标识符若当前视频号小店已绑定到微信开放平台账号下绑定成功后产生的订单会返回详见UnionID 机制说明
private OrderVoDetail order_detail ;// OrderDetail 订单详细数据信息
private JSONObject aftersale_detail ;// AfterSaleDetail 售后信息
}

View File

@ -0,0 +1,22 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@Data
public class OrderVoDeliverInfoAddress {
private String user_name ;//string 收货人姓名
private String postal_code;// string 邮编
private String province_name;// string 省份
private String city_name;// string 城市
private String county_name;// string
private String detail_info;// string 详细地址
private String national_code;// string 国家码已废弃请勿使用
private String tel_number;// string 联系方式
private String house_number;// string 门牌号码
private String virtual_order_tel_number;// string 虚拟发货订单联系方式(deliver_method=1时返回)
private JSONObject tel_number_ext_info;// TelNumberExtInfo 额外的联系方式信息虚拟号码相关
private Integer use_tel_number;// number 0不使用虚拟号码1使用虚拟号码
private String hash_code;// string 标识当前店铺下一个唯一的用户收货地址
}

View File

@ -0,0 +1,20 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@Data
public class OrderVoDeliveryInfo {
private OrderVoDeliverInfoAddress address_info;
private JSONArray delivery_product_info;// array DeliveryProductInfo 发货物流信息
private Integer ship_done_time;// number 发货完成时间秒级时间戳
private Integer deliver_method;// number 订单发货方式0普通物流1虚拟发货由商品的同名字段决定
private JSONObject address_under_review;// object AddressInfo 用户下单后申请修改收货地址商家同意后该字段会覆盖订单地址信息
private Integer address_apply_time;// number 修改地址申请时间秒级时间戳
private String ewaybill_order_code;// string 电子面单代发时的订单密文
private Integer quality_inspect_type;// number 订单是否需要走新质检流程1需要0不需要 本字段不存在时表示不需要
private JSONObject quality_inspect_info;// object QualityInsepctInfo 质检信息quality_inspect_type为1时返回
}

View File

@ -0,0 +1,20 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import java.util.List;
@Data
public class OrderVoDetail {
private List<OrderVoDetailProductInfo> product_infos;
private JSONObject price_info;// 价格信息
private JSONObject pay_info;// 支付信息
private OrderVoDeliveryInfo delivery_info;// 配送信息
private JSONObject coupon_info;// 优惠券信息
private JSONObject ext_info;// 额外信息
private JSONArray commission_infos;// 分佣信息
private JSONObject settle_info;// 结算信息
}

View File

@ -0,0 +1,35 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
@Data
public class OrderVoDetailProductInfo {
private String product_id ;//商品spuid
private String sku_id ;// 商品skuid
private String thumb_img ;// sku小图
private Integer sku_cnt ;// sku数量
private Integer sale_price ;// 售卖单价单位
private String title ;// 商品标题
private Integer on_aftersale_sku_cnt ;// 正在售后/退款流程中的 sku 数量
private Integer finish_aftersale_sku_cnt ;// 完成售后/退款的 sku 数量
private String sku_code ;// 商品编码
private Integer market_price ;// 市场单价单位
private JSONArray sku_attrs ;// sku属性
private Integer real_price ;// sku实付总价取estimate_price和change_price中较小值
private String out_product_id ;// 商品外部spuid
private String out_sku_id ;// 商品外部skuid
private Boolean is_discounted ;// 是否有优惠金额非必填默认为false
private Integer estimate_price ;// 优惠后sku总价非必填is_discounted为true时有值
private Boolean is_change_price;// bool 是否修改过价格非必填默认为false
private Integer change_price;// number 改价后sku总价非必填is_change_price为true时有值
private String out_warehouse_id;// string 区域库存id
private JSONObject sku_deliver_info;// SkuDeliverInfo 商品发货信息
private JSONObject extra_service;// ProductExtraService 商品额外服务信息
private Boolean use_deduction;// bool 是否使用了会员积分抵扣
private Integer deduction_price;// number 会员积分抵扣金额单位为分
private JSONArray order_product_coupon_info_list;// array OrderProductCouponInfo 商品优惠券信息逐步替换 order.order_detail.coupon_info
}

View File

@ -0,0 +1,22 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class ProductSkuVo {
private String sku_id;
private String out_sku_id;
private String thumb_img;
private String sku_code;
private JSONArray sku_attrs;
private Integer sale_price;
private Integer stock_num;
private Integer status;
private JSONObject sku_deliver_info;
}

View File

@ -0,0 +1,26 @@
package com.qihang.wei.openApi.vo;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class ProductVo {
private String product_id;
private String out_product_id;
private String title;
private String sub_title;
private JSONArray head_imgs;
private JSONObject desc_info;
private List<Map<String,String>> attrs;
private Integer status;
private Integer edit_status;
private Integer min_price;
private String spu_code;
private List<ProductSkuVo> skus;
private Integer product_type;
private String edit_time;
}

View File

@ -0,0 +1,13 @@
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> {
}

View File

@ -0,0 +1,13 @@
package com.qihang.wei.service;
import com.qihang.wei.domain.WeiGoods;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表wei_goods的数据库操作Service
* @createDate 2024-03-29 11:25:17
*/
public interface WeiGoodsService extends IService<WeiGoods> {
int saveAndUpdateGoods(Integer shopId,WeiGoods goods);
}

View File

@ -0,0 +1,13 @@
package com.qihang.wei.service;
import com.qihang.wei.domain.WeiGoodsSku;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表wei_goods_sku的数据库操作Service
* @createDate 2024-03-29 11:41:24
*/
public interface WeiGoodsSkuService extends IService<WeiGoodsSku> {
}

View File

@ -0,0 +1,13 @@
package com.qihang.wei.service;
import com.qihang.wei.domain.WeiOrderItem;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表wei_order_item的数据库操作Service
* @createDate 2024-03-29 16:44:51
*/
public interface WeiOrderItemService extends IService<WeiOrderItem> {
}

View File

@ -0,0 +1,14 @@
package com.qihang.wei.service;
import com.qihang.common.common.ResultVo;
import com.qihang.wei.domain.WeiOrder;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author TW
* @description 针对表wei_order的数据库操作Service
* @createDate 2024-03-29 16:44:51
*/
public interface WeiOrderService extends IService<WeiOrder> {
ResultVo<Integer> saveOrder(Integer shopId, WeiOrder order);
}

View File

@ -0,0 +1,22 @@
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{
}

View File

@ -0,0 +1,90 @@
package com.qihang.wei.service.impl;
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;
/**
* @author TW
* @description 针对表wei_goods的数据库操作Service实现
* @createDate 2024-03-29 11:25:17
*/
@AllArgsConstructor
@Service
public class WeiGoodsServiceImpl extends ServiceImpl<WeiGoodsMapper, WeiGoods>
implements WeiGoodsService{
private final WeiGoodsMapper mapper;
private final WeiGoodsSkuMapper skuMapper;
private final OGoodsSkuMapper goodsSkuMapper;
@Override
public int saveAndUpdateGoods(Integer shopId, WeiGoods goods) {
List<WeiGoods> goodsList = mapper.selectList(new LambdaQueryWrapper<WeiGoods>().eq(WeiGoods::getProductId, goods.getProductId()));
if (goodsList != null && goodsList.size() > 0) {
// 更新
// 存在更新
goods.setShopId(shopId);
goods.setId(goodsList.get(0).getId());
mapper.updateById(goods);
// 删除sku
skuMapper.delete(new LambdaQueryWrapper<WeiGoodsSku>().eq(WeiGoodsSku::getWeiGoodsId,goods.getId()));
// 重新插入sku
if(goods.getSkus()!=null) {
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());
}
}
skuMapper.insert(sku);
}
}
return ResultVoEnum.DataExist.getIndex();
} else {
// 不存在新增return 0;
// 不存在新增
goods.setShopId(shopId);
mapper.insert(goods);
// 插入sku
if(goods.getSkus()!=null) {
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());
}
}
skuMapper.insert(sku);
}
}
return 0;
}
}
}

View File

@ -0,0 +1,22 @@
package com.qihang.wei.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.wei.domain.WeiGoodsSku;
import com.qihang.wei.service.WeiGoodsSkuService;
import com.qihang.wei.mapper.WeiGoodsSkuMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表wei_goods_sku的数据库操作Service实现
* @createDate 2024-03-29 11:41:24
*/
@Service
public class WeiGoodsSkuServiceImpl extends ServiceImpl<WeiGoodsSkuMapper, WeiGoodsSku>
implements WeiGoodsSkuService{
}

View File

@ -0,0 +1,22 @@
package com.qihang.wei.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.wei.domain.WeiOrderItem;
import com.qihang.wei.service.WeiOrderItemService;
import com.qihang.wei.mapper.WeiOrderItemMapper;
import org.springframework.stereotype.Service;
/**
* @author TW
* @description 针对表wei_order_item的数据库操作Service实现
* @createDate 2024-03-29 16:44:51
*/
@Service
public class WeiOrderItemServiceImpl extends ServiceImpl<WeiOrderItemMapper, WeiOrderItem>
implements WeiOrderItemService{
}

View File

@ -0,0 +1,78 @@
package com.qihang.wei.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qihang.common.common.ResultVo;
import com.qihang.common.common.ResultVoEnum;
import com.qihang.wei.domain.WeiOrder;
import com.qihang.wei.domain.WeiOrderItem;
import com.qihang.wei.mapper.WeiOrderItemMapper;
import com.qihang.wei.service.WeiOrderService;
import com.qihang.wei.mapper.WeiOrderMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date;
import java.util.List;
/**
* @author TW
* @description 针对表wei_order的数据库操作Service实现
* @createDate 2024-03-29 16:44:51
*/
@AllArgsConstructor
@Service
public class WeiOrderServiceImpl extends ServiceImpl<WeiOrderMapper, WeiOrder>
implements WeiOrderService{
private final WeiOrderMapper mapper;
private final WeiOrderItemMapper itemMapper;
@Override
public ResultVo<Integer> saveOrder(Integer shopId, WeiOrder order) {
try {
List<WeiOrder> orders = mapper.selectList(new LambdaQueryWrapper<WeiOrder>().eq(WeiOrder::getOrderId, order.getOrderId()));
if (orders != null && orders.size() > 0) {
// 存在修改
WeiOrder update = new WeiOrder();
update.setId(orders.get(0).getId());
update.setStatus(order.getStatus());
update.setUpdateTime(order.getUpdateTime());
update.setPayInfo(order.getPayInfo());
update.setAftersaleDetail(order.getAftersaleDetail());
update.setDeliveryProductInfo(order.getDeliveryProductInfo());
mapper.updateById(update);
// 更新item
for (var item : order.getItems()) {
List<WeiOrderItem> taoOrderItems = itemMapper.selectList(new LambdaQueryWrapper<WeiOrderItem>().eq(WeiOrderItem::getSkuId, item.getSkuId()));
if (taoOrderItems != null && taoOrderItems.size() > 0) {
// 不处理
} else {
// 新增
item.setWeiOrderId(update.getId());
itemMapper.insert(item);
}
}
return ResultVo.error(ResultVoEnum.DataExist, "订单已经存在,更新成功");
} else {
// 不存在新增
order.setShopId(shopId);
mapper.insert(order);
// 添加item
for (var item : order.getItems()) {
item.setWeiOrderId(order.getId());
itemMapper.insert(item);
}
return ResultVo.success();
}
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultVo.error(ResultVoEnum.SystemException, "系统异常:" + e.getMessage());
}
}
}

View File

@ -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.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>

View File

@ -0,0 +1,32 @@
<?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.WeiGoodsMapper">
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.WeiGoods">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
<result property="outProductId" column="out_product_id" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="subTitle" column="sub_title" jdbcType="VARCHAR"/>
<result property="headImgs" column="head_imgs" jdbcType="VARCHAR"/>
<result property="headImg" column="head_img" jdbcType="VARCHAR"/>
<result property="descInfo" column="desc_info" jdbcType="VARCHAR"/>
<result property="attrs" column="attrs" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="editStatus" column="edit_status" jdbcType="INTEGER"/>
<result property="minPrice" column="min_price" jdbcType="INTEGER"/>
<result property="spuCode" column="spu_code" jdbcType="VARCHAR"/>
<result property="productType" column="product_type" jdbcType="INTEGER"/>
<result property="editTime" column="edit_time" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id,product_id,out_product_id,
title,sub_title,head_imgs,
head_img,desc_info,attrs,
status,edit_status,min_price,
spu_code,product_type,edit_time
</sql>
</mapper>

View File

@ -0,0 +1,30 @@
<?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.WeiGoodsSkuMapper">
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.WeiGoodsSku">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="weiGoodsId" column="wei_goods_id" jdbcType="BIGINT"/>
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
<result property="outSkuId" column="out_sku_id" jdbcType="VARCHAR"/>
<result property="thumbImg" column="thumb_img" jdbcType="VARCHAR"/>
<result property="salePrice" column="sale_price" jdbcType="INTEGER"/>
<result property="stockNum" column="stock_num" jdbcType="INTEGER"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="skuAttrs" column="sku_attrs" jdbcType="VARCHAR"/>
<result property="skuDeliverInfo" column="sku_deliver_info" jdbcType="VARCHAR"/>
<result property="erpGoodsId" column="erp_goods_id" jdbcType="BIGINT"/>
<result property="erpGoodsSkuId" column="erp_goods_sku_id" jdbcType="BIGINT"/>
</resultMap>
<sql id="Base_Column_List">
id,wei_goods_id,sku_id,
out_sku_id,thumb_img,sale_price,
stock_num,sku_code,status,
sku_attrs,sku_deliver_info,erp_goods_id,
erp_goods_sku_id
</sql>
</mapper>

View File

@ -0,0 +1,47 @@
<?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.WeiOrderItemMapper">
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.WeiOrderItem">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="weiOrderId" column="wei_order_id" jdbcType="BIGINT"/>
<result property="productId" column="product_id" jdbcType="VARCHAR"/>
<result property="skuId" column="sku_id" jdbcType="VARCHAR"/>
<result property="thumbImg" column="thumb_img" jdbcType="VARCHAR"/>
<result property="skuCnt" column="sku_cnt" jdbcType="INTEGER"/>
<result property="salePrice" column="sale_price" jdbcType="INTEGER"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="onAftersaleSkuCnt" column="on_aftersale_sku_cnt" jdbcType="INTEGER"/>
<result property="finishAftersaleSkuCnt" column="finish_aftersale_sku_cnt" jdbcType="INTEGER"/>
<result property="skuCode" column="sku_code" jdbcType="VARCHAR"/>
<result property="marketPrice" column="market_price" jdbcType="INTEGER"/>
<result property="skuAttrs" column="sku_attrs" jdbcType="VARCHAR"/>
<result property="realPrice" column="real_price" jdbcType="INTEGER"/>
<result property="outProductId" column="out_product_id" jdbcType="VARCHAR"/>
<result property="outSkuId" column="out_sku_id" jdbcType="VARCHAR"/>
<result property="isDiscounted" column="is_discounted" jdbcType="VARCHAR"/>
<result property="estimatePrice" column="estimate_price" jdbcType="INTEGER"/>
<result property="isChangePrice" column="is_change_price" jdbcType="VARCHAR"/>
<result property="changePrice" column="change_price" jdbcType="INTEGER"/>
<result property="outWarehouseId" column="out_warehouse_id" jdbcType="VARCHAR"/>
<result property="skuDeliverInfo" column="sku_deliver_info" jdbcType="VARCHAR"/>
<result property="extraService" column="extra_service" jdbcType="VARCHAR"/>
<result property="useDeduction" column="use_deduction" jdbcType="VARCHAR"/>
<result property="deductionPrice" column="deduction_price" jdbcType="INTEGER"/>
<result property="orderProductCouponInfoList" column="order_product_coupon_info_list" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,wei_order_id,product_id,
sku_id,thumb_img,sku_cnt,
sale_price,title,on_aftersale_sku_cnt,
finish_aftersale_sku_cnt,sku_code,market_price,
sku_attrs,real_price,out_product_id,
out_sku_id,is_discounted,estimate_price,
is_change_price,change_price,out_warehouse_id,
sku_deliver_info,extra_service,use_deduction,
deduction_price,order_product_coupon_info_list
</sql>
</mapper>

View File

@ -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.wei.mapper.WeiOrderMapper">
<resultMap id="BaseResultMap" type="com.qihang.wei.domain.WeiOrder">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="openid" column="openid" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="INTEGER"/>
<result property="unionid" column="unionid" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="aftersaleDetail" column="aftersale_detail" jdbcType="VARCHAR"/>
<result property="payInfo" column="pay_info" jdbcType="VARCHAR"/>
<result property="productPrice" column="product_price" jdbcType="INTEGER"/>
<result property="orderPrice" column="order_price" jdbcType="INTEGER"/>
<result property="freight" column="freight" jdbcType="INTEGER"/>
<result property="discountedPrice" column="discounted_price" jdbcType="INTEGER"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="postalCode" column="postal_code" jdbcType="VARCHAR"/>
<result property="provinceName" column="province_name" jdbcType="VARCHAR"/>
<result property="cityName" column="city_name" jdbcType="VARCHAR"/>
<result property="countyName" column="county_name" jdbcType="VARCHAR"/>
<result property="detailInfo" column="detail_info" jdbcType="VARCHAR"/>
<result property="telNumber" column="tel_number" jdbcType="VARCHAR"/>
<result property="houseNumber" column="house_number" jdbcType="VARCHAR"/>
<result property="virtualOrderTelNumber" column="virtual_order_tel_number" jdbcType="VARCHAR"/>
<result property="telNumberExtInfo" column="tel_number_ext_info" jdbcType="VARCHAR"/>
<result property="useTelNumber" column="use_tel_number" jdbcType="INTEGER"/>
<result property="hashCode" column="hash_code" jdbcType="VARCHAR"/>
<result property="deliveryProductInfo" column="delivery_product_info" jdbcType="VARCHAR"/>
<result property="shipDoneTime" column="ship_done_time" jdbcType="INTEGER"/>
<result property="ewaybillOrderCode" column="ewaybill_order_code" jdbcType="VARCHAR"/>
<result property="settleInfo" column="settle_info" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id,order_id,openid,
create_time,update_time,unionid,
status,aftersale_detail,pay_info,
product_price,order_price,freight,
discounted_price,user_name,postal_code,
province_name,city_name,county_name,
detail_info,tel_number,house_number,
virtual_order_tel_number,tel_number_ext_info,use_tel_number,
hash_code,delivery_product_info,ship_done_time,
ewaybill_order_code,settle_info
</sql>
</mapper>