Commit 4dbeecfe by manxiaoqiang

2

parent 1e9950fa
...@@ -182,6 +182,10 @@ ...@@ -182,6 +182,10 @@
<dmp.username>trackingio</dmp.username> <dmp.username>trackingio</dmp.username>
<dmp.password>trackingio</dmp.password> <dmp.password>trackingio</dmp.password>
<io.url>jdbc:mysql://tkio.cma5jkozme68.rds.cn-north-1.amazonaws.com.cn:3306/userio?characterEncoding=utf-8</io.url>
<io.username>reyun</io.username>
<io.password>Reyun123</io.password>
<mail.host>smtp.exmail.qq.com</mail.host> <mail.host>smtp.exmail.qq.com</mail.host>
<mail.username>manager@reyun.com</mail.username> <mail.username>manager@reyun.com</mail.username>
<mail.password>Reyun123</mail.password> <mail.password>Reyun123</mail.password>
......
...@@ -102,33 +102,33 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -102,33 +102,33 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
// DecimalFormat decimalFormat = new DecimalFormat("0%"); // DecimalFormat decimalFormat = new DecimalFormat("0%");
//String trackRemainPercent1 = decimalFormat.format(trackRemainPercent); //String trackRemainPercent1 = decimalFormat.format(trackRemainPercent);
//
String IOBeginTime = (isNotifiedObject != null && isNotifiedObject.getThisMonthUpgradeLevel() != null && isNotifiedObject.getThisMonthUpgradeLevel()) ? rootAccount.getModifyPricelevelTime() : firstDayOfThisMonth; // String IOBeginTime = (isNotifiedObject != null && isNotifiedObject.getThisMonthUpgradeLevel() != null && isNotifiedObject.getThisMonthUpgradeLevel()) ? rootAccount.getModifyPricelevelTime() : firstDayOfThisMonth;
//
//
BigInteger lastMonthEventNum=new BigInteger("0"); // BigInteger lastMonthEventNum=new BigInteger("0");
BigInteger thisMonthEventNum=new BigInteger("0"); // BigInteger thisMonthEventNum=new BigInteger("0");
BigInteger lastThreeDaysEventNum=new BigInteger("0"); // BigInteger lastThreeDaysEventNum=new BigInteger("0");
if(apps.size()>0){ // if(apps.size()>0){
lastMonthEventNum = getTotalNum(firstDayOfLastMonth, lastDayOfLastMonth, appids, "account_io_flow_restrict", "event_sum"); // lastMonthEventNum = getTotalNum(firstDayOfLastMonth, lastDayOfLastMonth, appids, "account_io_flow_restrict", "event_sum");
thisMonthEventNum = getTotalNum(IOBeginTime, currentDateStr, appids, "account_io_flow_restrict", "event_sum"); // thisMonthEventNum = getTotalNum(IOBeginTime, currentDateStr, appids, "account_io_flow_restrict", "event_sum");
lastThreeDaysEventNum = getTotalNum(IOBeginTime, currentDateStr, appids, "account_io_three_days_flow_restrict", "event_sum"); // lastThreeDaysEventNum = getTotalNum(IOBeginTime, currentDateStr, appids, "account_io_three_days_flow_restrict", "event_sum");
} // }
//
BigInteger lastMonthExceedNum = (lastMonthEventNum.subtract(packageType.getIoFlow()).compareTo(new BigInteger("0")) == 1) ? lastMonthEventNum.subtract(packageType.getIoFlow()) : new BigInteger("0"); // BigInteger lastMonthExceedNum = (lastMonthEventNum.subtract(packageType.getIoFlow()).compareTo(new BigInteger("0")) == 1) ? lastMonthEventNum.subtract(packageType.getIoFlow()) : new BigInteger("0");
if (isNotifiedObject != null && isNotifiedObject.getThisMonthUpgradeLevel() != null && isNotifiedObject.getThisMonthUpgradeLevel()) { // if (isNotifiedObject != null && isNotifiedObject.getThisMonthUpgradeLevel() != null && isNotifiedObject.getThisMonthUpgradeLevel()) {
lastMonthExceedNum = new BigInteger("0"); // lastMonthExceedNum = new BigInteger("0");
} // }
double v = packageType.getIoFlow().doubleValue() * 1 - lastMonthExceedNum.doubleValue(); // double v = packageType.getIoFlow().doubleValue() * 1 - lastMonthExceedNum.doubleValue();
DecimalFormat decimalFormat1 = new DecimalFormat("0"); // DecimalFormat decimalFormat1 = new DecimalFormat("0");
String format = decimalFormat1.format(v); // String format = decimalFormat1.format(v);
BigInteger thisMonthAvailableTotalFlow = new BigInteger(format); // BigInteger thisMonthAvailableTotalFlow = new BigInteger(format);
BigInteger thisMonthRemainingFlow = thisMonthAvailableTotalFlow.subtract(thisMonthEventNum); // BigInteger thisMonthRemainingFlow = thisMonthAvailableTotalFlow.subtract(thisMonthEventNum);
int IORemainDays = -1; // int IORemainDays = -1;
if (lastThreeDaysEventNum.compareTo(new BigInteger("1")) == 1) { // if (lastThreeDaysEventNum.compareTo(new BigInteger("1")) == 1) {
IORemainDays = (int) (Math.floor(Double.valueOf(thisMonthRemainingFlow.divide(lastThreeDaysEventNum.divide(new BigInteger("3"))).toString()))); // IORemainDays = (int) (Math.floor(Double.valueOf(thisMonthRemainingFlow.divide(lastThreeDaysEventNum.divide(new BigInteger("3"))).toString())));
} // }
double ioRemainPercent = thisMonthRemainingFlow.doubleValue() / thisMonthAvailableTotalFlow.doubleValue(); // double ioRemainPercent = thisMonthRemainingFlow.doubleValue() / thisMonthAvailableTotalFlow.doubleValue();
//String ioRemainPercent1 = decimalFormat.format(ioRemainPercent); //String ioRemainPercent1 = decimalFormat.format(ioRemainPercent);
BigInteger num = incrementFlowRepository.listByRootAccount(accountId, DateUtil.getBeforeDays(0)); BigInteger num = incrementFlowRepository.listByRootAccount(accountId, DateUtil.getBeforeDays(0));
...@@ -144,14 +144,14 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -144,14 +144,14 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
accountRestrict4Web.setOriginalName(packageType.getOriginalName()); accountRestrict4Web.setOriginalName(packageType.getOriginalName());
accountRestrict4Web.setIOLimit(packageType.getIoFlow()); accountRestrict4Web.setIOLimit(packageType.getIoFlow());
accountRestrict4Web.setTrackLimit(trackNum); accountRestrict4Web.setTrackLimit(trackNum);
accountRestrict4Web.setThisMonthIOFlow(thisMonthEventNum); accountRestrict4Web.setThisMonthIOFlow(new BigInteger("0"));
accountRestrict4Web.setTrackTotalFlow(clickNum); accountRestrict4Web.setTrackTotalFlow(clickNum);
accountRestrict4Web.setAccountId(rootParent); accountRestrict4Web.setAccountId(rootParent);
accountRestrict4Web.setPriceLevel(rootAccount.getPricelevel().intValue()); accountRestrict4Web.setPriceLevel(rootAccount.getPricelevel().intValue());
accountRestrict4Web.setLastMonthIOFlow(lastMonthEventNum); accountRestrict4Web.setLastMonthIOFlow(new BigInteger("0"));
accountRestrict4Web.setIORemainPercent(ioRemainPercent); accountRestrict4Web.setIORemainPercent(0d);
//accountRestrict4Web.setTrackRemainPercent(trackRemainPercent); //accountRestrict4Web.setTrackRemainPercent(trackRemainPercent);
accountRestrict4Web.setiOremainingDays(IORemainDays); //accountRestrict4Web.setiOremainingDays(0);
//accountRestrict4Web.setTrackRemainingDays(trackRemainDays); //accountRestrict4Web.setTrackRemainingDays(trackRemainDays);
accountRestrict4Web.setPackLevel(new Long(packageType.getId())); accountRestrict4Web.setPackLevel(new Long(packageType.getId()));
accountRestrict4Web.setFlowRestrict(flowRestrict); accountRestrict4Web.setFlowRestrict(flowRestrict);
...@@ -175,31 +175,31 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -175,31 +175,31 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
boolean tenPercent = (trackNum.doubleValue() * 0.9 <= clickNum.doubleValue()) && (trackNum.doubleValue() * 0.95 > clickNum.doubleValue()); boolean tenPercent = (trackNum.doubleValue() * 0.9 <= clickNum.doubleValue()) && (trackNum.doubleValue() * 0.95 > clickNum.doubleValue());
boolean exPercent = trackNum.doubleValue() <= clickNum.doubleValue(); boolean exPercent = trackNum.doubleValue() <= clickNum.doubleValue();
if (exPercent) { if (exPercent) {
ioFlag = false;
ioStatus = false;
}else if (tenPercent && (isNotifiedObject.getTrackTenPercentNotified() == null || !isNotifiedObject.getTrackTenPercentNotified())) {
ioStatus = false;
}
}
if (isIOProduct) {
boolean tenPercent = (thisMonthAvailableTotalFlow.doubleValue() * 0.9 <= thisMonthEventNum.doubleValue()) && (thisMonthAvailableTotalFlow.doubleValue() * 0.95 > thisMonthEventNum.doubleValue());
boolean exPercent = thisMonthAvailableTotalFlow.doubleValue() * 1 <= thisMonthEventNum.doubleValue();
if (exPercent) {
trackFlag = false;
trackStatus = false; trackStatus = false;
}else if (tenPercent && (isNotifiedObject.getIoTenPercentNotified() == null || !isNotifiedObject.getIoTenPercentNotified())) { trackFlag = false;
}else if (tenPercent && (isNotifiedObject.getTrackTenPercentNotified() == null || !isNotifiedObject.getTrackTenPercentNotified())) {
trackStatus = false; trackStatus = false;
} }
} }
// if (isIOProduct) {
// boolean tenPercent = (thisMonthAvailableTotalFlow.doubleValue() * 0.9 <= thisMonthEventNum.doubleValue()) && (thisMonthAvailableTotalFlow.doubleValue() * 0.95 > thisMonthEventNum.doubleValue());
// boolean exPercent = thisMonthAvailableTotalFlow.doubleValue() * 1 <= thisMonthEventNum.doubleValue();
// if (exPercent) {
// trackFlag = false;
// trackStatus = false;
// }else if (tenPercent && (isNotifiedObject.getIoTenPercentNotified() == null || !isNotifiedObject.getIoTenPercentNotified())) {
// trackStatus = false;
// }
// }
//是否流量用尽 //是否流量用尽
if(trackFlag){ if(trackFlag){
accountRestrict4Web.setIOFlowNotified(false); accountRestrict4Web.setIOFlowNotified(false);
} else{ } else{
accountRestrict4Web.setIOFlowNotified(true); accountRestrict4Web.setIOFlowNotified(true);
} }
accountRestrict4Web.setAllowBehavior(ioStatus); accountRestrict4Web.setAllowBehavior(false);
accountRestrict4Web.setTrackFlowNotified(trackStatus); accountRestrict4Web.setTrackFlowNotified(trackStatus);
} }
......
...@@ -88,10 +88,14 @@ public class TkioAccountServiceImpl implements TkioAccountService { ...@@ -88,10 +88,14 @@ public class TkioAccountServiceImpl implements TkioAccountService {
Map<String, Object> map = new HashMap(); Map<String, Object> map = new HashMap();
String email = null; String email = null;
if(null != sale){ if(null != sale){
SalesManLeader one = salesManLeaderRepository.findOne(Integer.parseInt(sale+"")); try {
SalesManLeader one = salesManLeaderRepository.findOne(Integer.parseInt(sale + ""));
User user1 = userRepository.findByEmail(one.getEmail()); User user1 = userRepository.findByEmail(one.getEmail());
if (null != user1) if (null != user1)
map.put("old", user1.getName()); map.put("old", user1.getName());
}catch (Exception e){
logger.error(e.getMessage(), e);
}
} }
List<User> list = new ArrayList<>(); List<User> list = new ArrayList<>();
if(user.getRole().equals(RoleEnum.NORTH_BUSSINUSS.getKey()) || user.getRole().equals(RoleEnum.SOUTH_BUSSINUSS.getKey())){ if(user.getRole().equals(RoleEnum.NORTH_BUSSINUSS.getKey()) || user.getRole().equals(RoleEnum.SOUTH_BUSSINUSS.getKey())){
......
...@@ -27,13 +27,11 @@ public class AccountCheck { ...@@ -27,13 +27,11 @@ public class AccountCheck {
public void task(){ public void task(){
List<Account> accountList = accountRepository.findRootParentsByPubDate(DateUtil.getBeforeDays(30)); List<Account> accountList = accountRepository.findRootParentsByPubDate(DateUtil.getBeforeDays(30));
logger.error("startDate :" + DateUtil.getBeforeDays(30)); logger.info("startDate :" + DateUtil.getBeforeDays(30));
logger.error("startDate :" + accountList);
if(ValidateUtil.isValid(accountList)){ if(ValidateUtil.isValid(accountList)){
List<Account> list = new ArrayList<>(); List<Account> list = new ArrayList<>();
for(Account a: accountList){ for(Account a: accountList){
List<Contract> contractList = contractRepository.findByPlatformAndEmail("tkio", a.getEmail(), ContractTypeEnum.MAIN.getKey()); List<Contract> contractList = contractRepository.findByPlatformAndEmail("tkio", a.getEmail(), ContractTypeEnum.MAIN.getKey());
logger.error("startDate :" + (null == contractList));
if(null == contractList || contractList.isEmpty()){ if(null == contractList || contractList.isEmpty()){
a.setStatus(0); a.setStatus(0);
list.add(a); list.add(a);
...@@ -43,8 +41,6 @@ public class AccountCheck { ...@@ -43,8 +41,6 @@ public class AccountCheck {
accountRepository.save(list); accountRepository.save(list);
} }
} }
} }
} }
} }
...@@ -89,7 +89,7 @@ public class AccountTask { ...@@ -89,7 +89,7 @@ public class AccountTask {
account4Web.setTrack(restrict4Web.getTrackTotalFlow()); account4Web.setTrack(restrict4Web.getTrackTotalFlow());
account4Web.setIoLimit(restrict4Web.getIOLimit()); account4Web.setIoLimit(restrict4Web.getIOLimit());
account4Web.setTrackLimit(restrict4Web.getTrackLimit()); account4Web.setTrackLimit(restrict4Web.getTrackLimit());
account4Web.setIoStatus(restrict4Web.getAllowBehavior()); account4Web.setIoStatus(true);
account4Web.setTrackStatus(restrict4Web.getTrackFlowNotified()); account4Web.setTrackStatus(restrict4Web.getTrackFlowNotified());
// double f = 1.0; // double f = 1.0;
// if((account4Web.getIo().doubleValue() != 0) && (null != account4Web.getIoLimit())){ // if((account4Web.getIo().doubleValue() != 0) && (null != account4Web.getIoLimit())){
...@@ -112,6 +112,7 @@ public class AccountTask { ...@@ -112,6 +112,7 @@ public class AccountTask {
account4Web.setStatus("已激活"); account4Web.setStatus("已激活");
} }
account4Web.setIoStatus(true);
if(account4Web.getTrackStatus()){ if(account4Web.getTrackStatus()){
account4Web.setStatus("已激活"); account4Web.setStatus("已激活");
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<bean id="tkioAccountTask" class="tkio.task.AccountTask"></bean> <bean id="tkioAccountTask" class="tkio.task.AccountTask"></bean>
<task:scheduled-tasks> <task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)--> <!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled ref="tkioAccountTask" method="task" cron="0 46 16 * * ?"/> <task:scheduled ref="tkioAccountTask" method="task" cron="0 58 16 * * ?"/>
</task:scheduled-tasks> </task:scheduled-tasks>
<bean id="tkioNoticeTask" class="tkio.task.NoticeTask"></bean> <bean id="tkioNoticeTask" class="tkio.task.NoticeTask"></bean>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<bean id="contractTask" class="common.task.ContractTask"></bean> <bean id="contractTask" class="common.task.ContractTask"></bean>
<task:scheduled-tasks> <task:scheduled-tasks>
<task:scheduled ref="contractTask" method="task" cron="0 28 17 * * ?"/> <task:scheduled ref="contractTask" method="task" cron="0 28 0 * * ?"/>
</task:scheduled-tasks> </task:scheduled-tasks>
<bean id="trackAccountTask" class="track.task.AccountTask"></bean> <bean id="trackAccountTask" class="track.task.AccountTask"></bean>
...@@ -54,13 +54,13 @@ ...@@ -54,13 +54,13 @@
<bean id="ioAccountTaskCheck" class="userio.task.IOAccountCheck"></bean> <bean id="ioAccountTaskCheck" class="userio.task.IOAccountCheck"></bean>
<task:scheduled-tasks> <task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)--> <!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled ref="ioAccountTaskCheck" method="task" cron="0 */5 * * * ?"/> <task:scheduled ref="ioAccountTaskCheck" method="task" cron="0 10 8 * * ?"/>
</task:scheduled-tasks> </task:scheduled-tasks>
<bean id="accountTaskCheck" class="tkio.task.AccountCheck"></bean> <bean id="accountTaskCheck" class="tkio.task.AccountCheck"></bean>
<task:scheduled-tasks> <task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)--> <!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled ref="accountTaskCheck" method="task" cron="0 */2 * * * ?"/> <task:scheduled ref="accountTaskCheck" method="task" cron="0 10 8 * * ?"/>
</task:scheduled-tasks> </task:scheduled-tasks>
</beans> </beans>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment