Commit c00d79af by manxiaoqiang

大后台定时任务

parent 22619666
......@@ -45,6 +45,14 @@
<office.username>root</office.username>
<office.password>reyun123</office.password>
<tkio.url>jdbc:mysql://192.168.2.57:3306/trackingio?characterEncoding=utf-8</tkio.url>
<tkio.username>root</tkio.username>
<tkio.password>reyun123</tkio.password>
<track.url>jdbc:mysql://192.168.2.57:3306/track?characterEncoding=utf-8</track.url>
<track.username>root</track.username>
<track.password>reyun123</track.password>
<mail.host>smtp.exmail.qq.com</mail.host>
<mail.username>service1@reyun.com</mail.username>
<mail.password>XSW29ijn</mail.password>
......
package common.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.math.BigInteger;
import java.util.Date;
@Entity
public class Account4Web {
private Long id;
private String email;
private String company;
private Date createDate;
private String status;
private String packageType;
private String pastDate;
private String track;
private String io;
private Integer backTime;
private String user;
private String tell;
private Integer money;
private Boolean ioStatus;
private Boolean trackStatus;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getPackageType() {
return packageType;
}
public void setPackageType(String packageType) {
this.packageType = packageType;
}
public String getPastDate() {
return pastDate;
}
public void setPastDate(String pastDate) {
this.pastDate = pastDate;
}
public String getTrack() {
return track;
}
public void setTrack(String track) {
this.track = track;
}
public String getIo() {
return io;
}
public void setIo(String io) {
this.io = io;
}
public Integer getBackTime() {
return backTime;
}
public void setBackTime(Integer backTime) {
this.backTime = backTime;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getTell() {
return tell;
}
public void setTell(String tell) {
this.tell = tell;
}
public Integer getMoney() {
return money;
}
public void setMoney(Integer money) {
this.money = money;
}
public Boolean getIoStatus() {
return ioStatus;
}
public void setIoStatus(Boolean ioStatus) {
this.ioStatus = ioStatus;
}
public Boolean getTrackStatus() {
return trackStatus;
}
public void setTrackStatus(Boolean trackStatus) {
this.trackStatus = trackStatus;
}
}
package common.repository;
import common.model.Account4Web;
import common.model.Auth;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public interface Account4WebRepository extends JpaRepository<Account4Web, Long> {
}
package tkio.model;
import java.math.BigInteger;
public class AccountRestrict4Web {
private String packageName;
private String originalName;
private BigInteger IOLimit;
private String pastDate;
private BigInteger TrackLimit;
private Long accountId;
private int priceLevel;
private int iOremainingDays;
private int trackRemainingDays;
private BigInteger TrackTotalFlow;
private BigInteger thisMonthIOFlow;
private Double trackRemainPercent;
private Double IORemainPercent;
private BigInteger lastMonthIOFlow;
private Boolean isFlowRestrict;
private Long packLevel;
private Boolean isTrackPastTimeNotified;
private Boolean isIOPastTimeNotified;
private Boolean isTrackFlowNotified;
private Boolean isIOFlowNotified;
private Boolean allowBehavior;
public Long getPackLevel() {
return packLevel;
}
public void setPackLevel(Long packLevel) {
this.packLevel = packLevel;
}
public Boolean getFlowRestrict() {
return isFlowRestrict;
}
public void setFlowRestrict(Boolean flowRestrict) {
isFlowRestrict = flowRestrict;
}
public String getPackageName() {
return packageName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
}
public String getOriginalName() {
return originalName;
}
public void setOriginalName(String originalName) {
this.originalName = originalName;
}
public BigInteger getIOLimit() {
return IOLimit;
}
public void setIOLimit(BigInteger IOLimit) {
this.IOLimit = IOLimit;
}
public String getPastDate() {
return pastDate;
}
public void setPastDate(String pastDate) {
this.pastDate = pastDate;
}
public BigInteger getTrackLimit() {
return TrackLimit;
}
public void setTrackLimit(BigInteger trackLimit) {
TrackLimit = trackLimit;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public int getPriceLevel() {
return priceLevel;
}
public void setPriceLevel(int priceLevel) {
this.priceLevel = priceLevel;
}
public int getiOremainingDays() {
return iOremainingDays;
}
public void setiOremainingDays(int iOremainingDays) {
this.iOremainingDays = iOremainingDays;
}
public int getTrackRemainingDays() {
return trackRemainingDays;
}
public void setTrackRemainingDays(int trackRemainingDays) {
this.trackRemainingDays = trackRemainingDays;
}
public BigInteger getTrackTotalFlow() {
return TrackTotalFlow;
}
public void setTrackTotalFlow(BigInteger trackTotalFlow) {
TrackTotalFlow = trackTotalFlow;
}
public BigInteger getThisMonthIOFlow() {
return thisMonthIOFlow;
}
public void setThisMonthIOFlow(BigInteger thisMonthIOFlow) {
this.thisMonthIOFlow = thisMonthIOFlow;
}
public Double getTrackRemainPercent() {
return trackRemainPercent;
}
public void setTrackRemainPercent(Double trackRemainPercent) {
this.trackRemainPercent = trackRemainPercent;
}
public Double getIORemainPercent() {
return IORemainPercent;
}
public void setIORemainPercent(Double IORemainPercent) {
this.IORemainPercent = IORemainPercent;
}
public BigInteger getLastMonthIOFlow() {
return lastMonthIOFlow;
}
public void setLastMonthIOFlow(BigInteger lastMonthIOFlow) {
this.lastMonthIOFlow = lastMonthIOFlow;
}
public Boolean getTrackPastTimeNotified() {
return isTrackPastTimeNotified;
}
public void setTrackPastTimeNotified(Boolean trackPastTimeNotified) {
isTrackPastTimeNotified = trackPastTimeNotified;
}
public Boolean getIOPastTimeNotified() {
return isIOPastTimeNotified;
}
public void setIOPastTimeNotified(Boolean IOPastTimeNotified) {
isIOPastTimeNotified = IOPastTimeNotified;
}
public Boolean getTrackFlowNotified() {
return isTrackFlowNotified;
}
public void setTrackFlowNotified(Boolean trackFlowNotified) {
isTrackFlowNotified = trackFlowNotified;
}
public Boolean getIOFlowNotified() {
return isIOFlowNotified;
}
public void setIOFlowNotified(Boolean IOFlowNotified) {
isIOFlowNotified = IOFlowNotified;
}
public Boolean getAllowBehavior() {
return allowBehavior;
}
public void setAllowBehavior(Boolean allowBehavior) {
this.allowBehavior = allowBehavior;
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.Date;
@Entity
public class App {
private Long id;
@NotNull
private String name;
private String platform;
private String appGenre;
private String appGenreName;
private String gameGenre;
//private String gameCategory;
private String appkey;
private String url;
private Long account;
private boolean sync;
// private boolean isActive;
private Long origiApp;
private String bundleid;
private String token;
private String installtoken;
private boolean regedbutton;
private Date createTime = new Date();
private String createAccount;
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;
public App() {
super();
}
public App(String name, String platform, String appGenre, String gameGenre) {
this.name = name;
this.platform = platform;
this.appGenre = appGenre;
this.gameGenre = gameGenre;
}
public App(String name, String platform, String appGenre, String gameGenre,
Long account) {
this.name = name;
this.platform = platform;
this.appGenre = appGenre;
this.gameGenre = gameGenre;
this.account = account;
}
// public boolean isActive() {
// return isActive;
// }
//
// public void setActive(boolean isActive) {
// this.isActive = isActive;
// }
public Long getAccount() {
return account;
}
public String getAppGenre() {
return appGenre;
}
@Transient
public String getAppGenreName() {
return appGenreName;
}
public void setAppGenreName(String appGenreName) {
this.appGenreName = appGenreName;
}
public String getAppkey() {
return appkey;
}
public String getGameGenre() {
return gameGenre;
}
/* @Transient
public String getGameCategory() {
return gameCategory;
}
public void setGameCategory(String gameCategory) {
this.gameCategory = gameCategory;
}*/
@Id
@GeneratedValue
public Long getId() {
return id;
}
public String getName() {
return name;
}
public String getPlatform() {
return platform;
}
public String getUrl() {
return url;
}
public boolean isSync() {
return sync;
}
public void setAccount(Long account) {
this.account = account;
}
public void setAppGenre(String appGenre) {
this.appGenre = appGenre;
}
public void setAppkey(String appkey) {
this.appkey = appkey;
}
public void setGameGenre(String gameGenre) {
this.gameGenre = gameGenre;
}
public void setId(Long id) {
this.id = id;
}
public void setName(String name) {
this.name = name;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public void setSync(boolean sync) {
this.sync = sync;
}
public void setUrl(String url) {
this.url = url;
}
public Long getOrigiApp() {
return origiApp;
}
public void setOrigiApp(Long origiApp) {
this.origiApp = origiApp;
}
public String getBundleid() {
return bundleid;
}
public void setBundleid(String bundleid) {
this.bundleid = bundleid;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public boolean isRegedbutton() {
return regedbutton;
}
public void setRegedbutton(boolean regedbutton) {
this.regedbutton = regedbutton;
}
public String getInstalltoken() {
return installtoken;
}
public void setInstalltoken(String installtoken) {
this.installtoken = installtoken;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getCreateAccount() {
return createAccount;
}
public void setCreateAccount(String createAccount) {
this.createAccount = createAccount;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(String modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
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;
}
public void setTrackAndIoBothExhaust(Boolean trackAndIoBothExhaust) {
this.trackAndIoBothExhaust = trackAndIoBothExhaust;
}
@Transient
public Boolean getMainAccountExpire() {
return mainAccountExpire;
}
public void setMainAccountExpire(Boolean mainAccountExpire) {
this.mainAccountExpire = mainAccountExpire;
}
@Transient
public Long getInstallNum() {
return installNum;
}
public void setInstallNum(Long installNum) {
this.installNum = installNum;
}
@Transient
public Long getRegisterNum() {
return registerNum;
}
public void setRegisterNum(Long registerNum) {
this.registerNum = registerNum;
}
@Override
public String toString() {
return "App [id=" + id + ", name=" + name + ", platform=" + platform
+ ", appGenre=" + appGenre + ", gameGenre=" + gameGenre
+ ", appkey=" + appkey + ", url=" + url + ", account="
+ account + ", sync=" + sync + ", origiApp=" + origiApp
+ ", bundleid=" + bundleid + ", token=" + token
+ ", installtoken=" + installtoken + ", regedbutton="
+ regedbutton + ", createTime=" + createTime
+ ", createAccount=" + createAccount + ", modifyTime="
+ modifyTime + ", modifyAccount=" + modifyAccount
+ ", delFlag=" + delFlag + "]";
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
@Entity
public class Auth {
private Long id;
private Long roleCategory;
private String controlAuth;
private Long app;
private Long account;
private boolean retentionAuth;
private boolean payAuth;
private Long createAccount;
private Date createTime;
private Date modifyTime = new Date();
private String modifyAccount;
private Boolean status;
private Boolean isNatureOpen;
private Boolean campaign;
private Boolean topAuth;
//transient
private List<RoleAuthDetail> roleAuthDetailList;
private List<DataAuth> dataAuth;
public Auth() {
super();
}
public Auth(Long id, Long roleCategory, String controlAuth,
Long app, Long account) {
super();
this.id = id;
this.roleCategory = roleCategory;
this.controlAuth = controlAuth;
this.app = app;
this.account = account;
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRoleCategory() {
return roleCategory;
}
public void setRoleCategory(Long roleCategory) {
this.roleCategory = roleCategory;
}
public String getControlAuth() {
return controlAuth;
}
public void setControlAuth(String controlAuth) {
this.controlAuth = controlAuth;
}
public Long getApp() {
return app;
}
public void setApp(Long app) {
this.app = app;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public boolean isRetentionAuth() {
return retentionAuth;
}
public void setRetentionAuth(boolean retentionAuth) {
this.retentionAuth = retentionAuth;
}
public boolean isPayAuth() {
return payAuth;
}
public void setPayAuth(boolean payAuth) {
this.payAuth = payAuth;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(String modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public Boolean getIsNatureOpen() {
return isNatureOpen;
}
public void setIsNatureOpen(Boolean isNatureOpen) {
this.isNatureOpen = isNatureOpen;
}
public Boolean getCampaign() {
return campaign;
}
public void setCampaign(Boolean campaign) {
this.campaign = campaign;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Boolean getTopAuth() {
return topAuth;
}
public void setTopAuth(Boolean topAuth) {
this.topAuth = topAuth;
}
@Transient
public List<RoleAuthDetail> getRoleAuthDetailList() {
return roleAuthDetailList;
}
public void setRoleAuthDetailList(List<RoleAuthDetail> roleAuthDetailList) {
this.roleAuthDetailList = roleAuthDetailList;
}
@Transient
public List<DataAuth> getDataAuth() {
return dataAuth;
}
public void setDataAuth(List<DataAuth> dataAuth) {
this.dataAuth = dataAuth;
}
@Override
public String toString() {
return "Auth [id=" + id + ", roleCategory=" + roleCategory
+ ", controlAuth=" + controlAuth + ", app=" + app
+ ", account=" + account + ", retentionAuth=" + retentionAuth
+ ", payAuth=" + payAuth + ", modifyTime=" + modifyTime
+ ", modifyAccount=" + modifyAccount + ", status=" + status
+ "]";
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
@Entity
public class DataAuth {
private Long id;
private Long account;
private Long app;
private Long campaign;
private String campaignCode;
private Long channel;
private Boolean allCampaign;
private Date modifyTime = new Date();
private String modifyAccount;
private Boolean delFlag;
private Boolean channelPermit;//子账号渠道权限是否放开
//Transient
private List<Long> campaignList;
public DataAuth() {
super();
}
public DataAuth(Long id, Long app, Long campaign, String campaignCode,
Long channel, Boolean allCampaign,Boolean channelPermit) {
super();
this.id = id;
this.app = app;
this.campaign = campaign;
this.campaignCode = campaignCode;
this.channel = channel;
this.allCampaign = allCampaign;
this.channelPermit = channelPermit;
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getApp() {
return app;
}
public void setApp(Long app) {
this.app = app;
}
public Long getCampaign() {
return campaign;
}
public void setCampaign(Long campaign) {
this.campaign = campaign;
}
public String getCampaignCode() {
return campaignCode;
}
public void setCampaignCode(String campaignCode) {
this.campaignCode = campaignCode;
}
public Long getChannel() {
return channel;
}
public void setChannel(Long channel) {
this.channel = channel;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(String modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getAllCampaign() {
return allCampaign;
}
public void setAllCampaign(Boolean allCampaign) {
this.allCampaign = allCampaign;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
this.delFlag = delFlag;
}
public Boolean getChannelPermit() {
return channelPermit;
}
public void setChannelPermit(Boolean channelPermit) {
this.channelPermit = channelPermit;
}
@Transient
public List<Long> getCampaignList() {
return campaignList;
}
public void setCampaignList(List<Long> campaignList) {
this.campaignList = campaignList;
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class IsNotified {
private Long id;
private String type;
private Long accountId;
private Boolean isTrackTwoMonthNotified;
private Boolean isTrackOneMonthNotified;
private Boolean isTrackTenDaysNotified;
private Boolean isTrackOneDaysNotified;
private Boolean isTrackExpireNotified;
private Boolean isIoTwoMonthNotified;
private Boolean isIoOneMonthNotified;
private Boolean isIoTenDaysNotified;
private Boolean isIoOneDaysNotified;
private Boolean isIoExpireNotified;
private Boolean isTrackThirtyPercentNotified;
private Boolean isTrackTwentyPercentNotified;
private Boolean isTrackTenPercentNotified;
private Boolean isTrackFivePercentNotified;
private Boolean isTrackExhaustPercentNotified;
private Boolean isIoThirtyPercentNotified;
private Boolean isIoTwentyPercentNotified;
private Boolean isIoTenPercentNotified;
private Boolean isIoFivePercentNotified;
private Boolean isIoExhaustPercentNotified;
private Long previousPackageLevel;
private String firstDayOfThisMonth;
private Boolean thisMonthUpgradeLevel;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public Boolean getTrackOneMonthNotified() {
return isTrackOneMonthNotified;
}
public void setTrackOneMonthNotified(Boolean trackOneMonthNotified) {
isTrackOneMonthNotified = trackOneMonthNotified;
}
public Boolean getTrackTenDaysNotified() {
return isTrackTenDaysNotified;
}
public void setTrackTenDaysNotified(Boolean trackTenDaysNotified) {
isTrackTenDaysNotified = trackTenDaysNotified;
}
public Boolean getTrackOneDaysNotified() {
return isTrackOneDaysNotified;
}
public void setTrackOneDaysNotified(Boolean trackOneDaysNotified) {
isTrackOneDaysNotified = trackOneDaysNotified;
}
public Boolean getTrackExpireNotified() {
return isTrackExpireNotified;
}
public void setTrackExpireNotified(Boolean trackExpireNotified) {
isTrackExpireNotified = trackExpireNotified;
}
public Boolean getIoOneMonthNotified() {
return isIoOneMonthNotified;
}
public void setIoOneMonthNotified(Boolean ioOneMonthNotified) {
isIoOneMonthNotified = ioOneMonthNotified;
}
public Boolean getIoTenDaysNotified() {
return isIoTenDaysNotified;
}
public void setIoTenDaysNotified(Boolean ioTenDaysNotified) {
isIoTenDaysNotified = ioTenDaysNotified;
}
public Boolean getIoOneDaysNotified() {
return isIoOneDaysNotified;
}
public void setIoOneDaysNotified(Boolean ioOneDaysNotified) {
isIoOneDaysNotified = ioOneDaysNotified;
}
public Boolean getIoExpireNotified() {
return isIoExpireNotified;
}
public void setIoExpireNotified(Boolean ioExpireNotified) {
isIoExpireNotified = ioExpireNotified;
}
public Boolean getTrackThirtyPercentNotified() {
return isTrackThirtyPercentNotified;
}
public void setTrackThirtyPercentNotified(Boolean trackThirtyPercentNotified) {
isTrackThirtyPercentNotified = trackThirtyPercentNotified;
}
public Boolean getTrackTwentyPercentNotified() {
return isTrackTwentyPercentNotified;
}
public void setTrackTwentyPercentNotified(Boolean trackTwentyPercentNotified) {
isTrackTwentyPercentNotified = trackTwentyPercentNotified;
}
public Boolean getTrackTenPercentNotified() {
return isTrackTenPercentNotified;
}
public void setTrackTenPercentNotified(Boolean trackTenPercentNotified) {
isTrackTenPercentNotified = trackTenPercentNotified;
}
public Boolean getTrackFivePercentNotified() {
return isTrackFivePercentNotified;
}
public void setTrackFivePercentNotified(Boolean trackFivePercentNotified) {
isTrackFivePercentNotified = trackFivePercentNotified;
}
public Boolean getTrackExhaustPercentNotified() {
return isTrackExhaustPercentNotified;
}
public void setTrackExhaustPercentNotified(Boolean trackExhaustPercentNotified) {
isTrackExhaustPercentNotified = trackExhaustPercentNotified;
}
public Boolean getIoThirtyPercentNotified() {
return isIoThirtyPercentNotified;
}
public void setIoThirtyPercentNotified(Boolean ioThirtyPercentNotified) {
isIoThirtyPercentNotified = ioThirtyPercentNotified;
}
public Boolean getIoTwentyPercentNotified() {
return isIoTwentyPercentNotified;
}
public void setIoTwentyPercentNotified(Boolean ioTwentyPercentNotified) {
isIoTwentyPercentNotified = ioTwentyPercentNotified;
}
public Boolean getIoTenPercentNotified() {
return isIoTenPercentNotified;
}
public void setIoTenPercentNotified(Boolean ioTenPercentNotified) {
isIoTenPercentNotified = ioTenPercentNotified;
}
public Boolean getIoFivePercentNotified() {
return isIoFivePercentNotified;
}
public void setIoFivePercentNotified(Boolean ioFivePercentNotified) {
isIoFivePercentNotified = ioFivePercentNotified;
}
public Boolean getIoExhaustPercentNotified() {
return isIoExhaustPercentNotified;
}
public void setIoExhaustPercentNotified(Boolean ioExhaustPercentNotified) {
isIoExhaustPercentNotified = ioExhaustPercentNotified;
}
public Boolean getTrackTwoMonthNotified() {
return isTrackTwoMonthNotified;
}
public void setTrackTwoMonthNotified(Boolean trackTwoMonthNotified) {
isTrackTwoMonthNotified = trackTwoMonthNotified;
}
public Boolean getIoTwoMonthNotified() {
return isIoTwoMonthNotified;
}
public void setIoTwoMonthNotified(Boolean ioTwoMonthNotified) {
isIoTwoMonthNotified = ioTwoMonthNotified;
}
public Long getPreviousPackageLevel() {
return previousPackageLevel;
}
public void setPreviousPackageLevel(Long previousPackageLevel) {
this.previousPackageLevel = previousPackageLevel;
}
public String getFirstDayOfThisMonth() {
return firstDayOfThisMonth;
}
public void setFirstDayOfThisMonth(String firstDayOfThisMonth) {
this.firstDayOfThisMonth = firstDayOfThisMonth;
}
public Boolean getThisMonthUpgradeLevel() {
return thisMonthUpgradeLevel;
}
public void setThisMonthUpgradeLevel(Boolean thisMonthUpgradeLevel) {
this.thisMonthUpgradeLevel = thisMonthUpgradeLevel;
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
@Entity
public class RoleAuth {
private Long id;
private Long roleCategory;
private String auth;
private Boolean payAuth;
private Boolean retentionAuth;
private Boolean isNatureOpen;
private Boolean topAuth;
private String roleName;
private Long createAccount;
private Date createTime;
private Long modifyAccount;
private Date modifyTime;
private Boolean delFlag;
//@Transient
private List<RoleAuthDetail> roleAuthDetails;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRoleCategory() {
return roleCategory;
}
public void setRoleCategory(Long roleCategory) {
this.roleCategory = roleCategory;
}
public String getAuth() {
return auth;
}
public void setAuth(String auth) {
this.auth = auth;
}
public Boolean getPayAuth() {
return payAuth;
}
public void setPayAuth(Boolean payAuth) {
this.payAuth = payAuth;
}
public Boolean getRetentionAuth() {
return retentionAuth;
}
public void setRetentionAuth(Boolean retentionAuth) {
this.retentionAuth = retentionAuth;
}
public Boolean getIsNatureOpen() {
return isNatureOpen;
}
public void setIsNatureOpen(Boolean isNatureOpen) {
this.isNatureOpen = isNatureOpen;
}
public Boolean getTopAuth() {
return topAuth;
}
public void setTopAuth(Boolean topAuth) {
this.topAuth = topAuth;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
this.delFlag = delFlag;
}
@Transient
public List<RoleAuthDetail> getRoleAuthDetails() {
return roleAuthDetails;
}
public void setRoleAuthDetails(List<RoleAuthDetail> roleAuthDetails) {
this.roleAuthDetails = roleAuthDetails;
}
@Override
public String toString() {
return "RoleAuth [id=" + id + ", roleCategory=" + roleCategory
+ ", auth=" + auth + "]";
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* Created by sunhao on 17/6/6.
* description:角色权限的详情
*/
@Entity
public class RoleAuthDetail {
private Long id;
private String auth;
private String authName;
private String parentAuth;
private int sort;
private Boolean view;
private Boolean edit;
private Long roleId;
public RoleAuthDetail() {}
public RoleAuthDetail(RoleAuthDetail roleAuthDetail) {
this.auth = roleAuthDetail.getAuth();
this.authName = roleAuthDetail.getAuthName();
this.parentAuth = roleAuthDetail.getParentAuth();
this.sort = roleAuthDetail.getSort();
this.view = roleAuthDetail.getView();
this.edit = roleAuthDetail.getEdit();
this.roleId = roleAuthDetail.getRoleId();
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getAuth() {
return auth;
}
public void setAuth(String auth) {
this.auth = auth;
}
public String getAuthName() {
return authName;
}
public void setAuthName(String authName) {
this.authName = authName;
}
public String getParentAuth() {
return parentAuth;
}
public void setParentAuth(String parentAuth) {
this.parentAuth = parentAuth;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public Boolean getView() {
return view;
}
public void setView(Boolean view) {
this.view = view;
}
public Boolean getEdit() {
return edit;
}
public void setEdit(Boolean edit) {
this.edit = edit;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
}
package tkio.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class SalesManLeader {
private int id;
private String area;
private String email;
private String name;
private int leader;
@Id
@GeneratedValue
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getArea() {
return area;
}
public void setArea(String area) {
this.area = area;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getLeader() {
return leader;
}
public void setLeader(int leader) {
this.leader = leader;
}
}
package tkio.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.util.Date;
@Entity
public class UserLog {
private Long id;
private String type;
private String email;
private boolean isMasterLogin;
private String operaType;
@Column(length=2000)
private String operaContent;
private Date pubDate = new Date();
private String ds;
private Long app;
private String appName;
private String objectType;
private String ip;
private String location;
public UserLog() {
super();
}
public String getEmail() {
return email;
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public Date getPubDate() {
return pubDate;
}
public void setEmail(String email) {
this.email = email;
}
public void setId(Long id) {
this.id = id;
}
public void setPubDate(Date pubDate) {
this.pubDate = pubDate;
}
public String getOperaType() {
return operaType;
}
public void setOperaType(String operaType) {
this.operaType = operaType;
}
public String getOperaContent() {
return operaContent;
}
public void setOperaContent(String operaContent) {
this.operaContent = operaContent;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
}
public Long getApp() {
return app;
}
public void setApp(Long app) {
this.app = app;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getObjectType() {
return objectType;
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public boolean isMasterLogin() {
return isMasterLogin;
}
public void setMasterLogin(boolean isMasterLogin) {
this.isMasterLogin = isMasterLogin;
}
@Override
public String toString()
{
return "UserLog{" +
"id=" + id +
", type='" + type + '\'' +
", email='" + email + '\'' +
", isMasterLogin=" + isMasterLogin +
", operaType='" + operaType + '\'' +
", operaContent='" + operaContent + '\'' +
", pubDate=" + pubDate +
", ds='" + ds + '\'' +
", app=" + app +
", appName='" + appName + '\'' +
", objectType='" + objectType + '\'' +
", ip='" + ip + '\'' +
", location='" + location + '\'' +
'}';
}
}
package tkio.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import tkio.model.Account;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@Transactional
public interface AccountRepository extends JpaRepository<Account, Long> {
@Query(value = "select root_parent from account where id=?1", nativeQuery = true)
BigInteger findRootParentByAccountId(Long accountId);
@Query(value = "SELECT * from account where is_super_user is true and `status` = 1 and past_date > ?1", nativeQuery = true)
List<Account> findRootParentsUnPast(String today);
@Query(value = "SELECT * from account where is_super_user is true and `status` = 1 and past_date < ?1", nativeQuery = true)
List<Account> findRootParentsPast(String today);
}
package tkio.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import tkio.model.App;
import java.util.List;
public interface AppRepository extends JpaRepository<App, Long> {
@Query(value = "select * from app where account in (select id from account where parent = ?1 or id = ?1) and del_flag is not true", nativeQuery = true)
List<App> listAppByRootAccount(Long account);
@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);
@Query(value = "select * from app a join auth b on a.id = b.app where b.account = ?1 ", nativeQuery = true)
List<App> findAuthApp(Long subAccountId);
@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 tkio.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import tkio.model.IsNotified;
@Transactional
public interface IsNotifiedRepository extends JpaRepository<IsNotified, Long> {
@Query(value = "select * from is_notified where account_id=?1", nativeQuery = true)
IsNotified findIsNotifiedByAccountId(Long accountId);
@Modifying
@Transactional
@Query(value = "delete from is_notified where account_id=?1", nativeQuery = true)
int deleteByAccountId(Long accountId);
}
package tkio.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import tkio.model.PackageType;
public interface PackageTypeRepository extends JpaRepository<PackageType, Long> {
@Query(value = "select * from package_type where id=(select pricelevel from account where id=?1)", nativeQuery = true)
PackageType findPackageTypeByRootParent(Long rootParent);
@Query(value = "select * from package_type where id=?1", nativeQuery = true)
PackageType findPackageTypeByID(Long ID);
}
package tkio.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import tkio.model.SalesManLeader;
@Transactional
public interface SalesManLeaderRepository extends JpaRepository<SalesManLeader, Long> {
@Query(value = "select email from sales_man_leader where id=(select leader from sales_man_leader where id=?1)", nativeQuery = true)
String findLeaderByBussinessMan(Long bussinessMan);
}
package tkio.service;
import tkio.model.AccountRestrict4Web;
import java.math.BigInteger;
/**
* Created by song on 2017/10/19.
*/
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);
}
package tkio.task;
import common.model.Account4Web;
import common.repository.Account4WebRepository;
import org.springframework.beans.factory.annotation.Autowired;
import tkio.model.Account;
import tkio.model.AccountRestrict4Web;
import tkio.model.PackageType;
import tkio.repository.AccountRepository;
import tkio.repository.PackageTypeRepository;
import tkio.service.AccountFlowRestrictService;
import util.DateUtil;
import util.ValidateUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by mxq on 2017/12/25.
*/
public class AccountTask {
@Autowired
AccountRepository accountRepository;
@Autowired
Account4WebRepository account4WebRepository;
@Autowired
AccountFlowRestrictService accountFlowRestrictService;
@Autowired
private PackageTypeRepository packageTypeRepository;
public void task(){
List<Account4Web> list = new ArrayList<>();
//未过期的查询是否流量到期
List<Account> accountValidList = accountRepository.findRootParentsUnPast(DateUtil.getBeforeDays(1));
if(ValidateUtil.isValid(accountValidList)){
for(Account ac : accountValidList){
AccountRestrict4Web restrict4Web = accountFlowRestrictService.findRestrictByAccount(ac.getId());
Account4Web account4Web = new Account4Web();
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
account4Web.setCreateDate(ac.getCreateTime());
account4Web.setStatus(null == restrict4Web.getIOFlowNotified() ? "已激活" : (restrict4Web.getIOFlowNotified() ? "已激活" : "流量用尽"));
account4Web.setPackageType(restrict4Web.getPackageName());
account4Web.setPastDate(ac.getPastDate());
if (ac.getPricelevel().equals(7L) || ac.getPricelevel().equals(8L) || ac.getPricelevel().equals(5L)){
account4Web.setIo(restrict4Web.getThisMonthIOFlow().toString());
account4Web.setTrack(restrict4Web.getTrackTotalFlow().toString());
}else{
account4Web.setIo(restrict4Web.getThisMonthIOFlow() + "/" + restrict4Web.getIOLimit());
account4Web.setTrack(restrict4Web.getTrackTotalFlow() + "/" + restrict4Web.getTrackLimit());
}
account4Web.setIoStatus(restrict4Web.getAllowBehavior());
account4Web.setTrackStatus(restrict4Web.getTrackFlowNotified());
account4Web.setUser(ac.getBussinessman().toString());
list.add(account4Web);
}
}
//已过期的直接设置成过期
List<Account> pastAccountList = accountRepository.findRootParentsPast(DateUtil.getBeforeDays(0));
List<PackageType> packageTypeList = packageTypeRepository.findAll();
Map<Long, String> map = new HashMap<>();
for(PackageType pt : packageTypeList){
map.put(pt.getId(), pt.getPackageName());
}
if(ValidateUtil.isValid(pastAccountList)){
for(Account ac : pastAccountList){
Account4Web account4Web = new Account4Web();
account4Web.setEmail(ac.getEmail());
account4Web.setCompany(ac.getCompany());
account4Web.setCreateDate(ac.getCreateTime());
account4Web.setStatus("已过期");
account4Web.setPackageType(map.get(ac.getPricelevel()));
account4Web.setPastDate(ac.getPastDate());
account4Web.setIo("----");
account4Web.setTrack("----");
account4Web.setIoStatus(false);
account4Web.setTrackStatus(false);
account4Web.setUser(ac.getBussinessman().toString());
list.add(account4Web);
}
}
account4WebRepository.save(list);
}
}
......@@ -19,6 +19,8 @@ public class Constant {
public static List<String> mlist = Arrays.asList(mailList.split(","));
public static String mailValidTime = mailBundle.getString("mail.valid_time");
public static ResourceBundle commonBundle = ResourceBundle.getBundle("common");
public static String reportUrl = commonBundle.getString("report.url");
......
package util;
import org.json.JSONArray;
import org.json.JSONException;
import java.util.Collection;
import java.util.Map;
/**
* 校验工具类
* @author liruijie@reyun.com
* @date 2015年11月24日
*/
public class ValidateUtil {
/**
* 判断string是否有效
* @param str
* @return
*/
public static boolean isValid(String str) {
if (str == null || "".equals(str.trim())) {
return false;
}
return true;
}
/**
* 判断集合的有效性
* @param col
* @return
*/
@SuppressWarnings("rawtypes")
public static boolean isValid(Collection col) {
if (col == null || col.isEmpty()) {
return false;
}
return true;
}
/**
* 判断map的有效性
* @param map
* @return
*/
@SuppressWarnings("rawtypes")
public static boolean isValid(Map map) {
if (map == null || map.isEmpty()) {
return false;
}
return true;
}
/**
* 判断数组有效性
* @param arr
* @return
*/
public static boolean isValid(Object[] arr) {
if (arr == null || arr.length == 0) {
return false;
}
return true;
}
/**
* 判断对象有效性
* @param obj
* @return
*/
public static boolean isValid(Object obj) {
if (obj == null) {
return false;
}
return true;
}
public static boolean isValid(JSONArray obj) {
if (obj == null) {
return false;
}
if(obj.length()<1){
return false;
}
return true;
}
public static boolean validNotChinese(String str){
return str.matches("^[a-zA-Z0-9_][a-zA-Z0-9_-]*$");
}
public static void main(String[] args) throws JSONException {
String s = "[]";
JSONArray o = new JSONArray(s);
boolean valid = isValid(o);
System.out.println(valid);
}
}
......@@ -9,11 +9,11 @@
<description>调度配置</description>
<!-- <bean id="autoSyncSurlTask" class="com.reyun.task.AutoSyncSurlTask"></bean>-->
<bean id="tkioAccountTask" class="tkio.task.AccountTask"></bean>
<!-- <task:scheduled-tasks>
&lt;!&ndash;//定时同步短链数据(每5分钟执行一次)&ndash;&gt;
<task:scheduled ref="autoSyncSurlTask" method="run" cron="0 */2 * * * ?"/>
</task:scheduled-tasks>-->
<task:scheduled-tasks>
<!--//定时同步短链数据(每5分钟执行一次)-->
<task:scheduled ref="tkioAccountTask" method="task" cron="0 32 19 * * ?"/>
</task:scheduled-tasks>
</beans>
......@@ -49,6 +49,16 @@
<property name="username" value="${office.username}"/>
<property name="password" value="${office.password}"/>
</bean>
<bean id="tkioDataSource" parent="parentDataSource">
<property name="url" value="${tkio.url}"/>
<property name="username" value="${tkio.username}"/>
<property name="password" value="${tkio.password}"/>
</bean>
<bean id="trackDataSource" parent="parentDataSource">
<property name="url" value="${track.url}"/>
<property name="username" value="${track.username}"/>
<property name="password" value="${track.password}"/>
</bean>
<!-- JPA实体管理工厂的配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
......@@ -71,8 +81,42 @@
</property>
</bean>
<bean id="officeEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="officeDataSource"/>
<property name="packagesToScan" value="office.model"></property>
<property name="dataSource" ref="officeDataSource"/>
<property name="packagesToScan" value="office.model"></property>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop><!-- none -->
<prop key="hibernate.connection.CharSet">utf8</prop>
<prop key="hibernate.connection.characterEncoding">utf8</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
</props>
</property>
</bean>
<bean id="tkioEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="tkioDataSource"/>
<property name="packagesToScan" value="tkio.model"></property>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop><!-- none -->
<prop key="hibernate.connection.CharSet">utf8</prop>
<prop key="hibernate.connection.characterEncoding">utf8</prop>
<prop key="hibernate.connection.useUnicode">true</prop>
</props>
</property>
</bean>
<bean id="trackEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="trackDataSource"/>
<property name="packagesToScan" value="track.model"></property>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
......@@ -99,6 +143,12 @@
<bean id="officeTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="officeEntityManagerFactory"/>
</bean>
<bean id="tkioTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="tkioEntityManagerFactory"/>
</bean>
<bean id="trackTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="trackEntityManagerFactory"/>
</bean>
<!-- Spring Data Jpa配置 -->
<jpa:repositories base-package="common.repository"
......@@ -107,9 +157,19 @@
<jpa:repositories base-package="office.repository"
repository-impl-postfix="Impl" transaction-manager-ref="officeTransactionManager"
entity-manager-factory-ref="officeEntityManagerFactory"/>
<jpa:repositories base-package="tkio.repository"
repository-impl-postfix="Impl" transaction-manager-ref="tkioTransactionManager"
entity-manager-factory-ref="tkioEntityManagerFactory"/>
<jpa:repositories base-package="track.repository"
repository-impl-postfix="Impl" transaction-manager-ref="trackTransactionManager"
entity-manager-factory-ref="trackEntityManagerFactory"/>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="officeTransactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="tkioTransactionManager" proxy-target-class="true"/>
<tx:annotation-driven transaction-manager="trackTransactionManager" proxy-target-class="true"/>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
......@@ -130,6 +190,24 @@
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<tx:advice id="tkioTxAdvice" transaction-manager="tkioTransactionManager">
<tx:attributes>
<tx:method name="report*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="list*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="query*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<tx:advice id="trackTxAdvice" transaction-manager="trackTransactionManager">
<tx:attributes>
<tx:method name="report*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="list*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="query*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config expose-proxy="true">
<aop:pointcut id="txPointcut" expression="execution(* common.service.*.*(..))"/>
......@@ -139,7 +217,14 @@
<aop:pointcut id="officetxPointcut" expression="execution(* office.service.*.*(..))"/>
<aop:advisor advice-ref="officeTxAdvice" pointcut-ref="officetxPointcut"/>
</aop:config>
<aop:config expose-proxy="true">
<aop:pointcut id="tkiotxPointcut" expression="execution(* tkio.service.*.*(..))"/>
<aop:advisor advice-ref="tkioTxAdvice" pointcut-ref="tkiotxPointcut"/>
</aop:config>
<aop:config expose-proxy="true">
<aop:pointcut id="tracktxPointcut" expression="execution(* track.service.*.*(..))"/>
<aop:advisor advice-ref="trackTxAdvice" pointcut-ref="tracktxPointcut"/>
</aop:config>
<!-- SpringMVC上传文件时,需要配置MultipartResolver处理器 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
......
report.url=${report.url}
awsneed=${awsneed}
profile.table=${profile.table}
event.table=${event.table}
usergroup.table=${usergroup.table}
iscache=${iscache}
......@@ -7,4 +7,12 @@ default.dataSource.password=${default.datasource.password}
office.url=${office.url}
office.username=${office.username}
office.password=${office.password}
\ No newline at end of file
office.password=${office.password}
tkio.url=${tkio.url}
tkio.username=${tkio.username}
tkio.password=${tkio.password}
track.url=${track.url}
track.username=${track.username}
track.password=${track.password}
\ No newline at end of file
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