完善jd店铺商品
This commit is contained in:
parent
4376b87fdf
commit
c6f10aee96
1783
docs/qihang-oms.sql
1783
docs/qihang-oms.sql
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -48,7 +48,7 @@ public class JdGoodsController extends BaseController {
|
|||
@PostMapping(value = "/sku/linkErp")
|
||||
public AjaxResult linkErp(@RequestBody LinkErpGoodsSkuBo bo)
|
||||
{
|
||||
if(bo.getId()!=null){
|
||||
if(bo.getId()==null){
|
||||
return AjaxResult.error(500,"缺少参数Id");
|
||||
}
|
||||
if(StringUtils.isBlank(bo.getErpGoodsSkuId())){
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ public class JdGoodsServiceImpl extends ServiceImpl<JdGoodsMapper, JdGoods>
|
|||
.eq(bo.getShopId()!=null,JdGoods::getShopId,bo.getShopId());
|
||||
|
||||
Page<JdGoods> goodsPage = mapper.selectPage(pageQuery.build(), queryWrapper);
|
||||
if(goodsPage.getRecords()!=null && goodsPage.getRecords().size()>0){
|
||||
for(JdGoods goods : goodsPage.getRecords()){
|
||||
goods.setSkuList(skuMapper.selectList(new LambdaQueryWrapper<JdGoodsSku>().eq(JdGoodsSku::getWareId,goods.getWareId())));
|
||||
}
|
||||
}
|
||||
return PageResult.build(goodsPage);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package cn.qihangerp.module.open.jd.service.impl;
|
|||
|
||||
import cn.qihangerp.common.ResultVo;
|
||||
import cn.qihangerp.domain.bo.LinkErpGoodsSkuBo;
|
||||
import cn.qihangerp.module.goods.domain.OGoods;
|
||||
import cn.qihangerp.module.goods.domain.OGoodsSku;
|
||||
import cn.qihangerp.module.goods.service.OGoodsService;
|
||||
import cn.qihangerp.module.goods.service.OGoodsSkuService;
|
||||
import cn.qihangerp.module.open.jd.domain.JdGoods;
|
||||
import cn.qihangerp.module.open.jd.mapper.JdGoodsMapper;
|
||||
|
|
@ -36,6 +38,7 @@ public class JdGoodsSkuServiceImpl extends ServiceImpl<JdGoodsSkuMapper, JdGoods
|
|||
private final JdGoodsSkuMapper mapper;
|
||||
private final JdGoodsMapper jdGoodsMapper;
|
||||
private final OGoodsSkuService oGoodsSkuService;
|
||||
private final OGoodsService oGoodsService;
|
||||
@Override
|
||||
public PageResult<JdGoodsSkuListVo> queryPageList(JdGoodsBo bo, PageQuery pageQuery) {
|
||||
if(StringUtils.hasText(bo.getOuterId())){
|
||||
|
|
@ -50,6 +53,12 @@ public class JdGoodsSkuServiceImpl extends ServiceImpl<JdGoodsSkuMapper, JdGoods
|
|||
public ResultVo linkErpGoodsSku(LinkErpGoodsSkuBo bo) {
|
||||
OGoodsSku oGoodsSku = oGoodsSkuService.getById(bo.getErpGoodsSkuId());
|
||||
if(oGoodsSku == null) return ResultVo.error("未找到系统商品sku");
|
||||
|
||||
OGoods oGoods=oGoodsService.getById(oGoodsSku.getGoodsId());
|
||||
if(oGoods == null){
|
||||
return ResultVo.error("未找到系统商品");
|
||||
}
|
||||
|
||||
JdGoodsSku taoGoodsSku = mapper.selectById(bo.getId());
|
||||
if(taoGoodsSku == null) {
|
||||
return ResultVo.error("JD商品sku数据不存在");
|
||||
|
|
@ -61,6 +70,7 @@ public class JdGoodsSkuServiceImpl extends ServiceImpl<JdGoodsSkuMapper, JdGoods
|
|||
|
||||
JdGoodsSku sku = new JdGoodsSku();
|
||||
sku.setId(bo.getId());
|
||||
sku.setLogo(oGoodsSku.getColorImage());
|
||||
sku.setErpGoodsId(oGoodsSku.getGoodsId());
|
||||
sku.setErpGoodsSkuId(oGoodsSku.getId());
|
||||
mapper.updateById(sku);
|
||||
|
|
@ -68,6 +78,7 @@ public class JdGoodsSkuServiceImpl extends ServiceImpl<JdGoodsSkuMapper, JdGoods
|
|||
JdGoods goodsUp=new JdGoods();
|
||||
goodsUp.setId(jdGoods.get(0).getId());
|
||||
goodsUp.setErpGoodsId(oGoodsSku.getGoodsId());
|
||||
goodsUp.setLogo(oGoods.getImage());
|
||||
jdGoodsMapper.updateById(goodsUp);
|
||||
return ResultVo.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<select id="selectSkuPageList" resultType="cn.qihangerp.module.open.jd.domain.vo.JdGoodsSkuListVo">
|
||||
SELECT sku.*,ogs.outer_erp_sku_id FROM oms_jd_goods_sku sku
|
||||
|
||||
LEFT JOIN o_goods_sku ogs on ogs.id = sku.o_goods_sku_id
|
||||
LEFT JOIN o_goods_sku ogs on ogs.id = sku.erp_goods_sku_id
|
||||
WHERE 1=1
|
||||
<if test="shopId != null and shopId != ''">
|
||||
AND sku.shop_id = #{shopId}
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
AND sku.outer_id = #{outerId}
|
||||
</if>
|
||||
<if test="hasLink != null and hasLink == 0">
|
||||
AND (sku.o_goods_sku_id is NULL or sku.o_goods_sku_id = 0)
|
||||
AND (sku.erp_goods_sku_id is NULL or sku.erp_goods_sku_id = 0)
|
||||
</if>
|
||||
<if test="hasLink != null and hasLink == 1">
|
||||
AND sku.o_goods_sku_id is NOT NULL and sku.o_goods_sku_id != 0
|
||||
AND sku.erp_goods_sku_id is NOT NULL and sku.erp_goods_sku_id != 0
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -75,10 +75,58 @@
|
|||
type="text"
|
||||
icon="el-icon-info"
|
||||
@click="handleViewSkuList(scope.row)"
|
||||
>{{scope.row.skus.length +' 个SKU'}}</el-button>
|
||||
>{{scope.row.skuList.length +' 个SKU'}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="ERP商品ID" align="center" prop="erpGoodsId" />
|
||||
<el-table-column label="状态" align="center" prop="wareStatus" >
|
||||
<template slot-scope="scope">
|
||||
<!--商品状态 -1:删除 1:从未上架 2:自主下架 4:系统下架 8:上架 513:从未上架待审 514:自主下架待审 516:系统下架待审 520:上架待审核 1028:系统下架审核失败-->
|
||||
<el-tag size="small" v-if="scope.row.wareStatus === 8">销售中</el-tag>
|
||||
<!-- <el-tag size="small">{{scope.row.wareStatus}}</el-tag>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleLink(scope.row)"-->
|
||||
<!-- >关联ERP</el-button>-->
|
||||
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog title="Sku List" :visible.sync="skuOpen" width="1200px" append-to-body>
|
||||
<el-table v-loading="loading" :data="skuList">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
||||
<el-table-column label="SKU编码" align="left" prop="outerId" />
|
||||
<el-table-column label="平台SkuId" align="center" prop="skuId" />
|
||||
<!-- <el-table-column label="图片" align="center" prop="colorImage" width="100">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <image-preview :src="scope.row.colorImage" :width="50" :height="50"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="商品名称" align="left" prop="goodsName" width="288px"/>-->
|
||||
<el-table-column label="SKU名称" align="left" prop="skuName" width="300">
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- {{getSkuProper(scope.row.propertiesName)}}-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="价格" align="center" prop="jdPrice" :formatter="amountFormatter"/>
|
||||
<el-table-column label="库存" align="center" prop="stockNum" />
|
||||
<el-table-column label="ERP SKU ID" align="center" prop="erpGoodsSkuId" />
|
||||
<el-table-column label="状态" align="center" prop="status" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" v-if="scope.row.status === 1">销售中</el-tag>
|
||||
|
|
@ -90,23 +138,13 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
icon="el-icon-share"
|
||||
@click="handleLink(scope.row)"
|
||||
>关联ERP</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
<!-- 添加或修改商品管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
|
|
@ -143,6 +181,8 @@ export default {
|
|||
// 遮罩层
|
||||
loading: true,
|
||||
pullLoading: false,
|
||||
skuList:[],
|
||||
skuOpen:false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
|
|
@ -232,6 +272,12 @@ export default {
|
|||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 查看SKU List*/
|
||||
handleViewSkuList(row){
|
||||
this.skuList = row.skuList
|
||||
this.skuOpen = true;
|
||||
|
||||
},
|
||||
handleLink(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
|
|
|
|||
|
|
@ -58,14 +58,16 @@
|
|||
<el-table v-loading="loading" :data="goodsList" >
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<!-- <el-table-column label="ID" align="center" prop="id" />-->
|
||||
<el-table-column label="图片" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="sku名称" align="center" prop="skuName" />
|
||||
<el-table-column label="商品ID" align="center" prop="wareId" />
|
||||
<el-table-column label="Sku Id" align="center" prop="skuId" />
|
||||
<el-table-column label="sku名称" align="center" prop="skuName" />
|
||||
<!-- <el-table-column label="图片" align="center" prop="logo" width="100">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <image-preview :src="scope.row.logo" :width="50" :height="50"/>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
|
||||
|
||||
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
|
|
|
|||
Loading…
Reference in New Issue