feat:体育活动、文化活动、品牌活动、系统金刚区 UI优化
This commit is contained in:
+2
-2
@@ -64,8 +64,8 @@ public class H5ActivitySportsApplyUserController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("h5.activity.sports.applyUser")
|
||||
public Result activityData(Integer year, Integer isActivity, Integer applyStatus) {
|
||||
return Result.success(activitySportsApplyUserService.activityData(year, isActivity, applyStatus));
|
||||
public Result activityData(Integer year, Integer isActivity, Integer applyStatus, String searchKeyword) {
|
||||
return Result.success(activitySportsApplyUserService.activityData(year, isActivity, applyStatus, searchKeyword));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+11
@@ -19,6 +19,17 @@ public interface ActivitySportsApplyUserService extends BaseService<ActivityScho
|
||||
|
||||
Pagination activityData(Integer year, Integer isActivity,Integer applyStatus);
|
||||
|
||||
/**
|
||||
* 根据年份、活动状态、报名状态和活动名称查询体育活动。
|
||||
*
|
||||
* @param year 活动年份
|
||||
* @param isActivity 活动状态
|
||||
* @param applyStatus 当前用户报名状态
|
||||
* @param searchKeyword 活动名称模糊查询关键词
|
||||
* @return 体育活动分页数据
|
||||
*/
|
||||
Pagination activityData(Integer year, Integer isActivity, Integer applyStatus, String searchKeyword);
|
||||
|
||||
List<NutMap> getEvents(String activityId);
|
||||
|
||||
Object getUnionCoachLeaderHead(String activityId,String unionId);
|
||||
|
||||
+18
@@ -144,6 +144,20 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
|
||||
@Override
|
||||
public Pagination activityData(Integer year, Integer isActivity, Integer applyStatus) {
|
||||
return activityData(year, isActivity, applyStatus, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据筛选条件及活动名称查询当前用户可见的体育活动。
|
||||
*
|
||||
* @param year 活动年份
|
||||
* @param isActivity 活动状态
|
||||
* @param applyStatus 当前用户报名状态
|
||||
* @param searchKeyword 活动名称模糊查询关键词
|
||||
* @return 体育活动分页数据
|
||||
*/
|
||||
@Override
|
||||
public Pagination activityData(Integer year, Integer isActivity, Integer applyStatus, String searchKeyword) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -183,6 +197,10 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
|
||||
cnd.and("school.isSave", "!=", true);
|
||||
|
||||
if (Lang.isNotEmpty(searchKeyword)) {
|
||||
cnd.and("school.NAME", "like", "%" + searchKeyword.trim() + "%");
|
||||
}
|
||||
|
||||
//查询报名中
|
||||
if (isActivity == 2) {
|
||||
cnd.and(new Static("now() >applyStartTime and now() < applyEndTime"));
|
||||
|
||||
+3
@@ -93,6 +93,9 @@ public class TrainSignUpApplyController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("id", "=", id);
|
||||
cnd.andEX("`year`", "=", year);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX("activityName", pageForm.getSearchKeyword()));
|
||||
}
|
||||
//查询报名中
|
||||
if (activityType == 2) {
|
||||
cnd.and(new Static("now() < activitySignUpEndTime"));
|
||||
|
||||
+16
-2
@@ -34,6 +34,15 @@ public class H5SpreadDisplayController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开工会动态 H5 详情页面。
|
||||
*/
|
||||
@At("/detail")
|
||||
@Ok("beetl:/platform/zhghh5/spread/display/detail.html")
|
||||
@SaCheckLogin
|
||||
public void detail() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 H5 端可见栏目树。
|
||||
*
|
||||
@@ -52,13 +61,18 @@ public class H5SpreadDisplayController {
|
||||
* @param pageForm 分页参数
|
||||
* @param categoryId 栏目 ID
|
||||
* @param title 标题模糊查询条件
|
||||
* @param sortType 排序方式
|
||||
* @param publishDays 发布时间范围天数
|
||||
* @param contentFlag 内容属性筛选
|
||||
* @return 已发布内容分页数据
|
||||
*/
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("H5已发布内容分页")
|
||||
public Result pageData(PageForm pageForm, String categoryId, String title) {
|
||||
return Result.success(contentService.pagePublished(pageForm, categoryId, title));
|
||||
public Result pageData(PageForm pageForm, String categoryId, String title,
|
||||
String sortType, Integer publishDays, String contentFlag) {
|
||||
return Result.success(contentService.pagePublished(pageForm, categoryId, title,
|
||||
sortType, publishDays, contentFlag));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,20 @@ public interface SpreadContentService extends BaseService<SpreadContent> {
|
||||
*/
|
||||
Pagination<NutMap> pagePublished(PageForm pageForm, String categoryId, String title);
|
||||
|
||||
/**
|
||||
* 按 H5 筛选条件分页查询已发布内容。
|
||||
*
|
||||
* @param pageForm 分页参数
|
||||
* @param categoryId 栏目 ID,查询时包含该栏目的直接子栏目
|
||||
* @param title 标题模糊查询条件
|
||||
* @param sortType 排序方式:comprehensive、latest、views
|
||||
* @param publishDays 发布时间范围天数,空或 0 表示不限
|
||||
* @param contentFlag 内容属性:all、recommend、headline、top
|
||||
* @return 已发布内容分页数据
|
||||
*/
|
||||
Pagination<NutMap> pagePublished(PageForm pageForm, String categoryId, String title,
|
||||
String sortType, Integer publishDays, String contentFlag);
|
||||
|
||||
SpreadContent getContent(String id);
|
||||
|
||||
void saveContent(SpreadContent content);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SpreadContentServiceImpl extends BaseServiceImpl<SpreadContent> imp
|
||||
|
||||
@Override
|
||||
public Pagination<NutMap> pagePublished(PageForm pageForm, String categoryId) {
|
||||
return pagePublished(pageForm, categoryId, null);
|
||||
return pagePublished(pageForm, categoryId, null, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,22 +75,54 @@ public class SpreadContentServiceImpl extends BaseServiceImpl<SpreadContent> imp
|
||||
*/
|
||||
@Override
|
||||
public Pagination<NutMap> pagePublished(PageForm pageForm, String categoryId, String title) {
|
||||
return pagePublished(pageForm, categoryId, title, null, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按 H5 筛选条件分页查询已发布内容。
|
||||
*
|
||||
* @param pageForm 分页参数
|
||||
* @param categoryId 栏目 ID,查询时包含该栏目的直接子栏目
|
||||
* @param title 标题模糊查询条件
|
||||
* @param sortType 排序方式
|
||||
* @param publishDays 发布时间范围天数
|
||||
* @param contentFlag 内容属性筛选
|
||||
* @return 已发布内容分页数据
|
||||
*/
|
||||
@Override
|
||||
public Pagination<NutMap> pagePublished(PageForm pageForm, String categoryId, String title,
|
||||
String sortType, Integer publishDays, String contentFlag) {
|
||||
SpreadContentQuery query = new SpreadContentQuery();
|
||||
query.setCategoryId(categoryId);
|
||||
query.setTitle(title);
|
||||
query.setIsPublished(1);
|
||||
Cnd cnd = buildCondition(query);
|
||||
if (publishDays != null && publishDays > 0) {
|
||||
cnd.and("c.publishedAt", ">=", System.currentTimeMillis() - publishDays * 24L * 60L * 60L * 1000L);
|
||||
}
|
||||
if ("recommend".equals(contentFlag)) {
|
||||
cnd.and("c.isRecommend", "=", 1);
|
||||
} else if ("headline".equals(contentFlag)) {
|
||||
cnd.and("c.isHeadline", "=", 1);
|
||||
} else if ("top".equals(contentFlag)) {
|
||||
cnd.and("c.isTop", "=", 1);
|
||||
}
|
||||
Sql countSql = Sqls.create("SELECT COUNT(1) FROM spread_content c $condition");
|
||||
countSql.setCondition(cnd);
|
||||
countSql.setCallback(Sqls.callback.integer());
|
||||
dao().execute(countSql);
|
||||
|
||||
String orderBy = resolvePublishedOrder(sortType);
|
||||
Sql listSql = Sqls.create("""
|
||||
SELECT c.*
|
||||
SELECT c.*,
|
||||
CASE WHEN child.parentId = '0' OR parent.id IS NULL THEN child.name ELSE parent.name END AS parentCategoryName,
|
||||
CASE WHEN child.parentId = '0' OR parent.id IS NULL THEN NULL ELSE child.name END AS childCategoryName
|
||||
FROM spread_content c
|
||||
LEFT JOIN spread_category child ON child.id = c.categoryId AND child.delFlag = 0
|
||||
LEFT JOIN spread_category parent ON parent.id = child.parentId AND parent.delFlag = 0
|
||||
$condition
|
||||
ORDER BY c.isTop DESC, c.publishedAt DESC, c.sortOrder ASC, c.createdAt DESC
|
||||
""");
|
||||
ORDER BY
|
||||
""" + orderBy);
|
||||
listSql.setCondition(cnd);
|
||||
listSql.setPager(dao().createPager(pageForm.getPageNumber(), pageForm.getPageSize()));
|
||||
listSql.setCallback(Sqls.callback.maps());
|
||||
@@ -99,6 +131,19 @@ public class SpreadContentServiceImpl extends BaseServiceImpl<SpreadContent> imp
|
||||
countSql.getInt(), listSql.getList(NutMap.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将前端排序标识转换为固定 SQL 排序片段,避免客户端直接控制排序字段。
|
||||
*/
|
||||
private String resolvePublishedOrder(String sortType) {
|
||||
if ("latest".equals(sortType)) {
|
||||
return "c.publishedAt DESC, c.createdAt DESC";
|
||||
}
|
||||
if ("views".equals(sortType)) {
|
||||
return "c.viewCount DESC, c.publishedAt DESC, c.createdAt DESC";
|
||||
}
|
||||
return "c.isTop DESC, c.publishedAt DESC, c.sortOrder ASC, c.createdAt DESC";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpreadContent getContent(String id) {
|
||||
if (StrUtil.isBlank(id)) {
|
||||
|
||||
Reference in New Issue
Block a user