From e836d705355e6a2561c91ce23f698655371baa7b Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Sun, 28 Mar 2021 23:29:26 +0800 Subject: [PATCH] 1 --- .../bweb/controller/HighOrderController.java | 34 +++++++++++++++++-- .../cweb/controller/HighOrderController.java | 11 ++++-- .../service/impl/HighOrderServiceImpl.java | 5 +++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 5516e659..c9c962c4 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -8,6 +8,7 @@ import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; import com.hai.service.HighCouponCodeService; @@ -44,9 +45,6 @@ public class HighOrderController { @Resource private HighOrderService highOrderService; - @Resource - private HighCouponService highCouponService; - @Resource private HighCouponCodeService highCouponCodeService; @@ -98,4 +96,34 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/getOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户订单") + public ResponseData getOrderList( + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "phone", required = false) String phone, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + +// // 用户 +// SessionObject sessionObject = userCenter.getSessionObject(request); +// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + map.put("status", status); + map.put("orderNo", orderNo); + map.put("phone", phone); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index b0c63902..ca03e504 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -188,8 +188,11 @@ public class HighOrderController { @RequestMapping(value = "/getUserOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取用户订单") - public ResponseData getUserOrderList(@RequestParam(name = "pageNum", required = true) Integer pageNum, - @RequestParam(name = "pageSize", required = true) Integer pageSize, + public ResponseData getUserOrderList( + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { @@ -199,9 +202,11 @@ public class HighOrderController { Map map = new HashMap<>(); map.put("memId", userInfoModel.getHighUser().getId()); + map.put("status", status); + map.put("orderNo", orderNo); PageHelper.startPage(pageNum,pageSize); - return ResponseMsgUtil.success(new PageInfo<>(highCouponService.getCouponList(map))); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderList(map))); } catch (Exception e) { log.error("HighOrderController --> getUserOrderList() error!", e); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 845a3611..92ef5868 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -208,6 +208,7 @@ public class HighOrderServiceImpl implements HighOrderService { @Override public List getOrderList(Map map) { + HighOrderExample example = new HighOrderExample(); HighOrderExample.Criteria criteria = example.createCriteria(); @@ -223,6 +224,10 @@ public class HighOrderServiceImpl implements HighOrderService { criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo")); } + if (MapUtils.getString(map, "phone") != null) { + criteria.andMemPhoneEqualTo(MapUtils.getString(map, "phone")); + } + example.setOrderByClause("create_time desc"); return highOrderMapper.selectByExample(example); }