yeshijie vor 7 Jahren
Ursprung
Commit
51597c3a5c

+ 16 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -649,22 +649,23 @@ public class PrenatalInspectorPreCardService extends BaseService {
        if(StringUtils.isNotBlank(preCard.getHeight())&&StringUtils.isNotBlank(preCard.getWeight())){
            //先判断体征数据是否变更
            DevicePatientHealthIndex index = healthIndexDao.findLastData(patientCode, 3);
            String height = null;
            String weight = null;
            if(index!=null){
                String height = index.getValue2();
                String weight = index.getValue1();
                if(!preCard.getHeight().equals(height)||!preCard.getWeight().equals(weight)){
                    //更新体征数据
                    JSONObject json = new JSONObject();
                    json.put("time",DateUtil.dateToStrLong(preCard.getCzrq()));
                    json.put("height",preCard.getHeight());
                    json.put("weight",preCard.getWeight());
                    try {
                        healthIndexService.addPatientHealthIndex(json.toString(), "3", patientCode, null);
                    }catch (Exception e){
                        e.printStackTrace();
                        logger.error("预建卡时 保存体征数据失败。。。");
                    }
                height = index.getValue2();
                weight = index.getValue1();
            }
            if(!preCard.getHeight().equals(height)||!preCard.getWeight().equals(weight)){
                //更新体征数据
                JSONObject json = new JSONObject();
                json.put("time",DateUtil.dateToStrLong(preCard.getCzrq()));
                json.put("height",preCard.getHeight());
                json.put("weight",preCard.getWeight());
                try {
                    healthIndexService.addPatientHealthIndex(json.toString(), "3", patientCode, null);
                }catch (Exception e){
                    e.printStackTrace();
                    logger.error("预建卡时 保存体征数据失败。。。");
                }
            }
        }