Browse Source

问卷问题修改

wangjun 4 years ago
parent
commit
a6d53352c4

+ 3 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/survey/service/SurveyService.java

@ -398,7 +398,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
            //设置选项
            for(WlyySurveyTemplateQuestionVO tq:tqVOs){
                List<WlyySurveyTemplateOptionDO> optionDOs  = surveyTemplateOptionDao.findByQuestionCodeAndDelOrderBySortAsc(tq.getId(),tq.getTemplateCode(),"1");
                List<WlyySurveyTemplateOptionDO> optionDOs  = surveyTemplateOptionDao.findByQuestionCodeAndDelOrderBySortAsc(tq.getCode(),tq.getTemplateCode(),"1");
                List<WlyySurveyTemplateOptionVO> optionVOs = new ArrayList<>();
                convertToModels(optionDOs,optionVOs,WlyySurveyTemplateOptionVO.class);
                tq.setOptionVOs(optionVOs);
@ -448,7 +448,6 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
            List<WlyySurveyTemplateQuestionDO> questions = EntityUtils.jsonToList(tempQJson, WlyySurveyTemplateQuestionDO.class);
            for (WlyySurveyTemplateQuestionDO wlyySurveyTemplateQuestionDO:questions){
                wlyySurveyTemplateQuestionDO.setTemplateCode(temp.getId());
                wlyySurveyTemplateQuestionDO.setTitle(temp.getTitle());
                wlyySurveyTemplateQuestionDO.setCode(wlyySurveyTemplateQuestionDO.getId());
                wlyySurveyTemplateQuestionDO.setId(UUID.randomUUID().toString());
            }
@ -466,6 +465,8 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
            List<WlyySurveyTemplateOptionDO> options = EntityUtils.jsonToList(tempOpJson, WlyySurveyTemplateOptionDO.class);
            for (WlyySurveyTemplateOptionDO wlyySurveyTemplateOptionDO:options){
                wlyySurveyTemplateOptionDO.setTemplateCode(temp.getId());
                wlyySurveyTemplateOptionDO.setCode(wlyySurveyTemplateOptionDO.getId());
                wlyySurveyTemplateOptionDO.setId(UUID.randomUUID()+"");
            }
            surveyTemplateOptionDao.save(options);
        }

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyTemplateOptionDO.java

@ -15,6 +15,7 @@ import javax.persistence.Table;
public class WlyySurveyTemplateOptionDO  {
    private String id;
    private String code;
    private String templateCode;//模板编码',
    private String questionCode;//模板问题编码',关联wlyy_survey_template_question
    private String content;//选项内容',
@ -115,4 +116,12 @@ public class WlyySurveyTemplateOptionDO  {
    public void setHaveComment(Integer haveComment) {
        this.haveComment = haveComment;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 10 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyTemplateOptionVO.java

@ -9,7 +9,8 @@ import io.swagger.annotations.ApiModelProperty;
 */
@ApiModel(value = "WlyySurveyTemplateOptionVO", description = "问卷调查模板问题选项")
public class WlyySurveyTemplateOptionVO extends UuidIdentityVO {
    @ApiModelProperty(value = "业务id", example = "模块1")
    private String code;//模板编码',
    @ApiModelProperty(value = "模板编码", example = "模块1")
    private String templateCode;//模板编码',
    @ApiModelProperty(value = "模板问题编码", example = "模块1")
@ -132,4 +133,12 @@ public class WlyySurveyTemplateOptionVO extends UuidIdentityVO {
    public void setOptCount(Integer optCount) {
        this.optCount = optCount;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
}

+ 10 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyTemplateQuestionVO.java

@ -13,7 +13,8 @@ import java.util.List;
 */
@ApiModel(value = "WlyySurveyTemplateQuestionVO", description = "问卷调查模板问题")
public class WlyySurveyTemplateQuestionVO extends UuidIdentityVO {
    @ApiModelProperty(value = "问题id", example = "模块1")
    private String code;//问题id
    @ApiModelProperty(value = "问题标题", example = "模块1")
    private String title;//问题标题',
    @ApiModelProperty(value = "问题说明(可为null)", example = "模块1")
@ -46,6 +47,14 @@ public class WlyySurveyTemplateQuestionVO extends UuidIdentityVO {
    @ApiModelProperty(value = "选项问题答题人数", example = "模块1")
    private Integer tqCount;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getTitle() {
        return title;
    }