|
|
|
@@ -73,20 +73,24 @@ public class WxQuestionController extends BaseController { |
|
|
|
@ApiOperation("设置问券配置") |
|
|
|
@PostMapping("/api/answerQuestion") |
|
|
|
public Result answerQuestion(@RequestBody WxQuestionLog wxQuestionLog) { |
|
|
|
if (wxQuestionLog == null) |
|
|
|
if (wxQuestionLog == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
if (wxQuestionLog.getQuestionId() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
if (wxQuestionLog.getAnswer() == null) |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); |
|
|
|
|
|
|
|
String[] arys1 = wxQuestionLog.getAnswer().split(","); |
|
|
|
List<Long> as = new ArrayList<>(); |
|
|
|
for (int i = 0; i < arys1.length; i++) { |
|
|
|
as.add(Long.parseLong(arys1[i])); |
|
|
|
if (wxQuestionLog.getAnswer().isEmpty()) { |
|
|
|
wxQuestionLog.setAnswer(null); |
|
|
|
} else { |
|
|
|
String[] arys1 = wxQuestionLog.getAnswer().split(","); |
|
|
|
List<Long> as = new ArrayList<>(); |
|
|
|
for (int i = 0; i < arys1.length; i++) { |
|
|
|
as.add(Long.parseLong(arys1[i])); |
|
|
|
} |
|
|
|
wxQuestionLog.setAnswer(JSONObject.toJSONString(as)); |
|
|
|
} |
|
|
|
|
|
|
|
wxQuestionLog.setAnswer(JSONObject.toJSONString(as)); |
|
|
|
wxQuestionLog.setUserId(getUserId()); |
|
|
|
|
|
|
|
wxQuestionService.saveOrUpdateLog(wxQuestionLog); |
|
|
|
|