|
@@ -41,6 +41,7 @@ func (this *EdbSourceStatController) Column() {
|
|
br.Msg = "请选择表类型"
|
|
br.Msg = "请选择表类型"
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ isApi, _ := this.GetInt("IsApi", 0)
|
|
tmpList, err := data_stat.GetStatColumn(columnType)
|
|
tmpList, err := data_stat.GetStatColumn(columnType)
|
|
if err != nil {
|
|
if err != nil {
|
|
br.Msg = "获取自定义列失败"
|
|
br.Msg = "获取自定义列失败"
|
|
@@ -49,6 +50,9 @@ func (this *EdbSourceStatController) Column() {
|
|
}
|
|
}
|
|
var list []*data_stat.EdbInfoStatColumnListItem
|
|
var list []*data_stat.EdbInfoStatColumnListItem
|
|
for _, v := range tmpList {
|
|
for _, v := range tmpList {
|
|
|
|
+ if isApi == 1 && v.ColumnKey == "InitSourceName" {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
tmp := new(data_stat.EdbInfoStatColumnListItem)
|
|
tmp := new(data_stat.EdbInfoStatColumnListItem)
|
|
tmp.ColumnKey = v.ColumnKey
|
|
tmp.ColumnKey = v.ColumnKey
|
|
tmp.IsShow = v.IsShow
|
|
tmp.IsShow = v.IsShow
|
|
@@ -491,7 +495,17 @@ func (this *EdbSourceStatController) EdbUpdateStat() {
|
|
|
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
|
+ isApi, _ := this.GetInt("IsApi", 0)
|
|
|
|
|
|
|
|
+ // 区分终端和API的统计
|
|
|
|
+ // 查询类型为API的终端编码
|
|
|
|
+ terminalCodeList, err := data_manage.GetTerminalCodeBySourceAndIsApi(source, isApi)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取终端编码失败"
|
|
|
|
+ br.ErrMsg = "获取终端编码失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
var startSize int
|
|
var startSize int
|
|
if pageSize <= 0 {
|
|
if pageSize <= 0 {
|
|
pageSize = utils.PageSize20
|
|
pageSize = utils.PageSize20
|
|
@@ -502,9 +516,10 @@ func (this *EdbSourceStatController) EdbUpdateStat() {
|
|
|
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
|
|
|
- condition := " and source = ?"
|
|
|
|
|
|
+ condition := " and source = ? and terminal_code in (" + utils.GetOrmInReplace(len(terminalCodeList)) + ")"
|
|
var pars []interface{}
|
|
var pars []interface{}
|
|
pars = append(pars, source)
|
|
pars = append(pars, source)
|
|
|
|
+ pars = append(pars, terminalCodeList)
|
|
if createTime != "" {
|
|
if createTime != "" {
|
|
startT, err := time.ParseInLocation(utils.FormatDate, createTime, time.Local)
|
|
startT, err := time.ParseInLocation(utils.FormatDate, createTime, time.Local)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -690,7 +705,7 @@ func (this *EdbSourceStatController) EdbSourceStat() {
|
|
|
|
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
pageSize, _ := this.GetInt("PageSize")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
currentIndex, _ := this.GetInt("CurrentIndex")
|
|
-
|
|
|
|
|
|
+ isApi, _ := this.GetInt("IsApi", 0)
|
|
var startSize int
|
|
var startSize int
|
|
if pageSize <= 0 {
|
|
if pageSize <= 0 {
|
|
pageSize = utils.PageSize20
|
|
pageSize = utils.PageSize20
|
|
@@ -701,9 +716,20 @@ func (this *EdbSourceStatController) EdbSourceStat() {
|
|
|
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
|
|
|
- condition := " and source = ?"
|
|
|
|
|
|
+ // 区分终端和API的统计
|
|
|
|
+ // 查询类型为API的终端编码
|
|
|
|
+ terminalCodeList, err := data_manage.GetTerminalCodeBySourceAndIsApi(source, isApi)
|
|
|
|
+ if err != nil {
|
|
|
|
+ br.Msg = "获取终端编码失败"
|
|
|
|
+ br.ErrMsg = "获取终端编码失败,Err:" + err.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ condition := " and source = ? and terminal_code in (" + utils.GetOrmInReplace(len(terminalCodeList)) + ")"
|
|
var pars []interface{}
|
|
var pars []interface{}
|
|
pars = append(pars, source)
|
|
pars = append(pars, source)
|
|
|
|
+ pars = append(pars, terminalCodeList)
|
|
|
|
|
|
if createTime != "" {
|
|
if createTime != "" {
|
|
startT, err := time.ParseInLocation(utils.FormatDate, createTime, time.Local)
|
|
startT, err := time.ParseInLocation(utils.FormatDate, createTime, time.Local)
|