Merge remote-tracking branch 'origin/master'
| | |
| | | import com.dsh.account.service.ICityManagerService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:06 |
| | |
| | | @RequestMapping("") |
| | | public class CityManagerController { |
| | | |
| | | @Resource |
| | | private ICityManagerService cityManagerService; |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.RecordAppoint; |
| | | import com.dsh.account.model.vo.classDetails.*; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "预约状态 0=全部 1=待上课 2=已完成 3=已取消", name = "appointStatus", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "时间类型 0=全部 1=近一周 2=近一个月 3=近一年", name = "appointStatus", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "时间类型 0=全部 1=近一周 2=近一个月 3=近一年", name = "timeType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "课程名称", name = "appointStatus", required = false, dataType = "string"), |
| | | }) |
| | | public ResultUtil<AppointmentRecordVo> cgeClassAppointmentRecordList(Integer stuId,Integer appointStatus,Integer timeType,String search){ |
| | | public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coach/queryCoachById") |
| | | public Coach queryCoachById( Integer id){ |
| | | public Coach queryCoachById(@RequestBody Integer id){ |
| | | try { |
| | | return service.getById(id); |
| | | }catch (Exception e){ |
| | |
| | | public class CourseOfStoreVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer courseId; |
| | | private Long courseId; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | |
| | | public static class CouList{ |
| | | |
| | | @ApiModelProperty(value = "课包ID") |
| | | Integer courseID; |
| | | Long courseID; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | String courseName; |
| | |
| | | |
| | | @ApiModelProperty(value = "课后视频标题") |
| | | private String videoName; |
| | | |
| | | @ApiModelProperty(value = "课后视频id") |
| | | private Integer videoId; |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.RecordAppoint; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailList; |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | AppointmentRecordVo getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search); |
| | | List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId, Integer appointStatus, Integer timeType, String search); |
| | | |
| | | ResultUtil cancelReservationOfCourse( Integer courseStuRecordId); |
| | | |
| | |
| | | } |
| | | } |
| | | classInfoVo.setCourseList(courseList); |
| | | List<ExerciseVideo> stuCourseOfVideoList = new ArrayList<>(); |
| | | ExerciseVideo video = new ExerciseVideo(); |
| | | video.setVideoUrl("https://media.w3.org/2010/05/sintel/trailer.mp4"); |
| | | video.setVideoCoverImgUrl("https://img1.baidu.com/it/u=1614146743,3691458181&fm=253&fmt=auto&app=120&f=JPEG?w=605&h=383"); |
| | | video.setVideoName("课后练习足球课"); |
| | | stuCourseOfVideoList.add(video); |
| | | |
| | | ExerciseVideo exerciseVideo = new ExerciseVideo(); |
| | | exerciseVideo.setVideoUrl("https://media.w3.org/2010/05/sintel/trailer.mp4"); |
| | | exerciseVideo.setVideoCoverImgUrl("https://img0.baidu.com/it/u=1492570361,4260963468&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500"); |
| | | exerciseVideo.setVideoName("篮球课"); |
| | | stuCourseOfVideoList.add(exerciseVideo); |
| | | // TODO: 2023/8/3 List<ExerciseVideo> stuCourseOfVideoList1 = voclClient.getStuCourseOfVideoList(); |
| | | List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds); |
| | | System.out.println(stuCourseOfVideoList); |
| | | classInfoVo.setExerciseVideoList(stuCourseOfVideoList); |
| | | }else { |
| | | classInfoVo.setIsThere(2); |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @param appointStatus 预约状态 0=全部 1=待上课 2=已完成 3=已取消 |
| | | * @param timeType 时间类型 0=全部 1=近一周 2=近一个月 3=近一年 |
| | | * @param search 课程名称 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppointmentRecordVo getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | AppointmentRecordVo recordVo = new AppointmentRecordVo(); |
| | | TStudent tStudent = this.baseMapper.selectOne(new QueryWrapper<TStudent>() |
| | | .eq("id",stuId ) |
| | | .eq("appUserId",appUserId)); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | recordVo.setStuId(tStudent.getId()); |
| | | recordVo.setStuName(tStudent.getName()); |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (ToolUtil.isEmpty(appointStatus)){ |
| | | recordVo.setAppointStatus(0); |
| | | }else { |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | public List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (recordAppoints.size() > 0) { |
| | | if (ToolUtil.isNotEmpty(appointStatus) && appointStatus != 0) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getStatus().equals(appointStatus)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(search)){ |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | if (ToolUtil.isNotEmpty(search)) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getCoursePackageName().contains(search)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(timeType)){ |
| | | |
| | | if (ToolUtil.isNotEmpty(timeType) && timeType != 0) { |
| | | Date lastOfDate = DateUtil.getLastOfDate(); |
| | | switch (timeType){ |
| | | switch (timeType) { |
| | | case 1: |
| | | Date lastWeekStartDate = DateUtil.getLastWeekStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 2: |
| | | Date lastMonthStartDate = DateUtil.getLastMonthStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 3: |
| | | Date lastYearStartDate = DateUtil.getLastYearStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | } |
| | | recordVo.setAppointList(recordAppoints); |
| | | } |
| | | return recordVo; |
| | | return recordAppoints; |
| | | } |
| | | |
| | | @Override |
| | |
| | | log_print("querySendDetails", response.getData()); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ALiSendSms sendSmsDemo = new ALiSendSms(); |
| | | try { |
| | | // 创建短信模板 |
| | | String templateCode = sendSmsDemo.addSmsTemplate(); |
| | | // 使用刚创建的短信模板发送短信 |
| | | String sData = sendSmsDemo.sendSms("156xxxxxxxx", templateCode, "{\"code\":\"8888\"}"); |
| | | Gson gson = new Gson(); |
| | | Map map = gson.fromJson(sData, Map.class); |
| | | String bizId = map.get("BizId").toString(); |
| | | // 根据短信发送流水号查询短信发送情况 |
| | | sendSmsDemo.querySendDetails(bizId); |
| | | } catch (ClientException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // public static void main(String[] args) { |
| | | // ALiSendSms sendSmsDemo = new ALiSendSms(); |
| | | // try { |
| | | // // 创建短信模板 |
| | | // String templateCode = sendSmsDemo.addSmsTemplate(); |
| | | // // 使用刚创建的短信模板发送短信 |
| | | // String sData = sendSmsDemo.sendSms("156xxxxxxxx", templateCode, "{\"code\":\"8888\"}"); |
| | | // Gson gson = new Gson(); |
| | | // Map map = gson.fromJson(sData, Map.class); |
| | | // String bizId = map.get("BizId").toString(); |
| | | // // 根据短信发送流水号查询短信发送情况 |
| | | // sendSmsDemo.querySendDetails(bizId); |
| | | // } catch (ClientException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | } |
| | |
| | | private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; |
| | | |
| | | public static void main(String args[]) { |
| | | |
| | | System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | System.out.println(MD5("123456")); |
| | | // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // s = KL(s); |
| | | // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // System.out.println("解密:" + JM(KL(s))); |
| | | // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | } |
| | | // public static void main(String args[]) { |
| | | // |
| | | // System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | // System.out.println(MD5("123456")); |
| | | // // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // // s = KL(s); |
| | | // // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // // System.out.println("解密:" + JM(KL(s))); |
| | | // // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | // } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | System.err.println(ce); |
| | | ResultUtil resultUtil = null; |
| | | try { |
| | | resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(resultUtil); |
| | | } |
| | | // public static void main(String[] ages){ |
| | | // PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | // ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | // System.err.println(ce); |
| | | // ResultUtil resultUtil = null; |
| | | // try { |
| | | // resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println(resultUtil); |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) throws Exception{ |
| | | String appId = "wx4f4bc4dec97d474b"; |
| | | String encryptedData = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="; |
| | | String sessionKey = "tiihtNczf5v6AKRyjwEUhQ=="; |
| | | String iv = "r7BXXKkLb8qrSNn05n0qiA=="; |
| | | System.out.println(decrypt(encryptedData, sessionKey, iv)); |
| | | } |
| | | // public static void main(String[] args) throws Exception{ |
| | | // String appId = "wx4f4bc4dec97d474b"; |
| | | // String encryptedData = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="; |
| | | // String sessionKey = "tiihtNczf5v6AKRyjwEUhQ=="; |
| | | // String iv = "r7BXXKkLb8qrSNn05n0qiA=="; |
| | | // System.out.println(decrypt(encryptedData, sessionKey, iv)); |
| | | // } |
| | | } |
| | |
| | | @ApiModelProperty(value = "性别(1=男,2=女)", dataType = "int", required = true) |
| | | private Integer gender; |
| | | @ApiModelProperty(value = "身高(CM)", dataType = "int", required = true) |
| | | private Integer height; |
| | | private String height; |
| | | @ApiModelProperty(value = "体重(KG)", dataType = "double", required = true) |
| | | private Double weight; |
| | | @ApiModelProperty(value = "联系电话", dataType = "string", required = false) |
| | |
| | | |
| | | Participant participant = new Participant(); |
| | | BeanUtils.copyProperties(addParticipant, participant); |
| | | participant.setHeight(Double.valueOf(addParticipant.getHeight()).intValue()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(ToolUtil.isNotEmpty(addParticipant.getBirthday())){ |
| | | Date parse = sdf.parse(addParticipant.getBirthday()); |
| | |
| | | private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; |
| | | |
| | | public static void main(String args[]) { |
| | | |
| | | System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | System.out.println(MD5("123456")); |
| | | // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // s = KL(s); |
| | | // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // System.out.println("解密:" + JM(KL(s))); |
| | | // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | } |
| | | // public static void main(String args[]) { |
| | | // |
| | | // System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | // System.out.println(MD5("123456")); |
| | | // // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // // s = KL(s); |
| | | // // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // // System.out.println("解密:" + JM(KL(s))); |
| | | // // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | // } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | System.err.println(ce); |
| | | ResultUtil resultUtil = null; |
| | | try { |
| | | resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(resultUtil); |
| | | } |
| | | // public static void main(String[] ages){ |
| | | // PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | // ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | // System.err.println(ce); |
| | | // ResultUtil resultUtil = null; |
| | | // try { |
| | | // resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println(resultUtil); |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | a.registerCondition, |
| | | a.introduction, |
| | | DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') as registerEndTime, |
| | | CONCAT(a.startAge, '-', a.endAge) as age, |
| | | |
| | | (a.baseNumber + a.applicantsNumber) as heat |
| | | CONCAT(a.startAge, '-', a.endAge) as `age`, |
| | | (a.baseNumber + a.applicantsNumber) as `heat` |
| | | from t_competition a |
| | | where a.auditStatus = 2 and a.`status` = 2 and a.state = 1 |
| | | <if test="null != cityCode and '' != cityCode"> |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.account.AppUserClient; |
| | |
| | | @Autowired |
| | | private CancelledClassesService cancelledClassesService; |
| | | |
| | | @Resource |
| | | private CoursePackageStudentService cspsService; |
| | | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Resource |
| | |
| | | .groupBy("coursePackageId")); |
| | | if (list.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | CoursePackagePaymentConfig paymentConfig = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId",tCoursePackage.getId() ) |
| | | .eq("classHours",tCoursePackagePayment.getClassHours())); |
| | | CoursePackageStudent packageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getAppUserId, courseRest.getAppUserId()) |
| | | .eq(CoursePackageStudent::getStudentId,courseRest.getStuId()) |
| | | .eq(CoursePackageStudent::getCoursePackagePaymentId,tCoursePackagePayment.getId()) |
| | | .eq(CoursePackageStudent::getCoursePackageId,tCoursePackagePayment.getCoursePackageId())); |
| | | if (ToolUtil.isEmpty(packageStudent) || (ToolUtil.isNotEmpty(packageStudent) && packageStudent.getReservationStatus() != 1)){ |
| | | // 没有预约过的/已经取消了的 |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | CoursePackagePaymentConfig paymentConfig = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId",tCoursePackage.getId() ) |
| | | .eq("classHours",tCoursePackagePayment.getClassHours())); |
| | | // 获取课程有效结束时间,判断 查询的日期parse 是否在有效期范围内 |
| | | Date expirationDate = DateTimeHelper.getExpirationDate(tCoursePackagePayment.getInsertTime(),tCoursePackage.getValidDays()); |
| | | System.out.println(expirationDate.after(parse)); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); |
| | | if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ |
| | | CourseOfStoreVo storeVo = new CourseOfStoreVo(); |
| | | storeVo.setCourseId(tCoursePackage.getId()); |
| | | storeVo.setCourseName(tCoursePackage.getName()); |
| | | storeVo.setClassStartTime(tCoursePackage.getClassStartTime()); |
| | | storeVo.setClassEndTime(tCoursePackage.getClassEndTime()); |
| | | storeVo.setStoreId(tCoursePackage.getStoreId()); |
| | | Store store = sreClient.queryStoreById(tCoursePackage.getStoreId()); |
| | | storeVo.setStoreAddress(store.getAddress()); |
| | | storeVo.setLat(store.getLat()); |
| | | storeVo.setLon(store.getLon()); |
| | | storeVo.setCoursePrice(ToolUtil.isEmpty(paymentConfig.getCashPayment()) ? (double) paymentConfig.getPlayPaiCoin():paymentConfig.getCashPayment()); |
| | | course.add(storeVo); |
| | | Date expirationDate = DateTimeHelper.getExpirationDate(tCoursePackagePayment.getInsertTime(),tCoursePackage.getValidDays()); |
| | | System.out.println(expirationDate.after(parse)); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); |
| | | if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ |
| | | CourseOfStoreVo storeVo = new CourseOfStoreVo(); |
| | | storeVo.setCourseId(packageStudent.getId()); |
| | | storeVo.setCourseName(tCoursePackage.getName()); |
| | | storeVo.setClassStartTime(tCoursePackage.getClassStartTime()); |
| | | storeVo.setClassEndTime(tCoursePackage.getClassEndTime()); |
| | | storeVo.setStoreId(tCoursePackage.getStoreId()); |
| | | Store store = sreClient.queryStoreById(tCoursePackage.getStoreId()); |
| | | storeVo.setStoreAddress(store.getAddress()); |
| | | storeVo.setLat(store.getLat()); |
| | | storeVo.setLon(store.getLon()); |
| | | storeVo.setCoursePrice(ToolUtil.isEmpty(paymentConfig.getCashPayment()) ? (double) paymentConfig.getPlayPaiCoin():paymentConfig.getCashPayment()); |
| | | course.add(storeVo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "coursePayId" ,value = "课包记录id",dataType = "long"), |
| | | }) |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData( Integer coursePayId){ |
| | | public ResultUtil<CourseDetailsResponse> getRegisteredData(Long coursePayId){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | |
| | | .eq("code",code)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上课主页-预约操作 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/reverse") |
| | | @ApiOperation(value = "上课主页-预约操作", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "上课记录id", name = "coursePackId", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "时间 yyyy-MM-dd", name = "time", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "学员id", name = "time", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil reverse(String courseID,String time,Integer stuId){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | CoursePackageStudent coursePackageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getId,courseID) |
| | | .eq(CoursePackageStudent::getAppUserId,appUserId) |
| | | .eq(CoursePackageStudent::getStudentId,stuId)); |
| | | if (ToolUtil.isEmpty(coursePackageStudent)){ |
| | | ResultUtil.error("该用户未购买该课包"); |
| | | } |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.updateById(coursePackageStudent); |
| | | |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public class CourseOfStoreVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer courseId; |
| | | private Long courseId; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | |
| | | |
| | | @ApiModelProperty(value = "课后视频标题") |
| | | private String videoName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "课后视频id") |
| | | private Integer videoId; |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "支付状态 1未支付 2已支付") |
| | | private Integer payStatus; |
| | | |
| | | @ApiModelProperty(value = "课包类型id") |
| | | private Integer coursePackTypeId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "课程介绍图片") |
| | | private String detailedDiagram; |
| | | |
| | | @ApiModelProperty("封面图") |
| | | private String cover; |
| | | |
| | | } |
| | |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | CourseDetailsResponse queryRegisteredCourseDetails(Integer coursePayId, Integer appUserId); |
| | | CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId); |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.service.impl.ServiceImpl; |
| | |
| | | queryWrapper.in(PostCourseVideo::getCoursePackageId,courseIds); |
| | | } |
| | | videoList = pcvMapper.selectList(queryWrapper); |
| | | // TODO: 2023/8/3 始终查出来是 空的 |
| | | System.out.println(videoList); |
| | | if (videoList.size() > 0){ |
| | | List<Integer> videoIds = videoList.stream().map(PostCourseVideo::getCourseId).collect(Collectors.toList()); |
| | | List<UserVideoDetails> userVideoDetails = uvdmapper.selectList(new QueryWrapper<UserVideoDetails>() |
| | |
| | | BenefitsVideos videosWithIds = bfvoClient.getVideosWithIds(userVideoDetail.getCourseId()); |
| | | response.setVideoId(userVideoDetail.getCourseId()); |
| | | response.setCoverImage(videosWithIds.getCover()); |
| | | if (null != search.getSearch()){ |
| | | // 根据正则模糊匹配 |
| | | String pattern = ".*" + search.getSearch() + ".*"; |
| | | Pattern regex = Pattern.compile(pattern); |
| | | Matcher matcher = regex.matcher(videosWithIds.getName()); |
| | | if (matcher.matches()) { |
| | | response.setVideoName(videosWithIds.getName()); |
| | | } |
| | | }else { |
| | | response.setVideoName(videosWithIds.getName()); |
| | | } |
| | | response.setVideoName(videosWithIds.getName()); |
| | | response.setSynopsis(videosWithIds.getIntroduction()); |
| | | response.setIntegral(videosWithIds.getIntegral()); |
| | | response.setStudyStatus(userVideoDetail.getState()); |
| | | responses.add(response); |
| | | } |
| | | Collections.sort(responses, Comparator.comparing(AppUserVideoResponse::getStudyStatus)); |
| | | } |
| | | if (ToolUtil.isNotEmpty(search.getSearch())){ |
| | | responses = responses.stream() |
| | | .filter(person -> person.getPackageName().contains(search.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (ToolUtil.isNotEmpty(search.getCourseTypeId())){ |
| | | responses = responses.stream() |
| | | .filter(person -> Objects.equals(person.getCoursePackageId(), search.getCourseTypeId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return responses; |
| | |
| | | response.setPackageName(coursePackage.getName()); |
| | | response.setSynopsis(videosWithIds.getIntroduction()); |
| | | response.setDetailedDiagram(coursePackage.getIntroduceDrawing()); |
| | | response.setCover(videosWithIds.getCover()); |
| | | } |
| | | |
| | | return response; |
| | |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = this.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId )); |
| | | System.out.println(tCoursePackagePayments); |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | RegisterCourseVo registerCourseVo = new RegisterCourseVo(); |
| | | registerCourseVo.setCoursePayId(tCoursePackagePayment.getId()); |
| | | registerCourseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | registerCourseVo.setCoursePackTypeId(coursePackage.getCoursePackageTypeId()); |
| | | registerCourseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | String storeAndCourse = coursePackage.getName()+"("+ store.getName() +")"; |
| | | registerCourseVo.setCourseNameStore(storeAndCourse); |
| | | registerCourseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | Coach coach = coachClient.queryCoachById(coursePackage.getCoachId()); |
| | | registerCourseVo.setCourseTeacher(coach.getName()); |
| | | registerCourseVo.setCourseTeacher(ToolUtil.isEmpty(coach) ? "" : coach.getName()); |
| | | List<CoursePackageStudent> coursePackageStudents = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId",coursePackage.getId()) |
| | | .eq("studentId",appUserId )); |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | if (coursePackageStudents.size() > 0 ){ |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | } |
| | | registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | courseVos.add(registerCourseVo); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(courseTypeId.getSearch())){ |
| | | courseVos = courseVos.stream() |
| | | .filter(person -> person.getCourseNameStore().contains(courseTypeId.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(courseTypeId.getCourseTypeId())){ |
| | | courseVos = courseVos.stream() |
| | | .filter(person -> Objects.equals(person.getCoursePackTypeId(), courseTypeId.getCourseTypeId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | if (courseVos.size() > 0 ){ |
| | | courseVos = courseVos.stream() |
| | | .sorted(Comparator.comparingInt(person -> person.getPayStatus() == 1 ? -1 : 1)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | return courseVos; |
| | | } |
| | | |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Integer coursePayId, Integer appUserId) { |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId) { |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(coursePayId); |
| | | |
| | |
| | | recordVo.setCourseStuRecordId(coursePackageStudent.getId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | String[] split = classWeeks.split(";"); |
| | | List<Integer> integerList = Arrays.stream(split) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | int dayOfWeek = DateTimeHelper.getDayOfWeek(new Date()); |
| | | List<String> integerList = Arrays.asList(split); |
| | | String weekOfDate = DateTimeHelper.getWeekOfDate(new Date()); |
| | | |
| | | if (integerList.contains(dayOfWeek)){ |
| | | if (integerList.contains(weekOfDate)){ |
| | | String dat = simpleDateFormat.format(date) +" "+ classStartTime; |
| | | |
| | | Date start = null; |
| | |
| | | private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; |
| | | |
| | | public static void main(String args[]) { |
| | | |
| | | System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | System.out.println(MD5("123456")); |
| | | // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // s = KL(s); |
| | | // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // System.out.println("解密:" + JM(KL(s))); |
| | | // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | } |
| | | // public static void main(String args[]) { |
| | | // |
| | | // System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | // System.out.println(MD5("123456")); |
| | | // // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // // s = KL(s); |
| | | // // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // // System.out.println("解密:" + JM(KL(s))); |
| | | // // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | // } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | System.err.println(ce); |
| | | ResultUtil resultUtil = null; |
| | | try { |
| | | resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(resultUtil); |
| | | } |
| | | // public static void main(String[] ages){ |
| | | // PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | // ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | // System.err.println(ce); |
| | | // ResultUtil resultUtil = null; |
| | | // try { |
| | | // resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println(resultUtil); |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | <mapper namespace="com.dsh.course.mapper.PostCourseVideoMapper"> |
| | | |
| | | <select id="queryCourseOfVideos" resultType="com.dsh.course.feignclient.model.ExerciseVideo"> |
| | | SELECT tc.introduce as videoName, tc.coverDrawing as videoCoverImgUrl, tc.courseVideo as videoUrl |
| | | SELECT tc.introduce as videoName, tc.coverDrawing as videoCoverImgUrl, tc.courseVideo as videoUrl, |
| | | courseId as videoId,coursePackageId |
| | | FROM t_post_course_video tpcv |
| | | LEFT JOIN t_course tc on tc.id = tpcv.courseId |
| | | where tc.state = 1 |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCity(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode); |
| | | |
| | | List<Map<String, Object>> queryListOfpage(@Param("provinceCode") String provinceCode, |
| | | @Param("cityCode") String cityCode, |
| | | @Param("cityManagerId") Integer cityManagerId, |
| | | @Param("storeName") String storeName, |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public void main(String[] ages){ |
| | | try { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // public void main(String[] ages){ |
| | | // try { |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.CouponListOfSearch; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.Region; |
| | | import com.dsh.guns.modular.system.service.IRegionService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.util.OBSUploadUtil; |
| | | import org.apache.commons.beanutils.ConvertUtils; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | private IRegionService regiService; |
| | | |
| | | @Resource |
| | | private IStoreService storeService; |
| | | |
| | | @Resource |
| | | private CouponClient client; |
| | | |
| | | @Resource |
| | | private CityManagerClient cmgrClient; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到优惠券管理首页 |
| | |
| | | |
| | | |
| | | /** |
| | | * 跳转到优惠券管理首页 |
| | | * 跳转到门店管理列表页 |
| | | */ |
| | | @RequestMapping("/storeList") |
| | | public String storePage(Model model) { |
| | | return PREFIX + "TStoreList.html"; |
| | | } |
| | | |
| | | @RequestMapping("/storeDetailsOfSearch") |
| | | @ResponseBody |
| | | public Object listOfStore(Integer provinceId,Integer cityId,Integer cityManagerId,String storeName){ |
| | | System.out.println("provinceId"+provinceId); |
| | | System.out.println("cityId"+cityId); |
| | | System.out.println("cityManagerId"+cityManagerId); |
| | | System.out.println("storeName"+storeName); |
| | | String provinceCode = null; |
| | | String cityCode = null; |
| | | if (ToolUtil.isNotEmpty(provinceId)){ |
| | | Region provinceRegion = regiService.getById(provinceId); |
| | | provinceCode = provinceRegion.getCode(); |
| | | } |
| | | if (ToolUtil.isNotEmpty(cityId)){ |
| | | Region cityRegion = regiService.getById(cityId); |
| | | provinceCode = cityRegion.getCode(); |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String,Object>> storeList = storeService.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); |
| | | if (storeList.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : storeList) { |
| | | String provinceName = (String) stringObjectMap.get("province"); |
| | | String cityName = (String) stringObjectMap.get("city"); |
| | | stringObjectMap.put("provinceCity",provinceName+cityName); |
| | | Integer managerId = (Integer) stringObjectMap.get("cityManagerId"); |
| | | CityManager cityManager = cmgrClient.queryCityManagerById(managerId); |
| | | if (ToolUtil.isNotEmpty(cityManager)){ |
| | | stringObjectMap.put("accountName",cityManager.getName()+"+"+cityManager.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return storeList; |
| | | } |
| | | |
| | | /** |
| | | * 获取 优惠券管理 |
| | |
| | | System.out.println(map); |
| | | return url; |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | @RequestMapping(value = "/commitData") |
| | | public void commitData(){ |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCity(String provinceCode, String cityCode); |
| | | |
| | | List<Map<String, Object>> queryListOfpage(String provinceCode, String cityCode, Integer cityManagerId, String storeName, Page<Map<String, Object>> page); |
| | | |
| | | } |
| | |
| | | public List<Map<String, Object>> queryCity(String provinceCode, String cityCode) { |
| | | return this.baseMapper.queryCity(provinceCode, cityCode); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryListOfpage(String provinceCode, String cityCode, Integer cityManagerId, String storeName, Page<Map<String, Object>> page) { |
| | | return this.baseMapper.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); |
| | | } |
| | | } |
| | |
| | | group by cityCode |
| | | ) as aa order by aa.code |
| | | </select> |
| | | <select id="queryListOfpage" resultType="java.util.Map"> |
| | | SELECT id, cityManagerId, province, city, `name` |
| | | from t_store |
| | | where 1=1 |
| | | <if test="provinceCode != null"> |
| | | and provinceCode = #{provinceCode} |
| | | </if> |
| | | <if test="cityCode != null"> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | <if test="cityManagerId != null"> |
| | | and cityManagerId = #{cityManagerId} |
| | | </if> |
| | | <if test="storeName != null and storeName != ' '"> |
| | | and `name` like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*兑换方式: </label> |
| | | <input class="col-sm-1 control-label" onclick="exchangeMethod1()" id="exchangeMethod" type="radio" |
| | | <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> |
| | | <input class="col-sm-1 control-label" id="exchangeMethod" onclick="exchangeMethod2()" type="radio" |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> |
| | | <input class="col-sm-1 control-label" id="exchangeMethod" onclick="exchangeMethod3()" type="radio" |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod3()" type="radio" |
| | | value="3" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 9%;margin-top: 7px">现金</label> |
| | | </div> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3">*适用范围: </label> |
| | | <div class="col-sm-3" id="belongsNationwide" hidden="hidden"> |
| | | <input class="col-sm-1" onclick="scopeOfApplication1()" id="company" type="radio" |
| | | <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" |
| | | value="0" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-2" style="width: 68%;margin-top: 7px">全国通用</label> |
| | | </div> |
| | | <div class="col-sm-3" id="belongsCity" hidden="hidden"> |
| | | <input class="col-sm-1" id="company" onclick="scopeOfApplication2()" type="radio" |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" |
| | | value="1" style="margin-top: 10px"/> |
| | | <label class="col-sm-2" style="width: 64%;margin-top: 7px">指定城市</label> |
| | | </div> |
| | | <div class="col-sm-3" id="belongsStore" hidden="hidden"> |
| | | <input class="col-sm-1" id="company" onclick="scopeOfApplication3()" type="radio" |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" |
| | | value="1" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-2" style="width: 64%;margin-top: 6px;">指定门店</label> |
| | | </div> |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="所在省" > |
| | | <#SelectCon id="province" name="所在省" > |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="distributionMethod" name="所在市" > |
| | | <#SelectCon id="city" name="所在市" > |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="门店名称" placeholder="请输入门店名称"/> |
| | | <#NameCon id="storeName" name="门店名称" placeholder="请输入门店名称"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TStoreProvince.search()"/> |
| | |
| | | * 提交 |
| | | */ |
| | | couponInfoDlg.addSubmit = function () { |
| | | |
| | | var resultData = {}; |
| | | // 用户权限 |
| | | var userType = $('#userType').val(); |
| | | // 优惠券名称 |
| | | var couponName = $('#name').val; |
| | |
| | | // 所需积分 |
| | | var requiredPoints = $('#requiredPoints').val(); |
| | | // 用户人群 |
| | | var userGroup = $('#userGroup').val(); |
| | | let userGroup = $(':radio[name="userGroup"]:checked').val(); |
| | | |
| | | // 发放数量 |
| | | var quantityIssued = $('#quantityIssued').val(); |
| | | // 限领数量 |
| | |
| | | |
| | | if (userType === '1'){ |
| | | // 平台管理员 |
| | | var exchangeMethod = $('#exchangeMethod').val; |
| | | // 兑换方式:积分+现金 |
| | | let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val(); |
| | | |
| | | if (exchangeMethod === 1){ |
| | | |
| | | } |
| | |
| | | } |
| | | var goodImg = this.goodsCover; |
| | | var goodImgs = this.goodsPicArray; |
| | | var company = $('#company').val; |
| | | if (company === 1){ |
| | | |
| | | } |
| | | // 适用范围 全国+指定城市+指定门店 |
| | | let company = $(':radio[name="company"]:checked').val() |
| | | if (company === 2){ |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | commitAJAX(resultData); |
| | | } |
| | | if (userType === '2'){ |
| | | // 城市管理员 |
| | |
| | | } |
| | | |
| | | |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val; |
| | | } |
| | | |
| | | function commitAJAX(obj){ |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/commitData", function (data) { |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCoupon.table.refresh(); |
| | | couponInfoDlg.close(); |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("dataResult", JSON.parse(obj)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所属账号', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'useScope', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] |
| | | } |
| | | }, |
| | | {title: '门店名称', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "满减券", 2: "代金券", 3: "体验券"}[value] |
| | | }}, |
| | | {title: '所属账号', field: 'accountName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | ]; |
| | | }; |
| | | |
| | |
| | | |
| | | |
| | | function storeOfClosePage(){ |
| | | |
| | | parent.layer.close(window.parent.couponInfoDlg.layerIndex); |
| | | } |
| | | |
| | | function saveSelectStores(){ |
| | |
| | | */ |
| | | TStoreProvince.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['distributionMethod'] = $("#distributionMethod").val(); |
| | | queryData['userPopulation'] = $("#userPopulation").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | |
| | | var provinceElement = document.getElementById("province"); |
| | | var provinceId = provinceElement.value; |
| | | |
| | | var cityElement = document.getElementById("city"); |
| | | var cityElementId = cityElement.value; |
| | | |
| | | queryData['provinceId'] = provinceId; |
| | | queryData['cityId'] = cityElementId; |
| | | queryData['cityManagerId'] = $("#userPopulation").val(); |
| | | queryData['storeName'] = $("#storeName").val(); |
| | | TStoreProvince.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | |
| | | * 重置搜索 |
| | | */ |
| | | TStoreProvince.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | $("#distributionMethod").val(''); |
| | | var provinceSelect = document.getElementById("province"); |
| | | provinceSelect.innerHTML = '<option value="">全部</option>'; |
| | | |
| | | var citySelect = document.getElementById("city"); |
| | | citySelect.innerHTML = '<option value="">全部</option>'; |
| | | |
| | | queryProvince(); |
| | | |
| | | $("#userPopulation").val(''); |
| | | $("#status").val(''); |
| | | $("#state").val(''); |
| | | $("#storeName").val(''); |
| | | TStoreProvince.search(); |
| | | }; |
| | | |
| | | function queryProvince(){ |
| | | // 发送AJAX请求到后台获取省份数据 |
| | | // 假设后台返回的数据格式为一个包含省份ID和名称的数组 |
| | | var provinceSelect = document.getElementById("province"); |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | provinceSelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | Feng.error("下拉失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | provinceSelect.addEventListener("change", queryCity); |
| | | } |
| | | |
| | | |
| | | // 获取城市数据 |
| | | function queryCity() { |
| | | var selectedProvinceId = this.value; // 获取选择的省份ID |
| | | // 发送AJAX请求到后台获取对应省份的城市数据 |
| | | // 假设后台返回的数据格式为一个包含城市ID和名称的数组 |
| | | |
| | | var citySelect = document.getElementById("city"); |
| | | citySelect.innerHTML = ""; |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | citySelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | console.log('data:',data) |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('province',selectedProvinceId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TStoreProvince.initColumn(); |
| | | var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeList", defaultColunms); |
| | | var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TStoreProvince.table = table.init(); |
| | | |
| | | |
| | | queryProvince(); |
| | | }); |
| | |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/store/queryStoreById") |
| | | public Store queryStoreById(@RequestBody Integer id){ |
| | | try { |
| | | return storeService.getById(id); |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String a ="2023-07-28 10:30-15:30"; |
| | | String substring = a.substring(0,a.lastIndexOf("-")); |
| | | System.out.println(substring); |
| | | } |
| | | |
| | | /** |
| | | * 课程微信支付 |
| | | * @param paymentPrice |
| | |
| | | private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; |
| | | |
| | | public static void main(String args[]) { |
| | | |
| | | System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | System.out.println(MD5("123456")); |
| | | // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // s = KL(s); |
| | | // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // System.out.println("解密:" + JM(KL(s))); |
| | | // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | } |
| | | // public static void main(String args[]) { |
| | | // |
| | | // System.out.println("MD5后再加密:" + KL(MD5("123456"))); |
| | | // System.out.println(MD5("123456")); |
| | | // // System.out.println("加密:" + KL(MD5("123456"))); |
| | | // // s = KL(s); |
| | | // // System.out.println("解密:" + KL("81dc9bdb52d04dc20036dbd8313ed055")); |
| | | // // System.out.println("解密:" + JM(KL(s))); |
| | | // // System.out.println("解密为MD5后的:" + KL(KL(MD5(s)))); |
| | | // // System.out.println(JM("5d62957bb57d3e49dcf48a0df064be4c")); |
| | | // // System.out.println(MD5AndKL.KL(MD5AndKL.MD5("admin"+"87654321"))); |
| | | // } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | System.err.println(ce); |
| | | ResultUtil resultUtil = null; |
| | | try { |
| | | resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(resultUtil); |
| | | } |
| | | // public static void main(String[] ages){ |
| | | // PayMoneyUtil payMoneyUtil = new PayMoneyUtil(); |
| | | // ResultUtil ce = payMoneyUtil.alipay("测试", "测试", "", "121456457", "10", "http://123.com"); |
| | | // System.err.println(ce); |
| | | // ResultUtil resultUtil = null; |
| | | // try { |
| | | // resultUtil = payMoneyUtil.queryALIOrder("121456457"); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println(resultUtil); |
| | | // } |
| | | |
| | | |
| | | /** |