Commit 18c4eef5acd66cfb0962a4cc322b24dbf5d36775
1 parent
ae095a5614
Exists in
master
and in
6 other branches
基层辅助建档接口
Showing 3 changed files with 7 additions and 10 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ArchiveDataServicer.java
View file @
18c4eef
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.query.ArchiveDataQuery; |
| 7 | 7 | import org.apache.commons.lang.StringUtils; |
| 8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | +import org.springframework.data.domain.Sort; | |
| 9 | 10 | import org.springframework.stereotype.Service; |
| 10 | 11 | |
| 11 | 12 | import java.util.List; |
| 12 | 13 | |
| ... | ... | @@ -28,13 +29,13 @@ |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | |
| 31 | - public List<ArchiveData> query(ArchiveDataQuery archiveDataQuery) { | |
| 32 | + public List<ArchiveData> query(ArchiveDataQuery archiveDataQuery,Sort.Direction direction,String field) { | |
| 32 | 33 | MongoQuery query = archiveDataQuery.convertToQuery(); |
| 33 | 34 | if (StringUtils.isNotEmpty(archiveDataQuery.getNeed())) { |
| 34 | 35 | archiveDataQuery.mysqlBuild(archiveDataDao.ArchiveDataCount(archiveDataQuery.convertToQuery())); |
| 35 | 36 | query.start(archiveDataQuery.getOffset()).end(archiveDataQuery.getLimit()); |
| 36 | 37 | } |
| 37 | - return archiveDataDao.query(query); | |
| 38 | + return archiveDataDao.query(query.addOrder(direction, field)); | |
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 |
platform-biz-service/src/main/resources/mainOrm/master/AssistBuildMapper.xml
View file @
18c4eef
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AssistBuildFacade.java
View file @
18c4eef
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | import com.lyms.platform.query.ArchiveDataQuery; |
| 16 | 16 | import net.sf.json.JSONObject; |
| 17 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | +import org.springframework.data.domain.Sort; | |
| 18 | 19 | import org.springframework.stereotype.Component; |
| 19 | 20 | |
| 20 | 21 | import java.text.ParseException; |
| ... | ... | @@ -170,7 +171,6 @@ |
| 170 | 171 | |
| 171 | 172 | List result = new ArrayList(); |
| 172 | 173 | ArchiveDataQuery query = new ArchiveDataQuery(); |
| 173 | - query.setSort(" created desc "); | |
| 174 | 174 | List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param); |
| 175 | 175 | if (CollectionUtils.isNotEmpty(userModels)) { |
| 176 | 176 | AssistBuildUserModel model = userModels.get(0); |
| ... | ... | @@ -185,7 +185,7 @@ |
| 185 | 185 | query.setNeed("true"); |
| 186 | 186 | query.setLimit(limit); |
| 187 | 187 | |
| 188 | - List<ArchiveData> list = archiveDataServicer.query(query); | |
| 188 | + List<ArchiveData> list = archiveDataServicer.query(query, Sort.Direction.DESC,"created"); | |
| 189 | 189 | if (CollectionUtils.isNotEmpty(list)) |
| 190 | 190 | { |
| 191 | 191 | for (ArchiveData archiveData : list) |
| ... | ... | @@ -209,7 +209,6 @@ |
| 209 | 209 | |
| 210 | 210 | List result = new ArrayList(); |
| 211 | 211 | ArchiveDataQuery query = new ArchiveDataQuery(); |
| 212 | - query.setSort(" created desc "); | |
| 213 | 212 | List<AssistBuildUserModel> userModels = assistBuildService.queryAssistBuildUsers(param); |
| 214 | 213 | if (CollectionUtils.isNotEmpty(userModels)) { |
| 215 | 214 | AssistBuildUserModel model = userModels.get(0); |
| ... | ... | @@ -219,7 +218,7 @@ |
| 219 | 218 | query.setBuildDateStart(start); |
| 220 | 219 | query.setBuildDateEnd(DateUtil.addMonth(start, 1)); |
| 221 | 220 | |
| 222 | - List<ArchiveData> list = archiveDataServicer.query(query); | |
| 221 | + List<ArchiveData> list = archiveDataServicer.query(query, Sort.Direction.DESC,"buildDate"); | |
| 223 | 222 | if (CollectionUtils.isNotEmpty(list)) |
| 224 | 223 | { |
| 225 | 224 | for (ArchiveData archiveData : list) |
| ... | ... | @@ -240,7 +239,7 @@ |
| 240 | 239 | public BaseResponse getArchiveUserInfo(String archiveId) { |
| 241 | 240 | ArchiveDataQuery query = new ArchiveDataQuery(); |
| 242 | 241 | query.setId(archiveId); |
| 243 | - List<ArchiveData> list = archiveDataServicer.query(query); | |
| 242 | + List<ArchiveData> list = archiveDataServicer.query(query,Sort.Direction.DESC,"created"); | |
| 244 | 243 | String json = ""; |
| 245 | 244 | if (CollectionUtils.isNotEmpty(list)) |
| 246 | 245 | { |