Browse Source

代码修改

liubing 3 years ago
parent
commit
79088ade89

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/prescription/BaseCarePrescriptionDO.java

@ -26,6 +26,7 @@ public class BaseCarePrescriptionDO extends UuidIdentityEntityWithCreateTime {
    private String sex;
    private String sex;
    private String age;
    private String age;
    private String photo;
    @Column(name = "patient")
    @Column(name = "patient")
    public String getPatient() {
    public String getPatient() {
@ -125,4 +126,13 @@ public class BaseCarePrescriptionDO extends UuidIdentityEntityWithCreateTime {
    public void setAge(String age) {
    public void setAge(String age) {
        this.age = age;
        this.age = age;
    }
    }
    @Transient
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
}
}

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/prescription/BaseCarePrescriptionService.java

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.prescription.BaseCarePrescriptionDO;
import com.yihu.jw.entity.care.prescription.BaseCarePrescriptionDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -111,6 +112,15 @@ public class BaseCarePrescriptionService {
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"续方记录不存在");
            result.put(ResponseContant.resultMsg,"续方记录不存在");
        }else {
        }else {
            BasePatientDO patientDO = patientDao.findById(prescriptionDO.getPatient());
            if (null!=patientDO){
                Integer sex = patientDO.getSex();
                prescriptionDO.setSex(null==sex?null:1==sex?"男":"女");
                prescriptionDO.setPhoto(patientDO.getPhoto());
                try{
                    prescriptionDO.setAge(IdCardUtil.getAgeByIdcardOrBirthday(patientDO.getIdcard(),patientDO.getBirthday())+"");
                }catch (Exception e){}
            }
            JSONObject objDo = JSONObject.parseObject(JSON.toJSONStringWithDateFormat(prescriptionDO,"yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue));
            JSONObject objDo = JSONObject.parseObject(JSON.toJSONStringWithDateFormat(prescriptionDO,"yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteMapNullValue));
            result.put(ResponseContant.resultFlag,ResponseContant.success);
            result.put(ResponseContant.resultFlag,ResponseContant.success);
            result.put(ResponseContant.resultMsg,objDo);
            result.put(ResponseContant.resultMsg,objDo);