소스 검색

问答列表

wjj 1 주 전
부모
커밋
9ee54f8c0a

+ 6 - 10
fs-admin/src/main/java/com/fs/his/controller/FsQuestionAndAnswerController.java

@@ -5,14 +5,7 @@ import java.util.List;
 import com.fs.his.vo.OptionsVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -107,9 +100,12 @@ public class FsQuestionAndAnswerController extends BaseController
      * 查询问答列表
      */
     @GetMapping("/allList")
-    public TableDataInfo getHospital()
+    public TableDataInfo getHospital(@RequestParam(name = "type",required = false) Integer type)
     {
-        List<OptionsVO> list = fsQuestionAndAnswerService.selectAllQuestionOptions();
+        if (type == null) {
+            type = 1;
+        }
+        List<OptionsVO> list = fsQuestionAndAnswerService.selectAllQuestionOptions(type);
         return getDataTable(list);
     }
 }

+ 5 - 2
fs-company/src/main/java/com/fs/hisStore/controller/FsQuestionAndAnswerController.java

@@ -42,9 +42,12 @@ public class FsQuestionAndAnswerController extends BaseController
      * 查询问答列表
      */
     @GetMapping("/allList")
-    public TableDataInfo getHospital()
+    public TableDataInfo getHospital(@RequestParam(name = "type",required = false) Integer type)
     {
-        List<OptionsVO> list = fsQuestionAndAnswerService.selectAllQuestionOptions();
+        if (type == null) {
+            type = 1;
+        }
+        List<OptionsVO> list = fsQuestionAndAnswerService.selectAllQuestionOptions(type);
         return getDataTable(list);
     }
 }

+ 2 - 2
fs-service/src/main/java/com/fs/his/mapper/FsQuestionAndAnswerMapper.java

@@ -61,6 +61,6 @@ public interface FsQuestionAndAnswerMapper extends BaseMapper<FsQuestionAndAnswe
      */
     int deleteFsQuestionAndAnswerByIds(Long[] ids);
 
-    @Select("select id dictValue,question_name dictLabel from fs_question_and_answer  ")
-    List<OptionsVO> selectAllQuestionOptions();
+    @Select("select id dictValue,question_name dictLabel from fs_question_and_answer where type = #{type}")
+    List<OptionsVO> selectAllQuestionOptions(Integer type);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/his/service/IFsQuestionAndAnswerService.java

@@ -61,7 +61,7 @@ public interface IFsQuestionAndAnswerService extends IService<FsQuestionAndAnswe
      */
     int deleteFsQuestionAndAnswerById(Long id);
 
-    List<OptionsVO> selectAllQuestionOptions();
+    List<OptionsVO> selectAllQuestionOptions(Integer type);
 
     List<FsQuestionAndAnswerVO> selectFsQuestionAndAnswerVOList();
 }

+ 2 - 2
fs-service/src/main/java/com/fs/his/service/impl/FsQuestionAndAnswerServiceImpl.java

@@ -170,8 +170,8 @@ public class FsQuestionAndAnswerServiceImpl extends ServiceImpl<FsQuestionAndAns
     }
 
     @Override
-    public List<OptionsVO> selectAllQuestionOptions() {
-        return fsQuestionAndAnswerMapper.selectAllQuestionOptions();
+    public List<OptionsVO> selectAllQuestionOptions(Integer type) {
+        return fsQuestionAndAnswerMapper.selectAllQuestionOptions(type);
     }
 
     @Override

+ 5 - 2
fs-user-app/src/main/java/com/fs/app/controller/QuestionAndAnswerController.java

@@ -36,9 +36,12 @@ public class QuestionAndAnswerController {
      */
     @ApiOperation("问答列表")
     @GetMapping("/allList")
-    public R answerList()
+    public R answerList(@RequestParam(name = "type",required = false) Integer type)
     {
-        List<OptionsVO> list = questionAndAnswerService.selectAllQuestionOptions();
+        if (type == null) {
+            type = 1;
+        }
+        List<OptionsVO> list = questionAndAnswerService.selectAllQuestionOptions(type);
         return R.ok().put("data",list);
     }