소스 검색

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

LiTaohong 6 년 전
부모
커밋
16669afa41
39개의 변경된 파일790개의 추가작업 그리고 184개의 파일을 삭제
  1. 23 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java
  2. 15 0
      business/base-service/src/main/java/com/yihu/jw/label/PatientLabelDao.java
  3. 2 0
      business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java
  4. 2 0
      business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java
  5. 2 2
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java
  6. 2 0
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java
  7. 7 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientMedicardCardService.java
  8. 2 2
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  9. 13 0
      business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxUrlConfigDao.java
  10. 65 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxUrlConfigService.java
  11. 78 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/label/PatientLabelDO.java
  12. 18 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  13. 33 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java
  14. 1 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  15. 10 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
  16. 14 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java
  17. 13 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java
  18. 74 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/label/BasePatientLabelVO.java
  19. 27 1
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageRecordVO.java
  20. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageVO.java
  21. 1 2
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java
  22. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java
  23. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  24. 35 35
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java
  25. 0 31
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WechatDao.java
  26. 0 17
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxAccessTokenDao.java
  27. 0 19
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateConfigDao.java
  28. 0 26
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateDao.java
  29. 3 2
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java
  30. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  31. 18 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/config/UrlconfigEndPoint.java
  32. 15 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java
  33. 19 2
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java
  34. 53 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java
  35. 21 2
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatInfoEndPoint.java
  36. 4 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/message/MyMessageService.java
  37. 69 22
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java
  38. 48 2
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java
  39. 90 13
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

+ 23 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java

@ -0,0 +1,23 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO> {
    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
    List<BaseDoctorHospitalDO> findByDoctorCode(String doctorCode);
}

+ 15 - 0
business/base-service/src/main/java/com/yihu/jw/label/PatientLabelDao.java

@ -0,0 +1,15 @@
package com.yihu.jw.label;
import com.yihu.jw.entity.base.label.PatientLabelDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/12/7.
 */
public interface PatientLabelDao extends PagingAndSortingRepository<PatientLabelDO, String>, JpaSpecificationExecutor<PatientLabelDO> {
    public List<PatientLabelDO> findByLabelTypeAndStatus(String labelType,Integer status);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java

@ -26,4 +26,6 @@ public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, St
    @Query("update BaseMessageDO t set t.readState = ?1 where t.id=?2 ")
    int updateStatusById(Integer readState,Integer id);
//    List<BaseMessageDO> getBy(String receiver,String sender,String msgTypeCode,Integer platform);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java

@ -74,6 +74,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
        List<Map<String, Object>> unReadResult = messageListSql(platform,code,0,page,unReadPageSize);
        for(Map<String, Object> one:unReadResult){
            Map<String,Object> unReadMap = new HashedMap();
            unReadMap.put("patientCode",one.get("sender"));
            unReadMap.put("name",one.get("sender_name"));
            unReadMap.put("count",one.get("num"));
            unReadMap.put("message",one.get("msg_content"));
@ -85,6 +86,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
            List<Map<String, Object>> readResult = messageListSql(platform,code,1,page,unReadPageSize);
            for(Map<String, Object> one:readResult){
                Map<String,Object> readMap = new HashedMap();
                readMap.put("patientCode",one.get("sender"));
                readMap.put("name",one.get("sender_name"));
                readMap.put("count",one.get("num"));
                readMap.put("message",one.get("msg_content"));

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java

@ -15,7 +15,7 @@ import java.util.Map;
 */
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<BasePatientDO> {
    BasePatientDO findByIdAndDel(String id, String del);
    BasePatientDO findById(String id);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,mobile as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    List<Map<String,Object>> findByIdcard(String idcard, Pageable pageable);
@ -28,7 +28,7 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    boolean existsByIdcardAndIdNot(String idcard,String id);
    boolean existsByIdcard(String idcard);
    boolean existsByIdcardAndDel(String idcard,String del);
    @Query("from BasePatientDO where mobile = ?1")
    List<BasePatientDO> findByMobile(String mobile);

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java

@ -21,4 +21,6 @@ public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<P
    PatientMedicareCardDO findByCode(String code);
    PatientMedicareCardDO findByTypeAndPatientCodeAndDel(String Type,String patientCode,String del);
    boolean existsByCodeAndDel(String code,String del);
}

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientMedicardCardService.java

@ -75,4 +75,11 @@ public class BasePatientMedicardCardService<T, R extends CrudRepository> extends
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel(Type,patientCode,del);
        return patientMedicareCardDO;
    }
    public boolean existsByCodeAndDel(String code)throws Exception{
        if(StringUtils.isEmpty(code)){
            throw new Exception("社保卡号不能为空");
        }
        return basePatientMedicareCardDao.existsByCodeAndDel(code,"1");
    }
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -169,7 +169,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
     * @return
     */
    public BasePatientDO findByIdAndDel(String patient) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findByIdAndDel(patient,"1");
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        if(basePatientDO==null){
            throw new Exception("not patient");
        }
@ -184,7 +184,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    public BasePatientDO findByMobileAndDel(String mobile) throws Exception{
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list.size()<=0){
            throw new Exception("not patient");
            return null;
        }
        return list.get(0);
    }

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/dao/WxUrlConfigDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.wechat.dao;
import com.yihu.jw.entity.base.wx.WxUrlConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2018/12/10.
 */
public interface WxUrlConfigDao extends PagingAndSortingRepository<WxUrlConfigDO, String>, JpaSpecificationExecutor<WxUrlConfigDO> {
    WxUrlConfigDO findByUrl(String url);
}

+ 65 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxUrlConfigService.java

@ -0,0 +1,65 @@
package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.saas.SaasDO;
import com.yihu.jw.entity.base.wx.WxUrlConfigDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.restmodel.base.wx.WxContants;
import com.yihu.jw.restmodel.base.wx.WxSaasVO;
import com.yihu.jw.restmodel.base.wx.WxWechatVO;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxUrlConfigDao;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2018/12/10.
 */
@Service
public class WxUrlConfigService {
    @Autowired
    private WxUrlConfigDao wxUrlConfigDao;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public Map<String,Object> getWxWechatConfig(String url){
        WxUrlConfigDO wxUrlConfigDO = wxUrlConfigDao.findByUrl(url);
        if(wxUrlConfigDO!=null){
            WxWechatDO wxWechatDO = wechatDao.findById(wxUrlConfigDO.getWxId());
            List<WxSaasVO> saasVOs = getWxSaasVOs(wxWechatDO.getId());
            Map<String,Object> map = new HashedMap();
            map.put("wxId",wxUrlConfigDO.getWxId());
            map.put("wxAppId",wxWechatDO.getAppId());
            map.put("publicType",wxWechatDO.getPublicType());
            map.put("saasVOs",saasVOs);
            return map;
        }else{
            return null;
        }
    }
    public List<WxSaasVO> getWxSaasVOs(String id){
        String sql ="SELECT " +
                " bs.`name` AS saasName, " +
                " bs.id AS saasid" +
                " FROM " +
                " wx_wechat_saas s " +
                " JOIN base_saas bs ON bs.id = s.saas_id " +
                " WHERE " +
                " s.wechat_id = '"+id+"'";
        List<WxSaasVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WxSaasVO.class));
        return list;
    }
}

+ 78 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/label/PatientLabelDO.java

@ -0,0 +1,78 @@
package com.yihu.jw.entity.base.label;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2018/12/7.
 */
@Entity
@Table(name = "base_patient_label")
public class PatientLabelDO extends UuidIdentityEntityWithOperator implements java.io.Serializable{
    private String labelCode;//标签标识',
    private String labelName;//标签名称',
    private String labelType;//标签类型(1:卫计委三大分组 2:健康状况 3:疾病类型 4:自定义标签5.周月标签 6.老年人标识 7.专病类型,8.健康情况)',
    private Integer isSystem;//是否系统标签(0:否 1是)',
    private String teamCode;//团队code',
    private Integer sort;//排序',
    private Integer status;//状态(0:无效 1:有效)',
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 18 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java

@ -36,6 +36,8 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
    private Integer sort;//排序:0 待支付,1未通过,2未通过,3待审核,4.生效
    private String cancelReason;//取消原因
    private String reviewReason;//审核原因
    @Column(name = "saas_id")
    public String getSaasId() {
@ -207,4 +209,20 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
    public String getReviewReason() {
        return reviewReason;
    }
    public void setReviewReason(String reviewReason) {
        this.reviewReason = reviewReason;
    }
}

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/WxUrlConfigDO.java

@ -0,0 +1,33 @@
package com.yihu.jw.entity.base.wx;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2018/12/10.
 */
@Entity
@Table(name = "wx_url_config")
public class WxUrlConfigDO extends IntegerIdentityEntity {
    private String url;
    private String wxId;
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getWxId() {
        return wxId;
    }
    public void setWxId(String wxId) {
        this.wxId = wxId;
    }
}

+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -472,6 +472,7 @@ public class BaseRequestMapping {
        public static final String idcardOccupied  = "/idcardOccupied";
        public static final String updateMobile  = "/updateMobile";
        public static final String resetPassword  = "/resetPassword";
        public static final String ForgetPwd  = "/forgetPwd";
        public static final String Regist = "regist";
        public static final String GetKey = "getKey";
        public static final String Login = "login";

+ 10 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java

@ -17,15 +17,20 @@ public class PatientRequestMapping {
        public static final String LIST = "/list";
    }
    public static class open extends Basic{
        public static final String openUrl = "/open";
        public static final String findwxConfig ="/findwxConfig";
    }
    public abstract static class Wechat extends Basic{
        public static final String wxBase =  "/wxBase";
        public static final String api_success ="success";
        public static final String api_error ="error";
        public static final String getSign ="/getSign";
        public static final String getWxWechatConfig ="/getWxWechatConfig";
    }
    /**
     * signPackage
     */
@ -42,6 +47,9 @@ public class PatientRequestMapping {
        public static final String findOrgByCode  = "/findOrgByCode";
        public static final String findPatientSignExist  = "/findPatientSignExist";
        public static final String findPatientSignPackage  = "/findPatientSignPackage";
        public static final String findLabelByLabelType  = "/findLabelByLabelType";
        public static final String findSingleSignPackageById  = "/findSingleSignPackageById";
        public static final String signPackageAndFamily  = "/signPackageAndFamily";
    }
    /**
     * myFamily
@ -62,6 +70,7 @@ public class PatientRequestMapping {
        public static final String messageToBinding  = "/messageToBinding";
        public static final String cancelBindFamily  = "/cancelBindFamily";
        public static final String updateAuthorizeById  = "/updateAuthorizeById";
        public static final String nonageByIdcard  = "/nonageByIdcard";
    }
    public static class MyMessage extends Basic {

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorHospitalVO.java

@ -114,5 +114,19 @@ public class BaseDoctorHospitalVO extends IntegerIdentityVO{
        this.createTime = createTime;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}

+ 13 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java

@ -1,9 +1,11 @@
package com.yihu.jw.restmodel.base.doctor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
/**
 * Created by Trick on 2018/11/29.
@ -163,6 +165,9 @@ public class BaseDoctorSimpleVO {
    @ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    @ApiModelProperty(value = "机构", example = "1")
    private List<BaseDoctorHospitalVO> hospitalVOs;
    public String getId() {
        return id;
@ -371,4 +376,12 @@ public class BaseDoctorSimpleVO {
    public void setDel(String del) {
        this.del = del;
    }
    public List<BaseDoctorHospitalVO> getHospitalVOs() {
        return hospitalVOs;
    }
    public void setHospitalVOs(List<BaseDoctorHospitalVO> hospitalVOs) {
        this.hospitalVOs = hospitalVOs;
    }
}

+ 74 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/label/BasePatientLabelVO.java

@ -0,0 +1,74 @@
package com.yihu.jw.restmodel.base.label;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/12/7.
 */
@ApiModel(value = "居民标签", description = "居民标签")
public class BasePatientLabelVO {
    private String labelCode;//标签标识',
    private String labelName;//标签名称',
    private String labelType;//标签类型(1:卫计委三大分组 2:健康状况 3:疾病类型 4:自定义标签5.周月标签 6.老年人标识 7.专病类型,8.健康情况)',
    private Integer isSystem;//是否系统标签(0:否 1是)',
    private String teamCode;//团队code',
    private Integer sort;//排序',
    private Integer status;//状态(0:无效 1:有效)',
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getTeamCode() {
        return teamCode;
    }
    public void setTeamCode(String teamCode) {
        this.teamCode = teamCode;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 27 - 1
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageRecordVO.java

@ -7,6 +7,7 @@ import java.util.Date;
 */
public class ServicePackageRecordVO {
    private String id;
    private String saasId;
    private String servicePackageId;//服务包id
    private String servicePackageName;//服务包名称
@ -27,10 +28,19 @@ public class ServicePackageRecordVO {
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
    private Integer sort;//排序:0 待支付,1未通过,2未通过,3待审核,4.生效
    private String cancelReason;//取消原因
    private String reviewReason;//审核原因
    private String introduce;//服务介绍
    private String endIntroduce;//过期时间说明
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getSaasId() {
        return saasId;
    }
@ -206,4 +216,20 @@ public class ServicePackageRecordVO {
    public void setEndIntroduce(String endIntroduce) {
        this.endIntroduce = endIntroduce;
    }
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
    public String getReviewReason() {
        return reviewReason;
    }
    public void setReviewReason(String reviewReason) {
        this.reviewReason = reviewReason;
    }
}

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageVO.java

@ -32,6 +32,8 @@ public class ServicePackageVO {
    private List<SerivePackageItemVO> items;//服务项描述
    private Integer signType;//判断当前居民是否签约:1为签约,2为未签约
    public String getId() {
        return id;
    }
@ -191,4 +193,12 @@ public class ServicePackageVO {
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getSignType() {
        return signType;
    }
    public void setSignType(Integer signType) {
        this.signType = signType;
    }
}

+ 1 - 2
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java

@ -63,8 +63,7 @@ public class BasicZuulFilter extends ZuulFilter {
        //内部微服务有不需要认证的地址请在URL上追加/open/来进行过滤,如/api/v1.0/open/**,不要在此继续追加!!!
        if (url.contains("/auth/")//验证服务
                || url.contains("/wechat")//微信
                || url.contains("/open/")
                || url.contains("/patient/")) {//开发接口
                || url.contains("/open/")) {//开发接口
            return true;
        }
        return this.authenticate(ctx, request, url);

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/WlyyTokenGranter.java

@ -314,7 +314,7 @@ public class WlyyTokenGranter implements TokenGranter {
            String client_id = parameters.get("client_id");
            String username = parameters.get("username");
            String captcha = parameters.get("captcha");
                //todo cyx  部署应注释掉
                //todo cyx  部署应取消注释(自测试,可注释,不验证短信直接登录)
           if (!wlyyRedisVerifyCodeService.verification(client_id, username, captcha)){
                throw new InvalidGrantException("Invalid captcha");
            }

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-authentication-lyx
    name: svr-authentication
  cloud:
    config:
      failFast: true

+ 35 - 35
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorHospitalDao.java

@ -1,35 +1,35 @@
package com.yihu.jw.base.dao.doctor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * 
 * 医生职业信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
}
//package com.yihu.jw.base.dao.doctor;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
//
//import java.util.List;
//import java.util.Map;
//import java.util.Set;
//
///**
// *
// * 医生职业信息 数据库访问层
// *
// * @version
// * <pre>
// * Author	Version		Date		Changes
// * litaohong 	1.0  		2018年08月31日 	Created
// *
// * </pre>
// * @since 1.
// */
//public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDoctorHospitalDO, Integer>, JpaSpecificationExecutor<BaseDoctorHospitalDO>  {
//
//    List<BaseDoctorHospitalDO> findByOrgCodeAndDoctorCode(String orgCode, String doctorCode);
//
//    @Query("select id from BaseDoctorHospitalDO where doctorCode = ?1")
//    Set<Object> findIdListByOrgCodeAndDoctorCode(String doctorCode);
//
//    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
//    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
//}

+ 0 - 31
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WechatDao.java

@ -1,31 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//import com.yihu.jw.entity.base.wx.WxWechatDO;
//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 Administrator on 2017/5/20 0020.
// */
//public interface WechatDao extends PagingAndSortingRepository<WxWechatDO, String>, JpaSpecificationExecutor<WxWechatDO> {
//
//    @Query("from WxWechatDO w where w.appId = ?1 and w.status!=-1")
//    WxWechatDO findByAppId(String appId);
//
//    @Query("from WxWechatDO w where w.appId = ?1 and w.id!= ?2 and w.status!=-1")
//    WxWechatDO findByAppIdExcludeId(String appId, String id);
//
//    @Query("from WxWechatDO w where w.id = ?1 and w.status!=-1")
//    WxWechatDO findById(String id);
//
//    @Query("from WxWechatDO w where w.status!=-1")
//    List<WxWechatDO> findAll();
//
//    @Query("from WxWechatDO w where w.appOriginId = ?1 and w.status!=-1")
//    WxWechatDO findByAppOriginId(String appOriginId);
//
//    List<WxWechatDO> findByName(String name);
//}

+ 0 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxAccessTokenDao.java

@ -1,17 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
//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 Administrator on 2017/5/18 0018.
// */
//public interface WxAccessTokenDao extends PagingAndSortingRepository<WxAccessTokenDO, String>, JpaSpecificationExecutor<WxAccessTokenDO> {
//
//    @Query("from WxAccessTokenDO w where w.wechatId =?1 order by w.addTimestamp desc")
//    List<WxAccessTokenDO> getWxAccessTokenById(String wechatId);
//}

+ 0 - 19
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateConfigDao.java

@ -1,19 +0,0 @@
//package com.yihu.jw.base.dao.wx;
//
//
//import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
//import java.util.List;
//
///**
// * Created by Trick on 2018/8/21.
// */
//public interface WxTemplateConfigDao extends PagingAndSortingRepository<WxTemplateConfigDO, String>, JpaSpecificationExecutor<WxTemplateConfigDO> {
//
//    WxTemplateConfigDO findByWechatIdAndTemplateNameAndSceneAndStatus(String wechatId, String templateName, String scene,Integer status);
//    WxTemplateConfigDO findByWechatIdAndTemplateNameAndScene(String wechatId, String templateName, String scene);
//    List<WxTemplateConfigDO> findByWechatIdAndScene(String wechatId,String scene);
//
//}

+ 0 - 26
svr/svr-base/src/main/java/com/yihu/jw/base/dao/wx/WxTemplateDao.java

@ -1,26 +0,0 @@
//package com.yihu.jw.base.dao.wx;//package com.yihu.jw.business.wx.dao;
//
//import com.yihu.jw.entity.base.wx.WxTemplateDO;
//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 Administrator on 2017/5/20 0020.
// */
//public interface WxTemplateDao extends PagingAndSortingRepository<WxTemplateDO, String>, JpaSpecificationExecutor<WxTemplateDO> {
//
//
//    @Query("from WxTemplateDO w where w.id = ?1 and w.status =1")
//    WxTemplateDO findById(String id);
//
//    @Query("from WxTemplateDO w where w.wechatId = ?1 and w.status =1")
//    List<WxTemplateDO> findByWxId(String wechatId);
//
//    List<WxTemplateDO> findByTemplateIdAndWechatIdAndStatus(String templateId,String wechatId,Integer status);
//
//    List<WxTemplateDO> findByTemplateNameAndWechatIdAndStatus(String templateId,String wechatId,Integer status);
//
//}

+ 3 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorHospitalService.java

@ -1,12 +1,13 @@
package com.yihu.jw.base.service.doctor;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import java.util.*;

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
@ -17,6 +16,7 @@ import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;

+ 18 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/config/UrlconfigEndPoint.java

@ -0,0 +1,18 @@
package com.yihu.jw.patient.endpoint.config;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by Trick on 2018/12/10.
 */
@RestController
@RequestMapping(PatientRequestMapping.open.openUrl)
@Api(tags = "开发接口", description = "开发接口")
public class UrlconfigEndPoint extends EnvelopRestEndpoint {
}

+ 15 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java

@ -67,7 +67,7 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole) throws Exception {
        try{
            Map<String,Object> patientApplyLog = myFamilyService.bindingMyFamily( getUID(patient), familyMobile, 1,familyBindRole);
            Map<String,Object> patientApplyLog = myFamilyService.bindingMyFamily( getUID(patient), familyMobile, 1,familyBindRole,null,null,null);
            return success(patientApplyLog);
        }catch (Exception e){
            e.printStackTrace();
@ -254,4 +254,18 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.nonageByIdcard)
    @ApiOperation(value = "根据身份判断是否未成年 1成年,2未成年")
    public Envelop nonageByIdcard(
            @ApiParam(name = "idcard", value = "身份证", required = true)
            @RequestParam(value = "idcard",required = true) String idcard) throws Exception {
        try{
            Integer resultMap = myFamilyService.nonageByIdcard(idcard);
            return success(resultMap);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
}

+ 19 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java

@ -172,6 +172,19 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        return success(patientService.resetPassword(id, password));
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.ForgetPwd)
    @ApiOperation(value = "通过验证码重置密码")
    public ObjEnvelop forgetPws(@ApiParam(name = "mobile", value = "手机号", required = true) @RequestParam String mobile,
                            @ApiParam(name = "password", value = "密码", required = true) @RequestParam String password,
                            @ApiParam(name = "captcha", value = "验证码", required = true) @RequestParam String captcha) throws Exception {
        ObjEnvelop envelop = new ObjEnvelop();
        Map<String, Object> result = patientService.forget(mobile, password,captcha);
        envelop.setObj(result);
        return envelop;
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.getCompletedInfo)
    @ApiOperation(value = "查询完善后信息详情")
    public ObjEnvelop<BasePatientVO> getCompletedInfo(
@ -196,8 +209,12 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "预注册测试接口")
    public Envelop bespeakRegist(
            @ApiParam(name = "mobile", value = "手机号")
            @RequestParam(value = "mobile", required = true) String mobile) throws Exception {
        Map<String, Object> map = patientService.bespeakRegist(mobile, 2L);
            @RequestParam(value = "mobile", required = true) String mobile,
            @ApiParam(name = "name", value = "居民名称")
            @RequestParam(value = "name", required = false) String name,
            @ApiParam(name = "idcard", value = "居民身份证")
            @RequestParam(value = "idcard", required = false) String idcard) throws Exception {
        Map<String, Object> map = patientService.bespeakRegist(mobile,name,idcard, 2L);
        Envelop envelop = new Envelop();
        String code = map.get("code").toString();
        String message = map.get("message").toString();

+ 53 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java

@ -2,15 +2,20 @@ package com.yihu.jw.patient.endpoint.servicepackage;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.label.PatientLabelDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.patient.service.servicepackage.PackageService;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorHospitalVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorSimpleVO;
import com.yihu.jw.restmodel.base.label.BasePatientLabelVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageRecordVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -45,11 +50,13 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "labelCode", required = false)String labelCode,
                                         @ApiParam(name = "labelType", value = "标签类型")
                                         @RequestParam(value = "labelType", required = false)String labelType,
                                         @ApiParam(name = "patient", value = "居民code(判断居民是否签约,非必传)")
                                         @RequestParam(value = "patient", required = false)String patient,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return packageService.findPackageService(city,labelCode,labelType,page,size);
        return packageService.findPackageService(city,labelCode,labelType,patient,page,size);
    }
@ -101,12 +108,42 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return packageService.signPackage(recordDO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.signPackageAndFamily)
    @ApiOperation(value = "绑定家人,签约服务包", notes = "绑定家人,签约服务包")
    public Envelop signPackageAndFamily(@ApiParam(name = "recordJson", value = "签约实体")
                                        @RequestParam(value = "recordJson", required = true)String recordJson,
                                        @ApiParam(name = "patient", value = "申请绑定的居民code")
                                        @RequestParam(value = "patient", required = true)String patient,
                                        @ApiParam(name = "familyName", value = "申请绑定的家人的名称")
                                        @RequestParam(value = "familyName", required = false)String familyName,
                                        @ApiParam(name = "principalNum", value = "医社保号")
                                        @RequestParam(value = "principalNum", required = false)String principalNum,
                                        @ApiParam(name = "idcard", value = "身份证号")
                                        @RequestParam(value = "idcard", required = false)String idcard,
                                        @ApiParam(name = "familyMobile", value = "家人的手机号码")
                                        @RequestParam(value = "familyMobile", required = true)String familyMobile,
                                        @ApiParam(name = "platform", value = "消息平台,1微信端/患者端,2医生APP端")
                                        @RequestParam(value = "platform", required = true)Integer platform,
                                        @ApiParam(name = "familyBindRole", value = "1\"配偶\",2\"父亲\",3\"母亲\",4\"公公\",5\"婆婆\",6\"岳父\",7\"岳母\",8\"女婿\",9\"儿媳\",10\"子女\"")
                                        @RequestParam(value = "familyBindRole", required = true)Integer familyBindRole,
                                        @ApiParam(name = "isAdult", value = "0未成年人 1成年人")
                                        @RequestParam(value = "isAdult", required = true)Integer isAdult) throws Exception {
        ServicePackageSignRecordDO recordDO = toEntity(recordJson, ServicePackageSignRecordDO.class);
        return packageService.signPackageAndFamily(recordDO,patient,familyMobile,platform,familyBindRole,isAdult,familyName,principalNum,idcard);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findDoctorById)
    @ApiOperation(value = "获取医生基础信息", notes = "获取医生基础信息")
    public ObjEnvelop<BaseDoctorSimpleVO> findDoctorById(@ApiParam(name = "doctorCode", value = "医生code")
                                                         @RequestParam(value = "doctorCode", required = true)String doctorCode) {
        BaseDoctorDO baseDoctorDO = packageService.findDoctorById(doctorCode);
        BaseDoctorSimpleVO baseDoctorSimpleVO = convertToModel(baseDoctorDO,BaseDoctorSimpleVO.class);
        List<BaseDoctorHospitalDO> baseDoctorHospitalDOs = packageService.findDoctorHospital(doctorCode);
        List<BaseDoctorHospitalVO> baseDoctorHospitalVOs = new ArrayList<>();
        convertToModels(baseDoctorHospitalDOs,baseDoctorHospitalVOs,BaseDoctorHospitalVO.class);
        baseDoctorSimpleVO.setHospitalVOs(baseDoctorHospitalVOs);
        return success(PatientRequestMapping.SignPackage.api_success,baseDoctorSimpleVO);
    }
@ -146,5 +183,20 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
        return packageService.findPatientSignPackage( label, labelType, patient, operator, familyModel, status, isHos,  page, size);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findLabelByLabelType)
    @ApiOperation(value = "获取标签", notes = "获取标签")
    public MixEnvelop<BasePatientLabelVO,BasePatientLabelVO> findLabelByLabelType(@ApiParam(name = "labelType", value = "标签类型") @RequestParam(value = "labelType", required = false)String labelType) {
        List<PatientLabelDO> list = packageService.findLabelByLabelType(labelType);
        List<BasePatientLabelVO> basePatientLabelVOs = new ArrayList<>();
        convertToModels(list,basePatientLabelVOs,BasePatientLabelVO.class);
        return MixEnvelop.getSuccess(PatientRequestMapping.SignPackage.api_success,basePatientLabelVOs);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findSingleSignPackageById)
    @ApiOperation(value = "根据签约id获取签约详情", notes = "根据签约id获取签约详情")
    public ObjEnvelop<ServicePackageRecordVO> findSingleSignPackageById(@ApiParam(name = "signId", value = "签约id") @RequestParam(value = "signId", required = false)String signId) {
        return success(PatientRequestMapping.SignPackage.api_success,packageService.findSingleSignPackageById(signId));
    }
//=================================
}

+ 21 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/wechat/WechatInfoEndPoint.java

@ -1,14 +1,18 @@
package com.yihu.jw.patient.endpoint.wechat;
import com.sun.net.httpserver.Authenticator;
import com.yihu.jw.entity.base.wx.JsApiTicket;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.service.WechatInfoService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.wechat.service.WxUrlConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -17,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
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.ResponseBody;
import java.security.MessageDigest;
@ -40,15 +45,29 @@ public class WechatInfoEndPoint extends EnvelopRestEndpoint {
    private WechatInfoService wechatInfoService;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private WxUrlConfigService wxUrlConfigService;
    @RequestMapping(value =  PatientRequestMapping.Wechat.getWxWechatConfig, method = RequestMethod.GET)
    @ResponseBody
    public ObjEnvelop<Map<String,Object>> getWxWechatConfig(@ApiParam(name = "url", value = "域名地址")
                                                                @RequestParam(value = "url", required = true)String url){
        return success(PatientRequestMapping.Wechat.api_success,wxUrlConfigService.getWxWechatConfig(url));
    }
    /**
     * 获取签名signature
     *
     * @param pageUrl 需要签名的页面全地址(?后的也需要除了#后的不需要)
     * @return
     */
    @RequestMapping(value = "getSign", method = RequestMethod.POST)
    @RequestMapping(value = PatientRequestMapping.Wechat.getSign, method = RequestMethod.POST)
    @ResponseBody
    public Envelop getSign(String pageUrl,String wxId) {
    public Envelop getSign(@ApiParam(name = "pageUrl", value = "授权页面")
                           @RequestParam(value = "pageUrl", required = true)String pageUrl,
                           @ApiParam(name = "wxId", value = "微信id")
                           @RequestParam(value = "wxId", required = true)String wxId) {
        String ticket = getJsapi_ticketByToken(wxId);
            Map<Object, Object> map = new HashMap<Object, Object>();

+ 4 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/message/MyMessageService.java

@ -25,4 +25,8 @@ public class MyMessageService {
        messageService.updateStatusById(readState,id);
    }
    public void messagedetailList(Integer type,String reciever,String sender){
        
    }
}

+ 69 - 22
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java

@ -9,6 +9,7 @@ import com.yihu.jw.message.service.MessageService;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
import com.yihu.jw.patient.service.personal_Info.PatientService;
import com.yihu.jw.patient.service.servicepackage.PackageService;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.service.WeChatQrcodeService;
import org.apache.commons.collections.map.HashedMap;
@ -68,22 +69,11 @@ public class MyFamilyService {
        }
        List<BasePatientFamilyMemberDO> list = patientFamilyMemberService.getByPatientAndFamilyRelation(patient,null);
        list.addAll(patientFamilyMemberService.getByFamilyMemberAndRelation(patient,null));
        for(BasePatientFamilyMemberDO one:list){
            Integer relation = one.getFamilyRelation();
            if(one.getFamilyMember().equals(patient)){//需要关系转换
                BasePatientDO p = patientService.findByIdAndDel(patient);
                relation = familyRelationTrans(one.getFamilyRelation(),p.getSex());
            }
            if(relation==10){continue;}
            Map<String,Object> relationMap = map.get(relation.toString());
            relationMap.put("isBinding",1);
        }
        List<BasePatientFamilyMemberDO> childrenList = patientFamilyMemberService.getByPatientAndFamilyRelation(patient,10);
        childrenList.addAll(patientFamilyMemberService.getByFamilyMemberAndRelation(patient,2,3));
        if(childrenList.size()==2){
            map.get("10").put("isBinding",1);
        }
        Collection<Map<String,Object>> valueCollection = map.values();
        List<Map<String,Object>> valueList = new LinkedList<>(valueCollection);
        return valueList;
@ -97,22 +87,32 @@ public class MyFamilyService {
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public Map<String,Object> bindingMyFamily( String patient, String familyMobile, Integer platform,Integer familyBindRole) throws Exception{
    public Map<String,Object> bindingMyFamily( String patient, String familyMobile, Integer platform,Integer familyBindRole,String familyName,String principalNum,String idcard) throws Exception{
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);
        //1、检验手机号码是否有存在账号,
        BasePatientDO familyPatient = patientService.findByMobileAndDel(familyMobile);
        Long time = 1000*60*60*24*Long.valueOf(qrCodeFailurTime);
        Long minutes = 60*24*Long.valueOf(qrCodeFailurTime);
        if(familyPatient==null){
            //2、没有存在账号的,预注册一个账号,调用预注册接口
            Map<String,Object> map = patientService.bespeakRegist(familyMobile,time);
            Map<String,Object> map = patientService.bespeakRegist(familyMobile,familyName,idcard,minutes);
            if(Integer.valueOf(map.get("code")+"")==1){
                familyPatient = (BasePatientDO)map.get("patient");
            }else{
                throw new Exception(map.get("message")+"");
            }
        }
        //生成社保卡号
        if(!StringUtils.isEmpty(principalNum)){
            PatientMedicareCardDO medicareCardDO = new PatientMedicareCardDO();
            medicareCardDO.setCode(principalNum);
            medicareCardDO.setParentType(PatientMedicareCardDO.ParentType.CareCard.getType());
            medicareCardDO.setType(PatientMedicareCardDO.Type.MedicareCard.getType());
            medicareCardDO.setPatientCode(familyPatient.getId());
            medicareCardDO.setDel("1");
            patientMedicareCardService.save(medicareCardDO);
        }
        //3、生成申请绑定的记录
        PatientApplyLog patientApplyLog = patientApplyLogService.findValidOne(patient,familyPatient.getId(),new Date(),familyBindRole);
        if(patientApplyLog==null){
@ -181,13 +181,30 @@ public class MyFamilyService {
     * @param familyBindRole 1"配偶",2"父亲",3"母亲",4"公公",5"婆婆",6"岳父",7"岳母",8"女婿",9"儿媳",10"子女"
     * @param isAdult 0未成年人 1成年人
     */
    public Map<String,Object> signBindFamily( String patient, String familyMobile, Integer platform,Integer familyBindRole,Integer isAdult) throws Exception{
    public Map<String,Object> signBindFamily( String patient, String familyMobile, Integer platform,Integer familyBindRole,Integer isAdult,
                                              String familyName,String principalNum,String idcard) throws Exception{
        //判断身份证号和社保卡号重复问题
        if(patientService.existsByIdcard(idcard)){
            throw new Exception("填写身份证已存在!");
        }
        if(patientMedicareCardService.existsByCodeAndDel(principalNum)){
            throw new Exception("填写社保卡号已存在!");
        }
        if(isAdult==1){
            Map<String,Object> p = bindingMyFamily(patient, familyMobile, platform,familyBindRole);
            Map<String,Object> p = bindingMyFamily(patient, familyMobile, platform,familyBindRole,familyName,principalNum,idcard);
            return p;
        }else if(isAdult==0){
            //注册一个没有手机号码的用户信息
            BasePatientDO familyPatient = null;
            BasePatientDO familyPatient = new BasePatientDO();
            familyPatient.setLocked(0);
            familyPatient.setEnabled(1);
            familyPatient.setDel("0");
            familyPatient.setLoginFailureCount(0);
            familyPatient.setPatientStatus("1");
            familyPatient.setName(familyName);
            familyPatient.setIdcard(idcard);
            familyPatient = patientService.save(familyPatient);
            //生成绑定信息
            BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO();
            patientFamilyMember.setPatient(patient);
@ -196,6 +213,15 @@ public class MyFamilyService {
            patientFamilyMember.setIsAuthorize(1);//0:未授权,1:已授权
            patientFamilyMember.setDel(1);
            patientFamilyMemberService.save(patientFamilyMember);
            //生成家人绑定信息
            BasePatientFamilyMemberDO patientFamilyMember2 = new BasePatientFamilyMemberDO();
            patientFamilyMember2.setPatient(familyPatient.getId());
            patientFamilyMember2.setFamilyMember(patient);
            BasePatientDO createUser = patientService.findByIdAndDel(patient);
            patientFamilyMember2.setFamilyRelation(familyRelationTrans(familyBindRole,createUser.getSex()));
            patientFamilyMember2.setIsAuthorize(1);
            patientFamilyMember2.setDel(1);
            patientFamilyMemberService.save(patientFamilyMember2);
        }
        return null;
    }
@ -267,7 +293,7 @@ public class MyFamilyService {
                patientFamilyMemberService.save(patientFamilyMember);
                BasePatientFamilyMemberDO patientFamilyMember2 = new BasePatientFamilyMemberDO();
                patientFamilyMember2.setPatient(patientApplyLog.getFamilyMemberCode());
                patientFamilyMember2.setFamilyMember(patientApplyLog.getFamilyMemberName());
                patientFamilyMember2.setFamilyMember(patientApplyLog.getCreateUser());
                BasePatientDO createUser = patientService.findByIdAndDel(patientApplyLog.getCreateUser());
                patientFamilyMember2.setFamilyRelation(familyRelationTrans(patientApplyLog.getFamilyBindRole(),createUser.getSex()));
                patientFamilyMember2.setIsAuthorize(isAuthorize);
@ -373,6 +399,9 @@ public class MyFamilyService {
        map.put("name",basePatientDO.getName());//姓名
        map.put("cardTypeName","身份证");
        map.put("idcard",basePatientDO.getIdcard());//身份证
        map.put("photo",basePatientDO.getPhoto());//头像
        map.put("role","自己");//角色
        map.put("isAuthorize",1);//授权
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardService.findByTypeAndPatientCodeAndDel(PatientMedicareCardDO.Type.MedicareCard.getType(),patient,"1");
        if(patientMedicareCardDO!=null){
@ -393,13 +422,13 @@ public class MyFamilyService {
        //家人
        for(BasePatientFamilyMemberDO one:list){
            Map<String,Object> map2 = new HashedMap();
            basePatientDO = patientService.findByIdAndDel(one.getPatient());
            basePatientDO = patientService.findByIdAndDel(one.getFamilyMember());
            map2.put("appellation",basePatientDO.getName());//别称
            map2.put("patientCode",basePatientDO.getId());//居民code
            map2.put("name",basePatientDO.getName());//姓名
            map2.put("cardTypeName","身份证");
            map2.put("idcard",basePatientDO.getIdcard());//身份证
            PatientMedicareCardDO patientMedicareCard = patientMedicareCardService.findByTypeAndPatientCodeAndDel(PatientMedicareCardDO.Type.MedicareCard.getType(),patient,"1");
            PatientMedicareCardDO patientMedicareCard = patientMedicareCardService.findByTypeAndPatientCodeAndDel(PatientMedicareCardDO.Type.MedicareCard.getType(),basePatientDO.getId(),"1");
            if(patientMedicareCardDO!=null){
                map2.put("principalNum",patientMedicareCard.getCode());//社保卡号
@ -407,14 +436,19 @@ public class MyFamilyService {
                map2.put("principalNum","");//社保卡号
            }
            map2.put("mobile",basePatientDO.getMobile());//手机号码
            if(StringUtils.isEmpty(packageId)){
                if(packageService.findPatientSignExist(patient,packageId)){
            if(!StringUtils.isEmpty(packageId)){
                if(packageService.findPatientSignExist(basePatientDO.getId(),packageId)){
                    map2.put("isPackage",1);
                }else{
                    map2.put("isPackage",0);
                }
            }
            map2.put("photo",basePatientDO.getPhoto());//头像
            map2.put("role",role.get(one.getFamilyRelation()-1));//角色
            //判断家人是否授权
            BasePatientFamilyMemberDO o = patientFamilyMemberService.findByPatientAndFamilyMemberAndDel(one.getFamilyMember(),one.getPatient());
            map2.put("isAuthorize",o.getIsAuthorize());//授权
            resultList.add(map2);
        }
        return resultList;
@ -567,6 +601,19 @@ public class MyFamilyService {
        }
    }
    /**
     * 根据身份判断是否未成年
     * @param idcard
     */
    public Integer nonageByIdcard(String idcard){
        Integer age = IdCardUtil.getAgeForIdcard(idcard);
        if(age>18){
            return 1;
        }else {
            return 0;
        }
    }
    /**
     * 家庭关系转换

+ 48 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -120,7 +120,8 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
     * @param time 预注册过期时间 例如: 2 , 则2分钟过期
     * @return
     */
    public Map<String,Object> bespeakRegist(String mobile,long time){
    @Transactional(rollbackFor = Exception.class)
    public Map<String,Object> bespeakRegist(String mobile,String name,String idcard,long time){
        Map<String, Object> map = new HashMap<>();
        boolean b = CommonUtils.isMobile(mobile);
@ -150,6 +151,8 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
            patient.setDel("0");
            patient.setLoginFailureCount(0);
            patient.setPatientStatus("1");
            patient.setName(name);
            patient.setIdcard(idcard);
            patient = this.save(patient);
        }else{
            patient = list.get(0);
@ -178,6 +181,7 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
        }
        patient.setSalt(randomString(5));
        patient.setPassword(MD5.md5Hex(newPassword + "{" + patient.getSalt() + "}"));
        save(patient);
        return ConstantUtils.SUCCESS;
    }
@ -291,7 +295,7 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
     */
    public boolean existsByIdcard(String idcard) {
        Preconditions.checkNotNull(idcard, "身份证不可为空");
        return basePatientDao.existsByIdcard(idcard);
        return basePatientDao.existsByIdcardAndDel(idcard,"1");
    }
@ -329,4 +333,46 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
        }
        return patient;
    }
    public Map<String,Object> forget(String mobile, String password, String captcha) {
        Map<String, Object> map = new HashMap<>();
        //增加密码
        if (password.length() < 6 || password.length() > 20) {
            map.put("code", -1);
            map.put("message", "密码长度需为6-20位");
            return map;
        }
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile, "1");
        if (CollectionUtils.isEmpty(list)) {
            map.put("code", -1);
            map.put("message", "该手机号暂未注册!");
            return map;
        }else if(list.size()>1){
            map.put("code", -1);
            map.put("message", "该手机号对应多个账号,请联系管理员");
            return map;
        }
        BasePatientDO patient = list.get(0);
        // 对验证码进行校验
        int res = baseSmsService.check(mobile, 2, captcha);
        if (-2 == res) {
            map.put("code", -1);
            map.put("message", "验证码已过期!");
            return map;
        } else if (-1 == res) {
            map.put("code", -1);
            map.put("message", "请输入正确的验证码!");
            return map;
        } else if (0 == res) {
            map.put("code", -1);
            map.put("message", "验证码无效!");
            return map;
        } else {
            resetPassword(patient.getId(), password);
            map.put("code", 1);
            map.put("message", "设置成功!");
        }
        return map;
    }
}

+ 90 - 13
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

@ -2,12 +2,16 @@ package com.yihu.jw.patient.service.servicepackage;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.label.PatientLabelDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.label.PatientLabelDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.servicepackage.ServicePackageDao;
import com.yihu.jw.patient.dao.servicepackage.ServicePackageItemDao;
@ -27,7 +31,6 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@ -40,9 +43,6 @@ public class PackageService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private UserAgent userAgent;
    @Autowired
    private ServicePackageDao servicePackageDao;
@ -55,6 +55,9 @@ public class PackageService {
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
@ -64,7 +67,10 @@ public class PackageService {
    @Autowired
    private MyFamilyService myFamilyService;
    public MixEnvelop findPackageService(String city,String labelCode,String labelType,Integer page,Integer size){
    @Autowired
    private PatientLabelDao patientLabelDao;
    public MixEnvelop findPackageService(String city,String labelCode,String labelType,String patient,Integer page,Integer size){
        String totalSql ="SELECT " +
                " count(1) as total " +
@ -101,7 +107,8 @@ public class PackageService {
                " p.price, " +
                " p.organization," +
                " p.organization_name AS organizationName," +
                " p.level " +
                " p.level," +
                " P.end_time AS endTime" +
                " FROM " +
                " base_service_package p " ;
                if(StringUtils.isNotBlank(labelCode)&&StringUtils.isNotBlank(labelType)){
@ -117,6 +124,20 @@ public class PackageService {
        sql +=  "ORDER BY p.sort ASC LIMIT " + (page - 1) * size + "," + size + "";
        List<ServicePackageVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServicePackageVO.class));
        //判断是否签约
        if(StringUtils.isNotBlank(patient)){
            if(list!=null&&list.size()>0){
                for(ServicePackageVO servicePackageVO:list){
                    if(findPatientSignExist(patient,servicePackageVO.getId())){
                        servicePackageVO.setSignType(1);
                    }else {
                        servicePackageVO.setSignType(0);
                    }
                }
            }
        }
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
@ -156,14 +177,14 @@ public class PackageService {
                    "    POW( " +
                    "     SIN( " +
                    "      ( " +
                    "       "+longitude+" * PI() / 180 - o.latitude * PI() / 180 " +
                    "       "+latitude+" * PI() / 180 - o.latitude * PI() / 180 " +
                    "      ) / 2 " +
                    "     ), " +
                    "     2 " +
                    "    ) + COS("+longitude+" * PI() / 180) * COS(o.latitude * PI() / 180) * POW( " +
                    "    ) + COS("+latitude+" * PI() / 180) * COS(o.latitude * PI() / 180) * POW( " +
                    "     SIN( " +
                    "      ( " +
                    "       "+latitude+" * PI() / 180 - o.longitude * PI() / 180 " +
                    "       "+longitude+" * PI() / 180 - o.longitude * PI() / 180 " +
                    "      ) / 2 " +
                    "     ), " +
                    "     2 " +
@ -231,10 +252,25 @@ public class PackageService {
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
    }
    public Envelop signPackageAndFamily(ServicePackageSignRecordDO recordDO,String patient, String familyMobile, Integer platform, Integer familyBindRole,
                                        Integer isAdult,String familyName,String principalNum,String idcard) throws Exception{
        //1.绑定家人
        myFamilyService.signBindFamily(patient,familyMobile,platform,familyBindRole,isAdult,familyName,principalNum,idcard);
        //2.服务签约
        servicePackageSignRecordDao.save(recordDO);
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
    }
    public BaseDoctorDO findDoctorById(String doctorCode){
        return baseDoctorDao.findOne(doctorCode);
    }
    public List<BaseDoctorHospitalDO> findDoctorHospital(String doctor){
        return baseDoctorHospitalDao.findByDoctorCode(doctor);
    }
    public BaseOrgDO findOrgByCode(String orgCode){
        return baseOrgDao.findByCode(orgCode);
    }
@ -350,17 +386,16 @@ public class PackageService {
                }else if("3".equals(familyModel)){
                    //查询已经授权,自己创建和家人相关记录
                    if(StringUtils.isNotBlank(patient)&&StringUtils.isNotBlank(operator)){
                        sql +=" AND (r.operator = '"+operator+"' " +
                                " OR r.patient = '"+patient+"' )";
                        sql +=" AND r.patient = '"+patient+"'";
                    }
                }
                if(status != null){
                    sql +=" AND r.`status` ="+status;
                }
                if(StringUtils.isNotBlank(isHos)){
                    sql +=" AND r.`status` < 0 ";
                    sql +=" AND r.`status` < -1 ";
                }else{
                    sql +=" AND r.`status` >= 0 ";
                    sql +=" AND r.`status` >= -1 ";
                }
                if(StringUtils.isNotBlank(label)&&StringUtils.isNotBlank(labelType)){
@ -374,4 +409,46 @@ public class PackageService {
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
    public ServicePackageRecordVO findSingleSignPackageById(String signId){
        String sql="SELECT " +
                " r.id, " +
                " r.saas_id AS saasId," +
                " p.id AS servicePackageId, " +
                " p.name AS servicePackageName, " +
                " r.patient," +
                " r.name," +
                " r.idcard," +
                " r.sign_doctor AS signDoctor, " +
                " r.sign_doctor_name AS signDoctorName, " +
                " r.ssc," +
                " r.hospital," +
                " r.hospital_name AS hospitalName," +
                " r.admin_team_code AS adminTeamCode," +
                " r.price," +
                " r.start_time AS startTime," +
                " r.end_time AS endTime," +
                " r.status," +
                " r.doctor_team_code AS doctorTeamCode," +
                " r.operator," +
                " r.create_time AS createTime," +
                " r.sort," +
                " p.introduce, " +
                " p.end_introduce AS endIntroduce," +
                " r.cancel_reason," +
                " r.review_reason " +
                " FROM " +
                " base_service_package_sign_record r  " +
                " JOIN base_service_package p ON r.service_package_id = p.id " +
                " WHERE r.id='"+signId+"'";
        List<ServicePackageRecordVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServicePackageRecordVO.class));
        if(list!=null&&list.size()>0){
            return list.get(0);
        }
        return null;
    }
    public List<PatientLabelDO> findLabelByLabelType(String labelType){
       return patientLabelDao.findByLabelTypeAndStatus(labelType,1);
    }
}