|  |  |  | 
|---|
|  |  |  | 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++) { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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(),"商品状态不能为空"); | 
|---|
|  |  |  | 
|---|
|  |  |  | .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() | 
|---|