Explorar o código

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

trick9191 %!s(int64=6) %!d(string=hai) anos
pai
achega
fbc8c97023

+ 2 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/servicePackage/ServicePackageLogVO.java

@ -1,5 +1,6 @@
package com.yihu.jw.restmodel.base.servicePackage;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -105,6 +106,7 @@ public class ServicePackageLogVO implements Serializable {
        this.id = id;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime() {
        return createTime;
    }

+ 9 - 4
svr/svr-base/src/main/java/com/yihu/jw/base/service/servicePackage/ServicePackageService.java

@ -1,5 +1,6 @@
package com.yihu.jw.base.service.servicePackage;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.elasticsearch.ElasticSearchHelper;
import com.yihu.elasticsearch.ElasticSearchUtil;
import com.yihu.jw.base.dao.servicePackage.ServicePackageDao;
@ -46,6 +47,8 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    private ElasticSearchUtil elasticSearchUtil;
    @Autowired
    private ElasticSearchHelper elastricSearchHelper;
    @Autowired
    private ObjectMapper objectMapper;
    @Value("${es.index.servicePackLog}")
    private String servicePackLongIndex;
@ -86,15 +89,17 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
        logVO.setFlag(ServicePackageLogVO.Flag.success.getValue());
        logVO.setFinish(0);
        logVO.setId(getCode());
        logVO.setMessage(signRecordDO.getSignDoctorName()+"新增了一条康复计划");
        String message = "新增了一条康复计划";
        if(StringUtils.isNotBlank(signRecordDO.getSignDoctorName())){
            message = signRecordDO.getSignDoctorName()+message;
        }
        logVO.setMessage(message);
        logVO.setSaasId(servicePackageVO.getSaasId());
        logVO.setSevicePackageId(servicePackageDO.getId());
        logVO.setUserType(ServicePackageLogVO.UserType.doctor.getValue());
        logVO.setUserCode(signRecordDO.getSignDoctor());
        logVO.setUserName(signRecordDO.getSignDoctorName());
        List<ServicePackageLogVO> logVOList = new ArrayList<>(1);
        logVOList.add(logVO);
        elastricSearchHelper.save(servicePackLongIndex,servicePackLongType,logVOList);
        elastricSearchHelper.save(servicePackLongIndex,servicePackLongType, objectMapper.writeValueAsString(logVO));
        return servicePackageDO;
    }

+ 10 - 2
svr/svr-base/src/main/resources/bootstrap.yml

@ -20,7 +20,7 @@ spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://172.17.110.212:1221}
      uri: ${wlyy.spring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
@ -28,5 +28,13 @@ spring:
  profiles: prod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://192.168.120.153:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.120.153:1221}
      label: ${wlyy.spring.config.label:prod}
---
spring:
  profiles: local
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.153:1221}
      label: ${wlyy.spring.config.label:local}

+ 12 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/UserDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.healthyhouse.dao;
import com.yihu.jw.healthyhouse.model.user.User;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author HZY
 * @created 2018/9/18 19:21
 */
public interface UserDao extends PagingAndSortingRepository<User, String>, JpaSpecificationExecutor<User> {
}

+ 59 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/IdEntity.java

@ -0,0 +1,59 @@
package com.yihu.jw.healthyhouse.model;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.util.Date;
/**
 *  jpa基类
 *
 * @author HZY
 * @created 2018/9/18 17:11
 */
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public class IdEntity implements java.io.Serializable{
    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    protected String id;  // 非业务主键
    @CreatedDate
    @Column(name = "create_date", nullable = false, length = 0,updatable = false)
    protected Date createDate;
    @LastModifiedDate
    @Column(name = "modify_date", nullable = false, length = 0)
    protected Date modifyDate;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public Date getCreateDate() {
        return createDate;
    }
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
    public Date getModifyDate() {
        return modifyDate;
    }
    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }
}

+ 150 - 0
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/model/user/User.java

@ -0,0 +1,150 @@
package com.yihu.jw.healthyhouse.model.user;
import com.yihu.jw.healthyhouse.model.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * @author HZY
 * @created 2018/9/18 17:07
 */
@Entity
@Table(name = "user")
public class User extends IdEntity implements Serializable{
    @Column(name = "login_code", nullable = false)
    private String loginCode;
    @Column(name = "name", nullable = false)
    private String name;
    @Column(name = "password", nullable = false)
    private String password;
    @Column(name = "gender", nullable = false)
    private String gender;
    @Column(name = "birthday", nullable = false)
    private Date birthday;
    @Column(name = "id_card_no", nullable = false)
    private String idCardNo;
    @Column(name = "telephone", nullable = false)
    private String telephone;
    @Column(name = "last_login_time", nullable = false, length = 0)
    private String lastLoginTime;
    @Column(name = "img_remote_path", nullable = false)
    private String imgRemotePath;   //头像地址
    @Column(name = "user_type", nullable = false)
    private String userType;         //用户类型
    @Column(name = "activated", nullable = false)
    private Integer activated;       //用户状态 0冻结,1激活
    @Column(name = "province_code", nullable = false)
    private String provinceCode;    //省编码
    @Column(name = "city_code", nullable = false)
    private String cityCode;        //市编码
    public String getLoginCode() {
        return loginCode;
    }
    public void setLoginCode(String loginCode) {
        this.loginCode = loginCode;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getGender() {
        return gender;
    }
    public void setGender(String gender) {
        this.gender = gender;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public String getIdCardNo() {
        return idCardNo;
    }
    public void setIdCardNo(String idCardNo) {
        this.idCardNo = idCardNo;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getLastLoginTime() {
        return lastLoginTime;
    }
    public void setLastLoginTime(String lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
    public String getImgRemotePath() {
        return imgRemotePath;
    }
    public void setImgRemotePath(String imgRemotePath) {
        this.imgRemotePath = imgRemotePath;
    }
    public String getUserType() {
        return userType;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }
    public Integer getActivated() {
        return activated;
    }
    public void setActivated(Integer activated) {
        this.activated = activated;
    }
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
    public String getCityCode() {
        return cityCode;
    }
    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }
}

+ 27 - 18
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -238,12 +238,17 @@ public class RehabilitationManageService {
            Integer familyFinishCount1 = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor")+"",patientCode);
            Integer familyServiceCount1 = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor")+"",patientCode,1);
            Integer familyUnfinishCount2 = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor_health")+"",patientCode,1);
            Integer familyFinishCount2 = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor_health")+"",patientCode);
            Integer familyServiceCount2 = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor_health")+"",patientCode,1);
            if((signFamilyMap.get("doctor")+"").equals(signFamilyMap.get("doctor_health")+"")){
                resultMap.put("signFamilyFinishItemCount",familyFinishCount1-familyUnfinishCount1);//完成项目
                resultMap.put("signFamilyServiceRecordCount",familyServiceCount1);//服务次数
            }else{
                Integer familyUnfinishCount2 = rehabilitationDetailDao.unfinishItemByDoctor(signFamilyMap.get("doctor_health")+"",patientCode,1);
                Integer familyFinishCount2 = rehabilitationDetailDao.findItemByDoctor(signFamilyMap.get("doctor_health")+"",patientCode);
                Integer familyServiceCount2 = rehabilitationDetailDao.completeServiceByDoctor(signFamilyMap.get("doctor_health")+"",patientCode,1);
            resultMap.put("signFamilyFinishItemCount",familyFinishCount1-familyUnfinishCount1+familyFinishCount2-familyUnfinishCount2);//完成项目
            resultMap.put("signFamilyServiceRecordCount",familyServiceCount1+familyServiceCount2);//服务次数
                resultMap.put("signFamilyFinishItemCount",familyFinishCount1-familyUnfinishCount1+familyFinishCount2-familyUnfinishCount2);//完成项目
                resultMap.put("signFamilyServiceRecordCount",familyServiceCount1+familyServiceCount2);//服务次数
            }
            //基础信息
            resultMap.put("hospitalName",signFamilyMap.get("hospital_name"));
@ -678,6 +683,23 @@ public class RehabilitationManageService {
        //服务医生
        //完成项目=全部的服务项目-未完成的服务项目
        List<Map<String,Object>> serviceDoctorList = new ArrayList<>();
        //全科医生和健管师要是同一个人,就显示全科医生
        if(!generalDoctor.equals(healthDoctor)){
            if(StringUtils.isNotEmpty(healthDoctor)){
                Map<String,Object> healthDoctorMap =  new HashMap<>();
                healthDoctorMap.put("type","健管师");
                healthDoctorMap.put("doctorName",healthDoctorName);
                healthDoctorMap.put("doctorCode",healthDoctor);
                Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
                Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
                Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
                healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
                healthDoctorMap.put("serviceCount",healthServiceCount);
                serviceDoctorList.add(healthDoctorMap);
            }
        }
        if(StringUtils.isNotEmpty(generalDoctor)){
            Map<String,Object> generalDoctorMap =  new HashMap<>();
@ -691,19 +713,6 @@ public class RehabilitationManageService {
            generalDoctorMap.put("serviceCount",generalServiceCount);
            serviceDoctorList.add(generalDoctorMap);
        }
        if(StringUtils.isNotEmpty(healthDoctor)){
            Map<String,Object> healthDoctorMap =  new HashMap<>();
            healthDoctorMap.put("type","健管师");
            healthDoctorMap.put("doctorName",healthDoctorName);
            healthDoctorMap.put("doctorCode",healthDoctor);
            Integer healthUnfinishCount = rehabilitationDetailDao.unfinishItemByDoctor(healthDoctor,patientCode,1);
            Integer healthFinishCount = rehabilitationDetailDao.findItemByDoctor(healthDoctor,patientCode);
            Integer healthServiceCount = rehabilitationDetailDao.completeServiceByDoctor(healthDoctor,patientCode,1);
            healthDoctorMap.put("finishedItem",healthFinishCount-healthUnfinishCount);
            healthDoctorMap.put("serviceCount",healthServiceCount);
            serviceDoctorList.add(healthDoctorMap);
        }
//        String specialistRelationSql = "select * from wlyy_specialist.wlyy_specialist_patient_relation where patient='"+patientCode+"' and sign_status='1' and status >=0  ";
        String specialistRelationSql = "select DISTINCT d.doctor,d.doctor_name from wlyy_specialist.wlyy_rehabilitation_plan_detail d LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id where d.type=2 and  p.patient='"+patientCode+"'";