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 904a0054..1de8be1a 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -293,5 +293,105 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/getKfcOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询KFC订单列表") + public ResponseData getKfcOrderList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getGasOrderModelList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getGasOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCinemaOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询电影订单列表") + public ResponseData getCinemaOrderList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getGasOrderModelList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getGasOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index 3fb6a66c..1fe6dc2d 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -252,8 +252,7 @@ public class OrderController { // 组装千猪订单 HighOrder qzOrder = highQzOrderService.assemblyQzOrder(orderNo, source); - return ResponseMsgUtil.success(qzOrder); -/* if (qzOrder != null) { + if (qzOrder != null) { Map map = new HashMap<>(); map.put("orderNo", qzOrder.getOrderNo()); map.put("payPrice", qzOrder.getPayPrice()); @@ -291,7 +290,7 @@ public class OrderController { SortedMap sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap); return ResponseMsgUtil.success(sortedMap); } - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");*/ + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号"); } catch (Exception e) { log.error("orderToPay error!", e); return ResponseMsgUtil.exception(e); diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index aaa64de7..83b62b8b 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -191,6 +191,105 @@ public interface HighOrderMapperExt { ""}) List selectGasOrderList(@Param("map") Map map); + @Select({""}) + List selectKfcOrderList(@Param("map") Map map); + + + @Select({""}) + List selectCinemaOrderList(@Param("map") Map map); + @Select({"select a.id orderId,b.id childOrderId from high_order a,high_child_order b where a.id = b.order_id and b.goods_type = 3 and a.order_status = 2 and TIMESTAMPDIFF(MINUTE,a.pay_time,SYSDATE()) > 60*24 GROUP BY b.id"}) List> selectFinishGasOrder(); diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 282fcdcc..494e26af 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -118,7 +118,30 @@ public interface HighOrderService { */ List getGoodsOrderModelList(Map map) throws Exception; + /** + * 查询加油订单 + * @param map + * @return + * @throws Exception + */ List getGasOrderModelList(Map map) throws Exception; + + /** + * 查询肯德基订单 + * @param map + * @return + * @throws Exception + */ + List getKfcOrderModelList(Map map) throws Exception; + + /** + * 查询电影订单 + * @param map + * @return + * @throws Exception + */ + List getCinemaOrderList(Map map) throws Exception; + /** * @Author 胡锐 * @Description 查询需要关闭的订单列表 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 d650fa9c..f4ab6a01 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 @@ -383,6 +383,32 @@ public class HighOrderServiceImpl implements HighOrderService { return highOrderMapper.selectGasOrderList(map); } + @Override + public List getKfcOrderModelList(Map map) throws Exception { + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + return highOrderMapper.selectKfcOrderList(map); + } + + @Override + public List getCinemaOrderList(Map map) throws Exception { + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + return highOrderMapper.selectCinemaOrderList(map); + } + @Override public List getCloseOrder() { return highOrderMapperExt.getCloseOrder(); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java index 309a5fda..74a53e37 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java @@ -41,10 +41,9 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { if (orderDetail != null && orderDetail.getBoolean("success") == true) { JSONObject data = orderDetail.getJSONObject("data"); - HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order != null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单已存在"); + return order; } HighUser highUser = highUserService.findByUnionId(data.getString("platformUniqueId")); if (highUser == null) { @@ -59,7 +58,8 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { highOrder.setPayType(2); highOrder.setPayPrice(data.getBigDecimal("totalPrice")); highOrder.setTotalPrice(data.getBigDecimal("totalPrice")); - highOrder.setDeductionPrice(new BigDecimal("0")); + highOrder.setDeductionPrice(new BigDecimal( + "0")); highOrder.setOrderStatus(1); highOrder.setCreateTime(data.getDate("createTime")); highOrder.setRemarks(data.getString("userRemark"));