|
@@ -1,5 +1,6 @@
|
|
|
package com.jpsoft.smart.modules.base.controller;
|
|
|
|
|
|
+import com.alipay.api.domain.Person;
|
|
|
import com.github.pagehelper.Page;
|
|
|
import com.github.pagehelper.util.StringUtil;
|
|
|
import com.jpsoft.smart.config.OSSConfig;
|
|
@@ -576,7 +577,6 @@ public class PersonDeviceRelationController {
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
-
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
@@ -589,6 +589,24 @@ public class PersonDeviceRelationController {
|
|
|
}
|
|
|
|
|
|
Page<PersonDeviceRelation> page = personDeviceRelationService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
+ for(PersonDeviceRelation pdr : page.getResult()){
|
|
|
+ DeviceInfo di = pdr.getDeviceInfo();
|
|
|
+ PersonInfo personInfo = pdr.getPersonInfo();
|
|
|
+ String faceDbId = "";
|
|
|
+ Boolean isWrite = false;
|
|
|
+ try {
|
|
|
+ //查找人脸ID
|
|
|
+ faceDbId = lapiService.getFaceDbId(di,personInfo.getCompanyName());
|
|
|
+ //查询人员是否成功写入设备
|
|
|
+ isWrite = lapiService.isSuccessAddPerson(personInfo,di,faceDbId);
|
|
|
+
|
|
|
+ }catch (Exception e){
|
|
|
+ isWrite = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ pdr.setIsWrite(isWrite);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
@@ -686,10 +704,14 @@ public class PersonDeviceRelationController {
|
|
|
@ApiOperation(value="人员查询是否绑定设备")
|
|
|
@RequestMapping(value = "isUnbindDeviceList",method = RequestMethod.POST)
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "personId",value = "人员ID",required = true ,paramType = "query")
|
|
|
+ @ApiImplicitParam(name = "personId",value = "人员ID",required = true ,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "deviceNo",value = "设备编号",required = true ,paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "deviceName",value = "设备名称",required = true ,paramType = "query")
|
|
|
})
|
|
|
public MessageResult<Map> isUnbindDeviceList(
|
|
|
Long personId,
|
|
|
+ @RequestParam(value="deviceNo",defaultValue="") String deviceNo,
|
|
|
+ @RequestParam(value="deviceName",defaultValue="") String deviceName,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,@RequestAttribute String subject){
|
|
|
|
|
@@ -722,6 +744,12 @@ public class PersonDeviceRelationController {
|
|
|
|
|
|
//searchParams.put("companyId",user.getCompanyId());
|
|
|
|
|
|
+ if(StringUtils.isNotEmpty(deviceNo)){
|
|
|
+ searchParams.put("deviceNo","%" + deviceNo + "%");
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(deviceName)){
|
|
|
+ searchParams.put("aliasName","%" + deviceName + "%");
|
|
|
+ }
|
|
|
Page<DeviceInfo> page = deviceInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
|
for (DeviceInfo deviceInfo:page) {
|