Commit ba5fa822 by 周海峰

no message

parent 3a1726f3
...@@ -41,11 +41,20 @@ public class WechatApiController { ...@@ -41,11 +41,20 @@ public class WechatApiController {
if (!CollectionUtils.isEmpty(platformApplicationsList)) { if (!CollectionUtils.isEmpty(platformApplicationsList)) {
//过滤 //过滤
if (!StringUtils.isEmpty(appName)) { if (!StringUtils.isEmpty(appName)) {
platformApplicationsList = platformApplicationsList.stream().filter(app -> app.getTitle().contains(appName)).collect(Collectors.toList()); platformApplicationsList = platformApplicationsList.stream()
.filter(app -> app.getTitle().contains(appName)).collect(Collectors.toList());
} }
for (PlatformApplicationsGroup applicationsGroup : platformApplicationsGroups) { for (PlatformApplicationsGroup applicationsGroup : platformApplicationsGroups) {
String groupCode = applicationsGroup.getGroupCode(); String groupCode = applicationsGroup.getGroupCode();
List<PlatformApplications> groupOf = platformApplicationsList.stream().filter(item -> groupCode.equals(item.getGroupCode())).collect(Collectors.toList()); List<PlatformApplications> groupOf = platformApplicationsList.stream()
.filter(item -> groupCode.equals(item.getGroupCode())).collect(Collectors.toList());
if (!groupOf.isEmpty()) {
groupOf = groupOf.stream().sorted((a, b) -> {
int numA = a.getWechatNum() != null ? Integer.parseInt(a.getWechatNum()) : 999;
int numB = b.getWechatNum() != null ? Integer.parseInt(b.getWechatNum()) : 999;
return numA - numB;
}).collect(Collectors.toList());
}
applicationsGroup.setApplicationsList(groupOf); applicationsGroup.setApplicationsList(groupOf);
} }
} }
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<result column="mailtype" jdbcType="VARCHAR" property="mailtype"/> <result column="mailtype" jdbcType="VARCHAR" property="mailtype"/>
<result column="group_code" jdbcType="VARCHAR" property="groupCode"/> <result column="group_code" jdbcType="VARCHAR" property="groupCode"/>
<result column="wechat_url" jdbcType="VARCHAR" property="wechatUrl"/> <result column="wechat_url" jdbcType="VARCHAR" property="wechatUrl"/>
<result column="num" jdbcType="VARCHAR" property="num"/>
<result column="wechat_num" jdbcType="VARCHAR" property="wechatNum"/>
</resultMap> </resultMap>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论