| | |
| | | import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO; |
| | | import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemOutputService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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 MmItemOutputEntity getByItemid(String itemid, String resultstr, Integer resultIndex) { |
| | | public MmItemOutputEntity getByItemid(String itemid, String resultstr, String resultIndex) { |
| | | QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("itemid", itemid) |
| | | .eq("resultstr", resultstr) |
| | | .eq("result_index", resultIndex); |
| | | .eq(StringUtils.isNotBlank(resultIndex), "result_index", resultIndex); |
| | | return mmItemOutputDao.selectOne(queryWrapper); |
| | | } |
| | | |
| | | @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 |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | } |