Przeglądaj źródła

异常码修改

wangjun 4 lat temu
rodzic
commit
aca4bde5f5
44 zmienionych plików z 3084 dodań i 1375 usunięć
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 3 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java
  4. 2 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  5. 4 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/exception/dao/BaseExceptionServerDictDao.java
  6. 6 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/ListEnvelop.java
  7. 5 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/PageEnvelop.java
  8. 42 3
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java
  9. 11 0
      common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionDictUtilDao.java
  10. 8 0
      common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionLogUtilDao.java
  11. 18 0
      common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionServerDictUtilDao.java
  12. 57 4
      common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java
  13. 57 1
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/PostFilter.java
  14. 4 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionServerDictDao.java
  15. 6 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java
  16. 58 19
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/account/PatientEndpoint.java
  17. 7 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/analysis/AnalysisEndPoint.java
  18. 212 125
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java
  19. 55 26
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java
  20. 46 16
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java
  21. 39 24
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/ConsultPriceEndpoint.java
  22. 293 161
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  23. 262 168
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java
  24. 30 25
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/ReservationSettingEndpoint.java
  25. 71 51
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/SysDictEndpoint.java
  26. 56 19
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/PrivateDictEndpoint.java
  27. 32 17
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/drugstore/BaseDrugStoreEndpoint.java
  28. 7 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/enterprise/EnterpriseController.java
  29. 90 31
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java
  30. 34 15
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionController.java
  31. 70 41
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionDictController.java
  32. 22 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  33. 33 13
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BannerDoctorController.java
  34. 54 40
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseBannerController.java
  35. 72 28
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java
  36. 39 20
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/SystemMessageController.java
  37. 423 199
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  38. 27 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/NationalDrugDictEndpoint.java
  39. 546 224
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  40. 132 50
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java
  41. 5 5
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  42. 120 24
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/survey/SurveyEndpoint.java
  43. 17 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/tnyy/TnyyController.java
  44. 7 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/version/VersionEndpoint.java

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

@ -3713,7 +3713,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Map<String, Object> rs = new HashedMap();
        if (doctorDO != null) {
            rs.put("doctor", doctor);
            rs.put("doctorSex", doctorDO.getSex());
            rs.put("doctorSex", doctorDO.getSex().toString());
            if (StringUtils.isNoneBlank(doctorDO.getIdcard())) {
                rs.put("doctorAge", IdCardUtil.getAgeForIdcard(doctorDO.getIdcard()));
            } else {

+ 3 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -50,8 +50,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.transaction.Transactional;
import java.io.IOException;
import java.io.StringReader;
import java.text.SimpleDateFormat;

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java

@ -253,7 +253,7 @@ public class EnterpriseService {
    public String sendTWMes(String enterpriseId,String userId,String title,String description,String url)throws Exception{
        String mesurl = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="+getToken(enterpriseId);
        String mesurl = "https://qyapi.weixin.qq.com/cg1-bin/message/send?access_token="+getToken(enterpriseId);
        JSONObject param = new JSONObject();
        param.put("touser",userId);

+ 2 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -3981,7 +3981,7 @@ public class ImService {
	public void doctorReplyUpdateYktState(String consult,String doctor,String wxId){
		if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
			String sql ="SELECT * FROM topics t where " +
			String sql ="SELECT * FROM im_internet_hospital.topics t where " +
					"t.id='"+consult+"' and t.reply_user='"+doctor+"' and t.reply=1 and t.status IN(0,1) ";
			List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
			logger.info("sql======"+sql);
@ -3990,6 +3990,7 @@ public class ImService {
				if (!flag){
					BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(consult);
					if (businessOrderDO!=null){
                        System.out.println("11111");
						ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"5");
					}
				}

+ 4 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/exception/dao/BaseExceptionServerDictDao.java

@ -5,7 +5,11 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseExceptionServerDictDao extends PagingAndSortingRepository<BaseExceptionServerDictDO, String>, JpaSpecificationExecutor<BaseExceptionServerDictDO> {
    @Query("from BaseExceptionServerDictDO t where t.isDel='1' and t.path=?1")
    BaseExceptionServerDictDO findServiceByPath(String path);
    @Query("from BaseExceptionServerDictDO t where t.isDel='1'")
    List<BaseExceptionServerDictDO> findServiceAll();
}

+ 6 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/ListEnvelop.java

@ -49,4 +49,10 @@ public class ListEnvelop<T> extends Envelop {
        envelop.setStatus(-1);
        return envelop;
    }
    public static ListEnvelop getCodeError(String message,Integer code) {
        ListEnvelop envelop = new ListEnvelop();
        envelop.setMessage(message);
        envelop.setStatus(code);
        return envelop;
    }
}

+ 5 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/PageEnvelop.java

@ -1,8 +1,11 @@
package com.yihu.jw.restmodel.web;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yihu.jw.entity.base.dict.BaseExceptionDictDO;
import com.yihu.jw.restmodel.exception.dao.BaseExceptionDictDao;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.Serializable;
import java.util.ArrayList;
@ -27,7 +30,8 @@ import java.util.List;
public class PageEnvelop<T> extends Envelop implements Serializable {
    private static final long serialVersionUID = 2076324875575488461L;
    @Autowired
    protected BaseExceptionDictDao baseExceptionDictDao;
    @ApiModelProperty(value = "当前页", example = "1")
    private int currPage = 1;

+ 42 - 3
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/web/endpoint/EnvelopRestEndpoint.java

@ -201,9 +201,19 @@ public abstract class EnvelopRestEndpoint extends Exception {
    protected Envelop failed (String message) {
        return failed(message, -10000);
    }
    public PageEnvelop failedPageEnvelopException(Exception e){
        System.out.println(e.getClass());
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(e.getClass().toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return PageEnvelop.getError(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
        }else {
            return PageEnvelop.getError(e.getMessage(),-10000);
        }
    }
    protected Envelop failedException(Exception e){
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(DataAccessException.class.toString());
        System.out.println(e.getClass());
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(e.getClass().toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return failed(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
@ -256,7 +266,36 @@ public abstract class EnvelopRestEndpoint extends Exception {
            return null;
        }*/
    }
    protected MixEnvelop failedMixEnvelopException(Exception e){
        System.out.println(e.getClass());
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(e.getClass().toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return MixEnvelop.getError(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
        }else {
            return MixEnvelop.getError(e.getMessage(),-10000);
        }
    }
    protected ListEnvelop failedListEnvelopException(Exception e){
        System.out.println(e.getClass());
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(e.getClass().toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return ListEnvelop.getCodeError(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
        }else {
            return ListEnvelop.getCodeError(e.getMessage(),-10000);
        }
    }
    protected ObjEnvelop failedObjEnvelopException(Exception e){
        System.out.println(e.getClass());
        BaseExceptionDictDO baseExceptionDictDO =baseExceptionDictDao.findByExceptionInfo(e.getClass().toString());
        if (baseExceptionDictDO!=null){
            e.printStackTrace();
            return ObjEnvelop.getError(baseExceptionDictDO.getRemindContent(),Integer.parseInt(baseExceptionDictDO.getCode()));
        }else {
            return ObjEnvelop.getError(e.getMessage(),-10000);
        }
    }
    protected Envelop failed (String message, int status) {
        Envelop envelop = new Envelop();
        envelop.setMessage(message);

+ 11 - 0
common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionDictUtilDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.util.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseExceptionDictUtilDao extends PagingAndSortingRepository<BaseExceptionDictDO, String>, JpaSpecificationExecutor<BaseExceptionDictDO> {
    @Query("from BaseExceptionDictDO  t where t.isDel='1' and t.exceptionInfo=?1")
    BaseExceptionDictDO findByExceptionInfo(String exceptionInfo);
}

+ 8 - 0
common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionLogUtilDao.java

@ -0,0 +1,8 @@
package com.yihu.jw.util.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseExceptionLogUtilDao extends PagingAndSortingRepository<BaseExceptionLogDO, String>, JpaSpecificationExecutor<BaseExceptionLogDO> {
}

+ 18 - 0
common/common-util/src/main/java/com/yihu/jw/util/dao/BaseExceptionServerDictUtilDao.java

@ -0,0 +1,18 @@
package com.yihu.jw.util.dao;
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseExceptionServerDictUtilDao extends PagingAndSortingRepository<BaseExceptionServerDictDO, String>, JpaSpecificationExecutor<BaseExceptionServerDictDO> {
    @Query("from BaseExceptionServerDictDO t where t.isDel='1' and t.path=?1")
    BaseExceptionServerDictDO findServiceByPath(String path);
    @Query("from BaseExceptionServerDictDO t where t.isDel='1'")
    List<BaseExceptionServerDictDO> findServiceAll();
    @Query("from BaseExceptionServerDictDO t where t.isDel='1' and t.name=?1")
    BaseExceptionServerDictDO findServiceByName(String name);
}

+ 57 - 4
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -1,6 +1,12 @@
package com.yihu.jw.util.http;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.dict.BaseExceptionDictDO;
import com.yihu.jw.entity.base.dict.BaseExceptionLogDO;
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
import com.yihu.jw.util.dao.BaseExceptionDictUtilDao;
import com.yihu.jw.util.dao.BaseExceptionLogUtilDao;
import com.yihu.jw.util.dao.BaseExceptionServerDictUtilDao;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
@ -14,23 +20,58 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
@Component
@Transactional(propagation= Propagation.NOT_SUPPORTED)
public class HttpClientUtil {
    @Autowired
    private BaseExceptionDictUtilDao baseExceptionDictUtilDao;
    @Autowired
    private BaseExceptionLogUtilDao baseExceptionLogUtilDao;
    @Autowired
    private BaseExceptionServerDictUtilDao baseExceptionServerDictUtilDao;
    @Value("${spring.application.name}")
    private String serverName;
    public  void saveExceptionLog(Exception e,String request,String response){
        BaseExceptionDictDO baseExceptionDictDO = baseExceptionDictUtilDao.findByExceptionInfo(e.getClass().toString());
        BaseExceptionLogDO baseExceptionLogDO = new BaseExceptionLogDO();
        BaseExceptionServerDictDO baseExceptionServerDictDO = baseExceptionServerDictUtilDao.findServiceByName(serverName);
        baseExceptionLogDO.setRequest(request);
        baseExceptionLogDO.setResponse(response);
        if (baseExceptionDictDO!=null){
            if (baseExceptionServerDictDO!=null){
                baseExceptionLogDO.setServiceCode(baseExceptionServerDictDO.getId());
                baseExceptionLogDO.setExceptionCode(baseExceptionServerDictDO.getId()+baseExceptionDictDO.getCode());
                baseExceptionLogDO.setExceptionType(baseExceptionDictDO.getExceptionType());
            }
            baseExceptionLogDO.setCreateTime(new Date());
        }else {
            baseExceptionLogDO.setExceptionCode(e.getCause().toString());
            baseExceptionLogDO.setCreateTime(new Date());
            if (baseExceptionServerDictDO!=null){
                baseExceptionLogDO.setServiceCode(baseExceptionServerDictDO.getId());
            }
        }
        baseExceptionLogDO = baseExceptionLogUtilDao.save(baseExceptionLogDO);
        System.out.println("saveSuccess");
    }
    /**
     * 发送post请求
     *
@ -99,10 +140,16 @@ public class HttpClientUtil {
                response.close();
            }
        } catch (ClientProtocolException e) {
            System.out.println(e.getClass()+"1");
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } catch (ParseException e) {
            System.out.println(e.getClass()+"2");
            saveExceptionLog(e,url,e.getMessage());
            e.printStackTrace();
        } catch (IOException e) {
            System.out.println(e.getClass()+"3");
            saveExceptionLog(e,url,e.getMessage());
            e.printStackTrace();
        } finally {
            // 关闭连接,释放资源
@ -134,10 +181,13 @@ public class HttpClientUtil {
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } catch (ParseException e) {
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } catch (IOException e) {
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } finally {
            // 关闭连接,释放资源
            try {
@ -333,10 +383,13 @@ public class HttpClientUtil {
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } catch (UnsupportedEncodingException e1) {
            e1.printStackTrace();
            saveExceptionLog(e1,url,e1.getMessage());
        } catch (IOException e) {
            e.printStackTrace();
            saveExceptionLog(e,url,e.getMessage());
        } finally {
            // 关闭连接,释放资源
            try {

+ 57 - 1
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/PostFilter.java

@ -3,7 +3,15 @@ package com.yihu.jw.gateway.filter;
import com.alibaba.fastjson.JSONObject;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import com.yihu.jw.entity.base.dict.BaseExceptionLogDO;
import com.yihu.jw.entity.base.dict.BaseExceptionServerDictDO;
import com.yihu.jw.gateway.AesEncryptUtils;
import com.yihu.jw.gateway.methlog.BaseExceptionService;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionLogDao;
import com.yihu.jw.gateway.methlog.dao.BaseExceptionServerDictDao;
import com.yihu.jw.gateway.security.BeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@ -11,6 +19,9 @@ import org.springframework.util.StreamUtils;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.zip.GZIPInputStream;
@Component
@ -39,6 +50,9 @@ public class PostFilter extends ZuulFilter {
    @Override
    public Object run() {
        RequestContext ctx = RequestContext.getCurrentContext();
        BaseExceptionServerDictDao baseExceptionServiceDictDao = BeanUtil.getBean(BaseExceptionServerDictDao.class);
        BaseExceptionLogDao baseExceptionLogDao = BeanUtil.getBean(BaseExceptionLogDao.class);
        BaseExceptionService baseExceptionService = BeanUtil.getBean(BaseExceptionService.class);
        logger.info("进入post过滤器");
        HttpServletRequest request = ctx.getRequest();
        String url = request.getRequestURI();
@ -56,9 +70,51 @@ public class PostFilter extends ZuulFilter {
            bytes = StreamUtils.copyToByteArray(stream);
        }
        String body = new String(bytes,"UTF8");
        String serviceId="";
        String responseCode="";
        String exceptionType="";
        List<BaseExceptionServerDictDO> baseExceptionServerDictDOS =baseExceptionServiceDictDao.findServiceAll();
        for (BaseExceptionServerDictDO baseExceptionServerDictDO:baseExceptionServerDictDOS){
            if (url.contains(baseExceptionServerDictDO.getPath())){
                serviceId=baseExceptionServerDictDO.getId();
                break;
            }
        }
        JSONObject jsonObject =JSONObject.parseObject(body);
        String status =jsonObject.getString("status");
        if (!"200".equalsIgnoreCase(status)){
            jsonObject.put("status",serviceId+status);
            BaseExceptionLogDO baseExceptionLogDO = new BaseExceptionLogDO();
            baseExceptionLogDO.setCreateTime(new Date());
            List<Map<String,Object>> list = baseExceptionService.findExceptionDict("","110001","","1");
            List<Map<String,Object>> serviceList=baseExceptionService.findExceptionService("","","1","");
            for (Map<String,Object> map:serviceList){
                if (ctx.getRequest().getServletPath().contains(map.get("pathUrl").toString())){
                    serviceId=map.get("id").toString();
                    break;
                }
            }
            if (list!=null&&list.size()>0){
                responseCode=serviceId+list.get(0).get("code").toString();
                exceptionType = list.get(0).get("exceptionType").toString();
            }
            baseExceptionLogDO.setExceptionType(exceptionType);
            baseExceptionLogDO.setServiceCode(serviceId);
            baseExceptionLogDO.setExceptionCode(responseCode);
            try {
                String  in = ctx.getRequest().getParameter("object");
                String jsonobject = AesEncryptUtils.decrypt(in);
                baseExceptionLogDO.setRequest(jsonobject);
                baseExceptionLogDO.setResponse(jsonObject.toString());
                baseExceptionLogDao.save(baseExceptionLogDO);
            }catch (Exception s){
                s.printStackTrace();
            }
        }
        JSONObject object = new JSONObject();
        object.put("status","200");
        object.put("data", AesEncryptUtils.encrypt(body));
        object.put("data", AesEncryptUtils.encrypt(jsonObject.toString()));
        if (!(url.contains("/open/noLogin/notify")||
            url.contains("/open/noLogin/ylzReceiveNotify")||
            url.contains("/open/noLogin/receiveNotify")||

+ 4 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/methlog/dao/BaseExceptionServerDictDao.java

@ -5,7 +5,11 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseExceptionServerDictDao extends PagingAndSortingRepository<BaseExceptionServerDictDO, String>, JpaSpecificationExecutor<BaseExceptionServerDictDO> {
    @Query("from BaseExceptionServerDictDO t where t.isDel='1' and t.path=?1")
    BaseExceptionServerDictDO findServiceByPath(String path);
    @Query("from BaseExceptionServerDictDO t where t.isDel='1'")
    List<BaseExceptionServerDictDO> findServiceAll();
}

+ 6 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java

@ -35,7 +35,12 @@ public class XzyyController extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ListEnvelop findPatientCard(@ApiParam(name = "patient", value = "居民code", required = false)
                                      @RequestParam(value = "patient",required = false)String patient)throws Exception{
        return success(xzzxEntranceService.selectPateintCard(patient));
        try {
            return success(xzzxEntranceService.selectPateintCard(patient));
        }catch (Exception e){
            return null;
        }
    }

+ 58 - 19
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/account/PatientEndpoint.java

@ -30,8 +30,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
            @RequestParam(value = "id", required = true) String id) throws Exception {
        return success(basePatientService.getPatientById(id));
        try {
            return success(basePatientService.getPatientById(id));
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.updatePatientPw)
@ -42,11 +45,16 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                  @RequestParam(value = "pw", required = true)String pw,
                                  @ApiParam(name = "orgPw", value = "原密码")
                                  @RequestParam(value = "orgPw", required = false)String orgPw)throws Exception{
        Boolean isSuccess = basePatientService.updatePatientPw(id,pw,orgPw);
        if (isSuccess){
            return success(isSuccess);
        }else {
            return failed("修改失败,请检查原密码是否正确");
        try {
            Boolean isSuccess = basePatientService.updatePatientPw(id,pw,orgPw);
            if (isSuccess){
                return success(isSuccess);
            }else {
                return failed("修改失败,请检查原密码是否正确");
            }
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
@ -58,7 +66,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "patient", value = "patient")
            @RequestParam(value = "patient", required = false) String patient) throws Exception {
        return success(basePatientService.getPatientCountByDoctor(doctor,patient));
        try {
            return success(basePatientService.getPatientCountByDoctor(doctor,patient));
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.getPatientEmrByDoctor)
    @ApiOperation(value = "获取居民电子病历信息")
@ -71,7 +83,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                            @ApiParam(name = "pageSize", value = "pageSize")
                                             @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        return basePatientService.findEmrByPatientId(patient,doctor,page,pageSize);
        try {
            return basePatientService.findEmrByPatientId(patient,doctor,page,pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.findPaitentPrescription)
@ -93,7 +109,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        try {
            return basePatientService.findPatientAllPrescription(doctor,keyName,status,page,size,patient,isSelectDrug);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
            return failedPageEnvelopException(e);
        }
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.createPatientGroupDict)
@ -107,7 +123,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                            @ApiParam(name = "groupName", value = "groupName")
                                            @RequestParam(value = "groupName", required = false) String groupName) throws Exception {
        return success(basePatientGroupDictService.createPatientGroupDict(groupId,doctor,groupCode,groupName));
        try {
            return success(basePatientGroupDictService.createPatientGroupDict(groupId,doctor,groupCode,groupName));
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.deletePatientGroupDict)
@ -117,7 +137,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "del", value = "del")
                                          @RequestParam(value = "del", required = false) String del) throws Exception {
        return success(basePatientGroupDictService.delPatientGroupDict(groupId,del));
        try {
            return success(basePatientGroupDictService.delPatientGroupDict(groupId,del));
        }catch (Exception e) {
            return failedException(e);
        }
    }
@ -132,7 +156,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                @ApiParam(name = "pageSize", value = "pageSize")
                                    @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        return basePatientGroupDictService.findByDoctor(doctor,groupName,page,pageSize);
        try {
            return basePatientGroupDictService.findByDoctor(doctor,groupName,page,pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.movePatientToGroup)
@ -147,8 +175,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            basePatientGroupDictService.movePatientToGroup(groupId,patient,doctor);
            return Envelop.getSuccess("操作成功");
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError(e.getMessage());
            return failedException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.delPatientGroup)
@ -159,7 +186,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
            basePatientGroupDictService.delPatientGroup(groupId);
            return Envelop.getSuccess("操作成功");
        }catch (Exception e){
            return Envelop.getError(e.getMessage());
            return failedException(e);
        }
    }
@ -177,7 +204,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                   @ApiParam(name = "pageSize", value = "pageSize")
                                   @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        return basePatientGroupDictService.findPatientGroup(patientName,doctor,groupId,page,pageSize);
        try {
            return basePatientGroupDictService.findPatientGroup(patientName,doctor,groupId,page,pageSize);
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.findPatientGroupNum)
@ -187,7 +218,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "groupIds", value = "多个用逗号隔开")
                                          @RequestParam(value = "groupIds", required = false) String groupIds) throws Exception {
        return success(basePatientGroupDictService.findPatientGroupNum(doctor,groupIds));
        try {
            return success(basePatientGroupDictService.findPatientGroupNum(doctor,groupIds));
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
@ -198,7 +233,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
                                       @ApiParam(name = "patient", value = "patient")
                                       @RequestParam(value = "patient", required = false) String patient) throws Exception {
        return success(basePatientService.findPatientInfoById(patient,doctor));
        try {
            return success(basePatientService.findPatientInfoById(patient,doctor));
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
}

+ 7 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/analysis/AnalysisEndPoint.java

@ -40,8 +40,13 @@ public class AnalysisEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "endTime", value = "endTime", required = true)
            @RequestParam(value = "endTime", required = false)String endTime)throws Exception{
        Object num = analysisService.queryAnalysis(doctor,startTime,endTime);
        return success(num);
        try {
            Object num = analysisService.queryAnalysis(doctor,startTime,endTime);
            return success(num);
        }catch (Exception e){
            return failedException(e);
        }
    }

+ 212 - 125
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -85,34 +85,39 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		if(StringUtils.isBlank(filters)){
			filters=filters+"del=1";
		}else{
			filters=filters+";del=1";
		}
		
		List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
		for (KnowledgeArticleDO knowledgeArticleDO:list){
			List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
			if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
				BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
				knowledgeArticleDO.setDeptName(doctorHospitalDO.getDeptName());
				knowledgeArticleDO.setHospitalName(doctorHospitalDO.getOrgName());
		try {
			if(StringUtils.isBlank(filters)){
				filters=filters+"del=1";
			}else{
				filters=filters+";del=1";
			}
			KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(knowledgeArticleDO.getId(),getUID());
			if (knowledgeArticleUserDO!=null){
				if (knowledgeArticleUserDO.getUsed()!=null&&knowledgeArticleUserDO.getUsed()==1){
					knowledgeArticleDO.setIsUsed(1);
			List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
			for (KnowledgeArticleDO knowledgeArticleDO:list){
				List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
				if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
					BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
					knowledgeArticleDO.setDeptName(doctorHospitalDO.getDeptName());
					knowledgeArticleDO.setHospitalName(doctorHospitalDO.getOrgName());
				}
				KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(knowledgeArticleDO.getId(),getUID());
				if (knowledgeArticleUserDO!=null){
					if (knowledgeArticleUserDO.getUsed()!=null&&knowledgeArticleUserDO.getUsed()==1){
						knowledgeArticleDO.setIsUsed(1);
					}
				}
			}
			List<KnowledgeArticleDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
			JSONObject result = new JSONObject();
			result.put("total",totals.size());
			result.put("detailModelList",list);
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
		List<KnowledgeArticleDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
		
		JSONObject result = new JSONObject();
		result.put("total",totals.size());
		result.put("detailModelList",list);
		
		return success(result);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.queryById)
@ -120,18 +125,22 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	public Envelop queryByCode(
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id) throws Exception{
			KnowledgeArticleDO articleDO = knowledgeArticleService.retrieve(id);
			KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(articleDO.getId(),getUID());
			if (knowledgeArticleUserDO!=null){
				articleDO.setIsUsed(knowledgeArticleUserDO.getUsed());
				articleDO.setKnowledgeArticleUserDO(knowledgeArticleUserDO);
			}
			List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(articleDO.getCreateUser());
			if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
				articleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
				articleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
			try {
				KnowledgeArticleDO articleDO = knowledgeArticleService.retrieve(id);
				KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(articleDO.getId(),getUID());
				if (knowledgeArticleUserDO!=null){
					articleDO.setIsUsed(knowledgeArticleUserDO.getUsed());
					articleDO.setKnowledgeArticleUserDO(knowledgeArticleUserDO);
				}
				List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(articleDO.getCreateUser());
				if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
					articleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
					articleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
				}
				return success(articleDO);
			}catch (Exception e){
				return failedException(e);
			}
		return success(articleDO);
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.deleteById)
@ -139,8 +148,12 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	public Envelop deleteById(
			@ApiParam(name = "id", value = "id,多个使用英文逗号分隔", required = true)
			@RequestParam(value = "id", required = true)String id)throws Exception {
			knowledgeArticleService.delArticle(id);
			return success("操作成功");
			try {
				knowledgeArticleService.delArticle(id);
				return success("操作成功");
			}catch (Exception e){
				return failedException(e);
			}
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveArticle)
@ -148,8 +161,13 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	public Envelop saveArticle(
			@ApiParam(name = "jsonData", value = "Json数据", required = true)
			@RequestParam String jsonData)throws Exception {
		knowledgeArticleService.saveArticle(jsonData);
		return success("操作成功");
		try {
			knowledgeArticleService.saveArticle(jsonData);
			return success("操作成功");
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.reviewArticle)
@ -162,8 +180,12 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "reason", value = "退回理由")
			@RequestParam(value = "reason", required = false) String reason
	)throws Exception {
		knowledgeArticleService.reviewArticle(articleId,status,reason);
		return success("操作成功");
		try {
			knowledgeArticleService.reviewArticle(articleId,status,reason);
			return success("操作成功");
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	
@ -180,14 +202,19 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		List<KnowledgeCategoryDO> list  = knowledgeCategoryService.search(fields,filters,sorts,page,pageSize);
		List<KnowledgeCategoryDO> result = new ArrayList<>();
		for(KnowledgeCategoryDO knowledgeCategoryDO:list){
			if(knowledgeCategoryDO.getDel() == 1){
				result.add(knowledgeCategoryDO);
		try {
			List<KnowledgeCategoryDO> list  = knowledgeCategoryService.search(fields,filters,sorts,page,pageSize);
			List<KnowledgeCategoryDO> result = new ArrayList<>();
			for(KnowledgeCategoryDO knowledgeCategoryDO:list){
				if(knowledgeCategoryDO.getDel() == 1){
					result.add(knowledgeCategoryDO);
				}
			}
			return success(result);
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
		return success(result);
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.saveCategory)
@ -195,8 +222,13 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	public Envelop saveCategory(
			@ApiParam(name = "jsonData", value = "Json数据", required = true)
			@RequestParam String jsonData)throws Exception {
		knowledgeCategoryService.saveCategory(jsonData);
		return success("操作成功");
		try {
			knowledgeCategoryService.saveCategory(jsonData);
			return success("操作成功");
		} catch (Exception e){
			return failedException(e);
		}
	}
	
	@PostMapping (value = BaseHospitalRequestMapping.KnowledgeArticle.updateDel)
@ -204,11 +236,16 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	public Envelop updateDel(
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id)throws Exception {
		Boolean flag = knowledgeCategoryService.updateDel(id);
		if (flag) {
			return success("操作成功");
		}else{
			return failed("操作失败");
		try {
			Boolean flag = knowledgeCategoryService.updateDel(id);
			if (flag) {
				return success("操作成功");
			}else{
				return failed("操作失败");
			}
		}catch (Exception e){
			return failedException(e);
		}
		
	}
@ -219,21 +256,34 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	                                 @RequestParam(value = "articleId",required = true)String articleId,
	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
	                                 @RequestParam(value = "sdJsons",required = true)String sdJsons)throws Exception {
		return success(knowledgeArticleService.saveArticleDept(articleId,sdJsons));
		try {
			return success(knowledgeArticleService.saveArticleDept(articleId,sdJsons));
		}catch (Exception e){
			return failedObjEnvelopException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findDeptByArticle)
	@ApiOperation(value = "查询文章下的科室")
	public ListEnvelop findDeptByArticle(@ApiParam(name = "articleId", value = "文章ID")
	                                    @RequestParam(value = "articleId",required = true)String articleId)throws Exception {
		return success(knowledgeArticleService.findDeptByArticle(articleId));
		try {
			return success(knowledgeArticleService.findDeptByArticle(articleId));
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByDept)
	@ApiOperation(value = "查询部门下发放的文章")
	public ListEnvelop findArticleByDept(@ApiParam(name = "dept", value = "科室")
	                                    @RequestParam(value = "dept",required = true)String dept)throws Exception {
		return success(knowledgeArticleService.findArticleByDept(dept));
		try {
			return success(knowledgeArticleService.findArticleByDept(dept));
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.saveDeptArticle)
@ -242,7 +292,12 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	                                 @RequestParam(value = "dept",required = true)String dept,
	                                 @ApiParam(name = "sdJsons", value = "部门与科室关系json")
	                                 @RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
		return success(knowledgeArticleService.saveDeptArticle(dept,sdJsons));
		try {
			return success(knowledgeArticleService.saveDeptArticle(dept,sdJsons));
		}catch (Exception e){
			return failedObjEnvelopException(e);
		}
	}
@ -250,16 +305,21 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	@ApiOperation(value = "发送文章/问卷")
	public ListEnvelop sendPatientBusiness(@ApiParam(name = "json", value = "患者业务关联表")
									  @RequestParam(value = "json",required = false)String json)throws Exception {
		ListEnvelop listEnvelop = new ListEnvelop();
		JSONArray jsonArray = JSONArray.parseArray(json);
		List<BasePatientBusinessDO> patientBusinessDOList = new ArrayList<>();
		for (int i=0;i<jsonArray.size();i++){
			JSONObject jsonObject = jsonArray.getJSONObject(i);
			BasePatientBusinessDO patientBusinessDO = toEntity(jsonObject.toJSONString(),BasePatientBusinessDO.class);
			patientBusinessDOList.add(patientBusinessDO);
		try {
			ListEnvelop listEnvelop = new ListEnvelop();
			JSONArray jsonArray = JSONArray.parseArray(json);
			List<BasePatientBusinessDO> patientBusinessDOList = new ArrayList<>();
			for (int i=0;i<jsonArray.size();i++){
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				BasePatientBusinessDO patientBusinessDO = toEntity(jsonObject.toJSONString(),BasePatientBusinessDO.class);
				patientBusinessDOList.add(patientBusinessDO);
			}
			listEnvelop.setDetailModelList(knowledgeArticleService.sendBusinessToPatient(patientBusinessDOList));
			return  listEnvelop;
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
		listEnvelop.setDetailModelList(knowledgeArticleService.sendBusinessToPatient(patientBusinessDOList));
		return  listEnvelop;
	}
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setArticleUsed)
@ -270,7 +330,11 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
									  @RequestParam(value = "used",required = false)Integer used,
									 @ApiParam(name = "doctor", value = "医生code")
										 @RequestParam(value = "doctor",required = false)String doctor)throws Exception {
		return success(knowledgeArticleService.setUsed(id,used,doctor));
		try {
			return success(knowledgeArticleService.setUsed(id,used,doctor));
		}catch (Exception e){
			return failedObjEnvelopException(e);
		}
}
@ -287,43 +351,48 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		if(StringUtils.isBlank(filters)){
			filters=filters+"del=1";
		}else{
			filters=filters+";del=1";
		}
		List<BasePatientBusinessDO> list  = patientBusinessService.search(fields,filters,sorts,page,pageSize);
		for (BasePatientBusinessDO patientBusinessDO:list){
			Integer type = patientBusinessDO.getRelationType();
			if (type==1){
				KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleService.selectById(patientBusinessDO.getRelationCode());
				if (knowledgeArticleDO!=null){
					List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
					if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
						knowledgeArticleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
						knowledgeArticleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
		try {
			if(StringUtils.isBlank(filters)){
				filters=filters+"del=1";
			}else{
				filters=filters+";del=1";
			}
			List<BasePatientBusinessDO> list  = patientBusinessService.search(fields,filters,sorts,page,pageSize);
			for (BasePatientBusinessDO patientBusinessDO:list){
				Integer type = patientBusinessDO.getRelationType();
				if (type==1){
					KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleService.selectById(patientBusinessDO.getRelationCode());
					if (knowledgeArticleDO!=null){
						List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
						if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
							knowledgeArticleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
							knowledgeArticleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
						}
					}
					patientBusinessDO.setKnowledgeArticleDO(knowledgeArticleDO);
					KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(patientBusinessDO.getRelationCode(),patientBusinessDO.getPatient());
					if (knowledgeArticleUserDO!=null){
						patientBusinessDO.setIsRead(knowledgeArticleUserDO.getIsRead());
						patientBusinessDO.setShare(knowledgeArticleUserDO.getShare());
						patientBusinessDO.setFabulous(knowledgeArticleUserDO.getFabulous());
						patientBusinessDO.setCollection(knowledgeArticleUserDO.getCollection());
					}
				}
				patientBusinessDO.setKnowledgeArticleDO(knowledgeArticleDO);
				KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(patientBusinessDO.getRelationCode(),patientBusinessDO.getPatient());
				if (knowledgeArticleUserDO!=null){
					patientBusinessDO.setIsRead(knowledgeArticleUserDO.getIsRead());
					patientBusinessDO.setShare(knowledgeArticleUserDO.getShare());
					patientBusinessDO.setFabulous(knowledgeArticleUserDO.getFabulous());
					patientBusinessDO.setCollection(knowledgeArticleUserDO.getCollection());
				}
			}
		}
		List<BasePatientBusinessDO> totals  = patientBusinessService.search(fields,filters,sorts);
			}
			List<BasePatientBusinessDO> totals  = patientBusinessService.search(fields,filters,sorts);
		JSONObject result = new JSONObject();
		result.put("total",totals.size());
		result.put("detailModelList",list);
			JSONObject result = new JSONObject();
			result.put("total",totals.size());
			result.put("detailModelList",list);
		return success(result);
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
	}
@ -339,7 +408,12 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
											   @RequestParam(value = "user",required = true)String user,
										   @ApiParam(name = "userType", value = "用户类型(1患者2医生)")
											   @RequestParam(value = "userType",required = true)String userType)throws Exception {
		return success(patientBusinessService.setCollectionById(id,flag,status,user,userType));
		try {
			return success(patientBusinessService.setCollectionById(id,flag,status,user,userType));
		}catch (Exception e){
			return failedObjEnvelopException(e);
		}
	}
@ -356,33 +430,38 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		if(StringUtils.isBlank(filters)){
			filters=filters+"del=1";
		}else{
			filters=filters+";del=1";
		}
		List<KnowledgeArticleUserDO> list  = knowledgeArticleUserService.search(fields,filters,sorts,page,pageSize);
		for (KnowledgeArticleUserDO knowledgeArticleUserDO:list){
			Integer type = knowledgeArticleUserDO.getRelationType();
			if (type==1){
				KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleService.selectById(knowledgeArticleUserDO.getRelationCode());
				if (knowledgeArticleDO!=null){
					List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
					if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
						knowledgeArticleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
						knowledgeArticleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
		try {
			if(StringUtils.isBlank(filters)){
				filters=filters+"del=1";
			}else{
				filters=filters+";del=1";
			}
			List<KnowledgeArticleUserDO> list  = knowledgeArticleUserService.search(fields,filters,sorts,page,pageSize);
			for (KnowledgeArticleUserDO knowledgeArticleUserDO:list){
				Integer type = knowledgeArticleUserDO.getRelationType();
				if (type==1){
					KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleService.selectById(knowledgeArticleUserDO.getRelationCode());
					if (knowledgeArticleDO!=null){
						List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
						if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
							knowledgeArticleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
							knowledgeArticleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
						}
					}
					knowledgeArticleUserDO.setKnowledgeArticleDO(knowledgeArticleDO);
				}
				knowledgeArticleUserDO.setKnowledgeArticleDO(knowledgeArticleDO);
			}
		}
		List<KnowledgeArticleUserDO> totals  = knowledgeArticleUserService.search(fields,filters,sorts);
		JSONObject result = new JSONObject();
		result.put("total",totals.size());
		result.put("detailModelList",list);
			List<KnowledgeArticleUserDO> totals  = knowledgeArticleUserService.search(fields,filters,sorts);
			JSONObject result = new JSONObject();
			result.put("total",totals.size());
			result.put("detailModelList",list);
		return success(result);
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
	}
	@PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByCategoryAndName)
@ -404,8 +483,12 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.getArticleGroup)
	@ApiOperation(value = "查询分类")
	public MixEnvelop getGroup(){
		MixEnvelop envelop = knowledgeCategoryService.findAllGroup();
		return envelop;
		try {
			MixEnvelop envelop = knowledgeCategoryService.findAllGroup();
			return envelop;
		}catch (Exception e){
			return failedMixEnvelopException(e);
		}
	}
@ -419,6 +502,10 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
												   @ApiParam(name = "pageSize", value = "分页大小)")
												   @RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
		return success(knowledgeArticleService.findPatientFavorite(patient,page,pageSize));
		try {
			return success(knowledgeArticleService.findPatientFavorite(patient,page,pageSize));
		}catch (Exception e){
			return failedException(e);
		}
	}
}

+ 55 - 26
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -68,11 +68,15 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "/getCity")
    @ApiOperation(value = "获取市列表信息", notes = "基础数据获取")
    public Envelop getCity() throws Exception {
        List<BaseCityDO> res =  cityService.getAllCity();
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取市列表信息!");
        try {
            List<BaseCityDO> res =  cityService.getAllCity();
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取市列表信息!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -87,11 +91,16 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "cityCode", required = false) String cityCode,
            @ApiParam(name = "level", value = "等级医院,1等级医院,2.社区医院")
            @RequestParam(value = "level", required = false) Integer level) {
        List<BaseOrgDO> res =  baseOrgInfoService.getOrgByCity(cityCode,level);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("该市未维护医院信息!");
        try {
            List<BaseOrgDO> res =  baseOrgInfoService.getOrgByCity(cityCode,level);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("该市未维护医院信息!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -107,11 +116,16 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "consultDeptFlag", value = "是否是就诊科室,1为查询门诊,不传为全部")
            @RequestParam(value = "consultDeptFlag", required = false) String consultDeptFlag)  {
        List<DictHospitalDeptDO> res =  hospitalDeptService.getHosDeptByCode(orgCode,consultDeptFlag);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的部门列表信息!");
        try {
            List<DictHospitalDeptDO> res =  hospitalDeptService.getHosDeptByCode(orgCode,consultDeptFlag);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取该机构的部门列表信息!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -127,11 +141,16 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "deptCode", value = "部门编码")
            @RequestParam(value = "deptCode", required = false) String deptCode) {
        List<BaseDoctorHospitalDO> res =  baseDoctorHosService.getDoctorByOrgAndDept(orgCode,deptCode);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构科室下的医生信息!");
        try {
            List<BaseDoctorHospitalDO> res =  baseDoctorHosService.getDoctorByOrgAndDept(orgCode,deptCode);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取该机构科室下的医生信息!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -144,11 +163,16 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    public Envelop getJobBySaasId(
            @ApiParam(name = "saasId", value = "租户ID,当为空的情况下查询所有")
            @RequestParam(value = "saasId", required = false) String saasId)  {
        List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的职称信息!");
        try {
            List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取该机构的职称信息!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -158,7 +182,12 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取街道信息", notes = "获取街道信息")
    public Envelop findByTown(@ApiParam(name = "town", value = "区级code")
                              @RequestParam(value = "town", required = true) String town)  {
        return success(baseStreetService.findByTown(town));
        try {
            return success(baseStreetService.findByTown(town));
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value = "/findWlyyHospital")

+ 46 - 16
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -49,7 +49,12 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "页码", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize") int pageSize) throws Exception {
        return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
        try{
            return baseDoctorService.queryList(city,hospital,status,name,type,typeCode,dept,page,pageSize);
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -61,11 +66,16 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "typeCode", value = "分部,无不传")
            @RequestParam(value = "typeCode", required = false)String typeCode)throws Exception{
        Object object = baseDoctorService.queryById(doctorId,typeCode);
        if (null != object){
            return success("查询成功",object);
        try {
            Object object = baseDoctorService.queryById(doctorId,typeCode);
            if (null != object){
                return success("查询成功",object);
            }
            return failed("查询失败");
        }catch (Exception e){
            return failedException(e);
        }
        return failed("查询失败");
    }
@ -74,12 +84,17 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    public Envelop update(
            @ApiParam(name = "baseDoctorVo", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVo") String baseDoctorVo)throws Exception{
        JSONObject jsonObject = JSONObject.fromObject(baseDoctorVo);
        Boolean update = baseDoctorService.update(jsonObject);
        if (!update){
            return failed("保存失败,参数不可为空");
        try {
            JSONObject jsonObject = JSONObject.fromObject(baseDoctorVo);
            Boolean update = baseDoctorService.update(jsonObject);
            if (!update){
                return failed("保存失败,参数不可为空");
            }
            return success("保存成功");
        }catch (Exception e){
            return failedException(e);
        }
        return success("保存成功");
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateList)
@ -87,9 +102,14 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    public Envelop updateList(
            @ApiParam(name = "baseDoctorVos", value = "JSON数据", required = true)
            @RequestParam(value = "baseDoctorVos") String baseDoctorVos)throws Exception{
        JSONArray jsonArray = JSONArray.fromObject(baseDoctorVos);
        Boolean update = baseDoctorService.updateList(jsonArray);
        return success("保存成功");
        try {
            JSONArray jsonArray = JSONArray.fromObject(baseDoctorVos);
            Boolean update = baseDoctorService.updateList(jsonArray);
            return success("保存成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -100,9 +120,14 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "doctorId", required = true) String doctorId,
            @ApiParam(name = "status", value = "状态")
            @RequestParam(value = "status", required = true) String status)throws Exception{
        baseDoctorService.updateStatus(doctorId,status);
        return success("修改成功");
        try {
            baseDoctorService.updateStatus(doctorId,status);
            return success("修改成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.DoctorSetting.updateDoctorPw)
@ -113,6 +138,11 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
                                  @RequestParam(value = "pw", required = true)String pw,
                                  @ApiParam(name = "orgPw", value = "原密码")
                                  @RequestParam(value = "orgPw", required = true)String orgPw)throws Exception{
        return success(baseDoctorService.updateDoctorPw(id,pw,orgPw));
        try {
            return success(baseDoctorService.updateDoctorPw(id,pw,orgPw));
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 39 - 24
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/ConsultPriceEndpoint.java

@ -41,28 +41,33 @@ public class ConsultPriceEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "json_data", value = "JSON数据", required = true, defaultValue = "15")
            @RequestParam(value = "json_data") String jsonData ) throws Exception {
        int flag = -1;
        WlyyHospitalConsultPriceDO wlyyHospitalConsultPriceDO = new WlyyHospitalConsultPriceDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        String hospital = dataDetail.get("hospital").toString();
        // 获取到职称及服务对象列表,拆分成json数组,再进行处理
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if (array.size() > 0) {
        try {
            int flag = -1;
            WlyyHospitalConsultPriceDO wlyyHospitalConsultPriceDO = new WlyyHospitalConsultPriceDO();
            Map dataDetail  = JSONObject.fromObject(jsonData);
            String hospital = dataDetail.get("hospital").toString();
            // 获取到职称及服务对象列表,拆分成json数组,再进行处理
            String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
            JSONArray array = JSONArray.fromObject(data);
            if (array.size() > 0) {
                for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                wlyyHospitalConsultPriceDO = consultPriceService.saveConsultPrice(jsonObject,hospital);
                if(wlyyHospitalConsultPriceDO != null){
                    flag = 0;
                }else{
                    break;
                    JSONObject jsonObject = array.getJSONObject(i);
                    wlyyHospitalConsultPriceDO = consultPriceService.saveConsultPrice(jsonObject,hospital);
                    if(wlyyHospitalConsultPriceDO != null){
                        flag = 0;
                    }else{
                        break;
                    }
                }
            }
        }
        if(flag == 0){
            return success("新增咨费成功!");
        }else{
            return failed("新增咨费失败!");
            if(flag == 0){
                return success("新增咨费成功!");
            }else{
                return failed("新增咨费失败!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -80,9 +85,14 @@ public class ConsultPriceEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<WlyyHospitalConsultPriceDO> wlyyHospitalConsultPriceDOS = consultPriceService.search(fields, filters, sorts, page, size);
        int count = (int) consultPriceService.getCount(filters);
        return success(wlyyHospitalConsultPriceDOS, count, page, size, WlyyHospitalConsultPriceVO.class);
        try {
            List<WlyyHospitalConsultPriceDO> wlyyHospitalConsultPriceDOS = consultPriceService.search(fields, filters, sorts, page, size);
            int count = (int) consultPriceService.getCount(filters);
            return success(wlyyHospitalConsultPriceDOS, count, page, size, WlyyHospitalConsultPriceVO.class);
        }catch (Exception e){
            return failedPageEnvelopException(e);
        }
    }
@ -93,8 +103,13 @@ public class ConsultPriceEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "id", value = "唯一标识ID")
            @RequestParam(value = "id", required = false) String id) {
        consultPriceService.deleteConsultPrice(id);
        return success("删除成功!");
        try {
            consultPriceService.deleteConsultPrice(id);
            return success("删除成功!");
        }catch (Exception e){
            return failedException(e);
        }
    }
}

Plik diff jest za duży
+ 293 - 161
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java


+ 262 - 168
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -183,7 +183,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@ApiParam(name = "doctorName", value = "医生名字")
								@RequestParam(value = "doctorName",required = false) String doctorName
								)throws Exception{
		List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus,doctorName);
		
		/*if (data != null) {
			for (ConsultVO consult : data) {
@ -217,12 +217,18 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			}
		}*/
		
		Long total = imService.countConsultRecordByPatient(patient, id,type,title);
		
		JSONObject result = new JSONObject();
		result.put("total",total);
		result.put("list",data);
		return success(result);
		try {
			List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus,doctorName);
			Long total = imService.countConsultRecordByPatient(patient, id,type,title);
			JSONObject result = new JSONObject();
			result.put("total",total);
			result.put("list",data);
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.isExistsUnfinishedConsult)
@ -233,12 +239,17 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = true) String patient)throws Exception {
		
		if(StringUtils.isEmpty(patient)){
			patient= getUID();
		try {
			if(StringUtils.isEmpty(patient)){
				patient= getUID();
			}
			String consultCode = imService.getUnfinishedConsult(patient, doctor);
			return success("请求成功",consultCode);
		}catch (Exception e){
			return failedException(e);
		}
		
		String consultCode = imService.getUnfinishedConsult(patient, doctor);
		return success("请求成功",consultCode);
	}
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.isExistsUnfinishedOutpatient)
	@ApiOperation(value = "查询居民与某个医生是否存在未结束的专家咨询")
@ -248,12 +259,17 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = true) String patient)throws Exception {
		if(StringUtils.isEmpty(patient)){
			patient= getUID();
		}
		String consultCode = imService.getUnfinishedConsult2(patient, doctor);
		return success("请求成功",consultCode);
		try {
			if(StringUtils.isEmpty(patient)){
				patient= getUID();
			}
			String consultCode = imService.getUnfinishedConsult2(patient, doctor);
			return success("请求成功",consultCode);
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.participants)
@ -262,8 +278,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "sessionId", value = "会话ID")
			@RequestParam(value = "sessionId",required = true) String sessionId)throws Exception{
		
		JSONArray participants = imService.getSessions(sessionId);
		return success(participants);
		try {
			JSONArray participants = imService.getSessions(sessionId);
			return success(participants);
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.getSessionMessage)
@ -279,8 +300,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page",required = true) int page,
			@ApiParam(name = "pagesize", value = "分页数")
			@RequestParam(value = "pagesize",required = true) int pagesize)throws Exception{
		JSONArray messageArray = imService.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getUID());
		return success(messageArray);
		try {
			JSONArray messageArray = imService.getSessionMessage(sessionId, startMsgId, endMsgId, page, pagesize, getUID());
			return success(messageArray);
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.intoTopic)
@ -291,15 +317,20 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "patientCode", value = "居民CODE")
			@RequestParam(value = "patientCode",required = true) String patientCode
			){
		int result = imService.intoTopic(consult,patientCode,"");
		if(result==-1){
			return failed("该咨询不是进行中");
		}
		try {
			int result = imService.intoTopic(consult,patientCode,"");
			if(result==-1){
				return failed("该咨询不是进行中");
			}
//		org.json.JSONObject json = new org.json.JSONObject();
//		json.put("consult",consult);
//		json.put("content","进入咨询");
//		BusinessLogs.info(BusinessLogs.BusinessType.consult, getUID(), getRepUID(), json);
		return success("进入成功");
			return success("进入成功");
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.append)
@ -317,56 +348,61 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "wechat_appid",required = false) String wechat_appid,
			@ApiParam(name = "patientCode", value = "居民CODE")
			@RequestParam(value = "patientCode",required = false) String patientCode) throws Exception {
		List<String> failed = new ArrayList<>();
		
		//处理语音文件
		if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
			
		try {
			List<String> failed = new ArrayList<>();
			//处理语音文件
			if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
//			imService.getInputStream("1",wechat_appid);
			
			if(3 == type){//语音文件
				String voicepath = imService.fetchWxVoices(wechat_appid);
				logger.info("voice_path:"+voicepath);
				JSONObject obj = new JSONObject();
				String voiceurl = "";
				// 将临时语音拷贝到正式存储路径下
				if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
					if("xm_ihealth_wx".equals(wechat_appid)){
						logger.info("voice_wx_type:"+wechat_appid);
						voiceurl = fileUploadService.uploadWxVoice(voicepath);
				if(3 == type){//语音文件
					String voicepath = imService.fetchWxVoices(wechat_appid);
					logger.info("voice_path:"+voicepath);
					JSONObject obj = new JSONObject();
					String voiceurl = "";
					// 将临时语音拷贝到正式存储路径下
					if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("voice_wx_type:"+wechat_appid);
							voiceurl = fileUploadService.uploadWxVoice(voicepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
					}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
						voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
						logger.info(voiceurl);
					}else {
						voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
						}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
							voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
							logger.info(voiceurl);
						}else {
							voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
						}
						obj.put("path", voiceurl);
						obj.put("times", times);
						content = obj.toString();
					}
					obj.put("path", voiceurl);
					obj.put("times", times);
					content = obj.toString();
				}
			}else if(2 == type){//图片文件
				String imagepath = imService.fetchWxImages(wechat_appid);
				logger.info("image_path:"+imagepath);
				JSONObject obj = new JSONObject();
				String imgeUrl = "";
				// 将临时语音拷贝到正式存储路径下
				if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
					if("xm_ihealth_wx".equals(wechat_appid)){
						logger.info("imge_wx_type:"+wechat_appid);
						imgeUrl = fileUploadService.uploadWxImage(imagepath);
				}else if(2 == type){//图片文件
					String imagepath = imService.fetchWxImages(wechat_appid);
					logger.info("image_path:"+imagepath);
					JSONObject obj = new JSONObject();
					String imgeUrl = "";
					// 将临时语音拷贝到正式存储路径下
					if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("imge_wx_type:"+wechat_appid);
							imgeUrl = fileUploadService.uploadWxImage(imagepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
					}else{
						imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
						}else{
							imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
						}
						content = imgeUrl;
					}
					content = imgeUrl;
				}
			}else{}
				}else{}
			}
			failed = imService.append(consult,content,type,times,patientCode,wechat_appid);
			return success(failed);
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
		
		failed = imService.append(consult,content,type,times,patientCode,wechat_appid);
		return success(failed);
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDiseaseAndDept)
@ -407,19 +443,29 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	                                                     @RequestParam(value = "pagesize",required = false) Integer pagesize
	) throws Exception{
		logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
		return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
				orgCode,dept,
				diseaseKey,doctorNameKey,
				jobTitleNameKey,outpatientType,
				keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
		try {
			logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
			return prescriptionService.findDoctorByHospitalAndDiseaseAndDept(iswork,patientid,
					orgCode,dept,
					diseaseKey,doctorNameKey,
					jobTitleNameKey,outpatientType,
					keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
		}catch (Exception e){
			return failedMixEnvelopException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.Prescription.findHotDeptAndDiseaseDict)
	@ApiOperation(value = "获取常见疾病、热门部门、医生拒绝接诊原因 字典", notes = "获取常见疾病、热门部门、医生拒绝接诊原因 字典")
	public ListEnvelop findHotDeptAndDiseaseDict(@ApiParam(name = "dictName", value = "dictName")
	                                             @RequestParam(value = "dictName", required = true,defaultValue = "ONLINE_HOSPITAL_DEPT_350211A1002")String dictName)throws Exception{
		return success(prescriptionService.findHotDeptAndDiseaseDict(dictName));
		try {
			return success(prescriptionService.findHotDeptAndDiseaseDict(dictName));
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.add)
	@ApiOperation(value = "居民添加咨询接口", notes = "居民添加咨询接口")
@ -622,13 +668,18 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	public Envelop patientInfo(
			@ApiParam(name = "patient", value = "居民CODE")
			@RequestParam(value = "patient",required = false) String patient) throws Exception {
		BasePatientDO result = basePatientService.findByIdAndDel(patient);
		//---居民性别取身份证字段--
		result.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(result.getIdcard())));
		if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
			familyMemberService.saveYktFamily(patient);
		try {
			BasePatientDO result = basePatientService.findByIdAndDel(patient);
			//---居民性别取身份证字段--
			result.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(result.getIdcard())));
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				familyMemberService.saveYktFamily(patient);
			}
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
		return success(result);
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.finish)
@ -716,7 +767,11 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	public Envelop getTopic(
			@ApiParam(name = "consult", value = "咨询CODE")
			@RequestParam(value = "consult",required = false) String consult)throws Exception {
		return success("请求成功",imService.getTopic(consult));
		try {
			return success("请求成功",imService.getTopic(consult));
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.getConsultCodeByOutpatientId)
@ -724,7 +779,12 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	public Envelop getConsultCodeByOutpatientId(
			@ApiParam(name = "outpatientid", value = "复诊ID")
			@RequestParam(value = "outpatientid",required = true) String outpatientid)throws Exception {
		return success("请求成功",imService.getConsultCodeByOutpatientId(outpatientid));
		try {
			return success("请求成功",imService.getConsultCodeByOutpatientId(outpatientid));
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.evaluationByConsultCode)
@ -741,8 +801,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
//		if(StringUtils.isEmpty(scoreContent)){
//			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
//		}
		imService.evaluationByConsultCode(consult,scoreContent,type,bannerList);
		return success("请求成功");
		try {
			imService.evaluationByConsultCode(consult,scoreContent,type,bannerList);
			return success("请求成功");
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.PatientIM.getEvaluationByConsultCode)
@ -753,8 +818,12 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
//		if(StringUtils.isEmpty(scoreContent)){
//			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
//		}
		
		return success("请求成功",imService.getEvaluationByConsultCode(consult));
		try {
			return success("请求成功",imService.getEvaluationByConsultCode(consult));
		}catch (Exception e){
			return failedListEnvelopException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.getSign)
@ -763,27 +832,32 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	                       @RequestParam(value = "pageUrl", required = true)String pageUrl,
	                       @ApiParam(name = "wxId", value = "微信id")
	                       @RequestParam(value = "wxId", required = true)String wxId) throws Exception {
		logger.info("pageUrl="+pageUrl);
		logger.info("wxId="+wxId);
		String ticket = wechatInfoService.getJsapi_ticketByToken(wxId);
		WxWechatDO wxWechatDO = wechatDao.findById(wxId);
		Map<Object, Object> map = new HashMap<Object, Object>();
		if (ticket != null) {
			String noncestr = UUID.randomUUID().toString();
			long timestamp = System.currentTimeMillis() / 1000;
			String url = pageUrl;
			logger.info("getSign.url="+url);
			String str = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
			logger.info("getSign.str="+str);
			// sha1加密
			String signature = SHA1(str);
			map.put("noncestr", noncestr);
			map.put("timestamp", timestamp);
			map.put("signature", signature);
			map.put("appid", wxWechatDO.getAppId());
			return success(PatientRequestMapping.Wechat.api_success,map);
		try {
			logger.info("pageUrl="+pageUrl);
			logger.info("wxId="+wxId);
			String ticket = wechatInfoService.getJsapi_ticketByToken(wxId);
			WxWechatDO wxWechatDO = wechatDao.findById(wxId);
			Map<Object, Object> map = new HashMap<Object, Object>();
			if (ticket != null) {
				String noncestr = UUID.randomUUID().toString();
				long timestamp = System.currentTimeMillis() / 1000;
				String url = pageUrl;
				logger.info("getSign.url="+url);
				String str = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "&timestamp=" + timestamp + "&url=" + url;
				logger.info("getSign.str="+str);
				// sha1加密
				String signature = SHA1(str);
				map.put("noncestr", noncestr);
				map.put("timestamp", timestamp);
				map.put("signature", signature);
				map.put("appid", wxWechatDO.getAppId());
				return success(PatientRequestMapping.Wechat.api_success,map);
			}
			return failed(PatientRequestMapping.Wechat.api_error);
		}catch (Exception e){
			return failedException(e);
		}
		return failed(PatientRequestMapping.Wechat.api_error);
	}
	
	/**
@ -815,9 +889,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@ApiOperation(value = "导诊的咨询对话", notes = "导诊的咨询对话")
	public Envelop getPatientGuaidenceConsult(@ApiParam(name = "patientCode", value = "居民CODE")
	                       @RequestParam(value = "patientCode", required = true)String patientCode) throws Exception {
		String session_id = patientCode+"_guidance_14";
		session_id = imService.getPatientGuaidenceConsult(patientCode,session_id,null);
		return success(session_id);
		try {
			String session_id = patientCode+"_guidance_14";
			session_id = imService.getPatientGuaidenceConsult(patientCode,session_id,null);
			return success(session_id);
		}catch (Exception e){
			return failedException(e);
		}
	}
@ -827,13 +906,18 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
											  @RequestParam(value = "patientCode", required = true)String patientCode,
											  @ApiParam(name = "type", value = "type")
											  @RequestParam(value = "type", required = false)String type) throws Exception {
		String session_id = null;
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(type)){
			session_id = patientCode+"_guidance_"+type;
		}
		Boolean re = imUtil.sessionIsExist(session_id);
		return success(re);
		try {
			String session_id = null;
			if (org.apache.commons.lang3.StringUtils.isNoneBlank(type)){
				session_id = patientCode+"_guidance_"+type;
			}
			Boolean re = imUtil.sessionIsExist(session_id);
			return success(re);
		}catch (Exception e){
			return failedException(e);
		}
	}
	
@ -845,8 +929,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	                                       @RequestParam(value = "userid", required = true) String userid,
	                                       @ApiParam(name = "olduserid", value = "删除的成员id")
	                                       @RequestParam(value = "olduserid", required = false) String olduserid)throws Exception{
		imService.updateParticipant(sessionid,userid,olduserid);
		return success("操作成功");
		try {
			imService.updateParticipant(sessionid,userid,olduserid);
			return success("操作成功");
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.PatientIM.patientGuaidenceAppend)
@ -871,66 +960,71 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "wechat_appid", value = "wechat_appid", defaultValue = "")
			@RequestParam(value = "wechat_appid", required = false) String wechat_appid
	)throws Exception{
		List<String> failed = new ArrayList<>();
		//处理语音文件
		if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
		try {
			List<String> failed = new ArrayList<>();
			//处理语音文件
			if(!org.springframework.util.StringUtils.isEmpty(wechat_appid)){
//			imService.getInputStream("1",wechat_appid);
			if("3".equalsIgnoreCase(content_type)){//语音文件
				String voicepath = imService.fetchWxVoices(wechat_appid);
				logger.info("voice_path:"+voicepath);
				JSONObject obj = new JSONObject();
				String voiceurl = "";
				// 将临时语音拷贝到正式存储路径下
				if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
					if("xm_ihealth_wx".equals(wechat_appid)){
						logger.info("voice_wx_type:"+wechat_appid);
						voiceurl = fileUploadService.uploadWxVoice(voicepath);
				if("3".equalsIgnoreCase(content_type)){//语音文件
					String voicepath = imService.fetchWxVoices(wechat_appid);
					logger.info("voice_path:"+voicepath);
					JSONObject obj = new JSONObject();
					String voiceurl = "";
					// 将临时语音拷贝到正式存储路径下
					if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("voice_wx_type:"+wechat_appid);
							voiceurl = fileUploadService.uploadWxVoice(voicepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
					}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
						voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
						logger.info(voiceurl);
					}else {
						voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
						}else if ("xm_xzzx_wx".equalsIgnoreCase(wechat_appid)){
							voiceurl = fileUploadService.uploadWxVoiceToEntrance(remote_inner_url,voicepath);
							logger.info(voiceurl);
						}else {
							voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
						}
						obj.put("path", voiceurl);
						obj.put("times", times);
						content = obj.toString();
					}
					obj.put("path", voiceurl);
					obj.put("times", times);
					content = obj.toString();
				}
			}else if("2".equalsIgnoreCase(content_type)){//图片文件
				String imagepath = imService.fetchWxImages(wechat_appid);
				logger.info("image_path:"+imagepath);
				JSONObject obj = new JSONObject();
				String imgeUrl = "";
				// 将临时语音拷贝到正式存储路径下
				if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
					if("xm_ihealth_wx".equals(wechat_appid)){
						logger.info("imge_wx_type:"+wechat_appid);
						imgeUrl = fileUploadService.uploadWxImage(imagepath);
				}else if("2".equalsIgnoreCase(content_type)){//图片文件
					String imagepath = imService.fetchWxImages(wechat_appid);
					logger.info("image_path:"+imagepath);
					JSONObject obj = new JSONObject();
					String imgeUrl = "";
					// 将临时语音拷贝到正式存储路径下
					if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
						if("xm_ihealth_wx".equals(wechat_appid)){
							logger.info("imge_wx_type:"+wechat_appid);
							imgeUrl = fileUploadService.uploadWxImage(imagepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
					}else{
						imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
						}else{
							imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
						}
						content = imgeUrl;
					}
					content = imgeUrl;
				}
			}else{
				}else{
				}
			}
			session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,type);
			String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1",extend);
			List<BaseDoctorRoleDO> doctorRoleDOS = doctorRoleDao.findByRoleCode("guidance");
			for (BaseDoctorRoleDO doctorRoleDO:doctorRoleDOS){
				System.out.println("发送外层SOCKET消息:通知医生导诊");
				JSONObject object = new JSONObject();
				object.put("socket_sms_type",13);
				object.put("relation_code",session_id);
				imService.sendWaiSocketMessage(sender_id,doctorRoleDO.getDoctorCode(),object.toString(),"1");
			}
		}
		session_id = imService.getPatientGuaidenceConsult(sender_id,session_id,type);
		String result = imService.patientGuaidenceAppend(sender_id,sender_name,session_id,content_type,content,"1",extend);
		List<BaseDoctorRoleDO> doctorRoleDOS = doctorRoleDao.findByRoleCode("guidance");
		for (BaseDoctorRoleDO doctorRoleDO:doctorRoleDOS){
			System.out.println("发送外层SOCKET消息:通知医生导诊");
			JSONObject object = new JSONObject();
			object.put("socket_sms_type",13);
			object.put("relation_code",session_id);
			imService.sendWaiSocketMessage(sender_id,doctorRoleDO.getDoctorCode(),object.toString(),"1");
		}
		return success(result);
			return success(result);
		}catch (Exception e){
			return failedException(e);
		}
	}
	
	

+ 30 - 25
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/ReservationSettingEndpoint.java

@ -36,36 +36,41 @@ public class ReservationSettingEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "json_data", value = "JSON数据", required = true, defaultValue = "15")
            @RequestParam(value = "json_data") String jsonData ) throws Exception {
        int flag = -1;
        WlyyHospitalReservationSettingDO wlyyHospitalReservationSettingDO = new WlyyHospitalReservationSettingDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        Map baseInfo = new HashMap();
        String hospital = dataDetail.get("hospital").toString();
        baseInfo.put("city",dataDetail.get("city").toString());
        baseInfo.put("cityName",dataDetail.get("cityName").toString());
        baseInfo.put("town",dataDetail.get("town").toString());
        baseInfo.put("townName",dataDetail.get("townName").toString());
        baseInfo.put("hospital",dataDetail.get("hospital").toString());
        baseInfo.put("hospitalName",dataDetail.get("hospitalName").toString());
        // 获取到职称及服务对象列表,拆分成json数组,再进行处理
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if (array.size() > 0) {
        try {
            int flag = -1;
            WlyyHospitalReservationSettingDO wlyyHospitalReservationSettingDO = new WlyyHospitalReservationSettingDO();
            Map dataDetail  = JSONObject.fromObject(jsonData);
            Map baseInfo = new HashMap();
            String hospital = dataDetail.get("hospital").toString();
            baseInfo.put("city",dataDetail.get("city").toString());
            baseInfo.put("cityName",dataDetail.get("cityName").toString());
            baseInfo.put("town",dataDetail.get("town").toString());
            baseInfo.put("townName",dataDetail.get("townName").toString());
            baseInfo.put("hospital",dataDetail.get("hospital").toString());
            baseInfo.put("hospitalName",dataDetail.get("hospitalName").toString());
            // 获取到职称及服务对象列表,拆分成json数组,再进行处理
            String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
            JSONArray array = JSONArray.fromObject(data);
            if (array.size() > 0) {
                for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                    JSONObject jsonObject = array.getJSONObject(i);
                    wlyyHospitalReservationSettingDO = reservationSettingService.saveReverationSetting(jsonObject,baseInfo);
                if(wlyyHospitalReservationSettingDO != null){
                    flag = 0;
                }else{
                    break;
                    if(wlyyHospitalReservationSettingDO != null){
                        flag = 0;
                    }else{
                        break;
                    }
                }
            }
        }
        if(flag == 0){
            return success("新增服务配置成功!");
        }else{
            return failed("新增服务配置失败!");
            if(flag == 0){
                return success("新增服务配置成功!");
            }else{
                return failed("新增服务配置失败!");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }

+ 71 - 51
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/SysDictEndpoint.java

@ -41,35 +41,40 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "json_data", value = "JSON数据", required = true)
            @RequestParam(value = "json_data") String jsonData )  throws Exception {
        int flag = -1;
        Envelop envelop = new Envelop();
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
        Map dataDetail  = JSONObject.fromObject(jsonData);
        String hospital = dataDetail.get("hospital") == "" ? "": dataDetail.get("hospital") .toString();
        String dictName = dataDetail.get("dictName") == "" ? "": dataDetail.get("dictName") .toString();
        String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
        JSONArray array = JSONArray.fromObject(data);
        if(array.size()>0) {
            for (int i = 0; i < array.size(); i++) {
                JSONObject jsonObject = array.getJSONObject(i);
                wlyyHospitalSysDictDO = sysDictService.saveConsultSetting(jsonObject, hospital, dictName);
                if (wlyyHospitalSysDictDO != null) {
                    flag = 0;
                    continue;
                } else {
                    break;
        try {
            int flag = -1;
            Envelop envelop = new Envelop();
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
            Map dataDetail  = JSONObject.fromObject(jsonData);
            String hospital = dataDetail.get("hospital") == "" ? "": dataDetail.get("hospital") .toString();
            String dictName = dataDetail.get("dictName") == "" ? "": dataDetail.get("dictName") .toString();
            String data = dataDetail.get("data") == "" ? "": dataDetail.get("data") .toString();
            JSONArray array = JSONArray.fromObject(data);
            if(array.size()>0) {
                for (int i = 0; i < array.size(); i++) {
                    JSONObject jsonObject = array.getJSONObject(i);
                    wlyyHospitalSysDictDO = sysDictService.saveConsultSetting(jsonObject, hospital, dictName);
                    if (wlyyHospitalSysDictDO != null) {
                        flag = 0;
                        continue;
                    } else {
                        break;
                    }
                }
            }
            if (flag < 0) {
                return failed("配置新增失败!");
            } else {
                return success("配置新增成功!", wlyyHospitalSysDictDO);
                if (flag < 0) {
                    return failed("配置新增失败!");
                } else {
                    return success("配置新增成功!", wlyyHospitalSysDictDO);
                }
            }else{
                return failed("获取待更新配置项失败!");
            }
        }else{
            return failed("获取待更新配置项失败!");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -87,18 +92,23 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "")
            @RequestParam(value = "dictName", required = false) String dictName ) throws Exception {
        List<WlyyHospitalSysDictDO>  wlyyHospitalSysDictDOS = new ArrayList<WlyyHospitalSysDictDO>();
        wlyyHospitalSysDictDOS = sysDictService.findByHospitalAndDictName(hospital,dictName);
        Map res = new HashMap();
        res.put("hospital",hospital);
        res.put("dictName",dictName);
        if(wlyyHospitalSysDictDOS != null){
            for(WlyyHospitalSysDictDO wlyyHospitalSysDictDO : wlyyHospitalSysDictDOS){
                res.put(wlyyHospitalSysDictDO.getDictCode().toString(),wlyyHospitalSysDictDO.getDictValue().toString());
        try {
            List<WlyyHospitalSysDictDO>  wlyyHospitalSysDictDOS = new ArrayList<WlyyHospitalSysDictDO>();
            wlyyHospitalSysDictDOS = sysDictService.findByHospitalAndDictName(hospital,dictName);
            Map res = new HashMap();
            res.put("hospital",hospital);
            res.put("dictName",dictName);
            if(wlyyHospitalSysDictDOS != null){
                for(WlyyHospitalSysDictDO wlyyHospitalSysDictDO : wlyyHospitalSysDictDOS){
                    res.put(wlyyHospitalSysDictDO.getDictCode().toString(),wlyyHospitalSysDictDO.getDictValue().toString());
                }
                return success("查询配置信息成功!",res);
            }else{
                return failed("配置信息未存储,请先保存!");
            }
            return success("查询配置信息成功!",res);
        }else{
            return failed("配置信息未存储,请先保存!");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -119,19 +129,24 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "dictCode", value = "字典项编码", defaultValue = "")
            @RequestParam(value = "dictCode", required = false) String dictCode ) throws Exception {
        ObjEnvelop objEnvelop = new ObjEnvelop();
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
        wlyyHospitalSysDictDO = sysDictService.findByHospitalAndDictCode(hospital,dictCode);
        if(wlyyHospitalSysDictDO != null){
            objEnvelop.setObj(wlyyHospitalSysDictDO);
            objEnvelop.setStatus(200);
            objEnvelop.setMessage("查询配置信息成功!");
        }else{
            objEnvelop.setStatus(-1);
            objEnvelop.setMessage("对不起,未查询到相关的配置信息!");
        try {
            ObjEnvelop objEnvelop = new ObjEnvelop();
            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = new WlyyHospitalSysDictDO();
            wlyyHospitalSysDictDO = sysDictService.findByHospitalAndDictCode(hospital,dictCode);
            if(wlyyHospitalSysDictDO != null){
                objEnvelop.setObj(wlyyHospitalSysDictDO);
                objEnvelop.setStatus(200);
                objEnvelop.setMessage("查询配置信息成功!");
            }else{
                objEnvelop.setStatus(-1);
                objEnvelop.setMessage("对不起,未查询到相关的配置信息!");
            }
            return objEnvelop;
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
        return objEnvelop;
    }
    
    @Override
@ -148,9 +163,14 @@ public class SysDictEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "dictName", value = "字典名称", required = true)
            @RequestParam(value = "dictName", required = true) String dictName ) throws Exception {
        List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
        return success("查询成功",list);
        try {
            List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
            return success("查询成功",list);
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 56 - 19
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/dict/PrivateDictEndpoint.java

@ -44,8 +44,12 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
                                    @RequestParam(value = "dictCode", required = false) String dictCode,
                                   @ApiParam(name = "hospitalCode", value = "")
                                   @RequestParam(value = "hospitalCode", required = false) String hospitalCode){
        try {
            return success(privateDictService.findByHospitalCodeAndDictCode(dictCode));
        }catch (Exception e){
            return failedException(e);
        }
        return success(privateDictService.findByHospitalCodeAndDictCode(dictCode));
    }
    @PostMapping(value= BaseHospitalRequestMapping.PatientNoLogin.savePrivateDict)
@ -65,15 +69,25 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "hospitalName", required = false)String hospitalName,
            @ApiParam(name = "imgUrl", value = "imgUrl", required = false)
            @RequestParam(value = "imgUrl", required = false)String imgUrl)throws Exception {
        MixEnvelop mixEnvelop =privateDictService.addPrivateDict(id,dictCode,dictName,dictValue,hospitalCode,hospitalName,imgUrl);
        return mixEnvelop;
        try {
            MixEnvelop mixEnvelop =privateDictService.addPrivateDict(id,dictCode,dictName,dictValue,hospitalCode,hospitalName,imgUrl);
            return mixEnvelop;
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @ApiOperation("删除隐私策略")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.delPrivateDict)
    public MixEnvelop delPrivateDict(@ApiParam(name = "id", value = "id", required = true)
                                         @RequestParam(value = "id", required = true)String id){
        MixEnvelop mixEnvelop =privateDictService.deleteById(id);
        return mixEnvelop;
        try {
            MixEnvelop mixEnvelop =privateDictService.deleteById(id);
            return mixEnvelop;
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @ApiOperation("查询字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.findDict)
@ -90,21 +104,34 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
                                @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                    @RequestParam(value = "pageSize", required = false)Integer pageSize){
        return wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value1,page,pageSize);
        try {
            return wlyyHospitalSysDictService.findDictsByNameCode(modelName,name,code,value1,page,pageSize);
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @ApiOperation("删除字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.delDict)
    public Envelop delDict(@ApiParam(name = "id", value = "id", required = true)
                                     @RequestParam(value = "id", required = true)String id){
        return success(wlyyHospitalSysDictService.deleteDictById(id));
        try {
            return success(wlyyHospitalSysDictService.deleteDictById(id));
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @ApiOperation("新增/修改字典")
    @GetMapping(value= BaseHospitalRequestMapping.PatientNoLogin.createOrUpdateDict)
    public Envelop createOrUpdateDict(@ApiParam(name = "json", value = "id", required = true)
                           @RequestParam(value = "json", required = true)String json) throws Exception{
        return success(wlyyHospitalSysDictService.updateOrCreateDict(json));
        try {
            return success(wlyyHospitalSysDictService.updateOrCreateDict(json));
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.SystemMessage.searchMessagePageList)
@ -124,18 +151,23 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
        if(org.apache.commons.lang.StringUtils.isBlank(filters)){
            filters="del=1";
        }else{
            String doctorId = wlyyHospitalSysDictService.findByDoctorMappingCode(filters);
            filters="receiver="+doctorId+";del=1";
            if (StringUtils.isNotBlank(type)){
                filters = filters+";type="+type;
        try {
            if(org.apache.commons.lang.StringUtils.isBlank(filters)){
                filters="del=1";
            }else{
                String doctorId = wlyyHospitalSysDictService.findByDoctorMappingCode(filters);
                filters="receiver="+doctorId+";del=1";
                if (StringUtils.isNotBlank(type)){
                    filters = filters+";type="+type;
                }
            }
            List<SystemMessageDO> list  = systemMessageService.search(fields,filters,sorts,page,pageSize);
            int count = (int) systemMessageService.getCount(filters);
            return success(list, count, page, pageSize, SystemMessageDO.class);
        }catch (Exception e){
            return failedException(e);
        }
        List<SystemMessageDO> list  = systemMessageService.search(fields,filters,sorts,page,pageSize);
        int count = (int) systemMessageService.getCount(filters);
        return success(list, count, page, pageSize, SystemMessageDO.class);
    }
@ -147,7 +179,12 @@ public class PrivateDictEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "jsonParam", required = false) String jsonParam,
            @ApiParam(name = "jsonContent", value = "消息内容")
            @RequestParam(value = "jsonContent", required = false) String jsonContent)throws Exception{
        return success(systemMessageService.commenSystemMessage(jsonParam,jsonContent));
        try {
            return success(systemMessageService.commenSystemMessage(jsonParam,jsonContent));
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 32 - 17
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/drugstore/BaseDrugStoreEndpoint.java

@ -41,14 +41,19 @@ public class BaseDrugStoreEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<BaseDrugStoreDO> baseProvinces = baseDrugStoreService.search(fields, filters, sorts, page, size);
        int count = (int)baseDrugStoreService.getCount(filters);
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(baseProvinces);
        mixEnvelop.setCurrPage(page);
        mixEnvelop.setTotalCount(count);
        mixEnvelop.setPageSize(size);
        return mixEnvelop;
        try {
            List<BaseDrugStoreDO> baseProvinces = baseDrugStoreService.search(fields, filters, sorts, page, size);
            int count = (int)baseDrugStoreService.getCount(filters);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setDetailModelList(baseProvinces);
            mixEnvelop.setCurrPage(page);
            mixEnvelop.setTotalCount(count);
            mixEnvelop.setPageSize(size);
            return mixEnvelop;
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.drugStoreManage.findDrugstoreByDistance)
    @ApiOperation(value = "药店距离查询")
@ -61,10 +66,15 @@ public class BaseDrugStoreEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "drugStoreName", required = false) String drugStoreName,
            @ApiParam(name = "hospitalName", value = "医院名称")
            @RequestParam(value = "hospitalName", required = false) String hospitalName) throws Exception {
        List<BaseDrugStoreDO> list = baseDrugStoreService.countDistanceListIncode(latitude,longitude,drugStoreName,hospitalName);
        MixEnvelop mixEnvelop = new MixEnvelop();
        mixEnvelop.setDetailModelList(list);
        return mixEnvelop;
        try {
            List<BaseDrugStoreDO> list = baseDrugStoreService.countDistanceListIncode(latitude,longitude,drugStoreName,hospitalName);
            MixEnvelop mixEnvelop = new MixEnvelop();
            mixEnvelop.setDetailModelList(list);
            return mixEnvelop;
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseRequestMapping.drugStoreManage.findDrugstoreById)
    @ApiOperation(value = "药店id查询")
@ -74,11 +84,16 @@ public class BaseDrugStoreEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "longitude", required = false) String longitude,
                                        @ApiParam(name = "id", value = "药店id")
                                     @RequestParam(value = "id", required = false) String id){
        BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreService.getById(id,latitude,longitude);
        if (null!=baseDrugStoreDO){
            return success(baseDrugStoreDO);
        }else {
            return failed("查询失败");
        try {
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreService.getById(id,latitude,longitude);
            if (null!=baseDrugStoreDO){
                return success(baseDrugStoreDO);
            }else {
                return failed("查询失败");
            }
        }catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }

+ 7 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/enterprise/EnterpriseController.java

@ -36,7 +36,13 @@ public class EnterpriseController extends EnvelopRestEndpoint {
            @RequestParam(value = "description")String description,
            @ApiParam(name = "url", value = "跳转链接", required = true)
            @RequestParam(value = "url")String url) throws Exception{
        return success(enterpriseService.sendTWMesBymobile( enterpriseId, mobile, title, description, url));
        try {
            return success(enterpriseService.sendTWMesBymobile( enterpriseId, mobile, title, description, url));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value = "/sendTWMesByDoctor")

+ 90 - 31
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java

@ -42,14 +42,19 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                                 @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                             @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                 @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        Integer curPage = (page-1)*pageSize;
        List<BaseDoctorBackgroundDO> list = baseDoctorBGService.getBackground(curPage,pageSize);
        if (list.size()>0){
            return success(list);
        }else {
            return failed("查询失败");
        }
        try {
            Integer curPage = (page-1)*pageSize;
            List<BaseDoctorBackgroundDO> list = baseDoctorBGService.getBackground(curPage,pageSize);
            if (list.size()>0){
                return success(list);
            }else {
                return failed("查询失败");
            }
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("保存医生选择的背景")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.saveDoctorBG)
@ -57,11 +62,17 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                              @RequestParam(value = "doctor", required = false)String doctor,
                          @ApiParam(name = "id", value = "id", required = false)
                          @RequestParam(value = "id", required = false)String id){
        BaseDoctorDO baseDoctorDO = baseDoctorBGService.setDoctorBackground(doctor,id);
        if (null!=baseDoctorDO){
            return success("操作成功");
        }else {
            return failed("操作失败");
        try {
            BaseDoctorDO baseDoctorDO = baseDoctorBGService.setDoctorBackground(doctor,id);
            if (null!=baseDoctorDO){
                return success("操作成功");
            }else {
                return failed("操作失败");
            }
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("新增背景板")
@ -70,19 +81,31 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                          @RequestParam(value = "bgName", required = false)String bgName,
                          @ApiParam(name = "bgUrl", value = "bgUrl", required = false)
                          @RequestParam(value = "bgUrl", required = false)String bgUrl){
        BaseDoctorBackgroundDO baseDoctorBackgroundDO = baseDoctorBGService.createBackground(bgName,bgUrl);
        if (null!=baseDoctorBackgroundDO){
            return success("操作成功");
        }else {
            return failed("操作失败");
        try {
            BaseDoctorBackgroundDO baseDoctorBackgroundDO = baseDoctorBGService.createBackground(bgName,bgUrl);
            if (null!=baseDoctorBackgroundDO){
                return success("操作成功");
            }else {
                return failed("操作失败");
            }
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("删除背景板")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.removeDoctorBG)
    public Envelop removeBg(@ApiParam(name = "id", value = "id", required = false)
                            @RequestParam(value = "id", required = false)String id){
         baseDoctorBGService.deleteBg(id);
        return success("操作成功");
        try {
            baseDoctorBGService.deleteBg(id);
            return success("操作成功");
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("修改背景板")
@ -93,11 +116,17 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                            @RequestParam(value = "bgName", required = false)String bgName,
                            @ApiParam(name = "baUrl", value = "baUrl", required = false)
                            @RequestParam(value = "baUrl", required = false)String baUrl){
        BaseDoctorBackgroundDO baseDoctorBackgroundDO = baseDoctorBGService.updateBackground(id,baUrl,bgName);
        if (null!=baseDoctorBackgroundDO){
            return success("操作成功");
        }else {
            return failed("操作失败");
        try {
            BaseDoctorBackgroundDO baseDoctorBackgroundDO = baseDoctorBGService.updateBackground(id,baUrl,bgName);
            if (null!=baseDoctorBackgroundDO){
                return success("操作成功");
            }else {
                return failed("操作失败");
            }
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
@ -113,16 +142,28 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                                @RequestParam(value = "page", required = false)Integer page,
                            @ApiParam(name = "size", value = "size", required = false)
                                @RequestParam(value = "size", required = false)Integer size){
        List<Map<String,Object>> mapList = baseDoctorBGService.selectByDoctor(doctor,contentType,content,page,size);
        return success(mapList);
        try {
            List<Map<String,Object>> mapList = baseDoctorBGService.selectByDoctor(doctor,contentType,content,page,size);
            return success(mapList);
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("保存医生快捷回复")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.saveDoctorMessage)
    public Envelop saveDoctorMessage(@ApiParam(name = "json", value = "json", required = true)
                                       @RequestParam(value = "json", required = true)String json) throws Exception{
        BaseDoctorMessageDO doctorMessageDO = objectMapper.readValue(json,BaseDoctorMessageDO.class);
        return success(baseDoctorBGService.saveDoctorMessage(doctorMessageDO));
        try {
            BaseDoctorMessageDO doctorMessageDO = objectMapper.readValue(json,BaseDoctorMessageDO.class);
            return success(baseDoctorBGService.saveDoctorMessage(doctorMessageDO));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
@ -130,14 +171,26 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.setMessageHead)
    public Envelop setMessageHead(@ApiParam(name = "id", value = "id", required = true)
                                     @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(baseDoctorBGService.setMessageHead(id));
        try {
            return success(baseDoctorBGService.setMessageHead(id));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @ApiOperation("获取医生快捷回复消息")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.selectMessageById)
    public Envelop selectMessageById(@ApiParam(name = "id", value = "id", required = true)
                                  @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(baseDoctorBGService.selectById(id));
        try {
            return success(baseDoctorBGService.selectById(id));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
@ -145,7 +198,13 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.delDoctorMessage)
    public Envelop delDoctorMessage(@ApiParam(name = "id", value = "id", required = true)
                                  @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(baseDoctorBGService.delDoctorMessage(id));
        try {
            return success(baseDoctorBGService.delDoctorMessage(id));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
    @ApiOperation(value = "订单导出", notes = "订单导出")

+ 34 - 15
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionController.java

@ -37,21 +37,31 @@ public class BaseSuggestionController extends EnvelopRestEndpoint {
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        MixEnvelop mixEnvelop=baseSuggestionService.findSuggestionByType(type,userId,page,pageSize);
        return mixEnvelop;
        try {
            MixEnvelop mixEnvelop=baseSuggestionService.findSuggestionByType(type,userId,page,pageSize);
            return mixEnvelop;
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.saveSuggestion)
    @ApiOperation("新增反馈建议")
    public Envelop saveSuggestion(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        BaseSuggestionDO baseSuggestionDO = toEntity(json, BaseSuggestionDO.class);
        BaseSuggestionDO result = baseSuggestionService.createSuggestion(baseSuggestionDO);
        if (null == result){
            return failed("新增失败");
        }
        return success("新增成功");
        try {
            BaseSuggestionDO baseSuggestionDO = toEntity(json, BaseSuggestionDO.class);
            BaseSuggestionDO result = baseSuggestionService.createSuggestion(baseSuggestionDO);
            if (null == result){
                return failed("新增失败");
            }
            return success("新增成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -64,12 +74,17 @@ public class BaseSuggestionController extends EnvelopRestEndpoint {
            @RequestParam(value = "content", required = false)String content,
            @ApiParam(name = "userId", value = "回复人id", required = true)
            @RequestParam(value = "userId", required = false)String userId)throws Exception{
        if (!StringUtils.isNoneBlank(userId)){
            userId= getUID();
        try {
            if (!StringUtils.isNoneBlank(userId)){
                userId= getUID();
            }
            String userName = getUNAME();
            baseSuggestionService.reponseSuggestion(id,content,userId,userName);
            return success("回复成功");
        }catch (Exception e){
            return failedException(e);
        }
        String userName = getUNAME();
        baseSuggestionService.reponseSuggestion(id,content,userId,userName);
        return success("回复成功");
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestion.findSuggestionById)
@ -77,7 +92,11 @@ public class BaseSuggestionController extends EnvelopRestEndpoint {
    public Envelop findSuggestionById(
            @ApiParam(name = "id", value = "建议id", required = true)
            @RequestParam(value = "id", required = true)String id) {
        BaseSuggestionDO baseSuggestionDO = baseSuggestionService.findSuggestionById(id);
        return success(baseSuggestionDO);
        try {
            BaseSuggestionDO baseSuggestionDO = baseSuggestionService.findSuggestionById(id);
            return success(baseSuggestionDO);
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 70 - 41
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseSuggestionDictController.java

@ -32,32 +32,46 @@ public class BaseSuggestionDictController extends EnvelopRestEndpoint {
                                           @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                           @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        MixEnvelop mixEnvelop=baseSuggestionDictService.findByNameAndDes(name,des,page,pageSize);
        return mixEnvelop;
        try {
            MixEnvelop mixEnvelop=baseSuggestionDictService.findByNameAndDes(name,des,page,pageSize);
            return mixEnvelop;
        } catch (Exception e){
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestionDict.saveSuggestionType)
    @ApiOperation("新增反馈建议类型")
    public Envelop saveSuggestionType(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        BaseSuggestionDictDO baseSuggestionDO = toEntity(json, BaseSuggestionDictDO.class);
        BaseSuggestionDictDO result = baseSuggestionDictService.createSuggestionType(baseSuggestionDO);
        if (null == result){
            return failed("新增失败");
        }
        return success("新增成功");
        try {
            BaseSuggestionDictDO baseSuggestionDO = toEntity(json, BaseSuggestionDictDO.class);
            BaseSuggestionDictDO result = baseSuggestionDictService.createSuggestionType(baseSuggestionDO);
            if (null == result){
                return failed("新增失败");
            }
            return success("新增成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.suggestionDict.delSuggestionType  )
    @ApiOperation("删除反馈建议类型")
    public Envelop delSuggestionType(
            @ApiParam(name = "id", value = "建议id", required = true)
            @RequestParam(value = "id", required = true)String id)throws Exception{
        boolean flag = baseSuggestionDictService.deleteSuggest(id);
        if (true==flag){
            return success("删除成功");
        }else {
            return failed("删除失败");
        try {
            boolean flag = baseSuggestionDictService.deleteSuggest(id);
            if (true==flag){
                return success("删除成功");
            }else {
                return failed("删除失败");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.suggestionDict.updateSuggestionType)
@ -71,32 +85,42 @@ public class BaseSuggestionDictController extends EnvelopRestEndpoint {
            @RequestParam(value = "suggestDes", required = false)String suggestDes,
            @ApiParam(name = "updateUser", value = "updateUser", required = false)
            @RequestParam(value = "updateUser", required = false)String updateUser)throws Exception {
        if (!StringUtils.isNoneBlank(updateUser)){
            updateUser = getUID();
        }
        String updateUserName = getUNAME();
        BaseSuggestionDictDO result = baseSuggestionDictService.updateSuggest(id,suggestName,suggestDes,updateUser,updateUserName);
        if (null == result) {
            return failed("更新失败,礼物不存在");
        try {
            if (!StringUtils.isNoneBlank(updateUser)){
                updateUser = getUID();
            }
            String updateUserName = getUNAME();
            BaseSuggestionDictDO result = baseSuggestionDictService.updateSuggest(id,suggestName,suggestDes,updateUser,updateUserName);
            if (null == result) {
                return failed("更新失败,礼物不存在");
            }
            return success("更新成功");
        }catch (Exception e){
            return failedException(e);
        }
        return success("更新成功");
    }
    @GetMapping(value= BaseHospitalRequestMapping.suggestionDict.upSuggestionType)
    @ApiOperation("上移")
    public Envelop upBanner(@ApiParam(name = "id", value = "id", required = true)
                            @RequestParam(value = "id", required = true)String id){
        BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
        String erroMessage = null;
        try {
            baseSuggestionDictDO = baseSuggestionDictService.upSuggestion(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
            return failed("上移失败"+erroMessage);
        }else {
            return success("上移成功");
            BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
            String erroMessage = null;
            try {
                baseSuggestionDictDO = baseSuggestionDictService.upSuggestion(id);
            } catch (Exception e) {
                erroMessage = e.getMessage();
            }
            if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
                return failed("上移失败"+erroMessage);
            }else {
                return success("上移成功");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -104,17 +128,22 @@ public class BaseSuggestionDictController extends EnvelopRestEndpoint {
    @ApiOperation("下移")
    public Envelop downBanner(@ApiParam(name = "id", value = "id", required = true)
                              @RequestParam(value = "id", required = true)String id){
        BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
        String erroMessage = null;
        try {
            baseSuggestionDictDO = baseSuggestionDictService.downSuggestion(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
            return failed("下移失败"+erroMessage);
        }else {
            return success("下移成功");
            BaseSuggestionDictDO baseSuggestionDictDO = new BaseSuggestionDictDO();
            String erroMessage = null;
            try {
                baseSuggestionDictDO = baseSuggestionDictService.downSuggestion(id);
            } catch (Exception e) {
                erroMessage = e.getMessage();
            }
            if (org.apache.commons.lang.StringUtils.isNotEmpty(erroMessage)){
                return failed("下移失败"+erroMessage);
            }else {
                return success("下移成功");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 22 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -381,27 +381,42 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findFamilyMumber)
    public Envelop findFamilyMumberByPatientId(@ApiParam(name = "patientId", value = "patientId", required = false)
                                               @RequestParam(value = "patientId", required = false) String patientId) {
        List<Map<String, Object>> list = new ArrayList<>();
        try {
            list = wlyyFamilyMemberService.findFamilyByPatientId(patientId);
        } catch (ParseException e) {
            e.printStackTrace();
            List<Map<String, Object>> list = new ArrayList<>();
            try {
                list = wlyyFamilyMemberService.findFamilyByPatientId(patientId);
            } catch (ParseException e) {
                e.printStackTrace();
            }
            return success(list);
        }catch (Exception e){
            return failedException(e);
        }
        return success(list);
    }
    @ApiOperation("删除就诊人")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.delFamilyMumber)
    public Envelop delFamilyMumber(@ApiParam(name = "id", value = "id", required = false)
                                   @RequestParam(value = "id", required = false) String id) {
        return wlyyFamilyMemberService.delMember(id);
        try {
            return wlyyFamilyMemberService.delMember(id);
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("获取单个亲属信息")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
                                    @RequestParam(value = "id", required = false) String id) throws Exception {
        return success(wlyyFamilyMemberService.findMemberById(id));
        try {
            return success(wlyyFamilyMemberService.findMemberById(id));
        }catch (Exception e){
            return failedException(e);
        }
    }
    public boolean verifyCaptcha(String key,String text){
        boolean pass = false;

+ 33 - 13
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BannerDoctorController.java

@ -45,21 +45,31 @@ public class BannerDoctorController extends EnvelopRestEndpoint {
                                  @RequestParam(value = "key", required = false)String key,
                                 @ApiParam(name = "value", value = "value", required = false)
                                  @RequestParam(value = "value", required = false)String value) throws Exception{
        ObjEnvelop objEnvelop = new ObjEnvelop();
        List<String> list = new ArrayList<>();
        if(StringUtils.isNotEmpty(bannerIds)){
            list =  Arrays.asList(bannerIds.split(","));
        try {
            ObjEnvelop objEnvelop = new ObjEnvelop();
            List<String> list = new ArrayList<>();
            if(StringUtils.isNotEmpty(bannerIds)){
                list =  Arrays.asList(bannerIds.split(","));
            }
            String patientId= getUID();
            objEnvelop = baseBannerDoctorService.bannerGive(patientId,list,content,doctor,doctorName,type,key,value);
            return objEnvelop;
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
        String patientId= getUID();
        objEnvelop = baseBannerDoctorService.bannerGive(patientId,list,content,doctor,doctorName,type,key,value);
    return objEnvelop;
    }
    @ApiOperation("查询赠送锦旗")
    @PostMapping(value= BaseHospitalRequestMapping.DoctorBanner.getBanner)
    public Envelop getBanners(@ApiParam(name = "doctor", value = "doctor", required = false)
                                     @RequestParam(value = "doctor", required = false)String doctor){
        JSONObject jsonObject = baseBannerDoctorService.getDoctorBanners(doctor);
        return success(jsonObject);
        try {
            JSONObject jsonObject = baseBannerDoctorService.getDoctorBanners(doctor);
            return success(jsonObject);
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
    @ApiOperation("查询未读消息")
    @PostMapping(value= BaseHospitalRequestMapping.DoctorBanner.getMessageNotRead)
@ -69,8 +79,13 @@ public class BannerDoctorController extends EnvelopRestEndpoint {
                              @RequestParam(value = "page", required = false,defaultValue = "1")Integer page,
                              @ApiParam(name = "pageSize", value = "pageSize", required = false)
                                  @RequestParam(value = "pageSize", required = false,defaultValue = "10")Integer pageSize){
        JSONObject jsonObject = baseBannerDoctorService.getMessageNotRead(doctor,page,pageSize);
        return success(jsonObject);
        try {
            JSONObject jsonObject = baseBannerDoctorService.getMessageNotRead(doctor,page,pageSize);
            return success(jsonObject);
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
    @ApiOperation("修改消息已读状态")
    @PostMapping(value= BaseHospitalRequestMapping.DoctorBanner.changeIsRead)
@ -78,7 +93,12 @@ public class BannerDoctorController extends EnvelopRestEndpoint {
                              @RequestParam(value = "id", required = false)String id,
                                @ApiParam(name = "doctor", value = "doctor", required = false)
                                @RequestParam(value = "doctor", required = false)String doctor){
         baseBannerDoctorService.isRead(id,doctor);
        return success("success");
        try {
            baseBannerDoctorService.isRead(id,doctor);
            return success("success");
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
    }
}

+ 54 - 40
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseBannerController.java

@ -34,7 +34,12 @@ public class BaseBannerController extends EnvelopRestEndpoint{
                                        @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                                   @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
            return baseBannerService.queryBannerByNameAndStatus(name,status,page,pageSize);
            try {
                return baseBannerService.queryBannerByNameAndStatus(name,status,page,pageSize);
            }catch (Exception e){
                return failedException(e);
            }
    }
    @PostMapping(value= BaseHospitalRequestMapping.BaseBannerssage.createBanner)
@ -42,12 +47,17 @@ public class BaseBannerController extends EnvelopRestEndpoint{
    public Envelop createBanner(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        BaseBannerDO bannerDO = toEntity(json,BaseBannerDO.class);
        BaseBannerDO result = baseBannerService.creatBanner(bannerDO);
        if (null == result){
            return failed("新增失败");
        try {
            BaseBannerDO bannerDO = toEntity(json,BaseBannerDO.class);
            BaseBannerDO result = baseBannerService.creatBanner(bannerDO);
            if (null == result){
                return failed("新增失败");
            }
            return success("新增成功");
        }catch (Exception e){
            return failedException(e);
        }
        return success("新增成功");
    }
@ -64,23 +74,33 @@ public class BaseBannerController extends EnvelopRestEndpoint{
            @RequestParam(value = "status", required = false)String status,
            @ApiParam(name = "description", value = "description", required = false)
            @RequestParam(value = "description", required = false)String description)throws Exception {
        String updateUser = getUID();
        String updateUserName = getUNAME();
        BaseBannerDO result = baseBannerService.updateBanner(id,name,img,status,updateUser,updateUserName,description);
        if (null == result) {
            return failed("更新失败,礼物不存在");
        try {
            String updateUser = getUID();
            String updateUserName = getUNAME();
            BaseBannerDO result = baseBannerService.updateBanner(id,name,img,status,updateUser,updateUserName,description);
            if (null == result) {
                return failed("更新失败,礼物不存在");
            }
            return success("更新成功");
        }catch (Exception e){
            return failedException(e);
        }
        return success("更新成功");
    }
    @GetMapping(value= BaseHospitalRequestMapping.BaseBannerssage.deleteBanner)
    @ApiOperation("删除礼物信息")
    public Envelop deleteBanner(@ApiParam(name = "id", value = "id", required = true)
                                    @RequestParam(value = "id", required = true)String id){
        boolean flag = baseBannerService.deleteBanner(id);
        if (true==flag){
            return success("删除成功");
        }else {
            return failed("删除失败");
        try {
            boolean flag = baseBannerService.deleteBanner(id);
            if (true==flag){
                return success("删除成功");
            }else {
                return failed("删除失败");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -88,17 +108,11 @@ public class BaseBannerController extends EnvelopRestEndpoint{
    @ApiOperation("上移锦旗信息")
    public Envelop upBanner(@ApiParam(name = "id", value = "id", required = true)
                                @RequestParam(value = "id", required = true)String id){
        BaseBannerDO bannerDO = new BaseBannerDO();
        String erroMessage = null;
        try {
            bannerDO = baseBannerService.upBanner(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (StringUtils.isNotEmpty(erroMessage)){
            return failed("上移失败"+erroMessage);
        }else {
            BaseBannerDO bannerDO = baseBannerService.upBanner(id);
            return success("上移成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -106,17 +120,12 @@ public class BaseBannerController extends EnvelopRestEndpoint{
    @ApiOperation("下移锦旗信息")
    public Envelop downBanner(@ApiParam(name = "id", value = "id", required = true)
                                 @RequestParam(value = "id", required = true)String id){
        BaseBannerDO bannerDO = new BaseBannerDO();
        String erroMessage = null;
        try {
            bannerDO = baseBannerService.downBanner(id);
        } catch (Exception e) {
            erroMessage = e.getMessage();
        }
        if (StringUtils.isNotEmpty(erroMessage)){
            return failed("下移失败"+erroMessage);
        }else {
            BaseBannerDO bannerDO = baseBannerService.downBanner(id);
            return success("下移成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.BaseBannerssage.onOff)
@ -125,11 +134,16 @@ public class BaseBannerController extends EnvelopRestEndpoint{
                              @RequestParam(value = "id", required = true)String id,
                         @ApiParam(name = "status", value = "status", required = true)
                         @RequestParam(value = "status", required = true)String status){
       BaseBannerDO bannerDO = baseBannerService.onOff(id,status);
       if (null!=bannerDO.getId()){
           return success("开关切换成功");
       }else {
           return failed("开关失败");
       try {
           BaseBannerDO bannerDO = baseBannerService.onOff(id,status);
           if (null!=bannerDO.getId()){
               return success("开关切换成功");
           }else {
               return failed("开关失败");
           }
       }catch (Exception e){
           return failedException(e);
       }
    }

+ 72 - 28
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/BaseUserMsgController.java

@ -40,10 +40,15 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                       @RequestParam(value = "contentId", required = false)String  contentId,
                                   @ApiParam(name = "isDoctor", value = "isDoctor", required = false)
                                       @RequestParam(value = "isDoctor", required = false)Integer  isDoctor){
        String patient = getUID();
        System.out.println("patient"+patient);
        baseUserMsgService.responseMessage(contentId,content,reciverId,patient,isDoctor);
        return success("回复成功" );
        try {
            String patient = getUID();
            System.out.println("patient"+patient);
            baseUserMsgService.responseMessage(contentId,content,reciverId,patient,isDoctor);
            return success("回复成功" );
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("自身评论")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.leaveMessage)
@ -60,12 +65,17 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                   @ApiParam(name = "value", value = "value", required = false)
                                    @RequestParam(value = "value", required = false)String value
                              ) throws IOException {
        String senderId = getUID();
        System.out.println("senderId"+senderId);
        //String senderName = getUNAME();
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop= baseUserMsgService.leaveMessage(content,reciverId,reciverName,senderId,type,key,value);
        return objEnvelop;
        try {
            String senderId = getUID();
            System.out.println("senderId"+senderId);
            //String senderName = getUNAME();
            ObjEnvelop objEnvelop = new ObjEnvelop();
            objEnvelop= baseUserMsgService.leaveMessage(content,reciverId,reciverName,senderId,type,key,value);
            return objEnvelop;
        }catch (Exception e){
            return failedObjEnvelopException(e);
        }
}
    @ApiOperation("医生评论展示")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.showMessage)
@ -83,17 +93,26 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                           @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                                   @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
        try {
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("医生评论展示")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.getSingleMessage)
    public Envelop getSingleMessage(@ApiParam(name = "id", value = "id", required = false)
                               @RequestParam(value = "id", required = false)String id){
        List<Map<String,Object>> list = baseUserMsgService.getSingle(id);
        if (list.size()>=0){
            return success(list);
        }else {
            return failed("查询失败");
        try {
            List<Map<String,Object>> list = baseUserMsgService.getSingle(id);
            if (list.size()>=0){
                return success(list);
            }else {
                return failed("查询失败");
            }
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("在线复诊")
@ -106,10 +125,15 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                   @RequestParam(value = "content", required = false)String content,
                                   @ApiParam(name = "relationCode", value = "relationCode", required = false)
                                   @RequestParam(value = "relationCode", required = false)String relationCode){
        String senderId = getUID();
        String senderName = getUNAME();
        baseUserMsgService.onlineVisitMessage(content,reciverId,reciverName,senderId,senderName,relationCode);
        return success("留言成功" );
        try {
            String senderId = getUID();
            String senderName = getUNAME();
            baseUserMsgService.onlineVisitMessage(content,reciverId,reciverName,senderId,senderName,relationCode);
            return success("留言成功" );
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("专家咨询")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.expertMessage)
@ -121,10 +145,15 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                   @RequestParam(value = "content", required = false)String content,
                                   @ApiParam(name = "relationCode", value = "relationCode", required = false)
                                   @RequestParam(value = "relationCode", required = false)String relationCode){
        String senderId = getUID();
        String senderName = getUNAME();
        baseUserMsgService.expertMessage(content,reciverId,reciverName,senderId,senderName,relationCode);
        return success("留言成功" );
        try {
            String senderId = getUID();
            String senderName = getUNAME();
            baseUserMsgService.expertMessage(content,reciverId,reciverName,senderId,senderName,relationCode);
            return success("留言成功" );
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("获取评论")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.getMessage)
@ -132,7 +161,12 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                                 @ApiParam(name = "relationCode", value = "relationCode", required = false)
                                 @RequestParam(value = "relationCode", required = false)String relationCode){
        return success(userMsgContentService.getAllMessage(relationCode));
        try {
            return success(userMsgContentService.getAllMessage(relationCode));
        }catch (Exception e){
            return failedException(e);
        }
    }
    @ApiOperation("获取评分")
    @PostMapping(value= BaseHospitalRequestMapping.UserMessage.getPoint)
@ -140,7 +174,12 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
            @ApiParam(name = "doctor", value = "doctor", required = false)
            @RequestParam(value = "doctor", required = false)String doctor){
        return success(userMsgContentService.countPoint(doctor));
        try {
            return success(userMsgContentService.countPoint(doctor));
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -153,7 +192,12 @@ public class BaseUserMsgController extends EnvelopRestEndpoint {
                               @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize) throws ParseException {
        JSONObject jsonObject=userMsgContentService.showContentByDoctor(doctor,page,pageSize);
        return success(jsonObject);
        try {
            JSONObject jsonObject=userMsgContentService.showContentByDoctor(doctor,page,pageSize);
            return success(jsonObject);
        }catch (Exception e){
            return failedException(e);
        }
    }
}

+ 39 - 20
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/message/SystemMessageController.java

@ -39,12 +39,16 @@ public class SystemMessageController extends EnvelopRestEndpoint {
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody SystemMessageDO systemMessageDO)throws Exception{
        SystemMessageDO messageDO = systemMessageService.addMessage(systemMessageDO);
        if (null == messageDO){
            return failed("新增失败");
        }
        return success("新增成功");
        try {
            SystemMessageDO messageDO = systemMessageService.addMessage(systemMessageDO);
            if (null == messageDO){
                return failed("新增失败");
            }
            return success("新增成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
@ -59,11 +63,16 @@ public class SystemMessageController extends EnvelopRestEndpoint {
            @ApiParam(name = "del", value = "del", required = false)
            @RequestParam(value = "del", required = false)String del)throws Exception{
        SystemMessageDO systemMessageDO = systemMessageService.updateMessage(id,read,del);
        if (null == systemMessageDO){
            return failed("更新失败,就诊消息不存在");
        try {
            SystemMessageDO systemMessageDO = systemMessageService.updateMessage(id,read,del);
            if (null == systemMessageDO){
                return failed("更新失败,就诊消息不存在");
            }
            return success("更新成功");
        }catch (Exception e){
            return failedException(e);
        }
        return success("更新成功");
    }
@ -82,14 +91,19 @@ public class SystemMessageController extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
        if(StringUtils.isBlank(filters)){
            filters="del=1";
        }else{
            filters=filters+";del=1";
        try {
            if(StringUtils.isBlank(filters)){
                filters="del=1";
            }else{
                filters=filters+";del=1";
            }
            List<SystemMessageDO> list  = systemMessageService.search(fields,filters,sorts,page,pageSize);
            int count = (int) systemMessageService.getCount(filters);
            return success(list, count, page, pageSize, SystemMessageDO.class);
        }catch (Exception e){
            return failedException(e);
        }
        List<SystemMessageDO> list  = systemMessageService.search(fields,filters,sorts,page,pageSize);
        int count = (int) systemMessageService.getCount(filters);
        return success(list, count, page, pageSize, SystemMessageDO.class);
    }
@ -99,11 +113,16 @@ public class SystemMessageController extends EnvelopRestEndpoint {
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id", required = true)String id)throws Exception{
        SystemMessageDO systemMessageDO = systemMessageService.queryById(id);
        if (null == systemMessageDO){
            return failed("获取失败,线上就诊消息不存在");
        try {
            SystemMessageDO systemMessageDO = systemMessageService.queryById(id);
            if (null == systemMessageDO){
                return failed("获取失败,线上就诊消息不存在");
            }
            return success("获取成功",200,systemMessageDO);
        }catch (Exception e){
            return failedException(e);
        }
        return success("获取成功",200,systemMessageDO);
    }

+ 423 - 199
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -251,13 +251,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                            @ApiParam(name = "pagesize", value = "分页大小")
                                                             @RequestParam(value = "pagesize",required = false) Integer pagesize
    ) throws Exception{
        logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
        return prescriptionService.findDoctorByHospitalAndDiseaseAndDept2(iswork,patientid,
                orgCode,dept,
                diseaseKey,doctorNameKey,
                jobTitleNameKey,outpatientType,
                keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
        try {
            logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
            return prescriptionService.findDoctorByHospitalAndDiseaseAndDept2(iswork,patientid,
                    orgCode,dept,
                    diseaseKey,doctorNameKey,
                    jobTitleNameKey,outpatientType,
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
        } catch (Exception e){
            return  failedMixEnvelopException(e);
        }
    }
    @GetMapping("/testFrontQuery")
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -294,13 +297,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                            @ApiParam(name = "pagesize", value = "分页大小")
                                                            @RequestParam(value = "pagesize",required = false) Integer pagesize
    ) throws Exception{
        logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
        return prescriptionService.findDoctorByHospitalAndDiseaseAndDept2(iswork,patientid,
                orgCode,dept,
                diseaseKey,doctorNameKey,
                jobTitleNameKey,outpatientType,
                keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
        try {
            logger.info("findDoctorByHospitalAndDiseaseAndDept start:"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss:SSS"));
            return prescriptionService.findDoctorByHospitalAndDiseaseAndDept2(iswork,patientid,
                    orgCode,dept,
                    diseaseKey,doctorNameKey,
                    jobTitleNameKey,outpatientType,
                    keyName,workingTime,consultStatus,chargType,consutlSort,isAttention,page,pagesize);
        } catch (Exception e){
            return  failedMixEnvelopException(e);
        }
    }
@ -308,7 +314,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取常见疾病、热门部门、医生拒绝接诊原因 字典", notes = "获取常见疾病、热门部门、医生拒绝接诊原因 字典")
    public ListEnvelop findHotDeptAndDiseaseDict(@ApiParam(name = "dictName", value = "dictName")
                                                 @RequestParam(value = "dictName", required = true,defaultValue = "ONLINE_HOSPITAL_DEPT_350211A1002")String dictName)throws Exception{
        return success(prescriptionService.findHotDeptAndDiseaseDict(dictName));
        try {
            return success(prescriptionService.findHotDeptAndDiseaseDict(dictName));
        } catch (Exception e){
            return  failedListEnvelopException(e);
        }
    }
@ -316,7 +327,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "居民获取当日就诊列表", notes = "居民获取当日就诊列表")
    public ListEnvelop getTodayOutpatinetList(@ApiParam(name = "patient", value = "居民ID")
                                              @RequestParam(value = "patient", required = true) String patient){
        return success(prescriptionService.getTodayOutpatinetList(patient,wxId));
        try {
            return success(prescriptionService.getTodayOutpatinetList(patient,wxId));
        } catch (Exception e){
            return  failedListEnvelopException(e);
        }
    }
@ -324,7 +340,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "就诊费用查询", notes = "就诊费用查询")
    public ListEnvelop findByDeptTypeCode(@ApiParam(name = "deptTypeCode", value = "6总部7金榜8夏禾")
                                          @RequestParam(value = "deptTypeCode", required = false)String deptTypeCode) throws Exception{
        return success(prescriptionService.findByDeptTypeCode(deptTypeCode));
        try {
            return success(prescriptionService.findByDeptTypeCode(deptTypeCode));
        } catch (Exception e){
            return  failedListEnvelopException(e);
        }
    }
@ -336,9 +356,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "dictName", value = "字典名称", required = true)
            @RequestParam(value = "dictName", required = true) String dictName ) throws Exception {
        List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
        return success("查询成功",list);
        try {
            List<Map<String, Object>> list = sysDictService.findByHosAndDict(hospital, dictName);
            return success("查询成功",list);
        } catch (Exception e){
            return  failedException(e);
        }
    }
@ -366,13 +390,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "doctor",required = true) String doctor,
            @ApiParam(name = "patient", value = "居民CODE")
            @RequestParam(value = "patient",required = true) String patient)throws Exception {
        if(StringUtils.isEmpty(patient)){
            patient= getUID();
        try {
            if(StringUtils.isEmpty(patient)){
                patient= getUID();
            }
            String consultCode = imService.getUnfinishedConsult(patient, doctor);
            return success("请求成功",consultCode);
        }catch (Exception e){
            return  failedException(e);
        }
        String consultCode = imService.getUnfinishedConsult(patient, doctor);
        return success("请求成功",consultCode);
    }
    /**
@ -387,11 +413,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "orgCode", required = false) String orgCode,
            @ApiParam(name = "consultDeptFlag", value = "是否是就诊科室,1为查询门诊,不传为全部")
            @RequestParam(value = "consultDeptFlag", required = false) String consultDeptFlag)  {
        List<DictHospitalDeptDO> res =  hospitalDeptService.getHosDeptByCode(orgCode,consultDeptFlag);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的部门列表信息!");
        try {
            List<DictHospitalDeptDO> res =  hospitalDeptService.getHosDeptByCode(orgCode,consultDeptFlag);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取该机构的部门列表信息!");
            }
        }catch (Exception e){
            return  failedException(e);
        }
    }
@ -404,11 +434,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    public Envelop getJobBySaasId(
            @ApiParam(name = "saasId", value = "租户ID,当为空的情况下查询所有")
            @RequestParam(value = "saasId", required = false) String saasId)  {
        List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId);
        if(res != null && res.size() > 0 ){
            return  success(res);
        }else{
            return success("无法获取该机构的职称信息!");
        try {
            List<DictJobTitleDO> res= baseDictJobTitleService.getBySaasId(saasId);
            if(res != null && res.size() > 0 ){
                return  success(res);
            }else{
                return success("无法获取该机构的职称信息!");
            }
        }catch (Exception e){
            return  failedException(e);
        }
    }
@ -417,7 +451,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取具体号源", notes = "获取具体号源")
    public ListEnvelop findWorkTimeInfo(@ApiParam(name = "id", value = "排班id")
                                        @RequestParam(value = "id", required = false)String id) {
        return success(prescriptionService.findWorkTimeInfo(id));
        try {
            return success(prescriptionService.findWorkTimeInfo(id));
        }catch (Exception e){
            return  failedListEnvelopException(e);
        }
    }
@ -426,50 +465,59 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    public ObjEnvelop findLevelOneDoctorUpcoming(@ApiParam(name = "doctor_idcard", value = "医生身份证")
                                                 @RequestParam(value = "doctor_idcard", required = true)String doctor_idcard){
        List<BaseDoctorDO> doctors = baseDoctorService.findByField("idcard",doctor_idcard);
        BaseDoctorDO doctor = null;
        JSONObject result = new JSONObject();
        if(!doctors.isEmpty()){
            doctor = doctors.get(0);
            //专家咨询
            Integer zjCount = imService.sessionCountByType(doctor.getId(),1,0);
            //全科医生求助专科
            Integer zjqzCount = imService.sessionCountByType(doctor.getId(),15,0);
    
            //专家咨询
            Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),"1");
            result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
            result.put("zjUnreadMessageCount",unreadMessageCount);//专家咨询未读数
        }else{
            result.put("zjCount",0);//专家咨询数量
            result.put("zjUnreadMessageCount",0);//专家咨询未读数
        try {
            List<BaseDoctorDO> doctors = baseDoctorService.findByField("idcard",doctor_idcard);
            BaseDoctorDO doctor = null;
            JSONObject result = new JSONObject();
            if(!doctors.isEmpty()){
                doctor = doctors.get(0);
                //专家咨询
                Integer zjCount = imService.sessionCountByType(doctor.getId(),1,0);
                //全科医生求助专科
                Integer zjqzCount = imService.sessionCountByType(doctor.getId(),15,0);
                //专家咨询
                Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),"1");
                result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
                result.put("zjUnreadMessageCount",unreadMessageCount);//专家咨询未读数
            }else{
                result.put("zjCount",0);//专家咨询数量
                result.put("zjUnreadMessageCount",0);//专家咨询未读数
            }
            return success("请求成功",result);
        }catch (Exception e){
            return  failedObjEnvelopException(e);
        }
        return success("请求成功",result);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.getUpcomingByDoctor)
    @ApiOperation(value = "获取医生待办详情", notes = "获取医生待办详情")
    public Envelop getUpcomingByDoctor(@ApiParam(name = "doctorIdcard", value = "doctorIdcard", required = true)
                                       @RequestParam(value = "doctorIdcard",required = true)String doctorIdcard){
        JSONObject result = new JSONObject();
        List<BaseDoctorDO> doctors = baseDoctorService.findDoctorsByIdcard(doctorIdcard);
        BaseDoctorDO doctor = new BaseDoctorDO();
        if(!doctors.isEmpty()){
            doctor = doctors.get(0);
        }else{
            return success("该身份证无法找到医生",-1);
        }
    
        //医生咨询
        Integer zxCount = imService.SessionsUnreadMessageCount(doctor.getId(), "1");
        Integer fzCount = imService.SessionsUnreadMessageCount(doctor.getId(), "9");
        Integer spCount = imService.SessionsUnreadMessageCount(doctor.getId(), "16");
        result.put("zxCount",zxCount);//专家咨询咨询数量
        result.put("fzCount",fzCount);//图文复诊数量
        result.put("spCount",spCount);//图文复诊数量
        result.put("totalCount",zxCount+fzCount+spCount);
        return success("请求成功",result);
        try {
            JSONObject result = new JSONObject();
            List<BaseDoctorDO> doctors = baseDoctorService.findDoctorsByIdcard(doctorIdcard);
            BaseDoctorDO doctor = new BaseDoctorDO();
            if(!doctors.isEmpty()){
                doctor = doctors.get(0);
            }else{
                return success("该身份证无法找到医生",-1);
            }
            //医生咨询
            Integer zxCount = imService.SessionsUnreadMessageCount(doctor.getId(), "1");
            Integer fzCount = imService.SessionsUnreadMessageCount(doctor.getId(), "9");
            Integer spCount = imService.SessionsUnreadMessageCount(doctor.getId(), "16");
            result.put("zxCount",zxCount);//专家咨询咨询数量
            result.put("fzCount",fzCount);//图文复诊数量
            result.put("spCount",spCount);//图文复诊数量
            result.put("totalCount",zxCount+fzCount+spCount);
            return success("请求成功",result);
        } catch (Exception e){
            return  failedException(e);
        }
    }
@ -483,33 +531,38 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @RequestMapping(value = "/getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public Envelop getOpenidByCode(String code,@RequestParam(value = "patientId", required = false)String patientId) throws Exception {
        //通过redis获取openid, 获取不到,则调用微信接口去取
        String key = wxId+":code";
        String openid = redisTemplate.opsForValue().get(key);
        if(!StringUtils.isEmpty(openid)){
            return success(PatientRequestMapping.Wechat.api_success,openid);
        }
        openid = wechatInfoService.getOpenidByCode(code, wxId);
        if (!StringUtils.isEmpty(patientId)){
            List<BasePatientWechatDo> list = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patientId);
            if (list!=null&&list.size()>0){
                for (BasePatientWechatDo basePatientWechatDo:list){
        try {
            //通过redis获取openid, 获取不到,则调用微信接口去取
            String key = wxId+":code";
            String openid = redisTemplate.opsForValue().get(key);
            if(!StringUtils.isEmpty(openid)){
                return success(PatientRequestMapping.Wechat.api_success,openid);
            }
            openid = wechatInfoService.getOpenidByCode(code, wxId);
            if (!StringUtils.isEmpty(patientId)){
                List<BasePatientWechatDo> list = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patientId);
                if (list!=null&&list.size()>0){
                    for (BasePatientWechatDo basePatientWechatDo:list){
                        basePatientWechatDo.setOpenid(openid);
                        basePatientWechatDao.save(basePatientWechatDo);
                    }
                }else {
                    BasePatientWechatDo basePatientWechatDo = new BasePatientWechatDo();
                    basePatientWechatDo.setPatientId(patientId);
                    basePatientWechatDo.setWechatId(wxId);
                    basePatientWechatDo.setCreateTime(new Date());
                    basePatientWechatDo.setOpenid(openid);
                    basePatientWechatDao.save(basePatientWechatDo);
                }
            }else {
                BasePatientWechatDo basePatientWechatDo = new BasePatientWechatDo();
                basePatientWechatDo.setPatientId(patientId);
                basePatientWechatDo.setWechatId(wxId);
                basePatientWechatDo.setCreateTime(new Date());
                basePatientWechatDo.setOpenid(openid);
                basePatientWechatDao.save(basePatientWechatDo);
            }
            }
            redisTemplate.opsForValue().set(key,openid);
            redisTemplate.expire(key,10, TimeUnit.SECONDS);
            return success(PatientRequestMapping.Wechat.api_success,openid);
        } catch (Exception e){
            return  failedException(e);
        }
        redisTemplate.opsForValue().set(key,openid);
        redisTemplate.expire(key,10, TimeUnit.SECONDS);
        return success(PatientRequestMapping.Wechat.api_success,openid);
    }
@ -761,7 +814,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询排班规则")
    public ObjEnvelop findWorkTimeRule(@ApiParam(name = "hospital", value = "医院code")
                                       @RequestParam(value = "hospital",required = true)String hospital) {
        return success(workTimeService.findWorkTimeRule(hospital));
        try {
            return success(workTimeService.findWorkTimeRule(hospital));
        } catch (Exception e){
            return  failedObjEnvelopException(e);
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
@ -770,7 +828,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false)String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
        try {
            return success(workTimeService.checkDoctorWork(doctor,ywCode));
        } catch (Exception e){
            return  failedObjEnvelopException(e);
        }
    }
@ -797,8 +860,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                return ObjEnvelop.getSuccess("获取面单信息成功",result);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("获取面单信息失败,"+e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -823,18 +885,23 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    public Envelop queryByCode(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id", required = true)String id) throws Exception{
        KnowledgeArticleDO articleDO = knowledgeArticleService.retrieve(id);
        KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(articleDO.getId(),getUID());
        if (knowledgeArticleUserDO!=null){
            articleDO.setIsUsed(knowledgeArticleUserDO.getUsed());
            articleDO.setKnowledgeArticleUserDO(knowledgeArticleUserDO);
        }
        List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(articleDO.getCreateUser());
        if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
            articleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
            articleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
        try {
            KnowledgeArticleDO articleDO = knowledgeArticleService.retrieve(id);
            KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(articleDO.getId(),getUID());
            if (knowledgeArticleUserDO!=null){
                articleDO.setIsUsed(knowledgeArticleUserDO.getUsed());
                articleDO.setKnowledgeArticleUserDO(knowledgeArticleUserDO);
            }
            List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(articleDO.getCreateUser());
            if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                articleDO.setHospitalName(doctorHospitalDOS.get(0).getOrgName());
                articleDO.setDeptName(doctorHospitalDOS.get(0).getDeptName());
            }
            return success(articleDO);
        }catch (Exception e) {
            return failedException(e);
        }
        return success(articleDO);
    }
@ -871,24 +938,38 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setAllCode)
    @ApiOperation(value = "生成所有医生二维码")
    public Envelop setAllCode() throws Exception{
        qrcodeService.makeAllSpecialistQrcode();
       return success("操作成功");
       try {
           qrcodeService.makeAllSpecialistQrcode();
           return success("操作成功");
       }catch (Exception e) {
           return failedException(e);
       }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setQrCode)
    @ApiOperation(value = "生成医生二维码")
    public Envelop setQrCode(@ApiParam(name = "doctor", value = "doctor", required = true)
                                 @RequestParam(value = "doctor", required = true)String doctor) throws Exception{
        String uri = qrcodeService.makeSpecialistQrcode(doctor);
        return success("操作成功",uri);
        try {
            String uri = qrcodeService.makeSpecialistQrcode(doctor);
            return success("操作成功",uri);
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setUrlCode)
    @ApiOperation(value = "生成链接推送")
    public Envelop setUrlCode(@ApiParam(name = "flag", value = "flag", required = true)
                             @RequestParam(value = "flag", required = true)String flag) throws Exception{
        String uri = qrcodeService.makeUrlQrcode(flag);
        return success("操作成功",uri);
        try {
            String uri = qrcodeService.makeUrlQrcode(flag);
            return success("操作成功",uri);
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.querySettledRecord)
@ -909,9 +990,14 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "pageNo", required = false)String pageNo,
                                      @ApiParam(name = "pageSize", value = "分页大小", required = false)
                                          @RequestParam(value = "pageSize", required = false)String pageSize) throws Exception{
       String result = ylzPayService.querySettledRecord(cardNo,beginDate,endDate,queryType,billSn,traceNo,pageNo,pageSize);
       logger.info(result);
       return success("操作成功",result);
       try {
           String result = ylzPayService.querySettledRecord(cardNo,beginDate,endDate,queryType,billSn,traceNo,pageNo,pageSize);
           logger.info(result);
           return success("操作成功",result);
       }catch (Exception e) {
           return failedException(e);
       }
    }
@ -939,9 +1025,14 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        @RequestParam(value = "orderNo", required = false)String orderNo,
                                    @ApiParam(name = "remark", value = "备注", required = false)
                                        @RequestParam(value = "remark", required = false)String remark) throws Exception{
        String result = payInfoNoticeService.paySuccessNotice(userName,idCard,phone,title,url,doctorName,total,miPay,selfPay,orderNo,remark);
        logger.info(result);
        return success("操作成功",result);
        try {
            String result = payInfoNoticeService.paySuccessNotice(userName,idCard,phone,title,url,doctorName,total,miPay,selfPay,orderNo,remark);
            logger.info(result);
            return success("操作成功",result);
        } catch (Exception e) {
            return failedException(e);
        }
    }
    /**
     * 商户回调通知
@ -1290,7 +1381,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                   @RequestParam(value = "pageSize", required = false) Integer pageSize
    ) {
        return wlyyHttpLogService.findLog(startTime,endTime,interfaceName,patient,doctor,page,pageSize);
        try {
            return wlyyHttpLogService.findLog(startTime,endTime,interfaceName,patient,doctor,page,pageSize);
        } catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
@ -1300,22 +1395,28 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "doctorId", required = true)String doctorId,
                                         @ApiParam(name = "orgCode", value = "医院code")
                                         @RequestParam(value = "orgCode", required = true)String orgCode) throws Exception{
        JSONObject object = prescriptionService.selectHospitalInfo(doctorId,orgCode);
        String date = DateUtil.getStringDateShort();
        //服务评分
        JSONObject jsonObject = statisticsEsService.getScoreList(null,date,2,"350200","4");
        if (jsonObject!=null){
            com.alibaba.fastjson.JSONArray array  = jsonObject.getJSONArray("resultList");
            if (array!=null&&array.size()!=0){
                JSONObject object1 = array.getJSONObject(0);
                object.put("scoreRate",object1.getString("scoreRate"));
        try {
            JSONObject object = prescriptionService.selectHospitalInfo(doctorId,orgCode);
            String date = DateUtil.getStringDateShort();
            //服务评分
            JSONObject jsonObject = statisticsEsService.getScoreList(null,date,2,"350200","4");
            if (jsonObject!=null){
                com.alibaba.fastjson.JSONArray array  = jsonObject.getJSONArray("resultList");
                if (array!=null&&array.size()!=0){
                    JSONObject object1 = array.getJSONObject(0);
                    object.put("scoreRate",object1.getString("scoreRate"));
                }else {
                    object.put("scoreRate",null);
                }
            }else {
                object.put("scoreRate",null);
            }
        }else {
            object.put("scoreRate",null);
            return success(object);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
        return success(object);
    }
@ -1340,7 +1441,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                              @ApiParam(name = "endTime", value = "结束时间 yyyy-MM-dd hh:mm:ss")
                                                  @RequestParam(value = "endTime", required = false)String endTime) throws Exception{
        return success(prescriptionService.findOutpatientAndPatient(startTime,endTime));
        try {
            return success(prescriptionService.findOutpatientAndPatient(startTime,endTime));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    /**
@ -1387,7 +1493,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询基础号别字典", notes = "查询基础号别字典")
    public ListEnvelop findDictLists() throws Exception{
        return success(baseDoctorService.findChargeDicts());
        try {
            return success(baseDoctorService.findChargeDicts());
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findWorkDoctorCount)
    @ApiOperation(value = "查询医生排版数量", notes = "查询医生排版数量")
@ -1397,20 +1508,34 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @ApiParam(name = "orgCode", value = "医院code")
            @RequestParam(value = "orgCode", required = false)String orgCode) throws Exception{
        return success(prescriptionService.getWorkDoctorCount(nowTime,orgCode));
        try {
            return success(prescriptionService.getWorkDoctorCount(nowTime,orgCode));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findAllDict)
    @ApiOperation(value = "查询配置字典所有项", notes = "查询配置字典所有项")
    public ListEnvelop<WlyyHospitalSysDictDO> findAllDict() throws Exception{
        return success(prescriptionService.findAllDict());
        try {
            return success(prescriptionService.findAllDict());
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictById)
    @ApiOperation(value = "根据id查询配置字典", notes = "根据id查询配置字典")
        public Envelop findDictById(@ApiParam(name = "dictId", value = "dictId")
                                                                      @RequestParam(value = "dictId", required = true)String dictId) throws Exception{
        return success(prescriptionService.findDictById(dictId));
        try {
            return success(prescriptionService.findDictById(dictId));
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.updateDictById)
    @ApiOperation(value = "根据id修改配置字典", notes = "根据id修改配置字典")
@ -1419,14 +1544,24 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                  @ApiParam(name = "dictValue", value = "dictId")
                                  @RequestParam(value = "dictValue", required = true)String dictValue) throws Exception{
        return success(prescriptionService.updateDictById(dictId,dictValue));
        try {
            return success(prescriptionService.updateDictById(dictId,dictValue));
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictByCode)
    @ApiOperation(value = "根据id修改配置字典", notes = "根据id修改配置字典")
    public ListEnvelop findDictByCode(@ApiParam(name = "dictCode", value = "dictCode")
                                  @RequestParam(value = "dictCode", required = true, defaultValue = "isDoctorWork")String dictCode) throws Exception{
        return success(prescriptionService.findSysByDictCode(dictCode));
        try {
            return success(prescriptionService.findSysByDictCode(dictCode));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientIM.getDoctorConsultCount)
    @ApiOperation(value = "医生端:查询会话视频邀请状态", notes = "医生端:查询会话视频邀请状态")
@ -1451,7 +1586,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                               @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
        try {
            return baseUserMsgService.getMessage(doctor,showAll,showAllType,beginTime,endTime,page,pageSize);
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
    @ApiOperation(value = "获取文章列表")
@ -1478,49 +1618,64 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
            @ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
            @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
        if(org.apache.commons.lang.StringUtils.isBlank(filters)){
            filters=filters+"del=1";
        }else{
            filters=filters+";del=1";
        }
        List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
        for (KnowledgeArticleDO knowledgeArticleDO:list){
            List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
            if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                knowledgeArticleDO.setDeptName(doctorHospitalDO.getDeptName());
                knowledgeArticleDO.setHospitalName(doctorHospitalDO.getOrgName());
        try {
            if(org.apache.commons.lang.StringUtils.isBlank(filters)){
                filters=filters+"del=1";
            }else{
                filters=filters+";del=1";
            }
            KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(knowledgeArticleDO.getId(),getUID());
            if (knowledgeArticleUserDO!=null){
                if (knowledgeArticleUserDO.getUsed()!=null&&knowledgeArticleUserDO.getUsed()==1){
                    knowledgeArticleDO.setIsUsed(1);
            List<KnowledgeArticleDO> list  = knowledgeArticleService.search(fields,filters,sorts,page,pageSize);
            for (KnowledgeArticleDO knowledgeArticleDO:list){
                List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());
                if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
                    BaseDoctorHospitalDO doctorHospitalDO = doctorHospitalDOS.get(0);
                    knowledgeArticleDO.setDeptName(doctorHospitalDO.getDeptName());
                    knowledgeArticleDO.setHospitalName(doctorHospitalDO.getOrgName());
                }
                KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(knowledgeArticleDO.getId(),getUID());
                if (knowledgeArticleUserDO!=null){
                    if (knowledgeArticleUserDO.getUsed()!=null&&knowledgeArticleUserDO.getUsed()==1){
                        knowledgeArticleDO.setIsUsed(1);
                    }
                }
            }
        }
        List<KnowledgeArticleDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
            List<KnowledgeArticleDO> totals  = knowledgeArticleService.search(fields,filters,sorts);
        JSONObject result = new JSONObject();
        result.put("total",totals.size());
        result.put("detailModelList",list);
            JSONObject result = new JSONObject();
            result.put("total",totals.size());
            result.put("detailModelList",list);
        return success(result);
            return success(result);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.popularityIncrease)
    @ApiOperation(value = "医生人气值增长")
    public Envelop popularityIncrease (
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", required = false) String doctor) throws Exception {
        BaseDoctorDO baseDoctorDO=baseDoctorService.popularityIncrease(doctor);
        return  success("操作成功",baseDoctorDO);
        try {
            BaseDoctorDO baseDoctorDO=baseDoctorService.popularityIncrease(doctor);
            return  success("操作成功",baseDoctorDO);
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @ApiOperation("查询赠送锦旗")
    @PostMapping(value= BaseHospitalRequestMapping.DoctorBanner.getBanner)
    public Envelop getBanners(@ApiParam(name = "doctor", value = "doctor", required = false)
                              @RequestParam(value = "doctor", required = false)String doctor){
        JSONObject jsonObject = baseBannerDoctorService.getDoctorBanners(doctor);
        return success(jsonObject);
        try {
            JSONObject jsonObject = baseBannerDoctorService.getDoctorBanners(doctor);
            return success(jsonObject);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByHospital)
    @ApiOperation(value = "查询机构底下部门", notes = "查询机构底下部门")
@ -1530,13 +1685,23 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "dept", required = false)String dept,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
        try {
            return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.getArticleGroup)
    @ApiOperation(value = "查询分类")
    public MixEnvelop getGroup(){
        MixEnvelop envelop = knowledgeCategoryService.findAllGroup();
        return envelop;
        try {
            MixEnvelop envelop = knowledgeCategoryService.findAllGroup();
            return envelop;
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByCategoryAndName)
@ -1552,8 +1717,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                   @ApiParam(name = "pageSize", value = "分页大小)")
                                                   @RequestParam(value = "pageSize",required = false)Integer pageSize)throws Exception {
        MixEnvelop mixEnvelop=knowledgeArticleService.findArticleByCategoryAndName(categoryFirst,categorySecond,keyWords,page,pageSize);
        return mixEnvelop;
        try {
            MixEnvelop mixEnvelop=knowledgeArticleService.findArticleByCategoryAndName(categoryFirst,categorySecond,keyWords,page,pageSize);
            return mixEnvelop;
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
    @ApiOperation(value = "查询所有机构", notes = "查询所有机构")
@ -1561,7 +1731,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "level", required = false)Integer level,
                                       @ApiParam(name = "keyWord", value = "名字关键字")
                                       @RequestParam(value = "keyWord", required = false)String keyWord) {
        return success(prescriptionService.findAllHospital(level,keyWord));
        try {
            return success(prescriptionService.findAllHospital(level,keyWord));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.appointmentRevisitOnDoor)
    @ApiOperation(value = "上门复诊", notes = "上门复诊")
@ -1574,8 +1749,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                               @ApiParam(name = "chargeType", value = "预约实体json")
                                               @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisitOnDoor(outpatientJson,expressageJson,registerJson,chargeType);
        return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
        try {
            WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisitOnDoor(outpatientJson,expressageJson,registerJson,chargeType);
            return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
@ -1583,7 +1763,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findJobCategory)
    @ApiOperation(value = "查询所有业务分类", notes = "查询所有业务分类")
    public MixEnvelop findJobCategory() {
        return prescriptionService.findJobCategory();
        try {
            return prescriptionService.findJobCategory();
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
@ -1603,11 +1788,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    @RequestParam(value = "page", required = false)Integer page,
                                    @ApiParam(name = "pageSize", value = "每页大小")
                                        @RequestParam(value = "pageSize", required = false)Integer pageSize) throws Exception {
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            prescriptionService.savePayStatusByHis(patientId);
        try {
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                prescriptionService.savePayStatusByHis(patientId);
            }
            logger.info("同步数据成功");
            return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
        } catch (Exception e) {
            return failedMixEnvelopException(e);
        }
        logger.info("同步数据成功");
        return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findBaseAddress)
    @ApiOperation(value = "查询地址", notes = "查询地址")
@ -1617,7 +1807,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    @RequestParam(value = "parentName", required = false)String parentName ){
        return  success(prescriptionService.findBaseAddress(addressFlag,parentName));
        try {
            return  success(prescriptionService.findBaseAddress(addressFlag,parentName));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping("/testsms")
    public void testsms(String mobile ,String contet){
@ -1625,8 +1820,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    }
    @GetMapping("/smsToDoctor")
    public Envelop sentMessageRemindSms(@RequestParam(value = "consult", required = true)String consult){
        ConsultDo consultDo = consultDao.findOne(consult);
        return  success(systemMessageService.sendDoctorRemindSms(consultDo));
        try {
            ConsultDo consultDo = consultDao.findOne(consult);
            return  success(systemMessageService.sendDoctorRemindSms(consultDo));
        } catch (Exception e) {
            return failedException(e);
        }
    }
    /**
     * 充值卡一支付
@ -1667,7 +1866,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "根据身份证号查询医生", notes = "根据身份证号查询医生")
    public Envelop findDoctorByIdCard(@ApiParam(name = "idCard", value = "身份证号")
                                      @RequestParam(value = "idCard", required = false)String idCard) {
        return success(prescriptionService.findByIdCard(idCard));
        try {
            return success(prescriptionService.findByIdCard(idCard));
        }catch (Exception e) {
            return failedException(e);
        }
    }
@ -1677,8 +1881,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "id", required = false)String id,
                                      @ApiParam(name = "channelId", value = "渠道id")
                                      @RequestParam(value = "channelId", required = false)String channelId) {
        prescriptionService.updateChannelId(id,channelId);
        return success("保存成功");
        try {
            prescriptionService.updateChannelId(id,channelId);
            return success("保存成功");
        }catch (Exception e) {
            return failedException(e);
        }
    }
@ -1779,7 +1988,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                           @RequestParam(value = "page", required = false)Integer page,
                                       @ApiParam(name = "pageSize", value = "")
                                           @RequestParam(value = "pageSize", required = false)Integer pageSize) {
        return businessOrderService.findYktCardCharge(startTime,endTime,orderNo,yktOrderNo,patientName,idCard,medicard,status,page,pageSize);
        try {
            return businessOrderService.findYktCardCharge(startTime,endTime,orderNo,yktOrderNo,patientName,idCard,medicard,status,page,pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    /**
@ -1799,15 +2013,20 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String lowCode) {
        //新版与旧版统计适配
        JSONObject result = new JSONObject();
        try {
            result = statisticsEsService.getConsultHead(startDate, endDate, area, level, index,lowCode);
            //新版与旧版统计适配
            JSONObject result = new JSONObject();
            try {
                result = statisticsEsService.getConsultHead(startDate, endDate, area, level, index,lowCode);
            } catch (Exception e) {
                e.printStackTrace();
            }
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.scheduleHead)
@ -1819,14 +2038,19 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getScheduleTotal(startDate, endDate,index,level,area);
        } catch (Exception e) {
            e.printStackTrace();
        }
            JSONObject result = new JSONObject();
            try {
                result= statisticsEsService.getScheduleTotal(startDate, endDate,index,level,area);
            } catch (Exception e) {
                e.printStackTrace();
            }
        return success(result);
            return success(result);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }

+ 27 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/NationalDrugDictEndpoint.java

@ -25,8 +25,14 @@ public class NationalDrugDictEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "保存药品字典接口")
    public ObjEnvelop saveNationalDrug(@ApiParam(name = "jsonData", value = "药品json串")
                                       @RequestParam(name = "jsonData", required = true) String jsonData) throws Exception {
        BaseNationalDrugDictDO nationalDrugDictDO = objectMapper.readValue(jsonData, BaseNationalDrugDictDO.class);
        return success(nationalDrugDictService.saveNationalDrug(nationalDrugDictDO));
        try {
            BaseNationalDrugDictDO nationalDrugDictDO = objectMapper.readValue(jsonData, BaseNationalDrugDictDO.class);
            return success(nationalDrugDictService.saveNationalDrug(nationalDrugDictDO));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getNationalDrugList)
@ -43,7 +49,12 @@ public class NationalDrugDictEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(name = "page", required = false) Integer page,
                                          @ApiParam(name = "pageSize", value = "页面大小")
                                          @RequestParam(name = "pageSize", required = false) Integer pageSize) throws Exception {
        return nationalDrugDictService.getNationalDrugList(name, number, hospital, status, page, pageSize);
        try {
            return nationalDrugDictService.getNationalDrugList(name, number, hospital, status, page, pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updateNationalDrugStatus)
@ -52,14 +63,24 @@ public class NationalDrugDictEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(name = "id", required = true) Integer id,
                                            @ApiParam(name = "status", value = "状态", required = true)
                                               @RequestParam(name = "status") Integer status){
        nationalDrugDictService.updateNationalDrugStatus(id,status);
        return success();
        try {
            nationalDrugDictService.updateNationalDrugStatus(id,status);
            return success();
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getNationalDrugById)
    @ApiOperation(value = "根据id获取药品字典")
    public ObjEnvelop getNationalDrugById(@ApiParam(name = "id", value = "药品id")
                                          @RequestParam(name = "id", required = true) Integer id) {
        return success(nationalDrugDictService.getNationalDrugById(id));
        try {
            return success(nationalDrugDictService.getNationalDrugById(id));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 546 - 224
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -31,6 +31,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.restmodel.base.area.BaseCityVO;
import com.yihu.jw.restmodel.base.area.BaseCommitteeVO;
@ -144,6 +145,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @Value("${qywx.url}")
    private String qywxUrl;
    @Autowired
    public ImUtil imUtil;
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientList)
    @ApiOperation(value = " 查询某个时间段的患者门诊就诊记录")
@ -159,22 +162,27 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                              @RequestParam(value = "cardNo",required = false)String cardNo,
                                          @ApiParam(name = "flag", value = "标识", required = false)
                                              @RequestParam(value = "flag",required = false)String flag) throws Exception {
        if(StringUtils.isNoneBlank(startTime)){
            startTime = startTime+" 00:00:00";
        }
        if(StringUtils.isNoneBlank(endTime)){
            endTime =endTime+" 23:59:59";
        }
        List<WlyyOutpatientVO> vos = new ArrayList<>();
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm,cardNo);
        }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
            vos = tnPrescriptionService.findOutpatientList(patient, cardNo,startTime, endTime, demoFlag,ksdm,flag);
        }else {
            return ListEnvelop.getError("尚未开发!");
        }
        return success(vos);
        try {
            if(StringUtils.isNoneBlank(startTime)){
                startTime = startTime+" 00:00:00";
            }
            if(StringUtils.isNoneBlank(endTime)){
                endTime =endTime+" 23:59:59";
            }
            List<WlyyOutpatientVO> vos = new ArrayList<>();
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm,cardNo);
            }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
                vos = tnPrescriptionService.findOutpatientList(patient, cardNo,startTime, endTime, demoFlag,ksdm,flag);
            }else {
                return ListEnvelop.getError("尚未开发!");
            }
            return success(vos);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientInfo)
@ -183,15 +191,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "patient",required = false) String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数")
                                         @RequestParam(value = "conNo",required = false) String conNo)throws Exception{
        WlyyOutpatientVO obj = new WlyyOutpatientVO();
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            obj = prescriptionService.findOutpatientInfo(patient,conNo);
        }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
            obj = tnPrescriptionService.findOutpatientInfo(patient,conNo,demoFlag,null);
        }else {
            return ObjEnvelop.getError("尚未开发!");
        try {
            WlyyOutpatientVO obj = new WlyyOutpatientVO();
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                obj = prescriptionService.findOutpatientInfo(patient,conNo);
            }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
                obj = tnPrescriptionService.findOutpatientInfo(patient,conNo,demoFlag,null);
            }else {
                return ObjEnvelop.getError("尚未开发!");
            }
            return success(obj);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
        return success(obj);
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
@ -205,16 +218,21 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号")
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        List<WlyyPrescriptionVO> obj = new ArrayList<>();
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            obj= prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
            obj= tnPrescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        }else {
            return ListEnvelop.getError("尚未开发!");
        }
        return success(obj);
        try {
            List<WlyyPrescriptionVO> obj = new ArrayList<>();
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                obj= prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
            }else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")){
                obj= tnPrescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
            }else {
                return ListEnvelop.getError("尚未开发!");
            }
            return success(obj);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescription)
@ -228,8 +246,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号", required = false)
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        WlyyPrescriptionVO obj = prescriptionService.findOriginPrescription(registerSn, patNo, admNo,realOrder, demoFlag);
        return success(obj);
        try{
            WlyyPrescriptionVO obj = prescriptionService.findOriginPrescription(registerSn, patNo, admNo,realOrder, demoFlag);
            return success(obj);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionList)
@ -246,7 +269,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                                  @RequestParam(value = "page", required = false)Integer page,
                                                                                  @ApiParam(name = "size", value = "每页大小")
                                                                                  @RequestParam(value = "size", required = true) Integer size) {
        return prescriptionService.findPrescriptionList(patient,status,startTime,endTime,page,size,wxId);
        try {
            return prescriptionService.findPrescriptionList(patient,status,startTime,endTime,page,size,wxId);
        } catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientList)
@ -265,7 +293,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                                              @RequestParam(value = "page", required = false)Integer page,
                                                                              @ApiParam(name = "size", value = "每页大小")
                                                                              @RequestParam(value = "size", required = true) Integer size) {
        return prescriptionService.findReOutpatientList(patient,status,startTime,endTime,outpatientType,page,size);
        try {
            return prescriptionService.findReOutpatientList(patient,status,startTime,endTime,outpatientType,page,size);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientInfo)
@ -274,16 +307,25 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                           @RequestParam(value = "outpatientId", required = true) String outpatientId,
                                           @ApiParam(name = "prescriptionId", value = "处方ID")
                                           @RequestParam(value = "prescriptionId", required = false) String prescriptionId)throws Exception{
        com.alibaba.fastjson.JSONObject obj =  prescriptionService.findReOutpatientInfo(outpatientId,prescriptionId,wxId);
        return success(obj);
        try {
            com.alibaba.fastjson.JSONObject obj =  prescriptionService.findReOutpatientInfo(outpatientId,prescriptionId,wxId);
            return success(obj);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPrescriptionInfo)
    @ApiOperation(value = "获取所有居民相关信息,续方信息,物流信息,药品信息(单条)", notes = "获取所有居民相关信息,续方信息,物流信息,药品信息(单条)")
    public ObjEnvelop<Map<String,Object>> findPrescriptionInfo(@ApiParam(name = "prescriptionId", value = "续方明细")
                                                               @RequestParam(value = "prescriptionId", required = false) String prescriptionId) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.findPrescriptionInfo(prescriptionId));
        try {
            return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.findPrescriptionInfo(prescriptionId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkPrescription)
@ -291,7 +333,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<Boolean> checkPrescription(@ApiParam(name = "patient", value = "续方明细")
                                                 @RequestParam(value = "patient", required = false) String patient) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.checkPrescription(patient));
        try {
            return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.checkPrescription(patient));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.cancelPrescription)
@ -299,14 +346,23 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<Boolean> cancelPrescription(@ApiParam(name = "prescriptionId", value = "续方ID")
                                                  @RequestParam(value = "prescriptionId", required = false) String prescriptionId) {
        
        return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.cancelPrescription(prescriptionId));
        try {
            return success(BaseHospitalRequestMapping.Prescription.api_success,prescriptionService.cancelPrescription(prescriptionId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientCard)
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ListEnvelop findPatientCard(@ApiParam(name = "patient", value = "居民Code")
                                       @RequestParam(value = "patient", required = true)String patient)throws Exception {
        return success(prescriptionService.findPatientCard(patient));
        try {
            return success(prescriptionService.findPatientCard(patient));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkOutpatient)
@ -317,7 +373,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "flag", required = false)boolean flag,
                                      @ApiParam(name = "outpatientType", value = "1在线复诊 2 协同 3 专家咨询")
                                          @RequestParam(value = "outpatientType", required = false)String outpatientType)throws Exception{
        return success(prescriptionService.checkOutpatient(patient,wxId,flag,outpatientType));
        try {
            return success(prescriptionService.checkOutpatient(patient,wxId,flag,outpatientType));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
@ -326,7 +387,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "level", required = false)Integer level,
                                       @ApiParam(name = "keyWord", value = "名字关键字")
                                       @RequestParam(value = "keyWord", required = false)String keyWord) {
        return success(prescriptionService.findAllHospital(level,keyWord));
        try {
            return success(prescriptionService.findAllHospital(level,keyWord));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByHospital)
@ -337,7 +403,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "dept", required = false)String dept,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
        try {
            return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -347,7 +418,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "orgCode", required = true)String orgCode,
                                          @ApiParam(name = "deptCode", value = "部门code")
                                          @RequestParam(value = "deptCode", required = true)String deptCode) {
        return prescriptionService.findDeptDesc(orgCode,deptCode);
        try {
            return prescriptionService.findDeptDesc(orgCode,deptCode);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
@ -357,7 +433,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                   @RequestParam(value = "orgCode", required = true)String orgCode,
                                        @ApiParam(name = "keyName", value = "关键字")
                                        @RequestParam(value = "keyName", required = false)String keyName) {
        return prescriptionService.findDeptByOrgCode(orgCode,keyName);
        try {
            return prescriptionService.findDeptByOrgCode(orgCode,keyName);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptByKeyWord)
@ -368,7 +449,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "page",required = true) Integer page,
                                         @ApiParam(name = "pagesize", value = "分页大小")
                                         @RequestParam(value = "pagesize",required = true) Integer pagesize) {
        return success(prescriptionService.findDeptByKeyWord(keyWord,page,pagesize));
        try {
            return success(prescriptionService.findDeptByKeyWord(keyWord,page,pagesize));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDept)
@ -391,7 +477,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                   @RequestParam(value = "key", required = false)String key,
                                                   @ApiParam(name = "consultStatus", value = "是否在线")
                                                   @RequestParam(value = "consultStatus", required = false)String consultStatus) {
        return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus));
        try {
            return success(prescriptionService.findDoctorByHospitalAndDept(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.appointmentRevisit)
@ -405,47 +495,50 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @ApiParam(name = "chargeType", value = "预约实体json")
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()&&!wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            ObjEnvelop objEnvelop =new ObjEnvelop();
            String msg = "";
            if (1==wlyyOutpatientDO.getRemindCount()){
                msg = "自取";
        try {
            WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
            if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()&&!wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
                ObjEnvelop objEnvelop =new ObjEnvelop();
                String msg = "";
                if (1==wlyyOutpatientDO.getRemindCount()){
                    msg = "自取";
                }else {
                    msg = "快递配送";
                }
                objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
                objEnvelop.setStatus(300);
                return objEnvelop;
            }else {
                msg = "快递配送";
            }
            objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
            objEnvelop.setStatus(300);
            return objEnvelop;
        }else {
            BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
            //发送系统消息
            SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
            //发送IM消息
            hospitalSystemMessageService.sendImMessage(systemMessageDO);
                BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
                //发送系统消息
                SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
                //发送IM消息
                hospitalSystemMessageService.sendImMessage(systemMessageDO);
            //发送医生抢单消息
            if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
                hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
            }
            if(!"zsyy".equals(qywxId) && !"xm_xzzx_wx".equals(qywxId)){
                //发送厦门i健康智能推送
                try{
                    if (doctorDO!=null&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        String wxurl = wlyyUrl+"/im/common/message/sendDoctorTemplateByDoctorIdcard?sessionId=1_1&sessionType=1&from=1&content=1&businessType=new&doctor_idcard="+doctorDO.getIdcard()+"&patientName="+URLEncoder.encode(wlyyOutpatientDO.getPatientName())+"&url=1";
                        logger.info("发送厦门i健康智能推送url:"+wxurl);
                        wlyyBusinessService.sendDoctorTemplateByDoctorIdcard(wxurl);
                //发送医生抢单消息
                if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
                    hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
                }
                if(!"zsyy".equals(qywxId) && !"xm_xzzx_wx".equals(qywxId)){
                    //发送厦门i健康智能推送
                    try{
                        if (doctorDO!=null&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                            String wxurl = wlyyUrl+"/im/common/message/sendDoctorTemplateByDoctorIdcard?sessionId=1_1&sessionType=1&from=1&content=1&businessType=new&doctor_idcard="+doctorDO.getIdcard()+"&patientName="+URLEncoder.encode(wlyyOutpatientDO.getPatientName())+"&url=1";
                            logger.info("发送厦门i健康智能推送url:"+wxurl);
                            wlyyBusinessService.sendDoctorTemplateByDoctorIdcard(wxurl);
                        }
                    }catch (Exception e){
                        logger.info("发送厦门i健康智能失败"+e.toString());
                    }
                }catch (Exception e){
                    logger.info("发送厦门i健康智能失败"+e.toString());
                }
            }
            return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
                return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
            }
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getICD10)
@ -525,7 +618,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "删除处方草稿", notes = "删除处方草稿")
    public Envelop deletePrescription(@ApiParam(name = "id", value = "处方id")
                                              @RequestParam(value = "id", required = true)String id)throws Exception {
        return success(prescriptionService.deletePrescription(id));
        try{
            return success(prescriptionService.deletePrescription(id));
        }catch (Exception e) {
            return failedException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.makeDiagnosis)
@ -583,7 +682,6 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(result);
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findExpressageList)
    @ApiOperation(value = "获取订单列表", notes = "获取订单列表")
    public MixEnvelop findExpressageList(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
@ -600,7 +698,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "page", required = false)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = false)Integer size) {
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size,wxId);
        try {
            return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size,wxId);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.setMailno)
@ -609,7 +712,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                @RequestParam(value = "mailno", required = false)String mailno,
                                @ApiParam(name = "expressageId", value = "订单id")
                                @RequestParam(value = "expressageId", required = false)String expressageId) {
        return success(prescriptionService.setMailno(mailno,expressageId));
        try{
            return success(prescriptionService.setMailno(mailno,expressageId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
@ -637,7 +746,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "就诊费用查询", notes = "就诊费用查询")
    public ListEnvelop findByDeptTypeCode(@ApiParam(name = "deptTypeCode", value = "6总部7金榜8夏禾")
                                          @RequestParam(value = "deptTypeCode", required = false)String deptTypeCode) throws Exception{
        return success(prescriptionService.findByDeptTypeCode(deptTypeCode));
        try {
            return success(prescriptionService.findByDeptTypeCode(deptTypeCode));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getCardInfo)
@ -674,7 +788,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus,page,size,ywCode));
        try {
            return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus,page,size,ywCode));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithMouthWork)
@ -696,7 +815,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                              @ApiParam(name = "size", value = "每页大小")
                                              @RequestParam(value = "size", required = true)Integer size) {
        
        return success(prescriptionService.findDoctorWithMouthWork(orgCode,dept,chargeType,date,nameKey,iswork,page,size));
        try {
            return success(prescriptionService.findDoctorWithMouthWork(orgCode,dept,chargeType,date,nameKey,iswork,page,size));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    
@ -704,7 +827,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取具体号源", notes = "获取具体号源")
    public ListEnvelop findWorkTimeInfo(@ApiParam(name = "id", value = "排班id")
                                        @RequestParam(value = "id", required = false)String id) {
        return success(prescriptionService.findWorkTimeInfo(id));
        try {
            return success(prescriptionService.findWorkTimeInfo(id));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorInfo)
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
@ -714,7 +842,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "withWork", required = false)String withWork,
                                     @ApiParam(name = "patient", value = "患者code")
                                         @RequestParam(value = "patient", required = false)String patient){
        return success(prescriptionService.findDoctorInfo(doctor,withWork,patient));
        try {
            return success(prescriptionService.findDoctorInfo(doctor,withWork,patient));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updateDoctorInfo)
@ -751,7 +883,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return success(prescriptionService.updateDoctorInfo(id, img,background,expertise, visitHospital, visitHospitalName, visitDept, visitDeptName, backgroundId,name,sex,learning,introduce,photo));
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -759,7 +891,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取医生基本信息信息", notes = "获取医生基本信息信息")
    public ObjEnvelop findDoctorBaseInfo(@ApiParam(name = "doctor", value = "医生code")
                                         @RequestParam(value = "doctor", required = true)String doctor){
        return success(prescriptionService.findDoctorBaseInfo(doctor));
        try {
            return success(prescriptionService.findDoctorBaseInfo(doctor));
        }catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.cancelOutPatient)
@ -783,38 +921,56 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                consultTeamDao.save(consultTeamDo);
            }
        }*/
        try {
            String consultCode = imService.getConsultCodeByOutpatientId(outPatientId);
            System.out.println("consultCode"+consultCode);
            if(StringUtils.isNoneBlank(consultCode)) {
                ConsultDo consultDo = consultDao.findByRelationCode(outPatientId);
                if(null!=consultDo){
                    imService.cancelRevisit(consultCode, consultDo.getPatient(), 1);
        try{
            try {
                String consultCode = imService.getConsultCodeByOutpatientId(outPatientId);
                System.out.println("consultCode"+consultCode);
                if(StringUtils.isNoneBlank(consultCode)) {
                    ConsultDo consultDo = consultDao.findByRelationCode(outPatientId);
                    if(null!=consultDo){
                        imService.cancelRevisit(consultCode, consultDo.getPatient(), 1);
                    }
                }
            }
            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outPatientId;
                prescriptionService.sendZsMsgFlow("OL_WZ_CANCEL",outPatientId,"",msgUrl,"取消问诊(用户)");
                if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                    String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outPatientId;
                    prescriptionService.sendZsMsgFlow("OL_WZ_CANCEL",outPatientId,"",msgUrl,"取消问诊(用户)");
                }
            }catch (Exception e){
                System.out.println("居民取消复诊失败");
                e.printStackTrace();
            }
        }catch (Exception e){
            System.out.println("居民取消复诊失败");
            return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1,wxId));
        }catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
        return success(prescriptionService.cancelOutPatient(outPatientId,cancelType,cancelValue,cancelRemark,1,wxId));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findCancelReasonList)
    @ApiOperation(value = "获取居民取消原因字典", notes = "获取居民取消原因字典")
    public ListEnvelop findCancelReasonList(){
        return success(prescriptionService.findCancelReasonList());
        try {
            return success(prescriptionService.findCancelReasonList());
        }catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findFastRegisterDate)
    @ApiOperation(value = "獲取快速咨詢時間", notes = "獲取快速咨詢時間")
    public ListEnvelop findFastRegisterDate(){
        return success(prescriptionService.findFastRegisterDate());
        try {
            return success(prescriptionService.findFastRegisterDate());
        }catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByTimeSlot)
@ -823,7 +979,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "startTime", required = false)String startTime,
                                      @ApiParam(name = "endTime", value = "结束时间")
                                      @RequestParam(value = "endTime", required = false)String endTime) {
        return success(prescriptionService.findByTimeSlot(startTime,endTime));
        try {
            return success(prescriptionService.findByTimeSlot(startTime,endTime));
        }catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException(e);
        }
    }
    
    
@ -837,21 +999,37 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                 @RequestParam(value = "startDate", required = false)String startDate,
                                                 @ApiParam(name = "endDate", value = "yyyy-MM-dd")
                                                 @RequestParam(value = "endDate", required = false)String endDate) {
        return success(prescriptionService.findDoctorWorkTimeByMonth(doctor,date,startDate,endDate));
        try {
            return success(prescriptionService.findDoctorWorkTimeByMonth(doctor,date,startDate,endDate));
        }catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findWorkRule)
    @ApiOperation(value = "查询排班规则", notes = "查询排班规则")
    public ListEnvelop findWorkRule(@ApiParam(name = "hospital", value = "医生code")
                                    @RequestParam(value = "hospital", required = true)String hospital) {
        return success(prescriptionService.findWorkRule("Scheduling",hospital));
        try {
            return success(prescriptionService.findWorkRule("Scheduling",hospital));
        }catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.updateWorkRule)
    @ApiOperation(value = "保存排班规则", notes = "保存排班规则")
    public ObjEnvelop updateWorkRule(@ApiParam(name = "workRoleJsons", value = "排班规则json")
                                     @RequestParam(value = "workRoleJsons", required = true)String workRoleJsons) {
        return success(prescriptionService.updateWorkRule(workRoleJsons));
        try {
            return success(prescriptionService.updateWorkRule(workRoleJsons));
        }catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveDoctorWorkTimeJson)
@ -864,7 +1042,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                             @RequestParam(value = "workTimeJson", required = true)String workTimeJson,
                                             @ApiParam(name = "date", value = "yyyy-MM,支持‘,’分割")
                                             @RequestParam(value = "date", required = false)String date)throws Exception {
        return success(prescriptionService.saveDoctorWorkTimeJson(type,codes,workTimeJson,date));
        try {
            return success(prescriptionService.saveDoctorWorkTimeJson(type,codes,workTimeJson,date));
        }catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
    }
@ -879,7 +1062,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success(prescriptionService.doctorSaveWorkTimeJson(codes,workTimeJson,date));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -893,7 +1076,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success(prescriptionService.doctorUpdateWorkTimeJson(workTimeJson,codes));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.deleteWorkTime)
@ -903,7 +1086,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success(prescriptionService.deleteWorkTime(code));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -916,7 +1099,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = "test2")
    @ApiOperation(value = "test2", notes = "test2")
    public Envelop test(String no)throws Exception {
        return success(prescriptionService.test2(no));
        try {
            return success(prescriptionService.test2(no));
        } catch (Exception e) {
            return failedException(e);
        }
    }
    
    @PostMapping(value = "/sendMes")
@ -987,7 +1174,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取居民信息接口", notes = "获取居民信息接口")
    public ObjEnvelop findPatientInfo(@ApiParam(name = "patient", value = "居民ID")
                                      @RequestParam(value = "patient", required = true)String patient){
        return success(prescriptionService.findPatientInfo(patient));
        try {
            return success(prescriptionService.findPatientInfo(patient));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
        
    }
@ -1025,22 +1216,33 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "city", required = false)String city,
                                      @ApiParam(name = "cityName", value = "市名称")
                                          @RequestParam(value = "cityName", required = false)String cityName){
        return success(prescriptionService.updatePatientInfo(patient,name,idcard,ssc,sex,town,townName,committeeCode,committeeName,address,photo,mobile,province,provinceName,city,cityName));
        try {
            return success(prescriptionService.updatePatientInfo(patient,name,idcard,ssc,sex,town,townName,committeeCode,committeeName,address,photo,mobile,province,provinceName,city,cityName));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveDoctorOnlineWork)
    @ApiOperation(value = "保存在线排班", notes = "保存在线排班")
    public Envelop saveDoctorOnlineWork(@ApiParam(name = "onlineWorkJson", value = "保存在线排班json")
                                        @RequestParam(value = "onlineWorkJson", required = true)String onlineWorkJson)throws Exception {
        return prescriptionService.saveDoctorOnlineWork(onlineWorkJson);
        try {
            return prescriptionService.saveDoctorOnlineWork(onlineWorkJson);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.delDoctorOnlineWork)
    @ApiOperation(value = "删除在线排班", notes = "删除在线排班")
    public Envelop delDoctorOnlineWork(@ApiParam(name = "id", value = "保存在线排班ID")
                                       @RequestParam(value = "id", required = true)String id)throws Exception {
        return prescriptionService.delDoctorOnlineWork(id);
        try {
            return prescriptionService.delDoctorOnlineWork(id);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorOnlineWorkList)
@ -1051,7 +1253,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                @RequestParam(value = "startDate", required = true)String startDate,
                                                @ApiParam(name = "endDate", value = "结束时间,YYYY-MM-dd")
                                                @RequestParam(value = "endDate", required = true)String endDate)throws Exception {
        return success(prescriptionService.findDoctorOnlineWorkList(doctor,startDate,endDate));
        try {
            return success(prescriptionService.findDoctorOnlineWorkList(doctor,startDate,endDate));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.cooperativeOutpatient)
@ -1062,19 +1269,24 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                            @RequestParam(value = "registerJson", required = false)String registerJson,
                                            @ApiParam(name = "chargeType", value = "号别")
                                            @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.cooperativeOutpatient(outpatientJson,registerJson,chargeType);
        
        //构建系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
        //发送系统消息
        hospitalSystemMessageService.sendImMessage(systemMessageDO);
        
        //发送医生抢单消息
        if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
            hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
        try {
            WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.cooperativeOutpatient(outpatientJson,registerJson,chargeType);
            //构建系统消息
            SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
            //发送系统消息
            hospitalSystemMessageService.sendImMessage(systemMessageDO);
            //发送医生抢单消息
            if(StringUtils.isBlank(wlyyOutpatientDO.getDoctor())){
                hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
            }
            return success(wlyyOutpatientDO);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
        
        return success(wlyyOutpatientDO);
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.saveOutpatientDoctor)
@ -1085,7 +1297,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                           @RequestParam(value = "registerJson", required = false)String registerJson,
                                           @ApiParam(name = "chargeType", value = "号别")
                                           @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        return success(prescriptionService.saveOutpatientDoctor(outpatientJson,registerJson,chargeType));
        try {
            return success(prescriptionService.saveOutpatientDoctor(outpatientJson,registerJson,chargeType));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.checkOauthQRCode)
@ -1111,7 +1327,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "page", required = true)Integer page,
                                       @ApiParam(name = "size", value = "每页大小")
                                       @RequestParam(value = "size", required = true)Integer size) {
        return prescriptionService.findByGeneralDoctor(generalDoctor,startDate,endDate,status,sort,page,size,wxId);
        try {
            return prescriptionService.findByGeneralDoctor(generalDoctor,startDate,endDate,status,sort,page,size,wxId);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    
    
@ -1119,7 +1339,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "全科医生首页统计信息", notes = "全科医生首页统计信息")
    public ObjEnvelop findGeneralDoctorInfo(@ApiParam(name = "generalDoctor", value = "全科医生")
                                            @RequestParam(value = "generalDoctor", required = true)String generalDoctor) {
        return success(prescriptionService.findGeneralDoctorInfo(generalDoctor));
        try {
            return success(prescriptionService.findGeneralDoctorInfo(generalDoctor));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.sendWlyyOutpatientMes)
@ -1143,7 +1367,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "居民获取当日就诊列表", notes = "居民获取当日就诊列表")
    public ListEnvelop getTodayOutpatinetList(@ApiParam(name = "patient", value = "居民ID")
                                              @RequestParam(value = "patient", required = true) String patient){
        return success(prescriptionService.getTodayOutpatinetList(patient,wxId));
        try{
            return success(prescriptionService.getTodayOutpatinetList(patient,wxId));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDoctorMapping)
@ -1152,7 +1380,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "doctor", required = true)String doctor,
                                       @ApiParam(name = "orgCode", value = "机构code")
                                       @RequestParam(value = "orgCode", required = true)String orgCode){
        return success(prescriptionService.getDoctorMapping(doctor,orgCode));
        try {
            return success(prescriptionService.getDoctorMapping(doctor,orgCode));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
        
    }
    
@ -1183,14 +1416,23 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询处方日志", notes = "查询处方日志")
    public ListEnvelop findPrescriptionLogByPreId(@ApiParam(name = "prescriptionCode", value = "处方code")
                                                  @RequestParam(value = "prescriptionCode", required = true)String prescriptionCode)throws Exception{
        return success(prescriptionLogService.findPrescriptionLogByPreId(prescriptionCode));
        try{
            return success(prescriptionLogService.findPrescriptionLogByPreId(prescriptionCode));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByPrescriptionCodeByStatus)
    @ApiOperation(value = "查询处方流程", notes = "查询处方流程")
    public ListEnvelop findByPrescriptionCodeByStatus(@ApiParam(name = "prescriptionCode", value = "处方code")
                                                      @RequestParam(value = "prescriptionCode", required = true)String prescriptionCode)throws Exception{
        return success(prescriptionLogService.findByPrescriptionCodeByStatus(prescriptionCode));
        try {
            return success(prescriptionLogService.findByPrescriptionCodeByStatus(prescriptionCode));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.xzzxFindByPartsCode)
    @ApiOperation(value = "心脏查询部位字典", notes = "心脏查询部位字典")
@ -1278,7 +1520,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取医生简介")
    public ObjEnvelop getDoctorIntroduction(@ApiParam(name = "doctor", value = "医生编码")
                                            @RequestParam(value = "doctor",required = false) String doctor)throws Exception{
        return success(prescriptionService.getDoctorIntroduction(doctor));
        try {
            return success(prescriptionService.getDoctorIntroduction(doctor));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findByDict)
@ -1287,7 +1534,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                  @RequestParam(value = "name", required = true)String name,
                                  @ApiParam(name = "hospital", value = "医生code")
                                  @RequestParam(value = "hospital", required = true)String hospital) {
        return success(prescriptionService.findByDict(name,hospital));
        try {
            return success(prescriptionService.findByDict(name,hospital));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getPatientAccetokenByIdcard)
@ -1400,7 +1652,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                        @RequestParam(value = "chargeType",required = false)String chargeType,
                                        @ApiParam(name = "dept", value = "科室")
                                            @RequestParam(value = "dept",required = false)String dept) {
        return success(prescriptionService.findDoctorByName(hospital,name,chargeType,dept));
        try {
            return success(prescriptionService.findDoctorByName(hospital,name,chargeType,dept));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDeptWithDoctorWorkTime)
@ -1413,14 +1669,23 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                  @RequestParam(value = "page",required = false)Integer page,
                                                  @ApiParam(name = "pagesize", value = "每页大小")
                                                  @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.findDeptWithDoctorWorkTime(hospital,keyWord,page,pagesize));
        try {
            return success(prescriptionService.findDeptWithDoctorWorkTime(hospital,keyWord,page,pagesize));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.findWorkTimeRule)
    @ApiOperation(value = "查询排班规则")
    public ObjEnvelop findWorkTimeRule(@ApiParam(name = "hospital", value = "医院code")
                                       @RequestParam(value = "hospital",required = true)String hospital) {
        return success(workTimeService.findWorkTimeRule(hospital));
        try {
            return success(workTimeService.findWorkTimeRule(hospital));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveWorkTimeRule)
@ -1429,7 +1694,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @RequestParam(value = "workTimeRuleJson",required = true)String workTimeRuleJson,
                                       @ApiParam(name = "isDoctorWorkJson", value = "判断是否排班json数据")
                                       @RequestParam(value = "isDoctorWorkJson",required = false)String isDoctorWorkJson) throws Exception{
        return success(workTimeService.saveWorkTimeRule(workTimeRuleJson,isDoctorWorkJson));
        try {
            return success(workTimeService.saveWorkTimeRule(workTimeRuleJson,isDoctorWorkJson));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    
@ -1439,7 +1709,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false) String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
        try {
            return success(workTimeService.checkDoctorWork(doctor,ywCode));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.importDoctorWork)
@ -1451,45 +1725,50 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                        @ApiParam(name = "dateMoth", value = "年-月,格式:2020-03")
                                        @RequestParam(value = "dateMoth",required = true)String dateMoth,
                                        HttpServletRequest request)throws Exception{
        request.setCharacterEncoding("UTF-8");
        DoctorWorkTimeExcelReader reader = new DoctorWorkTimeExcelReader();
        reader.read(file);
        
        if("-1".equals(reader.getCode())) {
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(-1);
            envelop.setMessage("目前仅支持200位医生同时导入!");
            return envelop;
        }
        
        List<DoctorWorkTimeMainExcelDO> errorLs = reader.getErrorLs();
        List<DoctorWorkTimeMainExcelDO> correctLs = reader.getCorrectLs();
        if(errorLs!=null&&errorLs.size()>0){
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(-1);
            envelop.setMessage("格式错误!");
            envelop.setDetailModelList(errorLs);
            return envelop;
        }
        
        Map<String,Object> rs = workTimeService.getExcelWorkInfo(correctLs,dateMoth,hospital);
        List<DoctorWorkTimeMainExcelDO> error = (List<DoctorWorkTimeMainExcelDO>)rs.get("error");
        Integer errorTotal = (Integer) rs.get("errorTotal");
        Integer succTotal = (Integer) rs.get("succTotal");
        
        if(error!=null&&error.size()>0){
        try {
            request.setCharacterEncoding("UTF-8");
            DoctorWorkTimeExcelReader reader = new DoctorWorkTimeExcelReader();
            reader.read(file);
            if("-1".equals(reader.getCode())) {
                ListEnvelop envelop = new ListEnvelop();
                envelop.setStatus(-1);
                envelop.setMessage("目前仅支持200位医生同时导入!");
                return envelop;
            }
            List<DoctorWorkTimeMainExcelDO> errorLs = reader.getErrorLs();
            List<DoctorWorkTimeMainExcelDO> correctLs = reader.getCorrectLs();
            if(errorLs!=null&&errorLs.size()>0){
                ListEnvelop envelop = new ListEnvelop();
                envelop.setStatus(-1);
                envelop.setMessage("格式错误!");
                envelop.setDetailModelList(errorLs);
                return envelop;
            }
            Map<String,Object> rs = workTimeService.getExcelWorkInfo(correctLs,dateMoth,hospital);
            List<DoctorWorkTimeMainExcelDO> error = (List<DoctorWorkTimeMainExcelDO>)rs.get("error");
            Integer errorTotal = (Integer) rs.get("errorTotal");
            Integer succTotal = (Integer) rs.get("succTotal");
            if(error!=null&&error.size()>0){
                ListEnvelop envelop = new ListEnvelop();
                envelop.setStatus(-1);
                envelop.setMessage(succTotal+"位医生,更新成功!"+","+errorTotal+"位医生,身份信息错误!更新失败!");
                envelop.setDetailModelList(error);
                return envelop;
            }
            ListEnvelop envelop = new ListEnvelop();
            envelop.setStatus(-1);
            envelop.setMessage(succTotal+"位医生,更新成功!"+","+errorTotal+"位医生,身份信息错误!更新失败!");
            envelop.setStatus(200);
            envelop.setMessage("导入成功!"+succTotal+"位医生排班数据!");
            envelop.setDetailModelList(error);
            return envelop;
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
        
        ListEnvelop envelop = new ListEnvelop();
        envelop.setStatus(200);
        envelop.setMessage("导入成功!"+succTotal+"位医生排班数据!");
        envelop.setDetailModelList(error);
        return envelop;
    }
    
    
@ -1612,7 +1891,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectStatusById(id));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -1630,7 +1909,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectListStatus(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1700,7 +1979,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                            @RequestParam(value = "page",required = false)Integer page,
                                            @ApiParam(name = "pagesize", value = "每页大小")
                                            @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.selectByCondition(hospital,dept,status,startTime,endTime,nameinfo,page,pagesize,wxId));
        try {
            return success(prescriptionService.selectByCondition(hospital,dept,status,startTime,endTime,nameinfo,page,pagesize,wxId));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateStatus)
@ -1714,7 +1997,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            prescriptionService.updateStatus(prescriptionId,status);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1736,7 +2019,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            prescriptionService.updateMailNoById(id,mailNo);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1835,7 +2118,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            return ObjEnvelop.getSuccess("ok",prescriptionService.savePrescriptionCheck(operate,reason,status,prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1856,7 +2139,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            
            return ObjEnvelop.getSuccess("ok",prescriptionService.findPrescriptionCheck(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1876,7 +2159,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            
            return ObjEnvelop.getSuccess("ok",prescriptionService.selectByPrescriptionId(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    
@ -1892,7 +2175,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            prescriptionService.deleteById(flag,id);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -1906,7 +2189,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderTime(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -1945,7 +2228,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.findByPrescriptionId(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -1995,7 +2278,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.readOutPatient(registerSn));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2013,7 +2296,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.readOutPatientXml(registerSn));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2030,7 +2313,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            }
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2043,7 +2326,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.outpmedicaldoc(patient));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2061,7 +2344,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                return ObjEnvelop.getSuccess("ok",prescriptionService.getPatInfoDataXml(opid,recSn));
            }
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2088,7 +2371,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.writeOutPatient(registerSn,chiefComplaint,hpi,elapsemhis,bodycheck,assistanTcheck,doctor,doctorName));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2116,7 +2399,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            }
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient,isSelectDrug,consumerflag);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
            return failedPageEnvelopException(e);
        }
    }
@ -2131,7 +2414,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return prescriptionService.findDrugAddress(outpatientId,longitude,dimension);
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
            return failedMixEnvelopException(e);
        }
    }
@ -2145,8 +2428,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BaseCommitteeDO> baseProvinces = baseCommitteeService.search(fields, filters, sorts);
        return success(baseProvinces, BaseCommitteeVO.class);
        try {
            List<BaseCommitteeDO> baseProvinces = baseCommitteeService.search(fields, filters, sorts);
            return success(baseProvinces, BaseCommitteeVO.class);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -2159,8 +2447,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BaseTownDO> baseTowns = baseTownService.search(fields, filters, sorts);
        return success(baseTowns, BaseTownVO.class);
        try{
            List<BaseTownDO> baseTowns = baseTownService.search(fields, filters, sorts);
            return success(baseTowns, BaseTownVO.class);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -2173,8 +2466,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BaseProvinceDO> baseProvinces = baseProvinceService.search(fields, filters, sorts);
        return success(baseProvinces, BaseProvinceVO.class);
        try {
            List<BaseProvinceDO> baseProvinces = baseProvinceService.search(fields, filters, sorts);
            return success(baseProvinces, BaseProvinceVO.class);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findCity)
@ -2186,8 +2484,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BaseCityDO> baseCitys = baseCityService.search(fields, filters, sorts);
        return success(baseCitys, BaseCityVO.class);
        try {
            List<BaseCityDO> baseCitys = baseCityService.search(fields, filters, sorts);
            return success(baseCitys, BaseCityVO.class);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    /**
     * 获取诊间支付url
@ -2223,7 +2526,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public MixEnvelop findCity (
            @ApiParam(name = "patientCode", value = "居民code")
            @RequestParam(value = "patientCode", required = false) String patientCode) throws Exception {
      return   prescriptionService.findPatientOpenId(patientCode);
      try {
          return   prescriptionService.findPatientOpenId(patientCode);
      } catch (Exception e) {
          return failedMixEnvelopException(e);
      }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.updatePayStatus)
@ -2250,7 +2558,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            }
            return ObjEnvelop.getSuccess("ok",businessOrderDO);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -2263,7 +2571,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return ObjEnvelop.getSuccess("ok",patientMappingService.findPatientNoByPatientCode(code));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.popularityIncrease)
@ -2271,8 +2579,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public Envelop popularityIncrease (
            @ApiParam(name = "doctor", value = "医生id")
            @RequestParam(value = "doctor", required = false) String doctor) throws Exception {
        BaseDoctorDO baseDoctorDO=baseDoctorInfoService.popularityIncrease(doctor);
        return  success("操作成功",baseDoctorDO);
        try {
            BaseDoctorDO baseDoctorDO=baseDoctorInfoService.popularityIncrease(doctor);
            return  success("操作成功",baseDoctorDO);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.xzzxSelectExamApply)
    @ApiOperation(value = "检查项目查询接口")
@ -2379,7 +2692,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "icd10Name", value = "诊断名称")
            @RequestParam(value = "icd10Name",defaultValue = "") String icd10Name) throws Exception {
        return prescriptionService.updatePatientDiagnosis(outpatientId,icd10,icd10Name);
        try {
            return prescriptionService.updatePatientDiagnosis(outpatientId,icd10,icd10Name);
        }catch (Exception e) {
            return failedException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.delHisPrescriptionByHisNo)
    @ApiOperation(value = "删除his处方信息")
@ -2419,7 +2737,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize",value = "页大小")
            @RequestParam(value = "pageSize",defaultValue = "",required = false) Integer pageSize) throws Exception {
        return prescriptionService.prescriptionManage(keyWord,doctorId,startTime,endTime,checkStatus,status,page,pageSize);
        try {
            return prescriptionService.prescriptionManage(keyWord,doctorId,startTime,endTime,checkStatus,status,page,pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.disablePrescription)
    @ApiOperation(value = "作废处方")
@ -2707,8 +3029,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        try {
            return prescriptionService.getNatAppointmentList(realOrder, name, hospitalFlag, mobile, idcard, payStatus, medicare, createTimeStart, createTimeEnd, appointmentTimeStart,appointmentTimeEnd,isSuccess, page, pageSize,orderNo);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }catch (Exception e) {
            return failedException(e);
        }
    }

+ 132 - 50
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -58,27 +58,41 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "startTime",required = false) String startTime,
                                          @ApiParam(name = "endTime", value = "结束时间")
                                          @RequestParam(value = "endTime",required = false) String endTime) throws Exception{
        if(page==null){
            page = 1;
        }
        if(size==null){
            size = 10;
        try {
            if(page==null){
                page = 1;
            }
            if(size==null){
                size = 10;
            }
            return success(ykyyEntranceService.vlisReportMasterlist(patient, page, size,startTime,endTime));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
        return success(ykyyEntranceService.vlisReportMasterlist(patient, page, size,startTime,endTime));
    }
    @GetMapping(value = "vlisReportMasterDetail")
    @ApiOperation(value = "检验信息明细")
    public ObjEnvelop vlisReportMasterDetail(@ApiParam(name = "reportId", value = "报告id")
                                         @RequestParam(value = "reportId",required = true) String reportId)throws Exception{
        return success(ykyyEntranceService.vlisReportMasterDetail(reportId));
        try {
            return success(ykyyEntranceService.vlisReportMasterDetail(reportId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "vpacsReportDetail")
    @ApiOperation(value = "检查信息明细")
    public ObjEnvelop vpacsReportDetail(@ApiParam(name = "reportId", value = "报告id")
                                             @RequestParam(value = "reportId",required = true) String reportId)throws Exception{
        return success(ykyyEntranceService.vpacsReportDetail(reportId));
        try {
            return success(ykyyEntranceService.vpacsReportDetail(reportId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "vpacsReportList")
@ -89,13 +103,18 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                            @RequestParam(value = "page",required = false) Integer page,
                                            @ApiParam(name = "size", value = "页面大小")
                                            @RequestParam(value = "size",required = false) Integer size) throws Exception{
        if(page==null){
            page = 1;
        }
        if(size==null){
            size = 10;
        try {
            if(page==null){
                page = 1;
            }
            if(size==null){
                size = 10;
            }
            return success(ykyyEntranceService.vpacsReportList(patient, page, size));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
        return success(ykyyEntranceService.vpacsReportList(patient, page, size));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientList)
@ -110,19 +129,29 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                              @RequestParam(value = "ksdm",required = false) String ksdm,
                                                      @ApiParam(name = "cardNo", value = "就诊卡号")
                                                      @RequestParam(value = "cardNo",required = false) String cardNo) throws Exception {
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient,cardNo, startTime, endTime, demoFlag,ksdm);
        return success(vos);
        try {
            List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient,cardNo, startTime, endTime, demoFlag,ksdm);
            return success(vos);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.synDoctorInfo)
    @ApiOperation(value = " 同步医生")
    public ObjEnvelop synDoctorInfo(@ApiParam(name = "idcard", value = "身份证")
                                         @RequestParam(value = "idcard",required = false) String idcard)throws Exception{
        ObjEnvelop obj =  new ObjEnvelop();
        prescriptionService.synDoctorInfo(idcard);
        obj.setStatus(200);
        obj.setMessage("同步成功");
        return success(obj);
        try {
            ObjEnvelop obj =  new ObjEnvelop();
            prescriptionService.synDoctorInfo(idcard);
            obj.setStatus(200);
            obj.setMessage("同步成功");
            return success(obj);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
@ -135,8 +164,13 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "conNo",required = false) String conNo,
                                         @ApiParam(name = "ksdm", value = "科室编号")
                                             @RequestParam(value = "ksdm",required = false) String ksdm)throws Exception{
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag,ksdm);
        return success(obj);
        try {
            WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag,ksdm);
            return success(obj);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
@ -150,8 +184,13 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号")
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        return success(obj);
        try {
            List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
            return success(obj);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -166,20 +205,22 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @ApiParam(name = "chargeType", value = "预约实体json")
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()&&!wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            ObjEnvelop objEnvelop =new ObjEnvelop();
            String msg = "";
            if (1==wlyyOutpatientDO.getRemindCount()){
                msg = "自取";
            }else {
                msg = "快递配送";
        try {
            WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
            if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()&&!wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
                ObjEnvelop objEnvelop =new ObjEnvelop();
                String msg = "";
                if (1==wlyyOutpatientDO.getRemindCount()){
                    msg = "自取";
                }else {
                    msg = "快递配送";
                }
                objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
                objEnvelop.setStatus(300);
                return objEnvelop;
            }
            objEnvelop.setMessage("您已经选择过"+msg+"方式,请勿修改");
            objEnvelop.setStatus(300);
            return objEnvelop;
        }
        SystemMessageDO systemMessageDO = commenPrescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
            SystemMessageDO systemMessageDO = commenPrescriptionService.sendOutPatientMes(wlyyOutpatientDO,payFlag);
       /* //发送系统消息
        SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(wlyyOutpatientDO);
        //发送IM消息
@ -190,7 +231,10 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
            hospitalSystemMessageService.sendImPichCheckMessage(wlyyOutpatientDO);
        }*/
        return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
            return success(BaseHospitalRequestMapping.Prescription.api_success,wlyyOutpatientDO);
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
@ -206,7 +250,12 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "groupNo", required = false)String groupNo,
                                         @ApiParam(name = "oupatienId", value = "门诊Id")
                                             @RequestParam(value = "oupatienId", required = false)String oupatienId)throws Exception {
        return success(prescriptionService.getDrugDictionary(drugNo,pyKey,winNo,groupNo,oupatienId));
        try {
            return success(prescriptionService.getDrugDictionary(drugNo,pyKey,winNo,groupNo,oupatienId));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -216,14 +265,24 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                  @RequestParam(value = "pyKey", required = false)String pyKey,
                                  @ApiParam(name = "drugNo", value = "药品编码")
                                  @RequestParam(value = "drugNo", required = false)String drugNo)throws Exception {
        return success(prescriptionService.getDrugUse(drugNo,pyKey,demoFlag));
        try {
            return success(prescriptionService.getDrugUse(drugNo,pyKey,demoFlag));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getDrugFrequency)
    @ApiOperation(value = "获取用药频次", notes = "获取用药频次")
    public ListEnvelop getDrugFrequency()throws Exception {
        return success(prescriptionService.getDrugFrequency(demoFlag));
        try {
            return success(prescriptionService.getDrugFrequency(demoFlag));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.getInspectionDictionary)
@ -234,20 +293,33 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                               @RequestParam(value = "winNo", required = false)String winNo,
                                               @ApiParam(name = "codes", value = "检查检验收费码codes,用逗号分割")
                                               @RequestParam(value = "codes", required = false)String codes)throws Exception{
        return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
        try {
            return success(prescriptionService.getInspectionDictionary(pyKey,codes,winNo));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientCard)
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ListEnvelop findPatientCard(@ApiParam(name = "patient", value = "居民Code")
                                       @RequestParam(value = "patient", required = true)String patient)throws Exception {
        return success(prescriptionService.findPatientCard(patient));
        try {
            return success(prescriptionService.findPatientCard(patient));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.synYkIcd10)
    @ApiOperation(value = "同步眼科icd10", notes = "同步眼科icd10")
    public ListEnvelop findPatientCard()throws Exception {
        return success(prescriptionService.synYkICD10());
        try {
            return success(prescriptionService.synYkICD10());
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -264,7 +336,7 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success("ok",prescriptionService.savePrescriptionOrder(code,price,tradeType,wxId,appletCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -272,7 +344,12 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取ICD10诊断编码", notes = "获取ICD10诊断编码")
    public ListEnvelop getICD10(@ApiParam(name = "pyKey", value = "拼音关键字")
                                @RequestParam(value = "pyKey", required = false)String pyKey)throws Exception {
        return success(prescriptionService.getICD10(pyKey,demoFlag));
        try {
            return success(prescriptionService.getICD10(pyKey,demoFlag));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -284,7 +361,7 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success("ok",businessOrderService.yktAppPayJson(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return failedObjEnvelopException(e);
        }
    }
@ -296,7 +373,7 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            return success("ok",ykyyEntranceService.findInfoBysql(sql));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
            return  failedObjEnvelopException(e);
        }
    }
@ -310,7 +387,12 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                        @ApiParam(name = "deptName", value = "deptName")
                                            @RequestParam(value = "deptName", required = false)String deptName)throws Exception {
        return success("ok",ykyyEntranceService.findDeptByYq(orgCode,deptCode,deptName));
        try {
            return success("ok",ykyyEntranceService.findDeptByYq(orgCode,deptCode,deptName));
        }catch (Exception e) {
            return  failedListEnvelopException(e);
        }
    }
}

+ 5 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -61,12 +61,12 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
            }else {
                result= statisticsEsService.getOutPatientLine(startDate, endDate, area, level, index, interval,level2_type);
            }
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
        return success(result);
    }
@ -93,11 +93,11 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getPrescriptionLine(startDate, endDate, area, level, index, interval,level2_type);
            return success(result);
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException(e);
        }
        return success(result);
    }
    /**
     *

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

@ -35,8 +35,13 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
    @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);
        try {
            List<WlyyHospitalSysDictVO> vos = surveyService.findSurveyLabel(name);
            return success(vos);
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyQuestion)
@ -51,14 +56,22 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "page",required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                          @RequestParam(value = "size",required = true)Integer size) throws Exception {
        return surveyService.findSurveyQuestion(title,creater,questionType,page,size);
        try {
            return surveyService.findSurveyQuestion(title,creater,questionType,page,size);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @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));
        try {
            return success(surveyService.findBySurveyId(surveyId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyQuestion)
@ -67,7 +80,12 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                         @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));
        try {
            return success(surveyService.saveSurveyQuestion(sqjsons,sqOptionJson));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.updataSurveyQuestion)
@ -76,14 +94,22 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                           @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));
        try {
            return success(surveyService.updataSurveyQuestion(sqjson,sqOptionJson));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @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));
        try {
            return success(surveyService.delSurveyQuestion(ids));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
@ -99,7 +125,12 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                              @RequestParam(value = "page",required = true)Integer page,
                                          @ApiParam(name = "size", value = "每页大小")
                                              @RequestParam(value = "size",required = true)Integer size) throws Exception {
        return surveyService.findSurveyTemplate( title, creater,label, page, size);
        try {
            return surveyService.findSurveyTemplate( title, creater,label, page, size);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplateById)
@ -108,7 +139,11 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                             @RequestParam(value = "tempId",required = true) String tempId,
                                             @ApiParam(name = "userCode", value = "当前用户id")
                                             @RequestParam(value = "userCode",required = false) String userCode ) throws Exception {
        return success(surveyService.findSurveyTemplateById(tempId,userCode));
        try {
            return success(surveyService.findSurveyTemplateById(tempId,userCode));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveSurveyTemplate)
@ -123,14 +158,22 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                         @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));
        try {
            return success(surveyService.saveSurveyTemplate(tempJson,tempQJson,tempOpJson,labelJson,labelInspJson));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @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));
        try {
            return success(surveyService.delSurveyTemplate(tempId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    //=================调查问卷居民查询\答题
@ -140,7 +183,11 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "tempId",required = true)String tempId,
                                     @ApiParam(name = "sdJsons", value = "部门与科室关系json")
                                     @RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
        return success(surveyService.saveSurveyDept(tempId,sdJsons));
        try {
            return success(surveyService.saveSurveyDept(tempId,sdJsons));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @PostMapping(value = BaseHospitalRequestMapping.WlyySurvey.saveDeptSurvey)
@ -149,14 +196,23 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "dept",required = true)String dept,
                                     @ApiParam(name = "sdJsons", value = "部门与科室关系json")
                                     @RequestParam(value = "sdJsons",required = false)String sdJsons)throws Exception {
        return success(surveyService.saveDeptSurvey(dept,sdJsons));
        try {
            return success(surveyService.saveDeptSurvey(dept,sdJsons));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyByDept)
    @ApiOperation(value = "模板-查询部门下发放的问卷")
    public ListEnvelop findSurveyByDept(@ApiParam(name = "dept", value = "科室")
                                        @RequestParam(value = "dept",required = true)String dept)throws Exception {
        return success(surveyService.findSurveyByDept(dept));
        try {
            return success(surveyService.findSurveyByDept(dept));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -166,14 +222,22 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                                  @RequestParam(value = "dept",required = true)String dept,
                                                  @ApiParam(name = "patient", value = "居民code")
                                                  @RequestParam(value = "patient",required = true)String patient)throws Exception {
        return success(surveyService.findSurveyByDeptAndPatient(dept,patient));
        try {
            return success(surveyService.findSurveyByDeptAndPatient(dept,patient));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findDeptBySurvey)
    @ApiOperation(value = "模板-查询模板下的科室")
    public ListEnvelop findDeptBySurvey(@ApiParam(name = "tempId", value = "模板ID")
                                        @RequestParam(value = "tempId",required = true)String tempId)throws Exception {
        return success(surveyService.findDeptBySurvey(tempId));
        try {
            return success(surveyService.findDeptBySurvey(tempId));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
@ -183,7 +247,11 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "suJson",required = true)String suJson,
                                     @ApiParam(name = "suaJsons", value = "答案集合json")
                                     @RequestParam(value = "suaJsons",required = true)String suaJsons)throws Exception {
        return success(surveyService.saveSurveyAnswer(suJson, suaJsons));
        try {
            return success(surveyService.saveSurveyAnswer(suJson, suaJsons));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findAnswerBySurveyTempCode)
@ -194,14 +262,23 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                                  @RequestParam(value = "tempId",required = true)String tempId,
                                                  @ApiParam(name = "surverUserId", value = "答题批次号")
                                                  @RequestParam(value = "surverUserId",required = false)String surverUserId)throws Exception {
        return success(surveyService.findAnswerBySurveyTempCode(surverUserId,patient,tempId));
        try {
            return success(surveyService.findAnswerBySurveyTempCode(surverUserId,patient,tempId));
        }catch (Exception e) {
            return failedListEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findSurveyTemplateResult)
    @ApiOperation(value = "统计-查询问题情况")
    public ObjEnvelop findSurveyTemplateResult(@ApiParam(name = "tempId", value = "模板ID")
                                                @RequestParam(value = "tempId",required = true)String tempId)throws Exception {
        return success(surveyService.findSurveyTemplateResult(tempId));
        try {
            return success(surveyService.findSurveyTemplateResult(tempId));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findQuestionInfoList)
@ -220,7 +297,12 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                           @RequestParam(value = "page",required = true)Integer page,
                                           @ApiParam(name = "size", value = "每页大小")
                                           @RequestParam(value = "size",required = true)Integer size)throws Exception {
        return surveyService.findQuestionInfoList(comment,temId,content,tempQuestionCode,tempOptionCode,page, size);
        try {
            return surveyService.findQuestionInfoList(comment,temId,content,tempQuestionCode,tempOptionCode,page, size);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.findAnswerList)
    @ApiOperation(value = "统计-综合查询问题答案")
@ -236,7 +318,12 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "page",required = true)Integer page,
                                     @ApiParam(name = "size", value = "每页大小")
                                     @RequestParam(value = "size",required = true)Integer size)throws Exception {
        return surveyService.findAnswerList(tempId,patient,patientName,title,page,size);
        try {
            return surveyService.findAnswerList(tempId,patient,patientName,title,page,size);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    //=================
@ -254,7 +341,11 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "page",required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页大小",defaultValue = "10")
                                     @RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize)throws Exception {
        return businessService.getUsedList(title,doctor,labelCode,used,page,pageSize);
        try {
            return businessService.getUsedList(title,doctor,labelCode,used,page,pageSize);
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.WlyySurvey.setUsed)
@ -266,7 +357,12 @@ public class SurveyEndpoint extends EnvelopRestEndpoint {
                                     @ApiParam(name = "doctor", value = "医生id")
                                     @RequestParam(value = "doctor",required = false) String doctor)throws Exception {
        businessService.setUsed(tempId,used,doctor);
        return success("操作成功");
        try {
            businessService.setUsed(tempId,used,doctor);
            return success("操作成功");
        }catch (Exception e) {
            return failedException(e);
        }
    }
}

+ 17 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/tnyy/TnyyController.java

@ -31,7 +31,12 @@ public class TnyyController extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取部门信息", notes = "获取部门信息")
    public ObjEnvelop getDeptInfo(@ApiParam(name = "code", value = "code", required = false)
                                  @RequestParam(value = "code",required = false)String code)throws Exception{
        return ObjEnvelop.getSuccess("ok",tnyyEntranceService.updateTnyyDept());
        try {
            return ObjEnvelop.getSuccess("ok",tnyyEntranceService.updateTnyyDept());
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
@ -39,14 +44,23 @@ public class TnyyController extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public ObjEnvelop updateTnyyDoctor(@ApiParam(name = "idcard", value = "idcard", required = false)
                                  @RequestParam(value = "idcard",required = false)String idcard)throws Exception{
        return ObjEnvelop.getSuccess("ok",tnyyEntranceService.updateTnyyDoctor(idcard));
        try {
            return ObjEnvelop.getSuccess("ok",tnyyEntranceService.updateTnyyDoctor(idcard));
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
    @GetMapping(value = "/synYkICD10")
    @ApiOperation(value = "获取icd10信息", notes = "获取icd10信息")
    public ObjEnvelop synYkICD10()throws Exception{
        return ObjEnvelop.getSuccess("ok",prescriptionService.synYkICD10());
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.synYkICD10());
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }
    }
}

+ 7 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/version/VersionEndpoint.java

@ -34,6 +34,8 @@ public class VersionEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "app升级")
    public Envelop appVersion(String code, double version) {
        try{
            AppVersionDO temp = versionsService.findVersionByCode(code);
            if (temp == null) {
                return Envelop.getError( "无效的APP类型失败!");
@ -55,6 +57,10 @@ public class VersionEndpoint extends EnvelopRestEndpoint {
                map.put("size", temp.getSize());
                return success("读取版本号成功!", map);
            }
        }catch (Exception e) {
            return failedException(e);
        }
    }
}