爱心帮扶系统-疗休养管理-基层工会报名:修复活动状态在活动未开始的时候显示活动已开始;

This commit is contained in:
dd3s_206
2026-06-17 12:53:19 +08:00
parent 1d43800090
commit f48ebde0bb
3 changed files with 22 additions and 4 deletions
@@ -100,7 +100,7 @@ public class LxyCommon {
public Object getNowHdList(@Param(value = "year", required = false) Integer year) {
Sql sql = Sqls.create("SELECT id,`name` FROM `lxy_hd` $condition");
Cnd cnd = Cnd.NEW();
cnd.and(new org.nutz.dao.util.cri.Static("now() < bmjzsj"));
cnd.and(new org.nutz.dao.util.cri.Static("now() >= bmkssj AND now() < bmjzsj"));
if (year != null) {
cnd.and(new org.nutz.dao.util.cri.Static("YEAR(hdcjsj) = " + year));
}
@@ -120,7 +120,7 @@ public class LxyGhbmController {
""");
Cnd cnd = Cnd.NEW();
cnd.and(new Static("now() < hd.bmjzsj"));
cnd.and(new Static("now() >= hd.bmkssj AND now() < hd.bmjzsj"));
cnd.and("mefp.hdid", "=", hdid);
cnd.andEX("un.id", "=", unionId);
@@ -243,6 +243,10 @@ public class LxyGhbmController {
return Result.error("未获取到报名数据,请选择人员报名");
}
if (!checkActivitySignUpTime(bmList.get(0).getHdid())) {
return Result.error("当前不在报名时间范围内");
}
if (!checkActivityUserScope(bmList.get(0).getHdid(), bmList.stream().map(Lxy_bm::getUserid).collect(Collectors.toList()))) {
return Result.error("存在不在活动人员范围内的人员,请重新选择");
}
@@ -389,6 +393,9 @@ public class LxyGhbmController {
try {
lock.lock();
String unionId = Vi.getUnionId();
if (!checkActivitySignUpTime(projectId)) {
return Result.error("当前不在报名时间范围内");
}
// 已经报名的,排除审核未通过
int count = dao.count(Lxy_bm.class, Cnd.where("hdid", "=", projectId).and("ghid", "=", unionId)
.and(Cnd.exps("bmzt", "in", List.of("1", "3", "5", "6")).or("bmzt", "is", null)));
@@ -538,6 +545,11 @@ public class LxyGhbmController {
return dao.count("activity_user_scope", Cnd.where("groupId", "=", activityGroupId).and("userId", "in", ids)) == ids.size();
}
private boolean checkActivitySignUpTime(String hdid) {
return lxyHdService.count(Cnd.where("id", "=", hdid)
.and(new Static("now() >= bmkssj AND now() < bmjzsj"))) > 0;
}
private Integer getActivityGroupId(String hdid) {
Lxy_hd hd = lxyHdService.fetch(hdid);
return hd == null ? null : hd.getActivityGroupId();
@@ -127,8 +127,8 @@ layout("/layouts/platform.html"){
<el-button @click="openView(scope.row)" size="mini" type="primary">查看报名</el-button>
<!--# } #-->
<!--# if(@shiro.hasRole('H04') || @shiro.hasRole('gh12')){ #-->
<el-button @click="openImport(scope.row)" size="mini" type="primary">导入</el-button>
<el-button @click="openBm2(scope.row)" size="mini" type="primary">报名</el-button>
<el-button :disabled="!isSignUpTime(scope.row)" @click="openImport(scope.row)" size="mini" type="primary">导入</el-button>
<el-button :disabled="!isSignUpTime(scope.row)" @click="openBm2(scope.row)" size="mini" type="primary">报名</el-button>
<!--# } #-->
</template>
</el-table-column>
@@ -589,6 +589,12 @@ display: -webkit-box;
"file-import": httpVueLoader("/components/plugins/FileImport.vue")
},
methods: {
isSignUpTime(row) {
const now = new Date().getTime()
const bmkssj = moment(row.bmkssj.valueOf())
const bmjzsj = moment(row.bmjzsj.valueOf())
return bmkssj <= now && now < bmjzsj
},
openImport() {
this.importDialog = true
this.$nextTick(() => {