parent
bd5b1541af
commit
a4a16fbaba
@ -0,0 +1,9 @@
|
||||
package au.com.royalpay.payment.manage.dev.core;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface HfUpdateService {
|
||||
|
||||
String updateStatus();
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package au.com.royalpay.payment.manage.dev.core.impl;
|
||||
|
||||
import au.com.royalpay.payment.manage.dev.core.HfClearAmountService;
|
||||
import au.com.royalpay.payment.manage.dev.core.HfUpdateService;
|
||||
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
||||
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
||||
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
||||
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
||||
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
||||
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.JsonArray;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class HfUpdateImpl implements HfUpdateService {
|
||||
@Resource
|
||||
private ClientMapper clientMapper;
|
||||
@Resource
|
||||
private MpWechatApiProvider mpWechatApiProvider;
|
||||
|
||||
@Override
|
||||
public String updateStatus() {
|
||||
List<JSONObject> clientIds = clientMapper.findByhfPayUrlNotNull();
|
||||
clientIds.forEach(dbResult -> {
|
||||
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + dbResult.getString("client_moniker") + "/jump/pc");
|
||||
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
|
||||
dbResult.put("hf_pay_url", api.registerShortUrl(longUrl));
|
||||
clientMapper.update(dbResult);
|
||||
});
|
||||
return "ok";
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<section class="content-header">
|
||||
<h1>更新HF短链接</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">hfupdate</li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<button class="btn btn-primary" ng-click="select()">Update</button> <label ng-hide="selecttotal" style="padding-left: 30px">请稍后</label>
|
||||
</div>
|
||||
</section>
|
Loading…
Reference in new issue