master
kira 6 years ago
parent 6bd68974e0
commit be79766deb

@ -1,30 +1,28 @@
package au.com.royalpay.payment.manage.dev.core.impl; 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.dev.core.HfUpdateService;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper; import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper; 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.MpWechatApi;
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
import au.com.royalpay.payment.tools.env.PlatformEnvironment; 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.alibaba.fastjson.JSONObject;
import com.google.gson.JsonArray;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List; import java.util.List;
import javax.annotation.Resource;
@Service @Service
public class HfUpdateImpl implements HfUpdateService { public class HfUpdateImpl implements HfUpdateService {
@Resource @Resource
private ClientMapper clientMapper; private ClientMapper clientMapper;
@Resource @Resource
private MpWechatApiProvider mpWechatApiProvider; private MpWechatApiProvider mpWechatApiProvider;
@Resource
private ClientConfigMapper clientConfigMapper;
@Override @Override
public String updateStatus() { public String updateStatus() {
@ -32,8 +30,14 @@ public class HfUpdateImpl implements HfUpdateService {
clientIds.forEach(dbResult -> { clientIds.forEach(dbResult -> {
String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + dbResult.getString("client_moniker") + "/jump/pc"); String longUrl = PlatformEnvironment.getEnv().concatUrl("/api/v1.0/hf_gateway/partners/" + dbResult.getString("client_moniker") + "/jump/pc");
MpWechatApi api = mpWechatApiProvider.getNewPaymentApi(); MpWechatApi api = mpWechatApiProvider.getNewPaymentApi();
dbResult.put("hf_pay_url", api.registerShortUrl(longUrl)); String url = api.registerShortUrl(longUrl);
dbResult.put("hf_pay_url", url);
JSONObject config = new JSONObject();
config.put("client_id",dbResult.getString("client_id"));
config.put("hf_pay_url", url);
clientConfigMapper.update(config);
clientMapper.update(dbResult); clientMapper.update(dbResult);
}); });
return "ok"; return "ok";
} }

Loading…
Cancel
Save