|
|
@ -15,6 +15,8 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
import org.joda.time.DateTimeZone;
|
|
|
|
import org.joda.time.DateTimeZone;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
|
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
@ -38,6 +40,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
|
public class SettleTaskServiceImpl implements SettleTasksService {
|
|
|
|
public class SettleTaskServiceImpl implements SettleTasksService {
|
|
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
private final SysSettlePlanMapper planMapper;
|
|
|
|
private final SysSettlePlanMapper planMapper;
|
|
|
|
private final StringRedisTemplate redisTemplate;
|
|
|
|
private final StringRedisTemplate redisTemplate;
|
|
|
|
private final MerchantInfoProvider mchInfoProvider;
|
|
|
|
private final MerchantInfoProvider mchInfoProvider;
|
|
|
@ -105,8 +108,10 @@ public class SettleTaskServiceImpl implements SettleTasksService {
|
|
|
|
URI uri = UriComponentsBuilder.fromHttpUrl(transactionHost).replacePath(SETTLE_TASK_URI)
|
|
|
|
URI uri = UriComponentsBuilder.fromHttpUrl(transactionHost).replacePath(SETTLE_TASK_URI)
|
|
|
|
.build().toUri();
|
|
|
|
.build().toUri();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
String taskStr = JSON.toJSONString(tasks);
|
|
|
|
|
|
|
|
logger.info("submitting settlement task:{}--------->{}", uri, taskStr);
|
|
|
|
restTemplate.exchange(RequestEntity.post(uri).contentType(MediaType.APPLICATION_JSON)
|
|
|
|
restTemplate.exchange(RequestEntity.post(uri).contentType(MediaType.APPLICATION_JSON)
|
|
|
|
.body(JSON.toJSONString(tasks).getBytes(StandardCharsets.UTF_8)), String.class);
|
|
|
|
.body(taskStr.getBytes(StandardCharsets.UTF_8)), String.class);
|
|
|
|
} catch (RestClientResponseException e) {
|
|
|
|
} catch (RestClientResponseException e) {
|
|
|
|
String resp = e.getResponseBodyAsString();
|
|
|
|
String resp = e.getResponseBodyAsString();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|