| | |
| | | |
| | | List<EquipmentVO> datas = new ArrayList<>(); |
| | | |
| | | if (pid == null) { |
| | | if (pid == null || pid.equals("")) { |
| | | for (int j = 0; j < pages.size(); j++) { |
| | | String expireTime = pages.get(j).getExpireTime(); |
| | | //1.获取当前时间 |
| | | Date dd = new Date(); |
| | | SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String end = sim.format(dd); |
| | | //把string类型转换为long类型的 |
| | | long st = sim.parse(expireTime).getTime(); |
| | | long en = sim.parse(end).getTime(); |
| | | //计算天数 |
| | | int day = (int) ((st - en) / 86400000); |
| | | if (day <= 30) { |
| | | pages.get(j).setType(1); |
| | | } else { |
| | | pages.get(j).setType(0); |
| | | } |
| | | } |
| | | datas = pages; |
| | | } else { |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | |
| | | //将得到的设备与查询所得设备进行匹配 |
| | | for (int i = 0; i < childList.size(); i++) { |
| | | for (int j = 0; j < pages.size(); j++) { |
| | | |
| | | String expireTime = pages.get(j).getExpireTime(); |
| | | //1.获取当前时间 |
| | | Date dd = new Date(); |
| | |
| | | int day = (int) ((st - en) / 86400000); |
| | | if (day <= 30) { |
| | | pages.get(j).setType(1); |
| | | } else { |
| | | pages.get(j).setType(0); |
| | | } |
| | | |
| | | if (childList.get(i).get("eqid") != null) { |