|
@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -137,20 +138,22 @@ public class ApiAppDeviceController {
|
|
|
|
|
|
|
|
|
ApiPageDTO page = appDeviceService.getListBySQL(sql.toString(), new HashMap<>(), param);
|
|
|
- // 组装数据
|
|
|
- List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
|
|
|
- for (Map<String, Object> p : list) {
|
|
|
- AppDevice device = new AppDevice();
|
|
|
- device.setSn(ObjectUtil.obj2String(p.get("sn")));
|
|
|
- appDeviceService.addSnTitle(device);
|
|
|
-
|
|
|
- p.put("type_title", device.getTypeTitle());
|
|
|
- p.put("pack_title", device.getPackTitle());
|
|
|
- p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")), DateUtils.YMD));
|
|
|
- p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
- p.put("operator", "admin");
|
|
|
+ if(null != page.getData()) {
|
|
|
+ // 组装数据
|
|
|
+ List<Map<String, Object>> list = (List<Map<String, Object>>) page.getData();
|
|
|
+ for (Map<String, Object> p : list) {
|
|
|
+ AppDevice device = new AppDevice();
|
|
|
+ device.setSn(ObjectUtil.obj2String(p.get("sn")));
|
|
|
+ appDeviceService.addSnTitle(device);
|
|
|
+
|
|
|
+ p.put("type_title", device.getTypeTitle());
|
|
|
+ p.put("pack_title", device.getPackTitle());
|
|
|
+ p.put("deliver_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("deliver_time")), DateUtils.YMD));
|
|
|
+ p.put("add_time", DateUtils.toString(ObjectUtil.obj2Date(p.get("add_time")), DateUtils.YMDHMS));
|
|
|
+ p.put("operator", "admin");
|
|
|
+ }
|
|
|
+ page.setData(list);
|
|
|
}
|
|
|
- page.setData(list);
|
|
|
return page;
|
|
|
}
|
|
|
|