jiangping
2023-09-15 04d88ef5d6e9f4814ad16f51f1550bd5be7c6fe6
server/service/src/main/java/com/doumee/service/business/impl/BaseGoodsServiceImpl.java
@@ -168,12 +168,15 @@
        wrapper.lambda()
                .eq(BaseGoods::getId,baseGoods.getId())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName())
                .set(BaseGoods::getName,baseGoods.getName());
                .set(BaseGoods::getBrandId,baseGoods.getBrandId())
                .set(BaseGoods::getCategoryId,baseGoods.getCategoryId())
                .set(BaseGoods::getImgurl,baseGoods.getImgurl())
                .set(BaseGoods::getPrice,baseGoods.getPrice())
                .set(BaseGoods::getZdPrice,baseGoods.getZdPrice());
        baseGoodsMapper.update(null,wrapper);
        multifileMapper.delete(new QueryWrapper<Multifile>().eq("OBJ_ID",baseGoods.getId()));
        multifileMapper.delete(new QueryWrapper<Multifile>().eq("OBJ_ID",baseGoods.getId())
                                                            .eq("OBJ_TYPE",Constants.ONE));
        List<Multifile> multifileList = baseGoods.getMultifileList();
        if(!Objects.isNull(multifileList)&&multifileList.size()>Constants.ZERO){
            for (int i = 0; i < multifileList.size(); i++) {
@@ -217,13 +220,13 @@
        if (CollectionUtils.isEmpty(idList)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"商品状态不能为空");
        }
        idList.forEach(s->updateStatusByIds(s,status));
        idList.forEach(s->updateStatusById(s,status));
    }
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    @Override
    public void updateStatusByIds(Integer id, Integer status) {
    public void updateStatusById(Integer id, Integer status) {
        if (Objects.isNull(status)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"商品状态不能为空");
@@ -277,7 +280,8 @@
                .leftJoin(BaseCategory.class,BaseCategory::getId,BaseGoods::getBaseDataId)
                .selectAll(BaseGoods.class)
                .selectAs(Brand::getName,BaseGoodsDTO::getBrandName)
                .selectAs(BaseCategory::getSortnum,BaseGoodsDTO::getCategoryName);
                .selectAs(BaseCategory::getSortnum,BaseGoodsDTO::getCategoryName)
                .eq(BaseGoods::getId,id);
        BaseGoodsDTO baseGoodsDTO = baseGoodsJoinMapper.selectJoinOne(BaseGoodsDTO.class, queryWrapper);
        String prefixUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.FILE_DIR).getCode()