Browse Source

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 6 years ago
parent
commit
aeb9a37005
19 changed files with 999 additions and 28 deletions
  1. 5 5
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java
  2. 45 0
      business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java
  3. 2 4
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java
  4. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  5. 9 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
  6. 83 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorOrgVO.java
  7. 374 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/doctor/BaseDoctorSimpleVO.java
  8. 56 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/OrgDistanceVO.java
  9. 53 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/SerivePackageItemVO.java
  10. 149 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/patient/signPackage/ServicePackageVO.java
  11. 3 2
      svr/svr-base/pom.xml
  12. 3 3
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorDao.java
  13. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  14. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  15. 11 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageDao.java
  16. 16 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageItemDao.java
  17. 12 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageSignRecordDao.java
  18. 109 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/sericePackage/PackageServiceEndpoint.java
  19. 58 12
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicePackage/PackageService.java

+ 5 - 5
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java

@ -5,10 +5,10 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
/**
 * 
 *
 * 医生基础信息 数据库访问层
 * 医生基础信息 数据库访问层
 * 
 * @version 
 *
 * @version
 * <pre>
 * <pre>
 * Author	Version		Date		Changes
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 * litaohong 	1.0  		2018年08月31日 	Created
@ -16,7 +16,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * </pre>
 * </pre>
 * @since 1.
 * @since 1.
 */
 */
/*
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
}*/
}

+ 45 - 0
business/base-service/src/main/java/com/yihu/jw/org/dao/BaseOrgDao.java

@ -0,0 +1,45 @@
package com.yihu.jw.org.dao;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Map;
/**
 * 
 * 机构信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseOrgDao extends PagingAndSortingRepository<BaseOrgDO, String>, JpaSpecificationExecutor<BaseOrgDO>  {
    @Query(value="select b.* from base_org b where b.code= ?1 and b.saasid= ?2 limit 1",nativeQuery = true)
    BaseOrgDO findByCodeAndSaasId(String code, String saasId);
    boolean existsByCode(String code);
    BaseOrgDO findByCode(String code);
    @Modifying
    @Query("delete from BaseOrgDO p where p.saasid=?1 ")
    void deleteBySaasId(String saasId);
    @Query("select id from BaseOrgDO where del = 1 and saasid = ?1")
    List findOrgCodeBySaasId(String saasId);
   /* @Query("select code as code,name as name from BaseOrgDO where del = 1 and saasid = ?1 ")
    List<Map<String,Object>> findOrgListBySaasId(String saasId);*/
    @Query("select code as code,name as name from BaseOrgDO where del = 1")
    List<Map<String,Object>> findOrgListBySaasId();
}

+ 2 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -20,10 +20,8 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    public enum Level {
    public enum Level {
        system("系统", "0"),
        system("系统", "0"),
        doctor("医生", "1"),
        team("团队", "2"),
        hospital("社区", "3"),
        town("区", "4");
        hospital("社区", "1"),
        saas("租户", "2");
        private String name;
        private String name;
        private String value;
        private String value;

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

@ -61,6 +61,7 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    private Date endTime;//服务结束时间
    private Date endTime;//服务结束时间
    private String status;//状态(1新建,2已完成)
    private String status;//状态(1新建,2已完成)
    private String doctorTeamCode;//医生服务团队code
    private String doctorTeamCode;//医生服务团队code
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
    private Date createTime;//创建时间
    @Column(name = "saas_id")
    @Column(name = "saas_id")
@ -217,4 +218,12 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    public void setCreateTime(Date createTime) {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
        this.createTime = createTime;
    }
    }
    public String getOperator() {
        return operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
}
}

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

@ -22,6 +22,15 @@ public class PatientRequestMapping {
     */
     */
    public static class SignPackage extends Basic {
    public static class SignPackage extends Basic {
        public static final String PREFIX  = "/signPackage";
        public static final String PREFIX  = "/signPackage";
        public static final String api_success ="success";
        public static final String findPackageService  = "/findPackageService";
        public static final String findServicePackageByPackageId  = "/findServicePackageByPackageId";
        public static final String findOrgByPackageId  = "/findOrgByPackageId";
        public static final String findDoctorByOrg  = "/findDoctorByOrg";
        public static final String signPackage  = "/signPackage";
        public static final String findDoctorById  = "/findDoctorById";
        public static final String findOrgById  = "/findOrgById";
    }
    }

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

@ -0,0 +1,83 @@
package com.yihu.jw.restmodel.base.doctor;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/11/28.
 */
@ApiModel(value = "BaseDoctorOrgVO", description = "获取签约医生")
public class BaseDoctorOrgVO {
    private String id;
    private String name;
    private String jobTitleCode;
    private String jobTitleName;
    private String deptName;
    private String deptCode;
    private String introduce;
    private String photo;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getJobTitleCode() {
        return jobTitleCode;
    }
    public void setJobTitleCode(String jobTitleCode) {
        this.jobTitleCode = jobTitleCode;
    }
    public String getJobTitleName() {
        return jobTitleName;
    }
    public void setJobTitleName(String jobTitleName) {
        this.jobTitleName = jobTitleName;
    }
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
}

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

@ -0,0 +1,374 @@
package com.yihu.jw.restmodel.base.doctor;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * Created by Trick on 2018/11/29.
 */
public class BaseDoctorSimpleVO {
    private String id;
    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名", example = "张三")
    private String name;
    /**
     * 性别(1男,2女) 用国家标准字典
     */
    @ApiModelProperty(value = "性别(1男,2女,整型 用国家标准字典", example = "1")
    private Integer sex;
    /**
     * 医生专长
     */
    @ApiModelProperty(value = "医生专长", example = "擅长....")
    private String expertise;
    /**
     * 医生介绍
     */
    @ApiModelProperty(value = "医生介绍", example = "....")
    private String introduce;
    /**
     *  身份证
     */
    @ApiModelProperty(value = " 身份证", example = "350.....")
    private String idcard;
    /**
     * 生日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @ApiModelProperty(value = "生日", example = "yyyy-MM-dd HH:mm:ss")
    private Date birthday;
    /**
     * 头像http地址
     */
    @ApiModelProperty(value = "头像http地址", example = "")
    private String photo;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", example = "")
    private String mobile;
    /**
     * 医生二维码
     */
    @ApiModelProperty(value = "医生二维码", example = "")
    private String qrcode;
    /**
     * 省代码
     */
    @ApiModelProperty(value = "省代码", example = "参考省代码")
    private String provinceCode;
    /**
     * 省名称
     */
    @ApiModelProperty(value = "省名称", example = "某某省")
    private String provinceName;
    /**
     * 市代码
     */
    @ApiModelProperty(value = "市代码", example = "参考市代码")
    private String cityCode;
    /**
     * 市名称
     */
    @ApiModelProperty(value = "市名称", example = "某某市")
    private String cityName;
    /**
     * 区县代码
     */
    @ApiModelProperty(value = "区县代码", example = "参考区县代码")
    private String townCode;
    /**
     * 区县名称
     */
    @ApiModelProperty(value = "区县名称", example = "某某区县")
    private String townName;
    /**
     * 街道代码
     */
    @ApiModelProperty(value = "街道代码", example = "参考街道代码")
    private String streetCode;
    /**
     * 街道名称
     */
    @ApiModelProperty(value = "街道名称", example = "某某街道")
    private String streetName;
    /**
     * 资格是否认证通过,1是,0否
     */
    @ApiModelProperty(value = "资格是否认证通过,1是,0否", example = "1")
    private String iscertified;
    /**
     * 是否是名医,1是,0否
     */
    @ApiModelProperty(value = "是否是名医,1是,0否,整型", example = "0")
    private Integer isFamous;
    /**
     * 是否提示设置密码  1 提示过 0未提示
     */
    @ApiModelProperty(value = "是否提示设置密码  1 提示过 0未提示", example = "0")
    private String isPasswordPrompt;
    /**
     * 名称拼音首字母
     */
    @ApiModelProperty(value = "名称拼音首字母", example = "")
    private String spell;
    /**
     * CA证书过期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @ApiModelProperty(value = "CA证书过期时间", example = "yyyy-MM-dd HH:mm:ss")
    private Date certifiedOvertime;
    /**
     * CA证书编号
     */
    @ApiModelProperty(value = "CA证书编号", example = "实际证书编号")
    private String certificateNum;
    /**
     * 用户微信openid
     */
    @ApiModelProperty(value = "用户微信openid", example = "填上微信那边分配给用户的")
    private String openid;
    /**
     * 作废标识,1正常,0作废
     */
    @ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getExpertise() {
        return expertise;
    }
    public void setExpertise(String expertise) {
        this.expertise = expertise;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getQrcode() {
        return qrcode;
    }
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getCityCode() {
        return cityCode;
    }
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getTownCode() {
        return townCode;
    }
    public void setTownCode(String townCode) {
        this.townCode = townCode;
    }
    public String getTownName() {
        return townName;
    }
    public void setTownName(String townName) {
        this.townName = townName;
    }
    public String getStreetCode() {
        return streetCode;
    }
    public void setStreetCode(String streetCode) {
        this.streetCode = streetCode;
    }
    public String getStreetName() {
        return streetName;
    }
    public void setStreetName(String streetName) {
        this.streetName = streetName;
    }
    public String getIscertified() {
        return iscertified;
    }
    public void setIscertified(String iscertified) {
        this.iscertified = iscertified;
    }
    public Integer getIsFamous() {
        return isFamous;
    }
    public void setIsFamous(Integer isFamous) {
        this.isFamous = isFamous;
    }
    public String getIsPasswordPrompt() {
        return isPasswordPrompt;
    }
    public void setIsPasswordPrompt(String isPasswordPrompt) {
        this.isPasswordPrompt = isPasswordPrompt;
    }
    public String getSpell() {
        return spell;
    }
    public void setSpell(String spell) {
        this.spell = spell;
    }
    public Date getCertifiedOvertime() {
        return certifiedOvertime;
    }
    public void setCertifiedOvertime(Date certifiedOvertime) {
        this.certifiedOvertime = certifiedOvertime;
    }
    public String getCertificateNum() {
        return certificateNum;
    }
    public void setCertificateNum(String certificateNum) {
        this.certificateNum = certificateNum;
    }
    public String getOpenid() {
        return openid;
    }
    public void setOpenid(String openid) {
        this.openid = openid;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 56 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/OrgDistanceVO.java

@ -0,0 +1,56 @@
package com.yihu.jw.restmodel.base.org;
import io.swagger.annotations.ApiModel;
/**
 * Created by Trick on 2018/11/28.
 */
@ApiModel(value = "OrgDistanceVO", description = "机构信息(医院)带距离")
public class OrgDistanceVO {
    private String code;
    private String name;
    private String address;
    private String distance;
    private String photo;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getDistance() {
        return distance;
    }
    public void setDistance(String distance) {
        this.distance = distance;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
}

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

@ -0,0 +1,53 @@
package com.yihu.jw.restmodel.patient.signPackage;
/**
 * Created by Trick on 2018/11/29.
 */
public class SerivePackageItemVO {
    private String id;
    private String servicePackageId;//服务包ID
    private String itemName;//服务包名称
    private Double price;//价格
    private String times;//次数/频次
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getServicePackageId() {
        return servicePackageId;
    }
    public void setServicePackageId(String servicePackageId) {
        this.servicePackageId = servicePackageId;
    }
    public String getItemName() {
        return itemName;
    }
    public void setItemName(String itemName) {
        this.itemName = itemName;
    }
    public Double getPrice() {
        return price;
    }
    public void setPrice(Double price) {
        this.price = price;
    }
    public String getTimes() {
        return times;
    }
    public void setTimes(String times) {
        this.times = times;
    }
}

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

@ -0,0 +1,149 @@
package com.yihu.jw.restmodel.patient.signPackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import java.util.Date;
import java.util.List;
/**
 * Created by Trick on 2018/11/27.
 */
public class ServicePackageVO {
    private String provinceCode;
    private String provinceName;
    private String cityCode;
    private String cityName;
    private String saasId;
    private String name;//服务包名称
    private Integer num;//服务项数量
    private Long price;//预售价//单位分
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    private String creater;//创建者
    private Date createTime;//创建时间
    private String introduce;//服务介绍
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Integer del;//是否有效(1有效,0失效)
    private List<SerivePackageItemVO> items;//服务项描述
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getCityCode() {
        return cityCode;
    }
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
    public String getCityName() {
        return cityName;
    }
    public void setCityName(String cityName) {
        this.cityName = cityName;
    }
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getNum() {
        return num;
    }
    public void setNum(Integer num) {
        this.num = num;
    }
    public Long getPrice() {
        return price;
    }
    public void setPrice(Long price) {
        this.price = price;
    }
    public String getLevel() {
        return level;
    }
    public void setLevel(String level) {
        this.level = level;
    }
    public String getCreater() {
        return creater;
    }
    public void setCreater(String creater) {
        this.creater = creater;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getIntroduce() {
        return introduce;
    }
    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    public List<SerivePackageItemVO> getItems() {
        return items;
    }
    public void setItems(List<SerivePackageItemVO> items) {
        this.items = items;
    }
}

+ 3 - 2
svr/svr-base/pom.xml

@ -177,12 +177,13 @@
            <version>RELEASE</version>
            <version>RELEASE</version>
            <scope>compile</scope>
            <scope>compile</scope>
        </dependency>
        </dependency>
        <dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <groupId>com.yihu.jw</groupId>
            <artifactId>patient-service</artifactId>
            <artifactId>base-service</artifactId>
            <version>2.0.0</version>
            <version>2.0.0</version>
            <scope>compile</scope>
        </dependency>
        </dependency>
        <dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <groupId>com.yihu.jw</groupId>
            <artifactId>sms-service</artifactId>
            <artifactId>sms-service</artifactId>

+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/dao/doctor/BaseDoctorDao.java

@ -21,6 +21,6 @@ import java.util.Map;
 * </pre>
 * </pre>
 * @since 1.
 * @since 1.
 */
 */
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
}
//public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
//
//}

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

@ -7,7 +7,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
import com.yihu.jw.base.service.dict.DictDoctorDutyService;
@ -22,6 +21,7 @@ import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.base.util.JavaBeanUtils;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
spring:
  application:
  application:
    name: svr-base-lith
    name: svr-base
  cloud:
  cloud:
    config:
    config:
      failFast: true
      failFast: true

+ 11 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.patient.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2018/11/29.
 */
public interface ServicePackageDao extends PagingAndSortingRepository<ServicePackageDO, String>, JpaSpecificationExecutor<ServicePackageDO> {
}

+ 16 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageItemDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.patient.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageItemDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/11/29.
 */
public interface ServicePackageItemDao extends PagingAndSortingRepository<ServicePackageItemDO, String>, JpaSpecificationExecutor<ServicePackageItemDO> {
    List<ServicePackageItemDO> findByServicePackageId(String servicePackageId);
}

+ 12 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageSignRecordDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.patient.dao.servicePackage;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2018/11/29.
 */
public interface ServicePackageSignRecordDao extends PagingAndSortingRepository<ServicePackageSignRecordDO, String>, JpaSpecificationExecutor<ServicePackageSignRecordDO> {
}

+ 109 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/sericePackage/PackageServiceEndpoint.java

@ -1,12 +1,35 @@
package com.yihu.jw.patient.endpoint.sericePackage;
package com.yihu.jw.patient.endpoint.sericePackage;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
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.doctor.BaseDoctorSimpleVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
import com.yihu.jw.restmodel.patient.signPackage.ServicePackageVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.base.WechatRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import io.swagger.annotations.Api;
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.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
/**
 * Created by Trick on 2018/11/27.
 * Created by Trick on 2018/11/27.
 */
 */
@ -15,4 +38,90 @@ import org.springframework.web.bind.annotation.RestController;
@Api(value = "居民服务包签约", description = "居民服务包签约", tags = {"居民端 - 居民服务包签约"})
@Api(value = "居民服务包签约", description = "居民服务包签约", tags = {"居民端 - 居民服务包签约"})
public class PackageServiceEndpoint extends EnvelopRestEndpoint {
public class PackageServiceEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PackageService packageService;
    @PostMapping(value = PatientRequestMapping.SignPackage.findPackageService, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取服务包", notes = "获取服务包")
    public MixEnvelop findPackageService(@ApiParam(name = "city", value = "城市代码")
                                         @RequestParam(value = "city", required = true)String city,
                                         @ApiParam(name = "labelCode", value = "标签code")
                                         @RequestParam(value = "labelCode", required = true)String labelCode,
                                         @ApiParam(name = "city", value = "城市代码")
                                         @RequestParam(value = "city", required = true)String labelType,
                                         @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);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.findServicePackageByPackageId, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取服务包详情", notes = "获取服务包详情")
    public ObjEnvelop<ServicePackageVO> findServicePackageByPackageId(@ApiParam(name = "packageId", value = "服务包id")
                                                          @RequestParam(value = "packageId", required = true)String packageId) {
        ServicePackageDO packageDO = packageService.findServicePackageByPackageId(packageId);
        ServicePackageVO packageVO = convertToModel(packageDO,ServicePackageVO.class);
        List<ServicePackageItemDO> itemDOs = packageService.findServicePackageItemByPackageId(packageId);
        List<SerivePackageItemVO> itemVOs = new ArrayList<>();
        convertToModels(itemDOs,itemVOs,SerivePackageItemVO.class);
        packageVO.setItems(itemVOs);
        return success(PatientRequestMapping.SignPackage.api_success,packageVO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.findOrgByPackageId, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取服务包执行机构", notes = "获取服务包执行机构")
    public MixEnvelop findOrgByPackageId(@ApiParam(name = "packageId", value = "服务包id")
                                         @RequestParam(value = "packageId", required = true)String packageId,
                                         @ApiParam(name = "latitude", value = "纬度")
                                         @RequestParam(value = "latitude", required = true)Double latitude,
                                         @ApiParam(name = "longitude", value = "经度")
                                         @RequestParam(value = "longitude", required = true)Double longitude,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        return packageService.findOrgByPackageId( packageId, latitude, longitude, page, size);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.findDoctorByOrg, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取机构下医生", notes = "获取机构下医生")
    public MixEnvelop findDoctorByOrg(@ApiParam(name = "org", value = "机构code")
                                      @RequestParam(value = "org", required = true)String org,
                                      @ApiParam(name = "page", value = "第几页")
                                      @RequestParam(value = "page", required = true)Integer page,
                                      @ApiParam(name = "size", value = "每页大小")
                                      @RequestParam(value = "size", required = true)Integer size) {
        return packageService.findDoctorByOrg( org,  page,  size);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.signPackage, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "签约服务包", notes = "签约服务包")
    public Envelop signPackage(@ApiParam(name = "recordJson", value = "签约实体")
                               @RequestParam(value = "recordJson", required = true)String recordJson) throws Exception{
        ServicePackageSignRecordDO recordDO = toEntity(recordJson, ServicePackageSignRecordDO.class);
        return packageService.signPackage(recordDO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.findDoctorById, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @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);
        return success(PatientRequestMapping.SignPackage.api_success,baseDoctorSimpleVO);
    }
    @PostMapping(value = PatientRequestMapping.SignPackage.findOrgById, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取机构基础信息详情", notes = "获取机构基础信息详情")
    public ObjEnvelop<BaseOrgVO> findOrgById(@ApiParam(name = "orgId", value = "机构id")
                                 @RequestParam(value = "orgId", required = true)String orgId) {
        BaseOrgDO baseOrgDO =  packageService.findOrgById(orgId);
        BaseOrgVO baseOrgVO = convertToModel(baseOrgDO,BaseOrgVO.class);
        return success(PatientRequestMapping.SignPackage.api_success,baseOrgVO);
    }
//=================================
}
}

+ 58 - 12
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicePackage/PackageService.java

@ -1,7 +1,15 @@
package com.yihu.jw.patient.service.servicePackage;
package com.yihu.jw.patient.service.servicePackage;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
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.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.patient.dao.servicePackage.ServicePackageDao;
import com.yihu.jw.patient.dao.servicePackage.ServicePackageItemDao;
import com.yihu.jw.patient.dao.servicePackage.ServicePackageSignRecordDao;
import com.yihu.jw.patient.useragent.UserAgent;
import com.yihu.jw.patient.useragent.UserAgent;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorOrgVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorOrgVO;
import com.yihu.jw.restmodel.base.org.OrgDistanceVO;
import com.yihu.jw.restmodel.base.org.OrgDistanceVO;
@ -37,17 +45,34 @@ public class PackageService {
    @Autowired
    @Autowired
    private ServicePackageDao servicePackageDao;
    private ServicePackageDao servicePackageDao;
    public MixEnvelop findPackageService(String city,String labelCode,Integer page,Integer size){
    @Autowired
    private ServicePackageItemDao servicePackageItemDao;
    @Autowired
    private ServicePackageSignRecordDao servicePackageSignRecordDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    public MixEnvelop findPackageService(String city,String labelCode,String labelType,Integer page,Integer size){
        String totalSql ="SELECT " +
        String totalSql ="SELECT " +
                " count(1) as total " +
                " count(1) as total " +
                " FROM " +
                " FROM " +
                " base_service_package p " ;
                " base_service_package p " ;
        if(StringUtils.isNotBlank(labelCode)){
        if(StringUtils.isNotBlank(labelCode)&&StringUtils.isNotBlank(labelType)){
            totalSql +=" JION base_package_label_info l ON l.service_package_id = p.id ";
            totalSql +=" JION base_package_label_info l ON l.service_package_id = p.id ";
        }
        }
        totalSql +=  " WHERE " +
        totalSql +=  " WHERE " +
                " p.city_code = '"+city+"' ";
                " p.city_code = '"+city+"' " +
                " AND p.del =1 ";
        if(StringUtils.isNotBlank(labelCode)&&StringUtils.isNotBlank(labelType)){
            totalSql += " ADN l.label_code='"+labelCode+"'" +
                        " AND l.label_type='"+labelType+"' ";
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        Long count = 0L;
        Long count = 0L;
@ -69,17 +94,32 @@ public class PackageService {
                " p.level " +
                " p.level " +
                " FROM " +
                " FROM " +
                " base_service_package p " ;
                " base_service_package p " ;
                if(StringUtils.isNotBlank(labelCode)){
                if(StringUtils.isNotBlank(labelCode)&&StringUtils.isNotBlank(labelType)){
                    sql+=" JION base_package_label_info l ON l.service_package_id = p.id ";
                    sql+=" JION base_package_label_info l ON l.service_package_id = p.id ";
                }
                }
        sql+=  " WHERE " +
               " p.city_code = '"+city+"' " +
                " LIMIT " + (page - 1) * size + "," + size + "";
        sql+=   " WHERE " +
                " p.city_code = '"+city+"' " +
                " AND p.del =1 ";
        if(StringUtils.isNotBlank(labelCode)&&StringUtils.isNotBlank(labelType)){
            sql +=  " ADN l.label_code='"+labelCode+"'" +
                    " AND l.label_type='"+labelType+"' ";
        }
        sql +=  " LIMIT " + (page - 1) * size + "," + size + "";
        List<ServicePackageVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServicePackageVO.class));
        List<ServicePackageVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ServicePackageVO.class));
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
    }
    public ServicePackageDO findServicePackageByPackageId(String packageId){
        ServicePackageDO servicePackageDO = servicePackageDao.findOne(packageId);
        return servicePackageDO;
    }
    public List<ServicePackageItemDO> findServicePackageItemByPackageId(String packageId){
        List<ServicePackageItemDO> itemDOs = servicePackageItemDao.findByServicePackageId(packageId);
        return itemDOs;
    }
    public MixEnvelop findOrgByPackageId(String packageId,Double latitude,Double longitude,Integer page,Integer size){
    public MixEnvelop findOrgByPackageId(String packageId,Double latitude,Double longitude,Integer page,Integer size){
        String totalSql ="SELECT " +
        String totalSql ="SELECT " +
@ -138,7 +178,7 @@ public class PackageService {
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
    }
    public MixEnvelop getDoctorByOrg(String org, Integer page, Integer size){
    public MixEnvelop findDoctorByOrg(String org, Integer page, Integer size){
        String totalSql ="SELECT " +
        String totalSql ="SELECT " +
                " count(1) as total" +
                " count(1) as total" +
@ -174,10 +214,16 @@ public class PackageService {
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
        return MixEnvelop.getSuccessListWithPage(PatientRequestMapping.SignPackage.api_success, list, page, size, count);
    }
    }
    public Envelop signPackage(ServicePackageDO servicePackageDO){
        servicePackageDO.setCreater(userAgent.getUID());
        servicePackageDO.setCreateTime(new Date());
        servicePackageDao.save(servicePackageDO);
    public Envelop signPackage(ServicePackageSignRecordDO recordDO){
        servicePackageSignRecordDao.save(recordDO);
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
        return Envelop.getSuccess(PatientRequestMapping.SignPackage.api_success);
    }
    }
    public BaseDoctorDO findDoctorById(String doctorCode){
        return baseDoctorDao.findOne(doctorCode);
    }
    public BaseOrgDO findOrgById(String orgId){
        return baseOrgDao.findOne(orgId);
    }
}
}