|
@@ -1,11 +1,13 @@
|
|
package com.jpsoft.smart.modules.base.controller;
|
|
package com.jpsoft.smart.modules.base.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.alipay.api.domain.Person;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.util.StringUtil;
|
|
import com.github.pagehelper.util.StringUtil;
|
|
import com.jpsoft.smart.config.OSSConfig;
|
|
import com.jpsoft.smart.config.OSSConfig;
|
|
-import com.jpsoft.smart.modules.base.entity.DeviceInfo;
|
|
|
|
-import com.jpsoft.smart.modules.base.entity.PersonDeviceLog;
|
|
|
|
|
|
+import com.jpsoft.smart.modules.base.entity.*;
|
|
|
|
+import com.jpsoft.smart.modules.base.service.CompanyInfoService;
|
|
|
|
+import com.jpsoft.smart.modules.base.service.CompanyPositionService;
|
|
import com.jpsoft.smart.modules.base.service.DeviceInfoService;
|
|
import com.jpsoft.smart.modules.base.service.DeviceInfoService;
|
|
import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
import com.jpsoft.smart.modules.common.dto.MessageResult;
|
|
@@ -55,6 +57,13 @@ public class PersonDeviceLogController {
|
|
@Autowired
|
|
@Autowired
|
|
private DeviceInfoService deviceInfoService;
|
|
private DeviceInfoService deviceInfoService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private CompanyPositionService companyPositionService;
|
|
|
|
+
|
|
|
|
+
|
|
@ApiOperation(value="列表")
|
|
@ApiOperation(value="列表")
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@@ -178,13 +187,14 @@ public class PersonDeviceLogController {
|
|
String timeRanges,String temperatureRanges,
|
|
String timeRanges,String temperatureRanges,
|
|
@RequestAttribute String subject) {
|
|
@RequestAttribute String subject) {
|
|
MessageResult<String> msgResult = new MessageResult<>();
|
|
MessageResult<String> msgResult = new MessageResult<>();
|
|
-
|
|
|
|
try {
|
|
try {
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
+ String companyId = user.getCompanyId();
|
|
|
|
+
|
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
|
HSSFSheet sheet = workbook.createSheet();
|
|
HSSFSheet sheet = workbook.createSheet();
|
|
//表头
|
|
//表头
|
|
HSSFRow rowTitle = sheet.createRow(0);
|
|
HSSFRow rowTitle = sheet.createRow(0);
|
|
-
|
|
|
|
HSSFCell cellTitle1 = rowTitle.createCell(0);
|
|
HSSFCell cellTitle1 = rowTitle.createCell(0);
|
|
cellTitle1.setCellValue("序号");
|
|
cellTitle1.setCellValue("序号");
|
|
HSSFCell cellTitle2 = rowTitle.createCell(1);
|
|
HSSFCell cellTitle2 = rowTitle.createCell(1);
|
|
@@ -201,6 +211,27 @@ public class PersonDeviceLogController {
|
|
cellTitle7.setCellValue("拍照图片");
|
|
cellTitle7.setCellValue("拍照图片");
|
|
|
|
|
|
|
|
|
|
|
|
+ //获取公司
|
|
|
|
+ //五级位置
|
|
|
|
+ //CompanyInfo companyInfo = companyInfoService.get(companyId);
|
|
|
|
+ List<CompanyPosition> companyPositionList = companyPositionService.findByCompanyId(companyId);
|
|
|
|
+ CompanyPosition companyPosition = null;
|
|
|
|
+ if(companyPositionList.size() > 0){
|
|
|
|
+ companyPosition = companyPositionList.get(0);
|
|
|
|
+ HSSFCell cellTitle8 = rowTitle.createCell(7);
|
|
|
|
+ cellTitle8.setCellValue(companyPosition.getPosition1Name());
|
|
|
|
+ HSSFCell cellTitle9 = rowTitle.createCell(8);
|
|
|
|
+ cellTitle9.setCellValue(companyPosition.getPosition2Name());
|
|
|
|
+ HSSFCell cellTitle10 = rowTitle.createCell(9);
|
|
|
|
+ cellTitle10.setCellValue(companyPosition.getPosition3Name());
|
|
|
|
+ HSSFCell cellTitle11 = rowTitle.createCell(10);
|
|
|
|
+ cellTitle11.setCellValue(companyPosition.getPosition4Name());
|
|
|
|
+ HSSFCell cellTitle12 = rowTitle.createCell(11);
|
|
|
|
+ cellTitle12.setCellValue(companyPosition.getPosition5Name());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//表内容
|
|
//表内容
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
@@ -210,9 +241,6 @@ public class PersonDeviceLogController {
|
|
//为公司管理员
|
|
//为公司管理员
|
|
boolean is_admin = userService.hasRole(subject,"ADMIN");
|
|
boolean is_admin = userService.hasRole(subject,"ADMIN");
|
|
if(is_admin){
|
|
if(is_admin){
|
|
- User user = userService.get(subject);
|
|
|
|
- String companyId = user.getCompanyId();
|
|
|
|
-
|
|
|
|
List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(companyId);
|
|
List<DeviceInfo> deviceInfoList = deviceInfoService.findByCompanyId(companyId);
|
|
List<String> deviceIdList = new ArrayList<String>();
|
|
List<String> deviceIdList = new ArrayList<String>();
|
|
if(deviceInfoList.size() > 0) {
|
|
if(deviceInfoList.size() > 0) {
|
|
@@ -308,6 +336,22 @@ public class PersonDeviceLogController {
|
|
HSSFCell cellContent7 = rowContent.createCell(6);
|
|
HSSFCell cellContent7 = rowContent.createCell(6);
|
|
cellContent7.setCellValue(personDeviceLog.getFaceImage());
|
|
cellContent7.setCellValue(personDeviceLog.getFaceImage());
|
|
|
|
|
|
|
|
+ //五级位置
|
|
|
|
+ //判断 如果公司没有五级位置 就不做展示
|
|
|
|
+ if(companyPositionList.size() > 0) {
|
|
|
|
+ PersonInfo person = personDeviceLog.getPerson();
|
|
|
|
+ HSSFCell cellContent8 = rowContent.createCell(7);
|
|
|
|
+ cellContent8.setCellValue(person.getPosition1());
|
|
|
|
+ HSSFCell cellContent9 = rowContent.createCell(8);
|
|
|
|
+ cellContent9.setCellValue(person.getPosition2());
|
|
|
|
+ HSSFCell cellContent10 = rowContent.createCell(9);
|
|
|
|
+ cellContent10.setCellValue(person.getPosition3());
|
|
|
|
+ HSSFCell cellContent11 = rowContent.createCell(10);
|
|
|
|
+ cellContent11.setCellValue(person.getPosition4());
|
|
|
|
+ HSSFCell cellContent12 = rowContent.createCell(11);
|
|
|
|
+ cellContent12.setCellValue(person.getPosition5());
|
|
|
|
+ }
|
|
|
|
+
|
|
sheet.autoSizeColumn(i);
|
|
sheet.autoSizeColumn(i);
|
|
}
|
|
}
|
|
|
|
|