|
@@ -52,7 +52,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
|
|
|
}
|
|
|
|
|
|
- IntroduceDTO introduceDTO = this.getRecordById(introduceMap.getIntroduceId());
|
|
|
+ IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
|
|
|
return introduceDTO;
|
|
|
}
|
|
|
|
|
@@ -84,17 +84,18 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
|
|
|
}
|
|
|
|
|
|
- IntroduceDTO introduceDTO = this.getRecordById(introduceMap.getIntroduceId());
|
|
|
+ IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
|
|
|
return introduceDTO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据id获取提示信息
|
|
|
+ * 获取指定位置提示信息
|
|
|
*
|
|
|
* @param id
|
|
|
+ * @param position
|
|
|
* @return
|
|
|
*/
|
|
|
- public IntroduceDTO getRecordById(Long id) {
|
|
|
+ public IntroduceDTO getRecordByIdAndPosition(Long id, Integer position) {
|
|
|
IntroduceDTO introduceDTO = new IntroduceDTO();
|
|
|
IntroduceInfo introduceInfo = this.getById(id);
|
|
|
if (introduceInfo == null) {
|
|
@@ -104,7 +105,12 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
}
|
|
|
BeanUtil.copyProperties(introduceInfo, introduceDTO);
|
|
|
|
|
|
+
|
|
|
QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
|
|
|
+ //展示位置
|
|
|
+ if (position != null) {
|
|
|
+ introduceDetailQueryWrapper.apply("find_in_set({0},position)", position);
|
|
|
+ }
|
|
|
introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
|
eq("introduce_id", introduceInfo.getId()).
|
|
|
orderByAsc("order_no");
|
|
@@ -112,4 +118,14 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
|
introduceDTO.setIntroduceDetailList(introduceDetailList);
|
|
|
return introduceDTO;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据id获取提示信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public IntroduceDTO getRecordById(Long id) {
|
|
|
+ return getRecordByIdAndPosition(id, null);
|
|
|
+ }
|
|
|
}
|