|
@@ -0,0 +1,89 @@
|
|
|
+package com.jpsoft.smart.modules.base.controller;
|
|
|
+
|
|
|
+
|
|
|
+import com.github.pagehelper.Page;
|
|
|
+import com.github.pagehelper.util.StringUtil;
|
|
|
+import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
|
|
|
+import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
|
+import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
|
+import com.jpsoft.smart.modules.common.dto.Sort;
|
|
|
+import com.jpsoft.smart.modules.common.utils.PojoUtils;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/personDeviceLog")
|
|
|
+@Api(description = "日志台账")
|
|
|
+public class PersonDeviceLogController {
|
|
|
+ @Autowired
|
|
|
+ private PersonDeviceLogService personDeviceLogService;
|
|
|
+
|
|
|
+ @ApiOperation(value="列表")
|
|
|
+ @RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "companyId",value = "企业ID", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "deviceNo",value = "设备编号", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "aliasName",value = "设备别名", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "personName",value = "人员姓名", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "matchStatus",value = "开门类型", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "beginTime",value = "开始时间", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "endTime",value = "结束时间", paramType = "query")
|
|
|
+ })
|
|
|
+ public MessageResult<Map> pageList(
|
|
|
+ String companyId,
|
|
|
+ String deviceNo,String aliasName,String personName,
|
|
|
+ String matchStatus,String beginTime,String endTime,
|
|
|
+ @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
+ @RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
+ @RequestAttribute String subject){
|
|
|
+
|
|
|
+ //当前用户ID
|
|
|
+ System.out.println(subject);
|
|
|
+
|
|
|
+ MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
+
|
|
|
+ Map<String,Object> searchParams = new HashMap<>();
|
|
|
+
|
|
|
+ List<Sort> sortList = new ArrayList<>();
|
|
|
+ sortList.add(new Sort("a.record_time","desc"));
|
|
|
+
|
|
|
+ if(StringUtil.isNotEmpty(companyId)){
|
|
|
+ searchParams.put("companyId",companyId);
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(deviceNo)){
|
|
|
+ searchParams.put("deviceNo","%"+deviceNo+"%");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(aliasName)){
|
|
|
+ searchParams.put("aliasName","%"+aliasName+"%");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(personName)){
|
|
|
+ searchParams.put("personName","%"+personName+"%");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(matchStatus)){
|
|
|
+ searchParams.put("matchStatus",matchStatus);
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(beginTime)){
|
|
|
+ searchParams.put("beginTime",beginTime);
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(endTime)){
|
|
|
+ searchParams.put("endTime",endTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ Page<PersonDeviceLog> page = personDeviceLogService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+
|
|
|
+ msgResult.setResult(true);
|
|
|
+ msgResult.setData(PojoUtils.pageWrapper(page));
|
|
|
+
|
|
|
+ return msgResult;
|
|
|
+ }
|
|
|
+}
|