Commit b8abf012 by manxiaoqiang

2

parent 833eff93
...@@ -440,9 +440,20 @@ public class ContractServiceImpl implements ContractService{ ...@@ -440,9 +440,20 @@ public class ContractServiceImpl implements ContractService{
typeMap.put(s.getId(), s.getPackageName()); typeMap.put(s.getId(), s.getPackageName());
} }
} }
List<ContractIncrement> incrementList = contractIncrementRepository.findAll();
Map<Long, String> incremenMap = new HashMap<>();
if(ValidateUtil.isValid(incrementList)){
for(ContractIncrement s: incrementList){
incremenMap.put(s.getId(), s.getPackageName());
}
}
Contract contract = contractRepository.findByCode(code); Contract contract = contractRepository.findByCode(code);
contract.setSaleName(saleMap.containsKey(contract.getSale()) ? saleMap.get(contract.getSale()) : ""); contract.setSaleName(saleMap.containsKey(contract.getSale()) ? saleMap.get(contract.getSale()) : "");
contract.setPriceLevelName(typeMap.containsKey(contract.getPriceLevel()) ? typeMap.get(contract.getPriceLevel()) : ""); if(contract.getType().equals(ContractTypeEnum.MAIN.getKey())){
contract.setPriceLevelName(typeMap.containsKey(contract.getPriceLevel()) ? typeMap.get(contract.getPriceLevel()) : "");
} else{
contract.setPriceLevelName(incremenMap.containsKey(contract.getPriceLevel()) ? incremenMap.get(contract.getPriceLevel()) : "");
}
contract.setCreateName(saleMap.containsKey(contract.getCreateAccount()) ? saleMap.get(contract.getCreateAccount()) : ""); contract.setCreateName(saleMap.containsKey(contract.getCreateAccount()) ? saleMap.get(contract.getCreateAccount()) : "");
Boolean flag = null; Boolean flag = null;
......
...@@ -110,7 +110,7 @@ public class UserServiceImpl implements UserService { ...@@ -110,7 +110,7 @@ public class UserServiceImpl implements UserService {
auth.setUser(save.getId()); auth.setUser(save.getId());
Auth authSave = authRepository.save(auth); Auth authSave = authRepository.save(auth);
if(save.getRoleType().equals(RoleTypeEnum.COMMON.getKey())){ if(null != save.getRoleType() && save.getRoleType().equals(RoleTypeEnum.COMMON.getKey())){
JSONArray rootArr = JSONArray.fromObject(authSave.getAuth()); JSONArray rootArr = JSONArray.fromObject(authSave.getAuth());
List<String> authList = new ArrayList<>(); List<String> authList = new ArrayList<>();
if(ValidateUtil.isValid(rootArr)){ if(ValidateUtil.isValid(rootArr)){
......
...@@ -132,16 +132,18 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -132,16 +132,18 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
//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));
if(null == num){ BigInteger trackNum = packageType.getTrackFlow();
num = new BigInteger("0");
if(trackNum.doubleValue() != -1 && null != num){
trackNum = trackNum.add(num);
} }
num.add(packageType.getTrackFlow());
accountRestrict4Web.setPastDate(pastDate); accountRestrict4Web.setPastDate(pastDate);
accountRestrict4Web.setPackageName(packageType.getPackageName()); accountRestrict4Web.setPackageName(packageType.getPackageName());
accountRestrict4Web.setOriginalName(packageType.getOriginalName()); accountRestrict4Web.setOriginalName(packageType.getOriginalName());
accountRestrict4Web.setIOLimit(packageType.getIoFlow()); accountRestrict4Web.setIOLimit(packageType.getIoFlow());
accountRestrict4Web.setTrackLimit(num); accountRestrict4Web.setTrackLimit(trackNum);
accountRestrict4Web.setThisMonthIOFlow(thisMonthEventNum); accountRestrict4Web.setThisMonthIOFlow(thisMonthEventNum);
accountRestrict4Web.setTrackTotalFlow(clickNum); accountRestrict4Web.setTrackTotalFlow(clickNum);
accountRestrict4Web.setAccountId(rootParent); accountRestrict4Web.setAccountId(rootParent);
...@@ -156,7 +158,7 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -156,7 +158,7 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
accountRestrict4Web.setAllowBehavior(isIOProduct); accountRestrict4Web.setAllowBehavior(isIOProduct);
if ((packageType.getId() == 7 || packageType.getId() == 8 || packageType.getId() == 5)) { if (packageType.getTrackFlow().doubleValue() < 0) {
accountRestrict4Web.setPackageName("包年套餐"); accountRestrict4Web.setPackageName("包年套餐");
} }
...@@ -165,13 +167,13 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -165,13 +167,13 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
boolean trackFlag = true; boolean trackFlag = true;
boolean trackStatus = true; boolean trackStatus = true;
if (rootParent.equals(accountId)) { if (rootParent.equals(accountId)) {
if (!(packageType.getId() == 7 || packageType.getId() == 8 || packageType.getId() == 5) && flowRestrict) { if (!(packageType.getTrackFlow().doubleValue() < 0) && flowRestrict) {
/** /**
* 不是超级用户,是包流量的用户 * 不是超级用户,是包流量的用户
*/ */
if (isTrackProduct) { if (isTrackProduct) {
boolean tenPercent = (packageType.getTrackFlow().doubleValue() * 0.9 <= clickNum.doubleValue()) && (packageType.getTrackFlow().doubleValue() * 0.95 > clickNum.doubleValue()); boolean tenPercent = (trackNum.doubleValue() * 0.9 <= clickNum.doubleValue()) && (trackNum.doubleValue() * 0.95 > clickNum.doubleValue());
boolean exPercent = packageType.getTrackFlow().doubleValue() <= clickNum.doubleValue(); boolean exPercent = trackNum.doubleValue() <= clickNum.doubleValue();
if (exPercent) { if (exPercent) {
ioFlag = false; ioFlag = false;
ioStatus = false; ioStatus = false;
......
...@@ -106,7 +106,7 @@ public class AccountTask { ...@@ -106,7 +106,7 @@ public class AccountTask {
// account4Web.setStatus("已激活"); // account4Web.setStatus("已激活");
// //
// } // }
if(account4Web.getTrackLimit().doubleValue() == -1){ if(account4Web.getTrackLimit().doubleValue() <= 0){
account4Web.setTrackStatus(true); account4Web.setTrackStatus(true);
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 16 17 * * ?"/> <task:scheduled ref="tkioAccountTask" method="task" cron="0 34 12 * * ?"/>
</task:scheduled-tasks> </task:scheduled-tasks>
<bean id="tkioNoticeTask" class="tkio.task.NoticeTask"></bean> <bean id="tkioNoticeTask" class="tkio.task.NoticeTask"></bean>
......
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