Ver código fonte

导出添加条件

xiao547607 3 anos atrás
pai
commit
fd2e8331d8

+ 67 - 53
web/src/main/java/com/jpsoft/shinestar/modules/base/controller/PersonDeviceLogController.java

@@ -99,7 +99,6 @@ public class PersonDeviceLogController {
             @RequestParam(value = "pageIndex", defaultValue = "1") int pageIndex,
             @RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
             @RequestAttribute String subject) {
-
         //当前用户ID
         System.out.println(subject);
 
@@ -267,6 +266,7 @@ public class PersonDeviceLogController {
             @ApiImplicitParam(name = "deviceNo", value = "设备编号", paramType = "query"),
             @ApiImplicitParam(name = "aliasName", value = "设备别名", paramType = "query"),
             @ApiImplicitParam(name = "personName", value = "人员姓名", paramType = "query"),
+            @ApiImplicitParam(name = "jobNumbers", value = "工号", paramType = "query"),
             @ApiImplicitParam(name = "timeRanges", value = "时间范围", paramType = "query"),
             @ApiImplicitParam(name = "temperatureRanges", value = "温度范围", paramType = "query"),
             @ApiImplicitParam(name = "matchMsg", value = "匹配状态", paramType = "query"),
@@ -277,6 +277,7 @@ public class PersonDeviceLogController {
             String companyId,
             @RequestParam(value = "subordinate", defaultValue = "false") Boolean subordinate,
             String deviceNo, String aliasName, String personName,String personId,
+            String jobNumbers,
             String timeRanges, String temperatureRanges, String matchMsg,
             @RequestParam(value = "distinct", defaultValue = "false") Boolean distinct,
             @RequestAttribute String subject,
@@ -302,32 +303,34 @@ public class PersonDeviceLogController {
             Cell cellTitle3 = rowTitle.createCell(2);
             cellTitle3.setCellValue("人员姓名");
             Cell cellTitle4 = rowTitle.createCell(3);
-            cellTitle4.setCellValue("测温度数");
+            cellTitle4.setCellValue("工号");
             Cell cellTitle5 = rowTitle.createCell(4);
-            cellTitle5.setCellValue("设备编号");
+            cellTitle5.setCellValue("测温度数");
             Cell cellTitle6 = rowTitle.createCell(5);
-            cellTitle6.setCellValue("设备别称");
+            cellTitle6.setCellValue("设备编号");
             Cell cellTitle7 = rowTitle.createCell(6);
-            cellTitle7.setCellValue("拍照图片");
+            cellTitle7.setCellValue("设备别称");
+            Cell cellTitle8 = rowTitle.createCell(7);
+            cellTitle8.setCellValue("拍照图片");
 
             //获取公司
             //五级位置
             //CompanyInfo companyInfo = companyInfoService.get(companyId);
-            List<CompanyPosition> companyPositionList = companyPositionService.findByCompanyId(userCompanyId);
-            CompanyPosition companyPosition = null;
-            if (companyPositionList.size() > 0) {
-                companyPosition = companyPositionList.get(0);
-                Cell cellTitle8 = rowTitle.createCell(7);
-                cellTitle8.setCellValue(companyPosition.getPosition1Name());
-                Cell cellTitle9 = rowTitle.createCell(8);
-                cellTitle9.setCellValue(companyPosition.getPosition2Name());
-                Cell cellTitle10 = rowTitle.createCell(9);
-                cellTitle10.setCellValue(companyPosition.getPosition3Name());
-                Cell cellTitle11 = rowTitle.createCell(10);
-                cellTitle11.setCellValue(companyPosition.getPosition4Name());
-                Cell cellTitle12 = rowTitle.createCell(11);
-                cellTitle12.setCellValue(companyPosition.getPosition5Name());
-            }
+//            List<CompanyPosition> companyPositionList = companyPositionService.findByCompanyId(userCompanyId);
+//            CompanyPosition companyPosition = null;
+//            if (companyPositionList.size() > 0) {
+//                companyPosition = companyPositionList.get(0);
+//                Cell cellTitle8 = rowTitle.createCell(7);
+//                cellTitle8.setCellValue(companyPosition.getPosition1Name());
+//                Cell cellTitle9 = rowTitle.createCell(8);
+//                cellTitle9.setCellValue(companyPosition.getPosition2Name());
+//                Cell cellTitle10 = rowTitle.createCell(9);
+//                cellTitle10.setCellValue(companyPosition.getPosition3Name());
+//                Cell cellTitle11 = rowTitle.createCell(10);
+//                cellTitle11.setCellValue(companyPosition.getPosition4Name());
+//                Cell cellTitle12 = rowTitle.createCell(11);
+//                cellTitle12.setCellValue(companyPosition.getPosition5Name());
+//            }
 
             //表内容
             Map<String, Object> searchParams = new HashMap<>();
@@ -367,6 +370,11 @@ public class PersonDeviceLogController {
                 searchParams.put("personId", personId);
             }
 
+            if (StringUtil.isNotEmpty(jobNumbers)) {
+                String[] jobNumbersArray = jobNumbers.split(",");
+                searchParams.put("jobNumbers", Arrays.asList(jobNumbersArray));
+            }
+
 
             if (StringUtils.isNotEmpty(companyId)) {
                 searchParams.put("companyId", companyId);
@@ -472,51 +480,57 @@ public class PersonDeviceLogController {
                     cellContent2.setCellValue(recordTime);
 
                     String name = "";
+                    String jobNumber = "";
                     if (personDeviceLog.getPerson() != null) {
                         name = personDeviceLog.getPerson().getName();
+                        if(personDeviceLog.getPerson().getJobNumber() != null) {
+                            jobNumber = personDeviceLog.getPerson().getJobNumber();
+                        }
                     } else {
                         name = "匿名用户";
                     }
                     Cell cellContent3 = rowContent.createCell(2);
                     cellContent3.setCellValue(name);
                     Cell cellContent4 = rowContent.createCell(3);
-                    cellContent4.setCellValue(personDeviceLog.getTemperature().toString());
+                    cellContent4.setCellValue(jobNumber);
                     Cell cellContent5 = rowContent.createCell(4);
-                    cellContent5.setCellValue(personDeviceLog.getDeviceNo());
+                    cellContent5.setCellValue(personDeviceLog.getTemperature().toString());
                     Cell cellContent6 = rowContent.createCell(5);
-                    if(personDeviceLog.getDevice() != null) {
-                        cellContent6.setCellValue(personDeviceLog.getDevice().getAliasName());
-                    }
+                    cellContent6.setCellValue(personDeviceLog.getDeviceNo());
                     Cell cellContent7 = rowContent.createCell(6);
-                    cellContent7.setCellValue(personDeviceLog.getFaceImage());
-
-                    //五级位置
-                    //判断 如果公司没有五级位置 就不做展示
-                    if (companyPositionList.size() > 0) {
-                        PersonInfo person = personDeviceLog.getPerson();
-                        if (person != null) {
-                            Cell cellContent8 = rowContent.createCell(7);
-                            if (person.getPosition1() != null) {
-                                cellContent8.setCellValue(person.getPosition1());
-                            }
-                            Cell cellContent9 = rowContent.createCell(8);
-                            if (person.getPosition1() != null) {
-                                cellContent9.setCellValue(person.getPosition2());
-                            }
-                            Cell cellContent10 = rowContent.createCell(9);
-                            if (person.getPosition1() != null) {
-                                cellContent10.setCellValue(person.getPosition3());
-                            }
-                            Cell cellContent11 = rowContent.createCell(10);
-                            if (person.getPosition1() != null) {
-                                cellContent11.setCellValue(person.getPosition4());
-                            }
-                            Cell cellContent12 = rowContent.createCell(11);
-                            if (person.getPosition1() != null) {
-                                cellContent12.setCellValue(person.getPosition5());
-                            }
-                        }
+                    if(personDeviceLog.getDevice() != null) {
+                        cellContent7.setCellValue(personDeviceLog.getDevice().getAliasName());
                     }
+                    Cell cellContent8 = rowContent.createCell(7);
+                    cellContent8.setCellValue(personDeviceLog.getFaceImage());
+
+//                    //五级位置
+//                    //判断 如果公司没有五级位置 就不做展示
+//                    if (companyPositionList.size() > 0) {
+//                        PersonInfo person = personDeviceLog.getPerson();
+//                        if (person != null) {
+//                            Cell cellContent8 = rowContent.createCell(7);
+//                            if (person.getPosition1() != null) {
+//                                cellContent8.setCellValue(person.getPosition1());
+//                            }
+//                            Cell cellContent9 = rowContent.createCell(8);
+//                            if (person.getPosition1() != null) {
+//                                cellContent9.setCellValue(person.getPosition2());
+//                            }
+//                            Cell cellContent10 = rowContent.createCell(9);
+//                            if (person.getPosition1() != null) {
+//                                cellContent10.setCellValue(person.getPosition3());
+//                            }
+//                            Cell cellContent11 = rowContent.createCell(10);
+//                            if (person.getPosition1() != null) {
+//                                cellContent11.setCellValue(person.getPosition4());
+//                            }
+//                            Cell cellContent12 = rowContent.createCell(11);
+//                            if (person.getPosition1() != null) {
+//                                cellContent12.setCellValue(person.getPosition5());
+//                            }
+//                        }
+//                    }
 
                     sheet.autoSizeColumn(i);
                 }