master
wangning 7 years ago
parent ff05fadea3
commit b239a9a02e

@ -178,7 +178,7 @@ public class CustomerImpressionServiceImpl implements CustomerImpressionService
clientCustomersMapper.updateAfterPaymentFinish(clientCustomerInfo);
}
} finally {
locker.unlock(customer_id);
locker.unlock(CUSTOMER_IMPRESSION_PREFIX+customer_id);
}
} catch (Exception e) {
logger.debug("Reduce Customer Impression Error Redis Value =" + redisValue, e);

@ -48,4 +48,7 @@ public interface ClientRateMapper {
JSONObject latestChannelCleanDays(@Param("rate_name")String rate_name, @Param("client_id")int client_id);
JSONObject latestExpiryConfig(@Param("client_id")int client_id,@Param("rate_name") String rate_name);
}

@ -61,8 +61,9 @@ public class PostponeClientTask {
expiryClients.put(p.getInteger("client_id"), p);
});
expiryClients.values().forEach(p -> {
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(p.getIntValue("client_id"));
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(p.getIntValue("client_id"), null);
int client_id = p.getIntValue("client_id");
List<JSONObject> adminAccounts = clientAccountMapper.listAdminAccounts(client_id);
List<JSONObject> clientRates = clientRateMapper.maxChannelExpiryTime(client_id, null);
JSONObject wechatRate = clientRateMapper.latestChannelCleanDays("Wechat", p.getIntValue("client_id"));
int cleanDays = 1;
if (wechatRate.getInteger("clean_days") != null) {
@ -72,16 +73,17 @@ public class PostponeClientTask {
}
int finalCleanDays = cleanDays;
clientRates.forEach(o -> {
o.remove("client_rate_id");
o.put("active_time", tomorrow);
o.put("manager_id", 0);
o.put("expiry_time", yearTomorrow);
o.put("create_time", now);
o.put("update_time", now);
o.put("clean_days", finalCleanDays);
o.put("manager_name", "System");
o.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(o);
JSONObject record = clientRateMapper.latestExpiryConfig(client_id,o.getString("rate_name"));
record.remove("client_rate_id");
record.put("active_time", now);
record.put("manager_id", 0);
record.put("expiry_time", yearTomorrow);
record.put("create_time", now);
record.put("update_time", now);
record.put("clean_days", finalCleanDays);
record.put("manager_name", "System");
record.put("remark", "费率到期系统自动延期1年");
clientRateMapper.saveRate(record);
});
adminAccounts.forEach(o -> {

@ -137,4 +137,12 @@
order by cr.expiry_time desc
limit 1
</select>
<select id="latestExpiryConfig" resultType="com.alibaba.fastjson.JSONObject">
SELECT * FROM
sys_client_rates
WHERE client_id = #{client_id} and rate_name =#{rate_name}
order by expiry_time desc
limit 1
</select>
</mapper>
Loading…
Cancel
Save