|
@ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
@ -42,6 +43,8 @@ import java.io.InputStream;
|
|
|
import java.io.InputStreamReader;
|
|
|
import java.util.*;
|
|
|
|
|
|
import static java.lang.Thread.sleep;
|
|
|
|
|
|
/***
|
|
|
* @ClassName: PadDeviceController
|
|
|
* @Description:
|
|
@ -66,6 +69,8 @@ public class PadDeviceController extends BaseController {
|
|
|
private ContactsService contactsService;
|
|
|
@Autowired
|
|
|
private DeviceDetailDao deviceDetailDao;
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
/**
|
|
|
* 设备列表获取
|
|
@ -253,4 +258,32 @@ public class PadDeviceController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value ="open/updateX1Device",method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "批量修改爱牵挂手表设备信息")
|
|
|
public String updateX1Device() {
|
|
|
try {
|
|
|
String sql = " select device_code from wlyy_devices wd where wd.category_code=4 ";
|
|
|
List<String> deviceSns = jdbcTemplate.queryForList(sql,String.class);
|
|
|
for (String deviceSn:deviceSns) {
|
|
|
patientDeviceService.updateX1Device(deviceSn);
|
|
|
sleep(2000);
|
|
|
}
|
|
|
System.out.println("MODIFY FINISH");
|
|
|
return write(200, "获取成功", "data", "success");
|
|
|
} catch (Exception e) {
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value ="open/updateX1DeviceBySn",method = RequestMethod.GET)
|
|
|
@ApiOperation(value = "修改爱牵挂手表设备信息")
|
|
|
public String updateX1DeviceBySn(@ApiParam(name = "deviceSn", value = "deviceSn", defaultValue = "deviceSn")
|
|
|
@RequestParam(value = "deviceSn", required = true) String deviceSn) {
|
|
|
try {
|
|
|
patientDeviceService.updateX1Device(deviceSn);
|
|
|
return write(200, "获取成功", "data", "success");
|
|
|
} catch (Exception e) {
|
|
|
return errorResult(e);
|
|
|
}
|
|
|
}
|
|
|
}
|