01-08
This commit is contained in:
@@ -50,6 +50,12 @@ public class GoodsSpuRest {
|
|||||||
public ResultBean<List<GoodsSpuVo>> listAll(@RequestBody OrgPathQuery query) {
|
public ResultBean<List<GoodsSpuVo>> listAll(@RequestBody OrgPathQuery query) {
|
||||||
return goodsSpuService.listAll(query);
|
return goodsSpuService.listAll(query);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("查询所有")
|
||||||
|
@PostMapping("/listAllByQuery")
|
||||||
|
public ResultBean<List<GoodsSpuVo>> listAllByQuery(@RequestBody GoodsSpuQuery query) {
|
||||||
|
return goodsSpuService.listAllByQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("保存修改")
|
@ApiOperation("保存修改")
|
||||||
@PostMapping("/saveOrUpdate")
|
@PostMapping("/saveOrUpdate")
|
||||||
public ResultBean<String> saveOrUpdate(@RequestBody GoodsSpuDto dto) {
|
public ResultBean<String> saveOrUpdate(@RequestBody GoodsSpuDto dto) {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="listAllByOrg" resultType="com.yxt.goods.biz.goodssku.GoodsSkuVo">
|
<select id="listAllByOrg" resultType="com.yxt.goods.biz.goodssku.GoodsSkuVo">
|
||||||
select a.*
|
select a.*,b.goodsName as goodsName
|
||||||
from goods_sku a
|
from goods_sku a
|
||||||
left join goods_spu b on b.sid =a.goodsSpuSid
|
left join goods_spu b on b.sid =a.goodsSpuSid
|
||||||
LEFT JOIN ss_user.sys_organization as s ON b.useOrgSid = s.sid
|
LEFT JOIN ss_user.sys_organization as s ON b.useOrgSid = s.sid
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public interface GoodsSpuMapper extends BaseMapper<GoodsSpu> {
|
|||||||
GoodsSpuVo initialization(@Param("sid")String sid);
|
GoodsSpuVo initialization(@Param("sid")String sid);
|
||||||
int updateBySidIsDelete(List<String> list);
|
int updateBySidIsDelete(List<String> list);
|
||||||
List<GoodsSpuVo> listAll(@Param("orgPath")String orgPath);
|
List<GoodsSpuVo> listAll(@Param("orgPath")String orgPath);
|
||||||
|
List<GoodsSpuVo> listAllByQuery(@Param(Constants.WRAPPER) QueryWrapper<GoodsSpu> qw);
|
||||||
GoodsSpuVo getGoodsByOrgAndCode(@Param("orgPath")String orgPath,@Param("goodsCode")String goodsCode);
|
GoodsSpuVo getGoodsByOrgAndCode(@Param("orgPath")String orgPath,@Param("goodsCode")String goodsCode);
|
||||||
|
|
||||||
IPage<SalesGoodsVo> getGoodsForSales(IPage<GoodsSpu> page, @Param(Constants.WRAPPER) QueryWrapper<GoodsSpu> qw);
|
IPage<SalesGoodsVo> getGoodsForSales(IPage<GoodsSpu> page, @Param(Constants.WRAPPER) QueryWrapper<GoodsSpu> qw);
|
||||||
|
|||||||
@@ -25,7 +25,14 @@
|
|||||||
s.orgSidPath like concat('%',#{orgPath},'%') and a.isDelete !='1' and a.isEnable='1'
|
s.orgSidPath like concat('%',#{orgPath},'%') and a.isDelete !='1' and a.isEnable='1'
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listAllByQuery" resultType="com.yxt.goods.biz.goodsspu.GoodsSpuVo">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from goods_spu a
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
<select id="initialization" resultType="com.yxt.goods.biz.goodsspu.GoodsSpuVo">
|
<select id="initialization" resultType="com.yxt.goods.biz.goodsspu.GoodsSpuVo">
|
||||||
select DISTINCT
|
select DISTINCT
|
||||||
s.*,a.goodsTypeName as typeName,b.brandName as brandName,c.manufacturerName as manufacturerName
|
s.*,a.goodsTypeName as typeName,b.brandName as brandName,c.manufacturerName as manufacturerName
|
||||||
|
|||||||
@@ -39,4 +39,6 @@ public class GoodsSpuQuery implements Query {
|
|||||||
@ApiModelProperty("用户sid")
|
@ApiModelProperty("用户sid")
|
||||||
private String userSid;
|
private String userSid;
|
||||||
private int index;
|
private int index;
|
||||||
|
private String brandSid;
|
||||||
|
private String typeSid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,18 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
|||||||
List<GoodsSpuVo> pagging = baseMapper.listAll(query.getOrgPath());
|
List<GoodsSpuVo> pagging = baseMapper.listAll(query.getOrgPath());
|
||||||
return rb.success().setData(pagging);
|
return rb.success().setData(pagging);
|
||||||
}
|
}
|
||||||
|
public ResultBean<List<GoodsSpuVo>> listAllByQuery(GoodsSpuQuery query) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
QueryWrapper<GoodsSpu> qw = new QueryWrapper<>();
|
||||||
|
if(StringUtils.isNotBlank(query.getBrandSid())){
|
||||||
|
qw.eq("brandSid",query.getBrandSid());
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(query.getTypeSid())){
|
||||||
|
qw.eq("goodsTypeSid",query.getTypeSid());
|
||||||
|
}
|
||||||
|
List<GoodsSpuVo> vos=baseMapper.listAllByQuery(qw);
|
||||||
|
return rb.success().setData(vos);
|
||||||
|
}
|
||||||
@Transactional
|
@Transactional
|
||||||
public ResultBean<String> saveOrUpdate(GoodsSpuDto dto) {
|
public ResultBean<String> saveOrUpdate(GoodsSpuDto dto) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
|||||||
Reference in New Issue
Block a user