| | |
| | | |
| | | import cc.mrbird.febs.common.core.constant.ModuleCode; |
| | | import cc.mrbird.febs.common.core.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.core.entity.system.Dic; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.core.utils.SequenceUtil; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | public IPage<DicItem> findDicItems(QueryRequest request, DicItem dicitem) { |
| | | LambdaQueryWrapper<DicItem> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DicItem::getDelFlag, 0); |
| | | queryWrapper.eq(DicItem::getDicId, dicitem.getDicId()); |
| | | if(StringUtils.isNotBlank(dicitem.getDicItemName())){ |
| | | queryWrapper.like(DicItem::getDicItemName, dicitem.getDicItemName()); |
| | | } |
| | | Page<DicItem> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return this.page(page, queryWrapper); |
| | | } |
| | |
| | | public List<DicItem> findDicItems(DicItem dicitem) { |
| | | LambdaQueryWrapper<DicItem> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DicItem::getDelFlag, 0); |
| | | queryWrapper.eq(DicItem::getDicCode,dicitem.getDicCode()); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | |
| | | public void deleteDicItem(DicItem dicitem) { |
| | | LambdaQueryWrapper<DicItem> wrapper = new LambdaQueryWrapper<>(); |
| | | // TODO 设置删除条件 |
| | | wrapper.eq(DicItem::getDicItemId, dicitem.getDicItemId()); |
| | | this.remove(wrapper); |
| | | } |
| | | |
| | |
| | | public void logicDelDicItem(String ids) { |
| | | String[] str = ids.split(","); |
| | | List<String> list = new ArrayList<>(Arrays.asList(str)); |
| | | dicitemMapper.logicDeleteByIds(list, operatorId); |
| | | for (String str1:list){ |
| | | LambdaQueryWrapper<DicItem> wrapper = new LambdaQueryWrapper<>(); |
| | | // TODO 设置删除条件 |
| | | wrapper.eq(DicItem::getDicItemId, str1); |
| | | this.remove(wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | redisService.del("dicItems"); |
| | | redisService.set("dicItems", dicItems); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<DicItem> getAllDicitemsAll() { |
| | | LambdaQueryWrapper<DicItem> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DicItem::getDelFlag, 0); |
| | | return this.baseMapper.selectList(queryWrapper); |
| | | } |
| | | } |