dev-discount
199901012 4 years ago
commit 3599b5e2f8
  1. 34
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 9
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  3. 5
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.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<String,Object> 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);
}
}
}

@ -188,7 +188,10 @@ public class HighOrderController {
@RequestMapping(value = "/getUserOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户订单")
public ResponseData getUserOrderList(@RequestParam(name = "pageNum", required = true) Integer pageNum,
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<String,Object> 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);

@ -209,6 +209,7 @@ public class HighOrderServiceImpl implements HighOrderService {
@Override
public List<HighOrder> getOrderList(Map<String, Object> map) {
HighOrderExample example = new HighOrderExample();
HighOrderExample.Criteria criteria = example.createCriteria();
@ -224,6 +225,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);
}

Loading…
Cancel
Save