Browse Source

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

LiTaohong 6 years ago
parent
commit
d8636143ad
25 changed files with 505 additions and 147 deletions
  1. 42 0
      business/base-service/src/main/java/com/yihu/jw/dict/dao/DictHospitalDeptDao.java
  2. 6 4
      business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java
  3. 6 0
      business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java
  4. 0 1
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java
  5. 13 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  6. 1 1
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java
  7. 28 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java
  8. 3 31
      common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java
  9. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java
  10. 7 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/patient/PatientRequestMapping.java
  11. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/org/BaseOrgVO.java
  12. 44 44
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictHospitalDeptDao.java
  13. 6 9
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/open/register/RegisterEndpoint.java
  14. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictHospitalDeptService.java
  15. 3 11
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  16. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/excelImport/BaseDoctorExcelDOReader.java
  17. 5 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientApplyLogDao.java
  18. 5 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicepackage/ServicePackageSignRecordDao.java
  19. 115 6
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java
  20. 1 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java
  21. 17 4
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java
  22. 137 19
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java
  23. 29 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/PatientApplyLogService.java
  24. 5 12
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java
  25. 19 1
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

+ 42 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/DictHospitalDeptDao.java

@ -0,0 +1,42 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import org.springframework.data.domain.Pageable;
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;
/**
 * 
 * 医院科室字典 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface DictHospitalDeptDao extends PagingAndSortingRepository<DictHospitalDeptDO, Integer>, JpaSpecificationExecutor<DictHospitalDeptDO>  {
    @Query("select code as code,name as name from DictHospitalDeptDO where orgCode in ?1")
    List<Map<String,Object>> findByOrgCodeIn(String orgCode, Pageable pageable);
    @Query("select code as code,name as name from DictHospitalDeptDO")
    List<Map<String,Object>> findCodeAndName(Pageable pageable);
    List<DictHospitalDeptDO> findByOrgCode(String orgCode);
    List<DictHospitalDeptDO> findByOrgCodeIn(String orgCode);
    Long countByCodeIn(String orgCode);
    boolean existsByCodeAndOrgCode(String code, String orgCode);
    DictHospitalDeptDO findByCode(String code);
}

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

@ -1,12 +1,11 @@
package com.yihu.jw.message.dao;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -14,11 +13,14 @@ import java.util.List;
 */
public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, String>, JpaSpecificationExecutor<BaseMessageDO> {
    @Query("select m from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 order by m.readState desc")
    @Query("select m from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.type=2 order by m.readState desc")
    List<BaseMessageDO> messageList(Integer platform, String code, String saasId,String msgTypeCode);
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.readState=1")
    @Query("select count(m.id) from BaseMessageDO m where m.platform=?1 and m.receiver=?2 and m.saasId=?3 and m.del=1 and m.msgTypeCode like ?4 and m.type=2 and m.readState=1")
    Integer countMessage(Integer platform, String code, String saasId,String msgTypeCode);
    BaseMessageDO findById(Integer id);
    @Query("select m from BaseMessageDO m where m.receiver=?1 and m.type=1 and m.failureTime>=?2 and m.msgTypeCode=?3")
    List<BaseMessageDO> applyMessageList(String patient,Date failureTime,String msgTypeCode);
}

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

@ -9,6 +9,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -103,6 +104,11 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
    }
    public List<BaseMessageDO> applyMessageList(String patient, Date failureTime, String msgTypeCode){
        return messageDao.applyMessageList(patient,failureTime,msgTypeCode);
    }
    private List<Map<String, Object>> messageListSql(Integer platform,String code,String saasId,Integer readState,Integer page,Integer pageSize){

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

@ -17,7 +17,6 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    BasePatientDO findByIdAndDel(String id, String del);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,phone 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);

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

@ -176,4 +176,17 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        return basePatientDO;
    }
    /**
     * 根据patient的id获取居民信息
     * @param mobile
     * @return
     */
    public BasePatientDO findByMobileAndDel(String mobile) throws Exception{
        List<BasePatientDO> list = basePatientDao.findByMobileAndDel(mobile,"1");
        if(list.size()<=0){
            throw new Exception("not patient");
        }
        return list.get(0);
    }
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java

@ -21,7 +21,7 @@ import org.springframework.util.StringUtils;
import java.util.*;
/**
 * Created by Administrator on 2017/5/18 0018.
 * Created by Administrator on 2017/5/18
 */
@Service
public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAccessTokenDao> {

+ 28 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/message/BaseMessageDO.java

@ -117,6 +117,16 @@ public class BaseMessageDO extends IntegerIdentityEntity {
     */
    private String relationData;
    /**
     * 消息存续类型(1、时效性,2、非时效性)
     */
    private Integer type;
    /**
     * 消息失效时间
     */
    private Date failureTime;
    @Column(name = "saas_id")
    public String getSaasId() {
@ -297,4 +307,22 @@ public class BaseMessageDO extends IntegerIdentityEntity {
    public void setRelationData(String relationData) {
        this.relationData = relationData;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "failure_time")
    public Date getFailureTime() {
        return failureTime;
    }
    public void setFailureTime(Date failureTime) {
        this.failureTime = failureTime;
    }
}

+ 3 - 31
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServicePackageSignRecordDO.java

@ -16,34 +16,6 @@ import java.util.Date;
@Table(name = "base_service_package_sign_record")
public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Serializable {
    public enum Status {
        create("新建", "1"),
        complete("已完成", "2");
        private String name;
        private String value;
        Status(String name, String value) {
            this.name = name;
            this.value = value;
        }
        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getValue() {
            return value;
        }
        public void setValue(String value) {
            this.value = value;
        }
    }
    private String saasId;
    private String servicePackageId;//服务包id
    private String servicePackageName;//服务包名称
@ -59,7 +31,7 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
    private Long price;//服务总价
    private Date startTime;//服务开始时间
    private Date endTime;//服务结束时间
    private String status;//状态(1新建,2已完成)
    private Integer status;//状态(0待审核,1已同意,待支付,2.支付成功,已生效,-1未通过,-2已取消,-3已过期)
    private String doctorTeamCode;//医生服务团队code
    private String operator;//签约申请人处理人
    private Date createTime;//创建时间
@ -193,11 +165,11 @@ public class ServicePackageSignRecordDO extends UuidIdentityEntity implements Se
        this.endTime = endTime;
    }
    public String getStatus() {
    public Integer getStatus() {
        return status;
    }
    public void setStatus(String status) {
    public void setStatus(Integer status) {
        this.status = status;
    }

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/myFamily/PatientApplyLog.java

@ -19,7 +19,7 @@ public class PatientApplyLog extends IntegerIdentityEntity {
    private String familyMemberCode;//家庭成员code
    private String qrCode;//二维码地址
    private Date failureTime;//失效时间
    private Integer status;//1、添加家人(默认),2、邀请登录,3、通过,4、拒绝
    private Integer status;//1、添加家人(默认),2、邀请登录,3、通过,4、拒绝,5、申请人主动终止申请
    private Integer del;//删除标志(1正常,0删除)申请人主动终止申请
    private Date createTime;//创建时间
    private String createUser;//申请人

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

@ -40,6 +40,7 @@ public class PatientRequestMapping {
        public static final String signPackage  = "/signPackage";
        public static final String findDoctorById  = "/findDoctorById";
        public static final String findOrgByCode  = "/findOrgByCode";
        public static final String findPatientSignExist  = "/findPatientSignExist";
    }
    /**
     * myFamily
@ -48,6 +49,12 @@ public class PatientRequestMapping {
        public static final String PREFIX  = "/myFamily";
        public static final String getMyFamilyBindingRole  = "/getMyFamilyBindingRole";
        public static final String getBindingList  = "/getBindingList";
        public static final String bindingMyFamily  = "/bindingMyFamily";
        public static final String createFamilyQrCode  = "/createFamilyQrCode";
        public static final String remindMyFamily  = "/remindMyFamily";
        public static final String confirmApply  = "/confirmApply";
        public static final String applyMessageList  = "/applyMessageList";
        public static final String cancelApply  = "/cancelApply";
    }

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

@ -1,9 +1,11 @@
package com.yihu.jw.restmodel.base.org;
import com.yihu.jw.restmodel.UuidIdentityVOWithOperator;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.List;
/**
@ -142,6 +144,8 @@ public class BaseOrgVO extends UuidIdentityVOWithOperator {
	@ApiModelProperty(value = "作废标识,1正常,0作废", example = "1")
    private String del;
    private List<DictHospitalDeptVO> depts;
    public String getCode() {
        return code;
    }
@ -283,5 +287,11 @@ public class BaseOrgVO extends UuidIdentityVOWithOperator {
        this.del = del;
    }
    public List<DictHospitalDeptVO> getDepts() {
        return depts;
    }
    public void setDepts(List<DictHospitalDeptVO> depts) {
        this.depts = depts;
    }
}

+ 44 - 44
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictHospitalDeptDao.java

@ -1,44 +1,44 @@
package com.yihu.jw.base.dao.dict;
import com.yihu.jw.entity.base.dict.DictDiseaseDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import feign.Param;
import org.springframework.data.domain.Pageable;
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;
/**
 * 
 * 医院科室字典 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface DictHospitalDeptDao extends PagingAndSortingRepository<DictHospitalDeptDO, Integer>, JpaSpecificationExecutor<DictHospitalDeptDO>  {
    @Query("select code as code,name as name from DictHospitalDeptDO where orgCode in ?1")
    List<Map<String,Object>> findByOrgCodeIn( String orgCode, Pageable pageable);
    @Query("select code as code,name as name from DictHospitalDeptDO")
    List<Map<String,Object>> findCodeAndName(Pageable pageable);
    List<DictHospitalDeptDO> findByOrgCode(String orgCode);
    List<DictHospitalDeptDO> findByOrgCodeIn(String orgCode);
    Long countByCodeIn(String orgCode);
    boolean existsByCodeAndOrgCode(String code,String orgCode);
    DictHospitalDeptDO findByCode(String code);
}
//package com.yihu.jw.base.dao.dict;
//
//import com.yihu.jw.entity.base.dict.DictDiseaseDO;
//import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
//import feign.Param;
//import org.springframework.data.domain.Pageable;
//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;
//
///**
// *
// * 医院科室字典 数据库访问层
// *
// * @version
// * <pre>
// * Author	Version		Date		Changes
// * litaohong 	1.0  		2018年08月31日 	Created
// *
// * </pre>
// * @since 1.
// */
//public interface DictHospitalDeptDao extends PagingAndSortingRepository<DictHospitalDeptDO, Integer>, JpaSpecificationExecutor<DictHospitalDeptDO>  {
//
//    @Query("select code as code,name as name from DictHospitalDeptDO where orgCode in ?1")
//    List<Map<String,Object>> findByOrgCodeIn( String orgCode, Pageable pageable);
//
//    @Query("select code as code,name as name from DictHospitalDeptDO")
//    List<Map<String,Object>> findCodeAndName(Pageable pageable);
//
//    List<DictHospitalDeptDO> findByOrgCode(String orgCode);
//
//    List<DictHospitalDeptDO> findByOrgCodeIn(String orgCode);
//
//    Long countByCodeIn(String orgCode);
//
//    boolean existsByCodeAndOrgCode(String code,String orgCode);
//
//    DictHospitalDeptDO findByCode(String code);
//
//}

+ 6 - 9
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/open/register/RegisterEndpoint.java

@ -25,21 +25,18 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.web.bind.annotation.*;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
//import javax.mail.*;
//import javax.mail.internet.InternetAddress;
//import javax.mail.internet.MimeBodyPart;
//import javax.mail.internet.MimeMessage;
//import javax.mail.internet.MimeMultipart;
/**
 * @author yeshijie on 2018/10/16.
 */

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictHospitalDeptService.java

@ -3,9 +3,9 @@ package com.yihu.jw.base.service.dict;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.enums.SystemDictEnum;
import com.yihu.jw.base.service.org.BaseOrgService;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;

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

@ -2,33 +2,27 @@ package com.yihu.jw.base.service.doctor;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SimplePropertyPreFilter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
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;
import com.yihu.jw.base.service.dict.DictHospitalDeptService;
import com.yihu.jw.base.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.org.OrgTree;
import com.yihu.jw.base.service.org.OrgTreeService;
import com.yihu.jw.base.service.org.tree.SimpleTree;
import com.yihu.jw.base.service.org.tree.SimpleTreeNode;
import com.yihu.jw.base.service.org.tree.TreeNode;
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.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
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.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleInfoDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.org.dao.BaseOrgDao;
@ -36,13 +30,11 @@ import com.yihu.mysql.query.BaseJpaService;
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.BaseDoctorDO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.text.ParseException;
import java.util.*;
/**

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

@ -1,10 +1,10 @@
package com.yihu.jw.base.service.doctor.excelImport;
import com.yihu.jw.base.dao.dict.DictDoctorDutyDao;
import com.yihu.jw.base.dao.dict.DictHospitalDeptDao;
import com.yihu.jw.base.dao.dict.DictJobTitleDao;
import com.yihu.jw.base.dao.doctor.BaseDoctorRoleInfoDao;
import com.yihu.jw.base.endpoint.common.excel.AExcelReader;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.org.dao.BaseOrgDao;

+ 5 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/myFamily/PatientApplyLogDao.java

@ -1,5 +1,6 @@
package com.yihu.jw.patient.dao.myFamily;
import com.sun.tools.javac.util.List;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
@ -17,4 +18,8 @@ public interface PatientApplyLogDao extends PagingAndSortingRepository<PatientAp
    PatientApplyLog findById(Integer id);
    @Modifying
    @Query("update PatientApplyLog t set t.status = ?1 where t.id=?2 ")
    int updateStatusById(Integer status,Integer id);
}

+ 5 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicepackage/ServicePackageSignRecordDao.java

@ -2,11 +2,16 @@ 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.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2018/11/29.
 */
public interface ServicePackageSignRecordDao extends PagingAndSortingRepository<ServicePackageSignRecordDO, String>, JpaSpecificationExecutor<ServicePackageSignRecordDO> {
    @Query("from ServicePackageSignRecordDO where patient  =?1 and servicePackageId =?2 and status >=0")
    public List<ServicePackageSignRecordDO> findByPatientRecord(String patient,String servicePackageId);
}

+ 115 - 6
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/myFamily/MyFamilyEndpoint.java

@ -1,6 +1,9 @@
package com.yihu.jw.patient.endpoint.myFamily;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.service.myFamily.MyFamilyService;
import com.yihu.jw.patient.service.personal_Info.PatientService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.patient.PatientRequestMapping;
@ -8,11 +11,9 @@ 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.web.bind.annotation.GetMapping;
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.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@ -26,6 +27,8 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private MyFamilyService myFamilyService;
    @Autowired
    private PatientService patientService;
    @GetMapping(value = PatientRequestMapping.MyFamily.getMyFamilyBindingRole)
    @ApiOperation(value = "获取我的家人")
@ -45,9 +48,11 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "签约界面已绑定家人信息")
    public Envelop getBindingList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient) throws Exception {
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "packageId", value = "服务包id", required = false)
            @RequestParam(value = "packageId",required = false) String packageId) throws Exception {
        try{
            List<Map<String,Object>> basePatients = myFamilyService.getBindingList(getUID(patient));
            List<Map<String,Object>> basePatients = myFamilyService.getBindingList(getUID(patient),packageId);
            return success(basePatients);
        }catch (Exception e){
            e.printStackTrace();
@ -55,5 +60,109 @@ public class MyFamilyEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.bindingMyFamily)
    @ApiOperation(value = "一键绑定家人")
    public Envelop bindingMyFamily(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "saasId", value = "saasId", required = true)
            @RequestParam(value = "saasId",required = true) String saasId,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
        try{
            PatientApplyLog patientApplyLog = myFamilyService.bindingMyFamily(request,wechatId, saasId, getUID(patient), familyMobile, 1,familyBindRole);
            return success(patientApplyLog);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.createFamilyQrCode)
    @ApiOperation(value = "生成绑定家人的二维码")
    public Envelop createFamilyQrCode(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient,
            @ApiParam(name = "familyMobile", value = "家人的手机号码", required = true)
            @RequestParam(value = "familyMobile",required = true) String familyMobile,
            @ApiParam(name = "wechatId", value = "wechatId", required = true)
            @RequestParam(value = "wechatId",required = true) String wechatId,
            @ApiParam(name = "familyBindRole", value = "家庭关系关系 1配偶 2父亲 3母亲 4公公 5婆婆 6岳父 7岳母 8子女", required = true)
            @RequestParam(value = "familyBindRole",required = true) Integer familyBindRole,HttpServletRequest request) throws Exception {
        try{
            BasePatientDO familyPatient = patientService.findByMobileAndDel(familyMobile);
            PatientApplyLog patientApplyLog = myFamilyService.createFamilyQrCode(request,familyPatient,wechatId, getUID(patient),familyBindRole);
            return success(patientApplyLog.getQrCode());
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.remindMyFamily)
    @ApiOperation(value = "绑定家人界面提醒家人通过")
    public Envelop remindMyFamily(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId,
            @ApiParam(name = "remindType", value = "提醒方式(1、打电话,2、发短信,3、微信)", required = true)
            @RequestParam(value = "remindType",required = true) Integer remindType) throws Exception {
        try{
            myFamilyService.remindMyFamily(patientApplyLogId,remindType);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @GetMapping(value = PatientRequestMapping.MyFamily.applyMessageList)
    @ApiOperation(value = "有效的申请绑定消息")
    public Envelop applyMessageList(
            @ApiParam(name = "patient", value = "居民code", required = false)
            @RequestParam(value = "patient",required = false) String patient) throws Exception {
        try{
            List<Map<String,Object>> messageList = myFamilyService.applyMessageList(getUID(patient));
            return success(messageList);
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.confirmApply)
    @ApiOperation(value = "家人确认绑定")
    public Envelop confirmApply(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId,
            @ApiParam(name = "status", value = "3、通过,4、拒绝", required = true)
            @RequestParam(value = "status",required = true) Integer status,
            @ApiParam(name = "isAuthorize", value = "0:未授权,1:已授权", required = true)
            @RequestParam(value = "isAuthorize",required = true) Integer isAuthorize) throws Exception {
        try{
            myFamilyService.confirmApply(patientApplyLogId,status,isAuthorize);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
    @PostMapping(value = PatientRequestMapping.MyFamily.cancelApply)
    @ApiOperation(value = "取消申请绑定家人")
    public Envelop cancelApply(
            @ApiParam(name = "patientApplyLogId", value = "patientApplyLogId", required = true)
            @RequestParam(value = "patientApplyLogId",required = true) Integer patientApplyLogId) throws Exception {
        try{
            myFamilyService.cancelApply(patientApplyLogId);
            return success();
        }catch (Exception e){
            e.printStackTrace();
            return failed(e.getMessage());
        }
    }
}

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

@ -107,7 +107,7 @@ 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);
            Map<String, Object> result = patientService.regist(mobile, captcha, password, openid);
            if ("-1".equals(result.get("code"))) {
                envelop.setStatus(-1);
                envelop.setMessage(result.get("message") + "");

+ 17 - 4
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/servicepackage/PackageServiceEndpoint.java

@ -1,12 +1,13 @@
package com.yihu.jw.patient.endpoint.sericepackage;
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.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.service_package.PackageService;
import com.yihu.jw.patient.service.servicepackage.PackageService;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.doctor.BaseDoctorSimpleVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.patient.signPackage.SerivePackageItemVO;
@ -20,7 +21,6 @@ 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.*;
import java.util.ArrayList;
@ -116,8 +116,21 @@ public class PackageServiceEndpoint extends EnvelopRestEndpoint {
                                 @RequestParam(value = "orgCode", required = true)String orgCode) {
        BaseOrgDO baseOrgDO =  packageService.findOrgByCode(orgCode);
        BaseOrgVO baseOrgVO = convertToModel(baseOrgDO,BaseOrgVO.class);
        List<DictHospitalDeptDO> depts = packageService.findDeptByOrgCode(orgCode);
        List<DictHospitalDeptVO> deptVOs = new ArrayList<>();
        convertToModels(depts,deptVOs,DictHospitalDeptVO.class);
        baseOrgVO.setDepts(deptVOs);
        return success(PatientRequestMapping.SignPackage.api_success,baseOrgVO);
    }
    @GetMapping(value = PatientRequestMapping.SignPackage.findPatientSignExist)
    @ApiOperation(value = "判断签约记录是否存在", notes = "判断签约记录是否存在")
    public ObjEnvelop<Boolean> findPatientSignExist(@ApiParam(name = "patient", value = "患者code") @RequestParam(value = "patient", required = true)String patient,
                                        @ApiParam(name = "packageId", value = "服务包id")
                                        @RequestParam(value = "packageId", required = true)String packageId) {
        return success(PatientRequestMapping.SignPackage.api_success,packageService.findPatientSignExist(patient,packageId));
    }
//=================================
}

+ 137 - 19
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/MyFamilyService.java

@ -1,6 +1,5 @@
package com.yihu.jw.patient.service.myFamily;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientFamilyMemberDO;
@ -9,6 +8,7 @@ import com.yihu.jw.entity.myFamily.PatientApplyLog;
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.wechat.service.WeChatQrcodeService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.LinkedMap;
@ -41,14 +41,16 @@ public class MyFamilyService {
    private PatientApplyLogService patientApplyLogService;
    @Autowired
    private BasePatientMedicardCardService  patientMedicareCardService;
    @Autowired
    private PackageService packageService;
    LinkedList<String> role = new LinkedList<>(Arrays.asList("配偶","父亲","母亲","公公","婆婆","岳父","岳母","女婿","儿媳","子女"));
    public List<Map<String,Object>> getMyFamilyBindingRole(String patient) throws Exception{
        //获取用户的信息,根据完善信息获取男女
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);
        Integer sex = patientDO.getSex();
        LinkedList<String> role = new LinkedList<>(Arrays.asList("配偶","父亲","母亲","公公","婆婆","岳父","岳母","女婿","儿媳","子女"));
        Map<String,Map<String,Object>> map = new LinkedMap();
        for(int i =0;i<role.size();i++){
            Map<String,Object> m = new LinkedMap();
@ -115,7 +117,8 @@ public class MyFamilyService {
        messageDO.setReceiver(familyPatient.getId());
        messageDO.setReceiverName(familyPatient.getName());
        messageDO.setSender(patient);
        messageDO.setType(1);
        messageDO.setFailureTime(patientApplyLog.getFailureTime());
        messageDO.setSenderName(patientDO.getName());
        messageDO.setSenderPhoto(patientDO.getPhoto());
        messageDO.setTitle("家人绑定");
@ -132,6 +135,36 @@ public class MyFamilyService {
        return patientApplyLog;
    }
    /**
     * 签约绑定家人
     * @param request
     * @param wechatId
     * @param saasId
     * @param patient
     * @param familyMobile
     * @param platform
     * @param familyBindRole 1"配偶",2"父亲",3"母亲",4"公公",5"婆婆",6"岳父",7"岳母",8"女婿",9"儿媳",10"子女"
     * @param isAdult 0未成年人 1成年人
     */
    public PatientApplyLog signBindFamily(HttpServletRequest request,String wechatId, String saasId, String patient, String familyMobile, Integer platform,Integer familyBindRole,Integer isAdult) throws Exception{
        if(isAdult==1){
            PatientApplyLog p = bindingMyFamily(request,wechatId, saasId,patient, familyMobile, platform,familyBindRole);
            return p;
        }else if(isAdult==0){
            //注册一个没有手机号码的用户信息
            BasePatientDO familyPatient = null;
            //生成绑定信息
            BasePatientFamilyMemberDO patientFamilyMember = new BasePatientFamilyMemberDO();
            patientFamilyMember.setPatient(patient);
            patientFamilyMember.setFamilyMember(familyPatient.getId());
            patientFamilyMember.setFamilyRelation(familyBindRole);
            patientFamilyMember.setIsAuthorize(1);//0:未授权,1:已授权
            patientFamilyMember.setDel(1);
            patientFamilyMemberService.save(patientFamilyMember);
        }
        return null;
    }
    /**
     * 生成绑定家人的二维码
     * @param request
@ -172,6 +205,7 @@ public class MyFamilyService {
     * @param remindType
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public void remindMyFamily(Integer patientApplyLogId,Integer remindType) throws Exception{
        int i = patientApplyLogService.updateRemindTypeById(remindType,patientApplyLogId);
        if(i<0){
@ -181,25 +215,12 @@ public class MyFamilyService {
    /**
     * 家人确认绑定
     * @param messageId
     * @param patientApplyLogId
     * @param status 1、添加家人(默认),2、邀请登录,3、通过,4、拒绝
     */
    @Transactional(rollbackFor = Exception.class)
    public void confirmApply(Integer messageId,Integer patientApplyLogId,Integer status,Integer isAuthorize){
    public void confirmApply(Integer patientApplyLogId,Integer status,Integer isAuthorize){
        BaseMessageDO messageDO = null;
        if(messageId!=null){
            messageDO = messageService.findById(messageId);
        }
        if(messageDO!=null&&patientApplyLogId==null){
            String json = messageDO.getRelationData();
            JSONObject jsonObject = JSONObject.parseObject(json);
            patientApplyLogId = (Integer)jsonObject.get("patientApplyLogId");
            messageDO.setReadState(1);
            messageDO.setReadTime(new Date());
            messageService.save(messageDO);
        }
        PatientApplyLog patientApplyLog = patientApplyLogService.findById(patientApplyLogId);
        patientApplyLog.setStatus(status);
@ -224,7 +245,7 @@ public class MyFamilyService {
     * @return
     * @throws Exception
     */
    public List<Map<String,Object>> getBindingList(String patient) throws Exception{
    public List<Map<String,Object>> getBindingList(String patient,String packageId) throws Exception{
        List<Map<String,Object>> resultList = new LinkedList<>();
        List<BasePatientFamilyMemberDO> list = patientFamilyMemberService.getByPatientAndFamilyMember(patient);
        String patientTemp = null;
@ -244,6 +265,14 @@ public class MyFamilyService {
            map.put("principalNum","");//社保卡号
        }
        map.put("mobile",basePatientDO.getMobile());//手机号码
        if(StringUtils.isEmpty(packageId)){
            if(packageService.findPatientSignExist(patient,packageId)){
                map.put("isPackage",1);
            }else{
                map.put("isPackage",0);
            }
        }
        resultList.add(map);
        //家人
        for(BasePatientFamilyMemberDO one:list){
@ -267,11 +296,100 @@ public class MyFamilyService {
                map2.put("principalNum","");//社保卡号
            }
            map2.put("mobile",basePatientDO.getMobile());//手机号码
            if(StringUtils.isEmpty(packageId)){
                if(packageService.findPatientSignExist(patient,packageId)){
                    map2.put("isPackage",1);
                }else{
                    map2.put("isPackage",0);
                }
            }
            resultList.add(map2);
        }
        return resultList;
    }
    public void myFamilyBindList(String patient) throws Exception{
        //已绑定的
        List<BasePatientFamilyMemberDO> bindList = patientFamilyMemberService.getByPatientAndFamilyMember(patient);
        BasePatientDO patientDO = patientService.findByIdAndDel(patient);//绑定人
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(BasePatientFamilyMemberDO one:bindList){
            Map<String,Object> map = new HashedMap();
            if(patient.equals(one.getPatient())){
                BasePatientDO familyMember = patientService.findByIdAndDel(one.getFamilyMember());
                map.put("photo",familyMember.getPhoto());//头像
                map.put("name",familyMember.getName());//姓名
                map.put("roleName",role.get(one.getFamilyRelation()+1));//角色名称
                map.put("mobile",familyMember.getMobile());//手机号码
                map.put("isAuthorize",one.getIsAuthorize());//0:未授权,1:已授权
                map.put("familyMemberId",one.getId());
                map.put("patientId",familyMember.getId());
                map.put("type",1);
            }else{
                Integer familyRelation = familyRelationTrans(one.getFamilyRelation(),patientDO.getSex());
                BasePatientDO familyMember = patientService.findByIdAndDel(one.getPatient());
                map.put("photo",familyMember.getPhoto());//头像
                map.put("name",familyMember.getName());//姓名
                map.put("roleName",role.get(familyRelation+1));//角色名称
                map.put("mobile",familyMember.getMobile());//手机号码
                map.put("isAuthorize",one.getIsAuthorize());//0:未授权,1:已授权
                map.put("familyMemberId",one.getId());
                map.put("patientId",familyMember.getId());
                map.put("type",1);
            }
            resultList.add(map);
        }
        //已邀请的
//        patientApplyLogService.
        //已取消的
    }
    /**
     * 有效的申请绑定消息
     * @param patient
     */
    @Transactional(rollbackFor = Exception.class)
    public List<Map<String,Object>> applyMessageList(String patient) throws Exception{
        List<BaseMessageDO> msgList = messageService.applyMessageList(patient, new Date(), "010801");
        List<Map<String,Object>> result = new ArrayList<>();
        PatientApplyLog patientApplyLog = null;
        for(BaseMessageDO one:msgList){
            Map<String,Object> map = new HashedMap();
            String o = one.getRelationData();
            patientApplyLog = patientApplyLogService.findById(Integer.valueOf(o));
            Integer bindRole = patientApplyLog.getFamilyBindRole();
            String createUser = patientApplyLog.getCreateUser();//申请人code
            BasePatientDO patientDO = patientService.findByIdAndDel(patient);//被绑定人
            BasePatientDO createPatient = patientService.findByIdAndDel(createUser);//绑定人
            Integer converRole = familyRelationTrans(bindRole,createPatient.getSex());//转换后的角色
            map.put("patientApplyLogId",one.getId());
            map.put("patientPhoto",patientDO.getPhoto());
            map.put("applyPatientPhoto",createPatient.getPhoto());
            map.put("explain","您的"+role.get(converRole-1)+createPatient.getName()+"邀请您绑定家人账号");
            result.add(map);
            one.setReadonly(1);
            one.setReadTime(new Date());
            messageService.save(one);
        }
        return result;
    }
    /**
     * 取消申请绑定家人
     * @param patientApplyLogId
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    public void cancelApply(Integer patientApplyLogId) throws Exception{
        int i= patientApplyLogService.updateStatusById(5, patientApplyLogId);
        if(i<0){
            throw new Exception("update data failur !");
        }
    }
    /**
     * 家庭关系转换

+ 29 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/myFamily/PatientApplyLogService.java

@ -2,10 +2,16 @@ package com.yihu.jw.patient.service.myFamily;
import com.yihu.jw.entity.myFamily.PatientApplyLog;
import com.yihu.jw.patient.dao.myFamily.PatientApplyLogDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @author liuwenbin on 2018/11/30.
 */
@ -14,6 +20,8 @@ public class PatientApplyLogService extends BaseJpaService<PatientApplyLog, Pati
    @Autowired
    private PatientApplyLogDao patientApplyLogDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 更新提醒方式
@ -28,4 +36,25 @@ public class PatientApplyLogService extends BaseJpaService<PatientApplyLog, Pati
    public PatientApplyLog findById(Integer id){
        return  patientApplyLogDao.findById(id);
    }
    /**
     * 更新是否取消申请
     * @param patientApplyLogId
     * @return
     */
    public int updateStatusById(Integer status, Integer patientApplyLogId){
        return  patientApplyLogDao.updateStatusById(status,patientApplyLogId);
    }
    //invalid 无效 valid 有效
    public List<Map<String, Object>> findValidByPatient(String patient){
        String sql = "select l.* from patient_apply_for_log l where l.create_user='"+patient+"' and l.del=1 and l.status in (1,2) and l.failure_time>="+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss");
        return jdbcTemplate.queryForList(sql);
    }
    //invalid 无效 valid 有效
    public List<Map<String, Object>> findInvalidByPatient(String patient){
        String sql = "select l.* from patient_apply_for_log l where l.create_user='"+patient+"' and l.del=1 and (l.status in (4,5) or (l.failure_time>='"+ DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+"' and l.status in (1,2)))";
        return jdbcTemplate.queryForList(sql);
    }
}

+ 5 - 12
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -48,11 +48,7 @@ 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){
    public Map<String,Object> regist(String mobile, String captcha, String password, String openid){
        Map<String, Object> map = new HashMap<>();
        boolean b = CommonUtils.isMobile(mobile);
        if(!b){
@ -85,20 +81,17 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
        } else{
            BasePatientDO patient = new BasePatientDO();
            patient.setMobile(mobile);
            if(org.apache.commons.lang.StringUtils.isNotBlank(password)){
            if(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));
                patient.setSalt(randomString(5));
                patient.setPassword(MD5.md5Hex(password + "{" + patient.getSalt() + "}"));
            }
            if(!"undefined".equals(openid) && org.apache.commons.lang.StringUtils.isNotBlank(openid)){
            if(!"undefined".equals(openid) && StringUtils.isNotBlank(openid)){
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }

+ 19 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/servicepackage/PackageService.java

@ -1,6 +1,8 @@
package com.yihu.jw.patient.service.service_package;
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.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageDO;
@ -53,6 +55,9 @@ public class PackageService {
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    public MixEnvelop findPackageService(String city,String labelCode,String labelType,Integer page,Integer size){
        String totalSql ="SELECT " +
@ -226,6 +231,19 @@ public class PackageService {
        return baseOrgDao.findByCode(orgCode);
    }
    public List<DictHospitalDeptDO> findDeptByOrgCode(String orgCode){
       return dictHospitalDeptDao.findByOrgCode(orgCode);
    }
    public Boolean findPatientSignExist(String patient,String packageId){
        List<ServicePackageSignRecordDO> list = servicePackageSignRecordDao.findByPatientRecord(patient,packageId);
        if(list!=null&&list.size()>0){
            return true;
        }else{
            return false;
        }
    }
//    public MixEnvelop findSignPackage(){
//
//    }