From 7b487d4c819bc67021cf224c5042066bf73df1e3 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期六, 28 十月 2023 17:01:00 +0800 Subject: [PATCH] 10.28。2 --- cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_edit.html | 19 +++ cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html | 38 ++++++- cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherOne.js | 40 +++++++- cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html | 37 ++++++ cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java | 19 +++ cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html | 9 + cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html | 11 ++ cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js | 8 cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherTwo.js | 44 +++++++- cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html | 28 ++++- 11 files changed, 223 insertions(+), 32 deletions(-) diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java index 5d483c2..dce73b2 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/controller/ParticipantController.java @@ -1,5 +1,8 @@ package com.dsh.competition.controller; +import com.dsh.competition.feignclient.account.AppUserClient; +import com.dsh.competition.feignclient.account.StudentClient; +import com.dsh.competition.feignclient.account.model.AppUser; import com.dsh.competition.model.AddParticipant; import com.dsh.competition.model.EditParticipant; import com.dsh.competition.model.ParticipantVo; @@ -13,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @@ -91,6 +95,9 @@ + @Resource + private StudentClient studentClient; + @ResponseBody @PostMapping("/api/participant/editParticipant") @ApiOperation(value = "编辑参赛人员", tags = {"APP-赛事活动列表", ""}) @@ -103,7 +110,17 @@ if(null == uid){ return ResultUtil.tokenErr(); } - return participantService.editParticipant(uid, editParticipant); + + if (editParticipant.getIsStudent()==0){ + return participantService.editParticipant(uid, editParticipant);} + else { + AppUser appUser = new AppUser(); + appUser.setId(editParticipant.getId()); + + + + return ResultUtil.success(); + } }catch (Exception e){ e.printStackTrace(); return ResultUtil.runErr(); diff --git a/cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java b/cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java index b8fc431..551baca 100644 --- a/cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java +++ b/cloud-server-competition/src/main/java/com/dsh/competition/model/EditParticipant.java @@ -28,4 +28,6 @@ private Integer gender; @ApiModelProperty(value = "身份证号码", dataType = "string", required = false) private String idcard; + @ApiModelProperty(value = "是否为学员1是0不是", dataType = "int", required = false) + private Integer isStudent; } diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html index 49b090e..c469402 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_add.html @@ -154,6 +154,9 @@ $("#t1").hide() $("#t2").hide() $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") }else { $("#t1").show() $("#t2").show() @@ -173,6 +176,9 @@ ajax.set("name",oneId); ajax.start(); } + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); } @@ -188,11 +194,15 @@ $("#type").empty().append(content1); }else{ console.log("=-======0000") + $("#t2").val("") + $("#t2").hide() } }); if (oneId==2 || oneId==25|| oneId==27){ + $("#t3").val("") + $("#t3").hide() } @@ -218,6 +228,7 @@ console.log(oneId); if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ $("#t3").hide() + $("#t3").val("") }else{ $("#t3").show() } diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_edit.html index ac867b8..71c3547 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/advertisement/advertisement_edit.html @@ -159,6 +159,12 @@ range:true }); + + document.addEventListener('DOMContentLoaded', function() { + var selectElement = document.getElementById('page'); + selectElement.onchange(); + }); + function updateType(e) { let name = $("#model").val(); console.log(name); @@ -166,6 +172,9 @@ $("#t1").hide() $("#t2").hide() $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") }else { $("#t1").show() $("#t2").show() @@ -185,6 +194,10 @@ ajax.set("name",oneId); ajax.start(); } + + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); } @@ -200,6 +213,7 @@ $("#type").empty().append(content1); }else{ console.log("=-======0000") + $("#t2").val("") $("#t2").hide() } @@ -207,10 +221,13 @@ if (oneId==2 || oneId==25|| oneId==27){ + $("#t3").val("") $("#t3").hide() } ajax.set("id",oneId); ajax.start(); + updateT(document.getElementById("type")); + } function updatePosition(e) { @@ -229,6 +246,8 @@ console.log(oneId); if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ $("#t3").hide() + $("#t3").val("") + }else{ $("#t3").show() } diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html index 7379f20..93b3ba3 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_three.html @@ -14,7 +14,7 @@ 跳转模块 </button> </div> - <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> + <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)"> <option value="不跳转">不跳转</option> <option value="加入玩湃">加入玩湃</option> <option value="开始课程">开始课程</option> @@ -42,7 +42,7 @@ 跳转类型 </button> </div> - <select class="form-control" id="type" style="width: 400px;" > + <select class="form-control" id="type" style="width: 400px;" onchange="updateT(this)"> @for(obj in list1){ <option value="${obj.id}" ${obj.id == item.typeId ? 'selected=selected' : ''}>${obj.name}</option> @} @@ -83,10 +83,20 @@ range:true }); + + function updateT(e) { + var oneId = $('#type option:selected').text(); + console.log(oneId); + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ + $("#t3").hide() + }else{ + $("#t3").show() + } + } + function updateType(e) { let name = $("#name").val() - console.log(name - ) + if(name =='不跳转'){ $("#t1").hide() $("#t2").hide() @@ -109,18 +119,26 @@ ajax.set("name",oneId); ajax.start(); } + + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); } function updateOne(e) { var oneId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ - if(data!=null){ + if(data!=null&&data.length>0){ + $("#t2").show() var content1; $.each(data, function(k,v) { content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; }); $("#type").empty().append(content1); + }else { + console.log("=-======0000") + $("#t2").hide() } }); ajax.set("id",oneId); diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html index 377d70f..f0f25fa 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add_two.html @@ -12,7 +12,7 @@ 跳转模块 </button> </div> - <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> + <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)"> <option value="" selected disabled>选择跳转模块</option> <option value="不跳转">不跳转</option> <option value="加入玩湃">加入玩湃</option> @@ -82,8 +82,9 @@ function updateT(e) { var oneId = $('#type option:selected').text(); console.log(oneId); - if (oneId!="详情"){ + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ $("#t3").hide() + $("#t3").val("") }else{ $("#t3").show() } @@ -97,6 +98,9 @@ $("#t1").hide() $("#t2").hide() $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") }else { $("#t1").show() $("#t2").show() @@ -137,6 +141,7 @@ }else{ console.log("=-======0000") $("#t2").hide() + $("#t2").val("") } }); diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html index 0674a16..24fd9ad 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html @@ -12,7 +12,7 @@ 跳转模块 </button> </div> - <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> + <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)"> <option value="" selected disabled>选择跳转模块</option> <option value="不跳转">不跳转</option> <option value="加入玩湃">加入玩湃</option> @@ -39,7 +39,7 @@ 跳转类型 </button> </div> - <select class="form-control" id="type" style="width: 400px;" > + <select class="form-control" id="type" style="width: 400px;" onchange="updateT(this)"> </select> </div> @@ -77,6 +77,23 @@ range:true }); + + document.addEventListener('DOMContentLoaded', function() { + var selectElement = document.getElementById('page'); + selectElement.onchange(); + }); + + function updateT(e) { + var oneId = $('#type option:selected').text(); + console.log(oneId); + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ + $("#t3").hide() + $("#t3").val("") + }else{ + $("#t3").show() + } + } + function updateType(e) { let name = $("#name").val() console.log(name @@ -85,6 +102,9 @@ $("#t1").hide() $("#t2").hide() $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") }else { $("#t1").show() $("#t2").show() @@ -103,22 +123,33 @@ ajax.set("name",oneId); ajax.start(); } + + var pageElement = document.getElementById('page'); + var event = new Event('change'); + pageElement.dispatchEvent(event); } function updateOne(e) { var oneId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ - if(data!=null){ + if(data!=null&&data.length>0){ + $("#t2").show() var content1; $.each(data, function(k,v) { content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; }); $("#type").empty().append(content1); + }else { + console.log("=-======0000") + $("#t2").hide() + $("#t2").val("") } }); ajax.set("id",oneId); ajax.start(); + updateT(document.getElementById("type")); + } </script> @} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html index 0844d59..fe20194 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_two.html @@ -11,7 +11,7 @@ 跳转模块 </button> </div> - <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)"> + <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)"> <option value="不跳转">不跳转</option> <option value="加入玩湃">加入玩湃</option> <option value="开始课程">开始课程</option> @@ -39,7 +39,7 @@ 跳转类型 </button> </div> - <select class="form-control" id="type" style="width: 400px;" > + <select class="form-control" id="type" style="width: 400px;" onchange="updateT(this)"> @for(obj in list1){ <option value="${obj.id}" ${obj.id == item.typeId ? 'selected=selected' : ''}>${obj.name}</option> @} @@ -76,12 +76,15 @@ <script src="${ctxPath}/modular/system/tShop/tShopOtherOne.js"></script> <script> - - - laydate.render({ elem: '#time', range:true + }); + + + document.addEventListener('DOMContentLoaded', function() { + var selectElement = document.getElementById('page'); + selectElement.onchange(); }); function updateType(e) { @@ -92,6 +95,9 @@ $("#t1").hide() $("#t2").hide() $("#t3").hide() + $("#t1").val("") + $("#t2").val("") + $("#t3").val("") }else { $("#t1").show() $("#t2").show() @@ -117,12 +123,23 @@ } + function updateT(e) { + var oneId = $('#type option:selected').text(); + console.log(oneId); + if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ + $("#t3").hide() + $("#t2").val("") + }else{ + $("#t3").show() + $("#t3").val("") + } + } + function updateOne(e) { var oneId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){ if(data!=null&&data.length>0){ $("#t2").show() - var content1; $.each(data, function(k,v) { content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; @@ -131,12 +148,21 @@ }else { console.log("=-======0000") $("#t2").hide() + $("#t2").val("") } }); + if (oneId==2 || oneId==25|| oneId==27){ + $("#t3").val("") + + $("#t3").hide() + } + ajax.set("id",oneId); ajax.start(); + updateT(document.getElementById("type")); + } window.onload = function() { diff --git a/cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js b/cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js index 9856083..fa35e15 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/advertisement/advertisement.js @@ -319,7 +319,7 @@ } console.log("====pagepagepage==============="+$("#page").val()) if(name !='0'){ - if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37) { + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { Feng.info("请选择跳转类型") return; } @@ -327,7 +327,7 @@ } if(name !='0') { if ($("#roleType").val() == 1) { - if ($('#type option:selected').text() == "详情") { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { if ($("#pageId").val() == '') { Feng.info("请输入跳转ID") return; @@ -413,7 +413,7 @@ } if(name !='0') { if ($("#roleType").val() == 1) { - if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37) { + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { Feng.info("请选择跳转类型") return; } @@ -421,7 +421,7 @@ } if(name !='0') { if ($("#roleType").val() == 1) { - if ($('#type option:selected').text() == "详情") { + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { if ($("#pageId").val() == '') { Feng.info("请输入跳转ID") return; diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherOne.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherOne.js index 5878705..1cd1d4c 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherOne.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherOne.js @@ -597,6 +597,12 @@ Feng.info("请选择跳转模块") return; } + + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + let page = $("#page").val() if(page=='' && name !='不跳转'){ Feng.info("请选择跳转页面") @@ -606,12 +612,23 @@ if(type=='' && name !='不跳转'){ } + + + let turnId = $("#turnId").val() - if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ - Feng.info("请输入跳转ID") - return; + // if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ + // Feng.info("请输入跳转ID") + // return; + // } + if ($('#type option:selected').text() == "详情" &&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#turnId").val() == '') { + Feng.info("请输入跳转ID") + return; + } } + + let sort = $("#sort").val() if(sort==''){ @@ -647,6 +664,11 @@ if(url==''){ } + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } + let name = $("#name").val() console.log(name) @@ -665,12 +687,20 @@ } let turnId = $("#turnId").val() - if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ - if(turnId==""){ + + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#turnId").val() == '') { Feng.info("请输入跳转ID") return; } } + + // if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ + // if(turnId==""){ + // Feng.info("请输入跳转ID") + // return; + // } + // } let sort = $("#sort").val() if(sort==''){ diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherTwo.js b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherTwo.js index 57f6acf..ac30f9f 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherTwo.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tShop/tShopOtherTwo.js @@ -607,10 +607,23 @@ } let turnId = $("#turnId").val() - if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ - Feng.info("请输入跳转ID") + // if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ + // Feng.info("请输入跳转ID") + // return; + // } + + if ($('#type option:selected').text() == "详情" &&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#turnId").val() == '') { + Feng.info("请输入跳转ID") + return; + } + } + + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") return; } + let sort = $("#sort").val() if(sort==''){ @@ -646,6 +659,10 @@ if(url==''){ } + if ($("#type").val() == ''&&$("#page").val()!=2&&$("#page").val()!=25&&$("#page").val()!=27&&$("#page").val()!=37&&$("#page").val()!=28) { + Feng.info("请选择跳转类型") + return; + } let name = $("#name").val() console.log(name) @@ -664,12 +681,20 @@ } let turnId = $("#turnId").val() - if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ - if(turnId==""){ + // if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ + // if(turnId==""){ + // Feng.info("请输入跳转ID") + // return; + // } + // } + + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#turnId").val() == '') { Feng.info("请输入跳转ID") return; } } + let sort = $("#sort").val() if(sort==''){ @@ -750,12 +775,19 @@ } let turnId = $("#turnId").val() - if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ - if(turnId==""){ + // if( type =='11' || type=='13'|| type=='16'|| type=='19'|| type=='21'|| type=='40'|| type=='43'){ + // if(turnId==""){ + // Feng.info("请输入跳转ID") + // return; + // } + // } + if ($('#type option:selected').text() == "详情"&&$('#type option:selected').text() == "指定商品"&&$('#type option:selected').text() == "指定折扣") { + if ($("#turnId").val() == '') { Feng.info("请输入跳转ID") return; } } + let sort = $("#sort").val() if(sort==''){ -- Gitblit v1.7.1