|
|
@ -30,6 +30,8 @@ import org.apache.http.client.methods.HttpPost; |
|
|
|
import org.apache.http.entity.StringEntity; |
|
|
|
import org.apache.http.entity.StringEntity; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
import org.apache.http.impl.client.CloseableHttpClient; |
|
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
@ -46,6 +48,8 @@ import java.util.concurrent.TimeUnit; |
|
|
|
@Service("outRechargeOrderService") |
|
|
|
@Service("outRechargeOrderService") |
|
|
|
public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(OutRechargeOrderServiceImpl.class); |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private OutRechargeOrderMapper outRechargeOrderMapper; |
|
|
|
private OutRechargeOrderMapper outRechargeOrderMapper; |
|
|
|
|
|
|
|
|
|
|
@ -730,7 +734,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
|
|
|
|
|
|
|
|
// 查询充值产品
|
|
|
|
// 查询充值产品
|
|
|
|
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId(), null); |
|
|
|
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(outRechargeOrder.getGoodsId(), null); |
|
|
|
|
|
|
|
System.out.println("话费定时任务 -> 需要重新充值:开始"); |
|
|
|
// 查询充值子订单
|
|
|
|
// 查询充值子订单
|
|
|
|
Map<String, Object> childOrderMap = new HashMap<>(); |
|
|
|
Map<String, Object> childOrderMap = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
@ -785,9 +789,8 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (String s : rechargePlatform) { |
|
|
|
for (String s : rechargePlatform) { |
|
|
|
TimeUnit.SECONDS.sleep(1); |
|
|
|
|
|
|
|
System.out.println("-----------------------------------------------------------------------------------------------------------------------------------------------------" + new Date()); |
|
|
|
|
|
|
|
// 尖椒充值
|
|
|
|
// 尖椒充值
|
|
|
|
|
|
|
|
System.out.println("话费定时任务 -> 需要重新充值:尖椒开始"); |
|
|
|
if (s.equals("1") && type == 1) { |
|
|
|
if (s.equals("1") && type == 1) { |
|
|
|
object.put("out_order_id", orderNo); |
|
|
|
object.put("out_order_id", orderNo); |
|
|
|
object.put("amount", outRechargePrice.getRechargePrice()); |
|
|
|
object.put("amount", outRechargePrice.getRechargePrice()); |
|
|
@ -808,12 +811,12 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
} |
|
|
|
} |
|
|
|
// 龙阅充值
|
|
|
|
// 龙阅充值
|
|
|
|
if (s.equals("2") && type == 2) { |
|
|
|
if (s.equals("2") && type == 2) { |
|
|
|
|
|
|
|
System.out.println("话费定时任务 -> 需要重新充值:龙阅开始"); |
|
|
|
object.put("out_trade_num", orderNo); |
|
|
|
object.put("out_trade_num", orderNo); |
|
|
|
object.put("product_id", outRechargePrice.getGoodsId()); |
|
|
|
object.put("product_id", outRechargePrice.getGoodsId()); |
|
|
|
object.put("mobile", outRechargeOrder.getRechargeContent()); |
|
|
|
object.put("mobile", outRechargeOrder.getRechargeContent()); |
|
|
|
object.put("notifyUrl", CommonSysConst.getSysConfig().getLyNotifyUrl()); |
|
|
|
object.put("notifyUrl", CommonSysConst.getSysConfig().getLyNotifyUrl()); |
|
|
|
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object); |
|
|
|
JSONObject returnObject = RechargeConfig.rechargeOrderByLy(object); |
|
|
|
System.out.println("龙阅请求回调地址---------------------" + CommonSysConst.getSysConfig().getLyNotifyUrl()); |
|
|
|
|
|
|
|
object.put("return_content", returnObject); |
|
|
|
object.put("return_content", returnObject); |
|
|
|
if (returnObject != null && returnObject.getLong("errno") == 0) { |
|
|
|
if (returnObject != null && returnObject.getLong("errno") == 0) { |
|
|
|
childOrder.setStatus(102); |
|
|
|
childOrder.setStatus(102); |
|
|
@ -854,6 +857,7 @@ public class OutRechargeOrderServiceImpl implements OutRechargeOrderService { |
|
|
|
outRechargeOrder.setRechargeStatus(204); |
|
|
|
outRechargeOrder.setRechargeStatus(204); |
|
|
|
} |
|
|
|
} |
|
|
|
outRechargeOrderService.updateOrder(outRechargeOrder); |
|
|
|
outRechargeOrderService.updateOrder(outRechargeOrder); |
|
|
|
|
|
|
|
System.out.println("话费定时任务 -> 需要重新充值:结束"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|