浏览代码

修改患者端图片保存方式

chenweida 8 年之前
父节点
当前提交
b4b62d8f85

+ 13 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/Patient.java

@ -1,13 +1,17 @@
package com.yihu.wlyy.entity.patient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.yihu.wlyy.entity.IdEntity;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import org.apache.commons.lang3.builder.ToStringBuilder;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -80,6 +84,8 @@ public class Patient extends IdEntity implements Serializable {
	// 用户状态:1正常,0禁用,-1恶意注册,2审核中
	private Integer status;
	private List<SignPatientLabelInfo> labelInfos=new ArrayList<>();//患者的疾病标签list
	public Patient() {
	}
@ -319,5 +325,12 @@ public class Patient extends IdEntity implements Serializable {
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Transient
	public List<SignPatientLabelInfo> getLabelInfos() {
		return labelInfos;
	}
	public void setLabelInfos(List<SignPatientLabelInfo> labelInfos) {
		this.labelInfos = labelInfos;
	}
}

+ 27 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.service.app.sign;
import java.util.*;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -1696,6 +1697,32 @@ public class FamilyContractService extends BaseService {
        }
        sql.append(" limit "+start+","+pagesize+"");
        List<Patient> returnList= jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(Patient.class));
        //得到疾病标签
        StringBuffer dieaseSql=new StringBuffer("" +
                " select p.* from wlyy_sign_patient_label_info p where p.label_type='2' and p.status=1 and  p.patient in " +
                " (select a.patient code from wlyy_sign_family a where a.type = 2 and a.status >= 1 and a.doctor_health is null and a.doctor='"+doctor+"' order by a.czrq desc ) ");
        List<SignPatientLabelInfo> dieaseList= jdbcTemplate.query(dieaseSql.toString(),new BeanPropertyRowMapper(SignPatientLabelInfo.class));
        Map<String,List<SignPatientLabelInfo>> diseaseMap=new HashMap<>();
        if(dieaseList!=null&&dieaseList.size()>0){
            for(SignPatientLabelInfo signPatientLabelInfo:dieaseList){
                List<SignPatientLabelInfo> signPatientLabelInfoTemp= diseaseMap.get(signPatientLabelInfo.getPatient());
                if(signPatientLabelInfoTemp!=null){
                    signPatientLabelInfoTemp.add(signPatientLabelInfo);
                }else{
                    signPatientLabelInfoTemp=new ArrayList<>();
                    signPatientLabelInfoTemp.add(signPatientLabelInfo);
                }
                diseaseMap.put(signPatientLabelInfo.getPatient(),signPatientLabelInfoTemp);
            }
        }
        if(returnList!=null&&returnList.size()>0){
            for(Patient patient:returnList){
                List<SignPatientLabelInfo> signPatientLabelInfoTemp=diseaseMap.get(patient.getCode());
                patient.setLabelInfos(signPatientLabelInfoTemp);
            }
        }
        Integer allCount= jdbcTemplate.queryForObject(countSql.toString(),Integer.class);
        if(allCount%pagesize==0){
            returnMap.put("count",allCount/pagesize);

+ 9 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.message.MessageService;
@ -816,6 +817,14 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                    //json.put("signCode", sf.getCode());//签约code
                    json.put("code", sf.getCode());//患者code
                    json.put("name", sf.getName());//患者name
                    json.put("address", sf.getAddress());//患者地址
                    if(sf.getLabelInfos()!=null&&sf.getLabelInfos().size()>0){
                        List<String> lablesStirng=new ArrayList<>();
                        for(SignPatientLabelInfo signPatientLabelInfo:sf.getLabelInfos()){
                            lablesStirng.add(signPatientLabelInfo.getLabelName());
                        }
                        json.put("disease", lablesStirng);//疾病
                    }
                    String idcard = sf.getIdcard();
                    if (StringUtils.isNotBlank(idcard) && (idcard.length() == 15 || idcard.length() == 18)) {
                        json.put("age", IdCardUtil.getAgeForIdcard(idcard));//患者年龄