'提交代码'

dev-discount
= 3 years ago
parent a8ec15156f
commit 04d2c1272a
  1. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 1
      hai-cweb/src/main/java/com/cweb/controller/HighGasController.java
  3. 22
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  4. 1
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  5. 38
      hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java
  6. 1
      hai-schedule/src/main/java/com/hai/schedule/HighGasSchedule.java

@ -113,6 +113,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/highGas/*") .excludePathPatterns("/highGas/*")
.excludePathPatterns("/wechat/*") .excludePathPatterns("/wechat/*")
.excludePathPatterns("/tuanyou/*") .excludePathPatterns("/tuanyou/*")
.excludePathPatterns("/highGas/*")
.excludePathPatterns("/common/*") .excludePathPatterns("/common/*")
.excludePathPatterns("/order/qzOrderToPay") .excludePathPatterns("/order/qzOrderToPay")
.excludePathPatterns("/czOrder/orderRefundNotify") .excludePathPatterns("/czOrder/orderRefundNotify")

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

@ -169,7 +169,7 @@ public class HighOrderController {
} }
if (childOrder.getGoodsType() == 3) { 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!", "参数错误"); log.error("HighOrderController --> addOrder() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_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, "未找到门店信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息");
} }
highOrder.setPayType(2); // 第三方平台 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.setGoodsName(store.getStoreName());
childOrder.setGoodsImg(store.getStoreLogo()); 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.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.setGoodsSpecName("默认");
childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString()))); 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")); highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo"));
if (highGasOilPrice == null) { if (highGasOilPrice == null) {
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));

@ -1,17 +1,24 @@
package com.cweb.controller.pay; package com.cweb.controller.pay;
import com.alibaba.fastjson.JSONObject; 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.security.AESEncodeUtil;
import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.CommonSysConst; import com.hai.config.CommonSysConst;
import com.hai.config.WxOrderConfig; import com.hai.config.WxOrderConfig;
import com.hai.dao.HighGasOrderRefundMapper; import com.hai.dao.HighGasOrderRefundMapper;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighGasOrderRefund; import com.hai.entity.HighGasOrderRefund;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.model.OrderRefundModel; import com.hai.model.OrderRefundModel;
import com.hai.model.ResponseData;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -94,4 +101,35 @@ public class TuanYouController {
log.error("WechatPayController --> wechatNotify() error!", e); 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")); highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getInteger("oilNo"));
if (highGasOilPrice == null) { if (highGasOilPrice == null) {
highGasOilPrice = new HighGasOilPrice();
highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setMerchantStoreId(store.getId());
highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo")); highGasOilPrice.setOilNo(oilPriceObject.getInteger("oilNo"));
highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName"));

Loading…
Cancel
Save