Explorar o código

sz 设备是否上传照片显示,人员管理、测温记录 查询条件添加

xiao547607 %!s(int64=5) %!d(string=hai) anos
pai
achega
8b06d9b0f5

+ 5 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonDeviceRelation.java

@@ -37,6 +37,11 @@ public class PersonDeviceRelation {
 
 	@ApiModelProperty(value = "人员信息")
 	private PersonInfo personInfo;
+	/**
+	 *是否删除
+	 */
+	@ApiModelProperty(value = "是否删除")
+	private Boolean isWrite;
 	/**
 	 *是否删除
 	 */

+ 14 - 2
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -279,8 +279,20 @@
                 a.name_ like #{name}
             </foreach>
         </if>
-        <if test="searchParams.jobNumber!=null">
-            and a.position3_ like #{searchParams.jobNumber}
+        <if test="searchParams.position1 != null">
+            and a.position1_ like #{searchParams.position1}
+        </if>
+        <if test="searchParams.position2 != null">
+            and a.position2_ like #{searchParams.position2}
+        </if>
+        <if test="searchParams.position3 != null">
+            and a.position3_ like #{searchParams.position3}
+        </if>
+        <if test="searchParams.position4 != null">
+            and a.position4_ like #{searchParams.position4}
+        </if>
+        <if test="searchParams.position5 != null">
+            and a.position5_ like #{searchParams.position5}
         </if>
         <foreach item="sort" collection="sortList" open="order by" separator=",">
             a.${sort.name} ${sort.order}

+ 30 - 2
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonDeviceRelationController.java

@@ -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) {

+ 10 - 10
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -501,19 +501,19 @@ public class PersonInfoController {
         }
 
         if (StringUtils.isNotEmpty(position1)) {
-            searchParams.put("position1",position1);
+            searchParams.put("position1","%" + position1 + "%");
         }
         if (StringUtils.isNotEmpty(position2)) {
-            searchParams.put("position2",position2);
+            searchParams.put("position2","%" + position2 + "%");
         }
         if (StringUtils.isNotEmpty(position3)) {
-            searchParams.put("position3",position3);
+            searchParams.put("position3","%" + position3 + "%");
         }
         if (StringUtils.isNotEmpty(position4)) {
-            searchParams.put("position4",position4);
+            searchParams.put("position4","%" + position4 + "%");
         }
         if (StringUtils.isNotEmpty(position5)) {
-            searchParams.put("position5",position5);
+            searchParams.put("position5","%" + position5 + "%");
         }
 
         if(faceBound != null){
@@ -1065,19 +1065,19 @@ public class PersonInfoController {
 //                searchParams.put("companyId",user.getCompanyId());
 //            }
             if (StringUtils.isNotEmpty(position1)) {
-                searchParams.put("position1",position1);
+                searchParams.put("position1","%" + position1 + "%");
             }
             if (StringUtils.isNotEmpty(position2)) {
-                searchParams.put("position2",position2);
+                searchParams.put("position2","%" + position2 + "%");
             }
             if (StringUtils.isNotEmpty(position3)) {
-                searchParams.put("position3",position3);
+                searchParams.put("position3","%" + position3 + "%");
             }
             if (StringUtils.isNotEmpty(position4)) {
-                searchParams.put("position4",position4);
+                searchParams.put("position4","%" + position4 + "%");
             }
             if (StringUtils.isNotEmpty(position5)) {
-                searchParams.put("position5",position5);
+                searchParams.put("position5","%" + position5 + "%");
             }
 
             Page<PersonInfo> page = personInfoService.pageSearch(searchParams,1,10000,false,sortList);

+ 52 - 22
web/src/main/java/com/jpsoft/smart/modules/business/controller/WorkAttendanceController.java

@@ -70,14 +70,24 @@ public class WorkAttendanceController {
     @ApiImplicitParams({
             @ApiImplicitParam(name="companyId",value = "单位编号",required = true,paramType = "form"),
             @ApiImplicitParam(name="name",value = "用户姓名",required = true,paramType = "form"),
-            @ApiImplicitParam(name="jobNumber",value = "工号",required = true,paramType = "form"),
             @ApiImplicitParam(name = "startDate",value = "开始时间", required = true,paramType="form"),
             @ApiImplicitParam(name = "endDate",value = "截止时间", required = true,paramType="form"),
+            @ApiImplicitParam(name = "position1",value = "一级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position2",value = "二级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position3",value = "三级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position4",value = "四级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "position5",value = "五级位置", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "faceBound",value = "是否同步", required = false, paramType = "form",dataType = "String"),
             @ApiImplicitParam(name = "subject",value = "subject", required = false,paramType="form")
     })
     @RequestMapping(value = "statList",method = RequestMethod.POST)
     public MessageResult<Map> statList(
-            String companyId,String name,String jobNumber,
+            String companyId,String name,
+            @RequestParam(value="position1",defaultValue="") String position1,
+            @RequestParam(value="position2",defaultValue="") String position2,
+            @RequestParam(value="position3",defaultValue="") String position3,
+            @RequestParam(value="position4",defaultValue="") String position4,
+            @RequestParam(value="position5",defaultValue="") String position5,
             @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
             @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate,
             @RequestAttribute String subject){
@@ -127,13 +137,25 @@ public class WorkAttendanceController {
                 }
                 searchParams.put("nameList", nameList);
             }
-            if (StringUtils.isNotEmpty(jobNumber)) {
-                searchParams.put("jobNumber", "%" + jobNumber + "%");
-            }
-
 
             searchParams.put("code",companyInfo.getCode() + "%");
 
+            if (StringUtils.isNotEmpty(position1)) {
+                searchParams.put("position1","%" + position1 + "%");
+            }
+            if (StringUtils.isNotEmpty(position2)) {
+                searchParams.put("position2","%" + position2 + "%");
+            }
+            if (StringUtils.isNotEmpty(position3)) {
+                searchParams.put("position3","%" + position3 + "%");
+            }
+            if (StringUtils.isNotEmpty(position4)) {
+                searchParams.put("position4","%" + position4 + "%");
+            }
+            if (StringUtils.isNotEmpty(position5)) {
+                searchParams.put("position5","%" + position5 + "%");
+            }
+
             List<PersonInfo> personInfoList = personInfoService.findByCompanyCode(searchParams,sortList);
 
             int days = Days.daysBetween(startTime,endTime).getDays();
@@ -219,9 +241,11 @@ public class WorkAttendanceController {
                 }
 
                 personMap.put("name",personInfo.getName());
-                personMap.put("company",personInfo.getPosition1());
-                personMap.put("department",personInfo.getPosition2());
-                personMap.put("jobNumber",personInfo.getPosition3());
+                personMap.put("position1",personInfo.getPosition1());
+                personMap.put("position2",personInfo.getPosition2());
+                personMap.put("position3",personInfo.getPosition3());
+                personMap.put("position4",personInfo.getPosition4());
+                personMap.put("position5",personInfo.getPosition5());
                 personMap.put("workDays",workDays);
                 personMap.put("restDays",restDays);
                 personMap.put("lateNum",lateNum);
@@ -339,35 +363,41 @@ public class WorkAttendanceController {
                 String name = (String) personMap.get("name");
                 row.createCell(0).setCellValue(name);
 
-                String companyName = (String) personMap.get("company");
-                row.createCell(1).setCellValue(companyName);
+                String position1 = (String) personMap.get("position1");
+                row.createCell(1).setCellValue(position1);
+
+                String position2 = (String) personMap.get("position2");
+                row.createCell(2).setCellValue(position2);
+
+                String position3 = (String) personMap.get("position3");
+                row.createCell(3).setCellValue(position3);
 
-                String department = (String) personMap.get("department");
-                row.createCell(2).setCellValue(department);
+                String position4 = (String) personMap.get("position4");
+                row.createCell(4).setCellValue(position4);
 
-                String jobNumber = (String) personMap.get("jobNumber");
-                row.createCell(3).setCellValue(jobNumber);
+                String position5 = (String) personMap.get("position5");
+                row.createCell(5).setCellValue(position5);
 
                 Integer workDays = Integer.valueOf(personMap.get("workDays").toString());
-                row.createCell(4).setCellValue(workDays);
+                row.createCell(6).setCellValue(workDays);
 
                 Integer restDays = Integer.valueOf(personMap.get("restDays").toString());
-                row.createCell(5).setCellValue(restDays);
+                row.createCell(7).setCellValue(restDays);
 
                 Integer lateNum = Integer.valueOf(personMap.get("lateNum").toString());
-                row.createCell(6).setCellValue(lateNum);
+                row.createCell(8).setCellValue(lateNum);
 
                 Integer leaveNum = Integer.valueOf(personMap.get("leaveNum").toString());
-                row.createCell(7).setCellValue(leaveNum);
+                row.createCell(9).setCellValue(leaveNum);
 
                 Integer missCardOnWorkCount = Integer.valueOf(personMap.get("missCardOnWorkCount").toString());
-                row.createCell(8).setCellValue(missCardOnWorkCount);
+                row.createCell(10).setCellValue(missCardOnWorkCount);
 
                 Integer missCardOffWorkCount = Integer.valueOf(personMap.get("missCardOffWorkCount").toString());
-                row.createCell(9).setCellValue(missCardOffWorkCount);
+                row.createCell(11).setCellValue(missCardOffWorkCount);
 
                 Integer missCardAllDayCount = Integer.valueOf(personMap.get("missCardAllDayCount").toString());
-                row.createCell(10).setCellValue(missCardAllDayCount);
+                row.createCell(12).setCellValue(missCardAllDayCount);
 
                 Map<String, List> workAttendanceMap = (Map<String, List>) personMap.get("workAttendanceMap");