|
|
|
@ -4,6 +4,7 @@ import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksServic
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.web.ManualSettleTask;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.SysSettlePlanMapper;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
|
|
|
|
import au.com.royalpay.payment.tools.livecheck.AppLiveCheck;
|
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONException;
|
|
|
|
@ -36,15 +37,17 @@ public class SettleTaskServiceImpl implements SettleTasksService {
|
|
|
|
|
private final String prefix;
|
|
|
|
|
private final RestTemplate restTemplate;
|
|
|
|
|
private final String transactionHost;
|
|
|
|
|
private final AppLiveCheck appLiveCheck;
|
|
|
|
|
private static final String SETTLE_TASK_URI = "/dev/manual/settle_tasks";
|
|
|
|
|
|
|
|
|
|
public SettleTaskServiceImpl(SysSettlePlanMapper planMapper, StringRedisTemplate redisTemplate,
|
|
|
|
|
MerchantInfoProvider mchInfoProvider, @Value("${app.redis.prefix}") String prefix,
|
|
|
|
|
@Value("${platform.services.transaction:http://127.0.0.1:6012}") String transactionHost) {
|
|
|
|
|
@Value("${platform.services.transaction:http://127.0.0.1:6012}") String transactionHost, AppLiveCheck appLiveCheck) {
|
|
|
|
|
this.planMapper = planMapper;
|
|
|
|
|
this.redisTemplate = redisTemplate;
|
|
|
|
|
this.mchInfoProvider = mchInfoProvider;
|
|
|
|
|
this.prefix = prefix;
|
|
|
|
|
this.appLiveCheck = appLiveCheck;
|
|
|
|
|
this.restTemplate = new RestTemplateBuilder()
|
|
|
|
|
.messageConverters(new ByteArrayHttpMessageConverter(),
|
|
|
|
|
new StringHttpMessageConverter(StandardCharsets.UTF_8))
|
|
|
|
@ -71,6 +74,8 @@ public class SettleTaskServiceImpl implements SettleTasksService {
|
|
|
|
|
return idleStatus;
|
|
|
|
|
}
|
|
|
|
|
JSONObject stdObj = JSON.parseObject(std);
|
|
|
|
|
boolean live = appLiveCheck.listLiveApps().contains(stdObj.getString("server_id"));
|
|
|
|
|
stdObj.put("processing", live);
|
|
|
|
|
if (!stdObj.getBooleanValue("processing")) {
|
|
|
|
|
stdObj.put("interrupted", true);
|
|
|
|
|
}
|
|
|
|
|