Browse Source

城市i健康业务基础组件提取

LiTaohong 6 years ago
parent
commit
fa8276f613
43 changed files with 2279 additions and 127 deletions
  1. 67 0
      business/base-service/pom.xml
  2. 22 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java
  3. 29 0
      business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java
  4. 20 0
      business/base-service/src/main/java/com/yihu/jw/patient/dao/PatientMedicareCardDao.java
  5. 165 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  6. 59 0
      business/base-service/src/main/java/com/yihu/jw/patient/service/PatientMedicardCardService.java
  7. 16 0
      business/base-service/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java
  8. 100 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java
  9. 0 53
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  10. 113 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java
  11. 100 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java
  12. 87 40
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java
  13. 32 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  14. 104 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/AccountAppealVO.java
  15. 117 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/FeedbackVO.java
  16. 104 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/HelpCenterVO.java
  17. 144 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/PatientMedicareCardVO.java
  18. 6 0
      svr/svr-base/pom.xml
  19. 5 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/BasePatientDao.java
  20. 5 1
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/PatientMedicareCardDao.java
  21. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java
  22. 21 9
      svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/BasePatientService.java
  23. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientFamilyMemberService.java
  24. 13 5
      svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientMedicardCardService.java
  25. 1 1
      svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasBusinessCardService.java
  26. 29 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/BasePatientDao.java
  27. 30 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/PatientMedicareCardDao.java
  28. 0 13
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/servicePackage/ServicePackageDao.java
  29. 21 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/AccountAppealDao.java
  30. 21 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/FeedbackDao.java
  31. 21 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/HelpCenterDao.java
  32. 128 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/BasePatientEndpoint.java
  33. 103 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientMedicareCardEndpoint.java
  34. 103 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java
  35. 103 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/FeedbackEndpoint.java
  36. 103 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/HelpCenterEndpoint.java
  37. 158 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/BasePatientService.java
  38. 58 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientMedicareCardService.java
  39. 22 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/AccountAppealService.java
  40. 22 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/FeedbackService.java
  41. 22 0
      svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/HelpCenterService.java
  42. 1 0
      wlyy-lib-parent-pom/pom.xml
  43. 2 1
      wlyy-parent-pom/pom.xml

+ 67 - 0
business/base-service/pom.xml

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.yihu.jw</groupId>
        <artifactId>wlyy-lib-parent-pom</artifactId>
        <version>2.0.0</version>
        <relativePath>../../wlyy-lib-parent-pom/pom.xml</relativePath>
    </parent>
    <groupId>com.yihu.jw</groupId>
    <artifactId>base-service</artifactId>
    <version>${parent.version}</version>
    <dependencies>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </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>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <!--   poi xml导入导出工具 end -->
    </dependencies>
</project>

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

@ -0,0 +1,22 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 医生基础信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
/*
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
}*/

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

@ -0,0 +1,29 @@
package com.yihu.jw.patient.dao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
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;
/**
 * Created by Trick on 2018/8/31.
 */
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<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);
    @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 name like ?1")
    List<Map<String,Object>> findByName(String name, Pageable pageable);
    @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")
    List<Map<String,Object>> findBaseInfo(Pageable pageable);
}

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

@ -0,0 +1,20 @@
package com.yihu.jw.patient.dao;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
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.Set;
/**
 * Created by Trick on 2018/8/31.
 */
public interface PatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, String>, JpaSpecificationExecutor<PatientMedicareCardDO> {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);
}

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

@ -0,0 +1,165 @@
package com.yihu.jw.patient.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
/**
 * 
 * 居民信息服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年08月31日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatientDao> {
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private PatientMedicardCardService patientMedicardCardService;
    @Autowired
    private ObjectMapper objectMapper;
    
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 居民id
     * @param patientId
     * @return
     */
    public String getPatientById(String patientId) throws Exception{
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(patientId)){
            result.put("result","parameter patientId is null");
            return result.toString();
        }
        List<BasePatientDO> patientDOList = this.findByField("id",patientId);
        if(CollectionUtils.isEmpty(patientDOList)){
            result.put("result","not exist patient for id:"+patientId);
            return result.toString();
        }
        result.put("patient",patientDOList.get(0));
        List<PatientMedicareCardDO> cards = patientMedicardCardService.findPatientCardByCode(patientId);
        result.put("medicareCard",cards);
        return result.toJSONString();
    }
    /**
     * 获取用户基础信息,参数为空查全部
     * @param nameOrIdcard
     * @param page
     * @param size
     * @param sorts
     * @return
     */
    public List<Map<String,Object>> queryPatientBaseInfo(String nameOrIdcard,int page,int size,String sorts)throws Exception{
        List<Map<String, Object>> result = new ArrayList<>();
        String param = null == nameOrIdcard ? "": nameOrIdcard;
        String sql = "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, " +
                "       committee_name                                         as committeeName, " +
                "       concat(province_name, city_name, town_name, street_name)   as address " +
                " from base_patient " +
                " where name like '%" + param + "%' or idcard like '%" + param + "%' order by create_time desc";
        String countSql = "select count(id) from base_patient where name like '%" + param + "%' or idcard like '%" + param + "%'";
        Long count  = jdbcTemplate.queryForObject(countSql,Long.class);
        if(count <= 0){
            return result;
        }
        result = jdbcTemplate.queryForList(sql);
        return result;
    }
    /**
     * 新增居民
     * @param jsonData
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public String createPatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject patient = jsonObject.getJSONObject("patient");
        JSONArray patientMedicareCards = jsonObject.getJSONArray("medicareCard");
        if(null == patient || CollectionUtils.isEmpty(patientMedicareCards)){
            return ConstantUtils.FAIL;
        }
        BasePatientDO basePatientDO = objectMapper.readValue(patient.toJSONString(),BasePatientDO.class);
        List<PatientMedicareCardDO> list = new ArrayList<>();
        patientMedicareCards.forEach((card)->{
            try {
                list.add(objectMapper.readValue(card.toString(),PatientMedicareCardDO.class));
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
        this.save(basePatientDO);
        patientMedicardCardService.batchInsert(list);
        return ConstantUtils.SUCCESS;
    }
    /**
     * 修改居民
     * @param jsonData
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public String updatePatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject patient = jsonObject.getJSONObject("patient");
        JSONArray patientMedicareCards = jsonObject.getJSONArray("medicareCard");
        if(null == patient || CollectionUtils.isEmpty(patientMedicareCards)){
            return ConstantUtils.FAIL;
        }
        BasePatientDO basePatientDO = objectMapper.readValue(patient.toJSONString(),BasePatientDO.class);
        if(StringUtils.isEmpty(basePatientDO.getId())){
            return ConstantUtils.FAIL;
        }
        // 保存修改的居民信息
        this.save(basePatientDO);
        Set<Object> cardIdList = patientMedicardCardService.findIdListByPatientCode(basePatientDO.getId());
        // 有些卡可能是新增或修改的,一条一条修改居民相关的卡的信息
        for (Object obj : patientMedicareCards) {
            PatientMedicareCardDO card = objectMapper.readValue(obj.toString(), PatientMedicareCardDO.class);
            card.setPatientCode(basePatientDO.getId());
            if(cardIdList.contains(card.getId())){
                cardIdList.remove(card.getId());
            }
            patientMedicardCardService.save(card);
        }
        // 有些卡可能是删除的
        if(cardIdList.size() > 0){
            patientMedicardCardService.delete(cardIdList.toArray());
        }
        return ConstantUtils.SUCCESS;
    }
}

+ 59 - 0
business/base-service/src/main/java/com/yihu/jw/patient/service/PatientMedicardCardService.java

@ -0,0 +1,59 @@
package com.yihu.jw.patient.service;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.PatientMedicareCardDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
 * 
 * 居民信息服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年08月31日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class PatientMedicardCardService extends BaseJpaService<PatientMedicareCardDO, PatientMedicareCardDao> {
    @Autowired
    private PatientMedicareCardDao patientMedicareCardDao;
    /**
     * 根据居民标识获取居民医疗相关卡列表
     * @param patientCode
     * @return
     */
    public List<PatientMedicareCardDO> findPatientCardByCode(String patientCode){
        List<PatientMedicareCardDO> result = new ArrayList<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return patientMedicareCardDao.findByPatientCode(patientCode);
    }
    /**
     * 根据居民标识获取关联卡id列表
     * @param patientCode
     * @return
     */
    public Set<Object> findIdListByPatientCode(String patientCode){
        Set<Object> result = new HashSet<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return patientMedicareCardDao.findIdListByPatientCode(patientCode);
    }
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/patient/util/ConstantUtils.java

@ -0,0 +1,16 @@
package com.yihu.jw.patient.util;
/**
 * @author litaohong on 2018/10/11
 * @project jw2.0
 */
public class ConstantUtils {
    public static final String SUCCESS = "success";
    public static final String FAIL = "fail";
    // 状态失效
    public static final String STATUS_0 = "0";
    // 状态有效
    public static final String STATUS_1 = "1";
}

+ 100 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java

@ -0,0 +1,100 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 账号申诉实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "account_appeal")
public class AccountAppealDO extends IntegerIdentityEntity {
    /**
	 * 申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)
	 */
	private String type;
    /**
	 * 申诉内容,问题描述
	 */
	private String content;
    /**
	 * 申诉人姓名
	 */
	private String name;
    /**
	 * 申诉人身份证号码
	 */
	private String idcard;
    /**
	 * 申诉人手机号码
	 */
	private String mobile;
    /**
	 * 身份证正反面照片,存地址,逗号分割
	 */
	private String img;
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
	@Column(name = "content")
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
	@Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
	@Column(name = "idcard")
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
	@Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
	@Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}

+ 0 - 53
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -64,11 +64,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
	 */
	private String phone;
    /**
	 * 社保卡号
	 */
	private String ssc;
    /**
	 * 头像http地址
	 */
@ -165,17 +160,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
     */
    private String committeeName;
    /**
	 * 疾病类型,0健康,1高血压,2糖尿病,3高血压+糖尿病
	 */
	private String disease;
    /**
	 * 病情:0绿标,1黄标,2红标,3重点关注,
	 */
	private String diseaseCondition;
    /**
	 * 总积分
	 */
@ -238,11 +222,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
	 */
	private Integer standardStatus;
    /**
	 * 医疗保险号
	 */
	private String medicareNumber;
    /**
	 * unionId 开发平台唯一标识
	 */
@ -331,14 +310,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.phone = phone;
    }
	@Column(name = "ssc")
    public String getSsc() {
        return ssc;
    }
    public void setSsc(String ssc) {
        this.ssc = ssc;
    }
	@Column(name = "photo")
    public String getPhoto() {
        return photo;
@ -427,22 +398,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.committeeName = committeeName;
    }
    @Column(name = "disease")
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
	@Column(name = "disease_condition")
    public String getDiseaseCondition() {
        return diseaseCondition;
    }
    public void setDiseaseCondition(String diseaseCondition) {
        this.diseaseCondition = diseaseCondition;
    }
	@Column(name = "points")
    public String getPoints() {
        return points;
@ -539,14 +494,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
        this.standardStatus = standardStatus;
    }
	@Column(name = "medicare_number")
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }
	@Column(name = "unionid")
    public String getUnionid() {
        return unionid;

+ 113 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java

@ -0,0 +1,113 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 意见反馈实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "feedback")
public class FeedbackDO extends IntegerIdentityEntity {
    /**
	 * 反馈问题大类(功能异常,功能优化,新功能建议,其他等)
	 */
	private String parentType;
    /**
	 * 问题小类(功能异常-某些功能不可用等)
	 */
	private String type;
    /**
	 * 反馈内容,问题和建议
	 */
	private String feedbackContent;
    /**
	 * 问题回答
	 */
	private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
	private String img;
    /**
	 * 联系手机号码
	 */
	private String mobile;
    /**
	 * 反馈次数
	 */
	private String count;
	@Column(name = "parent_type")
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
	@Column(name = "feedback_content")
    public String getFeedbackContent() {
        return feedbackContent;
    }
    public void setFeedbackContent(String feedbackContent) {
        this.feedbackContent = feedbackContent;
    }
	@Column(name = "answer")
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
	@Column(name = "img")
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
	@Column(name = "mobile")
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
	@Column(name = "count")
    public String getCount() {
        return count;
    }
    public void setCount(String count) {
        this.count = count;
    }
}

+ 100 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/HelpCenterDO.java

@ -0,0 +1,100 @@
package com.yihu.jw.entity.base.patient;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 帮助中心实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "help_center")
public class HelpCenterDO extends IntegerIdentityEntity {
    /**
	 * 问题大类(账号问题,续方问题,操作问题)
	 */
	private String parentType;
    /**
	 * 问题小类(账号被锁问题,身份证占用问题等等)
	 */
	private String type;
    /**
	 * 问题描述
	 */
	private String question;
    /**
	 * 问题回答
	 */
	private String answer;
    /**
	 * 有用次数
	 */
	private String usefulCount;
    /**
	 * 无用次数
	 */
	private String unusefulCount;
	@Column(name = "parent_type")
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
	@Column(name = "question")
    public String getQuestion() {
        return question;
    }
    public void setQuestion(String question) {
        this.question = question;
    }
	@Column(name = "answer")
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
	@Column(name = "useful_count")
    public String getUsefulCount() {
        return usefulCount;
    }
    public void setUsefulCount(String usefulCount) {
        this.usefulCount = usefulCount;
    }
	@Column(name = "unuseful_count")
    public String getUnusefulCount() {
        return unusefulCount;
    }
    public void setUnusefulCount(String unusefulCount) {
        this.unusefulCount = unusefulCount;
    }
}

+ 87 - 40
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/PatientMedicareCardDO.java

@ -1,93 +1,140 @@
package com.yihu.jw.entity.base.patient;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 居民信息(居民就是患者)实体
*
* @author Administrator on  2018年09月05日
*
*/
 * 居民卡包实体
 * 
 * @author Administrator on  2018年11月27日
 *
 */
@Entity
@Table(name = "patient_medicare_card")
public class PatientMedicareCardDO extends IntegerIdentityEntity {
    public enum Type{
        medicareCard(0),
        healthCard(1);
        private int value;
        Type(int value){
            this.value = value;
        }
        public int getValue() {
            return value;
        }
    }
    /**
	 * 卡标识
	 */
	private String code;
    /**
	 * 卡类型,1-医保卡,2-电子健康卡
	 * 卡的大类(A-医疗卡,B-优惠券,C-银行卡,unknow-其他)
	 */
	private String type;
	private String parentType;
    /**
     * 医疗保险号
     */
	private String medicareNumber;
	 * 卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,
	 */
	private String type;
    /**
	 * 居民标识
	 */
	private String patientCode;
    @Column(name = "code")
    /**
	 * 医疗保险号
	 */
	private String medicareNumber;
    /**
	 * 绑定密码
	 */
	private String password;
    /**
	 * 微信openid,有些卡会绑定微信
	 */
	private String wxOpenid;
    /**
	 * 备注
	 */
	private String remark;
    /**
	 * 状态,0-解除绑定,1-绑定中
	 */
	private String del;
	@Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "type")
	@Column(name = "parent_type")
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
	@Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Column(name = "medicare_number")
	@Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
	@Column(name = "medicare_number")
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }
    @Column(name = "patient_code")
    public String getPatientCode() {
        return patientCode;
	@Column(name = "password")
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
	@Column(name = "wx_openid")
    public String getWxOpenid() {
        return wxOpenid;
    }
    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }
	@Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
	@Column(name = "del")
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

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

@ -459,7 +459,7 @@ public class BaseRequestMapping {
    /**
     * 患者信息
     * 居民信息
     */
    public static class BasePatient extends Basic {
        public static final String PREFIX  = "/basePatient";
@ -467,6 +467,37 @@ public class BaseRequestMapping {
        public static final String getBaseInfo  = "/getBaseInfo";
    }
   /**
     * 居民卡包信息
     */
    public static class PatientMedicareCard extends Basic {
        public static final String PREFIX  = "/patientMedicareCard";
        public static final String getPatientById  = "/getCardsByPatientId";
    }
    /**
     * 居民账号申诉
     */
    public static class AccountAppeal extends Basic {
        public static final String PREFIX  = "/accountAppeal";
    }
    /**
     * 居民问题反馈
     */
    public static class Feedback extends Basic {
        public static final String PREFIX  = "/feedback";
    }
    /**
     * 居民帮助中心
     */
    public static class HelpCenter extends Basic {
        public static final String PREFIX  = "/helpCenter";
    }
    /**
     * 基础人口基数
     */

+ 104 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/AccountAppealVO.java

@ -0,0 +1,104 @@
package com.yihu.jw.restmodel.base.patient;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 
 * 账号申诉vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "AccountAppealVO", description = "账号申诉")
public class AccountAppealVO extends IntegerIdentityVO{
    /**
	 * 申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)
	 */
	@ApiModelProperty(value = "申诉问题类型(0-手机号码无法使用,1-无法找回密码,2-身份证被占用)", example = "模块1")
    private String type;
    /**
	 * 申诉内容,问题描述
	 */
	@ApiModelProperty(value = "申诉内容,问题描述", example = "模块1")
    private String content;
    /**
	 * 申诉人姓名
	 */
	@ApiModelProperty(value = "申诉人姓名", example = "模块1")
    private String name;
    /**
	 * 申诉人身份证号码
	 */
	@ApiModelProperty(value = "申诉人身份证号码", example = "模块1")
    private String idcard;
    /**
	 * 申诉人手机号码
	 */
	@ApiModelProperty(value = "申诉人手机号码", example = "模块1")
    private String mobile;
    /**
	 * 身份证正反面照片,存地址,逗号分割
	 */
	@ApiModelProperty(value = "身份证正反面照片,存地址,逗号分割", example = "模块1")
    private String img;
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}

+ 117 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/FeedbackVO.java

@ -0,0 +1,117 @@
package com.yihu.jw.restmodel.base.patient;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 
 * 意见反馈vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "FeedbackVO", description = "意见反馈")
public class FeedbackVO extends IntegerIdentityVO{
    /**
	 * 反馈问题大类(功能异常,功能优化,新功能建议,其他等)
	 */
	@ApiModelProperty(value = "反馈问题大类(功能异常,功能优化,新功能建议,其他等)", example = "模块1")
    private String parentType;
    /**
	 * 问题小类(功能异常-某些功能不可用等)
	 */
	@ApiModelProperty(value = "问题小类(功能异常-某些功能不可用等)", example = "模块1")
    private String type;
    /**
	 * 反馈内容,问题和建议
	 */
	@ApiModelProperty(value = "反馈内容,问题和建议", example = "模块1")
    private String feedbackContent;
    /**
	 * 问题回答
	 */
	@ApiModelProperty(value = "问题回答", example = "模块1")
    private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
	@ApiModelProperty(value = "图片,存图片地址,逗号分割", example = "模块1")
    private String img;
    /**
	 * 联系手机号码
	 */
	@ApiModelProperty(value = "联系手机号码", example = "模块1")
    private String mobile;
    /**
	 * 反馈次数
	 */
	@ApiModelProperty(value = "反馈次数", example = "模块1")
    private String count;
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getFeedbackContent() {
        return feedbackContent;
    }
    public void setFeedbackContent(String feedbackContent) {
        this.feedbackContent = feedbackContent;
    }
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getCount() {
        return count;
    }
    public void setCount(String count) {
        this.count = count;
    }
}

+ 104 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/HelpCenterVO.java

@ -0,0 +1,104 @@
package com.yihu.jw.restmodel.base.patient;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 
 * 帮助中心vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "HelpCenterVO", description = "帮助中心")
public class HelpCenterVO extends IntegerIdentityVO{
    /**
	 * 问题大类(账号问题,续方问题,操作问题)
	 */
	@ApiModelProperty(value = "问题大类(账号问题,续方问题,操作问题)", example = "模块1")
    private String parentType;
    /**
	 * 问题小类(账号被锁问题,身份证占用问题等等)
	 */
	@ApiModelProperty(value = "问题小类(账号被锁问题,身份证占用问题等等)", example = "模块1")
    private String type;
    /**
	 * 问题描述
	 */
	@ApiModelProperty(value = "问题描述", example = "模块1")
    private String question;
    /**
	 * 问题回答
	 */
	@ApiModelProperty(value = "问题回答", example = "模块1")
    private String answer;
    /**
	 * 有用次数
	 */
	@ApiModelProperty(value = "有用次数", example = "模块1")
    private String usefulCount;
    /**
	 * 无用次数
	 */
	@ApiModelProperty(value = "无用次数", example = "模块1")
    private String unusefulCount;
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getQuestion() {
        return question;
    }
    public void setQuestion(String question) {
        this.question = question;
    }
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    public String getUsefulCount() {
        return usefulCount;
    }
    public void setUsefulCount(String usefulCount) {
        this.usefulCount = usefulCount;
    }
    public String getUnusefulCount() {
        return unusefulCount;
    }
    public void setUnusefulCount(String unusefulCount) {
        this.unusefulCount = unusefulCount;
    }
}

+ 144 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/PatientMedicareCardVO.java

@ -0,0 +1,144 @@
package com.yihu.jw.restmodel.base.patient;
import com.yihu.jw.restmodel.IntegerIdentityVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
 * 
 * 居民卡包vo
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@ApiModel(value = "PatientMedicareCardVO", description = "居民卡包")
public class PatientMedicareCardVO extends IntegerIdentityVO{
    /**
	 * 卡标识
	 */
	@ApiModelProperty(value = "卡标识", example = "模块1")
    private String code;
    /**
	 * 卡的大类(A-医疗卡,B-优惠券,C-银行卡,unknow-其他)
	 */
	@ApiModelProperty(value = "卡的大类(A-医疗卡,B-优惠券,C-银行卡,unknow-其他)", example = "模块1")
    private String parentType;
    /**
	 * 卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,
	 */
	@ApiModelProperty(value = "卡的小类:医疗卡包含 A_01 医保卡,A_02 电子社保卡 A_03 电子就诊卡等等,,,", example = "模块1")
    private String type;
    /**
	 * 居民标识
	 */
	@ApiModelProperty(value = "居民标识", example = "模块1")
    private String patientCode;
    /**
	 * 医疗保险号
	 */
	@ApiModelProperty(value = "医疗保险号", example = "模块1")
    private String medicareNumber;
    /**
	 * 绑定密码
	 */
	@ApiModelProperty(value = "绑定密码", example = "模块1")
    private String password;
    /**
	 * 微信openid,有些卡会绑定微信
	 */
	@ApiModelProperty(value = "微信openid,有些卡会绑定微信", example = "模块1")
    private String wxOpenid;
    /**
	 * 备注
	 */
	@ApiModelProperty(value = "备注", example = "模块1")
    private String remark;
    /**
	 * 状态,0-解除绑定,1-绑定中
	 */
	@ApiModelProperty(value = "状态,0-解除绑定,1-绑定中", example = "模块1")
    private String del;
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getParentType() {
        return parentType;
    }
    public void setParentType(String parentType) {
        this.parentType = parentType;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getPatientCode() {
        return patientCode;
    }
    public void setPatientCode(String patientCode) {
        this.patientCode = patientCode;
    }
    public String getMedicareNumber() {
        return medicareNumber;
    }
    public void setMedicareNumber(String medicareNumber) {
        this.medicareNumber = medicareNumber;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getWxOpenid() {
        return wxOpenid;
    }
    public void setWxOpenid(String wxOpenid) {
        this.wxOpenid = wxOpenid;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
}

+ 6 - 0
svr/svr-base/pom.xml

@ -177,6 +177,12 @@
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>patient-service</artifactId>
            <version>2.0.0</version>
            <scope>compile</scope>
        </dependency>
        <!--   poi xml导入导出工具 end -->

+ 5 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/BasePatientDao.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.base.dao.patient;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -12,9 +13,11 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
*/
/**
 * Created by Trick on 2018/8/31.
 */
 *//*
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<BasePatientDO> {
    BasePatientDO findByIdAndDel(String id,String del);
@ -30,3 +33,4 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    List<Map<String,Object>> findBaseInfo(Pageable pageable);
}
*/

+ 5 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/dao/patient/PatientMedicareCardDao.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.base.dao.patient;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
@ -8,9 +9,11 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Set;
*/
/**
 * Created by Trick on 2018/8/31.
 */
 *//*
public interface PatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, String>, JpaSpecificationExecutor<PatientMedicareCardDO> {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
@ -18,3 +21,4 @@ public interface PatientMedicareCardDao extends PagingAndSortingRepository<Patie
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);
}
*/

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/patient/BasePatientEndpoint.java

@ -1,7 +1,7 @@
package com.yihu.jw.base.endpoint.patient;
import com.yihu.jw.base.service.patient.BasePatientService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;

+ 21 - 9
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/BasePatientService.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.base.service.patient;
import com.alibaba.fastjson.JSONArray;
@ -20,6 +21,7 @@ import java.io.IOException;
import java.util.*;
import java.util.regex.Pattern;
*/
/**
 * 
 * 居民信息服务service
@ -31,7 +33,8 @@ import java.util.regex.Pattern;
 *
 * </pre>
 * @since 1.
 */
 *//*
@Service
public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatientDao> {
@ -45,11 +48,13 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
    private ObjectMapper objectMapper;
    /**
    */
/**
     * 居民id
     * @param patientId
     * @return
     */
     *//*
    public String getPatientById(String patientId) throws Exception{
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(patientId)){
@ -66,14 +71,16 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
        result.put("medicareCard",cards);
        return result.toJSONString();
    }
    /**
    */
/**
     * 获取用户基础信息,参数为空查全部
     * @param nameOrIdcard
     * @param page
     * @param size
     * @param sorts
     * @return
     */
     *//*
    public List<Map<String,Object>> queryPatientBaseInfo(String nameOrIdcard,int page,int size,String sorts)throws Exception{
        List<Map<String,Object>> result = new ArrayList<>();
        if(StringUtils.isEmpty(nameOrIdcard)){
@ -92,11 +99,13 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return result;
    }
    /**
    */
/**
     * 新增居民
     * @param jsonData
     * @return
     */
     *//*
    @Transactional(rollbackFor = Exception.class)
    public String createPatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
@ -119,11 +128,13 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return ConstantUtils.SUCCESS;
    }
    /**
    */
/**
     * 修改居民
     * @param jsonData
     * @return
     */
     *//*
    @Transactional(rollbackFor = Exception.class)
    public String updatePatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
@ -155,3 +166,4 @@ public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatien
        return ConstantUtils.SUCCESS;
    }
}
*/

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientFamilyMemberService.java

@ -1,9 +1,9 @@
package com.yihu.jw.base.service.patient;
import com.yihu.jw.base.dao.patient.BasePatientDao;
import com.yihu.jw.base.dao.patient.BasePatientFamilyMemberDao;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientFamilyMemberDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.mysql.query.BaseJpaService;

+ 13 - 5
svr/svr-base/src/main/java/com/yihu/jw/base/service/patient/PatientMedicardCardService.java

@ -1,3 +1,4 @@
/*
package com.yihu.jw.base.service.patient;
import com.yihu.jw.base.dao.patient.PatientMedicareCardDao;
@ -12,6 +13,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
*/
/**
 * 
 * 居民信息服务service
@ -23,18 +25,21 @@ import java.util.Set;
 *
 * </pre>
 * @since 1.
 */
 *//*
@Service
public class PatientMedicardCardService extends BaseJpaService<PatientMedicareCardDO, PatientMedicareCardDao> {
    @Autowired
    private PatientMedicareCardDao patientMedicareCardDao;
    /**
    */
/**
     * 根据居民标识获取居民医疗相关卡列表
     * @param patientCode
     * @return
     */
     *//*
    public List<PatientMedicareCardDO> findPatientCardByCode(String patientCode){
        List<PatientMedicareCardDO> result = new ArrayList<>();
        if(StringUtils.isEmpty(patientCode)){
@ -43,11 +48,13 @@ public class PatientMedicardCardService extends BaseJpaService<PatientMedicareCa
        return patientMedicareCardDao.findByPatientCode(patientCode);
    }
    /**
    */
/**
     * 根据居民标识获取关联卡id列表
     * @param patientCode
     * @return
     */
     *//*
    public Set<Object> findIdListByPatientCode(String patientCode){
        Set<Object> result = new HashSet<>();
        if(StringUtils.isEmpty(patientCode)){
@ -57,3 +64,4 @@ public class PatientMedicardCardService extends BaseJpaService<PatientMedicareCa
    }
}
*/

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/saas/SaasBusinessCardService.java

@ -2,8 +2,8 @@ package com.yihu.jw.base.service.saas;
import com.yihu.jw.base.dao.saas.SaasBusinessCardDao;
import com.yihu.jw.base.service.doctor.BaseDoctorService;
import com.yihu.jw.base.service.patient.BasePatientService;
import com.yihu.jw.entity.base.saas.SaasBusinessCardDO;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

+ 29 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/BasePatientDao.java

@ -0,0 +1,29 @@
package com.yihu.jw.patient.dao.personal_info;
import com.yihu.jw.entity.base.patient.BasePatientDO;
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;
/**
 * Created by Trick on 2018/8/31.
 */
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<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);
    @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 name like ?1")
    List<Map<String,Object>> findByName(String name, Pageable pageable);
    @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")
    List<Map<String,Object>> findBaseInfo(Pageable pageable);
}

+ 30 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/personal_info/PatientMedicareCardDao.java

@ -0,0 +1,30 @@
package com.yihu.jw.patient.dao.personal_info;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
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.Set;
/**
 * 
 * 居民卡包 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface PatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, Integer>, JpaSpecificationExecutor<PatientMedicareCardDO>  {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);
}

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

@ -1,13 +0,0 @@
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;
/**
 *
 * @author yeshijie on 2018/8/17
 */
public interface ServicePackageDao extends PagingAndSortingRepository<ServicePackageDO, String>, JpaSpecificationExecutor<ServicePackageDO> {
}

+ 21 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/AccountAppealDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.patient.dao.settings;
import com.yihu.jw.entity.base.patient.AccountAppealDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 账号申诉 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface AccountAppealDao extends PagingAndSortingRepository<AccountAppealDO, Integer>, JpaSpecificationExecutor<AccountAppealDO>  {
}

+ 21 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/FeedbackDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.patient.dao.settings;
import com.yihu.jw.entity.base.patient.FeedbackDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 意见反馈 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface FeedbackDao extends PagingAndSortingRepository<FeedbackDO, Integer>, JpaSpecificationExecutor<FeedbackDO>  {
}

+ 21 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/dao/settings/HelpCenterDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.patient.dao.settings;
import com.yihu.jw.entity.base.patient.HelpCenterDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 帮助中心 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface HelpCenterDao extends PagingAndSortingRepository<HelpCenterDO, Integer>, JpaSpecificationExecutor<HelpCenterDO>  {
}

+ 128 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/BasePatientEndpoint.java

@ -0,0 +1,128 @@
package com.yihu.jw.patient.endpoint.personal_info;
import com.yihu.jw.base.service.patient.BasePatientService;
import com.yihu.jw.base.util.ConstantUtils;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.restmodel.base.patient.BasePatientVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * 居民信息控制器
 *
 * @version <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年08月31日 	Created
 *
 * </pre>
 * @since 1.
 */
@RestController
@RequestMapping(value = BaseRequestMapping.BasePatient.PREFIX)
@Api(value = "居民信息管理", description = "居民信息管理服务接口", tags = {"wlyy基础服务 - 居民信息管理服务接口"})
public class BasePatientEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BasePatientService basePatientService;
    @PostMapping(value = BaseRequestMapping.BasePatient.CREATE)
    @ApiOperation(value = "创建")
    public Envelop create(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
       String msg = basePatientService.createPatient(jsonData);
       if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
           return success(msg);
       }
        return failed(msg);
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        basePatientService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.BasePatient.UPDATE)
    @ApiOperation(value = "更新")
    public Envelop update(
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestParam String jsonData) throws Exception {
        String msg = basePatientService.updatePatient(jsonData);
        if(!StringUtils.equalsIgnoreCase(ConstantUtils.SUCCESS,msg)){
            return failed(msg);
        }
        return success(msg);
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.getPatientById)
    @ApiOperation(value = "获取列表")
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
            @RequestParam(value = "id", required = true) String id) throws Exception {
        String result = basePatientService.getPatientById(id);
        return success(result);
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.PAGE)
    @ApiOperation(value = "获取分页")
    public PageEnvelop<BasePatientVO> page(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<BasePatientDO> basePatients = basePatientService.search(fields, filters, sorts, page, size);
        int count = (int) basePatientService.getCount(filters);
        return success(basePatients, count, page, size, BasePatientVO.class);
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.LIST)
    @ApiOperation(value = "获取列表")
    public ListEnvelop<BasePatientVO> list(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<BasePatientDO> basePatients = basePatientService.search(fields, filters, sorts);
        return success(basePatients, BasePatientVO.class);
    }
    @GetMapping(value = BaseRequestMapping.BasePatient.getBaseInfo)
    @ApiOperation(value = "获取居民基础信息列表")
    public ListEnvelop queryPatientBaseInfo(
            @ApiParam(name = "nameOrIdcard", value = "居民姓名或身份证")
            @RequestParam(value = "nameOrIdcard", required = false) String nameOrIdcard,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<Map<String,Object>> basePatients = basePatientService.queryPatientBaseInfo(nameOrIdcard, page,size,sorts);
        return success(basePatients);
    }
}

+ 103 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientMedicareCardEndpoint.java

@ -0,0 +1,103 @@
package com.yihu.jw.patient.endpoint.personal_info;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.service.personal_Info.PatientMedicareCardService;
import com.yihu.jw.restmodel.base.patient.PatientMedicareCardVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.*;
import java.util.List;
/**
*
* 居民卡包控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.PatientMedicareCard.PREFIX)
@Api(value = "居民卡包管理", description = "居民卡包管理服务接口", tags = {"wlyy基础服务 - 居民卡包管理服务接口"})
public class PatientMedicareCardEndpoint extends EnvelopRestEndpoint {
@Autowired
private PatientMedicareCardService patientMedicareCardService;
@PostMapping(value = BaseRequestMapping.PatientMedicareCard.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<PatientMedicareCardVO> create (
    @ApiParam(name = "jsonData", value = "Json数据", required = true)
    @RequestParam String jsonData) throws Exception {
    PatientMedicareCardDO patientMedicareCard = toEntity(jsonData, PatientMedicareCardDO.class);
    patientMedicareCard = patientMedicareCardService.save(patientMedicareCard);
    return success(patientMedicareCard, PatientMedicareCardVO.class);
    }
    @PostMapping(value = BaseRequestMapping.PatientMedicareCard.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    patientMedicareCardService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.PatientMedicareCard.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<PatientMedicareCardVO> update (
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam String jsonData) throws Exception {
        PatientMedicareCardDO patientMedicareCard = toEntity(jsonData, PatientMedicareCardDO.class);
        if (null == patientMedicareCard.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        patientMedicareCard = patientMedicareCardService.save(patientMedicareCard);
        return success(patientMedicareCard, PatientMedicareCardVO.class);
        }
        @GetMapping(value = BaseRequestMapping.PatientMedicareCard.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<PatientMedicareCardVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<PatientMedicareCardDO> patientMedicareCards = patientMedicareCardService.search(fields, filters, sorts, page, size);
                int count = (int)patientMedicareCardService.getCount(filters);
                return success(patientMedicareCards, count, page, size, PatientMedicareCardVO.class);
         }
         @GetMapping(value = BaseRequestMapping.PatientMedicareCard.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<PatientMedicareCardVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<PatientMedicareCardDO> patientMedicareCards = patientMedicareCardService.search(fields, filters, sorts);
                  return success(patientMedicareCards, PatientMedicareCardVO.class);
         }
 }

+ 103 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java

@ -0,0 +1,103 @@
package com.yihu.jw.patient.endpoint.settings;
import com.yihu.jw.patient.service.settings.AccountAppealService;
import com.yihu.jw.restmodel.base.patient.AccountAppealVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.*;
import java.util.List;
import com.yihu.jw.entity.base.patient.AccountAppealDO;
/**
*
* 账号申诉控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.AccountAppeal.PREFIX)
@Api(value = "账号申诉管理", description = "账号申诉管理服务接口", tags = {"wlyy基础服务 - 账号申诉管理服务接口"})
public class AccountAppealEndpoint extends EnvelopRestEndpoint {
@Autowired
private AccountAppealService accountAppealService;
@PostMapping(value = BaseRequestMapping.AccountAppeal.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<AccountAppealVO> create (
    @ApiParam(name = "jsonData", value = "Json数据", required = true)
    @RequestParam String jsonData) throws Exception {
    AccountAppealDO accountAppeal = toEntity(jsonData, AccountAppealDO.class);
    accountAppeal = accountAppealService.save(accountAppeal);
    return success(accountAppeal, AccountAppealVO.class);
    }
    @PostMapping(value = BaseRequestMapping.AccountAppeal.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    accountAppealService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.AccountAppeal.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<AccountAppealVO> update (
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam String jsonData) throws Exception {
        AccountAppealDO accountAppeal = toEntity(jsonData, AccountAppealDO.class);
        if (null == accountAppeal.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        accountAppeal = accountAppealService.save(accountAppeal);
        return success(accountAppeal, AccountAppealVO.class);
        }
        @GetMapping(value = BaseRequestMapping.AccountAppeal.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<AccountAppealVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<AccountAppealDO> accountAppeals = accountAppealService.search(fields, filters, sorts, page, size);
                int count = (int)accountAppealService.getCount(filters);
                return success(accountAppeals, count, page, size, AccountAppealVO.class);
         }
         @GetMapping(value = BaseRequestMapping.AccountAppeal.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<AccountAppealVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<AccountAppealDO> accountAppeals = accountAppealService.search(fields, filters, sorts);
                  return success(accountAppeals, AccountAppealVO.class);
         }
 }

+ 103 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/FeedbackEndpoint.java

@ -0,0 +1,103 @@
package com.yihu.jw.patient.endpoint.settings;
import com.yihu.jw.patient.service.settings.FeedbackService;
import com.yihu.jw.restmodel.base.dict.FeedbackVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.*;
import java.util.List;
import com.yihu.jw.entity.base.FeedbackDO;
/**
*
* 意见反馈控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.Feedback.PREFIX)
@Api(value = "意见反馈管理", description = "意见反馈管理服务接口", tags = {"wlyy基础服务 - 意见反馈管理服务接口"})
public class FeedbackEndpoint extends EnvelopRestEndpoint {
@Autowired
private FeedbackService feedbackService;
@PostMapping(value = BaseRequestMapping.Feedback.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<FeedbackVO> create (
    @ApiParam(name = "jsonData", value = "Json数据", required = true)
    @RequestParam String jsonData) throws Exception {
    FeedbackDO feedback = toEntity(jsonData, FeedbackDO.class);
    feedback = feedbackService.save(feedback);
    return success(feedback, FeedbackVO.class);
    }
    @PostMapping(value = BaseRequestMapping.Feedback.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    feedbackService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.Feedback.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<FeedbackVO> update (
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam String jsonData) throws Exception {
        FeedbackDO feedback = toEntity(jsonData, FeedbackDO.class);
        if (null == feedback.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        feedback = feedbackService.save(feedback);
        return success(feedback, FeedbackVO.class);
        }
        @GetMapping(value = BaseRequestMapping.Feedback.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<FeedbackVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts, page, size);
                int count = (int)feedbackService.getCount(filters);
                return success(feedbacks, count, page, size, FeedbackVO.class);
         }
         @GetMapping(value = BaseRequestMapping.Feedback.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<FeedbackVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<FeedbackDO> feedbacks = feedbackService.search(fields, filters, sorts);
                  return success(feedbacks, FeedbackVO.class);
         }
 }

+ 103 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/HelpCenterEndpoint.java

@ -0,0 +1,103 @@
package com.yihu.jw.patient.endpoint.settings;
import com.yihu.jw.patient.service.settings.HelpCenterService;
import com.yihu.jw.restmodel.base.dict.HelpCenterVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.*;
import java.util.List;
import com.yihu.jw.entity.base.HelpCenterDO;
/**
*
* 帮助中心控制器
*
* @version
* <pre>
 * Author	Version		Date		Changes
 * Administrator 	1.0  		2018年11月27日 	Created
 *
 * </pre>
* @since 1.
*/
@RestController
@RequestMapping(value = BaseRequestMapping.HelpCenter.PREFIX)
@Api(value = "帮助中心管理", description = "帮助中心管理服务接口", tags = {"wlyy基础服务 - 帮助中心管理服务接口"})
public class HelpCenterEndpoint extends EnvelopRestEndpoint {
@Autowired
private HelpCenterService helpCenterService;
@PostMapping(value = BaseRequestMapping.HelpCenter.CREATE)
@ApiOperation(value = "创建")
public ObjEnvelop<HelpCenterVO> create (
    @ApiParam(name = "jsonData", value = "Json数据", required = true)
    @RequestParam String jsonData) throws Exception {
    HelpCenterDO helpCenter = toEntity(jsonData, HelpCenterDO.class);
    helpCenter = helpCenterService.save(helpCenter);
    return success(helpCenter, HelpCenterVO.class);
    }
    @PostMapping(value = BaseRequestMapping.HelpCenter.DELETE)
    @ApiOperation(value = "删除")
    public Envelop delete(
    @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
    @RequestParam(value = "ids") String ids) {
    helpCenterService.delete(ids.split(","));
    return success("删除成功");
    }
    @PostMapping(value = BaseRequestMapping.HelpCenter.UPDATE)
    @ApiOperation(value = "更新")
    public ObjEnvelop<HelpCenterVO> update (
        @ApiParam(name = "jsonData", value = "Json数据", required = true)
        @RequestParam String jsonData) throws Exception {
        HelpCenterDO helpCenter = toEntity(jsonData, HelpCenterDO.class);
        if (null == helpCenter.getId()) {
        return failed("ID不能为空", ObjEnvelop.class);
        }
        helpCenter = helpCenterService.save(helpCenter);
        return success(helpCenter, HelpCenterVO.class);
        }
        @GetMapping(value = BaseRequestMapping.HelpCenter.PAGE)
        @ApiOperation(value = "获取分页")
        public PageEnvelop<HelpCenterVO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
            List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts, page, size);
                int count = (int)helpCenterService.getCount(filters);
                return success(helpCenters, count, page, size, HelpCenterVO.class);
         }
         @GetMapping(value = BaseRequestMapping.HelpCenter.LIST)
         @ApiOperation(value = "获取列表")
         public ListEnvelop<HelpCenterVO> list (
             @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
             @RequestParam(value = "fields", required = false) String fields,
             @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
             @RequestParam(value = "filters", required = false) String filters,
             @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
             @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
             List<HelpCenterDO> helpCenters = helpCenterService.search(fields, filters, sorts);
                  return success(helpCenters, HelpCenterVO.class);
         }
 }

+ 158 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/BasePatientService.java

@ -0,0 +1,158 @@
package com.yihu.jw.patient.service.personal_Info;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.personal_info.BasePatientDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
/**
 * 
 * 居民信息服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong    1.0  2018年08月31日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class BasePatientService extends BaseJpaService<BasePatientDO, BasePatientDao> {
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private PatientMedicareCardService patientMedicardCardService;
    @Autowired
    private ObjectMapper objectMapper;
    /**
     * 居民id
     * @param patientId
     * @return
     */
    public String getPatientById(String patientId) throws Exception{
        JSONObject result = new JSONObject();
        if(StringUtils.isEmpty(patientId)){
            result.put("result","parameter patientId is null");
            return result.toString();
        }
        List<BasePatientDO> patientDOList = this.findByField("id",patientId);
        if(CollectionUtils.isEmpty(patientDOList)){
            result.put("result","not exist patient for id:"+patientId);
            return result.toString();
        }
        result.put("patient",patientDOList.get(0));
        List<PatientMedicareCardDO> cards = patientMedicardCardService.findPatientCardByCode(patientId);
        result.put("medicareCard",cards);
        return result.toJSONString();
    }
    /**
     * 获取用户基础信息,参数为空查全部
     * @param nameOrIdcard
     * @param page
     * @param size
     * @param sorts
     * @return
     */
    public List<Map<String,Object>> queryPatientBaseInfo(String nameOrIdcard,int page,int size,String sorts)throws Exception{
        List<Map<String,Object>> result = new ArrayList<>();
        if(StringUtils.isEmpty(nameOrIdcard)){
            result = basePatientDao.findBaseInfo(createPage(page,size,sorts));
        }else{
            String pattern = "^\\d+";
            boolean isMatch = Pattern.matches(pattern, nameOrIdcard);
            if(isMatch){
                result = basePatientDao.findByIdcard("%"+nameOrIdcard+"%",createPage(page,size,sorts));
                return result;
            }else{
                result = basePatientDao.findByName("%"+nameOrIdcard+"%",createPage(page,size,sorts));
                return result;
            }
        }
        return result;
    }
    /**
     * 新增居民
     * @param jsonData
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public String createPatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject patient = jsonObject.getJSONObject("patient");
        JSONArray patientMedicareCards = jsonObject.getJSONArray("medicareCard");
        if(null == patient || CollectionUtils.isEmpty(patientMedicareCards)){
            return ConstantUtils.FAIL;
        }
        BasePatientDO basePatientDO = objectMapper.readValue(patient.toJSONString(),BasePatientDO.class);
        List<PatientMedicareCardDO> list = new ArrayList<>();
        patientMedicareCards.forEach((card)->{
            try {
                list.add(objectMapper.readValue(card.toString(),PatientMedicareCardDO.class));
            } catch (IOException e) {
                e.printStackTrace();
            }
        });
        this.save(basePatientDO);
        patientMedicardCardService.batchInsert(list);
        return ConstantUtils.SUCCESS;
    }
    /**
     * 修改居民
     * @param jsonData
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    public String updatePatient(String jsonData) throws Exception {
        JSONObject jsonObject = JSONObject.parseObject(jsonData);
        JSONObject patient = jsonObject.getJSONObject("patient");
        JSONArray patientMedicareCards = jsonObject.getJSONArray("medicareCard");
        if(null == patient || CollectionUtils.isEmpty(patientMedicareCards)){
            return ConstantUtils.FAIL;
        }
        BasePatientDO basePatientDO = objectMapper.readValue(patient.toJSONString(),BasePatientDO.class);
        if(StringUtils.isEmpty(basePatientDO.getId())){
            return ConstantUtils.FAIL;
        }
        // 保存修改的居民信息
        this.save(basePatientDO);
        Set<Object> cardIdList = patientMedicardCardService.findIdListByPatientCode(basePatientDO.getId());
        // 有些卡可能是新增或修改的,一条一条修改居民相关的卡的信息
        for (Object obj : patientMedicareCards) {
            PatientMedicareCardDO card = objectMapper.readValue(obj.toString(), PatientMedicareCardDO.class);
            card.setPatientCode(basePatientDO.getId());
            if(cardIdList.contains(card.getId())){
                cardIdList.remove(card.getId());
            }
            patientMedicardCardService.save(card);
        }
        // 有些卡可能是删除的
        if(cardIdList.size() > 0){
            patientMedicardCardService.delete(cardIdList.toArray());
        }
        return ConstantUtils.SUCCESS;
    }
}

+ 58 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientMedicareCardService.java

@ -0,0 +1,58 @@
package com.yihu.jw.patient.service.personal_Info;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.patient.dao.personal_info.PatientMedicareCardDao;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
 * 
 * 居民卡包服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator    1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class PatientMedicareCardService extends BaseJpaService<PatientMedicareCardDO, PatientMedicareCardDao> {
    @Autowired
    private PatientMedicareCardDao patientMedicareCardDao;
    /**
     * 根据居民标识获取居民医疗相关卡列表
     * @param patientCode
     * @return
     */
    public List<PatientMedicareCardDO> findPatientCardByCode(String patientCode){
        List<PatientMedicareCardDO> result = new ArrayList<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return patientMedicareCardDao.findByPatientCode(patientCode);
    }
    /**
     * 根据居民标识获取关联卡id列表
     * @param patientCode
     * @return
     */
    public Set<Object> findIdListByPatientCode(String patientCode){
        Set<Object> result = new HashSet<>();
        if(StringUtils.isEmpty(patientCode)){
            return result;
        }
        return patientMedicareCardDao.findIdListByPatientCode(patientCode);
    }
}

+ 22 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/AccountAppealService.java

@ -0,0 +1,22 @@
package com.yihu.jw.patient.service.settings;
import com.yihu.jw.entity.base.patient.AccountAppealDO;
import com.yihu.jw.patient.dao.settings.AccountAppealDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 账号申诉服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator    1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class AccountAppealService extends BaseJpaService<AccountAppealDO, AccountAppealDao> {
}

+ 22 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/FeedbackService.java

@ -0,0 +1,22 @@
package com.yihu.jw.patient.service.settings;
import com.yihu.jw.entity.base.patient.FeedbackDO;
import com.yihu.jw.patient.dao.settings.FeedbackDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 意见反馈服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator    1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class FeedbackService extends BaseJpaService<FeedbackDO, FeedbackDao> {
}

+ 22 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/HelpCenterService.java

@ -0,0 +1,22 @@
package com.yihu.jw.patient.service.settings;
import com.yihu.jw.entity.base.patient.HelpCenterDO;
import com.yihu.jw.patient.dao.settings.HelpCenterDao;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * 
 * 帮助中心服务service
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * Administrator    1.0  2018年11月27日 Created
 *
 * </pre>
 * @since 1.
 */
@Service
public class HelpCenterService extends BaseJpaService<HelpCenterDO, HelpCenterDao> {
}

+ 1 - 0
wlyy-lib-parent-pom/pom.xml

@ -26,6 +26,7 @@
        <module>../common/common-fegin</module>
        <module>../common/common-web</module>
        <module>../common/common-tracer</module>
        <module>../business/base-service</module>
    </modules>
</project>

+ 2 - 1
wlyy-parent-pom/pom.xml

@ -62,7 +62,8 @@
        <module>../gateway/ag-basic</module> <!-- web网关 -->
        <!--业务微服务-->
        <module>../svr/svr-base</module><!-- 基础微服务 -->
        <module>../svr/svr-base</module><!--  城市i健康-后台管理端微服务 -->
        <module>../svr/svr-patient</module><!-- 城市i健康-居民端微服务 -->
        <module>../svr/svr-iot</module><!--物联网平台-->
        <!--<module>../svr/svr-wlyy</module>-->  <!-- i健康微服务 -->
        <module>../svr/svr-wlyy-health-bank</module> <!-- 健康银行 -->