|
@@ -3,14 +3,8 @@ package com.jpsoft.smart.modules.mobile.controller;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
import com.google.common.collect.Lists;
|
|
|
-import com.jpsoft.smart.modules.base.entity.CompanyInfo;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceFilterLog;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonInfo;
|
|
|
-import com.jpsoft.smart.modules.base.service.CompanyInfoService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonDeviceFilterLogService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
|
-import com.jpsoft.smart.modules.base.service.PersonInfoService;
|
|
|
+import com.jpsoft.smart.modules.base.entity.*;
|
|
|
+import com.jpsoft.smart.modules.base.service.*;
|
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
@@ -46,6 +40,9 @@ public class PersonDeviceLogApiController {
|
|
|
@Autowired
|
|
|
private CompanyInfoService companyInfoService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DeviceInfoService deviceInfoService;
|
|
|
+
|
|
|
@PostMapping("queryTemperatureRawRecordList")
|
|
|
@ApiOperation(value="根据实时数据查看企业人员温度数据")
|
|
|
@ApiImplicitParams({
|
|
@@ -571,4 +568,31 @@ public class PersonDeviceLogApiController {
|
|
|
return msgResult;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value="获取设备列表")
|
|
|
+ @RequestMapping(value = "getDeviceList",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
|
|
|
+ @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
|
|
|
+ })
|
|
|
+ public MessageResult<List<DeviceInfo>> getDeviceList(String token, @RequestAttribute String subject) {
|
|
|
+ MessageResult<List<DeviceInfo>> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ try{
|
|
|
+ PersonInfo person = personInfoService.get(Long.valueOf(subject));
|
|
|
+
|
|
|
+ String companyId = person.getCompanyId();
|
|
|
+
|
|
|
+ List<DeviceInfo> DeviceInfoList = deviceInfoService.findByCompanyId(companyId);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(DeviceInfoList);
|
|
|
+ }
|
|
|
+ catch (Exception ex){
|
|
|
+ msgResult.setMessage(ex.getMessage());
|
|
|
+ msgResult.setResult(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
}
|