| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.AreasMapper; |
| | | import com.doumee.dao.business.GoodsMapper; |
| | | import com.doumee.dao.business.GoodsorderMapper; |
| | | import com.doumee.dao.business.LabelsMapper; |
| | | import com.doumee.dao.business.join.GoodsAdminJoinMapper; |
| | | import com.doumee.dao.business.join.LabelsJoinMapper; |
| | |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private GoodsAdminJoinMapper goodsAdminJoinMapper; |
| | | private GoodsMapper goodsMapper; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | .in(Constants.equalsInteger(labels.getType(),Constants.LabelsType.YUN_FEE.getKey()),Areas::getId,labels.getAreaIdList()) |
| | | .in(Constants.equalsInteger(labels.getType(),Constants.LabelsType.BIG_AREA.getKey()),Areas::getId,labels.getAreaIdList())); |
| | | areasService.cacheData(); |
| | | } |
| | | if(Constants.equalsInteger(labels.getType(),Constants.LabelsType.HOMEZHUANQU.getKey())){ |
| | | String ids = "["+labels.getId()+"],"; |
| | | // goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | // .setSql("zhuanqu_Ids =REPLACE(zhuanqu_Ids, '"+ids+"', '')")); |
| | | if( labels.getApplyIdList()!=null && labels.getApplyIdList().size()>0){ |
| | | // List<Goods> goods = goodsMapper.selectList(new QueryWrapper<Goods>().lambda().in(Goods::getId,labels.getApplyIdList() )); |
| | | goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | .setSql("zhuanqu_Ids =concat(ifnull(zhuanqu_Ids,''), '"+ids+"' )") |
| | | .in(Goods::getId,labels.getApplyIdList() )); |
| | | } |
| | | } |
| | | return labels.getId(); |
| | | } |
| | |
| | | } |
| | | if(num>0){ |
| | | areasService.cacheData(); |
| | | } |
| | | } |
| | | if(Constants.equalsInteger(labels.getType(),Constants.LabelsType.HOMEZHUANQU.getKey())){ |
| | | String ids = "["+labels.getId()+"],"; |
| | | goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | .setSql("zhuanqu_Ids =REPLACE(zhuanqu_Ids, '"+ids+"', '')")); |
| | | if( labels.getApplyIdList()!=null && labels.getApplyIdList().size()>0){ |
| | | goodsMapper.update(null,new UpdateWrapper<Goods>().lambda() |
| | | .setSql("zhuanqu_Ids =concat(ifnull(zhuanqu_Ids,''), '"+ids+"' )") |
| | | .in(Goods::getId,labels.getApplyIdList() )); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if(StringUtils.isNotBlank(model.getImgurl())){ |
| | | model.setImgFullurl(path + model.getImgurl()); |
| | | model.setImgurlfull(path + model.getImgurl()); |
| | | } |
| | | if(Constants.equalsInteger(model.getType(),Constants.LabelsType.BIG_AREA.getKey()) |
| | | || Constants.equalsInteger(model.getType(),Constants.LabelsType.YUN_FEE.getKey())){ |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<LabelsResponse> getGoodsLabelsByType(Integer type) { |
| | | public List<LabelsResponse> getGoodsLabelsByType(Integer type,Integer parentId) { |
| | | LambdaQueryWrapper<Labels> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(Labels::getStatus,Constants.ZERO); |
| | | wrapper.eq(Labels::getStatus,Constants.ONE); |
| | | wrapper.eq(Labels::getIsdeleted,Constants.ZERO); |
| | | wrapper.eq(Objects.nonNull(parentId),Labels::getParentId,parentId); |
| | | wrapper.eq(Labels::getType,type); |
| | | wrapper.orderByAsc(Labels::getSortnum,Labels::getCreateDate); |
| | | List<Labels> labels = labelsMapper.selectList(wrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS,Constants.LABELS_IMG).getCode(); |
| | | List<LabelsResponse> collect = labels.stream().map(s -> { |
| | | LabelsResponse labelsResponse = new LabelsResponse(); |
| | | BeanUtils.copyProperties(s, labelsResponse); |
| | | if(StringUtils.isNotBlank(s.getImgurl())){ |
| | | labelsResponse.setImgUrl(path + s.getImgurl()); |
| | | } |
| | | return labelsResponse; |
| | | }).collect(Collectors.toList()); |
| | | return collect; |