New file |
| | |
| | | package com.dsh.competition.util; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.competition.entity.Competition; |
| | | import com.dsh.competition.model.TCompetition; |
| | | import com.dsh.competition.service.CompetitionService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author shaqian |
| | | * 定时任务修改赛事状态 |
| | | */ |
| | | @Component |
| | | public class TaskUtilCompetition { |
| | | |
| | | @Resource |
| | | private CompetitionService competitionService; |
| | | |
| | | /** |
| | | * 每秒去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 30000) |
| | | public void taskMinute(){ |
| | | try { |
| | | List<Competition> list = competitionService.list(new QueryWrapper<Competition>() |
| | | .ne("status",4).ne("state",3)); |
| | | for (Competition competition : list) { |
| | | // 当前时间小于开始时间 |
| | | if (competition.getStartTime().after(new Date())){ |
| | | competition.setStatus(1); |
| | | } |
| | | if (competition.getStartTime().before(new Date())){ |
| | | if (competition.getEndTime().after(new Date())){ |
| | | competition.setStatus(2); |
| | | }else{ |
| | | competition.setStatus(3); |
| | | } |
| | | } |
| | | competitionService.updateById(competition); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | <mapper namespace="com.dsh.competition.mapper.ParticipantMapper"> |
| | | <select id="getPeopleFromId" resultType="com.dsh.competition.feignclient.model.CompetitionUser"> |
| | | select t2.id, t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state |
| | | from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id |
| | | left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | from t_user_competition t1 |
| | | left join t_participant t2 on t1.participantId = t2.id |
| | | left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | where t1.competitionId =#{id} and t2.id is not null and t3.id is not null |
| | | <if test="state !=null and state !='' and state ==1"> |
| | | and t3.payStatus in (1,2) |
| | |
| | | <select id="queryCoursePackageSchedulingList" resultType="map"> |
| | | SELECT |
| | | CAST(id AS CHAR(20)) AS id, |
| | | CONCAT(DATE_FORMAT(classDate, '%Y-%m-%d %H:%i'), '-20:00') AS classDate, |
| | | CONCAT(DATE_FORMAT(classDate, '%Y-%m-%d %H:%i'), DATE_FORMAT(endDate, '%H:%i')) AS classDate, |
| | | courseId, |
| | | `status`, |
| | | cancelClasses, |
| | |
| | | for (String s : productImages.split(",")) { |
| | | strings.add(s); |
| | | } |
| | | |
| | | model.addAttribute("integral",coupon.getIntegral()); |
| | | model.addAttribute("cash",coupon.getCash()); |
| | | model.addAttribute("img",strings); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | model.addAttribute("item",coupon); |
| | | model.addAttribute("objectType",objectType); |
| | | Integer auditStatus = coupon.getAuditStatus(); |
| | | switch (auditStatus){ |
| | | case 1: |
| | | model.addAttribute("state","待审核"); |
| | | break; |
| | | case 2: |
| | | model.addAttribute("state","已拒绝"); |
| | | break; |
| | | case 3: |
| | | model.addAttribute("state","未通过"); |
| | | break; |
| | | } |
| | | return PREFIX + "TCouponExamineInfo.html"; |
| | | } |
| | | |
| | |
| | | model.addAttribute("reasons", ""); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | model.addAttribute("type2",tCoursePackage.getType()); |
| | | |
| | | return PREFIX1 + "coursePackageDiscount.html"; |
| | | } |
| | |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | |
| | | |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("name",tStore.getName()); |
| | | map1.put("short_name",tStore.getName()); |
| | | map1.put("location",tStore.getCity()); |
| | | map1.put("address",tStore.getAddress()); |
| | | map1.put("telephone",tStore.getPhone()); |
| | | map1.put("linkman",userName); |
| | | map1.put("business_time","[{\"start_time\":\""+tStore.getStartTime()+"\",\"close_time\":\""+tStore.getEndTime()+"\"}]"); |
| | | map1.put("logo",tStore.getCoverDrawing()); |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | map1.put("space_id",tStore.getId().toString()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | // // 添加门店 |
| | | // HashMap<String, String> map1 = new HashMap<>(); |
| | | // map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map1.put("name",tStore.getName()); |
| | | // map1.put("short_name",tStore.getName()); |
| | | // map1.put("location",tStore.getCity()); |
| | | // map1.put("address",tStore.getAddress()); |
| | | // map1.put("telephone",tStore.getPhone()); |
| | | // map1.put("linkman",userName); |
| | | // map1.put("business_time","[{\"start_time\":\""+tStore.getStartTime()+"\",\"close_time\":\""+tStore.getEndTime()+"\"}]"); |
| | | // map1.put("logo",tStore.getCoverDrawing()); |
| | | // map1.put("remark",tStore.getIntroduce()); |
| | | // map1.put("lat",tStore.getLat()); |
| | | // map1.put("lng",tStore.getLon()); |
| | | // map1.put("space_id",tStore.getId().toString()); |
| | | // String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | // System.out.println(result); |
| | | |
| | | |
| | | return new SuccessTip<>(); |
| | |
| | | site.setOperatorId(UserExt.getUser().getObjectId()); |
| | | Integer integer1 = siteClient.addSite(site); |
| | | |
| | | // 添加场地 |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | |
| | | } |
| | | function updateT(e) { |
| | | var oneId = $('#type option:selected').text(); |
| | | var page = $('#page option:selected').text(); |
| | | |
| | | console.log(oneId); |
| | | if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ |
| | |
| | | }else{ |
| | | $("#t3").show() |
| | | } |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | |
| | | </script> |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*当前状态: </label> |
| | | |
| | | <div class="col-sm-9"> |
| | | @if(state == "待审核"){ |
| | | <h3 style="color: yellowgreen">${state}</h3> |
| | | @} |
| | | @if(state == "已拒绝"){ |
| | | <h3 style="color: green">${state}</h3> |
| | | @} |
| | | @if(state == "未通过"){ |
| | | <h3 style="color: red">${state}</h3> |
| | | @} |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*优惠券名称: </label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="name" name="name" autocomplete="off" placeholder="请输入优惠券名称" value="${item.name}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | @if(cash!=null){ |
| | | <div class="row" id="needAmount" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | |
| | | </div> |
| | | </div> |
| | | @} |
| | | @} |
| | | @if(integral!=null){ |
| | | <div class="row" id="needIntegral" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | @} |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="type2" value="${type2}"> |
| | | |
| | | <input type="hidden" id="coursePackagePaymentConfig" value='${coursePackagePaymentConfig}'> |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | |
| | | <div class="col-sm-10"> |
| | | <label class="col-sm-2 control-label">拒绝理由:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <span>拒绝理由:${reasons}</span> |
| | | <span>${reasons}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <div class="col-sm-2"></div> |
| | | <div class="col-sm-10"> |
| | | <div class="col-sm-2"> |
| | | </div> |
| | | |
| | | <div class="col-sm-6" id="classHours" style="margin-top: 6px;"> |
| | | </div> |
| | | </div> |
| | |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | $(function() { |
| | | console.log($("#type2").val()) |
| | | if ($("#type2").val()==2){ |
| | | console.log("进入") |
| | | $("#classHours").hide() |
| | | } |
| | | |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | }else{ |
| | | $("#t3").show() |
| | | } |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | |
| | | function updateType(e) { |
| | |
| | | |
| | | function updateT(e) { |
| | | var oneId = $('#type option:selected').text(); |
| | | |
| | | console.log(oneId); |
| | | if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){ |
| | | $("#t3").hide() |
| | |
| | | }else{ |
| | | $("#t3").show() |
| | | } |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | |
| | | function updateType(e) { |
| | |
| | | }else{ |
| | | $("#t3").show() |
| | | } |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | |
| | | function updateType(e) { |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input id="id" value="${item.id}" hidden> |
| | | <input id="name1" value="${item.name}" hidden> |
| | | <#avatar id="url" name="图片(推荐像素宽度316px)" avatarImg="${item.url}"/> |
| | | <#avatar id="url" name="*图片(推荐像素宽度316px)" avatarImg="${item.url}"/> |
| | | <div class="input-group" style="margin-left: 342px;"> |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转模块 |
| | | *跳转模块 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)"> |
| | |
| | | <div class="input-group" style="margin-left: 342px;" id="t1" hidden > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转页面 |
| | | *跳转页面 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="page" style="width: 400px;" onchange="updateOne(this)"> |
| | |
| | | <div class="input-group" style="margin-left: 342px;" id="t2" > |
| | | <div class="input-group-btn"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button"> |
| | | 跳转类型 |
| | | *跳转类型 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="type" style="width: 400px;" onchange="updateT(this)"> |
| | |
| | | </div> |
| | | |
| | | <div class="form-group" id="t3" > |
| | | <label class="col-sm-3 control-label">跳转ID:</label> |
| | | <label class="col-sm-3 control-label">*跳转ID:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="turnId" name="turnId" type="text" style="width: 400px;" value="${item.turnId}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="t4" > |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <label class="col-sm-3 control-label">*排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text" style="width: 400px;" value="${item.sort}"> |
| | | |
| | |
| | | $("#t3").show() |
| | | $("#t3").val("") |
| | | } |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | |
| | | function updateOne(e) { |
| | |
| | | var state=$("#state").val() |
| | | var id=$("#id").val() |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/export", function(data){ |
| | | Feng.success("导出成功"); |
| | | }); |
| | | ajax.set("state",state); |
| | | ajax.set("id",id); |
| | |
| | | |
| | | TCouponExamine.openExamine = function () { |
| | | if (this.check()) { |
| | | var auditStatus= TCouponExamine.seItem.auditStatus; |
| | | if (auditStatus == 3){ |
| | | Feng.error("当前状态不可再次审核!"); |
| | | return ; |
| | | } |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '优惠券审核' |
| | |
| | | }, |
| | | {title: '操作', visible: role==1?true:false, align: 'center', valign: 'middle', |
| | | formatter:function (value,row) { |
| | | return '<a href="javascript:void(0);" style="color: blue" onclick="TCompetition.delete1(' + row.id +')">删除 </a> <a href="javascript:void(0);" style="color: blue" onclick="TCompetition.openTCompetitionDetail(' + row.id +')">编辑</a>' |
| | | return '<a href="javascript:void(0);" style="color: blue" ' + |
| | | 'onclick="TCompetition.delete1(' + row.id +')">删除 </a> ' + |
| | | '<a href="javascript:void(0);" style="color: blue" ' + |
| | | 'onclick="TCompetition.openTCompetitionDetail(' + row.id +')">编辑</a>' |
| | | } |
| | | }, |
| | | ]; |
| | |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | }; |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
New file |
| | |
| | | package com.dsh.other.util; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.other.entity.SiteBooking; |
| | | import com.dsh.other.mapper.SiteBookingMapper; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author shaqian |
| | | * 定时任务修改赛事状态 |
| | | */ |
| | | @Component |
| | | public class TaskUtilCompetition { |
| | | |
| | | @Resource |
| | | private SiteBookingMapper siteBookingMapper; |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute(){ |
| | | try { |
| | | List<SiteBooking> siteBookings = siteBookingMapper.selectList(new LambdaQueryWrapper<SiteBooking>().eq(SiteBooking::getStatus, 0)); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | long time = siteBooking.getInsertTime().getTime(); |
| | | long l = time + 1800 * 1000; |
| | | if(System.currentTimeMillis()>l){ |
| | | siteBooking.setStatus(5); |
| | | siteBookingMapper.updateById(siteBooking); |
| | | |
| | | } |
| | | } |
| | | //定时修改赛事状态 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //预约场地后,时间超过endTime,状态变为已过期 |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute1(){ |
| | | try { |
| | | List<SiteBooking> siteBookings = siteBookingMapper.selectList(new LambdaQueryWrapper<SiteBooking>().eq(SiteBooking::getStatus, 1)); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | long time = siteBooking.getEndTime().getTime(); |
| | | if (System.currentTimeMillis() > time) { |
| | | siteBooking.setStatus(4); |
| | | siteBookingMapper.updateById(siteBooking); |
| | | } |
| | | |
| | | } |
| | | //定时修改赛事状态 |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |