|
@@ -1,6 +1,7 @@
|
|
|
package middleground
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
"context"
|
|
|
"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/datasmt"
|
|
|
"jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/pb"
|
|
@@ -43,8 +44,8 @@ func (u *publicService) NewClient() zrpc.Client {
|
|
|
return client
|
|
|
}
|
|
|
|
|
|
-//获取身份列表
|
|
|
-func (p *publicService) List(searchValue, dataType string, pageNum, pageSize int64) *pb.DatasmtRespList {
|
|
|
+//列表数据处理
|
|
|
+func (p *publicService) List(searchValue, dataType string, pageNum, pageSize int64) map[string]interface{} {
|
|
|
client := p.NewClient()
|
|
|
if client == nil {
|
|
|
return nil
|
|
@@ -59,5 +60,54 @@ func (p *publicService) List(searchValue, dataType string, pageNum, pageSize int
|
|
|
log.Println(err)
|
|
|
return nil
|
|
|
}
|
|
|
- return resp
|
|
|
+ result := map[string]interface{}{}
|
|
|
+ result["PageCount"] = resp.PageCount
|
|
|
+ wordMap := map[string]string{}
|
|
|
+ wordArr := []map[string]interface{}{}
|
|
|
+ for _, v := range resp.FieldIllustrate {
|
|
|
+ wordArr = append(wordArr, map[string]interface{}{
|
|
|
+ "code": v.Code,
|
|
|
+ "Name": v.Name,
|
|
|
+ "describe": v.Describe,
|
|
|
+ })
|
|
|
+ wordMap[v.Code] = v.Name
|
|
|
+ }
|
|
|
+ arr := []map[string]interface{}{}
|
|
|
+ for _, v := range resp.List {
|
|
|
+ arr = append(arr, map[string]interface{}{
|
|
|
+ "id": v.Id,
|
|
|
+ "name": v.Name,
|
|
|
+ "format": v.Format,
|
|
|
+ "clearStatus": v.ClearStatus,
|
|
|
+ "clearStatusStr": common.If(v.ClearStatus == "0", "", "人工清洗"),
|
|
|
+ "dataType": v.DataType,
|
|
|
+ "dataTypeStr": wordMap[v.DataType],
|
|
|
+ })
|
|
|
+ }
|
|
|
+ result["wordMap"] = wordMap
|
|
|
+ result["FieldIllustrate"] = wordArr
|
|
|
+ result["hotKeys"] = resp.HotKeys
|
|
|
+ return result
|
|
|
+}
|
|
|
+func (p *publicService) Detail(id string) map[string]interface{} {
|
|
|
+ client := p.NewClient()
|
|
|
+ if client == nil {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ resp, err := datasmt.NewDatasmt(client).Detail(context.Background(), &pb.DatasmtReqDetail{
|
|
|
+ Id: id})
|
|
|
+ if err != nil {
|
|
|
+ log.Println(err)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ result := map[string]interface{}{}
|
|
|
+ result["name"] = resp.Name
|
|
|
+ result["dataTypeStr"] = resp.FieldIllustrate.Name
|
|
|
+ result["dataType"] = resp.FieldIllustrate.Code
|
|
|
+ result["describe"] = resp.FieldIllustrate.Describe
|
|
|
+ result["clearStatusStr"] = common.If(resp.ClearStatus == "0", "", "人工清洗")
|
|
|
+ result["clearStatus"] = resp.ClearStatus
|
|
|
+ result["dataExample"] = resp.DataExample
|
|
|
+ result["format"] = resp.Format
|
|
|
+ return result
|
|
|
}
|