Explorar el Código

列表数据排序

WH01243 hace 1 año
padre
commit
b3933f1552
Se han modificado 3 ficheros con 32 adiciones y 27 borrados
  1. 26 26
      api/application.api
  2. 2 1
      api/internal/handler/routes.go
  3. 4 0
      api/internal/service/owner.go

+ 26 - 26
api/application.api

@@ -334,106 +334,106 @@ service crmApplication {
 	@doc "添加线索"
 	@handler clueAdd
 	post /crmApplication/clue/add (ClueAddReq) returns (Reply)
-	
+
 	@doc "创建销售机会"
 	@handler saleChanceAdd
 	post /crmApplication/saleChance/add (SaleChanceReq) returns (Reply)
-	
+
 	@doc "收录操作"
 	@handler employOperate
 	post /crmApplication/employ/operate (EmployOperateReq) returns (Reply)
-	
+
 	@doc "商业资讯的转办"
 	@handler transfer
 	post /crmApplication/information/transfer (TransferReq) returns (Reply)
-	
+
 	@doc "忽略操作"
 	@handler ignoreOperate
 	post /crmApplication/ignore/operate (IgnoreOperateReq) returns (Reply)
-	
+
 	@doc "收录情况"
 	@handler employInfo
 	post /crmApplication/employ/info (InfoEmployinfoReq) returns (InfoReply)
-	
+
 	@doc "创建客户"
 	@handler customAdd
 	post /crmApplication/custom/add (CustomAddReq) returns (Reply)
-	
+
 	@doc "文件上传"
 	@handler fileUpload
 	post /crmApplication/file/upload (FileUploadReq) returns (Reply)
-	
+
 	@doc "分发"
 	@handler employDistribute
 	post /crmApplication/employ/distribute (EmployDistributeReq) returns (Reply)
-	
+
 	@doc "企业详情"
 	@handler entinfo
 	post /crmApplication/ent/info (EntInfoReq) returns (Reply)
-	
+
 	@doc "消息推送"
 	@handler pushMsg
 	post /crmApplication/info/push (PushMsgReq) returns (Reply)
-	
+
 	@doc "是否可以创建"
 	@handler canAddReq
 	post /crmApplication/info/canAdd (CanAddReq) returns (Reply)
-	
+
 	@doc "人脉可达潜客业主列表"
 	@handler ownerList
-	post /crmApplication/owner/List (OwnerListReq) returns (Reply)
-	
+	post /crmApplication/owner/list (OwnerListReq) returns (Reply)
+
 	@doc "人脉可达商机列表"
 	@handler projectList
 	post /crmApplication/network/project/list (ProjectListReq) returns (Reply)
-	
+
 	@doc "项目公关渠道分析-项目名称联想"
 	@handler PrPnameAss
 	post /crmApplication/pr/pname/ass (PnameAssReq) returns (Reply)
-	
+
 	@doc "项目公关渠道分析-与业主合作历史"
 	@handler CoopHistoryList
 	post /crmApplication/pr/project/analyse (CoopHistoryReq) returns (Reply)
-	
+
 	@doc "人脉库-添加/修改人脉"
 	@handler addOrUpdate
 	post /crmApplication/network/addOrUpdate (AddOrUpdateReq) returns (Reply)
-	
+
 	@doc "人脉库-业主名称联想"
 	@handler associate
 	post /crmApplication/network/associate (AssociateReq) returns (Reply)
-	
+
 	@doc "人脉库-全部人脉项目"
 	@handler allProject
 	post /crmApplication/network/allProject (AllprojectReq) returns (Reply)
-	
+
 	@doc "人脉库-列表"
 	@handler networkList
 	post /crmApplication/network/networkList (NetWorkListReq) returns (Reply)
-	
+
 	@doc "忽略操作"
 	@handler ignoreAction
 	post /crmApplication/ignore/action (IgnoreReq) returns (Reply)
-	
+
 	@doc "情报详情"
 	@handler infoDetail
 	post /crmApplication/infomation/detail (InfoDetailReq) returns (Reply)
-	
+
 	@doc "人脉可达商机列表-人脉路径"
 	@handler plistPath
 	post /crmApplication/network/plist/pathway (PListPathReq) returns (Reply)
-	
+
 	@doc "人脉项目分析-业主合作历史"
 	@handler projectHistory
 	post /crmApplication/pr/project/history (PrjectHistoryReq) returns (Reply)
 	@doc "可介绍业主路径"
 	@handler ownerRoute
 	post /crmApplication/owner/route (RouteOwnerListReq) returns (Reply)
-	
+
 	@doc "可介绍业主合作次数"
 	@handler ownerCooperate
 	post /crmApplication/owner/cooperate (CooperateOwnerListReq) returns (Reply)
-	
+
 	@doc "候选渠道列表"
 	@handler candidateChannel
 	post /crmApplication/candidate/channel (ChannelListReq) returns (Reply)

+ 2 - 1
api/internal/handler/routes.go

@@ -74,7 +74,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 			{
 				Method:  http.MethodPost,
-				Path:    "/crmApplication/owner/List",
+				Path:    "/crmApplication/owner/list",
 				Handler: ownerListHandler(serverCtx),
 			},
 			{
@@ -148,5 +148,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 				Handler: candidateChannelHandler(serverCtx),
 			},
 		},
+		rest.WithMaxBytes(104857600),
 	)
 }

+ 4 - 0
api/internal/service/owner.go

@@ -4,6 +4,7 @@ import (
 	"context"
 	"encoding/json"
 	"fmt"
+	"sort"
 	"strings"
 
 	"app.yhyue.com/moapp/jybase/common"
@@ -116,6 +117,9 @@ func (t *OwnerService) OwnerlList() map[string]interface{} {
 	}
 	startIndex := (t.PageIndex - 1) * t.PageSize
 	endIndex := t.PageIndex * t.PageSize
+	sort.Slice(returnData, func(i, j int) bool {
+		return returnData[i].Zbtime < returnData[j].Zbtime
+	})
 	if startIndex < gconv.Int64(len(returnData)) {
 		if endIndex > gconv.Int64(len(returnData)) {
 			endIndex = gconv.Int64(len(returnData))