Procházet zdrojové kódy

Merge branch 'srdev' of chenweida/patient-co-management into dev

chenweida před 7 roky
rodič
revize
ac64aa7ca7
15 změnil soubory, kde provedl 703 přidání a 311 odebrání
  1. 191 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/concern/ConcernDo.java
  2. 11 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java
  3. 2 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/team/sign/DoctorTeamMember.java
  4. 155 0
      common/common-rest-model/src/main/java/com.yihu.wlyy/rest/concern/concernVO.java
  5. 43 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/concern/ConcernDao.java
  6. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamDao.java
  7. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamMemberDao.java
  8. 155 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/concern/ConcernService.java
  9. 20 20
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java
  10. 40 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/concern/DoctorConcernController.java
  11. 81 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/concern/PatientConcernController.java
  12. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  13. 0 142
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  14. 0 143
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  15. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

+ 191 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/concern/ConcernDo.java

@ -0,0 +1,191 @@
package com.yihu.wlyy.entity.concern;// default package
import com.yihu.wlyy.entity.IdEntity;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * WlyyConcern entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "wlyy_concern")
public class ConcernDO extends IdEntity {
	private String code; //code
	private String patient;//患者code
	private String name;//患者名称
	private String openid;//openID
	private String idcard;//患者身份是在
	private String ssc;//患者社保卡
	private String mobile;//患者手机号
	private Integer status;//状态 -1取消关注 1已关注
	private String teamCode;//关注的团队code
	private Integer concernSource;//关注方式: 1扫描二维码 2页面跳转 3.咨询关注
	private String concernDoctorCode;//关注的医生code
	private String concernDoctorName;//关注的医生名称
	private Date createTime;//创建时间
	private Date updateTime;//修改时间
	// Constructors
	/** default constructor */
	public ConcernDO() {
	}
	/** full constructor */
	public ConcernDO(String code, String patient, String name, String openid,
					 String idcard, String ssc, String mobile, Integer status,
					 String teamCode, Integer concernSource, String concernDoctorCode,
					 String concernDoctorName, Integer adminTeamCode,
					 Timestamp createTime, Timestamp updateTime) {
		this.code = code;
		this.patient = patient;
		this.name = name;
		this.openid = openid;
		this.idcard = idcard;
		this.ssc = ssc;
		this.mobile = mobile;
		this.status = status;
		this.teamCode = teamCode;
		this.concernSource = concernSource;
		this.concernDoctorCode = concernDoctorCode;
		this.concernDoctorName = concernDoctorName;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}
	@Column(name = "code", nullable = false, length = 200)
	public String getCode() {
		return this.code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	@Column(name = "patient", length = 50)
	public String getPatient() {
		return this.patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	@Column(name = "name", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name = "openid", length = 50)
	public String getOpenid() {
		return this.openid;
	}
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	@Column(name = "idcard", nullable = false, length = 50)
	public String getIdcard() {
		return this.idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	@Column(name = "ssc", nullable = false, length = 20)
	public String getSsc() {
		return this.ssc;
	}
	public void setSsc(String ssc) {
		this.ssc = ssc;
	}
	@Column(name = "mobile", length = 100)
	public String getMobile() {
		return this.mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	@Column(name = "status", nullable = false)
	public Integer getStatus() {
		return this.status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Column(name = "team_code", length = 100)
	public String getTeamCode() {
		return this.teamCode;
	}
	public void setTeamCode(String teamCode) {
		this.teamCode = teamCode;
	}
	@Column(name = "concern_source")
	public Integer getConcernSource() {
		return this.concernSource;
	}
	public void setConcernSource(Integer concernSource) {
		this.concernSource = concernSource;
	}
	@Column(name = "concern_doctor_code", length = 50)
	public String getConcernDoctorCode() {
		return this.concernDoctorCode;
	}
	public void setConcernDoctorCode(String concernDoctorCode) {
		this.concernDoctorCode = concernDoctorCode;
	}
	@Column(name = "concern_doctor_name", length = 200)
	public String getConcernDoctorName() {
		return this.concernDoctorName;
	}
	public void setConcernDoctorName(String concernDoctorName) {
		this.concernDoctorName = concernDoctorName;
	}
	@Column(name = "create_time", length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "update_time", nullable = false, length = 0)
	public Date getUpdateTime() {
		return this.updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}

+ 11 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/profile/Doctor.java

@ -71,6 +71,8 @@ public class Doctor extends IdEntity {
    private String certificateNum;     //CA证书编号
    private String openid; //医生微信openID
    //=====================非hibernate字段=========================
    private String concernCode;//关注code
    public Double getEvaluateScore() {
        return evaluateScore;
@ -438,4 +440,13 @@ public class Doctor extends IdEntity {
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    @Transient
    public String getConcernCode() {
        return concernCode;
    }
    public void setConcernCode(String concernCode) {
        this.concernCode = concernCode;
    }
}

+ 2 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/doctor/team/sign/DoctorTeamMember.java

@ -22,10 +22,10 @@ public class DoctorTeamMember extends IdEntity {
    private String memberCode;
    private String code;
    private String name;
    private Integer type;//医生类型:1专科医生,2全科医生,3健康管理师,4临时专科 5.患者
    private Integer type;//医生类型:1服务医生
    private Date czrq;
    private String del;//是否作废,1正常,0作废
    private String signType;//签约类型(1表示三师签约,2表示家庭签约)
    private String signType;//签约类型(1表示三师签约,2表示家庭签约)  废弃字段
    /**
     * default constructor

+ 155 - 0
common/common-rest-model/src/main/java/com.yihu.wlyy/rest/concern/concernVO.java

@ -0,0 +1,155 @@
package com.yihu.wlyy.rest.concern;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by Administrator on 2018/4/4 0004.
 */
@ApiModel("关注类型")
public class ConcernVO {
    @ApiModelProperty(value = "code", example = "业务主键" )
    private String code; //code
    @ApiModelProperty(value = "patient", example = "患者code" )
    private String patient;//患者code
    @ApiModelProperty(value = "name", example = "患者名称" )
    private String name;//患者名称
    @ApiModelProperty(value = "openid", example = "openID" )
    private String openid;//openID
    @ApiModelProperty(value = "idcard", example = "患者身份" )
    private String idcard;//患者身份是在
    @ApiModelProperty(value = "ssc", example = "患者社保卡" )
    private String ssc;//患者社保卡
    @ApiModelProperty(value = "mobile", example = "患者手机号" )
    private String mobile;//患者手机号
    @ApiModelProperty(value = "status", example = "状态 -1取消关注 1已关注" )
    private Integer status;//状态 -1取消关注 1已关注
    @ApiModelProperty(value = "teamCode", example = "关注的团队code" )
    private String teamCode;//关注的团队code
    @ApiModelProperty(value = "concernSource", example = "关注方式: 1扫描二维码 2页面跳转" )
    private Integer concernSource;//关注方式: 1扫描二维码 2页面跳转
    @ApiModelProperty(value = "concernDoctorCode", example = "关注的医生code" )
    private String concernDoctorCode;//关注的医生code
    @ApiModelProperty(value = "concernDoctorName", example = "关注的医生名称" )
    private String concernDoctorName;//关注的医生名称
    @ApiModelProperty(value = "createTime", example = "创建时间" )
    private Date createTime;//创建时间
    @ApiModelProperty(value = "updateTime", example = "修改时间" )
    private Date updateTime;//修改时间
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    public Integer getConcernSource() {
        return concernSource;
    }
    public void setConcernSource(Integer concernSource) {
        this.concernSource = concernSource;
    }
    public String getConcernDoctorCode() {
        return concernDoctorCode;
    }
    public void setConcernDoctorCode(String concernDoctorCode) {
        this.concernDoctorCode = concernDoctorCode;
    }
    public String getConcernDoctorName() {
        return concernDoctorName;
    }
    public void setConcernDoctorName(String concernDoctorName) {
        this.concernDoctorName = concernDoctorName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}

+ 43 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/concern/ConcernDao.java

@ -0,0 +1,43 @@
package com.yihu.wlyy.repository.concern;
import com.yihu.wlyy.entity.concern.ConcernDO;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import io.vavr.collection.List;
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;
/**
 * Created by Administrator on 2018/4/4 0004.
 */
public interface ConcernDao extends
        PagingAndSortingRepository<ConcernDO, Long>,
        JpaSpecificationExecutor<ConcernDO> {
    @Query(" from  ConcernDO where code=?1 ")
    ConcernDO findByCode(String concernCode);
    /**
     * 目前是1个团队一个医生的 所以先这么做
     *
     * @param patientCode
     * @return
     */
    @Query("select d from  ConcernDO c,Doctor d where c.concernDoctorCode=d.code and  c.status=1  and  c.patient=?1  ")
    List<Doctor> listDoctorsByPatientCode(String patientCode);
    /**
     * 目前是1个团队一个医生的 所以先这么做
     *
     * @param doctorCode
     * @return
     */
    @Query("select p from  ConcernDO c,Patient p where c.patient=p.code and  c.status=1  and  c.concernDoctorCode=?1")
    List<Patient> listPatientsByDoctorCode(String doctorCode);
    @Query(" from  ConcernDO c where  c.status=1  and  c.patient=?1  and  c.concernDoctorCode=?2")
    ConcernDO findByPatientAndDoctor(String patientCode, String doctorCode);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamDao.java

@ -25,7 +25,7 @@ JpaSpecificationExecutor<DoctorTeam> {
	DoctorTeam findByParientCodeAndSignType(String parientCode, String type);
	@Modifying
	@Query("update DoctorTeam a set a.del =0  where a.code = ?1 and signType='2'")
	@Query("update DoctorTeam a set a.del =0  where a.code = ?1 ")
	void deleteTeam(String teamCode);
	/**

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorTeamMemberDao.java

@ -33,9 +33,10 @@ public interface DoctorTeamMemberDao extends PagingAndSortingRepository<DoctorTe
    void updateType1Del(String code);
    @Modifying
    @Query("update DoctorTeamMember a set a.del = '0' where a.team = ?1 and signType='2' ")
    @Query("update DoctorTeamMember a set a.del = '0' where a.team = ?1  ")
    void deleteMember(String code);
    @Query("select count(a) FROM DoctorTeamMember a WHERE a.memberCode =?1 and  a.del='1'")
    Integer teamListByDoctorCode(String doctorCode);

+ 155 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/concern/ConcernService.java

@ -0,0 +1,155 @@
package com.yihu.wlyy.service.app.concern;
import com.yihu.wlyy.entity.concern.ConcernDO;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.concern.ConcernDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import io.vavr.collection.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
 * Created by Administrator on 2018/4/4 0004.
 */
@Service
public class ConcernService extends BaseService {
    @Autowired
    private ConcernDao concernDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private DoctorTeamDao doctorTeamDao;
    @Autowired
    private DoctorTeamMemberDao doctorTeamDoctorDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 新增患者关注医生
     *
     * @param patientCode
     * @param doctorCode
     * @param concernSource 关注方式: 1扫描二维码 2页面跳转 前端传
     * @return
     */
    @Transactional
    public boolean addConcern(
            String patientCode, String doctorCode, Integer concernSource) {
        Patient patient = patientDao.findByCode(patientCode);
        Doctor doctor = doctorDao.findByCode(doctorCode);
        //新增关注
        ConcernDO concern = new ConcernDO();
        //新增关注的服务团队
        //建立团队
        DoctorTeam doctorTeam = new DoctorTeam();
        String doctorTeamCode = getCode();
        doctorTeam.setName("签约团队患者:" + patient.getName());
        doctorTeam.setCode(doctorTeamCode);
        doctorTeam.setCzrq(new Date());
        doctorTeam.setSignType("2");
        doctorTeam.setDel("1");
        doctorTeamDao.save(doctorTeam);
        concern.setTeamCode(doctorTeamCode);
        //添加团队成员
        DoctorTeamMember wlyyDoctorTeamDoctor = new DoctorTeamMember();
        wlyyDoctorTeamDoctor.setTeam(doctorTeamCode);
        wlyyDoctorTeamDoctor.setMemberCode(doctor.getCode());
        wlyyDoctorTeamDoctor.setName(doctor.getName());
        wlyyDoctorTeamDoctor.setDel("1");
        wlyyDoctorTeamDoctor.setType(1);
        wlyyDoctorTeamDoctor.setCode(getCode());
        wlyyDoctorTeamDoctor.setCzrq(new Date());
        doctorTeamDoctorDao.save(wlyyDoctorTeamDoctor);
        //保存关注记录
        concern.setCode(getCode());
        concern.setName(patient.getName());
        concern.setConcernDoctorCode(doctor.getCode());
        concern.setConcernDoctorName(doctor.getName());
        concern.setCreateTime(new Date());
        concern.setIdcard(patient.getIdcard());
        concern.setMobile(patient.getMobile());
        concern.setSsc(patient.getSsc());
        concern.setOpenid(patient.getOpenid());
        concern.setPatient(patient.getCode());
        concern.setStatus(1);
        concern.setConcernSource(concernSource);
        concernDao.save(concern);
        return true;
    }
    /**
     * 删除患者关注医生
     *
     * @param concernCode 关注code
     * @return
     */
    @Transactional
    public boolean deleteConcern(String concernCode) {
        ConcernDO concern = concernDao.findByCode(concernCode);
        //删除关注
        concern.setStatus(-1);
        //删除团队
        doctorTeamDao.deleteTeam(concern.getTeamCode());
        //删除团队成员
        doctorTeamDoctorDao.deleteMember(concern.getTeamCode());
        return true;
    }
    /**
     * 删除患者关注医生
     *
     * @param patientCode 患者code
     * @param doctorCode
     */
    @Transactional
    public void deleteConcern(String patientCode, String doctorCode) {
        ConcernDO concern = concernDao.findByPatientAndDoctor(patientCode, doctorCode);
        //删除关注
        concern.setStatus(-1);
        //删除团队
        doctorTeamDao.deleteTeam(concern.getTeamCode());
        //删除团队成员
        doctorTeamDoctorDao.deleteMember(concern.getTeamCode());
    }
    /**
     * 获取患者关注医生
     *
     * @param patientCode
     * @return
     */
    public List<Doctor> listDoctorsByPatientCode(String patientCode) {
        List<Doctor> doctors = concernDao.listDoctorsByPatientCode(patientCode);
        return doctors;
    }
    /**
     * 获取患者关注医生
     *
     * @param doctorCode
     * @return
     */
    public List<Patient> listPatientsByDoctorCode(String doctorCode) {
        List<Patient> patients = concernDao.listPatientsByDoctorCode(doctorCode);
        return patients;
    }
}

+ 20 - 20
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -188,7 +188,7 @@ public class WechatController extends WeixinBaseController {
    @ResponseBody
    public String regist(@RequestParam(value = "name", required = true) String name,
                         @RequestParam(value = "idcard", required = true) String idcard,
                         @RequestParam(value = "ssc", required = true) String ssc,
                         @RequestParam(value = "ssc", required = false) String ssc,
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "openid", required = true) String openid,
@ -200,9 +200,9 @@ public class WechatController extends WeixinBaseController {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "身份证号不允许为空!");
            }
            if (StringUtils.isEmpty(ssc)) {
                return error(-1, "社保卡号不允许为空!");
            }
//            if (StringUtils.isEmpty(ssc)) {
//                return error(-1, "社保卡号不允许为空!");
//            }
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空!");
            }
@ -241,22 +241,22 @@ public class WechatController extends WeixinBaseController {
                return error(-1, "请输入正确的身份证号!");
            }
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            if (socialSecurityInfo != null) {
                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
                }
                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
                    } else {
                        ssc = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
                    }
                }
            } else {
                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
            }
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
//
//            if (socialSecurityInfo != null) {
//                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
//                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
//                }
//                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
//                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
//                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
//                    } else {
//                        ssc = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
//                    }
//                }
//            } else {
//                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
//            }
            Patient patient = patientDao.findByIdcard(idcard);

+ 40 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/concern/DoctorConcernController.java

@ -0,0 +1,40 @@
package com.yihu.wlyy.web.doctor.concern;
import com.yihu.wlyy.service.app.concern.ConcernService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Administrator on 2018/4/4 0004.
 */
@RestController
@RequestMapping(value = "/doctor/concern")
@Api(description = "医生患者关注")
public class DoctorConcernController extends BaseController {
    @Autowired
    private ConcernService concernService;
    @RequestMapping(value = "/getConcernPatients", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生关注的患者1", notes = "")
    public String getConcernDoctors(
            @ApiParam(name = "doctor", value = "医生",required = false) @RequestParam(required = false, name = "doctor") String doctor
    ) {
        try {
            if(StringUtils.isEmpty(doctor)){
                doctor=getUID();
            }
            return write(200,"查询成功","data",concernService.listPatientsByDoctorCode(doctor));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-100, "查询失败");
        }
    }
}

+ 81 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/concern/PatientConcernController.java

@ -0,0 +1,81 @@
package com.yihu.wlyy.web.patient.concern;
import com.yihu.wlyy.service.app.concern.ConcernService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Administrator on 2018/4/4 0004.
 */
@RestController
@RequestMapping(value = "/patient/concern")
@Api(description = "患者关注")
public class PatientConcernController extends BaseController {
    @Autowired
    private ConcernService concernService;
    @RequestMapping(value = "/addConcern", method = RequestMethod.POST)
    @ApiOperation(value = "新增关注", notes = "")
    public String addConcern(
            @ApiParam(name = "patient", value = "患者", required = false) @RequestParam(required = false, name = "patient") String patient,
            @ApiParam(name = "doctor", value = "医生Code") @RequestParam(required = true, name = "doctor") String doctor,
            @ApiParam(name = "concernSource", value = "关注方式: 1扫描二维码 2页面跳转 3.咨询关注") @RequestParam(required = true, name = "concernSource") Integer concernSource
    ) {
        try {
            if (StringUtils.isEmpty(patient)) {
                patient = getUID();
            }
            concernService.addConcern(patient, doctor, concernSource);
            return success("关注成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-100, "关注失败");
        }
    }
    @RequestMapping(value = "/deleteConcern", method = RequestMethod.POST)
    @ApiOperation(value = "取消关注", notes = "")
    public String deleteConcern(
            @ApiParam(name = "patient", value = "患者", required = false) @RequestParam(required = false, name = "patient") String patient,
            @ApiParam(name = "doctor", value = "医生Code") @RequestParam(required = true, name = "doctor") String doctorCode
    ) {
        try {
            if (StringUtils.isEmpty(patient)) {
                patient = getUID();
            }
            concernService.deleteConcern(patient, doctorCode);
            return success("关注成功");
        } catch (Exception e) {
            e.printStackTrace();
            return error(-100, "关注失败");
        }
    }
    @RequestMapping(value = "/getConcernDoctors", method = RequestMethod.GET)
    @ApiOperation(value = "获取患者关注的医生", notes = "")
    public String getConcernDoctors(
            @ApiParam(name = "patient", value = "患者", required = false) @RequestParam(required = false, name = "patient") String patient
    ) {
        try {
            if (StringUtils.isEmpty(patient)) {
                patient = getUID();
            }
            return write(200, "查询成功", "data", concernService.listDoctorsByPatientCode(patient));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-100, "查询失败");
        }
    }
}

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

@ -4,7 +4,7 @@ spring:
  datasource:
    wlyy:
      url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://172.19.103.77/wlyy_sr?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: root
      password: 123456
    health:

+ 0 - 142
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -1,142 +0,0 @@
##内网的配置
spring:
  profiles: local
  datasource:
     wlyy:
       url: jdbc:mysql://10.95.22.143:3306/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
       username: wlyy
       password: jkzlehr@123
     health:
       url: jdbc:mysql://10.95.22.143:3306/device?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
       username: wlyy
       password: jkzlehr@123
  redis:
      host: 10.95.22.142 # Redis server host.
      port: 6380 # Redis server port.
      password: jkzlehr
server:
  server_url: http://10.95.22.10:8011/wlyy/
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://10.95.22.10:8011/wlyy/
  target_url: home/html/unreadMessageStatistic.html
im:
  im_list_get: http://10.95.22.138:3000/
  data_base_name: im
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fwww.xmtyw.cn%2fwlyy
  accId: gh_ffd64560fb21
  message:
     ##医生追加建议提醒 --签约邀请
     doctor_invitel_template: MQn79bx1ofb6hekhmRIuqLU7KjySJQzaBzrimgqVrzA
     #咨询回复
     template_consult_notice: 0mF_vHj-ILx8EH8DwzmAi7LqzjqYiU9IrSRRmziTZyc
     #签约成功
     template_sign_success: 0D2vYZVRzFz15p9Y_pkZ1DKutDq8UOsks79FXUKS0tA
     #签约失败
     template_sign_failed: My2VNERjJt4NXR4Ibh42pdrP6B6ka8rQxZeWinQh99s
     #健康指导提醒
     template_health_notice: uv31ES_VCmq3tBYtyGmEQvIwU_zh9LDhF3bFpbIUt5g
     #解约提醒
     template_termination:  C0tdXtA_8k-Cy4a1EkzQuI877vqaqAtRkc-e_Gsd7sk
     #预约成功
     template_appoint_success:  FY3Pqa66tHIE1Fv-irbFBPOh5cYP71fkOzfZKH4S-Fo
     #预约取消
     template_appoint_failed:  tldWEb9AN7p_RoHoD8ml0GxWW3V1V_mpEEhp2v6p56s
     #缴费提醒
     template_expenses_remind:  AcrlihhoGbm22A8cdFFDQ4u38ptRw0aiIPf-aGvNxMM
     #健康教育
     template_healthy_article: a5-ZGf-IUUULsuRNoHWQiBMU6pSYhLgPPqV67SjdLRo
     #医生变更
     template_doctor_change:  dtzSHImbPKfwcrjWlJEjAw3lGlvrLjsobSOE8g4adZA
     #问卷调查
     template_doctor_survey:  8ZWKJmoJ7VR7Uk4YS7aa0Z94QzCkxsyTW6R4CHhUJII
     #审核结果通知
     template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
     #服务结果通知
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     #体检报告提醒
     template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
     #处理结果通知
     template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276
  yihu_OpenPlatform_secret: 2JGL19AH3JS55MQY6ZOFJE1JZJ1OF23GWV67MCDQV74
fastDFS:
  fastdfs_file_url: http://10.95.22.10:8011/
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://10.95.22.10:8011/wlyy_service
express:
  sf_url: http://bsp-ois.sit.sf-express.com:9080/bsp-ois/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: BSPdevelop
  sf_check_word: j8DzkIFgmlomPt0aLuwU
pushMes:
# 1为推送redis,0为推送消息队列
  method: 1
  # redis队列名称
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
  host:  http://10.95.22.155:9200,http://10.95.22.156:9200
  tHost: 10.95.22.155:9300,10.95.22.156:9300
  clusterName: jkzl
#集美宣教居民端健康文章
jkEdu:
  web:
    articleBaseUrl: http://172.19.103.87:9088/jkeduweb
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://10.95.22.168:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN

+ 0 - 143
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -1,143 +0,0 @@
##内网开发连测试配置
spring:
  profiles: localtest
  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/
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://ehr.yihu.com/wlyy/
  target_url: home/html/unreadMessageStatistic.html
im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/
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
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
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.88:8011/wlyy_service
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic
  sf_code: SDDF
  sf_check_word: ttzlgGyOQu4L
pushMes:
# 1为推送redis,0为推送消息队列
  method: 1
  # redis队列名称
  redis_prescription_title: redisPrescription
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_test
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_test
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl
#集美宣教居民端健康文章
jkEdu:
  web:
    articleBaseUrl: http://172.19.103.87:9088/
#消息队列
activemq:
  username: admin
  password: admin
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_devtest  #健康文章推送
##如果是外网项目就是flase 内网是true
neiwang:
  enable: true
  wlyy: http://59.61.92.90:8072/wlyy
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN

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

@ -139,7 +139,7 @@ activemq:
##如果是外网项目就是flase 内网是true
neiwang:
  enable: false
  enable: true
  wlyy: http://59.61.92.90:8072/
#解决swagger 通过nginx代理之后curl显示localhost的问题