goods
This commit is contained in:
@@ -60,6 +60,14 @@ public class GoodsSpuRest {
|
||||
public ResultBean delete(@PathVariable("sid") String sid) {
|
||||
return goodsSpuService.delete(sid);
|
||||
}
|
||||
|
||||
@ApiOperation("根据sid批量删除")
|
||||
@DeleteMapping("/delBySids")
|
||||
public ResultBean delBySids(@RequestBody String[] sids){
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
goodsSpuService.delAll(sids);
|
||||
return rb.success();
|
||||
}
|
||||
@ApiOperation("更改可用状态")
|
||||
@GetMapping("/updateIsEnable/{sid}/{isEnable}")
|
||||
public ResultBean updateIsEnable(@PathVariable("sid") String sid,@PathVariable("isEnable")String isEnable) {
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/2/26 13:40
|
||||
@@ -16,4 +18,5 @@ public interface GoodsSpuMapper extends BaseMapper<GoodsSpu> {
|
||||
|
||||
IPage<GoodsSpuVo> listPage(IPage<GoodsSpu> page, @Param(Constants.WRAPPER) QueryWrapper<GoodsSpu> qw);
|
||||
GoodsSpuVo initialization(@Param("sid")String sid);
|
||||
int updateBySidIsDelete(List<String> list);
|
||||
}
|
||||
|
||||
@@ -24,4 +24,12 @@
|
||||
left join goods_manufacturer c on c.sid=s.manufacturerSid
|
||||
where s.sid=#{sid}
|
||||
</select>
|
||||
<update id="updateBySidIsDelete">
|
||||
UPDATE goods_spu
|
||||
SET isDelete=1
|
||||
where sid in
|
||||
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -79,6 +79,7 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
||||
// if(StringUtils.isNotBlank(query.getUserOrgSid())){
|
||||
// qw.eq("userOrgSid",query.getUserOrgSid());
|
||||
// }
|
||||
qw.ne("s.isDelete","1");
|
||||
IPage<GoodsSpu> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsSpuVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsSpuVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
@@ -200,7 +201,9 @@ public class GoodsSpuService extends MybatisBaseService<GoodsSpuMapper, GoodsSpu
|
||||
}
|
||||
return rb.success();
|
||||
}
|
||||
|
||||
public void delAll(String[] sids) {
|
||||
int count = baseMapper.updateBySidIsDelete(Arrays.stream(sids).collect(Collectors.toList()));
|
||||
}
|
||||
public ResultBean updateIsEnable(String sid, String isEnable) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
GoodsSpu wmsGoods = fetchBySid(sid);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GoodsUnitService extends MybatisBaseService<GoodsUnitMapper, GoodsU
|
||||
if(StringUtils.isNotBlank(query.getName())){
|
||||
qw.like("unitName",query.getName());
|
||||
}
|
||||
|
||||
qw.ne("isDelete","1");
|
||||
IPage<GoodsUnit> page = PagerUtil.queryToPage(pq);
|
||||
IPage<GoodsUnitVo> pagging = baseMapper.listPage(page, qw);
|
||||
PagerVo<GoodsUnitVo> p = PagerUtil.pageToVo(pagging, null);
|
||||
|
||||
Reference in New Issue
Block a user