LiTaohong 6 rokov pred
rodič
commit
d2f301b1eb

+ 27 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageDO.java

@ -84,10 +84,13 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    private String name;//服务包名称
    private Integer num;//服务项数量
    private Long price;//预售价//单位分
    private String organization;//发布机构
    private String organizationName;//发布机构名称
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    private String creater;//创建者
    private Date createTime;//创建时间
    private String introduce;//服务介绍
    private String endIntroduce;//过期时间说明
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Integer del;//是否有效(1有效,0失效)
    private Integer sort;//排序
@ -213,4 +216,28 @@ public class ServicePackageDO extends UuidIdentityEntity implements Serializable
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getEndIntroduce() {
        return endIntroduce;
    }
    public void setEndIntroduce(String endIntroduce) {
        this.endIntroduce = endIntroduce;
    }
    public String getOrganization() {
        return organization;
    }
    public void setOrganization(String organization) {
        this.organization = organization;
    }
    public String getOrganizationName() {
        return organizationName;
    }
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
}

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

@ -19,10 +19,13 @@ public class ServicePackageVO {
    private String name;//服务包名称
    private Integer num;//服务项数量
    private Long price;//预售价//单位分
    private String organization;//上架机构
    private String organizationName;//上架机构名称
    private String level;//服务包级别(0系统,1.医生,2团队,3社区,4区)
    private String creater;//创建者
    private Date createTime;//创建时间
    private String introduce;//服务介绍
    private String endIntroduce;//过期描述
    private String status;//审核状态(预留字段0待审核,1审核通过,2审核不通过)
    private Integer del;//是否有效(1有效,0失效)
@ -132,6 +135,14 @@ public class ServicePackageVO {
        this.introduce = introduce;
    }
    public String getEndIntroduce() {
        return endIntroduce;
    }
    public void setEndIntroduce(String endIntroduce) {
        this.endIntroduce = endIntroduce;
    }
    public String getStatus() {
        return status;
    }
@ -155,4 +166,20 @@ public class ServicePackageVO {
    public void setItems(List<SerivePackageItemVO> items) {
        this.items = items;
    }
    public String getOrganization() {
        return organization;
    }
    public void setOrganization(String organization) {
        this.organization = organization;
    }
    public String getOrganizationName() {
        return organizationName;
    }
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }
}

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

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

+ 7 - 5
gateway/ag-basic/src/main/resources/application.yml

@ -38,18 +38,20 @@ zuul:
  sensitive-headers:
  routes:
    svr-iot:
      path: /iot/**
      path: /cityihealth/iot/**
      serviceId: svr-iot
    svr-base:
      path: /base/**
      path: /cityihealth/base/**
      serviceId: svr-base
    svr-authentication:
      path: /auth/**
      path: /cityihealth/auth/**
      serviceId: svr-authentication
    svr-healthy-house:
      path: /healthyHouse/**
      path: /cityihealth/healthyHouse/**
      serviceId: svr-healthy-house
    svr-patient:
      path: /cityihealth/patient/**
      serviceId: svr-patient
---
spring:

+ 43 - 4
svr/svr-base/pom.xml

@ -60,8 +60,8 @@
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-zipkin</artifactId>-->
        <!--<groupId>org.springframework.cloud</groupId>-->
        <!--<artifactId>spring-cloud-starter-zipkin</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
@ -98,8 +98,8 @@
            <artifactId>common-web</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu.jw</groupId>-->
            <!--<artifactId>common-tracer</artifactId>-->
        <!--<groupId>com.yihu.jw</groupId>-->
        <!--<artifactId>common-tracer</artifactId>-->
        <!--</dependency>-->
        <!-- 文件服务器 -->
        <dependency>
@ -118,6 +118,11 @@
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>elasticsearch-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
@ -131,7 +136,41 @@
            </exclusions>
        </dependency>
        <!-- 发送邮件 -->
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 start-->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.yihu.ehr</groupId>
                    <artifactId>commons-util</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-collections4</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
        </dependency>
        <!-- xlsx  依赖这个包 -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>

+ 6 - 41
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java

@ -107,50 +107,15 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list!=null && list.size()> 0){
            envelop.setMessage("该手机号已经注册!");
        Map<String, Object> result = patientService.regis(mobile, captcha, password, openid);
        if("-1".equals(result.get("code"))){
            envelop.setStatus(-1);
            return envelop;
        }
        // 对验证码进行校验
        int res = baseSmsService.check(mobile, 0, captcha);
        if(-2 == res){
            envelop.setMessage("验证码已过期!");
            envelop.setStatus(-1);
            return envelop;
        }else if(-1 == res){
            envelop.setMessage("请输入正确的验证码!");
            envelop.setStatus(-1);
            return envelop;
        }else if(0 == res){
            envelop.setMessage("验证码无效!");
            envelop.setStatus(-1);
            return envelop;
        } else{
            BasePatientDO patient = new BasePatientDO();
            patient.setMobile(mobile);
            if(StringUtils.isNotBlank(password)){
                //增加密码
                String salt = UUID.randomUUID().toString().replace("-", "");
                patient.setSalt(salt);
                password = rsaService.decryptString(password);
                password = StringUtils.reverse(password);
                if(password.length()<6 || password.length()>20){
                    envelop.setMessage("密码长度需为6-20位");
                    envelop.setStatus(-1);
                    return envelop;
                }
                patient.setPassword(MD5.GetMD5Code(password + salt));
            }
            if(!"undefined".equals(openid) && StringUtils.isNotBlank(openid)){
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }
            patient.setDel("1");
            patient.setPatientStatus("1");
            patientService.save(patient);
            envelop.setMessage("注册成功");
            envelop.setMessage(result.get("message")+"");
        }else{
            envelop.setStatus(200);
            return envelop;
            envelop.setMessage(result.get("message")+"");
        }
        return envelop;
    }
    /**

+ 67 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -9,8 +9,10 @@ import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.personal_info.PatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.patient.util.CommonUtils;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.patient.util.RSAService;
import com.yihu.jw.sms.service.BaseSmsService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
@ -25,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.*;
/**
 * 居民信息服务
@ -45,6 +48,70 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
    @Value("fastDFS.fastdfs_file_url")
    private String fastdfsUrl;
    @Autowired
    private RSAService rsaService;
    public Map<String,Object> regis(String mobile, String captcha, String password, String openid){
        Map<String, Object> map = new HashMap<>();
        boolean b = CommonUtils.isMobile(mobile);
        if(!b){
            map.put("code",-1);
            map.put("message","手机号码格式不正确");
            return map;
        }
        //验证手机是否被注册
        List<BasePatientDO> list = patientDao.findByMobileAndDel(mobile,"1");
        if(list!=null && list.size()> 0){
            map.put("code",-1);
            map.put("message","该手机号已经注册!");
            return map;
        }
        // 对验证码进行校验
        int res = baseSmsService.check(mobile, 0, 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{
            BasePatientDO patient = new BasePatientDO();
            patient.setMobile(mobile);
            if(org.apache.commons.lang.StringUtils.isNotBlank(password)){
                //增加密码
                String salt = UUID.randomUUID().toString().replace("-", "");
                patient.setSalt(salt);
                password = rsaService.decryptString(password);
                password = org.apache.commons.lang.StringUtils.reverse(password);
                if(password.length()<6 || password.length()>20){
                    map.put("code",-1);
                    map.put("message","密码长度需为6-20位");
                    return map;
                }
                patient.setPassword(com.yihu.jw.util.security.MD5.GetMD5Code(password + salt));
            }
            if(!"undefined".equals(openid) && org.apache.commons.lang.StringUtils.isNotBlank(openid)){
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }
            patient.setDel("1");
            patient.setPatientStatus("1");
            this.save(patient);
            map.put("code",1);
            map.put("message","注册成功");
            return map;
        }
    }
    /**
     * 设置登录密码/修改密码
     * @param id

+ 3 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

@ -84,9 +84,12 @@ public class PackageService {
                " p.city_code AS cityCode, " +
                " p.city_name AS cityName, " +
                " p.introduce AS introduce, " +
                " p.end_introduce AS endIntroduce," +
                " p.`name` , " +
                " p.num , " +
                " p.price, " +
                " p.organization," +
                " p.organization_name AS organizationName," +
                " p.level " +
                " FROM " +
                " base_service_package p " ;