| 
															
																@ -6,14 +6,12 @@ import com.yihu.device.entity.DevicePatientHealthIndex; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.entity.device.PatientDevice; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.device.PatientDevice; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.entity.message.Message; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.message.Message; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.entity.patient.Patient; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.patient.Patient; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.patient.PatientAimSports; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.entity.patient.PatientHealthStandard; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.patient.PatientHealthStandard; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.entity.patient.SignFamily; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.entity.patient.SignFamily; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.repository.message.MessageDao; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.repository.message.MessageDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.repository.patient.PatientDao; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.repository.patient.PatientDeviceDao; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.repository.patient.PatientHealthStandardDao; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.repository.patient.SignFamilyDao; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import com.yihu.wlyy.repository.patient.*; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.service.BaseService; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.service.BaseService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import com.yihu.wlyy.task.HealthIndexUploadTask; 
															 | 
															
															 | 
															
																import com.yihu.wlyy.task.HealthIndexUploadTask; 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -40,6 +38,7 @@ import org.springside.modules.persistence.SearchFilter; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springside.modules.persistence.SearchFilter.Operator; 
															 | 
															
															 | 
															
																import org.springside.modules.persistence.SearchFilter.Operator; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import org.springside.modules.utils.Clock; 
															 | 
															
															 | 
															
																import org.springside.modules.utils.Clock; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																import java.text.DecimalFormat; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import java.text.SimpleDateFormat; 
															 | 
															
															 | 
															
																import java.text.SimpleDateFormat; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																import java.util.*; 
															 | 
															
															 | 
															
																import java.util.*; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -59,22 +58,20 @@ public class PatientHealthIndexService extends BaseService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private MessageDao messageDao; 
															 | 
															
															 | 
															
																    private MessageDao messageDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private JdbcTemplate jdbcTemplate; 
															 | 
															
															 | 
															
																    private JdbcTemplate jdbcTemplate; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private SignFamilyDao signFamilyDao; 
															 | 
															
															 | 
															
																    private SignFamilyDao signFamilyDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private ObjectMapper objectMapper; 
															 | 
															
															 | 
															
																    private ObjectMapper objectMapper; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private PatientDeviceDao patientDeviceDao; 
															 | 
															
															 | 
															
																    private PatientDeviceDao patientDeviceDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private DoctorWorkTimeService doctorWorkTimeService; 
															 | 
															
															 | 
															
																    private DoctorWorkTimeService doctorWorkTimeService; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private CommonUtil CommonUtil; 
															 | 
															
															 | 
															
																    private CommonUtil CommonUtil; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    @Autowired 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    private PushMsgTask pushMsgTask; 
															 | 
															
															 | 
															
																    private PushMsgTask pushMsgTask; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    @Autowired 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    private PatientAimSportsDao patientAimSportsDao; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -724,7 +721,36 @@ public class PatientHealthIndexService extends BaseService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                case "3": { 
															 | 
															
															 | 
															
																                case "3": { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setType(3); 
															 | 
															
															 | 
															
																                    obj.setType(3); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    obj.setValue1(map.get("weight")); //体重 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    String weight = map.get("weight"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    String height = map.get("height"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    obj.setValue1(weight); //体重 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    obj.setValue2(height); //身高 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    PatientAimSports patientAimSports = new PatientAimSports(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    patientAimSports = patientAimSportsDao.getPatientAimSportsByPatientCode(patientCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    //如果该患者没有设置运动目标,则获取预置数据 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    if(patientAimSports == null || StringUtils.isBlank(patientAimSports.getCode())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        patientAimSports = patientAimSportsDao.findByCode("default"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    double bmi = CommonUtil.getBMIByWeightAndHeight(map.get("weight"),map.get("height")); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    DecimalFormat df1 = new DecimalFormat("###.00"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    obj.setValue3(df1.format(bmi)); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    if(patientAimSports != null && StringUtils.isNoneEmpty(patientAimSports.getCode())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        //设置BMI值 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        if(bmi < Double.parseDouble(patientAimSports.getBmiMin())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            obj.setValue4("1"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        }else if(bmi > Double.parseDouble(patientAimSports.getBmiMax())){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            obj.setValue4("-1"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            obj.setValue4("0"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                    break; 
															 | 
															
															 | 
															
																                    break; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                } 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                case "4": { 
															 | 
															
															 | 
															
																                case "4": { 
															 |