爱心帮扶系统-疗休养管理-基层工会报名:修复活动状态在活动未开始的时候显示活动已开始;
This commit is contained in:
@@ -100,7 +100,7 @@ public class LxyCommon {
|
|||||||
public Object getNowHdList(@Param(value = "year", required = false) Integer year) {
|
public Object getNowHdList(@Param(value = "year", required = false) Integer year) {
|
||||||
Sql sql = Sqls.create("SELECT id,`name` FROM `lxy_hd` $condition");
|
Sql sql = Sqls.create("SELECT id,`name` FROM `lxy_hd` $condition");
|
||||||
Cnd cnd = Cnd.NEW();
|
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) {
|
if (year != null) {
|
||||||
cnd.and(new org.nutz.dao.util.cri.Static("YEAR(hdcjsj) = " + year));
|
cnd.and(new org.nutz.dao.util.cri.Static("YEAR(hdcjsj) = " + year));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class LxyGhbmController {
|
|||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
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.and("mefp.hdid", "=", hdid);
|
||||||
cnd.andEX("un.id", "=", unionId);
|
cnd.andEX("un.id", "=", unionId);
|
||||||
@@ -243,6 +243,10 @@ public class LxyGhbmController {
|
|||||||
return Result.error("未获取到报名数据,请选择人员报名");
|
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()))) {
|
if (!checkActivityUserScope(bmList.get(0).getHdid(), bmList.stream().map(Lxy_bm::getUserid).collect(Collectors.toList()))) {
|
||||||
return Result.error("存在不在活动人员范围内的人员,请重新选择");
|
return Result.error("存在不在活动人员范围内的人员,请重新选择");
|
||||||
}
|
}
|
||||||
@@ -389,6 +393,9 @@ public class LxyGhbmController {
|
|||||||
try {
|
try {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
String unionId = Vi.getUnionId();
|
String unionId = Vi.getUnionId();
|
||||||
|
if (!checkActivitySignUpTime(projectId)) {
|
||||||
|
return Result.error("当前不在报名时间范围内");
|
||||||
|
}
|
||||||
// 已经报名的,排除审核未通过
|
// 已经报名的,排除审核未通过
|
||||||
int count = dao.count(Lxy_bm.class, Cnd.where("hdid", "=", projectId).and("ghid", "=", unionId)
|
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)));
|
.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();
|
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) {
|
private Integer getActivityGroupId(String hdid) {
|
||||||
Lxy_hd hd = lxyHdService.fetch(hdid);
|
Lxy_hd hd = lxyHdService.fetch(hdid);
|
||||||
return hd == null ? null : hd.getActivityGroupId();
|
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>
|
<el-button @click="openView(scope.row)" size="mini" type="primary">查看报名</el-button>
|
||||||
<!--# } #-->
|
<!--# } #-->
|
||||||
<!--# if(@shiro.hasRole('H04') || @shiro.hasRole('gh12')){ #-->
|
<!--# if(@shiro.hasRole('H04') || @shiro.hasRole('gh12')){ #-->
|
||||||
<el-button @click="openImport(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 @click="openBm2(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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -589,6 +589,12 @@ display: -webkit-box;
|
|||||||
"file-import": httpVueLoader("/components/plugins/FileImport.vue")
|
"file-import": httpVueLoader("/components/plugins/FileImport.vue")
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
openImport() {
|
||||||
this.importDialog = true
|
this.importDialog = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user