|
@@ -12,9 +12,7 @@ import com.llisoft.pay.entity.App;
|
|
import com.llisoft.pay.entity.Order;
|
|
import com.llisoft.pay.entity.Order;
|
|
import com.llisoft.pay.util.BeanUtil;
|
|
import com.llisoft.pay.util.BeanUtil;
|
|
import com.llisoft.pay.util.CodeUtil;
|
|
import com.llisoft.pay.util.CodeUtil;
|
|
-import com.llisoft.pay.vo.OrderAddResponseVo;
|
|
|
|
import com.llisoft.pay.vo.OrderInfoResponseVo;
|
|
import com.llisoft.pay.vo.OrderInfoResponseVo;
|
|
-import com.llisoft.pay.vo.OrderPayResponseVo;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -43,7 +41,7 @@ public class OrderService {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public OrderAddResponseVo add(String appKey, int orderMoney, String orderTitle) throws Exception{
|
|
|
|
|
|
+ public String add(String appKey, int orderMoney, String orderTitle) throws Exception{
|
|
// 验证appKey合法性
|
|
// 验证appKey合法性
|
|
App app = appService.get(appKey);
|
|
App app = appService.get(appKey);
|
|
if (Objects.isNull(app)) {
|
|
if (Objects.isNull(app)) {
|
|
@@ -63,10 +61,7 @@ public class OrderService {
|
|
order.setAppId(app.getAppId());
|
|
order.setAppId(app.getAppId());
|
|
orderDao.insert(order);
|
|
orderDao.insert(order);
|
|
logger.info("添加订单成功: {}", orderNum);
|
|
logger.info("添加订单成功: {}", orderNum);
|
|
- // 返回结果
|
|
|
|
- OrderAddResponseVo vo = new OrderAddResponseVo();
|
|
|
|
- vo.setOrderNum(orderNum);
|
|
|
|
- return vo;
|
|
|
|
|
|
+ return orderNum;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -76,18 +71,14 @@ public class OrderService {
|
|
* @return
|
|
* @return
|
|
* @throws Exception
|
|
* @throws Exception
|
|
*/
|
|
*/
|
|
- public OrderPayResponseVo pay(String orderNum, byte payType, boolean isMobile) throws Exception{
|
|
|
|
|
|
+ public String pay(String orderNum, byte payType, boolean isMobile) throws Exception{
|
|
Order order = orderDao.selectByOrderNum(orderNum);
|
|
Order order = orderDao.selectByOrderNum(orderNum);
|
|
if(order.getOrderStatus() == STATUS_PAYED){
|
|
if(order.getOrderStatus() == STATUS_PAYED){
|
|
throw new Exception("订单已经支付过: " + orderNum);
|
|
throw new Exception("订单已经支付过: " + orderNum);
|
|
}
|
|
}
|
|
// 添加支付记录
|
|
// 添加支付记录
|
|
String payNum = payService.add(order.getOrderId(), payType);
|
|
String payNum = payService.add(order.getOrderId(), payType);
|
|
- String html = payService.pay(payNum, isMobile);
|
|
|
|
- // 返回结果
|
|
|
|
- OrderPayResponseVo vo = new OrderPayResponseVo();
|
|
|
|
- vo.setHtml(html);
|
|
|
|
- return vo;
|
|
|
|
|
|
+ return payService.pay(payNum, isMobile);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|