From ae1fa066d5ae99b126f305a3ceecc089aab748d2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 30 Jun 2021 15:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=9D=83=E9=99=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/GovStaffRoleResultDTO.java | 6 ++++++ .../service/impl/GovStaffRoleServiceImpl.java | 15 +++++++++++---- .../src/main/resources/mapper/GovStaffRoleDao.xml | 3 ++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java index 3d29b9d75e..3302c18b97 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -81,4 +82,9 @@ public class GovStaffRoleResultDTO implements Serializable { * 职责描述[默认值] */ private String defDescription; + /** + * 排序 + */ + @JsonIgnore + private Integer sort; } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 391696e92b..423920a84a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -44,10 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 政府端角色表 @@ -198,9 +195,19 @@ public class GovStaffRoleServiceImpl extends BaseServiceImplNumConstant.ZERO){ + Collections.sort(resultList, new Comparator() { + @Override + public int compare(GovStaffRoleResultDTO o1, GovStaffRoleResultDTO o2) { + return o1.getSort().compareTo(o2.getSort()); + } + }); + } return resultList; } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 7c35e8500b..da79b4be3b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -73,7 +73,8 @@ r.ROLE_KEY AS roleKey, r.ROLE_NAME AS roleName, r.ORG_TYPE AS orgType, - r.DESCRIPTION AS description + r.DESCRIPTION AS description, + r.SORT AS sort FROM gov_staff_role r WHERE r.CUSTOMER_ID = #{customerId} ORDER BY r.SORT asc