|
@@ -67,16 +67,22 @@ public class PersonDeviceLogController {
|
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "companyId",value = "所属单位编号", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "subordinate",value = "会否保护下级单位", required = false, paramType = "query",dataType = "String"),
|
|
|
@ApiImplicitParam(name = "deviceNo",value = "设备编号", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "aliasName",value = "设备别名", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "personName",value = "人员姓名", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "timeRanges",value = "时间范围", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "temperatureRanges",value = "温度范围", paramType = "query"),
|
|
|
- @ApiImplicitParam(name = "matchMsg",value = "匹配状态", paramType = "query")
|
|
|
+ @ApiImplicitParam(name = "matchMsg",value = "匹配状态", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "distinct",value = "是否去重", paramType = "query")
|
|
|
})
|
|
|
public MessageResult<Map> pageList(
|
|
|
+ String companyId,
|
|
|
+ @RequestParam(value="subordinate",defaultValue="false") Boolean subordinate,
|
|
|
String deviceNo,String aliasName,String personName,
|
|
|
String timeRanges,String temperatureRanges,String matchMsg,
|
|
|
+ @RequestParam(value="distinct",defaultValue="false") Boolean distinct,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@@ -88,6 +94,23 @@ public class PersonDeviceLogController {
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(companyId)){
|
|
|
+ searchParams.put("companyId", companyId);
|
|
|
+
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(companyId);
|
|
|
+
|
|
|
+ if(subordinate){
|
|
|
+ searchParams.put("companyCode", companyInfo.getCode() + "%");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ searchParams.put("companyCode", companyInfo.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (distinct!=null){
|
|
|
+ searchParams.put("distinct",distinct);
|
|
|
+ }
|
|
|
+
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("a.record_time","desc"));
|
|
|
|
|
@@ -96,9 +119,9 @@ public class PersonDeviceLogController {
|
|
|
|
|
|
if(!isSysAdmin){
|
|
|
User user = userService.get(subject);
|
|
|
- String companyId = user.getCompanyId();
|
|
|
+ String userCompanyId = user.getCompanyId();
|
|
|
|
|
|
- List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(companyId);
|
|
|
+ List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(userCompanyId);
|
|
|
List<String> deviceIdList = new ArrayList<String>();
|
|
|
|
|
|
for (DeviceInfo deviceInfo:deviceInfoList) {
|
|
@@ -125,7 +148,6 @@ public class PersonDeviceLogController {
|
|
|
searchParams.put("matchMsg","%"+matchMsg+"%");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if(StringUtil.isNotEmpty(timeRanges)){
|
|
|
String[] timeRangeArray = timeRanges.split(",");
|
|
|
String beginTime = "";
|