| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.model.AddAppUserVo; |
| | | import com.dsh.account.model.JoinPlayPaiVo; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索用户 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/appUser/queryAppUserListByName") |
| | | public List<TAppUser> queryAppUserListByName(@RequestBody String name){ |
| | | return appUserService.list(new QueryWrapper<TAppUser>().eq("state", 1).like("name", name)); |
| | | } |
| | | } |
| | |
| | | TStudent student = studentService.getById(id); |
| | | return student; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索学员 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentListByName") |
| | | public List<TStudent> queryStudentListByName(@RequestBody String name){ |
| | | return studentService.list(new QueryWrapper<TStudent>().eq("state", 1).like("name", name)); |
| | | } |
| | | } |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_account?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://127.0.0.1:3306/playpai_account?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Import; |
| | | import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | |
| | | * @author jason |
| | | */ |
| | | @EnableSwagger2 |
| | | @EnableScheduling |
| | | @EnableFeignClients |
| | | @MBCloudApplication |
| | | @Import({WebConfig.class}) |
| | |
| | | props4.setProperty("algorithm-expression", "t_user_video_details$->{appUserId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_user_video_details-inline", new AlgorithmConfiguration("INLINE", props4)); |
| | | result1.getKeyGenerators().put("t_user_video_details-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | //分片规则配置 |
| | | result1.getTables().add(getCoursePackageSchedulingTableRuleConfiguration()); |
| | | Properties props5 = new Properties(); |
| | | props5.setProperty("algorithm-expression", "t_course_package_scheduling$->{coursePackageId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_course_package_scheduling-inline", new AlgorithmConfiguration("INLINE", props5)); |
| | | result1.getKeyGenerators().put("t_course_package_scheduling-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | linkedList.add(result1); |
| | | |
| | | return linkedList; |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageSchedulingTableRuleConfiguration() { |
| | | ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_scheduling", "m_$->{0}.t_course_package_scheduling$->{1..5}");//30 |
| | | result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("coursePackageId", "t_course_package_scheduling-inline")); |
| | | result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_scheduling-snowflake")); |
| | | return result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 3:47 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CancelledClassesController { |
| | | |
| | | @Autowired |
| | | private CancelledClassesService cancelledClassesService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param cancelledClasses |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/cancelledClasses/addCancelledClasses") |
| | | public void addCancelledClasses(@RequestBody CancelledClasses cancelledClasses){ |
| | | cancelledClassesService.save(cancelledClasses); |
| | | } |
| | | } |
| | |
| | | courseService.updateById(course); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/course/queryCourseByType") |
| | | public List<TCourse> queryCourseByType(@RequestBody Integer type){ |
| | | return courseService.list(new QueryWrapper<TCourse>().eq("type", type).eq("state", 1)); |
| | | } |
| | | } |
| | |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.model.BaseVo; |
| | | import com.dsh.course.model.QueryCoursePackageLists; |
| | | import com.dsh.course.model.QueryExamineCoursePackageLists; |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | import com.dsh.course.service.ICoursePackagePaymentConfigService; |
| | |
| | | Page<Map<String, Object>> mapPage = page.setRecords(coursePackageService.queryCoursePackageLists(page, queryCoursePackageLists)); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackage/addCoursePackage") |
| | | public Integer addCoursePackage(@RequestBody TCoursePackage coursePackage){ |
| | | return coursePackageService.addCoursePackage(coursePackage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackage/updateCoursePackageById") |
| | | public void updateCoursePackageById(@RequestBody TCoursePackage coursePackage){ |
| | | coursePackageService.updateCoursePackageById(coursePackage); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackage/queryExamineCoursePackageLists") |
| | | public Page<Map<String, Object>> queryExamineCoursePackageLists(@RequestBody QueryExamineCoursePackageLists queryExamineCoursePackageLists){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryExamineCoursePackageLists.getLimit(), queryExamineCoursePackageLists.getOffset(), |
| | | queryExamineCoursePackageLists.getSort(), queryExamineCoursePackageLists.getOrder()); |
| | | Page<Map<String, Object>> mapPage = page.setRecords(coursePackageService.queryExamineCoursePackageLists(page, queryExamineCoursePackageLists)); |
| | | return mapPage; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/8 14:50 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackageDiscountController { |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService coursePackageDiscountService; |
| | | |
| | | |
| | | /** |
| | | * 获取课包折扣 |
| | | * @param coursePackagePaymentConfigId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscount") |
| | | public List<TCoursePackageDiscount> queryCoursePackageDiscount(@RequestBody Integer coursePackagePaymentConfigId){ |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfigId) |
| | | .eq("auditStatus", 2)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | | * @param list |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageDiscount/setCoursePackageDiscount") |
| | | public void setCoursePackageDiscount(@RequestBody List<TCoursePackageDiscount> list){ |
| | | TCoursePackageDiscount tCoursePackageDiscount = list.get(0); |
| | | coursePackageDiscountService.remove(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", tCoursePackageDiscount.getCoursePackageId())); |
| | | if(list.size() > 0){ |
| | | coursePackageDiscountService.saveBatch(list); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.service.ICoursePackagePaymentConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/7 11:46 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackagePaymentConfigController { |
| | | |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService coursePackagePaymentConfigService; |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePaymentConfig/addCoursePackagePaymentConfig") |
| | | public void addCoursePackagePaymentConfig(@RequestBody CoursePackagePaymentConfig coursePackagePaymentConfig){ |
| | | coursePackagePaymentConfigService.save(coursePackagePaymentConfig); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据课包id获取价格配置 |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList") |
| | | public List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList(@RequestBody Integer coursePackageId){ |
| | | return coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackageId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * @param coursePackageId |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePaymentConfig/delCoursePackagePaymentConfig") |
| | | public void delCoursePackagePaymentConfig(@RequestBody Integer coursePackageId){ |
| | | coursePackagePaymentConfigService.remove(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackageId)); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.model.BaseVo; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | |
| | | .eq("code",code)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息列表 |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/queryRegistrationRecord") |
| | | public Page<Map<String, Object>> queryRegistrationRecord(@RequestBody QueryRegistrationRecord queryRegistrationRecord){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryRegistrationRecord.getLimit(), queryRegistrationRecord.getOffset(), queryRegistrationRecord.getSort(), queryRegistrationRecord.getOrder()); |
| | | Page<Map<String, Object>> mapPage = page.setRecords(packagePaymentService.queryRegistrationRecord(page, queryRegistrationRecord)); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/queryWalkInStudentList") |
| | | public Page<Map<String, Object>> queryWalkInStudentList(@RequestBody QueryWalkInStudentList queryWalkInStudentList){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryWalkInStudentList.getLimit(), queryWalkInStudentList.getOffset(), queryWalkInStudentList.getSort(), queryWalkInStudentList.getOrder()); |
| | | Page<Map<String, Object>> mapPage = page.setRecords(packagePaymentService.queryWalkInStudentList(page, queryWalkInStudentList)); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById") |
| | | public TCoursePackagePayment queryCoursePackagePaymentById(@RequestBody Long id){ |
| | | return packagePaymentService.getById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackagePayment |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/editCoursePackagePayment") |
| | | public void editCoursePackagePayment(TCoursePackagePayment coursePackagePayment){ |
| | | packagePaymentService.updateById(coursePackagePayment); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.model.QueryCoursePackageSchedulingList; |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import com.dsh.course.util.PageFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:58 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackageSchedulingController { |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课列表 |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingList") |
| | | public Page<Map<String, Object>> queryCoursePackageSchedulingList(@RequestBody QueryCoursePackageSchedulingList queryCoursePackageSchedulingList){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryCoursePackageSchedulingList.getLimit(), queryCoursePackageSchedulingList.getOffset(), |
| | | queryCoursePackageSchedulingList.getSort(), queryCoursePackageSchedulingList.getOrder()); |
| | | Page<Map<String, Object>> mapPage = page.setRecords(coursePackageSchedulingService.queryCoursePackageSchedulingList(page, queryCoursePackageSchedulingList)); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingById") |
| | | public CoursePackageScheduling queryCoursePackageSchedulingById(@RequestBody Long id){ |
| | | return coursePackageSchedulingService.getById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") |
| | | public void editCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){ |
| | | coursePackageSchedulingService.updateById(coursePackageScheduling); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.model.QueryCoursePackageStudent; |
| | | import com.dsh.course.model.QueryCoursePackageStudentList; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.util.PageFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 17:39 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackageStudentController { |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | |
| | | /** |
| | | * 根据排课id获取预约数据 |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudentList") |
| | | public Page<Map<String, Object>> queryCoursePackageStudentList(@RequestBody QueryCoursePackageStudentList queryCoursePackageStudentList){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(queryCoursePackageStudentList.getLimit(), queryCoursePackageStudentList.getOffset(), |
| | | queryCoursePackageStudentList.getSort(), queryCoursePackageStudentList.getOrder()); |
| | | Page<Map<String, Object>> mapPage = page.setRecords(coursePackageStudentService.queryCoursePackageStudentList(page, queryCoursePackageStudentList)); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudentById") |
| | | public CoursePackageStudent queryCoursePackageStudentById(@RequestBody Long id){ |
| | | return coursePackageStudentService.getById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackageStudent |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/editCoursePackageStudent") |
| | | public void editCoursePackageStudent(@RequestBody CoursePackageStudent coursePackageStudent){ |
| | | coursePackageStudentService.updateById(coursePackageStudent); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据排课id获取预约数据 |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/queryByCoursePackageSchedulingId") |
| | | public List<CoursePackageStudent> queryByCoursePackageSchedulingId(@RequestBody Long coursePackageSchedulingId){ |
| | | return coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("coursePackageSchedulingId", coursePackageSchedulingId)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取上课记录数据 |
| | | * @param queryCoursePackageStudent |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudent") |
| | | public List<CoursePackageStudent> queryCoursePackageStudent(@RequestBody QueryCoursePackageStudent queryCoursePackageStudent){ |
| | | QueryWrapper<CoursePackageStudent> wrapper = new QueryWrapper<>(); |
| | | if(null != queryCoursePackageStudent.getAppUserId()){ |
| | | wrapper.eq("appUserId", queryCoursePackageStudent.getAppUserId()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getStudentId()){ |
| | | wrapper.eq("studentId", queryCoursePackageStudent.getStudentId()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getCoursePackageId()){ |
| | | wrapper.eq("coursePackageId", queryCoursePackageStudent.getCoursePackageId()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getCoursePackagePaymentId()){ |
| | | wrapper.eq("coursePackagePaymentId", queryCoursePackageStudent.getCoursePackagePaymentId()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getCoursePackageSchedulingId()){ |
| | | wrapper.eq("coursePackageSchedulingId", queryCoursePackageStudent.getCoursePackageSchedulingId()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getSignInOrNot()){ |
| | | wrapper.eq("signInOrNot", queryCoursePackageStudent.getSignInOrNot()); |
| | | } |
| | | if(null != queryCoursePackageStudent.getReservationStatus()){ |
| | | wrapper.eq("reservationStatus", queryCoursePackageStudent.getReservationStatus()); |
| | | } |
| | | return coursePackageStudentService.list(wrapper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加学员上课数据 |
| | | * @param coursePackageStudent |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/addCoursePackageStudent") |
| | | public void addCoursePackageStudent(@RequestBody CoursePackageStudent coursePackageStudent){ |
| | | coursePackageStudentService.save(coursePackageStudent); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | @TableField("coursePackagePaymentId") |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | @TableField("coursePackageSchedulingId") |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | @TableField("voucher") |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | 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 lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:46 |
| | | */ |
| | | @Data |
| | | @TableName("t_course_package_scheduling") |
| | | public class CoursePackageScheduling { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 上课日期 |
| | | */ |
| | | @TableField("classDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date classDate; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endDate") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endDate; |
| | | /** |
| | | * 课后练习课程id |
| | | */ |
| | | @TableField("courseId") |
| | | private Integer courseId; |
| | | /** |
| | | * 可获得积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | @TableField("cancelClasses") |
| | | private String cancelClasses; |
| | | /** |
| | | * 扣除课时 |
| | | */ |
| | | @TableField("deductClassHour") |
| | | private Integer deductClassHour; |
| | | /** |
| | | * 状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | * 课包购买记录id |
| | | */ |
| | | @TableField("coursePackagePaymentId") |
| | | private Integer coursePackagePaymentId; |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | @TableField("coursePackageSchedulingId") |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 到课状态(0=否,1=是) |
| | | */ |
| | |
| | | @TableField("reservationStatus") |
| | | private Integer reservationStatus; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | @TableField("absencesNumber") |
| | | private Integer absencesNumber; |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | @TableField("dropoutsNumber") |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 支付用户类型(1=用户,2=管理员) |
| | | */ |
| | | @TableField("payUserType") |
| | |
| | | * 退课时间 |
| | | */ |
| | | @TableField("withdrawalTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date withdrawalTime; |
| | | /** |
| | | * 退课凭证 |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | } |
| | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/29 14:09 |
| | |
| | | */ |
| | | @PostMapping("/base/appUser/updateAppUser") |
| | | void updateAppUser(AppUser appUser); |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊查询用户信息 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @PostMapping("/appUser/queryAppUserListByName") |
| | | List<AppUser> queryAppUserListByName(String name); |
| | | } |
| | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/4 23:38 |
| | |
| | | */ |
| | | @PostMapping("/student/queryStudentById") |
| | | Student queryStudentById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索数据 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @PostMapping("/student/queryStudentListByName") |
| | | List<Student> queryStudentListByName(String name); |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.model.QueryCoursePackageSchedulingList; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:55 |
| | | */ |
| | | public interface CoursePackageSchedulingMapper extends BaseMapper<CoursePackageScheduling> { |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageSchedulingList(Page<Map<String, Object>> page, @Param("item") QueryCoursePackageSchedulingList queryCoursePackageSchedulingList); |
| | | } |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public interface CoursePackageStudentMapper extends BaseMapper<CoursePackageStudent> { |
| | | |
| | | |
| | | /** |
| | | * 获取排课预约信息 |
| | | * @param page |
| | | * @param coursePackageSchedulingId |
| | | * @param userId |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageStudentList(Page<Map<String, Object>> page, @Param("coursePackageSchedulingId") Long coursePackageSchedulingId, |
| | | @Param("userId") List<Integer> userId, @Param("studentId") List<Integer> studentId); |
| | | } |
| | |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.model.QueryCoursePackageLists; |
| | | import com.dsh.course.model.QueryExamineCoursePackageLists; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageLists(Page<Map<String, Object>> page, @Param("item") QueryCoursePackageLists queryCoursePackageLists); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param page |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryExamineCoursePackageLists(Page<Map<String, Object>> page, @Param("item") QueryExamineCoursePackageLists queryExamineCoursePackageLists); |
| | | |
| | | } |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | TCoursePackagePayment getCoursePackagePaymentByCode(@Param("code") String code); |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * @param page |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryRegistrationRecord(Page<Map<String, Object>> page, @Param("coursePackageId") Integer coursePackageId, |
| | | @Param("userIds") List<Integer> userIds, @Param("studentIds") List<Integer> studentIds); |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param page |
| | | * @param coursePackagePaymentId |
| | | * @param userIds |
| | | * @param studentIds |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryWalkInStudentList(Page<Map<String, Object>> page, @Param("coursePackageId") Integer coursePackageId, @Param("coursePackagePaymentId") List<Long> coursePackagePaymentId, |
| | | @Param("userIds") List<Integer> userIds, @Param("studentIds") List<Integer> studentIds); |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 11:00 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageSchedulingList { |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 3:12 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageStudent { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课包购买记录id |
| | | */ |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 到课状态(0=否,1=是) |
| | | */ |
| | | private Integer signInOrNot; |
| | | /** |
| | | * 预约状态(0=取消,1=预约) |
| | | */ |
| | | private Integer reservationStatus; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 17:07 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageStudentList { |
| | | /** |
| | | * 排课id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 用户姓名 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员姓名 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/13 3:22 |
| | | */ |
| | | @Data |
| | | public class QueryExamineCoursePackageLists { |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 课程类型id |
| | | */ |
| | | private Integer coursePackageTypeId; |
| | | /** |
| | | * 课程名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 审核状态(1=待审核,2=已同意,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/10 19:47 |
| | | */ |
| | | @Data |
| | | public class QueryRegistrationRecord { |
| | | /** |
| | | * 课程id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员名称 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 2:46 |
| | | */ |
| | | @Data |
| | | public class QueryWalkInStudentList { |
| | | /** |
| | | * 课程id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员名称 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 14:05 |
| | | */ |
| | | public enum WeekEnum { |
| | | Sunday(1, "周日"), |
| | | Monday(2, "周一"), |
| | | Tuesday(3, "周二"), |
| | | Wednesday(4, "周三"), |
| | | Thursday(5, "周四"), |
| | | Friday(6, "周五"), |
| | | Saturday(7, "周六"); |
| | | |
| | | |
| | | WeekEnum(Integer week, String chineseName) { |
| | | this.week = week; |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | private Integer week; |
| | | private String chineseName; |
| | | |
| | | public Integer getWeek() { |
| | | return week; |
| | | } |
| | | |
| | | public void setWeek(Integer week) { |
| | | this.week = week; |
| | | } |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | |
| | | public static WeekEnum getWeekEnum(Integer week){ |
| | | WeekEnum[] values = WeekEnum.values(); |
| | | for (WeekEnum value : values) { |
| | | if(week == value.getWeek()){ |
| | | return value; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.model.QueryCoursePackageStudentList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public interface CoursePackageStudentService extends IService<CoursePackageStudent> { |
| | | |
| | | |
| | | /** |
| | | * 获取排课预约数据 |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageStudentList(Page<Map<String, Object>> page, QueryCoursePackageStudentList queryCoursePackageStudentList); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.model.QueryCoursePackageSchedulingList; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:57 |
| | | */ |
| | | public interface ICoursePackageSchedulingService extends IService<CoursePackageScheduling> { |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageSchedulingList(Page<Map<String, Object>> page, QueryCoursePackageSchedulingList queryCoursePackageSchedulingList); |
| | | |
| | | |
| | | /** |
| | | * 定时任务添加排课数据 |
| | | */ |
| | | void taskAddData(); |
| | | |
| | | |
| | | /** |
| | | * 定时修改状态 |
| | | */ |
| | | void taskSetStatus(); |
| | | } |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.RecordAppoint; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.ClasspaymentRequest; |
| | | import com.dsh.course.model.vo.request.CourseOfAfterRequest; |
| | |
| | | import com.dsh.course.util.ResultUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | ResultUtil insertVipPaymentCallback(String code, String orderNumber); |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * @param page |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryRegistrationRecord(Page<Map<String, Object>> page, QueryRegistrationRecord queryRegistrationRecord); |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param page |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryWalkInStudentList(Page<Map<String, Object>> page, QueryWalkInStudentList queryWalkInStudentList); |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageLists(Page<Map<String, Object>> page, QueryCoursePackageLists queryCoursePackageLists); |
| | | |
| | | |
| | | /** |
| | | * 添加课包 |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | | Integer addCoursePackage(TCoursePackage coursePackage); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | void updateCoursePackageById(TCoursePackage coursePackage); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryExamineCoursePackageLists(Page<Map<String, Object>> page, QueryExamineCoursePackageLists queryExamineCoursePackageLists); |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.mapper.CoursePackageSchedulingMapper; |
| | | import com.dsh.course.model.QueryCoursePackageSchedulingList; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:58 |
| | | */ |
| | | @Service |
| | | public class CoursePackageSchedulingServiceImpl extends ServiceImpl<CoursePackageSchedulingMapper, CoursePackageScheduling> implements ICoursePackageSchedulingService { |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageServiceImpl coursePackageService; |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingMapper; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryCoursePackageSchedulingList(Page<Map<String, Object>> page, QueryCoursePackageSchedulingList queryCoursePackageSchedulingList) { |
| | | List<Map<String, Object>> list = this.baseMapper.queryCoursePackageSchedulingList(page, queryCoursePackageSchedulingList); |
| | | for (Map<String, Object> map : list) { |
| | | Long id = Long.valueOf(map.get("id").toString()); |
| | | int count = coursePackageStudentService.count(new QueryWrapper<CoursePackageStudent>().eq("coursePackageSchedulingId", id).eq("reservationStatus", 1)); |
| | | map.put("registered", count); |
| | | int count1 = coursePackageStudentService.count(new QueryWrapper<CoursePackageStudent>().eq("coursePackageSchedulingId", id).eq("signInOrNot", 1)); |
| | | map.put("actualArrival", count1); |
| | | map.put("nonArrival", count - count1); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时添加排课数据 |
| | | */ |
| | | @Override |
| | | public void taskAddData() { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | List<TCoursePackage> list = coursePackageService.list(new QueryWrapper<TCoursePackage>().eq("status", 2).eq("auditStatus", 2).eq("state", 1)); |
| | | for (TCoursePackage tCoursePackage : list) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingMapper.selectOne(new QueryWrapper<CoursePackageScheduling>().eq("coursePackageId", tCoursePackage.getId()).last(" order by classDate desc limit 0, 1")); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | if(null != coursePackageScheduling){ |
| | | calendar.setTime(sdf1.parse(sdf.format(coursePackageScheduling.getClassDate()) + " 00:00:00")); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | }else{ |
| | | calendar.setTime(sdf1.parse(sdf.format(new Date()) + " 00:00:00")); |
| | | } |
| | | coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | coursePackageScheduling.setClassDate(calendar.getTime()); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingMapper.insert(coursePackageScheduling); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时修改状态 |
| | | */ |
| | | @Override |
| | | public void taskSetStatus() { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | //开始数据 |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingMapper.selectList(new QueryWrapper<CoursePackageScheduling>().eq("status", 1).last(" and now() >= classDate and now() < endDate")); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | coursePackageScheduling.setStatus(2); |
| | | coursePackageScheduling.setCoursePackageId(null); |
| | | coursePackageSchedulingMapper.updateById(coursePackageScheduling); |
| | | |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageScheduling.getCoursePackageId()); |
| | | if(coursePackage.getStatus() == 1){ |
| | | coursePackage.setStatus(2); |
| | | coursePackageService.updateById(coursePackage); |
| | | } |
| | | } |
| | | |
| | | //结束数据 |
| | | coursePackageSchedulings = coursePackageSchedulingMapper.selectList(new QueryWrapper<CoursePackageScheduling>().eq("status", 2).last(" and now() >= endDate")); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | coursePackageScheduling.setStatus(3); |
| | | coursePackageScheduling.setCoursePackageId(null); |
| | | coursePackageSchedulingMapper.updateById(coursePackageScheduling); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | | import com.dsh.course.feignclient.account.model.Student; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.model.QueryCoursePackageStudentList; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class CoursePackageStudentServiceImpl extends ServiceImpl<CoursePackageStudentMapper, CoursePackageStudent> implements CoursePackageStudentService { |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取排课预约数据 |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryCoursePackageStudentList(Page<Map<String, Object>> page, QueryCoursePackageStudentList queryCoursePackageStudentList) { |
| | | List<Integer> userId = null; |
| | | List<Integer> studentId = null; |
| | | if(ToolUtil.isNotEmpty(queryCoursePackageStudentList.getUserName())){ |
| | | List<AppUser> appUsers = appUserClient.queryAppUserListByName(queryCoursePackageStudentList.getUserName()); |
| | | if(appUsers.size() > 0){ |
| | | userId = appUsers.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if(ToolUtil.isNotEmpty(queryCoursePackageStudentList.getStudentName())){ |
| | | List<Student> students = studentClient.queryStudentListByName(queryCoursePackageStudentList.getStudentName()); |
| | | if(students.size() > 0){ |
| | | studentId = students.stream().map(Student::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = this.baseMapper.queryCoursePackageStudentList(page, queryCoursePackageStudentList.getCoursePackageSchedulingId(), userId, studentId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | Integer now = Integer.valueOf(sdf.format(new Date())); |
| | | for (Map<String, Object> map : list) { |
| | | Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); |
| | | Integer student_Id = Integer.valueOf(map.get("studentId").toString()); |
| | | AppUser appUser = appUserClient.queryAppUser(appUserId); |
| | | Student student = studentClient.queryStudentById(student_Id); |
| | | map.put("userName", appUser.getName()); |
| | | map.put("phone", student.getPhone()); |
| | | map.put("studentName", student.getName()); |
| | | map.put("age", null != student.getBirthday() ? now - Integer.valueOf(sdf.format(student.getBirthday())) : "-"); |
| | | map.put("sex", student.getSex()); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.alipay.api.domain.Person; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.CoachClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | | import com.dsh.course.feignclient.account.model.Coach; |
| | | import com.dsh.course.feignclient.account.model.Student; |
| | | import com.dsh.course.feignclient.activity.BenefitVideoClient; |
| | | import com.dsh.course.feignclient.activity.CouponClient; |
| | | import com.dsh.course.feignclient.activity.model.BenefitsVideos; |
| | |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.mapper.*; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.ClasspaymentRequest; |
| | |
| | | import com.dsh.course.model.vo.response.AppUserVideoResponse; |
| | | import com.dsh.course.model.vo.response.CourseDetailsResponse; |
| | | import com.dsh.course.model.vo.response.CourseOfVideoResponse; |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.util.*; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @Resource |
| | | private BenefitVideoClient bfvoClient; |
| | | |
| | | |
| | | @Resource |
| | | private UserVideoDetailsMapper uvdmapper; |
| | | |
| | |
| | | @Resource |
| | | private TCoursePackageDiscountMapper tcpdMapper; |
| | | |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentConfigMapper cpConfigMapper; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private AppUserClient appuClient; |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * @param page |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryRegistrationRecord(Page<Map<String, Object>> page, QueryRegistrationRecord queryRegistrationRecord) { |
| | | Integer coursePackageId = queryRegistrationRecord.getCoursePackageId(); |
| | | String userName = queryRegistrationRecord.getUserName(); |
| | | List<Integer> userIds = null; |
| | | List<Integer> studentIds = null; |
| | | if(ToolUtil.isNotEmpty(userName)){ |
| | | List<AppUser> appUsers = appuClient.queryAppUserListByName(userName); |
| | | if(appUsers.size() > 0){ |
| | | userIds = appUsers.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | String studentName = queryRegistrationRecord.getStudentName(); |
| | | if(ToolUtil.isNotEmpty(studentName)){ |
| | | List<Student> students = studentClient.queryStudentListByName(studentName); |
| | | if(students.size() > 0){ |
| | | studentIds = students.stream().map(Student::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = this.baseMapper.queryRegistrationRecord(page, coursePackageId, userIds, studentIds); |
| | | for (Map<String, Object> map : list) { |
| | | Long id = Long.valueOf(map.get("id").toString()); |
| | | Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); |
| | | Integer studentId = Integer.valueOf(map.get("studentId").toString()); |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | map.put("userName", null != appUser ? appUser.getName() : ""); |
| | | map.put("phone", null != appUser ? appUser.getPhone() : ""); |
| | | Student student = studentClient.queryStudentById(studentId); |
| | | map.put("studentName", null != student ? student.getName() : ""); |
| | | Integer integer = cpsMapper.selectCount(new QueryWrapper<CoursePackageStudent>().eq("appUserId", appUserId) |
| | | .eq("studentId", studentId).eq("coursePackagePaymentId", id).eq("signInOrNot", 1)); |
| | | map.put("already", integer); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param page |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryWalkInStudentList(Page<Map<String, Object>> page, QueryWalkInStudentList queryWalkInStudentList) { |
| | | Long coursePackageSchedulingId = queryWalkInStudentList.getCoursePackageSchedulingId(); |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingService.getById(coursePackageSchedulingId); |
| | | String userName = queryWalkInStudentList.getUserName(); |
| | | List<Integer> userIds = null; |
| | | List<Integer> studentIds = null; |
| | | if(ToolUtil.isNotEmpty(userName)){ |
| | | List<AppUser> appUsers = appuClient.queryAppUserListByName(userName); |
| | | if(appUsers.size() > 0){ |
| | | userIds = appUsers.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | String studentName = queryWalkInStudentList.getStudentName(); |
| | | if(ToolUtil.isNotEmpty(studentName)){ |
| | | List<Student> students = studentClient.queryStudentListByName(studentName); |
| | | if(students.size() > 0){ |
| | | studentIds = students.stream().map(Student::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<Long> coursePackagePaymentId = null; |
| | | List<CoursePackageStudent> coursePackageStudents = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>().eq("coursePackageSchedulingId", coursePackageSchedulingId).eq("reservationStatus", 1)); |
| | | if(coursePackageStudents.size() > 0){ |
| | | coursePackagePaymentId = coursePackageStudents.stream().map(CoursePackageStudent::getCoursePackagePaymentId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | List<Map<String, Object>> list = this.baseMapper.queryWalkInStudentList(page, coursePackageScheduling.getCoursePackageId(), coursePackagePaymentId, userIds, studentIds); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | Integer now = Integer.valueOf(sdf.format(new Date())); |
| | | for (Map<String, Object> map : list) { |
| | | Integer appUserId = Integer.valueOf(map.get("appUserId").toString()); |
| | | Integer student_Id = Integer.valueOf(map.get("studentId").toString()); |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | Student student = studentClient.queryStudentById(student_Id); |
| | | map.put("userName", appUser.getName()); |
| | | map.put("phone", student.getPhone()); |
| | | map.put("studentName", student.getName()); |
| | | map.put("age", null != student.getBirthday() ? now - Integer.valueOf(sdf.format(student.getBirthday())) : "-"); |
| | | map.put("sex", student.getSex()); |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackagePaymentConfig; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackageDiscount; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | |
| | | import com.dsh.course.mapper.TCoursePackageMapper; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.model.*; |
| | | import com.dsh.course.service.ICoursePackagePaymentConfigService; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.service.*; |
| | | import com.dsh.course.util.*; |
| | | import com.dsh.course.util.httpClinet.HttpResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加课包 |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer addCoursePackage(TCoursePackage coursePackage) { |
| | | try { |
| | | this.baseMapper.insert(coursePackage); |
| | | //生成排课数据 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date date = sdf1.parse(sdf.format(new Date()) + " 00:00:00"); |
| | | List<String> list = Arrays.asList(coursePackage.getClassWeeks().split(";")); |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String[] split = classStartTime.split(":"); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | String[] split1 = classEndTime.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | s.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | | while (true){ |
| | | int w = s.get(Calendar.DAY_OF_WEEK); |
| | | WeekEnum weekEnum = WeekEnum.getWeekEnum(w); |
| | | if(list.contains(weekEnum.getChineseName())){ |
| | | Calendar classDate = Calendar.getInstance(); |
| | | classDate.setTime(s.getTime()); |
| | | classDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); |
| | | classDate.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | classDate.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar endDate = Calendar.getInstance(); |
| | | endDate.setTime(s.getTime()); |
| | | endDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split1[0])); |
| | | endDate.set(Calendar.MINUTE, Integer.valueOf(split1[1])); |
| | | endDate.set(Calendar.SECOND, 0); |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(coursePackage.getId()); |
| | | coursePackageScheduling.setClassDate(classDate.getTime()); |
| | | coursePackageScheduling.setEndDate(endDate.getTime()); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | } |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | if(s.getTimeInMillis() > timeInMillis){ |
| | | break; |
| | | } |
| | | } |
| | | return coursePackage.getId(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | @Override |
| | | public void updateCoursePackageById(TCoursePackage coursePackage) { |
| | | try { |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("coursePackageId", coursePackage.getId())); |
| | | List<Long> collect = coursePackageStudents.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | |
| | | QueryWrapper<CoursePackageScheduling> coursePackageSchedulingQueryWrapper = new QueryWrapper<CoursePackageScheduling>().eq("coursePackageId", coursePackage.getId()); |
| | | if(collect.size() > 0){ |
| | | coursePackageSchedulingQueryWrapper.notIn("id", collect); |
| | | } |
| | | coursePackageSchedulingService.remove(coursePackageSchedulingQueryWrapper); |
| | | |
| | | this.baseMapper.updateById(coursePackage); |
| | | //生成排课数据 |
| | | Date date = null; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingService.getOne(new QueryWrapper<CoursePackageScheduling>().eq("coursePackageId", coursePackage.getId()).last(" and classDate > now() order by classDate desc limit 0, 1")); |
| | | if(null != coursePackageScheduling){ |
| | | date = sdf1.parse(sdf.format(coursePackageScheduling.getClassDate()) + " 00:00:00"); |
| | | }else{ |
| | | date = sdf1.parse(sdf.format(new Date()) + " 00:00:00"); |
| | | } |
| | | List<String> list = Arrays.asList(coursePackage.getClassWeeks().split(";")); |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String[] split = classStartTime.split(":"); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | String[] split1 = classEndTime.split(":"); |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | if(null != coursePackageScheduling){ |
| | | long time = sdf1.parse(sdf.format(new Date()) + " 00:00:00").getTime(); |
| | | int d = Long.valueOf(14L - ((s.getTimeInMillis() - time) / 86400000L)).intValue(); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + d); |
| | | }else{ |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); |
| | | } |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | | while (true){ |
| | | int w = s.get(Calendar.DAY_OF_WEEK); |
| | | WeekEnum weekEnum = WeekEnum.getWeekEnum(w); |
| | | if(list.contains(weekEnum.getChineseName())){ |
| | | Calendar classDate = Calendar.getInstance(); |
| | | classDate.setTime(s.getTime()); |
| | | classDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); |
| | | classDate.set(Calendar.MINUTE, Integer.valueOf(split[1])); |
| | | classDate.set(Calendar.SECOND, 0); |
| | | |
| | | Calendar endDate = Calendar.getInstance(); |
| | | endDate.setTime(s.getTime()); |
| | | endDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split1[0])); |
| | | endDate.set(Calendar.MINUTE, Integer.valueOf(split1[1])); |
| | | endDate.set(Calendar.SECOND, 0); |
| | | |
| | | CoursePackageScheduling coursePackageScheduling1 = new CoursePackageScheduling(); |
| | | coursePackageScheduling1.setCoursePackageId(coursePackage.getId()); |
| | | coursePackageScheduling1.setClassDate(classDate.getTime()); |
| | | coursePackageScheduling1.setEndDate(endDate.getTime()); |
| | | coursePackageScheduling1.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling1); |
| | | } |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | if(s.getTimeInMillis() > timeInMillis){ |
| | | break; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param page |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryExamineCoursePackageLists(Page<Map<String, Object>> page, QueryExamineCoursePackageLists queryExamineCoursePackageLists) { |
| | | List<Map<String, Object>> list = this.baseMapper.queryExamineCoursePackageLists(page, queryExamineCoursePackageLists); |
| | | for (Map<String, Object> map : list) { |
| | | Integer id = Integer.valueOf(map.get("id").toString()); |
| | | boolean cash = false; |
| | | boolean coin = false; |
| | | List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", id)); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : coursePackagePaymentConfigs) { |
| | | if(0 != coursePackagePaymentConfig.getCashPayment()){ |
| | | cash = true; |
| | | } |
| | | if(0 != coursePackagePaymentConfig.getPlayPaiCoin()){ |
| | | coin = true; |
| | | } |
| | | } |
| | | map.put("payType", (cash ? "现金支付" : "") + (coin ? cash ? "&玩湃币支付" : "玩湃币支付" : "")); |
| | | } |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.util; |
| | | |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 15:01 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 |
| | | */ |
| | | @Scheduled(fixedRate = 60000) |
| | | public void taskMinute(){ |
| | | try { |
| | | //定时修改排课状态 |
| | | coursePackageSchedulingService.taskSetStatus(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 零时任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | public void zeroTask(){ |
| | | //定时添加排课数据 |
| | | coursePackageSchedulingService.taskAddData(); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.CoursePackageSchedulingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.dsh.course.entity.CoursePackageScheduling"> |
| | | <id column="id" property="id" /> |
| | | <result column="coursePackageId" property="coursePackageId" /> |
| | | <result column="classDate" property="classDate" /> |
| | | <result column="courseId" property="courseId" /> |
| | | <result column="integral" property="integral" /> |
| | | <result column="cancelClasses" property="cancelClasses" /> |
| | | <result column="deductClassHour" property="deductClassHour" /> |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="queryCoursePackageSchedulingList" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | | DATE_FORMAT(classDate, '%Y-%m-%d') as classDate, |
| | | courseId, |
| | | `status`, |
| | | cancelClasses, |
| | | deductClassHour, |
| | | integral |
| | | from t_course_package_scheduling where coursePackageId = #{item.coursePackageId} order by classDate desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <mapper namespace="com.dsh.course.mapper.CoursePackageStudentMapper"> |
| | | |
| | | |
| | | |
| | | <select id="queryCoursePackageStudentList" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | | appUserId, |
| | | studentId, |
| | | signInOrNot, |
| | | reservationStatus |
| | | from t_course_package_student where coursePackageSchedulingId = #{coursePackageSchedulingId} |
| | | <if test="null != userId"> |
| | | and appUserId in |
| | | <foreach collection="appUserId" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != studentId"> |
| | | and studentId in |
| | | <foreach collection="studentId" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | a.state |
| | | from t_course_package a |
| | | left join t_course_package_type b on (a.coursePackageTypeId = b.id) |
| | | where a.state != 3 |
| | | where a.state != 3 and a.auditStatus = 2 |
| | | <if test="null != item.provinceCode and '' != item.provinceCode"> |
| | | and a.provinceCode = #{item.provinceCode} |
| | | </if> |
| | |
| | | </if> |
| | | order by a.insertTime desc |
| | | </select> |
| | | |
| | | |
| | | <select id="queryExamineCoursePackageLists" resultType="map"> |
| | | select |
| | | a.id, |
| | | CONCAT(a.province, a.city) as city, |
| | | a.storeId, |
| | | b.`name` as coursePackageType, |
| | | a.`name`, |
| | | a.maxSubscribeNumber, |
| | | CONCAT('购买后', a.validDays, '天内有效') as validDays, |
| | | a.sort, |
| | | a.auditStatus |
| | | from t_course_package a |
| | | left join t_course_package_type b on (a.coursePackageTypeId = b.id) |
| | | where a.state = 1 and a.auditStatus != 2 |
| | | <if test="null != item.provinceCode and '' != item.provinceCode"> |
| | | and a.provinceCode = #{item.provinceCode} |
| | | </if> |
| | | <if test="null != item.cityCode and '' != item.cityCode"> |
| | | and a.cityCode = #{item.cityCode} |
| | | </if> |
| | | <if test="null != item.coursePackageTypeId"> |
| | | and a.coursePackageTypeId = #{item.coursePackageTypeId} |
| | | </if> |
| | | <if test="null != item.name and '' != item.name"> |
| | | and a.name line CONCAT('%', #{item.name}, '%') |
| | | </if> |
| | | <if test="null != item.auditStatus"> |
| | | and a.auditStatus = #{item.auditStatus} |
| | | </if> |
| | | order by a.insertTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | and `code` = #{code} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryRegistrationRecord" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | | appUserId, |
| | | studentId, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as insertTime, |
| | | totalClassHours, |
| | | absencesNumber, |
| | | `status` |
| | | from t_course_package_payment where payStatus = 2 and state = 1 |
| | | <if test="null != coursePackageId"> |
| | | and coursePackageId = #{coursePackageId} |
| | | </if> |
| | | <if test="null != userIds"> |
| | | and appUserId in |
| | | <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != studentIds"> |
| | | and studentId in |
| | | <foreach collection="studentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | |
| | | |
| | | <select id="queryWalkInStudentList" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | | appUserId, |
| | | studentId |
| | | from t_course_package_payment where payStatus = 2 and state = 1 |
| | | <if test="null != coursePackageId"> |
| | | and coursePackageId = #{coursePackageId} |
| | | </if> |
| | | <if test="null != coursePackagePaymentId"> |
| | | and id not in |
| | | <foreach collection="coursePackagePaymentId" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != userIds"> |
| | | and appUserId in |
| | | <foreach collection="userIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != studentIds"> |
| | | and studentId in |
| | | <foreach collection="studentIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://127.0.0.1:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | |
| | | */ |
| | | @PostMapping("/coach/queryCoachByCity") |
| | | List<Coach> queryCoachByCity(String cityCode); |
| | | |
| | | |
| | | /** |
| | | * 根据id获取教练 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/coach/queryCoachById") |
| | | Coach queryCoachById(Integer id); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.dsh.course.feignClient.course.model.CancelledClasses; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 3:45 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CancelledClassesClient { |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param cancelledClasses |
| | | */ |
| | | @PostMapping("/cancelledClasses/addCancelledClasses") |
| | | void addCancelledClasses(CancelledClasses cancelledClasses); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/course/editCourseState") |
| | | void editCourseState(EditCourseState editCourseState); |
| | | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @PostMapping("/course/queryCourseByType") |
| | | List<TCourse> queryCourseByType(Integer type); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageLists; |
| | | import com.dsh.course.feignClient.course.model.QueryExamineCoursePackageLists; |
| | | import com.dsh.course.feignClient.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | |
| | | */ |
| | | @PostMapping("/coursePackage/queryCoursePackageLists") |
| | | Page<Map<String, Object>> queryCoursePackageLists(QueryCoursePackageLists queryCoursePackageLists); |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param coursePackage |
| | | */ |
| | | @PostMapping("/coursePackage/addCoursePackage") |
| | | Integer addCoursePackage(TCoursePackage coursePackage); |
| | | |
| | | |
| | | /** |
| | | * 根据id查询数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/coursePackage/queryCoursePackageById") |
| | | TCoursePackage queryById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | @PostMapping("/coursePackage/updateCoursePackageById") |
| | | void updateCoursePackage(TCoursePackage coursePackage); |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackage/queryExamineCoursePackageLists") |
| | | Page<Map<String, Object>> queryExamineCoursePackageLists(QueryExamineCoursePackageLists queryExamineCoursePackageLists); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.dsh.course.feignClient.course.model.TCoursePackageDiscount; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/8 14:46 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackageDiscountClient { |
| | | |
| | | /** |
| | | * 获取课包折扣 |
| | | * @param coursePackagePaymentConfigId |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageDiscount/queryCoursePackageDiscount") |
| | | List<TCoursePackageDiscount> queryCoursePackageDiscount(Integer coursePackagePaymentConfigId); |
| | | |
| | | |
| | | /** |
| | | * 配置课包折扣数据 |
| | | * @param list |
| | | */ |
| | | @PostMapping("/coursePackageDiscount/setCoursePackageDiscount") |
| | | void setCoursePackageDiscount(List<TCoursePackageDiscount> list); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.feignClient.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackagePayment; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/10 19:51 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackagePaymentClient { |
| | | |
| | | |
| | | /** |
| | | * 获取课程报名信息列表 |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackagePayment/queryRegistrationRecord") |
| | | Page<Map<String, Object>> queryRegistrationRecord(QueryRegistrationRecord queryRegistrationRecord); |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackagePayment/queryWalkInStudentList") |
| | | Page<Map<String, Object>> queryWalkInStudentList(QueryWalkInStudentList queryWalkInStudentList); |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackagePayment/queryCoursePackagePaymentById") |
| | | TCoursePackagePayment queryCoursePackagePaymentById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackagePayment |
| | | */ |
| | | @PostMapping("/coursePackagePayment/editCoursePackagePayment") |
| | | void editCoursePackagePayment(TCoursePackagePayment coursePackagePayment); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.dsh.course.feignClient.course.model.CoursePackagePaymentConfig; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/7 11:45 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackagePaymentConfigClient { |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @PostMapping("/coursePackagePaymentConfig/addCoursePackagePaymentConfig") |
| | | void addCoursePackagePaymentConfig(CoursePackagePaymentConfig coursePackagePaymentConfig); |
| | | |
| | | |
| | | /** |
| | | * 根据课包id获取价格配置 |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackagePaymentConfig/queryCoursePackagePaymentConfigList") |
| | | List<CoursePackagePaymentConfig> queryCoursePackagePaymentConfigList(Integer coursePackageId); |
| | | |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * @param coursePackageId |
| | | */ |
| | | @PostMapping("/coursePackagePaymentConfig/delCoursePackagePaymentConfig") |
| | | void delCoursePackagePaymentConfig(Integer coursePackageId); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.model.CoursePackageScheduling; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageSchedulingList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:59 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackageSchedulingClient { |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课记录 |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingList") |
| | | Page<Map<String, Object>> queryCoursePackageSchedulingList(QueryCoursePackageSchedulingList queryCoursePackageSchedulingList); |
| | | |
| | | |
| | | /** |
| | | * 根据id查询排课数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageScheduling/queryCoursePackageSchedulingById") |
| | | CoursePackageScheduling queryCoursePackageSchedulingById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") |
| | | void editCoursePackageScheduling(CoursePackageScheduling coursePackageScheduling); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.model.CoursePackageStudent; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageStudent; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageStudentList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 17:38 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CoursePackageStudentClient { |
| | | |
| | | |
| | | /** |
| | | * 获取课程排课预约数据 |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudentList") |
| | | Page<Map<String, Object>> queryCoursePackageStudentList(QueryCoursePackageStudentList queryCoursePackageStudentList); |
| | | |
| | | |
| | | /** |
| | | * 根据id查询数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudentById") |
| | | CoursePackageStudent queryCoursePackageStudentById(Long id); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackageStudent |
| | | */ |
| | | @PostMapping("/coursePackageStudent/editCoursePackageStudent") |
| | | void editCoursePackageStudent(CoursePackageStudent coursePackageStudent); |
| | | |
| | | |
| | | /** |
| | | * 根据排课id获取预约数据 |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageStudent/queryByCoursePackageSchedulingId") |
| | | List<CoursePackageStudent> queryByCoursePackageSchedulingId(Long coursePackageSchedulingId); |
| | | |
| | | |
| | | /** |
| | | * 获取学员上课数据 |
| | | * @param queryCoursePackageStudent |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageStudent/queryCoursePackageStudent") |
| | | List<CoursePackageStudent> queryCoursePackageStudent(QueryCoursePackageStudent queryCoursePackageStudent); |
| | | |
| | | |
| | | /** |
| | | * 添加学员上课数据 |
| | | * @param coursePackageStudent |
| | | */ |
| | | @PostMapping("/coursePackageStudent/addCoursePackageStudent") |
| | | void addCoursePackageStudent(CoursePackageStudent coursePackageStudent); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | public class CancelledClasses extends Model<CancelledClasses> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 消课类型(1=上课消课,2=支付消课) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课程支付记录id |
| | | */ |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | private String voucher; |
| | | /** |
| | | * 消课数量 |
| | | */ |
| | | private Integer cancelledClassesNumber; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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 lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/29 10:42 |
| | | */ |
| | | @Data |
| | | public class CoursePackagePaymentConfig { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课时数 |
| | | */ |
| | | private Integer classHours; |
| | | /** |
| | | * 现金支付价格 |
| | | */ |
| | | private Double cashPayment; |
| | | /** |
| | | * 玩湃币价格 |
| | | */ |
| | | private Integer playPaiCoin; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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 lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:46 |
| | | */ |
| | | @Data |
| | | public class CoursePackageScheduling { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 上课日期 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date classDate; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endDate; |
| | | /** |
| | | * 课后练习课程id |
| | | */ |
| | | private Integer courseId; |
| | | /** |
| | | * 可获得积分 |
| | | */ |
| | | private Integer integral; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | private String cancelClasses; |
| | | /** |
| | | * 扣除课时 |
| | | */ |
| | | private Integer deductClassHour; |
| | | /** |
| | | * 状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | private Integer status; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员上课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | @Data |
| | | public class CoursePackageStudent extends Model<CoursePackageStudent> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课包购买记录id |
| | | */ |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 到课状态(0=否,1=是) |
| | | */ |
| | | private Integer signInOrNot; |
| | | /** |
| | | * 预约状态(0=取消,1=预约) |
| | | */ |
| | | private Integer reservationStatus; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 11:00 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageSchedulingList { |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 3:12 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageStudent { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课包购买记录id |
| | | */ |
| | | private Long coursePackagePaymentId; |
| | | /** |
| | | * 排课记录id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 到课状态(0=否,1=是) |
| | | */ |
| | | private Integer signInOrNot; |
| | | /** |
| | | * 预约状态(0=取消,1=预约) |
| | | */ |
| | | private Integer reservationStatus; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 17:07 |
| | | */ |
| | | @Data |
| | | public class QueryCoursePackageStudentList { |
| | | /** |
| | | * 排课id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 用户姓名 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员姓名 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/13 3:22 |
| | | */ |
| | | @Data |
| | | public class QueryExamineCoursePackageLists { |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 课程类型id |
| | | */ |
| | | private Integer coursePackageTypeId; |
| | | /** |
| | | * 课程名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 审核状态(1=待审核,2=已同意,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/10 19:47 |
| | | */ |
| | | @Data |
| | | public class QueryRegistrationRecord { |
| | | /** |
| | | * 课程id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员名称 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/12 2:46 |
| | | */ |
| | | @Data |
| | | public class QueryWalkInStudentList { |
| | | /** |
| | | * 课程id |
| | | */ |
| | | private Long coursePackageSchedulingId; |
| | | /** |
| | | * 用户名称 |
| | | */ |
| | | private String userName; |
| | | /** |
| | | * 学员名称 |
| | | */ |
| | | private String studentName; |
| | | |
| | | private String order; |
| | | private Integer offset; |
| | | private Integer limit; |
| | | private String sort; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.model; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Data |
| | | public class TCoursePackage extends Model<TCoursePackage>{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | private Integer storeId; |
| | | /** |
| | | * 课包类型id |
| | | */ |
| | | private Integer coursePackageTypeId; |
| | | /** |
| | | * 课包名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 上课场地id |
| | | */ |
| | | private Integer siteId; |
| | | /** |
| | | * 教练id |
| | | */ |
| | | private Integer coachId; |
| | | /** |
| | | * 最多预约人数 |
| | | */ |
| | | private Integer maxSubscribeNumber; |
| | | /** |
| | | * 上课开始时间 |
| | | */ |
| | | private String classStartTime; |
| | | /** |
| | | * 上课结束时段 |
| | | */ |
| | | private String classEndTime; |
| | | /** |
| | | * 上课周,多个分号分隔 |
| | | */ |
| | | private String classWeeks; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | private String coverDrawing; |
| | | /** |
| | | * 详情图 |
| | | */ |
| | | private String detailDrawing; |
| | | /** |
| | | * 介绍图 |
| | | */ |
| | | private String introduceDrawing; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 有效天数 |
| | | */ |
| | | private Integer validDays; |
| | | /** |
| | | * 课程状态(1=未开始,2=进行中,3=已结束,4=已取消) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 审核状态(1=待审核,2=已同意,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | /** |
| | | * 审核人id |
| | | */ |
| | | private Integer auditUserId; |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String authRemark; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包折扣 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Data |
| | | public class TCoursePackageDiscount extends Model<TCoursePackageDiscount>{ |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课包价格规则id |
| | | */ |
| | | private Integer coursePackagePaymentConfigId; |
| | | /** |
| | | * 折扣类型(1=会员折扣,2=续课优惠,3=限时折扣,4=赠送课时) |
| | | */ |
| | | private Integer type; |
| | | /** |
| | | * 折扣优惠规则JSON ->详见 DiscountJsonDto类 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 审核状态(1=待审核,2=已通过,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | /** |
| | | * 审核人id |
| | | */ |
| | | private Integer auditUserId; |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String auditRemark; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course.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.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户课程包购买记录 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Data |
| | | public class TCoursePackagePayment extends Model<TCoursePackagePayment>{ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | private String code; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝,3=玩湃币,4=积分,5=积分+微信,6=积分+支付宝) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 课时数 |
| | | */ |
| | | private Integer classHours; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | private Double originalPrice; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Long userCouponId; |
| | | /** |
| | | * 现金支付价格 |
| | | */ |
| | | private BigDecimal cashPayment; |
| | | /** |
| | | * 玩湃币价格/积分 |
| | | */ |
| | | private Integer playPaiCoin; |
| | | /** |
| | | * 总课时 |
| | | */ |
| | | private Integer totalClassHours; |
| | | /** |
| | | * 剩余课时 |
| | | */ |
| | | private Integer laveClassHours; |
| | | /** |
| | | * 缺课次数 |
| | | */ |
| | | private Integer absencesNumber; |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 支付用户类型(1=用户,2=管理员) |
| | | */ |
| | | private Integer payUserType; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付) |
| | | */ |
| | | private Integer payStatus; |
| | | /** |
| | | * 第三方支付流水号 |
| | | */ |
| | | private String orderNumber; |
| | | /** |
| | | * 支付用户id |
| | | */ |
| | | private Integer payUserId; |
| | | /** |
| | | * 课程状态(1=正常,2=已退课) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 退课时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date withdrawalTime; |
| | | /** |
| | | * 退课凭证 |
| | | */ |
| | | private String certificate; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | } |
| | |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | courseService.editCourseState(id, state); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryCourseByType") |
| | | public List<TCourse> queryCourseByType(Integer type){ |
| | | return courseService.queryCourseByType(type); |
| | | } |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageDiscountClient; |
| | | import com.dsh.course.feignClient.course.CoursePackagePaymentConfigClient; |
| | | import com.dsh.course.feignClient.course.CoursePackageTypeClient; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackageType; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | @Resource |
| | | private CoachClient coachClient; |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; |
| | | |
| | | @Resource |
| | | private CoursePackageDiscountClient coursePackageDiscountClient; |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到添加页 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @GetMapping("/openAddCoursePackage") |
| | | public String openAddCoursePackage(Model model){ |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到编辑页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/openEditCoursePackage") |
| | | public String openEditCoursePackage(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("classTime", tCoursePackage.getClassStartTime() + ":00 - " + tCoursePackage.getClassEndTime() + ":00"); |
| | | String[] split = tCoursePackage.getClassWeeks().split(";"); |
| | | List<String> list5 = Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日"); |
| | | List<Map<String, Object>> classWeeks = new ArrayList<>(); |
| | | for (String s : list5) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("value", s); |
| | | map.put("checked", false); |
| | | for (String s1 : split) { |
| | | if(s.equals(s1)){ |
| | | map.put("checked", true); |
| | | } |
| | | } |
| | | classWeeks.add(map); |
| | | } |
| | | model.addAttribute("classWeeks", classWeeks); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = tCoursePackage.getCityCode(); |
| | | String provinceCode = tCoursePackage.getProvinceCode(); |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(provinceCode, cityCode); |
| | | model.addAttribute("city", list1); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", cityCode).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", tCoursePackage.getStoreId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(cityCode); |
| | | model.addAttribute("coach", coaches); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | model.addAttribute("coursePackagePaymentConfig", list4.remove(0)); |
| | | model.addAttribute("coursePackagePaymentConfigs", list4); |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = list4.get(0); |
| | | model.addAttribute("cashPayment", coursePackagePaymentConfig.getCashPayment() == 0 ? false : true); |
| | | model.addAttribute("playPaiCoin", coursePackagePaymentConfig.getPlayPaiCoin() == 0 ? false : true); |
| | | return PREFIX + "coursePackage_edit.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转详情页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/showCoursePackageDetails") |
| | | public String showCoursePackageDetails(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("classTime", tCoursePackage.getClassStartTime() + ":00 - " + tCoursePackage.getClassEndTime() + ":00"); |
| | | String[] split = tCoursePackage.getClassWeeks().split(";"); |
| | | List<String> list5 = Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日"); |
| | | List<Map<String, Object>> classWeeks = new ArrayList<>(); |
| | | for (String s : list5) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("value", s); |
| | | map.put("checked", false); |
| | | for (String s1 : split) { |
| | | if(s.equals(s1)){ |
| | | map.put("checked", true); |
| | | } |
| | | } |
| | | classWeeks.add(map); |
| | | } |
| | | model.addAttribute("classWeeks", classWeeks); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = tCoursePackage.getCityCode(); |
| | | String provinceCode = tCoursePackage.getProvinceCode(); |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(provinceCode, cityCode); |
| | | model.addAttribute("city", list1); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", cityCode).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", tCoursePackage.getStoreId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(cityCode); |
| | | model.addAttribute("coach", coaches); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | model.addAttribute("coursePackagePaymentConfig", list4.remove(0)); |
| | | model.addAttribute("coursePackagePaymentConfigs", list4); |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = list4.get(0); |
| | | model.addAttribute("cashPayment", coursePackagePaymentConfig.getCashPayment() == 0 ? false : true); |
| | | model.addAttribute("playPaiCoin", coursePackagePaymentConfig.getPlayPaiCoin() == 0 ? false : true); |
| | | return PREFIX + "coursePackage_info.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到折扣页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/showCoursePackageDiscount") |
| | | public String showCoursePackageDiscount(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list4) { |
| | | if(coursePackagePaymentConfig.getCashPayment() == 0){ |
| | | continue; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()); |
| | | map.put("classHours", coursePackagePaymentConfig.getClassHours()); |
| | | String payment = ""; |
| | | if(coursePackagePaymentConfig.getCashPayment() > 0){ |
| | | payment += "现金支付"; |
| | | } |
| | | if(coursePackagePaymentConfig.getPlayPaiCoin() > 0){ |
| | | payment += (ToolUtil.isNotEmpty(payment) ? "、" : "") + "玩湃币支付"; |
| | | } |
| | | map.put("payment", payment); |
| | | map.put("cashPayment", coursePackagePaymentConfig.getCashPayment()); |
| | | List<TCoursePackageDiscount> tCoursePackageDiscounts = coursePackageDiscountClient.queryCoursePackageDiscount(coursePackagePaymentConfig.getId()); |
| | | map.put("coursePackageDiscount", tCoursePackageDiscounts); |
| | | list.add(map); |
| | | } |
| | | model.addAttribute("coursePackagePaymentConfig", JSON.toJSONString(list)); |
| | | return PREFIX + "coursePackageDiscount.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到报名列表页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/registrationRecord") |
| | | public String registrationRecord(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | return PREFIX + "registrationRecord.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到上课记录列表页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/openClassRecord") |
| | | public String openClassRecord(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(id); |
| | | TStore store = storeService.getById(tCoursePackage.getStoreId()); |
| | | Coach coach = coachClient.queryCoachById(tCoursePackage.getCoachId()); |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("store", store); |
| | | model.addAttribute("coach", coach); |
| | | return PREFIX + "classRecord.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到查看学员列表 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/openCoursePackageStudent") |
| | | public String openCoursePackageStudent(Model model, Long id){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "coursePackageStudent.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到手动预约列表 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/openManualReservation") |
| | | public String openManualReservation(Model model, Long id){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "manualReservation.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到课包审核列表页 |
| | | * @return |
| | | */ |
| | | @GetMapping("/examineCoursePackage") |
| | | public String examineCoursePackage(Model model){ |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | List<Map<String, Object>> list = storeService.queryProvince(null); |
| | | model.addAttribute("province", list); |
| | | return PREFIX + "examineCoursePackage.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到审核详情页 |
| | | * @param model |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/showExamineCoursePackageDetails") |
| | | public String showExamineCoursePackageDetails(Model model, Integer id){ |
| | | TCoursePackage tCoursePackage = coursePackageService.queryById(id); |
| | | model.addAttribute("item", tCoursePackage); |
| | | model.addAttribute("classTime", tCoursePackage.getClassStartTime() + ":00 - " + tCoursePackage.getClassEndTime() + ":00"); |
| | | String[] split = tCoursePackage.getClassWeeks().split(";"); |
| | | List<String> list5 = Arrays.asList("周一", "周二", "周三", "周四", "周五", "周六", "周日"); |
| | | List<Map<String, Object>> classWeeks = new ArrayList<>(); |
| | | for (String s : list5) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("value", s); |
| | | map.put("checked", false); |
| | | for (String s1 : split) { |
| | | if(s.equals(s1)){ |
| | | map.put("checked", true); |
| | | } |
| | | } |
| | | classWeeks.add(map); |
| | | } |
| | | model.addAttribute("classWeeks", classWeeks); |
| | | List<TCoursePackageType> tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); |
| | | model.addAttribute("coursePackageType", tCoursePackageTypes); |
| | | String cityCode = tCoursePackage.getCityCode(); |
| | | String provinceCode = tCoursePackage.getProvinceCode(); |
| | | List<Map<String, Object>> list = storeService.queryProvince(cityCode); |
| | | model.addAttribute("province", list); |
| | | List<Map<String, Object>> list1 = storeService.queryCity(provinceCode, cityCode); |
| | | model.addAttribute("city", list1); |
| | | List<TStore> list2 = storeService.list(new QueryWrapper<TStore>().eq("cityCode", cityCode).eq("state", 1)); |
| | | model.addAttribute("store", list2); |
| | | List<TSite> list3 = siteService.list(new QueryWrapper<TSite>().eq("storeId", tCoursePackage.getStoreId()).eq("state", 1)); |
| | | model.addAttribute("site", list3); |
| | | List<Coach> coaches = coachClient.queryCoachByCity(cityCode); |
| | | model.addAttribute("coach", coaches); |
| | | List<CoursePackagePaymentConfig> list4 = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); |
| | | model.addAttribute("coursePackagePaymentConfig", list4.remove(0)); |
| | | model.addAttribute("coursePackagePaymentConfigs", list4); |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = list4.get(0); |
| | | model.addAttribute("cashPayment", coursePackagePaymentConfig.getCashPayment() == 0 ? false : true); |
| | | model.addAttribute("playPaiCoin", coursePackagePaymentConfig.getPlayPaiCoin() == 0 ? false : true); |
| | | return PREFIX + "examineCoursePackage_info.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return storeService.queryCity(code, cityCode); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据城市code获取门店 |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryStore") |
| | | public List<TStore> queryStore(String cityCode){ |
| | | List<TStore> list = storeService.list(new QueryWrapper<TStore>().eq("cityCode", cityCode).eq("state", 1)); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 根据门店id获取场地 |
| | | * @param storeId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/querySite") |
| | | public List<TSite> querySite(Integer storeId){ |
| | | List<TSite> list = siteService.list(new QueryWrapper<TSite>().eq("storeId", storeId).eq("state", 1)); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取城市教练 |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryCoach") |
| | | public List<Coach> queryCoach(String cityCode){ |
| | | List<Coach> coaches = coachClient.queryCoachByCity(cityCode); |
| | | return coaches; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加课包数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addCoursePackage") |
| | | public ResultUtil addCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig){ |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | classStartTime = classStartTime.substring(0, classStartTime.lastIndexOf(":")); |
| | | classEndTime = classEndTime.substring(0, classEndTime.lastIndexOf(":")); |
| | | coursePackage.setClassStartTime(classStartTime); |
| | | coursePackage.setClassEndTime(classEndTime); |
| | | coursePackage.setAuditStatus(1); |
| | | coursePackage.setStatus(1); |
| | | coursePackage.setState(1); |
| | | coursePackage.setInsertTime(new Date()); |
| | | coursePackageService.addCoursePackage(coursePackage, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/updateCoursePackage") |
| | | public ResultUtil updateCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig){ |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | classStartTime = classStartTime.substring(0, classStartTime.lastIndexOf(":")); |
| | | classEndTime = classEndTime.substring(0, classEndTime.lastIndexOf(":")); |
| | | coursePackage.setClassStartTime(classStartTime); |
| | | coursePackage.setClassEndTime(classEndTime); |
| | | coursePackageService.updateCoursePackage(coursePackage, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据状态 |
| | | * @param id |
| | | * @param state |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/editCoursePackageState") |
| | | public ResultUtil editCoursePackageState(Integer id, Integer state){ |
| | | TCoursePackage coursePackage = new TCoursePackage(); |
| | | coursePackage.setId(id); |
| | | coursePackage.setState(state); |
| | | coursePackageService.editCoursePackageState(coursePackage); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | | * @param json |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/setCoursePackageDiscount") |
| | | public ResultUtil setCoursePackageDiscount(Integer id, String json){ |
| | | return coursePackageService.setCoursePackageDiscount(id, json); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息列表 |
| | | * @param id |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryRegistrationRecord") |
| | | public Object queryRegistrationRecord(Integer id, String userName, String studentName){ |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryRegistrationRecord(id, userName, studentName); |
| | | return super.packForBT(mapPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryClassRecord") |
| | | public Object queryClassRecord(Integer id){ |
| | | Page<Map<String, Object>> page = coursePackageService.queryCoursePackageSchedulingList(id); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据排课id获取学员预约数据列表 |
| | | * @param id |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryCoursePackageStudentList") |
| | | public Object queryCoursePackageStudentList(Long id, String userName, String studentName){ |
| | | Page<Map<String, Object>> page = coursePackageService.queryCoursePackageStudentList(id, userName, studentName); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消预约 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/cancelReservation") |
| | | public ResultUtil cancelReservation(Long id){ |
| | | return coursePackageService.cancelReservation(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改缺席状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/setAbsenceStatus") |
| | | public ResultUtil setAbsenceStatus(Long id){ |
| | | return coursePackageService.setAbsenceStatus(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消排课记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/cancelClassSchedule") |
| | | public ResultUtil cancelClassSchedule(Long id){ |
| | | return coursePackageService.cancelClassSchedule(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发布课后练习 |
| | | * @param id |
| | | * @param courseId |
| | | * @param integral |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/afterClassExercises") |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral){ |
| | | return coursePackageService.afterClassExercises(id, courseId, integral); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加消课凭证 |
| | | * @param id |
| | | * @param cancelClasses |
| | | * @param deductClassHour |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/cancellationRecord") |
| | | public ResultUtil cancellationRecord(Long id, String cancelClasses, Integer deductClassHour){ |
| | | return coursePackageService.cancellationRecord(id, cancelClasses, deductClassHour); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param coursePackageSchedulingId |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryWalkInStudentList") |
| | | public Object queryWalkInStudentList(Long coursePackageSchedulingId, String userName, String studentName){ |
| | | Page<Map<String, Object>> page = coursePackageService.queryWalkInStudentList(coursePackageSchedulingId, userName, studentName); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 手动预约课程 |
| | | * @param coursePackagePaymentId |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/courseReservation") |
| | | public ResultUtil courseReservation(Long coursePackagePaymentId, Long coursePackageSchedulingId){ |
| | | return coursePackageService.courseReservation(coursePackagePaymentId, coursePackageSchedulingId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退课操作 |
| | | * @param coursePackagePaymentId |
| | | * @param certificate |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/dropTheClass") |
| | | public ResultUtil dropTheClass(Long coursePackagePaymentId, String certificate){ |
| | | return coursePackageService.dropTheClass(coursePackagePaymentId, certificate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 补课操作 |
| | | * @param coursePackagePaymentId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/makeUpMissedLessons") |
| | | public ResultUtil makeUpMissedLessons(Long coursePackagePaymentId){ |
| | | return coursePackageService.makeUpMissedLessons(coursePackagePaymentId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param coursePackageTypeId |
| | | * @param name |
| | | * @param auditStatus |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryExamineCoursePackageLists") |
| | | public Object queryExamineCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer auditStatus){ |
| | | Page<Map<String, Object>> mapPage = coursePackageService.queryExamineCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, name, auditStatus); |
| | | return super.packForBT(mapPage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审核课包 |
| | | * @param id |
| | | * @param auditStatus |
| | | * @param authRemark |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/setCoursePackageAuditStatus") |
| | | public ResultUtil setCoursePackageAuditStatus(Integer id, Integer auditStatus, String authRemark){ |
| | | return coursePackageService.setCoursePackageAuditStatus(id, auditStatus, authRemark); |
| | | } |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.model.CoursePackageScheduling; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, Integer storeId, String name, Integer status, Integer state); |
| | | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | void addCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig); |
| | | |
| | | |
| | | /** |
| | | * 获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | TCoursePackage queryById(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | void updateCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig); |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | void editCoursePackageState(TCoursePackage coursePackage); |
| | | |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | | * @param json |
| | | * @return |
| | | */ |
| | | ResultUtil setCoursePackageDiscount(Integer id, String json); |
| | | |
| | | |
| | | /** |
| | | * 获取课程报名信息 |
| | | * @param id |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryRegistrationRecord(Integer id, String userName, String studentName); |
| | | |
| | | |
| | | /** |
| | | * 获取课包上课信息列表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryCoursePackageSchedulingList(Integer id); |
| | | |
| | | |
| | | /** |
| | | * 获取排课对应学员数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryCoursePackageStudentList(Long id, String userName, String studentName); |
| | | |
| | | |
| | | /** |
| | | * 取消学员预约数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ResultUtil cancelReservation(Long id); |
| | | |
| | | |
| | | /** |
| | | * 修改缺席状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ResultUtil setAbsenceStatus(Long id); |
| | | |
| | | |
| | | /** |
| | | * 取消本次排课数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | ResultUtil cancelClassSchedule(Long id); |
| | | |
| | | |
| | | /** |
| | | * 添加课后练习 |
| | | * @param id |
| | | * @param courseId |
| | | * @param integral |
| | | * @return |
| | | */ |
| | | ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral); |
| | | |
| | | |
| | | /** |
| | | * 上传消课凭证 |
| | | * @param id |
| | | * @param cancelClasses |
| | | * @param deductClassHour |
| | | * @return |
| | | */ |
| | | ResultUtil cancellationRecord(Long id, String cancelClasses, Integer deductClassHour); |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param coursePackageSchedulingId |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryWalkInStudentList(Long coursePackageSchedulingId, String userName, String studentName); |
| | | |
| | | |
| | | /** |
| | | * 手动预约课程 |
| | | * @param coursePackagePaymentId |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | | ResultUtil courseReservation(Long coursePackagePaymentId, Long coursePackageSchedulingId); |
| | | |
| | | |
| | | /** |
| | | * 退课操作 |
| | | * @param coursePackagePaymentId |
| | | * @param certificate |
| | | * @return |
| | | */ |
| | | ResultUtil dropTheClass(Long coursePackagePaymentId, String certificate); |
| | | |
| | | |
| | | /** |
| | | * 补课操作 |
| | | * @param coursePackagePaymentId |
| | | * @return |
| | | */ |
| | | ResultUtil makeUpMissedLessons(Long coursePackagePaymentId); |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param coursePackageTypeId |
| | | * @param name |
| | | * @param auditStatus |
| | | * @return |
| | | */ |
| | | Page<Map<String, Object>> queryExamineCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer auditStatus); |
| | | |
| | | |
| | | /** |
| | | * 审核课包 |
| | | * @param id |
| | | * @param auditStatus |
| | | * @param authRemark |
| | | * @return |
| | | */ |
| | | ResultUtil setCoursePackageAuditStatus(Integer id, Integer auditStatus, String authRemark); |
| | | } |
| | |
| | | * @param state |
| | | */ |
| | | void editCourseState(Integer id, Integer state); |
| | | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<TCourse> queryCourseByType(Integer type); |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageLists; |
| | | import com.dsh.course.feignClient.course.*; |
| | | import com.dsh.course.feignClient.course.model.*; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.support.HttpKit; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; |
| | | |
| | | @Resource |
| | | private CoursePackageDiscountClient coursePackageDiscountClient; |
| | | |
| | | @Resource |
| | | private CoursePackagePaymentClient coursePackagePaymentClient; |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingClient coursePackageSchedulingClient; |
| | | |
| | | @Resource |
| | | private CoursePackageStudentClient coursePackageStudentClient; |
| | | |
| | | @Resource |
| | | private CancelledClassesClient cancelledClassesClient; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加课包数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @Override |
| | | public void addCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig) { |
| | | Integer integer = coursePackageClient.addCoursePackage(coursePackage); |
| | | JSONArray jsonArray = JSON.parseArray(coursePackagePaymentConfig); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer classHours = jsonObject.getInteger("classHours"); |
| | | Double cashPayment = jsonObject.getDouble("cashPayment"); |
| | | Integer playPaiCoin = jsonObject.getInteger("playPaiCoin"); |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig1 = new CoursePackagePaymentConfig(); |
| | | coursePackagePaymentConfig1.setCoursePackageId(integer); |
| | | coursePackagePaymentConfig1.setClassHours(classHours); |
| | | coursePackagePaymentConfig1.setCashPayment(cashPayment); |
| | | coursePackagePaymentConfig1.setPlayPaiCoin(playPaiCoin); |
| | | coursePackagePaymentConfigClient.addCoursePackagePaymentConfig(coursePackagePaymentConfig1); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TCoursePackage queryById(Integer id) { |
| | | return coursePackageClient.queryById(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * @param coursePackage |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @Override |
| | | public void updateCoursePackage(TCoursePackage coursePackage, String coursePackagePaymentConfig) { |
| | | coursePackageClient.updateCoursePackage(coursePackage); |
| | | coursePackagePaymentConfigClient.delCoursePackagePaymentConfig(coursePackage.getId()); |
| | | JSONArray jsonArray = JSON.parseArray(coursePackagePaymentConfig); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer classHours = jsonObject.getInteger("classHours"); |
| | | Double cashPayment = jsonObject.getDouble("cashPayment"); |
| | | Integer playPaiCoin = jsonObject.getInteger("playPaiCoin"); |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig1 = new CoursePackagePaymentConfig(); |
| | | coursePackagePaymentConfig1.setCoursePackageId(coursePackage.getId()); |
| | | coursePackagePaymentConfig1.setClassHours(classHours); |
| | | coursePackagePaymentConfig1.setCashPayment(cashPayment); |
| | | coursePackagePaymentConfig1.setPlayPaiCoin(playPaiCoin); |
| | | coursePackagePaymentConfigClient.addCoursePackagePaymentConfig(coursePackagePaymentConfig1); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * @param coursePackage |
| | | */ |
| | | @Override |
| | | public void editCoursePackageState(TCoursePackage coursePackage) { |
| | | coursePackageClient.updateCoursePackage(coursePackage); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | | * @param json |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil setCoursePackageDiscount(Integer id, String json) { |
| | | List<TCoursePackageDiscount> list = new ArrayList<>(); |
| | | JSONArray jsonArray = JSON.parseArray(json); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer coursePackagePaymentConfigId = jsonObject.getInteger("coursePackagePaymentConfigId"); |
| | | JSONArray coursePackageDiscount = jsonObject.getJSONArray("coursePackageDiscount"); |
| | | if(coursePackageDiscount.size() == 0){ |
| | | continue; |
| | | } |
| | | for (int j = 0; j < coursePackageDiscount.size(); j++) { |
| | | JSONObject cpd = coursePackageDiscount.getJSONObject(j); |
| | | Integer type = cpd.getInteger("type"); |
| | | switch (type){ |
| | | case 1: |
| | | JSONObject content1 = cpd.getJSONObject("content"); |
| | | if(null == content1){ |
| | | return ResultUtil.error("请填写有效的会员折扣"); |
| | | } |
| | | Double discountMember = content1.getDouble("discountMember"); |
| | | if(null == discountMember){ |
| | | return ResultUtil.error("请填写有效的会员折扣价格"); |
| | | } |
| | | break; |
| | | case 2: |
| | | JSONObject content2 = cpd.getJSONObject("content"); |
| | | if(null == content2){ |
| | | return ResultUtil.error("请填写有效的续课优惠"); |
| | | } |
| | | Double continuingMember = content2.getDouble("continuingMember"); |
| | | if(null == continuingMember){ |
| | | return ResultUtil.error("请填写有效的会员续课价格"); |
| | | } |
| | | Double continuingUser = content2.getDouble("continuingUser"); |
| | | if(null == continuingUser){ |
| | | return ResultUtil.error("请填写有效的用户续课价格"); |
| | | } |
| | | break; |
| | | case 3: |
| | | JSONArray content3 = cpd.getJSONArray("content"); |
| | | if(content3.size() == 0){ |
| | | return ResultUtil.error("请配置有效的限时折扣"); |
| | | } |
| | | for (int k = 0; k < content3.size(); k++) { |
| | | JSONObject jsonObject1 = content3.getJSONObject(k); |
| | | String startDate = jsonObject1.getString("startDate"); |
| | | String endDate = jsonObject1.getString("endDate"); |
| | | String startTime = jsonObject1.getString("startTime"); |
| | | String endTime = jsonObject1.getString("endTime"); |
| | | JSONArray weeks = jsonObject1.getJSONArray("weeks"); |
| | | Double cashPayment = jsonObject1.getDouble("cashPayment"); |
| | | if(ToolUtil.isEmpty(startDate)){ |
| | | return ResultUtil.error("请填写有效的折扣有效期"); |
| | | } |
| | | if(ToolUtil.isEmpty(endDate)){ |
| | | return ResultUtil.error("请填写有效的折扣有效期"); |
| | | } |
| | | if(ToolUtil.isEmpty(startTime)){ |
| | | return ResultUtil.error("请填写有效的折扣时间"); |
| | | } |
| | | if(ToolUtil.isEmpty(endTime)){ |
| | | return ResultUtil.error("请填写有效的折扣时间"); |
| | | } |
| | | if(null == weeks || weeks.size() == 0){ |
| | | return ResultUtil.error("请选择有效的折扣时间星期天"); |
| | | } |
| | | if(null == cashPayment){ |
| | | return ResultUtil.error("请填写有效的折扣金额"); |
| | | } |
| | | } |
| | | break; |
| | | case 4: |
| | | JSONArray content4 = cpd.getJSONArray("content"); |
| | | if(content4.size() == 0){ |
| | | return ResultUtil.error("请配置有效的赠送课时"); |
| | | } |
| | | for (int k = 0; k < content4.size(); k++) { |
| | | JSONObject jsonObject1 = content4.getJSONObject(k); |
| | | String startDate = jsonObject1.getString("startDate"); |
| | | String endDate = jsonObject1.getString("endDate"); |
| | | String startTime = jsonObject1.getString("startTime"); |
| | | String endTime = jsonObject1.getString("endTime"); |
| | | JSONArray weeks = jsonObject1.getJSONArray("weeks"); |
| | | Double hour = jsonObject1.getDouble("hour"); |
| | | if(ToolUtil.isEmpty(startDate)){ |
| | | return ResultUtil.error("请填写有效的赠送有效期"); |
| | | } |
| | | if(ToolUtil.isEmpty(endDate)){ |
| | | return ResultUtil.error("请填写有效的赠送有效期"); |
| | | } |
| | | if(ToolUtil.isEmpty(startTime)){ |
| | | return ResultUtil.error("请填写有效的赠送时间"); |
| | | } |
| | | if(ToolUtil.isEmpty(endTime)){ |
| | | return ResultUtil.error("请填写有效的赠送时间"); |
| | | } |
| | | if(null == weeks || weeks.size() == 0){ |
| | | return ResultUtil.error("请选择有效的赠送时间星期天"); |
| | | } |
| | | if(null == hour){ |
| | | return ResultUtil.error("请填写有效的赠送课时数"); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | TCoursePackageDiscount coursePackageDiscount1 = new TCoursePackageDiscount(); |
| | | coursePackageDiscount1.setCoursePackageId(id); |
| | | coursePackageDiscount1.setCoursePackagePaymentConfigId(coursePackagePaymentConfigId); |
| | | coursePackageDiscount1.setType(type); |
| | | coursePackageDiscount1.setContent(cpd.getString("content")); |
| | | coursePackageDiscount1.setAuditStatus(2); |
| | | coursePackageDiscount1.setInsertTime(new Date()); |
| | | list.add(coursePackageDiscount1); |
| | | } |
| | | } |
| | | coursePackageDiscountClient.setCoursePackageDiscount(list); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课程报名信息 |
| | | * @param id |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryRegistrationRecord(Integer id, String userName, String studentName) { |
| | | QueryRegistrationRecord queryRegistrationRecord = new QueryRegistrationRecord(); |
| | | queryRegistrationRecord.setCoursePackageId(id); |
| | | queryRegistrationRecord.setUserName(userName); |
| | | queryRegistrationRecord.setStudentName(studentName); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryRegistrationRecord.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryRegistrationRecord.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryRegistrationRecord.setSort(request.getParameter("sort")); |
| | | queryRegistrationRecord.setOrder(request.getParameter("order")); |
| | | Page<Map<String, Object>> mapPage = coursePackagePaymentClient.queryRegistrationRecord(queryRegistrationRecord); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包上课信息 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryCoursePackageSchedulingList(Integer id) { |
| | | QueryCoursePackageSchedulingList queryClassRecord = new QueryCoursePackageSchedulingList(); |
| | | queryClassRecord.setCoursePackageId(id); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryClassRecord.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryClassRecord.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryClassRecord.setSort(request.getParameter("sort")); |
| | | queryClassRecord.setOrder(request.getParameter("order")); |
| | | Page<Map<String, Object>> mapPage = coursePackageSchedulingClient.queryCoursePackageSchedulingList(queryClassRecord); |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取排课对应学员数据 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryCoursePackageStudentList(Long id, String userName, String studentName) { |
| | | QueryCoursePackageStudentList queryCoursePackageStudentList = new QueryCoursePackageStudentList(); |
| | | queryCoursePackageStudentList.setCoursePackageSchedulingId(id); |
| | | queryCoursePackageStudentList.setUserName(userName); |
| | | queryCoursePackageStudentList.setStudentName(studentName); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryCoursePackageStudentList.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryCoursePackageStudentList.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCoursePackageStudentList.setSort(request.getParameter("sort")); |
| | | queryCoursePackageStudentList.setOrder(request.getParameter("order")); |
| | | return coursePackageStudentClient.queryCoursePackageStudentList(queryCoursePackageStudentList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消预约 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil cancelReservation(Long id) { |
| | | CoursePackageStudent coursePackageStudent = coursePackageStudentClient.queryCoursePackageStudentById(id); |
| | | if(coursePackageStudent.getSignInOrNot() == 1){ |
| | | return ResultUtil.error("无法取消预约"); |
| | | } |
| | | coursePackageStudent = new CoursePackageStudent(); |
| | | coursePackageStudent.setId(id); |
| | | coursePackageStudent.setReservationStatus(0); |
| | | coursePackageStudentClient.editCoursePackageStudent(coursePackageStudent); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改缺席状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil setAbsenceStatus(Long id) { |
| | | CoursePackageStudent coursePackageStudent = coursePackageStudentClient.queryCoursePackageStudentById(id); |
| | | if(coursePackageStudent.getReservationStatus() == 0){ |
| | | return ResultUtil.error("该数据已取消预约"); |
| | | } |
| | | coursePackageStudent = new CoursePackageStudent(); |
| | | coursePackageStudent.setId(id); |
| | | coursePackageStudent.setSignInOrNot(0); |
| | | coursePackageStudentClient.editCoursePackageStudent(coursePackageStudent); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消本次排课 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil cancelClassSchedule(Long id) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | if(coursePackageScheduling.getStatus() != 1){ |
| | | return ResultUtil.error("不能取消本次"); |
| | | } |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(id); |
| | | if(coursePackageStudents.size() > 0){ |
| | | return ResultUtil.error("不能取消本次"); |
| | | } |
| | | coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setId(id); |
| | | coursePackageScheduling.setStatus(4); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加课后练习 |
| | | * @param id |
| | | * @param courseId |
| | | * @param integral |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | if(coursePackageScheduling.getStatus() != 3){ |
| | | return ResultUtil.error("不能发布课后练习"); |
| | | } |
| | | coursePackageScheduling.setCourseId(courseId); |
| | | coursePackageScheduling.setIntegral(integral); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上传消课凭证 |
| | | * @param id |
| | | * @param cancelClasses |
| | | * @param deductClassHour |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil cancellationRecord(Long id, String cancelClasses, Integer deductClassHour) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | if(coursePackageScheduling.getStatus() == 1 || coursePackageScheduling.getStatus() == 4){ |
| | | return ResultUtil.error("不能添加消课凭证"); |
| | | } |
| | | coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(id); |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudents) { |
| | | if(coursePackageStudent.getReservationStatus() == 0){ |
| | | continue; |
| | | } |
| | | TCoursePackagePayment tCoursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackageStudent.getCoursePackagePaymentId()); |
| | | tCoursePackagePayment.setLaveClassHours(tCoursePackagePayment.getLaveClassHours() - deductClassHour); |
| | | if(coursePackageStudent.getSignInOrNot() == 0){ |
| | | tCoursePackagePayment.setAbsencesNumber(tCoursePackagePayment.getAbsencesNumber() + 1); |
| | | } |
| | | coursePackagePaymentClient.editCoursePackagePayment(tCoursePackagePayment); |
| | | |
| | | CancelledClasses cancelledClasses = new CancelledClasses(); |
| | | cancelledClasses.setType(1); |
| | | cancelledClasses.setCoursePackageId(coursePackageStudent.getCoursePackageId()); |
| | | cancelledClasses.setCoursePackagePaymentId(coursePackageStudent.getCoursePackagePaymentId()); |
| | | cancelledClasses.setCoursePackageSchedulingId(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | cancelledClasses.setVoucher(cancelClasses); |
| | | cancelledClasses.setCancelledClassesNumber(deductClassHour); |
| | | cancelledClasses.setInsertTime(new Date()); |
| | | cancelledClassesClient.addCancelledClasses(cancelledClasses); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * @param coursePackageSchedulingId |
| | | * @param userName |
| | | * @param studentName |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryWalkInStudentList(Long coursePackageSchedulingId, String userName, String studentName) { |
| | | QueryWalkInStudentList queryWalkInStudentList = new QueryWalkInStudentList(); |
| | | queryWalkInStudentList.setCoursePackageSchedulingId(coursePackageSchedulingId); |
| | | queryWalkInStudentList.setUserName(userName); |
| | | queryWalkInStudentList.setStudentName(studentName); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryWalkInStudentList.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryWalkInStudentList.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryWalkInStudentList.setSort(request.getParameter("sort")); |
| | | queryWalkInStudentList.setOrder(request.getParameter("order")); |
| | | return coursePackagePaymentClient.queryWalkInStudentList(queryWalkInStudentList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 手动预约课程 |
| | | * @param coursePackagePaymentId |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil courseReservation(Long coursePackagePaymentId, Long coursePackageSchedulingId) { |
| | | QueryCoursePackageStudent queryCoursePackageStudent = new QueryCoursePackageStudent(); |
| | | queryCoursePackageStudent.setCoursePackagePaymentId(coursePackagePaymentId); |
| | | queryCoursePackageStudent.setCoursePackageSchedulingId(coursePackageSchedulingId); |
| | | queryCoursePackageStudent.setReservationStatus(1); |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryCoursePackageStudent(queryCoursePackageStudent); |
| | | if(coursePackageStudents.size() > 0){ |
| | | return ResultUtil.error("不能重复预约"); |
| | | } |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(coursePackageSchedulingId); |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(coursePackageScheduling.getCoursePackageId()); |
| | | queryCoursePackageStudent = new QueryCoursePackageStudent(); |
| | | queryCoursePackageStudent.setCoursePackageId(coursePackageScheduling.getCoursePackageId()); |
| | | queryCoursePackageStudent.setReservationStatus(1); |
| | | List<CoursePackageStudent> coursePackageStudents1 = coursePackageStudentClient.queryCoursePackageStudent(queryCoursePackageStudent); |
| | | if(coursePackageStudents1.size() >= tCoursePackage.getMaxSubscribeNumber()){ |
| | | return ResultUtil.error("已达到最多预约人数"); |
| | | } |
| | | |
| | | TCoursePackagePayment coursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackagePaymentId); |
| | | CoursePackageStudent coursePackageStudent = new CoursePackageStudent(); |
| | | coursePackageStudent.setAppUserId(coursePackagePayment.getAppUserId()); |
| | | coursePackageStudent.setStudentId(coursePackagePayment.getStudentId()); |
| | | coursePackageStudent.setCoursePackageId(coursePackagePayment.getCoursePackageId()); |
| | | coursePackageStudent.setCoursePackagePaymentId(coursePackagePaymentId); |
| | | coursePackageStudent.setCoursePackageSchedulingId(coursePackageSchedulingId); |
| | | coursePackageStudent.setSignInOrNot(1); |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(new Date()); |
| | | coursePackageStudentClient.addCoursePackageStudent(coursePackageStudent); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退课操作 |
| | | * @param coursePackagePaymentId |
| | | * @param certificate |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil dropTheClass(Long coursePackagePaymentId, String certificate) { |
| | | TCoursePackagePayment coursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackagePaymentId); |
| | | if(coursePackagePayment.getStatus() == 2){ |
| | | return ResultUtil.error("不能重复操作"); |
| | | } |
| | | coursePackagePayment.setStatus(2); |
| | | coursePackagePayment.setCertificate(certificate); |
| | | coursePackagePayment.setWithdrawalTime(new Date()); |
| | | //修改课时,费用线下自己处理不走线上 |
| | | Integer laveClassHours = coursePackagePayment.getLaveClassHours(); |
| | | if(laveClassHours == 0){ |
| | | return ResultUtil.error("无可退数量"); |
| | | } |
| | | coursePackagePayment.setDropoutsNumber(laveClassHours); |
| | | coursePackagePayment.setLaveClassHours(0); |
| | | coursePackagePaymentClient.editCoursePackagePayment(coursePackagePayment); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 补课操作 |
| | | * @param coursePackagePaymentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil makeUpMissedLessons(Long coursePackagePaymentId) { |
| | | TCoursePackagePayment coursePackagePayment = coursePackagePaymentClient.queryCoursePackagePaymentById(coursePackagePaymentId); |
| | | if(coursePackagePayment.getStatus() == 2){ |
| | | return ResultUtil.error("该学员已退课"); |
| | | } |
| | | if(coursePackagePayment.getAbsencesNumber() == 0){ |
| | | return ResultUtil.error("当前不需要补课"); |
| | | } |
| | | coursePackagePayment.setAbsencesNumber(coursePackagePayment.getAbsencesNumber() - 1); |
| | | coursePackagePaymentClient.editCoursePackagePayment(coursePackagePayment); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param coursePackageTypeId |
| | | * @param name |
| | | * @param auditStatus |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryExamineCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer auditStatus) { |
| | | QueryExamineCoursePackageLists queryExamineCoursePackageLists = new QueryExamineCoursePackageLists(); |
| | | queryExamineCoursePackageLists.setProvinceCode(provinceCode); |
| | | queryExamineCoursePackageLists.setCityCode(cityCode); |
| | | queryExamineCoursePackageLists.setCoursePackageTypeId(coursePackageTypeId); |
| | | queryExamineCoursePackageLists.setName(name); |
| | | queryExamineCoursePackageLists.setAuditStatus(auditStatus); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryExamineCoursePackageLists.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryExamineCoursePackageLists.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryExamineCoursePackageLists.setSort(request.getParameter("sort")); |
| | | queryExamineCoursePackageLists.setOrder(request.getParameter("order")); |
| | | Page<Map<String, Object>> mapPage = coursePackageClient.queryExamineCoursePackageLists(queryExamineCoursePackageLists); |
| | | List<Map<String, Object>> records = mapPage.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | | TStore store = storeService.getById(Integer.valueOf(record.get("storeId").toString())); |
| | | record.put("store", store.getName()); |
| | | } |
| | | return mapPage; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 审核课包 |
| | | * @param id |
| | | * @param auditStatus |
| | | * @param authRemark |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil setCoursePackageAuditStatus(Integer id, Integer auditStatus, String authRemark) { |
| | | TCoursePackage tCoursePackage = coursePackageClient.queryById(id); |
| | | if(tCoursePackage.getAuditStatus() != 1){ |
| | | return ResultUtil.error("不能重复审核"); |
| | | } |
| | | tCoursePackage.setAuditStatus(auditStatus); |
| | | tCoursePackage.setAuditUserId(UserExt.getUser().getId()); |
| | | tCoursePackage.setAuthRemark(authRemark); |
| | | coursePackageClient.updateCoursePackage(tCoursePackage); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | |
| | | editCourseState.setState(state); |
| | | courseClient.editCourseState(editCourseState); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * @param type |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TCourse> queryCourseByType(Integer type) { |
| | | return courseClient.queryCourseByType(type); |
| | | } |
| | | } |
| | |
| | | }) |
| | | }); |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> |
| | | @} |
| | | |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/static/js/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/course/course.js"></script> |
| | | <script src="${ctxPath}/js/layui/layui.js" charset="utf-8"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <h3>课包信息</h3> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-group" style="height: 10px;"> |
| | | <label class="col-sm-1 control-label" style="text-align: right;">所属门店:</label> |
| | | <span class="col-sm-2" style="text-align: left;">${store.name}</span> |
| | | </div> |
| | | <div class="form-group" style="height: 10px;"> |
| | | <label class="col-sm-1 control-label" style="text-align: right;">课包名称:</label> |
| | | <span class="col-sm-1" style="text-align: left;" id="name">${item.name}</span> |
| | | </div> |
| | | <div class="form-group" style="height: 10px;"> |
| | | <label class="col-sm-1 control-label" style="text-align: right;">授课教师:</label> |
| | | <span class="col-sm-2" style="text-align: left;">${coach.name}</span> |
| | | </div> |
| | | <div class="form-group" style="height: 10px;"> |
| | | <label class="col-sm-1 control-label" style="text-align: right;">上课时间:</label> |
| | | <span class="col-sm-2" style="text-align: left;">${item.classWeeks}</span> |
| | | </div> |
| | | <div class="form-group" style="height: 10px;"> |
| | | <label class="col-sm-1 control-label" style="text-align: right;"></label> |
| | | <span class="col-sm-2" style="text-align: left;">${item.classStartTime + ' - ' + item.classEndTime}</span> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="managerTableToolbar" role="group"> |
| | | <#button name="查看学员" icon="fa-plus" clickFun="ClassRecord.classRecord()"/> |
| | | <#button name="取消本次" icon="fa-edit" clickFun="ClassRecord.cancelClassSchedule()" space="true"/> |
| | | <#button name="发布课后练习" icon="fa-refresh" clickFun="ClassRecord.afterClassExercises()" space="true"/> |
| | | <#button name="上传消课记录" icon="fa-refresh" clickFun="ClassRecord.cancellationRecord()" space="true"/> |
| | | <#button name="查看消课记录" icon="fa-refresh" clickFun="ClassRecord.lookCancellationRecord()" space="true"/> |
| | | <#button name="手动预约" icon="fa-refresh" clickFun="ClassRecord.manualReservation()" space="true"/> |
| | | </div> |
| | | <#table id="managerTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/classRecord.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/static/js/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | |
| | | <#button name="下架" icon="fa-warning" clickFun="CoursePackage.editCoursePackageState(2)" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/coursePackage/coursePackageDiscount")){ |
| | | <#button name="折扣管理" icon="fa-check-circle" clickFun="CoursePackage.detailsCoursePackage()" space="true"/> |
| | | <#button name="折扣管理" icon="fa-check-circle" clickFun="CoursePackage.coursePackageDiscount()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/coursePackage/detailsCoursePackage")){ |
| | | <#button name="详情" icon="fa-check-circle" clickFun="CoursePackage.detailsCoursePackage()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/coursePackage/registrationRecord")){ |
| | | <#button name="报名信息" icon="fa-check-circle" clickFun="CoursePackage.detailsCoursePackage()" space="true"/> |
| | | <#button name="报名信息" icon="fa-check-circle" clickFun="CoursePackage.registrationRecord()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="managerTable"/> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackage.js"></script> |
| | | <script src="${ctxPath}/js/layui/layui.js" charset="utf-8"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <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>${item.name}</span> |
| | | </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> |
| | | </div> |
| | | <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 id="payment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <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 id="cashPayment"></span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <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-6" id="types" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="type" value="1"> 会员折扣 |
| | | <input type="checkbox" name="type" value="2"> 续课优惠 |
| | | <input type="checkbox" name="type" value="3"> 限时折扣 |
| | | <input type="checkbox" name="type" value="4"> 赠送课时 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="memberDiscount"> |
| | | |
| | | </div> |
| | | <div id="renewalOffer"> |
| | | |
| | | </div> |
| | | <div id="limitedTimeDiscount"> |
| | | |
| | | </div> |
| | | <div id="complimentaryClass"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageDiscount.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageDiscount.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackageDiscount.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input type="hidden" id="id" value="${id}"> |
| | | <div class="row"> |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="userName" name="所属用户"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="studentName" name="姓名"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 col-sm-3"> |
| | | <div class="row"> |
| | | <div class="col-lg-12 col-sm-12"> |
| | | <#button name="搜索" icon="fa-search" clickFun="CoursePackageStudent.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="CoursePackageStudent.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="managerTableToolbar" role="group"> |
| | | <#button name="取消预约" icon="fa-plus" clickFun="CoursePackageStudent.cancelReservation()"/> |
| | | <#button name="未到" icon="fa-edit" clickFun="CoursePackageStudent.absence()" space="true"/> |
| | | </div> |
| | | <#table id="managerTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackageStudent.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | @} |
| | |
| | | <label class="col-sm-3 control-label">*授课教师:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coachId" name="coachId"> |
| | | <option value="">请选择</option> |
| | | @for(obj in coach){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*最多预约人数:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" type="number" min="0"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" type="number" min="0" placeholder="请输入最多预约人数"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">课程简介:</label> |
| | | <label class="col-sm-3 control-label">*上课时间:</label> |
| | | <div class="col-sm-4"> |
| | | <textarea class="form-control" id="introduce" name="introduce" style="height: 200px;"></textarea> |
| | | <input class="form-control" id="classStartTime" name="classStartTime" placeholder="请选择"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程封面</label> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-8"> |
| | | <input type="checkbox" name="classWeeks" value="周一"> 周一 |
| | | <input type="checkbox" name="classWeeks" value="周二"> 周二 |
| | | <input type="checkbox" name="classWeeks" value="周三"> 周三 |
| | | <input type="checkbox" name="classWeeks" value="周四"> 周四 |
| | | <input type="checkbox" name="classWeeks" value="周五"> 周五 |
| | | <input type="checkbox" name="classWeeks" value="周六"> 周六 |
| | | <input type="checkbox" name="classWeeks" value="周日"> 周日 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包封面:</label> |
| | | <div class="col-sm-4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*列表页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="coverDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${ctxPath}/img/NoPIC.png"></div> |
| | |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:340 x 254px</label> |
| | | <label>推荐像素:210x280px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程介绍</label> |
| | | <label class="col-sm-3 control-label head-scu-label">*详情页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introductionDrawingPreId"> |
| | | <div id="detailDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${ctxPath}/img/NoPIC.png"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="introductionDrawingBtnId"> |
| | | <div class="head-scu-btn upload-btn" id="detailDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="introductionDrawing" value=""/> |
| | | <input type="hidden" id="detailDrawing" value=""/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780px</label> |
| | | <label>推荐像素:780x440px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课程内容</label> |
| | | <div class="col-sm-2" style="padding-top: 30px;"> |
| | | <input type="file" id="upFile" name="upFile" style="display: none"> |
| | | <input class="form-control" id="courseVideo" readonly/> |
| | | <label class="col-sm-3 control-label head-scu-label">*课包介绍</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introduceDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${ctxPath}/img/NoPIC.png"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2" style="padding-top: 30px;"> |
| | | <button class="btn btn-outline btn-success" type="file" onclick="UploadFileFn()"><i class="fa fa-upload"></i>上传视频</button> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="introduceDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="introduceDrawing" value=""/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780x</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="sort" name="sort" type="number" placeholder="请输入排序"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | <h3>课时设置</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="payType" value="1"> 现金 |
| | | <input type="checkbox" name="payType" value="2"> 玩湃币 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时有效期:</label> |
| | | <div class="col-sm-4"> |
| | | 购买后 <input id="validDays" name="validDays" type="number" min="0" placeholder="天数" style="width: 80px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 天内有效 |
| | | </div> |
| | | </div> |
| | | <div id="price"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> |
| | | <span class="cash_span"></span> |
| | | <span class="paiCoin_span"></span> |
| | | <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice()"></i> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CourseInfo.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CourseInfo.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/course/course_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackage_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | var avatarUp = new $WebUpload("coverDrawing"); |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introductionDrawing"); |
| | | var avatarUp1 = new $WebUpload("detailDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introduceDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="provinceCode" name="provinceCode"> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}" ${item.provinceCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="cityCode" name="cityCode"> |
| | | @for(obj in city){ |
| | | <option value="${obj.code}" ${item.cityCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所属门店:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="storeId" name="storeId"> |
| | | @for(obj in store){ |
| | | <option value="${obj.id}" ${item.storeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课程类型:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coursePackageTypeId" name="coursePackageTypeId"> |
| | | @for(obj in coursePackageType){ |
| | | <option value="${obj.id}" ${item.coursePackageTypeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包名称:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="name" name="name" value="${item.name}"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId"> |
| | | @for(obj in site){ |
| | | <option value="${obj.id}" ${item.siteId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*授课教师:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coachId" name="coachId"> |
| | | <option value="">请选择</option> |
| | | @for(obj in coach){ |
| | | <option value="${obj.id}" ${item.coachId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*最多预约人数:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" value="${item.maxSubscribeNumber}" type="number" min="0" placeholder="请输入最多预约人数"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="classStartTime" name="classStartTime" value="${classTime}" placeholder="请选择"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-8"> |
| | | @for(obj in classWeeks){ |
| | | <input type="checkbox" name="classWeeks" value="${obj.value}" ${obj.checked ? 'checked' : ''}> ${obj.value} |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包封面:</label> |
| | | <div class="col-sm-4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*列表页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="coverDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.coverDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="coverDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="coverDrawing" value="${item.coverDrawing}"/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:210x280px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*详情页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="detailDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.detailDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="detailDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="detailDrawing" value="${item.detailDrawing}"/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:780x440px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课包介绍</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introduceDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.introduceDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <div class="head-scu-btn upload-btn" id="introduceDrawingBtnId"> |
| | | <i class="fa fa-upload"></i> 上传 |
| | | </div> |
| | | </div> |
| | | <input type="hidden" id="introduceDrawing" value="${item.introduceDrawing}"/> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780x</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="sort" name="sort" value="${item.sort}" type="number" placeholder="请输入排序"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | <h3>课时设置</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="payType" value="1" ${cashPayment ? 'checked' : ''}> 现金 |
| | | <input type="checkbox" name="payType" value="2" ${playPaiCoin ? 'checked' : ''}> 玩湃币 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时有效期:</label> |
| | | <div class="col-sm-4"> |
| | | 购买后 <input id="validDays" name="validDays" type="number" value="${item.validDays}" min="0" placeholder="天数" style="width: 80px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 天内有效 |
| | | </div> |
| | | </div> |
| | | <div id="price"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${coursePackagePaymentConfig.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${coursePackagePaymentConfig.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${coursePackagePaymentConfig.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币 |
| | | @} |
| | | </span> |
| | | <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice()"></i> |
| | | </div> |
| | | </div> |
| | | @for(obj in coursePackagePaymentConfigs){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${obj.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${obj.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${obj.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币 |
| | | @} |
| | | </span> |
| | | <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice(4, this)"></i> |
| | | </div> |
| | | </div> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackage_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#classStartTime' |
| | | ,type: 'time' |
| | | ,range: true |
| | | }); |
| | | var avatarUp = new $WebUpload("coverDrawing"); |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("detailDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | |
| | | var avatarUp1 = new $WebUpload("introduceDrawing"); |
| | | avatarUp1.setUploadBarId("progressBar"); |
| | | avatarUp1.init(); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="provinceCode" name="provinceCode" disabled> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}" ${item.provinceCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="cityCode" name="cityCode" disabled> |
| | | @for(obj in city){ |
| | | <option value="${obj.code}" ${item.cityCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所属门店:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="storeId" name="storeId" disabled> |
| | | @for(obj in store){ |
| | | <option value="${obj.id}" ${item.storeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课程类型:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coursePackageTypeId" name="coursePackageTypeId" disabled> |
| | | @for(obj in coursePackageType){ |
| | | <option value="${obj.id}" ${item.coursePackageTypeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包名称:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="name" name="name" value="${item.name}" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId" disabled> |
| | | @for(obj in site){ |
| | | <option value="${obj.id}" ${item.siteId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*授课教师:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coachId" name="coachId" disabled> |
| | | <option value="">请选择</option> |
| | | @for(obj in coach){ |
| | | <option value="${obj.id}" ${item.coachId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*最多预约人数:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" value="${item.maxSubscribeNumber}" type="number" min="0" placeholder="请输入最多预约人数" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="classStartTime" name="classStartTime" value="${classTime}" placeholder="请选择" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-8"> |
| | | @for(obj in classWeeks){ |
| | | <input type="checkbox" name="classWeeks" value="${obj.value}" ${obj.checked ? 'checked' : ''}> ${obj.value} |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包封面:</label> |
| | | <div class="col-sm-4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*列表页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="coverDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.coverDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:210x280px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*详情页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="detailDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.detailDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:780x440px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课包介绍</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introduceDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.introduceDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780x</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="sort" name="sort" value="${item.sort}" type="number" placeholder="请输入排序"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | <h3>课时设置</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="payType" value="1" ${cashPayment ? 'checked' : ''}> 现金 |
| | | <input type="checkbox" name="payType" value="2" ${playPaiCoin ? 'checked' : ''}> 玩湃币 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时有效期:</label> |
| | | <div class="col-sm-4"> |
| | | 购买后 <input id="validDays" name="validDays" type="number" value="${item.validDays}" min="0" placeholder="天数" style="width: 80px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 天内有效 |
| | | </div> |
| | | </div> |
| | | <div id="price"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${coursePackagePaymentConfig.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${coursePackagePaymentConfig.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${coursePackagePaymentConfig.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 币 |
| | | @} |
| | | </span> |
| | | </div> |
| | | </div> |
| | | @for(obj in coursePackagePaymentConfigs){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${obj.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${obj.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${obj.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 币 |
| | | @} |
| | | </span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/coursePackage_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>课包审核</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="provinceCode" name="所在省"> |
| | | <option value="">全部</option> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="cityCode" name="所在市"> |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="coursePackageTypeId" name="课包类型"> |
| | | <option value="">全部</option> |
| | | @for(obj in coursePackageType){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="name" name="课包名称"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#SelectCon id="auditStatus" name="审核状态"> |
| | | <option value="">全部</option> |
| | | <option value="1">待审核</option> |
| | | <option value="3">未通过</option> |
| | | </#SelectCon> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 col-sm-3"> |
| | | <div class="row"> |
| | | <div class="col-lg-12 col-sm-12"> |
| | | <#button name="搜索" icon="fa-search" clickFun="ExamineCoursePackage.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="ExamineCoursePackage.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="managerTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/coursePackage/examineCoursePackage")){ |
| | | <#button name="审核" icon="fa-plus" clickFun="ExamineCoursePackage.examineCoursePackage()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/coursePackage/detailsExamineCoursePackage")){ |
| | | <#button name="详情" icon="fa-check-circle" clickFun="ExamineCoursePackage.detailsExamineCoursePackage()" space="true"/> |
| | | @} |
| | | </div> |
| | | <#table id="managerTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/examineCoursePackage.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">当前状态:</label> |
| | | <div class="col-sm-4"> |
| | | @if(item.auditStatus == 1){ |
| | | <span style="color: #D99A0D;">待审核</span> |
| | | @} |
| | | @if(item.auditStatus == 3){ |
| | | <span style="color: #F11B1B;">未通过</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在省:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="provinceCode" name="provinceCode" disabled> |
| | | @for(obj in province){ |
| | | <option value="${obj.code}" ${item.provinceCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所在市:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="cityCode" name="cityCode" disabled> |
| | | @for(obj in city){ |
| | | <option value="${obj.code}" ${item.cityCode == obj.code ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所属门店:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="storeId" name="storeId" disabled> |
| | | @for(obj in store){ |
| | | <option value="${obj.id}" ${item.storeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课程类型:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coursePackageTypeId" name="coursePackageTypeId" disabled> |
| | | @for(obj in coursePackageType){ |
| | | <option value="${obj.id}" ${item.coursePackageTypeId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包名称:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="name" name="name" value="${item.name}" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课场地:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="siteId" name="siteId" disabled> |
| | | @for(obj in site){ |
| | | <option value="${obj.id}" ${item.siteId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*授课教师:</label> |
| | | <div class="col-sm-4"> |
| | | <select class="form-control" id="coachId" name="coachId" disabled> |
| | | <option value="">请选择</option> |
| | | @for(obj in coach){ |
| | | <option value="${obj.id}" ${item.coachId == obj.id ? 'selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*最多预约人数:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="maxSubscribeNumber" name="maxSubscribeNumber" value="${item.maxSubscribeNumber}" type="number" min="0" placeholder="请输入最多预约人数" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*上课时间:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="classStartTime" name="classStartTime" value="${classTime}" placeholder="请选择" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label"></label> |
| | | <div class="col-sm-8"> |
| | | @for(obj in classWeeks){ |
| | | <input type="checkbox" name="classWeeks" value="${obj.value}" ${obj.checked ? 'checked' : ''}> ${obj.value} |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课包封面:</label> |
| | | <div class="col-sm-4"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*列表页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="coverDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.coverDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:210x280px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*详情页</label> |
| | | <div class="col-sm-2"> |
| | | <div id="detailDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.detailDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:780x440px</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*课包介绍</label> |
| | | <div class="col-sm-2"> |
| | | <div id="introduceDrawingPreId"> |
| | | <div><img width="100px" height="100px" src="${item.introduceDrawing}"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label"></label> |
| | | <label>推荐像素:宽780x</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-4"> |
| | | <input class="form-control" id="sort" name="sort" value="${item.sort}" type="number" placeholder="请输入排序"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | <h3>课时设置</h3> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*支付方式:</label> |
| | | <div class="col-sm-4" style="margin-top: 6px;"> |
| | | <input type="checkbox" name="payType" value="1" ${cashPayment ? 'checked' : ''}> 现金 |
| | | <input type="checkbox" name="payType" value="2" ${playPaiCoin ? 'checked' : ''}> 玩湃币 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时有效期:</label> |
| | | <div class="col-sm-4"> |
| | | 购买后 <input id="validDays" name="validDays" type="number" value="${item.validDays}" min="0" placeholder="天数" style="width: 80px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 天内有效 |
| | | </div> |
| | | </div> |
| | | <div id="price"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${coursePackagePaymentConfig.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${coursePackagePaymentConfig.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${coursePackagePaymentConfig.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 币 |
| | | @} |
| | | </span> |
| | | </div> |
| | | </div> |
| | | @for(obj in coursePackagePaymentConfigs){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*课时数:</label> |
| | | <div class="col-sm-8"> |
| | | <span class="classNumber_span"><input class="classNumber" type="number" value="${obj.classHours}" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> </span> |
| | | <span class="cash_span"> |
| | | @if(cashPayment){ |
| | | 现金支付:<input class="cash" type="number" value="${obj.cashPayment}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> ¥ |
| | | @} |
| | | </span> |
| | | <span class="paiCoin_span"> |
| | | @if(playPaiCoin){ |
| | | 玩湃币支付:<input class="paiCoin" type="number" value="${obj.playPaiCoin}" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;" readonly> 币 |
| | | @} |
| | | </span> |
| | | </div> |
| | | </div> |
| | | @} |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*审核状态:</label> |
| | | <div class="col-sm-8" style="margin-top: 6px;"> |
| | | <input name="auditStatus" type="radio" value="2"/> 通过 |
| | | <input name="auditStatus" type="radio" value="3"/> 拒绝 |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*拒绝理由:</label> |
| | | <div class="col-sm-8" style="margin-top: 6px;"> |
| | | <textarea id="authRemark" style="width: 100%;height: 200px;" placeholder="请输入拒绝理由"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="CoursePackageInfo.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="CoursePackageInfo.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/examineCoursePackage_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input type="hidden" id="id" value="${id}"> |
| | | <div class="row"> |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="userName" name="所属用户"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="studentName" name="姓名"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 col-sm-3"> |
| | | <div class="row"> |
| | | <div class="col-lg-12 col-sm-12"> |
| | | <#button name="搜索" icon="fa-search" clickFun="ManualReservation.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="ManualReservation.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="managerTableToolbar" role="group"> |
| | | <#button name="保存" icon="fa-plus" clickFun="ManualReservation.submit()"/> |
| | | </div> |
| | | <#table id="managerTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/manualReservation.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | <input type="hidden" id="name" value="${item.name}"> |
| | | <div class="col-lg-10 col-sm-9"> |
| | | <div class="row"> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="userName" name="购买用户"/> |
| | | </div> |
| | | <div class="col-lg-4 col-sm-12"> |
| | | <#NameCon id="studentName" name="购买学员"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-lg-2 col-sm-3"> |
| | | <div class="row"> |
| | | <div class="col-lg-12 col-sm-12"> |
| | | <#button name="搜索" icon="fa-search" clickFun="RegistrationRecord.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="RegistrationRecord.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="managerTableToolbar" role="group"> |
| | | <#button name="上课记录" icon="fa-plus" clickFun="RegistrationRecord.classRecord()"/> |
| | | <#button name="退课" icon="fa-edit" clickFun="RegistrationRecord.dropClass()" space="true"/> |
| | | <#button name="补课" icon="fa-refresh" clickFun="RegistrationRecord.makeUpMissedLessons()" space="true"/> |
| | | </div> |
| | | <#table id="managerTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/coursePackage/registrationRecord.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/dept/dept_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/dept/dept_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/dept/dept_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/dept/dept_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/menu/menu_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/menu/menu_info.js"></script> |
| | | @} |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAuditRecord/tAuditRecord.js"></script> |
| | | <script src="${ctxPath}/modular/system/tAuditRecord/tAuditRecord.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAuditRecord/tAuditRecord_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tAuditRecord/tAuditRecord_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tAuditRecord/tAuditRecord_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tAuditRecord/tAuditRecord_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tEnsureIncomeRule/tEnsureIncomeRule_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tEnsureIncomeRule/tEnsureIncomeRule_info.js"></script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <link rel="stylesheet" href="${ctxPath}/static/js/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="${ctxPath}/layui/css/layui.css" media="all"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/user/user.js"></script> |
| | | <script src="${ctxPath}/static/js/layui/layui.js" charset="utf-8"></script> |
| | | <script src="${ctxPath}/modular/system/user/user.js"></script> |
| | | <script src="${ctxPath}/layui/layui.js" charset="utf-8"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/user/user_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#birthday' |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/user/user_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | @} |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/user/user_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#birthday' |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/user/user_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#birthday' |
| | |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 修改密码 |
| | | */ |
| | | CourseInfo.chPwd = function () { |
| | | let oldPwd = $('#oldPwd').val(); |
| | | let newPwd = $('#newPwd').val(); |
| | | if(oldPwd == newPwd){ |
| | | Feng.error("新密码不能和原始密码相同"); |
| | | return |
| | | } |
| | | let patt = /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}/; |
| | | if(!patt.test(newPwd)){ |
| | | Feng.error("密码中必须包含大小字母、数字、特称字符,至少8个字符,最多30个字符"); |
| | | return |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/changePwd", function (data) { |
| | | Feng.success("修改成功!"); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("oldPwd"); |
| | | ajax.set("newPwd"); |
| | | ajax.set("rePwd"); |
| | | ajax.start(); |
| | | |
| | | }; |
| | | |
| | | function onBodyDown(event) { |
| | | if (!(event.target.id == "menuBtn" || event.target.id == "menuContent" || $( |
New file |
| | |
| | | /** |
| | | * 系统管理--用户管理的单例对象 |
| | | */ |
| | | let ClassRecord = { |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | courseList: null |
| | | }; |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | ClassRecord.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '日期', field: 'classDate', align: 'center', valign: 'middle'}, |
| | | {title: '报名学员', field: 'registered', align: 'center', valign: 'middle'}, |
| | | {title: '实到学员', field: 'actualArrival', align: 'center', valign: 'middle'}, |
| | | {title: '未到学员', field: 'nonArrival', align: 'center', valign: 'middle'}, |
| | | {title: '课后练习', field: 'courseId', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(typeof v == "undefined"){ |
| | | return '未布置'; |
| | | }else{ |
| | | return '已布置'; |
| | | } |
| | | } |
| | | }, |
| | | {title: '状态', field: 'status', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | | return '未开始'; |
| | | case 2: |
| | | return '已开始'; |
| | | case 3: |
| | | return '已结束'; |
| | | case 4: |
| | | return '已取消'; |
| | | } |
| | | } |
| | | }, |
| | | {title: '扣除课时', field: 'deductClassHour', align: 'center', valign: 'middle'}, |
| | | {title: '取消记录', field: 'absencesNumber', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(typeof v == "undefined"){ |
| | | return '未上传'; |
| | | }else{ |
| | | return '已上传'; |
| | | } |
| | | } |
| | | }, |
| | | ]; |
| | | return columns; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | ClassRecord.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | ClassRecord.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 点击修改按钮时 |
| | | * @param userId 管理员id |
| | | */ |
| | | ClassRecord.classRecord = function () { |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '查看学员', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/openCoursePackageStudent?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | ClassRecord.cancelClassSchedule = function () { |
| | | if (this.check()) { |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/cancelClassSchedule", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("取消成功!"); |
| | | ClassRecord.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("取消失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", ClassRecord.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | Feng.confirm("确定取消本次",operation); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | ClassRecord.afterClassExercises = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/course/queryCourseByType", function (data) { |
| | | ClassRecord.courseList = data; |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">视频类型:</label>\n' + |
| | | ' <div class="col-sm-9" style="margin-top: 6px;">\n' + |
| | | ' <span>课后练习</span>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">视频名称:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <select class="form-control" id="courseId">' + |
| | | ' <option value="">请选择</option>'; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>'; |
| | | } |
| | | htmlStr += ' </select>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">视频封面:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <img src="" style="height: 150px;" id="coverDrawing"/>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">视频简介:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea class="form-control" id="introduce" style="height: 200px;"></textarea>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">可获得积分:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="integral" type="number" min="0">' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>'; |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '选择课程' |
| | | , area: ['50%', '90%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['保存', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | let courseId = $('#courseId').val(); |
| | | let integral = $('#integral').val(); |
| | | if(null == courseId || '' == courseId){ |
| | | Feng.error("请选择有效的课程"); |
| | | return |
| | | } |
| | | if(null == integral || '' == integral){ |
| | | Feng.error("请输入有效的积分"); |
| | | return |
| | | } |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/afterClassExercises", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | layer.closeAll(); |
| | | RegistrationRecord.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", ClassRecord.seItem.id); |
| | | ajax.set("courseId", courseId); |
| | | ajax.set("integral", integral); |
| | | ajax.start(); |
| | | }, |
| | | }); |
| | | |
| | | $('#courseId').change(function () { |
| | | let id = $(this).val(); |
| | | for (let i = 0; i < ClassRecord.courseList.length; i++) { |
| | | if(ClassRecord.courseList[i].id == id){ |
| | | $('#coverDrawing').attr("src", ClassRecord.courseList[i].coverDrawing); |
| | | $('#introduce').text(ClassRecord.courseList[i].introduce); |
| | | } |
| | | } |
| | | }) |
| | | |
| | | $('#courseId').val(ClassRecord.seItem.courseId); |
| | | $('#integral').val(ClassRecord.seItem.integral); |
| | | |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('type', 1); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | ClassRecord.cancellationRecord = function(){ |
| | | if(this.check()){ |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2"></label>'+ |
| | | ' <label class="col-sm-8 control-label" style="text-align: left;">课程名称:' + $("#name").text() + '</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2"></label>'+ |
| | | ' <label class="col-sm-8 control-label" style="text-align: left;">*上传凭证(请上传小于5张图片):</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2"></label>'+ |
| | | ' <div class="col-sm-8" style="min-height: 200px;">\n' + |
| | | ' <div id="cancelClasses"></div>' + |
| | | ' <input type="file" id="file" style="display: none;"/>' + |
| | | ' <button onclick="uploadImgs()" style="width: 60px;padding: 10px; color: white;background-color: #0d8ddb;border-radius: 5px;border: none;bottom: 50%;position: absolute;"> 上传 </button>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2"></label>'+ |
| | | ' <label class="control-label" style="text-align: left;">扣除课时数:</label>\n' + |
| | | ' <input id="deductClassHour" type="number" min="0" style="background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;">' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>'; |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '上传消课记录' |
| | | , area: ['80%', '90%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['保存', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | let cancelClasses = $('#cancelClasses').html(); |
| | | let deductClassHour = $('#deductClassHour').val(); |
| | | if(null == cancelClasses || '' == cancelClasses){ |
| | | Feng.error("请上传凭证图片"); |
| | | return |
| | | } |
| | | if(null == deductClassHour || '' == deductClassHour){ |
| | | Feng.error("请输入有效的扣除课时数"); |
| | | return |
| | | } |
| | | let div_array = $('#cancelClasses').find('div'); |
| | | let str = ''; |
| | | for (let i = 0; i < div_array.length; i++) { |
| | | let v = $($(div_array[i]).find('img')[0]).attr('src'); |
| | | str += v + ";"; |
| | | } |
| | | |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/cancellationRecord", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | layer.closeAll(); |
| | | RegistrationRecord.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", ClassRecord.seItem.id); |
| | | ajax.set("cancelClasses", str.substring(0, str.length - 1)); |
| | | ajax.set("deductClassHour", deductClassHour); |
| | | ajax.start(); |
| | | }, |
| | | }); |
| | | |
| | | $('#file').on('change', function () { |
| | | var formData = new FormData() //创建一个forData |
| | | formData.append('file', $('#file')[0].files[0]) //把file添加进去 name命名为img |
| | | layer.load(); //上传loading |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/mgr/uploadImg', |
| | | data: formData, |
| | | type: "POST", |
| | | async: true, |
| | | cache: false, |
| | | contentType: false, |
| | | processData: false, |
| | | success: function(res) { |
| | | layer.closeAll('loading'); //关闭loading |
| | | $('#file').val(''); |
| | | $('#cancelClasses').append('' + |
| | | '<div style="float: left; margin: 10px; width: 200px;">' + |
| | | ' <i class="fa fa-close" style="font-size:24px;color: red;position: relative;top: 10px;right: -190px" onclick="removeImg(this)"></i>' + |
| | | ' <div style="width: 100%;"><img src="' + res + '" style="width: 100%;"/></div>' + |
| | | '</div>') |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | ClassRecord.lookCancellationRecord = function(){ |
| | | if(this.check()){ |
| | | if(ClassRecord.seItem.cancelClasses == '' || ClassRecord.seItem.cancelClasses == null){ |
| | | Feng.error("请先上传消课凭证"); |
| | | return |
| | | } |
| | | let imgs = ClassRecord.seItem.cancelClasses.split(";"); |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 20px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">课程名称:' + $("#name").text() + '</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">*上传凭证(请上传小于5张图片):</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-8" style="min-height: 200px;">\n' + |
| | | ' <div id="cancelClasses">'; |
| | | |
| | | for (let i = 0; i < imgs.length; i++) { |
| | | htmlStr += '<div><img src="' + imgs[i] + '" style="height: 150px;"/></div> '; |
| | | } |
| | | |
| | | htmlStr += '</div>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">扣除课时数:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="deductClassHour" value="' + ClassRecord.seItem.deductClassHour + '" type="number" min="0">' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>'; |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '查看消课记录' |
| | | , area: ['50%', '90%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | ClassRecord.manualReservation = function(){ |
| | | if(this.check()){ |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '手动预约', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/openManualReservation?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | |
| | | function uploadImgs(){ |
| | | let num = $('#cancelClasses>div').length; |
| | | if(num >= 5){ |
| | | Feng.error("最多只能上传5张图片"); |
| | | return; |
| | | } |
| | | $('#file').click(); |
| | | } |
| | | |
| | | |
| | | function removeImg(e){ |
| | | $(e).parent('div').remove(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ClassRecord.resetSearch = function () { |
| | | ClassRecord.search(); |
| | | } |
| | | |
| | | ClassRecord.search = function () { |
| | | let queryData = {}; |
| | | queryData['id'] = $('#id').val(); |
| | | ClassRecord.table.refresh({query: queryData}); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | let defaultColunms = ClassRecord.initColumn(); |
| | | let table = new BSTable(ClassRecord.id, "/coursePackage/queryClassRecord", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | id: $('#id').val() |
| | | }) |
| | | ClassRecord.table = table.init(); |
| | | }); |
| | |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | deptid:0 |
| | | layerIndex: -1 |
| | | }; |
| | | let language =$("#language").val() |
| | | |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | |
| | | {title: '课程有效期', field: 'validDays', align: 'center', valign: 'middle'}, |
| | | {title: '支付方式', field: 'payType', align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', align: 'center', valign: 'middle'}, |
| | | {title: '课程封面', field: 'status', align: 'center', valign: 'middle', |
| | | {title: '课包状态', field: 'status', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | |
| | | */ |
| | | CoursePackage.editCoursePackage = function () { |
| | | if (this.check()) { |
| | | if(CoursePackage.seItem.status != 1){ |
| | | Feng.error("该状态不能编辑"); |
| | | return |
| | | } |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/course/showEditCoursePackage?id=' + this.seItem.id |
| | | content: Feng.ctxPath + '/coursePackage/openEditCoursePackage?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | CoursePackage.delCoursePackage = function () { |
| | | if (this.check()) { |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/course/delCoursePackage", function () { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/delCoursePackage", function () { |
| | | Feng.success("删除成功!"); |
| | | CoursePackage.table.refresh(); |
| | | }, function (data) { |
| | |
| | | Feng.error("不能重复操作"); |
| | | return |
| | | } |
| | | let ajax = new $ax(Feng.ctxPath + "/course/editCoursePackageState", function (data) { |
| | | Feng.success("下架成功!"); |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/editCoursePackageState", function (data) { |
| | | Feng.success(state == 1 ? '上架' : "下架" + "成功!"); |
| | | CoursePackage.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("下架失败!" + data.responseJSON.message + "!"); |
| | | Feng.error(state == 1 ? '上架' : "下架" + "失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", CoursePackage.seItem.id); |
| | | ajax.set("state", state); |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/course/showCoursePackageDetails?id=' + this.seItem.id |
| | | content: Feng.ctxPath + '/coursePackage/showCoursePackageDetails?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | CoursePackage.coursePackageDiscount = function () { |
| | | if (this.check()) { |
| | | let payType = CoursePackage.seItem.payType; |
| | | if(payType.indexOf("现金支付") < 0){ |
| | | Feng.error("该课程不能配置折扣"); |
| | | return |
| | | } |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '折扣管理', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/showCoursePackageDiscount?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | CoursePackage.registrationRecord = function () { |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '报名信息', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/registrationRecord?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | |
| | | $('#provinceCode').change(function () { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCity", function (data) { |
| | | let htmlStr = '<option value="">全部</option>'; |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].code + '">' + data[i].name + '</option>' |
| | | } |
New file |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var CoursePackageDiscount = { |
| | | userInfoData: {}, |
| | | coursePackagePaymentConfig: {} |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | CoursePackageDiscount.close = function () { |
| | | parent.layer.close(window.parent.CoursePackage.layerIndex); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | CoursePackageDiscount.editSubmit = function () { |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/setCoursePackageDiscount", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("编辑成功!"); |
| | | CoursePackageDiscount.close(); |
| | | window.parent.CoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("编辑失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('json', JSON.stringify(CoursePackageDiscount.coursePackagePaymentConfig)); |
| | | ajax.set('id', $('#id').val()); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | function addPrice(type){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 3){ |
| | | let ll = $('#limitedTimeDiscount .limitedTimeDiscount').length; |
| | | let htmlStr = |
| | | ' <div class="form-group limitedTimeDiscount" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(3, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(3, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(3, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(3, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(3, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(3, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(3, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(3, this, \'cashPayment\')" min="0" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | |
| | | $('#limitedTimeDiscount').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 3){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | if(type == 4){ |
| | | let ll = $('#complimentaryClass .complimentaryClass').length; |
| | | let htmlStr = |
| | | ' <div class="form-group complimentaryClass" index="' + ll + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1" onclick="addPriceValue(4, this, \'weeks\')"/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2" onclick="addPriceValue(4, this, \'weeks\')"/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3" onclick="addPriceValue(4, this, \'weeks\')"/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4" onclick="addPriceValue(4, this, \'weeks\')"/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5" onclick="addPriceValue(4, this, \'weeks\')"/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6" onclick="addPriceValue(4, this, \'weeks\')"/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7" onclick="addPriceValue(4, this, \'weeks\')"/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" class="price" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | $('#complimentaryClass').append(htmlStr); |
| | | let arr = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | for(let k in arr){ |
| | | if(arr[k].type == 4){ |
| | | arr[k].content.push({}) |
| | | } |
| | | } |
| | | lay('.startAndEndDay').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | lay('.time').each(function(i, e){ |
| | | laydate.render({ |
| | | elem: this |
| | | ,type: 'time' |
| | | ,range: true |
| | | ,done: function(value, date, endDate){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = obj.coursePackageDiscount[i].content; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | let arr = value.split(" - "); |
| | | obj.coursePackageDiscount[i].content[j]['startTime'] = arr[0]; |
| | | obj.coursePackageDiscount[i].content[j]['endTime'] = arr[1]; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | function removePrice(type, e){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let object = $(e).parent('div').parent('div').parent('div').parent('div'); |
| | | let ii = object.attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | let arr = []; |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | continue |
| | | } |
| | | arr.push(jsonArray[j]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = arr; |
| | | } |
| | | } |
| | | object.remove(); |
| | | } |
| | | |
| | | |
| | | function addPriceValue(type, e, name){ |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(type == 1){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 2){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let content = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | content = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | content = obj.coursePackageDiscount[i].content; |
| | | } |
| | | content[name] = parseFloat($(e).val()); |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = content; |
| | | } |
| | | } |
| | | } |
| | | if(type == 3){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | if(type == 4){ |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index'); |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(type == obj.coursePackageDiscount[i].type){ |
| | | let jsonArray = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obj.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | if(j == ii){ |
| | | if('weeks' == name){ |
| | | let weeks = jsonArray[j].weeks; |
| | | let v = parseInt($(e).val()); |
| | | if(null != weeks && typeof weeks != "undefined"){ |
| | | if(e.checked){ |
| | | weeks.push(v); |
| | | }else{ |
| | | let arr = []; |
| | | for (let k = 0; k < weeks.length; k++) { |
| | | if(weeks[k] == v){ |
| | | continue |
| | | } |
| | | arr.push(weeks[k]); |
| | | } |
| | | weeks = arr; |
| | | } |
| | | }else{ |
| | | weeks = [v]; |
| | | } |
| | | jsonArray[j].weeks = weeks; |
| | | }else{ |
| | | jsonArray[j][name] = parseFloat($(e).val()); |
| | | } |
| | | } |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount[i].content = jsonArray; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function selectedPperiod(e){ |
| | | $('#classHours').find('button[checked]').attr('style', 'width: 60px;height: 30px;border: none;border-radius: 5px;'); |
| | | $('#classHours').find('button[checked]').removeAttr('checked'); |
| | | if(typeof e != "undefined"){ |
| | | $(e).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $(e).attr('checked', true); |
| | | }else{ |
| | | $($('#classHours').find('button')[0]).attr('style', 'width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;'); |
| | | $($('#classHours').find('button')[0]).attr('checked', true); |
| | | } |
| | | |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('#payment').text(obj.payment); |
| | | $('#cashPayment').text(obj.cashPayment); |
| | | |
| | | $('#memberDiscount').html(''); |
| | | $('#renewalOffer').html(''); |
| | | $('#limitedTimeDiscount').html(''); |
| | | $('#complimentaryClass').html(''); |
| | | let objv = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | $('input[name="type"]').each(function (i, e) { |
| | | e.checked = false; |
| | | let v = $(e).val(); |
| | | for (let i = 0; i < objv.coursePackageDiscount.length; i++) { |
| | | if(v == objv.coursePackageDiscount[i].type){ |
| | | $(e).click(); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | $(function () { |
| | | CoursePackageDiscount.coursePackagePaymentConfig = JSON.parse($('#coursePackagePaymentConfig').val()); |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < CoursePackageDiscount.coursePackagePaymentConfig.length; i++) { |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[i]; |
| | | if(i == 0){ |
| | | htmlStr += '<button checked onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;">' + obj.classHours + '课时</button> '; |
| | | }else{ |
| | | htmlStr += '<button onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;border: none;border-radius: 5px;">' + obj.classHours + '课时</button> '; |
| | | } |
| | | } |
| | | $('#classHours').html(htmlStr); |
| | | |
| | | $('input[name="type"]').click(function () { |
| | | let v = $(this).val(); |
| | | let index = $('#classHours').find('button[checked]').attr('index'); |
| | | if(this.checked && v == '1'){ |
| | | let discountMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>会员折扣</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.discountMember ? '' : jsonObject.discountMember); |
| | | discountMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(1, this, \'discountMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | |
| | | $('#memberDiscount').html(hh); |
| | | if(discountMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 1, |
| | | content:{ |
| | | discountMember: null |
| | | } |
| | | }); |
| | | } |
| | | }else if(!this.checked && v == '1'){ |
| | | $('#memberDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '2'){ |
| | | let continuingMember = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<h3>续课优惠</h3>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">会员续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">用户续课:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-2"></div>'+ |
| | | ' <div class="col-sm-10">' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obj = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obj.coursePackageDiscount.length; i++) { |
| | | if(v == obj.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obj.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obj.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obj.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingMember ? '' : jsonObject.continuingMember); |
| | | continuingMember = false; |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入会员支付价格" onblur="addPriceValue(2, this, \'continuingMember\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-3">\n' + |
| | | ' <input type="number" min="0" value="'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | let jsonObject = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonObject = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonObject = obje.coursePackageDiscount[i].content; |
| | | } |
| | | hh += (null == jsonObject.continuingUser ? '' : jsonObject.continuingUser); |
| | | } |
| | | } |
| | | hh += '" placeholder="请输入用户支付价格" onblur="addPriceValue(2, this, \'continuingUser\')" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>'+ |
| | | ' </div>'; |
| | | $('#renewalOffer').html(hh); |
| | | if(continuingMember){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 2, |
| | | content: { |
| | | continuingMember: null, |
| | | continuingUser: null |
| | | } |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '2'){ |
| | | $('#renewalOffer').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '3'){ |
| | | let data_value = true; |
| | | let hh = '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">限时折扣</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(3)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if(v == obje.coursePackageDiscount[i].type){ |
| | | data_value = false |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += '' + |
| | | ' <div class="form-group limitedTimeDiscount" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">折扣有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(3, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*折扣时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*现金支付:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" min="0" value="' + jsonArray[j].cashPayment + '" onblur="addPriceValue(3, this, \'cashPayment\')" placeholder="请输入折扣后支付价格" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | |
| | | } |
| | | } |
| | | $('#limitedTimeDiscount').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 3, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '3'){ |
| | | $('#limitedTimeDiscount').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | if(this.checked && v == '4'){ |
| | | let data_value = true; |
| | | let hh = |
| | | '<div class="hr-line-dashed"></div>' + |
| | | '<span style="font-size: 16px;font-weight: 500;">赠送课时</span> <i class="fa fa-plus-circle" style="font-size:24px" onclick="addPrice(4)"></i>\n'; |
| | | let obje = CoursePackageDiscount.coursePackagePaymentConfig[index]; |
| | | for (let i = 0; i < obje.coursePackageDiscount.length; i++) { |
| | | if (v == obje.coursePackageDiscount[i].type) { |
| | | data_value = false; |
| | | let jsonArray = null; |
| | | if(typeof obje.coursePackageDiscount[i].content == "string"){ |
| | | jsonArray = JSON.parse(obje.coursePackageDiscount[i].content); |
| | | }else{ |
| | | jsonArray = obje.coursePackageDiscount[i].content; |
| | | } |
| | | for (let j = 0; j < jsonArray.length; j++) { |
| | | hh += |
| | | ' <div class="form-group complimentaryClass" index="' + j + '">' + |
| | | ' <div class="col-sm-2"></div>\n' + |
| | | ' <div class="col-sm-8" style="border: 1px solid; padding: 20px;">\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送有效期:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="startAndEndDay" value="' + (jsonArray[j].startDate + " - " + jsonArray[j].endDate) + '" style="width: 300px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>' + |
| | | ' </div>\n' + |
| | | ' <div class="col-sm-1"><i class="fa fa-trash-o" style="font-size:24px;color: red;" onclick="removePrice(4, this)"></i></div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送时间:</label>\n' + |
| | | ' <div class="col-sm-5">\n' + |
| | | ' <input class="time" value="' + jsonArray[j].startTime + " - " + jsonArray[j].endTime + '" style="width: 200px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label"></label>\n' + |
| | | ' <div class="col-sm-8" style="margin-top: 6px;">\n' + |
| | | ' <input type="checkbox" name="week" value="1"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 1){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周一 ' + |
| | | ' <input type="checkbox" name="week" value="2"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 2){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周二 ' + |
| | | ' <input type="checkbox" name="week" value="3"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 3){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周三 ' + |
| | | ' <input type="checkbox" name="week" value="4"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 4){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周四 ' + |
| | | ' <input type="checkbox" name="week" value="5"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 5){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周五 ' + |
| | | ' <input type="checkbox" name="week" value="6"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 6){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周六 ' + |
| | | ' <input type="checkbox" name="week" value="7"'; |
| | | for (let k = 0; k < jsonArray[j].weeks.length; k++) { |
| | | let w = jsonArray[j].weeks[k]; |
| | | if(w == 7){ |
| | | hh += 'checked'; |
| | | } |
| | | } |
| | | hh += '/> 周日 ' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-2 control-label">*赠送课时数:</label>\n' + |
| | | ' <div class="col-sm-4">\n' + |
| | | ' <input type="number" value="' + jsonArray[j].hour + '" onblur="addPriceValue(4, this, \'hour\')" min="0" placeholder="请输入赠送课时数" style="width: 180px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"/> ¥\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>'; |
| | | } |
| | | } |
| | | } |
| | | $('#complimentaryClass').html(hh); |
| | | if(data_value){ |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount.push({ |
| | | type: 4, |
| | | content: [] |
| | | }) |
| | | } |
| | | }else if(!this.checked && v == '4'){ |
| | | $('#complimentaryClass').html(''); |
| | | let datas = CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount; |
| | | let arra = []; |
| | | for (let i = 0; i < datas.length; i++){ |
| | | if(datas[i].type == v){ |
| | | continue; |
| | | } |
| | | arra.push(datas[i]); |
| | | } |
| | | CoursePackageDiscount.coursePackagePaymentConfig[index].coursePackageDiscount = arra; |
| | | } |
| | | }) |
| | | |
| | | |
| | | selectedPperiod(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 系统管理--用户管理的单例对象 |
| | | */ |
| | | let CoursePackageStudent = { |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | CoursePackageStudent.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所属用户', field: 'userName', align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'studentName', align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', align: 'center', valign: 'middle'}, |
| | | {title: '年龄', field: 'age', align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(v == 1){ |
| | | return '男'; |
| | | }else{ |
| | | return '女'; |
| | | } |
| | | } |
| | | }, |
| | | {title: '到课状态', field: 'signInOrNot', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 0: |
| | | return '未到'; |
| | | case 1: |
| | | return '已到'; |
| | | } |
| | | } |
| | | }, |
| | | {title: '预定状态', field: 'reservationStatus', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(v == 0){ |
| | | return '已取消'; |
| | | }else{ |
| | | return '正常'; |
| | | } |
| | | } |
| | | }, |
| | | ]; |
| | | return columns; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | CoursePackageStudent.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | CoursePackageStudent.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 取消预约 |
| | | */ |
| | | CoursePackageStudent.cancelReservation = function () { |
| | | if (this.check()) { |
| | | if(CoursePackageStudent.seItem.reservationStatus == 0){ |
| | | Feng.error("不能重复操作"); |
| | | return |
| | | } |
| | | if(CoursePackageStudent.seItem.signInOrNot == 1){ |
| | | Feng.error("不能取消预约操作"); |
| | | return |
| | | } |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/cancelReservation", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("取消成功!"); |
| | | CoursePackageStudent.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("取消失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", CoursePackageStudent.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否取消预约",operation); |
| | | } |
| | | }; |
| | | |
| | | |
| | | CoursePackageStudent.absence = function () { |
| | | if (this.check()) { |
| | | if(CoursePackageStudent.seItem.signInOrNot == 0){ |
| | | Feng.error("不能重复操作"); |
| | | return |
| | | } |
| | | if(CoursePackageStudent.seItem.reservationStatus == 0){ |
| | | Feng.error("该数据已取消预约"); |
| | | return |
| | | } |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/setAbsenceStatus", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("修改成功!"); |
| | | CoursePackageStudent.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", CoursePackageStudent.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否标注未到",operation); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | CoursePackageStudent.resetSearch = function () { |
| | | $('#userName').val(''); |
| | | $('#studentName').val(''); |
| | | CoursePackageStudent.search(); |
| | | } |
| | | |
| | | CoursePackageStudent.search = function () { |
| | | let queryData = {}; |
| | | queryData['id'] = $('#id').val(); |
| | | queryData['userName'] = $('#userName').val(); |
| | | queryData['studentName'] = $('#studentName').val(); |
| | | CoursePackageStudent.table.refresh({query: queryData}); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | let defaultColunms = CoursePackageStudent.initColumn(); |
| | | let table = new BSTable(CoursePackageStudent.id, "/coursePackage/queryCoursePackageStudentList", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | id: $('#id').val() |
| | | }) |
| | | CoursePackageStudent.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var CoursePackageInfo = { |
| | | userInfoData: {}, |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | CoursePackageInfo.close = function () { |
| | | parent.layer.close(window.parent.CoursePackage.layerIndex); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 提交添加用户 |
| | | */ |
| | | CoursePackageInfo.addSubmit = function () { |
| | | let province = $('#provinceCode option:checked').text(); |
| | | let provinceCode = $('#provinceCode').val(); |
| | | let city = $('#cityCode option:checked').text(); |
| | | let cityCode = $('#cityCode').val(); |
| | | let storeId = $('#storeId').val(); |
| | | let coursePackageTypeId = $('#coursePackageTypeId').val(); |
| | | let name = $('#name').val(); |
| | | let siteId = $('#siteId').val(); |
| | | let coachId = $('#coachId').val(); |
| | | let maxSubscribeNumber = $('#maxSubscribeNumber').val(); |
| | | let classStartTime = $('#classStartTime').val(); |
| | | let classWeeks = ''; |
| | | $('input[name="classWeeks"]:checked').each(function (index, e) { |
| | | classWeeks += $(e).val() + ";"; |
| | | }) |
| | | let coverDrawing = $('#coverDrawing').val(); |
| | | let detailDrawing = $('#detailDrawing').val(); |
| | | let introduceDrawing = $('#introduceDrawing').val(); |
| | | let sort = $('#sort').val(); |
| | | let validDays = $('#validDays').val(); |
| | | let price = []; |
| | | $('#price>.form-group').each(function (i, e) { |
| | | let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val(); |
| | | let cash = $($(e).find(".cash_span input[class='cash']")[0]).val(); |
| | | let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val(); |
| | | price.push({ |
| | | classHours: classHours, |
| | | cashPayment: typeof cash == "undefined" ? 0 : cash, |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin |
| | | }) |
| | | }); |
| | | if(null == provinceCode || '' == provinceCode){ |
| | | Feng.error("所在省不能为空"); |
| | | return |
| | | } |
| | | if(null == cityCode || '' == cityCode){ |
| | | Feng.error("所在市不能为空"); |
| | | return |
| | | } |
| | | if(null == storeId || '' == storeId){ |
| | | Feng.error("所属门店不能为空"); |
| | | return |
| | | } |
| | | if(null == coursePackageTypeId || '' == coursePackageTypeId){ |
| | | Feng.error("课程类型不能为空"); |
| | | return |
| | | } |
| | | if(null == name || '' == name){ |
| | | Feng.error("课包名称不能为空"); |
| | | return |
| | | } |
| | | if(null == siteId || '' == siteId){ |
| | | Feng.error("上课场地不能为空"); |
| | | return |
| | | } |
| | | if(null == coachId || '' == coachId){ |
| | | Feng.error("授课教师不能为空"); |
| | | return |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if(null == classStartTime || '' == classStartTime){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | if(null == classWeeks || '' == classWeeks){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | |
| | | if(null == coverDrawing || '' == coverDrawing){ |
| | | Feng.error("课包封面不能为空"); |
| | | return |
| | | } |
| | | if(null == detailDrawing || '' == detailDrawing){ |
| | | Feng.error("详情页不能为空"); |
| | | return |
| | | } |
| | | if(null == introduceDrawing || '' == introduceDrawing){ |
| | | Feng.error("课包介绍不能为空"); |
| | | return |
| | | } |
| | | if(null == validDays || '' == validDays){ |
| | | Feng.error("课时有效期不能为空"); |
| | | return |
| | | } |
| | | |
| | | let obj = { |
| | | province: province, |
| | | provinceCode: provinceCode, |
| | | city: city, |
| | | cityCode: cityCode, |
| | | storeId: storeId, |
| | | coursePackageTypeId: coursePackageTypeId, |
| | | name: name, |
| | | siteId: siteId, |
| | | coachId: coachId, |
| | | maxSubscribeNumber: maxSubscribeNumber, |
| | | classStartTime: classStartTime.split(" - ")[0], |
| | | classEndTime: classStartTime.split(" - ")[1], |
| | | classWeeks: classWeeks, |
| | | coverDrawing: coverDrawing, |
| | | detailDrawing: detailDrawing, |
| | | introduceDrawing: introduceDrawing, |
| | | sort: sort, |
| | | validDays: validDays, |
| | | coursePackagePaymentConfig: JSON.stringify(price) |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/addCoursePackage", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("添加成功!"); |
| | | CoursePackageInfo.close(); |
| | | window.parent.CoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(obj); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | CoursePackageInfo.editSubmit = function () { |
| | | let id = $('#id').val(); |
| | | let province = $('#provinceCode option:checked').text(); |
| | | let provinceCode = $('#provinceCode').val(); |
| | | let city = $('#cityCode option:checked').text(); |
| | | let cityCode = $('#cityCode').val(); |
| | | let storeId = $('#storeId').val(); |
| | | let coursePackageTypeId = $('#coursePackageTypeId').val(); |
| | | let name = $('#name').val(); |
| | | let siteId = $('#siteId').val(); |
| | | let coachId = $('#coachId').val(); |
| | | let maxSubscribeNumber = $('#maxSubscribeNumber').val(); |
| | | let classStartTime = $('#classStartTime').val(); |
| | | let classWeeks = ''; |
| | | $('input[name="classWeeks"]:checked').each(function (index, e) { |
| | | classWeeks += $(e).val() + ";"; |
| | | }) |
| | | let coverDrawing = $('#coverDrawing').val(); |
| | | let detailDrawing = $('#detailDrawing').val(); |
| | | let introduceDrawing = $('#introduceDrawing').val(); |
| | | let sort = $('#sort').val(); |
| | | let validDays = $('#validDays').val(); |
| | | let price = []; |
| | | $('#price>.form-group').each(function (i, e) { |
| | | let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val(); |
| | | let cash = $($(e).find(".cash_span input[class='cash']")[0]).val(); |
| | | let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val(); |
| | | price.push({ |
| | | classHours: classHours, |
| | | cashPayment: typeof cash == "undefined" ? 0 : cash, |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin |
| | | }) |
| | | }); |
| | | if(null == provinceCode || '' == provinceCode){ |
| | | Feng.error("所在省不能为空"); |
| | | return |
| | | } |
| | | if(null == cityCode || '' == cityCode){ |
| | | Feng.error("所在市不能为空"); |
| | | return |
| | | } |
| | | if(null == storeId || '' == storeId){ |
| | | Feng.error("所属门店不能为空"); |
| | | return |
| | | } |
| | | if(null == coursePackageTypeId || '' == coursePackageTypeId){ |
| | | Feng.error("课程类型不能为空"); |
| | | return |
| | | } |
| | | if(null == name || '' == name){ |
| | | Feng.error("课包名称不能为空"); |
| | | return |
| | | } |
| | | if(null == siteId || '' == siteId){ |
| | | Feng.error("上课场地不能为空"); |
| | | return |
| | | } |
| | | if(null == coachId || '' == coachId){ |
| | | Feng.error("授课教师不能为空"); |
| | | return |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if(null == classStartTime || '' == classStartTime){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | if(null == classWeeks || '' == classWeeks){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | |
| | | if(null == coverDrawing || '' == coverDrawing){ |
| | | Feng.error("课包封面不能为空"); |
| | | return |
| | | } |
| | | if(null == detailDrawing || '' == detailDrawing){ |
| | | Feng.error("详情页不能为空"); |
| | | return |
| | | } |
| | | if(null == introduceDrawing || '' == introduceDrawing){ |
| | | Feng.error("课包介绍不能为空"); |
| | | return |
| | | } |
| | | if(null == validDays || '' == validDays){ |
| | | Feng.error("课时有效期不能为空"); |
| | | return |
| | | } |
| | | |
| | | let obj = { |
| | | id: id, |
| | | province: province, |
| | | provinceCode: provinceCode, |
| | | city: city, |
| | | cityCode: cityCode, |
| | | storeId: storeId, |
| | | coursePackageTypeId: coursePackageTypeId, |
| | | name: name, |
| | | siteId: siteId, |
| | | coachId: coachId, |
| | | maxSubscribeNumber: maxSubscribeNumber, |
| | | classStartTime: classStartTime.split(" - ")[0], |
| | | classEndTime: classStartTime.split(" - ")[1], |
| | | classWeeks: classWeeks, |
| | | coverDrawing: coverDrawing, |
| | | detailDrawing: detailDrawing, |
| | | introduceDrawing: introduceDrawing, |
| | | sort: sort, |
| | | validDays: validDays, |
| | | coursePackagePaymentConfig: JSON.stringify(price) |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/updateCoursePackage", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("编辑成功!"); |
| | | CoursePackageInfo.close(); |
| | | window.parent.CoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("编辑失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(obj); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | function queryStore() { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryStore", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#storeId').html(htmlStr); |
| | | |
| | | querySite(); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("cityCode", $('#cityCode').val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | |
| | | function querySite(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/querySite", 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.start(); |
| | | } |
| | | |
| | | |
| | | function queryCoach(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCoach", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].id + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#coachId').html(htmlStr); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("cityCode", $('#cityCode').val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | function addPrice(){ |
| | | let cash = false; |
| | | let paiCoin = false; |
| | | $('input[name="payType"]:checked').each(function (index, e) { |
| | | let v = $(e).val(); |
| | | if(v == 1){ |
| | | cash = true; |
| | | } |
| | | if(v == 2){ |
| | | paiCoin = true; |
| | | } |
| | | }) |
| | | |
| | | let htmlStr = '' + |
| | | '<div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*课时数:</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <span class="classNumber_span"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> <span class="cash_span">\n'; |
| | | if(cash){ |
| | | htmlStr += '现金支付:<input class="cash" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥ \n'; |
| | | } |
| | | htmlStr += '</span> <span class="paiCoin_span">'; |
| | | if(paiCoin){ |
| | | htmlStr += '玩湃币支付:<input class="paiCoin" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币 \n'; |
| | | } |
| | | htmlStr += '</span> <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice(this)"></i>\n' + |
| | | '</div>\n' + |
| | | '</div>'; |
| | | $('#price').append(htmlStr); |
| | | } |
| | | |
| | | |
| | | function removePrice(e){ |
| | | $(e).parent('div').parent('div').remove(); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | $('#provinceCode').change(function () { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCity", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].code + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#cityCode').html(htmlStr); |
| | | |
| | | queryStore(); |
| | | queryCoach(); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("code", $(this).val()); |
| | | ajax.start(); |
| | | }) |
| | | |
| | | |
| | | $('#cityCode').change(function () { |
| | | queryStore(); |
| | | }) |
| | | |
| | | |
| | | $('#storeId').change(function () { |
| | | querySite(); |
| | | }) |
| | | |
| | | $('input[name="payType"]').click(function () { |
| | | $('input[name="payType"]').each(function (index, e) { |
| | | let v = $(e).val(); |
| | | if(v == 1) { |
| | | if (e.checked) { |
| | | $('span[class="cash_span"]').each(function (index, e) { |
| | | $(e).html('现金支付:<input class="cash" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> ¥ '); |
| | | }) |
| | | } else { |
| | | $('span[class="cash_span"]').each(function (index, e) { |
| | | $(e).html(''); |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if(v == 2){ |
| | | if (e.checked) { |
| | | $('span[class="paiCoin_span"]').each(function (index, e) { |
| | | $(e).html('玩湃币支付:<input class="paiCoin" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币 ') |
| | | }) |
| | | } else { |
| | | $('span[class="paiCoin_span"]').each(function (index, e) { |
| | | $(e).html(''); |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | |
| | | }); |
New file |
| | |
| | | /** |
| | | * 系统管理--用户管理的单例对象 |
| | | */ |
| | | let ExamineCoursePackage = { |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | ExamineCoursePackage.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'city', align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'store', align: 'center', valign: 'middle'}, |
| | | {title: '课包类型', field: 'coursePackageType', align: 'center', valign: 'middle'}, |
| | | {title: '课包名称', field: 'name', align: 'center', valign: 'middle'}, |
| | | {title: '最多预约人数', field: 'maxSubscribeNumber', align: 'center', valign: 'middle'}, |
| | | {title: '课程有效期', field: 'validDays', align: 'center', valign: 'middle'}, |
| | | {title: '支付方式', field: 'payType', align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', align: 'center', valign: 'middle'}, |
| | | {title: '审核状态', field: 'auditStatus', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | | return '待审核'; |
| | | case 3: |
| | | return '未通过'; |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | return columns; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | ExamineCoursePackage.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | ExamineCoursePackage.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 点击修改按钮时 |
| | | * @param userId 管理员id |
| | | */ |
| | | ExamineCoursePackage.examineCoursePackage = function () { |
| | | if (this.check()) { |
| | | if(ExamineCoursePackage.seItem.auditStatus != 1){ |
| | | Feng.error("不能重复审核"); |
| | | return |
| | | } |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="padding: 10px;">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*审核状态:</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <input name="auditStatus" type="radio" value="2"/> 通过 ' + |
| | | ' <input name="auditStatus" type="radio" value="3"/> 拒绝 ' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*拒绝理由:</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <textarea id="authRemark" style="width: 100%;height: 200px;" placeholder="请输入拒绝理由"></textarea>' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>'; |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '课包审核' |
| | | , area: ['800px', '400px'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['保存', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | let auditStatus = $('input[name="auditStatus"]:checked').val(); |
| | | if(typeof auditStatus == "undefined"){ |
| | | Feng.error("请选择审核结果"); |
| | | return |
| | | } |
| | | let authRemark = $('#authRemark').text(); |
| | | if(3 == auditStatus && '' == authRemark){ |
| | | Feng.error("请输入拒绝理由"); |
| | | return |
| | | } |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/setCoursePackageAuditStatus", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("审核成功!"); |
| | | layer.closeAll(); |
| | | ExamineCoursePackage.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("审核失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", ExamineCoursePackage.seItem.id); |
| | | ajax.set("auditStatus", auditStatus); |
| | | ajax.set("authRemark", authRemark); |
| | | ajax.start(); |
| | | }, |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | ExamineCoursePackage.detailsExamineCoursePackage = function () { |
| | | if (this.check()) { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/showExamineCoursePackageDetails?id=' + this.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | ExamineCoursePackage.resetSearch = function () { |
| | | $("#provinceCode").val(""); |
| | | $("#cityCode").val(""); |
| | | $("#coursePackageTypeId").val(""); |
| | | $("#name").val(""); |
| | | $("#auditStatus").val(""); |
| | | ExamineCoursePackage.search(); |
| | | } |
| | | |
| | | ExamineCoursePackage.search = function () { |
| | | let queryData = {}; |
| | | queryData['provinceCode'] = $("#provinceCode").val(); |
| | | queryData['cityCode'] = $("#cityCode").val(); |
| | | queryData['coursePackageTypeId'] = $("#coursePackageTypeId").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['auditStatus'] = $("#auditStatus").val(); |
| | | ExamineCoursePackage.table.refresh({query: queryData}); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | let defaultColunms = ExamineCoursePackage.initColumn(); |
| | | let table = new BSTable(ExamineCoursePackage.id, "/coursePackage/queryExamineCoursePackageLists", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | ExamineCoursePackage.table = table.init(); |
| | | |
| | | |
| | | $('#provinceCode').change(function () { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCity", function (data) { |
| | | let htmlStr = ''; |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i].code + '">' + data[i].name + '</option>' |
| | | } |
| | | $('#cityCode').html(htmlStr); |
| | | }, function (data) { |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("code", $(this).val()); |
| | | ajax.start(); |
| | | }) |
| | | }); |
New file |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var ExamineCoursePackageInfo = { |
| | | userInfoData: {}, |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | ExamineCoursePackageInfo.close = function () { |
| | | parent.layer.close(window.parent.ExamineCoursePackage.layerIndex); |
| | | }; |
| | | |
| | | |
| | | ExamineCoursePackageInfo.addSubmit = function () { |
| | | let auditStatus = $('input[name="auditStatus"]:checked').val();; |
| | | if(typeof auditStatus == "undefined"){ |
| | | Feng.error("请选择审核结果"); |
| | | return |
| | | } |
| | | let authRemark = $('#authRemark').text(); |
| | | if(3 == auditStatus && '' == authRemark){ |
| | | Feng.error("请输入拒绝理由"); |
| | | return |
| | | } |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/setCoursePackageAuditStatus", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("审核成功!"); |
| | | ExamineCoursePackageInfo.close(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("审核失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", $('#id').val()); |
| | | ajax.set("auditStatus", auditStatus); |
| | | ajax.set("authRemark", authRemark); |
| | | ajax.start(); |
| | | }; |
New file |
| | |
| | | /** |
| | | * 系统管理--用户管理的单例对象 |
| | | */ |
| | | let ManualReservation = { |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | ManualReservation.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所属用户', field: 'userName', align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'studentName', align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', align: 'center', valign: 'middle'}, |
| | | {title: '年龄', field: 'age', align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | if(v == 1){ |
| | | return '男'; |
| | | }else{ |
| | | return '女'; |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | return columns; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | ManualReservation.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | ManualReservation.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | ManualReservation.submit = function () { |
| | | if (this.check()) { |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/courseReservation", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("预约成功!"); |
| | | ManualReservation.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("预约失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("coursePackageSchedulingId", $('#id').val()); |
| | | ajax.set("coursePackagePaymentId", ManualReservation.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ManualReservation.resetSearch = function () { |
| | | $('#userName').val(''); |
| | | $('#studentName').val(''); |
| | | ManualReservation.search(); |
| | | } |
| | | |
| | | ManualReservation.search = function () { |
| | | let queryData = {}; |
| | | queryData['coursePackageSchedulingId'] = $('#id').val(); |
| | | queryData['userName'] = $('#userName').val(); |
| | | queryData['studentName'] = $('#studentName').val(); |
| | | ManualReservation.table.refresh({query: queryData}); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | let defaultColunms = ManualReservation.initColumn(); |
| | | let table = new BSTable(ManualReservation.id, "/coursePackage/queryWalkInStudentList", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | coursePackageSchedulingId: $('#id').val() |
| | | }) |
| | | ManualReservation.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 系统管理--用户管理的单例对象 |
| | | */ |
| | | let RegistrationRecord = { |
| | | id: "managerTable",//表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | let language =$("#language").val() |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | RegistrationRecord.initColumn = function () { |
| | | let columns = [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '购买用户', field: 'userName', align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', align: 'center', valign: 'middle'}, |
| | | {title: '购课学员', field: 'studentName', align: 'center', valign: 'middle'}, |
| | | {title: '报名时间', field: 'insertTime', align: 'center', valign: 'middle'}, |
| | | {title: '已上课时数', field: 'already', align: 'center', valign: 'middle'}, |
| | | {title: '缺课次数', field: 'absencesNumber', align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', align: 'center', valign: 'middle', |
| | | formatter: function (v) { |
| | | switch (v) { |
| | | case 1: |
| | | return '正常'; |
| | | case 2: |
| | | return '<a href="#" onclick="">已退课-查看凭证</a>'; |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | return columns; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | RegistrationRecord.check = function () { |
| | | let selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } else { |
| | | RegistrationRecord.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 上课记录 |
| | | */ |
| | | RegistrationRecord.classRecord = function () { |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '上课记录', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/openClassRecord?id=' + $('#id').val() |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 点击修改按钮时 |
| | | * @param userId 管理员id |
| | | */ |
| | | RegistrationRecord.dropClass = function () { |
| | | if (this.check()) { |
| | | if(ClassRecord.seItem.status == 2){ |
| | | Feng.error("不能重复退课"); |
| | | return |
| | | } |
| | | let htmlStr = |
| | | '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">课程名称:' + $("#name").text() + '</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">用户姓名:' + ClassRecord.seItem.userName + '</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">学员姓名:' + ClassRecord.seItem.studentName + '</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-8 control-label">*上传凭证:</label>\n' + |
| | | ' </div>' + |
| | | ' <div class="form-group">\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <img id="certificate" src="" style="height: 100px;">' + |
| | | ' <input type="file" id="file" style="display: none;"/>' + |
| | | ' <button onclick="uploadImgs()" style="width: 20px;padding: 10px; color: white;background-color: #0d8ddb;border-radius: 5px;"> 上传 </button>' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>'; |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '退课' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: htmlStr |
| | | , btn: ['保存', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | let certificate = $('#certificate').attr('img'); |
| | | if(null == certificate || '' == certificate){ |
| | | Feng.error("请上传凭证图片"); |
| | | return |
| | | } |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/dropTheClass", function (res) { |
| | | if(res.code == 200){ |
| | | Feng.success("退课成功!"); |
| | | layer.closeAll(); |
| | | RegistrationRecord.table.refresh(); |
| | | }else{ |
| | | Feng.error(res.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("退课失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("coursePackagePaymentId", ClassRecord.seItem.id); |
| | | ajax.set("certificate", certificate); |
| | | ajax.start(); |
| | | }, |
| | | }); |
| | | |
| | | $('#file').on('change', function () { |
| | | var formData = new FormData() //创建一个forData |
| | | formData.append('file', $('#file')[0].files[0]) //把file添加进去 name命名为img |
| | | layer.load(); //上传loading |
| | | $.ajax({ |
| | | url: Feng.ctxPath + '/mgr/uploadImg', |
| | | data: formData, |
| | | type: "POST", |
| | | async: true, |
| | | cache: false, |
| | | contentType: false, |
| | | processData: false, |
| | | success: function(res) { |
| | | layer.closeAll('loading'); //关闭loading |
| | | $('#file').val(''); |
| | | $('#certificate').attr('src', res); |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | function uploadImgs(){ |
| | | $('#file').click(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除用户 |
| | | */ |
| | | RegistrationRecord.makeUpMissedLessons = function () { |
| | | if (this.check()) { |
| | | let operation = function(){ |
| | | let ajax = new $ax(Feng.ctxPath + "/coursePackage/makeUpMissedLessons", function () { |
| | | Feng.success("补课成功!"); |
| | | RegistrationRecord.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("补课失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", RegistrationRecord.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | Feng.confirm("是否补课",operation); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | RegistrationRecord.resetSearch = function () { |
| | | $("#userName").val(""); |
| | | $("#studentName").val(""); |
| | | RegistrationRecord.search(); |
| | | } |
| | | |
| | | RegistrationRecord.search = function () { |
| | | let queryData = {}; |
| | | queryData['userName'] = $("#userName").val(); |
| | | queryData['studentName'] = $("#studentName").val(); |
| | | queryData['id'] = $('#id').val(); |
| | | RegistrationRecord.table.refresh({query: queryData}); |
| | | } |
| | | |
| | | |
| | | $(function () { |
| | | let defaultColunms = RegistrationRecord.initColumn(); |
| | | let table = new BSTable(RegistrationRecord.id, "/coursePackage/queryRegistrationRecord", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | id: $('#id').val() |
| | | }) |
| | | RegistrationRecord.table = table.init(); |
| | | }); |