Browse Source

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

yeshijie 7 years ago
parent
commit
7633c24ec5

+ 202 - 0
common/common-entity/src/main/java/com/yihu/device/entity/DeviceDetail.java

@ -0,0 +1,202 @@
package com.yihu.device.entity;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by ysj on 2018/01/10.
 */
@Entity
@Table(name = "wlyy_devices")
public class DeviceDetail extends IdEntity{
    private String deviceName;
    private String deviceModel;
    private String deviceCode;
    private String manufacturer;
    private String applyDate;;
    private String orgName;
    private String linkman;
    private String tel;
    private String serverIp;
    private String manufacturerCode;
    private String address;
    private String representative;
    private String applicantName;
    private String applicantIdentity;
    private String applicantTel;
    private String applicantMail;
    /** default constructor */
    public DeviceDetail() {
    }
    /** full constructor */
    public DeviceDetail(String deviceName, String deviceModel, String deviceCode, String manufacturer, String applyDate
            , String orgName, String linkman, String tel, String serverIp, String manufacturerCode, String address
            , String representative, String applicantName, String applicantIdentity, String applicantTel, String applicantMail) {
        this.deviceName = deviceName;
        this.deviceModel = deviceModel;
        this.deviceCode = deviceCode;
        this.manufacturer = manufacturer;
        this.applyDate = applyDate;
        this.orgName = orgName;
        this.linkman = linkman;
        this.tel = tel;
        this.serverIp = serverIp;
        this.manufacturerCode = manufacturerCode;
        this.address = address;
        this.representative = representative;
        this.applicantName = applicantName;
        this.applicantIdentity = applicantIdentity;
        this.applicantTel = applicantTel;
        this.applicantMail = applicantMail;
    }
    @Column(name = "device_name")
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    @Column(name = "device_model")
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    @Column(name = "device_code")
    public String getDeviceCode() {
        return deviceCode;
    }
    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }
    @Column(name = "manufacturer")
    public String getManufacturer() {
        return manufacturer;
    }
    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }
    @Column(name = "apply_date")
    public String getApplyDate() {
        return applyDate;
    }
    public void setApplyDate(String applyDate) {
        this.applyDate = applyDate;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    @Column(name = "linkman")
    public String getLinkman() {
        return linkman;
    }
    public void setLinkman(String linkman) {
        this.linkman = linkman;
    }
    @Column(name = "tel")
    public String getTel() {
        return tel;
    }
    public void setTel(String tel) {
        this.tel = tel;
    }
    @Column(name = "server_ip")
    public String getServerIp() {
        return serverIp;
    }
    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }
    @Column(name = "manufacturerCode")
    public String getManufacturerCode() {
        return manufacturerCode;
    }
    public void setManufacturerCode(String manufacturerCode) {
        this.manufacturerCode = manufacturerCode;
    }
    @Column(name = "address")
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    @Column(name = "representative")
    public String getRepresentative() {
        return representative;
    }
    public void setRepresentative(String representative) {
        this.representative = representative;
    }
    @Column(name = "applicant_name")
    public String getApplicantName() {
        return applicantName;
    }
    public void setApplicantName(String applicantName) {
        this.applicantName = applicantName;
    }
    @Column(name = "applicant_identity")
    public String getApplicantIdentity() {
        return applicantIdentity;
    }
    public void setApplicantIdentity(String applicantIdentity) {
        this.applicantIdentity = applicantIdentity;
    }
    @Column(name = "applicant_tel")
    public String getApplicantTel() {
        return applicantTel;
    }
    public void setApplicantTel(String applicantTel) {
        this.applicantTel = applicantTel;
    }
    @Column(name = "applicant_mail")
    public String getApplicantMail() {
        return applicantMail;
    }
    public void setApplicantMail(String applicantMail) {
        this.applicantMail = applicantMail;
    }
}

+ 9 - 18
patient-co-manage/redis-cache/src/main/java/com/yihu/wlyy/task/RedisScheduledTask.java

@ -36,9 +36,6 @@ import java.util.List;
 * @date 2017/12/6 09:22
 */
@Component
//@RestController
//@RequestMapping(value = ApiVersion.Version1_0)
//@Api(description = "定时任务", tags = {"缓存服务管理--定时任务"})
public class RedisScheduledTask {
    Logger logger = LoggerFactory.getLogger(RedisScheduledTask.class);
@ -48,18 +45,14 @@ public class RedisScheduledTask {
    @Value("${ehr-redis.cache.memory.outFilePath}")
    private String outFilePath;
    // 生产环境服务器不允许代码直接通过SSH访问服务器,故暂时注释,另寻方法。
//    @Value("${ehr-redis.server.host}")
//    private String redisServerHost;
//    @Value("${ehr-redis.server.username}")
//    private String redisServerUsername;
//    @Value("${ehr-redis.server.password}")
//    private String redisServerPwd;
//    @Value("${ehr-redis.server.ssh-port}")
//    private int redisServerSshPort;
    private String redisServerHost = "";
    private String redisServerUsername = "";
    private String redisServerPwd = "";
    private int redisServerSshPort = 22;
    @Value("${ehr-redis.server.host}")
    private String redisServerHost;
    @Value("${ehr-redis.server.username}")
    private String redisServerUsername;
    @Value("${ehr-redis.server.password}")
    private String redisServerPwd;
    @Value("${ehr-redis.server.ssh-port}")
    private int redisServerSshPort;
    @Autowired
    private RedisCacheKeyMemoryService redisCacheKeyMemoryService;
@ -69,7 +62,6 @@ public class RedisScheduledTask {
    /**
     * 生成 Redis 快照
     */
//    @RequestMapping(value = "/redis/cache/statistics/backupRedis", method = RequestMethod.GET)
    @Scheduled(cron = "0 0 0 15 * ?")
    public void backupRedis() {
        redisTemplate.execute(new RedisCallback() {
@ -85,14 +77,13 @@ public class RedisScheduledTask {
    /**
     * 导出 redis 内存分析报告,并导入到数据库
     */
//    @RequestMapping(value = "/redis/cache/statistics/exportAndImportRedisMemoryData", method = RequestMethod.GET)
    @Scheduled(cron = "0 30 0 15 * ?")
    public void exportAndImportRedisMemoryData() {
        long start = System.currentTimeMillis();
        try {
            // 导出内存分析报告CSV文件(得到的内存值是近似值,比实际略小)
            // 生产环境服务器不允许代码直接通过SSH访问服务器,故暂时注释,另寻方法。
//            exportRedisMemoryReport();
            exportRedisMemoryReport();
            long export = System.currentTimeMillis();
            logger.info("成功导出Redis内存分析报告,耗时:" + (export - start) + " 毫秒");

+ 6 - 5
patient-co-manage/redis-cache/src/main/resources/application.yml

@ -43,9 +43,9 @@ spring:
      password: 123456
  redis:
    host: 172.19.103.47 # Redis server host.
    host: 172.19.103.88 # Redis server host.
    port: 6379
    password: redis!@456
    password:
fast-dfs:
  tracker-server: 172.19.103.13:22122
@ -57,13 +57,14 @@ ehr-redis:
      responseTimeChannel: redis.cache.reponse-time
  cache:
    memory:
      rdbFilePath: /usr/local/bin/dump.rdb
#      rdbFilePath: /usr/local/bin/dump.rdb
      rdbFilePath: /usr/local/redis/bin/dump.rdb
      outFilePath: /usr/local/ehr/redisReport/
      filename: memory.csv
  server:
    host: 172.19.103.47
    host: 172.19.103.88
    username: root
    password: jkzl
    password: ceshi
    ssh-port: 22
---
spring:

+ 2 - 1
patient-co-manage/redis-cache/src/main/webapp/WEB-INF/views/redis/cache/category/listJs.jsp

@ -112,10 +112,11 @@
        /*-- 与明细 Dialog 页面间回调的函数 --*/
        window.reloadMasterGrid = function() {
            reloadGrid();
        };
        window.closeDetailDialog = function (type, msg) {
            detailDialog.close();
            reloadGrid();
            msg && $.Notice.success(msg);
        };
    });

+ 15 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DeviceDetailDao.java

@ -0,0 +1,15 @@
package com.yihu.wlyy.health.repository;
import com.yihu.device.entity.DeviceDetail;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/10.
 */
public interface DeviceDetailDao extends PagingAndSortingRepository<DeviceDetail, Long>, JpaSpecificationExecutor<DeviceDetail> {
    @Query(value = "select a.* from device.wlyy_devices a where a.device_code=?1 limit 0,1",nativeQuery = true)
    DeviceDetail findBySn(String sn);
}

+ 51 - 14
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.app.device;
import com.yihu.device.entity.DeviceDetail;
import com.yihu.wlyy.entity.device.Device;
import com.yihu.wlyy.entity.device.PatientBloodSugger;
import com.yihu.wlyy.entity.device.PatientDevice;
@ -7,6 +8,7 @@ import com.yihu.wlyy.entity.device.PatientHealthTime;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.health.repository.DeviceDetailDao;
import com.yihu.wlyy.repository.deviece.DeviceDao;
import com.yihu.wlyy.repository.deviece.PatientBloodSuggerDao;
import com.yihu.wlyy.repository.deviece.PatientHealthTimeDao;
@ -57,7 +59,8 @@ public class PatientDeviceService extends BaseService {
    @Autowired
    private DoctorAdminTeamMemberDao doctorAdminTeamMemberDao;
    @Autowired
    private DeviceDetailDao deviceDetailDao;
    @Autowired
    private AdminTeamService adminTeamService;
    @Autowired
@ -76,6 +79,34 @@ public class PatientDeviceService extends BaseService {
    private String registerDevice = "DeviceGateway/DeviceApi/registerDevice";//注册设备
    /**
     * 验证sn码 先调总部接口 未注册才查询本地数据库,如果也没有才不能绑定
     * @param deviceSn
     * @return
     * @throws Exception
     */
    public Boolean checkDeviceSn(String deviceSn) throws Exception{
        Boolean flag = false;
        Map<String, String> params = new HashMap<>();
        params.put("deviceSn", deviceSn);
        //调用服务
        String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
        System.out.println("注册设备=" + response);
        JSONObject json = new JSONObject(response);
        String code = json.get("Code").toString();
        //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
        if ("10000".equals(code) || "10001".equals(code)) {
            flag = true;
        } else {
            DeviceDetail deviceDetail = deviceDetailDao.findBySn(deviceSn);
            if(deviceDetail != null){
                flag = true;
            }
        }
        return flag;
    }
    /**
     * 保存患者设备
     */
@ -117,20 +148,26 @@ public class PatientDeviceService extends BaseService {
            Patient patient = patientDao.findByCode(patientDevice.getUser());
            patientDevice.setUserIdcard(patient.getIdcard());
            //注册设备
            Map<String, String> params = new HashMap<>();
            params.put("deviceSn", sn);
            //调用服务
            String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
            System.out.println("注册设备=" + response);
            JSONObject json = new JSONObject(response);
            String code = json.get("Code").toString();
            //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
            if ("10000".equals(code) || "10001".equals(code)) {
//            //注册设备
//            Map<String, String> params = new HashMap<>();
//            params.put("deviceSn", sn);
//
//            //调用服务
//            String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
//            System.out.println("注册设备=" + response);
//            JSONObject json = new JSONObject(response);
//            String code = json.get("Code").toString();
//            //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
//            if ("10000".equals(code) || "10001".equals(code)) {
//                patientDeviceDao.save(patientDevice);
//            } else {
//                String message = json.get("Message").toString();
//                throw new Exception(message);
//            }
            if(checkDeviceSn(sn)){
                patientDeviceDao.save(patientDevice);
            } else {
                String message = json.get("Message").toString();
            }else {
                String message = "设备不存在";
                throw new Exception(message);
            }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -908,7 +908,7 @@ public class PatientHealthIndexService extends BaseService {
            }
    
            obj = patientHealthIndexDao.save(obj);
    
            //判断是否有未结束的续方咨询,发送消息给对应的医生
            sendPrescriptionHealthIndexMsgresult(obj,patient);
    

+ 95 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/iot/IotDeviceService.java

@ -1,7 +1,11 @@
package com.yihu.wlyy.service.third.iot;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.device.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,13 +22,92 @@ import java.util.List;
public class IotDeviceService {
//    @Value("${}")
    private String baseUrl = "https://iot.xmtyw.cn/";
    private String grantType = "client_credentials&";
    private String clientId = "Va5yQRHlA4Fq4eR3LT0vuXV4&";
    private String baseUrl = "http://192.168.131.24:8080/svr-iot/";
    private String grantType = "client_credentials";
    private String clientId = "Va5yQRHlA4Fq4eR3LT0vuXV4";
    private String clientSecret = "0rDSjzQ20XUj5itV7WRtznPQSzr5pVw2";
    private String dataSource = "iHealth";
    private String accessToken = "test";
    private String bloodSugarUnit = "mmol/L";
    private String bloodPressureUnit = "mmHg";
    private String pulseUnit = "bpm";
    private String heightUnit = "cm";
    private String weightUnit = "kg";
    private String bmiUnit = "kg/m^2";
    private String waistUnit = "cm";
    @Autowired
    private HttpClientUtil httpClientUtil;
    private String accessToken = "";
    /**
     * 将上传数据转换成标准的json传
     * @param obj
     * @param userType
     * @return
     */
    public DevicePatientHealthIndex upload(DevicePatientHealthIndex obj,String userType,String deviceName,String deviceModel,Patient patient){
        JSONObject json = new JSONObject();
        json.put("sn",obj.getDeviceSn());
        json.put("ext_code",userType);
        json.put("device_name",deviceName);
        json.put("device_model",deviceModel);
        json.put("idcard",patient.getIdcard());
        json.put("username",patient.getName());
        json.put("usercode",patient.getCode());
        JSONArray jsonArray = new JSONArray();
        JSONObject js = new JSONObject();
        js.put("measure_time",obj.getRecordDate());
        switch (obj.getType()){
            case 1:
                //血糖
                js.put("blood_sugar",obj.getValue1());
                js.put("blood_sugar_unit",bloodSugarUnit);
                js.put("blood_sugar_result",obj.getValue2());
                break;
            case 2:
                //血压
                js.put("systolic",obj.getValue1());
                js.put("systolic_unit",bloodPressureUnit);
                js.put("diastolic",obj.getValue2());
                js.put("diastolic_unit",bloodPressureUnit);
                if(StringUtils.isNotBlank(obj.getValue3())){
                    js.put("pulse",obj.getValue3());
                    js.put("pulse_unit",pulseUnit);
                }
                break;
            case 3:
                //体重/身高/BMI
                js.put("height",obj.getValue1());
                js.put("height_unit",heightUnit);
                js.put("weight",obj.getValue2());
                js.put("weight_unit",weightUnit);
                if(StringUtils.isNotBlank(obj.getValue3())){
                    js.put("bmi",obj.getValue3());
                    js.put("bmi_unit",bmiUnit);
                }
                break;
            case 4:
                //腰围
                js.put("waist",obj.getValue1());
                js.put("waist_unit",waistUnit);
                break;
            default:
                break;
        }
        jsonArray.add(js);
        json.put("data",jsonArray);
        //上传
        String response = upload(json);
        JSONObject re = JSONObject.parseObject(response);
        String errorMsg = re.getString("errorMsg");//错误信息(请求失败才有错误消息)
        String successMsg = re.getString("successMsg");//成功信息(请求成功才有成功消息)
        if(StringUtils.isBlank(errorMsg)){
            re.getJSONObject("obj").getString("id");
        }
        return obj;
    }
    public String getAccessToken(){
@ -44,7 +127,8 @@ public class IotDeviceService {
     */
    public String registedevice(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/registedevice";
        json.put("data_source",dataSource);
        String url = baseUrl+"/dataInput/userBind";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
@ -58,11 +142,12 @@ public class IotDeviceService {
     */
    public String upload(JSONObject json){
        json.put("access_token",accessToken);
        String url = baseUrl+"/upload";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("json",json.toString()));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return null;
        json.put("data_source",dataSource);
        String url = baseUrl+"/dataInput/input";
        org.json.JSONObject params = new org.json.JSONObject();
        params.put("json_data",json.toString());
        String response = httpClientUtil.postBody(url, params);
        return response;
    }
    /**

+ 19 - 15
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/device/PatientDeviceController.java

@ -123,22 +123,26 @@ public class PatientDeviceController extends BaseController {
                        throw new Exception("sn码" + newDeviceSN + "已被使用!");
                    }
                    //注册设备
                    Map<String, String> params = new HashMap<>();
                    params.put("deviceSn", newDeviceSN);
                    //调用服务
                    String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
                    System.out.println("注册设备=" + response);
                    JSONObject json = new JSONObject(response);
                    String code = json.get("Code").toString();
                    //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
                    if ("10000".equals(code) || "10001".equals(code)) {
                    } else {
                        String message = json.get("Message").toString();
                        return error(-1,message);
                    if(!patientDeviceService.checkDeviceSn(newDeviceSN)){
                        return error(-1,"设备不存在");
                    }
//                    //注册设备
//                    Map<String, String> params = new HashMap<>();
//                    params.put("deviceSn", newDeviceSN);
//
//                    //调用服务
//                    String response = HttpClientUtil.httpPost(url + registerDevice, HttpClientUtil.getSecretParams(params, appid, secret));
//                    System.out.println("注册设备=" + response);
//                    JSONObject json = new JSONObject(response);
//                    String code = json.get("Code").toString();
//                    //10000注册成功 10001已注册 -10000参数不通过(没传参数) -10001设备不存在 -10002设备未出库
//                    if ("10000".equals(code) || "10001".equals(code)) {
//
//                    } else {
//                        String message = json.get("Message").toString();
//                        return error(-1,message);
//                    }
                }
                if ("1".equals(categoryCode)) {
//                        先修改患者设备绑定表

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -39,7 +39,7 @@ public class PatientHealthController extends BaseController {
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("患者最近的各项健康信息")
    @ApiOperation("更改接口(包括手动记录的修改和所有的删除)")
    public String modify(@RequestParam long id,
                         @RequestParam(required = false) String recordDate,
                         @RequestParam(required = false) String value1,

+ 29 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/iot/IotDeviceController.java

@ -6,10 +6,12 @@ import com.yihu.wlyy.service.third.iot.IotDeviceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@ -34,7 +36,7 @@ public class IotDeviceController extends BaseController{
            js.put("device_name","血压计-康为A206G");
            js.put("device_model","血压计-康为A206G");
            js.put("idcard","350429198905194016");
            js.put("username","邹林");
            js.put("username","小李");
            js.put("manufacture_code","");
            js.put("manufacture_name","");
            js.put("owner_org_code","");
@ -55,6 +57,20 @@ public class IotDeviceController extends BaseController{
        }
    }
    @RequestMapping(value = "/upload",method = RequestMethod.POST)
    @ApiOperation("体征数据上传")
    public String upload(@ApiParam(name = "jsonStr",value = "jsonStr",defaultValue = "")
                         @RequestParam(value = "jsonStr",required = true) String jsonStr){
        try {
            JSONObject json = JSONObject.parseObject(jsonStr);
            String re = iotDeviceService.upload(json);
            return write(200, "体征数据上传成功!", "data", re);
        }catch (Exception e){
            error(e);
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "/upload1",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    public String upload1(){
@ -64,8 +80,13 @@ public class IotDeviceController extends BaseController{
            js.put("measure_time","2018-01-01 01:01:01");
            js.put("systolic","111");
            js.put("systolic_unit","mmHg");
            js.put("diastolic","60");
            js.put("diastolic_unit","mmHg");
            js.put("pulse","66");
            js.put("pulse_unit","bpm");
            js.put("del","1");
            js.put("status","0");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
@ -77,7 +98,7 @@ public class IotDeviceController extends BaseController{
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
            return write(200, "上传成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
@ -85,25 +106,27 @@ public class IotDeviceController extends BaseController{
    }
    @RequestMapping(value = "/upload2",method = RequestMethod.POST)
    @ApiOperation("不含居民身份的数据上传协议")
    @ApiOperation("含居民身份的数据上传协议")
    public String upload2(){
        try {
            JSONObject json = new JSONObject();
            JSONObject js = new JSONObject();
            js.put("measure_time","2018-01-01 11:01:01");
            js.put("blood_sugar","6.7");
            js.put("blood_sugar_unit","mmol/L");
            js.put("del","1");
            js.put("status","0");
            JSONArray jsonArray = new JSONArray();
            jsonArray.add(js);
            json.put("data",jsonArray);
            json.put("data",jsonArray);
            json.put("sn","2638234828");
            json.put("ext_code","1");
            json.put("device_name","血压计-康为A206G");
            json.put("device_model","血压计-康为A206G");
            json.put("idcard","350429198905194016");
            json.put("username","邹林");
            json.put("username","小李");
            String re = iotDeviceService.upload(json);
            return write(200, "注册设备成功!", "data", re);
            return write(200, "上传成功!", "data", re);
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());