提交实物代码

new-dev
袁野 2 years ago
parent a4755cdf6a
commit 57fb4be4d2
  1. 6
      hai-service/pom.xml
  2. 33
      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. 10
      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>
<artifactId>junit</artifactId>
</dependency>
<!-- 微信支付API v3-->
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-apache-httpclient</artifactId>
<version>0.4.9</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>

@ -3,6 +3,7 @@ package com.hai.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* high_order
@ -276,8 +277,38 @@ public class HighOrder implements Serializable {
*/
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 List<HighChildOrder> highChildOrderList;
public List<HighChildOrder> getHighChildOrderList() {
return highChildOrderList;
}
public void setHighChildOrderList(List<HighChildOrder> highChildOrderList) {
this.highChildOrderList = highChildOrderList;
}
public Long getId() {
return id;
}
@ -892,4 +923,4 @@ public class HighOrder implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

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

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

@ -494,14 +494,14 @@ public class OrderServiceImpl implements OrderService {
}
order.setSurplusRefundPrice(new BigDecimal("0"));
order.setSurplusRefundPrice(new BigDecimal("0") );
order.setSurplusRefundIntegral(0);
order.setSearchTitle(order.getOrderNo());
// 订单入库前处理
for (HighChildOrder childOrder : order.getHighChildOrderList()) {
childOrder.setOrderNo(order.getOrderNo());
childOrder.setSurplusRefundNum(childOrder.getSaleCount());
childOrder.setSurplusRefundNum(childOrder.getSaleCount()) ;
// 计算 子订单 在交易订单金额中的占比
BigDecimal ratio = childOrder.getGoodsPrice().divide(order.getTotalPrice(), 2, BigDecimal.ROUND_DOWN).setScale(2);
@ -541,6 +541,12 @@ public class OrderServiceImpl implements OrderService {
return orderData;
}
@Override
public JSONObject createOrderCombine(CreateOrderModel createOrderModel) throws Exception {
return null;
}
@Override
@Transactional(
propagation= Propagation.REQUIRES_NEW,

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

@ -92,6 +92,9 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Autowired
private OutRechargeChildOrderService childOrderService;
@Resource
private SecConfigService secConfigService;
@Override
public List<OutRechargeOrder> getListRechargeOrder(Map<String, Object> map) {
OutRechargeOrderExample example = new OutRechargeOrderExample();
@ -406,6 +409,10 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
String key = "recharge_" + outRechargeOrder.getId();
if (outRechargeOrderService.rechargeOrderAbnormal(outRechargeOrder)) {
return;
}
try {
// 分布式锁占坑
@ -547,6 +554,10 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
@Override
public void getPrepaidRechargeApi(OutRechargeOrder outRechargeOrder) {
if (rechargeOrderAbnormal(outRechargeOrder)) {
return;
}
JSONObject object = new JSONObject();
object.put("rechargePrice" , outRechargeOrder.getRechargePrice());
object.put("rechargeMobile" , outRechargeOrder.getRechargeContent());
@ -989,4 +1000,21 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService {
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