|
@@ -177,9 +177,7 @@ public class MiniApp {
|
|
|
QueryWrap<Member> memberQueryWrap = new QueryWrap<>();
|
|
|
memberQueryWrap.eq("member_openId", openId);
|
|
|
Member member = memberService.getOne(memberQueryWrap);
|
|
|
-// 查询订单状态不是未支付的订单
|
|
|
- QueryWrap<Order> orderQueryWrap = new QueryWrap<>();
|
|
|
- orderQueryWrap.notIn("order_status", "0");
|
|
|
+// 查询用户所有除了未支付状态的订单
|
|
|
List<Order> orderList = orderService.getOrderList(member.getId());
|
|
|
|
|
|
return R.success(orderList);
|
|
@@ -210,32 +208,50 @@ public class MiniApp {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return 查询订单条数
|
|
|
+ * @return 查询订单条数 附近设备条数
|
|
|
*/
|
|
|
- @GetMapping("/getOrdersTotal")
|
|
|
- public R<Integer> getOrdersTotal() {
|
|
|
+ @GetMapping("/getTotal")
|
|
|
+ public R<Map<String, Integer>> getTotal() {
|
|
|
+ BaseContextHandler.setTenant("0000");
|
|
|
+ String openId = BaseContextHandler.get("openId");
|
|
|
+ QueryWrap<Member> memberQueryWrap = new QueryWrap<>();
|
|
|
+ memberQueryWrap.eq("member_openId", openId);
|
|
|
+ Member member = memberService.getOne(memberQueryWrap);
|
|
|
+
|
|
|
QueryWrap<Order> orderQueryWrap = new QueryWrap<>();
|
|
|
- orderQueryWrap.notIn("order_status", "0");
|
|
|
+ orderQueryWrap.eq("order_member_id", member.getId()).notIn("order_status", "0");
|
|
|
int count = orderService.count(orderQueryWrap);
|
|
|
- return R.success(count);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * @return 查询附近设备条数
|
|
|
- */
|
|
|
- @GetMapping("/getEquTotal")
|
|
|
- public R<Integer> getEquTotal() {
|
|
|
|
|
|
QueryWrap<ProductionResource> queryWrap = new QueryWrap<>();
|
|
|
queryWrap.orderByDesc("create_time").last("limit 5");
|
|
|
List<ProductionResource> list = productionTenantResourceService.list(queryWrap);
|
|
|
+ HashMap<String, Integer> resultMap = new HashMap<>();
|
|
|
+ resultMap.put("goodsTotal", count);
|
|
|
if (null == list) {
|
|
|
- return R.success(0);
|
|
|
+ resultMap.put("equTotal", 0);
|
|
|
+ return R.success(resultMap);
|
|
|
}
|
|
|
+ resultMap.put("equTotal", list.size());
|
|
|
|
|
|
- return R.success(list.size());
|
|
|
+ return R.success(resultMap);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @return 查询附近设备条数
|
|
|
+ */
|
|
|
+// @GetMapping("/getEquTotal")
|
|
|
+// public R<Integer> getEquTotal() {
|
|
|
+//
|
|
|
+// QueryWrap<ProductionResource> queryWrap = new QueryWrap<>();
|
|
|
+// queryWrap.orderByDesc("create_time").last("limit 5");
|
|
|
+// List<ProductionResource> list = productionTenantResourceService.list(queryWrap);
|
|
|
+// if (null == list) {
|
|
|
+// return R.success(0);
|
|
|
+// }
|
|
|
+//
|
|
|
+// return R.success(list.size());
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
}
|