| | |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictItemRespVO; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mdk.vo.MergeItemVO; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | mmItemOutputService.deleteByItemId(predictItem.getId()); |
| | | List<MmItemOutputEntity> mmItemOutput = mmPredictItemDto.getMmItemOutputList(); |
| | | mmItemOutput.forEach(e -> { |
| | | e.setId(UUID.randomUUID().toString()); |
| | | e.setItemid(predictItem.getId()); |
| | | }); |
| | | mmItemOutputService.saveMmItemOutput(mmItemOutput); |
| | | if (!CollectionUtils.isEmpty(mmItemOutput)) { |
| | | mmItemOutput.forEach(e -> { |
| | | // 尽量保存原有id |
| | | if (StringUtils.isBlank(e.getId())) { |
| | | e.setId(UUID.randomUUID().toString()); |
| | | } |
| | | e.setItemid(predictItem.getId()); |
| | | }); |
| | | mmItemOutputService.saveMmItemOutput(mmItemOutput); |
| | | } |
| | | |
| | | |
| | | // 清空缓存 |
| | | clearCatch(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ItemVO getItemByOutPutId(String outPutId) { |
| | | if (StringUtils.isBlank(outPutId)) { |
| | | return null; |
| | | } |
| | | MmItemOutputEntity outPutById = mmItemOutputService.getOutPutById(outPutId); |
| | | if (ObjectUtils.isEmpty(outPutById)) { |
| | | return null; |
| | | } |
| | | String itemId = outPutById.getItemid(); |
| | | return getItemById(itemId); |
| | | } |
| | | |
| | | @Override |
| | | public MergeItemVO getMergeItemByItemId(String itemId) { |
| | | if (StringUtils.isBlank(itemId)) { |
| | | return null; |