update:修改标准问答bug
This commit is contained in:
+13
-4
@@ -10,6 +10,7 @@ import com.adc.da.util.http.Result;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -37,18 +38,26 @@ public class ReplyController extends BaseController<Reply> {
|
|||||||
|
|
||||||
@PostMapping("/insertReply")
|
@PostMapping("/insertReply")
|
||||||
public ResponseMessage insertReply(@RequestBody Reply reply){
|
public ResponseMessage insertReply(@RequestBody Reply reply){
|
||||||
reply.setAppendixId(reply.getFileList().get(0).getAttId());
|
if(StringUtils.isEmpty(reply.getReply())){
|
||||||
reply.setAppendixName(reply.getFileList().get(0).getName());
|
return Result.error("-1","请输入回答内容");
|
||||||
|
}
|
||||||
|
if(reply.getFileList().size() >0) {
|
||||||
|
reply.setAppendixId(reply.getFileList().get(0).getAttId());
|
||||||
|
reply.setAppendixName(reply.getFileList().get(0).getName());
|
||||||
|
}
|
||||||
reply.setReplyTime(new Date());
|
reply.setReplyTime(new Date());
|
||||||
reply.setId(UUIDUtils.randomUUID20());
|
reply.setId(UUIDUtils.randomUUID20());
|
||||||
if(replyService.save(reply)){
|
if(replyService.save(reply)){
|
||||||
return Result.success("200","添加成功");
|
return Result.success("200","提交成功");
|
||||||
}else {
|
}else {
|
||||||
return Result.error("200","添加失败");
|
return Result.error("-1","添加失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@PostMapping("/updateReply")
|
@PostMapping("/updateReply")
|
||||||
public ResponseMessage updateReply(String id){
|
public ResponseMessage updateReply(String id){
|
||||||
|
if(StringUtils.isEmpty(id)){
|
||||||
|
return Result.error("-1","请选择要归档的回答");
|
||||||
|
}
|
||||||
List<String> list = Arrays.asList(id.split(","));
|
List<String> list = Arrays.asList(id.split(","));
|
||||||
for (String s: list) {
|
for (String s: list) {
|
||||||
UpdateWrapper updateWrapper = new UpdateWrapper();
|
UpdateWrapper updateWrapper = new UpdateWrapper();
|
||||||
|
|||||||
@@ -68,17 +68,20 @@
|
|||||||
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME
|
SELECT reply.ID, reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,reply.APPENDIX_ID,APPENDIX_NAME
|
||||||
FROM reply
|
FROM reply
|
||||||
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
LEFT JOIN ts_user t2 ON t2.USID = reply.ANSWERER
|
||||||
<where>
|
<where>
|
||||||
<if test="id !=null and id !=''">
|
<if test="id !=null and id !=''">
|
||||||
AND reply.ASK_ID = #{id}
|
AND reply.ASK_ID = #{id}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by reply.REPLY_TIME
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getReplyDetails" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
<select id="getReplyDetails" resultType="com.adc.da.slrs.StandardQA.entity.AskQuestions">
|
||||||
SELECT aq.ID,aq.CLASSIFICATION,aq.PROBLEM_DESCRIPTION,t1.UNAME QUESTIONER,aq.QUESTION_TIME,aq.STANDARD_ENCDOING,
|
SELECT
|
||||||
aq.STANDARD_NAME,aq.STANDARD_ID,reply.REPLY,reply.REPLY_TIME,t2.UNAME ANSWERER,
|
DISTINCT
|
||||||
reply.APPENDIX,reply.APPENDIX_ID,reply.APPENDIX_NAME
|
aq.STANDARD_ID,aq.CLASSIFICATION,aq.STANDARD_ENCDOING,
|
||||||
|
aq.STANDARD_NAME
|
||||||
FROM ask_questions aq
|
FROM ask_questions aq
|
||||||
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
LEFT JOIN reply ON aq.ID = reply.ASK_ID AND reply.STATE = '0'
|
||||||
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
LEFT JOIN ts_user t1 ON t1.USID = aq.QUESTIONER
|
||||||
|
|||||||
Reference in New Issue
Block a user