1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

Replace new Sort() with Sort.by()

This commit is contained in:
dengchao@xgtl 2020-04-16 11:03:23 +08:00
parent 4c4809cce1
commit 04d6100c6d
3 changed files with 1507 additions and 1511 deletions

View File

@ -153,14 +153,14 @@ public class AgentAuditController extends Handler {
criterias.add(new Sort.Order(Sort.Direction.DESC, "status")); criterias.add(new Sort.Order(Sort.Direction.DESC, "status"));
criterias.add(new Sort.Order(Sort.Direction.DESC, "createtime")); criterias.add(new Sort.Order(Sort.Direction.DESC, "createtime"));
} else if (sort.equals("default")) { } else if (sort.equals("default")) {
defaultSort = new Sort(Sort.Direction.DESC, "status"); defaultSort = Sort.by(Sort.Direction.DESC, "status");
} }
if (criterias.size() > 0) { if (criterias.size() > 0) {
defaultSort = new Sort(criterias); defaultSort = Sort.by(criterias);
map.addAttribute("sort", sort); map.addAttribute("sort", sort);
} }
} else { } else {
defaultSort = new Sort(Sort.Direction.DESC, "status"); defaultSort = Sort.by(Sort.Direction.DESC, "status");
} }
// 坐席对话列表 // 坐席对话列表
@ -215,7 +215,7 @@ public class AgentAuditController extends Handler {
final String orgi = super.getOrgi(request); final String orgi = super.getOrgi(request);
final User logined = super.getUser(request); final User logined = super.getUser(request);
Sort defaultSort = new Sort(Sort.Direction.DESC, "status"); Sort defaultSort = Sort.by(Sort.Direction.DESC, "status");
// 坐席对话列表 // 坐席对话列表
List<AgentUser> agentUsers; List<AgentUser> agentUsers;
@ -246,7 +246,7 @@ public class AgentAuditController extends Handler {
ModelAndView view = request(super.createRequestPageTempletResponse("/apps/cca/agentusers")); ModelAndView view = request(super.createRequestPageTempletResponse("/apps/cca/agentusers"));
User logined = super.getUser(request); User logined = super.getUser(request);
final String orgi = super.getOrgi(request); final String orgi = super.getOrgi(request);
Sort defaultSort = new Sort(Sort.Direction.DESC, "status"); Sort defaultSort = Sort.by(Sort.Direction.DESC, "status");
view.addObject( view.addObject(
"agentUserList", agentUserRes.findByOrgiAndStatusAndAgentnoIsNot( "agentUserList", agentUserRes.findByOrgiAndStatusAndAgentnoIsNot(
orgi, MainContext.AgentUserStatusEnum.INSERVICE.toString(), logined.getId(), defaultSort)); orgi, MainContext.AgentUserStatusEnum.INSERVICE.toString(), logined.getId(), defaultSort));

View File

@ -97,7 +97,7 @@ public class AgentServiceProxy {
final AgentService agentService, final AgentService agentService,
final ModelMap map) { final ModelMap map) {
Sort defaultSort; Sort defaultSort;
defaultSort = new Sort(Sort.Direction.DESC, "servicetime"); defaultSort = Sort.by(Sort.Direction.DESC, "servicetime");
map.addAttribute( map.addAttribute(
"agentServiceList", "agentServiceList",
agentServiceRes.findByUseridAndOrgiAndStatus( agentServiceRes.findByUseridAndOrgiAndStatus(