update:修改法规释疑库查询详情

This commit is contained in:
sunzheng
2024-10-09 17:54:57 +08:00
parent 5792b75fe2
commit 19ff0e7493
@@ -167,21 +167,23 @@ public class LawsRegulationsQuestionLibraryServiceImpl extends ServiceImpl<LawsR
String regulationId1 = regulationIdList.get(i); String regulationId1 = regulationIdList.get(i);
String number = regulationNumberList.get(i); String number = regulationNumberList.get(i);
LawsDocumentSplit lawsDocumentSplit = documentSplitMapper.selectById(regulationId1); LawsDocumentSplit lawsDocumentSplit = documentSplitMapper.selectById(regulationId1);
regulationVo.setId(regulationId1); if (!Objects.isNull(lawsDocumentSplit)) {
regulationVo.setItemNum(lawsDocumentSplit.getItemNum()); regulationVo.setId(regulationId1);
regulationVo.setItemTitle(lawsDocumentSplit.getItemTitle()); regulationVo.setItemNum(lawsDocumentSplit.getItemNum());
regulationVo.setTitleTranslation(lawsDocumentSplit.getTitleTranslation()); regulationVo.setItemTitle(lawsDocumentSplit.getItemTitle());
regulationVo.setItemContent(lawsDocumentSplit.getItemContent()); regulationVo.setTitleTranslation(lawsDocumentSplit.getTitleTranslation());
regulationVo.setTranslation(lawsDocumentSplit.getTranslation()); regulationVo.setItemContent(lawsDocumentSplit.getItemContent());
// 找到最后一个空格的位置 regulationVo.setTranslation(lawsDocumentSplit.getTranslation());
int lastSpaceIndex = number.lastIndexOf(" "); // 找到最后一个空格的位置
// 确保空格存在并且位置不在字符串的开始或结束 int lastSpaceIndex = number.lastIndexOf(" ");
if (lastSpaceIndex != -1 && lastSpaceIndex < number.length() - 1) { // 确保空格存在并且位置不在字符串的开始或结束
String key = number.substring(0, lastSpaceIndex); if (lastSpaceIndex != -1 && lastSpaceIndex < number.length() - 1) {
regulationVo.setStandardNumber(key); String key = number.substring(0, lastSpaceIndex);
regulationVo.setStandardId(standardNumberMap.get(key)); regulationVo.setStandardNumber(key);
regulationVo.setStandardId(standardNumberMap.get(key));
}
regulationList.add(regulationVo);
} }
regulationList.add(regulationVo);
} }
lawsRegulationsQuestionLibrary.setRegulationList(regulationList); lawsRegulationsQuestionLibrary.setRegulationList(regulationList);
} }