dev-discount
胡锐 4 years ago
commit 27ba4e5812
  1. 52
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  3. 1
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  4. 22
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  5. 1
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  6. 38
      hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java
  7. 1
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java
  8. 48
      hai-schedule/src/main/java/com/hai/schedule/HighOrderSchedule.java
  9. 17
      hai-service/src/main/java/com/hai/config/QianZhuConfig.java
  10. 104
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  11. 14
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  12. 21
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  13. 14
      hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.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<String,Object> 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);
}
}
}

@ -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")

@ -88,7 +88,6 @@ public class HighGasController {
iterator.remove();
}
}
PageInfo<Map<String, Object>> mapPageInfo = PageUtil.initPageInfoObj(pageNum, distance.size(), pageSize, new PageInfo<>(distance));
for (Map<String, Object> map : mapPageInfo.getList()) {
if (StringUtils.isNotBlank(MapUtils.getString(map, "oil_no"))) {

@ -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())));
}

@ -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"));

@ -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);
}
}
}

@ -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"));

@ -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<HighOrder> 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小时订单自动完成

@ -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<String,Object> 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<String,Object> contentMap = new LinkedHashMap<>();
contentMap.put("orderNo", orderNo);

@ -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 " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +*/
" <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
" <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
" <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
@ -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 " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +*/
" <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
" <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
" <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
@ -290,6 +290,102 @@ public interface HighOrderMapperExt {
"</script>"})
List<HighOrderModel> selectCinemaOrderList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType," +
" b.id orderId, " +
" a.goods_name goodsName, " +
" a.goods_type goodsTypeId," +
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType," +
" b.order_no orderNo," +
" b.mem_name memName," +
" b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " +
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType," +
" b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," +
" b.deduction_price deductionPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold," +
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice," +
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, " +
" b.order_status orderStatusId," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.cancel_time cancelTime," +
" b.refund_time refundTime," +
" b.refund_content refundContent," +
" b.refusal_refund_content refusalRefundContent" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.goods_type = 6" +
" and a.giveaway_type = 0" +
/* " and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </if> )" +*/
" <if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
" <if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
" <if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
" <if test='map.payType != null'> and b.pay_type = #{map.payType} </if>",
" <if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>",
" <if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>",
" <if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>",
" GROUP BY a.id ORDER BY b.create_time desc" +
"</script>"})
List<HighOrderModel> getMobileOrderList(@Param("map") Map<String,Object> 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<HighOrder> 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<Map<String,Object>> selectFinishGasOrder();

@ -142,6 +142,14 @@ public interface HighOrderService {
*/
List<HighOrderModel> getCinemaOrderList(Map<String,Object> map) throws Exception;
/**
* 查询话费充值订单
* @param map
* @return
* @throws Exception
*/
List<HighOrderModel> getMobileOrderList(Map<String,Object> map) throws Exception;
/**
* @Author 胡锐
* @Description 查询需要关闭的订单列表
@ -184,6 +192,12 @@ public interface HighOrderService {
**/
Integer countUnusedDiscountByUserId(Long userId , Integer status);
/**
* 查询处于已经支付的话费订单
* @return
*/
List<HighOrder> getAlreadyPaidMobileOrder();
/**
* 查询团油超过支付时间24小时订单
* @return

@ -409,6 +409,19 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapper.selectCinemaOrderList(map);
}
@Override
public List<HighOrderModel> getMobileOrderList(Map<String, Object> 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<HighOrder> 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<HighOrder> getAlreadyPaidMobileOrder() {
return highOrderMapperExt.selectAlreadyPaidMobileOrder();
}
@Override
public List<Map<String, Object>> getFinishGasOrder() {
return highOrderMapper.selectFinishGasOrder();

@ -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;

Loading…
Cancel
Save