| | |
| | | |
| | | @Autowired |
| | | private TAppGiftService appGiftService; |
| | | |
| | | /** |
| | | * 根据介绍有礼id查询当前活动参与次数 |
| | | */ |
| | |
| | | .size(); |
| | | return activityId1; |
| | | } |
| | | |
| | | /** |
| | | * 介绍有礼 -- 参与用户列表 |
| | | */ |
| | |
| | | public List<IntroduceUser> queryIntroduceAll(@RequestBody IntroduceUserQuery query){ |
| | | return appGiftService.queryIntroduceAll(query); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有用户 |
| | | */ |
| | |
| | | public List<TAppUser> queryAPPUserByNameAndPhone(@RequestBody AppUserByNameAndPhoneDTO dto){ |
| | | return appUserService.queryAPPUserByNameAndPhone(dto); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | TAppUser appUser = appUserService.getById(appUserId); |
| | | return appUser; |
| | | } |
| | | |
| | | /** |
| | | * 冻结/解冻 1=解冻 2=冻结 |
| | | */ |
| | |
| | | public Object changeState(@RequestBody AdvertisementChangeStateDTO dto){ |
| | | return appUserService.changeState(dto); |
| | | } |
| | | |
| | | /** |
| | | * 后台添加 |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private TStudentService studentService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/logOff") |
| | | @ApiOperation(value = "注销", tags = {"注销"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/loginSMSCode") |
| | | @ApiOperation(value = "短信验证码登录", tags = {"APP-登录注册"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/bind") |
| | | @ApiOperation(value = "微信登录绑定手机号", tags = {"APP-登录注册"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/appUser/updateInfo") |
| | | @ApiOperation(value = "修改个人信息", tags = {"APP-登录注册"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/appUser/queryJoinPlayPai") |
| | | @ApiOperation(value = "获取加入玩湃首页数据", tags = {"APP-加入玩湃"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 购买年度会员支付微信回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 购买年度会员支付支付宝回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private UserIntegralChangesService userIntegralChangesService; |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param appUser |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索用户 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | public List<TAppUser> queryAppUserListByName(@RequestBody String name){ |
| | | return appUserService.list(new QueryWrapper<TAppUser>().eq("state", 1).like("name", name)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/appUser/addCourseInfoRecord") |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/city/unfreeze") |
| | | public void unfreeze(@RequestBody Integer id){ |
| | | try { |
| | |
| | | public CityManager getStoreById(@RequestParam Integer id){ |
| | | return cityManagerService.getOne(new QueryWrapper<CityManager>().eq("id",id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取已有城市管理的省、市 |
| | | */ |
| | |
| | | public List<CityManager> listAll(){ |
| | | return cityManagerService.listAll(); |
| | | } |
| | | |
| | | /** |
| | | * 选择省 展示市 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | private TAppGiftService appGiftService; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/queryStudentData") |
| | | @ApiOperation(value = "上课首页", tags = {"APP-开始上课"}) |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/weeksOfCourseDetailsList") |
| | | @ApiOperation(value = "上课首页-课程列表2.0", tags = {"APP-开始上课"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 编辑学员详情 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 提交编辑学员 |
| | | */ |
| | |
| | | TStudent tStudent = new TStudent(); |
| | | |
| | | |
| | | |
| | | |
| | | tStudent.setId(stu.getStuId()); |
| | | tStudent.setBirthday(format.parse(stu.getBirthday())); |
| | | tStudent.setHeadImg(stu.getHeadImg()); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课时详情 |
| | | */ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-支付 |
| | | */ |
| | |
| | | try { |
| | | |
| | | |
| | | |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | |
| | | @ApiImplicitParam(value = "课程名称", name = "appointStatus", required = false, dataType = "string"), |
| | | }) |
| | | public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search,Integer pageNum){ |
| | | // try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.getAppointmentRecords(stuId,appUserId,appointStatus,timeType,search,pageNum)); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索数据 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | public List<Coach> queryCoachListByName(@RequestBody String name){ |
| | | return service.list(new QueryWrapper<Coach>().like("name",name)); |
| | | } |
| | | /**根据运营商id查询教练 |
| | | |
| | | /** |
| | | * 根据运营商id查询教练 |
| | | */ |
| | | @PostMapping("/coach/queryCoachByOperatorId") |
| | | @ResponseBody |
| | |
| | | } |
| | | return coachSerchVOS; |
| | | } |
| | | |
| | | /** |
| | | * 上/下架、删除常见问题 type=1为上架 2为下架 |
| | | */ |
| | |
| | | |
| | | return service.changeState(vo); |
| | | } |
| | | |
| | | /** |
| | | * 添加教练 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/site/addCoach") |
| | |
| | | return service.save(coach); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取所有省 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据门店 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取城市下的所有教练 |
| | | * |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据门店 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增教练类型 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | return 200; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除教练类型 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改教练类型 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-公告列表", tags = {"APP-探索玩湃"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | return rechargeRecordsVOS; |
| | | } |
| | | |
| | | /** |
| | | * 数据统计-充值记录列表数据 |
| | | */ |
| | |
| | | } |
| | | return payStatus; |
| | | } |
| | | |
| | | /** |
| | | * 加入会员列表数据 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 兑换商品支付的微信回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 兑换商品支付的支付宝回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加学员 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/student/addStudent") |
| | |
| | | student.setIsDefault(1); |
| | | return studentService.save(student); |
| | | } |
| | | |
| | | /** |
| | | * 获取有学员的用户ids |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | public List<Integer> getHasStudentUser(){ |
| | | return studentService.list(new QueryWrapper<TStudent>()).stream().map(TStudent::getAppUserId).distinct().collect(Collectors.toList()); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户学员列表 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | studentService.updateById(student); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据电话号码学员信息 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索学员 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | public List<TStudent> queryStudentListByName(@RequestBody String name){ |
| | | return studentService.list(new QueryWrapper<TStudent>().eq("state", 1).like("name", name)); |
| | | } |
| | | |
| | | /** |
| | | * 根据名称模糊搜索学员 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Resource |
| | | private CoursePaymentClient paymentClient; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/giftSelect") |
| | | public List<SelectDto> giftSelect(@RequestBody GiftSearchDto giftSearchDto){ |
| | |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserYYs") |
| | | @ResponseBody |
| | | public List<Integer> getUserYYs(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserStore") |
| | | @ResponseBody |
| | | public List<Integer> getUserStore(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 3).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @PostMapping("/student/getUserYys") |
| | | @ResponseBody |
| | | public List<Integer> getUserYys(@RequestBody Integer id){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 2).eq(TAppUser::getAddUserId,id)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/getUserPtVip") |
| | | public List<Integer> getUserPtVip(){ |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().eq(TAppUser::getInsertType, 1).eq(TAppUser::getIsVip,1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/stuPt") |
| | | public HashMap<String, Object> stuPt(){ |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/stuYys") |
| | | public HashMap<String, Object> stuYys(@RequestBody Integer id){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private EvaluateStudentService evaluateStudentService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/save") |
| | | public void save(@RequestBody EvaluateStudent evaluateStudent) { |
| | |
| | | evaluateStudentService.saveOrUpdate(evaluateStudent); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/userAndVipStore") |
| | | public HashMap<String, Object> userAndVipStore(@RequestBody Integer id){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/student/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | map.put("fee2",sum1); |
| | | |
| | | |
| | | |
| | | |
| | | return map; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/student/queryUserAge") |
| | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/student/queryUserAge1") |
| | | public HashMap<String, Object> queryUserAge1(){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/student/queryUserAgeYys") |
| | | public HashMap<String, Object> queryUserAgeYys(@RequestBody Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @PostMapping("/student/queryUserAgeStore") |
| | | public HashMap<String, Object> queryUserAgeStore(Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @PostMapping("/student/queryUserAgeYys1") |
| | | public HashMap<String, Object> queryUserAgeYys1(@RequestBody Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/student/queryUserAgeStore1") |
| | | public HashMap<String, Object> queryUserAgeStore1(@RequestBody Integer id){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | |
| | | if (null != tAppUser){ |
| | | detailsVo.setUserId(appUserId); |
| | | if (tAppUser.getHeadImg()!=null){ |
| | | detailsVo.setUserImage(tAppUser.getHeadImg());} |
| | | else { |
| | | detailsVo.setUserImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/630864764d3c4e98822ff976a2389559.jpg");} |
| | | detailsVo.setUserImage(tAppUser.getHeadImg()); |
| | | } else { |
| | | detailsVo.setUserImage("https://we-park-life.oss-cn-beijing.aliyuncs.com/img/630864764d3c4e98822ff976a2389559.jpg"); |
| | | } |
| | | |
| | | |
| | | detailsVo.setUserName(tAppUser.getName()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/cancellation") |
| | | @ApiOperation(value = "个人信息-注销账号", tags = {"APP-使用福利"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/logOut") |
| | | @ApiOperation(value = "个人信息-退出登录", tags = {"APP-使用福利"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/useBenefit/goodsDetailsOne") |
| | | @ApiOperation(value = "积分商城-商品详情", tags = {"APP-使用福利"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 保存用户积分变动记录 |
| | | * |
| | | * @param vo |
| | | */ |
| | | @ResponseBody |
| | |
| | | @NoArgsConstructor |
| | | public class StudentSearch { |
| | | private String province; |
| | | private String city;String name; |
| | | private String city; |
| | | String name; |
| | | private String userName; |
| | | private String phone; |
| | | private List<Integer> ids; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | * <p> |
| | | * 荣誉规则 |
| | | * </p> |
| | | * |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.dsh.account.enums; |
| | | |
| | | |
| | | |
| | | public enum RechargeRecordEnum { |
| | | COURSE_PACKAGE_PURCHASE("课包购买"), |
| | | VENUE_RESERVATION("场地预约"), |
| | |
| | | EVENT_REGISTRATION("赛事报名"), |
| | | CANCEL_EVENT_REGISTRATION("取消赛事报名"), |
| | | CANCEL_VENUE_RESERVATION("取消场地预约"), |
| | | |
| | | |
| | | |
| | | ; |
| | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums") |
| | | int queryUserHasGoodsNums(@RequestBody AppUserGoodResp goodResp); |
| | | |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums1") |
| | | int queryUserHasGoodsNums1(@RequestBody AppUserGoodResp goodResp); |
| | | |
| | |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/competition/getPlayPaiFGoldPayRecord") |
| | | List<PaymentCompetition> getPlayPaiFGoldPayRecord(@RequestBody Integer appUserId); |
| | | @PostMapping("/base/competition/queryByCode") |
| | | |
| | | @PostMapping("/base/competition/queryByCode") |
| | | Integer queryByCode(@RequestBody String code); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 保存学员后同步参赛人员信息 |
| | | * |
| | | * @param saveParticipant |
| | | */ |
| | | @PostMapping("/participant/saveParticipant") |
| | | void saveParticipant(SaveParticipant saveParticipant); |
| | | |
| | | @PostMapping("/participant/counts") |
| | | Integer counts(Integer stuId); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/coursePackage/queryCoursePackageById") |
| | | CoursePackage queryCoursePackageById(Integer id); |
| | | |
| | | @PostMapping("/base/coursePackage/queryByCode") |
| | | Integer queryByCode(String code); |
| | | |
| | | @PostMapping("/base/coursePackage/counts") |
| | | Integer counts(Integer stuId); |
| | | |
| | | @PostMapping("/base/coursePackage/counts1") |
| | | Integer counts1(Integer stuId); |
| | | } |
| | |
| | | |
| | | // @PostMapping("/base/coursePack/getClassHour") |
| | | // Integer getClassHour(Integer courseConfigId); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody GetStuSessionList getStuSessionList); |
| | | |
| | | @PostMapping("/base/coursePack/getRecord") |
| | | List<PurchaseRecordVo> getRecord(@RequestBody RecordTimeRequest timeRequest); |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/honor/stuHonors") |
| | | public List<StuMedalVo> getStuHonors(@RequestBody List<Integer> honorIds); |
| | | |
| | | @PostMapping("/base/honor/getHonor") |
| | | HonorRules getHonor(@RequestBody List<Integer> integers); |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/site/getNewAddSiteList") |
| | | List<SiteVo> getAppUserSiteList(Integer storeId); |
| | | |
| | | @PostMapping("/base/site/queryByCode") |
| | | Integer queryByCode(@RequestBody String code); |
| | | |
| | | @PostMapping("/base/site/queryOperator") |
| | | OperatorUser queryOperator(@RequestBody List<Integer> stores); |
| | | |
| | | @PostMapping("/base/site/game") |
| | | List<Map<String, Object>> game(Integer appUserId); |
| | | |
| | | @PostMapping("/base/site/counts") |
| | | Integer counts(Integer stuId); |
| | | } |
| | |
| | | public interface StoreClient { |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/store/queryByStoreId") |
| | | OperatorUser queryByStoreId(Integer storeId); |
| | | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/store/queryStoreList") |
| | | List<Store> queryStoreList(QueryStoreList queryStoreList); |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/courseOfSto") |
| | |
| | | |
| | | /** |
| | | * 根据门店id获取门店信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | public interface RechargeRecordsMapper extends BaseMapper<RechargeRecords> { |
| | | |
| | | List<RechargeRecordsVO> rechargeList(@Param("query") RechargeRecordsQuery query,@Param("sTime")String sTime,@Param("eTime")String eTime); |
| | | |
| | | List<VipPayment> listAll(@Param("query") IncomeQuery query, @Param("sTime")String sTime, @Param("eTime")String eTime, @Param("amount") BigDecimal amount,@Param("insertType")Integer insertType); |
| | | |
| | | } |
| | |
| | | List<MonthData> getMonthUserCount(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount4(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount3(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount2(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount1(@Param("dto")UserInfoQueryDTO dto); |
| | | |
| | | List<DayData> getDayUserCount(@Param("dto")UserInfoQueryDTO dto); |
| | |
| | | List<GetHistoryDto> getHistory(); |
| | | |
| | | |
| | | |
| | | Integer getGiftSelect(@Param("giftSearchDto")GiftSearchDto giftSearchDto); |
| | | |
| | | List<Map<String, Object>> queryCom(@Param("id") Integer id); |
| | |
| | | @Data |
| | | public class RechargeRecordsVO { |
| | | /** |
| | | * |
| | | * {title: '所在省市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '充值用户', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | import lombok.Data; |
| | | |
| | | |
| | | |
| | | @Data |
| | | public class StuDetailsVo { |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | |
| | | |
| | | |
| | | @Data |
| | | public class RechargesDetail { |
| | | |
| | |
| | | public interface EvaluateStudentService extends IService<EvaluateStudent> { |
| | | |
| | | |
| | | |
| | | List<StuCommentsVo> queryStuCommentsList(Integer stuId); |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 购买年度会员 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 购买年度会员回调处理 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addVipPaymentCallback(String code, String orderNumber) throws Exception; |
| | |
| | | ResultUtil addRechargeCallbackPay(String code, String orderNumber); |
| | | |
| | | List<RechargeRecordsVO> rechargeList(RechargeRecordsQuery query); |
| | | |
| | | List<VipPayment> listAll(IncomeQuery query); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | | * |
| | | * @param type |
| | | * @param phone |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 注册账号 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param phone |
| | | * @param password |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信登录 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * |
| | | * @param phone |
| | | * @param code |
| | | * @param password |
| | |
| | | |
| | | /** |
| | | * 获取加入玩湃首页数据 |
| | | * |
| | | * @param lon |
| | | * @param lat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取使用福利首页数据 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取用户账单列表 |
| | | * |
| | | * @param yearMonth 年月 |
| | | * @param recordId 记录 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 注销账号 |
| | | * |
| | | * @param appUserId |
| | | */ |
| | | void cancellation(Integer appUserId); |
| | |
| | | List<MonthData> getMonthUserCount(UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount4(UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount3(UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount2(UserInfoQueryDTO dto); |
| | | |
| | | WeekData getWeekUserCount1(UserInfoQueryDTO dto); |
| | | |
| | | List<DayData> getDayUserCount(UserInfoQueryDTO dto); |
| | |
| | | List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId); |
| | | |
| | | CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId); |
| | | |
| | | /** |
| | | * 查询探索-公告列表 |
| | | */ |
| | | List<SysNotice> querySystemNoticeDetails(); |
| | | |
| | | /** |
| | | * 查询公告详情 |
| | | */ |
| | | SysNotice queryNoticeData(Integer noId); |
| | | |
| | | /** |
| | | * 查询常见问题列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询学院的上课记录 |
| | | * |
| | | * @param stuId |
| | | * @param appUserId |
| | | * @return |
| | |
| | | ResultUtil cancelReservationOfCourse( Integer courseStuRecordId); |
| | | |
| | | /** |
| | | * |
| | | * @param space 距离 |
| | | * @param cityCode 城市code |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 保存用户积分变动 |
| | | * |
| | | * @param vo |
| | | * @throws Exception |
| | | */ |
| | |
| | | public class CoachServiceImpl extends ServiceImpl<CoachMapper, Coach> implements CoachService { |
| | | @Autowired |
| | | private CoachMapper coachMapper; |
| | | |
| | | @Override |
| | | public List<CoachSerchVO> listAll(CoachQuery query) { |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private CoachService coachService; |
| | | |
| | | @Override |
| | | public List<StuCommentsVo> queryStuCommentsList(Integer stuId) { |
| | | List<StuCommentsVo> stuCommentsVos = new ArrayList<>(); |
| | |
| | | details.add(consumeDetail); |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //分页 |
| | | filteredList = filteredList.stream().skip((pageNo - 1) * size).limit(size). |
| | | collect(Collectors.toList()); |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | private ResultUtil AlipayPayment(String code,BigDecimal amount) { |
| | |
| | | tappMapper.updateById(tAppUser); |
| | | break; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | break; |
| | |
| | | } |
| | | return rechargeRecordsMapper.listAll(query,STime,ETime,query.getAmount(),query.getInsertType()); |
| | | } |
| | | |
| | | public static <T> List<T> pageList(List<T> list, int pageNum, int pageSize) { |
| | | //计算总页数 |
| | | int page = list.size() % pageSize == 0 ? list.size() / pageSize : list.size() / pageSize + 1; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<StuMedalVo> queryHonorDetails(Integer stuId) { |
| | | List<StuMedalVo> studentHonors = new ArrayList<>(); |
| | |
| | | |
| | | studentHonors.add(vo); |
| | | } |
| | | |
| | | |
| | | |
| | | return studentHonors; |
| | |
| | | private String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAouYvZ1v4RiydwNOnGcU0Hb4hQu0x6XUooaE2Bi6/atNOobtFdunnATGP6OMOW7yF9DpP8qH5mbFXAiaQD721y/7qlayI50UcV4mngRU4ZcaAVE3bp721Eg2H85RISa+Tb1CiOh+pc9p4l5UBseKsvB2ruHHForfZDPI8FL7AVUKBYCQPsa4zL6KAO2C6KULaTg/lCa+bYQKU0n9ca569VtdsqJUyxB9eSZjVd+9nKl62FLqp2NELGj7cXqiVBgDnBnVS5ZUO3mrBM5z/AxQbw3RwE3JqdkhzUA1BFjejAlT2zIGNOjUFagF8ao0wGElYfuk0bum6Hz5qWAt02QdNNwIDAQAB";//支付宝应用公钥 |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | @Resource |
| | | private UserConponClient userConponClient; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @Resource |
| | | private MerChandiseClient merChandiseClient; |
| | | |
| | | // 对数据进行分页处理的方法 |
| | | private static Page<Goods> getPage(List<Goods> dataList, Pageable pageable) { |
| | | int start = (int) pageable.getOffset(); |
| | | int end = Math.min((start + pageable.getPageSize()), dataList.size()); |
| | | return new PageImpl<>(dataList.subList(start, end), pageable, dataList.size()); |
| | | } |
| | | |
| | | @Override |
| | | public List<QueryAppUserVO> listAll(QueryAppUser query) { |
| | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<SelectDto> getSelects(List<Integer> studentIds) { |
| | |
| | | public List<TAppUser> queryAPPUserByNameAndPhone(AppUserByNameAndPhoneDTO dto) { |
| | | return appUserMapper.queryAPPUserByNameAndPhone(dto); |
| | | } |
| | | |
| | | @Override |
| | | public List<YearData> getYearUserCount(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getYearUserCount(dto); |
| | |
| | | public WeekData getWeekUserCount4(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount4(dto); |
| | | } |
| | | |
| | | @Override |
| | | public WeekData getWeekUserCount3(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount3(dto); |
| | | } |
| | | |
| | | @Override |
| | | public WeekData getWeekUserCount2(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount2(dto); |
| | | } |
| | | |
| | | @Override |
| | | public WeekData getWeekUserCount1(UserInfoQueryDTO dto) { |
| | | return appUserMapper.getWeekUserCount1(dto); |
| | |
| | | public List<GroupCityInfoVO> groupCityInfo(UserInfoQueryDTO dto) { |
| | | return appUserMapper.groupCityInfo(dto); |
| | | } |
| | | |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id,Integer uid) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(uid); |
| | | ClassInfoVo classInfoVo = new ClassInfoVo(); |
| | | // if (ToolUtil.isNotEmpty(tAppUser)){ |
| | | |
| | | // |
| | | |
| | | List<TStudent> tStudents = new ArrayList<>(); |
| | | if (id!=null) { |
| | | tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | |
| | | } |
| | | List<RegisteredCourse> courseList = new ArrayList<>(); |
| | | List<StuCourseResp> stuCoursePayment = paymentClient.getStuCoursePayment(tStudent.getId()); |
| | | List<Integer> coursePackIds = new ArrayList<>(); |
| | | if (stuCoursePayment.size() > 0){ |
| | | coursePackIds = stuCoursePayment.stream().map(StuCourseResp::getCourseId).collect(Collectors.toList()); |
| | | for (StuCourseResp tCoursePackagePayment : stuCoursePayment) { |
| | | RegisteredCourse course = new RegisteredCourse(); |
| | | course.setId(tCoursePackagePayment.getId()); |
| | |
| | | } |
| | | } |
| | | classInfoVo.setCourseList(courseList); |
| | | // List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds); |
| | | List<ExerciseVideo> query = voclClient.query(tStudent.getId()); |
| | | classInfoVo.setExerciseVideoList(query); |
| | | |
| | |
| | | classInfoVo.setImgs(tImgConfigs.get(0).getContent()); |
| | | } |
| | | } |
| | | // } |
| | | return classInfoVo; |
| | | } |
| | | |
| | | /** |
| | | * 处理数据 |
| | | * |
| | | * @param storeOfCourses |
| | | * @param longitude |
| | | * @param latitude |
| | |
| | | return courseVenues; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取短信验证码 |
| | | * |
| | | * @param type 1:登录,2:注册,3:修改密码,4:忘记密码 |
| | | * @param phone |
| | | * @return |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 注册用户 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 账号密码登录 |
| | | * |
| | | * @param phone |
| | | * @param password |
| | | * @return |
| | |
| | | return ResultUtil.success(token); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 验证码登录 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | return ResultUtil.success(token); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信登录 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取JWT token和存储个人信息 |
| | | * |
| | | * @param appUser |
| | | * @return |
| | | */ |
| | |
| | | return token; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * |
| | | * @param phone |
| | | * @param code |
| | | * @param password |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务修改到期会员的状态 |
| | | */ |
| | |
| | | this.baseMapper.membershipEnd(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取加入玩湃首页数据 |
| | | * |
| | | * @param lon |
| | | * @param lat |
| | | * @return |
| | |
| | | return goods; |
| | | } |
| | | |
| | | // 对数据进行分页处理的方法 |
| | | private static Page<Goods> getPage(List<Goods> dataList, Pageable pageable) { |
| | | int start = (int) pageable.getOffset(); |
| | | int end = Math.min((start + pageable.getPageSize()), dataList.size()); |
| | | return new PageImpl<>(dataList.subList(start, end), pageable, dataList.size()); |
| | | } |
| | | |
| | | @Override |
| | | public ProductDetailsVo productDetails(Integer goodId, Integer goodsType ) { |
| | | ProductDetailRequest detailsVo = new ProductDetailRequest(); |
| | |
| | | detailsVo.setGoodId(goodId); |
| | | return mcClient.getGoodDetailsWithId(detailsVo); |
| | | } |
| | | |
| | | @Override |
| | | public ProductDetailsVo goodsDetailsOne(Integer goodId ) { |
| | | return mcClient.getGoodDetailsWithIdOne(goodId); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private UserConponClient userConponClient; |
| | | |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public synchronized ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeType) { |
| | | System.out.println("exchangeType:--->"); |
| | | |
| | | |
| | | |
| | | ReturnModel returnModel = new ReturnModel(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | System.out.println(exchangeType); |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | |
| | | |
| | | |
| | | |
| | | if (ToolUtil.isEmpty(merchandise)){ |
| | |
| | | if (ToolUtil.isNotEmpty(count1) && count1 >= merchandise.getQuantityIssued()){ |
| | | return ResultUtil.error("超过发放数量"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < goodsNums; i++) { |
| | |
| | | return alipay; |
| | | } |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private MerChandiseClient merChandiseClient; |
| | | |
| | | |
| | | public void moneyOut(String outNum,String tradeNo) throws AlipayApiException { |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | // RoyaltyDetailInfos royaltyDetailInfos1 = new RoyaltyDetailInfos(); |
| | | // royaltyDetailInfos1.setTransOutType("loginName"); |
| | | // royaltyDetailInfos1.setTransOut("happysports@weparklife.com"); |
| | |
| | | // TCoursePackage byId = coursePackageService.getById(one.getCoursePackageId()); |
| | | |
| | | |
| | | |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(storeId); |
| | | |
| | | |
| | | |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | |
| | | // stores.add(paymentCompetitions); |
| | | // stores.add(siteBookings); |
| | | // OperatorUser operatorUser = siteClient.queryOperator(stores); |
| | | |
| | | |
| | | |
| | | |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | |
| | | } |
| | | return courseVenues; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private TCourseInfoRecordService courseInfoRecordService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil addStuOfAppUser(StuDetailsReq stu,Integer appUserId) throws Exception { |
| | | TStudent student = new TStudent(); |
| | |
| | | couPayClient.updatePaymentCoursePackage(coursePackagePayment); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | break; |
| | | } |
| | | if("WAIT_BUYER_PAY".equals(tradeStatus)){ |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @param appointStatus 预约状态 0=全部 1=待上课 2=已完成 3=已取消 |
| | |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getStatus().equals(4)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | else { |
| | | } else { |
| | | |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getStatus().equals(appointStatus)) |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param space 1=升序/2=降序 |
| | | * @param cityCode 城市code |
| | | * @param latitude |
| | |
| | | |
| | | /** |
| | | * 保存用户积分变动 |
| | | * |
| | | * @param vo |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | int totalItems = detailsResponses.size(); |
| | | int startIndex = (page - 1) * size; |
| | | int endIndex = Math.min(startIndex + size, totalItems); |
| | |
| | | } else { |
| | | detailsResponses.clear(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return detailsResponses; |
| | |
| | | |
| | | /** |
| | | * 购买年度会员 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 微信 |
| | | * |
| | | * @param vipPayment |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 支付宝 |
| | | * |
| | | * @param vipPayment |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 购买年度会员支付回调处理 |
| | | * |
| | | * @param code |
| | | * @param orderNumber |
| | | * @throws Exception |
| | |
| | | package com.dsh.account.util; |
| | | |
| | | |
| | | |
| | | public class BMIBodyUtil { |
| | | |
| | | public static String getBodyStatus(double bmi) { |
| | |
| | | /** |
| | | * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值 |
| | | * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object. |
| | | * |
| | | * @param d |
| | | * @param years |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的月份,可以为负 |
| | | * Adding the specified number of month to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param months |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的天数,可以为负 |
| | | * Adding the specified number of day to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param days |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的小时,可以为负 |
| | | * Adding the specified number of hour to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param hours |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的分钟,可以为负 |
| | | * Adding the specified number of minute to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param minutes |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的秒数,可以为负 |
| | | * Adding the specified number of seconds to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param seconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的毫秒数,可以为负 |
| | | * Adding the specified number of milliseconds to the given time can result in a negative value. |
| | | * |
| | | * @param d |
| | | * @param milliseconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的年份是新的给定的年份 |
| | | * Setting the year of a date object to a new given year. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param year 新的年份 |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的月份是新的给定的月份 |
| | | * Set the month of a date object to a new given month. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param month 新的月份 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的天是新的给定的天 |
| | | * Set the day of a date object to a new given day. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param day 新的天 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的小时是新的给定的小时 |
| | | * Setting the hour of a date object to a new given hour. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param hour 新的小时数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的分钟是新的给定的分钟数 |
| | | * Set the minutes of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param minute 新的分钟数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的毫秒数是新的给定的分钟数 |
| | | * Setting the milliseconds of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param millisecond 新的毫秒数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param d 日期对象 |
| | | */ |
| | | public static int getDaysOfMonth(Date d) { |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param year 年 |
| | | * @param month 月 |
| | | */ |
| | |
| | | /** |
| | | * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数 |
| | | * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month. |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取指定月份开始时0点0分0秒 |
| | | * |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取指定月份结束时23点59分59秒 |
| | | * |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期后几天的日期 |
| | | * Obtaining the date of the day after several days from the current date. |
| | | * |
| | | * @param day 天数 |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 是否是同一天 |
| | | * it the same day |
| | | * |
| | | * @param first |
| | | * @param second |
| | | * @return |
| | |
| | | /** |
| | | * 是否超过指定时刻 |
| | | * Has the specified time limit been exceeded |
| | | * |
| | | * @param day 时间 |
| | | * @param time 指定时刻 |
| | | * @return |
| | |
| | | /** |
| | | * 指定一天哪一个小时 |
| | | * Specify which hour of a particular day. |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 数字换算成中文(周) |
| | | * Conversion of numbers to Chinese (weeks) |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取两个时间的间隔(秒) |
| | | * Obtain the time difference between two instances (in seconds). |
| | | * |
| | | * @param d1 |
| | | * @param d2 |
| | | * @return |
| | |
| | | /** |
| | | * 获取到当月所有日期 |
| | | * Obtain all dates of the current month |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | Calendar cal = Calendar.getInstance(); |
| | | return cal; |
| | | } |
| | | |
| | | /** |
| | | * 毫秒转日期时间 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 计算年龄 |
| | | * |
| | | * @param birthDate |
| | | * @return |
| | | */ |
| | |
| | | // 粗计算年龄 |
| | | int age = yearNow - yearBirth; |
| | | // 当前月份小于出生月份年龄减一 |
| | | if (monthNow < monthBirth) { age--; } |
| | | if (monthNow < monthBirth) { |
| | | age--; |
| | | } |
| | | // 当前月份等于出生月份,日小于生日年龄减一 |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { age--; } |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { |
| | | age--; |
| | | } |
| | | // 返回年龄值 |
| | | return age; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> geocoding(String address) throws Exception{ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 坐标转换 |
| | | * |
| | | * @param locations 经度和纬度用","分割,经度在前,纬度在后,经纬度小数点后不得超过6位。多个坐标对之间用”|”进行分隔最多支持40对坐标。 |
| | | * @param coordsys 可选值:gps;mapbar;baidu;autonavi(不进行转换) |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取Request请求头UserId |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getLoginAuthUserId (HttpServletRequest request) { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * 返回json数据封装工具类 |
| | | * |
| | | * @ClassName: JsonUtil |
| | |
| | | |
| | | /** |
| | | * 校验实名认证 |
| | | * |
| | | * @param idcard |
| | | * @param name |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 通过生日计算年龄 |
| | | * |
| | | * @param birthDay 生日 |
| | | * @return |
| | | * @throws ParseException |
| | |
| | | |
| | | /** |
| | | * 获取当天的星期几 |
| | | * |
| | | * @return |
| | | */ |
| | | public static int getWeekStr(){ |
| | |
| | | |
| | | /** |
| | | * 计算两个经纬度之间的直线距离 |
| | | * |
| | | * @param lat1 经度1 |
| | | * @param lon1 纬度1 |
| | | * @param lat2 经度2 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private static String byteArrayToHexString(byte b[]) { |
| | | StringBuffer resultSb = new StringBuffer(); |
| | | for (int i = 0; i < b.length; i++) |
| | |
| | | private String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝支付 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码支付下单 |
| | | * |
| | | * @param body |
| | | * @param subject |
| | | * @param outTradeNo |
| | |
| | | |
| | | /** |
| | | * 支付成功后的回调处理逻辑 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> alipayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 支付宝查询订单支付状态 |
| | | * |
| | | * @param out_trade_no |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信统一下单 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param out_trade_no 商户订单号 |
| | |
| | | String prepay_id = map1.get("prepay_id"); |
| | | |
| | | |
| | | |
| | | |
| | | switch (type){ |
| | | case "JSAPI": |
| | | //重新进行签名后返回给前端 |
| | |
| | | |
| | | /** |
| | | * 微信支付成功后的回调处理 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> weixinpayCallback(HttpServletRequest request){ |
| | |
| | | map1.put("transaction_id", map.get("transaction_id"));//微信支付订单号 |
| | | String result = "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>"; |
| | | map1.put("result", result); |
| | | |
| | | |
| | | |
| | | return map1; |
| | |
| | | |
| | | /** |
| | | * 微信扫码收款 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param nonce_str 随机字符串 |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码收款 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款申请 |
| | | * |
| | | * @param transaction_id 微信订单号。微信生成的订单号,在支付通知中有返回 |
| | | * @param out_refund_no 商户退款单号。商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。 |
| | | * @param total_fee 订单金额。订单总金额,单位为分,只能为整数 |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的回调处理 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝退款 |
| | | * |
| | | * @param trade_no 支付宝交易号 |
| | | * @param refund_amount 退款金额 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询微信支付订单 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到零钱) |
| | | * |
| | | * @param openid 商户appid下,某用户的openid |
| | | * @param desc 企业付款备注,必填。 |
| | | * @param total_fee 企业付款金额 |
| | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到银行卡) |
| | | * |
| | | * @param desc 备注信息 |
| | | * @param total_fee 转账金额 |
| | | * @param partner_trade_no 订单号 |
| | |
| | | |
| | | /** |
| | | * 微信转账到银行卡不编号 |
| | | * |
| | | * @param bankName |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝转账 |
| | | * |
| | | * @param out_biz_no 商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。 |
| | | * @param trans_amount 订单总金额,单位为元,精确到小数点后两位 |
| | | * @param order_title 转账业务的标题,用于在支付宝用户的账单里显示 |
| | |
| | | |
| | | /** |
| | | * 获取请求内容 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws IOException |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的解密 |
| | | * |
| | | * @param req_info |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * xml转map |
| | | * |
| | | * @param xml |
| | | * @param charset |
| | | * @return |
| | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | | * Storing strings in Redis without an expiration time. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | |
| | | /** |
| | | * 以分钟为单位设置存储值(设置过期时间) |
| | | * Set storage value in minutes (set expiration time) as units. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param time 秒 |
| | |
| | | |
| | | /** |
| | | * 从redis中获取值 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * |
| | | * @param kes |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除key |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | |
| | | private T data;//返回数据 |
| | | |
| | | |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil error(String mag){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | | return ResultUtil.getResult(ResultUtil.ERROR, mag, obj); |
| | | } |
| | | |
| | | public static <T> ResultUtil <T> errorCode(String mag, T obj){ |
| | | return ResultUtil.getResult(501, mag, obj); |
| | | } |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(String msg){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil paranErr(String ages){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil<T> paranErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil runErr(){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data, String msg){ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param <T> |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param msg |
| | | * @param data |
| | | * @param <T> |
| | |
| | | |
| | | /** |
| | | * 签名无效 |
| | | * |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 把逗号分隔的字符串转换字符串数组 |
| | | * Convert comma-separated string to string array. |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 把逗号分隔字符串转换List的Long |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getClassCodeString(int length) { |
| | | String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | Random random = new Random(); |
| | |
| | | package com.dsh.account.util; |
| | | |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.io.StringWriter; |
| | |
| | | public static String currentTime() { |
| | | return DateUtil.getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.account.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * AES加密 |
| | | * |
| | | * @author pzb |
| | | * @Date 2021/12/3 15:43 |
| | | */ |
| | |
| | | /** |
| | | * AES解密 |
| | | * |
| | | * @param content |
| | | * 密文 |
| | | * @param content 密文 |
| | | * @return |
| | | * @throws InvalidAlgorithmParameterException |
| | | * @throws NoSuchProviderException |
| | |
| | | private static String appid ; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 解密数据 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 小程序使用jscode获取openid |
| | | * |
| | | * @param jscode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取微信小程序token |
| | | * |
| | | * @return |
| | | */ |
| | | public String getWxAppletsAccessToken() throws Exception{ |
| | |
| | | |
| | | /** |
| | | * 网站应用登录 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取微信个人信息 |
| | | * |
| | | * @param access_token |
| | | * @param openid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 公众号获取openid |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 通过config接口注入权限验证配置(公众号) |
| | | * 附录1-JS-SDK使用权限签名算法, |
| | | * |
| | | * @return |
| | | */ |
| | | public Map<String,Object> getSignatureConfig(String url) throws Exception{ |
| | |
| | | |
| | | /** |
| | | * 公众号获取用户个人信息 |
| | | * |
| | | * @param access_token |
| | | * @param openid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取小程序二维码 |
| | | * |
| | | * @param page 跳转页 例如 pages/index/index |
| | | * @param scene 参数 a=1&b=2 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信小程序加解密 |
| | | * |
| | | * @author pzb |
| | | * @Date 2021/12/3 15:43 |
| | | */ |
| | |
| | | /** |
| | | * 获得对明文进行补位填充的字节. |
| | | * |
| | | * @param count |
| | | * 需要进行填充补位操作的明文字节个数 |
| | | * @param count 需要进行填充补位操作的明文字节个数 |
| | | * @return 补齐用的字节数组 |
| | | */ |
| | | public static byte[] encode(int count) { |
| | |
| | | /** |
| | | * 删除解密后明文的补位字符 |
| | | * |
| | | * @param decrypted |
| | | * 解密后的明文 |
| | | * @param decrypted 解密后的明文 |
| | | * @return 删除补位字符后的明文 |
| | | */ |
| | | public static byte[] decode(byte[] decrypted) { |
| | |
| | | /** |
| | | * 将数字转化成ASCII码对应的字符,用于对明文进行补码 |
| | | * |
| | | * @param a |
| | | * 需要转化的数字 |
| | | * @param a 需要转化的数字 |
| | | * @return 转化得到的字符 |
| | | */ |
| | | public static char chr(int a) { |
| | |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 21:13 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 数据源配置 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 20:32 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 配置多数据源 |
| | | * |
| | | * @return |
| | | */ |
| | | private Map<String, DataSource> createDataSourceMap() { |
| | |
| | | |
| | | /** |
| | | * 分片配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private Collection<RuleConfiguration> createShardingRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getPaymentHistoryTableRuleConfiguration() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getRechargeRecordsTableRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserIntegralChangesTableRuleConfiguration() { |
| | |
| | | .paths(PathSelectors.any()).build().groupName("公共Aip接口") |
| | | .apiInfo(apiInfo("公共Aip接口", "文档中可以查询及测试接口调用参数和结果", "1.0.0版本")); |
| | | } |
| | | |
| | | |
| | | |
| | | private ApiInfo apiInfo(String name, String description, String version) { |
| | |
| | | spring.cloud.nacos.discovery.group=@profiles.group@ |
| | | spring.main.allow-bean-definition-overriding=true |
| | | spring.flyway.enabled=false |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | | feign.compression.request.enabled=true |
| | | feign.compression.response.enabled=true |
| | | |
| | | mybatis-plus.configuration.map-underscore-to-camel-case=false |
| | | |
| | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <update id="membershipEnd"> |
| | | update t_app_user set isVip = 0 where isVip = 1 and now() >= vipEndTime |
| | | </update> |
| | |
| | | and o.phone LIKE CONCAT('%',#{item.phone},'%') |
| | | </if> |
| | | <if test="item.ids != null and item.ids.size >0 "> |
| | | and o.appUserId in <foreach collection="item.ids" separator="," open="(" item="id" close=")"> |
| | | and o.appUserId in |
| | | <foreach collection="item.ids" separator="," open="(" item="id" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | |
| | | SELECT |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="getGiftSelect" resultType="java.lang.Integer"> |
| | |
| | | |
| | | |
| | | <select id="listAll" resultType="com.dsh.account.entity.UserIntegral"> |
| | | select t1.id,t2.province,t2.city,t2.name,t2.phone,t1.type,t1.oldIntegral,t1.newIntegral,t1.category ,t1.insertTime,t1.remark from t_user_integral_changes t1 left join t_app_user t2 on t1.appUserId = t2.id |
| | | select t1.id,t2.province,t2.city,t2.name,t2.phone,t1.type,t1.oldIntegral,t1.newIntegral,t1.category |
| | | ,t1.insertTime,t1.remark from t_user_integral_changes t1 left join t_app_user t2 on t1.appUserId = t2.id |
| | | where 1=1 |
| | | <if test="query.name !=null and query.name !=''"> |
| | | and t2.name like concat("%",#{query.name},"%") |
| | |
| | | spring.redis.database=0 |
| | | spring.redis.host=@redis.addr@ |
| | | |
| | | spring.redis.port=@redis.port@ |
| | | spring.redis.password=@redis.password@ |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | datasource.names=master0 |
| | | |
| | | 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 |
| | |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取所有福利视频分类 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/benefitVideo/list") |
| | |
| | | |
| | | /** |
| | | * 查看详情/编辑 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/benefitVideo/getById") |
| | |
| | | |
| | | /** |
| | | * 根据分类id查询福利视频分类下的视频 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/benefitVideo/getBenefitVideoById") |
| | |
| | | |
| | | /** |
| | | * 根据福利视频id获取福利视频信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/benefitVideo/getBenefitVideosById") |
| | |
| | | |
| | | /** |
| | | * 添加/修改福利视频分类 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/benefitVideo/add") |
| | |
| | | |
| | | /** |
| | | * 添加/修改视频详情 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/addBenefitsVideos") |
| | |
| | | return bfvService.updateById(site); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 上/下架、删除福利视频分类 type=1为上架 2为下架 3为删除 |
| | | */ |
| | |
| | | public BenefitsVideos getVideosWithIds(@RequestBody Integer id){ |
| | | return bfvService.getOne(new QueryWrapper<BenefitsVideos>().eq("id",id).eq("state",1)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/benefitsVideo/queryClassificationBenefitsVideosListOne") |
| | | @ApiOperation(value = "获取视频列表", tags = {"APP-线上课得积分", "APP-看视频得奖励"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 获取所有体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/listAll") |
| | |
| | | } |
| | | return queryBodySideAppointmentVOS; |
| | | } |
| | | |
| | | /** |
| | | * 增加/修改体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/addBodySideAppointments") |
| | |
| | | |
| | | /** |
| | | * 手动标记用户已经到店并完成体测 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/changeState") |
| | |
| | | |
| | | /** |
| | | * 通过id获取体测预约记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/bodySideAppointments/getInfoById") |
| | |
| | | package com.dsh.activity.controller; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | |
| | | private StoreClient stoClient; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private RegionClient regionClient; |
| | | |
| | |
| | | |
| | | /** |
| | | * 根据id获取优惠券信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponByUid") |
| | | public List<Coupon> queryCouponByUid(@RequestBody Integer uid){ |
| | |
| | | |
| | | /** |
| | | * 我的券包列表 |
| | | * |
| | | * @param req |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private OperatorClient operatorClient; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryCouponListSearch") |
| | | public List<Map<String,Object>> getCouponListOfSearch(@RequestBody CouponListOfSearch ofSearch){ |
| | |
| | | } |
| | | return mapList; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/couponExamineListSearch") |
| | | public List<Map<String,Object>> getCouponExamineListOfSearch(@RequestBody CouponExamineListSearch ofSearch){ |
| | |
| | | } |
| | | return couponInfo; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | Page<Object> objectPage = new Page<>(ofSearch.getOffset(), ofSearch.getLimit()); |
| | | return couponService.listRecord(objectPage,ofSearch.getId(),ofSearch.getIds(),ofSearch.getType()); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coupon/updateType") |
| | |
| | | |
| | | /** |
| | | * 获取介绍有礼-参与用户记录表 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/introduceUser/listAllUser") |
| | | public List<IntroduceUser> listAllUser(@RequestBody IntroduceUserQuery query){ |
| | | return introduceUserService.listAll(query); |
| | | } |
| | | |
| | | /** |
| | | * 通过id获取介绍有礼 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/introduce/getInfoById") |
| | |
| | | return idrService.getById(id); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取介绍有礼记录表 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/introduce/listAll") |
| | |
| | | } |
| | | return introduceVOS; |
| | | } |
| | | |
| | | /** |
| | | * 增加/修改介绍有礼记录 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/introduce/addIntroduce") |
| | |
| | | |
| | | /** |
| | | * 上/下架介绍有礼 type = 1上架 type=2下架 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/introduce/changeState") |
| | |
| | | |
| | | pmdsService.changeState(dto); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | */ |
| | |
| | | public PointsMerchandise getById(@RequestBody Integer id){ |
| | | return pmdsService.getById(id); |
| | | } |
| | | |
| | | /** |
| | | * 门票核销 |
| | | */ |
| | |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | return userPointsMerchandiseService.changeState(dto); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/base/pointMerchars/writeOff") |
| | |
| | | byId.setVerificationUserId(dto.getVerificationUserId()); |
| | | return userPointsMerchandiseService.updateById(byId); |
| | | } |
| | | |
| | | @Autowired |
| | | private OperatorClient operatorClient; |
| | | @Resource |
| | | private CouponCityService cityService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/ticketList") |
| | | public List<Map<String,Object>> ticketList(@RequestBody IntegralGoodsOfSearch ofSearch){ |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryGoodsListSearch") |
| | | public List<Map<String,Object>> getIntegralGoodsListOfSearch(@RequestBody IntegralGoodsOfSearch ofSearch){ |
| | |
| | | System.out.println("mapList->"+mapList); |
| | | return mapList; |
| | | } |
| | | |
| | | /** |
| | | * 获取积分商票消费金额 |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private PointsMerchandiseStoreService pointsMerchandiseStoreService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/convertGoods") |
| | | public List<IntegralCommodity> getConvertibleGoods(@RequestBody Location location) throws Exception { |
| | |
| | | System.out.println(commodity); |
| | | return commodity; |
| | | } |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | |
| | | // return pointMerchandiseVo; |
| | | // |
| | | // } |
| | | |
| | | |
| | | |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | |
| | | @PostMapping("/base/pointMerchars/getGoodDetails") |
| | | public ProductDetailsVo getGoodDetailsWithId(@RequestBody ProductDetailRequest detailRequest){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | ProductDetailsVo detailsVo = new ProductDetailsVo(); |
| | | PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId()); |
| | | |
| | | |
| | | |
| | | if (merchandise!=null) { |
| | |
| | | detailsVo.setBelongsScope(coupon.getUserPopulation()); |
| | | // int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | // .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | |
| | | |
| | | |
| | | int couponCounts = userCouponService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId())); |
| | |
| | | detailsVo.setOrderTime(format); |
| | | |
| | | |
| | | |
| | | |
| | | list2.add(pmdsServiceById.getCover()); |
| | | detailsVo.setPics(list2); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | |
| | | return 0; // 保持原顺序 |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | if (pmdsServiceById.getCardType()==1){ |
| | |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(byId.getInsertTime()); |
| | | calendar.add(Calendar.DAY_OF_MONTH, 31); |
| | |
| | | |
| | | } else if (pmdsServiceById.getCardType()==3) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | |
| | | |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | break; |
| | |
| | | // .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | |
| | | |
| | | |
| | | int couponCounts = userCouponService.count(new QueryWrapper<UserCoupon>().eq("couponId", coupon.getId())); |
| | | // detailsVo.setRedeemedNum(coupon.getPickUpQuantity()); |
| | | // detailsVo.setRedeemedNum(couponCounts); |
| | |
| | | |
| | | /** |
| | | * 获取用户已兑换商品的数量 |
| | | * |
| | | * @param goodResp |
| | | * @return 数量 |
| | | */ |
| | |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums1") |
| | | public int queryUserHasGoodsNums1(@RequestBody AppUserGoodResp goodResp){ |
| | |
| | | |
| | | /** |
| | | * 变更兑换商品的的状态 |
| | | * |
| | | * @param code |
| | | * @return 数量 |
| | | */ |
| | |
| | | return upmseService.getConsumeDetails(requestVo); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param mapLists |
| | | * @param timeType 1=未开始 2=已开始 3=已结束 |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/updateGoodsDetail") |
| | | public boolean updateGoodsDetail(@RequestBody Map<String, Object> map){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/addOther") |
| | | public Boolean addOther(@RequestBody String pam){ |
| | | Boolean save =false; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | private CouponStoreService csServie; |
| | | |
| | | |
| | | |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); |
| | | |
| | | @PostMapping("/base/userConpon/getStuOfConpons") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/coupon/querySiteCouponList") |
| | | @ApiOperation(value = "获取场地支付页面可用优惠券列表", tags = {"APP-预约场地", ""}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取用户优惠券数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private ICouponService couponService; |
| | | |
| | |
| | | |
| | | /** |
| | | * 修改优惠券数据 |
| | | * |
| | | * @param userCoupon |
| | | */ |
| | | @ResponseBody |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("t_body_side_appointments") |
| | | public class BodySideAppointment { |
| | |
| | | // 已兑换数量 |
| | | @TableField(exist = false) |
| | | private Integer pickUpQuantity4; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/appUser/queryAppUser") |
| | | AppUser queryAppUser(Integer appUserId); |
| | | |
| | | /** |
| | | * 获取所有用户 |
| | | */ |
| | |
| | | TStoreStaff baseInfo(Integer id); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取用户学员列表 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @PostMapping("/student/queryStudentList") |
| | | List<TStudent> queryStudentList(Integer appUserId); |
| | | |
| | | /** |
| | | * 获取有学员的用户ids |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("/student/getHasStudentUser") |
| | |
| | | |
| | | /** |
| | | * 保存用户积分变动记录 |
| | | * |
| | | * @param vo |
| | | */ |
| | | @PostMapping("/userIntegralChanges/saveUserIntegralChanges") |
| | |
| | | |
| | | /** |
| | | * 根据id获取课程详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据名称获取课程数据 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @PostMapping("/base/coursePackage/queryConfigCoursePackData") |
| | | CoursePackagePaymentConfig queryConfigCoursePackData(@RequestBody Integer coursePackConfigId); |
| | | |
| | | @PostMapping("/base/coursePackage/queryByStoreId") |
| | | List<CoursePackage> queryByStoreId(@RequestBody Integer shopId); |
| | | } |
| | |
| | | |
| | | |
| | | private Integer userId; |
| | | |
| | | |
| | | |
| | | |
| | | private List<Integer> rid; |
| | |
| | | |
| | | /** |
| | | * 根据id获取场地数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取福利课程列表 |
| | | * |
| | | * @param uid |
| | | * @param classificationId |
| | | * @param offset |
| | |
| | | @Param("activeStatus") Integer activeStatus, |
| | | @Param("state") Integer state, |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | |
| | | List<Map<String, Object>> queryGoodsListOfSearchAudit(@Param("name")String name, |
| | | @Param("type")Integer type, |
| | | @Param("redemptionMethod")Integer redemptionMethod, |
| | |
| | | |
| | | /** |
| | | * 获取购买课程可用优惠券列表 |
| | | * |
| | | * @param uid |
| | | * @param storeId |
| | | * @param provinceCode |
| | |
| | | import lombok.Data; |
| | | |
| | | |
| | | |
| | | @Data |
| | | public class ConponJsonRuleModel { |
| | | /** |
| | |
| | | * {title: '参与次数', field: 'number', visible: true, align: 'center', valign: 'middle',width:'8%',}, |
| | | * {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | * {title: '活动状态', field: 'activityState', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | * |
| | | */ |
| | | private Integer id; |
| | | private String provinceAndCity; |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 接收查询参数VO |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取福利视频分类列表数据 |
| | | * |
| | | * @param uid |
| | | * @param search |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BenefitsVideoClassificationListVo> queryClassificationBenefitsVideosList(Integer uid, Integer position, String search) throws Exception; |
| | | |
| | | List<BenefitsVideoClassificationListVo> queryClassificationBenefitsVideosListOne(Integer uid, Integer position, String search) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取福利视频列表 |
| | | * |
| | | * @param uid |
| | | * @param classificationId |
| | | * @param pageSize |
| | |
| | | |
| | | /** |
| | | * 获取福利视频详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 视频观看完毕后获得奖励 |
| | | * |
| | | * @param id |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取购买会员支付成功页面的优惠券 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<CouponListVo> queryCouponList(Integer uid, Integer distributionMethod) throws Exception; |
| | | |
| | | |
| | | |
| | | |
| | | Map<String, Object> queryConponRuleOfJson(Integer id); |
| | |
| | | * <p> |
| | | * 介绍有礼-用户参与 服务类 |
| | | * </p> |
| | | * |
| | | */ |
| | | public interface IntroduceUserService extends IService<IntroduceUser> { |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取购买课程可用优惠券列表 |
| | | * |
| | | * @param uid |
| | | * @param coursePackageId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取预约场地支付页面可用优惠券列表 |
| | | * |
| | | * @param siteId |
| | | * @param price |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<CouponListVo> querySiteCouponList(Integer uid, Integer siteId, Double price, String lon, String lat) throws Exception; |
| | | |
| | | |
| | | |
| | | List<CouponPackageResp> queryCouponPackagesList(Integer uid, CouponPackageReq req); |
| | |
| | | public class BenefitsVideoClassificationServiceImpl extends ServiceImpl<BenefitsVideoClassificationMapper, BenefitsVideoClassification> implements IBenefitsVideoClassificationService { |
| | | @Autowired |
| | | private BenefitsVideoClassificationMapper benefitsVideoClassificationMapper; |
| | | |
| | | @Override |
| | | public List<TQueryBenefitsVO> listAll(QueryBenefitsVedioVO vo) { |
| | | return benefitsVideoClassificationMapper.listAll(vo); |
| | |
| | | private BenefitsVideosMapper benefitsVideosMapper; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取福利视频分类列表数据 |
| | | * |
| | | * @param uid |
| | | * @param search |
| | | * @return |
| | |
| | | } |
| | | return listVos; |
| | | } |
| | | |
| | | @Override |
| | | public List<BenefitsVideoClassificationListVo> queryClassificationBenefitsVideosListOne(Integer uid, Integer position, String search) throws Exception { |
| | | QueryWrapper<BenefitsVideoClassification> wrapper = new QueryWrapper<BenefitsVideoClassification>().eq("position", position); |
| | |
| | | |
| | | /** |
| | | * 获取福利视频详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 视频观看完毕后获得奖励 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @throws Exception |
| | |
| | | public class BodySideAppointmentServiceImpl extends ServiceImpl<BodySideAppointmentMapper, BodySideAppointment> implements BodySideAppointmentService { |
| | | @Autowired |
| | | private BodySideAppointmentMapper bodySideAppointmentMapper; |
| | | |
| | | @Override |
| | | public List<QueryBodySideAppointmentVO> listAll(QueryBodySideAppointment vo) { |
| | | return bodySideAppointmentMapper.listAll(vo); |
| | |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取购买会员支付成功页面的优惠券 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> queryConponRuleOfJson(Integer id) { |
| | | return this.baseMapper.queryConponRuleOfJson(id); |
| | |
| | | public List<Map<String, Object>> queryCouponListOfSearch1(CouponListOfSearch ofSearch) { |
| | | return this.baseMapper.queryCouponListOfSearch1(ofSearch.getName(),ofSearch.getType(),ofSearch.getDistributionMethod(),ofSearch.getUserPopulation(),ofSearch.getStatus(),ofSearch.getState(),ofSearch.getPage(),ofSearch.getCityCode(),ofSearch.getStoreId()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryCouponExamineList(CouponExamineListSearch ofSearch) { |
| | | return this.baseMapper.queryCouponExamineList(ofSearch.getName(),ofSearch.getType(),ofSearch.getUserPopulation(),ofSearch.getDistributionMethod(),ofSearch.getAuditStatus(),ofSearch.getPage()); |
| | |
| | | public class IntroduceRewardsServiceImpl extends ServiceImpl<IntroduceRewardsMapper, IntroduceRewards> implements IntroduceRewardsService { |
| | | @Autowired |
| | | private IntroduceRewardsMapper introduceRewardsMapper; |
| | | |
| | | @Override |
| | | public Object changeState(IntroduceChangeStateDTO dto) { |
| | | List<Integer> ids = dto.getIds(); |
| | |
| | | return this.baseMapper.queryGoodsListOfSearch(ofSearch.getName(),ofSearch.getType(),ofSearch.getRedemptionMethod(), |
| | | ofSearch.getUserPopulation(),ofSearch.getActiveStatus(),ofSearch.getState(),ofSearch.getPage()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryGoodsListOfSearchAudit(IntegralGoodsOfSearch ofSearch) { |
| | | return this.baseMapper.queryGoodsListOfSearchAudit(ofSearch.getName(),ofSearch.getType(),ofSearch.getRedemptionMethod(), |
| | |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取购买课程可用优惠券列表 |
| | | * |
| | | * @param uid |
| | | * @param coursePackageId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取预约场地可用优惠券列表 |
| | | * |
| | | * @param siteId |
| | | * @param price |
| | | * @return |
| | |
| | | public class UserPointsMerchandiseServiceImpl extends ServiceImpl<UserPointsMerchandiseMapper, UserPointsMerchandise> implements UserPointsMerchandiseService { |
| | | @Autowired |
| | | private UserPointsMerchandiseMapper userPointsMerchandiseMapper; |
| | | |
| | | @Override |
| | | public List<PointMerchandiseIncomeVo> getAmount() { |
| | | return userPointsMerchandiseMapper.getAmount(); |
| | |
| | | /** |
| | | * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值 |
| | | * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object. |
| | | * |
| | | * @param d |
| | | * @param years |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的月份,可以为负 |
| | | * Adding the specified number of month to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param months |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的天数,可以为负 |
| | | * Adding the specified number of day to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param days |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的小时,可以为负 |
| | | * Adding the specified number of hour to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param hours |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的分钟,可以为负 |
| | | * Adding the specified number of minute to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param minutes |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的秒数,可以为负 |
| | | * Adding the specified number of seconds to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param seconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的毫秒数,可以为负 |
| | | * Adding the specified number of milliseconds to the given time can result in a negative value. |
| | | * |
| | | * @param d |
| | | * @param milliseconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的年份是新的给定的年份 |
| | | * Setting the year of a date object to a new given year. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param year 新的年份 |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的月份是新的给定的月份 |
| | | * Set the month of a date object to a new given month. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param month 新的月份 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的天是新的给定的天 |
| | | * Set the day of a date object to a new given day. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param day 新的天 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的小时是新的给定的小时 |
| | | * Setting the hour of a date object to a new given hour. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param hour 新的小时数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的分钟是新的给定的分钟数 |
| | | * Set the minutes of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param minute 新的分钟数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的毫秒数是新的给定的分钟数 |
| | | * Setting the milliseconds of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param millisecond 新的毫秒数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param d 日期对象 |
| | | */ |
| | | public static int getDaysOfMonth(Date d) { |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param year 年 |
| | | * @param month 月 |
| | | */ |
| | |
| | | /** |
| | | * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数 |
| | | * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month. |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期后几天的日期 |
| | | * Obtaining the date of the day after several days from the current date. |
| | | * |
| | | * @param day 天数 |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 是否是同一天 |
| | | * it the same day |
| | | * |
| | | * @param first |
| | | * @param second |
| | | * @return |
| | |
| | | /** |
| | | * 是否超过指定时刻 |
| | | * Has the specified time limit been exceeded |
| | | * |
| | | * @param day 时间 |
| | | * @param time 指定时刻 |
| | | * @return |
| | |
| | | /** |
| | | * 指定一天哪一个小时 |
| | | * Specify which hour of a particular day. |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 数字换算成中文(周) |
| | | * Conversion of numbers to Chinese (weeks) |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取两个时间的间隔(秒) |
| | | * Obtain the time difference between two instances (in seconds). |
| | | * |
| | | * @param d1 |
| | | * @param d2 |
| | | * @return |
| | |
| | | /** |
| | | * 获取到当月所有日期 |
| | | * Obtain all dates of the current month |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | Calendar cal = Calendar.getInstance(); |
| | | return cal; |
| | | } |
| | | |
| | | /** |
| | | * 毫秒转日期时间 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> geocoding(String address) throws Exception{ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 坐标转换 |
| | | * |
| | | * @param locations 经度和纬度用","分割,经度在前,纬度在后,经纬度小数点后不得超过6位。多个坐标对之间用”|”进行分隔最多支持40对坐标。 |
| | | * @param coordsys 可选值:gps;mapbar;baidu;autonavi(不进行转换) |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取Request请求头UserId |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getLoginAuthUserId (HttpServletRequest request) { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * 返回json数据封装工具类 |
| | | * |
| | | * @ClassName: JsonUtil |
| | |
| | | |
| | | /** |
| | | * 通过生日计算年龄 |
| | | * |
| | | * @param birthDay 生日 |
| | | * @return |
| | | * @throws ParseException |
| | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | | * Storing strings in Redis without an expiration time. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | |
| | | /** |
| | | * 以分钟为单位设置存储值(设置过期时间) |
| | | * Set storage value in minutes (set expiration time) as units. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param time 秒 |
| | |
| | | |
| | | /** |
| | | * 从redis中获取值 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * |
| | | * @param kes |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除key |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | |
| | | private T data;//返回数据 |
| | | |
| | | |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil error(String mag){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(String msg){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil paranErr(String ages){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil<T> paranErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil runErr(){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data, String msg){ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param <T> |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param msg |
| | | * @param data |
| | | * @param <T> |
| | |
| | | |
| | | /** |
| | | * 签名无效 |
| | | * |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 把逗号分隔的字符串转换字符串数组 |
| | | * Convert comma-separated string to string array. |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 把逗号分隔字符串转换List的Long |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getClassCodeString(int length) { |
| | | String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | Random random = new Random(); |
| | |
| | | package com.dsh.activity.util; |
| | | |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.io.StringWriter; |
| | |
| | | public static String currentTime() { |
| | | return DateUtil.getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.activity.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | /** |
| | | * @author 张鹏 |
| | | * @date 2020/9/2 11:12 |
| | | * |
| | | * <p> |
| | | * 重新封装实体时,ID 丢失精度,在重写的 ID 上添加注解 @JsonSerialize(using = JsonLongSerializer.class) |
| | | */ |
| | | public class JsonLongSerializer extends JsonSerializer<Long> { |
| | |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 21:13 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 数据源配置 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 20:32 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 配置多数据源 |
| | | * |
| | | * @return |
| | | */ |
| | | private Map<String, DataSource> createDataSourceMap() { |
| | |
| | | |
| | | /** |
| | | * 分片配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private Collection<RuleConfiguration> createShardingRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserCouponTableRuleConfiguration() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserPointsMerchandiseTableRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserBenefitsVideosTableRuleConfiguration() { |
| | |
| | | .paths(PathSelectors.any()).build().groupName("公共Aip接口") |
| | | .apiInfo(apiInfo("公共Aip接口", "文档中可以查询及测试接口调用参数和结果", "1.0.0版本")); |
| | | } |
| | | |
| | | |
| | | |
| | | private ApiInfo apiInfo(String name, String description, String version) { |
| | |
| | | spring.cloud.nacos.discovery.group=@profiles.group@ |
| | | spring.main.allow-bean-definition-overriding=true |
| | | spring.flyway.enabled=false |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | | feign.compression.request.enabled=true |
| | | feign.compression.response.enabled=true |
| | | |
| | | |
| | | mybatis-plus.configuration.map-underscore-to-camel-case=false |
| | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | |
| | | courseId, |
| | | integral, |
| | | "0" as study |
| | | from t_benefits_videos where state = 1 and id not in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) |
| | | from t_benefits_videos where state = 1 and id not in (select benefitsVideosId from t_user_benefits_videos where |
| | | appUserId = #{uid}) |
| | | <if test="null != classificationId"> |
| | | and benefitsVideoClassificationId = #{classificationId} |
| | | </if> |
| | |
| | | courseId, |
| | | integral, |
| | | "1" as study |
| | | from t_benefits_videos where state = 1 and id in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) |
| | | from t_benefits_videos where state = 1 and id in (select benefitsVideosId from t_user_benefits_videos where |
| | | appUserId = #{uid}) |
| | | <if test="null != classificationId"> |
| | | and benefitsVideoClassificationId = #{classificationId} |
| | | </if> |
| | |
| | | </select> |
| | | <select id="listRecord" resultType="java.util.Map"> |
| | | select id,userId,status from t_user_coupon where couponId =#{id} |
| | | and userId in <foreach collection="ids" separator="," open="(" item="i" close=")"> |
| | | and userId in |
| | | <foreach collection="ids" separator="," open="(" item="i" close=")"> |
| | | #{i} |
| | | </foreach> |
| | | <if test="type !=null"> |
| | |
| | | </where> |
| | | |
| | | |
| | | |
| | | |
| | | </update> |
| | | |
| | | |
| | |
| | | WHEN 2 THEN '课包购买' |
| | | WHEN 3 THEN '门票购买' |
| | | WHEN 4 THEN '优惠券购买' |
| | | END AS consumeName ,DATE_FORMAT(pm.insertTime, '%m-%d %H:%i')as `consumeTime`,2 as type,CONCAT('-',tm.cash) as consumeAmount |
| | | END AS consumeName ,DATE_FORMAT(pm.insertTime, '%m-%d %H:%i')as `consumeTime`,2 as type,CONCAT('-',tm.cash) as |
| | | consumeAmount |
| | | FROM t_user_points_merchandise pm |
| | | LEFT JOIN t_points_merchandise tm ON tm.id = pm.pointsMerchandiseId |
| | | WHERE pm.pointsMerchandiseId IN( |
| | |
| | | spring.redis.database=0 |
| | | |
| | | spring.redis.host=@redis.addr@ |
| | | |
| | | spring.redis.port=@redis.port@ |
| | | spring.redis.password=@redis.password@ |
| | | spring.redis.jedis.pool.max-active=1024 |
| | |
| | | datasource.names=master0 |
| | | |
| | | 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_activity?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取赛事报名记录 |
| | | */ |
| | |
| | | } |
| | | return paymentCompetitions; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | public BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | |
| | | |
| | | return paymentCompetitionService.queryByCode(code); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/queryCompetitionList") |
| | | @ApiOperation(value = "获取赛事列表", tags = {"APP-赛事活动列表"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | |
| | | |
| | | /** |
| | | * 报名赛事微信支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 报名赛事支付宝支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/queryMyCompetitionList") |
| | | @ApiOperation(value = "获取已报名赛事列表", tags = {"APP-赛事活动列表"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/queryMyCompetitionInfo") |
| | | @ApiOperation(value = "获取已报名赛事详情", tags = {"APP-赛事活动列表"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 取消已报名赛事后微信回退金额回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | return new Page<Competition>(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/competition/listAudit") |
| | | public Page<Competition> listAudit(@RequestBody ListQuery listQuery){ |
| | | try { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/competition/getPeoples") |
| | | @ResponseBody |
| | | public List<CompetitionUser> getPeoples(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | |
| | | getPeopleQuery.getId(),getPeopleQuery.getState()); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/competition/queryFee") |
| | |
| | | double sum = list.stream().mapToDouble(PaymentCompetition::getAmount).sum(); |
| | | return sum; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/actYys") |
| | | public HashMap<String, Object> actYys(@RequestBody CompetionVO vo){ |
| | |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/participant/addParticipant") |
| | | @ApiOperation(value = "添加参赛人员", tags = {"APP-赛事活动列表", ""}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/participant/editParticipant") |
| | | @ApiOperation(value = "编辑参赛人员", tags = {"APP-赛事活动列表", ""}) |
| | |
| | | int numDigits = String.valueOf(editParticipant.getId()).length(); |
| | | |
| | | |
| | | |
| | | if (numDigits==9){ |
| | | Participant byId = participantService.getById(editParticipant.getId()); |
| | | editParticipant.setName(byId.getName()); |
| | | return participantService.editParticipant(uid, editParticipant); |
| | | } |
| | | else { |
| | | } else { |
| | | |
| | | |
| | | TStudent student = new TStudent(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/participant/delParticipant") |
| | | @ApiOperation(value = "删除参赛人员", tags = {"APP-赛事活动列表", ""}) |
| | |
| | | |
| | | /** |
| | | * 保存学员后同步参赛人员信息 |
| | | * |
| | | * @param saveParticipant |
| | | */ |
| | | @ResponseBody |
| | |
| | | public class UserCompetitionController { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | // 已报名人数 |
| | | @TableField(exist = false) |
| | | private String count; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param appUser |
| | | */ |
| | | @PostMapping("/base/appUser/updateAppUser") |
| | |
| | | |
| | | @PostMapping("/base/appUser/getAllUser") |
| | | List<AppUser> getAllUser(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/appUser/updateTStudent") |
| | | void updateAppUser(TStudent student); |
| | | |
| | | /** |
| | | * 根据电话号码获取学员 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @PostMapping("/student/queryStudentList") |
| | | List<TStudent> queryStudentList(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/student/queryById") |
| | | TStudent queryById(Integer id); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取学员剩余课时 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 取消报名赛事后回退学员课时 |
| | | * |
| | | * @param paymentDeductionClassHour |
| | | */ |
| | | @PostMapping("/coursePackagePayment/rollbackPaymentDeductionClassHour") |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索门店 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据门店id获取门店信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取赛事列表 |
| | | * |
| | | * @param cityCode |
| | | * @param content |
| | | * @param registerCondition |
| | |
| | | * 定时任务修改赛事状态 |
| | | */ |
| | | void taskSetStatusStart(); |
| | | |
| | | |
| | | |
| | | void taskSetStatusEnd(); |
| | |
| | | */ |
| | | public interface ParticipantMapper extends BaseMapper<Participant> { |
| | | Page<CompetitionUser> getPeopleFromId(@Param("participantPage") Page<UserCompetition> participantPage, @Param("id") Integer id, @Param("state") Integer state); |
| | | |
| | | List<CompetitionUser> getPeoples(@Param("id") Integer id, @Param("state") Integer state); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取已报名赛事列表 |
| | | * |
| | | * @param uid |
| | | * @param type |
| | | * @param pageSize |
| | |
| | | |
| | | /** |
| | | * 获取赛事列表 |
| | | * |
| | | * @param content |
| | | * @param registerCondition |
| | | * @param heat |
| | |
| | | |
| | | /** |
| | | * 获取赛事详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 赛事报名 |
| | | * |
| | | * @param uid |
| | | * @param paymentCompetitionVo |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 赛事可用课包 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 添加参赛人员信息 |
| | | * |
| | | * @param uid |
| | | * @param addParticipant |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取参赛人员列表 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 修改参赛人员信息 |
| | | * |
| | | * @param editParticipant |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 删除参赛人员信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 保存学员后同步参赛人员信息 |
| | | * |
| | | * @param saveParticipant |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取我的赛事报名记录 |
| | | * |
| | | * @param uid |
| | | * @param type |
| | | * @param pageSize |
| | |
| | | |
| | | /** |
| | | * 获取我报名的赛事详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 取消赛事报名 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | | private String aliAppid = "2021004105665036";//支付宝appid |
| | | |
| | | private String appPrivateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCi5i9nW/hGLJ3A06cZxTQdviFC7THpdSihoTYGLr9q006hu0V26ecBMY/o4w5bvIX0Ok/yofmZsVcCJpAPvbXL/uqVrIjnRRxXiaeBFThlxoBUTdunvbUSDYfzlEhJr5NvUKI6H6lz2niXlQGx4qy8Hau4ccWit9kM8jwUvsBVQoFgJA+xrjMvooA7YLopQtpOD+UJr5thApTSf1xrnr1W12yolTLEH15JmNV372cqXrYUuqnY0QsaPtxeqJUGAOcGdVLllQ7easEznP8DFBvDdHATcmp2SHNQDUEWN6MCVPbMgY06NQVqAXxqjTAYSVh+6TRu6bofPmpYC3TZB003AgMBAAECggEBAJAcR2+PA3NBYUYHeFrqBRMS8uX8ZR19kjZ7IgoSLTFaQsP9opRylPSPXhrPVBKAE5leRQAHn4MCSlESwHvMfxo7KFjFTFAc6dffZZpipYQUOc9bGampwJh58/3e/pyBgVMG6J23CPf/HJQtNFSkjd/V9+ayb/9l2dUEL3bC0fAZ/dbx8HsxdLw8wn3fLlWLj68hOMqa2deCZe3JdSVsPbeWqkh56FFsMLug0Nd+Ar4TgRl9/jnhXF0JWiD0LmPUYLhboY7EfUBzN4w1iYbDi1P+3zvoOYsiVKAXox9GMhQ2VzOO2UcSTuizSza2e98mGpabl/GpKmCz+RDFjtkX6eECgYEA2MyCij65eO3aGIm3FUe93DULRBYTfX8qJQSJq2WOWA3mmQlEW6L3O2B5/lG2h+8WmN6iLEs9eHpgycGYp7vAqgrANEn16ACVcuyx0scFtrZfZ+kmHMzFfiUWxJjVYk/6YngsGVBLdw6ueM42C8TTP67X9tU5TdVGoGWuqEj4W98CgYEAwFqwprXOch5Pqk/RPbb49r0Ou03K/UbciWnWWKzUhFFNS8MdlQPoDvQZbMwHLeWsa2VhaKITK3x5biLQb3U+0GLOn6lTvEyrEUH+ucREyLgVYTRAvwBPtnvlrzpyxPk2HnslQjju8WrvvLLBMKWUjlTrTOzhaHT21gz3pHMiOakCgYEAhLmfaXdBITGshb054sNLDtdCkGpbgEcrzAHdLps769iGxkYQHXHFngpQZUwtTUcoNGqIKknd1jZFrv7gsD+XkgKG7PwimehRlkwmCX5ilxtLiVgJRzRt6+5U5AMVD90a0tHzXYP0z2yjj73fBJF5KtGl0a10KZxaYrQdm1UhB00CgYBZZgzx/k9rtHC8LAqIj1CYhHejT92G53c6Gkl3vyOqN4sgKhfGmSEySfrDGPRBPZxr8ZtbIPCd5mUdberH0osWGMYFaJI1UsCy7aQwvGpniz7MhZeN7dweaOjwDs8mgtjHQ96mL4XGCDhR0BZ/wIURvZ/6iaGdhbbu9unlsWj3uQKBgQCmZYdsbbZkd3ev6f8rwyvMz+DrCQyYpY44cegBYuJgrZiQnL2fJioeN7ixX0UM48SfwsZEIrzshP/LGAwnc2MdjxKUl4jLN8SEe0NAjXOnz9Zaw740+aOmLpXcLWdP4uM2gIhWsvW1tEkQZCXmm7c9s/RsU8Pmzv+YL3+fSijOzA==";//支付宝开发者应用私钥 |
| | |
| | | |
| | | /** |
| | | * 获取赛事列表 |
| | | * |
| | | * @param content |
| | | * @param registerCondition |
| | | * @param heat |
| | |
| | | |
| | | /** |
| | | * 获取赛事详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 赛事报名 |
| | | * |
| | | * @param uid |
| | | * @param paymentCompetitionVo |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 赛事微信支付 |
| | | * |
| | | * @param code |
| | | * @param money |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 赛事支付宝支付 |
| | | * |
| | | * @param code |
| | | * @param money |
| | | * @return |
| | |
| | | |
| | | @Autowired |
| | | private CompetitionService competitionService; |
| | | |
| | | public void moneyOut(String outNum,String tradeNo) throws AlipayApiException { |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2"); |
| | | AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | // RoyaltyDetailInfos royaltyDetailInfos1 = new RoyaltyDetailInfos(); |
| | | // royaltyDetailInfos1.setTransOutType("loginName"); |
| | | // royaltyDetailInfos1.setTransOut("happysports@weparklife.com"); |
| | |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(byId1.getOperatorId()); |
| | | |
| | | |
| | | |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | | // Integer siteBookings = siteClient.queryByCode(outTradeNo); |
| | | // List<Integer> stores = new ArrayList<>(); |
| | |
| | | // stores.add(paymentCompetitions); |
| | | // stores.add(siteBookings); |
| | | // OperatorUser operatorUser = siteClient.queryOperator(stores); |
| | | |
| | | |
| | | |
| | | |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加参赛人员信息 |
| | | * |
| | | * @param uid |
| | | * @param addParticipant |
| | | * @return |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取参赛人员列表 |
| | | * |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | |
| | | //利用HashMap去重身份证 |
| | | LinkedHashMap<String,ParticipantVo> linkedHashMap =new LinkedHashMap<>(); |
| | | SimpleDateFormat sdf_year = new SimpleDateFormat("yyyy"); |
| | | |
| | | |
| | | |
| | | |
| | | //查出临时表里的数据,也去重 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | listVo1.addAll(linkedHashMap.values()); |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * 修改参赛人员信息 |
| | | * |
| | | * @param editParticipant |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 删除参赛人员信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | private PaymentCompetitionMapper paymentCompetitionMapper; |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private CompetitionMapper competitionMapper; |
| | | |
| | | /** |
| | | * 获取我的报名赛事记录 |
| | | * |
| | | * @param uid |
| | | * @param type |
| | | * @param pageSize |
| | |
| | | |
| | | /** |
| | | * 获取我报名的赛事详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | competitionInfo.setStoreInfos(objects); |
| | | |
| | | |
| | | |
| | | List<ParticipantVo> participant = new ArrayList<>(); |
| | | List<UserCompetition> list = userCompetitionService.list(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); |
| | | List<Integer> collect = list.stream().map(UserCompetition::getParticipantId).collect(Collectors.toList()); |
| | |
| | | |
| | | /** |
| | | * 取消赛事报名 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | /** |
| | | * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值 |
| | | * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object. |
| | | * |
| | | * @param d |
| | | * @param years |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的月份,可以为负 |
| | | * Adding the specified number of month to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param months |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的天数,可以为负 |
| | | * Adding the specified number of day to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param days |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的小时,可以为负 |
| | | * Adding the specified number of hour to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param hours |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的分钟,可以为负 |
| | | * Adding the specified number of minute to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param minutes |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的秒数,可以为负 |
| | | * Adding the specified number of seconds to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param seconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的毫秒数,可以为负 |
| | | * Adding the specified number of milliseconds to the given time can result in a negative value. |
| | | * |
| | | * @param d |
| | | * @param milliseconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的年份是新的给定的年份 |
| | | * Setting the year of a date object to a new given year. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param year 新的年份 |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的月份是新的给定的月份 |
| | | * Set the month of a date object to a new given month. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param month 新的月份 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的天是新的给定的天 |
| | | * Set the day of a date object to a new given day. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param day 新的天 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的小时是新的给定的小时 |
| | | * Setting the hour of a date object to a new given hour. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param hour 新的小时数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的分钟是新的给定的分钟数 |
| | | * Set the minutes of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param minute 新的分钟数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的毫秒数是新的给定的分钟数 |
| | | * Setting the milliseconds of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param millisecond 新的毫秒数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param d 日期对象 |
| | | */ |
| | | public static int getDaysOfMonth(Date d) { |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param year 年 |
| | | * @param month 月 |
| | | */ |
| | |
| | | /** |
| | | * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数 |
| | | * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month. |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期后几天的日期 |
| | | * Obtaining the date of the day after several days from the current date. |
| | | * |
| | | * @param day 天数 |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 是否是同一天 |
| | | * it the same day |
| | | * |
| | | * @param first |
| | | * @param second |
| | | * @return |
| | |
| | | /** |
| | | * 是否超过指定时刻 |
| | | * Has the specified time limit been exceeded |
| | | * |
| | | * @param day 时间 |
| | | * @param time 指定时刻 |
| | | * @return |
| | |
| | | /** |
| | | * 指定一天哪一个小时 |
| | | * Specify which hour of a particular day. |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 数字换算成中文(周) |
| | | * Conversion of numbers to Chinese (weeks) |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取两个时间的间隔(秒) |
| | | * Obtain the time difference between two instances (in seconds). |
| | | * |
| | | * @param d1 |
| | | * @param d2 |
| | | * @return |
| | |
| | | /** |
| | | * 获取到当月所有日期 |
| | | * Obtain all dates of the current month |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | Calendar cal = Calendar.getInstance(); |
| | | return cal; |
| | | } |
| | | |
| | | /** |
| | | * 毫秒转日期时间 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取Request请求头UserId |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getLoginAuthUserId (HttpServletRequest request) { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * 返回json数据封装工具类 |
| | | * |
| | | * @ClassName: JsonUtil |
| | |
| | | |
| | | /** |
| | | * 校验实名认证 |
| | | * |
| | | * @param idcard |
| | | * @param name |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 通过生日计算年龄 |
| | | * |
| | | * @param birthDay 生日 |
| | | * @return |
| | | * @throws ParseException |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private static String byteArrayToHexString(byte b[]) { |
| | | StringBuffer resultSb = new StringBuffer(); |
| | | for (int i = 0; i < b.length; i++) |
| | |
| | | private String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝支付 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码支付下单 |
| | | * |
| | | * @param body |
| | | * @param subject |
| | | * @param outTradeNo |
| | |
| | | |
| | | /** |
| | | * 支付成功后的回调处理逻辑 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> alipayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 支付宝查询订单支付状态 |
| | | * |
| | | * @param out_trade_no |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信统一下单 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param out_trade_no 商户订单号 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信支付成功后的回调处理 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> weixinpayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 微信扫码收款 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param nonce_str 随机字符串 |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码收款 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款申请 |
| | | * |
| | | * @param transaction_id 微信订单号。微信生成的订单号,在支付通知中有返回 |
| | | * @param out_refund_no 商户退款单号。商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。 |
| | | * @param total_fee 订单金额。订单总金额,单位为分,只能为整数 |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的回调处理 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝退款 |
| | | * |
| | | * @param trade_no 支付宝交易号 |
| | | * @param refund_amount 退款金额 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询微信支付订单 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到零钱) |
| | | * |
| | | * @param openid 商户appid下,某用户的openid |
| | | * @param desc 企业付款备注,必填。 |
| | | * @param total_fee 企业付款金额 |
| | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到银行卡) |
| | | * |
| | | * @param desc 备注信息 |
| | | * @param total_fee 转账金额 |
| | | * @param partner_trade_no 订单号 |
| | |
| | | |
| | | /** |
| | | * 微信转账到银行卡不编号 |
| | | * |
| | | * @param bankName |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝转账 |
| | | * |
| | | * @param out_biz_no 商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。 |
| | | * @param trans_amount 订单总金额,单位为元,精确到小数点后两位 |
| | | * @param order_title 转账业务的标题,用于在支付宝用户的账单里显示 |
| | |
| | | |
| | | /** |
| | | * 获取请求内容 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws IOException |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的解密 |
| | | * |
| | | * @param req_info |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * xml转map |
| | | * |
| | | * @param xml |
| | | * @param charset |
| | | * @return |
| | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | | * Storing strings in Redis without an expiration time. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | |
| | | /** |
| | | * 以分钟为单位设置存储值(设置过期时间) |
| | | * Set storage value in minutes (set expiration time) as units. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param time 秒 |
| | |
| | | |
| | | /** |
| | | * 从redis中获取值 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * |
| | | * @param kes |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除key |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | |
| | | private T data;//返回数据 |
| | | |
| | | |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil error(String mag){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(String msg){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil paranErr(String ages){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil<T> paranErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil runErr(){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data, String msg){ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param <T> |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param msg |
| | | * @param data |
| | | * @param <T> |
| | |
| | | |
| | | /** |
| | | * 签名无效 |
| | | * |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 把逗号分隔的字符串转换字符串数组 |
| | | * Convert comma-separated string to string array. |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 把逗号分隔字符串转换List的Long |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getClassCodeString(int length) { |
| | | String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | Random random = new Random(); |
| | |
| | | package com.dsh.competition.util; |
| | | |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.io.StringWriter; |
| | |
| | | public static String currentTime() { |
| | | return DateUtil.getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.competition.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | /** |
| | | * @author 张鹏 |
| | | * @date 2020/9/2 11:12 |
| | | * |
| | | * <p> |
| | | * 重新封装实体时,ID 丢失精度,在重写的 ID 上添加注解 @JsonSerialize(using = JsonLongSerializer.class) |
| | | */ |
| | | public class JsonLongSerializer extends JsonSerializer<Long> { |
| | |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 21:13 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 数据源配置 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 20:32 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 配置多数据源 |
| | | * |
| | | * @return |
| | | */ |
| | | private Map<String, DataSource> createDataSourceMap() { |
| | |
| | | |
| | | /** |
| | | * 分片配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private Collection<RuleConfiguration> createShardingRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserCompetitionTableRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getPaymentCompetitionTableRuleConfiguration() { |
| | |
| | | .paths(PathSelectors.any()).build().groupName("公共Aip接口") |
| | | .apiInfo(apiInfo("公共Aip接口", "文档中可以查询及测试接口调用参数和结果", "1.0.0版本")); |
| | | } |
| | | |
| | | |
| | | |
| | | private ApiInfo apiInfo(String name, String description, String version) { |
| | |
| | | |
| | | /** |
| | | * 获取 包装防Xss Sql注入的 HttpServletRequest |
| | | * |
| | | * @return request |
| | | */ |
| | | public static HttpServletRequest getRequest() { |
| | |
| | | /** |
| | | * Copyright (c) 2011-2014, hubin (jobob@qq.com). |
| | | * |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | |
| | | /** |
| | | * Copyright (c) 2011-2014, hubin (jobob@qq.com). |
| | | * |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| | | * use this file except in compliance with the License. You may obtain a copy of |
| | | * the License at |
| | | * |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| | | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| | |
| | | spring.cloud.nacos.discovery.group=@profiles.group@ |
| | | spring.main.allow-bean-definition-overriding=true |
| | | spring.flyway.enabled=false |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | |
| | | datasource.names=master0 |
| | | |
| | | 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_competition?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | |
| | | /** |
| | | * @author 张鹏 |
| | | * @date 2020/9/2 11:12 |
| | | * |
| | | * <p> |
| | | * 重新封装实体时,ID 丢失精度,在重写的 ID 上添加注解 @JsonSerialize(using = JsonLongSerializer.class) |
| | | */ |
| | | public class JsonLongSerializer extends JsonSerializer<Long> { |
| | |
| | | |
| | | /** |
| | | * 数据源 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 21:13 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 数据源配置 |
| | | * |
| | | * @author pzb |
| | | * @Date 2022/11/21 20:32 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 配置多数据源 |
| | | * |
| | | * @return |
| | | */ |
| | | private Map<String, DataSource> createDataSourceMap() { |
| | |
| | | |
| | | /** |
| | | * 分片配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private Collection<RuleConfiguration> createShardingRuleConfiguration() { |
| | |
| | | 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())); |
| | | |
| | | //分片规则配置 |
| | | result1.getTables().add(getCoursePackageOrderTableRuleConfiguration()); |
| | | Properties props6 = new Properties(); |
| | | props1.setProperty("algorithm-expression", "t_course_package_order$->{appUserId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_course_package_order-inline", new AlgorithmConfiguration("INLINE", props6)); |
| | | result1.getKeyGenerators().put("t_course_package_order-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | |
| | | linkedList.add(result1); |
| | | |
| | | return linkedList; |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackagePaymentTableRuleConfiguration() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageStudentTableRuleConfiguration() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getPostCourseVideoTableRuleConfiguration() { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getUserVideoDetailsTableRuleConfiguration() { |
| | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageSchedulingTableRuleConfiguration() { |
| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageOrderTableRuleConfiguration() { |
| | | ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_order", "m_$->{0}.t_course_package_order$->{1..5}");//30 |
| | | result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("appUserId", "t_course_package_order-inline")); |
| | | result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_order-snowflake")); |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | .paths(PathSelectors.any()).build().groupName("公共Aip接口") |
| | | .apiInfo(apiInfo("公共Aip接口", "文档中可以查询及测试接口调用参数和结果", "1.0.0版本")); |
| | | } |
| | | |
| | | |
| | | |
| | | private ApiInfo apiInfo(String name, String description, String version) { |
| | |
| | | |
| | | /** |
| | | * 获取课包对应的消费记录 |
| | | * |
| | | * @param sessionList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * |
| | | * @param cancelledClasses |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 通过课程ids获取课程 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/course/getCourseByCourseIds") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/course/queryCourseList") |
| | | @ApiOperation(value = "获取课程列表", tags = {"APP-课程列表"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/course/queryCourseInfo") |
| | | @ApiOperation(value = "获取课程详情", tags = {"APP-课程列表"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 购买课程微信支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | String attach = map.get("attach"); |
| | | String result = map.get("result"); |
| | | |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(new QueryWrapper<TCoursePackagePayment>().eq("state", 1).eq("code", code).eq("payType", 1)); |
| | | TCoursePackagePayment one = list.get(0); |
| | | if(one.getPayStatus() == 1){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(transaction_id); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | } |
| | | ResultUtil resultUtil = coursePackageService.paymentCourseCallback(code, transaction_id, attach); |
| | | if (resultUtil.getCode() == 200) { |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | /** |
| | | * 购买课程支付宝回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | @PostMapping("/base/course/aliPaymentCourseCallback") |
| | | public void aliPaymentCourseCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | System.err.println("=====支付宝回调======="); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(new QueryWrapper<TCoursePackagePayment>().eq("state", 1).eq("code", code).eq("payType", 2)); |
| | | TCoursePackagePayment one = list.get(0); |
| | | if(one.getPayStatus() == 1){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(1); |
| | | coursePackagePayment.setOrderNumber(trade_no); |
| | | coursePackagePayment.setAppUserId(null); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | } |
| | | String passback_params = map.get("passback_params"); |
| | | ResultUtil resultUtil = coursePackageService.paymentCourseCallback(code, trade_no, passback_params); |
| | | if (resultUtil.getCode() == 200) { |
| | | PrintWriter out = response.getWriter(); |
| | | out.write("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | //分账 |
| | | public void moneyOut(){ |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id获取课程数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据名称获取数据 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课程管理列表数据 |
| | | * |
| | | * @param queryCourseList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加课程 |
| | | * |
| | | * @param course |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * |
| | | * @param course |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 编辑数据状态 |
| | | * |
| | | * @param editCourseState |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据类型获取数据 |
| | | * |
| | | * @param type |
| | | * @return |
| | | */ |
| | |
| | | return strings; |
| | | |
| | | } |
| | | |
| | | // 获取课包商品的价格配置 |
| | | @PostMapping("/course/getHoursByPackageId") |
| | | @ResponseBody |
| | |
| | | .eq("coursePackageId", coursePackageId1)); |
| | | return coursePackageId; |
| | | } |
| | | |
| | | @PostMapping("/course/getHours") |
| | | public List<Integer> getHours(@RequestBody Integer coursePackageId1){ |
| | | return coursePackageService.getHours(coursePackageId1); |
| | |
| | | TCoursePackage byId1 = coursePackageService.getById(byId.getCoursePackageId()); |
| | | return byId1; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/course/queryByDiscountId1") |
| | | public TCoursePackage queryByDiscountId1(@RequestBody Integer id){ |
| | |
| | | TCoursePackageDiscount byId = discountService.getById(id); |
| | | return byId.getAuditStatus(); |
| | | } |
| | | |
| | | @PostMapping("/course/queryDiscountList") |
| | | public List<DiscountList> queryDiscountList(@RequestBody QueryDiscountList queryDiscountList){ |
| | | return discountService.queryDiscountList(queryDiscountList); |
| | |
| | | |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService packagePaymentConfigService; |
| | | |
| | | @PostMapping("/course/times") |
| | | public List<SelectDto> times(@RequestBody Integer oneId){ |
| | | List<CoursePackagePaymentConfig> list = packagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId",oneId)); |
| | |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据门店ids获取课包ids 根据课包ids 获取购课记录的用户ids |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | return userVideoDetailsService.count(new QueryWrapper<UserVideoDetails>().eq("appUserId",stuId)) ; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | | */ |
| | |
| | | |
| | | return coursePackageService.list(new QueryWrapper<TCoursePackage>().eq("storeId", storeId)); |
| | | } |
| | | |
| | | /** |
| | | * 根据课包类型获取课包 |
| | | */ |
| | |
| | | |
| | | return coursePackageService.list(new QueryWrapper<TCoursePackage>().eq("coursePackageTypeId", typeId).eq("storeId",storeId)); |
| | | } |
| | | |
| | | /** |
| | | * 本周福利列表 |
| | | */ |
| | |
| | | String classTimeAsString = String.join("|", classTime); |
| | | |
| | | |
| | | |
| | | courseVo.setClassStartTime(classTimeAsString); |
| | | courseVo.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | courseVo.setApplicantsNumber(count); |
| | |
| | | |
| | | /** |
| | | * 根据id获取课包 |
| | | * |
| | | * @param coursePackConfigId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课包管理列表数据 |
| | | * |
| | | * @param queryCoursePackageLists |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackage |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", coursePackageId) |
| | | .eq("auditStatus", 2)); |
| | | } |
| | | |
| | | /** |
| | | * 获取根据课包id获取课包折扣 |
| | | */ |
| | |
| | | public List<TCoursePackageDiscount> queryByCoursePackageId1(@RequestBody Integer coursePackageId){ |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackageId", coursePackageId)); |
| | | } |
| | | |
| | | /** |
| | | * 获取课包折扣 |
| | | * |
| | | * @param coursePackagePaymentConfigId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑课包折扣 |
| | | * |
| | | * @param list |
| | | */ |
| | | @ResponseBody |
| | |
| | | return coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", id) |
| | | .ne("auditStatus", 2)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据主键id获取价格配置 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | public CoursePackagePaymentConfig getById(@RequestBody Integer id){ |
| | | return coursePackagePaymentConfigService.getById(id); |
| | | } |
| | | |
| | | /** |
| | | * 添加数据 |
| | | * |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据课包id获取价格配置 |
| | | * |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param coursePackageId |
| | | */ |
| | | @ResponseBody |
| | |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CoursePackagePaymentController { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger("business-log"); |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService packagePaymentService; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | |
| | | @Resource |
| | | private CoursePackageStudentService cspsService; |
| | | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Resource |
| | | private AppUserClient auClitn; |
| | | |
| | | @Resource |
| | | private StoreClient sreClient; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | @Autowired |
| | | private CouponClient couponClient; |
| | | @Autowired |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingMapper; |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService coursePackageOrderStudentService; |
| | | |
| | | |
| | | /** |
| | | * 查询学员入学时间 根据第一次购买课包的时间 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/getTime") |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 添加购课记录-后台 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/add") |
| | |
| | | coursePackageStudent.setCoursePackagePaymentId(packagePayment.getId()); |
| | | return coursePackageStudentService.save(coursePackageStudent); |
| | | } |
| | | |
| | | /** |
| | | * 手动支付 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/coursePackagePayment/changeState") |
| | |
| | | |
| | | return packagePaymentService.changeState(dto); |
| | | } |
| | | |
| | | @GetMapping("/coursePackagePayment/courseStore/{appUserId}/{coursePackageId}") |
| | | public List<TCoursePackagePayment> getByUserIdAndCoursePackageId(@PathVariable("appUserId") Integer appUserId,@PathVariable("coursePackageId") Integer coursePackageId){ |
| | | List<TCoursePackagePayment> list = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | .eq("coursePackageId", coursePackageId)); |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取购课记录 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取 没有学员信息的图片配置 |
| | | * |
| | | * @param stuId 学员id |
| | | * @return 课包列表 |
| | | */ |
| | |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | Student student = studentClient.queryStudentById(stuId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | List<CoursePackageOrderStudent> byUserId = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId",student.getAppUserId()) |
| | | .eq("studentId",stuId).eq("payStatus",2)); |
| | | .eq("studentId", stuId)); |
| | | |
| | | Date date = new Date(); |
| | | |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | for (CoursePackageOrderStudent tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null) { |
| | |
| | | resp.setResidueNums(tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setDeductionNums(tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setCourseType(tCoursePackage.getType()); |
| | | if (tCoursePackage.getType()!=1||tCoursePackage.getState()==2||tCoursePackagePayment.getPayStatus()==1){ |
| | | if (tCoursePackage.getType() != 1 || tCoursePackage.getState() == 2) { |
| | | resp.setIsAble(0); |
| | | }else { |
| | | resp.setIsAble(1); |
| | | } |
| | | |
| | | if (tCoursePackagePayment.getUseTime()!=null){ |
| | | // String afterDayDate = DateUtil.getAfterDayDate2(tCoursePackage.getInsertTime(),tCoursePackage.getValidDays() + ""); |
| | | // resp.setPeriodOfValidity(afterDayDate); |
| | | |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String str = sdf.format(tCoursePackagePayment.getUseTime()); |
| | | resp.setPeriodOfValidity(str); |
| | | } |
| | | |
| | | |
| | | |
| | | resps.add(resp); |
| | | } |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String str = sdf.format(date); |
| | | |
| | | for (StuCourseResp resp : resps) { |
| | | |
| | | |
| | | resp.setPeriodOfValidity(str); |
| | | } |
| | | |
| | | |
| | | return resps; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * 获取发布的 课包列表 |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * 课程名称列表 |
| | | */ |
| | | @PostMapping("/base/coursePack/sessionNames") |
| | |
| | | detVo.setRemainingNums(vo.getLaveClassHours()); |
| | | |
| | | detailsVos.add(detVo); |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | QueryWrapper<CourseCounsum> in = new QueryWrapper<CourseCounsum>().in("paymentId", ids).in("changeType", changes); |
| | | |
| | | if (recordTimeRequest.getType()!=null){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/stuOfCourses") |
| | | public StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody GetStuOfCoursesDetails getStuOfCoursesDetails){ |
| | | StuWithCoursesListVo lisco = new StuWithCoursesListVo(); |
| | |
| | | } |
| | | return lisco; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/continuingCourse") |
| | |
| | | return ResultUtil.success(coursePackageSchedulings1); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(packagePaymentService.queryRegisteredCourseList(courseTypeId,appUserId)); |
| | | return ResultUtil.success(coursePackageOrderService.queryRegisteredCourseList(courseTypeId, appUserId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | |
| | | /** |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | throw new RuntimeException(e.getMessage()); |
| | | // return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取学员剩余课时 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | return 0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取学员剩余课时 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | private TCoursePackageService packageService; |
| | | @Autowired |
| | | CoursePackageStudentService studentService ; |
| | | |
| | | /** |
| | | * 课程用于支付进行扣减 |
| | | * |
| | | * @param paymentDeductionClassHour |
| | | */ |
| | | @ResponseBody |
| | |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", coursePackagePayment.getStudentId()).eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id",collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", paymentDeductionClassHour.getId()).eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(coursePackagePayment.getCoursePackageId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 2.0 少于3课时 推送 |
| | |
| | | } |
| | | return integers; |
| | | } |
| | | |
| | | /** |
| | | * 取消赛事回退支付课时 |
| | | * |
| | | * @param paymentDeductionClassHour |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 找出符合门店的课包 |
| | | * |
| | | * @param s |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 课包续费玩湃币支付 |
| | | * |
| | | * @param |
| | | */ |
| | | @PostMapping("/coursePackagePayment/courseRenewPlayPaiPay") |
| | |
| | | public boolean delPaymentCoursePackage(@RequestBody Integer payId){ |
| | | return packagePaymentService.removeById(payId); |
| | | } |
| | | |
| | | @PostMapping("/base/coursePack/updatePaymentCoursePackage") |
| | | public boolean updatePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment){ |
| | | boolean id = packagePaymentService.update(packagePayment, new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | String[] split = orderDto.getStuIds().split(","); |
| | | for (String s : split) { |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s).eq("coursePackageId",orderDto.getClassId())); |
| | | |
| | | |
| | | |
| | | if (coursePackagePaymentServiceOne==null) { |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId) throws ParseException { |
| | | // 课包 |
| | | TCoursePackage tCoursePackage = coursePackageService.getById(courseId); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coursePack/getCoursePackagePaymentOfCode") |
| | | public List<TCoursePackagePayment> getCoursePackagePaymentOfCode(@RequestBody String code){ |
| | | return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id",collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", byId.getStudentId()).eq("coursePackageId", byId.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(byId.getCoursePackageId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(b){ |
| | | return 1; |
| | | }else { |
| | |
| | | |
| | | /** |
| | | * 查询课时 |
| | | * |
| | | * @param courseConfigId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课包报名信息列表 |
| | | * |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackagePayment |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackagePayment |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/getConsumes") |
| | | List<CourseCounsum> getConsumes(@RequestBody BillingDataRequestVo requestVo) { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/weeksOfCourseDetailsList") |
| | | HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq){ |
| | | public HashMap<String, Object> weeksOfCourseDetailsList(@RequestBody CourseDetailReq courseDetailReq) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | ArrayList<DetailsListVo> objects = new ArrayList<>(); |
| | | // try { |
| | | String time = courseDetailReq.getTime(); |
| | | Date parse = null; |
| | | try { |
| | |
| | | map.put("lon",lon); |
| | | map.put("lat",lat); |
| | | |
| | | String time1 = courseDetailReq.getTime(); |
| | | |
| | | // 找出门店的所有课程 排出体验 |
| | | List<TCoursePackage> list = tcpService.list(new LambdaQueryWrapper<TCoursePackage>().eq(TCoursePackage::getStoreId, courseDetailReq.getStoreId()).ne(TCoursePackage::getType, 3).eq(TCoursePackage::getState,1).like(TCoursePackage::getClassWeeks,week)); |
| | |
| | | collect.add(-1); |
| | | } |
| | | // 找出购买的课包 |
| | | List<TCoursePackagePayment> list1 = packagePaymentService.list(new LambdaQueryWrapper<TCoursePackagePayment>().eq(TCoursePackagePayment::getAppUserId, courseDetailReq.getAppUserId()).eq(TCoursePackagePayment::getStudentId, courseDetailReq.getStuId()).in(TCoursePackagePayment::getCoursePackageId, collect)); |
| | | List<Integer> collect1 = list1.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<Long> ids = list1.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | List<CoursePackageOrderStudent> list1 = coursePackageOrderStudentService.list(new QueryWrapper<CoursePackageOrderStudent>() |
| | | .eq("appUserId", courseDetailReq.getAppUserId()) |
| | | .eq("studentId", courseDetailReq.getStuId()) |
| | | .in("coursePackageId", collect) |
| | | .eq("status", 1) |
| | | .eq("state", 1) |
| | | ); |
| | | |
| | | List<Integer> collect1 = list1.stream().map(CoursePackageOrderStudent::getCoursePackageId).collect(Collectors.toList()); |
| | | List<Long> ids = list1.stream().map(CoursePackageOrderStudent::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | for (TCoursePackage tCoursePackage : list) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }else { |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | |
| | | objects.add(detailsListVo); |
| | | |
| | | } |
| | | // objects.add(detailsListVo); |
| | | } |
| | | map.put("data",objects); |
| | | |
| | | return map; |
| | | // } catch (ParseException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return map; |
| | | } |
| | | |
| | | private String week(int i){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/coursePt") |
| | | HashMap<String, Object> coursePt(@RequestBody List<Integer> userPt){ |
| | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/courseYys") |
| | | HashMap<String, Object> courseYys(@RequestBody List<Integer> userPt){ |
| | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/courseStore") |
| | | HashMap<String, Object> courseStore(@RequestBody List<Integer> userPt){ |
| | |
| | | } |
| | | |
| | | map.put("yearData",years); |
| | | |
| | | |
| | | |
| | | ArrayList<Integer> months = new ArrayList<>(); |
| | |
| | | |
| | | /** |
| | | * 获取课包排课列表 |
| | | * |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑数据 |
| | | * |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据排课id获取预约数据 |
| | | * |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackageStudent |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 根据排课id获取预约数据 |
| | | * |
| | | * @param coursePackageSchedulingId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取上课记录数据 |
| | | * |
| | | * @param queryCoursePackageStudent |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加学员上课数据 |
| | | * |
| | | * @param coursePackageStudent |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | return coursePackageTypeService.list(new QueryWrapper<TCoursePackageType>().in("id",ids)); |
| | | } |
| | | |
| | | /** |
| | | * 新增课包类型 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改课包类型 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | return 200; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除课包类型 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课包所有类型 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | private CancelledClassesService caccService; |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestBody GetStudentCourse course){ |
| | | Integer sult = 0; |
| | |
| | | private TCoursePackageService coursePackageService; |
| | | @Resource |
| | | private CoursePackageStudentMapper cpsMapper; |
| | | |
| | | //获取退费记录 |
| | | @RequestMapping("/getRefund") |
| | | @ResponseBody |
| | |
| | | |
| | | @Resource |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingService; |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping("/getStudentTotal") |
| | |
| | | |
| | | return studentClassInfo; |
| | | } |
| | | |
| | | //获取学员课程列表 |
| | | @RequestMapping("/getClassList") |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | //获取可转移学员 |
| | | @RequestMapping("/getSelect") |
| | | @ResponseBody |
| | |
| | | if (studentIds.size()>0){ |
| | | List<SelectDto> selectDtos = appUserClient.getSelects(studentIds); |
| | | |
| | | return selectDtos;} |
| | | else return null; |
| | | return selectDtos; |
| | | } else return null; |
| | | } |
| | | |
| | | |
| | | |
| | | //根据payid获取对应门店的常规课程 |
| | | |
| | | @Autowired |
| | | private TCoursePackageService packageService; |
| | | |
| | | @RequestMapping("/holiSelect") |
| | | @ResponseBody |
| | | public List<SelectDto> getHoliSelect(@RequestParam("courseId")Integer id){ |
| | |
| | | selectDto.setValue(t.getName()); |
| | | selectDtos.add(selectDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return selectDtos; |
| | |
| | | selectDto.setValue(t.getName()); |
| | | selectDtos.add(selectDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return selectDtos; |
| | |
| | | o.setStatus(4); |
| | | o.setAppUserId(null); |
| | | } |
| | | |
| | | |
| | | |
| | | paymentService.updateBatchById(pays); |
| | |
| | | o.setAppUserId(null); |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(o.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | |
| | | coursePackageSchedulingService.delete(new QueryWrapper<CoursePackageScheduling>().in("id", collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", o.getStudentId()).eq("coursePackageId", o.getCoursePackageId())); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | paymentService.updateBatchById(id1); |
| | | } |
| | | |
| | | @RequestMapping("/cancel") |
| | | @ResponseBody |
| | | public void cancel(@RequestParam("ids")String ids){ |
| | |
| | | |
| | | @Autowired |
| | | private MoneyBackService moneyBackService; |
| | | |
| | | @RequestMapping("/getMoneyBack") |
| | | @ResponseBody |
| | | public List<MoneyBack> getMoneyBack(@RequestParam("tStudentId")Integer tStudentId){ |
| | |
| | | courseCounsum.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId()!=studentPay.getAppUserId()){ |
| | | courseCounsum.setReason("课时转移"); |
| | | }else { courseCounsum.setReason("课时转移"); |
| | | } else { |
| | | courseCounsum.setReason("课时转移"); |
| | | } |
| | | courseCounsum.setNum(laveClassHours); |
| | | courseCounsum.setChangeType(0); |
| | |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | if (orinPay.getAppUserId()!=studentPay.getAppUserId()){ |
| | | courseCounsum1.setReason("课时转移"); |
| | | }else { courseCounsum1.setReason("课时转移"); |
| | | } else { |
| | | courseCounsum1.setReason("课时转移"); |
| | | } |
| | | courseCounsum1.setNum(laveClassHours); |
| | | courseCounsum1.setChangeType(1); |
| | |
| | | Student student = studentClient.queryStudentById(toClassDto.getToStudentId()); |
| | | |
| | | Date today = new Date(); |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(studentPay.getId()); |
| | |
| | | }else { |
| | | |
| | | |
| | | |
| | | Student student = studentClient.queryStudentById(toClassDto.getToStudentId()); |
| | | TCoursePackagePayment to = new TCoursePackagePayment(); |
| | | to.setStudentId(toClassDto.getToStudentId()); |
| | |
| | | paymentService.save(to); |
| | | |
| | | |
| | | |
| | | orinPay.setTotalClassHours(0); |
| | | orinPay.setLaveClassHours(0); |
| | | orinPay.setAppUserId(null); |
| | | orinPay.setStatus(1); |
| | | paymentService.updateById(orinPay); |
| | | |
| | | |
| | | |
| | | //删除orin的排课记录 |
| | |
| | | counsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("课时转移"); |
| | |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setPaymentId(to.getId()); |
| | | counsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(studentPay.getCoursePackageId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | Date today = new Date(); |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(studentPay.getId()); |
| | |
| | | private StudentClient studentClient; |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | @RequestMapping(value = "/toHoli",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") |
| | | @ResponseBody |
| | | public String toHoli(@RequestBody ToHoliDto toHoliDto) throws ParseException { |
| | |
| | | Student student = studentClient.queryStudentById(payment.getStudentId()); |
| | | |
| | | if (laveClassHours < classNum){ |
| | | strings.add(student.getName()); continue; |
| | | strings.add(student.getName()); |
| | | continue; |
| | | } |
| | | |
| | | Integer laveClassHoursnew = laveClassHours - classNum; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | System.out.println("保存成功=============》="+holi); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return join; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService coursePackagePaymentService; |
| | | |
| | | public static Date[] generateDateArray(int numDays,Date date) { |
| | | // LocalDate tomorrow = LocalDate.now().plusDays(1); |
| | | LocalDate tomorrow = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(1); |
| | |
| | | |
| | | return dates; |
| | | } |
| | | |
| | | private List<Integer> week(String week){ |
| | | String[] split = week.split(";"); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | |
| | | @RequestMapping(value = "/toTrans",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") |
| | | @ResponseBody |
| | | public String toTrans(@RequestBody ToHoliDto toHoliDto) throws ParseException { |
| | |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(toHoliDto.getClassId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | |
| | | |
| | | |
| | | Date today = new Date(); |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(holi.getId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | String[] stringArray = strings.toArray(new String[strings.size()]); |
| | | |
| | |
| | | System.out.println("==========join========"+join); |
| | | return "转课成功"; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<ExerciseVideo> getStuCourseOfVideoList(@RequestBody List<Integer> coursePackIds){ |
| | | return pcvService.queryCourseOfVideos(coursePackIds); |
| | | } |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService discountService; |
| | | |
| | |
| | | private CoursePackageStudentService coursePackageStudentService; |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/courseVideo/query") |
| | | public List<ExerciseVideo> query(@RequestBody Integer id) throws Exception { |
| | |
| | | List<ExerciseVideo> exerciseVideoList = new ArrayList<>(); |
| | | |
| | | // Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | |
| | | |
| | | |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("studentId", id); |
| | |
| | | exerciseVideo.setVideoName(appUserVideoResponse.getVideoName()); |
| | | exerciseVideo.setCoursePackageId(appUserVideoResponse.getCoursePackageId()); |
| | | exerciseVideo.setVideoUrl(appUserVideoResponse.getCourseVideo()); |
| | | exerciseVideo.setVideoCoverImgUrl(appUserVideoResponse.getCourseVideo());exerciseVideoList.add(exerciseVideo); |
| | | exerciseVideo.setVideoCoverImgUrl(appUserVideoResponse.getCourseVideo()); |
| | | exerciseVideoList.add(exerciseVideo); |
| | | } |
| | | |
| | | |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:45 |
| | | */ |
| | | @Data |
| | | @TableName("t_course_package_order") |
| | | public class CoursePackageOrder { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | /** |
| | | * 业务编号 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员ids |
| | | */ |
| | | @TableField("studentIds") |
| | | private String studentIds; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝,3=玩湃币,4=积分,5=积分+微信,6=积分+支付宝) |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | /** |
| | | * 课时数 |
| | | */ |
| | | @TableField("classHours") |
| | | private Integer classHours; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | @TableField("originalPrice") |
| | | private Double originalPrice; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | @TableField("userCouponId") |
| | | private Long userCouponId; |
| | | /** |
| | | * 现金支付价格 |
| | | */ |
| | | @TableField("cashPayment") |
| | | private BigDecimal cashPayment; |
| | | /** |
| | | * 玩湃币价格/积分 |
| | | */ |
| | | @TableField("playPaiCoin") |
| | | private Integer playPaiCoin; |
| | | /** |
| | | * 支付用户类型(1=用户,2=管理员) |
| | | */ |
| | | @TableField("payUserType") |
| | | private Integer payUserType; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付) |
| | | */ |
| | | @TableField("payStatus") |
| | | private Integer payStatus; |
| | | /** |
| | | * 第三方支付流水号 |
| | | */ |
| | | @TableField("orderNumber") |
| | | private String orderNumber; |
| | | /** |
| | | * 支付用户id |
| | | */ |
| | | @TableField("payUserId") |
| | | private Integer payUserId; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 平台手动支付时使用 |
| | | */ |
| | | @TableField("payUserName") |
| | | private String payUserName; |
| | | /** |
| | | * 销售人员(线下购课添加购课订单时使用) |
| | | */ |
| | | @TableField("salesName") |
| | | private String salesName; |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:59 |
| | | */ |
| | | @Data |
| | | @TableName("t_course_package_order_student") |
| | | public class CoursePackageOrderStudent { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | @TableField("studentId") |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 总课时 |
| | | */ |
| | | @TableField("totalClassHours") |
| | | private Integer totalClassHours; |
| | | /** |
| | | * 剩余课时 |
| | | */ |
| | | @TableField("laveClassHours") |
| | | private Integer laveClassHours; |
| | | /** |
| | | * 缺课次数 |
| | | */ |
| | | @TableField("absencesNumber") |
| | | private Integer absencesNumber; |
| | | /** |
| | | * 退课课时 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer dropoutsNumber; |
| | | /** |
| | | * 课程状态(1=正常,2=已退课) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 退课时间 |
| | | */ |
| | | @TableField("withdrawalTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date withdrawalTime; |
| | | /** |
| | | * 退课凭证 |
| | | */ |
| | | @TableField("certificate") |
| | | private String certificate; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 赠送课时 |
| | | */ |
| | | @TableField("giftClassHours") |
| | | private Integer giftClassHours; |
| | | /** |
| | | * 课程有效期 |
| | | */ |
| | | @TableField("useTime") |
| | | private Date useTime; |
| | | } |
| | |
| | | @Accessors(chain = true) |
| | | @TableName("t_course_package") |
| | | public class TCoursePackage extends Model<TCoursePackage>{ |
| | | |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ToHoliDto { |
| | | Integer id; |
| | |
| | | */ |
| | | @PostMapping("/base/appUser/queryAPPUserByNameAndPhone") |
| | | List<TAppUser> queryAPPUserByNameAndPhone(@RequestBody AppUserByNameAndPhoneDTO dto); |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param appUser |
| | | */ |
| | | @PostMapping("/base/appUser/updateAppUser") |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊查询用户信息 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索数据 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取默认学员 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取学员数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索数据 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @PostMapping("/student/queryStudentListByName") |
| | | List<Student> queryStudentListByName(String name); |
| | | |
| | | /** |
| | | * 根据名称模糊搜索学员 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @PostMapping("/student/queryTStudentListByName") |
| | | List<TStudent> queryTStudentListByName(@RequestBody String name); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据id获取优惠券 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取用户优惠券数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 送优惠券 |
| | | * |
| | | * @param sendCouponReq |
| | | */ |
| | | @PostMapping("/userCoupon/sendUserCoupon") |
| | | void sendUserCoupon(SendCouponReq sendCouponReq); |
| | | |
| | | @PostMapping("/userCoupon/edit") |
| | | void edit(@RequestBody UserCoupon userCoupon); |
| | | } |
| | |
| | | */ |
| | | /** |
| | | * 根据名称模糊搜索门店 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据门店id获取门店信息 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CoursePackageOrder; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:48 |
| | | */ |
| | | public interface CoursePackageOrderMapper extends BaseMapper<CoursePackageOrder> { |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 12:01 |
| | | */ |
| | | public interface CoursePackageOrderStudentMapper extends BaseMapper<CoursePackageOrderStudent> { |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取排课预约信息 |
| | | * |
| | | * @param page |
| | | * @param ids |
| | | * @param userId |
| | |
| | | |
| | | /** |
| | | * 获取课程管理列表 |
| | | * |
| | | * @param page |
| | | * @param queryCourseList |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取课包管理列表数据 |
| | | * |
| | | * @param page |
| | | * @param queryCoursePackageLists |
| | | * @return |
| | |
| | | List<Map<String, Object>> queryCoursePackageLists(Page<Map<String, Object>> page, @Param("item") QueryCoursePackageLists queryCoursePackageLists); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * |
| | | * @param page |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | |
| | | List<Map<String, Object>> queryByConfigId(@Param("oneId") Integer oneId); |
| | | |
| | | List<Integer> getHours(@Param("coursePackageId") Integer coursePackageId); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public interface TCoursePackagePaymentMapper extends BaseMapper<TCoursePackagePayment> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包购买人数 |
| | | * |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * |
| | | * @param page |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * |
| | | * @param page |
| | | * @param coursePackagePaymentId |
| | | * @param userIds |
| | |
| | | List<Integer> getStudentIds(@Param("id")Long payId,@Param("classId")Integer classId,@Param("appId")Integer appId); |
| | | |
| | | boolean updateHoursById(@Param("id") Long id, @Param("i") int i); |
| | | |
| | | boolean updateHoursById1(@Param("id") Long id, @Param("i") int i); |
| | | |
| | | void updateBytime(@Param("coursePackagePayment") TCoursePackagePayment coursePackagePayment); |
| | |
| | | @Data |
| | | public class CancelClassesVO { |
| | | /** |
| | | * |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '上课门店', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '学员姓名', field: 'studentName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '上课老师', field: 'coachName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消课时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '课程名称', field: 'courseName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '上课时间', field: 'startAndEnd', visible: true, align: 'center', valign: 'middle'} |
| | | * {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | * {title: '所在省市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '上课门店', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '学员姓名', field: 'studentName', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '上课老师', field: 'coachName', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '消课时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '课程名称', field: 'courseName', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '上课时间', field: 'startAndEnd', visible: true, align: 'center', valign: 'middle'} |
| | | */ |
| | | private Integer id; |
| | | private String provinceAndCity; |
| | |
| | | @Data |
| | | public class CoursePackagePaymentVO { |
| | | /** |
| | | * |
| | | {title: 'ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '课包类型', field: 'coursePackageType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '购课学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '购买方式', field: 'buyType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付方式', field: 'payType', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) {return{1:"微信",2:"支付宝",3:"玩湃币",4:"积分",5:"积分+微信",6:"积分+支付宝"}[data]}}, |
| | | {title: '总金额', field: 'originalPrice'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠金额', field: 'discountAmount'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付价格', field: 'cashPayment'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付状态', field: 'payStatus', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '赠送课时', field: 'giftClassHours', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: 'ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | * {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | * {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '课包类型', field: 'coursePackageType', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '购课学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '购买方式', field: 'buyType', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '支付方式', field: 'payType', visible: true, align: 'center', valign: 'middle', |
| | | * formatter:function (data) {return{1:"微信",2:"支付宝",3:"玩湃币",4:"积分",5:"积分+微信",6:"积分+支付宝"}[data]}}, |
| | | * {title: '总金额', field: 'originalPrice'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '优惠金额', field: 'discountAmount'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '支付价格', field: 'cashPayment'+'元', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '支付状态', field: 'payStatus', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '赠送课时', field: 'giftClassHours', visible: true, align: 'center', valign: 'middle'}, |
| | | */ |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private Long id; |
| | |
| | | @Data |
| | | public class RegisterOrderVO { |
| | | /** |
| | | * |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '所属门店', field: 'storeName', visible: role!=3?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '报名学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '报名时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '支付价格', field: 'payMoneyAndType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单来源', field: 'payUserType', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) {return{1:"线上",2:"线下"}[data]}}, |
| | | {title: '销售人员', field: 'salesName', visible: true, align: 'center', valign: 'middle'} |
| | | * {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | * {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | * {title: '所属门店', field: 'storeName', visible: role!=3?true:false, align: 'center', valign: 'middle'}, |
| | | * {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '报名学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '报名时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '支付价格', field: 'payMoneyAndType', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, |
| | | * {title: '订单来源', field: 'payUserType', visible: true, align: 'center', valign: 'middle', |
| | | * formatter:function (data) {return{1:"线上",2:"线下"}[data]}}, |
| | | * {title: '销售人员', field: 'salesName', visible: true, align: 'center', valign: 'middle'} |
| | | */ |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING) |
| | | private Long id; |
| | |
| | | private String time; |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Integer orderId; |
| | | private Long orderId; |
| | | |
| | | } |
| | |
| | | public interface CoursePackageSchedulingService extends IService<CoursePackageScheduling> { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取排课预约数据 |
| | | * |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageOrder; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.CourseOfAfterRequest; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:49 |
| | | */ |
| | | public interface ICoursePackageOrderService extends IService<CoursePackageOrder> { |
| | | |
| | | |
| | | /** |
| | | * 获取用户已报名课程 |
| | | * |
| | | * @param courseTypeId |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | List<RegisterCourseVo> queryRegisteredCourseList(CourseOfAfterRequest courseTypeId, Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 14:05 |
| | | */ |
| | | public interface ICoursePackageOrderStudentService extends IService<CoursePackageOrderStudent> { |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | |
| | | public interface TCoursePackagePaymentService extends IService<TCoursePackagePayment> { |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课程购买人数 |
| | | * |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询课包发布的课后视频列表 |
| | | * |
| | | * @param search |
| | | * @param courseIds |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取课后视频详情 |
| | | * |
| | | * @param detailsRequest |
| | | * @param appUserId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 更新视频学习状态 |
| | | * |
| | | * @param detailsRequest |
| | | * @param appUserId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取用户已报名课程 |
| | | * |
| | | * @param courseTypeId |
| | | * @param appUserId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取已报名课包详情 |
| | | * |
| | | * @param coursePayId |
| | | * @param appUserId |
| | | * @return |
| | |
| | | CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId,String lon,String lat); |
| | | |
| | | |
| | | |
| | | ResultUtil ContinuationOrpaymentCourse(Integer userIdFormRedis, ClasspaymentRequest request); |
| | | |
| | | /** |
| | | * 查询学员的课包上课记录 |
| | | * |
| | | * @param stuId |
| | | * @param appUserId |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * |
| | | * @param page |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * |
| | | * @param page |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | |
| | | List<Map<String, Object>> getStudentTotal(StudentQeryDto studentQeryDto); |
| | | |
| | | List<Map<String, Object>> bypac(PacQueryDto pacQueryDto); |
| | | |
| | | List<TCoursePackagePayment> listOne(List<Integer> ids); |
| | | |
| | | Integer listStoreId(String code); |
| | |
| | | List<CourseOfStoreVo> queryStoreOfCourse(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课程列表 |
| | | * |
| | | * @param coursePackageList |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取课包详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 课程报名支付 |
| | | * |
| | | * @param uid |
| | | * @param paymentCourseVo |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取课包管理列表数据 |
| | | * |
| | | * @param queryCoursePackageLists |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加课包 |
| | | * |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackage |
| | | */ |
| | | void updateCoursePackageById(TCoursePackage coursePackage); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | | */ |
| | |
| | | List<CoursePackageListVo> queryCourseListOne(CoursePackageList coursePackageList) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 购买课程支付成功后的回调处理 |
| | | * |
| | | * @param code |
| | | * @param trade_no |
| | | * @return |
| | | */ |
| | | ResultUtil paymentCourseCallback(String code, String trade_no, String attach); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取课程管理列表 |
| | | * |
| | | * @param page |
| | | * @param queryCourseList |
| | | * @return |
| | |
| | | public class CourseCounsumServiceImpl extends ServiceImpl<CourseCounsumMapper, CourseCounsum> implements CourseCounsumService { |
| | | @Autowired |
| | | private CancelledClassesMapper mapper; |
| | | |
| | | @Override |
| | | public List<MoneyBack> getRefund() { |
| | | return mapper.getRefund(); |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.*; |
| | | import com.dsh.course.feignclient.account.CoachClient; |
| | | import com.dsh.course.feignclient.account.model.Coach; |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.mapper.CoursePackageOrderMapper; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.CourseOfAfterRequest; |
| | | import com.dsh.course.service.ICoursePackageOrderService; |
| | | import com.dsh.course.service.ICoursePackageSchedulingService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | 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.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 11:49 |
| | | */ |
| | | @Service |
| | | public class CoursePackageOrderServiceImpl extends ServiceImpl<CoursePackageOrderMapper, CoursePackageOrder> implements ICoursePackageOrderService { |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | |
| | | @Resource |
| | | private CoachClient coachClient; |
| | | |
| | | @Resource |
| | | private CoursePackageStudentMapper coursePackageStudentMapper; |
| | | |
| | | @Autowired |
| | | private ICoursePackageSchedulingService coursePackageSchedulingService; |
| | | |
| | | |
| | | /** |
| | | * 获取用户已报名课程 |
| | | * |
| | | * @param courseTypeId |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<RegisterCourseVo> queryRegisteredCourseList(CourseOfAfterRequest courseTypeId, Integer appUserId) { |
| | | List<RegisterCourseVo> courseVos = new ArrayList<>(); |
| | | List<CoursePackageOrder> list = this.list(new QueryWrapper<CoursePackageOrder>().eq("appUserId", appUserId).eq("state", 1)); |
| | | for (CoursePackageOrder order : list) { |
| | | TCoursePackage coursePackage = coursePackageService.getById(order.getCoursePackageId()); |
| | | Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | | RegisterCourseVo registerCourseVo = new RegisterCourseVo(); |
| | | // 2.0 |
| | | registerCourseVo.setType(coursePackage.getType()); |
| | | |
| | | registerCourseVo.setOrderId(order.getId()); |
| | | registerCourseVo.setCoursePayId(order.getId()); |
| | | registerCourseVo.setCoursePackageId(order.getCoursePackageId()); |
| | | registerCourseVo.setCoursePackTypeId(coursePackage.getCoursePackageTypeId()); |
| | | registerCourseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | String storeAndCourse = coursePackage.getName() + "(" + store.getName() + ")"; |
| | | registerCourseVo.setCourseNameStore(storeAndCourse); |
| | | // 2.0 |
| | | registerCourseVo.setCourseTime(new SimpleDateFormat("yyyy-MM-dd").format(order.getInsertTime())); |
| | | Coach coach = coachClient.queryCoachById(coursePackage.getCoachId()); |
| | | registerCourseVo.setCourseTeacher(ToolUtil.isEmpty(coach) ? "" : coach.getName()); |
| | | if (coursePackage.getType() == 2) { |
| | | registerCourseVo.setTime(new SimpleDateFormat("yyyy-MM-dd").format(coursePackage.getStartTime()) + "-" + new SimpleDateFormat("yyyy-MM-dd").format(coursePackage.getEndTime())); |
| | | } |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId", coursePackage.getId()) |
| | | .eq("appUserId", appUserId)); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudents) { |
| | | ids.add(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | } |
| | | List<CoursePackageScheduling> cps = new ArrayList<>(); |
| | | |
| | | if (!ids.isEmpty()) { |
| | | cps = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().in("id", ids)); |
| | | } |
| | | Integer counts = 0; |
| | | |
| | | for (CoursePackageScheduling cp : cps) { |
| | | if (cp.getDeductClassHour() != null) { |
| | | counts = counts + cp.getDeductClassHour(); |
| | | } |
| | | } |
| | | if (coursePackageStudents.size() > 0) { |
| | | registerCourseVo.setCourseNums(counts); |
| | | } |
| | | registerCourseVo.setPayStatus(order.getPayStatus()); |
| | | |
| | | courseVos.add(registerCourseVo); |
| | | } |
| | | return courseVos; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackageOrderStudent; |
| | | import com.dsh.course.mapper.CoursePackageOrderStudentMapper; |
| | | import com.dsh.course.service.ICoursePackageOrderStudentService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/25 14:06 |
| | | */ |
| | | @Service |
| | | public class CoursePackageOrderStudentServiceImpl extends ServiceImpl<CoursePackageOrderStudentMapper, CoursePackageOrderStudent> implements ICoursePackageOrderStudentService { |
| | | } |
| | |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingMapper; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取课包排课数据 |
| | | * |
| | | * @param page |
| | | * @param queryCoursePackageSchedulingList |
| | | * @return |
| | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService packagePaymentService; |
| | | |
| | | /** |
| | | * 定时修改状态 |
| | | */ |
| | |
| | | private StudentClient studentClient; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingService; |
| | | |
| | | /** |
| | | * 获取排课预约数据 |
| | | * |
| | | * @param queryCoursePackageStudentList |
| | | * @return |
| | | */ |
| | |
| | | resde.setStoreDistance(s); |
| | | |
| | | |
| | | |
| | | |
| | | list.add(resde); |
| | | } |
| | | } |
| | |
| | | String classTimeAsString = String.join(" | ", classTime); |
| | | |
| | | |
| | | |
| | | packageResponse.setTime(classTimeAsString); |
| | | |
| | | return packageResponse; |
| | | } |
| | | |
| | | @Override |
| | | public List<DiscountList> queryDiscountListAudit(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | |
| | | } |
| | | return discountLists; |
| | | } |
| | | |
| | | @Override |
| | | public List<DiscountList> queryDiscountList(QueryDiscountList queryDiscountList) { |
| | | Page<DiscountList> discountListPage = new Page<>(queryDiscountList.getOffset(), queryDiscountList.getLimit()); |
| | |
| | | type += "会员折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==2){ |
| | | type += "续课优惠、"; |
| | | } |
| | | else if(tCoursePackageDiscounts.get(i).getType()==3){ |
| | | } else if (tCoursePackageDiscounts.get(i).getType() == 3) { |
| | | type += "限时折扣、"; |
| | | }else if(tCoursePackageDiscounts.get(i).getType()==4){ |
| | | type += "赠送课时、"; |
| | |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CoursePackagePaymentVO> listAll(CoursePackagePaymentQuery query) { |
| | | return cpConfigMapper.listAll(query); |
| | |
| | | if (!cityCode.equals(studentQeryDto.getCityCode())) { |
| | | iterator.remove(); // Remove the element from the list |
| | | } |
| | | }} |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (studentQeryDto.getStudentName()!=null&&studentQeryDto.getStudentName()!=""){ |
| | |
| | | |
| | | /** |
| | | * 获取课包购买人数 |
| | | * |
| | | * @param coursePackageId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | return responses; |
| | | } |
| | | |
| | | @Autowired |
| | | private TCourseService courseService; |
| | | |
| | | @Override |
| | | public CourseOfVideoResponse queryVideoDetails(CourseWithDetailsRequest detailsRequest,Integer appUserId) { |
| | | CourseOfVideoResponse response = new CourseOfVideoResponse(); |
| | |
| | | // .in("id",paysId )); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | System.out.println(tCoursePackagePayments); |
| | | if (tCoursePackagePayments.size() > 0){ |
| | | try { |
| | |
| | | // 2.0 |
| | | registerCourseVo.setType(coursePackage.getType()); |
| | | |
| | | registerCourseVo.setOrderId(tCoursePackagePayment.getOrderId()); |
| | | registerCourseVo.setOrderId(tCoursePackagePayment.getOrderId().longValue()); |
| | | registerCourseVo.setCoursePayId(tCoursePackagePayment.getId()); |
| | | registerCourseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | registerCourseVo.setCoursePackTypeId(coursePackage.getCoursePackageTypeId()); |
| | |
| | | @Autowired |
| | | private TCoursePackageDiscountService coursePackageDiscountService; |
| | | |
| | | @Resource |
| | | StoreClient storeClient; |
| | | |
| | | @Resource StoreClient storeClient; |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | | |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId,String lon,String lat) { |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(coursePayId); |
| | | // List<TCoursePackagePayment> tCoursePackagePayments = this.baseMapper.selectList(new QueryWrapper<TCoursePackagePayment>().eq("appUserId", appUserId).eq("coursePackageId", tCoursePackagePayment.getCoursePackageId())); |
| | | // List<Integer> stuIds = new ArrayList<>(); |
| | | // for (TCoursePackagePayment coursePackagePayment : tCoursePackagePayments) { |
| | | // stuIds.add(coursePackagePayment.getStudentId()); |
| | | // } |
| | | // response.setStuIds(stuIds); |
| | | response.setChooseHours(tCoursePackagePayment.getClassHours()); |
| | | CoursePackageOrder coursePackageOrder = coursePackageOrderService.getById(coursePayId); |
| | | response.setChooseHours(coursePackageOrder.getClassHours()); |
| | | |
| | | |
| | | if (null != tCoursePackagePayment){ |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | if (null != coursePackageOrder) { |
| | | TCoursePackage coursePackage = tcpmapper.selectById(coursePackageOrder.getCoursePackageId()); |
| | | if (coursePackage.getType()==2) { |
| | | response.setTime(new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getStartTime()) + "-" + new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getEndTime())); |
| | | } |
| | | |
| | | Store store = storeClient.queryStoreById(coursePackage.getStoreId()); |
| | | response.setStoreName(store.getName()); |
| | | |
| | |
| | | double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | response.setDistance(wgs84); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | response.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | response.setCoursePackageId(coursePackageOrder.getCoursePackageId()); |
| | | response.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | response.setDetailDrawing(coursePackage.getDetailDrawing()); |
| | | response.setCoursePackageName(coursePackage.getName()); |
| | | response.setCoursePayId(tCoursePackagePayment.getId()); |
| | | response.setCoursePayId(coursePackageOrder.getId()); |
| | | response.setType(coursePackage.getType()); |
| | | List<Integer> integers = StrUtils.dealStrToList(coursePackage.getClassWeeks()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | if (integers.size() > 0){ |
| | | StringBuilder courWeeks = new StringBuilder("每"+classWeeks); |
| | | // for (Integer integer : integers) { |
| | | // courWeeks.append(integer).append("、"); |
| | | // } |
| | | // if (courWeeks.length() > 0 && courWeeks.charAt(courWeeks.length() - 1) == '、'){ |
| | | // courWeeks.deleteCharAt(courWeeks.length() - 1); |
| | | // } |
| | | response.setWeeks(courWeeks.toString()); |
| | | } |
| | | ArrayList<String> classTime = new ArrayList<>(); |
| | |
| | | response.setCourseTimeFrame(joinedString); |
| | | |
| | | |
| | | // response.setCourseTimeFrame(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | response.setIntroduceDrawing(coursePackage.getIntroduceDrawing()); |
| | | |
| | | Integer payType = tCoursePackagePayment.getPayType(); |
| | | BigDecimal cashPayment = tCoursePackagePayment.getCashPayment(); |
| | | Integer payType = coursePackageOrder.getPayType(); |
| | | BigDecimal cashPayment = coursePackageOrder.getCashPayment(); |
| | | double cashPaymentValue = 0.0; |
| | | if(cashPayment!=null){ |
| | | |
| | | cashPaymentValue = cashPayment.doubleValue(); |
| | | } |
| | | Integer playPaiCoin = tCoursePackagePayment.getPlayPaiCoin(); |
| | | Integer playPaiCoin = coursePackageOrder.getPlayPaiCoin(); |
| | | TCoursePackageDiscount coursePackageDiscount = tcpdMapper.selectOne(new QueryWrapper<TCoursePackageDiscount>() |
| | | .eq("coursePackageId",coursePackage.getId() ) |
| | | .eq("type",1) |
| | |
| | | break; |
| | | } |
| | | |
| | | // coursePackage.get |
| | | |
| | | |
| | | response.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | response.setPayStatus(coursePackageOrder.getPayStatus()); |
| | | |
| | | |
| | | List<CoursePackagePaymentConfigVo> list = new ArrayList<>(); |
| | |
| | | coursePackagePaymentConfigVo.setVipPrice(null); |
| | | } |
| | | |
| | | } |
| | | else{ |
| | | } else { |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | |
| | | list.add(coursePackagePaymentConfigVo); |
| | | }); |
| | | response.setList(list); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | return response; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public ResultUtil AlipayPayment(String code, BigDecimal request){ |
| | | TCoursePackagePaymentMapper baseMapper1 = this.baseMapper; |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包购买", "课包购买", "", code, request.toString(), |
| | |
| | | appuClient.updateAppUser(appUser); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | } else if(coursePackageStudent.getSignInOrNot()==2){ |
| | | //已请假 |
| | | recordVo.setStatus(5); |
| | | } |
| | | else if (start.after(new Date())){ |
| | | } else if (start.after(new Date())) { |
| | | //待上课 |
| | | recordVo.setStatus(1); |
| | | } |
| | |
| | | |
| | | return recordVoList; |
| | | } |
| | | |
| | | public List<Integer> getIds(Integer siteId) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpResponse execute = httpRequest.execute(); |
| | |
| | | return ids; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil insertVipPaymentCallback(String code, String orderNumber) { |
| | | TCoursePackagePayment coursePackagePayment = this.baseMapper.getCoursePackagePaymentByCode(code); |
| | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | | * |
| | | * @param page |
| | | * @param queryRegistrationRecord |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取未预约排课学员列表 |
| | | * |
| | | * @param page |
| | | * @param queryWalkInStudentList |
| | | * @return |
| | |
| | | payCourseInfoReq.setDay(strings1); |
| | | return payCourseInfoReq; |
| | | } |
| | | |
| | | private static List<Integer> week(String week){ |
| | | String[] split = week.split(";"); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // TCoursePackage tCoursePackage = tcpmapper.selectById(req.getCourseId()); |
| | | // 添加课包 |
| | | TCoursePackagePayment tCoursePackagePayment1 = new TCoursePackagePayment(); |
| | |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | if(tCoursePackagePayment.getLaveClassHours()<=3){ |
| | | Integer appUserId = userId; |
| | | |
| | |
| | | public boolean updateHoursById(TCoursePackagePayment byId, int i) { |
| | | return this.baseMapper.updateHoursById1(byId.getId(),i); |
| | | } |
| | | |
| | | |
| | | |
| | | public static Date[] generateDateArray(int numDays,Date date) { |
| | |
| | | import io.vertx.core.json.Json; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | |
| | | private ICoursePackagePaymentConfigService coursePackagePaymentConfigService; |
| | | |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService coursePackageDiscountService; |
| | | |
| | | @Resource |
| | |
| | | @Resource |
| | | private CoursePackageStudentMapper cpsMapper; |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderStudentService coursePackageOrderStudentService; |
| | | |
| | | |
| | | private String aliAppid = "2021004105665036";//支付宝appid |
| | | |
| | |
| | | private String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAouYvZ1v4RiydwNOnGcU0Hb4hQu0x6XUooaE2Bi6/atNOobtFdunnATGP6OMOW7yF9DpP8qH5mbFXAiaQD721y/7qlayI50UcV4mngRU4ZcaAVE3bp721Eg2H85RISa+Tb1CiOh+pc9p4l5UBseKsvB2ruHHForfZDPI8FL7AVUKBYCQPsa4zL6KAO2C6KULaTg/lCa+bYQKU0n9ca569VtdsqJUyxB9eSZjVd+9nKl62FLqp2NELGj7cXqiVBgDnBnVS5ZUO3mrBM5z/AxQbw3RwE3JqdkhzUA1BFjejAlT2zIGNOjUFagF8ao0wGElYfuk0bum6Hz5qWAt02QdNNwIDAQAB";//支付宝应用公钥 |
| | | |
| | | private String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmu8n/4yTHWbn7VOrNc9OsLtDL1bEQ8gC1dHkj8Wy5z0mkaOsjJRIG/28ze12M0V8jdCKuuDr5Z1OPKiqf+XO3ypguEh+mYUVMBM/cZodDFQfTY1TKLWjvQCuaqlA+QUTCK6f7T7stsgyQ1o9Jj0rXZDz6PM4QHSTzjrLIBaeqM5WIBvH+fy/X+QG5Utd+/UT0kc0JyvuKhZ65yVUd/C9VcwJJAPliRsAQNrqYterwAJ9zvw9tF11wj9W0XgJ8Ccu4x3gR1vrlLRJJo/OA97RmxPQ+5hSacWQZCUd1dwiBq+YCrKVHGTj14izRHXrLc0yBlRXo7tBOIqcy3IsvKVthQIDAQAB";//支付宝支付公钥 |
| | | |
| | | @Autowired |
| | | private ICoursePackageOrderService coursePackageOrderService; |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 获取课程列表 |
| | | * |
| | | * @param coursePackageList |
| | | * @return |
| | | * @throws Exception |
| | |
| | | coursePackageListVo.setType(coursePackage.getType()); |
| | | |
| | | |
| | | |
| | | coursePackageListVo.setApplicantsNumber(integer); |
| | | Double cashPayment1 = coursePackagePaymentConfig.getCashPayment(); |
| | | Integer playPaiCoin = coursePackagePaymentConfig.getPlayPaiCoin(); |
| | |
| | | }else if(ToolUtil.isNotEmpty(playPaiCoin) && playPaiCoin>0){ |
| | | coursePackageListVo.setPayType(2); |
| | | } |
| | | |
| | | |
| | | |
| | | if (coursePackagePaymentConfig!=null) { |
| | |
| | | // System.out.println("Minimum price: " + minPrice); |
| | | |
| | | |
| | | |
| | | // } |
| | | // else{ |
| | | // List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<CoursePackageListVo> queryCourseListOne(CoursePackageList coursePackageList) throws Exception { |
| | | // AppUser appUser = appUserClient.queryAppUser(uid); |
| | |
| | | } |
| | | coursePackageListVo.setClassStartTime(classTime); |
| | | coursePackageListVo.setType(coursePackage.getType()); |
| | | |
| | | |
| | | |
| | | coursePackageListVo.setApplicantsNumber(integer); |
| | |
| | | |
| | | /** |
| | | * 获取课包详情 |
| | | * |
| | | * @param uid |
| | | * @param id |
| | | * @return |
| | |
| | | coursePackagePaymentConfigVo.setPaymentPrice(paymentPrice); |
| | | |
| | | |
| | | |
| | | // TCoursePackageDiscount discount = coursePackageDiscountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | // .eq("type", 2).eq("auditStatus", 2)); |
| | | // |
| | |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | coursePackagePaymentConfigVo.setVipPrice(null); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // } |
| | |
| | | |
| | | /** |
| | | * 课程包名支付 |
| | | * |
| | | * @param uid |
| | | * @param paymentCourseVo |
| | | * @return |
| | |
| | | Double playPaiCoin = coursePackagePaymentConfigVo.getPlayPaiCoin().doubleValue();//支付币 |
| | | playPaiCoin = new BigDecimal(students.length).multiply(new BigDecimal(playPaiCoin)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | |
| | | // if(paymentCourseVo.getPayType() != 3 && paymentPrice.compareTo(paymentCourseVo.getPrice()) != 0&&paymentCourseVo.getCouponId()!=null){ |
| | | // return ResultUtil.error("支付金额异常,请刷新后重试"); |
| | | // } |
| | | if(paymentCourseVo.getPayType() == 3 && playPaiCoin.compareTo(paymentCourseVo.getPrice()) != 0){ |
| | | return ResultUtil.error("支付金额异常,请刷新后重试"); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 课程微信支付 |
| | | * |
| | | * @param uid |
| | | * @param paymentPrice |
| | | * @param paymentCourseVo |
| | |
| | | */ |
| | | public ResultUtil weChatPaymentCourse(Integer uid, Double paymentPrice, PaymentCourseVo paymentCourseVo) throws Exception{ |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getById(paymentCourseVo.getCoursePackagePaymentConfigId()); |
| | | String[] split = paymentCourseVo.getStudentIds().split(";"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | for (String s : split) { |
| | | TCoursePackagePayment coursePackagePayment = new TCoursePackagePayment(); |
| | | coursePackagePayment.setCode(code); |
| | | coursePackagePayment.setAppUserId(uid); |
| | | coursePackagePayment.setStudentId(Integer.valueOf(s)); |
| | | coursePackagePayment.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackagePayment.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePayment.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackagePayment.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | coursePackagePayment.setCashPayment(new BigDecimal(paymentPrice)); |
| | | coursePackagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePayment.setAbsencesNumber(0); |
| | | coursePackagePayment.setPayUserType(1); |
| | | coursePackagePayment.setPayStatus(1); |
| | | coursePackagePayment.setPayUserId(uid); |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setState(1); |
| | | coursePackagePayment.setInsertTime(new Date()); |
| | | coursePackagePaymentService.save(coursePackagePayment); |
| | | //生成支付订单 |
| | | CoursePackageOrder coursePackageOrder = new CoursePackageOrder(); |
| | | coursePackageOrder.setCode(code); |
| | | coursePackageOrder.setAppUserId(uid); |
| | | coursePackageOrder.setStudentIds(paymentCourseVo.getStudentIds()); |
| | | coursePackageOrder.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackageOrder.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackageOrder.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrder.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackageOrder.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | coursePackageOrder.setCashPayment(new BigDecimal(paymentPrice)); |
| | | coursePackageOrder.setPayUserType(1); |
| | | coursePackageOrder.setPayStatus(1); |
| | | coursePackageOrder.setPayUserId(uid); |
| | | coursePackageOrder.setState(1); |
| | | coursePackageOrder.setInsertTime(new Date()); |
| | | coursePackageOrderService.save(coursePackageOrder); |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePayment.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | Integer sid=null; |
| | | if(student!=null){ |
| | | sid=student.getId(); |
| | | } |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("购买课程", "", code, paymentPrice.toString(), "/base/course/weChatPaymentCourseCallback", "APP", ""); |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("购买课程", coursePackagePaymentConfig.getId().toString(), code, paymentPrice.toString(), "/base/course/weChatPaymentCourseCallback", "APP", ""); |
| | | if(weixinpay.getCode() == 200){ |
| | | Integer finalSid = sid; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(new QueryWrapper<TCoursePackagePayment>().eq("state", 1).eq("code", code).eq("payType", 1)); |
| | | TCoursePackagePayment one = list.get(0); |
| | | if(one.getPayStatus() == 2){ |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", code).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(code, ""); |
| | | if(resultUtil.getCode() == 200 && one.getPayStatus() == 1){ |
| | | if (resultUtil.getCode() == 200 && coursePackageOrder1.getPayStatus() == 1) { |
| | | /** |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | |
| | | String s = data1.get("trade_state"); |
| | | String transaction_id = data1.get("transaction_id"); |
| | | if("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setStatus(3); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | //有待支付的订单,这里不处理 |
| | | // coursePackageOrder1.setState(3); |
| | | // coursePackageOrderService.updateById(coursePackageOrder1); |
| | | break; |
| | | } |
| | | if("SUCCESS".equals(s)){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(transaction_id); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | // 2.0 |
| | | userCouponClient.sendUserCoupon(new SendCouponReq(uid,coursePackagePaymentConfig.getCouponIds())); |
| | | |
| | | addPackageStudent(paymentCourseVo.getId(),uid, finalSid,one.getId(),null); |
| | | coursePackageOrder1.setPayStatus(2); |
| | | coursePackageOrder1.setOrderNumber(transaction_id); |
| | | coursePackageOrder1.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | addCoursePackageOrderStudent(coursePackageOrder1, coursePackagePaymentConfig); |
| | | break; |
| | | } |
| | | if("USERPAYING".equals(s)){ |
| | |
| | | return weixinpay; |
| | | } |
| | | |
| | | @Autowired |
| | | private TOrderService orderService; |
| | | |
| | | /** |
| | | * 课程支付宝支付 |
| | | * |
| | | * @param uid |
| | | * @param paymentPrice |
| | | * @param paymentCourseVo |
| | |
| | | */ |
| | | public ResultUtil aliPaymentCourse(Integer uid, Double paymentPrice, PaymentCourseVo paymentCourseVo) throws Exception{ |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getById(paymentCourseVo.getCoursePackagePaymentConfigId()); |
| | | String[] split = paymentCourseVo.getStudentIds().split(";"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | List<Long> pays = new ArrayList<>(); |
| | | //生成支付订单 |
| | | CoursePackageOrder coursePackageOrder = new CoursePackageOrder(); |
| | | coursePackageOrder.setCode(code); |
| | | coursePackageOrder.setAppUserId(uid); |
| | | coursePackageOrder.setStudentIds(paymentCourseVo.getStudentIds()); |
| | | coursePackageOrder.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackageOrder.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackageOrder.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrder.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackageOrder.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | coursePackageOrder.setCashPayment(new BigDecimal(paymentPrice)); |
| | | coursePackageOrder.setPayUserType(1); |
| | | coursePackageOrder.setPayStatus(1); |
| | | coursePackageOrder.setPayUserId(uid); |
| | | coursePackageOrder.setState(1); |
| | | coursePackageOrder.setInsertTime(new Date()); |
| | | coursePackageOrderService.save(coursePackageOrder); |
| | | |
| | | int isContinue = 0; |
| | | |
| | | for (String s : split) { |
| | | // TCoursePackagePayment coursePackagePayment = new TCoursePackagePayment(); |
| | | // coursePackagePayment.setCode(code); |
| | | // coursePackagePayment.setAppUserId(uid); |
| | | // coursePackagePayment.setStudentId(Integer.valueOf(s)); |
| | | // coursePackagePayment.setCoursePackageId(paymentCourseVo.getId()); |
| | | // coursePackagePayment.setPayType(paymentCourseVo.getPayType()); |
| | | // coursePackagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePayment.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | // coursePackagePayment.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | // coursePackagePayment.setCashPayment(new BigDecimal(paymentPrice)); |
| | | // coursePackagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePayment.setAbsencesNumber(0); |
| | | // coursePackagePayment.setPayUserType(1); |
| | | // coursePackagePayment.setPayStatus(1); |
| | | // coursePackagePayment.setPayUserId(uid); |
| | | // coursePackagePayment.setStatus(1); |
| | | // coursePackagePayment.setState(1); |
| | | // coursePackagePayment.setInsertTime(new Date()); |
| | | // coursePackagePaymentService.save(coursePackagePayment); |
| | | // |
| | | // |
| | | // CourseCounsum courseCounsum = new CourseCounsum(); |
| | | // courseCounsum.setPaymentId(coursePackagePayment.getId()); |
| | | // courseCounsum.setChangeType(1); |
| | | // courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | // courseCounsum.setInsertTime(new Date()); |
| | | // courseCounsum.setReason("购买课包"); |
| | | // courseCounsumService.save(courseCounsum); |
| | | |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s).eq("coursePackageId", paymentCourseVo.getId())); |
| | | |
| | | //赠送课时 |
| | | int weekday = DateUtil.dayOfWeek(new Date()) - 1; |
| | | TCoursePackageDiscount discount = coursePackageDiscountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("type",4).eq("coursePackageId", paymentCourseVo.getId()).last("limit 1")); |
| | | |
| | | Integer hour = 0; |
| | | if (discount!=null) { |
| | | JSONArray objects = JSONObject.parseArray(discount.getContent()); |
| | | JSONObject parse = JSONObject.parseObject(JSONObject.toJSONString(objects.get(0))); |
| | | hour = parse.getInteger("hour"); |
| | | if (hour == null) { |
| | | hour = 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if (coursePackagePaymentServiceOne==null) { |
| | | isContinue = 1; |
| | | TCoursePackagePayment coursePackagePayment = new TCoursePackagePayment(); |
| | | coursePackagePayment.setCode(code); |
| | | coursePackagePayment.setAppUserId(uid); |
| | | coursePackagePayment.setStudentId(Integer.valueOf(s)); |
| | | coursePackagePayment.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackagePayment.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackagePayment.setPlayPaiCoin(paymentPrice.intValue()); |
| | | coursePackagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setAbsencesNumber(0); |
| | | coursePackagePayment.setPayUserType(1); |
| | | coursePackagePayment.setPayStatus(1); |
| | | coursePackagePayment.setPayUserId(uid); |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setState(1); |
| | | coursePackagePayment.setInsertTime(new Date()); |
| | | coursePackagePaymentService.save(coursePackagePayment); |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | } |
| | | |
| | | pays.add(coursePackagePayment.getId()); |
| | | |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | |
| | | // addPackageStudent(paymentCourseVo.getId(), uid, Integer.valueOf(s), coursePackagePayment.getId()); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePayment.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | |
| | | |
| | | if (hour!=0){ |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setPaymentId(coursePackagePayment.getId()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setNum(hour); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("赠送课时"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | } |
| | | |
| | | //保存订单 |
| | | |
| | | |
| | | |
| | | |
| | | }else { |
| | | if (coursePackagePaymentServiceOne.getPayStatus()==1){ |
| | | isContinue = 1; |
| | | |
| | | } |
| | | // coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | // coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setCode(code); |
| | | // |
| | | coursePackagePaymentServiceOne.setPayStatus(1); |
| | | // coursePackagePaymentServiceOne.setSalesName("续课"); |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | // coursePackagePaymentServiceOne.setPayStatus(2); |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | pays.add(coursePackagePaymentServiceOne.getId()); |
| | | |
| | | |
| | | // |
| | | // Integer sId = null; |
| | | // Student student = studentClient.queryDefaultStudent(uid); |
| | | // if (student != null) { |
| | | // sId = student.getId(); |
| | | // } |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | // |
| | | // |
| | | // CourseCounsum courseCounsum = new CourseCounsum(); |
| | | // courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | // courseCounsum.setChangeType(1); |
| | | // courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | // courseCounsum.setInsertTime(new Date()); |
| | | // courseCounsum.setReason("续课"); |
| | | // courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | //新的订单添加 |
| | | if (paymentCourseVo.getOrderId()==null) { |
| | | TOrder order = new TOrder(); |
| | | order.setIsPay(1); |
| | | order.setPayType(1); |
| | | order.setAppUserId(uid); |
| | | order.setPrice(paymentPrice); |
| | | order.setCode(code); |
| | | |
| | | String paysStr = pays.stream() |
| | | .map(String::valueOf) |
| | | .collect(Collectors.joining(",")); |
| | | order.setPaysId(paysStr); |
| | | |
| | | orderService.save(order); |
| | | |
| | | } |
| | | |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | Integer sid=null; |
| | | if(student!=null){ |
| | | sid=student.getId(); |
| | | } |
| | | |
| | | ResultUtil alipay = payMoneyUtil.alipay("购买课程", "购买课程", student.getId().toString(), code, paymentPrice.toString(), "/base/course/aliPaymentCourseCallback"); |
| | | ResultUtil alipay = payMoneyUtil.alipay("购买课程", "购买课程", coursePackagePaymentConfig.getId().toString(), code, paymentPrice.toString(), "/base/course/aliPaymentCourseCallback"); |
| | | if(alipay.getCode() == 200){ |
| | | Integer finalSid = sid; |
| | | int finalIsContinue = isContinue; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(new QueryWrapper<TCoursePackagePayment>().eq("state", 1).eq("code", code).eq("payType", 2)); |
| | | TCoursePackagePayment one = list.get(0); |
| | | |
| | | List<TOrder> list1 = orderService.list(new QueryWrapper<TOrder>().eq("code", code).eq("payType", 1)); |
| | | TOrder order = list1.get(0); |
| | | |
| | | |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | if(order.getIsPay() == 2){ |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", code).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | break; |
| | | } |
| | | |
| | | if(order.getIsPay() == 1){ |
| | | AlipayTradeQueryResponse alipayTradeQueryResponse = payMoneyUtil.queryALIOrder(code); |
| | | if (null != alipayTradeQueryResponse) { |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | |
| | | |
| | | String tradeNo = alipayTradeQueryResponse.getTradeNo(); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | |
| | | coursePackagePayment.setStatus(3); |
| | | } |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | //有待支付的订单,这里不处理 |
| | | // coursePackageOrder1.setState(3); |
| | | // coursePackageOrderService.updateById(coursePackageOrder1); |
| | | break; |
| | | } |
| | | if("TRADE_SUCCESS".equals(s)){ |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setOrderNumber(tradeNo); |
| | | coursePackagePayment.setAppUserId(null); |
| | | } |
| | | |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | |
| | | |
| | | for (TOrder tOrder : list1) { |
| | | tOrder.setIsPay(2); |
| | | tOrder.setOrderNum(tradeNo); |
| | | } |
| | | orderService.updateBatchById(list1); |
| | | |
| | | |
| | | |
| | | for (String s1 : split) { |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s1).eq("coursePackageId", paymentCourseVo.getId())); |
| | | if (finalIsContinue !=1) { |
| | | |
| | | TCoursePackageDiscount discount = coursePackageDiscountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("type",4).eq("coursePackageId", paymentCourseVo.getId()).last("limit 1")); |
| | | |
| | | Integer hour = 0; |
| | | if (discount!=null) { |
| | | JSONArray objects = JSONObject.parseArray(discount.getContent()); |
| | | JSONObject parse = JSONObject.parseObject(JSONObject.toJSONString(objects.get(0))); |
| | | hour = parse.getInteger("hour"); |
| | | if (hour == null) { |
| | | hour = 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setCode(code); |
| | | |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | coursePackagePaymentServiceOne.setPayStatus(2); |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | } |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("续课"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | if (hour!=0){ |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setNum(hour); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("赠送课时"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | System.out.println("===========到达支付"); |
| | | // 2.0 |
| | | String[] coupons = coursePackagePaymentConfig.getCouponIds().split(","); |
| | | |
| | | |
| | | |
| | | userCouponClient.sendUserCoupon(new SendCouponReq(uid,coursePackagePaymentConfig.getCouponIds())); |
| | | |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | addPackageStudent(paymentCourseVo.getId(),uid, finalSid,coursePackagePayment.getId(),paymentPrice); |
| | | } |
| | | |
| | | moneyOut(tradeNo,tradeNo); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(student!=null){ |
| | | |
| | | } |
| | | coursePackageOrder1.setPayStatus(2); |
| | | coursePackageOrder1.setOrderNumber(tradeNo); |
| | | coursePackageOrder1.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | addCoursePackageOrderStudent(coursePackageOrder1, coursePackagePaymentConfig); |
| | | break; |
| | | } |
| | | if("WAIT_BUYER_PAY".equals(s)){ |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackageService coursePackageService; |
| | | public void moneyOut(String outNum,String tradeNo) throws AlipayApiException { |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2"); |
| | | AlipayTradeOrderSettleRequest request = new AlipayTradeOrderSettleRequest(); |
| | | AlipayTradeOrderSettleModel model = new AlipayTradeOrderSettleModel(); |
| | | model.setOutRequestNo(outNum); |
| | | model.setTradeNo(tradeNo); |
| | | List<RoyaltyDetailInfos> royaltyDetailInfos = new ArrayList<>(); |
| | | // |
| | | |
| | | AlipayTradeRoyaltyRelationBindRequest request1 = new AlipayTradeRoyaltyRelationBindRequest(); |
| | | AlipayTradeRoyaltyRelationBindModel bindModel = new AlipayTradeRoyaltyRelationBindModel(); |
| | | |
| | | |
| | | request1.setBizContent("{" + |
| | | " \"receiver_list\":[" + |
| | | " {" + |
| | | " \"type\":\"loginName\"," + |
| | | " \"account\":\"19522115070\"," + |
| | | " \"name\":\"罗易胜\"," + |
| | | " \"memo\":\"分账给测试商户\"," + |
| | | " }" + |
| | | " ]," + |
| | | " \"out_request_no\":\""+tradeNo+"\"" + |
| | | "}"); |
| | | AlipayTradeRoyaltyRelationBindResponse response = alipayClient.execute(request1); |
| | | if(response.isSuccess()){ |
| | | System.out.println("绑定调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | |
| | | |
| | | |
| | | // RoyaltyDetailInfos royaltyDetailInfos1 = new RoyaltyDetailInfos(); |
| | | // royaltyDetailInfos1.setTransOutType("loginName"); |
| | | // royaltyDetailInfos1.setTransOut("happysports@weparklife.com"); |
| | | // royaltyDetailInfos1.setTransInType("loginName"); |
| | | // royaltyDetailInfos1.setTransIn("19522115070"); |
| | | //// royaltyDetailInfos1.setAmount("0.01"); |
| | | // royaltyDetailInfos1.setAmountPercentage("100"); |
| | | |
| | | // royaltyDetailInfos.add(royaltyDetailInfos1); |
| | | |
| | | TCoursePackagePayment one = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("code", outNum)); |
| | | TCoursePackage byId = coursePackageService.getById(one.getCoursePackageId()); |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(byId.getStoreId()); |
| | | |
| | | |
| | | |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | | // Integer siteBookings = siteClient.queryByCode(outTradeNo); |
| | | // List<Integer> stores = new ArrayList<>(); |
| | | // stores.add(coursePackagePayments); |
| | | // stores.add(paymentCompetitions); |
| | | // stores.add(siteBookings); |
| | | // OperatorUser operatorUser = siteClient.queryOperator(stores); |
| | | |
| | | |
| | | |
| | | |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | | op.setTransOutType("loginName"); |
| | | op.setTransOut("happysports@weparklife.com"); |
| | | op.setTransInType("userId"); |
| | | op.setTransIn(operatorUser.getAlipayNum()); |
| | | op.setAmountPercentage(Long.valueOf(operatorUser.getAlipayProportion())); |
| | | |
| | | List<OpenApiRoyaltyDetailInfoPojo> ops = new ArrayList<>(); |
| | | ops.add(op); |
| | | model.setRoyaltyParameters(ops); |
| | | |
| | | request.setBizModel(model); |
| | | |
| | | |
| | | AlipayTradeOrderSettleResponse response1 = alipayClient.execute(request); |
| | | if(response1.isSuccess()){ |
| | | System.out.println("调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 玩湃币支付课程 |
| | | * |
| | | * @param appUser |
| | | * @param paymentPrice |
| | | * @param paymentCourseVo |
| | |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil playPaiCoinPaymentCourse(AppUser appUser, Double paymentPrice, PaymentCourseVo paymentCourseVo) throws Exception{ |
| | | Integer playPaiCoins = appUser.getPlayPaiCoins(); |
| | | if (playPaiCoins.compareTo(paymentPrice.intValue()) < 0) { |
| | | return ResultUtil.error("玩湃币不足"); |
| | | } |
| | | appUser.setPlayPaiCoins(playPaiCoins - paymentPrice.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getById(paymentCourseVo.getCoursePackagePaymentConfigId()); |
| | | String[] split = paymentCourseVo.getStudentIds().split(";"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | //生成支付订单 |
| | | CoursePackageOrder coursePackageOrder = new CoursePackageOrder(); |
| | | coursePackageOrder.setCode(code); |
| | | coursePackageOrder.setAppUserId(appUser.getId()); |
| | | coursePackageOrder.setStudentIds(paymentCourseVo.getStudentIds()); |
| | | coursePackageOrder.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackageOrder.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackageOrder.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrder.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackageOrder.setUserCouponId(paymentCourseVo.getCouponId()); |
| | | coursePackageOrder.setCashPayment(new BigDecimal(paymentPrice)); |
| | | coursePackageOrder.setPayUserType(1); |
| | | coursePackageOrder.setPayStatus(2); |
| | | coursePackageOrder.setPayUserId(appUser.getId()); |
| | | coursePackageOrder.setState(1); |
| | | coursePackageOrder.setInsertTime(new Date()); |
| | | coursePackageOrderService.save(coursePackageOrder); |
| | | |
| | | List<Long> pays = new ArrayList<>(); |
| | | |
| | | |
| | | TCoursePackage course = coursePackageService.getById(paymentCourseVo.getId()); |
| | | |
| | | |
| | | //赠送课时 |
| | | int weekday = DateUtil.dayOfWeek(new Date()) - 1; |
| | | TCoursePackageDiscount discount = coursePackageDiscountService.getOne(new QueryWrapper<TCoursePackageDiscount>().eq("type",4).eq("coursePackageId", paymentCourseVo.getId()).last("limit 1")); |
| | | |
| | | Integer hour = 0; |
| | | if (discount!=null) { |
| | | JSONArray objects = JSONObject.parseArray(discount.getContent()); |
| | | JSONObject parse = JSONObject.parseObject(JSONObject.toJSONString(objects.get(0))); |
| | | hour = parse.getInteger("hour"); |
| | | if (hour == null) { |
| | | hour = 0; |
| | | } |
| | | addCoursePackageOrderStudent(coursePackageOrder, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | for (String s : split) { |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s).eq("coursePackageId", paymentCourseVo.getId())); |
| | | |
| | | /** |
| | | * 购买课程支付成功后的回调处理 |
| | | * |
| | | * @param code |
| | | * @param trade_no |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil paymentCourseCallback(String code, String trade_no, String attach) { |
| | | CoursePackageOrder coursePackageOrder1 = coursePackageOrderService.getOne(new QueryWrapper<CoursePackageOrder>() |
| | | .eq("code", code).eq("state", 1)); |
| | | if (coursePackageOrder1.getPayStatus() == 2) { |
| | | return ResultUtil.success(); |
| | | } |
| | | coursePackageOrder1.setPayStatus(2); |
| | | coursePackageOrder1.setOrderNumber(trade_no); |
| | | coursePackageOrder1.setAppUserId(null); |
| | | coursePackageOrderService.updateById(coursePackageOrder1); |
| | | |
| | | CoursePackagePaymentConfig coursePackagePaymentConfig = coursePackagePaymentConfigService.getById(attach); |
| | | addCoursePackageOrderStudent(coursePackageOrder1, coursePackagePaymentConfig); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 支付成功后添加学员课时数据 |
| | | * |
| | | * @param coursePackageOrder |
| | | * @param coursePackagePaymentConfig |
| | | */ |
| | | public void addCoursePackageOrderStudent(CoursePackageOrder coursePackageOrder, CoursePackagePaymentConfig coursePackagePaymentConfig) { |
| | | // 发放优惠券 |
| | | userCouponClient.sendUserCoupon(new SendCouponReq(coursePackageOrder.getAppUserId(), coursePackagePaymentConfig.getCouponIds())); |
| | | |
| | | if (coursePackagePaymentServiceOne==null) { |
| | | TCoursePackagePayment coursePackagePayment = new TCoursePackagePayment(); |
| | | coursePackagePayment.setCode(code); |
| | | coursePackagePayment.setAppUserId(appUser.getId()); |
| | | coursePackagePayment.setStudentId(Integer.valueOf(s)); |
| | | coursePackagePayment.setCoursePackageId(paymentCourseVo.getId()); |
| | | coursePackagePayment.setPayType(paymentCourseVo.getPayType()); |
| | | coursePackagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | coursePackagePayment.setPlayPaiCoin(paymentPrice.intValue()); |
| | | coursePackagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePayment.setAbsencesNumber(0); |
| | | coursePackagePayment.setPayUserType(1); |
| | | coursePackagePayment.setPayStatus(2); |
| | | coursePackagePayment.setPayUserId(appUser.getId()); |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setState(1); |
| | | coursePackagePayment.setInsertTime(new Date()); |
| | | //开始处理学员课程课时记录和排课数据 |
| | | TCoursePackage coursePackage = coursePackageService.getById(coursePackageOrder.getCoursePackageId()); |
| | | String[] split = coursePackageOrder.getStudentIds().split(";"); |
| | | for (String id : split) { |
| | | CoursePackageOrderStudent coursePackageOrderStudent = coursePackageOrderStudentService.getOne(new QueryWrapper<CoursePackageOrderStudent>().eq("studentId", id) |
| | | .eq("coursePackageId", coursePackageOrder.getCoursePackageId()).eq("status", 1).eq("state", 1)); |
| | | if (null == coursePackageOrderStudent) { |
| | | coursePackageOrderStudent = new CoursePackageOrderStudent(); |
| | | coursePackageOrderStudent.setAppUserId(coursePackageOrder.getAppUserId()); |
| | | coursePackageOrderStudent.setStudentId(Integer.valueOf(id)); |
| | | coursePackageOrderStudent.setCoursePackageId(coursePackageOrder.getCoursePackageId()); |
| | | coursePackageOrderStudent.setTotalClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrderStudent.setAbsencesNumber(0); |
| | | coursePackageOrderStudent.setStatus(1); |
| | | coursePackageOrderStudent.setState(1); |
| | | coursePackageOrderStudent.setInsertTime(new Date()); |
| | | coursePackageOrderStudent.setGiftClassHours(0); |
| | | |
| | | if (course.getValidDays()!=null) { |
| | | Date date = new Date(); |
| | | Integer validDays = coursePackage.getValidDays(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.add(Calendar.DATE, course.getValidDays()); |
| | | date = calendar.getTime(); |
| | | coursePackagePayment.setUseTime(date); |
| | | } |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + validDays); |
| | | coursePackageOrderStudent.setUseTime(calendar.getTime()); |
| | | |
| | | coursePackagePaymentService.save(coursePackagePayment); |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(appUser.getId()); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | //开始排课 |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent); |
| | | } else { |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | coursePackageOrderStudent.setTotalClassHours(coursePackageOrderStudent.getTotalClassHours() + coursePackagePaymentConfig.getClassHours()); |
| | | coursePackageOrderStudent.setLaveClassHours(coursePackageOrderStudent.getLaveClassHours() + coursePackagePaymentConfig.getClassHours()); |
| | | Integer validDays = coursePackage.getValidDays(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(useTime.compareTo(new Date()) < 0 ? new Date() : useTime); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + validDays); |
| | | coursePackageOrderStudent.setUseTime(calendar.getTime()); |
| | | //中间断课,没有连续续费的情况需要重新排课 |
| | | if (useTime.compareTo(new Date()) < 0) { |
| | | addPackageStudent(coursePackage, coursePackageOrder.getAppUserId(), Integer.valueOf(id), coursePackageOrderStudent); |
| | | } |
| | | addPackageStudent(paymentCourseVo.getId(), appUser.getId(), Integer.valueOf(s), coursePackagePayment.getId(),null); |
| | | } |
| | | coursePackageOrderStudentService.saveOrUpdate(coursePackageOrderStudent); |
| | | |
| | | //课时记录 |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePayment.getId()); |
| | | courseCounsum.setPaymentId(coursePackageOrder.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | if (hour!=0){ |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setPaymentId(coursePackagePayment.getId()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setNum(hour); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("赠送课时"); |
| | | courseCounsumService.save(courseCounsum1); |
| | | } |
| | | } |
| | | |
| | | |
| | | pays.add(coursePackagePayment.getId()); |
| | | }else{ |
| | | coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | if (coursePackagePaymentServiceOne.getOriginalPrice()!=null) { |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice() + paymentCourseVo.getPrice()); |
| | | }else { |
| | | coursePackagePaymentServiceOne.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | } |
| | | if (coursePackagePaymentServiceOne.getPlayPaiCoin()==null){ |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(paymentPrice.intValue()); |
| | | |
| | | }else { |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue());} |
| | | coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | |
| | | |
| | | if (course.getValidDays()!=null) { |
| | | Date date = coursePackagePaymentServiceOne.getUseTime(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.add(Calendar.DATE, course.getValidDays()); |
| | | date = calendar.getTime(); |
| | | coursePackagePaymentServiceOne.setUseTime(date); |
| | | } |
| | | |
| | | |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | |
| | | // coursePackagePaymentService.save(coursePackagePayment); |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(appUser.getId()); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | } |
| | | addPackageStudent(paymentCourseVo.getId(), appUser.getId(), Integer.valueOf(s), coursePackagePaymentServiceOne.getId(),null); |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("续课"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | if (hour!=0){ |
| | | CourseCounsum courseCounsum1 = new CourseCounsum(); |
| | | courseCounsum1.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum1.setChangeType(1); |
| | | courseCounsum1.setNum(hour); |
| | | courseCounsum1.setInsertTime(new Date()); |
| | | courseCounsum1.setReason("赠送课时"); |
| | | courseCounsumService.save(courseCounsum1); |
| | | } |
| | | |
| | | |
| | | pays.add(coursePackagePaymentServiceOne.getId()); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if (paymentCourseVo.getOrderId()==null) { |
| | | TOrder order = new TOrder(); |
| | | order.setIsPay(1); |
| | | order.setPayType(2); |
| | | order.setAppUserId(appUser.getId()); |
| | | order.setPrice(paymentPrice); |
| | | order.setCode(code); |
| | | |
| | | String paysStr = pays.stream() |
| | | .map(String::valueOf) |
| | | .collect(Collectors.joining(",")); |
| | | order.setPaysId(paysStr); |
| | | |
| | | orderService.save(order); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | Integer playPaiCoins = appUser.getPlayPaiCoins(); |
| | | appUser.setPlayPaiCoins(playPaiCoins - paymentPrice.intValue()); |
| | | appUserClient.updateAppUser(appUser); |
| | | |
| | | // 2.0 |
| | | String couponIds = coursePackagePaymentConfig.getCouponIds(); |
| | | if(ToolUtil.isNotEmpty(couponIds)){ |
| | | // 赠送优惠券 |
| | | userCouponClient.sendUserCoupon(new SendCouponReq(appUser.getId(),couponIds)); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId,Double price) throws ParseException { |
| | | // 课包 |
| | | TCoursePackage tCoursePackage = this.baseMapper.selectById(courseId); |
| | | |
| | | /** |
| | | * 新购买课程后的排课 |
| | | * |
| | | * @param userId |
| | | * @param sId |
| | | * @throws ParseException |
| | | */ |
| | | private void addPackageStudent(TCoursePackage tCoursePackage, Integer userId, Integer sId, CoursePackageOrderStudent coursePackageOrderStudent) { |
| | | try { |
| | | //1常规 2假期 3体验 |
| | | if (tCoursePackage.getType()==1) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | //查出当前用户当前学员当前课包最后一天的排课数据 |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", sId).eq("coursePackageId", courseId)); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | |
| | | |
| | | |
| | | |
| | | //拿到最后一天的排课记录 |
| | | if (collect.size() > 0){ |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id", collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", sId).eq("coursePackageId", courseId)); |
| | | if (price!=null) { |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(paymentId); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("续课;" + price); |
| | | courseCounsum.setAppUserId(userId); |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | |
| | | }else { |
| | | if (price!=null) { |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(paymentId); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("报名课程;" + price); |
| | | courseCounsum.setAppUserId(userId); |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | } |
| | | Date today = new Date(); |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(paymentId); |
| | | Integer laveClassHours = pay.getLaveClassHours(); |
| | | //剩余课时 |
| | | Integer laveClassHours = coursePackageOrderStudent.getLaveClassHours(); |
| | | //扣除课时数 |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | Integer can = 0; |
| | | int count = 0; |
| | | // 本周周几 |
| | | Date[] dates = generateDateArray(14, today); |
| | | if (tCoursePackage.getType() == 1) { |
| | | can = laveClassHours / codeTime; |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | int day_week = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day_week = day_week - 1 == 0 ? 7 : day_week - 1; |
| | | int num = 8 - day_week + 7; |
| | | Date useTime = coursePackageOrderStudent.getUseTime(); |
| | | |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | for (int j = 0; j < split.length; j++) { |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | if (tCoursePackage.getType() == 2) { |
| | | Date startDate = tCoursePackage.getStartTime(); |
| | | Date endDate = tCoursePackage.getEndTime(); |
| | | dates = generateDateArray1(startDate, endDate); |
| | | can = 999; |
| | | } |
| | | for (Date date : dates) { |
| | | if (count == can) { |
| | | |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= useTime.getTime()) { |
| | | break; |
| | | } |
| | | int wei = DateUtil.dayOfWeek(date)-1; |
| | | if (wei == 0){ |
| | | wei = 7; |
| | | } |
| | | if (week.contains(wei)) { |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count == can) { |
| | | //剩余数量不足以排课 |
| | | if (laveClassHours.compareTo(codeTime) < 0) { |
| | | break; |
| | | } |
| | | |
| | | laveClassHours -= codeTime; |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(date) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(date) + " " + split1[i1]); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(paymentId); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | count++; |
| | | |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else if (tCoursePackage.getType()==2){ |
| | | if (tCoursePackage.getType() == 2) { |
| | | //上课星期 |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | Date today = new Date(); |
| | | //上课时段 |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | Date startTime = tCoursePackage.getStartTime(); |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | LocalDate startDate = startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate endDate = endTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | Period period = Period.between(startDate, endDate); |
| | | int days = period.getDays() + 1; |
| | | Integer can =999; |
| | | int count = 0; |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | //排课 本周+下周,课时不够扣则直接剩余不排课 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(startTime); |
| | | calendar.add(Calendar.DAY_OF_MONTH, -1); |
| | | |
| | | TCoursePackagePayment pay = coursePackagePaymentService.getById(paymentId); |
| | | |
| | | |
| | | Date[] dates = generateDateArray(days,calendar.getTime()); |
| | | for (Date date : dates) { |
| | | if (count==can){ |
| | | break; |
| | | //假期开始使用当前时间为起始时间进行排课 |
| | | calendar.setTime(startTime.getTime() > System.currentTimeMillis() ? startTime : new Date()); |
| | | int day_week = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day_week = day_week - 1 == 0 ? 7 : day_week - 1; |
| | | int num = 8 - day_week + 7; |
| | | for (int i = 0; i < num; i++) { |
| | | Date time = calendar.getTime(); |
| | | for (int j = 0; j < split.length; j++) { |
| | | //判断当天是否在排课星期内 |
| | | int day = calendar.get(Calendar.DAY_OF_WEEK); |
| | | day = day - 1 == 0 ? 7 : day - 1; |
| | | if (!week.contains(day)) { |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | continue; |
| | | } |
| | | int wei = cn.hutool.core.date.DateUtil.dayOfWeek(date)-1; |
| | | if (wei == 0){ |
| | | wei =7; |
| | | } |
| | | if (week.contains(wei)){ |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count==can){ |
| | | |
| | | //大于有效期不进行排课 |
| | | if (calendar.getTimeInMillis() >= endTime.getTime()) { |
| | | break; |
| | | } |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(date) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(date) + " " + split1[i1]); |
| | | Date parse = format1.parse(format.format(time) + " " + split[j]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[j]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(pay.getId()); |
| | | student1.setCoursePackagePaymentId(coursePackageOrderStudent.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | count++; |
| | | |
| | | //增加日期,用于判断 |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | } |
| | | }else if (tCoursePackage.getType()==3){ |
| | | |
| | | if (price!=null) { |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(paymentId); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买体验课;" + price); |
| | | courseCounsum.setAppUserId(userId); |
| | | courseCounsumService.save(courseCounsum); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | //生成当天的排课记录 |
| | | |
| | | //生成学员的上课表 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // 2.0 |
| | | TCourseInfoRecord tCourseInfoRecord = new TCourseInfoRecord(); |
| | | tCourseInfoRecord.setUserId(userId); |
| | | tCourseInfoRecord.setCourseId(courseId); |
| | | tCourseInfoRecord.setName("报名运动营"); |
| | | tCourseInfoRecord.setNum(tCoursePackage.getNeedNum()); |
| | | tCourseInfoRecord.setTime(new Date()); |
| | | tCourseInfoRecord.setType(2); |
| | | appUserClient.addCourseInfoRecord(tCourseInfoRecord); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public static Date[] generateDateArray(int numDays,Date date) { |
| | | // LocalDate tomorrow = LocalDate.now().plusDays(1); |
| | | LocalDate tomorrow = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().plusDays(1); |
| | |
| | | |
| | | return dates; |
| | | } |
| | | |
| | | /** |
| | | * 获取课包管理列表数据 |
| | | * |
| | | * @param queryCoursePackageLists |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加课包 |
| | | * |
| | | * @param coursePackage |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param coursePackage |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 获取课包审核列表 |
| | | * |
| | | * @param page |
| | | * @param queryExamineCoursePackageLists |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取课程管理列表 |
| | | * |
| | | * @param page |
| | | * @param queryCourseList |
| | | * @return |
| | |
| | | /** |
| | | * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值 |
| | | * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object. |
| | | * |
| | | * @param d |
| | | * @param years |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的月份,可以为负 |
| | | * Adding the specified number of month to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param months |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的天数,可以为负 |
| | | * Adding the specified number of day to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param days |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的小时,可以为负 |
| | | * Adding the specified number of hour to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param hours |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的分钟,可以为负 |
| | | * Adding the specified number of minute to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param minutes |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的秒数,可以为负 |
| | | * Adding the specified number of seconds to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param seconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的毫秒数,可以为负 |
| | | * Adding the specified number of milliseconds to the given time can result in a negative value. |
| | | * |
| | | * @param d |
| | | * @param milliseconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的年份是新的给定的年份 |
| | | * Setting the year of a date object to a new given year. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param year 新的年份 |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的月份是新的给定的月份 |
| | | * Set the month of a date object to a new given month. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param month 新的月份 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的天是新的给定的天 |
| | | * Set the day of a date object to a new given day. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param day 新的天 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的小时是新的给定的小时 |
| | | * Setting the hour of a date object to a new given hour. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param hour 新的小时数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的分钟是新的给定的分钟数 |
| | | * Set the minutes of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param minute 新的分钟数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的毫秒数是新的给定的分钟数 |
| | | * Setting the milliseconds of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param millisecond 新的毫秒数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param d 日期对象 |
| | | */ |
| | | public static int getDaysOfMonth(Date d) { |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param year 年 |
| | | * @param month 月 |
| | | */ |
| | |
| | | /** |
| | | * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数 |
| | | * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month. |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期后几天的日期 |
| | | * Obtaining the date of the day after several days from the current date. |
| | | * |
| | | * @param day 天数 |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 是否是同一天 |
| | | * it the same day |
| | | * |
| | | * @param first |
| | | * @param second |
| | | * @return |
| | |
| | | /** |
| | | * 是否超过指定时刻 |
| | | * Has the specified time limit been exceeded |
| | | * |
| | | * @param day 时间 |
| | | * @param time 指定时刻 |
| | | * @return |
| | |
| | | /** |
| | | * 指定一天哪一个小时 |
| | | * Specify which hour of a particular day. |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 数字换算成中文(周) |
| | | * Conversion of numbers to Chinese (weeks) |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取两个时间的间隔(秒) |
| | | * Obtain the time difference between two instances (in seconds). |
| | | * |
| | | * @param d1 |
| | | * @param d2 |
| | | * @return |
| | |
| | | /** |
| | | * 获取到当月所有日期 |
| | | * Obtain all dates of the current month |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取有效期数的结束时间 |
| | | * |
| | | * @param startTime 开始时间 |
| | | * @param validPeriod 有效期数 |
| | | * @return 结束时间 |
| | |
| | | Calendar cal = Calendar.getInstance(); |
| | | return cal; |
| | | } |
| | | |
| | | /** |
| | | * 毫秒转日期时间 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 计算年龄 |
| | | * |
| | | * @param birthDate |
| | | * @return |
| | | */ |
| | |
| | | // 粗计算年龄 |
| | | int age = yearNow - yearBirth; |
| | | // 当前月份小于出生月份年龄减一 |
| | | if (monthNow < monthBirth) { age--; } |
| | | if (monthNow < monthBirth) { |
| | | age--; |
| | | } |
| | | // 当前月份等于出生月份,日小于生日年龄减一 |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { age--; } |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { |
| | | age--; |
| | | } |
| | | // 返回年龄值 |
| | | return age; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> geocoding(String address) throws Exception{ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 坐标转换 |
| | | * |
| | | * @param locations 经度和纬度用","分割,经度在前,纬度在后,经纬度小数点后不得超过6位。多个坐标对之间用”|”进行分隔最多支持40对坐标。 |
| | | * @param coordsys 可选值:gps;mapbar;baidu;autonavi(不进行转换) |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取Request请求头UserId |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getLoginAuthUserId (HttpServletRequest request) { |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * 返回json数据封装工具类 |
| | | * |
| | | * @ClassName: JsonUtil |
| | |
| | | |
| | | /** |
| | | * 通过生日计算年龄 |
| | | * |
| | | * @param birthDay 生日 |
| | | * @return |
| | | * @throws ParseException |
| | |
| | | |
| | | /** |
| | | * 获取当天的星期几 |
| | | * |
| | | * @return |
| | | */ |
| | | public static int getWeekStr(){ |
| | |
| | | |
| | | /** |
| | | * 根据输入本周的周几,获取当天的时间 |
| | | * |
| | | * @param dayOfWeekInput 周几 |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private static String byteArrayToHexString(byte b[]) { |
| | | StringBuffer resultSb = new StringBuffer(); |
| | | for (int i = 0; i < b.length; i++) |
| | |
| | | private String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝支付 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码支付下单 |
| | | * |
| | | * @param body |
| | | * @param subject |
| | | * @param outTradeNo |
| | |
| | | |
| | | /** |
| | | * 支付成功后的回调处理逻辑 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> alipayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 支付宝查询订单支付状态 |
| | | * |
| | | * @param out_trade_no |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信统一下单 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param out_trade_no 商户订单号 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信支付成功后的回调处理 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> weixinpayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 微信扫码收款 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param nonce_str 随机字符串 |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码收款 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款申请 |
| | | * |
| | | * @param transaction_id 微信订单号。微信生成的订单号,在支付通知中有返回 |
| | | * @param out_refund_no 商户退款单号。商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。 |
| | | * @param total_fee 订单金额。订单总金额,单位为分,只能为整数 |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的回调处理 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝退款 |
| | | * |
| | | * @param trade_no 支付宝交易号 |
| | | * @param refund_amount 退款金额 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询微信支付订单 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到零钱) |
| | | * |
| | | * @param openid 商户appid下,某用户的openid |
| | | * @param desc 企业付款备注,必填。 |
| | | * @param total_fee 企业付款金额 |
| | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到银行卡) |
| | | * |
| | | * @param desc 备注信息 |
| | | * @param total_fee 转账金额 |
| | | * @param partner_trade_no 订单号 |
| | |
| | | |
| | | /** |
| | | * 微信转账到银行卡不编号 |
| | | * |
| | | * @param bankName |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝转账 |
| | | * |
| | | * @param out_biz_no 商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。 |
| | | * @param trans_amount 订单总金额,单位为元,精确到小数点后两位 |
| | | * @param order_title 转账业务的标题,用于在支付宝用户的账单里显示 |
| | |
| | | |
| | | /** |
| | | * 获取请求内容 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws IOException |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的解密 |
| | | * |
| | | * @param req_info |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * xml转map |
| | | * |
| | | * @param xml |
| | | * @param charset |
| | | * @return |
| | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | | * Storing strings in Redis without an expiration time. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | |
| | | /** |
| | | * 以分钟为单位设置存储值(设置过期时间) |
| | | * Set storage value in minutes (set expiration time) as units. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param time 秒 |
| | |
| | | |
| | | /** |
| | | * 从redis中获取值 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * |
| | | * @param kes |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除key |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil error(String mag){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(String msg){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil paranErr(){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil<T> paranErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil runErr(){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param <T> |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param str |
| | | * @param <T> |
| | |
| | | /** |
| | | * 把逗号分隔的字符串转换字符串数组 |
| | | * Convert comma-separated string to string array. |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 把逗号分隔字符串转换List的Long |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getClassCodeString(int length) { |
| | | String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | Random random = new Random(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每隔一分钟去处理的定时任务 预约课时 |
| | | */ |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.course.util; |
| | | |
| | | |
| | | |
| | | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.io.StringWriter; |
| | |
| | | public static String currentTime() { |
| | | return DateUtil.getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.course.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | spring.cloud.nacos.discovery.group=@profiles.group@ |
| | | spring.main.allow-bean-definition-overriding=true |
| | | spring.flyway.enabled=false |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | | feign.compression.request.enabled=true |
| | | feign.compression.response.enabled=true |
| | | |
| | | |
| | | mybatis-plus.configuration.map-underscore-to-camel-case=false |
| | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
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.CoursePackageOrderMapper"> |
| | | |
| | | </mapper> |
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.CoursePackageOrderStudentMapper"> |
| | | |
| | | </mapper> |
| | |
| | | </update> |
| | | |
| | | <select id="listAll" resultType="com.dsh.course.model.CoursePackagePaymentVO"> |
| | | select t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.studentId,t1.appUserId,t1.cashPayment,t1.playPaiCoin, |
| | | select |
| | | t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.studentId,t1.appUserId,t1.cashPayment,t1.playPaiCoin, |
| | | t1.payUserName as buyTypeName, |
| | | CONCAT(t2.province,t2.city) as provinceAndCity,t2.coursePackageTypeId,t2.storeId,t2.name as coursePackage, |
| | | t3.name as coursePackageType |
| | |
| | | and t1.payStatus = #{query.payStatus} |
| | | </if> |
| | | <if test="query.ids !=null and query.ids.size >0"> |
| | | and t2.id in <foreach collection="query.ids" close=")" item="id" open="(" separator=","> |
| | | and t2.id in |
| | | <foreach collection="query.ids" close=")" item="id" open="(" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="listAllRegister" resultType="com.dsh.course.model.RegisterOrderVO"> |
| | | select t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.appUserId,t1.cashPayment as money,t1.playPaiCoin, |
| | | select |
| | | t1.id,t1.studentId,t1.payUserType,t1.payStatus,t1.payType,t1.originalPrice,t1.userCouponId,t1.payUserId,t1.giftClassHours,t1.appUserId,t1.cashPayment |
| | | as money,t1.playPaiCoin, |
| | | t1.insertTime, |
| | | CONCAT(t2.province,t2.city) as provinceAndCity,t2.coursePackageTypeId,t2.storeId,t2.name as coursePackageName |
| | | from t_course_package_payment t1 |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <select id="queryCoursePackageSchedulingList" resultType="map"> |
| | | SELECT |
| | | CAST(id AS CHAR(20)) AS id, |
| | |
| | | </select> |
| | | <select id="queryAll" resultType="com.dsh.course.model.vo.response.AppUserVideoResponse"> |
| | | |
| | | SELECT cs.courseId as videoId,cs.coursePackageId as coursePackageId,tc.coverDrawing as coverImage,tc.name as videoName,tc.introduce as synopsis,cs.integral,tc.courseVideo as courseVideo,cp.name as packageName,cs.id as scId |
| | | SELECT cs.courseId as videoId,cs.coursePackageId as coursePackageId,tc.coverDrawing as coverImage,tc.name as |
| | | videoName,tc.introduce as synopsis,cs.integral,tc.courseVideo as courseVideo,cp.name as packageName,cs.id as |
| | | scId |
| | | FROM t_course_package_scheduling cs |
| | | LEFT JOIN t_course tc ON cs.courseId = tc.id |
| | | left join t_course_package cp on cs.coursePackageId = cp.id |
| | |
| | | select t1.id,t1.type,t1.status,t2.province pName,t2.city cName,t2.name,t2.storeId,t2.id courseId |
| | | from t_course_package_discount t1 |
| | | left join t_course_package t2 on t1.coursePackageId = t2.id |
| | | where t2.storeId in <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | where t2.storeId in |
| | | <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | <if test="pCode !=null and pCode !=''"> |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryCoursePackageLists" resultType="map"> |
| | | select |
| | | a.id, |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryRegistrationRecord" resultType="map"> |
| | | select |
| | | CAST(id AS CHAR(20)) as id, |
| | |
| | | </select> |
| | | <select id="getStudentTotal" resultType="map"> |
| | | SELECT * from( |
| | | SELECT studentId, totalClassHours, name as courseName, laveClassHours,cashPayment as cashPayment,hasHours,appUserId,insertTime |
| | | SELECT studentId, totalClassHours, name as courseName, laveClassHours,cashPayment as |
| | | cashPayment,hasHours,appUserId,insertTime |
| | | ,coursePackageId |
| | | FROM ( |
| | | SELECT studentId, totalClassHours, name, laveClassHours,cashPayment, (totalClassHours - laveClassHours) AS hasHours,py.appUserId,py.insertTime |
| | | SELECT studentId, totalClassHours, name, laveClassHours,cashPayment, (totalClassHours - laveClassHours) AS |
| | | hasHours,py.appUserId,py.insertTime |
| | | ,coursePackageId |
| | | FROM t_course_package_payment py |
| | | LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id |
| | | UNION ALL |
| | | SELECT studentId, SUM(totalClassHours) AS totalClassHours,'总计' as name, SUM(laveClassHours) AS laveClassHours, SUM(cashPayment) AS cashPayment, |
| | | SELECT studentId, SUM(totalClassHours) AS totalClassHours,'总计' as name, SUM(laveClassHours) AS laveClassHours, |
| | | SUM(cashPayment) AS cashPayment, |
| | | (SUM(totalClassHours) - SUM(laveClassHours)) AS hasHours,py.appUserId,py.insertTime,py.coursePackageId |
| | | FROM t_course_package_payment py |
| | | LEFT JOIN t_course_package cp ON py.coursePackageId = cp.id |
| | |
| | | coursePackageId |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="listOne" resultType="com.dsh.course.entity.TCoursePackagePayment"> |
| | | select * from t_course_package_payment where appUserId in <foreach collection="ids" separator="," open="(" item="id" close=")">#{id}</foreach> |
| | | select * from t_course_package_payment where appUserId in |
| | | <foreach collection="ids" separator="," open="(" item="id" close=")">#{id}</foreach> |
| | | </select> |
| | | <select id="queryStore" resultType="java.lang.Integer"> |
| | | SELECT |
| | |
| | | datasource.names=master0 |
| | | |
| | | 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 |
| | |
| | | public static void main(String[] args) { |
| | | try { |
| | | SpringApplication.run(OtherApplication.class, args); |
| | | }catch (Exception e){e.printStackTrace();} |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @Bean |
| | |
| | | /** |
| | | * @author 张鹏 |
| | | * @date 2020/9/2 11:12 |
| | | * |
| | | * <p> |
| | | * 重新封装实体时,ID 丢失精度,在重写的 ID 上添加注解 @JsonSerialize(using = JsonLongSerializer.class) |
| | | */ |
| | | public class JsonLongSerializer extends JsonSerializer<Long> { |
| | |
| | | .paths(PathSelectors.any()).build().groupName("公共Aip接口") |
| | | .apiInfo(apiInfo("公共Aip接口", "文档中可以查询及测试接口调用参数和结果", "1.0.0版本")); |
| | | } |
| | | |
| | | |
| | | |
| | | private ApiInfo apiInfo(String name, String description, String version) { |
| | |
| | | frequentlyAskedQuestions.setState(1); |
| | | return faqService.save(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 修改常见问题 |
| | | */ |
| | |
| | | public Object editQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions){ |
| | | return faqService.updateById(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 上/下架、删除常见问题 type=1为上架 2为下架 3为删除 |
| | | */ |
| | |
| | | public Object updateQuestion(@RequestBody FrequentlyAskedQuestions frequentlyAskedQuestions){ |
| | | return faqService.updateById(frequentlyAskedQuestions); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有常见问题 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/question/listAll") |
| | |
| | | List<Game> games = gameService.queryAll(ballQueryDto); |
| | | return games; |
| | | } |
| | | |
| | | // 根据门店ids 获取游戏记录 |
| | | @ResponseBody |
| | | @PostMapping("/game/getGameByStoreIds") |
| | |
| | | System.out.println("==========="+game); |
| | | return game.getId(); |
| | | } |
| | | |
| | | @Autowired |
| | | private TGameConfigService config; |
| | | |
| | |
| | | return gameService.orderlist(bookingQuery); |
| | | // return game.getId(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取广告管理 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/advertisement/listAll") |
| | | public List<Banner> listAll(@RequestBody AdvertisementQuery query){ |
| | | return bannerService.listAll(query); |
| | | } |
| | | |
| | | /** |
| | | * 上/下架、删除常见问题 state=1为上架 2为下架 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加广告管理 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/advertisement/addAdvertisement") |
| | |
| | | |
| | | /** |
| | | * 修改广告管理 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/advertisement/updateAdvertisement") |
| | |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/game") |
| | | public class GameController { |
| | |
| | | List<TGameConfig> tGameConfigs = new ArrayList<>(); |
| | | |
| | | if (appUser.getAddUserId()==null) { |
| | | |
| | | |
| | | |
| | | List<SiteLock> lock = lockService.list(new QueryWrapper<SiteLock>().eq("siteId", siteId)); |
| | |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @Autowired |
| | | private HonorRulesService honorRulesService; |
| | | |
| | | @PostMapping("/base/honor/getHonor") |
| | | public HonorRules getHonor(@RequestBody List<Integer> integers){ |
| | | // HonorRules one = honorRulesService.getOne(new QueryWrapper<HonorRules>().eq("type", integers.get(0)).le("condition", String.valueOf(integers.get(1))).last("limit 1")); |
| | |
| | | public List<StuMedalVo> getStuHonors(@RequestBody List<Integer> honorIds){ |
| | | List<StuMedalVo> stuMedalVos = new ArrayList<>(); |
| | | List<HonorRules> honorRules = hrService.querylistOfIds(honorIds); |
| | | |
| | | |
| | | |
| | | if (honorRules.size() > 0){ |
| | |
| | | |
| | | /** |
| | | * 获取系统图片 |
| | | * |
| | | * @param position |
| | | * @return |
| | | */ |
| | |
| | | private IProtocolService protocolService; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryProtocol") |
| | | @ApiOperation(value = "获取各种协议", tags = {"用户—登录注册"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<Site> getList(){ |
| | | return siteService.list(new QueryWrapper<Site>().ne("state",3)); |
| | | } |
| | | |
| | | /** |
| | | * 获取场地预约记录 |
| | | */ |
| | |
| | | public List<SiteBooking> listAll(@RequestBody SiteBookingQuery query){ |
| | | return siteBookingService.listAll(query); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有场地 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/site/list") |
| | | public List<TSiteDTO> listAll(@RequestBody SiteSearchVO vo){ |
| | | return siteTypeService.listAll(vo); |
| | | } |
| | | |
| | | /** |
| | | * 获取场地有效期在两个月内的场地列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/site/listExipre") |
| | |
| | | |
| | | return siteService.changeState(vo); |
| | | } |
| | | |
| | | /** |
| | | * 添加场地管理 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/site/addSite") |
| | |
| | | |
| | | /** |
| | | * 添加场地管理 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/base/site/addSiteBooking") |
| | |
| | | List<SiteBooking> siteId = siteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id)); |
| | | return siteId; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/site/querySiteType") |
| | | @ApiOperation(value = "获取场地类型", tags = {"用户—预约场地"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | // } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 购买课程微信支付回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 预约场地支付宝回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 启动游戏支付宝回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/site/queryMySiteById") |
| | | @ApiOperation(value = "获取我的预约场地列表详情2.0", tags = {"用户—预约场地"}) |
| | |
| | | map.put("name",site.getName()); |
| | | |
| | | |
| | | |
| | | List<Integer> ids = getIds(byId.getSiteId()); |
| | | byId.setStorePhone(byId1.getPhone()); |
| | | |
| | |
| | | |
| | | String result = startTimeString + "-" + endTimeString.substring(11); |
| | | byId.setTimes(result); |
| | | |
| | | |
| | | |
| | | |
| | | byId.setSid(Arrays.asList(storeId)); |
| | |
| | | |
| | | /** |
| | | * 微信退款回调 |
| | | * |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/site/continuePaymentMySite") |
| | | @ApiOperation(value = "继续支付我预约的场地", tags = {"用户—预约场地"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/site/queryContinuePaymentMySitePrice") |
| | | @ApiOperation(value = "获取继续支付场地金额", tags = {"用户—预约场地"}) |
| | |
| | | |
| | | /** |
| | | * 查询所有现金支付的预约记录 |
| | | * |
| | | * @param requestVo |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询所有玩湃币支付的预约记录 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return o; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 锁定场地列表 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加锁定场地 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除锁定场地 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | public Object deleteSiteLock(@PathVariable("id") Integer id){ |
| | | return siteLockService.removeById(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private StoreConfigService storeConfigService; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryStoreConfig") |
| | | @ApiOperation(value = "获取门店模块配置", tags = {"APP-加入玩湃"}) |
| | |
| | | |
| | | return storeService.getStoreInfo(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据城市管理员id获取门店 |
| | | */ |
| | |
| | | public Object getStoreByCityManagerId(@RequestBody Integer id){ |
| | | return storeService.getStoreByCityManagerId(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据员工id获取门店 |
| | | */ |
| | |
| | | public Store getStoreById(@RequestBody Integer id){ |
| | | return storeService.getOne(new QueryWrapper<Store>().eq("id",id)); |
| | | } |
| | | |
| | | /** |
| | | * 选择市区 展示全部门店 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据所选门店 查询经营时间 |
| | | * |
| | | * @param oneId |
| | | * @return |
| | | */ |
| | |
| | | public Store getTime(@RequestBody String oneId){ |
| | | return storeService.getOne(new QueryWrapper<Store>().eq("name",oneId)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/courseOfSto") |
| | |
| | | |
| | | /** |
| | | * 根据门店坐标与传入坐标,计算距离 |
| | | * |
| | | * @param distanceVo |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryStoreLists") |
| | | @ApiOperation(value = "获取门店列表", tags = {"APP-加入玩湃", "APP-课程列表", "用户—预约场地"}) |
| | |
| | | |
| | | /** |
| | | * 根据门店模糊搜索店铺 |
| | | * |
| | | * @param name |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据门店 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Autowired |
| | | private ISiteService siteService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/store/querySiteId") |
| | | public List<Integer> querySiteId(@RequestBody Integer storeId){ |
| | |
| | | tBackRecord.setTime(new Date()); |
| | | backRecordService.save(tBackRecord); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | @Autowired |
| | | private TStoreOtherConfigTrueService tStoreOtherConfigTrueService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryIndexSet") |
| | | @ApiOperation(value = "获取门店首页设置 2.0", tags = {"APP-免费福利"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryProvinceAndCity") |
| | | @ApiOperation(value = "获取省市数据", tags = {"APP-加入玩湃"}) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryAllCity") |
| | | @ApiOperation(value = "获取所有开通城市", tags = {"APP-赛事活动列表", "用户—预约场地"}) |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | public StoredValueConfig getStoreValueConfig(){ |
| | | return svconfigService.getOne(new QueryWrapper<>()); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/stored/getRechargeArrange") |
| | | public List<Map<String,Object>> getRechargeConfig(){ |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public List<Phone> list(){ |
| | | return phoneService.list(new QueryWrapper<>()); |
| | | } |
| | | |
| | | /** |
| | | * 修改客服电话 |
| | | */ |
| | |
| | | public class TRegionController { |
| | | |
| | | |
| | | |
| | | @Resource |
| | | private IRegionService regionService; |
| | | |
| | |
| | | sysLoginLog.setLogname("APP用户注销账号"); |
| | | ssllService.save(sysLoginLog); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | |
| | | * <p> |
| | | * 荣誉规则 |
| | | * </p> |
| | | * |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | |
| | | private Integer id; |
| | | /** |
| | | * 规则配置JSON |
| | | { |
| | | "rules": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "100.0", |
| | | "startTime": "", |
| | | "endTime": "" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "200.0", |
| | | "startTime": "", |
| | | "endTime": "" |
| | | }], |
| | | "time_rules": [{ |
| | | "sameTime": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "200.0", |
| | | "startTime": "2023-06-01", |
| | | "endTime": "2023-06-15" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "400.0", |
| | | "startTime": "2023-06-01", |
| | | "endTime": "2023-06-15" |
| | | }] |
| | | }, { |
| | | "sameTime": [{ |
| | | "money": "100.0", |
| | | "usersCoins": "100.0", |
| | | "MemberCoins": "300.0", |
| | | "startTime": "2023-07-01", |
| | | "endTime": "2023-07-15" |
| | | }, { |
| | | "money": "200.0", |
| | | "usersCoins": "200.0", |
| | | "MemberCoins": "600.0", |
| | | "startTime": "2023-07-01", |
| | | "endTime": "2023-07-15" |
| | | }] |
| | | }] |
| | | } |
| | | * { |
| | | * "rules": [{ |
| | | * "money": "100.0", |
| | | * "usersCoins": "100.0", |
| | | * "MemberCoins": "100.0", |
| | | * "startTime": "", |
| | | * "endTime": "" |
| | | * }, { |
| | | * "money": "200.0", |
| | | * "usersCoins": "200.0", |
| | | * "MemberCoins": "200.0", |
| | | * "startTime": "", |
| | | * "endTime": "" |
| | | * }], |
| | | * "time_rules": [{ |
| | | * "sameTime": [{ |
| | | * "money": "100.0", |
| | | * "usersCoins": "100.0", |
| | | * "MemberCoins": "200.0", |
| | | * "startTime": "2023-06-01", |
| | | * "endTime": "2023-06-15" |
| | | * }, { |
| | | * "money": "200.0", |
| | | * "usersCoins": "200.0", |
| | | * "MemberCoins": "400.0", |
| | | * "startTime": "2023-06-01", |
| | | * "endTime": "2023-06-15" |
| | | * }] |
| | | * }, { |
| | | * "sameTime": [{ |
| | | * "money": "100.0", |
| | | * "usersCoins": "100.0", |
| | | * "MemberCoins": "300.0", |
| | | * "startTime": "2023-07-01", |
| | | * "endTime": "2023-07-15" |
| | | * }, { |
| | | * "money": "200.0", |
| | | * "usersCoins": "200.0", |
| | | * "MemberCoins": "600.0", |
| | | * "startTime": "2023-07-01", |
| | | * "endTime": "2023-07-15" |
| | | * }] |
| | | * }] |
| | | * } |
| | | */ |
| | | private String content; |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | |
| | | @TableField("typeId") |
| | | private Integer typeId; |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | public interface CourseRecordClient { |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/courseRecord/cancelCourseData") |
| | | Integer cancelCourseRecordClass(@RequestBody Integer courseRecordId); |
| | | |
| | |
| | | public interface CustomerClient { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/nearbyStore") |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestBody GetAllNearbyStoreList list); |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/distanceCal") |
| | |
| | | |
| | | /** |
| | | * 根据用户id获取用户信息 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改用户信息 |
| | | * |
| | | * @param appUser |
| | | */ |
| | | @PostMapping("/base/appUser/updateAppUser") |
| | |
| | | |
| | | /** |
| | | * 根据id获取数据 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取优惠券 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取用户优惠券数据 |
| | | * |
| | | * @param queryUserCouponByIdAndUserId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改优惠券数据 |
| | | * |
| | | * @param userCoupon |
| | | */ |
| | | @PostMapping("/userCoupon/updateUserCoupon") |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.dsh.other.entity.CreateHistoryDto; |
| | | import com.dsh.other.entity.GetHistoryDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | void createHistory(@Param("createHistoryDto") CreateHistoryDto createHistoryDto); |
| | | |
| | | List<GetHistoryDto> getHistory(@Param("studentId") Integer studentId); |
| | | |
| | | int changeState(@Param("ids") List<Integer> ids,@Param("state") Integer state); |
| | | |
| | | List<Banner> listAll(@Param("query") AdvertisementQuery query); |
| | |
| | | |
| | | /** |
| | | * 获取场地列表 |
| | | * |
| | | * @param querySiteList |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取我的预约场地列表 |
| | | * |
| | | * @param uid |
| | | * @param status |
| | | * @param pageNo |
| | |
| | | |
| | | /** |
| | | * 获取省数据 |
| | | * |
| | | * @return |
| | | */ |
| | | List<ProvinceAndCityVo> queryProvince(); |
| | |
| | | |
| | | /** |
| | | * 获取市数据 |
| | | * |
| | | * @param pcode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据城市code获取城市列表 |
| | | * |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据城市管理员id获取门店集合 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<Store> getStoreByCityManagerId(@Param("id") Integer id); |
| | | |
| | | /** |
| | | * 根据门店员工id获取门店集合 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | import com.dsh.other.feignclient.model.AdvertisementQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.dsh.other.entity.CreateHistoryDto; |
| | | import com.dsh.other.entity.GetHistoryDto; |
| | | import com.dsh.other.model.BannerVo; |
| | |
| | | int changeState(AdvertisementChangeStateDTO dto); |
| | | |
| | | List<Banner> listAll(AdvertisementQuery query); |
| | | |
| | | void createHistory(CreateHistoryDto createHistoryDto); |
| | | |
| | | List<GetHistoryDto> gethistory(Integer studentId); |
| | |
| | | |
| | | /** |
| | | * 获取场地列表 |
| | | * |
| | | * @param querySiteList |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取场地详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取场地预约日期数据 |
| | | * |
| | | * @param id |
| | | * @param day |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 预约场地 |
| | | * |
| | | * @param reservationSite |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取我的预约场地列表 |
| | | * |
| | | * @param status |
| | | * @param pageNo |
| | | * @param pageSize |
| | |
| | | |
| | | /** |
| | | * 取消我的预约场地 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 继续支付我预约的场地 |
| | | * |
| | | * @param id |
| | | * @param payType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取继续支付金额 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取场地分类 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * |
| | | * @param lon |
| | | * @param lat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取开通的省市数据 |
| | | * |
| | | * @param pcode |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取所有城市 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据城市code获取门店列表 |
| | | * |
| | | * @param cityCode |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | @Autowired |
| | | private BannerMapper bannerMapper; |
| | | |
| | | @Override |
| | | public int changeState(AdvertisementChangeStateDTO dto) { |
| | | List<Integer> ids = dto.getIds(); |
| | |
| | | |
| | | @Resource |
| | | private FrequentlyAskedQuestionsMapper frequentlyAskedQuestionsMapper; |
| | | |
| | | @Override |
| | | public int changeState(QuestionChangeStateVO vo) { |
| | | List<Integer> questionIds = vo.getQuestionId(); |
| | |
| | | public class SiteBookingServiceImpl extends ServiceImpl<SiteBookingMapper, SiteBooking> implements ISiteBookingService { |
| | | @Autowired |
| | | private SiteBookingMapper siteBookingMapper; |
| | | |
| | | @Override |
| | | public List<BillingRequestOfType> queryDatas(Integer appUserId, String monthStart, String monthEnd) { |
| | | return this.baseMapper.queryDatas(appUserId,monthStart,monthEnd); |
| | |
| | | public class SiteLockServiceImpl extends ServiceImpl<SiteLockMapper, SiteLock> implements ISiteLockService { |
| | | @Autowired |
| | | private SiteLockMapper siteLockMapper; |
| | | |
| | | @Override |
| | | public List<TSiteLockDTO> getListById(Integer id) { |
| | | return siteLockMapper.getListById(id); |
| | |
| | | private TBackRecordService backRecordService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取场地列表 |
| | | * |
| | | * @param querySiteList |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取场地详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ISiteBookingService iSiteBookingService; |
| | | @Autowired |
| | | private ISiteService siteService; |
| | | |
| | | /** |
| | | * 获取场地预约日期数据 |
| | | * |
| | | * @param id |
| | | * @param day |
| | | * @return |
| | |
| | | return timeRanges; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static String getNextTime(String currentTime) { |
| | |
| | | return String.format("%02d:%02d", hour, minute); |
| | | |
| | | } |
| | | |
| | | public static String getNextTimeOne(String currentTime) { |
| | | |
| | | String[] parts = currentTime.split(":"); |
| | |
| | | |
| | | /** |
| | | * 预约场地 |
| | | * |
| | | * @param reservationSite |
| | | * @return |
| | | * @throws Exception |
| | |
| | | siteBookingService.save(siteBooking); |
| | | |
| | | |
| | | |
| | | |
| | | if(reservationSite.getPayType() == 1){//微信支付 |
| | | ResultUtil resultUtil = weChatPaymentSite(payMoney, siteBooking); |
| | | |
| | |
| | | |
| | | /** |
| | | * 课程微信支付 |
| | | * |
| | | * @param paymentPrice |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课程支付宝支付 |
| | | * |
| | | * @param paymentPrice |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 玩湃币支付 |
| | | * |
| | | * @param appUser |
| | | * @param paymentPrice |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取我的场地预约 |
| | | * |
| | | * @param uid |
| | | * @param status |
| | | * @param pageNo |
| | |
| | | |
| | | /** |
| | | * 取消我的预约场地 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 继续支付我预约的场地 |
| | | * |
| | | * @param id |
| | | * @param payType |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取继续支付金额 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取场地分类 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据城市管理员id获取门店集合 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | public List<Store> getStoreByCityManagerId(Integer id) { |
| | | return storeMapper.getStoreByCityManagerId(id); |
| | | } |
| | | |
| | | /** |
| | | * 根据门店员工id获取门店集合 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * |
| | | * @param lon |
| | | * @param lat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取开通省市 |
| | | * |
| | | * @param pcode |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取所有开通城市 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据城市code获取城市列表 |
| | | * |
| | | * @param cityCode |
| | | * @return |
| | | * @throws Exception |
| | |
| | | /** |
| | | * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值 |
| | | * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object. |
| | | * |
| | | * @param d |
| | | * @param years |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的月份,可以为负 |
| | | * Adding the specified number of month to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param months |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的天数,可以为负 |
| | | * Adding the specified number of day to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param days |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的小时,可以为负 |
| | | * Adding the specified number of hour to the given time is possible, including negative values. |
| | | * |
| | | * @param d 日期对象 |
| | | * @param hours |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的分钟,可以为负 |
| | | * Adding the specified number of minute to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param minutes |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的秒数,可以为负 |
| | | * Adding the specified number of seconds to the given time is possible, including negative values. |
| | | * |
| | | * @param d |
| | | * @param seconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 把给定的时间加上指定的毫秒数,可以为负 |
| | | * Adding the specified number of milliseconds to the given time can result in a negative value. |
| | | * |
| | | * @param d |
| | | * @param milliseconds |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的年份是新的给定的年份 |
| | | * Setting the year of a date object to a new given year. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param year 新的年份 |
| | | * @return 日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的月份是新的给定的月份 |
| | | * Set the month of a date object to a new given month. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param month 新的月份 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的天是新的给定的天 |
| | | * Set the day of a date object to a new given day. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param day 新的天 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的小时是新的给定的小时 |
| | | * Setting the hour of a date object to a new given hour. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param hour 新的小时数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的分钟是新的给定的分钟数 |
| | | * Set the minutes of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param minute 新的分钟数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 设置一个日期对象的毫秒数是新的给定的分钟数 |
| | | * Setting the milliseconds of a date object to a new given minute value. |
| | | * |
| | | * @param d 需要设定的日期对象 |
| | | * @param millisecond 新的毫秒数 |
| | | * @return 新日期对象 |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param d 日期对象 |
| | | */ |
| | | public static int getDaysOfMonth(Date d) { |
| | |
| | | /** |
| | | * 返回指定日期的月份的天数量 |
| | | * Retrieve the number of days in the month of the specified date. |
| | | * |
| | | * @param year 年 |
| | | * @param month 月 |
| | | */ |
| | |
| | | /** |
| | | * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数 |
| | | * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month. |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期后几天的日期 |
| | | * Obtaining the date of the day after several days from the current date. |
| | | * |
| | | * @param day 天数 |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取当前日期是星期几<br> |
| | | * Obtain the day of the week for the current date. |
| | | * |
| | | * @param dt |
| | | * @return 当前日期是星期几 |
| | | */ |
| | |
| | | /** |
| | | * 根据时间获取和当前时间的差距. |
| | | * Obtain the difference between the current time and the time in question. |
| | | * |
| | | * @param date - 待比较实际 |
| | | * @return 时间差距字符串 |
| | | */ |
| | |
| | | /** |
| | | * 是否是同一天 |
| | | * it the same day |
| | | * |
| | | * @param first |
| | | * @param second |
| | | * @return |
| | |
| | | /** |
| | | * 是否超过指定时刻 |
| | | * Has the specified time limit been exceeded |
| | | * |
| | | * @param day 时间 |
| | | * @param time 指定时刻 |
| | | * @return |
| | |
| | | /** |
| | | * 指定一天哪一个小时 |
| | | * Specify which hour of a particular day. |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 数字换算成中文(周) |
| | | * Conversion of numbers to Chinese (weeks) |
| | | * |
| | | * @param time |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 获取两个时间的间隔(秒) |
| | | * Obtain the time difference between two instances (in seconds). |
| | | * |
| | | * @param d1 |
| | | * @param d2 |
| | | * @return |
| | |
| | | /** |
| | | * 获取到当月所有日期 |
| | | * Obtain all dates of the current month |
| | | * |
| | | * @param date |
| | | * @return |
| | | */ |
| | |
| | | Calendar cal = Calendar.getInstance(); |
| | | return cal; |
| | | } |
| | | |
| | | /** |
| | | * 毫秒转日期时间 |
| | | * |
| | |
| | | |
| | | /** |
| | | * 计算年龄 |
| | | * |
| | | * @param birthDate |
| | | * @return |
| | | */ |
| | |
| | | // 粗计算年龄 |
| | | int age = yearNow - yearBirth; |
| | | // 当前月份小于出生月份年龄减一 |
| | | if (monthNow < monthBirth) { age--; } |
| | | if (monthNow < monthBirth) { |
| | | age--; |
| | | } |
| | | // 当前月份等于出生月份,日小于生日年龄减一 |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { age--; } |
| | | else if (monthNow == monthBirth && dayNow < dayBirth) { |
| | | age--; |
| | | } |
| | | // 返回年龄值 |
| | | return age; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | | * |
| | | * @param province |
| | | * @param city |
| | | * @param county |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | public Map<String, Object> geocoding(String address) throws Exception{ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String url = "https://restapi.amap.com/v3/geocode/geo?key=" + key + "&output=JSON&address=" + address; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据经纬度获取行政区域信息 |
| | | * |
| | | * @param lon |
| | | * @param lan |
| | | * @return |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | public Map<String, String> geocode1(String lon, String lan) throws Exception{ |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | |
| | | |
| | | /** |
| | | * 坐标转换 |
| | | * |
| | | * @param locations 经度和纬度用","分割,经度在前,纬度在后,经纬度小数点后不得超过6位。多个坐标对之间用”|”进行分隔最多支持40对坐标。 |
| | | * @param coordsys 可选值:gps;mapbar;baidu;autonavi(不进行转换) |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取直线距离 |
| | | * |
| | | * @param fromLonLat |
| | | * @param toLonLat |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取Request请求头UserId |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getLoginAuthUserId (HttpServletRequest request) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static String postRequest1(String url, Map<String, String> params,String appKey,String appSecret) { |
| | | // 构造HttpClient的实例 |
| | | HttpClient httpClient = new HttpClient(); |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private static String string2Sha1(String str){ |
| | | if(str==null||str.length()==0){ |
| | | return null; |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getRequest(String url, Map<String, String> params) { |
| | | // 构造HttpClient实例 |
| | | HttpClient client = new HttpClient(); |
| | |
| | | |
| | | /** |
| | | * 发送网络请求 |
| | | * |
| | | * @param url |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * jsonp跨域请求数据响应<br/> |
| | | * 方法名:responsejsonpData<br/> |
| | | * @author:Mryang<br/> |
| | | * @createTime:2016年7月31日-下午11:17:31 <br/> |
| | | * @tel: 15198268054<br/> |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @param map void<br/> |
| | | * @exception <br/> |
| | | * @throws <br/> |
| | | * @author:Mryang<br/> |
| | | * @createTime:2016年7月31日-下午11:17:31 <br/> |
| | | * @tel: 15198268054<br /> |
| | | * @since 1.0.0 |
| | | */ |
| | | public void responsejsonpData(HttpServletRequest request, HttpServletResponse response, Map<String, Object> map) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * |
| | | * 返回json数据封装工具类 |
| | | * |
| | | * @ClassName: JsonUtil |
| | |
| | | |
| | | /** |
| | | * 通过生日计算年龄 |
| | | * |
| | | * @param birthDay 生日 |
| | | * @return |
| | | * @throws ParseException |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | private static String byteArrayToHexString(byte b[]) { |
| | | StringBuffer resultSb = new StringBuffer(); |
| | | for (int i = 0; i < b.length; i++) |
| | |
| | | private String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝支付 |
| | | */ |
| | |
| | | request.setNotifyUrl(callbackPath + notifyUrl); |
| | | |
| | | |
| | | |
| | | |
| | | //分账 |
| | | // Integer coursePackagePayments = coursePackageClient.queryByCode(outTradeNo); |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | |
| | | // System.err.println("========royaltyInfo=========="+royaltyInfo); |
| | | |
| | | |
| | | |
| | | try { |
| | | //这里和普通的接口调用不同,使用的是sdkExecute |
| | | AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码支付下单 |
| | | * |
| | | * @param body |
| | | * @param subject |
| | | * @param outTradeNo |
| | |
| | | |
| | | /** |
| | | * 支付成功后的回调处理逻辑 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> alipayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 支付宝查询订单支付状态 |
| | | * |
| | | * @param out_trade_no |
| | | * @return |
| | | * @throws Exception |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信统一下单 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param out_trade_no 商户订单号 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信支付成功后的回调处理 |
| | | * |
| | | * @param request |
| | | */ |
| | | public Map<String, String> weixinpayCallback(HttpServletRequest request){ |
| | |
| | | |
| | | /** |
| | | * 微信扫码收款 |
| | | * |
| | | * @param body 商品描述 |
| | | * @param attach 附加数据 |
| | | * @param nonce_str 随机字符串 |
| | |
| | | |
| | | /** |
| | | * 支付宝扫码收款 |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款申请 |
| | | * |
| | | * @param transaction_id 微信订单号。微信生成的订单号,在支付通知中有返回 |
| | | * @param out_refund_no 商户退款单号。商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。 |
| | | * @param total_fee 订单金额。订单总金额,单位为分,只能为整数 |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的回调处理 |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 支付宝退款 |
| | | * |
| | | * @param trade_no 支付宝交易号 |
| | | * @param refund_amount 退款金额 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询微信支付订单 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到零钱) |
| | | * |
| | | * @param openid 商户appid下,某用户的openid |
| | | * @param desc 企业付款备注,必填。 |
| | | * @param total_fee 企业付款金额 |
| | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到银行卡) |
| | | * |
| | | * @param desc 备注信息 |
| | | * @param total_fee 转账金额 |
| | | * @param partner_trade_no 订单号 |
| | |
| | | |
| | | /** |
| | | * 微信转账到银行卡不编号 |
| | | * |
| | | * @param bankName |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝转账 |
| | | * |
| | | * @param out_biz_no 商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。 |
| | | * @param trans_amount 订单总金额,单位为元,精确到小数点后两位 |
| | | * @param order_title 转账业务的标题,用于在支付宝用户的账单里显示 |
| | |
| | | |
| | | /** |
| | | * 获取请求内容 |
| | | * |
| | | * @param request |
| | | * @return |
| | | * @throws IOException |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * |
| | | * @param map |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 微信退款成功后的解密 |
| | | * |
| | | * @param req_info |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * xml转map |
| | | * |
| | | * @param xml |
| | | * @param charset |
| | | * @return |
| | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | | * Storing strings in Redis without an expiration time. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | |
| | | /** |
| | | * 以分钟为单位设置存储值(设置过期时间) |
| | | * Set storage value in minutes (set expiration time) as units. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | * @param time 秒 |
| | |
| | | |
| | | /** |
| | | * 从redis中获取值 |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量获取 |
| | | * |
| | | * @param kes |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除key |
| | | * |
| | | * @param key |
| | | */ |
| | | public void remove(String key){ |
| | |
| | | |
| | | /** |
| | | * 删除资源 |
| | | * |
| | | * @param jedis |
| | | */ |
| | | public void closeJedis(Jedis jedis){ |
| | |
| | | private T data;//返回数据 |
| | | |
| | | |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil error(String mag){ |
| | |
| | | |
| | | /** |
| | | * 错误信息 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil <T> error(String mag, T obj){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(){ |
| | |
| | | |
| | | /** |
| | | * token失效 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil tokenErr(String msg){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil paranErr(String ages){ |
| | |
| | | |
| | | /** |
| | | * 参数异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T> ResultUtil<T> paranErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static ResultUtil runErr(){ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data){ |
| | |
| | | |
| | | /** |
| | | * 运行异常 |
| | | * |
| | | * @return |
| | | */ |
| | | public static <T>ResultUtil<T> runErr(T data, String msg){ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param data |
| | | * @param <T> |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 返回成功 |
| | | * |
| | | * @param msg |
| | | * @param data |
| | | * @param <T> |
| | |
| | | |
| | | /** |
| | | * 签名无效 |
| | | * |
| | | * @param <T> |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 把逗号分隔的字符串转换字符串数组 |
| | | * Convert comma-separated string to string array. |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 把逗号分隔字符串转换List的Long |
| | | * |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static String getClassCodeString(int length) { |
| | | String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; |
| | | Random random = new Random(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private SiteBookingMapper siteBookingMapper; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public static String currentTime() { |
| | | return DateUtil.getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package com.dsh.other.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | |
| | | spring.cloud.nacos.discovery.group=@profiles.group@ |
| | | spring.main.allow-bean-definition-overriding=true |
| | | spring.flyway.enabled=false |
| | | |
| | | |
| | | # \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0479\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD |
| | | feign.compression.request.mime-types=text/xml,application/xml,application/json |
| | | feign.compression.request.min-request-size=4096 |
| | |
| | | <!--0. 日志格式和颜色渲染 --> |
| | | <!-- 彩色日志依赖的渲染类 --> |
| | | <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
| | | <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
| | | <conversionRule conversionWord="wex" |
| | | converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/> |
| | | <conversionRule conversionWord="wEx" |
| | | converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/> |
| | | <!-- 彩色日志格式 --> |
| | | <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | <property name="CONSOLE_LOG_PATTERN" |
| | | value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
| | | |
| | | <!--1. 输出到控制台--> |
| | | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| | |
| | | |
| | | </select> |
| | | <select id="orderlist" resultType="map"> |
| | | SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange |
| | | SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - |
| | | ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange |
| | | FROM t_site_booking bk |
| | | LEFT JOIN t_store st on bk.storeId = st.id |
| | | LEFT JOIN t_site si on bk.siteId = si.id |
| | |
| | | |
| | | |
| | | <if test="date!=null and date!= ''"> |
| | | and bk.times like concat('%',#{date},'%') </if> |
| | | and bk.times like concat('%',#{date},'%') |
| | | </if> |
| | | <if test="payMethod!=null "> |
| | | and bk.payType=#{payMethod} |
| | | </if> |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | |
| | | |
| | | |
| | | |
| | | </select> |
| | |
| | | left join t_site_type c on (a.siteTypeId = c.id) |
| | | where a.state = 1 |
| | | <if test="null != item.startTime and '' != item.startTime and null != item.endTime and '' != item.endTime"> |
| | | and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentStartTime) <= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.startTime}) and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentEndTime) >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.endTime}) |
| | | and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentStartTime) <= CONCAT(DATE_FORMAT(now(), |
| | | '%Y-%m-%d'), ' ', #{item.startTime}) and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentEndTime) |
| | | >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.endTime}) |
| | | </if> |
| | | <if test="null != item.siteTypeId"> |
| | | and a.siteTypeId = #{item.siteTypeId} |
| | |
| | | </if> |
| | | order by a.insertTime desc limit #{item.pageNum}, #{item.pageSize} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryMySite" resultType="com.dsh.other.model.QueryMySiteVo"> |