rule update

master
yixian 7 years ago
parent d47830f7f9
commit 211da4f69e

@ -53,6 +53,9 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
throw new BadRequestException("Cannot settle today's transactions"); throw new BadRequestException("Cannot settle today's transactions");
} }
JSONObject currentTask = findCurrentSettle(clientId, false); JSONObject currentTask = findCurrentSettle(clientId, false);
if (currentTask.getBooleanValue("locked")) {
throw new BadRequestException("You cannot do this at the moment");
}
String taskId = currentTask.getString("task_id"); String taskId = currentTask.getString("task_id");
currentTask.put("request_time", new Date()); currentTask.put("request_time", new Date());
currentTask.put("client_id", clientId); currentTask.put("client_id", clientId);
@ -83,8 +86,9 @@ public class ManualSettleSupportImpl implements ManualSettleSupport {
todayTask = new JSONObject(); todayTask = new JSONObject();
} }
List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date()); List<JSONObject> settleLogs = clearingLogMapper.findByDate(new Date());
List<JSONObject> unsettleRequests = taskManualSettleMapper.listActiveTasks(clientId);
//今天未清算则锁定 //今天未清算则锁定
todayTask.put("locked", settleLogs.isEmpty()); todayTask.put("locked", settleLogs.isEmpty() || !unsettleRequests.isEmpty());
if (includingUnsettleData) { if (includingUnsettleData) {
Date end = findSettleTo(clientId); Date end = findSettleTo(clientId);
List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end); List<JSONObject> unsettleReports = transactionMapper.listClientUnsettleDataByDate(clientId, end);

Loading…
Cancel
Save