|
|
|
@ -87,6 +87,9 @@ public class CompanyQnAnswerServiceImpl extends ServiceImpl<CompanyQnAnswerMappe
|
|
|
|
|
r.setAnswerOpt(null);
|
|
|
|
|
r.setAnswerCont(null);
|
|
|
|
|
}
|
|
|
|
|
if (kind == CompanyQnTitle.CompanyQnTitleKindMultiChoice){
|
|
|
|
|
r.setAnswerMultiOpt(i.getAnswerOpt().split(","));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
result.add(r);
|
|
|
|
|
}
|
|
|
|
@ -147,7 +150,7 @@ public class CompanyQnAnswerServiceImpl extends ServiceImpl<CompanyQnAnswerMappe
|
|
|
|
|
String answerOpt = null;
|
|
|
|
|
String answerCont = null;
|
|
|
|
|
JSONObject options = null;
|
|
|
|
|
if (Common.isContain(new int[]{CompanyQnTitle.CompanyQnTitleKindChoice, CompanyQnTitle.CompanyQnTitleKindPartnerChoice}, companyQnTitle.getKind())) {
|
|
|
|
|
if (Common.isContain(new int[]{CompanyQnTitle.CompanyQnTitleKindChoice, CompanyQnTitle.CompanyQnTitleKindPartnerChoice, CompanyQnTitle.CompanyQnTitleKindMultiChoice}, companyQnTitle.getKind())) {
|
|
|
|
|
try {
|
|
|
|
|
options = JSONObject.parseObject((String) companyQnTitle.getOptions());
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -198,6 +201,19 @@ public class CompanyQnAnswerServiceImpl extends ServiceImpl<CompanyQnAnswerMappe
|
|
|
|
|
}
|
|
|
|
|
super.saveBatch(list);
|
|
|
|
|
break;
|
|
|
|
|
case 4: // 多选题
|
|
|
|
|
String[] answerOpts = params.getAnswerMultiChoice();
|
|
|
|
|
if(answerOpts==null||answerOpts.length <=0){
|
|
|
|
|
return Result.err("回答为空");
|
|
|
|
|
}
|
|
|
|
|
for (String opt : answerOpts) {
|
|
|
|
|
answerCont = (String) options.get(opt);
|
|
|
|
|
if (null == opt || null == answerCont) {
|
|
|
|
|
return Result.err("选项不符");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
super.saveOrUpdate(companyQnAnswer.setAnswerOpt(String.join(",",answerOpts)), up);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return Result.err("未知题型");
|
|
|
|
|
}
|
|
|
|
@ -230,13 +246,13 @@ public class CompanyQnAnswerServiceImpl extends ServiceImpl<CompanyQnAnswerMappe
|
|
|
|
|
if (null == qn) {
|
|
|
|
|
return Result.err("未知问卷");
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<CompanyQnAnswerer> qw = new QueryWrapper<>();
|
|
|
|
|
qw.select("answerer_id").eq("qn_id", qnId);
|
|
|
|
|
IPage iPage = companyQnAnswererService.page(page, qw);
|
|
|
|
|
List<CompanyQnAnswerer> answererIds = iPage.getRecords();
|
|
|
|
|
QueryWrapper<CompanyQnAnswer> qw = new QueryWrapper<>();
|
|
|
|
|
qw.select("answerer_id").eq("qn_id", qnId).groupBy("answerer_id");
|
|
|
|
|
IPage iPage = super.page(page, qw);
|
|
|
|
|
List<CompanyQnAnswer> answererIds = iPage.getRecords();
|
|
|
|
|
Collection ids = new ArrayList<>();
|
|
|
|
|
if (answererIds.size() > 0) {
|
|
|
|
|
for (CompanyQnAnswerer i : answererIds) {
|
|
|
|
|
for (CompanyQnAnswer i : answererIds) {
|
|
|
|
|
ids.add(i.getAnswererId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -263,8 +279,10 @@ public class CompanyQnAnswerServiceImpl extends ServiceImpl<CompanyQnAnswerMappe
|
|
|
|
|
List<CompanyQnController.ResultPartnerChoice> list = partnerChoiceResultData(qnId, isManage ? false : (qn.getIsSecret() == 1), null);
|
|
|
|
|
for (CompanyQnController.ResultPartnerChoice resultPartnerChoice : list) {
|
|
|
|
|
Map map = new LinkedHashMap();
|
|
|
|
|
map.put("SourceId", resultPartnerChoice.getAnswererName());
|
|
|
|
|
map.put("TargetId", resultPartnerChoice.getQnTowardsName());
|
|
|
|
|
map.put("SourceId", resultPartnerChoice.getAnswererId());
|
|
|
|
|
map.put("SourceName", resultPartnerChoice.getAnswererName());
|
|
|
|
|
map.put("TargetId", resultPartnerChoice.getQnTowardsId());
|
|
|
|
|
map.put("TargetName", resultPartnerChoice.getQnTowardsName());
|
|
|
|
|
for (CompanyQnController.ResultAnswerPartnerChoice resultAnswerPartnerChoice : resultPartnerChoice.getAnswerPartnerChoice()) {
|
|
|
|
|
String title = "题目编号" + resultAnswerPartnerChoice.getTitleId().toString();
|
|
|
|
|
if (null != qnTitleMap.get(resultAnswerPartnerChoice.getTitleId())) {
|
|
|
|
|