ソースを参照

Merge branch 'dev' of zd_123/patient-co-management into dev

huangwenjie 7 年 前
コミット
efd1c7699e

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -418,11 +418,11 @@ public class DataHandingService {
    }
    public void addPointOldDeviceBind()throws Exception{
        String sql = "SELECT pd.*,p.town FROM wlyy_patient_device pd LEFT JOIN wlyy_patient p ON pd.`user` = p.`code`";
        String sql = "SELECT pd.*,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0";
        List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(sql);
        Map<String,String> map = new HashedMap();
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
            if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("town")),"350205")){
            if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("hospital")).substring(0,6),"350205")){
                String deviceType=null;
                if (!map.containsKey(String.valueOf(patientDeviceMap.get("user")))) {
                    deviceType = map.get(String.valueOf(patientDeviceMap.get("user")));
@ -441,7 +441,7 @@ public class DataHandingService {
            }else if ("2".equals(entry.getValue())){
                flagStr="BP_BIND";
            }
            String creditDetail = "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+entry.getKey()+"\",\"hospital\":\"350205\"}";
            String creditDetail = "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+entry.getKey()+"\",\"hospital\":\"350205\"}";
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(creditDetail);
            com.alibaba.fastjson.JSONObject response = creditLogService.insert(jsonObject);
            String status = response.getString("status");
@ -466,7 +466,7 @@ public class DataHandingService {
            }else if (StringUtils.pathEquals("2",type)){
                flagStr = "BP_MEASURE";
            }
            String creditDetail = "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+user+"\",\"hospital\":\"350205\"}";
            String creditDetail = "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+user+"\",\"hospital\":\"350205\"}";
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(creditDetail);
            com.alibaba.fastjson.JSONObject response = creditLogService.insert(jsonObject);
            String status = response.getString("status");

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -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码查询某个居民的体征记录")