commit
This commit is contained in:
+5
-5
@@ -235,11 +235,11 @@ public class ActivityBasicScopeController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
|
||||
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
|
||||
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
}
|
||||
// if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
|
||||
// if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
|
||||
// cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
// }
|
||||
// }
|
||||
cnd.and("groupId", "IS NOT", null);
|
||||
cnd.and("groupName", "IS NOT", null);
|
||||
cnd.groupBy("groupId");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.v.nutz.zhgh.activity.controller.union;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityTissue;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
@@ -102,6 +103,12 @@ public class ActivityAuditController {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
baseService.insert(audit);
|
||||
baseService.dao().update(ActivityTissue.class, Chain.make("state", flag ? 3 : 2).add("auditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
// 审核通过,修改活动为启动状态,并且还要将这个活动设置成首界面可见
|
||||
if (flag) {
|
||||
baseService.dao().update(ActivityTissue.class, Chain.make("isDisabled", true), Cnd.where("id", "=", id));
|
||||
baseService.dao().update(Sys_home_activity.class, Chain.make("enable", true), Cnd.where("id", "=", id));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -88,8 +88,9 @@ public class ActivityUnionApplyUserController {
|
||||
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEx("YEAR(tissue.startTime)", "=", year);
|
||||
if (StrUtil.isNotBlank(year)) {
|
||||
cnd.andEx("YEAR(tissue.startTime)", "=", year);
|
||||
}
|
||||
cnd.andEx("tissue.isDisabled", "=", true);
|
||||
cnd.andEx("tissue.type", "=", type);
|
||||
cnd.andEx("tissue.state", "=", 3);
|
||||
@@ -116,6 +117,10 @@ public class ActivityUnionApplyUserController {
|
||||
List<NutMap> list = pagination.getList();
|
||||
list.forEach(v -> {
|
||||
String activityId = v.getString("id");
|
||||
// 当前活动已报名人数
|
||||
int totalApplyNum = baseService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId));
|
||||
v.put("totalApplyNum", totalApplyNum);
|
||||
|
||||
int signUpMethod = v.getInt("signUpMethod");
|
||||
if (signUpMethod == 1||signUpMethod == 3) {
|
||||
int count = baseService.dao().count(ActivityTissuePerson.class,
|
||||
@@ -179,8 +184,7 @@ public class ActivityUnionApplyUserController {
|
||||
activity_tissue_person atp
|
||||
LEFT JOIN `user` u ON atp.userId = u.id
|
||||
WHERE
|
||||
atp.tissueId = @tissueId
|
||||
AND u.unionid = @unionId
|
||||
atp.tissueId = @tissueId AND u.unionid = @unionId
|
||||
""");
|
||||
sql.setParam("tissueId", tissueId);
|
||||
sql.setParam("unionId", Vi.getUnionId());
|
||||
|
||||
+5
@@ -231,6 +231,11 @@ public class ActivityUnionManageController {
|
||||
} else {
|
||||
mobileHomeService.delete(tissue.getId());
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
tissue.setState(1);
|
||||
} else {
|
||||
tissue.setState(3);
|
||||
}
|
||||
activityTissueService.doEdit(tissue);
|
||||
return null;
|
||||
}
|
||||
|
||||
+24
-10
@@ -70,6 +70,20 @@ public class ActivityUnionUserStatisticsController {
|
||||
if (Lang.isEmpty(tissue)){
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (type == 40002) {
|
||||
if (!Vi.getUnionId().equals(tissue.getUnionId())) {
|
||||
return null;
|
||||
}
|
||||
} else if (type == 40003) {
|
||||
if (!vi.getClubId().equals(tissue.getClubId())) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
@@ -89,16 +103,16 @@ public class ActivityUnionUserStatisticsController {
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("atp.tissueId", "=", activityId);
|
||||
cnd.andEX("u.unionId", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
|
||||
if (type == 40002) {
|
||||
cnd.and("unionId", "=", Vi.getUnionId());
|
||||
} else if (type == 40003) {
|
||||
cnd.and("u.id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
// cnd.andEX("u.unionId", "=", unionId);
|
||||
// if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
// if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
|
||||
// if (type == 40002) {
|
||||
// cnd.and("unionId", "=", Vi.getUnionId());
|
||||
// } else if (type == 40003) {
|
||||
// cnd.and("u.id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
|
||||
@@ -239,6 +239,17 @@ public class ActivityTissue extends BaseModel implements Serializable, SysHomeCo
|
||||
@Comment("是否推送移动端首页")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer isPushHome;
|
||||
|
||||
@Column
|
||||
@Comment("签到开始时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String signStartTime;
|
||||
|
||||
@Column
|
||||
@Comment("签到结束时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String signEndTime;
|
||||
|
||||
@Override
|
||||
public Sys_home_activity covertToSysHomeActivity() {
|
||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||
@@ -252,7 +263,7 @@ public class ActivityTissue extends BaseModel implements Serializable, SysHomeCo
|
||||
} else if (this.getType() == 40003) {
|
||||
sysHomeActivity.setUrl("/platform/activity/applyUser/club");
|
||||
}
|
||||
sysHomeActivity.setH5Url("/mobile/activity/unionActivity");
|
||||
sysHomeActivity.setH5Url("/mobile/activity/unionActivity/goReg?id=" + this.getId() + "&signUpMethod=" + this.getSignUpMethod());
|
||||
if (StrUtil.isNotBlank(this.getApplyStartTime())) {
|
||||
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
|
||||
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
|
||||
|
||||
@@ -67,8 +67,9 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
|
||||
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
|
||||
$condition
|
||||
""");
|
||||
|
||||
cnd.andEx("YEAR(tissue.applyTime)", "=", year);
|
||||
if (StrUtil.isNotBlank(year)) {
|
||||
cnd.and("YEAR(tissue.applyTime)", "=", year);
|
||||
}
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("tissue.projectTypeCode", "!=", "50004");
|
||||
seg.or("tissue.projectTypeCode", "is", null);
|
||||
@@ -81,8 +82,15 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
|
||||
cnd.where().andLike("tissue.name", name);
|
||||
}
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) {
|
||||
cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
// cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
|
||||
if (ShiroUtil.hasAnyRoles("H04")) {
|
||||
cnd.and("tissue.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasAnyRoles("club01")) {
|
||||
cnd.and("tissue.clubId", "=", vi.getClubId());
|
||||
} else {
|
||||
cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
/* if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
|
||||
} else if (ShiroUtil.hasRole("club01")) {
|
||||
|
||||
Reference in New Issue
Block a user