Merge remote-tracking branch 'origin/master'
# Conflicts:
# cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java
# cloud-server-account/src/main/java/com/dsh/account/feignclient/other/StoreClient.java
# cloud-server-activity/src/main/java/com/dsh/activity/entity/Coupon.java
# cloud-server-activity/src/main/java/com/dsh/activity/mapper/CouponMapper.java
# cloud-server-activity/src/main/java/com/dsh/activity/service/impl/CouponServiceImpl.java
# cloud-server-other/src/main/java/com/dsh/other/controller/StoreController.java
# cloud-server-other/src/main/java/com/dsh/other/util/GDMapGeocodingUtil.java
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuListVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuPhysicalVo; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | | import com.dsh.account.model.vo.medalDetail.StuMedalVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.service.EvaluateStudentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.DateUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | /** |
| | | * 学员上课情况 接口 |
| | | */ |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("/base/startCource") |
| | | @RequestMapping("") |
| | | public class ClassDetailsController { |
| | | |
| | | private Logger logger = LoggerFactory.getLogger("business-log"); |
| | |
| | | private TAppUserService tappuService; |
| | | |
| | | @Autowired |
| | | private EvaluateStudentService evalstuService; |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/stu/queryStudentData") |
| | | @ApiOperation(value = "根据登录用户ID查询学员信息", tags = {"APP-开始上课-用户学员信息"}, notes = "") |
| | | @PostMapping("/base/startCource/queryStudentData") |
| | | @ApiOperation(value = "上课首页", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "经度值", name = "longitude", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "纬度值", name = "latitude", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryCouponRecord(String longitude,String latitude){ |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(@RequestBody String longitude, @RequestBody String latitude){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/stu/queryPhysical") |
| | | @ApiOperation(value = "获取学员测试报告", tags = {"APP-开始上课-获取学员测试报告"}, notes = "") |
| | | @PostMapping("/base/startCource/queryPhysical") |
| | | @ApiOperation(value = "获取学员测试报告", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "学员id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | * 添加学员信息 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/stu/addData") |
| | | @ApiOperation(value = "添加学员信息", tags = {"APP-开始上课-添加学员信息"}, notes = "") |
| | | @PostMapping("/base/startCource/addData") |
| | | @ApiOperation(value = "添加学员信息", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "学员信息", name = "stu", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | * 该APP用户下的学员列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/stu/listOfStu") |
| | | @ApiOperation(value = "该APP用户下的学员列表", tags = {"APP-开始上课-学员列表"}, notes = "") |
| | | @PostMapping("/base/startCource/listOfStu") |
| | | @ApiOperation(value = "学员列表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryStuList(){ |
| | | public ResultUtil<List<StuListVo>> queryStuList(){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | |
| | | } |
| | | return ResultUtil.success(stuListVos); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(ResultUtil.ERROR); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | |
| | | * 课时详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/stu/lessonDetails") |
| | | @ApiOperation(value = "课时详情", tags = {"APP-开始上课-课时详情"}, notes = "") |
| | | @PostMapping("/base/startCource/lessonDetails") |
| | | @ApiOperation(value = "课时详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "课包id", name = "lessonId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | }) |
| | | public void coursePackageDetails(@RequestBody Integer lessonId){ |
| | | public ResultUtil<ClassDetailsInsVo> coursePackageDetails(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | return ResultUtil.success(istuService.querySessionDetailsDt(userIdFormRedis,lessonId,stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-记录列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/recordDetails") |
| | | @ApiOperation(value = "课时详情-记录列表", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<PurchaseRecordVo>> recordList(@RequestBody RecordTimeRequest timeRequest, HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.queryDeduRecordDetails(timeRequest,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 课时详情-续课课包详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/renewal") |
| | | @ApiOperation(value = "课时详情-续课课包详情", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<CourseDetailsOfContinuationResp> renewalOfCourses(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.queryStuOfCourseDetails(lessonId,stuId,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 课时详情-选择优惠券 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/conponList") |
| | | @ApiOperation(value = "课时详情-选择优惠券", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponStuAvailableVo>> queryCouponList(HttpServletRequest request){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(istuService.queryStuOfConponDetails(userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 课时详情-支付 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/payment") |
| | | @ApiOperation(value = "课时详情-支付", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<?> continuationOperation(@RequestBody Integer lessonId, @RequestBody Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 学员评语 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/stuComment") |
| | | @ApiOperation(value = "学员评语", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<StuCommentsVo>> queryStuComment(@RequestParam("stuId") Integer stuId){ |
| | | try { |
| | | return ResultUtil.success(evalstuService.queryStuCommentsList(stuId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 学员勋章 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/startCource/stuMedal") |
| | | @ApiOperation(value = "学员勋章", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<StuMedalVo> queryStuMedal(@RequestParam("stuId") Integer stuId, HttpServletRequest request){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(request); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | | import com.dsh.account.model.vo.exploreDetail.ExploreDatasVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionIns; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 探索玩湃 控制器 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class ExploreWPController { |
| | | |
| | | |
| | | @Autowired |
| | | private TStudentService tsService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-探索首页", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<ExploreDatasVo> indexOfExploreDetail(@RequestBody LonLatRequest llrequest){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryIndexOfExplores(llrequest)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-公告列表", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<SysNotice>> queryNoticeListDatas(){ |
| | | try { |
| | | return ResultUtil.success(tsService.querySystemNoticeDetails()); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-公告详情", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<SysNotice> queryNotice(@RequestBody Integer noId){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryNoticeData(noId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-常见问题列表", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<QuestionDetailsVo> queryFrequentlyAskedQuestionDetails(){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryQuestionData()); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-常见问题详情", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<QuestionIns> queryQuestionData(@RequestBody Integer quesId){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryQuestionDataInfo(quesId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/exploreWP/noticeList") |
| | | @ApiOperation(value = "联系客服-客服电话列表", tags = {"APP-探索玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<String>> queryCustomerData(){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryCustomerDetails()); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * 支付回调控制器 |
| | | */ |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("/payment/callback") |
| | | public class PaymentCallbackController { |
| | | |
| | | |
| | | /** |
| | | * 支付宝支付回调接口 |
| | | */ |
| | | @PostMapping("/v1") |
| | | public void alipayCallback(){ |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信支付回调接口 |
| | | */ |
| | | @PostMapping("/v2") |
| | | public void weChatCallback(){ |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.entity; |
| | | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 评价学员记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_evaluate_student") |
| | | public class EvaluateStudent extends Model<EvaluateStudent> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 教练id |
| | | */ |
| | | private Integer coachId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 评语 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String imgs; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.account.entity; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息 |
New file |
| | |
| | | package com.dsh.account.feignclient.activity; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface IntroduceRewardsClient { |
| | | |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody List<Integer> userIds); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.activity; |
| | | |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface UserConponClient { |
| | | |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.competition; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | @PostMapping("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.competition.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 类型实体类: |
| | | * 类型:购买课包、消课、报名赛事、介绍有礼 |
| | | */ |
| | | |
| | | @Data |
| | | public class PurchaseRecordVo { |
| | | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String purchaseType; |
| | | |
| | | @ApiModelProperty(value = "类型变动时间 例如 06-29 10:48") |
| | | private String purchaseTime; |
| | | |
| | | @ApiModelProperty(value = "类型涉及金额 例如 +100 -50") |
| | | private String purchaseAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.dsh.account.feignclient.course.model.CourseOfStoreVo; |
| | | import com.dsh.account.feignclient.course.model.StuCourseResp; |
| | | import com.dsh.account.feignclient.course.model.StuWithCoursesListVo; |
| | | import com.dsh.account.feignclient.course.model.StudentOfCourseVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @PostMapping("/coursePack/storeOfCourse") |
| | | List<CourseOfStoreVo> getStoreOfCourses(); |
| | | |
| | | @PostMapping("/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseRecordClient { |
| | | |
| | | @PostMapping("/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestBody Integer courseId, @RequestBody Integer stuId, @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course; |
| | | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseSessionNameClient { |
| | | |
| | | |
| | | @PostMapping("/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuAndAppuserIdsVo { |
| | | |
| | | Integer stuId; |
| | | |
| | | Integer appUserId; |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuSessionDetailsVo { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer sessionid; |
| | | |
| | | @ApiModelProperty(value = "课时名称") |
| | | private String sessionName; |
| | | |
| | | @ApiModelProperty(value = "课时有效期") |
| | | private String periodOfValidity; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class StuWithCoursesListVo { |
| | | |
| | | @ApiModelProperty(value = "总学时数") |
| | | private Integer totalNums; |
| | | |
| | | @ApiModelProperty(value = "已扣学时数") |
| | | private Integer deductedNums; |
| | | |
| | | @ApiModelProperty(value = "剩余学时数") |
| | | private Integer remainingNums; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | |
| | | import com.dsh.account.model.vo.sourceDetail.CourseHoursType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StudentOfCourseVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师/教练") |
| | | private Integer coachId; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer wpGold; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other; |
| | | |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface NoticeClient { |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryNoticeDetails") |
| | | List<SysNotice> getSysNoticeDetails(); |
| | | |
| | | @PostMapping("/base/notice/queryNotice") |
| | | SysNotice getSysNoticeBuId(@RequestBody Integer noticeId); |
| | | |
| | | @PostMapping("/base/notice/sysTell") |
| | | List<String> queryCustomerTel(); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other; |
| | | |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionIns; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface QuestionClient { |
| | | |
| | | @PostMapping("/base/notice/queryQuestionDetails") |
| | | QuestionDetailsVo getSysQuestionDetails(); |
| | | |
| | | @PostMapping("/base/notice/queryQuestion") |
| | | QuestionIns getSysQuestionBuId(@RequestBody Integer quesId); |
| | | |
| | | } |
| | |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 15:54 |
| | | */ |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.StoreLonLatList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface StoreClient { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/store/queryStoreList") |
| | | List<Store> queryStoreList(QueryStoreList queryStoreList); |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId); |
| | | |
| | | |
| | | @PostMapping("/storeDetail/nearbyStore") |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestBody String longitude, @RequestBody String latitude); |
| | | |
| | | |
| | | @PostMapping("/storeDetail/storeOfLonLat") |
| | | public List<StoreLonLatList> getAllStoreLonLats(@RequestBody String longitude, @RequestBody String latitude); |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreDetailOfCourse { |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店地址") |
| | | String storeAddr; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreInfo { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "门店背景图") |
| | | private String storeImg; |
| | | |
| | | @ApiModelProperty(value = "门店距离当前位置") |
| | | private long distance; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店详细地址") |
| | | private String storeAddr; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreLonLatList { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | String longitude; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | String latitude; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.other.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysNotice { |
| | | |
| | | @ApiModelProperty(value = "公告id") |
| | | private Integer noticeId; |
| | | |
| | | @ApiModelProperty(value = "公告标题") |
| | | private String noticeTitle; |
| | | |
| | | @ApiModelProperty(value = "公告内容") |
| | | private String noticeContents; |
| | | |
| | | @ApiModelProperty(value = "公告发布时间") |
| | | private String noticeTime; |
| | | } |
New file |
| | |
| | | package com.dsh.account.mapper; |
| | | |
| | | import com.dsh.account.entity.EvaluateStudent; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 评价学员记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface EvaluateStudentMapper extends BaseMapper<EvaluateStudent> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Mapper |
| | | public interface TAppUserMapper extends BaseMapper<TAppUser> { |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Mapper |
| | | public interface TStudentMapper extends BaseMapper<TStudent> { |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class WeekedCourse { |
| | | |
| | | @ApiModelProperty(value = "是否为当天 1 是 2 否") |
| | | private Integer isToday; |
| | | |
| | | @ApiModelProperty(value = "星期缩写") |
| | | private String weekStr; |
| | | |
| | | @ApiModelProperty(value = "星期数值") |
| | | private Integer weekNum; |
| | | |
| | | @ApiModelProperty(value = "日期") |
| | | private String dayStr; |
| | | |
| | | @ApiModelProperty(value = "课包列表") |
| | | private List<CourseVenue> details; |
New file |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | public class ClassDataDetails { |
| | | |
| | | @ApiModelProperty(value = "已扣课时数") |
| | | private Integer deductionClassHours; |
| | | |
| | | @ApiModelProperty(value = "类型变动记录") |
| | | private List<PurchaseRecordVo> recordVos; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ClassDetailsInsVo { |
| | | |
| | | @ApiModelProperty(value = "学员id") |
| | | private Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "学员头像") |
| | | private String stuImage; |
| | | |
| | | @ApiModelProperty(value = "学员姓名") |
| | | private String stuName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "总学时数") |
| | | private Integer totalNums; |
| | | |
| | | @ApiModelProperty(value = "已扣学时数") |
| | | private Integer deductedNums; |
| | | |
| | | @ApiModelProperty(value = "剩余学时数") |
| | | private Integer remainingNums; |
| | | |
| | | @ApiModelProperty(value = "课包名称列表") |
| | | private List<StuSessionDetailsVo> sessionNames; |
| | | |
| | | @ApiModelProperty(value = "已扣课时数") |
| | | private Integer deductionClassHours; |
| | | |
| | | @ApiModelProperty(value = "课包列表") |
| | | private List<PurchaseRecordVo> details; |
| | | |
| | | } |
| | |
| | | private String imgs; |
| | | |
| | | @ApiModelProperty(value = "学员id") |
| | | private String stuId; |
| | | private Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "学员头像") |
| | | private String stuImg; |
| | |
| | | package com.dsh.account.model.vo.classDetails.classInsVo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuPhysicalVo { |
| | | |
| | | @ApiModelProperty(value = "身高") |
| | | private Double height; |
| | | |
| | | @ApiModelProperty(value = "体重") |
| | | private Double weight; |
| | | |
| | | @ApiModelProperty(value = "BMI参数") |
| | | private Double bmi; |
| | | |
| | | @ApiModelProperty(value = "图片链接") |
| | | private String url; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.commentDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StuCommentsVo { |
| | | |
| | | @ApiModelProperty(value = "学员头像") |
| | | private String headImg; |
| | | |
| | | @ApiModelProperty(value = "学员姓名") |
| | | private String stuName; |
| | | |
| | | @ApiModelProperty(value = "评价时间") |
| | | private String comTime; |
| | | |
| | | @ApiModelProperty(value = "评价内容") |
| | | private String contents; |
| | | |
| | | @ApiModelProperty(value = "评价上传图片地址列表") |
| | | private List<String> imgs; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.exploreDetail; |
| | | |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.StoreLonLatList; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ExploreDatasVo { |
| | | |
| | | @ApiModelProperty(value = "前往玩湃-经度-纬度") |
| | | private List<StoreLonLatList> lonLatLists; |
| | | |
| | | @ApiModelProperty(value = "门店列表") |
| | | private List<StoreInfo> storeLists; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.exploreDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LonLatRequest { |
| | | |
| | | @ApiModelProperty(value = "用户经度") |
| | | private String longitude; |
| | | |
| | | @ApiModelProperty(value = "用户纬度") |
| | | private String latitude; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.exploreDetails; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QuestionDetailsVo { |
| | | |
| | | @ApiModelProperty(value = "banner图") |
| | | private String bannerImg; |
| | | |
| | | @ApiModelProperty(value = "问题列表") |
| | | private List<QuestionIns> sysS; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.exploreDetails; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class QuestionIns { |
| | | |
| | | @ApiModelProperty(value = "问题id") |
| | | private Integer noticeId; |
| | | |
| | | @ApiModelProperty(value = "问题标题") |
| | | private String noticeTitle; |
| | | |
| | | @ApiModelProperty(value = "答复内容") |
| | | private String noticeContents; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.medalDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuMedalVo { |
| | | |
| | | @ApiModelProperty(value = "勋章类型(1=俱乐部之星,2=运动达人,3=社区之王,4=深度玩家)") |
| | | private Integer medalType; |
| | | |
| | | @ApiModelProperty(value = "勋章名称 例如:俱乐部之星") |
| | | private String medalName; |
| | | |
| | | @ApiModelProperty(value = "当前等级") |
| | | private Integer levelNum; |
| | | |
| | | @ApiModelProperty(value = "升级条件") |
| | | private String upgradeConditions; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponStuAvailableVo { |
| | | |
| | | @ApiModelProperty(value = "券id") |
| | | private Integer conponId; |
| | | |
| | | @ApiModelProperty(value = "券名称") |
| | | private String conponName; |
| | | |
| | | @ApiModelProperty(value = "券类型 1满减券(取 条件金额+扣减金额) 2代金券(取 扣减金额)") |
| | | private Integer conponType; |
| | | |
| | | @ApiModelProperty(value = "条件金额") |
| | | private double conditionalAmount; |
| | | |
| | | @ApiModelProperty(value = "扣减金额") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "有效期至 yyyy-MM-dd") |
| | | private String lifespan; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CourseDetailsOfContinuationResp { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "学员id") |
| | | private Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师") |
| | | private String teacherName; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店地址") |
| | | private String storeAddr; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "学员姓名") |
| | | private String stuName; |
| | | |
| | | @ApiModelProperty(value = "学员电话") |
| | | private String stuPhone; |
| | | |
| | | @ApiModelProperty(value = "学员年龄") |
| | | private Integer stuAge; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private double wpGold; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CourseHoursType { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer courseConfigId; |
| | | |
| | | @ApiModelProperty(value = "课时数") |
| | | private Integer courseHourNums; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.sourceDetail; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RecordTimeRequest { |
| | | |
| | | @ApiModelProperty(value = "学员id", dataType = "int", required = true) |
| | | private Integer stuId; |
| | | |
| | | @ApiModelProperty(value = "课包id", dataType = "int") |
| | | private Integer lessonId; |
| | | |
| | | @ApiModelProperty(value = "开始时间 格式:yyyy-MM", dataType = "string") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间 格式:yyyy-MM", dataType = "string") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "类型:1购买课包 2消费扣除 3报名赛事 4介绍有礼 5全部", dataType = "int") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.dsh.account.service; |
| | | |
| | | import com.dsh.account.entity.EvaluateStudent; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 评价学员记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface EvaluateStudentService extends IService<EvaluateStudent> { |
| | | |
| | | List<StuCommentsVo> queryStuCommentsList(Integer stuId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.exploreDetail.ExploreDatasVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionIns; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | void addStuOfAppUser(StuDetailsReq stu,Integer appUserId); |
| | | |
| | | ClassDetailsInsVo querySessionDetailsDt(Integer userIdFormRedis, Integer lessonId, Integer stuId); |
| | | |
| | | List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId); |
| | | |
| | | List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId); |
| | | |
| | | CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId); |
| | | /** |
| | | * 查询探索-公告列表 |
| | | */ |
| | | List<SysNotice> querySystemNoticeDetails(); |
| | | /** |
| | | * 查询公告详情 |
| | | */ |
| | | SysNotice queryNoticeData(Integer noId); |
| | | /** |
| | | * 查询常见问题列表 |
| | | */ |
| | | QuestionDetailsVo queryQuestionData(); |
| | | |
| | | /** |
| | | * 查询常见问题详情 |
| | | */ |
| | | QuestionIns queryQuestionDataInfo(Integer quesId); |
| | | |
| | | /** |
| | | * 查询客服列表 |
| | | */ |
| | | List<String> queryCustomerDetails(); |
| | | |
| | | /** |
| | | * 查询探索页面首页 |
| | | */ |
| | | ExploreDatasVo queryIndexOfExplores(LonLatRequest llrequest); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.EvaluateStudent; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.mapper.EvaluateStudentMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | | import com.dsh.account.service.EvaluateStudentService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 评价学员记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Service |
| | | public class EvaluateStudentServiceImpl extends ServiceImpl<EvaluateStudentMapper, EvaluateStudent> implements EvaluateStudentService { |
| | | |
| | | @Autowired |
| | | private TStudentMapper tstuMapper; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | @Override |
| | | public List<StuCommentsVo> queryStuCommentsList(Integer stuId) { |
| | | List<StuCommentsVo> stuCommentsVos = new ArrayList<>(); |
| | | TStudent tStudent = tstuMapper.selectById(stuId); |
| | | List<EvaluateStudent> evaluateStudents = this.baseMapper.selectList(new EntityWrapper<EvaluateStudent>() |
| | | .eq("studentId",stuId )); |
| | | if (evaluateStudents.size() > 0){ |
| | | for (EvaluateStudent evaluateStudent : evaluateStudents) { |
| | | StuCommentsVo vo = new StuCommentsVo(); |
| | | vo.setHeadImg(tStudent.getHeadImg()); |
| | | vo.setStuName(tStudent.getName()); |
| | | vo.setComTime(format.format(tStudent.getInsertTime())); |
| | | vo.setContents(evaluateStudent.getContent()); |
| | | String imgs = evaluateStudent.getImgs(); |
| | | String[] split = imgs.split(","); |
| | | vo.setImgs(Arrays.asList(split)); |
| | | stuCommentsVos.add(vo); |
| | | } |
| | | } |
| | | return stuCommentsVos; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.enums.WeeksEnum; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.CourseOfStoreVo; |
| | | import com.dsh.account.feignclient.course.model.QueryStoreList; |
| | |
| | | import com.dsh.account.util.akeylogin.Md5Util; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | .eq("isDefault",1)); |
| | | if (tStudents.size() > 0 ){ |
| | | TStudent tStudent = tStudents.get(0); |
| | | classInfoVo.setStuId(tStudent.getId()); |
| | | classInfoVo.setIsThere(1); |
| | | classInfoVo.setStuImg(tStudent.getHeadImg()); |
| | | classInfoVo.setStuSex(tStudent.getSex()); |
| | |
| | | * @param latitude |
| | | * @return |
| | | */ |
| | | public List<WeekedCourse> dealDatas(List<CourseOfStoreVo> storeOfCourses,String longitude ,String latitude){ |
| | | public List<WeekedCourse> dealDatas(List<CourseOfStoreVo> storeOfCourses,String longitude ,@RequestBody String latitude){ |
| | | List<WeekedCourse> weekedCourses = new ArrayList<>(); |
| | | int weekStr = LocalDateTimeUtils.getWeekStr(); |
| | | for (int i = 1; i < 8; i++) { |
| | | WeekedCourse weekedCourse = new WeekedCourse(); |
| | | weekedCourse.setWeekNum(i); |
| | | weekedCourse.setWeekStr(WeeksEnum.getStr(i)); |
| | | String weekOfDays = LocalDateTimeUtils.getWeekOfDays(i); |
| | | weekedCourse.setDayStr(weekOfDays); |
| | | List<CourseVenue> courseVenues = new ArrayList<>(); |
| | | if (weekStr == i) { |
| | | weekedCourse.setIsToday(1); |
| | | } else { |
| | | weekedCourse.setIsToday(2); |
| | | } |
| | | Map<Integer, List<CourseOfStoreVo>> map = storeOfCourses.stream().collect(Collectors.groupingBy(CourseOfStoreVo::getStoreId)); |
| | | for (Map.Entry<Integer, List<CourseOfStoreVo>> integerListEntry : map.entrySet()) { |
| | | List<CourseOfStoreVo> value = integerListEntry.getValue(); |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.activity.IntroduceRewardsClient; |
| | | import com.dsh.account.feignclient.activity.UserConponClient; |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.CancelListClient; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.CourseRecordClient; |
| | | import com.dsh.account.feignclient.course.CourseSessionNameClient; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import com.dsh.account.feignclient.course.model.StuWithCoursesListVo; |
| | | import com.dsh.account.feignclient.course.model.StudentOfCourseVo; |
| | | import com.dsh.account.feignclient.other.NoticeClient; |
| | | import com.dsh.account.feignclient.other.QuestionClient; |
| | | import com.dsh.account.feignclient.other.StoreClient; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.StoreLonLatList; |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.exploreDetail.ExploreDatasVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetails.QuestionIns; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | | import com.dsh.account.service.TStudentService; |
| | | |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TStudentServiceImpl extends ServiceImpl<TStudentMapper, TStudent> implements TStudentService { |
| | | |
| | | @Autowired |
| | | private CourseSessionNameClient sessionNameClient; |
| | | |
| | | @Autowired |
| | | private DeductionCompetitionsClient dcttClient; |
| | | |
| | | @Autowired |
| | | private CancelListClient cancelcClient; |
| | | |
| | | @Autowired |
| | | private IntroduceRewardsClient idrClient; |
| | | |
| | | @Autowired |
| | | private CourseRecordClient crClient; |
| | | |
| | | @Autowired |
| | | private CoursePaymentClient couPayClient; |
| | | |
| | | @Autowired |
| | | private UserConponClient userCClient; |
| | | |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | |
| | | @Autowired |
| | | private NoticeClient noClient; |
| | | |
| | | @Autowired |
| | | private QuestionClient quesClient; |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tauMapper; |
| | | |
| | | @Override |
| | | public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) { |
| | | TStudent student = new TStudent(); |
| | | student.setAppUserId(appUserId); |
| | | student.setName(stu.getName()); |
| | | student.setHeadImg(stu.getHeadImg()); |
| | | student.setPhone(stu.getPhone()); |
| | | student.setPhone(ToolUtil.isNotEmpty(stu.getPhone()) ? stu.getPhone() : ""); |
| | | student.setSex(stu.getSex()); |
| | | student.setIdCard(stu.getIdCard()); |
| | | student.setIdCard(ToolUtil.isNotEmpty(stu.getIdCard())?stu.getIdCard() : ""); |
| | | student.setBirthday(new Date(stu.getBirthday())); |
| | | student.setHeight(stu.getHeight()); |
| | | student.setWeight(stu.getWeight()); |
| | |
| | | student.setState(1); |
| | | this.baseMapper.insert(student); |
| | | } |
| | | |
| | | @Override |
| | | public ClassDetailsInsVo querySessionDetailsDt(Integer userIdFormRedis, Integer lessonId, Integer stuId) { |
| | | ClassDetailsInsVo insVo = new ClassDetailsInsVo(); |
| | | Date localMonthStart = DateTimeHelper.getCurrentMouthStart(); |
| | | Date localMonthEnd = DateTimeHelper.getCurrentMouthEnd(); |
| | | List<StuSessionDetailsVo> stuSessionList = sessionNameClient.getStuSessionList(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | TStudent tStudent = this.baseMapper.selectById(stuId); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | insVo.setStuId(tStudent.getId()); |
| | | insVo.setStuName(tStudent.getName()); |
| | | insVo.setStuImage(tStudent.getHeadImg()); |
| | | |
| | | List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>(); |
| | | |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(localMonthStart,localMonthEnd,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(localMonthStart,localMonthEnd,stuId,userIdFormRedis); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .eq("referralUserId",userIdFormRedis ) |
| | | .between("insertTime",localMonthStart ,localMonthEnd)); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(localMonthStart, localMonthEnd, userIds); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | insVo.setSessionNames(stuSessionList); |
| | | insVo.setDetails(dealDataOfTime(purchaseRecordVoList)); |
| | | StuWithCoursesListVo stuOfCoursesDetails = couPayClient.getStuOfCoursesDetails(stuId, userIdFormRedis); |
| | | insVo.setTotalNums(stuOfCoursesDetails.getTotalNums()); |
| | | insVo.setDeductedNums(stuOfCoursesDetails.getDeductedNums()); |
| | | insVo.setRemainingNums(stuOfCoursesDetails.getRemainingNums()); |
| | | Integer deductionClassHour = crClient.getDeductionClassHour(lessonId, stuId, userIdFormRedis); |
| | | insVo.setDeductionClassHours(deductionClassHour); |
| | | } |
| | | |
| | | return insVo; |
| | | } |
| | | |
| | | @Override |
| | | public List<PurchaseRecordVo> queryDeduRecordDetails(RecordTimeRequest timeRequest,Integer appUserId) { |
| | | List<PurchaseRecordVo> purchaseRecordVoList = new ArrayList<>(); |
| | | Date startTime = DateTimeHelper.getCurrentIdetMouthStart(timeRequest.getStartTime()); |
| | | Date endTime = DateTimeHelper.getCurrentIdeaMouthEnd(timeRequest.getEndTime()); |
| | | |
| | | List<PurchaseRecordVo> stuSourseList = dcttClient.getStuSourseList(startTime,endTime,appUserId); |
| | | purchaseRecordVoList.addAll(stuSourseList); |
| | | List<PurchaseRecordVo> cancelCourseList = cancelcClient.getCancelCourseList(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(cancelCourseList); |
| | | List<PurchaseRecordVo> purchaseRecordVos = sessionNameClient.queryCourseDetails(startTime,endTime,timeRequest.getStuId(),appUserId); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos); |
| | | List<TAppUser> tAppUsers = tauMapper.selectList(new QueryWrapper<TAppUser>() |
| | | .eq("referralUserId",appUserId ) |
| | | .between("insertTime",timeRequest.getStartTime() ,timeRequest.getEndTime())); |
| | | List<Integer> userIds = tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | List<PurchaseRecordVo> purchaseRecordVos1 = idrClient.queryAppUsersofIntroduce(startTime, endTime, userIds); |
| | | purchaseRecordVoList.addAll(purchaseRecordVos1); |
| | | |
| | | purchaseRecordVoList = dealDataOfTime(purchaseRecordVoList); |
| | | return purchaseRecordVoList; |
| | | } |
| | | |
| | | @Override |
| | | public List<CouponStuAvailableVo> queryStuOfConponDetails(Integer appUserId) { |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | availableVos = userCClient.queryUserWithConponList(appUserId); |
| | | return availableVos; |
| | | } |
| | | |
| | | @Override |
| | | public CourseDetailsOfContinuationResp queryStuOfCourseDetails(Integer lessonId, Integer stuId, Integer appUserId) { |
| | | CourseDetailsOfContinuationResp resp = new CourseDetailsOfContinuationResp(); |
| | | |
| | | StudentOfCourseVo studentCourse = couPayClient.getStudentCourse(lessonId,stuId,appUserId); |
| | | |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(studentCourse.getStoreId()); |
| | | |
| | | return resp; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysNotice> querySystemNoticeDetails() { |
| | | return noClient.getSysNoticeDetails(); |
| | | } |
| | | |
| | | @Override |
| | | public SysNotice queryNoticeData(Integer noId) { |
| | | return noClient.getSysNoticeBuId(noId); |
| | | } |
| | | |
| | | @Override |
| | | public QuestionDetailsVo queryQuestionData() { |
| | | return quesClient.getSysQuestionDetails(); |
| | | } |
| | | |
| | | @Override |
| | | public QuestionIns queryQuestionDataInfo(Integer quesId) { |
| | | return quesClient.getSysQuestionBuId(quesId); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryCustomerDetails() { |
| | | return noClient.queryCustomerTel(); |
| | | } |
| | | |
| | | @Override |
| | | public ExploreDatasVo queryIndexOfExplores(LonLatRequest llrequest) { |
| | | ExploreDatasVo datasVo = new ExploreDatasVo(); |
| | | List<StoreInfo> allNearbyStoreList = storeClient.getAllNearbyStoreList(llrequest.getLongitude(),llrequest.getLatitude()); |
| | | List<StoreLonLatList> allStoreLonLats = storeClient.getAllStoreLonLats(llrequest.getLongitude(), llrequest.getLatitude()); |
| | | datasVo.setStoreLists(allNearbyStoreList); |
| | | datasVo.setLonLatLists(allStoreLonLats); |
| | | return datasVo; |
| | | } |
| | | |
| | | |
| | | public static List<PurchaseRecordVo> dealDataOfTime(List<PurchaseRecordVo> purchaseRecords) { |
| | | Collections.sort(purchaseRecords, new Comparator<PurchaseRecordVo>() { |
| | | @Override |
| | | public int compare(PurchaseRecordVo record1, PurchaseRecordVo record2) { |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | Date date1 = null; |
| | | Date date2 = null; |
| | | try { |
| | | date1 = dateFormat.parse(record1.getPurchaseTime()); |
| | | date2 = dateFormat.parse(record2.getPurchaseTime()); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 倒序排序 |
| | | return date2.compareTo(date1); |
| | | } |
| | | }); |
| | | return purchaseRecords; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.*; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取指定月份开始时0点0分0秒 |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | | public static Date getCurrentIdetMouthStart(String input) { |
| | | // 解析年月字符串 |
| | | YearMonth yearMonth = YearMonth.parse(input); |
| | | // 获取月份的开始时间(月初0点) |
| | | LocalDate startOfMonth = yearMonth.atDay(1); |
| | | LocalDateTime startDateTime = startOfMonth.atTime(LocalTime.MIN); |
| | | return Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 获取当月结束时23点59分59秒 |
| | | * |
| | | * @return |
| | | */ |
| | | public static Date getCurrentMouthEnd() { |
| | | Date d = getSystemDate(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(d); |
| | | int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); |
| | | calendar.set(Calendar.DAY_OF_MONTH, lastDay); |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取指定月份结束时23点59分59秒 |
| | | * @param input 输入的时间,"yyyy-MM" |
| | | * @return |
| | | */ |
| | | public static Date getCurrentIdeaMouthEnd(String input) { |
| | | // 解析年月字符串 |
| | | YearMonth yearMonth = YearMonth.parse(input); |
| | | // 获取月份的结束时间(月末23:59:59秒) |
| | | LocalDate endOfMonth = yearMonth.atEndOfMonth(); |
| | | LocalDateTime endDateTime = endOfMonth.atTime(23, 59, 59); |
| | | return Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | } |
| | | |
| | | /** |
| | | * 返回下月的这天 |
| | | * |
| | | * @param date |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 功能描述: 根据两个定位点的经纬度算出两点间的距离(米/m) |
| | | * |
| | | * @param startLonLat 起始经纬度 |
| | | * @param endLonLat 结束经纬度(目标经纬度) |
| | | * @return java.lang.Long 两个定位点之间的距离 |
| | | */ |
| | | public Long getDistance(String startLonLat, String endLonLat) { |
| | | try { |
| | | // 返回起始地startAddr与目的地endAddr之间的距离,单位:米 |
| | | Long result = new Long(0); |
| | | String queryUrl = |
| | | "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat |
| | | + "&destination=" |
| | | + endLonLat; |
| | | String queryResult = getResponse(queryUrl); |
| | | JSONObject job = JSONObject.parseObject(queryResult); |
| | | JSONArray ja = job.getJSONArray("results"); |
| | | JSONObject jobO = JSONObject.parseObject(ja.getString(0)); |
| | | result = Long.parseLong(jobO.get("distance").toString()); |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 功能描述: 根据两个定位点的经纬度算出两点间的距离(千米/km) |
| | | * |
| | | * @param startLonLat 起始经纬度 |
| | | * @param endLonLat 结束经纬度(目标经纬度) |
| | | * @return java.lang.Long 两个定位点之间的距离 |
| | | */ |
| | | public String getDistanceTOKilometer(String startLonLat, String endLonLat) { |
| | | try { |
| | | // 返回起始地startAddr与目的地endAddr之间的距离,单位:米 |
| | | Long result = new Long(0); |
| | | String queryUrl = |
| | | "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat |
| | | + "&destination=" |
| | | + endLonLat; |
| | | String queryResult = getResponse(queryUrl); |
| | | JSONObject job = JSONObject.parseObject(queryResult); |
| | | JSONArray ja = job.getJSONArray("results"); |
| | | JSONObject jobO = JSONObject.parseObject(ja.getString(0)); |
| | | result = Long.parseLong(jobO.get("distance").toString()); |
| | | double kilDis = (double) result / 1000; |
| | | DecimalFormat decimalFormat = new DecimalFormat("#.00"); |
| | | return decimalFormat.format(kilDis); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 功能描述: 发送请求 |
| | | * |
| | | * @param serverUrl 请求地址 |
| | | * @return java.lang.String |
| | | * @author isymikasan |
| | | * @date 2022-01-26 09:15:01 |
| | | */ |
| | | private static String getResponse(String serverUrl) { |
| | | // 用JAVA发起http请求,并返回json格式的结果 |
| | | StringBuffer result = new StringBuffer(); |
| | | try { |
| | | URL url = new URL(serverUrl); |
| | | URLConnection conn = url.openConnection(); |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); |
| | | String line; |
| | | while ((line = in.readLine()) != null) { |
| | | result.append(line); |
| | | } |
| | | in.close(); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | |
| | | } |
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.account.mapper.EvaluateStudentMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dsh.activity.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.activity.service.IntroduceRewardsService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class IntroduceRewardsController { |
| | | |
| | | |
| | | @Autowired |
| | | private IntroduceRewardsService idrService; |
| | | |
| | | private final SimpleDateFormat mat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, @RequestBody Date endTime, @RequestBody List<Integer> userIds){ |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | List<IntroduceRewards> list = idrService.list(new QueryWrapper<IntroduceRewards>() |
| | | .ge("startTime",startTime) |
| | | .lt("endTime",endTime)); |
| | | IntroduceRewards introduceRewards = list.get(0); |
| | | userIds.forEach( userId -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+"+introduceRewards.getGiveClass()); |
| | | recordVo.setPurchaseType("介绍有礼"); |
| | | recordVos.add(recordVo); |
| | | } ); |
| | | return recordVos; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import com.dsh.activity.service.CouponService; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class UserConponController { |
| | | |
| | | @Autowired |
| | | private UserCouponService uconService; |
| | | |
| | | @Autowired |
| | | private CouponService cService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId){ |
| | | |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | |
| | | List<UserCoupon> list = uconService.list(new QueryWrapper<UserCoupon>() |
| | | .eq("userId", appUserId) |
| | | .eq("status",1)); |
| | | if (list.size() > 0){ |
| | | List<Integer> collect = list.stream().map(UserCoupon::getCouponId).collect(Collectors.toList()); |
| | | List<Coupon> conponList = cService.list(new QueryWrapper<Coupon>() |
| | | .in("id", collect)); |
| | | for (Coupon coupon : conponList) { |
| | | CouponStuAvailableVo availableVo = new CouponStuAvailableVo(); |
| | | availableVo.setConponId(coupon.getId()); |
| | | availableVo.setConponName(coupon.getName()); |
| | | availableVo.setConponType(coupon.getType()); |
| | | Map<String,Object> conponRuleMap = cService.queryConponRuleOfJson(coupon.getId()); |
| | | switch (coupon.getType()){ |
| | | case 1: |
| | | Object conditionalAmount = conponRuleMap.get("conditionalAmount"); |
| | | Object deductionAmount = conponRuleMap.get("deductionAmount"); |
| | | availableVo.setConditionalAmount((double) conditionalAmount); |
| | | availableVo.setAmount((double) deductionAmount); |
| | | break; |
| | | case 2: |
| | | Object amount = conponRuleMap.get("deductionAmount"); |
| | | availableVo.setAmount((double)amount); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | availableVo.setLifespan(format.format(coupon.getEndTime())); |
| | | availableVos.add(availableVo); |
| | | } |
| | | } |
| | | return availableVos; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 11:04 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_coupon") |
| | | public class Coupon { |
| | | public class Coupon extends Model<Coupon> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | |
| | | /** |
| | | * 优惠券名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 优惠券类型(1=满减券,2=代金券,3=体验券) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 优惠券规则JSON |
| | | */ |
| | | @TableField("content") |
| | | private String content; |
| | | /** |
| | | * 优惠券说明 |
| | | */ |
| | | @TableField("illustrate") |
| | | private String illustrate; |
| | | /** |
| | | * 发放方式(1=积分购买,2=注册赠送,3=自动发券) |
| | | */ |
| | | @TableField("distributionMethod") |
| | | private Integer distributionMethod; |
| | | /** |
| | | * 兑换方式(1=积分,2=积分+现金) |
| | | */ |
| | | @TableField("redemptionMethod") |
| | | private Integer redemptionMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | @TableField("cash") |
| | | private Double cash; |
| | | private BigDecimal cash; |
| | | /** |
| | | * 所需积分 |
| | | * 所属积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | private BigDecimal integral; |
| | | /** |
| | | * 用户人群(1=全部用户,2=年度会员,3=已有学员用户) |
| | | */ |
| | | @TableField("userPopulation") |
| | | private Integer userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | @TableField("quantityIssued") |
| | | private Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | @TableField("pickUpQuantity") |
| | | private Integer pickUpQuantity; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | @TableField("useScope") |
| | | private Integer useScope; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private Integer province; |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 审核状态(1=待审核,2=已通过,3=已拒绝) |
| | | */ |
| | | @TableField("auditStatus") |
| | | private Integer auditStatus; |
| | | /** |
| | | * 审核人id |
| | | */ |
| | | @TableField("auditUserId") |
| | | private Integer auditUserId; |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | @TableField("auditRemark") |
| | | private String auditRemark; |
| | | /** |
| | | * 状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_introduce_rewards") |
| | | public class IntroduceRewards extends Model<IntroduceRewards> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 赠送课时 |
| | | */ |
| | | private Integer giveClass; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | public class JSONConpon { |
| | | |
| | | double conditionalAmount; |
| | | |
| | | double deductionAmount; |
| | | |
| | | String experienceName; |
| | | |
| | | public JSONConpon(double conditionalAmount, double deductionAmount, String experienceName) { |
| | | this.conditionalAmount = conditionalAmount; |
| | | this.deductionAmount = deductionAmount; |
| | | this.experienceName = experienceName; |
| | | } |
| | | |
| | | public JSONConpon() { |
| | | } |
| | | |
| | | public double getConditionalAmount() { |
| | | return conditionalAmount; |
| | | } |
| | | |
| | | public void setConditionalAmount(double conditionalAmount) { |
| | | this.conditionalAmount = conditionalAmount; |
| | | } |
| | | |
| | | public double getDeductionAmount() { |
| | | return deductionAmount; |
| | | } |
| | | |
| | | public void setDeductionAmount(double deductionAmount) { |
| | | this.deductionAmount = deductionAmount; |
| | | } |
| | | |
| | | public String getExperienceName() { |
| | | return experienceName; |
| | | } |
| | | |
| | | public void setExperienceName(String experienceName) { |
| | | this.experienceName = experienceName; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_coupon") |
| | | public class UserCoupon extends Model<UserCoupon> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer couponId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 核销人员id |
| | | */ |
| | | private Integer verificationUserId; |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | private Date verificationTime; |
| | | /** |
| | | * 领取时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_points_merchandise") |
| | | public class UserPointsMerchandise extends Model<UserPointsMerchandise> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer pointsMerchandiseId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 核销人员id |
| | | */ |
| | | private Integer verificationUserId; |
| | | /** |
| | | * 核销时间 |
| | | */ |
| | | private Date verificationTime; |
| | | /** |
| | | * 领取时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient; |
| | | |
| | | |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface IntroduceRewardsClient { |
| | | |
| | | @PostMapping("/introduce/useOfRewards") |
| | | public List<PurchaseRecordVo> queryAppUsersofIntroduce(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody List<Integer> userIds); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient; |
| | | |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface UserConponClient { |
| | | |
| | | |
| | | @PostMapping("/userConpon/getStuOfConpons") |
| | | public List<CouponStuAvailableVo> queryUserWithConponList(@RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponStuAvailableVo { |
| | | |
| | | @ApiModelProperty(value = "券id") |
| | | private Integer conponId; |
| | | |
| | | @ApiModelProperty(value = "券名称") |
| | | private String conponName; |
| | | |
| | | @ApiModelProperty(value = "券类型 1满减券(取 条件金额+扣减金额) 2代金券(取 扣减金额)") |
| | | private Integer conponType; |
| | | |
| | | @ApiModelProperty(value = "条件金额") |
| | | private double conditionalAmount; |
| | | |
| | | @ApiModelProperty(value = "扣减金额") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "有效期至 yyyy-MM-dd") |
| | | private String lifespan; |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 类型实体类: |
| | | * 类型:购买课包、消课、报名赛事、介绍有礼 |
| | | */ |
| | | |
| | | @Data |
| | | public class PurchaseRecordVo { |
| | | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String purchaseType; |
| | | |
| | | @ApiModelProperty(value = "类型变动时间 例如 06-29 10:48") |
| | | private String purchaseTime; |
| | | |
| | | @ApiModelProperty(value = "类型涉及金额 例如 +100 -50") |
| | | private String purchaseAmount; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 11:22 |
| | | * <p> |
| | | * 优惠券 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CouponMapper extends BaseMapper<Coupon> { |
| | | |
| | | Map<String, Object> queryConponRuleOfJson(@Param("id") Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface IntroduceRewardsMapper extends BaseMapper<IntroduceRewards> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserCouponMapper extends BaseMapper<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserPointsMerchandiseMapper extends BaseMapper<UserPointsMerchandise> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | |
| | | |
| | | @Data |
| | | public class ConponJsonRuleModel { |
| | | /** |
| | | * 条件金额 |
| | | */ |
| | | double conditionalAmount; |
| | | /** |
| | | * 抵扣金额(代金券 取 该字段) |
| | | */ |
| | | double deductionAmount; |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | String experienceName; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.Coupon; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CouponService extends IService<Coupon> { |
| | | |
| | | Map<String, Object> queryConponRuleOfJson(Integer id); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface IntroduceRewardsService extends IService<IntroduceRewards> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserCouponService extends IService<UserCoupon> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface UserPointsMerchandiseService extends IService<UserPointsMerchandise> { |
| | | |
| | | } |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.dsh.activity.mapper.CouponMapper; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.service.ICouponService; |
| | | 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.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | public List<CouponListVo> queryCouponList(Integer uid, Integer distributionMethod) throws Exception { |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | List<CouponListVo> listVos = new ArrayList<>(); |
| | | if(null != appUser){ |
| | | if (null != appUser) { |
| | | List<Integer> userPopulation = new ArrayList<>(); |
| | | userPopulation.add(1);//全部用户 |
| | | if(1 == appUser.getIsVip()){ |
| | | if (1 == appUser.getIsVip()) { |
| | | userPopulation.add(2);//年度会员 |
| | | } |
| | | List<Student> students = studentClient.queryStudentList(uid); |
| | | if(students.size() > 0){ |
| | | if (students.size() > 0) { |
| | | userPopulation.add(3);//已有学员用户 |
| | | } |
| | | List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", distributionMethod).in("userPopulation", userPopulation) |
| | |
| | | couponListVo.setType(coupon.getType()); |
| | | couponListVo.setEffectiveTime(sdf.format(coupon.getStartTime()) + "-" + sdf.format(coupon.getEndTime())); |
| | | String content = coupon.getContent(); |
| | | if(coupon.getType() == 1){//满减{"num1":1,"num2":1} |
| | | if (coupon.getType() == 1) {//满减{"num1":1,"num2":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition("满" + jsonObject.getDouble("num1") + "元可用"); |
| | | couponListVo.setFavorable(jsonObject.getDouble("num2") + "元"); |
| | | } |
| | | if(coupon.getType() == 2){//满减{"num1":1} |
| | | if (coupon.getType() == 2) {//满减{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition(""); |
| | | couponListVo.setFavorable(jsonObject.getDouble("num1") + "元"); |
| | | } |
| | | if(coupon.getType() == 3){//体验券{"num1":1} |
| | | if (coupon.getType() == 3) {//体验券{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition(""); |
| | | couponListVo.setFavorable(jsonObject.getString("num1")); |
| | |
| | | } |
| | | return listVos; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Map<String, Object> queryConponRuleOfJson(Integer id) { |
| | | return this.baseMapper.queryConponRuleOfJson(id); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.mapper.IntroduceRewardsMapper; |
| | | import com.dsh.activity.service.IntroduceRewardsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 介绍奖励 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class IntroduceRewardsServiceImpl extends ServiceImpl<IntroduceRewardsMapper, IntroduceRewards> implements IntroduceRewardsService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.mapper.UserCouponMapper; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户优惠券领取记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class UserCouponServiceImpl extends ServiceImpl<UserCouponMapper, UserCoupon> implements UserCouponService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.mapper.UserPointsMerchandiseMapper; |
| | | import com.dsh.activity.service.UserPointsMerchandiseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分商品领取记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class UserPointsMerchandiseServiceImpl extends ServiceImpl<UserPointsMerchandiseMapper, UserPointsMerchandise> implements UserPointsMerchandiseService { |
| | | |
| | | } |
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.activity.mapper.CouponMapper"> |
| | | |
| | | <select id="queryConponRuleOfJson" resultType="java.util.Map"> |
| | | SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount, |
| | | JSON_EXTRACT(content, "$.deductionAmount") as deductionAmount, |
| | | JSON_EXTRACT(content, "$.experienceName") as experienceName |
| | | FROM t_coupon |
| | | where 1=1 |
| | | <if test="id != null"> |
| | | and `id` = #{id} |
| | | </if> |
| | | </select> |
| | | |
| | | </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.activity.mapper.IntroduceRewardsMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </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.activity.mapper.UserCouponMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </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.activity.mapper.UserPointsMerchandiseMapper"> |
| | | |
| | | <!-- 开启二级缓存 --> |
| | | <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.competition.entity.Competition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.competition.service.CompetitionService; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CompetitionController { |
| | | |
| | | |
| | | @Autowired |
| | | private CompetitionService cttService; |
| | | |
| | | @Autowired |
| | | private UserCompetitionService ucttService; |
| | | |
| | | private final SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | @PostMapping("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, @RequestBody Date endTime,@RequestParam("appUserId") Integer appUserId){ |
| | | |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | |
| | | List<Competition> list = cttService.list(new QueryWrapper<Competition>() |
| | | .eq("payType",3 ) |
| | | .eq("auditStatus",2)); |
| | | List<Integer> comIds = list.stream().map(Competition::getId).collect(Collectors.toList()); |
| | | List<UserCompetition> userCompetitions = ucttService.queryUsersCompetetions(startTime,endTime,appUserId,comIds); |
| | | if (userCompetitions.size() > 0){ |
| | | userCompetitions.forEach(coms ->{ |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseType("报名赛事"); |
| | | recordVo.setPurchaseTime(dateFormat.format(coms.getInsertTime())); |
| | | Competition competition = cttService.getById(coms.getCompetitionId()); |
| | | recordVo.setPurchaseAmount("-"+competition.getPrice()); |
| | | recordVos.add(recordVo); |
| | | }); |
| | | } |
| | | return recordVos; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 赛事报名记录 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/user_competition") |
| | | public class UserCompetitionController { |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.dsh.competition.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_competition") |
| | | public class Competition extends Model<Competition> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | private String cityCode; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | private Integer storeId; |
| | | /** |
| | | * 赛事名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | private Date endTime; |
| | | /** |
| | | * 报名结束时间 |
| | | */ |
| | | private Date registerEndTime; |
| | | /** |
| | | * 报名条件(1=全部用户,2=仅限年度会员参与,3=仅限学员参与) |
| | | */ |
| | | private Integer registerCondition; |
| | | /** |
| | | * 报名开始年龄 |
| | | */ |
| | | private Integer startAge; |
| | | /** |
| | | * 报名结束年龄 |
| | | */ |
| | | private Integer endAge; |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币支付,3=课时支付) |
| | | */ |
| | | private Integer payType; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | private BigDecimal price; |
| | | /** |
| | | * 参加地址 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | private String longitude; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | private String latitude; |
| | | /** |
| | | * 报名人数 |
| | | */ |
| | | private Integer applicantsNumber; |
| | | /** |
| | | * 基础人数 |
| | | */ |
| | | private Integer baseNumber; |
| | | /** |
| | | * 是否需要实名(0=否,1=是) |
| | | */ |
| | | private Integer realName; |
| | | /** |
| | | * 赛事简介 |
| | | */ |
| | | private String introduction; |
| | | /** |
| | | * 审核状态(1=待审核,2=已通过,3=已拒绝) |
| | | */ |
| | | private Integer auditStatus; |
| | | /** |
| | | * 审核人id |
| | | */ |
| | | private Integer auditUserId; |
| | | /** |
| | | * 审核备注 |
| | | */ |
| | | private String auditRemark; |
| | | /** |
| | | * 状态(1=未开始,2=已开始,3=已结束,4=已取消) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 赛事报名记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_competition") |
| | | public class UserCompetition extends Model<UserCompetition> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 赛事id |
| | | */ |
| | | private Integer competitionId; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer userId; |
| | | /** |
| | | * 状态(1=正常,2=取消) |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * 参加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient; |
| | | |
| | | |
| | | import com.dsh.competition.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-competition") |
| | | public interface DeductionCompetitionsClient { |
| | | |
| | | @PostMapping("/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestParam("appUserId") Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | public class ClassDataDetails { |
| | | |
| | | @ApiModelProperty(value = "已扣课时数") |
| | | private Integer deductionClassHours; |
| | | |
| | | @ApiModelProperty(value = "类型变动记录") |
| | | private List<PurchaseRecordVo> recordVos; |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 类型实体类: |
| | | * 类型:购买课包、消课、报名赛事、介绍有礼 |
| | | */ |
| | | |
| | | @Data |
| | | public class PurchaseRecordVo { |
| | | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String purchaseType; |
| | | |
| | | @ApiModelProperty(value = "类型变动时间") |
| | | private String purchaseTime; |
| | | |
| | | @ApiModelProperty(value = "类型涉及金额") |
| | | private String purchaseAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.competition.entity.Competition; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | public interface CompetitionMapper extends BaseMapper<Competition> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 赛事报名记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | public interface UserCompetitionMapper extends BaseMapper<UserCompetition> { |
| | | |
| | | |
| | | List<UserCompetition> queryUsersCompetetions(@Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime , |
| | | @Param("appUserId") Integer appUserId, |
| | | @Param("comIds") List<Integer> comIds); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.competition.entity.Competition; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | public interface CompetitionService extends IService<Competition> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 赛事报名记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | public interface UserCompetitionService extends IService<UserCompetition> { |
| | | |
| | | |
| | | List<UserCompetition> queryUsersCompetetions(Date startTime, Date endTime ,Integer appUserId, List<Integer> comIds); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.competition.entity.Competition; |
| | | import com.dsh.competition.mapper.CompetitionMapper; |
| | | import com.dsh.competition.service.CompetitionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @Service |
| | | public class CompetitionServiceImpl extends ServiceImpl<CompetitionMapper, Competition> implements CompetitionService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.mapper.UserCompetitionMapper; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 赛事报名记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-26 |
| | | */ |
| | | @Service |
| | | public class UserCompetitionServiceImpl extends ServiceImpl<UserCompetitionMapper, UserCompetition> implements UserCompetitionService { |
| | | |
| | | |
| | | @Override |
| | | public List<UserCompetition> queryUsersCompetetions(Date startTime, Date endTime , Integer appUserId, List<Integer> comIds) { |
| | | return this.baseMapper.queryUsersCompetetions(startTime,endTime,appUserId,comIds); |
| | | } |
| | | } |
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.competition.mapper.CompetitionMapper"> |
| | | |
| | | |
| | | </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.competition.mapper.UserCompetitionMapper"> |
| | | |
| | | <select id="queryUsersCompetetions" resultType="com.dsh.competition.entity.UserCompetition"> |
| | | SELECT * |
| | | FROM t_user_competition |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_user_competition1 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_user_competition2 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_user_competition3 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_user_competition4 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_user_competition5 |
| | | WHERE 1 = 1 |
| | | <if test=" stuId != null"> |
| | | and studentId = #{stuId} |
| | | </if> |
| | | <if test="appUserId != null"> |
| | | and competitionId in |
| | | <foreach collection="comIds" item="item" separator="," open="(" index="index" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="startTime != null and endTime != null"> |
| | | and (insertTime between #{startTime} and #{endTime}) |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CancelSourceController { |
| | | |
| | | |
| | | @Autowired |
| | | private CancelledClassesService caceService; |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackagePaymentService tcppService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | |
| | | /** |
| | | * 获取课包对应的消费记录 |
| | | * @param stuId 学员id |
| | | * @param appUserId 用户id |
| | | * @return |
| | | */ |
| | | @PostMapping("/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime,@RequestBody Date endTime,@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | |
| | | List<TCoursePackagePayment> tCoursePackagePayments = tcppService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | List<Integer> coursePackageIds = tCoursePackagePayments.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | List<CancelledClasses> list = caceService.list(new QueryWrapper<CancelledClasses>() |
| | | .in("coursePackageId", coursePackageIds) |
| | | .between("insertTime",startTime,endTime)); |
| | | if (list.size() > 0){ |
| | | list.forEach( canse -> { |
| | | PurchaseRecordVo purchaseRecordVo = new PurchaseRecordVo(); |
| | | purchaseRecordVo.setPurchaseTime(format.format(canse.getInsertTime())); |
| | | purchaseRecordVo.setPurchaseType(""); |
| | | purchaseRecordVo.setPurchaseAmount("-"+canse.getCancelledClassesNumber()); |
| | | purchaseRecordVos.add(purchaseRecordVo); |
| | | }); |
| | | } |
| | | return purchaseRecordVos; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | @PostMapping("/course/queryList") |
| | | public List<ExerciseVideo> queryStuCourseAfterVideos(List<Integer> courseIds){ |
| | | public List<ExerciseVideo> queryStuCourseAfterVideos(@RequestBody List<Integer> courseIds){ |
| | | List<ExerciseVideo> videos = new ArrayList<>(); |
| | | List<TCourse> list = courseService.list(new QueryWrapper<TCourse>() |
| | | .in("id", courseIds) |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.feignclient.model.CourseOfStoreVo; |
| | | import com.dsh.course.feignclient.model.StuCourseResp; |
| | | import com.dsh.course.feignclient.model.*; |
| | | import com.dsh.course.service.TCoursePackagePaymentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.util.DateUtil; |
| | | import com.dsh.course.util.StrUtils; |
| | | import io.swagger.annotations.Api; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | /** |
| | | * 获取 没有学员信息的图片配置 |
| | | * @param stuId 学员id |
| | | * @return 课包列表 |
| | | */ |
| | | @PostMapping("/coursePack/queryPayment") |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId){ |
| | | public List<StuCourseResp> getStuCoursePackagePayment(@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | List<StuCourseResp> resps = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(stuId); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,stuId,appUserId); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | |
| | | return tcpService.queryStoreOfCourse(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * 课程名称列表 |
| | | */ |
| | | @PostMapping("/coursePack/sessionNames") |
| | | public List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, @RequestBody Date endTime, @RequestBody Integer stuId, @RequestBody Integer appUserId){ |
| | | List<StuSessionDetailsVo> detailsVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(startTime,endTime,null,stuId,appUserId); |
| | | if (byUserId.size() > 0){ |
| | | List<Integer> collect = byUserId.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<TCoursePackage> list = tcpService.list(new QueryWrapper<TCoursePackage>() |
| | | .in("id", collect)); |
| | | list.forEach(vo -> { |
| | | StuSessionDetailsVo detVo = new StuSessionDetailsVo(); |
| | | detVo.setSessionid(vo.getId()); |
| | | detVo.setSessionName(vo.getName()); |
| | | String afterDayDate = DateUtil.getAfterDayDate2(vo.getInsertTime(),vo.getValidDays() + ""); |
| | | detVo.setPeriodOfValidity(afterDayDate); |
| | | detailsVos.add(detVo); |
| | | }); |
| | | } |
| | | return detailsVos; |
| | | } |
| | | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, @RequestBody Date endTime,@RequestBody Integer stuId, @RequestBody Integer appUserId) { |
| | | List<PurchaseRecordVo> purchaseRecordVos = new ArrayList<>(); |
| | | List<TCoursePackagePayment> coursePackage = packagePaymentService.queryAllCoursePackage(startTime,endTime,null,stuId, appUserId); |
| | | if (coursePackage.size() > 0 ){ |
| | | coursePackage.forEach( cspackage -> { |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseAmount("+"+cspackage.getClassHours()); |
| | | recordVo.setPurchaseTime(format.format(cspackage.getInsertTime())); |
| | | recordVo.setPurchaseType("购买课包"); |
| | | purchaseRecordVos.add(recordVo); |
| | | }); |
| | | } |
| | | return purchaseRecordVos; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/coursePack/stuOfCourses") |
| | | public StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody Integer stuId, @RequestBody Integer appUserId){ |
| | | StuWithCoursesListVo lisco = new StuWithCoursesListVo(); |
| | | Integer totalNu = 0; |
| | | Integer dedutNu = 0; |
| | | Integer remainNu = 0; |
| | | List<TCoursePackagePayment> byUserId = packagePaymentService.queryAllCoursePackage(null,null,null,stuId,appUserId); |
| | | if (byUserId.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : byUserId) { |
| | | totalNu = totalNu + tCoursePackagePayment.getTotalClassHours(); |
| | | dedutNu = dedutNu + tCoursePackagePayment.getLaveClassHours(); |
| | | remainNu = remainNu + (tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | | } |
| | | lisco.setTotalNums(totalNu); |
| | | lisco.setDeductedNums(remainNu); |
| | | lisco.setRemainingNums(dedutNu); |
| | | } |
| | | return lisco; |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | public StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId,@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | StudentOfCourseVo courseVo = new StudentOfCourseVo(); |
| | | List<TCoursePackagePayment> tCoursePackagePayments = packagePaymentService.queryAllCoursePackage(null,null,courseId,stuId,appUserId); |
| | | if (tCoursePackagePayments.size() > 0 ){ |
| | | |
| | | List<CourseHoursType> typeList = new ArrayList<>(); |
| | | tCoursePackagePayments.forEach(cou -> { |
| | | CourseHoursType hoursType = new CourseHoursType(); |
| | | hoursType.setCourseConfigId(cou.getId()); |
| | | hoursType.setCourseConfigId(cou.getClassHours()); |
| | | typeList.add(hoursType); |
| | | }); |
| | | TCoursePackagePayment tCoursePackagePayment = tCoursePackagePayments.get(0); |
| | | courseVo.setCoursePackageId(tCoursePackagePayment.getCoursePackageId()); |
| | | courseVo.setTypeList(typeList); |
| | | |
| | | TCoursePackage coursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | courseVo.setPackageImg(coursePackage.getCoverDrawing()); |
| | | courseVo.setCourseName(coursePackage.getName()); |
| | | courseVo.setCoachId(coursePackage.getCoachId()); |
| | | String classWeeks = coursePackage.getClassWeeks(); |
| | | List<Integer> integers = StrUtils.dealStrToList(classWeeks); |
| | | if (integers.size() > 0){ |
| | | StringBuilder courWeeks = new StringBuilder("每"); |
| | | for (Integer integer : integers) { |
| | | switch (integer){ |
| | | case 1: |
| | | courWeeks.append("周一、"); |
| | | break; |
| | | case 2: |
| | | courWeeks.append("周二、"); |
| | | break; |
| | | case 3: |
| | | courWeeks.append("周三、"); |
| | | break; |
| | | case 4: |
| | | courWeeks.append("周四、"); |
| | | break; |
| | | case 5: |
| | | courWeeks.append("周五、"); |
| | | break; |
| | | case 6: |
| | | courWeeks.append("周六、"); |
| | | break; |
| | | case 7: |
| | | courWeeks.append("周末、"); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | if (courWeeks.length() > 0 && courWeeks.charAt(courWeeks.length() - 1) == ','){ |
| | | courWeeks.deleteCharAt(courWeeks.length() - 1); |
| | | } |
| | | courseVo.setCourseWeek(courWeeks.toString()); |
| | | } |
| | | |
| | | courseVo.setCourseTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | // TODO: 2023/6/30 查询会员折扣数据 |
| | | String payType = tCoursePackagePayment.getPayType(); |
| | | BigDecimal cashPayment = tCoursePackagePayment.getCashPayment(); |
| | | double cashPaymentValue = cashPayment.doubleValue(); |
| | | Integer playPaiCoin = tCoursePackagePayment.getPlayPaiCoin(); |
| | | switch (payType) { |
| | | case "1;2": |
| | | courseVo.setAmount(cashPaymentValue); |
| | | courseVo.setWpGold(playPaiCoin); |
| | | break; |
| | | case "1": |
| | | courseVo.setAmount(cashPaymentValue); |
| | | break; |
| | | case "2": |
| | | courseVo.setWpGold(playPaiCoin); |
| | | break; |
| | | } |
| | | |
| | | courseVo.setStoreId(coursePackage.getStoreId()); |
| | | } |
| | | |
| | | return courseVo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class CourseRecordController { |
| | | |
| | | |
| | | @Autowired |
| | | private CoursePackageStudentService cosService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageService tcpService; |
| | | |
| | | @Autowired |
| | | private CancelledClassesService caccService; |
| | | |
| | | |
| | | |
| | | @PostMapping("/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestBody Integer courseId,@RequestBody Integer stuId,@RequestBody Integer appUserId){ |
| | | Integer sult = 0; |
| | | TCoursePackage coursePackage = tcpService.getById(courseId); |
| | | if (null != coursePackage && coursePackage.getStatus() == 3){ |
| | | List<CoursePackageStudent> coursePackageStudents = cosService.queryStuDeduClassHourNums(courseId, stuId, appUserId); |
| | | if (coursePackageStudents.size() > 0){ |
| | | List<CancelledClasses> list = caccService.list(new QueryWrapper<CancelledClasses>() |
| | | .eq("coursePackageId",courseId )); |
| | | if (list.size() > 0){ |
| | | for (CancelledClasses cancelledClasses : list) { |
| | | sult = sult + cancelledClasses.getCancelledClassesNumber(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return sult; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_cancelled_classes") |
| | | public class CancelledClasses extends Model<CancelledClasses> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 消课凭证 |
| | | */ |
| | | private String voucher; |
| | | /** |
| | | * 消课数量 |
| | | */ |
| | | private Integer cancelledClassesNumber; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员上课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_course_package_student") |
| | | public class CoursePackageStudent extends Model<CoursePackageStudent> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private Integer appUserId; |
| | | /** |
| | | * 学员id |
| | | */ |
| | | private Integer studentId; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 课包购买记录id |
| | | */ |
| | | private Integer coursePackagePaymentId; |
| | | /** |
| | | * 到课状态(0=否,1=是) |
| | | */ |
| | | private Integer signInOrNot; |
| | | /** |
| | | * 预约状态(0=取消,1=预约) |
| | | */ |
| | | private Integer reservationStatus; |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课程 |
| | |
| | | package com.dsh.course.entity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 有效天数 |
| | | */ |
| | |
| | | /** |
| | | * 支付方式(1=现金,2=玩湃币) |
| | | */ |
| | | private Integer payType; |
| | | private String payType; |
| | | /** |
| | | * 课时数 |
| | | */ |
New file |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CancelListClient { |
| | | |
| | | @PostMapping("/cancelSource/cancelList") |
| | | public List<PurchaseRecordVo> getCancelCourseList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.ExerciseVideo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface CourseListClient { |
| | | |
| | | @PostMapping("/course/queryList") |
| | | List<ExerciseVideo> queryStuCourseAfterVideos(List<Integer> courseIds); |
| | | List<ExerciseVideo> queryStuCourseAfterVideos(@RequestBody List<Integer> courseIds); |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @PostMapping("/coursePack/storeOfCourse") |
| | | List<CourseOfStoreVo> getStoreOfCourses(); |
| | | |
| | | @PostMapping("/coursePack/stuOfCourses") |
| | | StuWithCoursesListVo getStuOfCoursesDetails(@RequestBody Integer stuId,@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePack/continuingCourse") |
| | | StudentOfCourseVo getStudentCourse(@RequestBody Integer courseId, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseRecordClient { |
| | | |
| | | @PostMapping("/courseRecord/queryDeduClassHours") |
| | | public Integer getDeductionClassHour(@RequestBody Integer courseId, @RequestBody Integer stuId, @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient; |
| | | |
| | | |
| | | import com.dsh.course.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.course.feignclient.model.StuSessionDetailsVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-course") |
| | | public interface CourseSessionNameClient { |
| | | |
| | | |
| | | @PostMapping("/coursePack/sessionNames") |
| | | List<StuSessionDetailsVo> getStuSessionList(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | |
| | | @PostMapping("/coursePack/paymentCourse") |
| | | public List<PurchaseRecordVo> queryCourseDetails(@RequestBody Date startTime, |
| | | @RequestBody Date endTime, |
| | | @RequestBody Integer stuId, |
| | | @RequestBody Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CourseHoursType { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer courseConfigId; |
| | | |
| | | @ApiModelProperty(value = "课时数") |
| | | private Integer courseHourNums; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 类型实体类: |
| | | * 类型:购买课包、消课、报名赛事、介绍有礼 |
| | | */ |
| | | |
| | | @Data |
| | | public class PurchaseRecordVo { |
| | | |
| | | @ApiModelProperty(value = "类型名称") |
| | | private String purchaseType; |
| | | |
| | | @ApiModelProperty(value = "类型变动时间") |
| | | private String purchaseTime; |
| | | |
| | | @ApiModelProperty(value = "类型涉及金额") |
| | | private String purchaseAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StuSessionDetailsVo { |
| | | |
| | | @ApiModelProperty(value = "课时id") |
| | | private Integer sessionid; |
| | | |
| | | @ApiModelProperty(value = "课时名称") |
| | | private String sessionName; |
| | | |
| | | @ApiModelProperty(value = "课时有效期") |
| | | private String periodOfValidity; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class StuWithCoursesListVo { |
| | | |
| | | @ApiModelProperty(value = "总学时数") |
| | | private Integer totalNums; |
| | | |
| | | @ApiModelProperty(value = "已扣学时数") |
| | | private Integer deductedNums; |
| | | |
| | | @ApiModelProperty(value = "剩余学时数") |
| | | private Integer remainingNums; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StudentOfCourseVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer coursePackageId; |
| | | |
| | | @ApiModelProperty(value = "课包封面图") |
| | | private String packageImg; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | | |
| | | @ApiModelProperty(value = "授课老师/教练") |
| | | private Integer coachId; |
| | | |
| | | @ApiModelProperty(value = "上课周 例如:每周二") |
| | | private String courseWeek; |
| | | |
| | | @ApiModelProperty(value = "上课时间:例如 14:00-16:00") |
| | | private String courseTime; |
| | | |
| | | @ApiModelProperty(value = "课时列表: 50 70 90") |
| | | private List<CourseHoursType> typeList; |
| | | |
| | | @ApiModelProperty(value = "支付价格") |
| | | private double amount; |
| | | |
| | | @ApiModelProperty(value = "会员价") |
| | | private double vipAmount; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer wpGold; |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CancelledClassesMapper extends BaseMapper<CancelledClasses> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员上课记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | public interface CoursePackageStudentMapper extends BaseMapper<CoursePackageStudent> { |
| | | |
| | | List<CoursePackageStudent> queryStuDeduClassHourNums(@Param("courseId") Integer courseId, |
| | | @Param("stuId") Integer stuId, |
| | | @Param("appUserId") Integer appUserId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TCoursePackagePaymentMapper extends BaseMapper<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(@Param("stuId") Integer stuId); |
| | | List<TCoursePackagePayment> queryAllCoursePackage(@Param("startTime")Date startTime, |
| | | @Param("endTime")Date endTime , |
| | | @Param("coursePackId") Integer coursePackId, |
| | | @Param("stuId") Integer stuId, |
| | | @Param("appUserId") Integer appUserId); |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | public interface CancelledClassesService extends IService<CancelledClasses> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员上课记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | public interface CoursePackageStudentService extends IService<CoursePackageStudent> { |
| | | |
| | | List<CoursePackageStudent> queryStuDeduClassHourNums(Integer courseId, Integer stuId, Integer appUserId); |
| | | |
| | | } |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface TCoursePackagePaymentService extends IService<TCoursePackagePayment> { |
| | | |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Integer stuId); |
| | | List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime ,Integer lessionId,Integer stuId, Integer appUserId); |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.mapper.CancelledClassesMapper; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包消课记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-29 |
| | | */ |
| | | @Service |
| | | public class CancelledClassesServiceImpl extends ServiceImpl<CancelledClassesMapper, CancelledClasses> implements CancelledClassesService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 学员上课记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | @Service |
| | | public class CoursePackageStudentServiceImpl extends ServiceImpl<CoursePackageStudentMapper, CoursePackageStudent> implements CoursePackageStudentService { |
| | | |
| | | @Override |
| | | public List<CoursePackageStudent> queryStuDeduClassHourNums(Integer courseId, Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryStuDeduClassHourNums(courseId,stuId,appUserId); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class TCoursePackagePaymentServiceImpl extends ServiceImpl<TCoursePackagePaymentMapper, TCoursePackagePayment> implements TCoursePackagePaymentService { |
| | | |
| | | @Override |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Integer stuId) { |
| | | return this.baseMapper.queryAllCoursePackage(stuId); |
| | | public List<TCoursePackagePayment> queryAllCoursePackage(Date startTime, Date endTime , Integer coursePackId, Integer stuId, Integer appUserId) { |
| | | return this.baseMapper.queryAllCoursePackage(startTime,endTime,coursePackId,stuId,appUserId); |
| | | } |
| | | |
| | | /** |
| | |
| | | return dateStr; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 得到n天之后的日期 |
| | | */ |
| | | public static String getAfterDayDate2(Date date,String days) { |
| | | int daysInt = Integer.parseInt(days); |
| | | |
| | | Calendar canlendar = Calendar.getInstance(); // java.util包 |
| | | canlendar.setTime(date); |
| | | canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动 |
| | | Date afterDate = canlendar.getTime(); |
| | | |
| | | SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String dateStr = sdfd.format(afterDate); |
| | | |
| | | return dateStr; |
| | | } |
| | | |
| | | /** |
| | | * 得到n天之后是周几 |
| | | */ |
| | |
| | | return sBuilder.toString(); |
| | | } |
| | | |
| | | public static List<Integer> dealStrToList(String str){ |
| | | List<Integer> list = new ArrayList<>(); |
| | | if (null == str || str == "" || str.isEmpty()){ |
| | | return list; |
| | | } |
| | | String[] strArray = str.split(";"); |
| | | for (String numStr : strArray) { |
| | | int num = Integer.parseInt(numStr); |
| | | list.add(num); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
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.CancelledClassesMapper"> |
| | | |
| | | </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.CoursePackageStudentMapper"> |
| | | |
| | | |
| | | <select id="queryStuDeduClassHourNums" resultType="com.dsh.course.entity.CoursePackageStudent"> |
| | | SELECT * |
| | | FROM t_course_package_student |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_student1 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_student2 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_student3 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_student4 |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_student5 |
| | | WHERE signInOrNot = 1 |
| | | <if test="courseId != null"> |
| | | and coursePackageId = #{courseId} |
| | | </if> |
| | | <if test="stuId != null "> |
| | | and studentId = #{stuId} |
| | | </if> |
| | | <if test="appUserId != null"> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | UNION ALL |
| | | SELECT * |
| | | FROM t_course_package_payment5 |
| | | WHERE user_id = #{stuId} |
| | | WHERE 1=1 |
| | | <if test=" stuId != null"> |
| | | and studentId = #{stuId} |
| | | </if> |
| | | <if test="appUserId != null"> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | <if test="startTime != null and endTime != null"> |
| | | and (insertTime between #{startTime} and #{endTime}) |
| | | </if> |
| | | <if test="coursePackId != null "> |
| | | and coursePackageId = #{coursePackId} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | |
| | | <version>1.5.22</version> |
| | | </dependency> |
| | | |
| | | <!-- http--> |
| | | <dependency> |
| | | <groupId>org.apache.httpcomponents</groupId> |
| | | <artifactId>httpclient</artifactId> |
| | | <version>4.5.13</version> |
| | | </dependency> |
| | | |
| | | <!-- mybatis generertor--> |
| | | |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.FrequentlyAskedQuestions; |
| | | import com.dsh.other.model.vo.questionVo.QuestionDetailsVo; |
| | | import com.dsh.other.model.vo.questionVo.QuestionIns; |
| | | import com.dsh.other.service.FrequentlyAskedQuestionsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class AskedQuestionsController { |
| | | |
| | | |
| | | @Autowired |
| | | private FrequentlyAskedQuestionsService faqService; |
| | | |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryQuestionDetails") |
| | | public QuestionDetailsVo getSysQuestionDetails(){ |
| | | QuestionDetailsVo notices = new QuestionDetailsVo(); |
| | | List<QuestionIns> sysS = new ArrayList<>(); |
| | | List<FrequentlyAskedQuestions> list = faqService.list(new QueryWrapper<FrequentlyAskedQuestions>() |
| | | .eq("state", 1) |
| | | .orderByDesc("insertTime")); |
| | | if (list.size() > 0 ){ |
| | | list.forEach(noList -> { |
| | | QuestionIns notice = new QuestionIns(); |
| | | notice.setQuesId(noList.getId()); |
| | | notice.setQuesTitle(noList.getContent()); |
| | | notice.setQuesContents(noList.getAnswer()); |
| | | sysS.add(notice); |
| | | }); |
| | | notices.setSysS(sysS); |
| | | } |
| | | return notices; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryQuestion") |
| | | public QuestionIns getSysQuestionBuId(@RequestBody Integer quesId){ |
| | | QuestionIns sysNotice = new QuestionIns(); |
| | | FrequentlyAskedQuestions notice = faqService.getById(quesId); |
| | | if (null != notice){ |
| | | sysNotice.setQuesId(notice.getId()); |
| | | sysNotice.setQuesTitle(notice.getContent()); |
| | | sysNotice.setQuesContents(notice.getAnswer()); |
| | | sysNotice.setQuesTime(format.format(notice.getInsertTime())); |
| | | } |
| | | return sysNotice; |
| | | } |
| | | } |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import com.dsh.other.feignclient.model.StoreInfo; |
| | | import com.dsh.other.feignclient.model.StoreLonLatList; |
| | | import com.dsh.other.model.BaseVo; |
| | | import com.dsh.other.service.StoreService; |
| | | import com.dsh.other.util.GDMapGeocodingUtil; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import com.dsh.other.util.ToolUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 15:42 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("") |
| | | @RequestMapping("/base/protocol") |
| | | public class StoreController { |
| | | |
| | | @Autowired |
| | | private StoreService storeService; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId){ |
| | | StoreDetailOfCourse ofCourse = new StoreDetailOfCourse(); |
| | | Store store = stoService.getById(storeId); |
| | | if (null != store){ |
| | | ofCourse.setStoreName(store.getName()); |
| | | ofCourse.setStoreAddr(store.getAddress()); |
| | | } |
| | | return ofCourse; |
| | | } |
| | | |
| | | @PostMapping("/storeDetail/nearbyStore") |
| | | public List<StoreInfo> getAllNearbyStoreList(@RequestBody String longitude,@RequestBody String latitude){ |
| | | String current = longitude+","+latitude; |
| | | List<StoreInfo> storeInfos = new ArrayList<>(); |
| | | String cityCode = ""; |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(longitude, latitude); |
| | | cityCode = geocode.get("cityCode"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | List<Store> storeList = stoService.list(new QueryWrapper<Store>() |
| | | .eq("state", 1) |
| | | .eq("cityCode",cityCode)); |
| | | if (storeList.size() > 0){ |
| | | for (Store store : storeList) { |
| | | String storeLon = store.getLon(); |
| | | String storeLat = store.getLat(); |
| | | String result = storeLon+","+storeLat; |
| | | String distanceTOKilometer = gdMapGeocodingUtil.getDistanceTOKilometer(current, result); |
| | | StoreInfo info = new StoreInfo(); |
| | | info.setStoreId(store.getId()); |
| | | info.setStoreName(store.getName()); |
| | | info.setStoreImg(store.getRealPicture()); |
| | | info.setDistance(Long.parseLong(distanceTOKilometer)); |
| | | info.setStoreAddr(store.getAddress()); |
| | | storeInfos.add(info); |
| | | } |
| | | Comparator<StoreInfo> distanceComparator = new Comparator<StoreInfo>() { |
| | | @Override |
| | | public int compare(StoreInfo store1, StoreInfo store2) { |
| | | return Long.compare(store1.getDistance(), store2.getDistance()); |
| | | } |
| | | }; |
| | | Collections.sort(storeInfos, distanceComparator); |
| | | } |
| | | return storeInfos; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/storeDetail/storeOfLonLat") |
| | | public List<StoreLonLatList> getAllStoreLonLats(@RequestBody String longitude, @RequestBody String latitude){ |
| | | List<StoreLonLatList> storeInfos = new ArrayList<>(); |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(longitude, latitude); |
| | | String cityCode = geocode.get("cityCode"); |
| | | List<Store> storeList = stoService.list(new QueryWrapper<Store>() |
| | | .eq("cityCode",cityCode)); |
| | | if (storeList.size() > 0){ |
| | | for (Store store : storeList) { |
| | | StoreLonLatList latList = new StoreLonLatList(); |
| | | latList.setStoreId(store.getId()); |
| | | latList.setLongitude(store.getLon()); |
| | | latList.setLatitude(store.getLat()); |
| | | storeInfos.add(latList); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return storeInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/store/queryStoreList") |
| | | public List<Store> queryStoreList(@RequestBody String provinceCode, @RequestBody String cityCode){ |
| | | try { |
| | | return storeService.queryStorsList(provinceCode, cityCode); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/store/queryStoreLists") |
| | | @ApiOperation(value = "获取门店列表", tags = {"APP-加入玩湃"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "经纬", name = "lon", dataType = "string", required = true), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", dataType = "string", required = true), |
| | | }) |
| | | public ResultUtil<List<BaseVo>> queryStoreLists(@RequestBody String lon, @RequestBody String lat){ |
| | | if(ToolUtil.isEmpty(lon)){ |
| | | return ResultUtil.paranErr("lon"); |
| | | } |
| | | if(ToolUtil.isEmpty(lat)){ |
| | | return ResultUtil.paranErr("lat"); |
| | | } |
| | | try { |
| | | List<BaseVo> baseVos = storeService.queryStoreLists(lon, lat); |
| | | return ResultUtil.success(baseVos); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据门店模糊搜索店铺 |
| | | * @param name |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/store/queryStoreListByName") |
| | | public List<Store> queryStoreListByName(@RequestBody String name){ |
| | | try { |
| | | List<Store> stores = storeService.list(new QueryWrapper<Store>().eq("state", 1).like("name", name)); |
| | | return stores; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据门店 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/store/queryStoreById") |
| | | public Store queryStoreById(@RequestBody Integer id){ |
| | | try { |
| | | return storeService.getById(id); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | | * @param provinceCode |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Notice; |
| | | import com.dsh.other.entity.Phone; |
| | | import com.dsh.other.feignclient.model.SysNotice; |
| | | import com.dsh.other.service.NoticeService; |
| | | import com.dsh.other.service.PhoneService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("") |
| | | public class SystemNoticeController { |
| | | |
| | | @Autowired |
| | | private NoticeService noticeSers; |
| | | |
| | | @Autowired |
| | | private PhoneService phoneService; |
| | | |
| | | private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryNoticeDetails") |
| | | public List<SysNotice> getSysNoticeDetails(){ |
| | | List<SysNotice> notices = new ArrayList<>(); |
| | | List<Notice> list = noticeSers.list(new QueryWrapper<Notice>() |
| | | .eq("state", 1) |
| | | .eq("upOrDown", 1) |
| | | .orderByDesc("insertTime")); |
| | | if (list.size() > 0 ){ |
| | | list.forEach(noList -> { |
| | | SysNotice notice = new SysNotice(); |
| | | notice.setNoticeId(noList.getId()); |
| | | notice.setNoticeTitle(noList.getName()); |
| | | notice.setNoticeContents(noList.getContent()); |
| | | notice.setNoticeTime(format.format(noList.getInsertTime())); |
| | | notices.add(notice); |
| | | }); |
| | | } |
| | | return notices; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryNotice") |
| | | public SysNotice getSysNoticeBuId(@RequestBody Integer noticeId){ |
| | | SysNotice sysNotice = new SysNotice(); |
| | | Notice notice = noticeSers.getById(noticeId); |
| | | if (null != notice){ |
| | | sysNotice.setNoticeId(notice.getId()); |
| | | sysNotice.setNoticeTitle(notice.getName()); |
| | | sysNotice.setNoticeContents(notice.getContent()); |
| | | sysNotice.setNoticeTime(format.format(notice.getInsertTime())); |
| | | } |
| | | return sysNotice; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/notice/sysTell") |
| | | public List<String> queryCustomerTel(){ |
| | | List<String> tellS = new ArrayList<>(); |
| | | List<Phone> list = phoneService.list(); |
| | | if (list.size() > 0 ){ |
| | | tellS = list.stream().map(Phone::getPhone).collect(Collectors.toList()); |
| | | } |
| | | return tellS; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_frequently_asked_questions") |
| | | public class FrequentlyAskedQuestions extends Model<FrequentlyAskedQuestions> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 常见问题 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | /** |
| | | * 答复内容 |
| | | */ |
| | | private String answer; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 公告 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_notice") |
| | | public class Notice extends Model<Notice> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 功能名称 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 公告内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | /** |
| | | * 0下架1上架 |
| | | */ |
| | | private Integer upOrDown; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 客服电话 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_phone") |
| | | public class Phone extends Model<Phone> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | private Date insertTime; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface CustomerClient { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.feignclient.model.SysNotice; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface NoticeClient { |
| | | |
| | | |
| | | @PostMapping("/base/notice/queryNoticeDetails") |
| | | List<SysNotice> getSysNoticeDetails(); |
| | | |
| | | @PostMapping("/base/notice/queryNotice") |
| | | SysNotice getSysNoticeBuId(@RequestBody Integer noticeId); |
| | | |
| | | @PostMapping("/base/notice/sysTell") |
| | | List<String> queryCustomerTel(); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.model.vo.questionVo.QuestionDetailsVo; |
| | | import com.dsh.other.model.vo.questionVo.QuestionIns; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface QuestionClient { |
| | | |
| | | @PostMapping("/base/notice/queryQuestionDetails") |
| | | QuestionDetailsVo getSysQuestionDetails(); |
| | | |
| | | @PostMapping("/base/notice/queryQuestion") |
| | | QuestionIns getSysQuestionBuId(@RequestBody Integer quesId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.feignclient.model.StoreDetailOfCourse; |
| | | import com.dsh.other.feignclient.model.StoreInfo; |
| | | import com.dsh.other.feignclient.model.StoreLonLatList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient(value = "mb-cloud-other") |
| | | public interface StoreClient { |
| | | |
| | | |
| | | @PostMapping("/storeDetail/courseOfSto") |
| | | public StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId); |
| | | |
| | | |
| | | @PostMapping("/storeDetail/nearbyStore") |
| | | List<StoreInfo> getAllNearbyStoreList(@RequestBody String longitude, @RequestBody String latitude); |
| | | |
| | | |
| | | @PostMapping("/storeDetail/storeOfLonLat") |
| | | public List<StoreLonLatList> getAllStoreLonLats(@RequestBody String longitude, @RequestBody String latitude); |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreDetailOfCourse { |
| | | |
| | | String storeName; |
| | | |
| | | String storeAddr; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreInfo { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "门店背景图") |
| | | private String storeImg; |
| | | |
| | | @ApiModelProperty(value = "门店距离当前位置") |
| | | private long distance; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty(value = "门店详细地址") |
| | | private String storeAddr; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StoreLonLatList { |
| | | |
| | | @ApiModelProperty(value = "门店id") |
| | | Integer storeId; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | String longitude; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | String latitude; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SysNotice { |
| | | |
| | | @ApiModelProperty(value = "公告id") |
| | | private Integer noticeId; |
| | | |
| | | @ApiModelProperty(value = "公告标题") |
| | | private String noticeTitle; |
| | | |
| | | @ApiModelProperty(value = "公告内容") |
| | | private String noticeContents; |
| | | |
| | | @ApiModelProperty(value = "公告发布时间") |
| | | private String noticeTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.FrequentlyAskedQuestions; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface FrequentlyAskedQuestionsMapper extends BaseMapper<FrequentlyAskedQuestions> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.Notice; |
| | | |
| | | /** |
| | | * <p> |
| | | * 公告 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface NoticeMapper extends BaseMapper<Notice> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.Phone; |
| | | |
| | | /** |
| | | * <p> |
| | | * 客服电话 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface PhoneMapper extends BaseMapper<Phone> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model.vo.questionVo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QuestionDetailsVo { |
| | | |
| | | @ApiModelProperty(value = "banner图") |
| | | private String bannerImg; |
| | | |
| | | @ApiModelProperty(value = "问题列表") |
| | | private List<QuestionIns> sysS; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model.vo.questionVo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class QuestionIns { |
| | | |
| | | @ApiModelProperty(value = "问题id") |
| | | private Integer quesId; |
| | | |
| | | @ApiModelProperty(value = "问题标题") |
| | | private String quesTitle; |
| | | |
| | | @ApiModelProperty(value = "答复内容") |
| | | private String quesContents; |
| | | |
| | | @ApiModelProperty(value = "答复内容") |
| | | private String quesTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.FrequentlyAskedQuestions; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface FrequentlyAskedQuestionsService extends IService<FrequentlyAskedQuestions> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.Notice; |
| | | |
| | | /** |
| | | * <p> |
| | | * 公告 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface NoticeService extends IService<Notice> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.Phone; |
| | | |
| | | /** |
| | | * <p> |
| | | * 客服电话 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | public interface PhoneService extends IService<Phone> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.FrequentlyAskedQuestions; |
| | | import com.dsh.other.mapper.FrequentlyAskedQuestionsMapper; |
| | | import com.dsh.other.service.FrequentlyAskedQuestionsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Service |
| | | public class FrequentlyAskedQuestionsServiceImpl extends ServiceImpl<FrequentlyAskedQuestionsMapper, FrequentlyAskedQuestions> implements FrequentlyAskedQuestionsService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.Notice; |
| | | import com.dsh.other.mapper.NoticeMapper; |
| | | import com.dsh.other.service.NoticeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 公告 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Service |
| | | public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.Phone; |
| | | import com.dsh.other.mapper.PhoneMapper; |
| | | import com.dsh.other.service.PhoneService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 客服电话 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-03 |
| | | */ |
| | | @Service |
| | | public class PhoneServiceImpl extends ServiceImpl<PhoneMapper, Phone> implements PhoneService { |
| | | |
| | | } |
| | |
| | | import com.dsh.other.util.httpClinet.HttpResult; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | public class GDMapGeocodingUtil { |
| | | |
| | | private String key = "fb131ad2dbfb3f39d7d37d244b92aa2d"; |
| | | |
| | | |
| | | /** |
| | | * 将行政区域名称转化为坐标 |
| | |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 功能描述: 根据两个定位点的经纬度算出两点间的距离(米/m) |
| | | * |
| | | * @param startLonLat 起始经纬度 |
| | | * @param endLonLat 结束经纬度(目标经纬度) |
| | | * @return java.lang.Long 两个定位点之间的距离 |
| | | */ |
| | | public Long getDistance(String startLonLat, String endLonLat) { |
| | | try { |
| | | // 返回起始地startAddr与目的地endAddr之间的距离,单位:米 |
| | | Long result = new Long(0); |
| | | String queryUrl = |
| | | "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat |
| | | + "&destination=" |
| | | + endLonLat; |
| | | String queryResult = getResponse(queryUrl); |
| | | JSONObject job = JSONObject.parseObject(queryResult); |
| | | JSONArray ja = job.getJSONArray("results"); |
| | | JSONObject jobO = JSONObject.parseObject(ja.getString(0)); |
| | | result = Long.parseLong(jobO.get("distance").toString()); |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 功能描述: 根据两个定位点的经纬度算出两点间的距离(千米/km) |
| | | * |
| | | * @param startLonLat 起始经纬度 |
| | | * @param endLonLat 结束经纬度(目标经纬度) |
| | | * @return java.lang.Long 两个定位点之间的距离 |
| | | */ |
| | | public String getDistanceTOKilometer(String startLonLat, String endLonLat) { |
| | | try { |
| | | // 返回起始地startAddr与目的地endAddr之间的距离,单位:米 |
| | | Long result = new Long(0); |
| | | String queryUrl = |
| | | "http://restapi.amap.com/v3/distance?key=" + key + "&origins=" + startLonLat |
| | | + "&destination=" |
| | | + endLonLat; |
| | | String queryResult = getResponse(queryUrl); |
| | | JSONObject job = JSONObject.parseObject(queryResult); |
| | | JSONArray ja = job.getJSONArray("results"); |
| | | JSONObject jobO = JSONObject.parseObject(ja.getString(0)); |
| | | result = Long.parseLong(jobO.get("distance").toString()); |
| | | double kilDis = (double) result / 1000; |
| | | DecimalFormat decimalFormat = new DecimalFormat("#.00"); |
| | | return decimalFormat.format(kilDis); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 功能描述: 发送请求 |
| | | * |
| | | * @param serverUrl 请求地址 |
| | | * @return java.lang.String |
| | | * @author isymikasan |
| | | * @date 2022-01-26 09:15:01 |
| | | */ |
| | | private static String getResponse(String serverUrl) { |
| | | // 用JAVA发起http请求,并返回json格式的结果 |
| | | StringBuffer result = new StringBuffer(); |
| | | try { |
| | | URL url = new URL(serverUrl); |
| | | URLConnection conn = url.openConnection(); |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); |
| | | String line; |
| | | while ((line = in.readLine()) != null) { |
| | | result.append(line); |
| | | } |
| | | in.close(); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.util; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.ssl.SSLContexts; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.Charset; |
| | | import java.security.KeyStore; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * http工具类 |
| | | */ |
| | | @Component |
| | | public class HttpClientUtil { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(HttpClientUtil.class); |
| | | |
| | | private PoolingHttpClientConnectionManager connectionManager; |
| | | |
| | | |
| | | public HttpClientUtil(){ |
| | | //1.创建连接池管理器 |
| | | connectionManager = new PoolingHttpClientConnectionManager(60000, |
| | | TimeUnit.MILLISECONDS); |
| | | connectionManager.setMaxTotal(1000); |
| | | connectionManager.setDefaultMaxPerRoute(50); |
| | | } |
| | | |
| | | /** |
| | | * 创建一个httpClient对象 |
| | | */ |
| | | private CloseableHttpClient getHttpCline(){ |
| | | return HttpClients.custom() |
| | | .setConnectionManager(connectionManager) |
| | | .disableAutomaticRetries() |
| | | .build(); |
| | | } |
| | | |
| | | private RequestConfig getRequestConfig(){ |
| | | RequestConfig.Builder builder = RequestConfig.custom(); |
| | | builder.setSocketTimeout(60000)//3.1设置客户端等待服务端返回数据的超时时间 |
| | | .setConnectTimeout(30000)//3.2设置客户端发起TCP连接请求的超时时间 |
| | | .setExpectContinueEnabled(true) |
| | | .setConnectionRequestTimeout(30000);//3.3设置客户端从连接池获取链接的超时时间 |
| | | return builder.build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | | private CloseableHttpResponse setPostHttpRequset(String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setConfig(this.getRequestConfig()); |
| | | if(null != header){ |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | } |
| | | List<NameValuePair> list = new ArrayList<>(); |
| | | if(null != params){ |
| | | Set<String> keys = params.keySet(); |
| | | for(String key : keys){ |
| | | list.add(new BasicNameValuePair(key, null == params.get(key) ? null : params.get(key).toString())); |
| | | } |
| | | } |
| | | switch (contentType){ |
| | | case "form": |
| | | httpPost.setEntity(new UrlEncodedFormEntity(list, "UTF-8")); |
| | | break; |
| | | case "json": |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String s =objectMapper.writeValueAsString(params); |
| | | httpPost.setEntity(new StringEntity(s, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), Charset.forName("UTF-8")))); |
| | | break; |
| | | } |
| | | return getHttpCline().execute(httpPost); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | | private CloseableHttpResponse setGetHttpRequset(String url, Map<String, Object> params, Map<String, String> header) throws Exception{ |
| | | StringBuffer sb = new StringBuffer(); |
| | | String p = ""; |
| | | if(null != params){ |
| | | Set<String> keys = params.keySet(); |
| | | for(String key : keys){ |
| | | sb.append(key + "=" + params.get(key) + "&"); |
| | | } |
| | | p = "?" + sb.substring(0, sb.length() - 1); |
| | | } |
| | | HttpGet httpGet = new HttpGet(url + p); |
| | | httpGet.setConfig(getRequestConfig()); |
| | | if(null != header){ |
| | | for(String key : header.keySet()){ |
| | | httpGet.setHeader(key, header.get(key)); |
| | | } |
| | | } |
| | | return getHttpCline().execute(httpGet); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | * @param header 请求头 |
| | | * @param contentType 参数请求方式form/json |
| | | * @return |
| | | */ |
| | | public HttpResult pushHttpRequset(String mothed, String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{ |
| | | String randome = UUID.randomUUID().toString(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); |
| | | logger.info(sdf.format(new Date()) + "----(" + randome + ")请求参数:" + JSON.toJSONString(params)); |
| | | CloseableHttpResponse httpResponse = null; |
| | | switch (mothed){ |
| | | case "GET": |
| | | httpResponse = this.setGetHttpRequset(url, params, header); |
| | | break; |
| | | case "POST": |
| | | httpResponse = setPostHttpRequset(url, params, header, contentType); |
| | | break; |
| | | } |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | logger.info(sdf.format(new Date()) + "----(" + randome + ")返回结果:" + content); |
| | | HttpResult httpResult = HttpResult.getHttpResult(statusCode, content); |
| | | this.close(httpResponse); |
| | | return httpResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | | * @return |
| | | */ |
| | | public HttpResult pushHttpRequsetXml(String url, String xml, Map<String, String> header) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setConfig(getRequestConfig()); |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | httpPost.setHeader("Content-Type", "application/xml"); |
| | | httpPost.setEntity(new StringEntity(xml, "UTF-8")); |
| | | CloseableHttpResponse httpResponse = getHttpCline().execute(httpPost); |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | HttpResult httpResult = HttpResult.getHttpResult(statusCode, content); |
| | | this.close(httpResponse); |
| | | return httpResult; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | | * @param certPassword 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public String pushHttpsRequsetXml(String url, String xml, Map<String, String> header, String certPassword, String certPath, String certType) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | httpPost.setHeader("Content-Type", "application/xml"); |
| | | httpPost.setEntity(new StringEntity(xml, "UTF-8")); |
| | | CloseableHttpClient httpCline = this.initCert(certPassword, certPath, certType); |
| | | CloseableHttpResponse httpResponse = httpCline.execute(httpPost); |
| | | String content = null; |
| | | if(httpResponse.getStatusLine().getStatusCode() == 200){ |
| | | content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | }else{ |
| | | content = "返回状态码:" + httpResponse.getStatusLine() + "。" + EntityUtils.toString(httpResponse.getEntity()); |
| | | } |
| | | this.close(httpResponse); |
| | | httpCline.close(); |
| | | return content; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | | * @throws Exception |
| | | */ |
| | | private CloseableHttpClient initCert(String key, String certPath, String certType) throws Exception { |
| | | KeyStore keyStore = KeyStore.getInstance(certType); |
| | | InputStream inputStream = new FileInputStream(new File(certPath)); |
| | | try { |
| | | keyStore.load(inputStream, key.toCharArray()); |
| | | } finally { |
| | | inputStream.close(); |
| | | } |
| | | SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, key.toCharArray()).build(); |
| | | SSLConnectionSocketFactory sslsf = |
| | | new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1"}, null, |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭资源 |
| | | */ |
| | | private void close(CloseableHttpResponse httpResponse){ |
| | | try { |
| | | if(null != httpResponse){ |
| | | EntityUtils.consume(httpResponse.getEntity());//此处高能,通过源码分析,由EntityUtils是否回收HttpEntity |
| | | httpResponse.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | try { |
| | | if(null != httpResponse){ |
| | | httpResponse.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.util; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * http请求返回封装 |
| | | */ |
| | | @Data |
| | | public class HttpResult { |
| | | /** |
| | | * 返回状态码 |
| | | */ |
| | | private Integer code; |
| | | /** |
| | | * 返回结果 |
| | | */ |
| | | private String data; |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static HttpResult getHttpResult(Integer code, String data){ |
| | | HttpResult httpResult = new HttpResult(); |
| | | httpResult.setCode(code); |
| | | httpResult.setData(data); |
| | | return httpResult; |
| | | } |
| | | } |
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.other.mapper.FrequentlyAskedQuestionsMapper"> |
| | | |
| | | |
| | | </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.other.mapper.NoticeMapper"> |
| | | |
| | | </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.other.mapper.PhoneMapper"> |
| | | |
| | | |
| | | </mapper> |