Merge remote-tracking branch 'origin/dev_20230216' into dev_20230216
This commit is contained in:
+2
-2
@@ -157,8 +157,8 @@ public class AskQuestionsController extends BaseController<AskQuestions> {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAskQuestionsByakId")
|
||||
public ResponseMessage getAskQuestionsByakId(String id,String state){
|
||||
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id,state);
|
||||
public ResponseMessage getAskQuestionsByakId(String id,String state,String userId){
|
||||
List<Reply> askQuestionsList = askQuestionsService.getAskQuestionsByakId(id,state,userId);
|
||||
return Result.success(askQuestionsList);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ public class ReplyController extends BaseController<Reply> {
|
||||
return Result.error("-1","编辑失败",null);
|
||||
}
|
||||
for(Reply reply: replyList){
|
||||
reply.setAnswerer(reply.getAnswererId());
|
||||
reply.setState("yes");
|
||||
}
|
||||
replyService.updateBatchById(replyList);
|
||||
|
||||
@@ -39,4 +39,10 @@ public interface AskQuestionsDao extends BaseMapper<AskQuestions> {
|
||||
List<Reply> getAskQuestionsByakId (@Param("id") String id,@Param("state") String state);
|
||||
|
||||
List<String> getUId();
|
||||
|
||||
String selectByRId(@Param("id") String id);
|
||||
|
||||
String selectBYAQId(@Param("id") String id);
|
||||
|
||||
List<Reply> getAskQuestionsById(@Param("id") String id);
|
||||
}
|
||||
|
||||
@@ -71,4 +71,6 @@ public class Reply extends BaseEntity {
|
||||
|
||||
@TableField(exist = false)
|
||||
private String taskId;
|
||||
@TableField(exist = false)
|
||||
private String answererId;
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public interface AskQuestionsService extends IService<AskQuestions> {
|
||||
|
||||
List<AskQuestions> getAskQuestionsByStandardId(String standardId);
|
||||
List<AskQuestions> getArchiveAskQuestions(String id);
|
||||
List<Reply> getAskQuestionsByakId(String id,String state);
|
||||
List<Reply> getAskQuestionsByakId(String id,String state,String userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+12
-2
@@ -8,6 +8,8 @@ import com.adc.da.slrs.StandardQA.entity.AskQuestionsPage;
|
||||
import com.adc.da.slrs.StandardQA.entity.AskQuestionsReplyVO;
|
||||
import com.adc.da.slrs.StandardQA.entity.Reply;
|
||||
import com.adc.da.slrs.StandardQA.service.AskQuestionsService;
|
||||
import com.adc.da.slrs.sarUser.entity.UpDTO;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -39,6 +41,9 @@ public class AskQuestionsServiceImpl extends ServiceImpl<AskQuestionsDao, AskQue
|
||||
@Autowired
|
||||
private ReplyDao replyDao;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService userService;
|
||||
|
||||
@Override
|
||||
public List<AskQuestions> getAskQuestions(AskQuestions askQuestions) {
|
||||
return askQuestionsDao.getAskQuestions(askQuestions);
|
||||
@@ -113,8 +118,13 @@ public class AskQuestionsServiceImpl extends ServiceImpl<AskQuestionsDao, AskQue
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Reply> getAskQuestionsByakId(String id,String state) {
|
||||
return askQuestionsDao.getAskQuestionsByakId(id,state);
|
||||
public List<Reply> getAskQuestionsByakId(String id,String state,String userId) {
|
||||
String questioner = askQuestionsDao.selectBYAQId(id);
|
||||
String answerer = askQuestionsDao.selectByRId(id);
|
||||
if (userId.equals(questioner)||userId.equals(answerer)){
|
||||
return askQuestionsDao.getAskQuestionsByakId(id,state);
|
||||
}
|
||||
return askQuestionsDao.getAskQuestionsById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsByakId" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME,reply.state
|
||||
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME as ANSWERER,t2.USID as `answererId`,reply.APPENDIX_ID,APPENDIX_NAME,reply.state
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
@@ -266,5 +266,43 @@
|
||||
order by QUESTION_TIME desc
|
||||
</select>
|
||||
|
||||
<select id="selectByRId" resultType="java.lang.String">
|
||||
SELECT reply.ANSWERER
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
<if test="id != null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
limit 1
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBYAQId" resultType="java.lang.String">
|
||||
SELECT ask_questions.QUESTIONER
|
||||
FROM ask_questions
|
||||
LEFT JOIN ts_user t2 ON t2.USID = ask_questions.QUESTIONER
|
||||
left join reply on reply.ASK_ID = ask_questions.ID
|
||||
<where>
|
||||
<if test="id != null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
limit 1
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAskQuestionsById" resultType="com.adc.da.slrs.StandardQA.entity.Reply">
|
||||
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME,reply.state
|
||||
FROM reply
|
||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||
<where>
|
||||
<if test="id !=null and id !=''">
|
||||
AND reply.ASK_ID = #{id}
|
||||
</if>
|
||||
AND reply.state = 'yes'
|
||||
</where>
|
||||
order by reply.REPLY_TIME
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user