|
@ -433,4 +433,30 @@ public class DataHandingService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void addPointOldHealth()throws Exception{
|
|
|
String sql ="SELECT ph.`user`,sf.`name`,DATE(ph.record_date),ph.type " +
|
|
|
" FROM device.`wlyy_patient_health_index` ph LEFT JOIN wlyy.wlyy_sign_family sf ON ph.`user` = sf.patient " +
|
|
|
" WHERE ph.del=1 AND ph.record_date >'2017-07-01 00:00:00' AND ph.record_date <='2018-06-30 23:59:59' " +
|
|
|
" and LEFT(sf.hospital,6)='350205' GROUP BY DATE(ph.record_date),ph.`user`";
|
|
|
List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
String flagStr = "";
|
|
|
for (Map<String,Object> map : mapList){
|
|
|
String type = String.valueOf(map.get("type"));
|
|
|
String user = String.valueOf(map.get("user"));
|
|
|
if (!StringUtils.isEmpty(type) && StringUtils.pathEquals("1",type)){
|
|
|
flagStr = "GLU_MEASURE";
|
|
|
}else if (StringUtils.pathEquals("2",type)){
|
|
|
flagStr = "BP_MEASURE";
|
|
|
}
|
|
|
String creditDetail = "{\"tradeType\":\"HEALTH_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");
|
|
|
if (!"200".equals(status)){
|
|
|
logger.info("添加积分失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|