master
wangning 7 years ago
parent e023b105e9
commit 7c760fe803

@ -168,27 +168,22 @@ public class ClientContractServiceImpl implements ClientContractService {
return result;
}
int waringDays = sysConfigManager.getSysConfig().getIntValue("rate_warning_days");
rateInfo.forEach((p) -> {
for (JSONObject p : rateInfo) {
if (now.compareTo(DateUtils.addDays(p.getDate("expiry_time"),1)) > -1) {
result.put("rate_expire", true);
}
if (DateUtils.addDays(now, waringDays).compareTo(DateUtils.addDays(p.getDate("expiry_time"),1)) > -1) {
int expireDay = 0;
long expireSS = (DateUtils.addDays(p.getDate("expiry_time"),1).getTime()-now.getTime());
expireDay = (int)expireSS/(1000*60*60*24);
if(expireSS%(1000*60*60*24)>1){
++expireDay;
}
result.put("expire_days",expireDay);
result.put("rate_waring", true);
}
});
int expireDay = 0;
long expireSS = (DateUtils.addDays(rateInfo.get(0).getDate("expiry_time"),1).getTime()-now.getTime());
expireDay = (int)expireSS/(1000*60*60*24);
logger.debug("kirawang__expiryTime+1"+DateUtils.addDays(rateInfo.get(0).getDate("expiry_time"),1).getTime());
logger.debug("kirawang__当前时间"+now.getTime());
logger.debug("kirawang__时间差"+(DateUtils.addDays(rateInfo.get(0).getDate("expiry_time"),1).getTime()-now.getTime()));
logger.debug("kirawang__取整位"+(int)expireSS/(1000*60*60*24));
logger.debug("kirawang__取整位"+(int)expireSS/(1000*60*60*24));
if(expireSS%(1000*60*60*24)>1){
++expireDay;
}
result.put("expire_days",expireDay);
return result;
}
}

@ -96,5 +96,6 @@
SELECT max(active_time) FROM sys_client_rates
WHERE client_id = #{client_id}
)
order by expiry_time desc
</select>
</mapper>
Loading…
Cancel
Save