Browse Source

bug修复。

zhengqiang 5 năm trước cách đây
mục cha
commit
8b4f710dde

+ 14 - 13
common/src/main/java/com/jpsoft/smart/modules/common/utils/POIUtils.java

@@ -402,21 +402,22 @@ public class POIUtils {
         while(srcRowIndex<= rowNum){
             Row dataRow1 = srcSheet.getRow(srcRowIndex);
 
-            Cell cell = dataRow1.getCell(validateColIndex);
-
-            if (cell!=null && StringUtils.isNotEmpty(cell.getStringCellValue())){
-                Row dataRow2 = destSheet.createRow(destRowIndex);
-
-                for (int i=0;i<dataRow1.getLastCellNum();i++){
-                    if (dataRow1.getCell(i)!=null) {
-                        dataRow2.createCell(i).setCellValue((String)getCellValue(0,srcRowIndex,i));
-                    }
-                    else{
-                        break;
+            if(dataRow1!=null) {
+                Cell cell = dataRow1.getCell(validateColIndex);
+
+                if (cell != null && StringUtils.isNotEmpty(cell.getStringCellValue())) {
+                    Row dataRow2 = destSheet.createRow(destRowIndex);
+
+                    for (int i = 0; i < dataRow1.getLastCellNum(); i++) {
+                        if (dataRow1.getCell(i) != null) {
+                            dataRow2.createCell(i).setCellValue((String) getCellValue(0, srcRowIndex, i));
+                        } else {
+                            break;
+                        }
                     }
-                }
 
-                destRowIndex++;
+                    destRowIndex++;
+                }
             }
 
             srcRowIndex++;

+ 0 - 1
web/src/main/java/com/jpsoft/smart/config/WebMvcConfig.java

@@ -65,6 +65,5 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/personInfoApi/getVerifyCode")
 				.excludePathPatterns("/mobile/personInfoApi/validateCode")
 				.excludePathPatterns("/mobile/personInfoApi/findByOpenId");
-
 	}
 }

+ 13 - 7
web/src/main/java/com/jpsoft/smart/modules/mobile/controller/PersonDeviceLogApiController.java

@@ -8,6 +8,7 @@ import com.jpsoft.smart.modules.base.service.PersonDeviceLogService;
 import com.jpsoft.smart.modules.base.service.PersonInfoService;
 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.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -39,15 +40,15 @@ public class PersonDeviceLogApiController {
             @ApiImplicitParam(name="token",value = "令牌",required = true,paramType = "form"),
             @ApiImplicitParam(name="subject",value = "目标(不传)",paramType = "form")
     })
-    public MessageResult<List> queryTemperatureRecordListByEnt(
+    public MessageResult<Map> queryTemperatureRecordListByEnt(
             @DateTimeFormat(pattern = "yyyy-MM-dd") Date queryDate,
             String token,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
-        List<Map> recordList = new ArrayList<>();
+        Page<Map> recordPageList = new Page<>();
 
-        MessageResult<List> messageResult = new MessageResult<>();
+        MessageResult<Map> messageResult = new MessageResult<>();
 
         try {
             PersonInfo admin = personInfoService.get(Long.valueOf(subject));
@@ -58,11 +59,11 @@ public class PersonDeviceLogApiController {
             List<Sort> sortList1 = new ArrayList<>();
             sortList1.add(new Sort("id_","asc"));
 
-            Page<PersonInfo> personList = personInfoService.pageSearch(personSearchParam,pageIndex,pageSize,true,sortList1);
+            Page<PersonInfo> personPageList = personInfoService.pageSearch(personSearchParam,pageIndex,pageSize,true,sortList1);
 
             DateTime startTime = new DateTime(queryDate);
 
-            for (PersonInfo person : personList) {
+            for (PersonInfo person : personPageList) {
                 Map<String, Object> recordMap = new HashMap<>();
 
                 recordMap.put("name", person.getName());
@@ -147,11 +148,16 @@ public class PersonDeviceLogApiController {
 
                 recordMap.put("list", personDeviceLogs);
 
-                recordList.add(recordMap);
+                recordPageList.add(recordMap);
             }
 
+            recordPageList.setTotal(personPageList.getTotal());
+            recordPageList.setPages(personPageList.getPages());
+            recordPageList.setPageNum(personPageList.getPageNum());
+            recordPageList.setPageSize(personPageList.getPageSize());
+
             messageResult.setResult(true);
-            messageResult.setData(recordList);
+            messageResult.setData(PojoUtils.pageWrapper(recordPageList));
         }
         catch (Exception ex){
             messageResult.setResult(false);