Merge branch 'develop'

master
yixian 4 years ago
commit a57e66ca3f

@ -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);
}

@ -226,7 +226,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
let arr = $scope.plans.filter(p => p.plan_id === $scope.task.plan)
chosenPlan = arr.length ? arr[0] : null;
$scope.$close({
plan_id: $scope.task.remark.replace(' ', '') + randomString(6),
task_id: $scope.task.remark.replace(' ', '') + randomString(6),
settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'),
remark: $scope.task.remark,
plan: chosenPlan
@ -243,7 +243,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
cleanDays.push(3);
}
$scope.$close({
plan_id: $scope.task.remark.replace(' ', '') + randomString(6),
task_id: $scope.task.remark.replace(' ', '') + randomString(6),
disabled_clean_days: cleanDays,
settle_date: $filter('date')($scope.task.settle_date, 'yyyy-MM-dd'),
last_settle_date: $scope.task.last_settle_date != null ? $filter('date')($scope.task.last_settle_date, 'yyyy-MM-dd') : null,

Loading…
Cancel
Save