|
@ -1,6 +1,8 @@
|
|
|
package com.yihu.jw.hospital.survey.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
|
|
|
import com.yihu.jw.entity.hospital.survey.*;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.hospital.survey.dao.*;
|
|
@ -8,9 +10,11 @@ import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
|
|
|
import com.yihu.jw.restmodel.hospital.survey.*;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
import com.yihu.jw.utils.EntityUtils;
|
|
|
import com.yihu.jw.utils.StringUtil;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@ -152,7 +156,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
public Boolean saveSurveyQuestion(String sqjsons,String sqOptionJson)throws Exception{
|
|
|
|
|
|
//保存问题
|
|
|
List<WlyySurveyQuestionDO> surveys = (List<WlyySurveyQuestionDO>) com.alibaba.fastjson.JSONArray.parseArray(sqjsons, WlyySurveyQuestionDO.class);
|
|
|
List<WlyySurveyQuestionDO> surveys = EntityUtils.jsonToList(sqjsons, WlyySurveyQuestionDO.class);
|
|
|
surveyQuestionDao.save(surveys);
|
|
|
|
|
|
if(surveys!=null&&surveys.size()>0){
|
|
@ -162,7 +166,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
surveyQuestionsOptionDao.delete(optionDOs);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(sqOptionJson)){
|
|
|
List<WlyySurveyQuestionsOptionDO> options = (List<WlyySurveyQuestionsOptionDO>) com.alibaba.fastjson.JSONArray.parseArray(sqOptionJson, WlyySurveyQuestionsOptionDO.class);
|
|
|
List<WlyySurveyQuestionsOptionDO> options = EntityUtils.jsonToList(sqOptionJson, WlyySurveyQuestionsOptionDO.class);
|
|
|
surveyQuestionsOptionDao.save(options);
|
|
|
}
|
|
|
}
|
|
@ -186,7 +190,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
surveyQuestionsOptionDao.delete(optionDOs);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(sqOptionJson)){
|
|
|
List<WlyySurveyQuestionsOptionDO> options = (List<WlyySurveyQuestionsOptionDO>) com.alibaba.fastjson.JSONArray.parseArray(sqOptionJson, WlyySurveyQuestionsOptionDO.class);
|
|
|
List<WlyySurveyQuestionsOptionDO> options = EntityUtils.jsonToList(sqOptionJson, WlyySurveyQuestionsOptionDO.class);
|
|
|
surveyQuestionsOptionDao.save(options);
|
|
|
}
|
|
|
return true;
|
|
@ -347,7 +351,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
}
|
|
|
//新增问题
|
|
|
if(StringUtils.isNotBlank(tempQJson)){
|
|
|
List<WlyySurveyTemplateQuestionDO> questions = (List<WlyySurveyTemplateQuestionDO>) com.alibaba.fastjson.JSONArray.parseArray(tempQJson, WlyySurveyTemplateQuestionDO.class);
|
|
|
List<WlyySurveyTemplateQuestionDO> questions = EntityUtils.jsonToList(tempQJson, WlyySurveyTemplateQuestionDO.class);
|
|
|
surveyTemplateQuestionDao.save(questions);
|
|
|
}
|
|
|
|
|
@ -359,7 +363,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
|
|
|
//保存新问题选项
|
|
|
if(StringUtils.isNotBlank(tempOpJson)){
|
|
|
List<WlyySurveyTemplateOptionDO> questions = (List<WlyySurveyTemplateOptionDO>) com.alibaba.fastjson.JSONArray.parseArray(tempOpJson, WlyySurveyTemplateOptionDO.class);
|
|
|
List<WlyySurveyTemplateOptionDO> questions = EntityUtils.jsonToList(tempOpJson, WlyySurveyTemplateOptionDO.class);
|
|
|
surveyTemplateOptionDao.save(questions);
|
|
|
}
|
|
|
|
|
@ -369,8 +373,8 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
surveyLabelInfoDao.delete(labelDels);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(labelJson)){
|
|
|
List<WlyySurveyLabelInfoDO> labels = (List<WlyySurveyLabelInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(labelJson, WlyySurveyLabelInfoDO.class);
|
|
|
|
|
|
List<WlyySurveyLabelInfoDO> labels = EntityUtils.jsonToList(labelJson, WlyySurveyLabelInfoDO.class);
|
|
|
surveyLabelInfoDao.save(labels);
|
|
|
}
|
|
|
|
|
|
//删除检查标签
|
|
@ -380,7 +384,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
}
|
|
|
//保存检查标签
|
|
|
if(StringUtils.isNotBlank(labelInspJson)){
|
|
|
List<WlyySurveyInspLabelInfoDO> labels = (List<WlyySurveyInspLabelInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(labelInspJson, WlyySurveyInspLabelInfoDO.class);
|
|
|
List<WlyySurveyInspLabelInfoDO> labels = EntityUtils.jsonToList(labelInspJson, WlyySurveyInspLabelInfoDO.class);
|
|
|
surveyInspLabelInfoDao.save(labels);
|
|
|
}
|
|
|
|
|
@ -409,4 +413,5 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
}
|