Merge branch 'hotfix_asd' into develop

master
wangning 7 years ago
commit 56290c7bdb

@ -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);
}
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 {
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) {
JSONObject client_customer = new JSONObject();
client_customer.put("client_id", order.getIntValue("client_id"));
client_customer.put("customer_id", order.getString("customer_id"));
@ -234,20 +234,20 @@ 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"));
clientCustomerInfo.put("customer_id", order.getString("customer_id"));
clientCustomerInfo.put("total_amount", order.getBigDecimal("total_amount"));
if (userInfo != null) {
clientCustomerInfo.put("headimg", userInfo.getString("headimg"));
clientCustomerInfo.put("nick_name", userInfo.getString("nickname"));
} else {
clientCustomerInfo.put("payment_times", 1);
clientCustomerInfo.put("client_id", order.getIntValue("client_id"));
clientCustomerInfo.put("customer_id", order.getString("customer_id"));
clientCustomerInfo.put("total_amount", order.getBigDecimal("total_amount"));
if (userInfo != null) {
clientCustomerInfo.put("headimg", userInfo.getString("headimg"));
clientCustomerInfo.put("nick_name", userInfo.getString("nickname"));
}
clientCustomerInfo.put("last_payment_time", order.getDate("confirm_time"));
clientCustomersMapper.updateAfterPaymentFinish(clientCustomerInfo);
}
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