Parcourir la source

Merge branch 'dev' of zd_123/patient-co-management into dev

huangwenjie il y a 6 ans
Parent
commit
f3cb493ab3
16 fichiers modifiés avec 933 ajouts et 18 suppressions
  1. 84 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/power/SettleAccountsPower.java
  2. 1 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java
  3. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyyJpa.java
  4. 61 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyySalveJpa.java
  5. 18 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/power/SettleAccountsPowerDao.java
  6. 91 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/PatientSalveDao.java
  7. 17 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/SettleAccountsSalvePowerDao.java
  8. 447 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/SignFamilySalveDao.java
  9. 55 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/message/GcOtherMessageController.java
  10. 100 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcOtherMessageService.java
  11. 15 4
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  12. 9 1
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  13. 10 2
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  14. 9 1
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  15. 10 2
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  16. 5 1
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 84 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/power/SettleAccountsPower.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.entity.power;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 诊间结算权限表
 *
 * @author zhangdan
 */
@Entity
@Table(name = "wlyy_settle_accounts_power")
public class SettleAccountsPower extends IdEntity implements Serializable {
    // '1个人 2团队 3社区 4区 5市',
    private int  type;
    //'type类型对应的code',
    private String relationCode;
    //'type对应的名称',
    private String relationName;
    //'是否有权限(0没有1有)',
    private int isPower;
    //'创建时间',
    private Date createTime;
    //'更新时间',
    private Date updateTime;
    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    public String getRelationName() {
        return relationName;
    }
    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }
    public int getIsPower() {
        return isPower;
    }
    public void setIsPower(int isPower) {
        this.isPower = isPower;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}

+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java

@ -351,7 +351,7 @@ public class JMController {
			if (jsonObject.getInt("msgCode")==800){
				return Result.success("获取接种记录成功!",data);
			}else{
				return Result.error(jsonObject.getString("body"));
				return Result.error("查询失败!");
			}
		} catch (Exception ex) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyyJpa.java

@ -34,7 +34,7 @@ public class WlyyJpa {
    @Bean(name = "wlyyDataSource")
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource.wlyy")
    @ConfigurationProperties(prefix = "spring.datasource.primaryReadWrite")
    public DataSource wlyyDataSource() {
        return DataSourceBuilder.create().build();
    }

+ 61 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyySalveJpa.java

@ -0,0 +1,61 @@
package com.yihu.wlyy.config.jpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
/**
 * Created by zhangdan on 2018/10/22.
 */
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyySalveEntityManagerFactory",
        transactionManagerRef = "wlyySalveTransactionManager",
        basePackages = {"com.yihu.wlyy.salve.repository"})   //设置Repository所在位置
public class WlyySalveJpa {
    @Autowired
    private HibernateProperties hibernateProperties;
    @Bean(name = "wlyySalveDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.primaryRead")
    public DataSource wlyyDataSource() {
        return DataSourceBuilder.create().build();
    }
    @Bean(name = "wlyySalveEntityManagerFactory")
    public LocalContainerEntityManagerFactoryBean entityManagerFactoryPrimary(
            @Qualifier("wlyySalveDataSource") DataSource dataSource) {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.wlyy.entity");
        emfb.setPersistenceUnitName("wlyySalve");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);
        emfb.setJpaProperties(hibernateProperties.hibProperties());
        return emfb;
    }
    @Bean(name = "wlyySalveTransactionManager")
    JpaTransactionManager transactionManagerSecondary(
            @Qualifier("wlyySalveEntityManagerFactory") EntityManagerFactory builder) {
        return new JpaTransactionManager(builder);
    }
}

+ 18 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/power/SettleAccountsPowerDao.java

@ -0,0 +1,18 @@
package com.yihu.wlyy.repository.power;
import com.yihu.wlyy.entity.power.SettleAccountsPower;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by zhangdam on 2018/10/22.
 */
public interface SettleAccountsPowerDao extends PagingAndSortingRepository<SettleAccountsPower, Long>, JpaSpecificationExecutor<SettleAccountsPower> {
    List<SettleAccountsPower> findByIsPower(int isPower);
    List<SettleAccountsPower> findByRelationCodeAndIsPower(String relationCode,int isPower);
}

+ 91 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/PatientSalveDao.java

@ -0,0 +1,91 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.salve.repository;
import com.yihu.wlyy.entity.patient.Patient;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface PatientSalveDao extends PagingAndSortingRepository<Patient, Long> {
    // 查询患者姓名
    @Query("select p.name from Patient p where p.code=?1 and p.status=1")
    String findNameByCode(String code);
    // 根據患者標識查詢患者信息
    @Query("select p from Patient p where p.code=?1 and p.status=1")
    Patient findByCode(String code);
    // 根據身份證號查詢患者信息
    @Query("select p from Patient p where p.idcard=?1 and p.status=1")
    Patient findByIdcard(String idcard);
    @Query("select p from Patient p where p.ssc=?1 and p.status=1")
    Patient findBySsc(String ssc);
    // 根據手机号查詢患者信息
    @Query("select p from Patient p where p.mobile=?1 and p.status=1")
    List<Patient> findByMobile(String mobile);
    // 根據病情等级获取患者信息
    @Query("select p from Patient p where p.diseaseCondition=?1 and p.status=1")
    Iterable<Patient> findInfoByLevel(int level);
    @Query("select p from Patient p where p.openid=?1 and p.status=1")
    Patient findByOpenid(String openid);
    @Query("select count(1) from Patient p where p.openid=?1 and p.status=1")
    int countByOpenid(String openid);
    //清空openid
    @Modifying
    @Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
    int clearOpenid(String patient, String openid);
    
    //清空openid
    @Modifying
    @Query("update Patient p set p.openid = null where p.openid = ?1 and p.status=1")
    int clearOpenidByOpenid(String openid);
    @Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
    List<Patient> findAllSignPatient();
    @Query(" select p from Patient p where password is null ")
    List<Patient> findAllIdCardPatientAndNoPassword();
    @Query("select p from Patient p where p.status = 1 and p.openid = ?1 order by p.czrq desc")
    Page<Patient> findPatientByOpenid(String openid, Pageable pageable);
    //根据openID获取居民
    @Query("select p from Patient p where p.status = 1 and p.openid = ?1 order by p.czrq desc")
    List<Patient> findPatientByOpenid(String openid);
    //获取所有的openid并排重
    @Query("select distinct p.openid from Patient p where p.openid is not null and p.openid <> '' ")
    List<String> findOpenids();
    @Query(value=" select DISTINCT p.* from wlyy_patient p  LEFT JOIN wlyy_sign_family s on s.patient = p.code  RIGHT JOIN wlyy_sign_patient_label_info sp on sp.patient = p.code WHERE sp.status = 1 and s.status > 0 and sp.label_type = 3 and (sp.label = 1 or sp.label = 2)  and s.admin_team_code = ?1 and (s.doctor = ?2 or s.doctor_health =?2)",nativeQuery = true)
    List<Patient> findAllSignPatientTeamcode(String teamcode, String doctorcode);
    @Query(value="SELECT DISTINCT t.* FROM wlyy_sign_family t1,wlyy_patient t WHERE t.`code`=t1.patient AND t1.STATUS>0 AND " +
            " t1.admin_team_code= ?1 AND(YEAR(curdate())-IF(length(t.idcard)=18,substring(t.idcard,7,4),IF(length(t.idcard)=15,concat('19',substring(t.idcard,7,2)),NULL)))>65 " +
            " AND t1.idcard NOT IN(SELECT DISTINCT s.idcard FROM wlyy_sign_family s,wlyy_old_people_physical_examination o WHERE s.admin_team_code=?1 AND s.`status`>0 AND s.idcard=o.id_card " +
            " AND o.medical_time>?2 )ORDER BY t1.openid DESC,CONVERT(t1.NAME USING gbk)",nativeQuery = true)
    List<Patient> findExaminationRemind(long teamcode, Date medicalTime);
    //根据code获取地址
    @Query("select p.address from Patient p where p.code = ?1")
    String getAddress(String patient);
    Patient findByUnionid(String unionid);
}

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/SettleAccountsSalvePowerDao.java

@ -0,0 +1,17 @@
package com.yihu.wlyy.salve.repository;
import com.yihu.wlyy.entity.power.SettleAccountsPower;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by zhangdam on 2018/10/22.
 */
public interface SettleAccountsSalvePowerDao extends PagingAndSortingRepository<SettleAccountsPower, Long>, JpaSpecificationExecutor<SettleAccountsPower> {
    List<SettleAccountsPower> findByIsPower(int isPower);
    List<SettleAccountsPower> findByRelationCodeAndIsPower(String relationCode, int isPower);
}

+ 447 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/salve/repository/SignFamilySalveDao.java

@ -0,0 +1,447 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.salve.repository;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
public interface SignFamilySalveDao extends PagingAndSortingRepository<SignFamily, Long>, JpaSpecificationExecutor<SignFamily> {
    @Query("select count(1) from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
    int hasSingStatus(String idcard);
    @Modifying
    @Query("update SignFamily a set a.mobile = ?2 where a.patient = ?1")
    int updatePatientMobile(String patient, String mobile);
    //更新有效签约患者手机号
    @Modifying
    @Query("update SignFamily a set a.mobile = ?2 where a.patient = ?1 and a.status > 0 ")
    int updateSignMobile(String patient, String mobile);
    @Query("select a from SignFamily a where a.idcard = ?1 and status = ?2 and a.type = 2")
    SignFamily findByPatientStatus(String idcard, int status);
    @Query("select a from SignFamily a where a.patient = ?1 and status = ?2 and a.type = 2")
    SignFamily findByPatientCodeStatus(String patient, int status);
    @Query("select a from SignFamily a where a.patient = ?1 and status >= ?2 and a.type = 2")
    SignFamily findByPatientCodeStatus2(String patient, int status);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status >= 1")
    SignFamily findByPatientAndType(String patient, int type);
    SignFamily findByFamilyCode(String familyCode);
    SignFamily findByTeamCode(String TeamCode);
    @Query("select a from SignFamily a where a.teamCode = ?1 and a.type = 2 and a.code=?2")
    List<SignFamily> findByTeamCodeIsValid(String teamCode, String code);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0")
    SignFamily findByDoctorPatient(String doctor, String patient);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and (a.type = 2 or a.type=1) and a.status >= 0")
    List<SignFamily> findSSandFamilyByDoctorPatient(String doctor, String patient);
    @Query("select a from SignFamily a where a.doctorHealth = ?1 and a.patient = ?2 and a.type = 2 and a.status >= 0 ")
    SignFamily findByDoctorHealthPatient(String doctor, String patient);
    @Query("select p from Patient p,SignFamily a where a.doctorHealth = ?1  and a.adminTeamId=?2 and a.patient =p.code and a.type = 2 and a.status >= 0")
    List<Patient> findByDoctorHealthPatient(String doctor, Long team);
    @Query("select p from Patient p,SignFamily a where (a.doctorHealth = ?1 or a.doctor=?2 ) and a.patient =p.code and a.type = 2 and a.status >= 0")
    List<Patient> findByDoctorOrDoctorHealthPatient(String doctorHealth, String doctor);
    @Query("select p from Patient p,SignFamily a where a.doctor = ?1 and a.adminTeamId=?2 and a.patient =p.code and a.type = 2 and a.status >= 0")
    List<Patient> findByDoctorPatient(String doctor, Long team);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.type = 1 and a.status > 0")
    SignFamily findSsSignByDoctorPatient(String doctor, String patient);
    @Query("select a from SignFamily a,DoctorTeamMember w where a.teamCode = w.team and w.del = '1' and w.memberCode = ?1 and a.patient = ?2 and a.status > 0")
    List<SignFamily> findByDoctorAndPatient(String doctor, String patient);
    @Query(value = "select a from SignFamily a where a.doctor =?1 and a.patient = ?2 and a.status =0 and a.signYear =?3")
    List<SignFamily> findByDoctorAndPatientOverDue(String doctor, String patient, String signYear);
    @Query(value = "select a from SignFamily a where a.doctorHealth =?1 and a.patient = ?2 and a.status =0 and a.signYear =?3")
    List<SignFamily> findByDoctorHealthAndPatient(String doctorHealth, String patient, String signYear);
    @Query(value = "select a from SignFamily a where a.doctor =?1 and a.patient = ?2 and a.signYear =?3 and a.status = 1 and a.expensesStatus ='1'")
    List<SignFamily> findByDoctorAndPatientIsValid(String doctor, String patient, String signYear);
    @Query(value = "select a from SignFamily a where a.doctorHealth =?1 and a.patient = ?2 and a.signYear =?3 and a.status = 1 and a.expensesStatus ='1'")
    List<SignFamily> findByDoctorHealthAndPatientIsValid(String doctorHealth, String patient, String signYear);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.status = 1 and a.type = 2")
    SignFamily findByFamilyDoctorAndPatient(String doctor, String patient);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.patient = ?2 and a.status = 1 and a.type = 1")
    SignFamily findBySanshiDoctorAndPatient(String doctor, String patient);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.openid = ?2 and a.type = 2 and a.status >= 0")
    SignFamily findByDoctorOpenid(String doctor, String openid);
    @Query("select a from SignFamily a where a.doctor = ?1 and a.idcard = ?2 and a.type = 2 and a.status >= 0")
    SignFamily findByDoctorIdcard(String doctor, String idcard);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status >= 0")
    SignFamily findByIdcard(String idcard);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status > 0 and a.expensesStatus ='1'")
    SignFamily getExpensesSignByIdcard(String idcard);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type =1 and a.status >= 0")
    SignFamily findSSByIdcard(String idcard);
    @Query("select a from SignFamily a where a.idcard = ?1 ")
    List<SignFamily> findAllByIdcard(String idcard);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.status >= 0")
    List<SignFamily> findSSandJTByIdcard(String idcard);
    @Query("select a from SignFamily a where a.openid = ?1 and a.type = 2 and a.status >= 0")
    SignFamily findByOpenid(String openid);
    // 取消签约申请
    @Modifying
    @Query("update SignFamily a set a.status = -1 where a.patient = ?1 and a.doctor = ?2 and a.type = 2 and a.status = 0")
    void unsignByPatient(String patient, String doctor);
    // 取消签约申请
    @Modifying
    @Query("update SignFamily a set a.status = -1 where a.openid = ?1 and a.doctor = ?2 and a.type = 2 and a.status = 0")
    void unsignByOpenid(String openid, String doctor);
    // 查询医生的签约数量
    @Query("select count(1) from SignFamily a where a.doctor = ?1")
    int countByDoctor(String doctor);
    // 查询医生的签约数量
    @Query("select count(1) from SignFamily a")
    int countByDoctor();
    // 更新状态为待解约
    @Modifying
    @Query("update SignFamily a set a.status = 2 where a.patient = ?1 and a.doctor = ?2 and a.status = 1 and a.type = 2")
    int surrender(String patient, String doctor);
    // 更新待签约状态为拒绝或同意状态
    @Modifying
    @Query("update SignFamily a set a.status = ?1 where a.patient = ?2 and a.status = 0 and a.type = 2")
    int handleSign(int status, String patient);
    // 更新已签约状态为解约
    @Modifying
    @Query("update SignFamily a set a.status = -3, a.reason = ?1 where a.patient = ?2 and a.status = 2 and a.type = 2")
    int handleSurrender(String reason, String patient);
    // 拒绝解约
    @Modifying
    @Query("update SignFamily a set a.status = 1 where a.patient = ?1 and a.status = 2 and a.type = 2")
    int refuseSurrender(String patient);
    // 查询患者已生效的家庭签约
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status > 0")
    SignFamily findSignByPatient(String patient);
    @Modifying
    @Query("update SignFamily a set a.openid = ?1 where patient = ?2")
    int updateOpenidByPatient(String openid, String patient);
    // 查询已签约的总数
    @Query("select count(1) from SignFamily a where (a.doctor = ?1 or a.doctorHealth = ?1) and (a.status = 1 or a.status = 2) and a.type = 2")
    int countAmountSignedByDoctor(String doctor);
    // 查询待签约总数
    @Query("select count(1) from SignFamily a where (a.doctor = ?1 or a.doctorHealth = ?1) and a.status = 0 and a.type = 2")
    int countAmountUnsignByDoctor(String doctor);
    // 查询团队中的健康管理师 sf.doctorHealth,sf.doctorHealthName,
    //select sf.doctorHealth,sf.doctorHealthName,count(*) totalContract from SignFamily sf where sf.healthDoctor = ?1
    @Query("select sf.doctorHealth,sf.doctorHealthName,count(sf)  from SignFamily sf where sf.doctorHealth = ?1")
    List<Object> findTeamHealthDoctors(String healthDoctor);
    // 查询团队中的全科医生 sf.doctor,sf.doctorName,d.hosptialName,
    //select sf.doctor,sf.doctorName,d.hosptialName,count(*) totalContract from SignFamily sf left join Doctor d on sf.doctor = d.code where sf.doctor = ?1
    @Query("select sf.doctor,sf.doctorName,d.hospitalName,count(sf) from SignFamily sf, Doctor d  where ( sf.doctor is null or sf.doctor = d.code) and sf.doctor = ?1")
    List<Object> findTeamQkDoctors(String doctor);
    // 待签约 待解决 已签约
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b,DoctorTeam t,DoctorTeamMember td where a.patient=b.code and a.teamCode=t.code and t.code=td.team and td.memberCode=?1 and td.type=?2 and a.status=?3 order by a.begin desc")
    Page<Object> findToBeSignSignWebByDoctor(String doctor, int doctorType, int status, Pageable pageRequest);
    /**
     * 查询全科医生签约患者
     *
     * @param doctor
     * @param status
     * @param pageRequest
     * @return
     */
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor = ?1 and a.status=?2 order by a.begin desc")
    Page<Object> findSignedPatientByQkDoctor(String doctor, int status, Pageable pageRequest);
    /**
     * 查询健康管理师签约患者
     *
     * @param doctor
     * @param status
     * @param pageRequest
     * @return
     */
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctorHealth = ?1 and a.status=?2 order by a.begin desc")
    Page<Object> findSignedPatientByJkDoctor(String doctor, int status, Pageable pageRequest);
    /**
     * 查询全科医生已解约患者
     *
     * @param doctor
     * @param pageRequest
     * @return
     */
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor = ?1 and (a.status=-3 or a.status=-4) order by a.begin desc")
    Page<Object> findUnSignedPatientByQkDoctor(String doctor, Pageable pageRequest);
    /**
     * 查询健康管理师已解约患者
     *
     * @param doctor
     * @param pageRequest
     * @return
     */
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctorHealth = ?1 and (a.status=-3 or a.status=-4) order by a.begin desc")
    Page<Object> findUnSignedPatientByJkDoctor(String doctor, Pageable pageRequest);
    //已经解约
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b,DoctorTeam t,DoctorTeamMember td where a.patient=b.code and a.teamCode=t.code and t.code=td.team and td.memberCode=?1 and td.type=?2 and(a.status=-3 or a.status=-4 ) order by a.begin desc")
    Page<Object> findToBeSignSignWebByDoctor_34(String doctor, int doctorType, Pageable pageRequest);
    @Query("select a from SignFamily a where a.mobile = ?1 and a.type = 2 and a.status >= 0")
    SignFamily findByMobile(String mobile);
    @Query("select a.code,a.doctor,b.code,b.name,b.provinceName,b.cityName,b.townName,b.address,b.photo,a.status,a.id,a.applyDate,a.reason,b.streetName,b.sex from SignFamily a,Patient b where a.patient=b.code and a.doctor=?1 and a.status=?2 order by a.begin desc")
    Page<Object> findToBeSignSignWebByDoctor_0(String doctor, int i, Pageable pageRequest);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status >= 1")
    SignFamily findBySanshiPatient(String code);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status >= 0")
    SignFamily findBySsPatient(String code);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 1")
    SignFamily findByjiatingPatient(String code);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status = 1")
    SignFamily findByjiatingPatientYes(String code);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status = 1")
    SignFamily findBySanshiPatientYes(String id);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 1 and a.status in (0,1,2,3)")
    SignFamily findByPatientSanshiSignInfo(String idCard);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 2 and a.status in (0,1,2,3)")
    SignFamily findByPatientFamilySignInfo(String idCard);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >=0")
    SignFamily findByjiatingPatientStatus0(String patient);
    //查找昨天的家庭签约数据
    @Query(" from SignFamily a where  a.type =2 and a.status = 1  and unix_timestamp(a.applyDate)>=unix_timestamp(?1) and unix_timestamp(a.applyDate)<unix_timestamp(?2) and a.expensesStatus=1 ")
    List<SignFamily> findByJiatingSignYesterdayExpensesStatus(String yesterday, String today);
    //查找昨天的家庭签约数据
    @Query(" from SignFamily a where  a.type =2 and a.status >= 1  and  unix_timestamp(a.applyDate)<=unix_timestamp(?1) and a.expensesStatus=1 ")
    List<SignFamily> findByJiatingSignYesterdayExpensesStatus(String yesterday);
    //查找昨天的家庭签约数据
    @Query(" from SignFamily a where  a.type =2 and a.status >= 1  and  unix_timestamp(a.applyDate)<=unix_timestamp(?1) ")
    List<SignFamily> findByJiatingSignYesterday(String yesterday);
    //查找昨天的家庭解约数据
    @Query(" from SignFamily a where  a.type =2 and a.status in (-3,-4) and unix_timestamp(a.applyUnsignDate)>=unix_timestamp(?1) and unix_timestamp(a.applyUnsignDate)<unix_timestamp(?2) and a.expensesStatus=1")
    List<SignFamily> findByJiatingUnSignYesterdayExpensesStatus(String yesterday, String today);
    //查找昨天的家庭待数据
    @Query(" from SignFamily a where  a.type =2 and a.status =0  and unix_timestamp(a.patientApplyDate)>=unix_timestamp(?1) and unix_timestamp(a.patientApplyDate)<unix_timestamp(?2)")
    List<SignFamily> findByJiatingWaitSignYesterdayExpensesStatus(String yesterday, String today);
    //查找昨天的家庭待改签
    @Query(" from SignFamily a where  a.type =2 and a.status =100  and unix_timestamp(a.patientApplyDate)>=unix_timestamp(?1) and unix_timestamp(a.patientApplyDate)<unix_timestamp(?2) and a.expensesStatus=1 ")
    List<SignFamily> findByJiatingChaangeSignYesterdayExpensesStatus(String yesterday, String now);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = 1 and a.status in (0,1,2)")
    SignFamily findSanshiSignByPatient(String patientCode);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status in (0,1,2)")
    SignFamily findFamilySignByPatient(String patientCode);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status =-4 and a.signYear =?2")
    SignFamily findFamilySignByPatientOverDue(String patientCode, String signYear);
    @Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.patient = p.code and a.status in (1,2,3)")
    List<Object> findDoctorSignPatients(String doctor);
    @Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and p.name like ?2 and a.patient = p.code and a.status in (1,2,3)")
    List<Object> findDoctorSignPatientsLikeName(String doctor, String name);
    @Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.type = ?2 and a.patient = p.code and a.status in (1,2,3)")
    List<Object> findDoctorSignPatientsBySignType(String doctor, int type);
    @Query("select p.code, p.name, p.photo, p.birthday, p.sex, p.diseaseCondition, p.disease, p.recordAmount,a.type,a.applyDate,p.idcard  from SignFamily a,Patient p where (a.doctor = ?1 or a.doctorHealth = ?1) and a.type = ?2 and p.name like ?3 and a.patient = p.code and a.status in (1,2,3)")
    List<Object> findDoctorSignPatientsByTypeName(String doctor, int type, String name);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
    SignFamily findByPatient(String patient);
    @Query("select a from SignFamily a where a.teamCode = ?1 and a.type =2 and a.status >= 0")
    SignFamily findByTeam(String teamCode);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status >= 0")
    List<SignFamily> findByPatients(String patient);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.signYear =?2 and a.status in (-4,1,2,3) order by a.id desc ")
    List<SignFamily> findByPatientsLastYear(String patient, String signYear);
    @Query("select a from SignFamily a where a.idcard = ?1 and a.type = 1 and a.status >= 0")
    SignFamily findBySanshiIdcard(String idcard);
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = ?2 and a.status > 0")
    SignFamily findSignByPatient(String patient, int type);
    SignFamily findByCode(String code);
    @Query(" from SignFamily a where a.patient = ?1 and a.type = ?2 and (a.status=-3 or a.status=-4)  order by a.id desc")
    List<SignFamily> findLastJySignByPatient(String patient, int type);
    @Query(" from SignFamily a where  a.type =1 and unix_timestamp(a.czrq)=unix_timestamp( ?1 )  ")
    List<SignFamily> findByDate(String s);
    @Modifying
    @Query("update SignFamily set expenses_type = ?1 where patient = ?2 and status > 0 and type = 2")
    int updateExpensesType(String expensesType, String patient);
    @Query("select count(*) from SignFamily where patient = ?1 and status > 0 and type = 1")
    int countPatientSsSign(String patient);
    @Query("select count(*) from SignFamily where patient = ?1 and status > 0 and type = 2")
    int countPatientJtSign(String patient);
    // 查询患者已生效的家庭签约
    @Query("select a from SignFamily a where a.patient = ?1 and a.type = 2 and a.status = 0")
    SignFamily findSigningByPatient(String patient);
    //找出家庭签约中 团队是空的值
    @Query("select a from SignFamily a where a.type = 2 and a.status = 1 and a.adminTeamId is null")
    List<SignFamily> findBySignTypeAndTeamCode();
    //找出没有健康管理师的签约数据
    @Query("select a from SignFamily a where a.type = 2 and a.status >= 1 and a.doctorHealth is null and a.adminTeamId = ?1 order by a.czrq desc")
    List<SignFamily> findNoHealthSignFamilyNum(Long teamCode);
    //找出没有健康管理师的签约数据
    @Query("select a from SignFamily a where a.type = 2 and a.status >= 1 and a.doctorHealth is null and a.doctor=?1 order by a.czrq desc")
    Page<SignFamily> findNoHealthSignFamilyHealth(String doctor, Pageable pageRequest);
    @Query("select a from SignFamily a where a.type = ?1 and a.signSource = ?2 and a.status > 0 order by a.id")
    Page<SignFamily> findByTypeAndSignSource(Integer type, String signSource, Pageable pageable);
    @Query("select a from SignFamily a where a.type = ?1 and a.signSource = ?2 and a.status > 0 and a.id >= ?3 and a.id <= ?4 order by a.id")
    Page<SignFamily> findByTypeAndSignSourceAndId(Integer type, String signSource, Long start, Long end, Pageable pageable);
    @Query("select a from SignFamily a where a.patient = ?1 and a.status >= 0")
    List<SignFamily> findAllSignByPatient(String patient);
    /**
     * 获取所有有效的签约信息(不包含-1 -2)
     *
     * @param patient
     * @return
     */
    @Query("select a from SignFamily a where a.patient = ?1 and a.status <> -1 and a.status <> -2 order by a.czrq")
    List<SignFamily> findAllActiveSignByPatient(String patient);
    @Query("select a.patient from SignFamily a where a.doctor = ?1 and a.type = 2 and a.status > 0 and a.doctorHealth is null")
    List<String> findNohealthByDoctor(String doctor);
    /**
     * 获取团队中有效的患者
     *
     * @param teamCode
     * @param status
     * @return
     */
    @Query("select count(f) from SignFamily f where f.adminTeamId = ?1 and f.status >= ?2 ")
    int findByAdminTeamIdAndStatus(long teamCode, int status);
    @Query("select f from SignFamily f where f.patient = ?1 and f.adminTeamId = ?2 and f.status > 0 and f.type = ?3")
    SignFamily findByPatientAndAdminTeamId(String patient, Long teamCode, Integer type);
    //根据医生和居民判断是否存在签约关系(全科及健管)
    @Query("select count(1) from SignFamily f where f.status > 0 and f.patient = ?1 and ( f.doctor = ?2 or doctorHealth = ?2  )")
    int findByPatientAndDoctor(String patient, String doctor);
    @Query(value = "select a from SignFamily a where a.patient = ?1 and a.signYear =?2 and a.status >= 0")
    List<SignFamily> findByDoctorAndPatientHossPost(String patient, String signYear);
    @Query(value = " select a.*  from wlyy_sign_family a where a.patient = ?1  and a.status = -4 order by a.apply_date desc limit 0,1", nativeQuery = true)
    SignFamily findOutTimeSigningByPatient(String patient);
    @Query(value = " select a.*  from wlyy_sign_family a where a.patient = ?1  and a.status = -4 and a.team_code = ?2 order by a.apply_date desc limit 0,1", nativeQuery = true)
    SignFamily findOutTimeSigningByPatientAndTeamCode(String patient, String teamCode);
    //      完成缴费后更新签约开始时间begin 缴费状态expensesStatus 医保流水号medical_insurance_num  扣费时间expenses_time
    @Modifying
    @Query("update SignFamily a set a.begin = ?2 ,a.medicalInsuranceNum=?3,a.expensesStatus = ?4,a.expensesTime = ?2,a.signPaySource = ?5 where a.code = ?1 ")
    int updatePatientBegin(String code, Date begin, String medicalInsuranceNum, String expensesStatus, int signPaySource);
    //查询居民的扣费状态
    @Query(" select a from SignFamily a where a.patient = ?1 ")
    SignFamily findPatientExpensesStatus(String patient);
    // 查询团队已签约的总数
    @Query("select count(1) from SignFamily a where  a.adminTeamId = ?1 and (a.status = 1 or a.status = 2) and a.type = 2")
    int countAmountSignedByAdminTeam(Long id);
    // 查询已签约未缴费居民
    @Query("select a from SignFamily a where  a.patient = ?1 and a.type = 2 and a.expensesStatus = '0' and a.status >0")
    SignFamily findUnpay(String patient);
    //根据身份证号码查询该人的签约情况
    @Query("select count(1) from SignFamily a where a.idcard=?1 and a.status>0 and a.type=2")
    int hasSignCount(String idcard);
    //根据patient查找有效签约的hospital
    @Query("select a.hospital from SignFamily a where a.patient = ?1 and a.status = 1 and a.expensesStatus = '1'")
    String getHospital(String patient);
    //查看团队内医生签约人数
    @Query("select count(1) from SignFamily a where a.status > 0 and a.adminTeamId = ?1 and (a.doctor = ?2 or a.doctorHealth = ?2)")
    int countByAdminTeamId(Long adminTeamId, String doctor);
    //根据居民和医生找出居民签约团队
    @Query("select f from SignFamily f where f.status > 0 and f.patient = ?1 and ( f.doctor = ?2 or doctorHealth = ?2  )")
    SignFamily findSignFamilyByPatientAndDoctor(String patient, String doctor);
    //根据居民获取有效的签约
    List<SignFamily> findByPatientAndExpensesStatusAndStatus(String patient, String expensesStatus, Integer status);
    //根据居民找出居民签约团队
    @Query("select a from SignFamily a where a.patient = ?1 and a.status = 1 and a.expensesStatus = '1'")
    SignFamily findSignFamilyByPatient(String patient);
}

Fichier diff supprimé car celui-ci est trop grand
+ 55 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/message/GcOtherMessageController.java


+ 100 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcOtherMessageService.java

@ -0,0 +1,100 @@
package com.yihu.wlyy.web.third.gateway.service;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.entity.power.SettleAccountsPower;
import com.yihu.wlyy.salve.repository.PatientSalveDao;
import com.yihu.wlyy.salve.repository.SettleAccountsSalvePowerDao;
import com.yihu.wlyy.salve.repository.SignFamilySalveDao;
import com.yihu.wlyy.web.third.gateway.controller.message.GcOtherMessageController;
import com.yihu.wlyy.web.third.gateway.vo.base.BaseResultModel;
import com.yihu.wlyy.wechat.util.WeiXinTempMsgSendUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.*;
/**
 * Created by zhangdan on 2018/10/19.
 */
@Service
public class GcOtherMessageService {
    private Logger logger = LoggerFactory.getLogger(GcOtherMessageController.class);
    @Autowired
    private WeiXinTempMsgSendUtils weiXinTempMsgSendUtils;
    @Autowired
    private PatientSalveDao patientSalveDao;
    @Autowired
    private SignFamilySalveDao signFamilySalveDao;
    @Autowired
    private SettleAccountsSalvePowerDao settleAccountsSalvePowerDao;
    @Value("${wechat.message.template_consult_notice}")
    private String templateId;
    @Value("${server.server_url}")
    private String server_url;
    @Value("${wechat.message.template_to_be_pay}")
    private String template_to_be_pay;
    @Value("${wechat.message.template_pay_success}")
    private String template_pay_success;
    public BaseResultModel sendWeiXinSettleAccounts(String cardNo,String templateJson,String url,String type)throws Exception{
        String templateId = "";
        if ("1".equals(type)){
            templateId=template_to_be_pay;
        }else if ("2".equals(type)){
            templateId=template_pay_success;
        }
       Patient patient = patientSalveDao.findBySsc(cardNo);
        if (patient==null){
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(),BaseResultModel.statusEm.opera_error.getMessage()+"获取用户信息错误!");
        }
        SignFamily signFamily = signFamilySalveDao.findByPatient(patient.getCode());
        if (signFamily==null){
            return new BaseResultModel(BaseResultModel.statusEm.opera_error.getCode(),BaseResultModel.statusEm.opera_error.getMessage()+"签约信息错误!");
        }
        int isCanSend = 0;
        List<SettleAccountsPower> settleAccountsPowerList = settleAccountsSalvePowerDao.findByIsPower(1);
        for (SettleAccountsPower settleAccountsPower : settleAccountsPowerList){
            //个人
            if (settleAccountsPower.getType()==1 && settleAccountsPower.getRelationCode().equals(patient.getCode())){
                isCanSend++;
            }
            //团队
            if (settleAccountsPower.getType()==2 && settleAccountsPower.getRelationCode().equals(signFamily.getAdminTeamId())){
                isCanSend++;
            }
            //社区
            if (settleAccountsPower.getType()==3 && settleAccountsPower.getRelationCode().equals(signFamily.getHospital())){
                isCanSend++;
            }
            //区
            if (settleAccountsPower.getType()==4 && settleAccountsPower.getRelationCode().equals(signFamily.getHospital().substring(0,6))){
                isCanSend++;
            }
        }
        if (isCanSend>0){
            System.out.println("------------start send message--------------");
            System.out.println("param1-------"+cardNo);
            System.out.println("param2-------"+templateJson);
            System.out.println("param3-------"+type);
            System.out.println("param4-------"+url);
            System.out.println("接收者id----"+patient.getOpenid());
            System.out.println("消息模板id----"+templateId);
            weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(templateJson));
        }
        return new BaseResultModel(BaseResultModel.statusEm.success.getCode(),BaseResultModel.statusEm.success.getMessage());
    }
}

+ 15 - 4
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -3,10 +3,18 @@ spring:
  profiles: dev
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
    primaryReadWrite:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    primaryRead:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
#    wlyy:
#      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#      username: root
#      password: 123456
    health:
      url: jdbc:mysql://172.19.103.77/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
@ -49,6 +57,9 @@ healthBank:
#康复计划配置
rehabilitation:
  url: http://localhost:10051/svr-wlyy-rehabilitation/
#集美客服配置
customerService:
  url: http://localhost:8180/
#小程序
applets:

+ 9 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -3,10 +3,18 @@ spring:
  profiles: devtest
  datasource:
    wlyy:
    primaryReadWrite:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    primaryRead:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
      username: linzhou
      password: linzhou
#    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

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

@ -3,8 +3,16 @@ spring:
  profiles: local
  datasource:
     wlyy:
       url: jdbc:mysql://10.95.22.143:3306/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#     wlyy:
#       url: jdbc:mysql://10.95.22.143:3306/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#       username: wlyy
#       password: jkzlehr@123
     primaryReadWrite:
       url: jdbc:mysql://10.95.22.143:3306/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
       username: wlyy
       password: jkzlehr@123
     primaryRead:
       url: jdbc:mysql:/10.95.22.7:3306/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
       username: wlyy
       password: jkzlehr@123
     health:

+ 9 - 1
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -3,10 +3,18 @@ spring:
  profiles: localtest
  datasource:
    wlyy:
#    wlyy:
#      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#      username: linzhou
#      password: linzhou
    primaryReadWrite:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: linzhou
      password: linzhou
    primaryRead:
      url: jdbc:mysql://172.19.103.85/wlyy?useUnicode=true&characterEncoding=utf-8&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

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

@ -2,8 +2,16 @@
spring:
  profiles: prod
  datasource:
    wlyy:
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#    wlyy:
#      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
#      username: wlyy
#      password: jkzlehr@123
    primaryReadWrite:
      url: jdbc:mysql://59.61.92.90:9069/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    health:

+ 5 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -3,7 +3,11 @@ spring:
  profiles: test
  datasource:
    wlyy:
    primaryReadWrite:
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg
    primaryRead:
      url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: ssgg
      password: ssgg