销售订单选择商品
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
package com.yxt.goods.apiadmin;
|
package com.yxt.goods.apiadmin;
|
||||||
|
|
||||||
import com.yxt.goods.biz.goodsbrandinfo.GoodsBrandInfo;
|
import com.yxt.goods.biz.goodsbrandinfo.GoodsBrandInfo;
|
||||||
import com.yxt.goods.biz.goodsspu.GoodsSpuDto;
|
import com.yxt.goods.biz.goodsspu.*;
|
||||||
import com.yxt.goods.biz.goodsspu.GoodsSpuQuery;
|
|
||||||
import com.yxt.goods.biz.goodsspu.GoodsSpuService;
|
|
||||||
import com.yxt.goods.biz.goodsspu.GoodsSpuVo;
|
|
||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
@@ -30,6 +27,13 @@ public class GoodsSpuRest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
GoodsSpuService goodsSpuService;
|
GoodsSpuService goodsSpuService;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("销售订单获取商品")
|
||||||
|
@PostMapping("/getGoodsForSales")
|
||||||
|
public ResultBean<PagerVo<SalesGoodsVo>> getGoodsForSales(@RequestBody PagerQuery<SalesGoodsQuery> pq) {
|
||||||
|
return goodsSpuService.getGoodsForSales(pq);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("分页列表")
|
@ApiOperation("分页列表")
|
||||||
@PostMapping("/listPage")
|
@PostMapping("/listPage")
|
||||||
public ResultBean<PagerVo<GoodsSpuVo>> listPage(@RequestBody PagerQuery<GoodsSpuQuery> pq) {
|
public ResultBean<PagerVo<GoodsSpuVo>> listPage(@RequestBody PagerQuery<GoodsSpuQuery> pq) {
|
||||||
|
|||||||
@@ -21,4 +21,6 @@ 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);
|
||||||
|
|
||||||
|
IPage<SalesGoodsVo> getGoodsForSales(IPage<GoodsSpu> page, @Param(Constants.WRAPPER) QueryWrapper<GoodsSpu> qw);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,20 @@
|
|||||||
left join goods_manufacturer c on c.sid=s.manufacturerSid
|
left join goods_manufacturer c on c.sid=s.manufacturerSid
|
||||||
where s.sid=#{sid}
|
where s.sid=#{sid}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getGoodsForSales" resultType="com.yxt.goods.biz.goodsspu.SalesGoodsVo">
|
||||||
|
select
|
||||||
|
s.sid as goodSpuSid,
|
||||||
|
s.goodsName as goodsSpuName,
|
||||||
|
sku.sid as goodsSkuSid,
|
||||||
|
sku.goodsSkuCode,
|
||||||
|
sku.title as goodsSkuTitle,
|
||||||
|
s.goodsUnitName as unit
|
||||||
|
from goods_spu s
|
||||||
|
left join goods_sku sku on a.sid = sku.goodsSpuSid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
<update id="updateBySidIsDelete">
|
<update id="updateBySidIsDelete">
|
||||||
UPDATE goods_spu
|
UPDATE goods_spu
|
||||||
SET isDelete=1
|
SET isDelete=1
|
||||||
@@ -42,4 +56,4 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -485,4 +485,21 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
|||||||
}
|
}
|
||||||
return goodsSpuDto;
|
return goodsSpuDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean<PagerVo<SalesGoodsVo>> getGoodsForSales(PagerQuery<SalesGoodsQuery> pq) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
SalesGoodsQuery query = pq.getParams();
|
||||||
|
QueryWrapper<GoodsSpu> qw = new QueryWrapper<>();
|
||||||
|
if (StringUtils.isNotBlank(query.getGoodsName())) {
|
||||||
|
qw.like("s.goodsName", query.getGoodsName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getCreateOrgSid())) {
|
||||||
|
qw.like("s.createOrgSid", query.getCreateOrgSid());
|
||||||
|
}
|
||||||
|
qw.ne("s.isDelete","1");
|
||||||
|
IPage<GoodsSpu> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<SalesGoodsVo> pagging = baseMapper.getGoodsForSales(page, qw);
|
||||||
|
PagerVo<SalesGoodsVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return rb.success().setData(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.yxt.goods.biz.goodsspu;
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Fan
|
||||||
|
* @description
|
||||||
|
* @date 2024/7/19 17:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SalesGoodsQuery implements Query {
|
||||||
|
private String goodsName;
|
||||||
|
private String createOrgSid;
|
||||||
|
}
|
||||||
62
src/main/java/com/yxt/goods/biz/goodsspu/SalesGoodsVo.java
Normal file
62
src/main/java/com/yxt/goods/biz/goodsspu/SalesGoodsVo.java
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yxt.goods.biz.goodsspu;
|
||||||
|
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Fan
|
||||||
|
* @description
|
||||||
|
* @date 2024/7/19 17:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SalesGoodsVo implements Vo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 辅单位数量
|
||||||
|
*/
|
||||||
|
private String auxiliaryUnit;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private String count;
|
||||||
|
/**
|
||||||
|
* 商品基础信息Sid
|
||||||
|
*/
|
||||||
|
private String goodSpuSid;
|
||||||
|
/**
|
||||||
|
* 商品编码
|
||||||
|
*/
|
||||||
|
private String goodsSkuCode;
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
private String goodsSkuOwnSpec;
|
||||||
|
/**
|
||||||
|
* 商品Skusid
|
||||||
|
*/
|
||||||
|
private String goodsSkuSid;
|
||||||
|
/**
|
||||||
|
* 商品Sku名称
|
||||||
|
*/
|
||||||
|
private String goodsSkuTitle;
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String goodsSpuName;
|
||||||
|
/**
|
||||||
|
* 销售单价
|
||||||
|
*/
|
||||||
|
private String price;
|
||||||
|
/**
|
||||||
|
* 计量单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 体积(立方米)
|
||||||
|
*/
|
||||||
|
private String volume;
|
||||||
|
/**
|
||||||
|
* 重量(kg)
|
||||||
|
*/
|
||||||
|
private String weight;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user