篮球赛报名

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.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record; import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -66,6 +67,8 @@ import java.util.stream.IntStream;
@RequiresAuthentication @RequiresAuthentication
public class ActivityApplyController { public class ActivityApplyController {
@Inject
private Dao dao;
@Inject @Inject
private ActivitySchoolService activitySchoolService; private ActivitySchoolService activitySchoolService;
@Inject @Inject
@@ -186,7 +189,7 @@ public class ActivityApplyController {
// cnd.and(new Static("now() > school.applyEndTime")); // 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("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()))); 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.sex,
u.birthday, u.birthday,
u.mobile, u.mobile,
un.`name` unitname un.`name` unitname,
position
FROM FROM
sys_user u sys_user u
LEFT JOIN activity_basic_unit un ON u.unitid = un.id LEFT JOIN activity_basic_unit un ON u.unitid = un.id
@@ -409,6 +413,9 @@ public class ActivityApplyController {
apply.setActivityUnionId(basicUnit.getUnionid()); apply.setActivityUnionId(basicUnit.getUnionid());
apply.setActivityUnionName(basicUnion.getUnionname()); apply.setActivityUnionName(basicUnion.getUnionname());
apply.setApplyUnitId(basicUnit.getId()); 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)); activitySchoolApplyService.doApplies(activityId, basicUnit.getUnionid(), eventId, Arrays.asList(applies));
return null; return null;
@@ -554,6 +561,7 @@ public class ActivityApplyController {
"\tu.loginname,\n" + "\tu.loginname,\n" +
"\tu.sex,\n" + "\tu.sex,\n" +
"\tu.mobile,\n" + "\tu.mobile,\n" +
"\tu.position,\n" +
"\tun.`name` unitname \n" + "\tun.`name` unitname \n" +
"FROM\n" + "FROM\n" +
"\tsys_user u\n" + "\tsys_user u\n" +
@@ -666,7 +674,7 @@ public class ActivityApplyController {
""").setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId()); """).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.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()))); 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 @ViReturn
@RequiresPermissions("activity.apply") @RequiresPermissions("activity.apply")
public Object doPromiseBook(@Param("promiseBookFileList") String promiseBookFileList, @Param("activityId") String activityId) { 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 activityUnion = new ActivityUnion();
activityUnion.setActivityId(activityId); activityUnion.setActivityId(activityId);
activityUnion.setUnionId(getUnionId()); activityUnion.setUnionId(unionId);
activityUnion.setFiles(Json.fromJsonAsList(Sys_file.class, promiseBookFileList)); activityUnion.setFiles(Json.fromJsonAsList(Sys_file.class, promiseBookFileList));
simpleService.insert(activityUnion); simpleService.dao().insert(activityUnion);
return null; return null;
} }
@@ -640,18 +640,18 @@ layout("/layouts/platform.html"){
</el-option> </el-option>
</el-select>--> </el-select>-->
<el-dropdown @command="changeTeam" <!--<el-dropdown @command="changeTeam"
v-if="projectType==2&&teams.length>1"> v-if="projectType==2&&teams.length>1">
<el-button size="small" type="primary"> <el-button size="small" type="primary">
修改小队<i 修改小队<i
class="el-icon-arrow-down el-icon--right"></i> class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{item}" <el-dropdown-item :command="{item}"
v-for="item in teams">{{item.name}} v-for="item in teams">{{item.name}}
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>-->
</div> </div>
<el-table :data="appliedData2" :key="tabkey" <el-table :data="appliedData2" :key="tabkey"
@@ -1322,7 +1322,7 @@ layout("/layouts/platform.html"){
formRules: { formRules: {
name: [{required: true, message: "必填", trigger: ["blur", "change"]}], name: [{required: true, message: "必填", trigger: ["blur", "change"]}],
teamId: [{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']}], // userId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}, },
@@ -1677,6 +1677,16 @@ layout("/layouts/platform.html"){
}, },
async doLeaderCoach() { async doLeaderCoach() {
if (!this.LeaderData.position) {
this.$message.warning("请填写领队职称职务")
return
}
if (!this.CoachData.position) {
this.$message.warning("请填写教练职称职务")
return
}
this.$refs["form"].validate(async (valid) => { this.$refs["form"].validate(async (valid) => {
if (valid) { if (valid) {
let loading = this.$loading({ let loading = this.$loading({
@@ -2075,7 +2085,7 @@ layout("/layouts/platform.html"){
//判断每一个选手填写的是否正确 //判断每一个选手填写的是否正确
for (let i = 0; i < appliedData.length; i++) { for (let i = 0; i < appliedData.length; i++) {
if (!appliedData[i].position) { if (!appliedData[i].position) {
this.$message.warning("请填写填写职称职务!") this.$message.warning("请填写完整职称职务!")
return return
} }
if (!appliedData[i].mobile) { if (!appliedData[i].mobile) {
@@ -2407,6 +2417,7 @@ layout("/layouts/platform.html"){
team: this.teams.find(x => x.id == this.team).name, team: this.teams.find(x => x.id == this.team).name,
unitId: v.unitid, unitId: v.unitid,
unitname: v.unitname, unitname: v.unitname,
position: v.position,
age: v.age, age: v.age,
birthday: v.birthday, birthday: v.birthday,
userId: v.id, userId: v.id,
@@ -2453,14 +2464,16 @@ layout("/layouts/platform.html"){
this.rightChecked = v this.rightChecked = v
}, },
flushApplyed(applyed) { flushApplyed(applyed) {
debugger
if (this.activityData2.id === "6a2546b6df41457b871d590c0290eb07") { 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({ this.$notify({
title: "警告", title: "警告",
message: "您只能报一队暂时不能报两队!", message: "您只能报一队暂时不能报两队!",
type: "warning" type: "warning"
}) })
this.team = "ad85ba7540494c0d849936555287fa78" this.team = this.teams[0].id
return return
} }
} }