篮球赛报名

This commit is contained in:
Paidax
2025-04-23 10:53:38 +08:00
parent 2bfb4061d0
commit 1762f8a384
2 changed files with 36 additions and 12 deletions
@@ -29,6 +29,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
@@ -66,6 +67,8 @@ import java.util.stream.IntStream;
@RequiresAuthentication
public class ActivityApplyController {
@Inject
private Dao dao;
@Inject
private ActivitySchoolService activitySchoolService;
@Inject
@@ -186,7 +189,7 @@ public class ActivityApplyController {
// cnd.and(new Static("now() > school.applyEndTime"));
// }
if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN,gh08")) {
cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
}
@@ -236,7 +239,8 @@ public class ActivityApplyController {
u.sex,
u.birthday,
u.mobile,
un.`name` unitname
un.`name` unitname,
position
FROM
sys_user u
LEFT JOIN activity_basic_unit un ON u.unitid = un.id
@@ -409,6 +413,9 @@ public class ActivityApplyController {
apply.setActivityUnionId(basicUnit.getUnionid());
apply.setActivityUnionName(basicUnion.getUnionname());
apply.setApplyUnitId(basicUnit.getId());
dao.update(Sys_user.class, Chain.make("mobile", apply.getMobile()).add("position", apply.getPosition()),
Cnd.where("id", "=", apply.getUserId()));
}
activitySchoolApplyService.doApplies(activityId, basicUnit.getUnionid(), eventId, Arrays.asList(applies));
return null;
@@ -554,6 +561,7 @@ public class ActivityApplyController {
"\tu.loginname,\n" +
"\tu.sex,\n" +
"\tu.mobile,\n" +
"\tu.position,\n" +
"\tun.`name` unitname \n" +
"FROM\n" +
"\tsys_user u\n" +
@@ -666,7 +674,7 @@ public class ActivityApplyController {
""").setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId());
if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN,gh08")) {
cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
}
@@ -892,11 +900,14 @@ public class ActivityApplyController {
@ViReturn
@RequiresPermissions("activity.apply")
public Object doPromiseBook(@Param("promiseBookFileList") String promiseBookFileList, @Param("activityId") String activityId) {
String unionId = getUnionId();
simpleService.dao().clear(ActivityUnion.class, Cnd.where("activityId", "=", activityId).and("unionId", "=", unionId));
ActivityUnion activityUnion = new ActivityUnion();
activityUnion.setActivityId(activityId);
activityUnion.setUnionId(getUnionId());
activityUnion.setUnionId(unionId);
activityUnion.setFiles(Json.fromJsonAsList(Sys_file.class, promiseBookFileList));
simpleService.insert(activityUnion);
simpleService.dao().insert(activityUnion);
return null;
}
@@ -640,18 +640,18 @@ layout("/layouts/platform.html"){
</el-option>
</el-select>-->
<el-dropdown @command="changeTeam"
<!--<el-dropdown @command="changeTeam"
v-if="projectType==2&&teams.length>1">
<el-button size="small" type="primary">
修改小队<i
class="el-icon-arrow-down el-icon--right"></i>
class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{item}"
v-for="item in teams">{{item.name}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>-->
</div>
<el-table :data="appliedData2" :key="tabkey"
@@ -1322,7 +1322,7 @@ layout("/layouts/platform.html"){
formRules: {
name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
teamId: [{required: true, message: "必填", trigger: ["blur", "change"]}],
position: [{required: true, message: "必填", trigger: ["blur", "change"]}]
// position: [{required: true, message: "必填", trigger: ["blur", "change"]}]
// userId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
@@ -1677,6 +1677,16 @@ layout("/layouts/platform.html"){
},
async doLeaderCoach() {
if (!this.LeaderData.position) {
this.$message.warning("请填写领队职称职务")
return
}
if (!this.CoachData.position) {
this.$message.warning("请填写教练职称职务")
return
}
this.$refs["form"].validate(async (valid) => {
if (valid) {
let loading = this.$loading({
@@ -2075,7 +2085,7 @@ layout("/layouts/platform.html"){
//判断每一个选手填写的是否正确
for (let i = 0; i < appliedData.length; i++) {
if (!appliedData[i].position) {
this.$message.warning("请填写填写职称职务!")
this.$message.warning("请填写完整职称职务!")
return
}
if (!appliedData[i].mobile) {
@@ -2407,6 +2417,7 @@ layout("/layouts/platform.html"){
team: this.teams.find(x => x.id == this.team).name,
unitId: v.unitid,
unitname: v.unitname,
position: v.position,
age: v.age,
birthday: v.birthday,
userId: v.id,
@@ -2453,14 +2464,16 @@ layout("/layouts/platform.html"){
this.rightChecked = v
},
flushApplyed(applyed) {
debugger
if (this.activityData2.id === "6a2546b6df41457b871d590c0290eb07") {
if (this.team === "00dfa3b4f2ad4d238277b1345e6437f3" && "${@shiro.getPrincipalProperty('unit').getUnionid()}" !== "6234c0450ef0414f87a38794faac6c3d") {
if (["00dfa3b4f2ad4d238277b1345e6437f3", "6748ad4bd12c4af5b32c3ceace7fc694"].includes(this.team)
&& "${@shiro.getPrincipalProperty('unit').getUnionid()}" !== "6234c0450ef0414f87a38794faac6c3d") {
this.$notify({
title: "警告",
message: "您只能报一队暂时不能报两队!",
type: "warning"
})
this.team = "ad85ba7540494c0d849936555287fa78"
this.team = this.teams[0].id
return
}
}