| | |
| | | private FrequentlyAskedQuestionsService faqService; |
| | | |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | /** |
| | | * 添加常见问题 |
| | | */ |
| | | @RequestMapping("/base/question/addQuestion") |
| | | public Object addQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions){ |
| | | public Object addQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions) { |
| | | frequentlyAskedQuestions.setInsertTime(new Date()); |
| | | frequentlyAskedQuestions.setState(1); |
| | | return faqService.save(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 修改常见问题 |
| | | */ |
| | | @RequestMapping("/base/question/editQuestion") |
| | | public Object editQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions){ |
| | | public Object editQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions) { |
| | | return faqService.updateById(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 上/下架、删除常见问题 type=1为上架 2为下架 3为删除 |
| | | */ |
| | | @RequestMapping("/base/question/changeState") |
| | | public Object changeState(@RequestBody QuestionChangeStateVO vo){ |
| | | public Object changeState(@RequestBody QuestionChangeStateVO vo) { |
| | | return faqService.changeState(vo); |
| | | } |
| | | |
| | |
| | | * 查看详情 |
| | | */ |
| | | @RequestMapping("/base/question/getInfo") |
| | | public FrequentlyAskedQuestions getInfo(@RequestBody Integer id){ |
| | | public FrequentlyAskedQuestions getInfo(@RequestBody Integer id) { |
| | | return faqService.getInfo(id); |
| | | } |
| | | |
| | |
| | | * 编辑常见问题 |
| | | */ |
| | | @RequestMapping("/base/question/updateQuestion") |
| | | public Object updateQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions){ |
| | | public Object updateQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions) { |
| | | return faqService.updateById(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有常见问题 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/question/listAll") |
| | | public List<FrequentlyAskedQuestions> listAll(@RequestBody QuestionSearchVO vo){ |
| | | public List<FrequentlyAskedQuestions> listAll(@RequestBody QuestionSearchVO vo) { |
| | | QueryWrapper<FrequentlyAskedQuestions> frequentlyAskedQuestionsQueryWrapper = new QueryWrapper<>(); |
| | | if (vo.getState()!=null){ |
| | | frequentlyAskedQuestionsQueryWrapper.eq("state",vo.getState()); |
| | | if (vo.getState() != null) { |
| | | frequentlyAskedQuestionsQueryWrapper.eq("state", vo.getState()); |
| | | } |
| | | if (vo.getContent()!=null && !vo.getContent().equals("") ){ |
| | | frequentlyAskedQuestionsQueryWrapper.like("content",vo.getContent()); |
| | | if (vo.getContent() != null && !vo.getContent().equals("")) { |
| | | frequentlyAskedQuestionsQueryWrapper.like("content", vo.getContent()); |
| | | } |
| | | frequentlyAskedQuestionsQueryWrapper.ne("state",3); |
| | | frequentlyAskedQuestionsQueryWrapper.ne("state", 3); |
| | | frequentlyAskedQuestionsQueryWrapper.orderByDesc("sort"); |
| | | List<FrequentlyAskedQuestions> list = faqService.list(frequentlyAskedQuestionsQueryWrapper); |
| | | return list; |
| | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/notice/queryQuestionDetails") |
| | | public List<QuestionIns> getSysQuestionDetails(){ |
| | | public List<QuestionIns> getSysQuestionDetails() { |
| | | List<QuestionIns> sysS = new ArrayList<>(); |
| | | List<FrequentlyAskedQuestions> list = faqService.list(new QueryWrapper<FrequentlyAskedQuestions>() |
| | | .eq("state", 1) |
| | | .orderByDesc("insertTime")); |
| | | if (list.size() > 0 ){ |
| | | if (list.size() > 0) { |
| | | list.forEach(noList -> { |
| | | QuestionIns notice = new QuestionIns(); |
| | | notice.setQuesId(noList.getId()); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryQuestion") |
| | | public QuestionIns getSysQuestionBuId(@RequestParam("quesId") Integer quesId){ |
| | | public QuestionIns getSysQuestionBuId(@RequestParam("quesId") Integer quesId) { |
| | | QuestionIns sysNotice = new QuestionIns(); |
| | | FrequentlyAskedQuestions notice = faqService.getById(quesId); |
| | | if (null != notice){ |
| | | if (null != notice) { |
| | | sysNotice.setQuesId(notice.getId()); |
| | | sysNotice.setQuesTitle(notice.getContent()); |
| | | sysNotice.setQuesContents(notice.getAnswer()); |