Commit 67d3e86a by manxiaoqiang

new

parent f78a24ce
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/lib" relative="WEB-INF/lib" />
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
sonar.projectKey=io
sonar.projectName=userio
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8
\ No newline at end of file
package com.reyun.controller;
import com.reyun.dic.LogEnumType;
import com.reyun.dic.OperateObjectEnumType;
import com.reyun.model.Account;
import com.reyun.model.VirtualEvent;
import com.reyun.repository.AppRepository;
import com.reyun.security.annotation.CurrentAccount;
import com.reyun.service.RetentionService;
import com.reyun.service.UserLogService;
import com.reyun.service.VirtualEventService;
import com.reyun.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/retention")
public class RetentionController {
protected Logger logger = LoggerFactory.getLogger(RetentionController.class);
@Autowired
AppRepository appRepository;
@Autowired
RetentionService retentionService;
@Autowired
UserLogService userLogService;
@Autowired
VirtualEventService virtualEventService;
@RequestMapping(value = "reportdetail/{app}", method = RequestMethod.GET)
@ResponseBody
public ResultModel reportDetail(HttpServletRequest request, @PathVariable Long app, @CurrentAccount Account loginAccount) {
String start = request.getParameter("startdate");
String end = request.getParameter("enddate");
String reportView = request.getParameter("reportview");
String userGroupStr = request.getParameter("usergroupid");
String eventInfo = request.getParameter("eventinfo");
String dimensionStr = request.getParameter("dimention");
String isDeviceStr = request.getParameter("isdevice");
String retentiontype = request.getParameter("retentiontype");
String eventType = request.getParameter("eventType");
boolean isProfile=false;
if(!StringUtils.isEmpty(eventType) && "profile".equals(eventType)){
isProfile=true;
}
boolean isDevice = !StringUtil.isEmpty(isDeviceStr) && "true".equals(isDeviceStr);
boolean isList = request.getParameter("datatype") != null && "list".equals(request.getParameter("datatype"));
if (StringUtil.isEmpty(reportView)) {
reportView = "day";
}
//日期间隔
int interval = this.getIntervalByReportView(start, end, reportView);
//开始结束日期
String startDate = this.getStartDateByReportView(start, reportView);
String endDate = this.getEndDateByReportView(end, reportView);
Map<String, List> result = retentionService.retentionDetailReport(loginAccount, startDate, endDate, isList, eventInfo, app,
userGroupStr, dimensionStr, reportView, interval, isDevice, retentiontype,isProfile);
userLogService.insertLog(loginAccount, LogEnumType.FIND.getCode(), LogEnumType.FIND.getName() + "留存明细报表",
"{\"eventinfo\":" + eventInfo + "}", app, OperateObjectEnumType.REPORT.getCode());
if (result.isEmpty()) {
return ResultModel.ERROR(ResultStatus.NETWORK_ERROR);
} else {
return ResultModel.OK(result);
}
}
@RequestMapping(value = "report/{app}", method = RequestMethod.GET)
@ResponseBody
public ResultModel report(HttpServletRequest request, @PathVariable Long app, @CurrentAccount Account loginAccount) {
String start = request.getParameter("startdate");
String end = request.getParameter("enddate");
String isDeviceStr = request.getParameter("isdevice");
boolean isDevice = !StringUtil.isEmpty(isDeviceStr) && "true".equals(isDeviceStr);
String reportView = request.getParameter("reportview");
String retentiontype = request.getParameter("retentiontype");
if (StringUtil.isEmpty(reportView)) {
reportView = "day";
}
//日期间隔
int interval = this.getIntervalByReportView(start, end, reportView);
//开始结束日期
String startDate = this.getStartDateByReportView(start, reportView);
String endDate = this.getEndDateByReportView(end, reportView);
String eventInfo = request.getParameter("eventinfo");
String userGroupStr = request.getParameter("usergroupid");
String dimensionStr = request.getParameter("dimention");
boolean isList = request.getParameter("datatype") != null && "list".equals(request.getParameter("datatype"));
String eventType = request.getParameter("eventType");
boolean isProfile=false;
if(!StringUtils.isEmpty(eventType) && "profile".equals(eventType)){
isProfile=true;
}
Map<String, List> result = retentionService.retentionReport(startDate, endDate, isList, eventInfo, app, userGroupStr,
dimensionStr, reportView, interval, isDevice, loginAccount.getId(), retentiontype,isProfile);
userLogService.insertLog(loginAccount, LogEnumType.FIND.getCode(), LogEnumType.FIND.getName() + "留存报表",
"{\"eventinfo\":" + eventInfo + "}", app, OperateObjectEnumType.REPORT.getCode());
if (result.isEmpty()) {
return ResultModel.ERROR(ResultStatus.NETWORK_ERROR);
} else {
return ResultModel.OK(result);
}
}
/**
* 获取开始时间
*/
private String getStartDateByReportView(String startDate, String reportView) {
String resultDate = startDate;
switch (reportView) {
case "day":
resultDate = startDate;
break;
case "week":
resultDate = DateUtil.getFirstDayStrOfWeek(DateUtil.parseDate(startDate));
break;
case "month":
resultDate = DateUtil.getFirstDayOfMonth(DateUtil.parseDate(startDate));
break;
}
return resultDate;
}
/**
* 获取结束时间
*/
private String getEndDateByReportView(String endDate, String reportView) {
String resultDate = endDate;
switch (reportView) {
case "day":
resultDate = endDate;
break;
case "week":
resultDate = DateUtil.getLastDayStrOfWeek(DateUtil.parseDate(endDate));
break;
case "month":
resultDate = DateUtil.getLastDayOfMonth(DateUtil.parseDate(endDate));
break;
}
return resultDate;
}
/**
* 根据报表显示类型获取日期间隔
*/
private int getIntervalByReportView(String startDate, String endDate, String reportView) {
int interval = 0;
switch (reportView) {
case "day":
interval = DateUtil.getDateInterval(startDate, endDate).size();
break;
case "week":
interval = DateUtil.getEveryWeek(startDate, endDate).size();
break;
case "month":
interval = DateUtil.getEveryMonth(startDate, endDate).size();
break;
}
return interval;
}
}
package com.reyun.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.reyun.service.TipService;
import com.reyun.util.ResultModel;
/**
* Created by nolan on 22/12/2016.
* description:
*/
@Controller
@RequestMapping("tip")
public class TipController {
@Autowired
private TipService tipService;
@RequestMapping(value = "{menu}", method = RequestMethod.GET)
@ResponseBody
public ResultModel findByMenu(@PathVariable String menu) {
return ResultModel.OK(tipService.findAllByMenu(menu));
}
}
package com.reyun.dic;
/**
* Created by sunhao on 17/6/6.
* desc:角色类型
*/
public enum RoleEnumType {
SUPER_USER(0L,"母账号"),
MANAGER(1L,"管理员"),
SUB_APP_MANAGER(2L,"子应用管理员"),
CUSTOM_AUTH(3L,"自定义权限"),
CUSTOM_ROLE(4L,"自定义角色"),
CHANNEL_PERSON(5L,"渠道账号");
private Long key;
private String value;
RoleEnumType(Long key, String value){
this.key = key;
this.value = value;
}
public Long getKey() {
return key;
}
public void setKey(Long key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.reyun.dic;
/**
* Created by sunhao on 17/3/23.
*/
public enum ThirdAccountChannelType {
SM_SEARCH("smsearch","神马搜索");
private String key;
private String value;
ThirdAccountChannelType(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.reyun.dic;
/**
* Created by sunhao on 17/6/1.
* desc:上传错误类型
*/
public enum UploadErrorEnumType {
READ_ERROR("READ_ERROR","数据读取错误"),
TABLE_EMPTY("EMPTY","表为空"),
HEAD_ERROR("HEAD_ERROR","表头错误"),
CONTENT_ERROR("CONTENT_ERROR","内容错误"),
REPEAT_ALL("REPEAT_ALL","内容全部重复");
private String key;
private String value;
UploadErrorEnumType(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
package com.reyun.dic;
/**
* Created by nolan on 28/12/2016.
* description:
*/
public enum ViewColumnEnumType {
BASE("base", "基础指标"),
RETETION("retetion", "留存指标"),
PAYMENT("payment", "付费指标"),
EXCEPTION("exception", "异常数据");
private String code;
private String name;
ViewColumnEnumType(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.reyun.dic;
/**
* Created by song on 2017/9/5.
*/
public enum VirtualEventType {
ACTIVEEVENT("active","虚拟活跃事件"),
INSTALEVENT("install","新增虚拟活跃事件"),
USERDEFINEDEVENT("userdefine","自定义虚拟事件");
private String code;
private String name;
VirtualEventType(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.reyun.dic;
/**
* Created by nolan on 26/10/2016.
* description:
*/
public enum WhatEventEnumType {
INSTALL("install", "激活"),
REGED("reged", "注册"),
LOGGEDIN("loggedin", "登录"),
PAYMENT("payment", "付费"),
EVENT("event", "效果点");
private String id;
private String value;
WhatEventEnumType(String id, String value) {
this.id = id;
this.value = value;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static WhatEventEnumType get(String key){
for (WhatEventEnumType dic : WhatEventEnumType.values()) {
if(dic.getId().equals(key)){
return dic;
}
}
return null;
}
}
package com.reyun.exception;
/**
* Created by nolan on 24/11/2016.
* description:
*/
public class TipException extends RuntimeException {
public TipException() {
}
public TipException(String message) {
super(message);
}
public TipException(String message, Throwable cause) {
super(message, cause);
}
public TipException(Throwable cause) {
super(cause);
}
public TipException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
package com.reyun.exception;
/**
* Created by nolan on 18/11/2016.
* description:
*/
public class TransferCurrentAccountException extends RuntimeException {
}
package com.reyun.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.List;
/**
* Created by nolan on 15/12/2016.
* description:
*/
public class ResultAuthModel {
private String retention;
private String pay;
private String isnatureopen;
@JsonIgnore
private List<ResultNode> nodes;
public String getRetention() {
return retention;
}
public void setRetention(String retention) {
this.retention = retention;
}
public String getPay() {
return pay;
}
public void setPay(String pay) {
this.pay = pay;
}
public String getIsnatureopen() {
return isnatureopen;
}
public void setIsnatureopen(String isnatureopen) {
this.isnatureopen = isnatureopen;
}
public List<ResultNode> getNodes() {
return nodes;
}
public void setNodes(List<ResultNode> nodes) {
this.nodes = nodes;
}
@Override
public String toString() {
return "ResultAuthModel{" +
"retention='" + retention + '\'' +
", pay='" + pay + '\'' +
", isnatureopen='" + isnatureopen + '\'' +
", nodes=" + nodes +
'}';
}
static class ResultNode {
private String name;
private String zh;
private String canselect;
private int parent;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getZh() {
return zh;
}
public void setZh(String zh) {
this.zh = zh;
}
public String getCanselect() {
return canselect;
}
public void setCanselect(String canselect) {
this.canselect = canselect;
}
public int getParent() {
return parent;
}
public void setParent(int parent) {
this.parent = parent;
}
@Override
public String toString() {
return "ResultNode{" +
"name='" + name + '\'' +
", zh='" + zh + '\'' +
", canselect='" + canselect + '\'' +
", parent=" + parent +
'}';
}
}
public static void main(String[] args) throws IOException {
String str = "{\n" +
" \"retention\": \"true\",\n" +
" \"pay\": \"false\",\n" +
" \"isnatureopen\": \"true\",\n" +
" \"nodes\": [\n" +
" {\n" +
" \"name\": \"transform\",\n" +
" \"zh\": \"转化分析\",\n" +
" \"canselect\": \"true\",\n" +
" \"parent\": 1\n" +
" },\n" +
" {\n" +
" \"name\": \"decisionsupport\",\n" +
" \"zh\": \"决策支持\",\n" +
" \"canselect\": \"true\",\n" +
" \"parent\": 1\n" +
" },\n" +
" {\n" +
" \"name\": \"campaignmanage\",\n" +
" \"zh\": \"活动管理\",\n" +
" \"canselect\": \"false\",\n" +
" \"parent\": 2\n" +
" },\n" +
" {\n" +
" \"name\": \"authmanage\",\n" +
" \"zh\": \"成员管理\",\n" +
" \"canselect\": \"false\",\n" +
" \"parent\": 3\n" +
" }\n" +
" ]\n" +
"}";
ResultAuthModel resultAuthModel = new ObjectMapper().readValue(str, ResultAuthModel.class);
}
}
package com.reyun.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
@Entity
public class Retention {
private Long id;
private Long account;
private Long app;
private String name;
private String eventInfo;
private String view;
private String startDate;
private String endDate;
private int relativeTime;
private String retentionType;
private Long createAccount;
private Date createTime = new Date();
private Date modifyTime = new Date();
private Long modifyAccount;
private Boolean delFlag;
private String cAccount;
private String mAcoucnt;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public Long getApp() {
return app;
}
public void setApp(Long app) {
this.app = app;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEventInfo() {
return eventInfo;
}
public void setEventInfo(String eventInfo) {
this.eventInfo = eventInfo;
}
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 Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
this.delFlag = delFlag;
}
@Transient
@Column(name="cAccount" )
public String getcAccount() {
return cAccount;
}
public void setcAccount(String cAccount) {
this.cAccount = cAccount;
}
@Transient
public String getmAcoucnt() {
return mAcoucnt;
}
public void setmAcoucnt(String mAcoucnt) {
this.mAcoucnt = mAcoucnt;
}
public String getView() {
return view;
}
public void setView(String view) {
this.view = view;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public int getRelativeTime() {
return relativeTime;
}
public void setRelativeTime(int relativeTime) {
this.relativeTime = relativeTime;
}
public String getRetentionType() {
return retentionType;
}
public void setRetentionType(String retentionType) {
this.retentionType = retentionType;
}
}
package com.reyun.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 com.reyun.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 com.reyun.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class RoleCategory {
private Long id;
private String name;
private String menu;
private boolean canselect;
private boolean pay;
private boolean isnatureopen;
private boolean retention;
private int parent;
private int role;
private String rolename;
private String descp;
public RoleCategory() {
super();
}
public RoleCategory(Long id, String name, String menu) {
super();
this.id = id;
this.name = name;
this.menu = menu;
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMenu() {
return menu;
}
public void setMenu(String menu) {
this.menu = menu;
}
public boolean isCanselect() {
return canselect;
}
public void setCanselect(boolean canselect) {
this.canselect = canselect;
}
public boolean isPay() {
return pay;
}
public void setPay(boolean pay) {
this.pay = pay;
}
public boolean isIsnatureopen() {
return isnatureopen;
}
public void setIsnatureopen(boolean isnatureopen) {
this.isnatureopen = isnatureopen;
}
public boolean isRetention() {
return retention;
}
public void setRetention(boolean retention) {
this.retention = retention;
}
public int getParent() {
return parent;
}
public void setParent(int parent) {
this.parent = parent;
}
public int getRole() {
return role;
}
public void setRole(int role) {
this.role = role;
}
public String getRolename() {
return rolename;
}
public void setRolename(String rolename) {
this.rolename = rolename;
}
public String getDescp() {
return descp;
}
public void setDescp(String descp) {
this.descp = descp;
}
}
package com.reyun.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 com.reyun.model;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
@Entity
public class SystemParam {
private Long id;
private Long account;
private int clickDay;
private int installDay;
private int ciDay;
private int cilag;
private int normalclick;
private int normalinstall;
//作弊参数设置状态
private Boolean cheatStatus;
//黑名单库状态
private Boolean blacklistStatus;
//防作弊等级
private Integer blacklistLevel;
//等级对应的渠道个数
private Integer channelNum;
private Date pubDate;
private Date modifyTime = new Date();
private Long modifyAccount;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public int getClickDay() {
return clickDay;
}
public void setClickDay(int clickDay) {
this.clickDay = clickDay;
}
public int getInstallDay() {
return installDay;
}
public void setInstallDay(int installDay) {
this.installDay = installDay;
}
public int getCiDay() {
return ciDay;
}
public void setCiDay(int ciDay) {
this.ciDay = ciDay;
}
public int getCilag() {
return cilag;
}
public void setCilag(int cilag) {
this.cilag = cilag;
}
public int getNormalclick() {
return normalclick;
}
public void setNormalclick(int normalclick) {
this.normalclick = normalclick;
}
public int getNormalinstall() {
return normalinstall;
}
public void setNormalinstall(int normalinstall) {
this.normalinstall = normalinstall;
}
public Date getPubDate() {
return pubDate;
}
public void setPubDate(Date pubDate) {
this.pubDate = pubDate;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getCheatStatus() {
return cheatStatus;
}
public void setCheatStatus(Boolean cheatStatus) {
this.cheatStatus = cheatStatus;
}
public Boolean getBlacklistStatus() {
return blacklistStatus;
}
public void setBlacklistStatus(Boolean blacklistStatus) {
this.blacklistStatus = blacklistStatus;
}
public Integer getBlacklistLevel() {
return blacklistLevel;
}
public void setBlacklistLevel(Integer blacklistLevel) {
this.blacklistLevel = blacklistLevel;
}
public Integer getChannelNum() {
return channelNum;
}
public void setChannelNum(Integer channelNum) {
this.channelNum = channelNum;
}
}
package com.reyun.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Tip {
private Long id;
private String menu;
private String key;
private String tip;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMenu() {
return menu;
}
public void setMenu(String menu) {
this.menu = menu;
}
@Column(name="`key`")
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getTip() {
return tip;
}
public void setTip(String tip) {
this.tip = tip;
}
}
package com.reyun.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Translation {
private Long id;
private String codename;
private String chname;
private String twname;
private String esname;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(unique = true, nullable = false)
public String getCodename() {
return codename;
}
public void setCodename(String codename) {
this.codename = codename;
}
public String getChname() {
return chname;
}
public void setChname(String chname) {
this.chname = chname;
}
public String getTwname() {
return twname;
}
public void setTwname(String twname) {
this.twname = twname;
}
public String getEsname() {
return esname;
}
public void setEsname(String esname) {
this.esname = esname;
}
}
package com.reyun.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;
import java.util.Map;
/**
* Created by sunhao on 17/5/22.
* desc:上传记录表
*/
@Entity
public class UploadHistory {
private Long id;
private String uploadData;
//格式错误数据行数
private List<Integer> uploadErrorList;
//与数据库重复行数
private List<Integer> uploadRepeatedList;
//表内重复行数
private List<List<Integer>> innerRepeatList;
//读取数据中间存储
private Map<String, Map<Integer, String>> keywordCreativeMap;
private Long accountId;
private Long campaignId;
private Date uploadTime;
private int rowNumber;
private String errorType;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUploadData() {
return uploadData;
}
public void setUploadData(String uploadData) {
this.uploadData = uploadData;
}
@Transient
public List<Integer> getUploadErrorList() {
return uploadErrorList;
}
public void setUploadErrorList(List<Integer> uploadErrorList) {
this.uploadErrorList = uploadErrorList;
}
@Transient
public List<Integer> getUploadRepeatedList() {
return uploadRepeatedList;
}
public void setUploadRepeatedList(List<Integer> uploadRepeatedList) {
this.uploadRepeatedList = uploadRepeatedList;
}
@Transient
public List<List<Integer>> getInnerRepeatList() {
return innerRepeatList;
}
public void setInnerRepeatList(List<List<Integer>> innerRepeatList) {
this.innerRepeatList = innerRepeatList;
}
@Transient
public Map<String, Map<Integer, String>> getKeywordCreativeMap() {
return keywordCreativeMap;
}
public void setKeywordCreativeMap(Map<String, Map<Integer, String>> keywordCreativeMap) {
this.keywordCreativeMap = keywordCreativeMap;
}
public Long getAccountId() {
return accountId;
}
public void setAccountId(Long accountId) {
this.accountId = accountId;
}
public Long getCampaignId() {
return campaignId;
}
public void setCampaignId(Long campaignId) {
this.campaignId = campaignId;
}
public Date getUploadTime() {
return uploadTime;
}
public void setUploadTime(Date uploadTime) {
this.uploadTime = uploadTime;
}
public int getRowNumber() {
return rowNumber;
}
public void setRowNumber(int rowNumber) {
this.rowNumber = rowNumber;
}
@Transient
public String getErrorType() {
return errorType;
}
public void setErrorType(String errorType) {
this.errorType = errorType;
}
}
package com.reyun.model;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
@Entity
public class UserGroup {
private Long id;
private Long account;
private Long app;
private String name;
private String mark;
// 1:新增; 2:所有
private int userType;
private String profileInfo;
private String eventInfo;
private String startDate;
private String endDate;
private Long number;
private Date dataUpdateTime;
private String querySql;
private int status;
private Long createAccount;
private Date createTime = new Date();
private Date modifyTime = new Date();
private Long modifyAccount;
private Boolean delFlag;
private String cAccount;
private String mAccount;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public Long getApp() {
return app;
}
public void setApp(Long app) {
this.app = app;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMark() {
return mark;
}
public void setMark(String mark) {
this.mark = mark;
}
public int getUserType() {
return userType;
}
public void setUserType(int userType) {
this.userType = userType;
}
public String getProfileInfo() {
return profileInfo;
}
public void setProfileInfo(String profileInfo) {
this.profileInfo = profileInfo;
}
public String getEventInfo() {
return eventInfo;
}
public void setEventInfo(String eventInfo) {
this.eventInfo = eventInfo;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public Long getCreateAccount() {
return createAccount;
}
public void setCreateAccount(Long createAccount) {
this.createAccount = createAccount;
}
public Long getNumber() {
return number;
}
public void setNumber(Long number) {
this.number = number;
}
public Date getDataUpdateTime() {
return dataUpdateTime;
}
public void setDataUpdateTime(Date dataUpdateTime) {
this.dataUpdateTime = dataUpdateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public Long getModifyAccount() {
return modifyAccount;
}
public void setModifyAccount(Long modifyAccount) {
this.modifyAccount = modifyAccount;
}
public Boolean getDelFlag() {
return delFlag;
}
public void setDelFlag(Boolean delFlag) {
this.delFlag = delFlag;
}
public String getQuerySql() {
return querySql;
}
public void setQuerySql(String querySql) {
this.querySql = querySql;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Transient
public String getcAccount() {
return cAccount;
}
public void setcAccount(String cAccount) {
this.cAccount = cAccount;
}
@Transient
public String getmAccount() {
return mAccount;
}
public void setmAccount(String mAccount) {
this.mAccount = mAccount;
}
}
package com.reyun.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@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 com.reyun.model;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* Created by sunhao on 17/3/1.
*/
@Table(uniqueConstraints = @UniqueConstraint(columnNames={"noticeid","accountid"}))
@Entity
public class UserNoticeLog {
private Long id;
@NotNull
private Long noticeid;
@NotNull
private Long accountid;
@NotNull
private Date readdate;
public UserNoticeLog(){super();}
public UserNoticeLog(Long noticeId, Long accountId,Date readDate)
{
this.noticeid = noticeId;
this.accountid = accountId;
this.readdate = readDate;
}
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Date getReaddate() {
return readdate;
}
public void setReaddate(Date readdate) {
this.readdate = readdate;
}
public Long getNoticeid() {
return noticeid;
}
public void setNoticeid(Long noticeid) {
this.noticeid = noticeid;
}
public Long getAccountid() {
return accountid;
}
public void setAccountid(Long accountid) {
this.accountid = accountid;
}
}
package com.reyun.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* Created by nolan on 28/12/2016.
* description:
*/
@Entity
public class UserViewColumn {
private Long id;
private Long account;
private String viewcolumn;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAccount() {
return account;
}
public void setAccount(Long account) {
this.account = account;
}
public String getViewcolumn() {
return viewcolumn;
}
public void setViewcolumn(String viewcolumn) {
this.viewcolumn = viewcolumn;
}
}
package com.reyun.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* Created by nolan on 28/12/2016.
* description:
*/
@Entity
public class ViewColumn {
private Long id; //主键
private String fieldcode; //字段编码
private String fieldname; //字段名称
private Boolean ischeck; //是否缺省选中
private Boolean isedit; //是否可编辑
private String type;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFieldcode() {
return fieldcode;
}
public void setFieldcode(String fieldcode) {
this.fieldcode = fieldcode;
}
public String getFieldname() {
return fieldname;
}
public void setFieldname(String fieldname) {
this.fieldname = fieldname;
}
public Boolean getIscheck() {
return ischeck;
}
public void setIscheck(Boolean ischeck) {
this.ischeck = ischeck;
}
public Boolean getIsedit() {
return isedit;
}
public void setIsedit(Boolean isedit) {
this.isedit = isedit;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
package com.reyun.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
/**
* C by song on 2017/9/4.
*/
@Entity
public class VirtualEvent {
private Long id;
private Long appId;
private String name;
private String eventList;
private String type;
private Long createAccount;
private Date createTime = new Date();
private Long modifyAccount;
private Date modifyTime = new Date();
private boolean isEnable;
private String ch_name;
private String eventListName;
@Id
@GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getAppId() {
return appId;
}
public void setAppId(Long appId) {
this.appId = appId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEventList() {
return eventList;
}
public void setEventList(String eventList) {
this.eventList = eventList;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
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 isEnable() {
return isEnable;
}
public void setEnable(boolean enable) {
isEnable = enable;
}
public String getCh_name() {
return ch_name;
}
public void setCh_name(String ch_name) {
this.ch_name = ch_name;
}
@Transient
public String getEventListName() {
return eventListName;
}
public void setEventListName(String eventListName) {
this.eventListName = eventListName;
}
@Override
public String toString() {
return "VirtualEvent{" +
"id=" + id +
", appId=" + appId +
", name='" + name + '\'' +
", eventList='" + eventList + '\'' +
", type='" + type + '\'' +
", createAccount=" + createAccount +
", createTime=" + createTime +
", modifyAccount='" + modifyAccount + '\'' +
", modifyTime=" + modifyTime +
", isEnable=" + isEnable +
'}';
}
}
/*
package com.reyun.ops;
import com.amazonaws.services.dynamodbv2.document.*;
import com.amazonaws.services.dynamodbv2.model.WriteRequest;
import com.google.common.base.Predicate;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.reyun.model.SurlModel;
import com.reyun.util.*;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.*;
import java.util.*;
import java.util.Date;
import java.util.concurrent.*;
*/
/**
* Created by nolan on 13/02/2017.
* description:
*//*
public class SurlOpsMain {
private final static Logger logger = LoggerFactory.getLogger(SurlOpsMain.class);
public static void main(String[] args) {
if (Constant.awsneed) {
updateAWSRedis();
}
}
public static List<SurlModel> updateAWSDynamodb(Long appid, int threadsize, final int recordsize, boolean isTest) throws SQLException, InterruptedException {
logger.info("启动配置: 线程数/{}, 单线程处理记录数/{}", threadsize, recordsize);
final List<SurlModel> list;
if (appid != null) {
list = querySurlByAppId(appid);
} else {
list = queryAllSurls();
}
final Integer totalnum;
final Integer pagenum;
if(isTest){
pagenum = 1;
totalnum = recordsize;
}else {
totalnum = list != null ? list.size() : 0;
pagenum = totalnum % recordsize == 0 ? totalnum / recordsize : totalnum / recordsize + 1;
}
logger.info("总计记录数:{},总页数: {}......", totalnum, pagenum);
List<SurlModel> rtnList = Lists.newArrayList();
ExecutorService exec = Executors.newFixedThreadPool(threadsize);
final Semaphore semaphore = new Semaphore(threadsize);
List<Future<List<SurlModel>>> cblist = Lists.newArrayList();
for (int i = 0; i < pagenum; i++) {
try {
semaphore.acquire();
} catch (InterruptedException e) {
logger.error("InterruptedException pagenum:{}", i);
e.printStackTrace();
throw e;
}
logger.info("运行第{}页, 每页{}条......", i+1, recordsize);
final int index = i;
cblist.add(exec.submit(new Callable<List<SurlModel>>() {
@Override
public List<SurlModel> call() throws Exception {
List<SurlModel> subtasklist = list.subList(index * recordsize, (index + 1) == pagenum ? totalnum : ((index + 1) * recordsize));
if (subtasklist == null || subtasklist.size() == 0)
return Lists.newArrayList();
List<SurlModel> errorList = Lists.newArrayList();
List<Item> awsitemlist = Lists.newArrayList();
for (SurlModel item : subtasklist) {
Map<String, Object> attributes = BeanUtils.bean2Map(item);
attributes = Maps.filterValues(attributes, new Predicate<Object>() {
@Override
public boolean apply(Object s) {
return s != null && !Strings.isNullOrEmpty(String.valueOf(s));
}
});
if(!attributes.containsKey("surl")){
errorList.add(item);
}else{
awsitemlist.add(Item.fromMap(attributes));
}
}
BatchWriteItemOutcome batchWriteItemOutcome = null;
try {
batchWriteItemOutcome = DynamoDBUtil.getInstance().getDynamoDB().batchWriteItem(new TableWriteItems(SurlModel.TABLE).withItemsToPut(awsitemlist));
} catch (Exception e) {
logger.info("awsitemlist: {}", awsitemlist);
throw e;
}
do {
Map<String, List<WriteRequest>> unprocessedItems = batchWriteItemOutcome.getUnprocessedItems();
if (batchWriteItemOutcome.getUnprocessedItems().size() == 0) {
logger.info("No unprocessed items found");
} else {
batchWriteItemOutcome = DynamoDBUtil.getInstance().getDynamoDB().batchWriteItemUnprocessed(unprocessedItems);
}
} while (batchWriteItemOutcome.getUnprocessedItems().size() > 0);
semaphore.release();
return errorList;
}
}));
}
for(Future<List<SurlModel>> cb : cblist){
try {
final List<SurlModel> c = cb.get();
if (c != null && c.size() > 0) {
rtnList.addAll(c);
}
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
exec.shutdown();
logger.info("总计记录数:{},总页数: {}......//END", totalnum, pagenum);
return rtnList;
}
public static void updateAWSRedis() {
if (Constant.awsneed) {
List<Map<String, String>> dbList = new ArrayList<Map<String, String>>();
try {
dbList = queryAWSFalse();
} catch (SQLException e) {
String subject = "Fail to query data from DB, which need to update to AWS redis.";
try {
MailUtils.sendSimpleEmail(subject, subject, Constant.mlist);
} catch (Exception e1) {
logger.error("Fail to send email to inform fail of query data from DB" + e1.getMessage());
}
}
if (dbList.size() > 0) {
InetAddress addr = null;
try {
addr = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
logger.error("Fail to get local ip.." + e.getMessage());
}
String ip = addr!=null?addr.getHostAddress():"";
String tokenStr = "zhangxiaoyan_" + DateUtil.format(new Date(), DateUtil.C_DATE_PATTON_DEFAULT);
String token = CipherUtil.generatePassword(tokenStr);
List<String> surlList = new ArrayList<String>();
List<String> campaignpackidList = new ArrayList<String>();
for (Map<String, String> m : dbList) {
Map attributes = Maps.filterValues(m, new Predicate<Object>() {
@Override
public boolean apply(Object s) {
return s != null && !Strings.isNullOrEmpty(String.valueOf(s));
}
});
Table tableModel = DynamoDBUtil.getInstance().getTable(SurlModel.TABLE);
final PutItemOutcome putItemOutcome = tableModel.putItem(Item.fromMap(attributes));
boolean isflag = putItemOutcome.getPutItemResult().getSdkHttpMetadata().getHttpStatusCode() == 200;
if(!isflag){
logger.error("Fail to update AWS dynamodb campaigninfo by surl: {}.", m.get("surl"));
}
m.put("method", "update");
m.put("token", token);
try {
boolean success = HttpClientUtil.httpAWS(m, ip, m.get("surl"), Constant.awsurl);
if (success) {
if (!StringUtil.isEmpty(m.get("category")) && m.get("category").equals("APPMARKET")) {
String sac = m.get("surl");
String[] sacs = sac.split(":");
campaignpackidList.add(sacs[1]);
} else {
surlList.add(m.get("surl"));
}
}
} catch (Exception e) {
logger.error("Fail to update AWS redis campaigninfo by surl:" + m.get("surl") + "from database..." + e.getMessage());
}
}
if (surlList.size() > 0) {
String surlstr = "'" + StringUtils.join(surlList, "','") + "'";
try {
updateStatusInMysql(surlstr);
} catch (SQLException e) {
logger.error("Fail to update db table campaign's awssuccess filed." + e.getMessage());
}
}
if (campaignpackidList.size() > 0) {
String idstr = "'" + StringUtils.join(campaignpackidList, "','") + "'";
try {
updateStatusInMysqlId(idstr);
} catch (SQLException e) {
logger.error("Fail to update db table campaign's awssuccess filed." + e.getMessage());
}
}
} else {
logger.info("There is no data need to update AWS redis...");
}
}
}
public static List<Map<String, String>> queryAWSFalse() throws SQLException {
DBUtil dbUtil = DBUtil.newInstance();
String sql = "select c.channel, c.channelid,c.name,c.url,c.special_keys,c.surl,c.campaignpackid,a.appkey,a.url as appurl,ch.name as channelname,ch.unique_name,ch.category from campaign c, app a, channel ch where c.awssuccess=false and a.id=c.app and ch.id=c.channel";
Connection conn = dbUtil.getConn();
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(sql);
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
while (rs.next()) {
String channelcategory = rs.getString("category");
String surl = rs.getString("surl");
if (!StringUtil.isEmpty(channelcategory) && channelcategory.equals("APPMARKET")) {
surl = rs.getString("appkey")+":"+rs.getString("campaignpackid");
}
Map<String, String> inner = new HashMap<String, String>();
inner.put("surl", surl);
inner.put("name", rs.getString("name"));
inner.put("channelid", rs.getString("channelid"));
String uniq = rs.getString("unique_name");
inner.put("channelname", StringUtil.isEmpty(uniq) ? "" : uniq);
inner.put("channel", rs.getString("channelname"));
inner.put("cid", rs.getString("channel"));
inner.put("appid", rs.getString("appkey"));
String special = rs.getString("special_keys");
if (!StringUtil.isEmpty(special)) {
inner.put("specialkeys", special);
}
inner.put("category", channelcategory);
String appurl = rs.getString("appurl");
String url = rs.getString("url");
inner.put("url", StringUtil.isEmpty(url) ? appurl : url);
list.add(inner);
}
if (rs != null) {
rs.close();
}
if (st != null) {
rs.close();
}
if (conn != null) {
conn.close();
}
return list;
}
public static void updateStatusInMysql(String surlstr) throws SQLException {
DBUtil dbUtil = DBUtil.newInstance();
String sql = "update campaign set awssuccess=true where surl in ("+surlstr+")";
Connection conn = dbUtil.getConn();
PreparedStatement pdst = conn.prepareStatement(sql);
pdst.executeUpdate();
pdst.close();
conn.close();
}
public static void updateStatusInMysqlId(String idstr) throws SQLException {
DBUtil dbUtil = DBUtil.newInstance();
String sql = "update campaign set awssuccess=true where campaignpackid in ("+idstr+")";
Connection conn = dbUtil.getConn();
PreparedStatement pdst = conn.prepareStatement(sql);
pdst.executeUpdate();
pdst.close();
conn.close();
}
}
*/
package com.reyun.repository;
import java.math.BigInteger;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.reyun.model.Retention;
public interface RetentionRepository extends JpaRepository<Retention, Long> {
@Query(value="select f.*,a.email as cAccount from retention f, account a where f.app=?1 and a.id = ?2 and f.del_flag is not true and a.id=f.create_account order by modify_time desc",nativeQuery = true)
List<Retention> findAllByApp(Long app , Long account);
@Query(value="select r.* from retention r where r.app=?1 and r.del_flag is not true order by r.modify_time desc",nativeQuery = true)
List<Retention> findAllByApp(Long app);
@Query(value="select * from retention where app=?2 and del_flag is not true and name=?1",nativeQuery=true)
Retention findByNameAndApp(String name, Long app);
@Query(value = "select count(*) from retention where create_account = 1? and app=?2 and name like ?3% ", nativeQuery = true)
BigInteger findCountLikeName(Long accountId, Long appId, String name);
}
package com.reyun.repository;
import com.reyun.model.RoleAuthDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* Created by sunhao on 17/6/7.
* Desc:权限详情DAO
*/
public interface RoleAuthDetailRepository extends JpaRepository<RoleAuthDetail,Long>{
@Query(value = "select * from role_auth_detail where role_id = ?1", nativeQuery = true)
List<RoleAuthDetail> findDetailByRole(Long roleId);
@Query(value = "select * from role_auth_detail where role_id = ?1 and (view is true or edit is true)", nativeQuery = true)
List<RoleAuthDetail> findValidDetailByRole(Long roleId);
}
package com.reyun.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.reyun.model.RoleAuth;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
public interface RoleAuthRepository extends JpaRepository<RoleAuth, Long> {
RoleAuth findByRoleCategory(Long id);
@Query(value = "select * from role_auth where id in ?1 ", nativeQuery = true)
List<RoleAuth> findCustomRoleList(List<Long> createAccounts);
@Query(value = "select * from role_auth where create_account in ?1 and del_flag is not true order by create_time desc ", nativeQuery = true)
List<RoleAuth> findAllCustomRoleList(List<Long> createAccounts);
@Query(value = "select count(*) from role_auth where create_account in ?1 and role_name = ?2 and del_flag is not true", nativeQuery = true)
BigInteger findByAccountAndName(List<Long> accountList, String roleName);
@Query(value = "select count(*) from role_auth where create_account in ?1 and role_category = 4 and del_flag is not true", nativeQuery = true)
BigInteger findCustomNumByAccount(List<Long> accountList);
@Transactional
@Modifying
@Query(value = "update role_auth set del_flag = true , modify_account = ?2, modify_time = ?3 where id = ?1 ", nativeQuery = true)
int deleteCustomRole(Long roleId, Long modifyAccount, Date modifyDate);
}
package com.reyun.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import com.reyun.model.RoleCategory;
@Transactional
public interface RoleCategoryRepository extends JpaRepository<RoleCategory, Long> {
@Query(value="select * from role_category",nativeQuery=true)
List<RoleCategory> listAllRoleCategory();
@Query(value="select * from role_category where role = ?1",nativeQuery=true)
List<RoleCategory> listMenuAuthByRole(int role);
}
package com.reyun.repository;
import com.reyun.model.CommonParam;
import com.reyun.model.SalesManLeader;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
@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 com.reyun.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import com.reyun.model.SystemParam;
@Transactional
public interface SystemParamRepository extends JpaRepository<SystemParam, Long> {
@Query(value="select * from system_param where account = ?1",nativeQuery=true)
SystemParam findByAccount(Long account);
}
package com.reyun.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import com.reyun.model.Tip;
@Transactional
public interface TipRepository extends JpaRepository<Tip, Long> {
@Query(value="select * from tip where menu=?1",nativeQuery=true)
List<Tip> findAllByMenu(String menu);
}
package com.reyun.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.reyun.model.Translation;
public interface TranslationRepository extends JpaRepository<Translation, Long> {
Translation findByCodename(String name);
}
package com.reyun.repository;
import com.reyun.model.UploadHistory;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by sunhao on 17/5/22.
* desc:数据上传历史记录DAO
*/
public interface UploadHistoryRepository extends JpaRepository<UploadHistory, Long> {
}
package com.reyun.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.reyun.model.UserGroup;
public interface UserGroupRepository extends JpaRepository<UserGroup, Long> {
@Query(value="select * from usergroup where account = ?1",nativeQuery=true)
List<UserGroup> listByAccount(Long createAccount);
@Query(value="select * from user_group where app = ?1 and account = ?2 and del_flag is not true",nativeQuery=true)
List<UserGroup> listByApp(Long app,Long account);
@Query(value="select * from user_group where app = ?1 and del_flag is not true",nativeQuery=true)
List<UserGroup> listByApp(Long app);
UserGroup findByName(String name);
@Query(value="select * from user_group where app = ?1 and account = ?2 and name = ?3 and del_flag is not true",nativeQuery=true)
UserGroup findByName(Long app,Long account,String name);
}
package com.reyun.repository;
import com.reyun.model.UserLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.math.BigInteger;
import java.util.List;
public interface UserLogRepository extends JpaRepository<UserLog, Long> {
@Query(value = "select * from audit a where a.master_login is not true and a.email like %?1% and a.type=?2 and a.ds>=?3 and a.ds<=?4 order by a.pub_date desc limit ?5, ?6", nativeQuery = true)
List<UserLog> findAllByEmailAndType(String email, String type,
String startDate, String endDate, int start, int end);
@Query(value = "select * from audit a where a.master_login is not true and a.email like %?1% and a.ds>=?2 and a.ds<=?3 order by a.pub_date desc limit ?4, ?5", nativeQuery = true)
List<UserLog> findAllByEmail(String email, String startDate, String endDate,
int start, int end);
@Query(value = "select * from audit a where a.master_login is not true and a.type=?1 and a.ds>=?2 and a.ds<=?3 order by a.pub_date desc limit ?4, ?5", nativeQuery = true)
List<UserLog> findAllByType(String type, String startDate, String endDate,
int start, int end);
@Query(value = "select * from audit a where a.master_login is not true and a.ds>=?1 and a.ds<=?2 order by a.pub_date desc limit ?3, ?4", nativeQuery = true)
List<UserLog> findAll(String startDate, String endDate, int start, int end);
@Query(value = "select count(*) from audit a where a.master_login is not true and a.email like %?1% and a.type=?2 and a.ds>=?3 and a.ds<=?4", nativeQuery = true)
BigInteger getCount(String email, String type, String startDate, String endDate);
@Query(value = "select count(*) from audit a where a.master_login is not true and a.email like %?1% and a.ds>=?2 and a.ds<=?3", nativeQuery = true)
BigInteger getCountByEmail(String email, String startDate, String endDate);
@Query(value = "select count(*) from audit a where a.master_login is not true and a.type=?1 and a.ds>=?2 and a.ds<=?3", nativeQuery = true)
BigInteger getCountByType(String type, String startDate, String endDate);
@Query(value = "select count(*) from audit a where a.master_login is not true and a.ds>=?1 and a.ds<=?2", nativeQuery = true)
BigInteger getCount(String startDate, String endDate);
@Query(value = "select * from user_log where master_login is not true and email = ?1 and type = 'login' order by pub_date desc limit 4", nativeQuery = true)
List<UserLog> findRecentUserLog(String email);
}
package com.reyun.repository;
import com.reyun.model.UserNoticeLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by sunhao on 17/3/1.
*/
@Transactional
public interface UserNoticeLogRepository extends JpaRepository<UserNoticeLog, Long> {
@Query(value = "select * from user_notice_log u where u.accountid = ?1 and u.noticeid in ?2 ",nativeQuery = true)
List<UserNoticeLog> listUserNoticeLog(Long accountId , List<Long> noticeIdList);
@Query(value = "select * from user_notice_log u where u.accountid = ?1 and u.noticeid = ?2", nativeQuery = true)
UserNoticeLog findUserNoticeLog(Long accountId , Long noticeId);
}
package com.reyun.repository;
import com.reyun.model.UserViewColumn;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
/**
* Created by nolan on 28/12/2016.
* description:
*/
public interface UserViewColumnRepository extends JpaRepository<UserViewColumn, Long> {
@Query(value = "select a from UserViewColumn a where a.account = ?1")
UserViewColumn findByAccount(Long accountid);
}
package com.reyun.repository;
import com.reyun.model.ViewColumn;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by nolan on 28/12/2016.
* description:
*/
public interface ViewColumnRepository extends JpaRepository<ViewColumn, Long> {
}
package com.reyun.repository;
import com.reyun.model.ConfigParam;
import com.reyun.model.VirtualEvent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* Created by song on 2017/9/4.
*/
public interface VirtualEventRepository extends JpaRepository<VirtualEvent, Long> {
@Query(value = "select * from virtual_event where app_id=?1 and type=?2", nativeQuery = true)
List<VirtualEvent> findEventListByAppIdAndType(Long appId, String type);
@Query(value = "select * from virtual_event where app_id=?1", nativeQuery = true)
List<VirtualEvent> findEventListByAppId(Long appId);
@Query(value = "select * from virtual_event where id=?1", nativeQuery = true)
List<VirtualEvent> findEventListById(Long id);
@Query(value = "select * from virtual_event where id!=?1", nativeQuery = true)
List<VirtualEvent> findEventListByIdNot(Long id);
@Query(value = "select * from virtual_event where name = ?1 limit 1", nativeQuery = true)
VirtualEvent findVirtualEventByEventId(String eventId);
@Query(value = "select b.* from virtual_event b left join app a on a.id = b.app_id where a.appkey = ?1 and b.ch_name = ?2 limit 1", nativeQuery = true)
VirtualEvent findVirtualEventByChName(String appKey, String eventId);
}
package com.reyun.security;
/**
* Created by nolan on 11/11/2016.
* description:
*/
public interface TokenManager {
void delMultiRelationshipByKey(String key);
/**
* 通过key删除关联关系
*
* @param key
*/
void delRelationshipByKey(String key);
/**
* 通过token删除关联关系
*
* @param token
*/
void delRelationshipByToken(String token);
/**
* 通过token获得对应的key
*
* @param token
* @return
*/
String getKeyFromToken(String token);
/**
* 通过key获得对应token
* @param key
* @return
*/
String getTokenFromKey(String key);
/**
* 根据key生成对应token
* @param key
* @return
*/
String createToken(String key);
}
package com.reyun.service;
import java.util.List;
import java.util.Map;
import com.reyun.model.Account;
import com.reyun.model.Retention;
public interface RetentionService {
Retention create(Retention retention, Long account);
Retention update(Retention retention, Long account);
Retention delete(Long id, Long account);
Retention findById(Long id);
List<Retention> findByApp(Long app);
Retention validName(String name, Long app);
Map<String, List> retentionReport(String startDate, String endDate, boolean isList, String eventInfo, Long app, String usergroup, String dimention, String reportView, int interval, boolean isDevice, Long account,String retentiontype,boolean isProfile);
Map<String, List> retentionDetailReport(Account account, String startDate, String endDate, boolean isList, String eventInfo, Long app, String usergroup, String dimention, String reportView, int interval, boolean isDevice, String retentiontype, boolean isProfile);
}
package com.reyun.service;
import com.reyun.model.SystemParam;
public interface SystemParamService {
public SystemParam create(Long account);
public SystemParam update(SystemParam systemParam,Long account);
public SystemParam find(Long account);
}
package com.reyun.service;
import java.util.List;
import java.util.Map;
import com.reyun.model.Tip;
public interface TipService {
public Map<String, String> findAllByMenu(String menu);
}
package com.reyun.service;
import com.reyun.model.UserGroup;
import java.util.List;
import java.util.Map;
public interface UserGroupService {
UserGroup save(UserGroup userGroup, Long account);
UserGroup update(UserGroup userGroup, Long account);
List<UserGroup> list(Long app, Long account);
List<UserGroup> list(Long app);
UserGroup findById(Long id);
UserGroup delete(Long id, Long account);
Boolean valid(Long account, Long app, String name);
Map<String,String> getSql(UserGroup userGroup);
boolean refresh(Long id);
}
package com.reyun.service;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.reyun.model.Account;
import com.reyun.model.UserLog;
import com.reyun.util.DateUtil;
import com.reyun.util.StringUtil;
public interface UserLogService {
/**
* 插入审计日志
* @param account
* @param type
* @param content
* @return
*/
public boolean insertLog(Account account, String type, String typeName, Object object);
public boolean insertLog(Account account, String type, String typeName, Object object, HttpServletRequest request);
public boolean insertLog(Account account, String type, String typeName, Object object, Long app, String ObjectType);
public boolean insertLog(HttpServletRequest request, String type, String typeName, Long app, String ObjectType);
public boolean insertLog(Account account, String type, String typeName, Object object, Long app, String ObjectType,HttpServletRequest request);
public boolean insertLog(Account account, String type, String typeName, List object, Long app, String ObjectType,HttpServletRequest request);
public boolean insertLog(Account account, String type, String typeName, String content, Long app, String ObjectType,HttpServletRequest request);
/**
* 查询审计日志列表
* @param email
* @param type
* @param startDate
* @param endDate
* @param pageIndex
* @param pageSize
* @return
*/
public List<UserLog> findUserLogList(String email, String type, String startDate, String endDate, int pageIndex, int pageSize);
/**
* 查询满足条件的日志数量
* @param email
* @param type
* @param startDate
* @param endDate
* @return
*/
public BigInteger findUserLogCount(String email, String type, String startDate, String endDate);
}
package com.reyun.service;
import com.reyun.model.Account;
import com.reyun.model.Event4Web;
import com.reyun.model.VirtualEvent;
import java.util.List;
/**
* Created by song on 2017/9/4.
*/
public interface VirtualEventService {
List<VirtualEvent> findEventList(Long appId, Account account);
VirtualEvent updateEvent(Long appId, Account account, VirtualEvent virtualEvent);
List<Event4Web> findActiveEventList(Long appId, Long activeEventId);
List<Event4Web> unselectedEvent(Long app);
VirtualEvent userDefineVirtual(Long appId,VirtualEvent virtualEvent,Account account);
List<VirtualEvent> findCustomEventList(Long appId, Account loginAccount);
List<VirtualEvent> enableEvent(Long id);
List<VirtualEvent> disableEvent(Long id);
String findVirtualEvents(String virtualEventId);
List<String> findVirtualEventList(String virtualEventId);
VirtualEvent getVirtualEvent(String appKey, String eventChName);
}
package com.reyun.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.reyun.dic.CustomMenuType;
import com.reyun.dic.VirtualEventType;
import com.reyun.model.*;
import com.reyun.repository.*;
import com.reyun.service.*;
import com.reyun.taskexecute.ReportCallable;
import com.reyun.util.*;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
public class RetentionServiceImpl implements RetentionService {
private static Logger logger = LoggerFactory.getLogger(RetentionServiceImpl.class);
@Autowired
AppRepository appRepository;
@Autowired
RetentionRepository retentionRepository;
@Autowired
AccountRepository accountRepository;
@Autowired
UserGroupRepository usergroupRepository;
@Autowired
AuthService authService;
@Autowired
CustomMenuTemplateRepository customMenuTemplateRepository;
@Autowired
ConfigParamService configparamService;
@Autowired
VirtualEventService virtualEventService;
@Autowired
VirtualEventRepository virtualEventRepository;
@Autowired
ReportService reportService;
private final static String TEMPLATE_TYPE_RETENTION = "retention";
private Map<String, List> format(String reponse) {
Map<String, List> result = new HashMap<>();
List<List<Object>> valueResult = new ArrayList<>();
try {
ReportListResult content = new ObjectMapper().readValue(reponse, ReportListResult.class);
List<Map<String, Object>> valList = content.getVal();
if (valList.size() > 0) {
Map<String, Object> valueMap = valList.get(0);
List<Object> users = new ArrayList<>();
for (String k : valueMap.keySet()) {
if (!"isall0".equals(k)) {
users.add(valueMap.get(k));
}
}
List<Object> trans4firstList = new ArrayList<>();
List<Object> trans4lastList = new ArrayList<>();
trans4firstList.add(100.00d);
for (int i = 1; i < users.size(); i++) {
Double trans4first = Double.valueOf(users.get(i).toString()) * 100.0 / Double.valueOf(users.get(0).toString());
BigDecimal trans4firstb = BigDecimal.valueOf(users.get(0).toString().equals("0") ? 0 : trans4first);
Object trans4firstResult = trans4firstb.setScale(2, BigDecimal.ROUND_HALF_UP);
trans4firstList.add(trans4firstResult);
if (i > 0) {
Double trans4last = Double.valueOf(users.get(i).toString()) * 100.0 / Double.valueOf(users.get(i - 1).toString());
BigDecimal trans4lastb = BigDecimal.valueOf(users.get(i - 1).toString().equals("0") ? 0 : trans4last);
Object trans4lastResult = trans4lastb.setScale(2, BigDecimal.ROUND_HALF_UP);
trans4lastList.add(trans4lastResult);
}
}
valueResult.add(trans4firstList);
valueResult.add(users);
result.put("trans4last", trans4lastList);
}
result.put("val", valueResult);
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
@Override
public Retention create(Retention retention, Long account) {
retention.setAccount(account);
retention.setCreateAccount(account);
App app = appRepository.findOne(retention.getApp());
// String sqlTemp =
// SqlUtil.generateRetentionSql(retention.getEventInfo(),
// app.getAppkey());
// retention.setQuerySql(sqlTemp);
return retentionRepository.save(retention);
}
@Override
public Retention update(Retention retention, Long account) {
Retention dbRetention = retentionRepository.findOne(retention.getId());
dbRetention.setName(retention.getName());
dbRetention.setEventInfo(retention.getEventInfo());
dbRetention.setModifyTime(new Date());
dbRetention.setModifyAccount(account);
// dbRetention.setRelativeTime(retention.getRelativeTime());
// dbRetention.setStartDate(retention.getStartDate());
// dbRetention.setEndDate(retention.getEndDate());
// dbRetention.setView(retention.getView());
dbRetention.setRetentionType(retention.getRetentionType());
App app = appRepository.findOne(dbRetention.getApp());
// String sqlTemp =
// SqlUtil.generateRetentionSql(retention.getEventInfo(),
// app.getAppkey());
// dbRetention.setQuerySql(sqlTemp);
List<CustomMenuTemplate> templateList = customMenuTemplateRepository.findAllTemplateByOriginal(dbRetention.getId(), TEMPLATE_TYPE_RETENTION);
if(ValidateUtil.isValid(templateList)){
List<CustomMenuTemplate> list = new ArrayList<>();
for(CustomMenuTemplate cu : templateList){
cu.setName(dbRetention.getName());
list.add(cu);
}
customMenuTemplateRepository.save(list);
}
return retentionRepository.save(dbRetention);
}
@Override
public Retention delete(Long id, Long account) {
Retention dbRetention = retentionRepository.findOne(id);
dbRetention.setModifyAccount(account);
dbRetention.setModifyTime(new Date());
dbRetention.setDelFlag(true);
//查看是否存在看单之中,如果存在则删除。
List<Long> templateList = customMenuTemplateRepository.findTemplateByOriginal(id, CustomMenuType.RETENTION.getKey());
if (!CollectionUtils.isEmpty(templateList)) {
customMenuTemplateRepository.deleteTemplateByIds(account, templateList);
}
return retentionRepository.save(dbRetention);
}
@Override
public Retention findById(Long id) {
return retentionRepository.findOne(id);
}
@Override
public List<Retention> findByApp(Long app) {
List<Retention> retentionList = retentionRepository.findAllByApp(app);
List<Long> account = new ArrayList<>();
for (Retention f : retentionList) {
account.add(f.getCreateAccount());
}
Iterable<Account> accountList = accountRepository.findAll(account);
Iterator<Account> a = accountList.iterator();
Map<Long, String> idNameMap = new HashMap<>();
while (a.hasNext()) {
Account aObject = a.next();
idNameMap.put(aObject.getId(), aObject.getEmail());
}
for (Retention f : retentionList) {
f.setcAccount(idNameMap.get(f.getCreateAccount()));
}
return retentionList;
}
@Override
public Retention validName(String name, Long app) {
return retentionRepository.findByNameAndApp(name, app);
}
@Override
public Map<String, List> retentionReport(String startDate, String endDate, boolean isList,
String eventInfo, Long app, String usergroup, String dimention,
String reportView, int interval, boolean isDevice, Long account, String retentiontype, boolean isProfile) {
int retentions = 30;
if (reportView.equals("week")) {
retentions = 8;
} else if (reportView.equals("month")) {
retentions = 3;
}
if (DateUtil.compare_date(endDate, DateUtil.getBeforeDays(0)) == 1) {
endDate = DateUtil.getBeforeDays(0);
}
String firstEndDate = endDate;
String secondEndDate = "";
if (reportView.equals("day")) {
secondEndDate = DateUtil.getBeforeDays(endDate, -retentions);
firstEndDate = DateUtil.getBeforeDays(firstEndDate, -1);
String s1 = "";
} else if (reportView.equals("week")) {
secondEndDate = DateUtil.getLastDayOfWeek(DateUtil.getAfterWeeks(endDate, retentions));
} else if (reportView.equals("month")) {
secondEndDate = DateUtil.getLastdayOfMonth(DateUtil.getAfterMonths(endDate, retentions));
}
if (DateUtil.compare_date(secondEndDate, DateUtil.getBeforeDays(0)) == 1) {
secondEndDate = DateUtil.getBeforeDays(0);
}
String secondStartDate = "";
if (reportView.equals("day")) {
secondStartDate = DateUtil.getBeforeDays(startDate, -1);
} else if (reportView.equals("week")) {
String s = "";
secondStartDate = DateUtil.getFirstDayOfWeek(DateUtil.getAfterWeeks(startDate, 1));
} else if (reportView.equals("month")) {
secondStartDate = DateUtil.getFirstdayOfMonth(DateUtil.getAfterMonths(startDate, 1));
}
boolean isCompare = false;
String dimentionKey = dimention;
String sqlTemp = "";
String totalSql = "";
String usergroupName = "";
boolean isUserGroup = false;
App appObject = appRepository.findOne(app);
sqlTemp = chooseVirtualEvent(retentiontype, app, eventInfo, appObject, reportView);
//数据权限过滤
sqlTemp = sqlTemp.replace("$campaign","");
if (!"install".equals(retentiontype)) {
sqlTemp = sqlTemp.replace("$firststartdate", startDate + "");
sqlTemp = sqlTemp.replace("$secondstartdate", secondStartDate);
sqlTemp = sqlTemp.replace("$interval", interval + "");
sqlTemp = sqlTemp.replace("$firstenddate", firstEndDate + "");
sqlTemp = sqlTemp.replace("$secondenddate", secondEndDate + "");
sqlTemp = sqlTemp.replaceAll("xwho", "a.xwho");
sqlTemp = sqlTemp.replaceAll("xwhat", "a.xwhat");
sqlTemp = sqlTemp.replaceAll("xwhen", "a.xwhen");
sqlTemp = sqlTemp.replaceAll(" ds", " a.ds");
sqlTemp = sqlTemp.replaceAll("_deviceid", "a._deviceid");
String dataSource = "";
String[] split = sqlTemp.split(" ");
for (String s : split) {
s.replaceAll(" ", "");
if (s.startsWith("tkio_bigtable_view")) {
dataSource = s;
break;
}
}
Pattern pattern = Pattern.compile("\\$dimentionselect");
Matcher matcher = pattern.matcher(sqlTemp);
sqlTemp = matcher.replaceFirst("\\$firstdimentionselect");
String afterReplace = new String(dataSource + " a \\$joinprofile");
String beforeReplace = new String(dataSource);
sqlTemp = sqlTemp.replaceAll(beforeReplace, afterReplace);
totalSql = new String(sqlTemp);
usergroupName = "";
isUserGroup = false;
if (StringUtil.isEmpty(usergroup)) {
sqlTemp = sqlTemp.replace("$usergroup", "");
totalSql = totalSql.replace("$usergroup", "");
} else {
isCompare = true;
isUserGroup = true;
usergroupName = usergroupRepository.findOne(Long.valueOf(usergroup)).getName();
totalSql = totalSql.replace("$usergroup", "");
sqlTemp = sqlTemp
.replace(
"$usergroup",
String.format(
" and a.xwho in (select objectid as xwho from %s where id='%s' and objecttype='xwho')",
Constant.usergroupTable, usergroup));
}
//if (StringUtil.isEmpty(dimention) || dimention.equals("usergroup")) {
if ("-all".equals(dimention) || "usergroup".equals(dimention)) {
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "");
sqlTemp = sqlTemp.replace("$dimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
sqlTemp = sqlTemp.replace("$joinprofile", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$dimentionselect", "");
totalSql = totalSql.replace("$dimentionwhere", "");
totalSql = totalSql.replace("$dimentionaftergroupby", "");
totalSql = totalSql.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$joinprofile", "");
totalSql = totalSql.replace("$firstdimentionselect", "");
} else {
isCompare = true;
totalSql = totalSql.replace("$dimentionselect", "");
totalSql = totalSql.replace("$dimentionwhere", "");
totalSql = totalSql.replace("$dimentionaftergroupby", "");
totalSql = totalSql.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$joinprofile", "");
totalSql = totalSql.replace("$firstdimentionselect", "");
if (isProfile) {
sqlTemp = sqlTemp.replace("$dimentionselect", "b." + dimention + ",");
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "," + " b." + dimention);
sqlTemp = sqlTemp.replace("$dimentiongroupby", " group by " + dimention);
sqlTemp = sqlTemp.replace("$firstdimentionselect", dimention + ", ");
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
String profileSource = Constant.profileTable + appObject.getAppkey();
sqlTemp = sqlTemp.replace("$joinprofile", "right join " + profileSource + " b on a.xwho=b.xwho");
} else {
sqlTemp = sqlTemp.replace("$dimentionselect", "a." + dimention + ",");
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "," + " a." + dimention);
sqlTemp = sqlTemp.replace("$dimentiongroupby", " group by " + dimention);
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
sqlTemp = sqlTemp.replace("$joinprofile", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", dimention + ", ");
}
}
} else {
sqlTemp = sqlTemp.replace("$firststartdate", startDate + "");
sqlTemp = sqlTemp.replace("$secondstartdate", startDate);
sqlTemp = sqlTemp.replace("$interval", interval + "");
sqlTemp = sqlTemp.replace("$firstenddate", firstEndDate + "");
sqlTemp = sqlTemp.replace("$secondenddate", secondEndDate + "");
sqlTemp = sqlTemp.replaceAll("t0", "a");
sqlTemp = sqlTemp.replaceAll("t1", "b");
totalSql = new String(sqlTemp);
usergroupName = "";
isUserGroup = false;
if (StringUtil.isEmpty(usergroup)) {
sqlTemp = sqlTemp.replace("$usergroup", "");
totalSql = totalSql.replace("$usergroup", "");
} else {
String s;
isCompare = true;
isUserGroup = true;
usergroupName = usergroupRepository.findOne(Long.valueOf(usergroup)).getName();
totalSql = totalSql.replace("$usergroup", "");
sqlTemp = sqlTemp.replace("$usergroup",
String.format(
" and a.xwho in (select objectid as xwho from %s where id='%s' and objecttype='xwho')",
Constant.usergroupTable, usergroup));
}
//if (StringUtil.isEmpty(dimention) || dimention.equals("usergroup")) {
if ("-all".equals(dimention) || "usergroup".equals(dimention)) {
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "");
sqlTemp = sqlTemp.replace("$dimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$dimentionselect", "");
totalSql = totalSql.replace("$dimentionwhere", "");
totalSql = totalSql.replace("$dimentionaftergroupby", "");
totalSql = totalSql.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$firstdimentionselect", "");
} else {
isCompare = true;
totalSql = totalSql.replace("$dimentionselect", "");
totalSql = totalSql.replace("$dimentionwhere", "");
totalSql = totalSql.replace("$dimentionaftergroupby", "");
totalSql = totalSql.replace("$dimentiongroupby", "");
totalSql = totalSql.replace("$firstdimentionselect", "");
if (isProfile) {
sqlTemp = sqlTemp.replace("$dimentionselect", "b." + dimention + ",");
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "," + " b." + dimention);
sqlTemp = sqlTemp.replace("$dimentiongroupby", " group by " + dimention);
sqlTemp = sqlTemp.replace("$firstdimentionselect", dimention + ", ");
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
} else {
sqlTemp = sqlTemp.replace("$dimentionselect", "a." + dimention + ",");
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "," + " a." + dimention);
sqlTemp = sqlTemp.replace("$dimentiongroupby", " group by " + dimention);
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", dimention + ", ");
}
}
}
Map<String, List> result = new HashMap<>();
try {
if (isCompare) {
if (isUserGroup) {
dimentionKey = "usergroup";
}
if ("-all".equals(dimention)) {
sqlTemp = new String(totalSql);
}
// 创建一个线程池
ExecutorService pool = Executors.newFixedThreadPool(2);
// 创建两个有返回值的任务
ReportCallable c1 = new ReportCallable("retention", totalSql, null, startDate, endDate, dimentionKey, isCompare, true,
interval, reportView, null, "", null, null, appObject.getAppkey());
ReportCallable c2 = new ReportCallable("retention", sqlTemp, null, startDate, endDate, dimentionKey, isCompare, false,
interval, reportView, usergroup, usergroupName, null, null, appObject.getAppkey());
// 执行任务并获取Future对象
Future<Map<String, List>> f1 = pool.submit(c1);
Future<Map<String, List>> f2 = pool.submit(c2);
// 从Future对象上获取任务的返回值,并输出到控制台
try {
result = f1.get();
List<Map<String, Object>> val1 = result.get("val");
if (!result.containsKey("isempty") || "usergroup".equals(dimention)) {
Map<String, List> result2 = f2.get();
List<Map<String, Object>> val2 = result2.get("val");
val1.addAll(val2);
}
result.put("val", val1);
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
// 关闭线程池
pool.shutdown();
} else {
Map<String, String> conditions = new HashMap<String, String>();
conditions.put("sql", sqlTemp);
conditions.put("dbtype", "presto");
conditions.put("datatype", "list");
conditions.put("reportname", "retention");
conditions.put("appid", appObject.getAppkey());
Map<String, List> responseJson = reportService.reportBySql(conditions);
result = SqlUtil.format4Retention(responseJson, interval, dimentionKey, reportView, usergroup, usergroupName, null);
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
@Override
public Map<String, List> retentionDetailReport(Account loginAccount, String startDate, String endDate, boolean isList, String eventInfo, Long app,
String usergroup, String dimention, String reportView, int interval, boolean isDevice, String retentiontype, boolean isProfile) {
int retentions = 30;
if (reportView.equals("week")) {
retentions = 8;
} else if (reportView.equals("month")) {
retentions = 3;
}
if (DateUtil.compare_date(endDate, DateUtil.getBeforeDays(0)) == 1) {
endDate = DateUtil.getBeforeDays(0);
}
String firstEndDate = endDate;
String secondEndDate = "";
if (reportView.equals("day")) {
secondEndDate = DateUtil.getBeforeDays(endDate, -retentions);
firstEndDate = DateUtil.getBeforeDays(firstEndDate, -1);
} else if (reportView.equals("week")) {
secondEndDate = DateUtil.getLastDayOfWeek(DateUtil.getAfterWeeks(endDate, retentions));
} else if (reportView.equals("month")) {
secondEndDate = DateUtil.getLastdayOfMonth(DateUtil.getAfterMonths(endDate, retentions));
}
if (DateUtil.compare_date(secondEndDate, DateUtil.getBeforeDays(0)) == 1) {
secondEndDate = DateUtil.getBeforeDays(0);
}
String secondStartDate = "";
if (reportView.equals("day")) {
secondStartDate = DateUtil.getBeforeDays(startDate, -1);
} else if (reportView.equals("week")) {
secondStartDate = DateUtil.getFirstDayOfWeek(DateUtil.getAfterWeeks(startDate, 1));
} else if (reportView.equals("month")) {
secondStartDate = DateUtil.getFirstdayOfMonth(DateUtil.getAfterMonths(startDate, 1));
}
String sqlTemp = "";
App appObject = appRepository.findOne(app);
sqlTemp = chooseVirtualEvent(retentiontype, app, eventInfo, appObject, reportView);
//数据权限过滤
sqlTemp = sqlTemp.replace("$campaign","");
if (!"install".equals(retentiontype)) {
sqlTemp = sqlTemp.replace("$firststartdate", startDate + "");
sqlTemp = sqlTemp.replace("$secondstartdate", secondStartDate);
sqlTemp = sqlTemp.replace("$interval", interval + "");
sqlTemp = sqlTemp.replace("$firstenddate", firstEndDate + "");
sqlTemp = sqlTemp.replace("$secondenddate", secondEndDate + "");
sqlTemp = sqlTemp.replaceAll("xwho", "a.xwho");
sqlTemp = sqlTemp.replaceAll("xwhat", "a.xwhat");
sqlTemp = sqlTemp.replaceAll("xwhen", "a.xwhen");
sqlTemp = sqlTemp.replaceAll(" ds", " a.ds");
sqlTemp = sqlTemp.replaceAll("_deviceid", "a._deviceid");
String dataSource = "";
String[] split = sqlTemp.split(" ");
for (String s : split) {
s.replaceAll(" ", "");
if (s.startsWith("tkio_bigtable_view")) {
dataSource = s;
break;
}
}
Pattern pattern = Pattern.compile("\\$dimentionselect");
Matcher matcher = pattern.matcher(sqlTemp);
sqlTemp = matcher.replaceFirst("\\$firstdimentionselect");
String afterReplace = new String(dataSource + " a \\$joinprofile");
String beforeReplace = new String(dataSource);
sqlTemp = sqlTemp.replaceAll(beforeReplace, afterReplace);
if (StringUtil.isEmpty(usergroup)) {
sqlTemp = sqlTemp.replace("$usergroup", "");
} else {
sqlTemp = sqlTemp
.replace(
"$usergroup",
String.format(
" and a.xwho in (select objectid as xwho from %s where id='%s' and objecttype='xwho')",
Constant.usergroupTable, usergroup));
}
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "");
sqlTemp = sqlTemp.replace("$dimentionselect", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentiongroupby", "");
if (isProfile) {
String profileSource = Constant.profileTable + appObject.getAppkey();
sqlTemp = sqlTemp.replace("$joinprofile", "right join " + profileSource + " b on a.xwho=b.xwho");
} else {
sqlTemp = sqlTemp.replace("$joinprofile", "");
}
if (StringUtil.isEmpty(dimention)) {
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
} else {
JSONObject dimentionObject = JSONObject.fromObject(dimention);
if (dimentionObject.size() > 0) {
String key = dimentionObject.keys().next().toString();
String value = dimentionObject.getString(key);
String type = dimentionObject.getString("type");
if (StringUtil.isEmpty(value)) {
String s1;
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
} else {
String dimentionwhere = StringUtil.getSql(key, value, "in", type, "").trim();
if (isProfile) {
sqlTemp = sqlTemp.replace("$dimentionwhere", String.format(" and b.%s", dimentionwhere));
} else {
sqlTemp = sqlTemp.replace("$dimentionwhere", String.format(" and a.%s", dimentionwhere));
}
}
}
}
} else {
sqlTemp = sqlTemp.replace("$firststartdate", startDate + "");
sqlTemp = sqlTemp.replace("$secondstartdate", startDate);
sqlTemp = sqlTemp.replace("$interval", interval + "");
sqlTemp = sqlTemp.replace("$firstenddate", firstEndDate + "");
sqlTemp = sqlTemp.replace("$secondenddate", secondEndDate + "");
sqlTemp = sqlTemp.replaceAll("t0", "a");
sqlTemp = sqlTemp.replaceAll("t1", "b");
if (StringUtil.isEmpty(usergroup)) {
sqlTemp = sqlTemp.replace("$usergroup", "");
} else {
sqlTemp = sqlTemp.replace("$usergroup",
String.format(
" and a.xwho in (select objectid as xwho from %s where id='%s' and objecttype='xwho')",
Constant.usergroupTable, usergroup));
}
sqlTemp = sqlTemp.replace("$dimentionaftergroupby", "");
sqlTemp = sqlTemp.replace("$dimentionselect", "");
sqlTemp = sqlTemp.replace("$firstdimentionselect", "");
sqlTemp = sqlTemp.replace("$dimentiongroupby", "");
if (StringUtil.isEmpty(dimention)) {
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
} else {
JSONObject dimentionObject = JSONObject.fromObject(dimention);
if (dimentionObject.size() > 0) {
String key = dimentionObject.keys().next().toString();
String value = dimentionObject.getString(key);
String type = dimentionObject.getString("type");
if (StringUtil.isEmpty(value)) {
sqlTemp = sqlTemp.replace("$dimentionwhere", "");
} else {
// value = value.replace(",", "','");
String dimentionwhere = StringUtil.getSql(key, value, "in", type, "").trim();
if (isProfile) {
sqlTemp = sqlTemp.replace("$dimentionwhere", String.format(" and b.%s", dimentionwhere));
} else {
sqlTemp = sqlTemp.replace("$dimentionwhere", String.format(" and a.%s", dimentionwhere));
}
}
}
}
}
if (isDevice) {
sqlTemp = sqlTemp.replace("xwho", "_deviceid");
}
Map<String, String> conditions = new HashMap<String, String>();
conditions.put("sql", sqlTemp);
conditions.put("dbtype", "presto");
conditions.put("datatype", "list");
conditions.put("reportname", "retention");
conditions.put("appid", appObject.getAppkey());
Map<String, List> result = new HashMap<>();
try {
Map<String, List> responseJson = reportService.reportBySql(conditions);
result = SqlUtil.format4DetailList(responseJson, startDate, interval, reportView);
} catch (Exception e) {
List<Map<String, Object>> val = new ArrayList<>();
List<String> columnkey = new ArrayList<>();
result.put("val", val);
result.put("columnkey", columnkey);
result.put("name", columnkey);
e.printStackTrace();
}
return result;
}
private Map<String, List> getRetentionResult(boolean isDetail) {
Map<String, List> result = new HashMap<>();
List<Map<String, Object>> val = new ArrayList<>();
List<String> columnkey = new ArrayList<>();
List<String> name = new ArrayList<>();
if (!isDetail) {
Map<String, Object> map = new HashMap<>();
map.put("ds", "整体");
map.put("init", 0);
map.put("retention1", 0);
map.put("retention2", 0);
map.put("retention3", 0);
map.put("retention4", 0);
map.put("retention5", 0);
map.put("retention6", 0);
map.put("retention7", 0);
map.put("retention14", 0);
map.put("rate_retention30", 0d);
map.put("rate_retention1", 0d);
map.put("rate_retention2", 0d);
map.put("rate_retention3", 0d);
map.put("rate_retention4", 0d);
map.put("rate_retention5", 0d);
map.put("rate_retention6", 0d);
map.put("rate_retention7", 0d);
map.put("rate_retention14", 0d);
map.put("rate_retention30", 0d);
val.add(map);
}
columnkey.add("ds");
columnkey.add("init");
columnkey.add("retention1");
columnkey.add("retention2");
columnkey.add("retention3");
columnkey.add("retention4");
columnkey.add("retention5");
columnkey.add("retention6");
columnkey.add("retention7");
columnkey.add("retention14");
columnkey.add("retention30");
name.add("日期");
name.add("初始日");
name.add("1天后");
name.add("2天后");
name.add("3天后");
name.add("4天后");
name.add("5天后");
name.add("6天后");
name.add("7天后");
name.add("14天后");
name.add("30天后");
result.put("val", val);
result.put("columnkey", columnkey);
result.put("name", name);
result.put("key", name.subList(1, name.size()));
return result;
}
private String chooseVirtualEvent(String retentiontype, Long app, String eventInfo, App appObject, String reportView) {
String s = "";
if (VirtualEventType.ACTIVEEVENT.getCode().equals(retentiontype)) {
List<VirtualEvent> eventList = virtualEventRepository.findEventListByAppIdAndType(app, retentiontype);
if (CollectionUtils.isEmpty(eventList)) {
eventInfo = configparamService.getConfigParamByKey("default_event");
} else {
eventInfo = eventList.get(0).getEventList();
}
s = SqlUtil.generateVirtualRetentionSql(eventInfo, appObject.getAppkey(), reportView);
} else if (VirtualEventType.INSTALEVENT.getCode().equals(retentiontype)) {
List<VirtualEvent> eventList = virtualEventRepository.findEventListByAppIdAndType(app, VirtualEventType.ACTIVEEVENT.getCode());
if (CollectionUtils.isEmpty(eventList)) {
eventInfo = configparamService.getConfigParamByKey("default_event");
} else {
eventInfo = eventList.get(0).getEventList();
}
s = SqlUtil.generateInstallVirtualRetentionSql(eventInfo, appObject.getAppkey(), reportView);
} else {
s = SqlUtil.generateRetentionSql(eventInfo, appObject.getAppkey(), reportView);
}
return s;
}
}
package com.reyun.service.impl;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.reyun.model.SystemParam;
import com.reyun.repository.SystemParamRepository;
import com.reyun.service.SystemParamService;
@Service
@Transactional
public class SystemParamServiceImpl implements SystemParamService {
@Autowired
SystemParamRepository systemParamRepository;
@Override
public SystemParam update(
SystemParam resource,Long account) {
SystemParam set = systemParamRepository.findOne(resource.getId());
if(resource.getCiDay() != 0){
set.setCiDay(resource.getCiDay());
}
if(resource.getCilag() != 0){
set.setCilag(resource.getCilag());
}
if(resource.getClickDay() != 0){
set.setClickDay(resource.getClickDay());
}
if(resource.getInstallDay() != 0){
set.setInstallDay(resource.getInstallDay());
}
if(resource.getNormalclick()!= 0){
set.setNormalclick(resource.getNormalclick());
}
if(resource.getNormalinstall() != 0){
set.setNormalinstall(resource.getNormalinstall());
}
set.setModifyAccount(account);
set.setModifyTime(new Date());
return systemParamRepository.save(set);
}
@Override
public SystemParam find(Long account) {
return systemParamRepository.findByAccount(account);
}
@Override
public SystemParam create(Long account) {
SystemParam systemParam = new SystemParam();
systemParam.setAccount(account);
systemParam.setCiDay(7);
systemParam.setCilag(5);
systemParam.setClickDay(30);
systemParam.setInstallDay(30);
systemParam.setNormalclick(30);
systemParam.setNormalinstall(30);
systemParam.setPubDate(new Date());
return systemParamRepository.save(systemParam);
}
}
package com.reyun.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.reyun.model.Tip;
import com.reyun.repository.TipRepository;
import com.reyun.service.TipService;
@Service
public class TipServiceImpl implements TipService {
@Autowired
TipRepository tipRepository;
@Override
public Map<String, String> findAllByMenu(String menu) {
List<Tip> tips = tipRepository.findAllByMenu(menu);
Map<String, String> result = new HashMap<>();
for (Tip tip : tips) {
result.put(tip.getKey(), tip.getTip());
}
return result;
}
}
package com.reyun.service.impl;
import com.reyun.model.Account;
import com.reyun.model.UserGroup;
import com.reyun.repository.AccountRepository;
import com.reyun.repository.AppRepository;
import com.reyun.repository.EventtableMetadataRepository;
import com.reyun.repository.UserGroupRepository;
import com.reyun.service.AppService;
import com.reyun.service.AuthService;
import com.reyun.service.UserGroupService;
import com.reyun.taskexecute.UserGroupThread;
import com.reyun.util.Constant;
import com.reyun.util.ValidateUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class UserGroupServiceImpl implements UserGroupService {
@Autowired
UserGroupRepository userGroupRepository;
@Autowired
EventtableMetadataRepository eventtableMetadataRepository;
@Autowired
AppRepository appRepository;
@Autowired
AppService appService;
@Autowired
AccountRepository accountRepository;
@Autowired
AuthService authService;
@Override
public UserGroup save(UserGroup userGroup, Long account) {
userGroup.setAccount(account);
userGroup.setCreateAccount(account);
userGroup.setCreateTime(new Date());
userGroup.setStatus(0);
userGroup.setDataUpdateTime(new Date());
Map<String, String> map = this.getSql(userGroup);
String sql = map.get("sql");
userGroup.setQuerySql(sql);
UserGroup save = userGroupRepository.save(userGroup);
UserGroupThread thread = new UserGroupThread(save,false);
thread.start();
return save;
}
@Override
public UserGroup findById(Long id) {
return userGroupRepository.findOne(id);
}
@Override
public boolean refresh(Long id) {
UserGroup findOne = userGroupRepository.findOne(id);
if (findOne.getStatus() == 0) {
return false;
} else {
findOne.setStatus(0);
findOne.setDataUpdateTime(new Date());
UserGroup save = userGroupRepository.save(findOne);
UserGroupThread thread = new UserGroupThread(save,true);
thread.start();
return true;
}
}
@Override
public UserGroup update(UserGroup source, Long account) {
UserGroup userGroup = userGroupRepository.findOne(source.getId());
userGroup.setStartDate(source.getStartDate());
userGroup.setEndDate(source.getEndDate());
userGroup.setEventInfo(source.getEventInfo());
userGroup.setMark(source.getMark());
userGroup.setModifyAccount(account);
userGroup.setModifyTime(new Date());
userGroup.setUserType(source.getUserType());
userGroup.setProfileInfo(source.getProfileInfo());
userGroup.setName(source.getName());
userGroup.setStatus(0);
userGroup.setDataUpdateTime(new Date());
Map<String, String> map = this.getSql(userGroup);
String sql = map.get("sql");
// String bucketStr = map.get("bucketid");
userGroup.setQuerySql(sql);
UserGroup save = userGroupRepository.save(userGroup);
UserGroupThread thread = new UserGroupThread(save,true);
thread.start();
return save;
}
@Override
public List<UserGroup> list(Long appId, Long accountId) {
Account account = accountRepository.findOne(accountId);
Account rootAccount = authService.findRootParentAccount(accountId);
List<Account> children = accountRepository.findByParent(rootAccount.getId());
Map<Long, String> map = new HashMap<>();
Map<Long, String> emailMap = new HashMap<>();
map.put(account.getId(), account.getName());
emailMap.put(account.getId(), account.getEmail());
if (ValidateUtil.isValid(children)) {
for (Account acc : children) {
map.put(acc.getId(), acc.getName());
emailMap.put(acc.getId(), acc.getEmail());
}
}
List<UserGroup> result = userGroupRepository.listByApp(appId);
if (ValidateUtil.isValid(result)) {
for (UserGroup user : result) {
user.setcAccount( !ValidateUtil.isValid(map.get(user.getAccount())) ? emailMap.get(user.getAccount()) : map.get(user.getAccount()));
user.setmAccount(!ValidateUtil.isValid(map.get(user.getModifyAccount())) ? emailMap.get(user.getModifyAccount()) : map.get(user.getModifyAccount()));
user.setNumber(user.getId()*3);
}
}
return result;
}
@Override
public List<UserGroup> list(Long app) {
return userGroupRepository.listByApp(app);
}
@Override
public UserGroup delete(Long id, Long account) {
UserGroup userGroup = userGroupRepository.findOne(id);
userGroup.setModifyAccount(account);
userGroup.setModifyTime(new Date());
userGroup.setDelFlag(true);
UserGroup save = userGroupRepository.save(userGroup);
return save;
}
@Override
public Boolean valid(Long account, Long app, String name) {
UserGroup userGroup = userGroupRepository
.findByName(app, account, name);
Boolean flag = true;
if (userGroup == null) {
flag = false;
}
return flag;
}
@Override
public Map<String, String> getSql(UserGroup userGroup) {
String appkey = appRepository.findAppkeyById(userGroup.getApp());
String startDate = userGroup.getStartDate();
String endDate = userGroup.getEndDate();
String eventInfo = userGroup.getEventInfo();
StringBuilder eventSB = new StringBuilder();
if (ValidateUtil.isValid(eventInfo)) {
JSONObject eventsObj = JSONObject.fromObject(eventInfo);
String eventRelation = eventsObj.getString("relation");
JSONArray eventArray = eventsObj.getJSONArray("events");
List<String> eventNameList = new ArrayList<String>();
for (int i = 0; i < eventArray.size(); i++) {
JSONObject eventObject = eventArray.getJSONObject(i);
String eventName = eventObject.getString("event");
eventNameList.add(eventName);
String proRelation = eventObject.getString("relation");
if (i == 0) {
eventSB.append(
" xwho in ( select xwho from "
+ Constant.eventTable + appkey + " where ")
.append("ds>='").append(startDate)
.append("' and ds<='").append(endDate)
.append("' and xwhat ='").append(eventName)
.append("' ");
} else {
eventSB.append(") ")
.append(eventRelation)
.append(" xwho in ( select xwho from "
+ Constant.eventTable + appkey + " where ")
.append("ds>='").append(startDate)
.append("' and ds<='").append(endDate)
.append("' and xwhat ='").append(eventName)
.append("' ");
}
JSONArray params = eventObject.getJSONArray("params");
if (params.size() > 0) {
for (int j = 0; j < params.size(); j++) {
JSONObject param = params.getJSONObject(j);
String attrName = param.getString("attr");
String typeName = attrName.equals("_cid") ? "number" : param.getString("type");
String values = param.getString("value");
if (param.getString("operator").contains("in")) {
if (typeName.contains("string") || typeName.contains("date")) {
String value = values.replace(",", "','");
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" ('").append(value)
.append("') ");
} else {
eventSB.append(proRelation)
.append(" ")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append("('").append(value)
.append("') ");
}
} else {
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" (").append(values)
.append(") ");
} else {
eventSB.append(proRelation)
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append("(").append(values)
.append(") ");
}
}
} else if (param.getString("operator").contains("between")) {
if (typeName.contains("string") || typeName.contains("date")) {
String value = values.replace(",", "' and '");
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" '").append(value)
.append("' ");
} else {
eventSB.append(proRelation)
.append(" ")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" '").append(value)
.append("' ");
}
} else {
String value = values.replace(",", " and ");
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" ").append(value)
.append(" ");
} else {
eventSB.append(proRelation)
.append(" ")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" ").append(value)
.append(" ");
}
}
} else {
if (typeName.contains("string") || typeName.contains("date")) {
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" '").append(values)
.append("' ");
} else {
eventSB.append(proRelation)
.append(" ")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" '").append(values)
.append("' ");
}
} else {
if (j == 0) {
eventSB.append("and (")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" ").append(values)
.append(" ");
} else {
eventSB.append(proRelation)
.append(" ")
.append(attrName)
.append(" ")
.append(param.getString("operator"))
.append(" ").append(values)
.append(" ");
}
}
}
}
eventSB.append(")");
}
}
}
StringBuilder result = new StringBuilder();
String profileInfo = userGroup.getProfileInfo();
if (ValidateUtil.isValid(profileInfo)) {
JSONObject profileJson = JSONObject.fromObject(profileInfo);
String relation = profileJson.getString("relation");
JSONArray profilesJson = profileJson.getJSONArray("profiles");
// 循环profilesJson获得每个属性的信息
for (int i = 0; i < profilesJson.size(); i++) {
// 数据类型
String type = profilesJson.getJSONObject(i).getString("type");
// 属性名儿
String attr = profilesJson.getJSONObject(i).getString("attr");
// 运算符
String operator = profilesJson.getJSONObject(i).getString(
"operator");
// 属性值
String value = profilesJson.getJSONObject(i).getString("value");
result.append(attr).append(" ").append(operator).append(" ");
/**
* 根据运算符不同拼接不同的sql语句
*/
// = < > >= <= 等直接加上value
if (operator.equals("=") || operator.equals(">")
|| operator.equals("<") || operator.equals(">=")
|| operator.equals("<=")) {
// string date的数据类型需要在值上加‘’
if (type.equals("string") || type.equals("date")) {
result.append("'").append(value).append("'");
} else {
result.append(value);
}
} else if (operator.equals("in") || operator.equals("not in")) {
// 运算符是in not in需要加上(),遍历数组
String[] array = value.split(",");
result.append("(");
// = < > >= <= 等直接加上value
if (type.equals("string") || type.equals("date")) {
for (int j = 0; j < array.length - 1; j++) {
result.append("'").append(array[j]).append("'")
.append(",");
}
result.append("'").append(array[array.length - 1])
.append("'").append(")");
} else {
for (int j = 0; j < array.length - 1; j++) {
result.append(array[j]).append(",");
}
result.append(array[array.length - 1]).append(")");
}
} else if (operator.equals("between")) {
String[] array = value.split(",");
// = < > >= <= 等直接加上value
if (type.equals("date") || type.equals("string")) {
result.append("'").append(array[0]).append(" and ")
.append("'").append(array[1]).append("'");
} else {
result.append(array[0]).append(" and ")
.append(array[1]);
}
}
result.append(" ").append(relation).append(" ");
}
result.delete((result.toString().length())
- (relation.length() + 1), result.toString().length() - 1);
}
// List<String> listBuckets = eventtableMetadataRepository.listBuckets(
// appkey, userGroup.getStartDate(), userGroup.getEndDate(),
// eventNameList);
// String bucketStr = String.join("','", listBuckets);
StringBuilder sqlSB = new StringBuilder();
if (ValidateUtil.isValid(eventInfo)) {
if (!ValidateUtil.isValid(profileInfo)) {
sqlSB.append(
"select xwho from " + Constant.eventTable + appkey
+ " where(").append("_deviceid!='00000000-0000-0000-0000-000000000000' and ").append(eventSB.toString())
.append("))");
} else {
sqlSB.append(
"select xwho from " + Constant.eventTable + appkey
+ " where(").append("_deviceid!='00000000-0000-0000-0000-000000000000' and ")
.append(eventSB.toString())
.append("))")
.append(" and xwho in (select xwho from "
+ Constant.profileTable + appkey + " where ")
.append(" (").append("_deviceid!='00000000-0000-0000-0000-000000000000' and ")
.append(result.toString()).append("))");
}
} else {
sqlSB.append(
"select xwho from " + Constant.profileTable + appkey
+ " where ").append(" ( ").append("_deviceid!='00000000-0000-0000-0000-000000000000' and ")
.append(result.toString()).append(")");
}
String query = sqlSB.toString();
// String sql = query.replace("$", bucketStr);
Map<String, String> map = new HashMap<String, String>();
map.put("sql", query);
// map.put("bucketid", bucketStr);
return map;
}
}
package com.reyun.service.impl;
import com.reyun.model.Account;
import com.reyun.model.App;
import com.reyun.model.UserLog;
import com.reyun.repository.AccountRepository;
import com.reyun.repository.AppRepository;
import com.reyun.repository.UserLogRepository;
import com.reyun.service.UserLogService;
import com.reyun.taskexecute.UserLogThread;
import com.reyun.util.DateUtil;
import com.reyun.util.IPAddrUtil;
import com.reyun.util.StringUtil;
import com.reyun.util.ValidateUtil;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
@Service
public class UserLogServiceImpl implements UserLogService {
protected Logger logger = LoggerFactory.getLogger(UserLogServiceImpl.class);
@Autowired
UserLogRepository userLogRepository;
@Autowired
AccountRepository accountRepository;
@Autowired
AppRepository appRepository;
@Override
public boolean insertLog(Account account, String type, String typeName,
Object content) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, null, null, null);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(Account account, String type, String typeName,
Object content, HttpServletRequest request) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, request, null, null);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(Account account, String type, String typeName,
Object content, Long app, String objectType) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, null, app, objectType);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(HttpServletRequest request, String type, String typeName, Long app, String objectType) {
UserLogThread userLogThread = new UserLogThread("", false, type, typeName, "", request, app, objectType);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(Account account, String type, String typeName,
Object content, Long app, String objectType,HttpServletRequest request) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, request, app, objectType);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(Account account, String type, String typeName,
List content, Long app, String objectType,HttpServletRequest request) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, request, app, objectType);
userLogThread.start();
return true;
}
@Override
public boolean insertLog(Account account, String type, String typeName,
String content, Long app, String objectType,HttpServletRequest request) {
UserLogThread userLogThread = new UserLogThread(account.getEmail(), account.getIsMasterLogin(), type, typeName, content, request, app, objectType);
userLogThread.start();
return true;
}
@Override
public List<UserLog> findUserLogList(String email, String type,
String startDate, String endDate, int pageIndex, int pageSize) {
int start = pageIndex * pageSize;
if (!StringUtil.isEmpty(email) && !StringUtil.isEmpty(type)) {
return userLogRepository.findAllByEmailAndType(email, type, startDate, endDate, start, pageSize);
} else if (!StringUtil.isEmpty(email)) {
return userLogRepository.findAllByEmail(email, startDate, endDate, start, pageSize);
} else if (!StringUtil.isEmpty(type)) {
return userLogRepository.findAllByType(type, startDate, endDate, start, pageSize);
} else {
return userLogRepository.findAll(startDate, endDate, start, pageSize);
}
}
@Override
public BigInteger findUserLogCount(String email, String type,
String startDate, String endDate) {
if (!StringUtil.isEmpty(email) && !StringUtil.isEmpty(type)) {
return userLogRepository.getCount(email, type, startDate, endDate);
} else if (!StringUtil.isEmpty(email)) {
return userLogRepository.getCountByEmail(email, startDate, endDate);
} else if (!StringUtil.isEmpty(type)) {
return userLogRepository.getCountByType(type, startDate, endDate);
} else {
return userLogRepository.getCount(startDate, endDate);
}
}
}
package com.reyun.service.impl;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.reyun.model.UserViewColumn;
import com.reyun.model.ViewColumn;
import com.reyun.repository.UserViewColumnRepository;
import com.reyun.repository.ViewColumnRepository;
import com.reyun.service.IViewColumnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by nolan on 28/12/2016.
* description:
*/
@Service
public class ViewColumnServiceImpl implements IViewColumnService {
@Autowired
private ViewColumnRepository viewColumnRepository;
@Autowired
private UserViewColumnRepository userViewColumnRepository;
public List<ViewColumn> findUserViewColumns(Long accountid) {
List<ViewColumn> itemlist = viewColumnRepository.findAll();
UserViewColumn userViewColumn = userViewColumnRepository.findByAccount(accountid);
if (userViewColumn != null && !Strings.isNullOrEmpty(userViewColumn.getViewcolumn())) {
Iterable<String> viewcolumnList = Splitter.on(",").omitEmptyStrings().trimResults().split(userViewColumn.getViewcolumn());
List<String> fieldCodeList = Lists.newArrayList(viewcolumnList);
for (int i = 0; i < itemlist.size(); i++) {
ViewColumn viewColumn = itemlist.get(i);
if (fieldCodeList.contains(viewColumn.getFieldcode())) {
viewColumn.setIscheck(true);
}
}
}
return itemlist;
}
public void saveUserViewColumn(Long accountid, String viewcolumn) {
UserViewColumn userViewColumn = this.userViewColumnRepository.findByAccount(accountid);
if (userViewColumn == null) {
userViewColumn = new UserViewColumn();
userViewColumn.setAccount(accountid);
userViewColumn.setViewcolumn(viewcolumn);
this.userViewColumnRepository.saveAndFlush(userViewColumn);
} else {
userViewColumn.setViewcolumn(viewcolumn);
this.userViewColumnRepository.saveAndFlush(userViewColumn);
}
}
}
package com.reyun.service.impl;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.reyun.dic.VirtualEventType;
import com.reyun.model.Account;
import com.reyun.model.App;
import com.reyun.model.CommonEvent;
import com.reyun.model.Event4Web;
import com.reyun.model.EventMeta;
import com.reyun.model.VirtualEvent;
import com.reyun.repository.AppRepository;
import com.reyun.repository.CommonEventRepository;
import com.reyun.repository.EventMetaRepository;
import com.reyun.repository.VirtualEventRepository;
import com.reyun.service.CommonParamService;
import com.reyun.service.ConfigParamService;
import com.reyun.service.EventService;
import com.reyun.service.VirtualEventService;
import com.reyun.util.PinYinUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* Created by song on 2017/9/4.
*/
@Service
public class VirtualEventImpl implements VirtualEventService {
private static final String H5_ACTIVE_DEFAULT_EVENT = "h5_default_event";
private static final String NOT_H5_ACTIVE_DEFAULT_EVENT = "default_event";
private static final String H5_APP_PLATFROM = "H5";
private static final String ACTIVE_EVENT_ENG = "vir_active_event";
private static final String ACTIVE_EVENT_CH = "活跃事件";
private static final String PREFIX = "vir_";
private static final String NOT_INCLUDE_EVENT = "install";
@Autowired
private VirtualEventRepository virtualEventRepository;
@Autowired
private ConfigParamService configParamService;
@Autowired
private EventMetaRepository eventMetaRepository;
@Autowired
CommonParamService commonParamService;
@Autowired
EventService eventService;
@Autowired
CommonEventRepository commonEventRepository;
@Autowired
AppRepository appRepository;
@Override
public List<VirtualEvent> findEventList(Long appId, Account account) {
List<VirtualEvent> virtualEventList = virtualEventRepository.findEventListByAppIdAndType(appId, VirtualEventType.ACTIVEEVENT.getCode());
String default_key;
if (CollectionUtils.isEmpty(virtualEventList)) {
String platform = appRepository.findPlatformByAppId(appId);
if (platform.equals(H5_APP_PLATFROM)) {
default_key = configParamService.getConfigParamByKey(H5_ACTIVE_DEFAULT_EVENT);
} else {
default_key = configParamService.getConfigParamByKey(NOT_H5_ACTIVE_DEFAULT_EVENT);
}
VirtualEvent virtualEvent = new VirtualEvent();
virtualEvent.setName(ACTIVE_EVENT_ENG + appId);
virtualEvent.setCh_name(ACTIVE_EVENT_CH);
virtualEvent.setCreateAccount(account.getId());
virtualEvent.setType(VirtualEventType.ACTIVEEVENT.getCode());
virtualEvent.setCreateTime(new Date());
virtualEvent.setModifyTime(new Date());
virtualEvent.setAppId(appId);
virtualEvent.setEventList(default_key);
virtualEventRepository.save(virtualEvent);
}
List<VirtualEvent> eventList = virtualEventRepository.findEventListByAppId(appId);
for (VirtualEvent virtualEvent : eventList) {
String ev = virtualEvent.getEventList();
String s = parseEventList(ev, appId);
virtualEvent.setEventListName(s);
}
return eventList;
}
@Override
public List<Event4Web> findActiveEventList(Long appId, Long activeEventId) {
List<Event4Web> resultList = new ArrayList<>();
App app = appRepository.findOne(appId);
VirtualEvent activeVirtualEvent = virtualEventRepository.findOne(activeEventId);
String[] eventList = activeVirtualEvent.getEventList().split(",");
List<String> eventArrayList = Lists.newArrayList(eventList);
Map<String, EventMeta> eventMetaMap = new HashMap<>();
List<EventMeta> eventMetaList = eventMetaRepository.findByEventIds(app.getAppkey(), eventArrayList);
if (!CollectionUtils.isEmpty(eventMetaList)) {
eventMetaMap = Maps.uniqueIndex(eventMetaList, new Function<EventMeta, String>() {
@Override
public String apply(EventMeta eventMeta) {
return eventMeta.getEventId();
}
});
for (String event : eventArrayList) {
Event4Web event4Web = new Event4Web();
event4Web.setEventName(event);
String alias = eventMetaMap.containsKey(event) ? eventMetaMap.get(event).getAlias() : event;
event4Web.setEventNameAlias(StringUtils.isEmpty(alias) ? event : alias);
resultList.add(event4Web);
}
}
return resultList;
}
@Override
public List<Event4Web> unselectedEvent(Long app) {
List<Event4Web> event4Webs = eventService.listEvent(app);
List<CommonEvent> commonEventList = commonEventRepository.findAll();
Map<String, CommonEvent> commonEventMap = new HashMap<>();
if (!CollectionUtils.isEmpty(commonEventList)) {
commonEventMap = Maps.uniqueIndex(commonEventList, new Function<CommonEvent, String>() {
@Override
public String apply(CommonEvent commonEvent) {
return commonEvent.getEvent();
}
});
}
HashSet<String> eventNameSet = new HashSet<>();
LinkedList<Event4Web> temp = new LinkedList<>();
for (Event4Web event4Web : event4Webs) {
String eventName = event4Web.getEventName();
eventNameSet.add(eventName);
if (!NOT_INCLUDE_EVENT.equals(eventName)) {
temp.add(event4Web);
}
}
if(!appRepository.findPlatformByAppId(app).equals(H5_APP_PLATFROM)) {
String configParamByKey = configParamService.getConfigParamByKey(NOT_H5_ACTIVE_DEFAULT_EVENT);
String[] notSelect = configParamByKey.split(",");
for (String un_event : notSelect) {
if (!eventNameSet.contains(un_event)) {
CommonEvent commonEvent = commonEventMap.get(un_event);
EventServiceImpl eventService = new EventServiceImpl();
Event4Web event4Web = eventService.commonEventTo4Web(commonEvent);
temp.add(event4Web);
}
}
}
return temp;
}
private String parseEventList(String events, Long appId) {
String[] eventList = events.split(",");
List<String> eventArrayList = Lists.newArrayList(eventList);
Map<String, EventMeta> eventMetaMap = new HashMap<>();
App app = appRepository.findOne(appId);
List<EventMeta> eventMetaList = eventMetaRepository.findByEventIds(app.getAppkey(), eventArrayList);
if (!CollectionUtils.isEmpty(eventMetaList)) {
eventMetaMap = Maps.uniqueIndex(eventMetaList, new Function<EventMeta, String>() {
@Override
public String apply(EventMeta eventMeta) {
return eventMeta.getEventId();
}
});
}
StringBuilder str = new StringBuilder();
Map<String, CommonEvent> allCommonEvent = commonParamService.findAllCommonEvent();
for (String event : eventArrayList) {
if (eventMetaMap.containsKey(event) && !StringUtils.isEmpty(eventMetaMap.get(event).getAlias())) {
str.append(eventMetaMap.get(event).getAlias()).append(",");
} else {
CommonEvent commonEvent = allCommonEvent.get(event);
if (commonEvent != null) {
str.append(commonEvent.getAlias()).append(",");
} else {
str.append(event).append(",");
}
}
}
str.deleteCharAt(str.length() - 1);
return str.toString();
}
@Override
public VirtualEvent updateEvent(Long appId, Account account, VirtualEvent virtualEvent) {
VirtualEvent virEvent = virtualEventRepository.findOne(virtualEvent.getId());
virEvent.setEventList(virtualEvent.getEventList());
virEvent.setModifyTime(new Date());
virEvent.setModifyAccount(account.getId());
String type = virtualEvent.getType();
if (type.equals(VirtualEventType.USERDEFINEDEVENT.getCode())) {
virEvent.setCh_name(virtualEvent.getCh_name());
String name_pingYin = PinYinUtil.getPingYin(PREFIX + virtualEvent.getCh_name().replace(" ", "") + "_" + appId);
virEvent.setName(name_pingYin);
}
return virtualEventRepository.save(virEvent);
}
@Override
public VirtualEvent userDefineVirtual(Long appId, VirtualEvent virtualEvent1, Account account) {
String name_pingYin = PinYinUtil.getPingYin(PREFIX + virtualEvent1.getCh_name().replace(" ", "") + "_" + appId);
VirtualEvent virtualEvent = new VirtualEvent();
virtualEvent.setName(name_pingYin);
virtualEvent.setCh_name(virtualEvent1.getCh_name().replace(" ", ""));
virtualEvent.setCreateAccount(account.getId());
virtualEvent.setType(VirtualEventType.USERDEFINEDEVENT.getCode());
virtualEvent.setCreateTime(new Date());
virtualEvent.setAppId(appId);
virtualEvent.setEventList(virtualEvent1.getEventList());
virtualEvent.setEnable(true);
return virtualEventRepository.save(virtualEvent);
}
@Override
public List<VirtualEvent> findCustomEventList(Long appId, Account loginAccount) {
List<VirtualEvent> eventList = virtualEventRepository.findEventListByAppIdAndType(appId, VirtualEventType.USERDEFINEDEVENT.getCode());
for (VirtualEvent virtualEvent : eventList) {
String ev = virtualEvent.getEventList();
String s = parseEventList(ev, appId);
virtualEvent.setEventList(s);
}
return eventList;
}
@Override
public List<VirtualEvent> enableEvent(Long id) {
List<VirtualEvent> eventListById = virtualEventRepository.findEventListById(id);
for (VirtualEvent virtualEvent : eventListById) {
virtualEvent.setEnable(true);
}
return eventListById;
}
@Override
public List<VirtualEvent> disableEvent(Long id) {
List<VirtualEvent> eventListById = virtualEventRepository.findEventListById(id);
for (VirtualEvent virtualEvent : eventListById) {
virtualEvent.setEnable(false);
}
return eventListById;
}
/**
* 查询虚拟事件
* @param virtualEventId
* @return
*/
@Override
public String findVirtualEvents(String virtualEventId) {
String result = "";
VirtualEvent virtualEvent = virtualEventRepository.findVirtualEventByEventId(virtualEventId);
if(null != virtualEvent){
result = "'" + virtualEvent.getEventList().replace(",", "','") + "'";
}
return result;
}
@Override
public List<String> findVirtualEventList(String virtualEventId) {
VirtualEvent virtualEvent = virtualEventRepository.findVirtualEventByEventId(virtualEventId);
if(null != virtualEvent){
return Arrays.asList(virtualEvent.getEventList().split(","));
}
return new ArrayList<String>();
}
@Override
public VirtualEvent getVirtualEvent(String appKey, String eventChName) {
return virtualEventRepository.findVirtualEventByChName(appKey, eventChName);
}
}
package com.reyun.taskexecute;
import com.reyun.context.AppUtils;
import com.reyun.model.UserGroup;
import com.reyun.service.ReportService;
import com.reyun.util.Constant;
import com.reyun.util.DBUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UserGroupThread extends Thread {
protected static Logger logger = LoggerFactory.getLogger(UserGroupThread.class);
private ReportService reportService = AppUtils.getApplicationContext().getBean(ReportService.class);
private UserGroup userGroup;
private Boolean isExist;
public UserGroupThread(UserGroup userGroup, Boolean isExist) {
super();
this.userGroup = userGroup;
this.isExist = isExist;
}
@Override
public void run() {
if (isExist) {
String deleteSql = "ALTER TABLE " + Constant.usergroupTable + " DROP IF EXISTS PARTITION(id = '"
+ userGroup.getId() + "')";
Map<String, String> deleteCondition = new HashMap<String, String>();
deleteCondition.put("sql", deleteSql);
deleteCondition.put("dbtype", "hive");
reportService.execute(deleteSql);
}
String querySql = userGroup.getQuerySql();
String insertSql = "INSERT into " + Constant.usergroupTable + " select DISTINCT(xwho),'xwho','"
+ userGroup.getId() + "' from (" + querySql + ") t;";
//String deviceSql = insertSql.replace("xwho", "_deviceid");
String sql = "SELECT count(objectid) as number from " + Constant.usergroupTable + " where id = '"
+ userGroup.getId() + "' and objecttype='xwho'";
//String query = insertSql + deviceSql + sql;
String query = insertSql + sql;
Map<String, String> conditions = new HashMap<String, String>();
conditions.put("sql", query);
conditions.put("dbtype", "presto");
conditions.put("datatype", "list");
Map<String, List> result = reportService.reportBySql(conditions);
Long number = 0L;
if (result.containsKey("val")) {
List<Map<String, Object>> valList = result.get("val");
for (int i = 0; i < valList.size(); i++) {
Map<String, Object> ob = valList.get(i);
number = Long.valueOf(ob.get("number").toString());
}
}
try {
updateNumber(number, userGroup.getId());
} catch (SQLException e1) {
try {
updateStaus(2, userGroup.getId());
} catch (SQLException e) {
logger.error(e.getMessage(), e);
}
logger.error(e1.getMessage(), e1);
}
try {
updateStaus(1, userGroup.getId());
} catch (SQLException e) {
logger.error(e.getMessage(), e);
}
}
private static void updateStaus(int status, Long id) throws SQLException {
String sql = "update user_group set status = " + status + " where id = " + id;
Connection conn = DBUtil.newInstance().getConn();
Statement statement = conn.createStatement();
statement.executeUpdate(sql);
if (statement != null) {
statement.close();
}
if (conn != null) {
conn.close();
}
}
private static void updateNumber(Long number, Long id) throws SQLException {
String sql = "update user_group set number = " + number + " where id = " + id;
Connection conn = DBUtil.newInstance().getConn();
Statement statement = conn.createStatement();
statement.executeUpdate(sql);
if (statement != null) {
statement.close();
}
if (conn != null) {
conn.close();
}
}
}
package com.reyun.taskexecute;
import com.reyun.context.AppUtils;
import com.reyun.model.App;
import com.reyun.model.UserLog;
import com.reyun.repository.AppRepository;
import com.reyun.repository.UserLogRepository;
import com.reyun.service.impl.UserLogServiceImpl;
import com.reyun.util.DateUtil;
import com.reyun.util.IPAddrUtil;
import com.reyun.util.ValidateUtil;
import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
* Created by zxy on 2017/12/15.
*/
public class UserLogThread extends Thread
{
protected Logger logger = LoggerFactory.getLogger(UserLogThread.class);
private AppRepository appRepository = AppUtils.getApplicationContext().getBean(AppRepository.class);
private UserLogRepository userLogRepository = AppUtils.getApplicationContext().getBean(UserLogRepository.class);
private String type;
private String email;
private boolean isMasterLogin;
private String operaType;
private String operaContent;
private Object content;
private List contentList;
private String contentStr;
private Long app;
private String appName;
private String objectType;
private HttpServletRequest request;
/**
* 传入内容为对象
* @param email
* @param isMasterLogin
* @param type
* @param operaType
* @param content
* @param request
* @param app
* @param objectType
*/
public UserLogThread(String email, boolean isMasterLogin, String type, String operaType, Object content, HttpServletRequest request, Long app, String objectType)
{
this.type = type;
this.email = email;
this.isMasterLogin = isMasterLogin;
this.operaType = operaType;
this.content = content;
this.app = app;
this.objectType = objectType;
this.request = request;
}
/**
* 传入内容为列表
* @param email
* @param isMasterLogin
* @param type
* @param operaType
* @param content
* @param request
* @param app
* @param objectType
*/
public UserLogThread(String email, boolean isMasterLogin, String type, String operaType, List content, HttpServletRequest request, Long app, String objectType)
{
this.type = type;
this.email = email;
this.isMasterLogin = isMasterLogin;
this.operaType = operaType;
this.contentList = content;
this.app = app;
this.objectType = objectType;
this.request = request;
}
/**
* 传入内容为字符串
* @param email
* @param isMasterLogin
* @param type
* @param operaType
* @param content
* @param request
* @param app
* @param objectType
*/
public UserLogThread(String email, boolean isMasterLogin, String type, String operaType, String content, HttpServletRequest request, Long app, String objectType)
{
this.type = type;
this.email = email;
this.isMasterLogin = isMasterLogin;
this.operaType = operaType;
this.contentStr = content;
this.app = app;
this.objectType = objectType;
this.request = request;
}
@Override
public void run()
{
try
{
if (this.content != null) {
System.out.println(this.content);
this.operaContent = JSONObject.fromObject(this.content).toString();
} else if (this.contentList != null) {
System.out.println(this.contentList);
this.operaContent = JSONArray.fromObject(this.contentList).toString();
} else if (this.contentStr != null) {
System.out.println(this.contentStr);
this.operaContent = this.contentStr;
}
UserLog audit = new UserLog();
audit.setEmail(this.email);
audit.setMasterLogin(this.isMasterLogin);
if (this.app != null) {
App appObject = appRepository.findOne(this.app);
audit.setApp(this.app);
audit.setAppName(appObject.getName());
}
audit.setObjectType(this.objectType);
audit.setPubDate(new Date());
audit.setDs(DateUtil.format(new Date()));
audit.setOperaContent(this.operaContent);
if (this.request != null) {
String ipAddr = IPAddrUtil.getIpAddrNew(request);
audit.setIp(ipAddr);
if(ValidateUtil.isValid(ipAddr)){
String locationFromIpAddr = IPAddrUtil.getLocationFromIpAddr(ipAddr);
audit.setLocation(locationFromIpAddr);
}
}
audit.setOperaType(this.operaType);
audit.setType(type);
userLogRepository.save(audit);
} catch (Exception e) {
e.printStackTrace();
}
}
}
package com.reyun.util;
/**
* Created by nolan on 15/11/2016.
* description:
*/
public class ResultModel {
/**
* 返回码
*/
private int code;
/**
* 返回结果描述
*/
private String message;
/**
* 返回内容
*/
private Object content;
public ResultModel(int code, String message) {
this.code = code;
this.message = message;
this.content = "";
}
public ResultModel(int code, String message, Object content) {
this.code = code;
this.message = message;
this.content = content;
}
public ResultModel(ResultStatus status) {
this.code = status.getCode();
this.message = status.getMessage();
this.content = "";
}
public ResultModel(ResultStatus status, Object content) {
this.code = status.getCode();
this.message = status.getMessage();
this.content = content;
}
public static ResultModel OK(Object content) {
return new ResultModel(ResultStatus.SUCCESS, content);
}
public static ResultModel OK() {
return new ResultModel(ResultStatus.SUCCESS);
}
public static ResultModel ERROR(ResultStatus error) {
return new ResultModel(error);
}
public int getCode() {
return code;
}
public String getMessage() {
return message;
}
public Object getContent() {
return content;
}
}
\ No newline at end of file
package com.reyun.util;
/**
* Created by nolan on 15/11/2016.
* description:
*/
public enum ResultStatus {
SUCCESS(200, "成功"),
FAILED(-200, "失败"),
NUMBER_LIMIT(-300, "超过限定值,无法添加"),
NETWORK_ERROR(404, "网络异常"),
PARAM_INVALID(-1000, "参数错误"),
USERNAME_OR_PASSWORD_ERROR(-1001, "用户名或密码错误"),
USERNAME_LOGIN_EXPIRE(-1002, "用户登陆失效"),
SUB_ACCOUNT_DISABLE(-1003, "子帐号已禁用"),
ORIGINAL_ACCOUNT_DISABLE(-1004, "主体帐号已禁用"),
ACCOUNT_BUSINESS_EXPIRE(-1005, "主帐号已过期"),
ACCOUNT_NOT_CONFIRM(-1006, "帐号待审核"),
APP_DEL(-1007, "应用已被删除"),
AUTH_ACCOUNT_BUSINESS_EXPIRE(-1008, "授权帐号已过期"),
ONELINK_OCCUPY(-1009, "onelink占用推广活动"),
ACCOUNT_NOT_ACTIVATE(-1010, "账号未激活"),
USER_NOT_AUTH(-2000, "功能未授权"),
CAMPAIGN_CREATEING(-3000, "推广活动正在创建中, 请勿重复提交"),
ID_NOT_EXIST(-4000, "对应ID的记录不存在"),
EXPORT_DATA_EXIST(-5000, "导出记录已存在"),
EXPORT_FILE_EXIST(-5001, "导出文件不存在"),
RECORD_EXIST(-6000, "记录已存在,请勿重复提交"),
NAME_EXIST(-6001, "名称已存在"),
EVENT_NULL(-6002, "事件为空"),
FILE_TYPE_ERROR(-6003, "文件格式错误"),
CAMPAIGN_OCCUPY(-1010, "推广活动占用渠道"),
NAME_NULL(-1101, "名称为空"),
NAME_INVAILD(-1102, "名称不合法"),
CAMPAIGN_NOT_MATCH_APP(-1103, "推广活动与应用不匹配"),
SURL_NULL(-1105, "短链为空"),
CAMPAIGN_NULL(-1106, "推广活动不存在"),
CAMPAIGN_EXISTS(-1107, "此分包渠道的活动已存在"),
CAMPAIGN_REPEAT(-1008,"批量创建推广活动时名称重复"),
MSG_SMS_OUTOFTIME(-4001, "验证码过时,重新获取"),
MSG_SMS_REQUESTTIMES(-4002, "今天请求验证码次数过多"),
MSG_SMS_IPREQUESTTIMES(-4003, "IP地址请求过多"),
MSG_SMS_IPERROR(-4004, "未知ip达到峰值"),
MSG_SMS_WRONG(-4005, "验证码不正确"),
CHANNELACCOUNT_NOEXIST(-5001, "渠道帐号不存在"),
CHANNEL_ALIASNAME_EXIST(-5002, "该名称系统已存在"),
CHANNELACCOUNT_EXIST(-5003, "该账号ID已创建投放账号,不可重复创建"),
CHANNEL_LINKID_NOEXIST(-5004, "link_id不存在"),
COMMON_IP_EXISTS(-7000, "公共ip已存在"),
EXP_INVALID(11000, "自定义表达式错误");
/**
* 返回码
*/
private int code;
/**
* 返回结果描述
*/
private String message;
ResultStatus(int code, String message) {
this.code = code;
this.message = message;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
\ No newline at end of file
package com.reyun.util;
import org.apache.commons.lang.StringUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class ShortUrl {
public static String[] generateCode(String url) {
String key = "Binjoo"; // 网址的混合KEY
String[] chars = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
"W", "X", "Y", "Z" };
String hex = toMd5(key + url);// 对传入网址和混合KEY进行MD5加密
String[] resUrl = new String[4];
for (int i = 0; i < 4; i++) {
// 把加密字符按照8位一组16进制与0x3FFFFFFF进行位与运算
String sTempSubString = hex.substring(i * 8, i * 8 + 8);
long lHexLong = 0x3FFFFFFF & Long.parseLong(sTempSubString, 16);
String outChars = "";
for (int j = 0; j < 6; j++) {
// 把得到的值与 0x0000003D 进行位与运算,取得字符数组 chars 索引
long index = 0x0000003D & lHexLong;
// 把取得的字符相加
outChars += chars[(int) index];
// 每次循环按位右移 5 位
lHexLong = lHexLong >> 5;
}
resUrl[i] = outChars;
}
return resUrl;
}
public static String[] generateCodeN(String url, int length) {
String key = "REYUN!@#"; // 网址的混合KEY
String[] chars = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
"K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
"W", "X", "Y", "Z" };
String hex = toMd5(key + url);// 对传入网址和混合KEY进行MD5加密
System.out.println(hex);
hex = hex + CharacterUtils.getRandomString(length*8);
String[] resUrl = new String[length];
for (int i = 0; i < length; i++) {
// 把加密字符按照8位一组16进制与0x3FFFFFFF进行位与运算
String sTempSubString = hex.substring(i * 8, i * 8 + 8);
long lHexLong = 0x3FFFFFFF & Long.parseLong(sTempSubString, 16);
String outChars = "";
for (int j = 0; j < 7; j++) {
// 把得到的值与 0x0000003D 进行位与运算,取得字符数组 chars 索引
long index = 0x0000003D & lHexLong;
// 把取得的字符相加
outChars += chars[(int) index];
// 每次循环按位右移 5 位
lHexLong = lHexLong >> 5;
}
resUrl[i] = outChars;
}
return resUrl;
}
private static String toMd5(String arg) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(arg.getBytes());
byte b[] = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length; offset++) {
i = b[offset];
if (i < 0)
i += 256;
if (i < 16)
buf.append("0");
buf.append(Integer.toHexString(i));
}
return buf.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
public static void main(String[] args) {
String[] result = generateCodeN("zhangxiaoyan@reyun.comAASJJHDMFHBbjdBDFHJDNFHDFF", 10);
System.out.println(result.length);
System.out.println(StringUtils.join(result,","));
}
}
package com.reyun.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class ShortUrlGenerator {
public static String[] beshort(String url, int len) {
String key = "reyun";
String[] chars = new String[] { "a", "b", "c", "d", "e", "f", "g", "h",
"i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H",
"I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z"
};
// �Դ�����ַ���� MD5 ����
String sMD5EncryptResult = HashAlgorithms.MD5(key + url);
String hex = sMD5EncryptResult;
String[] resUrl = new String[4];
for (int i = 0; i < 4; i++) {
String sTempSubString = hex.substring(i * 8, i * 8 + 8);
long lHexLong = 0x3FFFFFFF & Long.parseLong(sTempSubString, 16);
String outChars = "";
for (int j = 0; j < len; j++) {
long index = 0x0000003D & lHexLong;
outChars += chars[(int) index];
lHexLong = lHexLong >> 1;
}
resUrl[i] = outChars;
}
return resUrl;
}
/**
* @param args
*/
public static void main(String[] args) {
// String sLongUrl = "yybaby" ;
// String[] aResult;
// //
//
// for ( int i = 1; i <= 26 ; i++) {
// aResult = shortUrl (sLongUrl+i);
// System. out .println( "[" + i + "]-->" + aResult[1]);
// }
String dateStr = DateUtil
.getCurrentDateStr(DateUtil.C_TIME_PATTON_DEFAULT);
String username = "test@126.com";
String appname = "hulai";
// String plattype = "andriod";
String key = ShortUrlGenerator
.beshort(username + appname + dateStr, 6)[0];
// String key = Md5(username+appname+dateStr);
// System.out.println(key);
// System.out.println(key.length());
System.out.println(md5("f7riea"));
System.out.println(md5("jBqFuE"));
System.out.println(md5("vERUZY"));
System.out.println(md5("7rEQU3"));
System.out.println(md5("qje6NU"));
System.out.println(md5("eab6MU"));
System.out.println(md5("uERyne"));
System.out.println(md5("FQU3mf"));
}
public static String md5(String plainText) {
String key = "reyun";
plainText = plainText + key;
String result = null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes());
byte b[] = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length; offset++) {
i = b[offset];
if (i < 0)
i += 256;
if (i < 16)
buf.append("0");
buf.append(Integer.toHexString(i));
}
result = buf.toString(); // md5 32bit
// result = buf.toString().substring(8, 24))); //md5 16bit
// result = buf.toString().substring(8, 24);
// //System.out.println("mdt 16bit: " + buf.toString().substring(8,
// 24));
// //System.out.println("md5 32bit: " + buf.toString() );
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return result;
}
}
package com.reyun.util;
import com.reyun.context.AppUtils;
import com.reyun.model.Event4Web;
import com.reyun.service.EventService;
import com.reyun.service.EventStatsService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.StringUtils;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by zxy on 2017/9/14.
*/
public class SizheTool {
public Map getMap() {
Map<String, String> map = new HashedMap();
map.put("注册", "reged");
map.put("app", "app");
map.put("campaign", "campaign");
return map;
}
public static void main(String[] args) {
SizheTool tool = new SizheTool();
try {
List<String> list = jisuanStr("(注册1.country.count+app.country.count)*3-campaign.count/campaign.countuser", tool.getMap());
String str = StringUtils.join(list.toArray());
System.out.println(str);
} catch (Exception e) {
System.out.println("请检查你的算式格式");
e.printStackTrace();
}
}
/**
* 计算<br>
* 步骤:1、如果有括号<br>
* 然后取上一个最近的(坐标 计算当前括号组合里的算式 ),在继续往下查找括号 以此类推,直至循环使用到所有坐标元素
* 计算完毕(运算顺序括号、乘除、加减)
*
* @param str
* @return
*/
public static List<String> jisuanStr(String str, Map<String, String> map) throws Exception {
double returnDouble = 0;
// List<String> listSplit = splitStr(str); // 拆分好的元素
List<String> listSplitResult = new ArrayList<String>();
List<String> listSplit = new ArrayList<String>();
Matcher matcher = Pattern.compile("\\-?[\\w\\u4e00-\\u9fa5()]+(\\.[\\w\\u4e00-\\u9fa5()]+){1,2}|[+*/()]|\\-|\\d")
.matcher(str);// 用正则拆分成每个元素
Pattern p1 = Pattern.compile("\\-?\\d+(\\.\\d+)?|[+*/()]|\\-");
while (matcher.find()) {
String mid = matcher.group(0);
System.out.println(mid + "------" + p1.matcher(mid).matches());
if (p1.matcher(mid).matches()) {
listSplitResult.add(mid);
listSplit.add(mid);
}
else {
String[] arrays = mid.split("\\.");
StringBuffer sb = new StringBuffer();
boolean isNegative = false;
if (arrays.length > 1) {
if (arrays[0].startsWith("-")) {
isNegative = true;
if (map.get(arrays[0].substring(1)) == null) {
throw new Exception();
}
sb.append("-" + map.get(arrays[0].substring(1)));
} else {
if (map.get(arrays[0]) == null) {
throw new Exception();
}
sb.append(map.get(arrays[0]));
}
}
for (int i=1; i<arrays.length; i++) {
sb.append(".").append(arrays[i]);
}
listSplitResult.add(sb.toString());
if (isNegative) {
listSplit.add("-1");
} else {
listSplit.add("1");
}
}
System.out.println(listSplit);
// listSplit.add(matcher.group(0));
}
System.out.println(listSplit);
List<Integer> zKuohaoIdxList = new ArrayList<Integer>();// 左括号,<所在坐标,>
if (Pattern.compile(".*\\(|\\).*").matcher(str).find()) {// 如果包含括号运算
String value = "";// 单个字符值
int zIdx = 0;// 上一个左括号在zKuoHaoIdxList的下标
// 此层循环计算完所有括号里的算式
List<String> tempList = new ArrayList<String>();// 前面没有计算的元素
int removeL = 0;
int tempListSize = 0;
for (int i = 0; i < listSplit.size(); i++) {
value = listSplit.get(i);
tempList.add(value);
tempListSize = tempList.size();
if ("(".equals(value)) {// 左括号
zKuohaoIdxList.add(tempListSize-1);
} else if (")".equals(value)) {// 遇到右括号就计算与上一左括号间的算式
zIdx = zKuohaoIdxList.size() - 1;// 离当前右括号最近的左括号配对
int start = zKuohaoIdxList.get(zIdx);
returnDouble = jisuan(tempList, start + 1, tempListSize-1); // 开始位置,就是上一个左括号
removeL = tempListSize - start;
tempList = removeUseList(tempList, removeL);// 移除已使用的元素
tempList.add(returnDouble + "");// 刚刚计算的值添加进来
zKuohaoIdxList.remove(zIdx);// 计算完毕清除括号
}
}
// 把所有计算完
returnDouble = jisuan(tempList, 0, tempList.size());
} else {// 没有括号运算
returnDouble = jisuan(listSplit, 0, listSplit.size());
}
System.out.println(returnDouble);
return listSplitResult;
}
/**
* 倒序删除已用过的元素
*
* @param list
* @param removeLength
* 数量
* @return
*/
public static List<String> removeUseList(List<String> list, int removeLength) {
int le = list.size() - removeLength;
for (int i = list.size() - 1; i >= le; i--) {
list.remove(i);
}
return list;
}
/**
* 计算算式
*
* @param listSplit
* @param start
* 括号算式开始符位置
* @param end
* 括号结束符位置
* @return
*/
public static double jisuan(List<String> listSplit, int start, int end)
throws Exception {
double returnValue = 0;
String strValue = null;// 临时变量
List<String> jjValueList = new ArrayList<String>();// 剩下的加减元素
// 遍历计算乘除法
for (int i = start; i < end; i++) {
strValue = listSplit.get(i);
if ("*".equals(strValue) || "/".equals(strValue)) {// 乘除
strValue = jisuanValue("*".equals(strValue) ? "*" : "/", Double
.parseDouble(jjValueList.get(jjValueList.size() - 1)),
Double.parseDouble(listSplit.get(i + 1)))
+ "";
jjValueList.remove(jjValueList.size() - 1);
i++;
}
jjValueList.add(strValue);
}
// 遍历计算加减
for (int j = 0; j < jjValueList.size(); j++) {
strValue = jjValueList.get(j);
if ("-".equals(strValue) || "+".equals(strValue)) {
returnValue = jisuanValue("-".equals(strValue) ? "-" : "+",
returnValue, Double.parseDouble(jjValueList.get(j + 1)));
j++;
} else {
returnValue += Double.parseDouble(jjValueList.get(j));
}
}
return returnValue;
}
/**
* 计算2个数间的加减乘除操作 如:2*5 ,2/5
*
* @param type
* 运算符
* @param start
* 数 相当于上面2
* @param end
* 被数 相当于上面5
* @return
*/
public static double jisuanValue(String type, double start, double end)
throws Exception {
double d = 0;
if ("-".equals(type)) {
d = start - end;
} else if ("+".equals(type)) {
d = start + end;
} else if ("*".equals(type)) {
d = start * end;
} else if ("/".equals(type)) {
if (0 == start || 0 == end)
d = 0;
else
d = start / end;
}
return d;
}
}
package com.reyun.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.reyun.model.EventViewAttr;
import com.reyun.model.IntelligentPath;
import com.reyun.model.ReportListResult;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.springframework.util.StringUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SqlUtil
{
private final static String VIEW_DAY = "day";
private final static String VIEW_WEEK = "week";
private final static String VIEW_MONTH = "month";
public static String generateFunnelSqlTemp(String eventinfo, String appid, int window)
{
JSONArray eventArray = JSONArray.fromObject(eventinfo);
StringBuffer funnelEventsSB = new StringBuffer();
StringBuffer paramsSB = new StringBuffer();
List<String> events = new ArrayList<>();
String firstEvent = "";
String firstParam = "";
for (int i = 0; i < eventArray.size(); i++) {
JSONObject event = eventArray.getJSONObject(i);
String name = event.getString("event");
if (i == 0) {
firstEvent = name;
}
else {
events.add(name);
}
funnelEventsSB.append(String.format("%s%s", i == 0 ? "" : ",", name));
if (event.containsKey("params")) {
JSONArray paramArray = event.getJSONArray("params");
if (paramArray.size() > 0) {
String relation = event.getString("relation");
StringBuffer param1EventSB = i == 0 ? new StringBuffer() : new StringBuffer(String.format(" and case when xwhat='%s' then ", name));
param1EventSB = getEventParamStringBuffer(param1EventSB, paramArray, relation);
if (i == 0) {
firstParam = param1EventSB.toString();
}
else {
paramsSB.append(param1EventSB).append(" else 1=1 end");
}
}
}
}
return String.format("select $dimentionselect ld_sum(temp, %s) "
+ "from ( "
+ "select $dimentionselect ld_count(xwhen, $interval, %s*86400, $startdatetime, xwhat, '%s') as temp "
+ "from %s "
+ "where _deviceid!='00000000-0000-0000-0000-000000000000' and ds >= '$startdate' $dimentionwhere $usergroup and "
+ "( "
+ "(xwhat = '%s' and ds < '$firstenddate' %s) "
+ "or "
+ "(xwhat in ('%s') and ds <= '$secondenddate' %s) "
+ ") "
+ "group by xwho $dimentionaftergroupby"
+ ") $dimentiongroupby",
eventArray.size(), window, funnelEventsSB, Constant.eventTable + appid, firstEvent,
StringUtil.isEmpty(firstParam) ? "" : " and (" + firstParam + ")",
String.join("','", events), paramsSB.length() > 0 ? paramsSB : "");
}
/**
* 生成事件概览SQL
* created by sunhao 2017-04-11
* <p>
* 参数模板中参数:
* $groupFieldSql 分类维度中需要group的字段
* $selectDate 查询时间粒度
* $startData 开始时间
* $endDate 结束时间
* $whereFieldSql 分类维度中的字段值
*/
public static String generateEventStatsSqlTemplate(String eventCondition, String appKey, Map<String, EventViewAttr> eventViewAttrMap)
{
final String eventTable = Constant.eventTable + appKey;
StringBuilder sqlWhere = new StringBuilder();
sqlWhere.append(" 1 = 1 ");
JSONObject conditionObject = JSONObject.fromObject(eventCondition);
String eventName = conditionObject.getString("event");
String relation = conditionObject.getString("relation");
/**
* 分类维度参数:
* viewField 显示字段
* filedOperate 字段操作
* {"viewField":"_payment","fieldOperate":"_min"}
* eg:
* 显示字段 xwho _payment
* 总次数 count(*)
* 总人数 count(distinct xwho )
* 人均总数 count(*)/count(distinct xwho )
* 总和 sum(x)
* 均值 avg(x)
* 最大值 max(x)
* 最小值 min(x)
*
*/
String viewField = conditionObject.getString("viewField");
String fieldOperate = conditionObject.getString("fieldOperate");
/**
* 选择默认显示属性,{"viewField":"_count","fieldOperate":""}
* 选择自定义属性, {"viewField":"_payment","fieldOperate":"_min"}
*/
if (StringUtil.isEmpty(fieldOperate)) {
EventViewAttr eventViewAttr = eventViewAttrMap.get(viewField);
fieldOperate = null != eventViewAttr ? eventViewAttr.getAttrType() : null;
viewField = "xwho";
}
else {
EventViewAttr eventViewAttr = eventViewAttrMap.get(fieldOperate);
fieldOperate = null != eventViewAttr ? eventViewAttr.getAttrType() : null;
}
//属性
JSONArray paramArray = (JSONArray) conditionObject.get("params");
if (null != paramArray) {
//构建属性条件
for (int i = 0; i < paramArray.size(); i++) {
JSONObject attr = paramArray.getJSONObject(i);
String attrName = attr.getString("attr");
String attrType = attr.getString("type");
String attrValue = attr.getString("value");
String attrOperate = attr.getString("operator");
sqlWhere.append(String.format("%s %s", i == 0 ? "and " : relation, StringUtil.getSql(attrName, attrValue, attrOperate, attrType, "")));
}
}
//参数校验
if (StringUtil.isEmpty(fieldOperate) || StringUtil.isEmpty(eventTable) || StringUtil.isEmpty(eventName)) {
return null;
}
//聚合字段
String operateField = String.format(fieldOperate, viewField);
//返回结果
return String.format("select $selectDate as ds, %s as sumData $selectFieldSql " +
" from %s " +
" where $campaign _deviceid != '00000000-0000-0000-0000-000000000000' and xwhat = '%s' and ds >= '$startData' and ds <= '$endDate' and (%s) $whereFieldSql " +
" group by $selectDate $groupFieldSql order by ds desc , sumData desc",
operateField,
eventTable,
eventName,
sqlWhere.toString());
}
private static int getRetentions(String reportView)
{
int retentionInterval;
switch (reportView) {
case VIEW_WEEK:
retentionInterval = 8;
break;
case VIEW_MONTH:
retentionInterval = 3;
break;
default:
retentionInterval = 30;
break;
}
return retentionInterval;
}
public static String generateRetentionSql(String eventinfo, String appid, String reportView)
{
int retentionInterval = getRetentions(reportView);
JSONArray eventArray = JSONArray.fromObject(eventinfo);
StringBuffer whereSB = new StringBuffer(" where ");
whereSB.append(String.format("(", appid));
String events = "";
for (int i = 0; i < eventArray.size(); i++) {
JSONObject event = eventArray.getJSONObject(i);
String name = event.getString("event");
events += i == 0 ? name : "," + name;
StringBuffer param1EventSB = new StringBuffer();
if (event.containsKey("params")) {
JSONArray paramArray = event.getJSONArray("params");
if (paramArray.size() > 0) {
String relation = event.getString("relation");
param1EventSB.append(" and (");
param1EventSB = getEventParamStringBuffer(param1EventSB, paramArray, relation);
param1EventSB.append(")");
}
}
if (i == 0) {
whereSB.append(String.format(" ( $campaign _deviceid!='00000000-0000-0000-0000-000000000000' and ds>='$firststartdate' and ds < '$firstenddate' and xwhat = '%s' %s)",
name, param1EventSB.length() > 0 ? param1EventSB : ""));
}
else {
whereSB.append(String.format(" or ($campaign _deviceid!='00000000-0000-0000-0000-000000000000' and ds >= '$secondstartdate' and ds <= '$secondenddate' and xwhat = '%s' %s)",
name, param1EventSB.length() > 0 ? param1EventSB : ""));
}
}
System.out.println("=======================================" + whereSB);
return String.format("select $dimentionselect lc_sum(temp, $interval, %s) "
+ "from ("
+ "select $dimentionselect lc_count("
+ "date_diff('%s', from_iso8601_timestamp('2007-01-01'), from_unixtime(xwhen)),"
+ "date_diff('%s', from_iso8601_timestamp('2007-01-01'), from_iso8601_timestamp('$firststartdate')), "
+ "$interval, %s, xwhat, '%s') as temp "
+ "from %s %s $dimentionwhere $usergroup "
+ "group by xwho $dimentionaftergroupby) $dimentiongroupby",
retentionInterval, reportView, reportView, retentionInterval, events, Constant.eventTable + appid, whereSB + ")");
}
public static String generateVirtualRetentionSql(String events, String appid, String reportView)
{
int retentionInterval = getRetentions(reportView);
String[] singleEvent = events.split(",");
StringBuilder sb = new StringBuilder();
for (String s : singleEvent) {
sb.append("'" + s + "',");
}
String xwhatevents = sb.deleteCharAt(sb.length() - 1).toString();
StringBuffer whereSB = new StringBuffer(" where $campaign ds>='$firststartdate' and ds<='$secondenddate'");
return String.format("select $dimentionselect active_lc_sum(temp, $interval, %s) "
+ "from ("
+ "select $dimentionselect active_lc_count("
+ "date_diff('%s', from_iso8601_timestamp('$firststartdate'), from_iso8601_timestamp(ds)),"
+ "$interval, %s, xwhat, '%s') as temp "
+ "from %s %s $dimentionwhere $usergroup "
+ "and xwhat in (%s) "
+ "group by xwho $dimentionaftergroupby ) $dimentiongroupby",
retentionInterval, reportView, retentionInterval, events, Constant.eventTable + appid, whereSB, xwhatevents);
}
public static String generateInstallVirtualRetentionSql(String events, String appid, String reportView)
{
int retentionInterval = getRetentions(reportView);
return String.format("select $firstdimentionselect added_lc_sum(temp, $interval, %s) "
+ "from (select $dimentionselect added_lc_count(t0.xwhat,date_diff("
+ "'%s',from_iso8601_timestamp('$firststartdate'), from_iso8601_timestamp(substr(t1._register_time,1,10))),"
+ "date_diff('%s',from_iso8601_timestamp(substr(t1._register_time,1,10)), from_iso8601_timestamp(t0.ds)),"
+ "$interval, %s,'%s') as temp from %s t0 right join %s t1 on t0.xwho = t1.xwho "
+ "where $campaign substr(t1._register_time,1,10) >= '$firststartdate' and substr(t1._register_time,1,10) "
+ "< '$firstenddate' and t0.ds >= '$secondstartdate' and t0.ds <= '$secondenddate' $dimentionwhere $usergroup group by t0.xwho $dimentionaftergroupby) $dimentiongroupby;",
retentionInterval, reportView, reportView, retentionInterval, events, Constant.eventTable + appid, Constant.profileTable + appid);
}
private static StringBuffer getEventParamStringBuffer(StringBuffer param1EventSB, JSONArray paramArray, String relation)
{
for (int j = 0; j < paramArray.size(); j++) {
JSONObject param = paramArray.getJSONObject(j);
String attr = param.getString("attr");
String type = param.getString("type");
String value = param.getString("value");
String oper = param.getString("operator");
param1EventSB.append(String.format("%s %s", j == 0 ? "" : relation, StringUtil.getSql(attr, value, oper, type, "")));
}
return param1EventSB;
}
private static Map<String, List> format(String reponse)
{
Map<String, List> result = new HashMap<>();
List<List<Object>> valueResult = new ArrayList<>();
try {
ReportListResult content = new ObjectMapper().readValue(reponse, ReportListResult.class);
List<Map<String, Object>> valList = content.getVal();
if (valList.size() > 0) {
Map<String, Object> valueMap = valList.get(0);
List<Object> users = new ArrayList<>();
for (String k : valueMap.keySet()) {
if (!"isall0".equals(k)) {
users.add(valueMap.get(k));
}
}
List<Object> trans4firstList = new ArrayList<>();
List<Object> trans4lastList = new ArrayList<>();
for (int i = 0; i < users.size(); i++) {
Double trans4first = Double.valueOf(users.get(i).toString()) * 100.0 / Double.valueOf(users.get(0).toString());
BigDecimal trans4firstb = BigDecimal.valueOf(trans4first);
Object trans4firstResult = trans4firstb.setScale(2, BigDecimal.ROUND_HALF_UP);
trans4firstList.add(users.get(0).toString().equals("0") ? 0 : trans4firstResult);
if (i > 0) {
Double trans4last = Double.valueOf(users.get(i).toString()) * 100.0 / Double.valueOf(users.get(i - 1).toString());
BigDecimal trans4lastb = BigDecimal.valueOf(trans4last);
Object trans4lastResult = trans4lastb.setScale(2, BigDecimal.ROUND_HALF_UP);
trans4lastList.add(users.get(i - 1).toString().equals("0") ? 0 : trans4lastResult);
}
}
valueResult.add(trans4firstList);
valueResult.add(users);
result.put("trans4last", trans4lastList);
}
result.put("val", valueResult);
}
catch (IOException e) {
e.printStackTrace();
}
return result;
}
/**
* 格式化来自报表的漏斗数据
*/
public static Map<String, List> format4Funnel(Map<String, List> response, List<String> eventList, boolean isCompare, String dimension,
String startDate, String endDate, boolean isTotal, String userGroup,
String userGroupName, Map<String, String> eventAlisMap, String dimensionValue)
{
Map<String, List> result = new HashMap<>();
List<Map<String, Object>> valueResult = new ArrayList<>();
List<Map<String, Object>> valList = response.get("val");
List<String> columnKeyList = new ArrayList<>();
List<String> nameList = new ArrayList<>();
List<String> alias = new ArrayList<>();
for (String e : eventList) {
alias.add(eventAlisMap.get(e));
}
if (valList != null && valList.size() > 0) {
List<String> dimensionValueList = new ArrayList<>();
for (Map<String, Object> val : valList) {
if (isCompare) {
Map<String, Object> innerMap = new HashMap<>();
JSONArray valArray = new JSONArray();
if (StringUtil.isEmpty(userGroup)) {
valArray = JSONArray.fromObject(val.get("_col1"));
}
else {
valArray = JSONArray.fromObject(val.get("_col0"));
}
if (valArray.size() > 0) {
if (StringUtil.isEmpty(userGroup)) {
dimensionValueList.add(val.get(dimension).toString());
innerMap.put(dimension, val.get(dimension));
}
else {
innerMap.put(dimension, userGroupName);
}
if (!columnKeyList.contains(dimension)) {
columnKeyList.add(dimension);
nameList.add(dimension);
}
List<Object> valSumList = valArray.subList(valArray.size() - eventList.size(), valArray.size());
List<Long> users = new ArrayList<>();
for (Object o : valSumList) {
users.add(Long.valueOf(o.toString()));
}
deal1Funnel(users, eventList, columnKeyList, nameList, innerMap, eventAlisMap);
valueResult.add(innerMap);
}
}
else if (isTotal) {
JSONArray valArray = JSONArray.fromObject(val.get("_col0"));
if (valArray.size() > 0) {
List<Object> usersObject = valArray.subList(valArray.size() - eventList.size(), valArray.size());
Map<String, Object> innerMap = new HashMap<>();
innerMap.put(dimension, "整体");
if (!columnKeyList.contains(dimension)) {
columnKeyList.add(dimension);
nameList.add(dimension);
}
List<Long> users = new ArrayList<>();
for (Object o : usersObject) {
users.add(Long.valueOf(o.toString()));
}
deal1Funnel(users, eventList, columnKeyList, nameList, innerMap, eventAlisMap);
valueResult.add(innerMap);
}
}
else {
JSONArray valArray = JSONArray.fromObject(val.get("_col0"));
if (valArray.size() > 0) {
List<String> dateList = DateUtil.getDateInterval(startDate, endDate);
List<Object> usersAll = Arrays.asList(valArray.toArray());
for (int i = 0; i <= dateList.size(); i++) {
Map<String, Object> innerMap = new HashMap<>();
innerMap.put("ds", i == dateList.size() ? "整体" : dateList.get(i));
if (!columnKeyList.contains("ds")) {
columnKeyList.add("ds");
nameList.add("日期");
}
List<Long> users = new ArrayList<>();
for (int j = 0; j < eventList.size(); j++) {
users.add(Long.valueOf(usersAll.get(i * eventList.size() + j).toString()));
}
deal1Funnel(users, eventList, columnKeyList, nameList, innerMap, eventAlisMap);
if (i == dateList.size()) {
valueResult.add(0, innerMap);
}
else {
valueResult.add(innerMap);
}
}
}
}
}
if (!StringUtil.isEmpty(dimensionValue)) {
String[] dimentionValueList4Web = dimensionValue.split(",");
if (valueResult.size() < dimentionValueList4Web.length) {
for (String dv : dimentionValueList4Web) {
if (!dimensionValueList.contains(dv)) {
valueResult.addAll(getEmptyFunnelResult(eventList, alias, dimension, dv).get("val"));
}
}
}
}
}
result.put("val", valueResult);
result.put("columnkey", columnKeyList);
result.put("name", nameList);
result.put("eventname", eventList);
result.put("key", alias);
if (valueResult.isEmpty()) {
if (!StringUtil.isEmpty(dimension) && dimension.equals("usergroup")) {
dimensionValue = userGroupName;
}
result = getEmptyFunnelResult(eventList, alias, dimension, dimensionValue);
result.put("eventname", eventList);
result.put("key", alias);
}
return result;
}
public static void deal1Funnel(List<Long> users, List<String> eventList, List<String> columnKeyList,
List<String> nameList, Map<String, Object> innerMap, Map<String, String> eventAlisMap)
{
for (int i = 0; i < users.size(); i++) {
String eventName = eventList.get(i);
innerMap.put(eventName, users.get(i));
Double trans4first = users.get(0).equals(0L) ? 0d : users.get(i) * 100.0 / users.get(0);
BigDecimal trans4firstb = BigDecimal.valueOf(trans4first);
Object trans4firstResult = trans4firstb.setScale(2, BigDecimal.ROUND_HALF_UP);
innerMap.put("rate_" + eventName, users.get(0).equals(0L) ? i == 0 ? 100 : 0 : trans4firstResult);
if (i > 0) {
Long last = users.get(i - 1);
innerMap.put(eventName + "lost", last - users.get(i));
if (!columnKeyList.contains(eventName + "lost")) {
columnKeyList.add(eventName + "lost");
nameList.add("流失");
}
Double lost4last = last == 0 ? 0d : (last - users.get(i)) * 100.0 / last;
BigDecimal lost4lastb = BigDecimal.valueOf(lost4last);
Object lost4lastResult = lost4lastb.setScale(2, BigDecimal.ROUND_HALF_UP);
innerMap.put("rate_" + eventName + "lost", lost4lastResult);
}
if (!columnKeyList.contains(eventName)) {
columnKeyList.add(eventName);
nameList.add(eventAlisMap.get(eventName));
}
}
}
private static Map<String, List> getEmptyFunnelResult(List<String> keyList, List<String> alias, String dimension, String dimensionValue)
{
Map<String, List> result = new HashMap<>();
List<String> columnKeyList = new ArrayList<>();
List<String> nameList = new ArrayList<>();
List<Map<String, Object>> val = new ArrayList<>();
if (StringUtil.isEmpty(dimension)) {
columnKeyList.add("ds");
nameList.add("日期");
}
else {
columnKeyList.add(dimension);
nameList.add(dimension);
}
if (StringUtil.isEmpty(dimensionValue)) {
Map<String, Object> map = new HashMap<>();
map.put(StringUtil.isEmpty(dimension) ? "ds" : dimension, "整体");
map = getEmptyFunnelValueMap(map, columnKeyList, keyList, nameList);
val.add(map);
}
else {
String[] valueList = dimensionValue.split(",");
for (String v : valueList) {
Map<String, Object> map = new HashMap<>();
map.put(dimension, v);
map = getEmptyFunnelValueMap(map, columnKeyList, keyList, nameList);
val.add(map);
}
}
result.put("val", val);
result.put("columnkey", columnKeyList);
result.put("name", nameList);
result.put("isempty", new ArrayList<>());
return result;
}
private static Map<String, Object> getEmptyFunnelValueMap(Map<String, Object> map, List<String> columnKeyList, List<String> keyList, List<String> nameList)
{
for (int i = 0; i < keyList.size(); i++) {
if (i != 0) {
columnKeyList.add(keyList.get(i) + "lost");
nameList.add("流失");
map.put("rate_" + keyList.get(i) + "lost", 0d);
}
columnKeyList.add(keyList.get(i));
nameList.add(keyList.get(i));
map.put(keyList.get(i), 0);
map.put("rate_" + keyList.get(i), i == 0 ? 100d : 0d);
}
return map;
}
public static Map<String, List> format4DetailList(Map<String, List> response, String startDate, int interval, String reportView)
{
Map<String, List> result = new HashMap<>();
List<Map<String, Object>> valueResult = new ArrayList<>();
List<String> columnKeyList = new ArrayList<>();
List<String> nameList = new ArrayList<>();
List<Map<String, Object>> valList = response.get("val");
if (valList != null && valList.size() > 0) {
Map<String, Object> valueMap = valList.get(0);
List<Long> users = new ArrayList<>();
for (String k : valueMap.keySet()) {
if (!"isall0".equals(k)) {
JSONArray valArray = JSONArray.fromObject(valueMap.get(k));
for (Object o : valArray.toArray()) {
users.add(Long.valueOf(o.toString()));
}
}
}
if (users.size() > 0) {
int retentionInterval = getRetentions(reportView);
List<Long> firstEventUsers = users.subList(users.size() - interval, users.size());
List<Long> secondEventUsers = users.subList(0, users.size() - interval);
for (int i = 0; i < interval; i++) {
Map<String, Object> innerMap = new HashMap<>();
if ("day".equals(reportView)) {
innerMap.put("ds", DateUtil.getBeforeDays(startDate, -i));
}
else if ("week".equals(reportView)) {
String weekStr = DateUtil.getAfterWeeks(startDate, i);
innerMap.put("ds", DateUtil.getFirstDayOfWeek(weekStr) + "~" + DateUtil.getLastDayOfWeek(weekStr));
}
else {
String monthStr = DateUtil.getAfterMonths(startDate, i);
innerMap.put("ds", DateUtil.getFirstdayOfMonth(monthStr) + "~" + DateUtil.getLastdayOfMonth(monthStr));
}
Long first = firstEventUsers.get(i);
innerMap.put("init", first);
if (!columnKeyList.contains("ds")) {
columnKeyList.add("ds");
nameList.add("日期");
}
if (!columnKeyList.contains("init")) {
columnKeyList.add("init");
nameList.add("初始人数");
}
for (int j = i * retentionInterval; j < (i + 1) * retentionInterval; j++) {
if (isDateValid(i == 0 ? j : j % (i * retentionInterval), reportView)) {
Long retention = secondEventUsers.get(j);
innerMap.put("retention" + (j % retentionInterval + 1), retention);
Double rate = first.equals(0L) ? 0d : retention * 100.0 / first;
BigDecimal rateb = BigDecimal.valueOf(rate);
Object ratebResult = rateb.setScale(2, BigDecimal.ROUND_HALF_UP);
innerMap.put("rate_" + "retention" + (j % retentionInterval + 1), ratebResult);
if (!columnKeyList.contains("retention" + (j % retentionInterval + 1))) {
columnKeyList.add("retention" + (j % retentionInterval + 1));
nameList.add((j % retentionInterval + 1) + getNameByReportView(reportView) + "后");
}
}
}
valueResult.add(innerMap);
}
}
}
if (valueResult.isEmpty()) {
result = getEmptyRetentionResult("ds", true, reportView, null, null);
}
else {
result.put("val", valueResult);
result.put("columnkey", columnKeyList);
result.put("name", nameList);
}
return result;
}
/**
* 格式化来自报表系统的留存数据
*/
public static Map<String, List> format4Retention(Map<String, List> response, int interval, String dimension, String reportView, String userGroup,
String userGroupName, String dimensionValues)
{
Map<String, List> result = new HashMap<>();
List<Map<String, Object>> valueResult = new ArrayList<>();
List<String> columnKeyList = new ArrayList<>();
List<String> nameList = new ArrayList<>();
List<Map<String, Object>> valList = response.get("val");
if (valList != null && valList.size() > 0) {
List<String> dimensionValueList = new ArrayList<>();
for (Map<String, Object> valueMap : valList) {
String dimensionValue = "";
String dimensionKey = "";
List<Long> users = new ArrayList<>();
for (String k : valueMap.keySet()) {
if (!"isall0".equals(k) && !k.equals(dimension)) {
JSONArray valArray = JSONArray.fromObject(valueMap.get(k));
for (Object o : valArray.toArray()) {
users.add(Long.valueOf(o.toString()));
}
}
else if (k.equals(dimension)) {
dimensionValue = valueMap.get(k).toString();
dimensionKey = valueMap.get(k).toString();
dimensionValueList.add(dimensionValue);
}
}
if (users.size() > 0) {
List<Long> firstEventUsers = users.subList(users.size() - interval, users.size());
List<Long> secondEventUsers = users.subList(0, users.size() - interval);
if (!StringUtil.isEmpty(dimension)) {
columnKeyList.add(dimension);
nameList.add("usergroup".equals(dimension) ? "用户组" : "维度");
}
else {
columnKeyList.add("ds");
nameList.add("日期");
}
columnKeyList.add("init");
nameList.add("初始日");
Map<String, Object> valueResultMap = deal1Retention(interval, firstEventUsers, secondEventUsers,
columnKeyList, nameList, dimension, dimensionValue, reportView, userGroup, userGroupName, dimensionKey);
valueResult.add(valueResultMap);
}
}
if (!StringUtil.isEmpty(dimensionValues)) {
String[] dimensionValueList4Web = dimensionValues.split(",");
if (valueResult.size() < dimensionValueList4Web.length) {
for (String dv : dimensionValueList4Web) {
if (!dimensionValueList.contains(dv)) {
valueResult.addAll(getEmptyRetentionResult(dimension, false, reportView, userGroup, dv).get("val"));
}
}
}
}
}
if (valueResult.isEmpty()) {
if (!StringUtil.isEmpty(userGroupName)) {
dimensionValues = userGroupName;
}
result = getEmptyRetentionResult(dimension, false, reportView, userGroup, dimensionValues);
}
else {
result.put("val", valueResult);
result.put("columnkey", columnKeyList);
result.put("name", nameList);
result.put("key", nameList.isEmpty() ? new ArrayList<String>() : nameList.subList(1, nameList.size()));
}
return result;
}
/**
* 获取空留存结果信息
*/
private static Map<String, List> getEmptyRetentionResult(String dimention, boolean isDetail, String reportView,
String userGroup, String dimensionValue)
{
Map<String, List> result = new HashMap<>();
List<Map<String, Object>> val = new ArrayList<>();
if (!isDetail) {
if (StringUtil.isEmpty(dimensionValue)) {
Map<String, Object> map = new HashMap<>();
map.put(StringUtil.isEmpty(dimention) ? "ds" : dimention, "整体");
map = getEmptyRetentionValue(map, reportView);
val.add(map);
}
else {
String[] valueList = dimensionValue.split(",");
for (String v : valueList) {
Map<String, Object> map = new HashMap<>();
if (!StringUtil.isEmpty(userGroup)) {
map.put(dimention + "id", userGroup);
}
map.put(dimention, v);
map = getEmptyRetentionValue(map, reportView);
val.add(map);
}
}
}
//columnkey
List<String> columnKey = new ArrayList<>();
columnKey.add(StringUtil.isEmpty(dimention) ? "ds" : dimention);
columnKey.add("init");
columnKey = getRetentionColumnKeyByView(columnKey, reportView);
//name
List<String> name = new ArrayList<>();
name = getRetentionColumnNameByView(name, reportView);
result.put("columnkey", columnKey);
result.put("name", name);
result.put("key", name.subList(1, name.size()));
result.put("isempty", new ArrayList<>(1));
result.put("val", val);
return result;
}
/**
* 获取留存的columnKey列表
* created by sunhao 2017-05-12
*/
private static List<String> getRetentionColumnKeyByView(List<String> columnKey, String reportView)
{
switch (reportView) {
case VIEW_DAY:
columnKey.add("retention1");
columnKey.add("retention2");
columnKey.add("retention3");
columnKey.add("retention4");
columnKey.add("retention5");
columnKey.add("retention6");
columnKey.add("retention7");
columnKey.add("retention14");
columnKey.add("retention30");
break;
case VIEW_WEEK:
columnKey.add("retention1");
columnKey.add("retention2");
columnKey.add("retention3");
columnKey.add("retention4");
columnKey.add("retention5");
columnKey.add("retention6");
columnKey.add("retention7");
columnKey.add("retention8");
break;
case VIEW_MONTH:
columnKey.add("retention1");
columnKey.add("retention2");
columnKey.add("retention3");
break;
}
return columnKey;
}
/**
* 获取留存的列名列表
* created by sunhao 2017-05-12
*/
private static List<String> getRetentionColumnNameByView(List<String> name, String reportView)
{
name.add("日期");
name.add("初始人数");
switch (reportView) {
case VIEW_DAY:
name.add("1天后");
name.add("2天后");
name.add("3天后");
name.add("4天后");
name.add("5天后");
name.add("6天后");
name.add("7天后");
name.add("14天后");
name.add("30天后");
break;
case VIEW_WEEK:
name.add("1周后");
name.add("2周后");
name.add("3周后");
name.add("4周后");
name.add("5周后");
name.add("6周后");
name.add("7周后");
name.add("8周后");
break;
case VIEW_MONTH:
name.add("1月后");
name.add("2月后");
name.add("3月后");
break;
}
return name;
}
private static Map<String, Object> getEmptyRetentionValue(Map<String, Object> map, String reportView)
{
map.put("init", 0);
switch (reportView) {
case VIEW_DAY:
map.put("retention1", 0);
map.put("retention2", 0);
map.put("retention3", 0);
map.put("retention4", 0);
map.put("retention5", 0);
map.put("retention6", 0);
map.put("retention7", 0);
map.put("retention14", 0);
map.put("retention30", 0d);
map.put("rate_retention1", 0d);
map.put("rate_retention2", 0d);
map.put("rate_retention3", 0d);
map.put("rate_retention4", 0d);
map.put("rate_retention5", 0d);
map.put("rate_retention6", 0d);
map.put("rate_retention7", 0d);
map.put("rate_retention14", 0d);
map.put("rate_retention30", 0d);
break;
case VIEW_WEEK:
map.put("retention1", 0);
map.put("retention2", 0);
map.put("retention3", 0);
map.put("retention4", 0);
map.put("retention5", 0);
map.put("retention6", 0);
map.put("retention7", 0);
map.put("retention8", 0);
map.put("rate_retention1", 0d);
map.put("rate_retention2", 0d);
map.put("rate_retention3", 0d);
map.put("rate_retention4", 0d);
map.put("rate_retention5", 0d);
map.put("rate_retention6", 0d);
map.put("rate_retention7", 0d);
map.put("rate_retention8", 0d);
break;
case VIEW_MONTH:
map.put("retention1", 0);
map.put("retention2", 0);
map.put("retention3", 0);
map.put("rate_retention1", 0d);
map.put("rate_retention2", 0d);
map.put("rate_retention3", 0d);
break;
}
return map;
}
public static Map<String, Object> getEmptyRetentionValue(String key, String usergroup, String value, String reportView)
{
Map<String, Object> map = new HashMap<>();
map.put(key, value);
if ("usergroup".equals(key)) {
map.put("usergroupid", usergroup);
}
map = getEmptyRetentionValue(map, reportView);
;
return map;
}
public static Map<String, Object> deal1Retention(int interval, List<Long> firstEventUsers, List<Long> secondEventUsers,
List<String> columnKeyList, List<String> nameList, String dimension,
String dimensionValue, String reportView, String userGroup,
String userGroupName, String dimensionKey)
{
Map<String, Object> valueResultMap = new HashMap<>();
Map<String, Long> innerMap = new HashMap<>();
int retentionInterval = getRetentions(reportView);
for (int i = 0; i < interval; i++) {
Long first = !innerMap.containsKey("init") ? firstEventUsers.get(i) : innerMap.get("init") + firstEventUsers.get(i);
innerMap.put("init", first);
for (int j = i * retentionInterval; j < (i + 1) * retentionInterval; j++) {
if (isDateValid(i == 0 ? j : j % (i * retentionInterval), reportView)) {
Long retention = !innerMap.containsKey("retention" + (j % retentionInterval + 1)) ? secondEventUsers.get(j) : innerMap.get("retention" + (j % retentionInterval + 1)) + secondEventUsers.get(j);
innerMap.put("retention" + (j % retentionInterval + 1), retention);
if (!columnKeyList.contains("retention" + (j % retentionInterval + 1))) {
columnKeyList.add("retention" + (j % retentionInterval + 1));
nameList.add((j % retentionInterval + 1) + getNameByReportView(reportView) + "后");
}
}
}
}
if (StringUtil.isEmpty(dimension)) {
valueResultMap.put("ds", "整体");
}
else if (!StringUtil.isEmpty(userGroup)) {
valueResultMap.put(dimension, userGroupName);
valueResultMap.put(dimension + "id", userGroup);
}
else if (StringUtil.isEmpty(dimensionValue)) {
valueResultMap.put(dimension, "整体");
}
else {
valueResultMap.put(dimension, dimensionValue);
valueResultMap.put(dimension + "_key", dimensionKey);
}
for (String key : innerMap.keySet()) {
valueResultMap.put(key, innerMap.get(key));
if (!key.equals("init")) {
Double rate = innerMap.get("init").equals(0L) ? 0d : innerMap.get(key) * 100.0 / innerMap.get("init");
BigDecimal rateb = BigDecimal.valueOf(rate);
Object ratebResult = rateb.setScale(2, BigDecimal.ROUND_HALF_UP);
valueResultMap.put("rate_" + key, ratebResult);
}
}
return valueResultMap;
}
public static Map<String, List> formatRetentionByName(String responseJson, boolean isDetail, String reportView, String start,
String end, String userGroup, String usergroupName, boolean isDemo)
{
Map<String, List> result = new HashMap<>();
try {
ReportListResult reportListResult = new ObjectMapper().readValue(responseJson, ReportListResult.class);
if (reportListResult.getDesc() != null) {
result.put("desc", reportListResult.getDesc());
}
List<String> nameList = reportListResult.getName();
List<Map<String, Object>> val = reportListResult.getVal();
List<Map<String, Object>> newVal = new ArrayList<>();
List<String> valKeys = new ArrayList<>();
result.put("columnkey", reportListResult.getColumnkey());
result.put("name", nameList);
result.put("key", nameList.subList(1, nameList.size()));
result.put("val", reportListResult.getVal());
for (Map<String, Object> v : val) {
valKeys.add(v.get("ds").toString());
}
List<String> keys = getRetentionKeys(start, end, reportView);
if (isDetail) {
//补0
for (String key : keys) {
if (valKeys.contains(key)) {
Map<String, Object> map = val.get(valKeys.indexOf(key));
if ("week".equals(reportView)) {
map.put("ds", key + "~" + DateUtil.getLastDayStrOfWeek(DateUtil.parseDate(key)));
}
else if ("month".equals(reportView)) {
map.put("ds", key + "~" + DateUtil.getLastDayOfMonth(DateUtil.parseDate(key)));
}
Map<String, Object> valueResultMap = new HashMap<>();
for (String k : map.keySet()) {
valueResultMap.put(k, map.get(k));
if (!k.equals("init") && !k.equals("ds") && !k.equals("isall0")) {
Double rate = map.get("init").equals(0) ? 0d : Integer.valueOf(map.get(k).toString()) * 100.0 / Integer.valueOf(map.get("init").toString());
BigDecimal rateb = BigDecimal.valueOf(rate);
Object ratebResult = rateb.setScale(2, BigDecimal.ROUND_HALF_UP);
valueResultMap.put("rate_" + k, ratebResult);
}
}
newVal.add(valueResultMap);
}
else {
String dsValue = key;
if ("week".equals(reportView)) {
dsValue = key + "~" + DateUtil.getLastDayStrOfWeek(DateUtil.parseDate(key));
}
else if ("month".equals(reportView)) {
dsValue = key + "~" + DateUtil.getLastDayOfMonth(DateUtil.parseDate(key));
}
newVal.add(getEmptyRetentionValue("ds", null, dsValue, reportView));
}
}
result.put("val", newVal);
}
else {
//汇总
if (!val.isEmpty()) {
Map<String, Object> map = new HashMap<>();
for (Map<String, Object> v : val) {
if (keys.contains(v.get("ds"))) {
for (String key : v.keySet()) {
if (!"ds".equals(key) && !"isall0".equals(key)) {
map.put(key, !map.containsKey(key) ? v.get(key) : Integer.valueOf(map.get(key).toString()) + Integer.valueOf(v.get(key).toString()));
}
}
}
}
Map<String, Object> valueResultMap = new HashMap<>();
for (String key : map.keySet()) {
valueResultMap.put(key, map.get(key));
if (!key.equals("init")) {
Double rate = map.get("init").equals(0) ? 0d : Integer.valueOf(map.get(key).toString()) * 100.0 / Integer.valueOf(map.get("init").toString());
BigDecimal rateb = BigDecimal.valueOf(rate);
Object ratebResult = rateb.setScale(2, BigDecimal.ROUND_HALF_UP);
valueResultMap.put("rate_" + key, ratebResult);
}
}
if (!StringUtil.isEmpty(userGroup) && !StringUtil.isEmpty(usergroupName)) {
valueResultMap.put("usergroup", usergroupName);
valueResultMap.put("usergroupid", userGroup);
List<String> columnkey = result.get("columnkey");
columnkey.remove("ds");
columnkey.add(0, "usergroup");
List<String> name = result.get("name");
name.remove("日期");
name.add(0, "usergroup");
result.put("key", name.subList(1, name.size()));
}
else if (!StringUtil.isEmpty(userGroup)) {
valueResultMap.put("usergroup", "整体");
List<String> columnkey = result.get("columnkey");
columnkey.remove("ds");
columnkey.add(0, "usergroup");
List<String> name = result.get("name");
name.remove("日期");
name.add(0, "usergroup");
result.put("key", name.subList(1, name.size()));
}
else {
valueResultMap.put("ds", "整体");
}
newVal.add(valueResultMap);
}
result.put("val", newVal);
if (newVal.isEmpty()) {
if (!StringUtil.isEmpty(userGroup)) {
newVal.add(getEmptyRetentionValue("usergroup", userGroup, usergroupName, reportView));
List<String> columnkey = result.get("columnkey");
columnkey.remove("ds");
columnkey.add(0, "usergroup");
List<String> name = result.get("name");
name.remove("日期");
name.add(0, "usergroup");
result.put("key", name.subList(1, name.size()));
}
else {
newVal.add(getEmptyRetentionValue("ds", null, "日期", reportView));
}
}
}
}
catch (IOException e) {
e.printStackTrace();
}
return result;
}
private static List<String> getRetentionKeys(String start, String end, String reportView)
{
List<String> keys = new ArrayList<>();
switch (reportView) {
case VIEW_DAY:
keys = DateUtil.getDateInterval(start, end);
break;
case VIEW_WEEK:
List<String> weeks = DateUtil.getEveryWeek(start, end);
for (String week : weeks) {
keys.add(DateUtil.getFirstDayOfWeek(week));
}
break;
case VIEW_MONTH:
List<String> months = DateUtil.getEveryMonth(start, end);
for (String month : months) {
keys.add(DateUtil.getFirstdayOfMonth(month));
}
break;
}
return keys;
}
private static String getNameByReportView(String reportView)
{
String reportViewName = "日";
switch (reportView) {
case VIEW_DAY:
reportViewName = "日";
break;
case VIEW_WEEK:
reportViewName = "周";
break;
case VIEW_MONTH:
reportViewName = "月";
break;
}
return reportViewName;
}
private static boolean isDateValid(int day, String reportView)
{
List<Integer> dayList = new ArrayList<>();
switch (reportView) {
case VIEW_DAY:
dayList.add(1);
dayList.add(2);
dayList.add(3);
dayList.add(4);
dayList.add(5);
dayList.add(6);
dayList.add(7);
dayList.add(14);
dayList.add(30);
break;
case VIEW_WEEK:
dayList.add(1);
dayList.add(2);
dayList.add(3);
dayList.add(4);
dayList.add(5);
dayList.add(6);
dayList.add(7);
dayList.add(8);
break;
case VIEW_MONTH:
dayList.add(1);
dayList.add(2);
dayList.add(3);
break;
}
return dayList.contains(day + 1);
}
/**
* 构建只能路径查询SQL
* select pathfind_sum(temp, 20, false)
* from (select pathfind_count(xwhen, xwhat, 'install,startup,reged,loggedin,payment', 'payment', false, 3600, 20) as temp
* from hive.tkio_orc_kudu.event_942da081fd89f2d691b4b55b203d6468
* where ds >= '2017-06-01' and ds <= '2017-06-01' and
* xwhat in ('install','startup','reged','loggedin','payment')
* group by _deviceid);
*
* @param intelligentPath 参数model
* @param appKey appKey
* @return sql
*/
public static String generateIntelligentPathSql(IntelligentPath intelligentPath, String appKey)
{
StringBuilder sqlWhere = new StringBuilder();
String userGroupSql = "";
String inEventsSql = excludeTargetEvent(intelligentPath.getEvents(), intelligentPath.getTargetEvent());
Long session = intelligentPath.getSession() * intelligentPath.getSessionUnit();
//解析事件筛选构建where
JSONObject conditionObject = JSONObject.fromObject(intelligentPath.getEventCondition());
String eventName = conditionObject.getString("event");
String relation = conditionObject.getString("relation");
sqlWhere.append(" or (xwhat = '").append(eventName).append("' ");
//属性
JSONArray paramArray = (JSONArray) conditionObject.get("params");
if (null != paramArray) {
//构建属性条件
for (int i = 0; i < paramArray.size(); i++) {
JSONObject attr = paramArray.getJSONObject(i);
String attrName = attr.getString("attr");
String attrType = attr.getString("type");
String attrValue = attr.getString("value");
String attrOperate = attr.getString("operator");
sqlWhere.append(String.format("%s %s", i == 0 ? "and " : relation, StringUtil.getSql(attrName, attrValue, attrOperate, attrType, "")));
}
}
sqlWhere.append(")");
//用户分群
if (null != intelligentPath.getUserGroup()) {
userGroupSql = String.format(" and _deviceid in (select objectid as _deviceid from %s where id='%s' and objecttype='_deviceid') ",
Constant.usergroupTable,
intelligentPath.getUserGroup());
}
//参数校验
if (StringUtils.isEmpty(inEventsSql) || StringUtils.isEmpty(sqlWhere)) {
return null;
}
//拼装sql
return String.format("select pathfind_sum(temp, 10, %s) as path from (select pathfind2_count(xwhen, xwhat," +
" '%s'," +
" '%s'," +
" %s," +
" %s, 10) as temp " +
" from " + Constant.eventTable + "%s " +
" where $campaign _deviceid <> '00000000-0000-0000-0000-000000000000' and ds >= '$startDate' and ds <= '$endDate' and (xwhat in (%s) " +
" %s)" +
// " %s group by _deviceid);",
" %s group by xwho);",
intelligentPath.getStartOrEnd(),
intelligentPath.getEvents(),
intelligentPath.getTargetEvent(),
intelligentPath.getStartOrEnd(),
session,
appKey,
inEventsSql,
sqlWhere,
userGroupSql
);
}
/**
* 踢除目标事件
*/
private static String excludeTargetEvent(String events, String targetEvent)
{
StringBuilder stringBuilder = new StringBuilder();
String[] eventArray = events.split(",");
for (String event : eventArray) {
if (!targetEvent.equals(event)) {
stringBuilder.append("'").append(event).append("',");
}
}
return stringBuilder.length() == 0 ? null : stringBuilder.toString().substring(0, stringBuilder.length() - 1);
}
public static void main(String[] args)
{
// String eventinfo =
// "[{event: \"Action\",relation:\"and\",params:[]},{event: \"payment\",relation:\"and\",params:[]}]";
// SqlUtil util = new SqlUtil();
// String sql = util.generateRetentionSql(eventinfo, "bfa099f35fb3b8158846a24e7066ca34");
// System.out.println(sql);
// String response = "{\"val\": [{\"step1\": 100,\"step2\": 80,\"step3\": 50}],\"key\": []}";
// String response = "{\"val\":[{\"_col0\":\"583,465,485,410,357,337,315,311,327,304,625,265,233,514,230,334,361,363,112,0,0,0,0,0,0,0,0,0,0,0,16601\",\"isall0\":false}],\"key\":[]}";
// Map<String, List> result = SqlUtil.format4List(response, "2016-12-10", 1);
// System.out.println(result);
// System.out.println(SqlUtil.format4DetailList(response, "2016-12-10", 1));
// String funnelEventInfo = "[{event: \"open\"},{event: \"search\"},{event: \"view\"},{event: \"cart\"}]";
// String sql = SqlUtil.generateFunnelSqlTemp(funnelEventInfo, "2323", 3);
// sql = sql.replace("$dimentionselect", "");
// sql = sql.replace("$dimentionwhere", "");
// sql = sql.replace("$usergroup", "");
// sql = sql.replace("$dimentionaftergroupby", "");
// sql = sql.replace("$dimentiongroupby", "");
// System.out.println(sql);
IntelligentPath intelligentPath = new IntelligentPath();
intelligentPath.setStartOrEnd(false);
intelligentPath.setTargetEvent("payment");
intelligentPath.setEvents("install,payment");
intelligentPath.setEventCondition("{\"event\":\"payment\",\"relation\":\"and\",\"params\":[{\"attr\":\"_country\",\"type\":\"string\",\"value\":\"中国\",\"operator\":\"=\"}]}");
intelligentPath.setSession(3600L);
System.out.println(generateIntelligentPathSql(intelligentPath, "942da081fd89f2d691b4b55b203d6468"));
}
}
package com.reyun.util;
import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringUtil {
private static final String URL_REGEX_PATTERN = "(http|https):\\/\\/[^\\s]+";
private static final String NAME_REGEX_PATTERN = "^[a-zA-Z0-9\\s\\.\\-\\u4E00-\\u9FA5]+$";
public static String[] toStrArray(String str) {
return str.split(",");
}
/*
* 判断是否为整数
*
* @param str 传入的字符串
*
* @return 是整数返回true,否则返回false
*/
public static boolean isInteger(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches();
}
/*
* 判断是否为浮点数,包括double和float
*
* @param str 传入的字符串
*
* @return 是浮点数返回true,否则返回false
*/
public static boolean isDouble(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[.\\d]*$");
return pattern.matcher(str).matches();
}
public static boolean isNumber(String string) {
return string.matches("^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$");
}
public static boolean isEmpty(String string) {
return string == null || "".equals(string);
}
public static String escapeString(String old) {
old = old.replace("'", "\\'");
return old;
}
public static void main(String[] args) {
String str = "点通";
String pattern = "([广点通])|([百分点])|([乱七八糟])";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(str);
System.out.println(m.group());
}
/**
* 随机获取user_agent
*
*/
public static String getUA() {
String[] _user_agent_pc = {
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser)",
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Maxthon 2.0)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; TencentTraveler 4.0)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; The World)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; 360SE)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Avant Browser)",
"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Maxthon 2.0)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; TencentTraveler 4.0)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; The World)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; 360SE)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Avant Browser)",
"Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0)",
"Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon 2.0)",
"Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; TencentTraveler 4.0)",
"Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)",
"Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)",
"Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Maxthon 2.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; TencentTraveler 4.0)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; The World)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; 360SE)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Avant Browser)",
"Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Maxthon 2.0)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; TencentTraveler 4.0)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; The World)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; 360SE)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Avant Browser)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0)",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:39.0) Gecko/20100101 Firefox/39.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0 Safari/535.11",
"Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1",
"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50",
"Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0 Opera 12.14",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14",
"Mozilla/5.0 (Windows NT 5.1) Gecko/20100101 Firefox/14.0 Opera/12.0",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; de) Opera 11.51",
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0 Safari/537.36",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2225.0 Safari/537.36",
"Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko QQBrowser/8.1.3886.400",
"Mozilla/5.0 (MSIE 9.0; Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko QQBrowser/8.2.3638.400",
"Mozilla/5.0 (MSIE 9.0; Windows NT 6.0; Trident/7.0; rv:11.0) like Gecko QQBrowser/8.3.4765.400",
"Mozilla/5.0 (MSIE 9.0; Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko QQBrowser/9.1.3471.400",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer 3.4.0.12519)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer 3.5.0.12758)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer 4.0.0.13120)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer 4.2.0.13550)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer 5.0.0.14004)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer/6.1.0.8158)",
"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; 2345Explorer/6.2.0.9202)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; UBrowser/5.0.1369.26)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; UBrowser/5.2.2603.1)",
"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; UBrowser/5.4.4237.43)",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:34.0) Gecko/20100101 Firefox/34.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:36.0) Gecko/20100101 Firefox/36.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:37.0) Gecko/20100101 Firefox/37.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:38.0) Gecko/20100101 Firefox/38.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:39.0) Gecko/20100101 Firefox/39.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:40.0) Gecko/20100101 Firefox/40.0",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:41.0) Gecko/20100101 Firefox/41.0",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/2.1.7.6 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.11 YYE/3.6 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.46 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2478.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2498.0 Safari/537.36",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; en) Presto/2.8.131 Version/11.11",
"Opera/9.80 (Windows NT 6.1; U; en) Presto/2.8.131 Version/11.11",
"Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",
"Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14",
"Opera/9.80 (Windows NT 6.1; WOW64; U; pt) Presto/2.10.229 Version/11.62",
"Opera/9.80 (Windows NT 6.0; U; pl) Presto/2.10.229 Version/11.62",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52",
"Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; de) Presto/2.9.168 Version/11.52",
"Opera/9.80 (Windows NT 5.1; U; en) Presto/2.9.168 Version/11.51",
"Opera/9.80 (Windows NT 6.1; U; es-ES) Presto/2.9.181 Version/12.00",
"Opera/9.80 (Windows NT 5.1; U; zh-sg) Presto/2.9.181 Version/12.00",
"Opera/12.0 (Windows NT 5.2;U;en)Presto/22.9.168 Version/12.00",
"Opera/12.0 (Windows NT 5.1;U;en)Presto/22.9.168 Version/12.00",
"Opera/12.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.02" };
int index = (int) (Math.random() * _user_agent_pc.length);
return _user_agent_pc[index];
}
public static String getSql(String attr, String values, String operator, String type,String tableAlias) {
StringBuilder eventSB = new StringBuilder();
if (attr.equals("_cid")) {
type = "number";
}
if (operator.contains("in")) {
if (type.contains("string") || type.contains("date")) {
String value = values.replace(",", "','");
eventSB.append(" ").append(tableAlias).append(attr).append(" ").append(operator).append("('").append(value).append("') ");
} else {
eventSB.append(tableAlias).append(attr).append(" ").append(operator).append("(").append(values).append(") ");
}
} else if (operator.contains("between")) {
if (type.contains("string") || type.contains("date")) {
String value = values.replace(",", "' and '");
eventSB.append(tableAlias).append(attr).append(" ").append(operator).append(" '").append(value).append("' ");
} else {
String value = values.replace(",", " and ");
eventSB.append(tableAlias).append(attr).append(" ").append(operator).append(" ").append(value).append(" ");
}
} else {
if (type.contains("string") || type.contains("date")) {
eventSB.append(tableAlias).append(attr).append(" ").append(operator).append(" '").append(values).append("' ");
} else {
eventSB.append(tableAlias).append(attr).append(" ").append(operator).append(" ").append(values).append(" ");
}
}
return eventSB.toString();
}
public static String conditionFormat(String str) {
str = "'" + str.replaceAll(",", "','") + "'";
return str;
}
/**
* URL校验
*/
public static boolean urlMatch(String str) {
Pattern pattern = Pattern.compile(URL_REGEX_PATTERN);
return pattern.matcher(str).matches();
}
/**
* 名字校验
*/
public static boolean nameMatch(String str) {
Pattern pattern = Pattern.compile(NAME_REGEX_PATTERN);
return pattern.matcher(str).matches();
}
/**
* 将Long List转换成String,逗号隔开
*/
public static String transList2String(List<Long> idList){
StringBuilder stringBuilder = new StringBuilder();
for(Long id : idList){
stringBuilder.append(id).append(",");
}
return stringBuilder.length() > 0 ? stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(",")).toString() : stringBuilder.toString();
}
/**
* 将逗号分隔的string转换成Long的List
*/
public static List<Long> transString2LongList(String ids)
{
List<Long> resultList = new ArrayList<>();
String[] idArray = toStrArray(ids);
for (String id : idArray) {
try {
if (Strings.isNullOrEmpty(id)) {
continue;
}
resultList.add(Long.parseLong(id));
}
catch (Exception e) {
e.printStackTrace();
}
}
return resultList;
}
}
package com.reyun.util;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Random;
import javax.imageio.ImageIO;
/**
* 验证码生成器
*/
public class ValidateCodeUtil {
// 图片的宽度。
private int width = 160;
// 图片的高度。
private int height = 40;
// 验证码字符个数
private int codeCount = 5;
// 验证码干扰线数
private int lineCount = 150;
// 验证码
private static String code = null;
// 验证码图片Buffer
private BufferedImage buffImg = null;
private char[] codeSequence = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
public ValidateCodeUtil() {
this.createCode();
}
/**
*
* @param width
* 图片宽
* @param height
* 图片高
*/
public ValidateCodeUtil(int width, int height) {
this.width = width;
this.height = height;
this.createCode();
}
/**
*
* @param width
* 图片宽
* @param height
* 图片高
* @param codeCount
* 字符个数
* @param lineCount
* 干扰线条数
*/
public ValidateCodeUtil(int width, int height, int codeCount,
int lineCount, String code) {
this.width = width;
this.height = height;
this.codeCount = codeCount;
this.lineCount = lineCount;
this.code = code;
this.createCode();
}
public void createCode() {
int x = 0, fontHeight = 0, codeY = 0;
int red = 0, green = 0, blue = 0;
x = width / (codeCount + 5);// 每个字符的宽度
fontHeight = height - 2;// 字体的高度
codeY = height - 4;
// 图像buffer
buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
// 生成随机数
Random random = new Random();
// 将图像填充为白色
g.setColor(Color.WHITE);
g.fillRect(0, 0, width, height);
Font font = new Font("Arial", Font.PLAIN, fontHeight);
g.setFont(font);
for (int i = 0; i < lineCount; i++) {
int xs = random.nextInt(width);
int ys = random.nextInt(height);
int xe = xs + random.nextInt(width / 8);
int ye = ys + random.nextInt(height / 8);
red = random.nextInt(255);
green = random.nextInt(255);
blue = random.nextInt(255);
g.setColor(new Color(red, green, blue));
g.drawLine(xs, ys, xe, ye);
}
// randomCode记录随机产生的验证码
StringBuilder randomCode = new StringBuilder();
// 随机产生codeCount个字符的验证码。
for (int i = 0; i < codeCount; i++) {
String strRand = String.valueOf(code.charAt(i));
// 产生随机的颜色值,让输出的每个字符的颜色值都将不同。
red = random.nextInt(255);
green = random.nextInt(255);
blue = random.nextInt(255);
g.setColor(new Color(red, green, blue));
g.drawString(strRand, (i * 2) * x, codeY);
// 将产生的四个随机数组合在一起。
randomCode.append(strRand);
}
// 将四位数字的验证码保存到Session中。
code = randomCode.toString();
}
public void write(String path) throws IOException {
OutputStream sos = new FileOutputStream(path);
this.write(sos);
}
public void write(OutputStream sos) throws IOException {
ImageIO.write(buffImg, "png", sos);
sos.close();
}
public BufferedImage getBuffImg() {
return buffImg;
}
public String getCode() {
return code;
}
}
package com.reyun.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);
}
}
package com.reyun.util;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multiset;
import java.util.Collection;
/**
* Created by nolan on 19/01/2017.
* description:
*/
public class ViewColumnDependUtil {
private static Multimap<String, String> multimap = ArrayListMultimap.create();
static {
//激活率=激活设备数/排重点击
multimap.put("rate_install", "num_install");
multimap.put("rate_install", "dupnum_click_all");
//注册率=注册设备数/激活设备数
multimap.put("rate_reged", "dupnum_reged_day");
multimap.put("rate_reged", "num_install");
//异常点击率=异常点击设备数/点击总数
multimap.put("rate_click_fake", "num_click_fake");
multimap.put("rate_click_fake", "num_click_total");
//异常激活率=异常激活设备数/激活设备数
multimap.put("rate_install_fake", "num_install_fake");
multimap.put("rate_install_fake", "num_install");
//n日留存率=sum(激活设备数n日留存设备数)*100.0/sum(激活设备数)
multimap.put("rate_retentiond1", "rate_retentiond1");
multimap.put("rate_retentiond1", "num_install");
multimap.put("rate_retentiond3", "rate_retentiond3");
multimap.put("rate_retentiond3", "num_install");
multimap.put("rate_retentiond7", "rate_retentiond7");
multimap.put("rate_retentiond7", "num_install");
multimap.put("rate_retentiond30", "rate_retentiond30");
multimap.put("rate_retentiond30", "num_install");
//ltvn=sum(n日LTV值)/sum(激活设备数)
multimap.put("amt_ltv0", "amt_ltv0");
multimap.put("amt_ltv0", "num_install");
multimap.put("amt_ltv7", "amt_ltv7");
multimap.put("amt_ltv7", "num_install");
multimap.put("amt_ltv30", "amt_ltv30");
multimap.put("amt_ltv30", "num_install");
//arpu=注收比付费/排重激活设备数
multimap.put("arpu","amt_amount");
multimap.put("arpu","num_ins");
//arpu=注收比付费/付费设备数
multimap.put("arppu","amt_amount");
multimap.put("arppu","num_pay");
//付费率=付费设备数*100.0/排重激活设备数
multimap.put("rate_pay","num_pay");
multimap.put("rate_pay","num_ins");
//H5注册率=注册用户/排重点击
multimap.put("rate_reged_h5","num_register");
multimap.put("rate_reged_h5","num_click");
}
public static Multiset<String> getRateKeyFields() {
return multimap.keys();
}
public static Collection<String> getRateDependFields(String ratefield) {
return multimap.get(ratefield);
}
}
delete from view_column;
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_click','点击总数',1,0,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('dupnum_click_all','排重点击数',1,0,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('dupnum_click_day','按天排重点击',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_install','激活设备数',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_install','激活率',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('dupnum_reged_day','注册设备数',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('dupnum_reged_mon','排重注册设备数',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_reged','注册率',0,1,'base');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_retentiond1','D1留存',0,1,'retetion');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_retentiond3','D3留存',0,1,'retetion');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_retentiond7','D7留存',0,1,'retetion');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_retentiond30','D30留存',0,1,'retetion');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_ltv0','LTV0',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_ltv7','LTV7',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_ltv30','LTV30',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('amt_income_region','区间付费',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('amt_income_new_user','新增付费',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_payer_new_user','新增付费设备',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('amt_income_all_user','总付费',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_payer_all_user','总付费设备',0,1,'payment');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_click_fake','异常点击总数',0,1,'exception');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_click_fake','异常点击率',0,1,'exception');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('num_install_fake','异常激活设备总数',0,1,'exception');
insert into view_column (fieldcode, fieldname,ischeck,isedit,type) value ('rate_install_fake', '异常激活率',0,1,'exception');
-- 特殊渠道-参数配置
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=__MD5_IMEI__', 'ADVERTISING', null, '2015-03-19 16:41:13', null, 'd', null, 0, 0, 0, null, null, '多盟', '0', 'http://uri6.com/$surl', 'ry_coop', 'domob', null, null, '[ { "name": "sign_key", "key": "signKey" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2015-05-01 14:33:17', null, 'a', null, 0, 0, 0, null, null, 'adwords', '0', 'http://uri6.com/$surl', 'ry_coop', 'adwords', null, null, '[ { "name": "转化ID", "key": "adAppKey" }, { "name": "转化标签", "key": "adLabel" }, { "name": "bundleid", "key": "adBundleid" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=$01&bundleid=$BLINDED_SITE_ID&clickid=$IMP_ID&ip=$USER_IP', 'ADVERTISING', null, '2015-07-07 14:52:50', null, 'i', 'idfa=$IDA&bundleid=$BLINDED_SITE_ID&clickid=$IMP_ID&ip=$USER_IP', 1, 1, 1, null, null, 'inmobi', '0', 'https://uri6.com/$surl', 'ry_coop', 'inmobi', null, null, '[ { "name": "propertyId", "key": "propertyId" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('chn=gdt&campaignid=$surl', 'ADVERTISING', null, '2015-09-11 11:49:37', null, 'g', 'chn=gdt&campaignid=$surl', 0, 1, 1, null, null, '广点通', '0', 'http://uri6.com/adclick', 'ry_coop', 'gdt', null, null, '[ { "name": "密钥A(encrypt_key)", "key": "encryptKey" }, { "name": "密钥B(sign_key)", "key": "signKey" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('noredirect=true', 'ADVERTISING', null, '2016-02-29 14:20:16', null, 'w', 'noredirect=true', 0, 0, 1, null, null, '微信mp', '0', 'http://uri6.com/$surl', 'ry_coop', 'weixinmp', null, null, '[ { "name": "encrypt_key", "key": "encryptKey" }, { "name": "sign_key", "key": "signKey" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2016-04-11 19:01:22', null, 'a', 'bundleid={PACKAGE_NAME}&idfa={IDFA}&applovin_id={DID}&subchannel={APP_ID}&c={CAMPAIGN_NAME}', 0, 0, 1, null, null, 'applovin', '1', 'http://uri6.com/$surl', 'ry_coop', 'applovin', null, null, '[ { "name": "sdk_key", "key": "sdkKey" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2016-04-12 13:39:22', null, 'x', null, 0, 0, 0, null, null, '新数DSP', '1', 'http://uri6.com/$surl', 'ry_coop', 'xinshu', null, null, '[ { "name": "token", "key": "xsToken" }, { "name": "company_id", "key": "xsCompanyId" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2016-04-22 16:00:15', null, 'z', null, 0, 0, 0, null, null, '掌阅', '0', 'http://uri6.com/$surl', 'ry_coop', 'zhangyue', null, null, '[ { "name": "agentid", "key": "agentid" }, { "name": "agentpwd", "key": "agentpwd" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2016-04-27 20:39:59', null, 'y', 'idfa={IDFA}&bid={bid}', 0, 0, 1, null, null, '网易(有道)DSP', '1', 'https://uri6.com/$surl', 'ry_coop', 'youdao', null, null, '[ { "name": "youdao_conv_id", "key": "youdao_conv_id" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('chn=zht&campaignid=$surl', 'ADVERTISING', null, '2016-05-19 19:16:03', null, 'z', 'chn=zht&campaignid=$surl', 1, 0, 1, null, null, '智汇推', '0', 'https://uri6.com/adclick', 'ry_coop', 'zht', null, null, '[ { "name": "encrypt_key", "key": "encryptKey" }, { "name": "sign_key", "key": "signKey" } ]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, '2016-11-14 18:59:55', null, 't', null, 0, 0, 0, null, null, 'Thinklean', '0', 'http://uri6.com/$surl', 'ry_coop', 'thinklean', null, null, '[ { "name": "dev_key", "key": "thkDevkey" }, { "name": "pn", "key": "thkPn" } ]');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://advertiser.inmobiapis.com/tpce/v1/events/custom?trackingPartner=reyun&propertyId=$!args.get(''propertyId'')&impId=$!args.get(''clickid'')&ida=$!args.get(''idfa'')&eventName=register', 0, null, 444, null, null, null, 'code', '200', 'inmobi', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://advertiser.inmobiapis.com/tpce/v1/events/custom?trackingPartner=reyun&propertyId=$!args.get(''propertyId'')&impId=$!args.get(''clickid'')&ida=$!args.get(''idfa'')&eventName=loggedin', 0, null, 444, null, null, null, 'code', '200', 'inmobi', 'loggedin');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://advertiser.inmobiapis.com/tpce/v1/events/purchase?trackingPartner=reyun&propertyId=$!args.get(''propertyId'')&impId=$!args.get(''clickid'')&ida=$!args.get(''idfa'')&purchaseCurrency=CNY&purchaseValue=$!args.get(''currencyamnout'')&purchaseTime=$Format.when2Millis($!args.get(''when''))', 0, null, 444, null, null, null, 'code', '200', 'inmobi', 'payment');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://advertiser.inmobiapis.com/tpce/v1/events/custom?trackingPartner=reyun&propertyId=$!args.get(''propertyId'')&impId=$!args.get(''clickid'')&ida=$!args.get(''idfa'')&eventName=event', 0, null, 444, null, null, null, 'code', '200', 'inmobi', 'event');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://ut.appcoachs.net/conversion?tid=$!args.get(''clickid'')&source=reyun&adv_sub=Register&e_tkn=Register&goal_id=$!args.get(''goal_id'')', 0, null, 403, null, null, '200', null, null, 'appcoachS', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://install.mobvista.com/install?reyun_type=register&mobvista_type=reyun&mobvista_campuuid=$!args.get(''mobvista_campuuid'')&mobvista_clickid=$!args.get(''mobvista_clickid'')&mobvista_ip=$!args.get(''ip'')&mobvista_mac=$!args.get(''mac'')&mobvista_device=$Format.encode($Format.getUaDevice($!args.get(''ryua'')))&mobvista_os=$Format.getUaOs($!args.get(''ryua''))&#{if}($!args.get(''idfa''))mobvista_pl=ios&mobvista_devid=$!args.get(''idfa'')&mobvista_gaid=$!args.get(''idfa'')#{else}mobvista_pl=android&mobvista_devid=$!args.get(''androidid'')&mobvista_imei=$!args.get(''imei'')#{end}', 0, null, 405, null, null, '200', null, null, 'Mobvista', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://appt.eyangmedia.com/event?tid=$!args.get(''tid'')&adv=$!args.get(''adv'')&#{if}($!args.get(''idfa''))idfa=$Format.md5($!args.get(''idfa''))&os=iOS#{else}aid=$Format.md5($!args.get(''androidid''))&imei=$Format.md5($!args.get(''imei''))&os=Android#{end}&ts=$Format.when2Seconds($!args.get(''when''))&type=2', 0, null, 2514, null, null, '200', null, null, 'eyangmedia', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://appt.eyangmedia.com/event?tid=$!args.get(''tid'')&adv=$!args.get(''adv'')&#{if}($!args.get(''idfa''))idfa=$Format.md5($!args.get(''idfa''))&os=iOS#{else}aid=$Format.md5($!args.get(''androidid''))&imei=$Format.md5($!args.get(''imei''))&os=Android#{end}&ts=$Format.when2Seconds($!args.get(''when''))&type=5', 0, null, 2514, null, null, '200', null, null, 'eyangmedia', 'payment');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://appt.eyangmedia.com/event?tid=$!args.get(''tid'')&adv=$!args.get(''adv'')&#{if}($!args.get(''idfa''))idfa=$Format.md5($!args.get(''idfa''))&os=iOS#{else}aid=$Format.md5($!args.get(''androidid''))&imei=$Format.md5($!args.get(''imei''))&os=Android#{end}&ts=$Format.when2Seconds($!args.get(''when''))&type=3', 0, null, 2514, null, null, '200', null, null, 'eyangmedia', 'loggedin');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://oneway.fusetracking.com/pb?tid=$!args.get(''tid'')&idfa=$!args.get(''idfa'')&_id=34', 0, null, 646, null, null, '200', null, null, 'oneway', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://glispatrack.com/sp/mp.php?clickid=$!args.get(''clickid'')&type=multi&step=1&eventid=registration&oid=$!args.get(''idfa'')', 0, null, 406, null, null, '200', null, null, 'Glispa', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://chance.adsensor.org/event/f2f79d2e/$!args.get(''aid'')?ip=$!args.get(''ip'')&clickid=$!args.get(''clickid'')&idfa=$!args.get(''idfa'')', 0, null, 397, null, null, '200', null, null, 'chukong', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://global.ymtracking.com/conv?transaction_id=$!args.get(''transaction_id'')&affiliate_id=$!args.get(''affiliate_id'')&source=reyun', 0, null, 519, null, null, '200', null, null, 'yeahmobi', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://network.adsmarket.com/npe?npe_id=1&programid=$!args.get(''prg'')&visitor_cid=$!args.get(''cid'')&p1=$!args.get(''idfa'')', 0, null, 717, null, null, '200', null, null, 'matomy', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('https://vidoads.fusetracking.com/pb?tid=$!args.get(''tid'')', 0, null, 1594, null, null, '200', null, null, 'vidoads', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://t.gdt.qq.com/conv/app/$!args.get(''gdt_appid'')/conv?v=$Format.gdtEncrypt($!args)&conv_type=MOBILEAPP_COST&app_type=$Format.upperCase($!args.get(''app_type''))&advertiser_id=$!args.get(''advertiser_id'')', 0, null, 456, null, null, '', 'ret', '0', 'gdt', 'payment');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://manager.spotad.co/cmserver/analytics/firePixel?clickId=$!args.get(''clickId'')&conversionType=REGISTER', 0, null, 1940, null, null, '200', null, null, 'spotad', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://www.91mobcastle.com:9095/conversion?clickid=$!args.get(''clickid'')&c_idfa=$!args.get(''idfa'')&c_android_id=$!args.get(''androidid'')&c_imei=$!args.get(''imei'')&source=reyun', 0, null, 1981, null, null, '200', null, null, 'mobcastlead', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://tracking.taptica.com/aff_lsr?tt_cid=$!args.get(''tt_cid'')&tt_adv_id=$!args.get(''tt_adv_id'')&#{if}($!args.get(''idfa''))tt_idfa=$!args.get(''idfa'')#{else}tt_imei=$!args.get(''imei'')&tt_android_id=$!args.get(''androidid'')#{end}&tt_advertising_id=$!args.get(''tt_advertising_id'')&subchannel=$!args.get(''subchannel'')', 0, null, 2627, null, null, '200', null, null, 'taptica', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://rt.applovin.com/pix?event=postinstall&sub_event=register&package_name=$!args.get(''bundleid'')&sdk_key=$!args.get(''sdk_key'')&platform=ios&idfa=$!args.get(''idfa'')&did=$!args.get(''applovin_id'')', 0, null, 701, null, null, '200', null, null, 'applovin', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://rt.applovin.com/pix?event=postinstall&sub_event=loggedin&package_name=$!args.get(''bundleid'')&sdk_key=$!args.get(''sdk_key'')&platform=ios&idfa=$!args.get(''idfa'')&did=$!args.get(''applovin_id'')', 0, null, 701, null, null, '200', null, null, 'applovin', 'loggedin');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://rt.applovin.com/pix?event=checkout&package_name=$!args.get(''bundleid'')&sdk_key=$!args.get(''sdk_key'')&platform=ios&revenue=$!args.get(''currencyamount'')&currency_code=$!args.get(''currencytype'')&idfa=$!args.get(''idfa'')&did=$!args.get(''applovin_id'')', 0, null, 701, null, null, '200', null, null, 'applovin', 'payment');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://callback.api.youmi.net/v2/ad_eff?_ymid=$!args.get(''ymid'')&mac=$!args.get(''mac'')&ifa=$!args.get(''idfa'')', 0, null, 399, null, null, '200', null, null, 'youmi', 'reged');
INSERT INTO channel_integrate (callbackurl, iscallback, callback_key, channel, last_date, pub_date, successcode, successkey, successvalue, unique_name, what) VALUES ('http://callback.api.youmi.net/v2/ad_eff?_ymid=$!args.get(''ymid'')&mac=$!args.get(''mac'')&ifa=$!args.get(''idfa'')', 0, null, 399, null, null, '200', null, null, 'youmi', 'payment');
-- 添加激活回调设置
CREATE TABLE `callback_disable` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account` bigint(20) DEFAULT NULL,
`app` bigint(20) DEFAULT NULL,
`channel` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED
-- 20170215 Issue #45
update view_column set fieldname = '按天排重点击数' where fieldname = '按天排重点击';
update view_column set fieldname = '新增付费设备数' where fieldname = '新增付费设备';
update view_column set fieldname = '总付费设备数' where fieldname = '总付费设备';
update view_column set fieldname = '异常激活设备数' where fieldname = '异常激活设备总数';
-- 20170215 同步渠道编码
drop from channel where type is not null;
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'g', null, 0, 0, 0, null, null, '果盟', '1', 'http://uri6.com/$surl', 'ry_coop', 'guomob', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 0, null, null, '安沃', '1', 'http://uri6.com/$surl', 'ry_coop', 'adwo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'g', 'asdf', 0, 0, 0, null, null, '果合', '1', 'http://uri6.com/$surl', 'ry_coop', 'guohead', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 0, null, null, 'adSage', '1', 'http://uri6.com/$surl', 'ry_coop', 'adsage', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=__MD5_IMEI__', 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '多盟', '0', 'http://uri6.com/$surl', 'ry_coop', 'domob', null, null, '[
{
"name": "sign_key",
"key": "signKey"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'w', null, 0, 0, 0, null, null, '万普', '1', 'http://uri6.com/$surl', 'ry_coop', 'wapx', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'c', null, 0, 1, 0, null, null, '畅思', '1', 'http://uri6.com/$surl', 'ry_coop', 'chukong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, 'MEX', '1', 'http://uri6.com/$surl', 'ry_coop', 'ad-mex', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 1, 0, null, null, '有米', '1', 'http://uri6.com/$surl', 'ry_coop', 'youmi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '点入', '0', 'http://uri6.com/$surl', 'ry_coop', 'dianru', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, '土壳移动', '1', 'http://uri6.com/$surl', 'ry_coop', 'tuke', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 1, 0, null, null, 'appcoachS', '0', 'http://uri6.com/$surl', 'ry_coop', 'appcoachS', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('app_id={{{app_id}}}&android={{{isu}}}&clickid={{{id}}}', 'ADVERTISING', null, null, 0, 'v', null, 1, 0, 1, null, null, 'Vungle', '0', 'https://uri6.com/$surl', 'ry_coop', 'Vungle', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 1, 0, null, null, 'Mobvista', '0', 'http://uri6.com/$surl', 'ry_coop', 'Mobvista', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'g', null, 0, 1, 0, null, null, 'Glispa', '1', 'http://uri6.com/$surl', 'ry_coop', 'Glispa', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, '磨盘时代', '1', 'http://uri6.com/$surl', 'ry_coop', 'imopan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'q', null, 0, 0, 0, null, null, '趣米', '1', 'http://uri6.com/$surl', 'ry_coop', 'qumi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'l', null, 0, 0, 0, null, null, '力美积分墙', '1', 'http://uri6.com/$surl', 'ry_coop', 'limei', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'c', null, 0, 0, 0, null, null, '畅思chartboost', '1', 'http://uri6.com/$surl', 'ry_coop', 'chukong2', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 0, null, null, 'adwords', '0', 'http://uri6.com/$surl', 'ry_coop', 'adwords', null, null, '[
{
"name": "转化ID",
"key": "adAppKey"
},
{
"name": "转化标签",
"key": "adLabel"
},
{
"name": "bundleid",
"key": "adBundleid"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'k', null, 0, 0, 0, null, null, '筷子', '1', 'http://uri6.com/$surl', 'ry_coop', 'kuaizi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '优友', '1', 'http://uri6.com/$surl', 'ry_coop', 'youyou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '新游互联', '1', 'http://uri6.com/$surl', 'ry_coop', 'xinyou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=$01&bundleid=$BLINDED_SITE_ID&clickid=$IMP_ID&ip=$USER_IP', 'ADVERTISING', null, null, 0, 'i', 'idfa=$IDA&bundleid=$BLINDED_SITE_ID&clickid=$IMP_ID&ip=$USER_IP', 1, 1, 1, null, null, 'inmobi', '0', 'https://uri6.com/$surl', 'ry_coop', 'inmobi', null, null, '[
{
"name": "propertyId",
"key": "propertyId"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '豆盟', '1', 'http://uri6.com/$surl', 'ry_coop', 'doumeng', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'l', null, 0, 0, 0, null, null, '力美DSP', '0', 'http://uri6.com/$surl', 'ry_coop', 'limeidsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'b', null, 0, 0, 0, null, null, '璧合', '0', 'http://uri6.com/$surl', 'ry_coop', 'bihe', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('chn=gdt&campaignid=$surl', 'ADVERTISING', null, null, 0, 'g', 'chn=gdt&campaignid=$surl', 0, 1, 1, null, null, '广点通', '0', 'http://uri6.com/adclick', 'ry_coop', 'gdt', null, null, '[
{
"name": "密钥A(encrypt_key)",
"key": "encryptKey"
},
{
"name": "密钥B(sign_key)",
"key": "signKey"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '指盟', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhimeng', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '点乐', '1', 'http://uri6.com/$surl', 'ry_coop', 'dianle', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', 'idfa={idfa}&ip={ip}&subid={subid}', 0, 0, 1, null, null, 'avazu', '1', 'http://uri6.com/$surl', 'ry_coop', 'avazu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'g', null, 0, 0, 0, null, null, '搞趣', '1', 'http://uri6.com/$surl', 'ry_coop', 'gaoqu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '追书神器', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhuishu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 0, null, null, 'adview', '1', 'http://uri6.com/$surl', 'ry_coop', 'adview', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '限时免费大全', '1', 'http://uri6.com/$surl', 'ry_coop', 'xianmian', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=__UDID__', 'ADVERTISING', null, null, 0, 'a', 'muid=__UDID__', 1, 0, 1, null, null, '爱奇艺', '0', 'https://uri6.com/$surl', 'ry_coop', 'iqiyi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '宜搜', '1', 'http://uri6.com/$surl', 'ry_coop', 'yisou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'b', null, 0, 0, 0, null, null, '百思不得姐', '0', 'http://uri6.com/$surl', 'ry_coop', 'budejie', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '笑得合不拢嘴', '1', 'http://uri6.com/$surl', 'ry_coop', 'xdhblz', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'j', null, 0, 0, 0, null, null, '久邦数码', '1', 'http://uri6.com/$surl', 'ry_coop', 'jiubang', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei=__IMEI__&androidid=__ANDROIDID1__&ip=__IP__&ts=__TS__&os=__OS__&callback=__CALLBACK_URL__&noredirect=true', 'ADVERTISING', null, null, 0, 'j', 'idfa=__IDFA__&openudid=__OPENUDID__&ip=__IP__&ts=__TS__&os=__OS__&callback=__CALLBACK_URL__&noredirect=true', 1, 0, 1, null, null, '今日头条', '0', 'https://uri6.com/$surl', 'ry_coop', 'toutiao', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 0, 0, null, null, '试客', '1', 'http://uri6.com/$surl', 'ry_coop', 'shike', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 1, 0, null, null, 'YeahMobi', '0', 'http://uri6.com/$surl', 'ry_coop', 'yeahmobi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'f', null, 0, 0, 0, null, null, '非凡时代', '1', 'http://uri6.com/$surl', 'ry_coop', 'feifan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'q', null, 0, 0, 0, null, null, '钱咖', '1', 'http://uri6.com/$surl', 'ry_coop', 'qianka', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '大树 ‘dsp', '1', 'http://uri6.com/$surl', 'ry_coop', 'dashu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid={IMEI_SUM}&lbs={LBS}', 'ADVERTISING', null, null, 0, 'u', 'muid={IDFA_SUM}&lbs={LBS}', 0, 0, 1, null, null, 'UC头条', '0', 'http://uri6.com/$surl', 'ry_coop', 'uctoutiao', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '易连飞宇', '1', 'http://uri6.com/$surl', 'ry_coop', 'yilianfeiyu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '优数', '0', 'http://uri6.com/$surl', 'ry_coop', 'youshu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'f', null, 0, 0, 0, null, null, 'fyber', '1', 'http://uri6.com/$surl', 'ry_coop', 'fyber', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('kwid={keywordid}&creative={creative}', 'ADVERTISING', null, null, 0, 'b', 'kwid={keywordid}&creative={creative}', 0, 0, 1, null, null, '百度关键字', '0', 'http://uri6.com/$surl', 'ry_bd', 'baidusem', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('noredirect=true', 'ADVERTISING', null, null, 0, 'w', 'noredirect=true', 0, 0, 1, null, null, '微信mp', '0', 'http://uri6.com/$surl', 'ry_coop', 'weixinmp', null, null, '[
{
"name": "encrypt_key",
"key": "encryptKey"
},
{
"name": "sign_key",
"key": "signKey"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, '兔玩网', '1', 'http://uri6.com/$surl', 'ry_coop', 'tuwan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei={@imei}&mac={@mac}&baidu_appid={@appid}&cid={@cid}&crid={@crid}&traceid={@traceid}&ip={@ip}&devicetype={@devicetype}&osversion={@osversion}&pk={@pk}&noredirect=true', 'ADVERTISING', null, null, 0, 'b', 'idfa={@idfa}&mac={@mac}&baidu_appid={@appid}&cid={@cid}&crid={@crid}&traceid={@traceid}&ip={@ip}&devicetype={@devicetype}&osversion={@osversion}&pk={@pk}&noredirect=true', 0, 0, 1, null, null, '百度DSP', '0', 'http://uri6.com/$surl', 'ry_coop', 'baidudsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'r', null, 0, 0, 0, null, null, '仁盈软件', '1', 'http://uri6.com/$surl', 'ry_coop', 'renying', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'o', null, 0, 1, 0, null, null, 'oneway', '1', 'http://uri6.com/$surl', 'ry_coop', 'oneway', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, '1', null, 0, 0, 0, null, null, '18183', '1', 'http://uri6.com/$surl', 'ry_coop', '18183', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '掌通', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhangtong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid={IMEI_SUM}&lbs={LBS}', 'ADVERTISING', null, null, 0, 'u', 'muid={IDFA_SUM}&lbs={LBS}', 0, 0, 1, null, null, 'UC浏览器', '0', 'http://uri6.com/$surl', 'ry_coop', 'ucliulanqi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '睿晟', '0', 'http://uri6.com/$surl', 'ry_coop', 'ruisheng', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', 'bundleid={PACKAGE_NAME}&idfa={IDFA}&applovin_id={DID}&subchannel={APP_ID}&c={CAMPAIGN_NAME}', 0, 1, 1, null, null, 'applovin', '1', 'http://uri6.com/$surl', 'ry_coop', 'applovin', null, null, '[
{
"name": "sdk_key",
"key": "sdkKey"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '新数DSP', '1', 'http://uri6.com/$surl', 'ry_coop', 'xinshu', null, null, '[
{
"name": "token",
"key": "xsToken"
},
{
"name": "company_id",
"key": "xsCompanyId"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'h', null, 0, 0, 0, null, null, 'Helium', '1', 'http://uri6.com/$surl', 'ry_coop', 'helium', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 1, 0, null, null, 'matomy', '1', 'http://uri6.com/$surl', 'ry_coop', 'matomy', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('adu={adu}&androidid={did}&chn={adxid}&imp={imp_id}', 'ADVERTISING', null, null, 0, 'p', 'adu={adu}&idfa={did}&chn={adxid}&imp={imp_id}', 0, 0, 1, null, null, '盆友', '0', 'http://uri6.com/$surl', 'ry_coop', 'penyou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, 'mobcastle', '0', 'http://uri6.com/$surl', 'ry_coop', 'mobcastle', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '指尖互动', '1', 'http://uri6.com/$surl', 'ry_coop', 'fingermob', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'f', null, 0, 0, 0, null, null, '蜂巢', '0', 'http://uri6.com/$surl', 'ry_coop', 'fengchao', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'w', null, 0, 0, 0, null, null, '玩吧', '1', 'http://uri6.com/$surl', 'ry_coop', 'wanba', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, '图友DSP', '1', 'http://uri6.com/$surl', 'ry_coop', 'tuyou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'q', null, 0, 0, 0, null, null, '钱鹿', '1', 'http://uri6.com/$surl', 'ry_coop', 'qianlu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, 'TAD', '1', 'http://uri6.com/$surl', 'ry_coop', 'tad', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '掌阅', '0', 'http://uri6.com/$surl', 'ry_coop', 'zhangyue', null, null, '[
{
"name": "agentid",
"key": "agentid"
},
{
"name": "agentpwd",
"key": "agentpwd"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, '3', null, 0, 0, 0, null, null, '360', '2', 'http://uri6.com/$surl', 'ry_coop', '360', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'x', null, 0, 0, 0, null, null, '小米', '2', 'http://uri6.com/$surl', 'ry_coop', 'xiaomi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'u', null, 0, 0, 0, null, null, 'uc', '2', 'http://uri6.com/$surl', 'ry_coop', 'uc', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'w', null, 0, 0, 0, null, null, '豌豆荚', '2', 'http://uri6.com/$surl', 'ry_coop', 'wandoujia', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 't', null, 0, 0, 0, null, null, '腾讯应用宝', '2', 'http://uri6.com/$surl', 'ry_coop', 'tengxunyingyongbao', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'o', null, 0, 0, 0, null, null, 'oppo', '2', 'http://uri6.com/$surl', 'ry_coop', 'oppo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'v', null, 0, 0, 0, null, null, 'vivo(步步高)', '2', 'http://uri6.com/$surl', 'ry_coop', 'vivo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'h', null, 0, 0, 0, null, null, '华为', '2', 'http://uri6.com/$surl', 'ry_coop', 'huawei', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'l', null, 0, 0, 0, null, null, '联想', '2', 'http://uri6.com/$surl', 'ry_coop', 'lianxiang', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'j', null, 0, 0, 0, null, null, '金立', '2', 'http://uri6.com/$surl', 'ry_coop', 'jinli', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'k', null, 0, 0, 0, null, null, '酷派', '2', 'http://uri6.com/$surl', 'ry_coop', 'kupai', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'm', null, 0, 0, 0, null, null, '魅族', '2', 'http://uri6.com/$surl', 'ry_coop', 'meizu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, '3', null, 0, 0, 0, null, null, '优酷', '2', 'http://uri6.com/$surl', 'ry_coop', 'youku', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'p', null, 0, 0, 0, null, null, 'PPS', '2', 'http://uri6.com/$surl', 'ry_coop', 'pps', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'p', null, 0, 0, 0, null, null, 'pptv', '2', 'http://uri6.com/$surl', 'ry_coop', 'pptv', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'a', null, 0, 0, 0, null, null, '安智', '2', 'http://uri6.com/$surl', 'ry_coop', 'anzhi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'y', null, 0, 0, 0, null, null, '应用汇', '2', 'http://uri6.com/$surl', 'ry_coop', 'yingyonghui', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'd', null, 0, 0, 0, null, null, '当乐', '2', 'http://uri6.com/$surl', 'ry_coop', 'dangle', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, '4', null, 0, 0, 0, null, null, '4399', '2', 'http://uri6.com/$surl', 'ry_coop', '4399', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 's', null, 0, 0, 0, null, null, '搜狗', '2', 'http://uri6.com/$surl', 'ry_coop', 'sogou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'c', null, 0, 0, 0, null, null, '叉叉助手', '2', 'http://uri6.com/$surl', 'ry_coop', 'chachazhushou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'm', null, 0, 0, 0, null, null, '拇指玩', '2', 'http://uri6.com/$surl', 'ry_coop', 'muzhiwan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, '3', null, 0, 0, 0, null, null, '酷狗', '2', 'http://uri6.com/$surl', 'ry_coop', 'kugou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 'b', null, 0, 0, 0, null, null, 'bilbil', '2', 'http://uri6.com/$surl', 'ry_coop', 'bilbil', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'APPMARKET', null, null, 0, 's', null, 0, 0, 0, null, null, '手机百度', '2', 'http://uri6.com/$surl', 'ry_coop', 'shoujibaidu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '西洋镜', '1', 'http://uri6.com/$surl', 'ry_coop', 'xiyangjing', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'b', null, 0, 0, 0, null, null, 'BiddingX', '0', 'http://uri6.com/$surl', 'ry_coop', 'bx', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, '7', null, 0, 0, 0, null, null, '7日坐标', '1', 'http://uri6.com/$surl', 'ry_coop', '7ri', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', 'idfa={IDFA}&bid={bid}', 0, 0, 1, null, null, '网易(有道)DSP', '1', 'https://uri6.com/$surl', 'ry_coop', 'youdao', null, null, '[
{
"name": "youdao_conv_id",
"key": "youdao_conv_id"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, 'X-MOB', '0', 'http://uri6.com/$surl', 'ry_coop', 'xmob', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei=[IMEI]&lbs=[LBS]&callback=[CALLBACK]', 'ADVERTISING', null, null, 0, 'm', 'idfa=[IDFA]&lbs=[LBS]&callback=[CALLBACK]', 1, 0, 1, null, null, '陌陌', '0', 'https://uri6.com/$surl', 'ry_coop', 'momo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('', 'ADVERTISING', null, null, 0, 'r', 'mac={mac}&idfa={idfa}&noredirect=true', 0, 0, 1, null, null, '软猎', '1', 'http://uri6.com/$surl', 'ry_coop', 'ruanlie', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '掌上互动', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhangshanghudong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'l', null, 0, 0, 0, null, null, '灵境', '1', 'http://uri6.com/$surl', 'ry_coop', 'lingjing', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=__IMEI__', 'ADVERTISING', null, null, 0, 's', 'idfa=__IDFA__', 1, 0, 1, null, null, '搜狐汇算', '0', 'https://uri6.com/$surl', 'ry_coop', 'huisuan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'j', null, 0, 0, 0, null, null, '巨掌', '1', 'http://uri6.com/$surl', 'ry_coop', 'juzhang', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('chn=zht&campaignid=$surl', 'ADVERTISING', null, null, 0, 'z', 'chn=zht&campaignid=$surl', 1, 0, 1, null, null, '智汇推', '0', 'https://uri6.com/adclick', 'ry_coop', 'zht', null, null, '[
{
"name": "encrypt_key",
"key": "encryptKey"
},
{
"name": "sign_key",
"key": "signKey"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '点入DSP', '1', 'http://uri6.com/$surl', 'ry_coop', 'dianrudsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'x', null, 0, 0, 0, null, null, '仙果dsp', '2', 'http://uri6.com/$surl', 'ry_coop', 'xianguodsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', 'idfa={idfa}&ip={ip}&tid={tracker_partner_id}&aid={app_id}&noredirect=true', 0, 0, 1, null, null, 'Tapjoy', '1', 'http://uri6.com/$surl', 'ry_coop', 'tapjoy', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'e', null, 0, 0, 0, null, null, 'everyads', '1', 'http://uri6.com/$surl', 'ry_coop', 'everyads', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('&imp={imp_id}&androidid={did}&adu={adu}', 'ADVERTISING', null, null, 0, 'y', '&imp={imp_id}&idfa={did}&adu={adu}', 0, 0, 1, null, null, '鹰击', '0', 'http://uri6.com/$surl', 'ry_coop', 'yingji', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'g', null, 0, 0, 0, null, null, '果合视频', '1', 'http://uri6.com/$surl', 'ry_coop', 'guohevideo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '之行传媒', '0', 'http://uri6.com/$surl', 'ry_coop', 'zhixingchuanmei', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 0, 0, null, null, 'SYHS', '1', 'http://uri6.com/$surl', 'ry_coop', 'syhs', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, 'MobUpps', '1', 'http://uri6.com/$surl', 'ry_coop', 'mobupps', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('mac=##MAC##&muid=##IMEI##', 'ADVERTISING', null, null, 0, 'y', 'mac=##MAC##&idfa=##IDFA##&muid=##IDFAMD5##', 0, 0, 1, null, null, '优酷', '0', 'http://uri6.com/$surl', 'ry_coop', 'youku', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'j', null, 0, 0, 0, null, null, '聚鹏', '1', 'http://uri6.com/$surl', 'ry_coop', 'jupeng', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('mac=__mac__&muid=__md5_imei__&androidid=__md5_dpid__&callback=__cb_a__', 'ADVERTISING', null, null, 0, 'a', 'mac=__mac__&bundleid=__bundleid__&muid=__md5_did__&callback=__cb_b__', 0, 0, 1, null, null, 'Adoceans', '0', 'http://uri6.com/$surl', 'ry_coop', 'adoceans', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '掌游宝', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhangyoubao', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 0, 0, null, null, '时趣互动', '1', 'http://uri6.com/$surl', 'ry_coop', 'shiquhudong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 0, null, null, 'Astra', '1', 'http://uri6.com/$surl', 'ry_coop', 'fuseclick', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'v', null, 0, 1, 0, null, null, 'VidoAds', '0', 'http://uri6.com/$surl', 'ry_coop', 'vidoads', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'b', null, 0, 0, 0, null, null, '百度文学', '1', 'http://uri6.com/$surl', 'ry_coop', 'baiduwenxue', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'h', null, 0, 0, 0, null, null, '海数互联', '1', 'http://uri6.com/$surl', 'ry_coop', 'haishu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, '多点广告', '1', 'http://uri6.com/$surl', 'ry_coop', 'duodianad', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('idfa=[IDFA]', 'ADVERTISING', null, null, 0, 'a', null, 0, 0, 1, null, null, 'adcolony', '1', 'http://uri6.com/$surl', 'ry_coop', 'adcolony', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, '麦萌漫画', '1', 'http://uri6.com/$surl', 'ry_coop', 'maimengmanhua', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '亿玛', '0', 'http://uri6.com/$surl', 'ry_coop', 'yima', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'a', 'idfa={IDFA}', 0, 0, 1, null, null, 'Aduu', '1', 'http://uri6.com/$surl', 'ry_coop', 'aduu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, 'dmmobi', '1', 'http://uri6.com/$surl', 'ry_coop', 'dmmobi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'w', null, 0, 0, 0, null, null, '玩转互联', '0', 'http://uri6.com/$surl', 'ry_coop', 'wanzhuan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 1, 0, 0, null, null, '智汇推外链', '0', 'https://uri6.com/$surl', 'ry_coop', 'zhtwl', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '众橙', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhongcheng', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '银橙传媒', '0', 'http://uri6.com/$surl', 'ry_coop', 'yinchengchuanmei', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 1, 0, null, null, 'Spotad', '0', 'http://uri6.com/$surl', 'ry_coop', 'spotad', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'z', null, 0, 0, 0, null, null, '掌握', '1', 'http://uri6.com/$surl', 'ry_coop', 'zhangwo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'd', null, 0, 0, 0, null, null, 'AdPotato', '1', 'http://uri6.com/$surl', 'ry_coop', 'adpotato', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei={imei}&androidid={android_id}&clickid={clickid}&subchannel={n_id}', 'ADVERTISING', null, null, 0, 'm', 'idfa={idfa}&clickid={clickid}&subchannel={n_id}', 0, 1, 1, null, null, 'MobCastleAD', '0', 'http://uri6.com/$surl', 'ry_coop', 'mobcastlead', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'q', null, 0, 0, 0, null, null, '麒点', '0', 'http://uri6.com/$surl', 'ry_coop', 'keydot', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '易动手盟', '0', 'http://uri6.com/$surl', 'ry_coop', 'yidong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, 'TopDang', '0', 'http://uri6.com/$surl', 'ry_coop', 'topdang', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'r', null, 0, 0, 0, null, null, 'Rocket10', '0', 'http://uri6.com/$surl', 'ry_coop', 'rocket10', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, '1', null, 0, 0, 0, null, null, '1图1', '0', 'http://uri6.com/$surl', 'ry_coop', '1tu1', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid={android_id_md5}&ip={ip}&gameid={game_id}', 'ADVERTISING', null, null, 0, 'u', 'idfa={ifa}&ip={ip}&gameid={game_id}', 1, 0, 1, null, null, 'Unity', '0', 'https://uri6.com/$surl', 'ry_coop', 'unity', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'p', null, 0, 0, 0, null, null, 'PP助手', '0', 'http://uri6.com/$surl', 'ry_coop', 'ppzhushou', '', null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei={IMEI}&click_time={TS}&lbs={LBS}', 'ADVERTISING', null, null, 0, 'a', 'idfa={IDFA}&click_time={TS}&lbs={LBS}', 0, 0, 0, null, null, '神马搜索', '0', 'http://uri6.com/$surl', '', 'shenmasearch', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', 'idfa=idfa&cid=cid', 0, 0, 1, null, null, '云聚', '1', 'http://uri6.com/$surl', 'ry_coop', 'yunju', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'i', null, 0, 0, 0, null, null, 'ipromo', '0', 'http://uri6.com/$surl', 'ry_coop', 'ipromo', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'i', null, 0, 0, 0, null, null, 'Idvert', '1', 'http://uri6.com/$surl', 'ry_coop', 'idvert', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, '', null, 0, 0, 0, null, null, 'hina', '', 'http://uri6.com/$surl', '', '', null, 422, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'h', null, 0, 0, 0, null, null, '慧推', '0', 'http://uri6.com/$surl', 'ry_coop', 'huitui', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, '麦田', '0', 'http://uri6.com/$surl', 'ry_coop', 'maitian', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'h', null, 0, 0, 0, null, null, 'hina', '0', 'http://uri6.com/$surl', 'ry_coop', 'hina', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'l', null, 0, 0, 0, null, null, '乐视DSP', '0', 'http://uri6.com/$surl', 'ry_coop', 'leshidsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 0, 0, null, null, '纷熙移动', '1', 'http://uri6.com/$surl', 'ry_coop', 'fenxiyidong', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 't', null, 0, 0, 0, null, null, 'Thinklean', '0', 'http://uri6.com/$surl', 'ry_coop', 'thinklean', null, null, '[
{
"name": "dev_key",
"key": "thkDevkey"
},
{
"name": "pn",
"key": "thkPn"
}
]');
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '易杨DSP', '0', 'http://uri6.com/$surl', 'ry_coop', 'eyangmedia', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('muid=__IMEI__&mac=__MAC__&ip=__IP__&os=__OS__&ts=__TS__', 'ADVERTISING', null, null, 0, 'a', 'idfa=__IDFA__&mac=__MAC__&ip=__IP__&os=__OS__&ts=__TS__', 1, 0, 1, null, null, '爱奇艺DSP', '0', 'https://uri6.com/$surl', 'ry_coop', 'iqiyidsp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 's', null, 0, 0, 0, null, null, '上榜科技', '0', 'http://uri6.com/$surl', 'ry_coop', 'shangbangkeji', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('ip=__IP__&muid=__MUID__&mac=__MAC__&androidid=__ANDROID_ID__&&imei=__IMEI__&&callback=__ACTIVE_CB__&noredirect=true', 'ADVERTISING', null, null, 0, 'j', 'ip=__IP__&muid=__MUID__&mac=__MAC__&bundleid=__BUNDLEID__&idfa=__IDFA__&callback=__ACTIVE_CB__&noredirect=true', 0, 0, 1, null, null, '极光', '0', 'http://uri6.com/$surl', 'ry_coop', 'jiguang', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'k', null, 0, 0, 0, null, null, '快手', '0', 'http://uri6.com/$surl', 'ry_coop', 'kuaishou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'y', null, 0, 0, 0, null, null, '隐逸数字', '0', 'http://uri6.com/$surl', 'ry_coop', 'yinyishuzi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'e', null, 0, 0, 0, null, null, 'echovalue', '0', 'http://uri6.com/$surl', 'ry_coop', 'echovalue', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('tt_cid={tt_cid}&tt_adv_id={tt_adv_id}&imei={tt_imei}&tt_advertising_id={tt_advertising_id}&androidid={tt_android_id}&subchannel={aff_id}_{tt_sub_aff}', 'ADVERTISING', null, null, 0, 't', 'tt_cid={tt_cid}&tt_adv_id={tt_adv_id}&idfa={tt_idfa}&subchannel={aff_id}_{tt_sub_aff}', 0, 1, 1, null, null, 'Taptica', '0', 'http://uri6.com/$surl', 'ry_coop', 'taptica', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, 'ADVERTISING', null, null, 0, 'm', null, 0, 0, 0, null, null, 'Mediamob', '0', 'http://uri6.com/$surl', 'ry_coop', 'mediamob', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('aff_sub={click_id}&subchannel={aff_pub}&payout={payout}&advertisingid={advertising_id}&androidid={android_id}&ip={ip}&mac={mac}', null, null, null, 0, 'm', 'aff_sub={click_id}&subchannel={aff_pub}&payout={payout}ip={ip}&idfa={idfa}&mac={mac}', 0, 0, 1, null, null, 'MobHuge', '0', 'http://uri6.com/$surl', 'ry_coop', 'mobhuge', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'a', 'mac={mac_address}&idfa={ios_ifa}&ip={session_ip}&transaction_id={transaction_id}&subchannel={affiliate_id}', 0, 0, 1, null, null, 'AppLift', '1', 'http://uri6.com/$surl', 'ry_coop', 'applift', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'z', null, 0, 0, 0, null, null, '灼见', '0', 'http://uri6.com/$surl', 'ry_coop', 'zhuojian', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'c', null, 0, 0, 0, null, null, 'centrixlink', '0', 'http://uri6.com/$surl', 'ry_coop', 'centrixlink', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('subchannel=%WebID%', null, null, null, 0, 'j', 'subchannel=%WebID%', 0, 0, 1, null, null, '巨鲨', '0', 'http://uri6.com/$surl', 'ry_coop', 'jusha', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'd', 'mac={MAC}&idfa={IDFA}&subchannel={subchannel}&clkid={clkid}', 0, 0, 1, null, null, 'dotinapp', '1', 'http://uri6.com/$surl', 'ry_coop', 'dotinapp', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'c', null, 0, 0, 0, null, null, 'Codrim', '1', 'http://uri6.com/$surl', 'ry_coop', 'codrim', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'b', null, 0, 0, 0, null, null, '比邻弘科', '1', 'http://uri6.com/$surl', 'ry_coop', 'bilinhongke', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'd', null, 0, 0, 0, null, null, '斗鱼', '1', 'http://uri6.com/$surl', 'ry_coop', 'douyu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'a', null, 0, 0, 0, null, null, 'adwan', '1', 'http://uri6.com/$surl', 'ry_coop', 'adwan', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'm', null, 0, 0, 0, null, null, 'miercn', '1', 'http://uri6.com/$surl', 'ry_coop', 'miercn', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, '9', null, 0, 0, 0, null, null, '91助手', '1', 'http://uri6.com/$surl', 'ry_coop', '91zhushou', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 's', 'transaction_id={transaction_id}&affiliate_id={affiliate_id}&idfa={ios_ifa}', 0, 0, 1, null, null, 'surikate', '1', 'http://uri6.com/$surl', 'ry_coop', 'surikate', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'g', null, 0, 0, 0, null, null, 'Gamebeats', '1', 'http://uri6.com/$surl', 'ry_coop', 'gamebeats', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, '3', null, 1, 0, 1, null, null, '360卫士', '1', 'https://uri6.com/$surl', 'ry_coop', '360weishi', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES (null, null, null, null, 0, 'y', null, 1, 0, 1, null, null, '云数', '1', 'https://uri6.com/$surl', 'ry_coop', 'yunshu', null, null, null);
INSERT INTO channel (androidparam, category, create_account, create_time, del_flag, firstchar, iosparam, ishttps, isintegrate, istrackurlspecial, modify_account, modify_time, name, os, trackurl, type, unique_name, url, account, special_params) VALUES ('imei=__IMEIORI__&click_time=__TS__&callback=URL', null, null, null, 0, 'w', 'idfa=__IDFA__&click_time=__TS__&callback=URL', 0, 0, 1, null, null, 'weAD', '0', 'http://uri6.com/$surl', 'ry_coop', 'wead', null, null, null);
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
metadata-complete="false"
version="3.1">
<!-- ===================================================================== -->
<!-- This file contains the default descriptor for web applications. -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- The intent of this descriptor is to include jetty specific or common -->
<!-- configuration for all webapps. If a context has a webdefault.xml -->
<!-- descriptor, it is applied before the contexts own web.xml file -->
<!-- -->
<!-- A context may be assigned a default descriptor by: -->
<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
<!-- + Passed an arg to addWebApplications -->
<!-- -->
<!-- This file is used both as the resource within the jetty.jar (which is -->
<!-- used as the default if no explicit defaults descriptor is set) and it -->
<!-- is copied to the etc directory of the Jetty distro and explicitly -->
<!-- by the jetty.xml file. -->
<!-- -->
<!-- ===================================================================== -->
<description>
Default web.xml file.
This file is applied to a Web application before it's own WEB_INF/web.xml file
</description>
<!-- ==================================================================== -->
<!-- Removes static references to beans from javax.el.BeanELResolver to -->
<!-- ensure webapp classloader can be released on undeploy -->
<!-- ==================================================================== -->
<listener>
<listener-class>org.eclipse.jetty.servlet.listener.ELContextCleaner</listener-class>
</listener>
<!-- ==================================================================== -->
<!-- Removes static cache of Methods from java.beans.Introspector to -->
<!-- ensure webapp classloader can be released on undeploy -->
<!-- ==================================================================== -->
<listener>
<listener-class>org.eclipse.jetty.servlet.listener.IntrospectorCleaner</listener-class>
</listener>
<!-- ==================================================================== -->
<!-- Context params to control Session Cookies -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!--
UNCOMMENT TO ACTIVATE
<context-param>
<param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
<param-value>127.0.0.1</param-value>
</context-param>
<context-param>
<param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
<param-value>/</param-value>
</context-param>
<context-param>
<param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
<param-value>-1</param-value>
</context-param>
-->
<!-- ==================================================================== -->
<!-- The default servlet. -->
<!-- This servlet, normally mapped to /, provides the handling for static -->
<!-- content, OPTIONS and TRACE methods for the context. -->
<!-- The following initParameters are supported: -->
<!--
* acceptRanges If true, range requests and responses are
* supported
*
* dirAllowed If true, directory listings are returned if no
* welcome file is found. Else 403 Forbidden.
*
* welcomeServlets If true, attempt to dispatch to welcome files
* that are servlets, but only after no matching static
* resources could be found. If false, then a welcome
* file must exist on disk. If "exact", then exact
* servlet matches are supported without an existing file.
* Default is true.
*
* This must be false if you want directory listings,
* but have index.jsp in your welcome file list.
*
* redirectWelcome If true, welcome files are redirected rather than
* forwarded to.
*
* gzip If set to true, then static content will be served as
* gzip content encoded if a matching resource is
* found ending with ".gz"
*
* resourceBase Set to replace the context resource base
*
* resourceCache If set, this is a context attribute name, which the servlet
* will use to look for a shared ResourceCache instance.
*
* relativeResourceBase
* Set with a pathname relative to the base of the
* servlet context root. Useful for only serving static content out
* of only specific subdirectories.
*
* pathInfoOnly If true, only the path info will be applied to the resourceBase
*
* stylesheet Set with the location of an optional stylesheet that will be used
* to decorate the directory listing html.
*
* aliases If True, aliases of resources are allowed (eg. symbolic
* links and caps variations). May bypass security constraints.
*
* etags If True, weak etags will be generated and handled.
*
* maxCacheSize The maximum total size of the cache or 0 for no cache.
* maxCachedFileSize The maximum size of a file to cache
* maxCachedFiles The maximum number of files to cache
*
* useFileMappedBuffer
* If set to true, it will use mapped file buffer to serve static content
* when using NIO connector. Setting this value to false means that
* a direct buffer will be used instead of a mapped file buffer.
* By default, this is set to true.
*
* cacheControl If set, all static content will have this value set as the cache-control
* header.
*
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>aliases</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>acceptRanges</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>welcomeServlets</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>redirectWelcome</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>maxCacheSize</param-name>
<param-value>256000000</param-value>
</init-param>
<init-param>
<param-name>maxCachedFileSize</param-name>
<param-value>200000000</param-value>
</init-param>
<init-param>
<param-name>maxCachedFiles</param-name>
<param-value>2048</param-value>
</init-param>
<init-param>
<param-name>gzip</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>etags</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
<!--
<init-param>
<param-name>resourceCache</param-name>
<param-value>resourceCache</param-value>
</init-param>
-->
<!--
<init-param>
<param-name>cacheControl</param-name>
<param-value>max-age=3600,public</param-value>
</init-param>
-->
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- ==================================================================== -->
<!-- JSP Servlet -->
<!-- This is the jasper JSP servlet from the jakarta project -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- The JSP page compiler and execution servlet, which is the mechanism -->
<!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
<!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
<!-- following initialization parameters (default values are in square -->
<!-- brackets): -->
<!-- -->
<!-- checkInterval If development is false and reloading is true, -->
<!-- background compiles are enabled. checkInterval -->
<!-- is the time in seconds between checks to see -->
<!-- if a JSP page needs to be recompiled. [300] -->
<!-- -->
<!-- compiler Which compiler Ant should use to compile JSP -->
<!-- pages. See the Ant documenation for more -->
<!-- information. [javac] -->
<!-- -->
<!-- classdebuginfo Should the class file be compiled with -->
<!-- debugging information? [true] -->
<!-- -->
<!-- classpath What class path should I use while compiling -->
<!-- generated servlets? [Created dynamically -->
<!-- based on the current web application] -->
<!-- Set to ? to make the container explicitly set -->
<!-- this parameter. -->
<!-- -->
<!-- development Is Jasper used in development mode (will check -->
<!-- for JSP modification on every access)? [true] -->
<!-- -->
<!-- enablePooling Determines whether tag handler pooling is -->
<!-- enabled [true] -->
<!-- -->
<!-- fork Tell Ant to fork compiles of JSP pages so that -->
<!-- a separate JVM is used for JSP page compiles -->
<!-- from the one Tomcat is running in. [true] -->
<!-- -->
<!-- ieClassId The class-id value to be sent to Internet -->
<!-- Explorer when using <jsp:plugin> tags. -->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
<!-- -->
<!-- javaEncoding Java file encoding to use for generating java -->
<!-- source files. [UTF-8] -->
<!-- -->
<!-- keepgenerated Should we keep the generated Java source code -->
<!-- for each page instead of deleting it? [true] -->
<!-- -->
<!-- logVerbosityLevel The level of detailed messages to be produced -->
<!-- by this servlet. Increasing levels cause the -->
<!-- generation of more messages. Valid values are -->
<!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
<!-- [WARNING] -->
<!-- -->
<!-- mappedfile Should we generate static content with one -->
<!-- print statement per input line, to ease -->
<!-- debugging? [false] -->
<!-- -->
<!-- -->
<!-- reloading Should Jasper check for modified JSPs? [true] -->
<!-- -->
<!-- suppressSmap Should the generation of SMAP info for JSR45 -->
<!-- debugging be suppressed? [false] -->
<!-- -->
<!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
<!-- dumped to a file? [false] -->
<!-- False if suppressSmap is true -->
<!-- -->
<!-- scratchdir What scratch directory should we use when -->
<!-- compiling JSP pages? [default work directory -->
<!-- for the current web application] -->
<!-- -->
<!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
<!-- -->
<!-- xpoweredBy Determines whether X-Powered-By response -->
<!-- header is added by generated servlet [false] -->
<!-- -->
<!-- If you wish to use Jikes to compile JSP pages: -->
<!-- Set the init parameter "compiler" to "jikes". Define -->
<!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
<!-- to cause Jikes to emit error messages in a format compatible with -->
<!-- Jasper. -->
<!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
<!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<servlet id="jsp">
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>logVerbosityLevel</param-name>
<param-value>DEBUG</param-value>
</init-param>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.7</param-value>
</init-param>
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.7</param-value>
</init-param>
<!--
<init-param>
<param-name>classpath</param-name>
<param-value>?</param-value>
</init-param>
-->
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspf</url-pattern>
<url-pattern>*.jspx</url-pattern>
<url-pattern>*.xsp</url-pattern>
<url-pattern>*.JSP</url-pattern>
<url-pattern>*.JSPF</url-pattern>
<url-pattern>*.JSPX</url-pattern>
<url-pattern>*.XSP</url-pattern>
</servlet-mapping>
<!-- ==================================================================== -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- ==================================================================== -->
<!-- Default MIME mappings -->
<!-- The default MIME mappings are provided by the mime.properties -->
<!-- resource in the org.eclipse.jetty.server.jar file. Additional or modified -->
<!-- mappings may be specified here -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- UNCOMMENT TO ACTIVATE
<mime-mapping>
<extension>mysuffix</extension>
<mime-type>mymime/type</mime-type>
</mime-mapping>
-->
<!-- ==================================================================== -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- ==================================================================== -->
<locale-encoding-mapping-list>
<locale-encoding-mapping>
<locale>ar</locale>
<encoding>ISO-8859-6</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>be</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>bg</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>ca</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>cs</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>da</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>de</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>el</locale>
<encoding>ISO-8859-7</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>en</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>es</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>et</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>fi</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>fr</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>hr</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>hu</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>is</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>it</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>iw</locale>
<encoding>ISO-8859-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>ja</locale>
<encoding>Shift_JIS</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>ko</locale>
<encoding>EUC-KR</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>lt</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>lv</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>mk</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>nl</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>no</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>pl</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>pt</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>ro</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>ru</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sh</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sk</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sl</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sq</locale>
<encoding>ISO-8859-2</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sr</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>sv</locale>
<encoding>ISO-8859-1</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>tr</locale>
<encoding>ISO-8859-9</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>uk</locale>
<encoding>ISO-8859-5</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>zh</locale>
<encoding>GB2312</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>zh_TW</locale>
<encoding>Big5</encoding>
</locale-encoding-mapping>
</locale-encoding-mapping-list>
<security-constraint>
<web-resource-collection>
<web-resource-name>Disable TRACE</web-resource-name>
<url-pattern>/</url-pattern>
<http-method>TRACE</http-method>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Enable everything but TRACE</web-resource-name>
<url-pattern>/</url-pattern>
<http-method-omission>TRACE</http-method-omission>
</web-resource-collection>
</security-constraint>
</web-app>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M13,5V3h2v2H13z M9,7h2v2H9V7z M9,3h2v2H9V3z M5,11h2v2H5V11z M5,7h2v2H5V7z M5,3h2v2H5V3z M1,11
h2v2H1V11z M1,7h2v2H1V7z M1,3h2v2H1V3z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M15.5,7.1c0,0.1,0,0.2,0,0.4h-0.9l0,0h-5h-1v-1V0.6c0.2,0,0.3-0.1,0.5-0.1s0.3,0,0.5,0.1
c1.3,0.1,2.4,0.5,3.4,1.2c0,0,0,0,0,0c0.3,0.2,0.6,0.5,0.8,0.7c0,0.1,0.1,0.1,0.1,0.2c0.2,0.2,0.4,0.5,0.6,0.8
c0.1,0.1,0.1,0.3,0.2,0.4c0.1,0.2,0.3,0.4,0.4,0.7c0.1,0.2,0.1,0.4,0.2,0.7c0.1,0.2,0.1,0.3,0.2,0.5c0.1,0.4,0.1,0.8,0.1,1.3l0,0
C15.5,7,15.5,7.1,15.5,7.1z M9.5,1.5v4.9h5C14.2,3.9,12.1,1.8,9.5,1.5z M13.4,9c0,0.2,0,0.3-0.1,0.5c-0.1,1.3-0.5,2.4-1.2,3.4
c0,0,0,0,0,0c-0.2,0.3-0.5,0.6-0.7,0.8c-0.1,0-0.1,0.1-0.2,0.1c-0.2,0.2-0.5,0.4-0.7,0.6c-0.1,0.1-0.3,0.1-0.4,0.2
c-0.2,0.1-0.4,0.3-0.7,0.4c-0.2,0.1-0.4,0.1-0.7,0.2c-0.2,0.1-0.3,0.1-0.5,0.2c-0.4,0.1-0.8,0.1-1.3,0.1c-3.6,0-6.5-2.9-6.5-6.5
c0-0.4,0-0.9,0.1-1.3c0-0.2,0.1-0.3,0.2-0.5C0.8,7,0.9,6.8,1,6.5c0.1-0.2,0.2-0.5,0.3-0.7c0.1-0.1,0.1-0.3,0.2-0.4
C1.7,5.2,1.9,5,2.1,4.7c0-0.1,0.1-0.1,0.1-0.2c0.3-0.3,0.5-0.5,0.8-0.7c0,0,0,0,0,0c0.9-0.7,2.1-1.2,3.3-1.2c0.2,0,0.3-0.1,0.5-0.1
c0.2,0,0.3,0,0.5,0.1v5.9h5.9C13.4,8.7,13.4,8.8,13.4,9z M7.5,9.5h-1v-1V3.6c-2.8,0.3-5,2.6-5,5.4c0,3,2.4,5.5,5.5,5.5
c2.9,0,5.2-2.2,5.4-5H7.5z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M14.5,7.4v5.9c0,1.1-0.9,2-2,2h-9c-1.1,0-2-0.9-2-2V7.4c-0.6,0-1-0.4-1-1v-3c0-0.6,0.4-1,1-1h5.6
L5.7,1.1l0.7-0.7l1.8,1.7l1.8-1.7l0.7,0.7L9.3,2.5h5.2c0.6,0,1,0.4,1,1v3C15.5,7,15.1,7.4,14.5,7.4z M8.5,14.4h4c0.6,0,1-0.4,1-1
V7.4h-5V14.4z M7.5,3.5h-6v3h6V3.5z M7.5,7.4h-5v5.9c0,0.6,0.4,1,1,1h4V7.4z M14.5,3.5h-6v3h6V3.5z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M14.5,10c0,0.7-0.4,1.2-1,1.4v3.1h-1v-3.1c-0.6-0.2-1-0.7-1-1.4s0.4-1.2,1-1.4V1.5h1v7.1
C14.1,8.8,14.5,9.3,14.5,10z M8.5,8.4v6.1h-1V8.4c-0.6-0.2-1-0.7-1-1.4s0.4-1.2,1-1.4V1.5h1v4.1c0.6,0.2,1,0.7,1,1.4
S9.1,8.2,8.5,8.4z M3.5,6.4v8.1h-1V6.4c-0.6-0.2-1-0.7-1-1.4s0.4-1.2,1-1.4V1.5h1v2.1c0.6,0.2,1,0.7,1,1.4S4.1,6.2,3.5,6.4z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M15.3,11.1c0.4,0.5,0.7,1.2,0.7,1.9c0,1.7-1.3,3-3,3c-1,0-1.8-0.5-2.4-1.2C10.1,14.9,9.6,15,9,15
c-2.8,0-5.2-1.7-6.3-4C1.2,10.8,0,9.5,0,8s1.2-2.8,2.7-3C3.8,2.7,6.2,1,9,1c0.6,0,1.1,0.1,1.6,0.2C11.2,0.5,12,0,13,0
c1.7,0,3,1.3,3,3c0,0.7-0.3,1.4-0.7,1.9C15.7,5.9,16,6.9,16,8S15.7,10.1,15.3,11.1z M1,8c0,1.1,0.9,2,2,2s2-0.9,2-2S4.1,6,3,6
S1,6.9,1,8z M13,1c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S14.1,1,13,1z M14.5,5.6C14,5.8,13.5,6,13,6c-1.7,0-3-1.3-3-3
c0-0.3,0.1-0.6,0.1-0.9C9.8,2,9.4,2,9,2C6.7,2,4.8,3.3,3.8,5.1C5.1,5.5,6,6.6,6,8s-0.9,2.5-2.2,2.9c1,1.8,3,3.1,5.2,3.1
c0.4,0,0.8,0,1.1-0.1C10.1,13.6,10,13.3,10,13c0-1.7,1.3-3,3-3c0.5,0,1,0.2,1.5,0.4C14.8,9.7,15,8.9,15,8S14.8,6.3,14.5,5.6z M13,11
c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S14.1,11,13,11z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-41 43 16 16" style="enable-background:new -41 43 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_1_" class="st0" d="M-27.9,54.9h-10.4c-0.8,0-1.5-0.6-1.5-1.5l0.1-6.5c0-0.8,0.6-1.5,1.5-1.5h10.5
c0.8,0,1.5,0.6,1.5,1.5l-0.1,6.6C-26.4,54.3-27,54.9-27.9,54.9z M-34.6,54.2h3v-0.7h-3V54.2z M-27.1,46.8c0-0.4-0.4-0.7-0.7-0.7
h-10.5c-0.4,0-0.7,0.3-0.7,0.7l-0.1,5.1c0,0.4,0.4,0.7,0.7,0.7h10.5c0.4,0,0.7-0.4,0.7-0.7L-27.1,46.8z M-30.9,57.3h-4.5v-1.8h4.5
V57.3z"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
<style type="text/css">
.st0{fill:#4186EC;}
</style>
<path id="XMLID_2_" class="st0" d="M12.7,11.3v2.4c0,0.8-0.7,1.5-1.5,1.5H4.6c-0.8,0-1.5-0.7-1.5-1.5v-2.4H1.5V3.2h1.6V2.3
c0-0.8,0.7-1.5,1.5-1.5h6.7c0.8,0,1.5,0.7,1.5,1.5v0.9h1.6v8.1H12.7z M6.8,14.5H9v-0.7H6.8V14.5z M3.9,12.2c0,0.4,0.3,0.7,0.7,0.7
h6.7c0.4,0,0.7-0.3,0.7-0.7v-0.9H3.9V12.2z M3.9,4.4H3.1v6h0.8V7.5H7v2.9h0.8v-6H7v2.4H3.9V4.4z M12,2.3c0-0.4-0.4-0.7-0.8-0.7H4.6
c-0.4,0-0.7,0.4-0.7,0.7v0.9H12V2.3z M12.3,6.9c-0.4-0.4-0.9-0.5-1.4-0.5c-0.4,0-0.7,0.1-1.1,0.4l0.4-1.7h2.5V4.4h-3L9,7.5l0.7,0.1
c0.1-0.2,0.3-0.4,0.4-0.4c0.2-0.1,0.4-0.2,0.6-0.2c0.4,0,0.7,0.1,1,0.3c0.3,0.2,0.3,0.5,0.3,1c0,0.4-0.1,0.8-0.3,1.1
c-0.2,0.3-0.5,0.4-0.9,0.4c-0.4,0-0.6-0.1-0.8-0.3C9.8,9.4,9.7,9.1,9.6,8.7L8.8,8.8C8.9,9.3,9.1,9.7,9.5,10c0.3,0.3,0.8,0.4,1.3,0.4
c0.7,0,1.2-0.2,1.6-0.7c0.3-0.3,0.4-0.9,0.4-1.4S12.7,7.2,12.3,6.9z"/>
</svg>
(function(){
var tempVersion = new Date().getTime();
angular.module("app.active")
.config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
var menu = "active",html = ["product"];
$stateProvider.state(menu,{
url:"",
templateUrl: '/template/menu/collect.html?r='+tempVersion,
controller: "collectCtrl"
});
html.forEach(function(h){
$stateProvider.state('collect.' + h,{
url:"/" + menu + "/" + h,
views:{
"content@":{
templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
controller: h +"Ctrl"
}
}
});
});
}]);
})();
(function () {
'use strict';
angular.module("app")
.factory("ToolService",["$rootScope","$timeout","UtilService",toolservice]);
function toolservice($rootScope,$timeout,UtilService){
var service = {},that = $rootScope,
rootmenu = {"admonitor":"广告监测","behavior":"行为分析","export":"数据导出","management":"管理中心"},
menu = {"custommenu": "行业看单","eventstats": "事件分析","funnel": "漏斗转化","retention": "留存分析",
"intelligentpath": "智能路径","usergroup": "用户分群","event": "APP事件管理","profile": "用户属性管理",
"logtool": "日志流","report": "下载报表","app": "产品中心","auth": "成员管理"};
service.setName = function(name){
that.name = name;
}
service.getName = function(){
return that.name;
}
service.isDemoUser = function(){
return (UtilService.getCookie("ryioUname") == 'demo@reyun.com');
}
service.getChannelCampaignList = function(){
var list = [
{id:"channel",name:"渠道"},
{id:"campgroup",name:"活动组"},
{id:"campaign",name:"活动"}
];
return UtilService.cloneJSON(list);
}
service.getPackTypeList = function(){
var list = [
{id:"all",name:"全部"},
{id:"APPMARKET",name:"分包"},
{id:"ADVERTISING",name:"分链接"}
];
return UtilService.cloneJSON(list);
}
service.getDeviceTypeList = function(){
var list = [
{id:"device",name:"按设备看"},
{id:"user",name:"按账号看"}
];
return UtilService.cloneJSON(list);
}
/**
* [getChannelCampaignUrl description]
* @param type
* @param appid
* @param cid 渠道ID
* @return
*/
service.getChannelCampaignParams = function(type,appid,cid){
var url = "",txt = "";
if(type == 'channel'){ //渠道
url = appid + "/channel/findall";
txt = "渠道";
}
else if(type == 'campgroup'){//活动组
url = appid + "/campgroup/findall";
txt = "活动组";
}
else if(type == 'campbychannel'){//应用渠道下的活动
url = appid + "/campaign/findbychannel?channelid="+cid;
txt = "活动";
}
else{
url = appid + "/campaign/findall";
txt = "活动";
}
return {
url :url,
txt:txt
};
}
/**
* [getParams description]
* @param {[type]} obj 一般为$scope
* @param {[type]} flag 1:有渠道、活动组、活动筛选
* @return {[type]} [description]
*/
service.getParams = function(obj,flag){
var params = {appid:obj.appid};
if(obj.date){
params.startdate = obj.date.startDate;
params.enddate = obj.date.endDate;
}
if(flag && flag == 1 && obj.typeInfoIds != "" && obj.typeInfoIds != -1){{
switch(obj.typeId){
case "campgroup":
params.cgroupid = obj.typeInfoIds;
break;
case "campaign":
params.campaignid = obj.typeInfoIds;
break;
case "channel":
default:
params.cid = obj.typeInfoIds;
break;
}
}}
return params;
}
service.getOneColors = function(){
return ["#1fb9e9"];
}
service.getTwoColors = function(){
return ["#1fb9e9","#f8a20f"];
}
service.getThreeColors = function(){
return ["#1fb9e9","#f8a20f","#8e6eb6"];
}
service.getSixColors = function(){
return ["#1fb9e9","#f8a20f","#8e6eb6","#9cc272","#f36e55","#00b37f"];
}
service.getTenColors = function(){
return ["#1fb9e9","#f8a20f","#00b37f","#f36e55","#5c9eff","#fccc01","#9cc272","#ec407a","#8e6eb6","#cddc39"];
}
service.getToday = function(){
return {
startDate:UtilService.getDay(0),
endDate:UtilService.getDay(0)
}
}
service.getYesDay = function(){
return {
startDate:UtilService.getDay(-1),
endDate:UtilService.getDay(-1)
}
}
service.getLastDays = function(d,flag){
if(angular.isUndefined(flag)){ //默认最大显示昨天
flag = -1;
}
else{
if(d>0){
d -= 1;
}
else{
d += 1;
}
}
return {
startDate:UtilService.getDay(d),
endDate:UtilService.getDay(flag)
}
}
service.getLastWeeks = function(d){
var w = UtilService.getNowWeekNum(),
date = new Date(),
year = date.getFullYear();
var range = {end:year+UtilService.getStr(w)},pd = d + w +1;
if(pd > 0 ){
range.start = year + UtilService.getStr(pd);
}else{
var pr = UtilService.getYearWeekCount(year-1);
range.start = (year-1) + UtilService.getStr(pr + pd);
}
return range;
}
service.getLastMonths = function(d){
var date = new Date(),year = date.getFullYear(),month = date.getMonth()+1;
var range = {end:year+UtilService.getStr(month)},pm = month+d+1;
if(pm > 0 ){
range.start = year + UtilService.getStr(pm);
}else{
range.start = (year-1) + UtilService.getStr(12 + pm);
}
return range;
}
service.getStringTypes = function(){
return [
{"id":"=","name":"="},
{"id":"!=","name":"≠"},
{"id":"in","name":"in","more":true},
{"id":"not in","name":"not in","more":true}
]
}
service.getNumberTypes = function(){
return [
{"id":">","name":">"},
{"id":">=","name":">="},
{"id":"=","name":"="},
{"id":"<=","name":"<="},
{"id":"<","name":"<"},
{"id":"between","name":"between","both":true}
]
}
//loading加载
service.showLoading = function(){
document.getElementById("sysLoad").style.display = "block";
}
service.hideLoading = function(){
document.getElementById("sysLoad").style.display = "none";
}
//显示灰色背景
service.showAlp = function(){
document.getElementById("alpLoad").style.display = "block";
}
service.hideAlp = function(){
document.getElementById("alpLoad").style.display = "none";
}
//删除等操作提示
service.showTips = function(msg,time){
service.hideLoading();
var t = 1200;
if(msg.length>10){
t = 2000;
}
time = time || t;
$rootScope.operShow = true;
$rootScope.operMsg = msg;
$timeout(function(){
service.hideTips();
},time);
}
service.hideTips = function(){
$rootScope.operShow = false;
$rootScope.operMsg = "";
}
service.getMenuTip = function(name){
var tip = $rootScope.currentPageTips[name];
if(!tip){
tip = "无";
}
return tip;
}
//计算漏斗数据格式
service.getFunnelData = function(fdata,chartKey,chartKeyName){
var rmd = new Date().getTime();
if(angular.isUndefined(fdata)){
fdata = {};
}
var users = [],rates = [],marks = [],preu = -1;
chartKeyName.filter(function(key){
var u = fdata[key],r = fdata['rate_'+key];
u = angular.isUndefined(u) ? 0 : u;
r = angular.isUndefined(r) ? 0 : r;
users.push(u);
rates.push(r);
if(preu>-1){
if(preu==0){
marks.push(0);
}else{
marks.push(UtilService.decimal2(u/preu*100));
}
}
preu = u;
});
var data = {
val : [rates,users],
trans4last : marks,
key : chartKey,
rmd : ++rmd
};
var rateData = data.val[0],rateData1 = [],preRate = 0;
for(var i=0;i<rateData.length;i++){
var r = preRate - rateData[i];
if(preRate>0){
// r = r / preRate * preRate;
}else{
r = 0;
}
rateData1.push(r); //转化率
preRate = rateData[i];
}
data.val.splice(1,0,rateData1);
return data;
}
service.noDataChart = function(){
var rmd = new Date().getTime();
return {
val : [],
trans4last : [],
key : [],
rmd : ++rmd,
name :[]
};
}
/**
*
* @param {[type]} type funnel:漏斗
* customretention:自定义留存
* detailcustomretention:自定义留存明细,
* commonretention:固定留存
* eventstats:事件
* normal:普通
*/
service.getChartConditions = function(name,reportname,params,type,id){
if(UtilService.isNullStr(type)){type = "normal";}
var appid = params.appid,newparams = UtilService.cloneJSON(params);
var subType = params.viewtype || "";
delete newparams.appid;
var condition = {
reportName:reportname,
conditions:JSON.stringify(newparams),
functionType:type,
subType:subType,
app:appid,
name:name
};
if(!UtilService.isNullStr(id)){
condition.functionId = id;
}
return condition;
}
//计算字节长度
service.getByteLen = function(col){
var templen=0;
for(var i=0; i < col.length; i++){
var a = col.charAt(i);
if (a.match(/[a-zA-Z\u4e00-\u9fa5]/) != null) {
templen += 2;
}
else {
templen += 1;
}
}
return templen;
}
//计算table列宽
service.getTableColsWidth = function(cols,flag,count){
var colsStyle = [];
var leftw = $rootScope.unfoldFlag?90:230;
var tablew = flag?(($(window).width()-10-leftw)/(count?count:2)-(count==3?48:45)):($(window).width()-leftw), colsw = 0;
var specialCols = "推广活动,推广活动组,渠道,子渠道,子账号,关键字,创意,付费激活周期";
angular.forEach(cols,function(col){
var templen = service.getByteLen(col);
var colw = specialCols.indexOf(col)>-1?240:col=="日期"?(flag!='day'?160:90):col=='分组'?150:(8 * templen+(flag?13:27));
var colStyle = {'width': colw +'px','max-width': colw +'px'};
colsw += colw;
colsStyle.push(colStyle);
});
if(colsw < tablew){
// var leftw = $rootScope.unfoldFlag?90:$rootScope.unfoldFlag==false?230:270;
// tablew = $(window).width()-leftw;
// if(flag){
// tablew = (tablew-10)/2-45;
// }
var diffw = tablew - 2 - colsw,
collen = colsStyle.length,
coldiffw = (diffw - 12*collen)/collen;
angular.forEach(colsStyle,function(col){
var ocolw = parseInt(col.width.slice(0,-2));
col.width = col['max-width'] = ocolw + coldiffw +'px';
});
}
return colsStyle;
}
service.getCMidInfo = function(){
var cid = localStorage.getItem("rytf_cid"),
campaignid = localStorage.getItem("rytf_campid");
if(UtilService.isNullStr(cid)){
cid = -1;
campaignid = '_default_';
}
return {
cid : cid,
campaignid : campaignid
};
}
service.getRoleName = function(){
if($rootScope.isSuper){
return "主账号";
}
else if($rootScope.isManage){
return "管理员";
}
else if($rootScope.isAppManage){
return "子应用管理员";
}
}
service.getUser = function(){
var u = localStorage.getItem("ry_user");
if(UtilService.isNullStr(u)){
return {};
}
else{
return JSON.parse(u);
}
}
return service;
}
})();
(function () {
'use strict';
angular.module("app")
.factory("UtilService",UtilService);
function UtilService(){
var service = {};
service.randRange = function(min, max) {
var randNumber = Math.floor(Math.random() * (max - min + 1)) + min;
return randNumber;
};
service.sortArray = function(array, flag) {
if (flag == "desc") {
return array.sort(function(x, y) {
return x == y ? 0 : (x > y ? -1 : 1);
});
} else {
return array.sort(function(x, y) {
return x == y ? 0 : (x > y ? 1 : -1);
});
}
};
service.getMaxByArray = function(array){
var arr = service.cloneJSON(array);
arr = arr.sort(function(x,y){
return x == y ? 0 : (x > y ? -1 : 1);
});
return arr[0];
};
service.sortArray2 = function(array,name,index,flag) {
var tempArr = [],len = array.length;
if(len > 0){
name.filter(function(n,j){
var temp = [];
for(var i=0;i<len;i++){
temp.push(array[i][j]);
}
temp.push(n);
tempArr.push(temp);
});
if (flag == "desc") {
tempArr.sort(function(x, y) {
return x[index] == y[index] ? 0 : (x[index] > y[index] ? -1 : 1);
});
} else {
tempArr.sort(function(x, y) {
return x[index] == y[index] ? 0 : (x[index] > y[index] ? 1 : -1);
});
}
tempArr.filter(function(item,j){
name[j] = item.pop();
for(var i=0;i<len;i++){
array[i][j] = item[i];
}
});
}
};
service.sumArray = function(array){
var sum = 0;
for(var i=0;i<array.length;i++){
if(array[i]!=null){
sum += array[i];
}
}
return sum;
};
service.decimal2 = function(nm, n) {
n = n ? n : 2;
var ts = "1";
var tn = 1;
for (var i = 0; i < n; i++) {
ts += "0";
}
tn = parseInt(ts);
var num = Math.round(nm * tn) / tn;
var numstr = num + "";
var dotindex = numstr.indexOf(".");
var newstr = '';
if (dotindex > 0) {
newstr = numstr.substring(dotindex, numstr.length);
if (newstr > 2) {
numstr = numstr.substring(0, numstr.length - 2);
num = parseFloat(numstr);
}
}
return num;
};
/*0今天,-1昨天。。。*/
service.getDay = function(num){
var time = new Date(),
dayFn = function(date) {
var YY = date.getFullYear(),
MM = date.getMonth() + 1,
DD = date.getDate();
if (MM < 10) MM = "0" + MM;
if (DD < 10) DD = "0" + DD;
return YY + "-" + MM + "-" + DD
},
times = time.getTime() + (1000 * 60 * 60 * 24 * num);
time.setTime(times);
return dayFn(time);
};
/**
* 某一天之前的几个月 返回值格式YYYY-MM-DD
*/
service.getLastMonthsDate = function (day, num) {
var resultDate = new Date(day);
resultDate.setMonth(resultDate.getMonth() - Number(num));
return resultDate.Format("yyyy-MM-dd");
};
//一年多少周
service.getYearWeekList = function(year){
if(typeof year == 'undefined'){
var d = new Date();
year = d.getFullYear();
}
var weeklist = [];
var firstDay = new Date(year, 0, 1),fw = firstDay.getDay();
var maxDay = new Date(year, 11, 31);
fw = fw == 0 ? 7 :fw;
var endDay = firstDay.clone().addDays(7 - fw),w = 0;
//当年的第一天为周五周六周日并到上一年
if(fw > 0 && fw < 5){
w = 1;
weeklist.push({
week : w,
date : endDay,
year : year
});
}
while(endDay < maxDay && !maxDay.isSameDay(endDay)){
w ++ ;
endDay = endDay.clone().addDays(7);
weeklist.push({
week : w,
date : endDay,
year : year
});
}
var lastDay = new Date(year, 11, 31),lastW = lastDay.getDay();
//当年最后一天是周五周六或者周日时,移到下一年
if(lastW > 0 && lastW < 4){
weeklist.pop();
}
return weeklist;
}
service.getYearWeekCount = function(year){
return service.getYearWeekList(year).length;
}
//当前周数
service.getNowWeekNum = function(){
var today = Date.today();
var firstDay = new Date(today.getFullYear(), 0, 1),fw = firstDay.getDay();
var endDay = firstDay.clone(),n = 0;
if( fw > 0){
endDay = endDay.addDays(8-fw);
n = 1;
}
var days = diffDate(endDay , today);
return Math.ceil(days/7) + n;
}
service.cloneJSON = function(para){
var rePara = null;
var type = Object.prototype.toString.call(para);
if(type.indexOf("Object") > -1){
rePara = jQuery.extend(true, {}, para);
}else if(type.indexOf("Array") > 0){
rePara = para.concat();
}else{
rePara = para;
}
return rePara;
};
service.splitString = function(str, olength){
var resString = '',
len = 0,
reg = new RegExp(/[^\x00-\xff]/);
for(var i = 0; i < str.length; i++){
var char = str.charAt(i);
len += (reg.test(char) ? 2 : 1);
if(len <= olength){
resString += char;
}
}
return {
str: resString,
len: len
};
};
//数组合并
service.merge = function(){
return Array.prototype.concat.apply([], arguments);
}
service.isNullStr = function(str){
if(angular.isUndefined(str) || str=="" || str == null || str == 'null'){
return true;
}else{
return false;
}
}
service.getStr = function(n){
if(n < 10){
return "0"+n;
}else{
return n+"";
}
}
service.setCookie = function(n,_value,d){
$.cookie(n,_value,{expires:d,path:'/',secure:false,raw:false});
}
service.getCookie = function(n){
return $.cookie(n);
}
service.setItem = function(n,_value){
window.localStorage.setItem(n,_value);
}
service.getItem = function(n){
return window.localStorage.getItem(n);
}
service.copyTxt = function(obj){
$(obj).select();
var bol = false;
try{
bol = document.execCommand("Copy",'false',null);
}
catch(e){
bol = false;
}
return bol;
}
service.randRangeId = function() {
if(service.getCookie('tkRmdId')){
return service.getCookie('tkRmdId');
}
else{
var randNumber = new Date().getTime() + service.randRange(3,5);
service.setCookie('tkRmdId',randNumber,3*365);
return randNumber;
}
};
service.randDeviceId = function() {
if(localStorage.getItem('rmdDeviceId')){
return localStorage.getItem('rmdDeviceId');
}
else{
var randNumber = new Date().getTime() + service.randRange(3,10);
localStorage.setItem('rmdDeviceId',randNumber);
return randNumber;
}
}
service.getAppkey = function(){
return "0d401839250deff23daf62fd49a444cb";
}
service.getTKAppkey = function(){
return "f0f251af10e66a0c94d2e923d8863105";
}
service.getLogRoot = function(){
return "http://log.reyun.com";
}
service.deviceInfo = function(){
var browser = {
versions:function(){
var u = navigator.userAgent, app = navigator.appVersion;
return {//移动终端浏览器版本信息
trident: u.indexOf("Trident") > -1, //IE内核
presto: u.indexOf("Presto") > -1, //opera内核
webKit: u.indexOf("AppleWebKit") > -1, //苹果、谷歌内核
gecko: u.indexOf("Gecko") > -1 && u.indexOf("KHTML") == -1, //火狐内核
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
android: u.indexOf("Android") > -1 || u.indexOf("Linux") > -1, //android终端或者uc浏览器
iPhone: u.indexOf("iPhone") > -1 , //是否为iPhone或者QQHD浏览器
iPad: u.indexOf("iPad") > -1, //是否iPad
webApp: u.indexOf("Safari") == -1 //是否web应该程序,没有头部与底部
};
}(),
language:(navigator.browserLanguage || navigator.language).toLowerCase()
}
return browser;
}
service.operatorSystem = function(){
var sUserAgent = navigator.userAgent;
var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
if (isMac)
{
return "Mac";
}
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
if(bIsIpad){
return "ipad";
}
var isIPhone = (navigator.platform == "iPhone");
if(isIPhone){
return "iPhone";
}
var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
if (isUnix){
return "Unix";
}
var isLinux = (String(navigator.platform).indexOf("Linux") > -1);
var bIsAndroid = sUserAgent.toLowerCase().match(/android/i) == "android";
if (isLinux) {
if(bIsAndroid){
return "Android";
}
else{
return "Linux";
}
}
if (isWin) {
var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1;
if (isWin2K){
return "Win2000";
}
var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 || sUserAgent.indexOf("Windows XP") > -1;
if (isWinXP){
return "WinXP";
}
var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1;
if (isWin2003){
return "Win2003";
}
var isWinVista= sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1;
if (isWinVista){
return "WinVista";
}
var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1;
if (isWin7){
return "Win7";
}
var isWin8 = sUserAgent.indexOf("Windows NT 6.2") > -1 || sUserAgent.indexOf("Windows 8") > -1;
if (isWin8){
return "Win8";
}
}
return "other";
}
service.getBrowser = function(flag){
var ua=window.navigator.userAgent,bow = "",vers = "";
if(ua.toLowerCase().indexOf("micromessenger")>-1){
bow = "wechat";
}
else if(/Firefox/g.test(ua))
{
ua=ua.split(" ");
bow = "Firefox";
vers = ua[ua.length-1].split("/")[1];
}
else if(/MSIE/g.test(ua))
{
bow="IE";
if(ua.indexOf("QQBrowser")>-1){
bow = "QQBrowser";
}
ua = ua.split(";");
vers = ua[1].split(" ")[2];
}
else if(/Opera/g.test(ua))
{
ua=ua.split(" ");
bow = "Opera";
vers = ua[ua.length-1].split("/")[1];
}
else if(/Chrome/g.test(ua))
{
ua=ua.split(" ");
bow = "Chrome";
vers = ua[ua.length-2].split("/")[1];
}
else if(/^apple\s+/i.test(navigator.vendor))
{
ua=ua.split(" ");
bow = "Safair";
vers = ua[ua.length-2].split("/")[1];
}
else{
bow="others";
}
var versArr = vers.split(".");
if(versArr.length>1){
vers = versArr[0]+"."+versArr[1];
}
if(flag){
return bow+vers;
}
else{
return bow;
}
}
return service;
}
})();
(function(){
angular.module("app.collect")
.controller("retentionCtrl",["$rootScope","$scope","HttpService","ToolService","UtilService","$timeout","$q","$stateParams",retentionCtrl]);
function retentionCtrl($rootScope,$scope,HttpService,ToolService,UtilService,$timeout,$q,$stateParams){
var rmd = new Date().getTime();
var fid = $stateParams.pageid;
$scope.queryInfoByApp = function(flag,dID){
if(angular.isUndefined(flag) || flag==5){
//app下所有事件
var eventPM = HttpService.getInfo($scope.appid+"/event/find");
eventPM.then(function(data){
$scope.eventListAll = data;
$scope.eventList = $scope.eventListAll.filter(function(item){
return item.eventName != 'install';
});
});
//通用属性
var profilePM = HttpService.getInfo($scope.appid+"/event/find/allAttr");
$scope.dimenId = "-all";
profilePM.then(function(data){
data.unshift({"dimensionType":"whole",id:"-all",name:"总体",type:"string"});
for(var i=0; i< data.length; i++){
if(data[i].dimensionType == 'population' || data[i].dimensionType == 'source'){
data[i].dimensionType = 'eventlist';
}
}
$scope.dimensionList = data;
});
}
var definePM = HttpService.getInfo("mng/retention/find/"+$scope.appid);
definePM.then(function(data){
$scope.seatxt = "";
$scope.defineList = data;
$scope.isEditInfo = 1;
if(flag==2){ //修改自定义事件
for(var i=0;i<$scope.defineList.length;i++){
if($scope.defineList[i].id == dID){
$scope.define = $scope.defineList[i];
break;
}
}
$scope.defineFlag = ++rmd;
}
if(data.length>0){
if(!UtilService.isNullStr(fid)){
for(var i=0;i<$scope.defineList.length;i++){
if($scope.defineList[i].id == fid){
$scope.define = $scope.defineList[i];
break;
}
}
$scope.clickDefine($scope.define);
fid = null;
}
else if(flag==1 || (flag == 3 && $scope.define && $scope.define.id == dID)){
$scope.clickDefine($scope.defineList[0]);
}
}
else{
$scope.clickType($scope.typeList[1]);
}
if(flag == 5){
$scope.dimenRmd = ++rmd;
}
});
}
//选择按设备或者按用户
/*$scope.deviceList = ToolService.getDeviceTypeList();
$scope.deviceInit = $scope.deviceList[0].id;
$scope.$on("deviceId",function(e,msg){
$scope.seeFlag = msg.info.id;
});*/
$scope.deviceId = false;
$scope.dimensionname = "维度对比";
$scope.usergroupid = -1;
$scope.$on("dimensionId",function(e,msg){
$scope.dimenId = msg.info.id;
$scope.dimenObj = msg.info;
$scope.dimenEventType = msg.info.eventType;
if($scope.dimenId == 'usergroup' && $scope.usergroupid == -1){
$scope.lengedNames = ["整体"];
$scope.dimenugkeys = UtilService.cloneJSON(msg.info.key);
$scope.dimenugkeys.unshift("all");
msg.info.value.filter(function(item){
$scope.lengedNames.push(item);
});
$scope.usergroupid = msg.info.key[0];
$scope.userIndex = 1;
}
else{
$scope.usergroupid = -1;
}
});
$scope.showDemistion = function(){
return $scope.define && $scope.define.id>0 || $scope.isShowCache;
}
//已保存的事件
$scope.definename = "请选择模板";
$scope.clickDefine = function(m){
$scope.define = m;
$scope.typesign = 'define';
$scope.typesname = m.name;
$scope.ename = m.name;
$scope.defineFlag = ++rmd;
$scope.showEventWin = false;
$scope.helpname = "自定义留存";
$rootScope.thirdtab = m.name;
}
$scope.deleteDefine = function(d){
$scope.delDefine = d;
ToolService.showAlp();
ToolService.showLoading();
var validPM = HttpService.getInfo("custommenu/delete/valid/"+d.id+"?type=retention");
validPM.then(function(data){
ToolService.hideLoading();
$scope.wantDelete = true;
$scope.custommenus = angular.isArray(data) && data.length>0?data:false;
});
}
$scope.doDelete = function(){
$scope.closeWin();
ToolService.showLoading();
var deletePM = HttpService.deleteInfo("mng/retention/delete/"+$scope.delDefine.id);
deletePM.then(function(){
ToolService.showTips("删除成功");
$scope.queryInfoByApp(3,$scope.delDefine.id);
ToolService.hideLoading();
});
}
$scope.date = ToolService.getLastDays(-7);
$scope.disTimeFlag = [];
$scope.rangday = -1;
$scope.changeTimeFlag = function(flag){
if($scope.disTimeFlag.indexOf(flag)>-1){return false;}
// if(flag == 'day'){
// $scope.rangday = 15;
// }
// else{
// $scope.rangday = -1;
// }
$scope.timeFlag = flag;
}
$scope.changeTimeFlag("day");
$scope.$on("dateCustos",function(e,msg){
var days = diffDate(msg.startDate,msg.endDate);
if(days>=15 || days>=60){
$scope.disTimeFlag = ["day"];
if($scope.timeFlag == 'day'){
if(days>=60){
$scope.timeFlag = 'month';
}
else{
$scope.timeFlag = 'week';
}
}
}
else{
if(msg.startDate == msg.endDate){
$scope.disTimeFlag = ["week","month"];
$scope.timeFlag = 'day';
}
else{
$scope.disTimeFlag = [];
}
}
$scope.date = msg;
});
$scope.$watch("date",function(){
if(angular.isDefined($scope.date)){
$scope.datestr = $scope.date.startDate + "至" + $scope.date.endDate;
}
});
$scope.typeList = [
{id:'define',name:"新建自定义留存"},
{id:'install',name:"新增留存"},
{id:'dau',name:"活跃留存"}
];
if(!$scope.hasEditPower()){
$scope.typeList = $scope.typeList.slice(1);
}
$scope.clickType = function(obj){
$scope.typesign = obj.id;
$scope.typesname = obj.name;
$scope.helpname = obj.name;
$scope.define = {id:0};
if(obj.id == 'define'){
$scope.addModel(0);
$scope.helpname = "自定义留存";
}
else{
$scope.defineFlag = ++rmd;
$scope.showEventWin = false;
$scope.isShowCache = false;
$rootScope.thirdtab = obj.name;
}
}
$scope.eventInfo = [];
$scope.dimenInit = $scope.dimenId = "-all";
$scope.$watch("appid",function(n){
if(angular.isDefined(n)){
$scope.dimenId = "-all";
$scope.lengedNames = [];
$scope.queryInfoByApp(5);
$scope.clickType($scope.typeList[1]);
}
});
$scope.initEventInfo = function(flag,cache){
$scope.eventInfo.filter(function(item){
item.show = false;
});
if(flag==1 || cache) {//编辑
$scope.isShowCache = flag == 0 || $scope.typesname=="新建自定义留存";
ToolService.showLoading();
var eventInfo = $scope.isShowCache?JSON.parse(JSON.parse(cache)):JSON.parse($scope.define.eventInfo),evts = [],evtvals = [];
eventInfo.filter(function(item){
var temp = {event:item.event,param:[]};
var pppm = UtilService.cloneJSON(item.params);
pppm.filter(function(pm){
temp.param.push(pm.attr);
});
evts.push(item.event);
evtvals.push(temp);
});
var evtprofilePM = HttpService.getInfo($scope.appid+"/event/find/param?names="+evts.join(",")+"&params="+JSON.stringify(evtvals));
evtprofilePM.then(function(pros){
pros.filter(function(evt){
for(var i=0;i<$scope.eventList.length;i++){
if(evt.eventName == $scope.eventList[i].eventName){
$scope.eventList[i].profiles = evt.profiles;
break;
}
}
});
eventInfo.filter(function(e){
e.oldparams = UtilService.cloneJSON(e.params);
delete e.params;
$scope.addEvent(e);
});
ToolService.hideLoading();
});
}
else{
$scope.addEvent();
$scope.addEvent();
}
}
$scope.changeRel = function(obj){
obj.relation = obj.relation == 'and' ? "or" : 'and';
}
$scope.changeSeeFlag = function(flag){
$scope.seeFlag = flag;
}
var rmd = new Date().getTime();
$scope.eventinitname = "请选择事件";
$scope.addEvent = function(obj){
rmd ++;
var temp = {id:"evt_"+rmd,eventid:"event_"+rmd,relation:"and",show:true};
if(obj){
for(var k in obj){
temp[k] = obj[k];
}
temp.eventinit = obj.event;
}
(function(temp){
$scope.$on(temp.eventid,function(e,msg){
temp.params = [];
temp.event = msg.info.eventName;
temp.nullevent = false;
var setparams = function(){
temp.paramsList = msg.info.profiles;
if(temp.oldparams){
temp.oldparams.filter(function(item){
$scope.addEventParams(temp,item);
});
delete temp.oldparams;
}
}
if(angular.isArray(msg.info.profiles)){
setparams(msg.info.profiles);
}
else{
var proPM = HttpService.getInfo($scope.appid+"/event/find/param?names="+temp.event);
proPM.then(function(data){
msg.info.profiles = data[0].profiles;
setparams();
});
}
});
})(temp);
if($scope.eventInfo.length % 2 == 0){
temp.title = "初始行为";
temp.zidx = 2;
}else{
temp.zidx = 1;
temp.title = "回访行为";
}
$scope.eventInfo.push(temp);
}
$scope.closeAddWin = function(flag){
$scope.showEventWin = false;
if(flag == 1 && $scope.isEditInfo == 2){
$scope.clickType($scope.typeList[1]);
}
$scope.isEditInfo = 1;
}
$scope.getEventParamsNum = function(event){
if(!event || !event.params){return 5;}
var eps = event.params.filter(function(item){
return item.show!=false;
});
return eps.length;
}
$scope.addEventParams = function(event,obj){
if(!event.params || $scope.getEventParamsNum(event)>=3){return false;};
rmd ++;
var tempparam = {id:"pam_"+rmd,pid:event.id};
if(obj){
for(var k in obj){
tempparam[k] = obj[k];
}
}
event.params.push(tempparam);
}
$scope.removeEventParams = function(event,param){
for(var i=0;i<event.params.length;i++){
if(event.params[i].id == param.id){
event.params[i].show = false;
break;
}
}
}
$scope.initCondition = function(){
if(!$scope.canSave()){return false;}
$scope.initEventInfo();
}
$scope.$on("event",function(e,msg){
for(var i=0;i<$scope.eventInfo.length;i++){
if($scope.eventInfo[i].id == msg.pid){
var params = $scope.eventInfo[i].params;
for(var j=0;j<params.length;j++){
if(params[j].id == msg.id){
params[j] = msg;
break;
}
}
}
}
});
$scope.canSave = function(){
if(!$scope.eventInfo || $scope.eventInfo.length == 0){return false;}
var can = false;
for(var i=0;i<$scope.eventInfo.length;i++){
var temp = $scope.eventInfo[i];
if(temp.show == true && temp.event){
can = true;
break;
}
}
return can;
}
$scope.nowiptEvents = "";
$scope.getEventCrm = function(islook){
var hasNull = false;
var eventInfo = [],myEvents = [],isnull = false;
$scope.nowiptEvents = "";
$scope.eventInfo.filter(function(item){
if(item.show!=false){
var temp = {event:item.event,relation:item.relation,params:[]};
if(UtilService.isNullStr(item.event)){
item.nullevent = true;
hasNull = true;
}
else{
item.nullevent = false;
if(angular.isUndefined(item.params)){
isnull = true;
}
else{
item.params.filter(function(pm){
if(pm.show!=false){
var pms = {};
for(var k in pm){
if(k!='id' && k!='pid'){
if(k!='value'){
pms[k] = pm[k];
}else{
pms[k] = pm[k].join(",");
}
if(UtilService.isNullStr(pm[k])){
$scope.$broadcast(pm.id, "null");
hasNull = true;
}
}
}
temp.params.push(pms);
}
});
}
}
eventInfo.push(temp);
myEvents.push(item.event);
}
});
if(isnull){
return false;
}else{
if(hasNull){
if(islook){
ToolService.showTips($scope.formTipMsg);
}
}
else{
$scope.nowiptEvents = JSON.stringify(eventInfo);
}
}
}
$scope.isEditInfo = 1;
$scope.addModel = function(flag){
var cache = UtilService.getItem("retention_"+$scope.appid);
if(flag){
if($scope.typesign=="install" || $scope.typesign=="dau" ||
($scope.define && $scope.define.id == 0 && !cache)){return false;}
$scope.isEditInfo = 3;
}else{
$scope.isEditInfo = 2;
}
$scope.initEventInfo(flag,cache);
$scope.showEventWin = true;
}
$scope.nameWin = function(flag){
$scope.getEventCrm();
if($scope.nowiptEvents==''){
ToolService.hideLoading();
ToolService.showTips($scope.formTipMsg);
return false;
}
ToolService.showAlp();
$scope.wantSave = true;
$scope.currentDefine = {};
$scope.ename = "";
if(angular.isDefined(flag)){ //编辑
$scope.currentDefine = $scope.define;
$scope.define = {id:0};
}
}
$scope.lookReport = function(){
if(!$scope.canSave()){return false;}
$scope.getEventCrm(true);
if($scope.nowiptEvents!=''){
$scope.showEventWin = false;
$scope.query(true);
}
}
$scope.closeWin = function(flag){
$scope.wantSave = false;
$scope.wantDelete = false;
if(flag){
if(flag == 1){
$scope.showEventWin = false;
}
if(flag == 2 && $scope.isEditInfo == 3){
$scope.define = $scope.currentDefine;
}
}
$scope.isEditInfo = 1;
ToolService.hideAlp();
}
$scope.save = function(){
$scope.getEventCrm();
if($scope.nowiptEvents==''){return false;}
var doSave = function(){
var par = {
app : $scope.appid,
eventInfo: $scope.nowiptEvents,
name : $scope.ename
}
var savePM = null,txtTips = "添加成功",flag=1;
if($scope.define.id>0){
par.id = $scope.define.id;
savePM = HttpService.putInfo("mng/retention/update",par);
txtTips = "修改成功";
flag = 2;
}else{
savePM = HttpService.postInfo("mng/retention/create",par);
}
ToolService.showLoading();
savePM.then(function(data){
$scope.closeWin(1);
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.queryInfoByApp(flag,par.id);
if($scope.isShowCache){
localStorage.removeItem("retention_"+$scope.appid);
$scope.isShowCache = false;
}
});
}
if($scope.define.id == 0){
var verPar = {
name: {
key: 'spcname',
val: $scope.ename
}
};
$scope.tip = formJudge(verPar);
if(UtilService.isNullStr($scope.ename) || $scope.tip.succ != true){
ToolService.showTips("请输入20个汉字以内名称,允许字符为中英文数字_-");
return false;
}
else{
ToolService.showLoading();
var existPM = HttpService.getInfo("mng/retention/valid/"+$scope.appid,{name:$scope.ename});
existPM.then(function(data){
if(data==true){
ToolService.hideLoading();
ToolService.showTips("名称已存在");
}
else{
doSave();
}
});
}
}else{
doSave();
}
}
var getParams = function(){
var params = {
reportview:$scope.timeFlag,
retentiontype:$scope.typesign,
appid : $scope.appid
};
if($scope.isTempLook || $scope.isShowCache){
$scope.getEventCrm();
if($scope.nowiptEvents==''){return -1;}
params.eventinfo = $scope.nowiptEvents;
UtilService.setItem("retention_"+$scope.appid,JSON.stringify($scope.nowiptEvents));
$scope.isShowCache = true;
}
else if($scope.define && $scope.define.id>0){
params.eventinfo = $scope.define.eventInfo;
}
else if($scope.typesign == 'define'){
return -2;
}
params.startdate = $scope.date.startDate;
params.enddate = $scope.date.endDate;
params.datatype = "list";
params.eventType = $scope.dimenEventType;
return params;
}
$scope.retetionConfig = {color:ToolService.getTenColors(),ispercent:true,legend:false};
var maxRet = 0,maxDetailRet = 0;
$scope.query = function(istemp){
if(istemp){
$scope.isTempLook = true;
}
else{
$scope.isTempLook = false;
}
var params = getParams();
if(params == -1){return false;}
if(params == -2){
$scope.clickType($scope.typeList[1]);
return false;
}
params.datatype = "list";
/*if($scope.dimenId && $scope.dimenId!='-all' && $scope.showDemistion()){
params.dimention = $scope.dimenId;
if(params.dimention == 'usergroup'){
if($scope.usergroupid==-1){return false;}
params.usergroupid = $scope.usergroupid;
}
}*/
params.dimention = $scope.dimenId;
if(params.dimention == 'usergroup'){
if($scope.usergroupid==-1){return false;}
params.usergroupid = $scope.usergroupid;
}
params.isdevice = $scope.seeFlag == 'device';
params.eventType = $scope.dimenEventType;
var retetionPM = null, areport = "", expType = "", ddID = "", ddName = ($scope.define.name || $scope.typesname) + "的留存趋势详情";
if($scope.define && $scope.define.id>0){
ddID = $scope.define.id;
}
var view = 'ds';
if($scope.timeFlag != 'day'){
view = $scope.timeFlag;
}
var myreport = "retention/report/"+$scope.appid;
areport = myreport;
expType = "customretention";
if($scope.typesign!='define' && $scope.typesign != 'dau'){
//新增留存
params.eventinfo = "payment,loggedin,reged";
}
else if($scope.typesign=='dau'){
params.retentiontype = 'active';
}else{
//自定义
}
retetionPM = HttpService.getInfo(myreport,params);
$scope.retetionLoading = true;
$scope.showDetail = false;
$scope.infolistLoading = true;
retetionPM.then(function(data){
$scope.infolist = data;
if(params.dimention){
$scope.infolist.name[0] = $scope.dimenObj.name;
}
var infoVal = data.val;
$scope.infolistLoading = false;
var chartData = {
name:[],
key:[],
val:[],
rmd: ++rmd
};
if(infoVal.length>0){
chartData.key = data.key.slice(1);
var columns = data.columnkey;
infoVal.filter(function(item){
chartData.name.push(item[columns[0]]);
var linedata = [];
for(var i=2;i<columns.length;i++){
linedata.push(item['rate_'+columns[i]]);
}
chartData.val.push(linedata);
});
}
else{
if($scope.dimenId == 'usergroup' && $scope.lengedNames && $scope.lengedNames.length>1){
chartData.name = ['整体',$scope.lengedNames[$scope.userIndex]];
}
}
$scope.eventChartData = chartData;
if(params.dimention != 'usergroup'){
$scope.lengedNames = chartData.name;
}
var max = 5;
if(chartData.name.length > max){
$scope.myChartData = {
name:chartData.name.slice(0,max),
key:chartData.key,
val:chartData.val.slice(0,max),
rmd: ++rmd
};
}
else{
$scope.myChartData = UtilService.cloneJSON(chartData);
}
maxRet = 0;
var k = data.columnkey[2];
data.val.filter(function(item){
if(item[k] > maxRet){
maxRet = item['rate_'+k];
}
});
$scope.retetionLoading = false;
$scope.myChartDataCondition = ToolService.getChartConditions(ddName,areport,params,expType,ddID);
},function(data){
// $scope.errorBack(data.message);
$scope.myChartData = ToolService.noDataChart();
$scope.infolist = {};
$scope.retetionLoading = false;
$scope.infolistLoading = false;
});
}
var lengedMax = 10;
$scope.changeChartData = function(n){
if(!$scope.myChartData){return false;}
if($scope.dimenId == 'usergroup'){
var idx = $scope.lengedNames.indexOf(n);
if(idx > 0 && $scope.dimenugkeys.indexOf($scope.usergroupid) != idx){
$scope.usergroupid = $scope.dimenugkeys[idx];
$scope.userIndex = idx;
return false;
}
else if(idx == 0){
ToolService.showTips("整体不可取消");
return false;
}
}
var namelen = $scope.myChartData.name.length,idx = $scope.myChartData.name.indexOf(n);
if(idx>-1){ //删除该线
var tempData = UtilService.cloneJSON($scope.myChartData);
tempData.name.splice(idx,1);
tempData.val.splice(idx,1);
tempData.rmd = ++rmd;
$scope.myChartData = tempData;
}
if(namelen < lengedMax && idx == -1){ //加入
var pidx = $scope.eventChartData.name.indexOf(n);
var tempData = UtilService.cloneJSON($scope.myChartData);
tempData.name.push(n);
tempData.val.push($scope.eventChartData.val[pidx]);
tempData.rmd = ++rmd;
$scope.myChartData = tempData;
}
}
$scope.lengedBgStyle = function(n){
var idx = $scope.myChartData.name.indexOf(n);
if(idx>-1){
return {"background-color":$scope.retetionConfig.color[idx],"border-color":"transparent"};
}
else{
return {};
}
}
$scope.lengedClass = function(n){
if(!$scope.myChartData){return "";}
var namelen = $scope.myChartData.name.length,idx = $scope.myChartData.name.indexOf(n);
if(namelen>=lengedMax && idx==-1){
return 'disable';
}
else{
return "";
}
}
$scope.getBgColor = function(opa,idx,flag){
if(idx<1){return {};}
if(flag == 1 && maxRet > 0){
opa = Number((opa/maxRet).toFixed(2))*0.8;
}
else if(flag == 2 && maxDetailRet > 0){
opa = Number((opa/maxDetailRet).toFixed(2))*0.8;
}
else{
opa = 0;
}
var color = "rgba(109,199,190,"+opa+")";
return {'background-color':color};
}
$scope.subDetail = function(info,idx){
if(idx>0){return false;}
var nk = $scope.infolist.columnkey[0];
$scope.detailInfoTitle = info[nk];
$scope.detailInfoLoading = true;
$scope.showDetail = true;
var params = getParams();
var detailPM = null;
$scope.detailInfo = [];
params.isdevice = $scope.seeFlag == 'device';
var myreport = "",expType = "",ddID = "";
expType = "detailcustomretention";
if($scope.typesign!='define' && $scope.typesign != 'dau'){
var view = 'ds';
if($scope.timeFlag != 'day'){
view = $scope.timeFlag;
}
params.isdetail = true;
/*myreport = "retention_" + $scope.typesign + "_dau_by" + view; 整体*/
myreport = "reportdetail/"+$scope.appid;
}else if($scope.typesign == 'dau'){
params.retentiontype = "active";
}
else{
if($scope.define && $scope.define.id>0){
ddID = $scope.define.id;
}
}
//第一个整体不传参数
if($scope.detailInfoTitle != '整体'){
if($scope.dimenId && $scope.dimenId!='-all'){
if($scope.dimenId == 'usergroup'){
params.usergroupid = $scope.usergroupid;
}
else{
var json = {};
json[$scope.dimenId] = info[$scope.dimenId+"_key"];
json.type = $scope.dimenObj.type;
params.dimention = JSON.stringify(json);
}
}
}
var areport = "";
if($scope.typesign!='define' && $scope.typesign != 'dau'){
areport = myreport;
params.eventinfo = "payment,loggedin,reged";
detailPM = HttpService.getInfo('retention/'+myreport,params);
}else if($scope.typesign == 'dau'){
areport = "retention/reportdetail/"+$scope.appid;
params.eventinfo = "payment,loggedin,reged";
detailPM = HttpService.getInfo(areport,params);
}
else{
areport = "retention/reportdetail/"+$scope.appid;
detailPM = HttpService.getInfo(areport,params);
}
params.eventType = $scope.dimenEventType;
detailPM.then(function(data){
$scope.detailInfo = data;
$scope.detailInfoLoading = false;
maxDetailRet = 0;
var k = data.columnkey[2];
data.val.filter(function(item){
if(item[k] > maxDetailRet){
maxDetailRet = item['rate_'+k];
}
});
$scope.detailInfoCondition = ToolService.getChartConditions(($scope.define.name || $scope.typesname)+"的留存明细",areport,params,expType,ddID);
},function(data){
// $scope.errorBack(data.message);
$scope.detailInfoLoading = false;
});
}
$scope.$watch("appid+date.startDate+date.endDate+seeFlag+timeFlag+dimenId+defineFlag+usergroupid",function(){
if(angular.isDefined($scope.appid) && angular.isDefined($scope.date) && angular.isDefined($scope.typesign)){
$scope.query();
}
});
}
})();
(function(){
var tempVersion = new Date().getTime();
angular.module("app.collect")
.config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
var menu = "collect",html = ["retention","funnel","export","intelligentpath","eventstats","custommenu","logtool","report"];
var hasDetail = [];
$stateProvider.state(menu,{
url:"",
templateUrl: '/template/menu/'+menu+'.html?r='+tempVersion,
controller: "collectCtrl"
});
html.forEach(function(h){
$stateProvider.state(menu + '.' + h,{
url:"/" + menu + "/" + h,
params:{
stateinfo:null,
pageid:null
},
views:{
"content@":{
templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
controller: h +"Ctrl"
}
}
});
if(hasDetail.indexOf(h)>-1){
var v = h+"Detail";
$stateProvider.state('collect.' + v,{
url:"/" + menu + "/" + v,
params:{
aid:null
},
views:{
"content@":{
templateUrl: "/template/" + menu + "/" + v + '.html?r='+tempVersion,
controller: v +"Ctrl"
}
}
});
}
});
//看单-左侧菜单调整
$stateProvider.state(menu + '.custommenuDetail',{
url:"/" + menu + "/custommenu/:pageid",
views:{
"content@":{
templateUrl: "/template/" + menu + '/custommenu.html?r='+tempVersion,
controller:"custommenuCtrl"
}
}
});
}]);
})();
This source diff could not be displayed because it is too large. You can view the blob instead.
(function(){
var tempVersion = new Date().getTime();
angular.module("app.home")
.config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
var menu = "home",html = ["home","main","demolist"];
$stateProvider.state(menu,{
url:"",
templateUrl: '/template/menu/collect.html?r='+tempVersion,
controller: "collectCtrl"
});
html.forEach(function(h){
$stateProvider.state('home.' + h,{
url:"/" + menu + "/" + h,
views:{
"home@":{
templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
controller: h +"Ctrl"
}
}
});
});
}]);
})();
\ No newline at end of file
(function(){
angular.module("app.login")
.controller("successCtrl",["$scope","UtilService","$http","$interval",successCtrl]);
function successCtrl($scope,UtilService,$http,$interval){
$scope.hasReged = true;
}
})();
\ No newline at end of file
(function(){
var tempVersion = new Date().getTime();
angular.module("app.manage")
.config(['$stateProvider',"$urlRouterProvider",function ($stateProvider,$urlRouterProvider) {
var menu = "manage",html = ["app","auth","event","activityevent","profile","userinfo","usergroup","nopower"];
var nodetail = ["systemparam","event","profile","downloadurl"];
$stateProvider.state(menu,{
url:"",
templateUrl: '/template/menu/collect.html?r='+tempVersion,
controller: "collectCtrl"
});
html.forEach(function(h){
$stateProvider.state('collect.' + h,{
url:"/" + menu + "/" + h,
params:{
aid:null
},
views:{
"content@":{
templateUrl: "/template/" + menu + "/" + h + '.html?r='+tempVersion,
controller: h +"Ctrl"
}
}
});
if(nodetail.indexOf(h)==-1){
var v = h+"Detail";
$stateProvider.state('collect.' + v,{
url:"/" + menu + "/" + v,
params:{
aid:null
},
views:{
"content@":{
templateUrl: "/template/" + menu + "/" + v + '.html?r='+tempVersion,
controller: v +"Ctrl"
}
}
});
}
});
}]);
})();
(function(){
angular.module("app.manage")
.controller("usergroupCtrl",["$scope","$rootScope","HttpService","ToolService","UtilService","$state",usergroupCtrl])
.controller("usergroupDetailCtrl",["$scope","$rootScope","HttpService","ToolService","UtilService","$q","$state","$stateParams",usergroupDetailCtrl]);
function usergroupCtrl($scope,$rootScope,HttpService,ToolService,UtilService,$state){
$scope.query = function(){
var usergroupPM = HttpService.getInfo("mng/usergroup/find/"+$scope.appid);
ToolService.showLoading();
usergroupPM.then(function(data){
ToolService.hideLoading();
$scope.usergroupList = data;
});
}
$scope.$watch("appid",function(n){
if(angular.isDefined(n)){
$scope.query();
}
});
$scope.$on('flipinfo',function(e,msg){
$scope.flipPage = msg;
});
$scope.doRemove = function(id){
$scope.delstatus = true;
$scope.delId = id;
}
$scope.removeInfo = function(){
var removePM = HttpService.deleteInfo("mng/usergroup/delete/"+$scope.delId);
ToolService.showLoading();
removePM.then(function(data){
ToolService.hideLoading();
$scope.delstatus = false;
ToolService.showTips("删除成功");
$scope.query();
});
}
$scope.gopage = function(info){
if(angular.isDefined(info)){
$state.go("collect.usergroupDetail",{aid:info});
}else{
$state.go("collect.usergroupDetail");
}
}
$scope.refreshExport = function(info){
var upDate = info.dataUpdateTime;
if(angular.isDefined(upDate)){
if(Date.isSameDay(new Date(),new Date(upDate))){
ToolService.showTips("已经是最新数据");
return false;
}
}
var putPM = HttpService.putInfo("mng/usergroup/refresh/"+info.id);
ToolService.showLoading();
putPM.then(function(data){
ToolService.hideLoading();
$scope.query();
});
}
}
function usergroupDetailCtrl($scope,$rootScope,HttpService,ToolService,UtilService,$q,$state,$stateParams){
var editInfo = $stateParams.aid,infoId = null;
if(editInfo!=null){
infoId = $scope.id = editInfo.id;
}
$scope.mydate = ToolService.getLastDays(-7,0);
$scope.userType = 0;
$scope.$on("dateCustos",function(e,msg){
$scope.mydate = msg;
});
$scope.$watch("mydate",function(n){
if(angular.isDefined(n)){
$scope.datestr = $scope.mydate.startDate + "至" + $scope.mydate.endDate;
}
});
var profilePM = null,eventPM = null;
$scope.queryEventProfile = function(){
profilePM = HttpService.getInfo($scope.appid+"/profile/find");
profilePM.then(function(data){
$scope.profileList = data;
});
eventPM = HttpService.getInfo($scope.appid+"/event/find");
eventPM.then(function(data){
$scope.eventList = data;
});
if(infoId!=null){
ToolService.showLoading();
$q.all([profilePM,eventPM]).then(function(data){
var info = editInfo;
var profileInfoStr = info.profileInfo,eventInfoStr = info.eventInfo;
if(!UtilService.isNullStr(profileInfoStr)){
var profileInfo = JSON.parse(profileInfoStr);
$scope.profileRel = profileInfo.relation,profiles = profileInfo.profiles;
profileInfo.profiles.filter(function(p){
$scope.addProfile(p);
});
}
if(!UtilService.isNullStr(eventInfoStr)){
var eventInfo = JSON.parse(eventInfoStr),evts = [],evtvals = [];
$scope.eventRel = eventInfo.relation;
eventInfo.events.filter(function(item){
var temp = {event:item.event,param:[]};
var pppm = UtilService.cloneJSON(item.params);
pppm.filter(function(pm){
temp.param.push(pm.attr);
});
evts.push(item.event);
evtvals.push(temp);
});
var evtprofilePM = HttpService.getInfo($scope.appid+"/event/find/param?names="+evts.join(",")+"&params="+JSON.stringify(evtvals));
evtprofilePM.then(function(pros){
pros.filter(function(evt){
for(var i=0;i<$scope.eventList.length;i++){
if(evt.eventName == $scope.eventList[i].eventName){
$scope.eventList[i].profiles = evt.profiles;
break;
}
}
});
eventInfo.events.filter(function(e){
e.oldparams = UtilService.cloneJSON(e.params);
delete e.params;
$scope.addEvent(e);
});
});
}
ToolService.hideLoading();
});
}
}
$scope.$watch("appid",function(n){
if(angular.isDefined(n)){
if(profilePM!=null){
$scope.cancel();
}
else{
$scope.queryEventProfile();
}
}
});
$scope.changeRel = function(flag,obj){
switch (flag) {
case 1:
$scope.profileRel = $scope.profileRel == 'and' ? "or" : 'and';
break;
case 2:
$scope.eventRel = $scope.eventRel == 'and' ? "or" : 'and';
break;
case 3:
obj.relation = obj.relation == 'and' ? "or" : 'and';
break;
default:
break;
}
}
var rmd = new Date().getTime();
$scope.getProfileNum = function(){
if(!$scope.profileInfo){return 0;}
var ps = $scope.profileInfo.filter(function(item){
return item.show!=false;
});
return ps.length;
}
$scope.addProfile = function(obj){
if($scope.getProfileNum()>=5){
return false;
}
rmd ++;
var temp = {id:"pro_"+rmd};
if(obj){
for(var k in obj){
temp[k] = obj[k];
}
}
$scope.profileInfo.push(temp);
}
$scope.removeProfile = function(pro){
for(var i=0;i<$scope.profileInfo.length;i++){
if($scope.profileInfo[i].id == pro.id){
$scope.profileInfo[i].show = false;
break;
}
}
}
$scope.$on("profile",function(e,msg){
for(var i=0;i<$scope.profileInfo.length;i++){
if($scope.profileInfo[i].id == msg.id){
$scope.profileInfo[i] = msg;
break;
}
}
});
$scope.eventinitname = "请选择事件";
$scope.getEventNum = function(){
var es = $scope.eventInfo.filter(function(item){
return item.show!=false;
});
return es.length;
}
$scope.setEventStyle = function(){
var idx = -1;
var len = $scope.eventInfo.length;
$scope.eventInfo.filter(function(item,i){
if(item.show!=false){
idx ++;
item.style = {'z-index':len-i};
}
});
}
$scope.addEvent = function(obj){
if($scope.getEventNum()>=5){return false;}
rmd ++;
var temp = {id:"evt_"+rmd,eventid:"event_"+rmd,relation:"and"};
if(obj){
for(var k in obj){
temp[k] = obj[k];
}
temp.eventinit = obj.event;
}
(function(temp){
$scope.$on(temp.eventid,function(e,msg){
temp.params = [];
temp.event = msg.info.eventName;
temp.nullevent = false;
var setparams = function(){
temp.paramsList = msg.info.profiles;
if(temp.oldparams){
temp.oldparams.filter(function(item){
$scope.addEventParams(temp,item);
});
delete temp.oldparams;
}
}
if(angular.isArray(msg.info.profiles)){
setparams(msg.info.profiles);
}
else{
var proPM = HttpService.getInfo($scope.appid+"/event/find/param?names="+temp.event);
proPM.then(function(data){
msg.info.profiles = data[0].profiles;
setparams();
});
}
});
})(temp);
$scope.eventInfo.push(temp);
$scope.setEventStyle();
}
$scope.removeEvent = function(event){
for(var i=0;i<$scope.eventInfo.length;i++){
if($scope.eventInfo[i].id == event.id){
$scope.eventInfo[i].show = false;
break;
}
}
$scope.setEventStyle();
}
$scope.getEventParamsNum = function(event){
if(!event.params){return 5;}
var eps = event.params.filter(function(item){
return item.show!=false;
});
return eps.length;
}
$scope.addEventParams = function(event,obj){
if(!event.params || $scope.getEventParamsNum(event)>=3){return false;};
rmd ++;
var tempparam = {id:"pam_"+rmd,pid:event.id};
if(obj){
for(var k in obj){
tempparam[k] = obj[k];
}
}
event.params.push(tempparam);
}
$scope.removeEventParams = function(event,param){
for(var i=0;i<event.params.length;i++){
if(event.params[i].id == param.id){
event.params[i].show = false;
break;
}
}
}
$scope.$on("event",function(e,msg){
for(var i=0;i<$scope.eventInfo.length;i++){
if($scope.eventInfo[i].id == msg.pid){
var params = $scope.eventInfo[i].params;
for(var j=0;j<params.length;j++){
if(params[j].id == msg.id){
params[j] = msg;
break;
}
}
}
}
});
var oldname = "";
$scope.init = function(){
$scope.profileInfo = [];
$scope.eventInfo = [];
$scope.profileRel = "and";
$scope.eventRel = "and";
if(infoId!=null){
$scope.name = oldname = editInfo.name;
$scope.mark = editInfo.mark;
$scope.userType = editInfo.userType;
$scope.mydate = {
startDate:editInfo.startDate,
endDate:editInfo.endDate
};
}
};
$scope.init();
//判断账号是否存在
$scope.exixtName = function(flag){
if(angular.isDefined(flag) && flag ==1){
ToolService.showLoading();
}
if($scope.judgeNameChange(oldname,$scope.name)){
var namePM = HttpService.getInfo("mng/usergroup/valid/"+$scope.appid,{name:$scope.name});
namePM.then(function(data){
$scope.tip = {};
if(data==true){//存在
$scope.tip = {
name:{
status:true,
txt:"名称已存在"
}
}
ToolService.hideLoading();
}else{
if(angular.isDefined(flag) && flag ==1){
$scope.save();
}
}
});
}
else{
if(angular.isDefined(flag) && flag ==1){
$scope.save();
}
}
}
$scope.save = function(){
var par = {
name: $scope.name,
mark: $scope.mark,
userType: $scope.userType,
startDate:$scope.mydate.startDate,
endDate:$scope.mydate.endDate,
app:$scope.appid
};
var pevtInfo = "";
var profileInfo = {'relation':$scope.profileRel,profiles:[]};
var hasNull = false;
$scope.profileInfo.filter(function(item){
if(item.show!=false){
if(UtilService.isNullStr(item.attr)){
$scope.$broadcast(item.id, "error");
hasNull = true;
}
var temp = {};
for(var k in item){
if(k!='id'){
if(k!='value'){
temp[k] = item[k];
}else{
temp[k] = item[k].join(",");
}
if(UtilService.isNullStr(temp[k]) && k!='pid'){
$scope.$broadcast(item.id, "error");
hasNull = true;
}
}
}
profileInfo.profiles.push(temp);
}
});
if(profileInfo.profiles.length>0){
par.profileInfo = JSON.stringify(profileInfo);
pevtInfo = "profile";
}
var eventInfo = {relation:$scope.eventRel,events:[]};
$scope.eventInfo.filter(function(item){
if(item.show!=false){
var temp = {event:item.event,relation:item.relation,params:[]};
if(UtilService.isNullStr(item.event)){
item.nullevent = true;
hasNull = true;
}
else{
item.nullevent = false;
item.params.filter(function(pm){
if(pm.show!=false){
if(UtilService.isNullStr(pm.attr)){
$scope.$broadcast(pm.id, "error");
hasNull = true;
}
var pms = {};
for(var k in pm){
if(k!='id' && k!='pid'){
if(k!='value'){
pms[k] = pm[k];
}else{
pms[k] = pm[k].join(",");
}
if(UtilService.isNullStr(pm[k])){
$scope.$broadcast(pm.id, "error");
hasNull = true;
}
}
}
temp.params.push(pms);
}
});
}
eventInfo.events.push(temp);
}
});
if(eventInfo.events.length>0){
par.eventInfo = JSON.stringify(eventInfo);
pevtInfo = "event";
}
var verPar = {
name: {
key: 'spcname',
val: par.name
}
}
$scope.tip = formJudge(verPar);
if(pevtInfo==''){
$scope.tip.params = {
status : true,
txt:"至少选择用户属性或者触发事件其中一项"
}
$scope.tip.succ = false;
}
if(hasNull){
// ToolService.showTips('选择框、输入框必填');
}
if ($scope.tip.succ != true || hasNull) {
ToolService.hideLoading();
ToolService.showTips($scope.formTipMsg);
return false;
}
var savePM = null,txtTips = "添加成功";
if(infoId!=null){
par.id = infoId;
savePM = HttpService.putInfo("mng/usergroup/update",par);
txtTips = "修改成功";
}else{
savePM = HttpService.postInfo("mng/usergroup/create",par);
}
ToolService.showLoading();
savePM.then(function(data){
ToolService.hideLoading();
ToolService.showTips(txtTips);
$scope.cancel();
});
}
$scope.cancel = function(){
$state.go("collect.usergroup");
}
}
})();
(function(){
angular.module("app.manage")
.controller("userinfoCtrl",["$rootScope","$scope","HttpService","ToolService","UtilService","$state",userinfoCtrl])
function userinfoCtrl($rootScope,$scope,HttpService,ToolService,UtilService,$state){
$scope.isDemo = ToolService.isDemoUser();
$scope.queryInfo = function(){
var userPM = HttpService.getInfo("account/detail",{});
userPM.then(function(data){
$scope.myid = data.id;
$scope.email = data.email;
$scope.name = data.name;
$scope.company = data.company;
$scope.phone = data.phone;
$scope.qq = data.qq;
$scope.createTime = data.createTime;
$scope.wechat = data.wechat;
$scope.logList = data.userLogList!=null ? data.userLogList : [];
});
}
$scope.queryInfo();
$scope.save = function(){
var par = {
name: $scope.name,
company: $scope.company,
phone: $scope.phone,
wechat: $scope.wechat,
qq: $scope.qq
};
var verPar = {
name: {
key: 'username',
max:32,
val: par.name
},
company: {
key: 'companyname',
max:96,
val: par.company
},
phone: {
key: 'cellphone',
val: par.phone
},
wechat: {
key: 'wechat',
val: par.wechat
},
qq: {
key: 'qq',
val: par.qq
}
}
$scope.tip = formJudge(verPar);
if ($scope.tip.succ != true) {
ToolService.showTips($scope.formTipMsg);
return false;
}
var savePM = HttpService.putInfo("account/updateBase",par);
ToolService.showLoading();
savePM.then(function(data){
ToolService.hideLoading();
if(data==1){
ToolService.showTips("修改成功");
$scope.toedit = false;
}
else{
ToolService.showTips("修改失败");
}
});
}
$scope.savepwd = function(){
var par = {
pwd: $scope.pwd,
newpwd: $scope.newpwd
};
var verPar = {
pwd: {
key: 'isNull',
val: par.pwd
},
newpwd: {
key: 'pwd',
val: par.newpwd
},
crmpwd: {
key: 'pwd',
val: $scope.crmpwd
}
}
$scope.tip = formJudge(verPar);
if($scope.pwd != undefined && $scope.pwd == $scope.newpwd){
if ($scope.tip.succ == true) {
$scope.tip.succ = false;
}
$scope.tip.newpwd = {
status:true,
txt:"新旧密码一致,请重新修改密码"
}
}
if($scope.newpwd!= undefined && $scope.crmpwd!= undefined && $scope.newpwd!=$scope.crmpwd){
if ($scope.tip.succ == true) {
$scope.tip.succ = false;
}
$scope.tip.crmpwd = {
status:true,
txt:"两次密码不一致,请重新输入"
}
}
if ($scope.tip.succ != true) {
ToolService.showTips($scope.formTipMsg);
return false;
}
var savePM = HttpService.putInfo("account/updatePwd?oldPassword="+par.pwd+"&newPassword="+par.newpwd,{});;
ToolService.showLoading();
savePM.then(function(data){
ToolService.hideLoading();
if(data==1){
ToolService.showTips("修改成功");
window.location.href = "/login.html";
}
else{
ToolService.showTips("修改失败");
}
},function(data){
ToolService.hideLoading();
if(data.code == -1001){
$scope.tip = {
pwd:{
status:true,
txt:'原密码输入错误,请重新输入'
}
}
}
else{
ToolService.showTips("修改失败");
}
});
}
}
})();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
$htmlbg:#f1f1f1;
$normalfont:#333;
$contentp:20px;
$headerbg:#ffffff; //header bg
$headerH:46px; //header height
$headerbc:#dcdcdc;//hearder-border
$leftwidth:186px; //menu width
$logoFontColor:#fff; //logo
$logobg:#5f97fb;
$menuContGap:30px; // menu-content-gap
$bordercolor:#c9c9c9; //
$darkfontcolor:#333; //
$lightfontcolor:#999;
$labelfontcolor:#666;
$blackfontcolor:#171a1e;
$disfontcolor:#c8c8c8;
$activebgcolor:#00a9e8;
$activeftcolor:#fff;
$iptheight:34px;
$btnheight:34px;
$comradius:3px;
$btndiscolor:#dcdcdc;
$btnformcolor:#01b9e0;
$btngraybg:#cbcbcb;
$btngraybg1:#fbfbfb;
$disbgcolor:#f9f9f9;
$nofontcolor:#bababa;
$tipftcolor:#b5b0b0;
$comactiveftcolor:#00a9e8; //font active color eg:blue
$loadingbarcolor:#00a9e8;
$darkbluecolor:#4e93cf;
$disbtncolor:#b8b8b8;
$menubgcolor:#ffffff;
$menuTop:38px;
$menuliheight:36px;
$menupadleft:16px;
$menuftcolor:#999999;
$menulibw:3px; //li border-width
$menuliactivebc:#5f97fb;
$menuliactivebg:#f1f3f5;
$menuliactiveft:#4186ec;
$submenuliactiveft:#00a9e8;
$wraptitleH:50px;
$wraptitlebgc:#fbfbfb; //bg-color
$wraptitlebrc:#e4e4e4; //br-color
$wrapPadding:22px 24px 16px 12px;
$defaultbg:#fff;
$itemGap:10px;
$smartChartH:260px;
$barChartH:390px;
$funnelChartH:250px;
$TitleChartH:400px;
$mapChartH:500px;
$itemlabel:#999999;
$itemstrong:#666666;
$tablebr:#e4e4e4;
$tablethbg:#f8f8f8;
$tablethft:#333333;
$tabletdft:#666666;
$tabletdactiveft:#428ccc;
$tablecelleven:#fff;
$tablecellodd:#fcfcfc;
$tablecellhover:#f1fbff;
$tablecellheight:43px;
$labelpiewidth:400px;
$labelpieheight:330px;
$labelpiegap:80px;
$labelcolor:#666;
$labellistpl:60px;
$labelfz:12px;
$labelbr:#999;
$labelselectedfc:#fff;
$labelheight:26px;
$labeltop:0px;
$labeldisft:#b4b4b4;
$labeldisbr:#c9c9c9;
$labeldistips:#e74646;
$selectactivebr:#00a9e8;
$optionbr:#c9c9c9;
$optionliheight:34px;
$optionlifc:#666666;
$optionpad:16px;
$optionliactivebg:#edfaff;
$optionliactivefc:#00a9e8;
$datebr:#c9c9c9;
$datewrapgap:20px;
$datebg:#fafafa;
$datefc:#333333;
$datethbr:#5ca3c5;
$datethbg:#f1fbff;
$datethfc:#2f6fa6;
$datelabelfc:#666666;
$datedisfc:#999999;
$datefz:12px;
$dateactivecolor:#00a9e8;
$dateradius:13px;
$datecellhw:26px;
$datewcellhw:40px;
$datemcellhw:40px;
$dateipth:28px;
$formPad:40px;
$formMg:78px;
$formbluecolor:#428ccc;
$formtitlemb:60px;
$formitemmb:30px;
$formlabelw:100px;
$formtitlebg:#fbfbfb;
$formtitlemdH:44px;
$formpowerH:340px;
$formmenupr:50px;
$formmenup:20px;
$formpeople:#e74646;
$formmenudis:#c9c9c9;
$formcampbg:#fbfbfb;
$formcamplihover:#f1f1f1;
$formcamplih:28px;
$formcampwraph:270px;
$formred:#e74646;
$descpcolor:#428ccc;
$descbg:#f7f7f7;
$operwidth:40px;
$eventbg:#f3f3f3;
$tabbarcolor:#5fb5f1;
$tabbarbgcolor:#e6e6e6;
$tabncolor:#3696d8;
$userbottombg:#f6f6f6;
$userbottombr:#e2e2e2;
$copyrightH:50px;
$redcolor:#fb4c3f;
$exceptionbg:#fe7472;
$normalbg:#5cc291;
$relbg:#95959e;
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>灵犀</title>
<meta name="keywords" content="热云数据 灵犀" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<!-- build:css styles/login.css -->
<link rel="stylesheet" type="text/css" href="styles/login.css">
<!-- endbuild -->
<!-- build:js scripts/change.js -->
<script src="js/app/page.js"></script>
<!-- endbuild -->
<!-- build:js scripts/regcom8.js -->
<script src="js/common/angular.min.js"></script>
<script src="js/common/echarts.min.js"></script>
<script src="js/common/jquery.min.js"></script>
<script src="js/common/jquery.cookie.min.js"></script>
<!-- endbuild -->
<!-- build:js scripts/success.js -->
<script src="js/common/judge.js"></script>
<script src="js/login/module.js"></script>
<script src="js/app/HttpService.js"></script>
<script src="js/app/UtilService.js"></script>
<script src="js/login/success.js"></script>
<!-- endbuild -->
</head>
<body ng-app="app" ng-controller="successCtrl">
<div class="loginWrap register">
<div class="activationWrap">
<a class="logo" href="login.html"></a>
<div class="registerActivation">已激活成功</div>
<a href="/login.html"><div class="activationButton successButton">立即登录</div></a>
</div>
</div>
<div class="copyright regt" ng-class="{'static':!hasReged}">
2017 TrackingIO.com All Rights Reserved <a href="http://www.miitbeian.gov.cn/" target="_blank">京ICP备14021832号</a>
</div>
<div class="alphaDiv" id="sysLoad" style="display: none;z-index: 99;">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
</body>
</html>
<div class="p">
<div class="conditionBox clearfix p pb20">
<div class="left">
<div class="selList" ng-class="{'active':selme,'noright':hasEditPower()}" ng-click="selme=!selme;" ng-mouseleave="selme=false;">
<span ng-class="{'dark ckhand':!isEditInfo && typesign=='define'}">{{typesname}}</span>
<div class="arrowIcon"></div>
<div class="optionList even" ng-show="selme" style="width:320px;">
<dl class="dlOperTitle bbb">
<dd ng-click="clickType(type)" ng-repeat="type in typeList track by $index" ng-class="{'active':typesign == type.id && define.id==0}">{{type.name}}</dd>
</dl>
<div ng-show="defineList.length>5" class="searchWrap ml10 searchSpec clearfix" style="float:none;width:300px;" stop-event>
<input type="text" class="searchIpt selectIpt" style="width:300px;" ng-model="seatxt" placeholder="关键字搜索">
</div>
<ul>
<li ng-repeat="m in defineList | filter:{'name':seatxt} track by $index" ng-click="clickDefine(m)" ng-class="{'active':m.id == define.id && !isShowCache}" title="{{m.name}}" class="p">
{{m.name}}<span class="delIcon s1" ng-click="deleteDefine(m)" stop-event ng-if="hasEditPower()"></span>
</li>
</ul>
</div>
</div>
<div class="btn8 dark btnblock btnNo" ng-class="{'active':isEditInfo==3 && showEventWin,'dis':!define || (define.id==0 && !isShowCache) || (isEditInfo==2 && !isShowCache)}" ng-click="addModel(1)" ng-show="hasEditPower()">编辑</div>
</div>
<div class="right">
<!-- <select-t-list meau-info="dimensionList" meau-id="dimensionId" meau-name="dimensionname" meau-typekey="['whole','usergroup','population','source']" meau-typename="['','用户分群','人口维度','来源维度']" ng-show="showDemistion()" meau-data="dimenInit" meau-refresh="dimenRmd"></select-t-list> -->
<select-t-list meau-info="dimensionList" meau-id="dimensionId" meau-id2="dimenEventType" meau-name="dimensionname" meau-typekey="['whole','usergroup','eventlist',null]" meau-typename="['','用户分群','事件属性','用户属性']" ng-show="typesign=='define' || typesign=='dau' || typesign=='install'" meau-data="dimenInit" meau-refresh="dimenRmd"></select-t-list>
<my-datepicker class="dateRange rightDate" init-day="date" max-day="-1" range-days2="rangday"><span>{{datestr}}</span></my-datepicker>
</div>
<div class="conditionWin eventBox" ng-show="showEventWin" ng-class="{'edit':isEditInfo==3}">
<div class="sanicon"></div>
<div class="funnelWrap clearfix" ng-repeat="event in eventInfo track by $index" ng-class="{'last':$index>0}" ng-show="event.show!=false">
<div class="eventItem clearfix p" style="z-index:{{event.zidx}}">
<div class="label txtLabel">{{event.title}}:</div>
<select-list meau-info="eventList" meau-id2="event.eventid" meau-data="event.eventinit" meau-name="eventinitname" class="eventItemsel" keyid="eventName" keyname="eventNameAlias" meau-red="event.nullevent"></select-list>
<div class="profileItemWrap p">
<div class="operInfo" style="bottom:35px;" ng-show="event.params && getEventParamsNum(event)>1">
<div class="operBtn" ng-click="changeRel(event)">{{event.relation}}</div>
</div>
<div class="profileItem" ng-repeat="item in event.params track by $index" ng-show="item.show!=false">
<profile-item info-list="event.paramsList" item-info="item" item-type="event" item-event="event.event"></profile-item>
<span class="removeSpan" ng-click="removeEventParams(event,item)">取消</span>
</div>
<span class="ml10 addAttrBtn" ng-click="addEventParams(event)" ng-class="{'dis':getEventParamsNum(event)>=3}" style="display: inline-block;">
<span class="addAttrIcon"></span><span class="ckhand">添加事件属性筛选</span>
</span>
</div>
</div>
</div>
<div class="conditionBoxBottom">
<div class="right mt20">
<span class="ckhand mr10" ng-class="{'dis':!canSave()}" ng-click="initCondition()">重置条件</span>
<span ng-show="define.id==0">
<div class="btn btnblock mr10 mybtn h30" ng-click="nameWin()" ng-class="{'disable':!canSave()}">保存</div>
<div class="btn3 btnblock mybtn h30" ng-click="lookReport()" ng-class="{'disable':!canSave()}">查看</div>
</span>
<div class="btnMoreGroup" ng-show="define.id>0" ng-mouseenter="bgroup=true" ng-mouseleave="bgroup=false;">
<div class="primaryBtn" ng-click="save()" ng-class="{'dis':!canSave()}">保存</div>
<div class="primarySelBtn" ng-class="{'dis':!canSave()}"></div>
<ul class="btnMenu" ng-show="bgroup && canSave()">
<li ng-click="save()">保存</li>
<li ng-click="nameWin(1)">另存为</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="conditionAlpha" ng-show="showEventWin" ng-click="closeAddWin(1)"></div>
<div class="chartWrap chart300 one clearfix" style="margin-top: 0px;">
<div class="chartWrapItem titleChart">
<div class="chartModule">
<span class="bigTips">{{define.name || typesname}}的留存趋势<help-tip class="help" dname="helpname" hidx="1"></help-tip></span>
<div class="right rigthM">
<!-- <select-list meau-info="deviceList" meau-id="deviceId" meau-data="deviceInit" class="whitebg" style="width:100px;"></select-list> -->
<ul class="btnGroup">
<li ng-class="{'active':timeFlag=='day','dis':disTimeFlag.indexOf('day')>-1}" ng-click="changeTimeFlag('day')"></li>
<li ng-class="{'active':timeFlag=='week','dis':disTimeFlag.indexOf('week')>-1}" ng-click="changeTimeFlag('week')"></li>
<li ng-class="{'active':timeFlag=='month','dis':disTimeFlag.indexOf('month')>-1}" ng-click="changeTimeFlag('month')"></li>
</ul>
</div>
</div>
<div class="chartItem p">
<div ng-class="{'lengedChart':dimenId!='-all'}">
<min-chart chart-data="myChartData" chart-type="line" chart-config="retetionConfig" chart-loading="retetionLoading" chart-resize="yes"></min-chart>
</div>
<!-- <div class="lengedWrap" ng-show="dimenId && dimenId!='-all' && showDemistion()"> -->
<div class="lengedWrap" ng-show="dimenId!='-all'">
<div class="searchWrap searchSpec clearfix" style="float:none;">
<input type="text" class="searchIpt selectIpt" ng-model="swtxt" placeholder="关键字搜索">
</div>
<ul class="hm-scroll">
<li ng-repeat="name in lengedNames | filter:swtxt track by $index" ng-class="lengedClass(name)" ng-click="changeChartData(name)">
<span class="sign" ng-style="lengedBgStyle(name)"></span>{{name}}
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="chartWrap clearfix">
<div class="chartWrapItem nothborder">
<div class="chartModule">
<span>{{define.name || typesname}}的留存趋势详情</span>
<export-button export-condition="myChartDataCondition" ng-if="infolist.val && infolist.val.length>0"></export-button>
</div>
<is-loading ng-if="infolistLoading"></is-loading>
<div class="tableList" ng-show="!infolistLoading" style="background-color: #fff;">
<table ng-show="infolist.val.length>0">
<tr>
<th ng-repeat="title in infolist.name track by $index" class="p">
{{title}}
</th>
</tr>
<tr ng-repeat="info in infolist.val track by $index" >
<td ng-repeat="col in infolist.columnkey track by $index" ng-class="{'name':$index==0}" ng-click="subDetail(info,$index)" ng-style="getBgColor(info['rate_' + col],$index,1)">
{{info[col]}}
<p ng-if="$index>1">{{info['rate_' + col]}}%</p>
</td>
</tr>
</table>
<no-data ng-if="!infolist.val || infolist.val.length==0"></no-data>
</div>
</div>
</div>
<div class="chartWrap clearfix" ng-show="showDetail">
<div class="chartWrapItem nothborder">
<div class="chartModule">
<span>{{define.name || typesname}}的留存明细</span>
<em class="ml10" style="font-size: 14px;">({{detailInfoTitle}})</em>
<export-button export-condition="detailInfoCondition"></export-button>
</div>
<is-loading ng-if="detailInfoLoading"></is-loading>
<div class="tableList" ng-show="!detailInfoLoading" style="background-color: #fff;">
<table>
<tr>
<th>日期</th>
<th ng-repeat="title in detailInfo.name track by $index" ng-if="$index>0">
{{title}}
</th>
</tr>
<tr ng-repeat="info in detailInfo.val track by $index" >
<td ng-repeat="col in detailInfo.columnkey track by $index" ng-style="getBgColor(info['rate_' + col],$index,2)">
{{info[col]}}
<p ng-if="$index>1">{{info['rate_' + col]}}%</p>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="openTipWin" ng-show="wantDelete">
<div class="closeGray" ng-click="closeWin()"></div>
<div class="tipCont">
<span ng-show="custommenus.length>0">
报表“{{delDefine.name}}”正在被
<span ng-repeat="custommenu in custommenus" ng-click="gotoCustonMenu(custommenu.id)">
<span class="customname">{{custommenu.name}}</span>
<span ng-show="!$last"></span></span>
{{custommenus.length}}个看单使用<br/>
删除后对应看单将不会再显示该报表,是否确认删除?
</span>
<span ng-show="!custommenus">
您正在删除报表“{{delDefine.name}}”,是否确认删除?
</span>
</div>
<div class="openBtnGroup clearfix">
<div class="btn8 mr20" ng-click="closeWin()">取消</div>
<div class="btn8" ng-click="doDelete()">确定</div>
</div>
</div>
<div class="openTipWin" ng-show="wantSave">
<div class="closeGray" ng-click="closeWin(2)"></div>
<div class="tipCont" style="text-align: left;">
<p class="mb10">请输入模板名称:</p>
<div>
<input type="text" class="iptform" ng-model="ename" style="width:300px;" placeholder="文字限定在20个汉字以内">
<div class="btn5 ml10 btnblock conwidth" ng-click="save(1)">保存</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="searchGroup p" ng-class="{'active':isactive}" ng-mouseenter="isactive=true" ng-mouseleave="isactive=false;">
<input type="text" ng-model="srhTxt" placeholder="输入搜索关键词">
<div class="btns" ng-click="query()">搜索</div>
<div class="removeTxt" ng-if="srhTxt!=''" ng-click="doNull()"></div>
</div>
\ No newline at end of file
<div class="selList app-type" ng-class="{'active':selme && operSel,'iptnull':meauRed,'dis':!operSel}" ng-click="selme=!selme;" ng-mouseleave="selme=false;">
<span>
<b ng-if="currentInfo.platform" ng-class="{'Android':'android','iOS':'apple','H5':'web'}[currentInfo.platform]"></b>
<em ng-if="currentInfo.platform" class="iconfont" ng-class="{'Android':'icon-android','iOS':'icon-ios','H5':'icon-wrap'}[currentInfo.platform]" style="color:#fff;"></em>
{{selName}}</span>
<div ng-class="{'whiteArrowIcon':iconType=='white','arrowIcon':!iconType,'blueArrow':iconType=='blue'}" ng-style="{'margin-top':selId=='line' || selId=='columnstack' || selId=='pie' || selId=='table'?'10px':''}"></div>
<div class="optionList" ng-show="selme && operSel" ng-class="{'chartType':selId=='line' || selId=='columnstack' || selId=='pie' || selId=='table'}">
<div ng-show="meauInfo.length>5 && showsearch && !meauInfo[0].dsflag" class="searchWrap" style="width: 100%;margin-top:5px;margin-bottom: 5px;float:left;box-sizing: border-box;padding:0px 5px;" stop-event>
<input type="text" class="searchIpt selectIpt" ng-model="searchlitxt" placeholder="关键字搜索" style="width:100%;border:1px solid #c9c9c9;">
</div>
<div class="clear"></div>
<ul style="max-height: 170px;">
<li ng-repeat="m in meauInfo | filterList:searchlitxt:keyname track by $index" ng-click="clickMeau(m)" ng-class="{'active':selId == m[keyid]}" title="{{m[keyname]}}" ng-style="{'border-bottom': m.border?'1px solid #dcdcdc':'','height':'35px'}" ng-if="m.attr!='usergroup'">
<i ng-if="m.platform" ng-class="{'Android':'android','iOS':'apple','H5':'web','line':'line','columnstack':'columnstack','pie':'pie','table':'table'}[m.platform]"></i>
<em ng-if="m.platform" class="iconfont" ng-class="{'Android':'icon-android','iOS':'icon-ios','H5':'icon-wrap','line':'icon-line','columnstack':'icon-columnstack','pie':'icon-pie','table':'icon-table'}[m.platform]"></em>
{{m[keyname]}}<em ng-if="m.templates && m.categoryName" class="label">({{m.categoryName}})</em>
</li>
</ul>
</div>
</div>
\ No newline at end of file
<div class="selList" ng-class="{'active':selme && operSel,'iptnull':meauRed,'dis':!operSel}" ng-click="selme=!selme;" ng-mouseleave="selme=false;">
<span>{{selName}}</span>
<div class="arrowIcon"></div>
<div class="optionList even" ng-show="selme && operSel">
<div ng-show="meauInfo.length>5 && typeName.length==2" class="searchWrap" style="width: 100%;margin-top:5px;margin-bottom: 5px;float:left;box-sizing: border-box;padding:0px 5px;" stop-event>
<input type="text" class="searchIpt selectIpt" ng-model="searchlitxt" placeholder="关键字搜索" style="width:100%;border:1px solid #c9c9c9;">
</div>
<div ng-repeat="type in typeKey track by $index" ng-class="{'border':$index>0 && haslist(type)}" ng-show="haslist(type)">
<div class="liTypeTitle" ng-if="typeName[$index]!='' && ((virtual==type || nature==type) || !searchlitxt)">{{typeName[$index]}}</div>
<ul>
<li ng-repeat="m in meauInfo | filterList:searchlitxt:keyname track by $index" ng-click="clickMeau(m)" ng-class="{'active':selId == m[keyid] && (meauType == m.type || !meauType)}" title="{{m[keyname]}}" ng-if="m.type == type || m.dimensionType == type">
{{m[keyname]}}
</li>
</ul>
</div>
</div>
</div>
\ No newline at end of file
<div class="selList" ng-class="{'active':selme,'iptnull':meauRed}" ng-click="selme=true;" ng-mouseleave="selme=false;">
<span ng-if="selIDS.length>0" title="{{selNames.join(',')}}">{{selNames.join(",")}}</span>
<span ng-if="selIDS.length==0">{{selName}}</span>
<div class="arrowIcon"></div>
<div class="optionList" ng-show="selme" stop-event>
<div class="searchWrap ml10" style="float: left;" ng-show="meauInfo.length>5">
<input type="text" class="searchIpt" ng-model="searchlitxt" placeholder="输入搜索关键字" style="border:1px solid #c9c9c9;">
</div>
<div class="clear"></div>
<ul>
<li ng-show="meauInfo.length>1">
<span ng-click="checkAll()">
<span class="checkbox" ng-class="{'active':ischeckall}" style="margin-right: 6px;"></span>全选
</span>
</li>
<li ng-repeat="m in meauInfo | filterList:searchlitxt:keyname track by $index" ng-click="clickMeau(m)" ng-class="{'active':selId == m[keyid]}" title="{{m[keyname]}}">
<span class="checkbox" style="margin-right: 6px;" ng-class="{'active':selIDS.indexOf(m[keyid])>-1}"></span>{{m[keyname]}}
</li>
</ul>
<div style="padding:10px;width:60px;margin:0 auto;" class="clearfix" ng-show="keyid=='id'">
<div class="btn4" ng-click="okSelect()">确定</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="selList" ng-class="{'active':selme}" ng-click="showSelWin()" stop-event>
<span>{{selName}}</span>
<div class="arrowIcon"></div>
<div class="optionList" ng-show="selme">
<div class="searchWrap ml10">
<input type="text" class="searchIpt" ng-model="seclitxt" placeholder="输入搜索关键字">
</div>
<div class="clear"></div>
<ul style="max-height: 170px;">
<div class="darklabel ml10">通用事件属性</div>
<li ng-repeat="m in meauInfo | filter:{name:seclitxt} track by $index" ng-click="clickMeau(m)" title="{{m.name}}">
<span class="radio" ng-class="{'active':selId == m.id}" style="margin-right: 6px;"></span>{{m.name}}
</li>
</ul>
</div>
<div class="optionList" ng-show="secondSel" ng-style="secondStyle" stop-event>
<div class="searchWrap ml10">
<input type="text" class="searchIpt" ng-model="searchlitxt" placeholder="输入搜索关键字">
</div>
<div class="clear"></div>
<ul style="max-height: 170px;">
<li ng-repeat="v in secondList | filter:searchlitxt track by $index" ng-click="clickSecMeau(v,$index)" title="{{v}}">
<span class="checkbox" style="margin-right: 6px;" ng-class="{'active':secIDS.indexOf(v)>-1}"></span>{{v}}
</li>
</ul>
<div style="padding:10px;width:100px;margin:0 auto;" class="clearfix">
<div class="btn4" ng-click="okSelect()">确定</div>
<div class="btn2" ng-click="selme=false;secondSel=false">取消</div>
</div>
</div>
</div>
<div class="dialogWin tipwin" ng-show="status==true">
<div class="dialogTitle">
<label>{{title}}</label>
<div class="closeBtn right mr10" ng-click="hideWin()"></div>
</div>
<div class="dialogContent">
<div class="formInfo">
<p class="ptip" ng-transclude></p>
<div class="btnTwoWrap clearfix">
<div class="btn5 mr10" ng-click="crmWin()" style="width:70px;text-align: center;">{{okTitle}}</div>
<div class="btn6" ng-click="hideWin()" style="width:70px;text-align: center;">{{noTitle}}</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<div class="btn3 mb20" ng-click="gopage()" ng-if="(usergroupList.length < limitInfo.dataUserGroupNum || limitInfo.dataUserGroupNum == -1) && hasEditPower()"><span class="formAddIcon"></span>新建分群</div>
<div class="clear"></div>
<div class="wrapTitle formTitleWrap">
<span>分群管理<help-tip class="help" name="分群管理"></help-tip></span>
<div class="searchWrap">
<input type="text" class="searchIpt" ng-model="searchTxt" placeholder="输入名称搜索">
</div>
</div>
<div class="tableList">
<table>
<tr>
<th>序号</th>
<th>名称</th>
<th>分群人数</th>
<th>分群数据更新时间</th>
<th>创建者</th>
<th>编辑者</th>
<th>编辑时间</th>
<th ng-if="hasEditPower()">操作</th>
</tr>
<tr ng-repeat="info in usergroupList | filter:{name:searchTxt} track by $index" ng-if="$index>flipPage.start && $index < flipPage.end">
<td>{{$index+1}}</td>
<td>{{info.name}}</td>
<td>
<span ng-if="info.status == 0">计算中</span>
<span ng-if="info.status == 1">{{info.number}}</span>
<span ng-if="info.status == 2">计算失败</span>
</td>
<td>{{info.dataUpdateTime | date:'yyyy-MM-dd'}}</td>
<td>{{info.cAccount}}</td>
<td>{{info.mAccount}}</td>
<td>{{info.modifyTime | date:'yyyy-MM-dd'}}</td>
<td class="formOper" ng-if="hasEditPower()">
<!-- <div class="formBtn" ng-click="refreshExport(info)">
<span class="f5Icon"></span>更新
</div> -->
<div class="formBtn" ng-click="gopage(info)">
<span class="editIcon"></span>编辑
</div>
<div class="formBtn" ng-click="doRemove(info.id)">
<span class="removeIcon"></span>删除
</div>
</td>
</tr>
</table>
<flip-info list-info="usergroupList" search-txt="searchTxt" search-name="name"></flip-info>
<del-tip status="delstatus" delfn="removeInfo()">确定删除该数据?</del-tip>
</div>
\ No newline at end of file
<div class="formDetailInfo">
<div class="formDetailTitle">
<a class="pretitle" ui-sref="collect.usergroup">分群管理</a>
<span ng-if="!id"> >新建分群</span>
<span ng-if="id"> >修改分群</span>
</div>
<div class="clear"></div>
<div class="formDetailItem">
<div class="iptlabel must">名称:</div>
<input type="text" class="iptform" ng-model="name" ng-blur="exixtName()" placeholder="请输入用户群名称">
<em class="error" ng-if="tip.name.status">{{tip.name.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">备注:</div>
<input type="text" class="iptform" ng-model="mark" placeholder="请输入用户群备注">
<em class="error" ng-if="tip.mark.status">{{tip.mark.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel must">时间:</div>
<my-datepicker class="dateRange" options="dateOps" init-day="mydate"><span>{{datestr}}</span></my-datepicker>
<div class="radioWrap" style="margin-left: 30px;">
<div class="radiolabel" ng-click="userType=0">
<span class="radio" ng-class="{'active':userType==0}"></span>
所有用户
</div>
<div class="radiolabel" ng-click="userType=1">
<span class="radio" ng-class="{'active':userType==1}"></span>
新增用户
</div>
</div>
</div>
<div class="profileWrap datawrap">
<div>用户属性</div>
<div class="profileItemWrap p">
<div class="operInfo" ng-show="getProfileNum()>0">
<div class="operBtn" ng-click="changeRel(1)">{{profileRel}}</div>
</div>
<div class="profileItem" ng-repeat="pro in profileInfo track by $index" id="{{pro.id}}" ng-show="pro.show!=false">
<profile-item info-list="profileList" item-info="pro" item-type="profile"></profile-item>
<span class="delItemIcon cldItem" ng-click="removeProfile(pro)"></span>
</div>
</div>
<div class="addItemIcon" ng-click="addProfile()" ng-class="{'dis':getProfileNum()>=5}"></div>
</div>
<div class="relationWrap">
<div class="pcenter label">AND</div>
</div>
<div class="profileWrap datawrap">
<div>触发事件<em class="error ml10" ng-if="tip.params.status">{{tip.params.txt}}</em></div>
<div class="profileItemWrap p">
<div class="operInfo" ng-show="getEventNum()>0">
<div class="operBtn" ng-click="changeRel(2)">{{eventRel}}</div>
</div>
<div class="eventItem ugItem clearfix p" ng-repeat="event in eventInfo track by $index" ng-show="event.show!=false" ng-style="event.style" style="margin-bottom: 10px;">
<select-list meau-info="eventList" meau-id2="event.eventid" meau-data="event.eventinit" meau-name="eventinitname" class="eventItemsel" keyid="eventName" keyname="eventNameAlias" meau-red="event.nullevent"></select-list>
<div class="profileItemWrap p" style="margin-left: 220px;padding-top: 10px;">
<div class="operInfo" style="bottom:15px;" ng-show="event.params && getEventParamsNum(event)>0">
<div class="operBtn" ng-click="changeRel(3,event)">{{event.relation}}</div>
</div>
<div class="profileItem" ng-repeat="item in event.params track by $index" ng-show="item.show!=false">
<profile-item info-list="event.paramsList" item-info="item" item-type="event" item-event="event.event"></profile-item>
<span class="removeSpan" ng-click="removeEventParams(event,item)">取消</span>
</div>
<span class="ml10 addAttrBtn" ng-click="addEventParams(event)" ng-class="{'dis':getEventParamsNum(event)>=3}">
<span class="addAttrIcon"></span><span class="ckhand">添加事件属性筛选</span>
</span>
</div>
<span class="delItemIcon right" ng-click="removeEvent(event)"></span>
</div>
</div>
<div class="addItemIcon" ng-click="addEvent()" ng-class="{'dis':getEventNum()>=5}"></div>
</div>
<div class="formsaveBtnWrap clearfix">
<div class="btn5" ng-click="exixtName(1)">
<span ng-if="!id">立即创建</span>
<span ng-if="id">保存</span>
</div>
<div class="btn6" ng-click="cancel()">取消</div>
</div>
</div>
\ No newline at end of file
<div class="wrapTitle formTitleWrap">
<span>账号管理</span>
</div>
<div class="formDetailInfo">
<div class="formhalf">
<div class="formline">账户信息
<div class="formBtn right" ng-click="toedit=true" ng-show="!toedit">
<span class="editIcon"></span>编辑</div>
</div>
<div class="formDetailItem">
<div class="iptlabel">账号:</div>
<div class="toblock">{{email}}</div>
</div>
<div class="formDetailItem">
<div class="iptlabel">姓名:</div>
<div class="iptformdis" ng-show="!toedit">{{name}}</div>
<input type="text" class="iptform" ng-model="name" placeholder="姓名" ng-show="toedit">
<em class="error errorInfo" ng-if="tip.name.status">{{tip.name.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">公司:</div>
<div class="iptformdis" ng-show="!toedit">{{company}}</div>
<input type="text" class="iptform" ng-model="company" placeholder="公司" ng-show="toedit">
<em class="error errorInfo" ng-if="tip.company.status">{{tip.company.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">手机:</div>
<div class="iptformdis" ng-show="!toedit">{{phone}}</div>
<input type="text" class="iptform" ng-model="phone" placeholder="手机" ng-show="toedit">
<em class="error errorInfo" ng-if="tip.phone.status">{{tip.phone.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">微信:</div>
<div class="iptformdis" ng-show="!toedit">{{wechat}}</div>
<input type="text" class="iptform" ng-model="wechat" placeholder="微信" ng-show="toedit">
<em class="error errorInfo" ng-if="tip.wechat.status">{{tip.wechat.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">QQ:</div>
<div class="iptformdis" ng-show="!toedit">{{qq}}</div>
<input type="text" class="iptform" ng-model="qq" placeholder="QQ" ng-show="toedit">
<em class="error errorInfo" ng-if="tip.qq.status">{{tip.qq.txt}}</em>
</div>
<div class="formDetailItem" ng-show="toedit">
<div class="iptlabel">&nbsp;</div>
<div class="btn5 toblock" style="padding:0px 20px;" ng-click="save()">提交修改</div>
</div>
</div>
<div class="formhalf" style="padding-right: 0px;" ng-show="isDemo">
</div>
<div class="formhalf" style="padding-right: 0px;" ng-show="!isDemo">
<div class="formline">修改密码</div>
<div class="formDetailItem">
<div class="iptlabel">原密码:</div>
<input type="password" class="iptform" ng-model="pwd" placeholder="输入原密码">
<em class="error" ng-if="tip.pwd.status" style="margin-left: 110px;display: block;line-height: 20px">{{tip.pwd.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">新密码:</div>
<input type="password" class="iptform" ng-model="newpwd" placeholder="*6-18位至少包含数字、大小写字母中的两种">
<em class="error" ng-if="tip.newpwd.status" style="margin-left: 110px;display: block;line-height: 20px">{{tip.newpwd.txt}}</em>
</div>
<div class="formDetailItem" >
<div class="iptlabel">确认密码:</div>
<input type="password" class="iptform" ng-model="crmpwd" placeholder="*6-18位至少包含数字、大小写字母中的两种">
<em class="error" ng-if="tip.crmpwd.status" style="margin-left: 110px;display: block;line-height: 20px">{{tip.crmpwd.txt}}</em>
</div>
<div class="formDetailItem">
<div class="iptlabel">&nbsp;</div>
<div class="btn5 toblock" style="padding:0px 20px;" ng-click="savepwd()">提交修改</div>
</div>
</div>
<div class="formhalf mt20">
<div class="formline">登录信息</div>
<div class="formDetailItem">
<div class="iptlabel">注册日期:</div>
{{createTime | date:'yyyy-MM-dd'}}
</div>
<div class="formDetailItem">
<div class="iptlabel" style="vertical-align: top;">近期登录:</div>
<ul class="toblock">
<li ng-repeat="log in logList track by $index">
<span class="mr10">{{log.pubDate | date:'yyyy-MM-dd HH:mm:ss'}}</span>
<span class="mr10">IP:{{log.ip}}</span>
<span>{{log.location}}</span>
</li>
</ul>
</div>
</div>
</div>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/lib" relative="WEB-INF/lib" />
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:1.3.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:1.5.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:3.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.7.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:4.3.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:1.7.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:1.1.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:4.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:4.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.9.1" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.ehcache-spring-annotations:ehcache-spring-annotations:1.1.2" level="project" />
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.1.0" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:4.2.1.Final" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: dom4j:dom4j:1.6.1" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:4.2.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:4.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-validator:5.0.0.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:1.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.1.1.GA" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:0.8.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.glassfish.web:javax.el:2.2.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: javax.el:javax.el-api:2.2.4" level="project" />
<orderEntry type="library" name="Maven: org.xerial.snappy:snappy-java:1.1.2.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.5" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jcl-over-slf4j:1.7.5" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.1.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.1.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-access:1.1.3" level="project" />
<orderEntry type="library" name="Maven: org.logback-extensions:logback-ext-spring:0.1.2" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.20.0-GA" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:5.1.25" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.8.5" level="project" />
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.3" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.0.14" level="project" />
<orderEntry type="module-library">
<library name="Maven: com.alibaba:jconsole:1.8.0">
<CLASSES>
<root url="jar://D:/java/jdk1.8.0_91/lib/jconsole.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Maven: com.alibaba:tools:1.8.0">
<CLASSES>
<root url="jar://D:/java/jdk1.8.0_91/lib/tools.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Maven: net.sf.json-lib:json-lib:jdk15:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.ezmorph:ezmorph:1.0.6" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20090211" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.2.2" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" name="Maven: com.belerweb:pinyin4j:2.5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-email:1.2" level="project" />
<orderEntry type="library" name="Maven: javax.mail:mail:1.4.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.googlecode.jmockit:jmockit:1.5" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.googlecode.jmockit:jmockit-coverage:0.999.24" level="project" />
<orderEntry type="library" name="Maven: org.jdom:jdom:1.1.3" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-dynamodb:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-s3:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-kms:1.11.52" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-core:1.11.52" level="project" />
<orderEntry type="library" name="Maven: software.amazon.ion:ion-java:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:jmespath-java:1.0" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.6.3" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jettison:jettison:1.3.7" level="project" />
<orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.8" level="project" />
<orderEntry type="library" name="Maven: org.webjars.npm:isemail:2.1.0" level="project" />
<orderEntry type="library" name="Maven: commons-net:commons-net:3.6" level="project" />
<orderEntry type="library" name="Maven: dnsjava:dnsjava:2.1.8" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:3.16" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.16" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.anarres.lzo:lzo-core:1.0.5" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:annotations:2.0.3" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:ads-lib:3.9.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject:guice:4.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject.extensions:guice-assistedinject:4.0" level="project" />
<orderEntry type="library" name="Maven: com.google.inject.extensions:guice-multibindings:4.0" level="project" />
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
<orderEntry type="library" name="Maven: net.sf.opencsv:opencsv:1.8" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.8.2" level="project" />
<orderEntry type="library" name="Maven: com.google.api-client:google-api-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.oauth-client:google-oauth-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:adwords-axis:3.9.0" level="project" />
<orderEntry type="library" name="Maven: com.google.api-ads:ads-lib-axis:3.9.0" level="project" />
<orderEntry type="library" name="Maven: commons-discovery:commons-discovery:0.4" level="project" />
<orderEntry type="library" name="Maven: javax.xml:jaxrpc-api:1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.axis:axis:1.4" level="project" />
<orderEntry type="library" name="Maven: wsdl4j:wsdl4j:1.6.2" level="project" />
<orderEntry type="library" name="Maven: com.google.http-client:google-http-client-jackson2:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.http-client:google-http-client:1.22.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: com.beust:jcommander:1.48" level="project" />
<orderEntry type="library" name="Maven: com.facebook.presto:presto-jdbc:0.170" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-jdbc:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-common:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: commons-cli:commons-cli:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.1" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.aggregate:jetty-all:7.6.0.v20120127" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-jaspic_1.0_spec:1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.geronimo.specs:geronimo-annotation_1.0_spec:1.1.1" level="project" />
<orderEntry type="library" name="Maven: asm:asm-commons:3.1" level="project" />
<orderEntry type="library" name="Maven: asm:asm-tree:3.1" level="project" />
<orderEntry type="library" name="Maven: com.codahale.metrics:metrics-core:3.0.2" level="project" />
<orderEntry type="library" name="Maven: com.codahale.metrics:metrics-jvm:3.0.2" level="project" />
<orderEntry type="library" name="Maven: com.codahale.metrics:metrics-json:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-service:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: net.sf.jpam:jpam:1.1" level="project" />
<orderEntry type="library" name="Maven: tomcat:jasper-compiler:5.5.23" level="project" />
<orderEntry type="library" name="Maven: tomcat:jasper-runtime:5.5.23" level="project" />
<orderEntry type="library" name="Maven: commons-el:commons-el:1.0" level="project" />
<orderEntry type="library" name="Maven: javax.servlet.jsp:jsp-api:2.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-recipes:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.jamon:jamon-runtime:2.3.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-serde:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.avro:avro:1.7.6-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: com.thoughtworks.paranamer:paranamer:2.3" level="project" />
<orderEntry type="library" name="Maven: com.twitter:parquet-hadoop-bundle:1.5.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-servlet:1.14" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-server:1.14" level="project" />
<orderEntry type="library" name="Maven: asm:asm:3.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-metastore:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: com.jolbox:bonecp:0.8.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.derby:derby:10.11.1.1" level="project" />
<orderEntry type="library" name="Maven: org.datanucleus:datanucleus-api-jdo:3.2.6" level="project" />
<orderEntry type="library" name="Maven: org.datanucleus:datanucleus-rdbms:3.2.9" level="project" />
<orderEntry type="library" name="Maven: commons-pool:commons-pool:1.5.4" level="project" />
<orderEntry type="library" name="Maven: commons-dbcp:commons-dbcp:1.4" level="project" />
<orderEntry type="library" name="Maven: javax.jdo:jdo-api:3.0.1" level="project" />
<orderEntry type="library" name="Maven: javax.transaction:jta:1.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-shims:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive.shims:hive-shims-common:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hive.shims:hive-shims-0.23:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-server-resourcemanager:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.google.inject.extensions:guice-servlet:3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey.contribs:jersey-guice:1.9" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-common:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-api:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.2.2" level="project" />
<orderEntry type="library" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.jersey:jersey-client:1.9" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-server-common:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.fusesource.leveldbjni:leveldbjni-all:1.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-server-applicationhistoryservice:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hadoop:hadoop-yarn-server-web-proxy:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.hive.shims:hive-shims-scheduler:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.mockito:mockito-all:1.9.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.2.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.2.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.thrift:libthrift:0.9.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.zookeeper:zookeeper:3.4.5-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-framework:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.curator:curator-client:2.6.0" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.5" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-exec:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hive:hive-ant:1.1.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.5" level="project" />
<orderEntry type="library" name="Maven: oro:oro:2.0.8" level="project" />
<orderEntry type="library" name="Maven: org.cloudera.logredactor:logredactor:1.0.3" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-jaxrs:1.8.8" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.8.8" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.8.8" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-xc:1.8.8" level="project" />
<orderEntry type="library" name="Maven: log4j:log4j:1.2.16" level="project" />
<orderEntry type="library" name="Maven: log4j:apache-log4j-extras:1.2.17" level="project" />
<orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.4" level="project" />
<orderEntry type="library" name="Maven: org.antlr:stringtemplate:3.2.1" level="project" />
<orderEntry type="library" name="Maven: org.antlr:ST4:4.0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.ant:ant:1.9.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.ant:ant-launcher:1.9.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.4.1" level="project" />
<orderEntry type="library" name="Maven: org.tukaani:xz:1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.thrift:libfb303:0.9.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.ivy:ivy:2.4.0" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.groovy:groovy-all:2.4.4" level="project" />
<orderEntry type="library" name="Maven: org.datanucleus:datanucleus-core:3.2.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.calcite:calcite-core:1.0.0-incubating" level="project" />
<orderEntry type="library" name="Maven: org.apache.calcite:calcite-linq4j:1.0.0-incubating" level="project" />
<orderEntry type="library" name="Maven: org.pentaho:pentaho-aggdesigner-algorithm:5.1.5-jhyde" level="project" />
<orderEntry type="library" name="Maven: eigenbase:eigenbase-properties:1.1.4" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.janino:janino:2.7.6" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.janino:commons-compiler:2.7.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.calcite:calcite-avatica:1.0.0-incubating" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" name="Maven: jline:jline:2.12" level="project" />
<orderEntry type="library" name="Maven: org.apache.hbase:hbase-common:1.2.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hbase:hbase-protocol:1.2.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hbase:hbase-annotations:1.2.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:2.5.0" level="project" />
<orderEntry type="library" name="Maven: org.mortbay.jetty:jetty-util:6.1.26.cloudera.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.htrace:htrace-core:3.2.0-incubating" level="project" />
<orderEntry type="library" name="Maven: org.apache.hadoop:hadoop-annotations:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.hadoop:hadoop-common:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.1.1" level="project" />
<orderEntry type="library" name="Maven: xmlenc:xmlenc:0.52" level="project" />
<orderEntry type="library" name="Maven: org.mortbay.jetty:jetty:6.1.26.cloudera.4" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-json:1.9" level="project" />
<orderEntry type="library" name="Maven: com.sun.xml.bind:jaxb-impl:2.2.3-1" level="project" />
<orderEntry type="library" name="Maven: net.java.dev.jets3t:jets3t:0.9.0" level="project" />
<orderEntry type="library" name="Maven: com.jamesmurty.utils:java-xmlbuilder:0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.hadoop:hadoop-auth:2.6.0-cdh5.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M15" level="project" />
<orderEntry type="library" name="Maven: org.apache.directory.server:apacheds-i18n:2.0.0-M15" level="project" />
<orderEntry type="library" name="Maven: org.apache.directory.api:api-asn1-api:1.0.0-M20" level="project" />
<orderEntry type="library" name="Maven: org.apache.directory.api:api-util:1.0.0-M20" level="project" />
<orderEntry type="library" name="Maven: com.jcraft:jsch:0.1.42" level="project" />
<orderEntry type="library" name="Maven: org.apache.htrace:htrace-core4:4.0.1-incubating" level="project" />
<orderEntry type="library" name="Maven: com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>
\ 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