添加多选题最多最少选项设置,及对应的更新SQL

This commit is contained in:
wkeyuan 2022-01-18 20:22:58 +08:00
parent 2032bcbfc9
commit 44a4ce7ead
4 changed files with 16 additions and 16 deletions

View File

@ -62,6 +62,8 @@ public class QuCheckboxController {
String cellCount=request.getParameter("cellCount");
String contactsAttr=request.getParameter("contactsAttr");
String contactsField=request.getParameter("contactsField");
String paramInt01=request.getParameter("paramInt01");//最小分
String paramInt02=request.getParameter("paramInt02");//最大分
if("".equals(quId)){
quId=null;
}
@ -79,12 +81,16 @@ public class QuCheckboxController {
randOrder=(randOrder==null || "".equals(randOrder))?"0":randOrder;
cellCount=(cellCount==null || "".equals(cellCount))?"0":cellCount;
contactsAttr=(contactsAttr==null || "".equals(contactsAttr))?"0":contactsAttr;
paramInt01=(paramInt01==null || "".equals(paramInt01))?"0":paramInt01;
paramInt02=(paramInt02==null || "".equals(paramInt02))?"0":paramInt02;
entity.setContactsAttr(Integer.parseInt(contactsAttr));
entity.setContactsField(contactsField);
entity.setIsRequired(Integer.parseInt(isRequired));
entity.setHv(Integer.parseInt(hv));
entity.setRandOrder(Integer.parseInt(randOrder));
entity.setCellCount(Integer.parseInt(cellCount));
entity.setParamInt01(Integer.parseInt(paramInt01));
entity.setParamInt02(Integer.parseInt(paramInt02));
Map<String, Object> optionNameMap=WebUtils.getParametersStartingWith(request, "optionValue_");
List<QuCheckbox> quCheckboxs=new ArrayList<QuCheckbox>();
for (String key : optionNameMap.keySet()) {

View File

@ -53,9 +53,9 @@ public class Question extends IdEntity{
//说明的验证方式
private CheckType checkType;
// 枚举题 枚举项数目 ,评分题起始分值
private Integer paramInt01 = 3;
private Integer paramInt01 = 0;
//评分题最大分值
private Integer paramInt02 = 10;
private Integer paramInt02 = 0;
//是否显示 0不显示 1显示
private Integer visibility=1;

View File

@ -9,7 +9,7 @@ import net.diaowen.dwsurvey.entity.DataCross;
import net.diaowen.dwsurvey.entity.Question;
import net.diaowen.dwsurvey.entity.SurveyDirectory;
import net.diaowen.dwsurvey.entity.SurveyStats;
import net.diaowen.dwsurvey.service.AnScoreManager;
import net.diaowen.dwsurvey.service.*;
import net.sf.json.JSONArray;
import org.hibernate.criterion.Criterion;
@ -19,17 +19,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import net.diaowen.common.service.BaseServiceImpl;
import net.diaowen.dwsurvey.service.AnAnswerManager;
import net.diaowen.dwsurvey.service.AnCheckboxManager;
import net.diaowen.dwsurvey.service.AnDFillblankManager;
import net.diaowen.dwsurvey.service.AnEnumquManager;
import net.diaowen.dwsurvey.service.AnFillblankManager;
import net.diaowen.dwsurvey.service.AnOrderManager;
import net.diaowen.dwsurvey.service.AnRadioManager;
import net.diaowen.dwsurvey.service.AnYesnoManager;
import net.diaowen.dwsurvey.service.QuestionManager;
import net.diaowen.dwsurvey.service.SurveyAnswerManager;
import net.diaowen.dwsurvey.service.SurveyStatsManager;
/**
@ -67,6 +56,8 @@ public class SurveyStatsManagerImpl extends
private AnScoreManager anScoreManager;
@Autowired
private AnOrderManager anOrderManager;
@Autowired
private AnUploadFileManager anUploadFileManager;
@Override
public void setBaseDao() {
@ -135,7 +126,6 @@ public class SurveyStatsManagerImpl extends
if (QuType.YESNO == quType) {// 是非题
anYesnoManager.findGroupStats(question);
} else if (QuType.RADIO == quType || QuType.COMPRADIO == quType) {// 单选
// 复合单选
anRadioManager.findGroupStats(question);
} else if (QuType.CHECKBOX == quType
|| QuType.COMPCHECKBOX == quType) {// 多选 复合多选
@ -150,8 +140,10 @@ public class SurveyStatsManagerImpl extends
anEnumquManager.findGroupStats(question);
} else if (QuType.SCORE == quType) {// 评分题
anScoreManager.findGroupStats(question);
} else if (QuType.ORDERQU == quType) {
} else if (QuType.ORDERQU == quType) {
anOrderManager.findGroupStats(question);
} else if (QuType.UPLOADFILE == quType) {
anUploadFileManager.findGroupStats(question);
}
}

View File

@ -0,0 +1,2 @@
/** 升级到5.2.2 建议执行一下以下SQ更新参数 **/
update t_question set param_int01=0,param_int02=0 where qu_type='2' and param_int01=3 and param_int02=10;