问答中心 我的回答 返回taskId
This commit is contained in:
+5
@@ -84,5 +84,10 @@ public class BusProcessNewController extends BaseAction {
|
||||
return iBusProcessNewService.selectWenDan(taskId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "问答中心 个人中心 我的问答 回答无taskID问题")
|
||||
@GetMapping("/questionsAndAnswers")
|
||||
public BusProcessNew questionsAndAnswers(@RequestParam("askId") String askId,@RequestParam("answerer") String answerer) {
|
||||
return iBusProcessNewService.questionsAndAnswers(askId,answerer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -45,4 +45,5 @@ public interface IBusProcessNewService extends IService<BusProcessNew> {
|
||||
|
||||
Map<String,Object> selectWenDan(String taskId);
|
||||
|
||||
BusProcessNew questionsAndAnswers(String askId, String answerer);
|
||||
}
|
||||
|
||||
+30
-3
@@ -132,11 +132,13 @@ public class BusProcessNewServiceImpl extends ServiceImpl<BusProcessNewMapper, B
|
||||
objectQueryWrapper.eq("TASK_ID",taskId);
|
||||
List<BusProcessNew> busProcessNews = baseMapper.selectList(objectQueryWrapper);
|
||||
if(!busProcessNews.isEmpty()){
|
||||
String mesg = busProcessNews.get(0).getMesg();
|
||||
String mesg = busProcessNews.get(0).getMesg();
|
||||
JSONObject jsonObject = JSON.parseObject(mesg);
|
||||
JSONObject askQuestions = jsonObject.getJSONObject("askQuestions");
|
||||
String id = askQuestions.getString("id");
|
||||
return id;
|
||||
if(askQuestions!=null) {
|
||||
String id = askQuestions.getString("id");
|
||||
return id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -155,4 +157,29 @@ public class BusProcessNewServiceImpl extends ServiceImpl<BusProcessNewMapper, B
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusProcessNew questionsAndAnswers(String askId, String answerer) {
|
||||
QueryWrapper<BusProcessNew> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("USER_ID",answerer);
|
||||
objectQueryWrapper.eq("TASK_INFO","问答中心回答");
|
||||
objectQueryWrapper.groupBy("P_ID");
|
||||
List<BusProcessNew> busProcessNews = baseMapper.selectList(objectQueryWrapper);
|
||||
if(!busProcessNews.isEmpty()){
|
||||
for (BusProcessNew data: busProcessNews){
|
||||
JSONObject jsonObject = JSON.parseObject(data.getMesg());
|
||||
JSONObject askQuestions = jsonObject.getJSONObject("askQuestions");
|
||||
if(askQuestions!=null) {
|
||||
String id = askQuestions.getString("id");
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
if (id.equals(askId)) {
|
||||
//返回当前数据
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user