cloud-server-account/src/main/java/com/dsh/account/feignclient/course/VideoOfCourseListClient.java
New file @@ -0,0 +1,17 @@ package com.dsh.account.feignclient.course; import com.dsh.account.model.vo.classDetails.ExerciseVideo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @FeignClient(value = "mb-cloud-course") public interface VideoOfCourseListClient { @PostMapping("/base/courseVideo/getAllList") List<ExerciseVideo> getStuCourseOfVideoList(@RequestBody List<Integer> coursePackIds); } cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java
@@ -15,6 +15,7 @@ import com.dsh.account.feignclient.course.CoursePackageClient; import com.dsh.account.feignclient.course.CoursePackageConfigClient; import com.dsh.account.feignclient.course.CoursePaymentClient; import com.dsh.account.feignclient.course.VideoOfCourseListClient; import com.dsh.account.feignclient.course.model.*; import com.dsh.account.feignclient.other.ImgConfigClient; import com.dsh.account.feignclient.other.RechargeConfigClient; @@ -98,6 +99,10 @@ @Resource private ImgConfigClient icfgClient; @Resource private VideoOfCourseListClient voclClient; @Resource private VipPaymentMapper vipPaymentMapper; @@ -155,7 +160,9 @@ List<RegisteredCourse> courseList = new ArrayList<>(); List<StuCourseResp> stuCoursePayment = paymentClient.getStuCoursePayment(tStudent.getId()); List<Integer> coursePackIds = new ArrayList<>(); if (stuCoursePayment.size() > 0){ coursePackIds = stuCoursePayment.stream().map(StuCourseResp::getCourseId).collect(Collectors.toList()); for (StuCourseResp tCoursePackagePayment : stuCoursePayment) { RegisteredCourse course = new RegisteredCourse(); course.setCourseId(tCoursePackagePayment.getCourseId()); @@ -168,10 +175,7 @@ } } classInfoVo.setCourseList(courseList); List<ExerciseVideo> videos = new ArrayList<>(); classInfoVo.setExerciseVideoList(videos); classInfoVo.setExerciseVideoList(voclClient.getStuCourseOfVideoList(coursePackIds)); }else { classInfoVo.setIsThere(2); List<TImgConfig> tImgConfigs = configClient.getNoneStuImgs(); @@ -199,9 +203,12 @@ CourseVenue courseVenue = new CourseVenue(); courseVenue.setStoreId(storeId); courseVenue.setAreaName(value.get(0).getCourseName()); courseVenue.setSiteDistance(LonlatUtils.distance(Double.parseDouble(longitude), Double.parseDouble(latitude), Double.parseDouble(value.get(0).getLon()), Double.parseDouble(value.get(0).getLat())) + ""); if (ToolUtil.isEmpty(longitude) && ToolUtil.isEmpty(latitude)){ courseVenue.setSiteDistance(0+""); }else { courseVenue.setSiteDistance(LonlatUtils.distance(Double.parseDouble(longitude), Double.parseDouble(latitude), Double.parseDouble(value.get(0).getLon()), Double.parseDouble(value.get(0).getLat())) + ""); } List<CourseVenue.CouList> courses = new ArrayList<>(); for (CourseOfStoreVo courseOfStoreVo : value) { CourseVenue.CouList couList = new CourseVenue.CouList(); @@ -1165,6 +1172,7 @@ weeksOfCourseRest.setStuId(stuId); weeksOfCourseRest.setAppUserId(appUserId); List<CourseOfStoreVo> storeOfCourses = paymentClient.getStoreOfCourses(weeksOfCourseRest); System.out.println(storeOfCourses); if (storeOfCourses.size() > 0 ){ courseVenues = dealDatas(storeOfCourses,longitude,latitude); } cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
@@ -152,7 +152,9 @@ .eq("classHours",tCoursePackagePayment.getClassHours())); // 获取课程有效结束时间,判断 查询的日期parse 是否在有效期范围内 Date expirationDate = DateTimeHelper.getExpirationDate(tCoursePackagePayment.getInsertTime(),tCoursePackage.getValidDays()); System.out.println(expirationDate.after(parse)); String classWeeks = tCoursePackage.getClassWeeks(); System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ CourseOfStoreVo storeVo = new CourseOfStoreVo(); storeVo.setCourseId(tCoursePackage.getId()); @@ -169,6 +171,7 @@ } } } System.out.println(course); return course; } catch (ParseException e) { return null; cloud-server-course/src/main/java/com/dsh/course/controller/PostCourseVideoController.java
New file @@ -0,0 +1,27 @@ package com.dsh.course.controller; import com.dsh.course.feignclient.model.ExerciseVideo; import com.dsh.course.service.PostCourseVideoService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; @RestController @RequestMapping("") public class PostCourseVideoController { @Resource private PostCourseVideoService pcvService; @ResponseBody @PostMapping("/base/courseVideo/getAllList") public List<ExerciseVideo> getStuCourseOfVideoList(@RequestBody List<Integer> coursePackIds){ return pcvService.queryCourseOfVideos(coursePackIds); } } cloud-server-course/src/main/java/com/dsh/course/feignclient/VideoOfCourseListClient.java
New file @@ -0,0 +1,18 @@ package com.dsh.course.feignclient; import com.dsh.course.feignclient.model.ExerciseVideo; import com.dsh.course.feignclient.model.StoreOfCourseVo; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @FeignClient(value = "mb-cloud-course") public interface VideoOfCourseListClient { @PostMapping("/base/courseVideo/getAllList") List<ExerciseVideo> getStuCourseOfVideoList(@RequestBody List<Integer> coursePackIds); } cloud-server-course/src/main/java/com/dsh/course/mapper/PostCourseVideoMapper.java
@@ -2,6 +2,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dsh.course.entity.PostCourseVideo; import com.dsh.course.feignclient.model.ExerciseVideo; import org.apache.ibatis.annotations.Param; import java.util.List; /** * <p> @@ -14,4 +18,6 @@ public interface PostCourseVideoMapper extends BaseMapper<PostCourseVideo> { List<ExerciseVideo> queryCourseOfVideos(@Param("coursePackIds") List<Integer> coursePackIds); } cloud-server-course/src/main/java/com/dsh/course/service/PostCourseVideoService.java
@@ -2,6 +2,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.dsh.course.entity.PostCourseVideo; import com.dsh.course.feignclient.model.ExerciseVideo; import java.util.List; /** * <p> @@ -13,4 +16,6 @@ */ public interface PostCourseVideoService extends IService<PostCourseVideo> { List<ExerciseVideo> queryCourseOfVideos(List<Integer> coursePackIds); } cloud-server-course/src/main/java/com/dsh/course/service/impl/PostCourseVideoServiceImpl.java
@@ -2,9 +2,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dsh.course.entity.PostCourseVideo; import com.dsh.course.feignclient.model.ExerciseVideo; import com.dsh.course.mapper.PostCourseVideoMapper; import com.dsh.course.service.PostCourseVideoService; import org.springframework.stereotype.Service; import java.util.List; /** * <p> @@ -17,4 +20,8 @@ @Service public class PostCourseVideoServiceImpl extends ServiceImpl<PostCourseVideoMapper, PostCourseVideo> implements PostCourseVideoService { @Override public List<ExerciseVideo> queryCourseOfVideos(List<Integer> coursePackIds) { return this.baseMapper.queryCourseOfVideos(coursePackIds); } } cloud-server-course/src/main/java/com/dsh/course/util/StrUtils.java
@@ -106,8 +106,31 @@ } String[] strArray = str.split(";"); for (String numStr : strArray) { int num = Integer.parseInt(numStr); list.add(num); switch (numStr){ case "周一": list.add(1); break; case "周二": list.add(2); break; case "周三": list.add(3); break; case "周四": list.add(4); break; case "周五": list.add(5); break; case "周六": list.add(6); break; case "周日": list.add(7); break; } } return list; } cloud-server-course/src/main/resources/mapper/PostCourseVideoMapper.xml
@@ -2,4 +2,18 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.dsh.course.mapper.PostCourseVideoMapper"> <select id="queryCourseOfVideos" resultType="com.dsh.course.feignclient.model.ExerciseVideo"> SELECT tc.introduce as videoName, tc.coverDrawing as videoCoverImgUrl, tc.courseVideo as videoUrl FROM t_post_course_video tpcv LEFT JOIN t_course tc on tc.id = tpcv.courseId where tc.state = 1 <if test="coursePackIds.size >0 "> and tpcv.coursePackageId in <foreach collection="coursePackIds" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> order by tpcv.courseDate desc limit 0,2 </select> </mapper> cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dsh.course.feignClient.activity.CouponClient; import com.dsh.course.feignClient.activity.model.CouponListOfSearch; import com.dsh.guns.config.UserExt; import com.dsh.guns.core.common.constant.factory.PageFactory; import com.dsh.guns.core.util.ToolUtil; import com.dsh.guns.modular.system.model.Region; @@ -57,7 +58,10 @@ * 跳转到添加 */ @RequestMapping("/coupon_add") public String memberCouponAdd() { public String memberCouponAdd(Model model) { Integer objectType = UserExt.getUser().getObjectType(); System.out.println(objectType); model.addAttribute("userType",objectType); return PREFIX + "TCouponAdd.html"; } cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html
@@ -19,7 +19,7 @@ width: 100px; height: 100px; line-height: 100px; margin-top: 32px; margin-top: 34px; text-align: center; } .avatar { @@ -37,6 +37,7 @@ } </style> <div class="ibox float-e-margins"> <input id="userType" value="${userType}" hidden="hidden"> <div class="ibox-content"> <div class="form-horizontal"> <div class="row"> @@ -56,7 +57,7 @@ <div class="form-group"> <label class="col-sm-3 control-label">*优惠券类型: </label> <input class="col-sm-1" style="margin-left: 2.7%;width: 13px;height: 13px;" name="prescription" onclick="radio1()" name="prescription" onclick="radio1()" checked value="1" type="radio"> <label class="col-sm-1" style="margin-left: 10px;width: 17%">满减券: 满</label> <input type="text" class="col-sm-1" id="conditionalAmount" @@ -105,13 +106,13 @@ <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label">*发放方式: </label> <input class="col-sm-1 control-label" name="distributionMethod" type="radio" value="1" style="margin-top: 10px"/> value="1" checked style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分购买</label> <input class="col-sm-1 control-label" name="distributionMethod" type="radio" value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">注册赠送</label> <input class="col-sm-1 control-label" name="distributionMethod" type="radio" value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">自动发券</label> </div> </div> @@ -119,19 +120,19 @@ </div> </div> <div class="row"> <div class="row" id="exchangeType" hidden="hidden"> <div class="col-sm-6"> <div class="form-group"> <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label">*兑换方式: </label> <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" value="1" style="margin-top: 10px"/> value="1" checked style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod3()" type="radio" value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> value="3" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 9%;margin-top: 7px">现金</label> </div> </div> @@ -139,7 +140,7 @@ </div> </div> <div class="row" id="needAmount"> <div class="row" id="needAmount" hidden="hidden"> <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3 control-label">*所需现金</label> @@ -152,7 +153,7 @@ </div> </div> <div class="row" id="needIntegral"> <div class="row" id="needIntegral" hidden="hidden"> <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3 control-label">*所需积分</label> @@ -171,13 +172,13 @@ <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label">*用户人群: </label> <input class="col-sm-1 control-label" name="userGroup" type="radio" value="1" style="margin-top: 10px"/> value="1" checked style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> <input class="col-sm-1 control-label" name="userGroup" type="radio" value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> <input class="col-sm-1 control-label" name="userGroup" type="radio" value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> </div> </div> @@ -218,11 +219,11 @@ </div> </div> <div class="row" id="app"> <div class="row" id="app" hidden="hidden"> <div class="col-sm-6"> <div class="form-group"> <label class="col-sm-3 control-label">*商品封面: </label> <div class="col-sm-2"> <div class="col-sm-2" style="margin-top: 2%"> <el-upload class="avatar-uploader" action="/tCouponManage/uploadPic" @@ -238,11 +239,11 @@ </div> </div> <div class="row" id="app1"> <div class="row" id="app1" hidden="hidden"> <div class="col-sm-6" style="width: 100%"> <div class="form-group"> <label class="col-sm-3 control-label" style="width: 15%;margin-left: 5%">*商品图片(请上传不超过五张图片): </label> <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%"> <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label> <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> <el-upload :limit="5" class="avatar-uploader" @@ -261,20 +262,26 @@ </div> </div> <div class="row"> <div class="row" id="belongsCon" hidden="hidden"> <div class="col-sm-6"> <div class="form-group"> <div class="initialLevel col-sm-12 control-label form-group"> <label class="col-sm-3 control-label">*适用范围: </label> <input class="col-sm-1 control-label" onclick="scopeOfApplication1()" name="company" type="radio" value="0" checked style="margin-top: 10px"/> <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全国通用</label> <input class="col-sm-1 control-label" name="company" onclick="scopeOfApplication2()" type="radio" value="1" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: 7px">指定城市</label> <input class="col-sm-1 control-label" name="company" onclick="scopeOfApplication3()" type="radio" value="1" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-1" style="width: 16%;margin-top: -16px;margin-left: 8%">指定门店</label> <label class="col-sm-3">*适用范围: </label> <div class="col-sm-3" id="belongsNationwide" hidden="hidden"> <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" value="0" checked style="margin-top: 10px"/> <label class="col-sm-2" style="width: 68%;margin-top: 7px">全国通用</label> </div> <div class="col-sm-3" id="belongsCity" hidden="hidden"> <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" value="1" style="margin-top: 10px"/> <label class="col-sm-2" style="width: 64%;margin-top: 7px">指定城市</label> </div> <div class="col-sm-3" id="belongsStore" hidden="hidden"> <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" value="1" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> <label class="col-sm-2" style="width: 64%;margin-top: 6px;">指定门店</label> </div> </div> </div> cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js
@@ -42,22 +42,6 @@ parent.layer.close(window.parent.TCoupon.layerIndex); } function ajax(serverCouponId, value, remark) { var ajax = new $ax(Feng.ctxPath + "/couponServer/examine", function (data) { Feng.success("审核成功!"); window.parent.TCoupon.table.refresh(); couponInfoDlg.close(); }, function (data) { Feng.error("审核失败!" + data.responseJSON.message + "!"); }); ajax.setData({ couponServerId: serverCouponId, state: value, remark: remark }); ajax.start(); } /** * 兑换方式1 @@ -254,22 +238,29 @@ } /** * 关闭此对话框 * 提交 */ couponInfoDlg.addSubmitCoupon = function () { var value = $('input:radio:checked').val(); let couponServerId = $("#serverCouponId").val(); let remark = $('#detail').val() if (value == 1) { //提交信息 ajax(couponServerId, value, remark) } else { if (!remark) { Feng.error("请输入拒绝理由!"); return; } ajax(couponServerId, value, remark) couponInfoDlg.addSubmit = function () { var userType = $('#userType').val(); var prescription = $('#prescription').val(); var illustrate = $('#illustrate').val(); var distributionMethod = $('#distributionMethod').val(); var prescription = $('#prescription').val(); if (userType === '1'){ } var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; var couponName = $('#name').val; } /** @@ -302,5 +293,26 @@ $(function () { getProvince(null); radio1(); var userType = $('#userType').val(); if (userType === '1'){ // 兑换方式 $('#exchangeType').show(); $('#needAmount').show(); $('#needIntegral').show(); // 图片 $('#app').show(); $('#app1').show(); // 适用范围 $('#belongsCon').show(); $('#belongsNationwide').show(); $('#belongsCity').show(); $('#belongsStore').show(); } if (userType === '2'){ $('#needIntegral').show(); $('#belongsCon').show(); $('#belongsStore').show(); $('#storeSelect').show(); } });