Kaynağa Gözat

Merge branch 'dev' of shikejing/wlyy2.0 into dev

shikejing 3 yıl önce
ebeveyn
işleme
b7fc67506e

+ 1 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PadDeviceController.java

@ -108,9 +108,6 @@ public class PadDeviceController extends BaseController {
                             @RequestParam(value = "json", required = true) String json,
                             @ApiParam(name = "patient", value = "居民code") @RequestParam(value = "patient", required = false) String patientCode,
                             @ApiParam(name = "doctorCode", value = "管理员code") @RequestParam(value = "doctorCode", required = false) String doctorCode,
                             @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ")  @RequestParam(value = "safe_area",required = false)String safe_area,
                             @ApiParam(name = "name",value = "安全区名称") @RequestParam(value = "name",required = false)String name,
                             @ApiParam(name = "fenceNO",value = "安全区编号") @RequestParam(value = "fenceNO",required = false)Integer fenceNO,
                             @ApiParam(name = "sleepPlanJson", value = "睡眠计划json") @RequestParam(value = "sleepPlanJson", required = false) String sleepPlanJson
                             //{"deviceSn": "7052169111","getUpTime": "07:00","napTime": "13:00","nightRestTime": "21:30"}
                             ) {
@ -136,7 +133,7 @@ public class PadDeviceController extends BaseController {
            device.setAgentName(doctor.getName());
            String sn = device.getDeviceSn();
            synchronized (sn.intern()){
                Boolean flagDevice = patientDeviceService.saveDevice(device,safe_area,fenceNO,name,sleepPlan);
                Boolean flagDevice = patientDeviceService.saveDevice(device,sleepPlan);
                if (flagDevice == false){
                    return write(-1,"请填写投放地址");
                }

+ 1 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/device/PatientDeviceController.java

@ -87,9 +87,6 @@ public class PatientDeviceController extends BaseController {
    @RequestMapping(value = "SavePatientDevice", method = RequestMethod.POST)
    public String saveDevice(@ApiParam(name = "json", value = "设备数据json", defaultValue = "{\"deviceId\": \"3\",\"deviceName\": \"血压计-优瑞恩\",\"deviceSn\": \"7052169111\",\"categoryCode\": \"1\",\"userType\": \"-1\"}")
                             @RequestParam(value = "json", required = true) String json,
                             @ApiParam(name = "safe_area",value = "lon1,lat1;lon2,lat2; 5个坐标 形成一个封闭区域  A;B;C;D;A ") @RequestParam(value = "safe_area",required = false)String safe_area,
                             @ApiParam(name = "name",value = "安全区名称") @RequestParam(value = "name",required = false)String name,
                             @ApiParam(name = "fenceNO",value = "安全区编号") @RequestParam(value = "fenceNO",required = false)Integer fenceNO,
                             @ApiParam(name = "sleepPlanJson", value = "睡眠计划json") @RequestParam(value = "sleepPlanJson", required = false) String sleepPlanJson){
        //{"deviceSn": "7052169111","getUpTime": "07:00","napTime": "13:00","nightRestTime": "21:30"})
        try {
@ -117,7 +114,7 @@ public class PatientDeviceController extends BaseController {
            String sn = device.getDeviceSn();
            synchronized (sn.intern()){
//                patientDeviceService.saveDevice(device);
                Boolean flagDevice = patientDeviceService.saveDevice(device,safe_area,fenceNO,name,sleepPlan);
                Boolean flagDevice = patientDeviceService.saveDevice(device,sleepPlan);
                if (flagDevice == false){
                    return write(-1,"请填写投放地址");
                }

+ 1 - 30
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -183,7 +183,7 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
    /**
     * 保存患者设备
     */
    public boolean saveDevice(DevicePatientDevice devicePatientDevice, String safe_area, Integer fenceNO, String name, BaseSleepPlan sleepPlan) throws Exception {
    public boolean saveDevice(DevicePatientDevice devicePatientDevice, BaseSleepPlan sleepPlan) throws Exception {
        //判断sn码是否被使用
        String sn = devicePatientDevice.getDeviceSn();
        String type = devicePatientDevice.getCategoryCode();
@ -243,35 +243,6 @@ public class PatientDeviceService extends BaseJpaService<DevicePatientDevice, Pa
        MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
        if(checkDeviceSn(sn)){
            //V1.0.0 添加手表的时候需要设置围栏
            if ("4".equals(type)){
                Device device = deviceDao.findOne(new Long (type));
                if (device!=null){
                    if ("X1".equals(device.getModel())){
                        url = MessageFormat.format(AqgConfig.X1fence_area, sn,fenceNO);
                    }
                }
                param.add("name", name);
                param.add("freq", "1"); //"0,触发一天;1,每日触发 "
                param.add("enable","1");
                param.add("time_begin", "0");
                param.add("time_end", "86400");
                param.add("safe_area", safe_area);
                HttpEntity<com.alibaba.fastjson.JSONObject> response = httpClientUtil.aqgCookieHttp(url, param, HttpMethod.POST, getCookie());
                com.alibaba.fastjson.JSONObject object = response.getBody();
                if (object.get("success").equals("true")){
                    System.out.println("围栏地址添加成功");
                } else {
                    System.out.println("添加失败");
                    String message = "围栏设置失败";
                    throw new Exception(message);
                }
            }
            if ("16".equals(type)){ //智能拐杖
            }
            if ("13".equals(type)){ //睡眠带
                if (StringUtils.isBlank(sleepPlan.getGetUpTime()) || StringUtils.isBlank(sleepPlan.getNightRestTime())) {
                    String message = "请完善睡眠时间规划";

+ 1 - 1
svr/svr-cloud-care/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name:  svr-cloud-care-ysj
    name:  svr-cloud-care
  cloud:
    config:
      failFast: true