master
wangning 7 years ago
parent d5165e50aa
commit ab111ce878

@ -131,7 +131,7 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService
JSONObject clientCustomerInfo = clientCustomersMapper.getClientCustomerWithNull(client_id, customer_id);
if (clientCustomerInfo == null) {
locker.lock(CUSTOMER_IMPRESSION_PREFIX+customer_id, 30_000, 30_000);
locker.lock(CUSTOMER_IMPRESSION_PREFIX + customer_id, 30_000, 30_000);
try {
JSONObject client_customer = new JSONObject();
client_customer.put("client_id", order.getIntValue("client_id"));
@ -216,10 +216,10 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService
if (userInfo == null) {
userInfo = customerRelationAlipayMapper.findCustomerByUserId(customer_id);
}
locker.lock(CUSTOMER_IMPRESSION_PREFIX + customer_id, 30_000, 30_000);
try {
JSONObject clientCustomerInfo = clientCustomersMapper.getClientCustomerWithNull(order.getIntValue("client_id"), customer_id);
if (clientCustomerInfo == null) {
locker.lock(CUSTOMER_IMPRESSION_PREFIX+customer_id, 30_000, 30_000);
try {
JSONObject client_customer = new JSONObject();
client_customer.put("client_id", order.getIntValue("client_id"));
client_customer.put("customer_id", order.getString("customer_id"));
@ -234,9 +234,6 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService
client_customer.put("total_amount", order.getBigDecimal("total_amount"));
client_customer.put("last_payment_time", order.getDate("confirm_time"));
clientCustomersMapper.insert(client_customer);
} finally {
locker.unlock(customer_id);
}
} else {
clientCustomerInfo.put("payment_times", 1);
clientCustomerInfo.put("client_id", order.getIntValue("client_id"));
@ -249,6 +246,9 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService
clientCustomerInfo.put("last_payment_time", order.getDate("confirm_time"));
clientCustomersMapper.updateAfterPaymentFinish(clientCustomerInfo);
}
} finally {
locker.unlock(customer_id);
}
} catch (Exception e) {
logger.debug("Reduce Customer Impression Error Redis Value =" + redisValue, e);
}

Loading…
Cancel
Save