ソースを参照

医生信息修改

wangjun 4 年 前
コミット
235af8a1f3

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

@ -14,6 +14,7 @@ import com.yihu.jw.util.common.PercentageUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,6 +23,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -60,6 +62,8 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
    private SurveyUserDao surveyUserDao;
    @Autowired
    private SurveyUserAnswerDao surveyUserAnswerDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    /**
     * 查询字典
     * 1.surveyLabel;2.surveyScreenLabel
@ -305,6 +309,39 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        if(list!=null&&list.size()>0){
            //设置标签
            for(WlyySurveyTemplateVO templateVO : list){
                String templateCode = templateVO.getId();
                String sqlUsed = "select t.used as \"used\" from wlyy_knowledge_article_user t where t.relation_code = '"+templateCode +"'";
                if(StringUtils.isNotEmpty(creater)){
                    sqlUsed += " and t.user_code = '"+creater+"'";
                }
                List<Map<String,Object>> listUsed = hibenateUtils.createSQLQuery(sqlUsed);
                for (Map<String,Object> map:listUsed){
                    Integer in = null;
                    if (listUsed.size()>0){
                        if (null!=listUsed.get(0)){
                            Object object = map.get("used");
                            if(object!=null){
                                if(object instanceof Integer){
                                    in = (Integer)object;
                                }else if(object instanceof String){
                                    in = Integer.parseInt((String)object);
                                }else if(object instanceof Double){
                                    in = (int)((double)object);
                                }else if(object instanceof Float){
                                    in = (int)((float)object);
                                }else if(object instanceof BigDecimal){
                                    in = ((BigDecimal)object).intValue();
                                }else if(object instanceof Long){
                                    in = ((Long)object).intValue();
                                }
                            }
                        }
                        templateVO.setUsed(in);
                    }
                }
                templateVO.setLabels(findSurveyTemplateLabel(templateVO.getId()));
            }
        }

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

@ -39,7 +39,16 @@ public class WlyySurveyTemplateVO extends UuidIdentityVO {
    private List<WlyySurveyTemplateQuestionVO> templateQuestionVOs;
    @ApiModelProperty(value = "有效作答人数", example = "模块1")
    private Integer answerCount;//修改时间',
    @ApiModelProperty(value = "是否常用", example = "模块1")
    private Integer used;//是否常用1常用0不常用,
    public Integer getUsed() {
        return used;
    }
    public void setUsed(Integer used) {
        this.used = used;
    }
    public String getTitle() {
        return title;

+ 7 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictJobTitleEndpoint.java

@ -1,6 +1,8 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
import com.yihu.jw.base.service.dict.DictJobTitleService;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.restmodel.base.dict.DictJobTitleVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -36,6 +38,8 @@ public class DictJobTitleEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DictJobTitleService dictJobTitleService;
    @Autowired
    private DictDoctorDutyService dictDoctorDutyService;
    @PostMapping(value = BaseRequestMapping.DictJobTitle.CREATE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建")
@ -89,15 +93,15 @@ public class DictJobTitleEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseRequestMapping.DictJobTitle.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<DictJobTitleVO> list(
    public ListEnvelop<DictDoctorDutyDO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<DictJobTitleDO> dictJobTitles = dictJobTitleService.search(fields, filters, sorts);
        return success(dictJobTitles, DictJobTitleVO.class);
        List<DictDoctorDutyDO> dictJobTitles = dictDoctorDutyService.search(fields, filters, sorts);
        return success(dictJobTitles, DictDoctorDutyDO.class);
    }
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorEndpoint.java

@ -207,7 +207,7 @@ public class BaseDoctorEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据区域获取机构列表")
    public Envelop getOrgListByTown(
            @ApiParam(name = "doctorCode", value = "townCode")
            @RequestParam(value = "doctorCode", required = true) String doctorCode,
            @RequestParam(value = "doctorCode", required = false    ) String doctorCode,
            @ApiParam(name = "townCode", value = "townCode")
            @RequestParam(value = "townCode", required = true) String townCode) throws Exception {
        JSONObject jsonObject = baseDoctorService.getOrgListByTownAndDoctorCode(doctorCode,townCode);

+ 1 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/doctor/BaseDoctorRoleInfoEndpoint.java

@ -43,6 +43,7 @@ public class BaseDoctorRoleInfoEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorRoleDictService baseDoctorRoleDictService;
    @PostMapping(value = BaseRequestMapping.BaseDoctorRoleInfo.CREATE)
    @ApiOperation(value = "创建")
    public Envelop create(

+ 27 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/BasePatientBusinessService.java

@ -215,6 +215,7 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
		MixEnvelop mixEnvelop = new MixEnvelop();
		sql.append("SELECT " +
				" t.id, " +
				" b.used as \"used\","+
				" t.title, " +
				" t.template_comment AS templateComment, " +
				" t.organization, " +
@ -265,13 +266,22 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
				return mixEnvelop;
				//0为查询模板
			} else {
				sql.append("where t.del = 1");
				sql.append("JOIN wlyy_survey_label_info i ON t.id = i.survey_temp_code where 1=1");
				sql.append(" and t.del = 1");
				if (StringUtils.isNotEmpty(doctor)) {
					sql.append(" and t.title like '%" + title + "%'");
				}
				String sqlCount = "select Count(1) as \"total\" from ("+sql+") l";
				List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql.toString(), page, pageSize);
				List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount);
				Long count = 0L;
				if (listCount.size()>0){
					count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
				}
				if (list.size() > 0) {
					for (Map<String, Object> map : list) {
						List<WlyySurveyLabelInfoVO>  wlyySurveyLabelInfoVOS= surveyService.findSurveyTemplateLabel(null==map.get("id")?"":map.get("id").toString());
						map.put("labels",wlyySurveyLabelInfoVOS);
						String createTime = null == map.get("create_time") ? "" : map.get("create_time").toString();
						String creater = null == map.get("creater") ? "" : map.get("creater").toString();
						map.put("create_time", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
@ -281,21 +291,33 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
						}
					}
				}
				mixEnvelop.setPageSize(pageSize);
				mixEnvelop.setCurrPage(page);
				mixEnvelop.setTotalCount(count.intValue());
				mixEnvelop.setDetailModelList(list);
				return mixEnvelop;
			}
			//空位查我的问卷
		} else {
			sql.append("where t.del = 1");
			sql.append("JOIN wlyy_survey_label_info i ON t.id = i.survey_temp_code where 1=1");
			sql.append(" and t.del = 1");
			if (StringUtils.isNotEmpty(doctor)) {
				sql.append(" and t.creater = '" + doctor + "'");
			}
			if (StringUtils.isNotEmpty(doctor)) {
				sql.append(" and t.title like '%" + title + "%'");
			}
			String sqlCount = "select Count(1) as \"total\" from ("+sql+") l";
			List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql.toString(), page, pageSize);
			List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sqlCount);
			Long count = 0L;
			if (listCount.size()>0){
				count = hibenateUtils.objTransformLong(listCount.get(0).get("total"));
			}
			if (list.size() > 0) {
				for (Map<String, Object> map : list) {
					List<WlyySurveyLabelInfoVO>  wlyySurveyLabelInfoVOS= surveyService.findSurveyTemplateLabel(null==map.get("id")?"":map.get("id").toString());
					map.put("labels",wlyySurveyLabelInfoVOS);
					String createTime = null == map.get("create_time") ? "" : map.get("create_time").toString();
					String creater = null == map.get("creater") ? "" : map.get("creater").toString();
					map.put("create_time", DateUtil.dateToStrLong(DateUtil.strToDateLong(createTime)));
@ -306,6 +328,9 @@ public class BasePatientBusinessService extends BaseJpaService<BasePatientBusine
				}
			}
			mixEnvelop.setPageSize(pageSize);
			mixEnvelop.setCurrPage(page);
			mixEnvelop.setTotalCount(count.intValue());
			mixEnvelop.setDetailModelList(list);
			return mixEnvelop;
		}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -263,7 +263,7 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
						object.put("content",wlyySurveyTemplateDO.getTemplateComment());
						object.put("id",wlyySurveyTemplateDO.getId());
					}
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "36", object.toJSONString(),"1");
					imUtil.sendImMsg(patientBusinessDO.getDoctor(), patientBusinessDO.getDoctorName(), patientBusinessDO.getSessionId(), "17", object.toJSONString(),"1");
				}
			}