|
|
@@ -116,174 +116,5 @@ public class IotPestrecogController extends BaseController {
|
|
|
IotPestRecogPeriodInfoResVo infoResVo = iIotPestrecogService.period(reqVo);
|
|
|
return AjaxResult.success(infoResVo);
|
|
|
}
|
|
|
-//
|
|
|
-// public List<IotPest> getIotPestList(List<IotPestrecog> list) {
|
|
|
-// Map<String, IotPest> pestMap = iotPestService.selectIotPestMapAllInfo();
|
|
|
-// List<IotPest> iotPests2 = new ArrayList<>();
|
|
|
-// Set<String> set = new HashSet<>();
|
|
|
-// for (IotPestrecog iotPestrecog : list) {
|
|
|
-// set.add(iotPestrecog.getPestBusid());
|
|
|
-// }
|
|
|
-// for (String s : set) {
|
|
|
-// IotPest iotPest1 = new IotPest();
|
|
|
-// iotPest1.setPestBid(s);
|
|
|
-// IotPest pest = pestMap.get(s);
|
|
|
-// if (pest != null) {
|
|
|
-// iotPest1.setPestName(pest.getPestName());
|
|
|
-// iotPest1.setPestId(pest.getPestId());
|
|
|
-// }
|
|
|
-// iotPests2.add(iotPest1);
|
|
|
-// }
|
|
|
-// return iotPests2;
|
|
|
-// }
|
|
|
-//
|
|
|
-// protected TableDataInfo getDataTable(IPage page) {
|
|
|
-// TableDataInfo rspData = new TableDataInfo();
|
|
|
-// rspData.setCode(ErrorCode.SUCCESS.getCode());
|
|
|
-// rspData.setMsg(ErrorCode.SUCCESS.getMessage());
|
|
|
-// rspData.setData(page.getRecords());
|
|
|
-// rspData.setTotal(page.getTotal());
|
|
|
-// return rspData;
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 对列表与导出的参数进行封装
|
|
|
-// *
|
|
|
-// * @param reqVo
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// private Map<String, Object> getParamMap(IotPestRecogPeriodReqVo reqVo) {
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
-// map.put("devBid", reqVo.getDevBid());
|
|
|
-//
|
|
|
-// if (StringUtils.isNotEmpty(reqVo.getPestrecogMarktype())) {
|
|
|
-// map.put("pestrecogMarktype", reqVo.getPestrecogMarktype());
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(reqVo.getPestBids())) {
|
|
|
-// map.put("newList_pestBusid", reqVo.getPestBids());
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(reqVo.getStartTime()) && StringUtils.isEmpty(reqVo.getEndTime())) {
|
|
|
-// map.put("gte_pestrecogCreatedDate", reqVo.getStartTime());
|
|
|
-// }
|
|
|
-// if (StringUtils.isEmpty(reqVo.getStartTime()) && StringUtils.isNotEmpty(reqVo.getEndTime())) {
|
|
|
-// map.put("lte_pestrecogCreatedDate", reqVo.getEndTime());
|
|
|
-// }
|
|
|
-// if (StringUtils.isNotEmpty(reqVo.getStartTime()) && StringUtils.isNotEmpty(reqVo.getEndTime())) {
|
|
|
-// map.put("time_pestrecogCreatedDate", reqVo.getStartTime() + "," + reqVo.getEndTime());
|
|
|
-// }
|
|
|
-// return map;
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 对返回数据进行封装
|
|
|
-// *
|
|
|
-// * @param records
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// private List<IotPestrecogResVo> getIotPestrecogResVoList(List<IotPestrecog> records) {
|
|
|
-// Map<String, IotPest> pestMap = iotPestService.selectIotPestMapAllInfo();
|
|
|
-// List<IotPestrecogResVo> list = new ArrayList<>();
|
|
|
-// for (IotPestrecog record : records) {
|
|
|
-// IotPestrecogResVo resVo = new IotPestrecogResVo();
|
|
|
-// BeanUtils.copyProperties(record, resVo);
|
|
|
-// AggregationOperation lookupOperation = LookupOperation.newLookup()
|
|
|
-// .from("IotCbdrecog")
|
|
|
-// .localField("cbdrecogBid")
|
|
|
-// .foreignField("cbdrecogBid")
|
|
|
-// .as("IotCbdrecog");
|
|
|
-// Criteria criteria = new Criteria();
|
|
|
-// criteria.and("pestrecogBid").is(record.getPestrecogBid());
|
|
|
-// Aggregation aggregation = Aggregation.newAggregation(lookupOperation, Aggregation.match(criteria));
|
|
|
-//// Aggregation aggregation= Aggregation.newAggregation(
|
|
|
-//// Aggregation.lookup("IotCbdrecog", "cbdrecogBid", "cbdrecogBid", "IotCbdrecog"),
|
|
|
-//// Aggregation.match(criteria));
|
|
|
-// AggregationResults<Document> result = mongoTemplate.aggregate(aggregation, "IotCbdpest", Document.class);
|
|
|
-// List<Document> objs = result.getMappedResults();
|
|
|
-// if (objs.size() > 0) {
|
|
|
-// Document document = objs.get(0);
|
|
|
-// JSONObject from = JSONObject.from(document);
|
|
|
-// JSONArray array = from.getJSONArray("IotCbdrecog");
|
|
|
-// if (array.size() > 0) {
|
|
|
-// JSONObject jsonObject = array.getJSONObject(0);
|
|
|
-// resVo.setCbdrecogAddr(jsonObject.getString("cbdrecogAddr"));
|
|
|
-// resVo.setCbdrecogManualaddr(jsonObject.getString("cbdrecogManualaddr"));
|
|
|
-// resVo.setCbdrecogMarktype(jsonObject.getString("cbdrecogMarktype"));
|
|
|
-// resVo.setCbdrecogManualmark(jsonObject.getString("cbdrecogManualmark"));
|
|
|
-// resVo.setCbdrecogMachinemark(jsonObject.getString("cbdrecogMachinemark"));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(record.getPestBusid())) {
|
|
|
-// IotPest pest = pestMap.get(record.getPestBusid());
|
|
|
-// if (pest != null) {
|
|
|
-// resVo.setPestName(pest.getPestName());
|
|
|
-// resVo.setPestId(pest.getPestId());
|
|
|
-// list.add(resVo);
|
|
|
-// } else {
|
|
|
-// // 手动识别的名字,待完善
|
|
|
-// resVo.setPestName("-");
|
|
|
-// list.add(resVo);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// return list;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 对返回数据进行封装
|
|
|
-// *
|
|
|
-// * @param records
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// private List<IotPestrecogResVo> getIotPestrecogResVoList2(List<IotPestrecog> records) {
|
|
|
-// Map<String, IotPest> pestMap = iotPestService.selectIotPestMapAllInfo();
|
|
|
-// List<IotPestrecogResVo> list = new ArrayList<>();
|
|
|
-// for (IotPestrecog record : records) {
|
|
|
-// IotPestrecogResVo resVo = new IotPestrecogResVo();
|
|
|
-// BeanUtils.copyProperties(record, resVo);
|
|
|
-// AggregationOperation lookupOperation = LookupOperation.newLookup()
|
|
|
-// .from("IotCbdrecog")
|
|
|
-// .localField("cbdrecogBid")
|
|
|
-// .foreignField("cbdrecogBid")
|
|
|
-// .as("IotCbdrecog");
|
|
|
-// Criteria criteria = new Criteria();
|
|
|
-// criteria.and("pestrecogBid").is(record.getPestrecogBid());
|
|
|
-// Aggregation aggregation = Aggregation.newAggregation(lookupOperation, Aggregation.match(criteria));
|
|
|
-//// Aggregation aggregation= Aggregation.newAggregation(
|
|
|
-//// Aggregation.lookup("IotCbdrecog", "cbdrecogBid", "cbdrecogBid", "IotCbdrecog"),
|
|
|
-//// Aggregation.match(criteria));
|
|
|
-// AggregationResults<Document> result = mongoTemplate.aggregate(aggregation, "IotCbdpest", Document.class);
|
|
|
-// List<Document> objs = result.getMappedResults();
|
|
|
-// if (objs.size() > 0) {
|
|
|
-// Document document = objs.get(0);
|
|
|
-// JSONObject from = JSONObject.from(document);
|
|
|
-// JSONArray array = from.getJSONArray("IotCbdrecog");
|
|
|
-// if (array.size() > 0) {
|
|
|
-// JSONObject jsonObject = array.getJSONObject(0);
|
|
|
-// resVo.setCbdrecogAddr(jsonObject.getString("cbdrecogAddr"));
|
|
|
-// resVo.setCbdrecogManualaddr(jsonObject.getString("cbdrecogManualaddr"));
|
|
|
-// resVo.setCbdrecogMarktype(jsonObject.getString("cbdrecogMarktype"));
|
|
|
-// resVo.setCbdrecogManualmark(jsonObject.getString("cbdrecogManualmark"));
|
|
|
-// resVo.setCbdrecogMachinemark(jsonObject.getString("cbdrecogMachinemark"));
|
|
|
-// }
|
|
|
-// }
|
|
|
-// if (!StringUtils.isEmpty(record.getPestBusid())) {
|
|
|
-// IotPest pest = pestMap.get(record.getPestBusid());
|
|
|
-// if (pest != null) {
|
|
|
-// resVo.setPestName(pest.getPestName());
|
|
|
-// resVo.setPestId(pest.getPestId());
|
|
|
-// list.add(resVo);
|
|
|
-// } else {
|
|
|
-// // 手动识别的名字,待完善
|
|
|
-// resVo.setPestName("-");
|
|
|
-// list.add(resVo);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// return list;
|
|
|
-// }
|
|
|
+
|
|
|
}
|