From 7376e815929dd389207943b1aaff9ac46e83566a Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Sun, 21 Nov 2021 20:37:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/HighOrderPreController.java | 16 +++++++++++- .../com/hai/service/HighOrderPreService.java | 7 ++++++ .../service/impl/HighOrderPreServiceImpl.java | 25 ++++++++++--------- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderPreController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderPreController.java index c951848d..333f10ad 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderPreController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderPreController.java @@ -88,7 +88,7 @@ public class HighOrderPreController { @RequestMapping(value = "/getOrderPreById", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "根据id查询预约订单详情") + @ApiOperation(value = "根据预约订单id 查询预约订单详情") public ResponseData getOrderPreById(@RequestParam(name = "orderPreId", required = true) Long orderPreId) { try { @@ -100,6 +100,20 @@ public class HighOrderPreController { } } + @RequestMapping(value = "/getPreByOrderIdId", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据订单id 查询预约订单详情") + public ResponseData getPreByOrderIdId(@RequestParam(name = "orderId", required = true) Long orderId) { + try { + + return ResponseMsgUtil.success(highOrderPreService.getPreByOrderId(orderId)); + + } catch (Exception e) { + log.error("HighOrderController --> getPreByOrderIdId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/orderComplete", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "订单完成") diff --git a/hai-service/src/main/java/com/hai/service/HighOrderPreService.java b/hai-service/src/main/java/com/hai/service/HighOrderPreService.java index 3fd95f2a..d5ed40b2 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderPreService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderPreService.java @@ -24,6 +24,13 @@ public interface HighOrderPreService { **/ HighOrderPre findByOrderId(Long orderId); + /** + * 根据订单ID 查询预约信息 + * @param orderId + * @return + */ + HighOrderPre getPreByOrderId(Long orderId); + /** * @Author Sum1Dream * @Description // 根据订单号查询订单 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderPreServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderPreServiceImpl.java index 4d5b16dd..49aed02e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderPreServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderPreServiceImpl.java @@ -62,13 +62,13 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { criteria.andPreUserPhoneEqualTo(MapUtils.getString(map, "userPhone")); } -<<<<<<< HEAD if (StringUtils.isNotBlank(MapUtils.getString(map,"createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map,"createTimeE"))) { criteria.andCreateTimeBetween( DateUtil.format(MapUtils.getString(map,"createTimeS") , "yyyy-MM-dd HH:mm:ss") , DateUtil.format(MapUtils.getString(map,"createTimeE") , "yyyy-MM-dd HH:mm:ss")); -======= + } + if (MapUtils.getString(map, "preOrderNo") != null) { criteria.andPreOrderNoLike("%" + MapUtils.getString(map, "preOrderNo") + "%"); } @@ -77,13 +77,6 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { criteria.andPreUserNameLike("%" + MapUtils.getString(map, "preUserName") + "%"); } - - if (MapUtils.getString(map , "createTimeS") !=null && MapUtils.getString(map , "createTimeE") != null) { - criteria.andCreateTimeBetween( - DateUtil.format(MapUtils.getString(map , "createTimeS") , "yyyy-MM-dd HH:mm:ss") , - DateUtil.format(MapUtils.getString(map , "createTimeE") , "yyyy-MM-dd HH:mm:ss")); ->>>>>>> 635a7e3af19c875fe2f81995c7898dd251b70d32 - } return highOrderPreMapper.selectByExample(example); } @@ -92,6 +85,17 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { return highOrderPreMapper.selectByPrimaryKey(orderId); } + @Override + public HighOrderPre getPreByOrderId(Long orderId) { + HighOrderPreExample example = new HighOrderPreExample(); + example.createCriteria().andOrderIdEqualTo(orderId); + List list = highOrderPreMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + @Override public HighOrderPre findByOrderNo(String orderNo) { return null; @@ -99,11 +103,8 @@ public class HighOrderPreServiceImpl implements HighOrderPreService { @Override public void insertOrderPre(HighOrderPre highOrderPre) { -<<<<<<< HEAD highOrderPre.setCreateTime(new Date()); highOrderPre.setUpdateTime(new Date()); -======= ->>>>>>> 635a7e3af19c875fe2f81995c7898dd251b70d32 highOrderPreMapper.insert(highOrderPre); }