|
@@ -134,6 +134,25 @@ public class EartagServiceImpl implements IEartagService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public Result listManyEartagOnlineStatus(String farmId, Integer days) throws ParseException {
|
|
|
+ DateUtil dateUtil = new DateUtil();
|
|
|
+ String pastDate = dateUtil.getPastDate(days);
|
|
|
+ String todayDate = dateUtil.getTodayDateText();
|
|
|
+ List<EartarFarmAllStatusEntity> FarmAllStatusEntityList = farmAllStatusRepo.getOneByFarmIdAndCreateDateAndPastDate(farmId, pastDate, todayDate);
|
|
|
+ JSONArray dataJa = new JSONArray();
|
|
|
+ for (EartarFarmAllStatusEntity farmAllStatusEntity : FarmAllStatusEntityList) {
|
|
|
+ JSONObject newJo = new JSONObject();
|
|
|
+ dataJa.add(newJo);
|
|
|
+ newJo.put("time", dateUtil.formatDateText(farmAllStatusEntity.getCreateDate()));
|
|
|
+ newJo.put("value", farmAllStatusEntity.getEartagOnline());
|
|
|
+// newJo.put("total", farmAllStatusEntity.getDeviceTotal());
|
|
|
+// newJo.put("rate", farmAllStatusEntity.getDeviceRate());
|
|
|
+// newJo.put("offline", farmAllStatusEntity.getDeviceOffline());
|
|
|
+ }
|
|
|
+ return new Result(ResultCode.SUCCESS, dataJa);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public Result listAllEartagRegister(String farmId, String earmark, Integer activeStatus, Integer liveStatus, Integer registerType, String startDate, String endDate, Integer pageNo, Integer pageSize) throws ParseException {
|
|
|
//
|
|
|
Specification<EartagEartagRegisterEntity> sf = (Specification<EartagEartagRegisterEntity>) (root, criteriaQuery, criteriaBuilder) -> {
|