Commit 67f42a68 by zhangxiaoyan

app tag

parent 39f912c3
......@@ -90,17 +90,15 @@ public class LoginController
if (account != null) {
if(!account.getRoleCategory().equals(5L)) {
Boolean trackAndIoBothExhaust = accountFlowRestrictService.isTrackAndIoBothExhaust(account.getId());
Boolean trackAndIoBothExhaust = accountFlowRestrictService.isIoExhaust(account.getId());
Long rootParent = accountRepository.findRootParentByAccountId(account.getId()).longValue();
Account rootAccount = accountRepository.findOne(rootParent);
if (trackAndIoBothExhaust) {
if (rootAccount.getAllowBehavior()) {
rtnMap.put("msg", "行为分析流量用尽!");
rtnMap.put("code", 211);
return ResultModel.OK(rtnMap);
}
}
}
if (!account.getIsSuperUser()) {
//子账号
......
......@@ -61,7 +61,6 @@ public class Account {
private String regIpAddr;
private String regIpLocation;
private Boolean verifyEmail = false;
private Boolean allowBehavior;
private Boolean isFlowRestrict;
private String modifyPricelevelTime;
private Boolean newContract;
......@@ -74,13 +73,6 @@ public class Account {
isFlowRestrict = flowRestrict;
}
public Boolean getAllowBehavior() {
return allowBehavior;
}
public void setAllowBehavior(Boolean allowBehavior) {
this.allowBehavior = allowBehavior;
}
public Account() {
super();
......
......@@ -44,13 +44,9 @@ public class App {
private Date modifyTime = new Date();
private String modifyAccount;
private Boolean delFlag;
//是否同步DDB
private Boolean syncDdb;
private Long installNum;
private Long registerNum;
//是够是debug模式 true 是测试,false不是测试
private Boolean isDebug;
private Boolean trackAndIoBothExhaust;
private Boolean mainAccountExpire;
......@@ -260,22 +256,6 @@ public class App {
this.delFlag = delFlag;
}
public Boolean getIsDebug() {
return this.isDebug;
}
public void setIsDebug(Boolean isDebug) {
this.isDebug = isDebug;
}
public Boolean getSyncDdb() {
return syncDdb;
}
public void setSyncDdb(Boolean syncDdb) {
this.syncDdb = syncDdb;
}
@Transient
public Boolean getTrackAndIoBothExhaust() {
return trackAndIoBothExhaust;
......@@ -312,14 +292,6 @@ public class App {
this.registerNum = registerNum;
}
public Boolean getDebug() {
return isDebug;
}
public void setDebug(Boolean debug) {
isDebug = debug;
}
public Boolean getDistributeTask() {
return distributeTask;
}
......
......@@ -15,32 +15,15 @@ public interface AppRepository extends JpaRepository<App, Long>
@Query(value="select appkey from app where id = ?1",nativeQuery=true)
String findAppkeyById(Long id);
List<App> findByAccount(Long account);
@Query(value = "select * from app where account =?1 and bundleid = ?2 and del_flag is not true", nativeQuery = true)
App findByBundleidInNotDel(Long account, String bundleid);
@Query(value = "select * from app where account =?1 and name = ?2 and del_flag is not true", nativeQuery = true)
App findByNameNotDel(Long account, String name);
@Query(value = "select * from app where sync_ddb is false and del_flag is not true", nativeQuery = true)
List<App> findNotSyncAppDebug();
@Query(value = "select * from app where token = ?1 limit 1", nativeQuery = true)
App findOneByAppToken(String token);
@Query(value = "select * from app where id in ?1", nativeQuery = true)
List<App> findByIds(List<Long> ids);
@Query(value = "SELECT DISTINCT t2.* FROM campaign t0 JOIN channel t1 ON t0.channel = t1.id JOIN app t2 ON t0.app = t2.id WHERE t0.del_flag is not true and (t1.type!='ry_coop' or t1.type is NULL) and t1.category = 'ADVERTISING' and t2.id in ?1 and t2.platform = ?2 and t2.del_flag is not TRUE" , nativeQuery = true)
List<App> findAppsFromOnelink(List<Long> appids, String platform);
@Query(value = "SELECT DISTINCT t2.* FROM campaign t0 JOIN channel t1 ON t0.channel = t1.id JOIN app t2 ON t0.app = t2.id WHERE t0.del_flag is not true and (t1.type!='ry_coop' or t1.type is NULL) and t1.category = 'ADVERTISING' and t2.id = ?1" , nativeQuery = true)
App findAppFromOnelink(Long appid);
@Query(value = "select * from app where appkey in ?1", nativeQuery = true)
List<App> findByAppkeys(List<String> appkeys);
@Query(value = "select * from app a join auth b on a.id = b.app where b.account = ?1 and b.create_account in (select id from account where root_parent = ?2) ", nativeQuery = true)
List<App> findAuthAppByRootParent(Long subAccountId, Long rootParent);
......@@ -50,18 +33,8 @@ public interface AppRepository extends JpaRepository<App, Long>
@Query(value="select platform from app where id = ?1",nativeQuery=true)
String findPlatformByAppId(Long appId);
@Query(value="select categoryname from category where categoryid=(select game_genre from app where id=?1);",nativeQuery=true)
String findGameCategoryByAppID(Long appId);
@Query(value="select categoryname from category where categoryid=(select app_genre from app where id=?1);",nativeQuery=true)
String findAppGenreNameByAppID(Long id);
@Query(value = "select DISTINCT a.* from app a right join data_auth d on a.id = d.app where d.account = ?1 and d.app in ?2 and d.channel = ?3 and (d.all_campaign is true or d.channel_permit is true)", nativeQuery = true)
List<App> listTotalAuthorizedApp(Long accountId, List<Long> appIdList, Long channelId);
@Query(value = "select create_account from app where appkey=?1", nativeQuery = true)
String findCreateAccountByAppkey(String appKey);
@Query(value = "select DISTINCT a.* from app a right join data_auth d on a.id = d.app where d.account = ?1 and d.channel = ?2 and (d.all_campaign is true or d.channel_permit is true)", nativeQuery = true)
List<App> listApps(Long accountId, Long channelId);
}
package com.reyun.repository;
import com.reyun.model.AppTag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
......@@ -11,10 +14,13 @@ import java.util.List;
* @author nolan
* @date 26/12/2017
*/
public interface AppTagRepository extends CrudRepository<AppTag, Long>
public interface AppTagRepository extends JpaRepository<AppTag, Long>
{
@Query(value = "select * from app_tag where app=?1", nativeQuery = true)
List<AppTag> findByApp(Long app);
@Query(value = "delete from app_tag where app=?1 ", nativeQuery = true)
@Modifying
Long deleteByApp(Long app);
}
......@@ -10,7 +10,6 @@ import java.math.BigInteger;
public interface AccountFlowRestrictService {
AccountRestrict4Web findRestrictByAccount(Long accountId);
BigInteger getTotalNum(String createTime, String pastDate, String appids, String reportName, String sumType);
Boolean isTrackAndIoBothExhaust(Long accountId);
Boolean isTrackExhaust(Long accountId);
Boolean isIoExhaust(Long accountId);
AccountRestrict4Web RestrictFlowByAccountTask(Long accountId);
}
......@@ -83,11 +83,6 @@ public class AppServiceImpl implements AppService {
app.setDelFlag(true);
appRepository.save(app);
/*//删除APP在ddb中的状态
if (Constant.awsneed) {
awsDynamoDBService.deleteAppSdkDebugItem(app.getAppkey());
}*/
return app;
}
......@@ -144,8 +139,6 @@ public class AppServiceImpl implements AppService {
resource.setAppkey(ShortUrlGenerator.md5(key));
resource.setToken(CipherUtil.generatePassword("reged_"+ShortUrlGenerator.md5(key)));
resource.setRegedbutton(false);
//新建APP默认debug模式 true 是测试,false不是测试
resource.setIsDebug(false);
// resource.setSyncDdb(false);
App app = appRepository.save(resource);
......
......@@ -545,7 +545,6 @@ public class AuthServiceImpl implements AuthService {
//新建账号 account
Account saveAccount = this.buildAccount(loginAccount, subAccount, false);
saveAccount.setAllowBehavior(loginAccount.getAllowBehavior());
saveAccount = accountRepository.save(saveAccount);
//构建权限 auth
......
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