parent
8ba499ce78
commit
1a81591c93
@ -0,0 +1,31 @@
|
|||||||
|
package au.com.royalpay.payment.manage.task;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper;
|
||||||
|
import au.com.royalpay.payment.manage.ofei.core.OfeiServer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by wangning on 2018/1/2.
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@ConditionalOnProperty(value = "app.run-tasks", havingValue = "true")
|
||||||
|
public class OfeiOrderCheckTask {
|
||||||
|
@Resource
|
||||||
|
private OfeiServer ofeiServer;
|
||||||
|
@Resource
|
||||||
|
private TopUpOrderMapper topUpOrderMapper;
|
||||||
|
@Scheduled(cron = "0 0/20 * * * ?")
|
||||||
|
public void checkGreenChannel(){
|
||||||
|
List<String> orderIds = topUpOrderMapper.findOrderIdByStatus("10");
|
||||||
|
for (String orderId : orderIds) {
|
||||||
|
ofeiServer.checkOrder(orderId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="au.com.royalpay.payment.manage.mappers.ofei.TopUpOrderMapper">
|
||||||
|
<select id="findOrderIdByStatus">
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
FROM top_up_order
|
||||||
|
where status = #{status}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,36 @@
|
|||||||
|
<section class="content-header">
|
||||||
|
<h1>Phone Top Up</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-cog"></i> Basic Config
|
||||||
|
</li>
|
||||||
|
<li><a ui-sref="^">Dev Tools</a></li>
|
||||||
|
<li class="active">phone top up</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<div class="box-solid">
|
||||||
|
<div class="box box-warning">
|
||||||
|
<div class="box-header">
|
||||||
|
<form role="form" style="margin:0px auto;width: 50%">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Phone Number</label>
|
||||||
|
<input ng-model="params.phoneNumber" name="code" class="form-control" type="text"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>Amount</label>
|
||||||
|
<input ng-model="params.amount" class="form-control" type="text" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<button class="btn btn-primary btn-block" ng-click="topUp()">commit</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in new issue