提交实物代码

new-dev
袁野 2 years ago
parent a4755cdf6a
commit 57fb4be4d2
  1. 6
      hai-service/pom.xml
  2. 31
      hai-service/src/main/java/com/hai/entity/HighOrder.java
  3. 4
      hai-service/src/main/java/com/hai/order/model/combine/CombineOrderModel.java
  4. 4
      hai-service/src/main/java/com/hai/order/service/OrderService.java
  5. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  6. 2
      hai-service/src/main/java/com/hai/service/OutRechargeOrderService.java
  7. 28
      hai-service/src/main/java/com/hai/service/impl/OutRechargeOrderServiceImpl.java
  8. 6
      hai-service/src/main/java/com/hai/wxPay/WxConfig.java

@ -345,6 +345,12 @@
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
</dependency> </dependency>
<!-- 微信支付API v3-->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-apache-httpclient</artifactId>
<version>0.4.9</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>

@ -3,6 +3,7 @@ package com.hai.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* high_order * high_order
@ -276,8 +277,38 @@ public class HighOrder implements Serializable {
*/ */
private String ext6; private String ext6;
private String time;
private String goodsTypeName;
public String getGoodsTypeName() {
return goodsTypeName;
}
public void setGoodsTypeName(String goodsTypeName) {
this.goodsTypeName = goodsTypeName;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private List<HighChildOrder> highChildOrderList;
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) {
this.highChildOrderList = highChildOrderList;
}
public Long getId() { public Long getId() {
return id; return id;
} }

@ -0,0 +1,4 @@
package com.hai.order.model.combine;
public class CombineOrderModel {
}

@ -1,5 +1,6 @@
package com.hai.order.service; package com.hai.order.service;
import com.alibaba.fastjson.JSONObject;
import com.hai.entity.HighChildOrder; import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.order.model.CreateOrderModel; import com.hai.order.model.CreateOrderModel;
@ -36,6 +37,9 @@ public interface OrderService {
*/ */
HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception; HighOrder createOrder(CreateOrderModel createOrderModel) throws Exception;
JSONObject createOrderCombine(CreateOrderModel createOrderModel) throws Exception;
/** /**
* 订单取消 * 订单取消
* @param order 订单 * @param order 订单

@ -541,6 +541,12 @@ public class OrderServiceImpl implements OrderService {
return orderData; return orderData;
} }
@Override
public JSONObject createOrderCombine(CreateOrderModel createOrderModel) throws Exception {
return null;
}
@Override @Override
@Transactional( @Transactional(
propagation= Propagation.REQUIRES_NEW, propagation= Propagation.REQUIRES_NEW,

@ -212,4 +212,6 @@ public interface OutRechargeOrderService {
OutRechargeChildOrder mobileChildOrderHandle(HighOrder highOrder , OutRechargeOrder outRechargeOrder); OutRechargeChildOrder mobileChildOrderHandle(HighOrder highOrder , OutRechargeOrder outRechargeOrder);
JSONObject prepaidRechargeOrderHandle(JSONObject object); JSONObject prepaidRechargeOrderHandle(JSONObject object);
boolean rechargeOrderAbnormal(OutRechargeOrder order);
} }

@ -92,6 +92,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Autowired @Autowired
private OutRechargeChildOrderService childOrderService; private OutRechargeChildOrderService childOrderService;
@Resource
private SecConfigService secConfigService;
@Override @Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, Object> map) { public List<OutRechargeOrder> getListRechargeOrder(Map<String, Object> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample(); OutRechargeOrderExample example = new OutRechargeOrderExample();
@ -406,6 +409,10 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
String key = "recharge_" + outRechargeOrder.getId(); String key = "recharge_" + outRechargeOrder.getId();
if (outRechargeOrderService.rechargeOrderAbnormal(outRechargeOrder)) {
return;
}
try { try {
// 分布式锁占坑 // 分布式锁占坑
@ -547,6 +554,10 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override @Override
public void getPrepaidRechargeApi(OutRechargeOrder outRechargeOrder) { public void getPrepaidRechargeApi(OutRechargeOrder outRechargeOrder) {
if (rechargeOrderAbnormal(outRechargeOrder)) {
return;
}
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
object.put("rechargePrice" , outRechargeOrder.getRechargePrice()); object.put("rechargePrice" , outRechargeOrder.getRechargePrice());
object.put("rechargeMobile" , outRechargeOrder.getRechargeContent()); object.put("rechargeMobile" , outRechargeOrder.getRechargeContent());
@ -989,4 +1000,21 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
return childOrder; return childOrder;
} }
@Override
public boolean rechargeOrderAbnormal(OutRechargeOrder order) {
HighOrder highOrder = highOrderService.getOrderByOrderNo(order.getOrderNo());
if (secConfigService.isConfig("RECHARGE_ORDER" , order.getRechargeContent())) {
highOrder.setExceptionStatus(true);
highOrder.setExceptionContent("当前订单存在以前多充值!");
order.setRechargeStatus(204);
orderService.updateOrderData(highOrder);
outRechargeOrderMapper.updateByPrimaryKey(order);
return true;
}
return false;
}
} }

@ -0,0 +1,6 @@
package com.hai.wxPay;
public class WxConfig {
}
Loading…
Cancel
Save