|
@ -18,6 +18,7 @@ import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
@ -36,6 +37,8 @@ public class DoctorHealthController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private PatientService patientService;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@RequestMapping(value = "recent",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
@ -456,6 +459,27 @@ public class DoctorHealthController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/getHealthDateAll",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("医生端--查询所有有数据的日期")
|
|
|
public String getHealthDateAll(@ApiParam(value = "居民code)", name = "patientCode") @RequestParam(value = "patientCode",required = true)String patientCode,
|
|
|
@ApiParam(value = "设备sn码", name = "deviceSn") @RequestParam(value = "deviceSn",required = true)String deviceSn,
|
|
|
@ApiParam(value = "时间(month:yyyy-MM)", name = "choseMonth") @RequestParam(value = "choseMonth",required = true)String choseMonth,
|
|
|
@ApiParam(value = "健康指标类型(1血糖,2血压,3体重,4腰围)",name = "type")@RequestParam(value = "type",required = true)int type){
|
|
|
try{
|
|
|
String sql = "select DISTINCT(DATE_FORMAT(a.record_date,'%Y-%m-%d')) result from device.wlyy_patient_health_index a where a.type="+type+" and a.`user` = '"+patientCode+"' and DATE_FORMAT(a.record_date,'%Y-%m') = '"+choseMonth+"' and a.device_sn = '"+deviceSn+"' and a.del = '1' order by a.record_date,a.id";
|
|
|
List<Map<String,Object>> reusltList = jdbcTemplate.queryForList(sql);
|
|
|
List<String> list = new ArrayList<>();
|
|
|
for (Map<String,Object> map : reusltList){
|
|
|
list.add(String.valueOf(map.get("result")));
|
|
|
}
|
|
|
return write(200, "获取健康指标记录日期成功", "data", list);
|
|
|
}catch (Exception e){
|
|
|
return invalidUserException(e, -1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/patientHealthIndexByDateAndDeviceSn",method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ApiOperation("医生端--根据时间和设备sn码查询某个居民的体征记录")
|