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 80c69658..88ef83c0 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -393,5 +393,57 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value = "/getMobileOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询话费充值订单列表") + public ResponseData getMobileOrderList(@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.getMobileOrderList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getGasOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index def20259..47ccbee5 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -113,6 +113,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/highGas/*") .excludePathPatterns("/wechat/*") .excludePathPatterns("/tuanyou/*") + .excludePathPatterns("/highGas/*") .excludePathPatterns("/common/*") .excludePathPatterns("/order/qzOrderToPay") .excludePathPatterns("/czOrder/orderRefundNotify") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 592d40d9..0c62423d 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -88,7 +88,6 @@ public class HighGasController { iterator.remove(); } } - PageInfo> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance)); for (Map map : mapPageInfo.getList()) { if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) { 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 60306ed5..efbe1773 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -169,7 +169,7 @@ public class HighOrderController { } if (childOrder.getGoodsType() == 3) { - if (childOrder.getGoodsPrice() == null || childOrder.getGasPriceGun() == null || childOrder.getGasPriceVip() == null || StringUtils.isBlank(childOrder.getGasGunNo()) || StringUtils.isBlank(childOrder.getGasOilNo()) || childOrder.getGasOilType() == null) { + if (childOrder.getGasPriceGun() == null || childOrder.getGasPriceVip() == null || StringUtils.isBlank(childOrder.getGasGunNo()) || StringUtils.isBlank(childOrder.getGasOilNo()) || childOrder.getGasOilType() == null) { log.error("HighOrderController --> addOrder() error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } @@ -180,9 +180,29 @@ public class HighOrderController { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); } highOrder.setPayType(2); // 第三方平台 + + // 获取当前加油价格 + JSONObject jsonObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), childOrder.getGasOilNo()); + if (jsonObject == null || !jsonObject.getString("code").equals("200")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格"); + } + if(jsonObject.getJSONArray("result").size() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格"); + } + JSONObject priceDetail = JSONObject.parseObject(JSONObject.toJSONString(jsonObject.getJSONArray("result").get(0)), JSONObject.class); + childOrder.setGoodsName(store.getStoreName()); childOrder.setGoodsImg(store.getStoreLogo()); + + // 平台的价格 + childOrder.setExt1(childOrder.getGasPriceVip().toString()); childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_HALF_UP)); + + // 团油的价格 + childOrder.setGasPriceGun(priceDetail.getBigDecimal("priceGun")); + childOrder.setGasPriceVip(priceDetail.getBigDecimal("priceVip")); + childOrder.setGoodsPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_HALF_UP)); + childOrder.setGoodsSpecName("默认"); childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString()))); } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index ccf3efef..c4a24c5d 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -93,6 +93,7 @@ public class HighTestController { // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { + highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java index 812d0739..c6defe97 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java @@ -1,17 +1,24 @@ package com.cweb.controller.pay; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; import com.hai.common.security.AESEncodeUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.config.CommonSysConst; import com.hai.config.WxOrderConfig; import com.hai.dao.HighGasOrderRefundMapper; +import com.hai.entity.HighChildOrder; import com.hai.entity.HighGasOrderRefund; import com.hai.entity.HighOrder; import com.hai.model.OrderRefundModel; +import com.hai.model.ResponseData; import com.hai.service.HighOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -94,4 +101,35 @@ public class TuanYouController { log.error("WechatPayController --> wechatNotify() error!", e); } } + + @RequestMapping(value = "/abnormalOrderRefund", method = RequestMethod.POST) + @ApiOperation(value = "异常订单退款") + @ResponseBody + public ResponseData abnormalOrderRefund(@RequestBody JSONObject body) { + try { + if (StringUtils.isNotBlank(body.getString("orderNo"))) { + // 查询订单 + HighOrder order = highOrderService.getOrderByOrderNo(body.getString("orderNo")); + // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 + if (order != null && order.getOrderStatus() == 2) { + OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + for (HighChildOrder childOrder : order.getHighChildOrderList()) { + childOrder.setChildOrdeStatus(4); + } + order.setOrderStatus(4); + order.setRefundTime(new Date()); + order.setRefundPrice(order.getPayRealPrice()); + highOrderService.updateOrder(order); + return ResponseMsgUtil.success("退款成功"); + } + } + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败"); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java index 26511f9a..ea47fff2 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java @@ -78,6 +78,7 @@ public class HighGasSchedule { // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo")); if (highGasOilPrice == null) { + highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); diff --git a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java index 50819c66..88bdd7ec 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java @@ -2,7 +2,10 @@ package com.hai.schedule; import com.alibaba.fastjson.JSONObject; import com.hai.common.utils.HttpsUtils; +import com.hai.config.QianZhuConfig; +import com.hai.config.WxOrderConfig; import com.hai.entity.HighOrder; +import com.hai.model.OrderRefundModel; import com.hai.service.HighOrderService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,6 +51,51 @@ public class HighOrderSchedule { } } + /** + * @Author 胡锐 + * @Description 处理话费充值订单 + * @Date 2021/4/4 22:45 + **/ + @Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次 + public void handleMobileOrder() { + List orderList = highOrderService.getAlreadyPaidMobileOrder(); + if (orderList != null && orderList.size() > 0) { + for (HighOrder order : orderList) { + try { + HighOrder highOrder = highOrderService.getOrderById(order.getId()); + if (highOrder != null) { + JSONObject mobileOrderJson = QianZhuConfig.getMobileOrderByOrderNo(highOrder.getOrderNo()); + if (mobileOrderJson != null && mobileOrderJson.getBoolean("success") == true) { + JSONObject data = mobileOrderJson.getJSONObject("data"); + + // 订单状态 0:待付款 5:已支付 10:充值中 15:交易成功 -5:已取消 -10:充值失败 + if (data.getInteger("status") == 15) { + highOrder.getHighChildOrderList().get(0).setChildOrdeStatus(3); + highOrder.setOrderStatus(3); + highOrder.setFinishTime(new Date()); + highOrderService.updateOrder(highOrder); + } + if (data.getInteger("status") == -10 || data.getInteger("status") == -5) { + if(highOrder.getPaySerialNo() != null && highOrder.getPayRealPrice() != null) { + OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(highOrder.getPaySerialNo(), highOrder.getPayRealPrice(), highOrder.getPayRealPrice()); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + highOrder.getHighChildOrderList().get(0).setChildOrdeStatus(4); + highOrder.setOrderStatus(4); + highOrder.setRefundTime(new Date()); + highOrder.setRefundPrice(highOrder.getPayRealPrice()); + highOrderService.updateOrder(highOrder); + } + } + } + } + } + } catch (Exception e) { + log.error("HighCouponSchedule --> handleMobileOrder() error!", e); + } + } + } + } + /** * @Author 胡锐 * @Description 完成团油订单 超过支付时间24小时订单自动完成 diff --git a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java index 9c943301..7d13f415 100644 --- a/hai-service/src/main/java/com/hai/config/QianZhuConfig.java +++ b/hai-service/src/main/java/com/hai/config/QianZhuConfig.java @@ -111,7 +111,8 @@ public class QianZhuConfig { /** - * 获取话费充值Token + * 话费充值 + * 获取Token * @param platformUniqueId 用户唯一id * @param nickname 昵称 * @param mobile 电话号码 @@ -134,6 +135,13 @@ public class QianZhuConfig { return HttpsUtils.doPost("https://live.qianzhu8.com/gateway", JSON.toJSONString(map)); } + /** + * 话费订单 + * 根据订单号查询 + * @param orderNo 订单号 + * @return + * @throws Exception + */ public static JSONObject getMobileOrderByOrderNo(String orderNo) throws Exception { Map contentMap = new LinkedHashMap<>(); contentMap.put("orderNo", orderNo); @@ -148,6 +156,13 @@ public class QianZhuConfig { return HttpsUtils.doPost("https://nf.qianzhu8.com/gateway", JSON.toJSONString(map)); } + /** + * 话费订单 + * 支付订单 + * @param orderNo + * @return + * @throws Exception + */ public static JSONObject payMobileOrder(String orderNo) throws Exception { Map contentMap = new LinkedHashMap<>(); contentMap.put("orderNo", orderNo); 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 83b62b8b..42e960ca 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -226,9 +226,9 @@ public interface HighOrderMapperExt { " a.order_id = b.id" + " and a.goods_type = 4" + " and a.giveaway_type = 0" + - " and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " + +/* " and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " + " and c.company_id = #{map.companyId} " + - " and c.merchant_id = #{map.merchantId} )" + + " and c.merchant_id = #{map.merchantId} )" +*/ " and b.order_no = #{map.orderNo}", " and b.pay_serial_no = #{map.paySerialNo} ", " and b.pay_model = #{map.payModel} ", @@ -276,9 +276,9 @@ public interface HighOrderMapperExt { " a.order_id = b.id" + " and a.goods_type = 5" + " and a.giveaway_type = 0" + - " and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " + +/* " and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " + " and c.company_id = #{map.companyId} " + - " and c.merchant_id = #{map.merchantId} )" + + " and c.merchant_id = #{map.merchantId} )" +*/ " and b.order_no = #{map.orderNo}", " and b.pay_serial_no = #{map.paySerialNo} ", " and b.pay_model = #{map.payModel} ", @@ -290,6 +290,102 @@ public interface HighOrderMapperExt { ""}) List selectCinemaOrderList(@Param("map") Map map); + @Select({""}) + List getMobileOrderList(@Param("map") Map map); + + /** + * 查询处于已经支付的话费订单 + */ + @Select({"SELECT" + + " b.*" + + " FROM" + + " high_child_order a," + + " high_order b" + + " WHERE" + + " a.order_id = b.id" + + " and a.goods_type = 6" + + " and b.order_status = 2" + + " and a.giveaway_type = 0" + + " GROUP BY a.id ORDER BY b.create_time desc"}) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT), + @Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_id", property="memId", jdbcType=JdbcType.BIGINT), + @Result(column="mem_name", property="memName", jdbcType=JdbcType.VARCHAR), + @Result(column="mem_phone", property="memPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_model", property="payModel", jdbcType=JdbcType.INTEGER), + @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER), + @Result(column="pay_gold", property="payGold", jdbcType=JdbcType.INTEGER), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="order_status", property="orderStatus", jdbcType=JdbcType.INTEGER), + @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="cancel_remarks", property="cancelRemarks", jdbcType=JdbcType.VARCHAR), + @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="refund_content", property="refundContent", jdbcType=JdbcType.VARCHAR), + @Result(column="refusal_refund_content", property="refusalRefundContent", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectAlreadyPaidMobileOrder(); + @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 494e26af..7ceba2a1 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -142,6 +142,14 @@ public interface HighOrderService { */ List getCinemaOrderList(Map map) throws Exception; + /** + * 查询话费充值订单 + * @param map + * @return + * @throws Exception + */ + List getMobileOrderList(Map map) throws Exception; + /** * @Author 胡锐 * @Description 查询需要关闭的订单列表 @@ -184,6 +192,12 @@ public interface HighOrderService { **/ Integer countUnusedDiscountByUserId(Long userId , Integer status); + /** + * 查询处于已经支付的话费订单 + * @return + */ + List getAlreadyPaidMobileOrder(); + /** * 查询团油超过支付时间24小时订单 * @return 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 f4ab6a01..3e030003 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 @@ -409,6 +409,19 @@ public class HighOrderServiceImpl implements HighOrderService { return highOrderMapper.selectCinemaOrderList(map); } + @Override + public List getMobileOrderList(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.getMobileOrderList(map); + } + @Override public List getCloseOrder() { return highOrderMapperExt.getCloseOrder(); @@ -460,6 +473,9 @@ public class HighOrderServiceImpl implements HighOrderService { public void cancelOrder(Long orderId) { HighOrder order = getOrderById(orderId); if (order != null) { + if (order.getOrderStatus() != 1) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); + } order.setOrderStatus(5); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 order.setCancelTime(new Date()); @@ -522,6 +538,11 @@ public class HighOrderServiceImpl implements HighOrderService { return highDiscountUserRelMapper.selectByExample(example).size(); } + @Override + public List getAlreadyPaidMobileOrder() { + return highOrderMapperExt.selectAlreadyPaidMobileOrder(); + } + @Override public List> getFinishGasOrder() { return highOrderMapper.selectFinishGasOrder(); 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 42fad488..9dafa790 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 @@ -91,8 +91,9 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { highChildOrder.setChildOrdeStatus(1); highChildOrder.setPraiseStatus(0); - // 计算原始价格 - highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString()))); + /* // 计算原始价格 + highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString())); + highOrder.setTotalPrice();*/ // 1:堂食 2:外带 3:外卖 highChildOrder.setExt1(kfcPlaceOrder.getString("eatType")); @@ -120,8 +121,8 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { highChildOrder.setChildOrdeStatus(1); highChildOrder.setPraiseStatus(0); - // 计算原始价格 - highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString()))); + /*// 计算原始价格 + highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString())));*/ // 观看时间 JSONObject showTimeObject = new JSONObject(); @@ -151,10 +152,11 @@ public class HighQzOrderServiceImpl implements HighQzOrderService { highChildOrder.setGiveawayType(false); highChildOrder.setChildOrdeStatus(1); highChildOrder.setPraiseStatus(0); - // 计算原始价格 - highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString()))); + /* // 计算原始价格 + highOrder.setTotalPrice(highChildOrder.getGoodsPrice().multiply(new BigDecimal(highChildOrder.getSaleCount().toString())));*/ highOrder.getHighChildOrderList().add(highChildOrder); } + highOrderService.insertOrder(highOrder); } return highOrder;