| | |
| | | import net.bytebuddy.asm.Advice; |
| | | import org.aspectj.weaver.ast.Var; |
| | | import io.swagger.models.auth.In; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | /** |
| | | * 查询学员入学时间 根据第一次购买课包的时间 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/getTime") |
| | | public String getTime(@RequestBody Integer studentId){ |
| | | List<TCoursePackagePayment> list = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("studentId", studentId) |
| | | .orderByDesc("insertTime") |
| | | .last("LIMIT 1")); |
| | | if (list.size()>0){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date insertTime = list.get(0).getInsertTime(); |
| | | String format1 = format.format(list.get(0).getInsertTime()); |
| | | return format1; |
| | | } |
| | | return ""; |
| | | } |
| | | /** |
| | | * 添加购课记录-后台 |
| | | * @return |
| | |
| | | queryWrapper.like("reason", consumeQuery.getReason()); |
| | | |
| | | } |
| | | |
| | | List<CourseCounsum> list = counsumService.list(queryWrapper); |
| | | |
| | | |
| | | |
| | | |
| | | // List<CourseCounsum> list = counsumService.list(new QueryWrapper<CourseCounsum>().eq("paymentId", consumeQuery.getPayId()).eq("changeType", consumeQuery.getChangeType()).between("insertTime", consumeQuery.getStart(), consumeQuery.getEnd()).like("reason", consumeQuery.getReason())); |
| | | return list; |
| | | } |
| | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId()!=studentPay.getAppUserId()){ |
| | | courseCounsum.setReason("赠课"); |
| | | }else { courseCounsum.setReason("转课"); |
| | | courseCounsum.setReason("课时转移"); |
| | | }else { courseCounsum.setReason("课时转移"); |
| | | } |
| | | courseCounsum.setNum(laveClassHours); |
| | | courseCounsum.setChangeType(0); |
| | |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId()!=studentPay.getAppUserId()){ |
| | | courseCounsum1.setReason("赠课"); |
| | | }else { courseCounsum1.setReason("转课"); |
| | | courseCounsum1.setReason("课时转移"); |
| | | }else { courseCounsum1.setReason("课时转移"); |
| | | } |
| | | courseCounsum1.setNum(laveClassHours); |
| | | courseCounsum1.setChangeType(1); |
| | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("赠课"); |
| | | courseCounsum.setReason("课时转移"); |
| | | courseCounsum.setNum(orinPay.getLaveClassHours()); |
| | | courseCounsum.setChangeType(0); |
| | | courseCounsum.setPaymentId(orinPay.getId()); |
| | |
| | | |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("赠课"); |
| | | courseCounsum1.setReason("课时转移"); |
| | | courseCounsum1.setNum(orinPay.getLaveClassHours()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setPaymentId(to.getId()); |
| | |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | Date insertTime; |
| | | @TableField("appUserId") |
| | | Integer appUserId; |
| | |
| | | |
| | | private String city; |
| | | |
| | | |
| | | /** |
| | | * 入学时间 |
| | | */ |
| | | private Date time; |
| | | } |
| | |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackagePaymentClient { |
| | | |
| | | /** |
| | | * 查询学员入学时间 根据第一次购买课包的时间 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/getTime") |
| | | String getTime(@RequestBody Integer studentId); |
| | | /** |
| | | * 获取报名订单记录列表 |
| | | */ |
| | |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().select("id","name").eq("storeId", storeId).eq("state", 1)); |
| | | return list; |
| | | } |
| | | /** |
| | | * 根据门店id获取场地 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite1") |
| | | public List<TSite> querySite1(Integer storeId,Integer type){ |
| | | List<TSite> list = new ArrayList<>(); |
| | | if (type==1){ |
| | | list = siteService.list(new QueryWrapper<TSite>() |
| | | .select("id","name") |
| | | .eq("storeId", storeId) |
| | | .eq("state", 1) |
| | | .eq("ishalf",type)); |
| | | }else{ |
| | | list = siteService.list(new QueryWrapper<TSite>() |
| | | .select("id","name") |
| | | .eq("storeId", storeId) |
| | | .eq("state", 1) |
| | | ); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | String startTime,String text,Integer sort,String name,Integer useScope,String cityIds,String storeIds,Integer cardType |
| | | ) throws ParseException { |
| | | // 判断当前选择的课包 是不是假期课 然后判断选择的有效期是否在假期课有效期内 |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(coursePackageId); |
| | | if (tCoursePackage.getType()==2){ |
| | | // 如果是假期课 获取到当前课包的开始时间和结束时间 |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | Date startTime1 = tCoursePackage.getStartTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date s = format.parse(startTime.split(" - ")[0]); |
| | | Date e = format.parse(startTime.split(" - ")[1]); |
| | | if (s.before(startTime1)){ |
| | | // 有效期开始时间小于假期课开始时间 |
| | | return 5009; |
| | | } |
| | | if (e.after(endTime)){ |
| | | // 有效期结束时间大于假期课结束时间 |
| | | return 5008; |
| | | if (coursePackageId!=null){ |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(coursePackageId); |
| | | if (tCoursePackage.getType()==2){ |
| | | // 如果是假期课 获取到当前课包的开始时间和结束时间 |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | Date startTime1 = tCoursePackage.getStartTime(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date s = format.parse(startTime.split(" - ")[0]); |
| | | Date e = format.parse(startTime.split(" - ")[1]); |
| | | if (s.before(startTime1)){ |
| | | // 有效期开始时间小于假期课开始时间 |
| | | return 5009; |
| | | } |
| | | if (e.after(endTime)){ |
| | | // 有效期结束时间大于假期课结束时间 |
| | | return 5008; |
| | | } |
| | | } |
| | | } |
| | | PointsMerchandise pointsMerchandise = new PointsMerchandise(); |
| | |
| | | List<String> strings = new ArrayList<>(); |
| | | |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(id); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).like("times",date)); |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>() |
| | | .eq("siteId", id).like("times",date)); |
| | | System.out.println("=======siteBookings======"+siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | |
| | | import com.dsh.course.feignClient.auth.model.TokenResponse; |
| | | import com.dsh.course.model.node.MenuNode; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.modular.system.controller.util.CaptchaGenerator; |
| | | import com.dsh.guns.modular.system.controller.util.CaptchaImageGenerator; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.model.Role; |
| | | import com.dsh.guns.modular.system.service.IRelationService; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import javax.activation.MailcapCommandMap; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.awt.image.BufferedImage; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/", method = RequestMethod.GET) |
| | | public String index(Model model) { |
| | | // 判断是否第一次登录 如果是跳转至修改密码页面 |
| | | |
| | | model.addAttribute("tips", ""); |
| | | //获取菜单列表 |
| | | User user = UserExt.getUser(); |
| | |
| | | */ |
| | | @RequestMapping(value = "/login", method = RequestMethod.GET) |
| | | public String login() { |
| | | if (false || false) { |
| | | if (UserExt.getUser()!=null) { |
| | | return REDIRECT + "/"; |
| | | } else { |
| | | return "/login.html" ; |
| | |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentClient; |
| | | import com.dsh.course.feignClient.course.CourseStuddentClient; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackagePayment; |
| | |
| | | private CompetitionClient competitionClient; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private CoursePackagePaymentClient coursePackagePaymentClient; |
| | | |
| | | @RequestMapping("download") |
| | | public void down(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | |
| | | System.out.println("======>t"+tStudentId); |
| | | //查询学员信息 |
| | | TStudentDto tStudentDto = itStudentService.listOne(tStudentId); |
| | | // 查询该学员第一次购买课包的时间 |
| | | String time = coursePackagePaymentClient.getTime(tStudentId); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | if (time!=null){ |
| | | Date parse = format.parse(time); |
| | | tStudentDto.setTime(parse); |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | model.addAttribute("item", tStudentDto); |
| | | if (tStudentDto.getLateralSurface()!=null) { |
| | | String[] pics = tStudentDto.getLateralSurface().split(";"); |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.util; |
| | | |
| | | import java.util.Random; |
| | | |
| | | public class CaptchaGenerator { |
| | | public static String generateCaptcha(int length) { |
| | | Random random = new Random(); |
| | | StringBuilder captcha = new StringBuilder(); |
| | | for (int i = 0; i < length; i++) { |
| | | int randomChar = random.nextInt(26) + 65; // 生成随机的大写字母的ASCII码 |
| | | captcha.append((char) randomChar); |
| | | // 将ASCII码转换为字符并添加到验证码字符串中 |
| | | } |
| | | return captcha.toString();} |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.util; |
| | | |
| | | import java.awt.Color; |
| | | import java.awt.Font; |
| | | import java.awt.Graphics2D; |
| | | import java.awt.image.BufferedImage; |
| | | |
| | | public class CaptchaImageGenerator { |
| | | public static BufferedImage generateCaptchaImage(String captcha, int width, int height) { |
| | | BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); |
| | | Graphics2D graphics2D = image.createGraphics();// 设置背景色 |
| | | graphics2D.setColor(Color.WHITE); |
| | | graphics2D.fillRect(0, 0, width, height); |
| | | // 设置验证码字体 |
| | | Font font = new Font("Arial", Font.BOLD, 48); |
| | | graphics2D.setFont(font); |
| | | // 设置验证码颜色 |
| | | // graphics2D.setColor(Color.BLACK); |
| | | // 在图片上绘制验证码字符串 |
| | | int x = (width - graphics2D.getFontMetrics().stringWidth(captcha)) |
| | | / 2; |
| | | int y = height / 2; |
| | | graphics2D.drawString(captcha, x, y); |
| | | graphics2D.dispose(); |
| | | return image; |
| | | } |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | |
| | | |
| | | |
| | | @Data |
| | | @TableName("t_course_consum") |
| | | public class CourseCounsum { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | Integer id; |
| | | @TableField("changeType") |
| | | Integer changeType; |
| | | @TableField("num") |
| | | Integer num; |
| | | @TableField("reason") |
| | | String reason; |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | Date insertTime; |
| | | @TableField("appUserId") |
| | | Integer appUserId; |
| | | } |
| | |
| | | @Data |
| | | public class IntroduceUserQuery { |
| | | // 介绍有礼id |
| | | private Integer introduceId; |
| | | private Integer activityId; |
| | | // 分享用户姓名 |
| | | private String shareUserName; |
| | | // 分享用户i淡化 |
| | |
| | | public ResultUtil cancelReservation(Long id) { |
| | | CoursePackageStudent coursePackageStudent = coursePackageStudentClient.queryCoursePackageStudentById(id); |
| | | if(coursePackageStudent.getSignInOrNot() == 1){ |
| | | return ResultUtil.error("无法取消预约"); |
| | | return ResultUtil.error("当前学员已到课不能请假"); |
| | | } |
| | | // TCoursePackagePayment payment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackageStudent.getCoursePackagePaymentId()); |
| | | // payment.setAbsencesNumber(payment.getAbsencesNumber()+1); |
| | |
| | | <input class="itemInput" type="password" name="password" id="password" placeholder="请输入密码" required="" value=""> |
| | | </div> |
| | | |
| | | <!-- <div class="form-group" style="float: left;">--> |
| | | <!-- <div class="col-sm-8" style="padding-left: 0px; padding-right: 0px;">--> |
| | | <!-- <input class="form-control" type="text" name="kaptcha" placeholder="验证码" required="">--> |
| | | <!-- </div>--> |
| | | <!-- <div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;">--> |
| | | <!-- <img src="${ctxPath}/kaptcha" id="kaptcha" width="100%" height="100%"/>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="form-group" style="float: left;"> |
| | | <div class="col-sm-8" style="padding-left: 0px; padding-right: 0px;"> |
| | | <input class="form-control" type="text" name="kaptcha" placeholder="验证码" required=""> |
| | | </div> |
| | | <div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;"> |
| | | <img src="${ctxPath}/kaptcha" id="kaptcha" width="100%" height="100%"/> |
| | | </div> |
| | | </div> |
| | | <button onclick="login()" class="btn full-width m-b" style="background-color: #0573EA;color: white;">登 录</button> |
| | | <button type="submit" id="submit" style="display: none;"></button> |
| | | </p> |
| | |
| | | var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8); |
| | | return decryptedStr.toString(); |
| | | } |
| | | |
| | | function login(){ |
| | | let password = $('#password').val(); |
| | | password = encrypt(password); |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | | |
| | | <title>玩湃-修改密码</title> |
| | | |
| | | <link rel="shortcut icon" href="${ctxPath}/log.ico"> |
| | | <link href="${ctxPath}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet"> |
| | | <link href="${ctxPath}/css/font-awesome.css?v=4.4.0" rel="stylesheet"> |
| | | <link href="${ctxPath}/css/style.css?v=4.1.0" rel="stylesheet"> |
| | | <script>if (window.top !== window.self) { |
| | | window.top.location = window.location; |
| | | }</script> |
| | | <script src="${ctxPath}/js/jquery.min.js?v=2.1.4"></script> |
| | | <script src="${ctxPath}/js/bootstrap.min.js?v=3.3.6"></script> |
| | | <style> |
| | | .item{ |
| | | display: flex; |
| | | align-items: center; |
| | | /*border: 1px solid red !important;*/ |
| | | margin: 24px 0; |
| | | position: relative; |
| | | } |
| | | .item>img{ |
| | | position: absolute; |
| | | left: 8px; |
| | | /*bottom: 50%;*/ |
| | | } |
| | | .itemInput{ |
| | | background:none; |
| | | outline:none; |
| | | border:0px; |
| | | border-bottom:1px solid grey ; |
| | | padding-left: 30px; |
| | | height: 34px; |
| | | width: 100%; |
| | | } |
| | | .itemInput[type="text"]{ |
| | | |
| | | background: #fff; |
| | | outline: none; |
| | | } |
| | | |
| | | .itemInput:-webkit-autofill { |
| | | -webkit-box-shadow: 0 0 0 1000px white inset; // 背景设为白色 |
| | | -webkit-text-fill-color: #fff; // 字体颜色 |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body class="gray-bg" style="background:url(${ctxPath}/img/index1.png) no-repeat; background-size:cover;"> |
| | | |
| | | <div style="display: flex;align-items: center;justify-content: center;height: 100%"> |
| | | |
| | | |
| | | <div style="position: relative;margin-left:200px;left: -20px; max-width: 300px;min-height: 300px;background: white;border-radius: 8px;box-sizing: border-box;padding: 0 30px 0 50px;display: flex;align-items: center;justify-content: center;"> |
| | | <div style="max-height: 100%" > |
| | | <img style="margin-left: 44px" src="${ctxPath}/img/logo.png" width="100px" height="120px"/> |
| | | <br/> |
| | | <h4 style="color: red;">${tips!}</h4> |
| | | <form class="m-t" role="form" action="${ctxPath}/login" method="post"> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/img/account.png" /> |
| | | <input class="itemInput" type="text" name="username" id="username" placeholder="请输入账号" required="" value=""> |
| | | </div> |
| | | <div class="item"> |
| | | <input class="itemInput" name="sms_code" id="sms_code" placeholder="请输入验证码" required="" value="" style="padding-left: 0px; text-align: center;"> |
| | | <button id="btn" type="button" onclick="sendSMSCode(this)" style="width: 150px; font-size: 14px;">获取验证码</button> |
| | | </div> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/img/password.png" /> |
| | | <input class="itemInput" type="password" name="password" id="password" placeholder="请输入新密码" required="" value=""> |
| | | </div> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/img/password.png" /> |
| | | <input class="itemInput" type="password" name="passwordS" id="passwordS" placeholder="请确认新密码" required="" value=""> |
| | | </div> |
| | | |
| | | <button onclick="update()" class="btn full-width m-b" style="background-color: #0573EA;color: white;">保存</button> |
| | | <button class="btn full-width m-b" style="background-color: #0573EA;color: white;">关闭</button> |
| | | <button type="submit" id="submit" style="display: none;"></button> |
| | | </p> |
| | | </form> |
| | | </div> |
| | | </div></div> |
| | | </body> |
| | | <script src="${ctxPath}/js/jquery.min.js?v=2.1.4"></script> |
| | | <script src="${ctxPath}/js/common/ajax-object.js"></script> |
| | | <script src="${ctxPath}/js/common/Feng.js"></script> |
| | | <script src="${ctxPath}/crypto-js/crypto-js.js"></script> |
| | | <script> |
| | | $(function () { |
| | | $("#kaptcha").on('click', function () { |
| | | $("#kaptcha").attr('src', '${ctxPath}/kaptcha?' + Math.floor(Math.random() * 100)).fadeIn(); |
| | | }); |
| | | }); |
| | | var key = CryptoJS.enc.Utf8.parse("c53fd327353a09a1"); |
| | | var iv = CryptoJS.enc.Utf8.parse("3a0565e3b1d8ae3d"); |
| | | |
| | | //aes加密 |
| | | function encrypt(context) { |
| | | var encrypted = ''; |
| | | if (typeof(context) == 'string') { |
| | | |
| | | }else if(typeof(context) == 'object'){ |
| | | context = JSON.stringify(context); |
| | | } |
| | | var srcs = CryptoJS.enc.Utf8.parse(context); |
| | | encrypted = CryptoJS.AES.encrypt(srcs, key, { |
| | | iv: iv, |
| | | mode: CryptoJS.mode.CBC, |
| | | padding: CryptoJS.pad.Pkcs7 |
| | | }); |
| | | return encrypted.toString(); |
| | | } |
| | | // aes解密 |
| | | function decrypt(context) { |
| | | var decrypt = CryptoJS.AES.decrypt(context, key, { |
| | | iv: iv, |
| | | mode: CryptoJS.mode.CBC, |
| | | padding: CryptoJS.pad.Pkcs7 |
| | | }); |
| | | var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8); |
| | | return decryptedStr.toString(); |
| | | } |
| | | |
| | | function update(){ |
| | | let password = $('#password').val(); |
| | | password = encrypt(password); |
| | | $('#password').val(password); |
| | | $('#submit').submit(); |
| | | } |
| | | |
| | | |
| | | window.addEventListener( |
| | | "mousewheel", |
| | | function(event) { |
| | | if (event.ctrlKey === true || event.metaKey) { |
| | | event.preventDefault(); |
| | | } |
| | | }, |
| | | { passive: false } |
| | | ); |
| | | |
| | | //firefox |
| | | window.addEventListener( |
| | | "DOMMouseScroll", |
| | | function(event) { |
| | | if (event.ctrlKey === true || event.metaKey) { |
| | | event.preventDefault(); |
| | | } |
| | | }, |
| | | { passive: false } |
| | | ); |
| | | |
| | | |
| | | function fontSize(designWidth, maxWidth, minWidth) { |
| | | var doc = document, |
| | | win = window, |
| | | docEl = doc.documentElement, |
| | | remStyle = document.createElement("style"), |
| | | tid; |
| | | |
| | | function refreshRem() { |
| | | var width = docEl.getBoundingClientRect().width; |
| | | maxWidth = maxWidth || 540; |
| | | width > maxWidth && (width = maxWidth); |
| | | var rem = (width * 100) / designWidth; |
| | | remStyle.innerHTML = "html{font-size:" + rem + "px;}"; |
| | | } |
| | | |
| | | if (docEl.firstElementChild) { |
| | | docEl.firstElementChild.appendChild(remStyle); |
| | | } else { |
| | | var wrap = doc.createElement("div"); |
| | | wrap.appendChild(remStyle); |
| | | doc.write(wrap.innerHTML); |
| | | wrap = null; |
| | | } |
| | | // 要等 wiewport 设置好后才能执行 refreshRem,不然 refreshRem 会执行2次; |
| | | refreshRem(); |
| | | |
| | | win.addEventListener( |
| | | "resize", |
| | | function(res) { |
| | | // console.log(res); |
| | | if (minWidth < res.currentTarget.innerWidth) { |
| | | clearTimeout(tid); //防止执行两次 |
| | | return; |
| | | } |
| | | |
| | | tid = setTimeout(refreshRem, 10); |
| | | }, |
| | | false |
| | | ); |
| | | |
| | | win.addEventListener( |
| | | "pageshow", |
| | | function(e) { |
| | | if (e.persisted) { |
| | | // 浏览器后退的时候重新计算 |
| | | clearTimeout(tid); |
| | | tid = setTimeout(refreshRem, 300); |
| | | } |
| | | }, |
| | | false |
| | | ); |
| | | |
| | | if (doc.readyState === "complete") { |
| | | doc.body.style.fontSize = "16px"; |
| | | } else { |
| | | doc.addEventListener( |
| | | "DOMContentLoaded", |
| | | function(e) { |
| | | doc.body.style.fontSize = "16px"; |
| | | }, |
| | | false |
| | | ); |
| | | } |
| | | } |
| | | fontSize(768, 1920); |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | }); |
| | | |
| | | |
| | | document.addEventListener('DOMContentLoaded', function() { |
| | | var selectElement = document.getElementById('page'); |
| | | selectElement.onchange(); |
| | | }); |
| | | |
| | | |
| | | function updateType(e) { |
| | | let name = $("#model").val(); |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | var pageElement = document.getElementById('page'); |
| | | var event = new Event('change'); |
| | | pageElement.dispatchEvent(event); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | if (oneId==2 || oneId==25|| oneId==27){ |
| | | $("#t3").val("") |
| | | $("#t3").hide() |
| | |
| | | }else{ |
| | | $("#t3").show() |
| | | } |
| | | var page = $('#page option:selected').text(); |
| | | if (page=="线上课得积分" || page=="看视频得奖励"){ |
| | | if (oneId == "列表"){ |
| | | $("#t3").show() |
| | | } |
| | | } |
| | | } |
| | | window.onload = function() { |
| | | var temp = $("#turnId").val(); |
| | |
| | | <script type="text/javascript"> |
| | | function updateType(o) { |
| | | if(o==1){ |
| | | |
| | | // 选择半场 查询支持半场的场地 |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/querySite1", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#siteId').html(htmlStr); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("storeId", $('#storeId').val()); |
| | | ajax.set("type", 2); |
| | | ajax.start(); |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | |
| | | }) |
| | | ajax3.start() |
| | | }else { |
| | | // 选择半场 查询支持半场的场地 |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/querySite1", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#siteId').html(htmlStr); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("storeId", $('#storeId').val()); |
| | | ajax.set("type", 1); |
| | | ajax.start(); |
| | | |
| | | var elements = document.getElementsByClassName("layui-btn layui-btn-primary green-button"); |
| | | var count = elements.length; |
| | | |
| | |
| | | elem: '#time' |
| | | ,lang:"CN", |
| | | min:0, |
| | | max:10, |
| | | max:9, |
| | | format:'yyyy-MM-dd', |
| | | done:function (a) { |
| | | console.log("==========="+a) |
| | |
| | | }); |
| | | if (oneId==2 || oneId==25|| oneId==27){ |
| | | $("#t3").val("") |
| | | |
| | | $("#t3").hide() |
| | | } |
| | | |
| | | ajax.set("id",oneId); |
| | | ajax.start(); |
| | | updateT(document.getElementById("type")); |
| | |
| | | "type": "input-date", |
| | | "id": "u:9fe564fc31fc", |
| | | "label": "        入学时间:", |
| | | "name": "birthday", |
| | | "embed": false, |
| | | "mode": "inline", |
| | | "size": "md", |
| | | "value":`${studentClassInfo.inDate}`, |
| | | "value":`${item.time}`, |
| | | "disabled": true, |
| | | }, |
| | | { |
| | |
| | | $('#storeId').change(function () { |
| | | querySite(); |
| | | }) |
| | | $('#siteId').change(function () { |
| | | if ($('#time').val()!="") |
| | | CoursePackageInfo.addTime(); |
| | | }) |
| | | |
| | | $('input[name="payType"]').click(function () { |
| | | $('input[name="payType"]').each(function (index, e) { |
| | |
| | | |
| | | ClassRecord.cancellationRecord = function(i){ |
| | | if(this.check()){ |
| | | console.log("看看时间") |
| | | console.log( ClassRecord.seItem.classDate |
| | | ) |
| | | var timeString = ClassRecord.seItem.classDate; |
| | | var parts = timeString.split(' '); // 以空格分割字符串 |
| | | var datePart = parts[0]; // 获取日期部分 |
| | | var endTime = parts[1].split('-')[1]; // 获取时间段的结束时间 |
| | | var res=datePart+" "+endTime; |
| | | console.log("最终结果"); |
| | | console.log(res); |
| | | // 获取当前时间 |
| | | let now = new Date(); |
| | | // 将指定时间转换为 Date 对象 |
| | | let specifiedTime = new Date(res); |
| | | // 比较当前时间是否大于指定时间 |
| | | if (now > specifiedTime) { |
| | | console.log("当前时间大于指定时间"); |
| | | Feng.error("当前课程还未结束,不能上传消课记录") |
| | | return |
| | | } |
| | | let htmlStr = |
| | | |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/cancelReservation", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("取消成功!"); |
| | | Feng.success("请假成功!"); |
| | | CoursePackageStudent.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("取消失败!" + data.responseJSON.message + "!"); |
| | | Feng.error("请假失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", CoursePackageStudent.seItem.id); |
| | | ajax.start(); |
| | |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | console.log("调用") |
| | | var queryData = {}; |
| | | queryData['userName'] = $("#userName").val(); |
| | | queryData['userPhone'] = $("#userPhone").val(); |
| | |
| | | var table = new BSTable(TCompetition.id, "/introduce/listAllUser", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCompetition.table = table.init(); |
| | | TCompetition.search(); |
| | | }); |
| | | |
| | | |
| | |
| | | const pickUpQuantity2 = Number(pickUpQuantityInput.value); |
| | | |
| | | if (isNaN(quantityIssued2) || isNaN(pickUpQuantity2)) { |
| | | Feng.error("优惠卷数量必须为数字") |
| | | console.log('Both quantityIssued and pickUpQuantity must be numbers.'); |
| | | } else if (quantityIssued2 >= pickUpQuantity2) { |
| | | |
| | | console.log('quantityIssued is greater than pickUpQuantity.'); |
| | | } else { |
| | | |
| | | Feng.error("发放数量必须大于等于限领数量") |
| | | return |
| | | console.log('quantityIssued is not greater than pickUpQuantity.'); |
| | | } |
| | | let typeAll = document.querySelector('input[name="type"]:checked').value; |
| | | if(typeAll==2){ |
| | |
| | | console.log("请选择相同运营商门店") |
| | | Feng.info("请选择相同运营商门店"); |
| | | |
| | | }else if(data.code == 200){ |
| | | }else if (data==5009){ |
| | | Feng.error("有效期开始时间不应小于假期课开始时间"); |
| | | return; |
| | | }else if (data==5008){ |
| | | Feng.error("有效期结束时间不应大于假期课结束时间"); |
| | | return; |
| | | } |
| | | else if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/add", function(data){ |
| | | console.log("看看返回参数") |
| | | console.log(data) |
| | | if(data=="5001"){ |
| | | Feng.error("该账号已经存在"); |
| | | return; |
| | | }else if(data=="5003"){ |
| | | console.log("请选择相同运营商门店") |
| | | Feng.info("请选择相同运营商门店"); |
| | | }else if (data=="5009"){ |
| | | Feng.info("有效期开始时间不应小于假期课开始时间"); |
| | | }else if (data=="5008"){ |
| | | Feng.info("有效期结束时间不应大于假期课结束时间"); |
| | | Feng.error("请选择相同运营商门店"); |
| | | return; |
| | | }else if (data==5009){ |
| | | Feng.error("有效期开始时间不应小于假期课开始时间"); |
| | | return; |
| | | }else if (data==5008){ |
| | | Feng.error("有效期结束时间不应大于假期课结束时间"); |
| | | return; |
| | | } else if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | }else{ |
| | | console.log("走这里") |
| | | Feng.error(data.msg); |
| | | return; |
| | | } |
| | | |
| | | },function(data){ |
| | |
| | | @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(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |