| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MmItemOutputEntity> getByItemid(String itemid, String resultstr, List<Integer> resultIndexs) { |
| | | QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("itemid", itemid) |
| | | .eq("resultstr", resultstr) |
| | | .in(!CollectionUtils.isEmpty(resultIndexs), "result_index", resultIndexs); |
| | | return mmItemOutputDao.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByItemId(String itemId) { |
| | | QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("itemid", itemId); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getItemIdByOut(List<String> outIds) { |
| | | List<String> result = new ArrayList<>(); |
| | | if (CollectionUtils.isEmpty(outIds)) { |
| | | return result; |
| | | } |
| | | QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.in("id", outIds); |
| | | List<MmItemOutputEntity> list = baseMapper.selectList(queryWrapper); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return result; |
| | | } |
| | | list.forEach(item -> { |
| | | result.add(item.getItemid()); |
| | | }); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public MmItemOutputEntity getOutPutById(String outputid) { |
| | | if (outputMap.containsKey(outputid)) { |
| | | return outputMap.get(outputid); |
| | | } |
| | | MmItemOutputEntity entity = mmItemOutputDao.selectById(outputid); |
| | | outputMap.put(outputid, entity); |
| | | return entity; |
| | | if (entity != null) { |
| | | outputMap.put(outputid, entity); |
| | | } |
| | | return outputMap.get(outputid); |
| | | } |
| | | } |