Jelajahi Sumber

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 tahun lalu
induk
melakukan
cf21c0234a
26 mengubah file dengan 328 tambahan dan 243 penghapusan
  1. 12 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java
  2. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/quartz/SchedulerConfig.java
  3. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  4. 11 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java
  5. 6 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  6. 11 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java
  7. 8 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java
  8. 9 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  9. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwArchivesService.java
  10. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSignService.java
  11. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSmjkService.java
  12. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/verified/VerifiedService.java
  13. 5 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java
  14. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/SignUploadTask.java
  15. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java
  16. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java
  17. 1 103
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemConf.java
  18. 14 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java
  19. 27 13
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/WlyySerivceController.java
  20. 17 13
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  21. 8 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java
  22. 18 15
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/HealthServiceController.java
  23. 18 16
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/MyInfoController.java
  24. 18 16
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/SelfManagementController.java
  25. 7 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinAccessTokenUtils.java
  26. 106 10
      patient-co/patient-co-wlyy/src/main/resources/application.yml

+ 12 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -37,16 +37,16 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
        super.addInterceptors(registry);
        super.addInterceptors(registry);
    }
    }
    /**
     * 为null的数据不返回
     * @param converters
     */
    @Override
    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
        ObjectMapper objectMapper=new ObjectMapper();
        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
        converters.add(mappingJackson2HttpMessageConverter);
    }
//    /**
//     * 为null的数据不返回
//     * @param converters
//     */
//    @Override
//    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//        MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
//        ObjectMapper objectMapper=new ObjectMapper();
//        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//        mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
//        converters.add(mappingJackson2HttpMessageConverter);
//    }
}
}

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/quartz/SchedulerConfig.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.config.quartz;
package com.yihu.wlyy.config.quartz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Bean;
@ -23,6 +24,8 @@ public class SchedulerConfig {
    private JobFactory jobFactory;
    private JobFactory jobFactory;
    @Autowired
    @Autowired
    private DataSource dataSource;
    private DataSource dataSource;
    @Value("${quartz.name}")
    private String schedulerFactoryBeanName;
    @Bean
    @Bean
    SchedulerFactoryBean schedulerFactoryBeanWlyy() throws IOException {
    SchedulerFactoryBean schedulerFactoryBeanWlyy() throws IOException {
        SchedulerFactoryBean bean = new SchedulerFactoryBean();
        SchedulerFactoryBean bean = new SchedulerFactoryBean();
@ -30,6 +33,7 @@ public class SchedulerConfig {
        bean.setApplicationContext(this.applicationContext);
        bean.setApplicationContext(this.applicationContext);
        bean.setOverwriteExistingJobs(true);
        bean.setOverwriteExistingJobs(true);
        bean.setStartupDelay(20);// 延时启动
        bean.setStartupDelay(20);// 延时启动
        bean.setBeanName(schedulerFactoryBeanName);
        bean.setAutoStartup(true);
        bean.setAutoStartup(true);
        bean.setDataSource(dataSource);
        bean.setDataSource(dataSource);
        bean.setQuartzProperties(quartzProperties());
        bean.setQuartzProperties(quartzProperties());

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -39,6 +39,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.PageRequest;
@ -117,6 +118,9 @@ public class ConsultTeamService extends ConsultService {
    Map<Integer, String> relations = new HashMap<>();
    Map<Integer, String> relations = new HashMap<>();
    @Value("${im.im_list_get}")
    private String im_list_get;
    @PostConstruct
    @PostConstruct
    public void init() {
    public void init() {
        relations.put(0, "其他");
        relations.put(0, "其他");
@ -980,7 +984,7 @@ public class ConsultTeamService extends ConsultService {
     * @param content     内容
     * @param content     内容
     */
     */
    private String sendIM(String from, String to, String contentType, String content) {
    private String sendIM(String from, String to, String contentType, String content) {
        String imAddr = SystemConf.getInstance().getImListGet() + "api/v1/chats/pm";
        String imAddr = im_list_get + "api/v1/chats/pm";
        List<NameValuePair> params = new ArrayList<>();
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("from", from));
        params.add(new BasicNameValuePair("from", from));
        params.add(new BasicNameValuePair("to", to));
        params.add(new BasicNameValuePair("to", to));
@ -999,7 +1003,7 @@ public class ConsultTeamService extends ConsultService {
     * @param content     内容
     * @param content     内容
     */
     */
    private String sendGroupIM(String from, String groupCode, String contentType, String content) {
    private String sendGroupIM(String from, String groupCode, String contentType, String content) {
        String imAddr = SystemConf.getInstance().getImListGet() + "api/v1/chats/gm";
        String imAddr = im_list_get + "api/v1/chats/gm";
        List<NameValuePair> params = new ArrayList<>();
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("from", from));
        params.add(new BasicNameValuePair("from", from));
        params.add(new BasicNameValuePair("group", groupCode));
        params.add(new BasicNameValuePair("group", groupCode));

+ 11 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort;
@ -67,10 +68,12 @@ public class PatientDeviceService extends BaseService {
    @Autowired
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private HttpClientUtil HttpClientUtil;
    private String url = SystemConf.getInstance().getYihuOpenPlatformUrl();
    private String appid = SystemConf.getInstance().getYihuOpenPlatformAppId();
    private String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String url;
    @Value("${yihu.yihu_OpenPlatform_appId}")
    private String appid;
    @Value("${yihu.yihu_OpenPlatform_secret}")
    private String secret;
    private String registerDevice = "DeviceGateway/DeviceApi/registerDevice";//注册设备
    private String registerDevice = "DeviceGateway/DeviceApi/registerDevice";//注册设备
@ -548,6 +551,7 @@ public class PatientDeviceService extends BaseService {
    /**
    /**
     * 根据user,deviceSN修改血糖时间段
     * 根据user,deviceSN修改血糖时间段
     *
     * @param user
     * @param user
     * @param deviceSN
     * @param deviceSN
     * @param newDeviceSN
     * @param newDeviceSN
@ -559,13 +563,14 @@ public class PatientDeviceService extends BaseService {
    /**
    /**
     * 根据user,deviceSN更换绑定血糖仪
     * 根据user,deviceSN更换绑定血糖仪
     *
     * @param user
     * @param user
     * @param deviceSN
     * @param deviceSN
     * @param newDeviceSN
     * @param newDeviceSN
     * @throws Exception
     * @throws Exception
     */
     */
    public int updatePatientDevice(String user, String deviceSN, String newDeviceSN,String userType) throws Exception {
        int rows = patientDeviceDao.updatePatientDevice(user,deviceSN,newDeviceSN,userType);
    public int updatePatientDevice(String user, String deviceSN, String newDeviceSN, String userType) throws Exception {
        int rows = patientDeviceDao.updatePatientDevice(user, deviceSN, newDeviceSN, userType);
        return rows;
        return rows;
    }
    }

+ 6 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Transactional;
@ -60,6 +61,10 @@ public class FamilyMemberService extends BaseService {
    private CommonUtil CommonUtil;
    private CommonUtil CommonUtil;
    @Autowired
    @Autowired
    private HttpUtil HttpUtil;
    private HttpUtil HttpUtil;
    @Value("${wechat.appId}")
    private String appId;
    @Value("${wechat.appSecret}")
    private String appSecret;
    @PostConstruct
    @PostConstruct
    public void init() {
    public void init() {
@ -891,7 +896,7 @@ public class FamilyMemberService extends BaseService {
            }
            }
        }
        }
        String token_url = "https://api.weixin.qq.com/cgi-bin/token";
        String token_url = "https://api.weixin.qq.com/cgi-bin/token";
        String params = "grant_type=client_credential&appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret();
        String params = "grant_type=client_credential&appid=" +appId + "&secret=" + appSecret;
        String result = HttpUtil.sendGet(token_url, params);
        String result = HttpUtil.sendGet(token_url, params);
        JSONObject json = new JSONObject(result);
        JSONObject json = new JSONObject(result);
        if (json.has("access_token")) {
        if (json.has("access_token")) {

+ 11 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -9,6 +9,7 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.annotation.Transactional;
@ -37,7 +38,14 @@ public class HealthEduArticleService extends BaseService {
    private HealthEduArticleLabelService healthEduArticleLabelService;
    private HealthEduArticleLabelService healthEduArticleLabelService;
    @Autowired
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String yihu_OpenPlatform_url;
    @Value("${yihu.yihu_OpenPlatform_appId}")
    private String yihu_OpenPlatform_appId;
    @Value("${yihu.yihu_OpenPlatform_secret}")
    private String yihu_OpenPlatform_secret;
    /**
    /**
     * 保存福州健康教育文章
     * 保存福州健康教育文章
     * @param result xml格式
     * @param result xml格式
@ -127,11 +135,11 @@ public class HealthEduArticleService extends BaseService {
        HttpClientUtil httpClientUtil = new HttpClientUtil();
        HttpClientUtil httpClientUtil = new HttpClientUtil();
//      获取远程地址url 、App Key 和 App secret  
//      获取远程地址url 、App Key 和 App secret  
        String prixUrl = SystemConf.getInstance().getYihuOpenPlatformUrl();
        String prixUrl =yihu_OpenPlatform_url;
//        String prixUrl ="http://apitest.yihu.com.cn/OpenPlatform/cgiBin/1.0/";
//        String prixUrl ="http://apitest.yihu.com.cn/OpenPlatform/cgiBin/1.0/";
        String appId =SystemConf.getInstance().getYihuOpenPlatformAppId();
        String appId =yihu_OpenPlatform_appId;
//        String appId = "9000276";
//        String appId = "9000276";
        String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
        String secret = yihu_OpenPlatform_secret;
//        String secret = "OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA";
//        String secret = "OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA";
//      请求参数(i健康接口说明文档)正式接口 由prixUrl获取apixUrl
//      请求参数(i健康接口说明文档)正式接口 由prixUrl获取apixUrl
        String apiUrl = prixUrl+"jkjy/JkjyImpl/queryHealtheducationForIHealth";
        String apiUrl = prixUrl+"jkjy/JkjyImpl/queryHealtheducationForIHealth";

+ 8 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -38,6 +38,7 @@ import org.hibernate.sql.Select;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort;
@ -130,7 +131,11 @@ public class FamilyContractService extends BaseService {
    private ImUtill ImUtill;
    private ImUtill ImUtill;
    @Autowired
    @Autowired
    private HttpUtil httpUtil;
    private HttpUtil httpUtil;
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Value("${im.data_base_name}")
    private String im_dataBase_name;
    public SignFamily findSignFamilyByCode(String code) {
    public SignFamily findSignFamilyByCode(String code) {
        return signFamilyDao.findByCodeAndType(code, 2);
        return signFamilyDao.findByCodeAndType(code, 2);
@ -1147,7 +1152,7 @@ public class FamilyContractService extends BaseService {
                }
                }
            }
            }
            new Thread(new SignUploadTask(sf.getCode(), httpUtil)).start();
            new Thread(new SignUploadTask(sf.getCode(), httpUtil,jwUrl)).start();
            JSONObject participants = new JSONObject();
            JSONObject participants = new JSONObject();
            participants.put(sf.getPatient(), 0);
            participants.put(sf.getPatient(), 0);
            if (StringUtils.equals(sf.getDoctor(), sf.getDoctorHealth())) {//全科和建管同一个人
            if (StringUtils.equals(sf.getDoctor(), sf.getDoctorHealth())) {//全科和建管同一个人
@ -1487,7 +1492,7 @@ public class FamilyContractService extends BaseService {
                }
                }
            }
            }
            new Thread(new SignUploadTask(sf.getCode(),httpUtil)).start();
            new Thread(new SignUploadTask(sf.getCode(), httpUtil,jwUrl)).start();
            JSONObject participants = new JSONObject();
            JSONObject participants = new JSONObject();
            participants.put(sf.getPatient(), 0);
            participants.put(sf.getPatient(), 0);
            if (StringUtils.equals(sf.getDoctor(), sf.getDoctorHealth())) {//全科和建管同一个人
            if (StringUtils.equals(sf.getDoctor(), sf.getDoctorHealth())) {//全科和建管同一个人
@ -2817,7 +2822,7 @@ public class FamilyContractService extends BaseService {
     */
     */
    public SignFamily getSignFamilyBySessionId(String sessionId, String patient) {
    public SignFamily getSignFamilyBySessionId(String sessionId, String patient) {
        SignFamily signFamily = null;
        SignFamily signFamily = null;
        String sql = "select id from " + SystemConf.getInstance().getImDataBaseName() + ".topics where  session_id = '" + sessionId + "' order by create_time desc limit 0, 1";
        String sql = "select id from " +im_dataBase_name + ".topics where  session_id = '" + sessionId + "' order by create_time desc limit 0, 1";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        if (list != null && list.size() > 0) {
        if (list != null && list.size() > 0) {
            String consultCode = list.get(0).get("id").toString();
            String consultCode = list.get(0).get("id").toString();

+ 9 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -21,6 +21,7 @@ import com.yihu.wlyy.util.SystemConf;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -57,6 +58,8 @@ public class StatisticsService extends BaseService {
    @Autowired
    @Autowired
    private StatisticsAllService statisticsAllService;
    private StatisticsAllService statisticsAllService;
    @Value("${im.data_base_name}")
    private String im_dataBase_name;
    /**
    /**
     * 获取上次统计时间
     * 获取上次统计时间
@ -2010,7 +2013,7 @@ public class StatisticsService extends BaseService {
        if (admin == null) {
        if (admin == null) {
            throw new RuntimeException("未找到团队信息");
            throw new RuntimeException("未找到团队信息");
        }
        }
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
        startDate = startDate + " 00:00:00";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        endDate = endDate + " 23:59:59";
        Long id = admin.getId();
        Long id = admin.getId();
@ -2296,7 +2299,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @return
     */
     */
    public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
    public Map<String, Object> getConsultByteam(Long id, String startDate, String endDate) {
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
//        startDate = startDate + " 00:00:00";
//        startDate = startDate + " 00:00:00";
//        endDate = endDate + " 23:59:59";
//        endDate = endDate + " 23:59:59";
        //咨询量
        //咨询量
@ -2448,7 +2451,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @return
     */
     */
    public JSONObject getTeamConsultCount(String teamCode, String startDate, String endDate, String type) {
    public JSONObject getTeamConsultCount(String teamCode, String startDate, String endDate, String type) {
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
        String sql;
        String sql;
        String totalSql;
        String totalSql;
        startDate = startDate + " 00:00:00";
        startDate = startDate + " 00:00:00";
@ -2553,7 +2556,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @return
     */
     */
    public JSONObject getTeamDoctorConsultCount(String teamCode, String startDate, String endDate, String type, String doctor) {
    public JSONObject getTeamDoctorConsultCount(String teamCode, String startDate, String endDate, String type, String doctor) {
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
        String sql;
        String sql;
        String totalSql;
        String totalSql;
        startDate = startDate + " 00:00:00";
        startDate = startDate + " 00:00:00";
@ -2661,7 +2664,7 @@ public class StatisticsService extends BaseService {
     * @return
     * @return
     */
     */
    public JSONArray getMemberConsultList(String teamCode, String startDate, String endDate, String sort, String sortType) {
    public JSONArray getMemberConsultList(String teamCode, String startDate, String endDate, String sort, String sortType) {
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
        startDate = startDate + " 00:00:00";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        endDate = endDate + " 23:59:59";
        // 未回复咨询总量
        // 未回复咨询总量
@ -2872,7 +2875,7 @@ public class StatisticsService extends BaseService {
    }
    }
    public JSONObject getDoctorConsultTitle(String doctor, String teamCode, String startDate, String endDate) {
    public JSONObject getDoctorConsultTitle(String doctor, String teamCode, String startDate, String endDate) {
        String imDataBaseName = SystemConf.getInstance().getImDataBaseName();
        String imDataBaseName = im_dataBase_name;
        startDate = startDate + " 00:00:00";
        startDate = startDate + " 00:00:00";
        endDate = endDate + " 23:59:59";
        endDate = endDate + " 23:59:59";
        //获取咨询总数
        //获取咨询总数

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwArchivesService.java

@ -9,6 +9,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.ArrayList;
@ -23,14 +24,13 @@ import java.util.List;
@Service("JwArchivesService")
@Service("JwArchivesService")
public class JwArchivesService {
public class JwArchivesService {
    //基卫服务地址
    private String jwUrl = SystemConf.getInstance().getJwUrl();
    @Autowired
    @Autowired
    private SystemDictService systemDictService;
    private SystemDictService systemDictService;
    @Autowired
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private HttpClientUtil HttpClientUtil;
    @Value("${sign.check_upload}")
    private String jwUrl;
    /**
    /**
     *  查询居民健康体检列表信息接口
     *  查询居民健康体检列表信息接口

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSignService.java

@ -13,6 +13,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.ArrayList;
@ -27,12 +28,12 @@ import java.util.Map;
@Service
@Service
public class JwSignService {
public class JwSignService {
    //基卫服务地址
    private String jwUrl = SystemConf.getInstance().getJwUrl();
    @Autowired
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private HttpClientUtil HttpClientUtil;
    @Value("${sign.check_upload}")
    private String jwUrl;
    /****************************************************************************************************************************/
    /****************************************************************************************************************************/
    /**
    /**

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSmjkService.java

@ -14,6 +14,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.ArrayList;
@ -29,7 +30,8 @@ import java.util.Map;
public class JwSmjkService {
public class JwSmjkService {
    //基卫服务地址
    //基卫服务地址
    private String jwUrl = SystemConf.getInstance().getJwUrl();
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Autowired
    @Autowired
    private ObjectMapper objectMapper = new ObjectMapper();
    private ObjectMapper objectMapper = new ObjectMapper();

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/verified/VerifiedService.java

@ -15,6 +15,7 @@ import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import javax.crypto.Cipher;
import javax.crypto.Cipher;
@ -34,8 +35,8 @@ import java.util.Map;
public class VerifiedService {
public class VerifiedService {
    //基卫服务地址
    //基卫服务地址
    private String jwUrl = SystemConf.getInstance().getJwUrl();
    @Value("${sign.check_upload}")
    private String jwUrl;
    //授权码
    //授权码
    private String appkey = "9683dbd88e0111e69beb0050569a506a";
    private String appkey = "9683dbd88e0111e69beb0050569a506a";

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/service/OnePayService.java

@ -68,6 +68,9 @@ public class OnePayService {
    DoctorDao doctorDao;
    DoctorDao doctorDao;
    @Value("${server.server_url}")
    @Value("${server.server_url}")
    private String serverUrl;
    private String serverUrl;
    @Value("${wechat.accId}")
    private String accId;
    /**
    /**
     * 查询绑卡信息(本人)
     * 查询绑卡信息(本人)
     */
     */
@ -143,7 +146,7 @@ public class OnePayService {
            // 如医保绑卡信息请求参数
            // 如医保绑卡信息请求参数
            JSONObject params = new JSONObject();
            JSONObject params = new JSONObject();
            params.put("openId", openid);
            params.put("openId", openid);
            params.put("accId", SystemConf.getInstance().getAccId()); //微信公众号开发者ID
            params.put("accId", accId); //微信公众号开发者ID
            requestParams.setParam(params);
            requestParams.setParam(params);
            requestParams.setTransType(config.getBindCardType());
            requestParams.setTransType(config.getBindCardType());
@ -443,7 +446,7 @@ public class OnePayService {
            // 如医保绑卡信息请求参数
            // 如医保绑卡信息请求参数
            JSONObject params = new JSONObject();
            JSONObject params = new JSONObject();
            params.put("openId", openid);
            params.put("openId", openid);
            params.put("accId", SystemConf.getInstance().getAccId());  //微信公众号开发者ID
            params.put("accId", accId);  //微信公众号开发者ID
            requestParams.setParam(params);
            requestParams.setParam(params);
            requestParams.setTransType(config.getCreateSicardType());
            requestParams.setTransType(config.getCreateSicardType());

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/SignUploadTask.java

@ -20,18 +20,20 @@ public class SignUploadTask implements Runnable {
    private static Logger logger = LoggerFactory.getLogger(SignUploadTask.class);
    private static Logger logger = LoggerFactory.getLogger(SignUploadTask.class);
    String code = "";
    String code = "";
    String jwUrl;
    private HttpUtil httpUtil;
    private HttpUtil httpUtil;
    public SignUploadTask(String code,HttpUtil httpUtil) {
    public SignUploadTask(String code,HttpUtil httpUtil,String jwUrl) {
        this.code = code;
        this.code = code;
        this.httpUtil=httpUtil;
        this.httpUtil=httpUtil;
        this.jwUrl=jwUrl;
    }
    }
    @Override
    @Override
    public void run() {
    public void run() {
        try {
        try {
            Thread.sleep(3000);
            Thread.sleep(3000);
            String url = SystemConf.getInstance().getJwUrl();
            String url = jwUrl;
            String resultStr = httpUtil.sendPost(url + "/third/sign/UploadSignFamily?code=" + code, "");
            String resultStr = httpUtil.sendPost(url + "/third/sign/UploadSignFamily?code=" + code, "");
            JSONObject json = new JSONObject(resultStr);
            JSONObject json = new JSONObject(resultStr);

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -12,7 +12,8 @@ import java.io.*;
public class CommonUtil {
public class CommonUtil {
    @Value("${fastDFS.fastdfs_file_url}")
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    private String fastdfs_file_url;
    @Value("${server.server_url}")
    private String server_url;
    /**
    /**
     * 获取图片全路径
     * 获取图片全路径
     *
     *
@ -25,7 +26,7 @@ public class CommonUtil {
            if (url.indexOf("http") > -1) {
            if (url.indexOf("http") > -1) {
                return url;
                return url;
            } else {
            } else {
                return SystemConf.getInstance().getServerUrl() + url;
                return server_url+ url;
            }
            }
        }
        }
    }
    }

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ImUtill.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.util;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
/**
/**
@ -13,8 +14,9 @@ public class ImUtill {
    @Autowired
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private HttpClientUtil HttpClientUtil;
    private static final String im_host = SystemConf.getInstance().getImListGet();
    @Value("${im.im_list_get}")
    private String im_host;
    /**
    /**
     * 获取医生统计数据
     * 获取医生统计数据
     * status reply 为空值是是该医生总咨询量
     * status reply 为空值是是该医生总咨询量

+ 1 - 103
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/SystemConf.java

@ -141,18 +141,6 @@ public class SystemConf {
    }
    }
    /**
     * IM地址
     *
     * @return
     */
    @Value("${im.im_list_get}")
    private String im_list_get;
    public String getImListGet() {
        return im_list_get;
    }
    /**
    /**
     * 获取文件保存的临时路径
     * 获取文件保存的临时路径
     *
     *
@ -168,49 +156,12 @@ public class SystemConf {
     * @return
     * @return
     */
     */
    @Value("${images.path}")
    private String imagesPath;
    public String getImagePath() {
        return imagesPath;
    }
    @Value("${wechat.appId}")
    private String appId;
    @Value("${wechat.appSecret}")
    private String appSecret;
    @Value("${wechat.accId}")
    private String accId;
    public String getAppId() {
        return appId;
    }
    public String getAccId() {
        return accId;
    }
    public String getAppSecret() {
        return appSecret;
    }
    /**
    /**
     * 获取服务全路径
     * 获取服务全路径
     *
     *
     * @return
     * @return
     */
     */
    @Value("${server.server_url}")
    private String server_url;
    public String getServerUrl() {
        return server_url;
    }
    public String getServerUrlStr() {
        return server_url;
    }
    /******************************** 挂号配置 ********************************************/
    /******************************** 挂号配置 ********************************************/
    /**
    /**
@ -229,16 +180,6 @@ public class SystemConf {
    /****************************************************************************************/
    /****************************************************************************************/
    @Value("${sign.check_upload}")
    private String sign_check_upload;
    /**
     * 基卫服务地址
     */
    public String getJwUrl() {
        return getSystemProperties().getProperty("sign_check_upload");
    }
    /********************************* EHR配置 **********************************************/
    /********************************* EHR配置 **********************************************/
    /**
    /**
     * 是否启用EHR演示
     * 是否启用EHR演示
@ -263,50 +204,7 @@ public class SystemConf {
    /**************************************************************************************/
    /**************************************************************************************/
    /*********************************
     * 健康之路开放平台 配置
     **********************************************/
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String yihu_OpenPlatform_url;
    @Value("${yihu.yihu_OpenPlatform_appId}")
    private String yihu_OpenPlatform_appId;
    @Value("${yihu.yihu_OpenPlatform_secret}")
    private String yihu_OpenPlatform_secret;
    /**
     * 健康之路开放平台url
     */
    public String getYihuOpenPlatformUrl() {
        return yihu_OpenPlatform_url;
    }
    /**
     * 健康之路开放平台渠道号
     */
    public String getYihuOpenPlatformAppId() {
        return yihu_OpenPlatform_appId;
    }
    /**
     * 健康之路开放平台秘钥
     */
    public String getYihuOpenPlatformSecret() {
        return yihu_OpenPlatform_secret;
    }
    /**************************************************************************************/
    /**************************************************************************************/
    /**
     * 获取IM数据库名
     *
     * @return
     */
    @Value("${im.data_base_name}")
    private String im_dataBase_name;
    public String getImDataBaseName() {
        return im_dataBase_name;
    }
}
}

+ 14 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/WeixinBaseController.java

@ -22,6 +22,7 @@ import com.yihu.wlyy.entity.security.JsApiTicket;
import com.yihu.wlyy.service.common.account.AccessTokenService;
import com.yihu.wlyy.service.common.account.AccessTokenService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.account.TokenService;
import org.springframework.beans.factory.annotation.Value;
public class WeixinBaseController extends BaseController {
public class WeixinBaseController extends BaseController {
@ -36,6 +37,14 @@ public class WeixinBaseController extends BaseController {
	private CommonUtil CommonUtil;
	private CommonUtil CommonUtil;
	@Autowired
	@Autowired
	private HttpUtil HttpUtil;
	private HttpUtil HttpUtil;
	@Value("${wechat.appId}")
	private String appId;
	@Value("${wechat.appSecret}")
	private String appSecret;
	@Value("${images.path}")
	private String imagesPath;
	/**
	/**
	 * 通过code获取判断openid
	 * 通过code获取判断openid
	 * 
	 * 
@ -45,7 +54,7 @@ public class WeixinBaseController extends BaseController {
	public String getOpenidByCode(String code) {
	public String getOpenidByCode(String code) {
		try {
		try {
			String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
			String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
			String params = "appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret() + "&code=" + code + "&grant_type=authorization_code";
			String params = "appid=" + appId + "&secret=" +appSecret+ "&code=" + code + "&grant_type=authorization_code";
			String result = HttpUtil.sendGet(token_url, params);
			String result = HttpUtil.sendGet(token_url, params);
			System.out.println("getOpenidByCode:"+result);
			System.out.println("getOpenidByCode:"+result);
			JSONObject json = new JSONObject(result);
			JSONObject json = new JSONObject(result);
@ -69,7 +78,7 @@ public class WeixinBaseController extends BaseController {
	public String getOpenid(String code) {
	public String getOpenid(String code) {
		try {
		try {
			String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
			String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
			String params = "appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret() + "&code=" + code + "&grant_type=authorization_code";
			String params = "appid=" + appId + "&secret=" +appSecret + "&code=" + code + "&grant_type=authorization_code";
			String result = HttpUtil.sendGet(token_url, params);
			String result = HttpUtil.sendGet(token_url, params);
			JSONObject json = new JSONObject(result);
			JSONObject json = new JSONObject(result);
			Map<Object, Object> map = new HashMap<Object, Object>();
			Map<Object, Object> map = new HashMap<Object, Object>();
@ -129,7 +138,7 @@ public class WeixinBaseController extends BaseController {
				}
				}
			}
			}
			String token_url = "https://api.weixin.qq.com/cgi-bin/token";
			String token_url = "https://api.weixin.qq.com/cgi-bin/token";
			String params = "grant_type=client_credential&appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret();
			String params = "grant_type=client_credential&appid=" + appId + "&secret=" + appSecret;
			String result = HttpUtil.sendGet(token_url, params);
			String result = HttpUtil.sendGet(token_url, params);
			JSONObject json = new JSONObject(result);
			JSONObject json = new JSONObject(result);
			if (json.has("access_token")) {
			if (json.has("access_token")) {
@ -306,7 +315,7 @@ public class WeixinBaseController extends BaseController {
	}
	}
	public String saveImageToDiskNoImageCompress(String mediaId) throws Exception {
	public String saveImageToDiskNoImageCompress(String mediaId) throws Exception {
		// 文件保存的临时路径
		// 文件保存的临时路径
		String tempPath = SystemConf.getInstance().getImagePath() + File.separator;
		String tempPath = imagesPath+ File.separator;
		// 拼接年月日路径
		// 拼接年月日路径
		String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
		String datePath = DateUtil.getStringDate("yyyy") + File.separator + DateUtil.getStringDate("MM") + File.separator + DateUtil.getStringDate("dd") + File.separator;
		// 重命名文件
		// 重命名文件
@ -503,7 +512,7 @@ public class WeixinBaseController extends BaseController {
     */
     */
	public String getOpenId(String code) throws Exception {
	public String getOpenId(String code) throws Exception {
		String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
		String token_url = "https://api.weixin.qq.com/sns/oauth2/access_token";
		String params = "appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret() + "&code=" + code + "&grant_type=authorization_code";
		String params = "appid=" + appId+ "&secret=" + appSecret + "&code=" + code + "&grant_type=authorization_code";
		String result = HttpUtil.sendGet(token_url, params);
		String result = HttpUtil.sendGet(token_url, params);
		JSONObject json = new JSONObject(result);
		JSONObject json = new JSONObject(result);
		if (json.has("openid")) {
		if (json.has("openid")) {

+ 27 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/WlyySerivceController.java

@ -14,6 +14,7 @@ import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.Element;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
@ -34,7 +35,9 @@ public class WlyySerivceController extends BaseController{
    @Autowired
    @Autowired
    private HttpUtil HttpUtil;
    private HttpUtil HttpUtil;
    //基卫服务地址
    @Value("${sign.check_upload}")
    private String jwUrl;
    /**
    /**
     * 检查是否签约
     * 检查是否签约
     *
     *
@ -45,7 +48,7 @@ public class WlyySerivceController extends BaseController{
    @ApiOperation("检查是否签约")
    @ApiOperation("检查是否签约")
    public String checkSignFamily(@RequestParam("idcard") String idcard){
    public String checkSignFamily(@RequestParam("idcard") String idcard){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idcard, "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idcard, "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -67,7 +70,7 @@ public class WlyySerivceController extends BaseController{
    @ApiOperation("上传签约数据")
    @ApiOperation("上传签约数据")
    public String uploadSignFamily(@RequestParam("code")String code){
    public String uploadSignFamily(@RequestParam("code")String code){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/UploadSignFamily?code=" + code, "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/UploadSignFamily?code=" + code, "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -90,7 +93,7 @@ public class WlyySerivceController extends BaseController{
    @ApiOperation("初次采集签约接口")
    @ApiOperation("初次采集签约接口")
    public String loadAllSignFamily(@RequestParam("start_time")String start_time){
    public String loadAllSignFamily(@RequestParam("start_time")String start_time){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadAllSignFamily?start_time=" + start_time, "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadAllSignFamily?start_time=" + start_time, "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -112,7 +115,7 @@ public class WlyySerivceController extends BaseController{
    @ApiOperation("单条采集签约接口")
    @ApiOperation("单条采集签约接口")
    public String loadSingleSignFamily(@RequestParam("idcard")String idcard){
    public String loadSingleSignFamily(@RequestParam("idcard")String idcard){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamily?idcard=" + idcard, "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamily?idcard=" + idcard, "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -136,7 +139,7 @@ public class WlyySerivceController extends BaseController{
    @ApiOperation("时间范围采集签约接口")
    @ApiOperation("时间范围采集签约接口")
    public String loadSignFamilyBatch(@RequestParam("start_time")String start_time,@RequestParam("end_time")String end_time){
    public String loadSignFamilyBatch(@RequestParam("start_time")String start_time,@RequestParam("end_time")String end_time){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamilyBatch?start_time=" + start_time + "&end_time=" + end_time, "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/LoadSignFamilyBatch?start_time=" + start_time + "&end_time=" + end_time, "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -156,7 +159,7 @@ public class WlyySerivceController extends BaseController{
    @RequestMapping(value = "/third/sign/ReUploadSignFamily",method = RequestMethod.POST)
    @RequestMapping(value = "/third/sign/ReUploadSignFamily",method = RequestMethod.POST)
    public String reuploadSignFamily(){
    public String reuploadSignFamily(){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUploadSignFamily", "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUploadSignFamily", "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -177,7 +180,7 @@ public class WlyySerivceController extends BaseController{
    @RequestMapping(value = "/third/sign/ReUpdateSignFamily",method = RequestMethod.POST)
    @RequestMapping(value = "/third/sign/ReUpdateSignFamily",method = RequestMethod.POST)
    public String reupdateSignFamily(){
    public String reupdateSignFamily(){
        try{
        try{
            String checkUrl = SystemConf.getInstance().getJwUrl();
            String checkUrl = jwUrl;
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUpdateSignFamily", "");
            String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/ReUpdateSignFamily", "");
            if(StringUtils.isEmpty(jsonString)){
            if(StringUtils.isEmpty(jsonString)){
                return write(-1,"调用失败");
                return write(-1,"调用失败");
@ -221,23 +224,34 @@ public class WlyySerivceController extends BaseController{
    /**
    /**
     * 获取转诊预约医生列表
     * 获取转诊预约医生列表
     * @param orgCode   机构编码
     * @param deptCode  科室编码
     * @param city
     * @param hospitalId
     * @param hosDeptId
     * @param filter
     * @param pageIndex
     * @param pageSize
     * @return
     * @return
     */
     */
    @RequestMapping(value = "/third/smjk/RegDeptSpeDoctorList",method = RequestMethod.POST)
    @RequestMapping(value = "/third/smjk/RegDeptSpeDoctorList",method = RequestMethod.POST)
    @ApiOperation("获取转诊预约医生列表")
    @ApiOperation("获取转诊预约医生列表")
    @ResponseBody
    @ResponseBody
    public String getRegDeptSpeDoctorList(
    public String getRegDeptSpeDoctorList(
            @ApiParam(name="orgCode",value="机构编码") @RequestParam(name="orgCode",required = true) String orgCode,
            @ApiParam(name="deptCode",value="科室编码") @RequestParam(name="deptCode",required = true) String deptCode){
            @ApiParam(name = "city", value = "城市编码", defaultValue = "350200")@RequestParam(value = "city", required = true) String city,
            @ApiParam(name="hospitalId",value="医院编码",defaultValue = "350211A1001") @RequestParam(name="hospitalId",required = true) String hospitalId,
            @ApiParam(name="hosDeptId",value="科室编码",defaultValue = "1040610") @RequestParam(name="hosDeptId",required = true) String hosDeptId,
            @ApiParam(name = "filter", value = "过滤条件", defaultValue = "")
            @RequestParam(value = "filter", required = false) String filter,
            @ApiParam(name = "pageIndex", value = "第几页", defaultValue = "")
            @RequestParam(value = "pageIndex", required = false) Integer pageIndex,
            @ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "")
            @RequestParam(value = "pageSize", required = false) Integer pageSize){
        try {
        try {
            //10天排班的医生列表
            //10天排班的医生列表
            //String list  = jwSmjkService.getRegDeptSpeDoctorList(orgCode,deptCode);
            //String list  = jwSmjkService.getRegDeptSpeDoctorList(orgCode,deptCode);
            //7天排班的医生列表
            //7天排班的医生列表
            String list = jwSmjkService.GetDoctorList(orgCode,deptCode);
            String list = jwSmjkService.GetDoctorList(hospitalId,hosDeptId);
            return write(200, "获取转诊预约医生列表成功!", "data", list);
            return write(200, "获取转诊预约医生列表成功!", "data", list);
        } catch (Exception ex) {
        } catch (Exception ex) {
            ex.printStackTrace();
            ex.printStackTrace();

+ 17 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Page;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
@ -77,6 +78,9 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    private CommonUtil CommonUtil;
    private CommonUtil CommonUtil;
    @Autowired
    @Autowired
    private HttpUtil HttpUtil;
    private HttpUtil HttpUtil;
    @Value("${sign.check_upload}")
    private String sign_check_upload;
    /**
    /**
     * 根据姓名、地址、身份证搜索已分配的居民
     * 根据姓名、地址、身份证搜索已分配的居民
     *
     *
@ -226,10 +230,10 @@ public class DoctorFamilyContractController extends WeixinBaseController {
     */
     */
    @RequestMapping(value = "/getPatientLables")
    @RequestMapping(value = "/getPatientLables")
    @ResponseBody
    @ResponseBody
    public String getPatientLables( @RequestParam(required = false)String labelType,
                                    @RequestParam(required = false)String level,
                                    @RequestParam(required = false)String oldDoctorCode,
                                    @RequestParam(required = false)Long teamCode) {
    public String getPatientLables(@RequestParam(required = false) String labelType,
                                   @RequestParam(required = false) String level,
                                   @RequestParam(required = false) String oldDoctorCode,
                                   @RequestParam(required = false) Long teamCode) {
        try {
        try {
            //修改年度服务类型1.3.4需求
            //修改年度服务类型1.3.4需求
            if ("1".equals(labelType)) {
            if ("1".equals(labelType)) {
@ -487,7 +491,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            //1.3.5 新增居委会字段countryCode
            //1.3.5 新增居委会字段countryCode
            SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
            SignFamily sf = familyContractService.agent(getAccessToken(), name, doctor, doctorName,
                    healthDoctor, healthDoctorName, cDoctor.getHospital(), cDoctor.getHospitalName(),
                    healthDoctor, healthDoctorName, cDoctor.getHospital(), cDoctor.getHospitalName(),
                    idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, adminTeamCode, sevId,countryCode);
                    idcard, ssc, mobile, emerMobile, images, healthLabel, customLabel, disease, expenses, signDoctorCode, signDoctorName, signDoctorLevel, adminTeamCode, sevId, countryCode);
            if (sf == null) {
            if (sf == null) {
                return error(-1, "代理签约失败!");
                return error(-1, "代理签约失败!");
            } else {
            } else {
@ -539,7 +543,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
        try {
        try {
            if (type != 2) {
            if (type != 2) {
                try {
                try {
                    String checkUrl = SystemConf.getInstance().getJwUrl();
                    String checkUrl = sign_check_upload;
                    String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + patientIDcard, "");
                    String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + patientIDcard, "");
                    if (!StringUtils.isEmpty(jsonString)) {
                    if (!StringUtils.isEmpty(jsonString)) {
@ -769,7 +773,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
            JSONObject result = new JSONObject();
            JSONObject result = new JSONObject();
            try {
            try {
                String checkUrl = SystemConf.getInstance().getJwUrl();
                String checkUrl = sign_check_upload;
                String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idCard, "");
                String jsonString = HttpUtil.sendPost(checkUrl + "/third/sign/CheckSignFamily?idcard=" + idCard, "");
                if (!StringUtils.isEmpty(jsonString)) {
                if (!StringUtils.isEmpty(jsonString)) {
@ -907,8 +911,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    json.put("jtSign", new JSONObject(jtSign));
                    json.put("jtSign", new JSONObject(jtSign));
                }
                }
                json.put("countryCode",temp.getSickVillage()==null?"":temp.getSickVillage());
                json.put("countryName",temp.getSickVillageName()==null?"":temp.getSickVillageName());
                json.put("countryCode", temp.getSickVillage() == null ? "" : temp.getSickVillage());
                json.put("countryName", temp.getSickVillageName() == null ? "" : temp.getSickVillageName());
                return write(200, "患者信息查询成功!", "data", json);
                return write(200, "患者信息查询成功!", "data", json);
            } else {
            } else {
@ -979,8 +983,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    json.put("jtSign", new JSONObject(jtSign));
                    json.put("jtSign", new JSONObject(jtSign));
                }
                }
                json.put("countryCode",temp.getSickVillage()==null?"":temp.getSickVillage());
                json.put("countryName",temp.getSickVillageName()==null?"":temp.getSickVillageName());
                json.put("countryCode", temp.getSickVillage() == null ? "" : temp.getSickVillage());
                json.put("countryName", temp.getSickVillageName() == null ? "" : temp.getSickVillageName());
                return write(200, "患者信息查询成功!", "data", json);
                return write(200, "患者信息查询成功!", "data", json);
            } else {
            } else {
@ -1132,7 +1136,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
    @RequestMapping(value = "/sign_info_update")
    @RequestMapping(value = "/sign_info_update")
    @ResponseBody
    @ResponseBody
    @ObserverRequired
    @ObserverRequired
    public String updateSignInfo(@RequestParam(required = false)String patient, @RequestParam(required = false) String healthDoctor,
    public String updateSignInfo(@RequestParam(required = false) String patient, @RequestParam(required = false) String healthDoctor,
                                 @RequestParam(required = false) String doctor,
                                 @RequestParam(required = false) String doctor,
                                 @RequestParam(required = false) String expensesType) {
                                 @RequestParam(required = false) String expensesType) {
        try {
        try {
@ -1175,7 +1179,7 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                return write(200, "查询成功!", "data", rs);
                return write(200, "查询成功!", "data", rs);
            }
            }
            //1.3.5按居委会字段划分居民
            //1.3.5按居委会字段划分居民
            if("5".equals(labelType)){
            if ("5".equals(labelType)) {
                JSONObject rs = familyContractService.getCountryPatientList(teamCode);
                JSONObject rs = familyContractService.getCountryPatientList(teamCode);
                return write(200, "查询成功!", "data", rs);
                return write(200, "查询成功!", "data", rs);
            }
            }

+ 8 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -15,6 +15,7 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -45,9 +46,13 @@ public class PatientDeviceController extends BaseController {
    @Autowired
    @Autowired
    private HttpClientUtil HttpClientUtil;
    private HttpClientUtil HttpClientUtil;
    private String url = SystemConf.getInstance().getYihuOpenPlatformUrl();
    private String appid = SystemConf.getInstance().getYihuOpenPlatformAppId();
    private String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
    @Value("${yihu.yihu_OpenPlatform_url}")
    private String url;
    @Value("${yihu.yihu_OpenPlatform_appId}")
    private String appid;
    @Value("${yihu.yihu_OpenPlatform_secret}")
    private String secret;
    private String registerDevice = "DeviceGateway/DeviceApi/registerDevice";//注册设备
    private String registerDevice = "DeviceGateway/DeviceApi/registerDevice";//注册设备
    private ObjectMapper objectMapper = new ObjectMapper();
    private ObjectMapper objectMapper = new ObjectMapper();

+ 18 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/HealthServiceController.java

@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import org.json.JSONException;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -19,6 +20,8 @@ import com.yihu.wlyy.web.WeixinBaseController;
@RequestMapping(value = "/wx/health/service", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wx/health/service", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "患者端-健康服务在线咨询")
@Api(description = "患者端-健康服务在线咨询")
public class HealthServiceController extends WeixinBaseController {
public class HealthServiceController extends WeixinBaseController {
	@Value("${server.server_url}")
	private String server_url;
	/**
	/**
	 * 健康服务»在线咨询
	 * 健康服务»在线咨询
@ -31,13 +34,13 @@ public class HealthServiceController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=1&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=1&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 1);
//			String paramUrl = getParamUrl(json2, 1);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/zxwz/html/online-consulting.html");
			response.sendRedirect(server_url + "wx/html/zxwz/html/online-consulting.html");
		} else {
		} else {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
		}
		}
	}
	}
@ -53,13 +56,13 @@ public class HealthServiceController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=2&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=2&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 2);
//			String paramUrl = getParamUrl(json2, 2);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/zxyy/html/online-appointment.html");
			response.sendRedirect(server_url + "wx/html/zxyy/html/online-appointment.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -74,13 +77,13 @@ public class HealthServiceController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=3&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=3&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 3);
//			String paramUrl = getParamUrl(json2, 3);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-doctor-advice.html");
			response.sendRedirect(server_url + "wx/html/grzx/html/my-doctor-advice.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -95,13 +98,13 @@ public class HealthServiceController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=4&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=4&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 4);
//			String paramUrl = getParamUrl(json2, 4);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/yygl/html/pharmacy-manage.html");
			response.sendRedirect(server_url + "wx/html/yygl/html/pharmacy-manage.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -116,13 +119,13 @@ public class HealthServiceController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=5&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=5&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 5);
//			String paramUrl = getParamUrl(json2, 5);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/sfgy/html/jihuaindex.html");
			response.sendRedirect(server_url + "wx/html/sfgy/html/jihuaindex.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
}
}

+ 18 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/MyInfoController.java

@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import org.json.JSONException;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
@ -18,7 +19,8 @@ import com.yihu.wlyy.web.WeixinBaseController;
@RequestMapping("/wx/my/info")
@RequestMapping("/wx/my/info")
@Api(description = "患者端-个人信息")
@Api(description = "患者端-个人信息")
public class MyInfoController extends WeixinBaseController {
public class MyInfoController extends WeixinBaseController {
	@Value("${server.server_url}")
	private String server_url;
	/**
	/**
	 * 我的»我的资料
	 * 我的»我的资料
	 * @param code
	 * @param code
@ -31,13 +33,13 @@ public class MyInfoController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=11&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=11&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 11);
//			String paramUrl = getParamUrl(json2, 11);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-detail.html");
			response.sendRedirect(server_url + "wx/html/grzx/html/my-detail.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -52,13 +54,13 @@ public class MyInfoController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=12&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=12&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 12);
//			String paramUrl = getParamUrl(json2, 12);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-appointment.html");
			response.sendRedirect(server_url + "wx/html/grzx/html/my-appointment.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -73,13 +75,13 @@ public class MyInfoController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=13&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=13&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 13);
//			String paramUrl = getParamUrl(json2, 13);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/zxwz/html/teachers-consulting-list.html");
			response.sendRedirect(server_url + "wx/html/zxwz/html/teachers-consulting-list.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -94,13 +96,13 @@ public class MyInfoController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=14&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=14&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 14);
//			String paramUrl = getParamUrl(json2, 14);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/grzx/html/my-equipments.html");
			response.sendRedirect(server_url + "wx/html/grzx/html/my-equipments.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
	/**
	/**
@ -115,13 +117,13 @@ public class MyInfoController extends WeixinBaseController {
		String message = getOpenid(code);
		String message = getOpenid(code);
		JSONObject json = new JSONObject(message);
		JSONObject json = new JSONObject(message);
		if (Integer.parseInt(json.get("status").toString()) == 100) {
		if (Integer.parseInt(json.get("status").toString()) == 100) {
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=15&openid=" + json.get("msg").toString());
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=15&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 15);
//			String paramUrl = getParamUrl(json2, 15);
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/guide.html");
			response.sendRedirect(server_url + "wx/html/home/html/guide.html");
		} else
		} else
			response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
			response.sendRedirect(server_url + "wx/health_service/404.html");
	}
	}
}
}

+ 18 - 16
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/SelfManagementController.java

@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONException;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
@ -23,7 +24,8 @@ import com.yihu.wlyy.web.WeixinBaseController;
@RequestMapping("/wx/self/management")
@RequestMapping("/wx/self/management")
@Api(description = "自我管理")
@Api(description = "自我管理")
public class SelfManagementController extends WeixinBaseController {
public class SelfManagementController extends WeixinBaseController {
    @Value("${server.server_url}")
    private String server_url;
    @Autowired
    @Autowired
    private PatientService patientService;
    private PatientService patientService;
    @Autowired
    @Autowired
@ -41,13 +43,13 @@ public class SelfManagementController extends WeixinBaseController {
        String message = getOpenid(code);
        String message = getOpenid(code);
        JSONObject json = new JSONObject(message);
        JSONObject json = new JSONObject(message);
        if (Integer.parseInt(json.get("status").toString()) == 100) {
        if (Integer.parseInt(json.get("status").toString()) == 100) {
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=6&openid=" + json.get("msg").toString());
            response.sendRedirect(server_url + "wx/html/home/html/login.html?type=6&openid=" + json.get("msg").toString());
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 6);
//			String paramUrl = getParamUrl(json2, 6);
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/teachers-sign.html");
            response.sendRedirect(server_url + "wx/html/ssgg/html/teachers-sign.html");
        } else
        } else
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
            response.sendRedirect(server_url + "wx/health_service/404.html");
    }
    }
    /**
    /**
@ -67,12 +69,12 @@ public class SelfManagementController extends WeixinBaseController {
                doctor = familyContractService.checkPatient(patient.getCode());
                doctor = familyContractService.checkPatient(patient.getCode());
            }
            }
            if (StringUtils.isEmpty(doctor)) {
            if (StringUtils.isEmpty(doctor)) {
                response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/choose-region.html?openid=" + openid);
                response.sendRedirect(server_url + "wx/html/ssgg/html/choose-region.html?openid=" + openid);
            } else {
            } else {
                response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/doctor-home-page.html?openid=" + openid + "&doctor=" + doctor);
                response.sendRedirect(server_url + "wx/html/ssgg/html/doctor-home-page.html?openid=" + openid + "&doctor=" + doctor);
            }
            }
        } else
        } else
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
            response.sendRedirect(server_url + "wx/health_service/404.html");
    }
    }
    /**
    /**
@ -87,13 +89,13 @@ public class SelfManagementController extends WeixinBaseController {
        String message = getOpenid(code);
        String message = getOpenid(code);
        JSONObject json = new JSONObject(message);
        JSONObject json = new JSONObject(message);
        if (Integer.parseInt(json.get("status").toString()) == 100) {
        if (Integer.parseInt(json.get("status").toString()) == 100) {
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=8&openid=" + json.get("msg").toString());
            response.sendRedirect(server_url + "wx/html/home/html/login.html?type=8&openid=" + json.get("msg").toString());
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 8);
//			String paramUrl = getParamUrl(json2, 8);
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/health-index.html");
            response.sendRedirect(server_url + "wx/html/ssgg/html/health-index.html");
        } else
        } else
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
            response.sendRedirect(server_url + "wx/health_service/404.html");
    }
    }
    /**
    /**
@ -108,13 +110,13 @@ public class SelfManagementController extends WeixinBaseController {
        String message = getOpenid(code);
        String message = getOpenid(code);
        JSONObject json = new JSONObject(message);
        JSONObject json = new JSONObject(message);
        if (Integer.parseInt(json.get("status").toString()) == 100) {
        if (Integer.parseInt(json.get("status").toString()) == 100) {
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=9&openid=" + json.get("msg").toString());
            response.sendRedirect(server_url + "wx/html/home/html/login.html?type=9&openid=" + json.get("msg").toString());
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 9);
//			String paramUrl = getParamUrl(json2, 9);
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/health-record.html");
            response.sendRedirect(server_url + "wx/html/ssgg/html/health-record.html");
        } else
        } else
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
            response.sendRedirect(server_url + "wx/health_service/404.html");
    }
    }
    /**
    /**
@ -130,13 +132,13 @@ public class SelfManagementController extends WeixinBaseController {
        String message = getOpenid(code);
        String message = getOpenid(code);
        JSONObject json = new JSONObject(message);
        JSONObject json = new JSONObject(message);
        if (Integer.parseInt(json.get("status").toString()) == 100) {
        if (Integer.parseInt(json.get("status").toString()) == 100) {
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/home/html/login.html?type=10&openid=" + json.get("msg").toString());
            response.sendRedirect(server_url + "wx/html/home/html/login.html?type=10&openid=" + json.get("msg").toString());
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
        } else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 10);
//			String paramUrl = getParamUrl(json2, 10);
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/html/ssgg/html/health-headline.html");
            response.sendRedirect(server_url + "wx/html/ssgg/html/health-headline.html");
        } else
        } else
            response.sendRedirect(SystemConf.getInstance().getServerUrlStr() + "wx/health_service/404.html");
            response.sendRedirect(server_url + "wx/health_service/404.html");
    }
    }
}
}

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinAccessTokenUtils.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.SystemConf;
import org.json.JSONObject;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
/**
/**
@ -17,6 +18,11 @@ public class WeiXinAccessTokenUtils {
    private AccessTokenService accessTokenService;
    private AccessTokenService accessTokenService;
    @Autowired
    @Autowired
    private HttpUtil httpUtil;
    private HttpUtil httpUtil;
    @Value("${wechat.appId}")
    private String appId;
    @Value("${wechat.appSecret}")
    private String appSecret;
    /**
    /**
     * 获取微信AccessToken
     * 获取微信AccessToken
     *
     *
@ -36,7 +42,7 @@ public class WeiXinAccessTokenUtils {
                }
                }
            }
            }
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String params = "grant_type=client_credential&appid=" + SystemConf.getInstance().getAppId() + "&secret=" + SystemConf.getInstance().getAppSecret();
            String params = "grant_type=client_credential&appid=" +appId + "&secret=" + appSecret;
            String result = httpUtil.sendGet(token_url, params);
            String result = httpUtil.sendGet(token_url, params);
            JSONObject json = new JSONObject(result);
            JSONObject json = new JSONObject(result);
            if (json.has("access_token")) {
            if (json.has("access_token")) {

+ 106 - 10
patient-co/patient-co-wlyy/src/main/resources/application.yml

@ -76,19 +76,19 @@ security:
    password: jkzlehr
    password: jkzlehr
---
---
##测试的配置
spring:
spring:
  profiles: test
  profiles: test
  datasource:
  datasource:
    wlyy:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
    health:
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
      url: jdbc:mysql://172.17.110.160/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
  redis:
  redis:
    host: 172.19.103.88 # Redis server host.
    host: 172.19.103.88 # Redis server host.
@ -155,8 +155,12 @@ sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
  check_upload: http://172.19.103.85:8011/wlyy_service
---
quartz:
  name: schedulerFactoryBean_test
---
##正式的配置
spring:
spring:
  profiles: prod
  profiles: prod
@ -234,8 +238,13 @@ images:
sign:
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
  check_upload: http://59.61.92.90:8072/wlyy_service
---
quartz:
  name: schedulerFactoryBeanWlyy
---
##开发的配置
spring:
spring:
  profiles: dev
  profiles: dev
@ -315,4 +324,91 @@ images:
  sign_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/familycontract.png
  sign_path: /usr/local/apache-tomcat-8.0.26/webapps/wlyy/images/familycontract.png
sign:
sign:
  check_upload: http://172.19.103.87:8011/wlyy_service
  check_upload: http://172.19.103.87:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_dev
---
##开发连测试用这个版本的配置
spring:
  profiles: dev_test
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    health:
      url: jdbc:mysql://172.19.103.85/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
im:
  im_list_get: http://172.19.103.88:3000/
  group_server: http://172.19.103.88:3000/api/v1/chats/gm
  msg_push_server: http://172.19.103.88:3000/api/v1/chats/sm
  data_base_name: im_new
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
   #咨询回复
   template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
   #签约成功
   template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
   #签约失败
   template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
   #健康指导提醒
   template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
   #解约提醒
   template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
   #预约成功
   template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
   #预约取消
   template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
   #缴费提醒
   template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
   #健康教育
   template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
   #医生变更
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
images:
  path: /var/local/upload/images
  renew_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/renew.png
  sign_path: /usr/local/apache-tomcat-8.0.36/webapps/wlyy/images/familycontract.png
sign:
  check_upload: http://172.19.103.85:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test_dev