Selaa lähdekoodia

发起协同门诊

Trick 5 vuotta sitten
vanhempi
commit
2a62ba5232
14 muutettua tiedostoa jossa 478 lisäystä ja 24 poistoa
  1. 2 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 17 0
      business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyInspLabelInfoDao.java
  3. 15 0
      business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyLabelInfoDao.java
  4. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyTemplateOptionDao.java
  5. 101 16
      business/base-service/src/main/java/com/yihu/jw/hospital/survey/service/SurveyService.java
  6. 42 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyInspLabelInfoDO.java
  7. 42 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyLabelInfoDO.java
  8. 19 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  9. 43 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyInspLabelInfoVO.java
  10. 43 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyLabelInfoVO.java
  11. 14 3
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyTemplateVO.java
  12. 11 2
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java
  13. 125 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/survey/SurveyEndpoint.java
  14. 1 1
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -694,9 +694,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public JSONObject checkOutpatient(String patient)throws Exception{
    public Map<String,Object> checkOutpatient(String patient)throws Exception{
        //-1卡余额不足,,-2 存在未结束的诊断热 1成功
        JSONObject rs = new JSONObject();
        Map<String,Object> rs = new HashedMap();
        //1.余额判断改到前端判断
        //net.sf.json.JSONObject json = entranceService.qutpatientBalance(cardNo,demoFlag);

+ 17 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyInspLabelInfoDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.hospital.survey.dao;
import com.yihu.jw.entity.hospital.survey.WlyySurveyInspLabelInfoDO;
import com.yihu.jw.entity.hospital.survey.WlyySurveyLabelInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/9/10.
 */
public interface SurveyInspLabelInfoDao  extends PagingAndSortingRepository<WlyySurveyInspLabelInfoDO, String>, JpaSpecificationExecutor<WlyySurveyInspLabelInfoDO> {
    List<WlyySurveyInspLabelInfoDO> findBySurveyTempCode(String surveyTempCode);
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyLabelInfoDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.hospital.survey.dao;
import com.yihu.jw.entity.hospital.survey.WlyySurveyLabelInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/9/10.
 */
public interface SurveyLabelInfoDao extends PagingAndSortingRepository<WlyySurveyLabelInfoDO, String>, JpaSpecificationExecutor<WlyySurveyLabelInfoDO> {
    List<WlyySurveyLabelInfoDO> findBySurveyTempCode(String surveyTempCode);
}

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/survey/dao/SurveyTemplateOptionDao.java

@ -12,4 +12,7 @@ import java.util.List;
public interface SurveyTemplateOptionDao extends PagingAndSortingRepository<WlyySurveyTemplateOptionDO, String>, JpaSpecificationExecutor<WlyySurveyTemplateOptionDO> {
    List<WlyySurveyTemplateOptionDO> findByTemplateQuestionCodeAndDelOrderBySortAsc(String templateQuestionCode,String del);
    List<WlyySurveyTemplateOptionDO> findByTemplateCodeAndDelOrderBySortAsc(String templateCode,String del);
}

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

@ -8,6 +8,7 @@ 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.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,13 +44,17 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
    private SurveyTemplateQuestionDao surveyTemplateQuestionDao;
    @Autowired
    private SurveyTemplateOptionDao surveyTemplateOptionDao;
    @Autowired
    private SurveyLabelInfoDao surveyLabelInfoDao;
    @Autowired
    private SurveyInspLabelInfoDao surveyInspLabelInfoDao;
    /**
     * 查询字典
     * 1.surveyLabel;2.surveyScreenLabel
     * @param name
     * @return
     */
    public List<WlyyHospitalSysDictVO> getSurveyLabel(String name){
    public List<WlyyHospitalSysDictVO> findSurveyLabel(String name){
        List<WlyyHospitalSysDictVO> list = new ArrayList<>();
        return convertToModels(sysDictDao.findByDictName(name),list,WlyyHospitalSysDictVO.class);
    }
@ -105,7 +110,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        if(questionType!=null){
            sql+=" AND q.question_type ="+questionType;
        }
        sql += " ORDER BY o.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
        sql += " ORDER BY q.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
        List<WlyySurveyQuestionVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyySurveyQuestionVO.class));
@ -267,7 +272,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        if(StringUtils.isNotBlank(label)){
            sql += " i.label_code ='"+label+"'";
        }
        sql += " ORDER BY o.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
        sql += " ORDER BY t.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
        List<WlyySurveyTemplateVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyySurveyTemplateVO.class));
@ -290,6 +295,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        WlyySurveyTemplateDO templateDO = surveyTemplateDao.findOne(tempId);
        WlyySurveyTemplateVO templateVO = convertToModel(templateDO,WlyySurveyTemplateVO.class);
        templateVO.setLabels(findSurveyTemplateLabel(tempId));
        templateVO.setInsplabels(findSurveyInspTemplateLabel(tempId));
        List<WlyySurveyTemplateQuestionDO> tqDOs = surveyTemplateQuestionDao.findByTemplateCodeAndDelOrderBySortAsc(tempId,"1");
        if(tqDOs!=null&&tqDOs.size()>0){
@ -309,19 +315,98 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        return templateVO;
    }
    public List<Map<String,Object>> findSurveyTemplateLabel(String tempId){
        String sql ="SELECT " +
                " i.label_code AS labelCode, " +
                " i.label_name AS labelName " +
                " FROM " +
                " wlyy_survey_label_info i " +
                " WHERE " +
                " i.survey_temp_code = '"+tempId+"'";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    public List<WlyySurveyLabelInfoVO> findSurveyTemplateLabel(String tempId){
        List<WlyySurveyLabelInfoDO> list = surveyLabelInfoDao.findBySurveyTempCode(tempId);
        List<WlyySurveyLabelInfoVO> rs = new ArrayList<>();
        return convertToModels(list,rs,WlyySurveyLabelInfoVO.class);
    }
    public List<WlyySurveyInspLabelInfoVO> findSurveyInspTemplateLabel(String tempId){
        List<WlyySurveyInspLabelInfoDO> list = surveyInspLabelInfoDao.findBySurveyTempCode(tempId);
        List<WlyySurveyInspLabelInfoVO> rs = new ArrayList<>();
        return convertToModels(list,rs,WlyySurveyInspLabelInfoVO.class);
    }
    /**
     * 保存,更新模板
     * @param tempJson
     * @param tempQJson
     * @param tempOpJson
     * @return
     * @throws Exception
     */
    public Boolean saveSurveyTemplate(String tempJson,String tempQJson,String tempOpJson,String labelJson,String labelInspJson)throws Exception{
        WlyySurveyTemplateDO temp = objectMapper.readValue(tempJson,WlyySurveyTemplateDO.class);
        temp = surveyTemplateDao.save(temp);
        //删除原有问题
        List<WlyySurveyTemplateQuestionDO> questionDODels = surveyTemplateQuestionDao.findByTemplateCodeAndDelOrderBySortAsc(temp.getId(),"1");
        if(questionDODels!=null&&questionDODels.size()>0){
            surveyTemplateQuestionDao.delete(questionDODels);
        }
        //新增问题
        if(StringUtils.isNotBlank(tempQJson)){
            List<WlyySurveyTemplateQuestionDO> questions = (List<WlyySurveyTemplateQuestionDO>) com.alibaba.fastjson.JSONArray.parseArray(tempQJson, WlyySurveyTemplateQuestionDO.class);
            surveyTemplateQuestionDao.save(questions);
        }
        //删除原有问题选项
        List<WlyySurveyTemplateOptionDO> optionDODels = surveyTemplateOptionDao.findByTemplateCodeAndDelOrderBySortAsc(temp.getId(),"1");
        if(optionDODels!=null&&optionDODels.size()>0){
            surveyTemplateOptionDao.delete(optionDODels);
        }
        //保存新问题选项
        if(StringUtils.isNotBlank(tempOpJson)){
            List<WlyySurveyTemplateOptionDO> questions = (List<WlyySurveyTemplateOptionDO>) com.alibaba.fastjson.JSONArray.parseArray(tempOpJson, WlyySurveyTemplateOptionDO.class);
            surveyTemplateOptionDao.save(questions);
        }
        //保存标签
        List<WlyySurveyLabelInfoDO> labelDels = surveyLabelInfoDao.findBySurveyTempCode(temp.getId());
        if(labelDels!=null&&labelDels.size()>0){
            surveyLabelInfoDao.delete(labelDels);
        }
        if(StringUtils.isNotBlank(labelJson)){
            List<WlyySurveyLabelInfoDO> labels = (List<WlyySurveyLabelInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(labelJson, WlyySurveyLabelInfoDO.class);
        }
        //删除检查标签
        List<WlyySurveyInspLabelInfoDO> labelInspDels = surveyInspLabelInfoDao.findBySurveyTempCode(temp.getId());
        if(labelDels!=null&&labelDels.size()>0){
            surveyInspLabelInfoDao.delete(labelInspDels);
        }
        //保存检查标签
        if(StringUtils.isNotBlank(labelInspJson)){
            List<WlyySurveyInspLabelInfoDO> labels = (List<WlyySurveyInspLabelInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(labelInspJson, WlyySurveyInspLabelInfoDO.class);
            surveyInspLabelInfoDao.save(labels);
        }
        return true;
    }
//    public Boolean saveSurveyTemplate(){
//
//    }
    /**
     * 删除
     * @param tempId
     * @return
     */
    public Boolean delSurveyTemplate(String tempId){
        WlyySurveyTemplateDO temp = surveyTemplateDao.findOne(tempId);
        if(temp!=null){
            //删除原有问题
            List<WlyySurveyTemplateQuestionDO> questionDODels = surveyTemplateQuestionDao.findByTemplateCodeAndDelOrderBySortAsc(temp.getId(),"1");
            if(questionDODels!=null&&questionDODels.size()>0){
                surveyTemplateQuestionDao.delete(questionDODels);
            }
            //删除原有问题选项
            List<WlyySurveyTemplateOptionDO> optionDODels = surveyTemplateOptionDao.findByTemplateCodeAndDelOrderBySortAsc(temp.getId(),"1");
            if(optionDODels!=null&&optionDODels.size()>0){
                surveyTemplateOptionDao.delete(optionDODels);
            }
            surveyTemplateDao.delete(temp);
        }
        return true;
    }
}

+ 42 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyInspLabelInfoDO.java

@ -0,0 +1,42 @@
package com.yihu.jw.entity.hospital.survey;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2019/9/10.
 */
@Entity
@Table(name = "wlyy_survey_insp_label_info")
public class WlyySurveyInspLabelInfoDO extends UuidIdentityEntity {
    private String surveyTempCode;//问卷模板编码',
    private String labelCode;//(筛查类型code)',
    private String labelName;//(筛查类型name)',
    public String getSurveyTempCode() {
        return surveyTempCode;
    }
    public void setSurveyTempCode(String surveyTempCode) {
        this.surveyTempCode = surveyTempCode;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
}

+ 42 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/survey/WlyySurveyLabelInfoDO.java

@ -0,0 +1,42 @@
package com.yihu.jw.entity.hospital.survey;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2019/9/10.
 */
@Entity
@Table(name = "wlyy_survey_label_info")
public class WlyySurveyLabelInfoDO extends UuidIdentityEntity {
    private String surveyTempCode;//问卷模板编码',
    private String labelCode;//(1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查)',
    private String labelName;//(1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查)',
    public String getSurveyTempCode() {
        return surveyTempCode;
    }
    public void setSurveyTempCode(String surveyTempCode) {
        this.surveyTempCode = surveyTempCode;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
}

+ 19 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -418,4 +418,23 @@ public class BaseHospitalRequestMapping {
        public static final String hasDefault  = "/hasDefault";
    }
    /**
     * 问卷调查
     */
    public static class WlyySurvey extends Basic{
        public static final String PREFIX  = "/survey";
        public static final String findSurveyLabel  = "/findSurveyLabel";
        public static final String findSurveyQuestion  = "/findSurveyQuestion";
        public static final String findBySurveyId  = "/findBySurveyId";
        public static final String saveSurveyQuestion  = "/saveSurveyQuestion";
        public static final String updataSurveyQuestion  = "/updataSurveyQuestion";
        public static final String delSurveyQuestion  = "/delSurveyQuestion";
        public static final String findSurveyTemplate  = "/findSurveyTemplate";
        public static final String findSurveyTemplateById  = "/findSurveyTemplateById";
        public static final String saveSurveyTemplate  = "/saveSurveyTemplate";
        public static final String delSurveyTemplate  = "/delSurveyTemplate";
    }
}

+ 43 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyInspLabelInfoVO.java

@ -0,0 +1,43 @@
package com.yihu.jw.restmodel.hospital.survey;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by Trick on 2019/9/10.
 */
@ApiModel(value = "WlyySurveyInspLabelInfoVO", description = "问卷模板筛查标签")
public class WlyySurveyInspLabelInfoVO extends UuidIdentityVO {
    @ApiModelProperty(value = "问卷模板编码", example = "模块1")
    private String surveyTempCode;//问卷模板编码',
    @ApiModelProperty(value = "筛查类型code", example = "模块1")
    private String labelCode;//(筛查类型code)',
    @ApiModelProperty(value = "筛查类型name", example = "模块1")
    private String labelName;//(筛查类型name)',
    public String getSurveyTempCode() {
        return surveyTempCode;
    }
    public void setSurveyTempCode(String surveyTempCode) {
        this.surveyTempCode = surveyTempCode;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
}

+ 43 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyLabelInfoVO.java

@ -0,0 +1,43 @@
package com.yihu.jw.restmodel.hospital.survey;
import com.yihu.jw.restmodel.UuidIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * Created by Trick on 2019/9/10.
 */
@ApiModel(value = "WlyySurveyLabelInfoVO", description = "问卷模板标签")
public class WlyySurveyLabelInfoVO extends UuidIdentityVO {
    @ApiModelProperty(value = "问卷模板编码", example = "模块1")
    private String surveyTempCode;//问卷模板编码',
    @ApiModelProperty(value = "1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查", example = "模块1")
    private String labelCode;//(1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查)',
    @ApiModelProperty(value = "1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查", example = "模块1")
    private String labelName;//(1满意度、2糖尿病、3高血压、4生活日常,5疾病筛查)',
    public String getSurveyTempCode() {
        return surveyTempCode;
    }
    public void setSurveyTempCode(String surveyTempCode) {
        this.surveyTempCode = surveyTempCode;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
}

+ 14 - 3
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/survey/WlyySurveyTemplateVO.java

@ -30,7 +30,10 @@ public class WlyySurveyTemplateVO extends UuidIdentityVO {
    @ApiModelProperty(value = "修改时间", example = "模块1")
    private Date updateTime;//修改时间',
    @ApiModelProperty(value = "标签", example = "模块1")
    private List<Map<String,Object>> labels;
    private List<WlyySurveyLabelInfoVO> labels;
    @ApiModelProperty(value = "标签", example = "模块1")
    private List<WlyySurveyInspLabelInfoVO> insplabels;
    @ApiModelProperty(value = "问题", example = "模块1")
    private List<WlyySurveyTemplateQuestionVO> templateQuestionVOs;
@ -94,14 +97,22 @@ public class WlyySurveyTemplateVO extends UuidIdentityVO {
        this.updateTime = updateTime;
    }
    public List<Map<String, Object>> getLabels() {
    public List<WlyySurveyLabelInfoVO> getLabels() {
        return labels;
    }
    public void setLabels(List<Map<String, Object>> labels) {
    public void setLabels(List<WlyySurveyLabelInfoVO> labels) {
        this.labels = labels;
    }
    public List<WlyySurveyInspLabelInfoVO> getInsplabels() {
        return insplabels;
    }
    public void setInsplabels(List<WlyySurveyInspLabelInfoVO> insplabels) {
        this.insplabels = insplabels;
    }
    public List<WlyySurveyTemplateQuestionVO> getTemplateQuestionVOs() {
        return templateQuestionVOs;
    }

+ 11 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthYlzConfigService.java

@ -15,6 +15,7 @@ import com.ylzinfo.ehc.common.utils.DateUtils;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -156,6 +157,8 @@ public class OauthYlzConfigService {
            EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl(), oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
            TransResponse re = ehcHandler.execute(e);
            String rs = com.alibaba.fastjson.JSONObject.toJSONString(re);
            logger.info("checkOauthQRCode TransResponse :"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS")+" "+rs);
            com.alibaba.fastjson.JSONObject json = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.parse(rs);
            String ret_code = json.getString("ret_code");
@ -165,12 +168,18 @@ public class OauthYlzConfigService {
                if("succ".equals(auth_status)){
                    String idcard = biz.getString("id_no");
                    BasePatientDO patientDO =  basePatientDao.findByIdcardAndDel(idcard,"1");
                    if(patientDO == null){
                    if(StringUtils.isNotBlank(idcard)&&patientDO == null){
                        BasePatientDO patient = new BasePatientDO();
                        String salt = UUID.randomUUID().toString().substring(0,5);
                        String mobile = biz.getString("mobile_phone");
                        String pw = idcard.substring(mobile.length()-6);
                        String pw = null;
                        if(StringUtils.isNotBlank(mobile)){
                            pw = mobile.substring(mobile.length()-6);
                        }else{
                            pw = idcard.substring(idcard.length()-6);
                        }
                        patient.setIdcard(idcard);
                        patient.setName(biz.getString("user_name"));

+ 125 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/survey/SurveyEndpoint.java

@ -0,0 +1,125 @@
package com.yihu.jw.hospital.endpoint.survey;
import com.yihu.jw.hospital.survey.service.SurveyService;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * Created by Trick on 2019/9/10.
 */
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.WlyySurvey.PREFIX)
@Api(value = "问卷调查", description = "问卷调查", tags = {"问卷调查"})
public class SurveyEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private SurveyService surveyService;
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyLabel)
    @ApiOperation(value = "问题-查询字典")
    public ListEnvelop findSurveyLabel(@ApiParam(name = "name", value = "1.surveyLabel 标签;2.surveyScreenLabel 问卷类型")
                                       @RequestParam(value = "name",required = true) String name) throws Exception {
        List<WlyyHospitalSysDictVO> vos = surveyService.findSurveyLabel(name);
        return success(vos);
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyQuestion)
    @ApiOperation(value = "问题-获取问卷问题列表")
    public MixEnvelop findSurveyQuestion(@ApiParam(name = "title", value = "标题")
                                          @RequestParam(value = "title",required = false) String title,
                                         @ApiParam(name = "questionType", value = "问题类型")
                                          @RequestParam(value = "questionType",required = false)Integer questionType,
                                         @ApiParam(name = "page", value = "第几页,1开始")
                                          @RequestParam(value = "page",required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                          @RequestParam(value = "size",required = true)Integer size) throws Exception {
        return surveyService.findSurveyQuestion(title,questionType,page,size);
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findBySurveyId)
    @ApiOperation(value = "问题-获取问卷问题详情(单条)")
    public ObjEnvelop findBySurveyId(@ApiParam(name = "surveyId", value = "问卷Id")
                                     @RequestParam(value = "surveyId",required = true) String surveyId) throws Exception {
        return success(surveyService.findBySurveyId(surveyId));
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyQuestion)
    @ApiOperation(value = "问题-批量保存问卷问题")
    public ObjEnvelop saveSurveyQuestion(@ApiParam(name = "sqjsons", value = "问题实体列表json")
                                         @RequestParam(value = "sqjsons",required = true)String sqjsons,
                                         @ApiParam(name = "sqOptionJson", value = "选项实体列表json")
                                         @RequestParam(value = "sqOptionJson",required = false)String sqOptionJson) throws Exception {
        return success(surveyService.saveSurveyQuestion(sqjsons,sqOptionJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.updataSurveyQuestion)
    @ApiOperation(value = "问题-更新问题(单条)")
    public ObjEnvelop updataSurveyQuestion(@ApiParam(name = "sqjson", value = "问题实体json")
                                           @RequestParam(value = "sqjson",required = true)String sqjson,
                                           @ApiParam(name = "sqOptionJson", value = "选项实体列表json")
                                           @RequestParam(value = "sqOptionJson",required = false)String sqOptionJson) throws Exception {
        return success(surveyService.updataSurveyQuestion(sqjson,sqOptionJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.delSurveyQuestion)
    @ApiOperation(value = "问题-批量删除")
    public ObjEnvelop delSurveyQuestion(@ApiParam(name = "ids", value = "问题实体ID,逗号分割")
                                        @RequestParam(value = "ids",required = true)String ids) throws Exception {
        return success(surveyService.delSurveyQuestion(ids));
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplate)
    @ApiOperation(value = "模板-查询模板列表")
    public MixEnvelop findSurveyTemplate(@ApiParam(name = "title", value = "标题")
                                              @RequestParam(value = "title",required = false) String title,
                                          @ApiParam(name = "label", value = "标签code")
                                              @RequestParam(value = "label",required = false)String label,
                                          @ApiParam(name = "page", value = "第几页,1开始")
                                              @RequestParam(value = "page",required = true)Integer page,
                                          @ApiParam(name = "size", value = "每页大小")
                                              @RequestParam(value = "size",required = true)Integer size) throws Exception {
        return surveyService.findSurveyTemplate( title, label, page, size);
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplateById)
    @ApiOperation(value = "模板-获取模板详情(单条)")
    public ObjEnvelop findSurveyTemplateById(@ApiParam(name = "tempId", value = "模板ID")
                                             @RequestParam(value = "tempId",required = true) String tempId) throws Exception {
        return success(surveyService.findSurveyTemplateById(tempId));
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyTemplate)
    @ApiOperation(value = "问题-批量保存问卷问题")
    public ObjEnvelop saveSurveyTemplate(@ApiParam(name = "tempJson", value = "模板实体json")
                                         @RequestParam(value = "tempJson",required = true)String tempJson,
                                         @ApiParam(name = "tempQJson", value = "模板问题列表json")
                                         @RequestParam(value = "tempQJson",required = false)String tempQJson,
                                         @ApiParam(name = "tempOpJson", value = "模板问题选项列表json")
                                         @RequestParam(value = "tempOpJson",required = false)String tempOpJson,
                                         @ApiParam(name = "labelJson", value = "模板标签json")
                                         @RequestParam(value = "labelJson",required = false)String labelJson,
                                         @ApiParam(name = "labelInspJson", value = "模板筛查标签json")
                                         @RequestParam(value = "labelInspJson",required = false)String labelInspJson) throws Exception {
        return success(surveyService.saveSurveyTemplate(tempJson,tempQJson,tempOpJson,labelJson,labelInspJson));
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.delSurveyTemplate)
    @ApiOperation(value = "模板-批量删除")
    public ObjEnvelop delSurveyTemplate(@ApiParam(name = "tempId", value = "模板实体json")
                                        @RequestParam(value = "tempId",required = true)String tempId) throws Exception {
        return success(surveyService.delSurveyTemplate(tempId));
    }
}

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital
    name: svr-internet-hospital-lyx
  cloud:
    config:
      failFast: true