add manual task log

master
Yixian 3 years ago
parent 796b8d3ef0
commit c18d26aaa0

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

Loading…
Cancel
Save