| | |
| | | import com.dsh.account.dto.BindDto; |
| | | import com.dsh.account.dto.SelectDto; |
| | | import com.dsh.account.dto.UpdateInfoDto; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.TCourseInfoRecord; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.entity.*; |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.model.query.appUserQuery.QueryAppUser; |
| | | import com.dsh.account.model.vo.QueryAppUserVO; |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TCourseInfoRecordService; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | import com.dsh.account.service.*; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TStudentService studentService; |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/logOff") |
| | | @ApiOperation(value = "注销", tags = {"注销"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "账号id", name = "appId", dataType = "int", required = true) |
| | | }) |
| | | public ResultUtil<String> logOff(Integer appId){ |
| | | try { |
| | | |
| | | appUserService.removeById(appId); |
| | | studentService.remove(new QueryWrapper<TStudent>().eq("appUserId",appId)); |
| | | |
| | | return ResultUtil.success("注销成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/addAppUser") |
| | | @ApiOperation(value = "注册用户", tags = {"APP-登录注册"}) |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(){ |
| | | public ResultUtil<ClassInfoVo> queryCouponRecord(Integer stuId){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tappuService.queryUserOfStus(userIdFormRedis)); |
| | | return ResultUtil.success(tappuService.queryUserOfStus(stuId,userIdFormRedis)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | vo.setBmi(tStudent.getBmi()); |
| | | vo.setBodyStatus(BMIBodyUtil.getBodyStatus(tStudent.getBmi())); |
| | | vo.setUrl(tStudent.getLateralSurface()); |
| | | if (tStudent.getLateralSurface()!=null) { |
| | | String[] split = tStudent.getLateralSurface().split(";"); |
| | | vo.setUrls(split); |
| | | } |
| | | vo.setHeight(tStudent.getHeight()); |
| | | vo.setWeight(tStudent.getWeight()); |
| | | } |
| | |
| | | } |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | Double height = stu.getHeight(); |
| | | Double squareHeight = Math.pow(height/100, 2); |
| | | Double weight = stu.getWeight(); |
| | | |
| | | Double bim = weight/squareHeight; |
| | | |
| | | TStudent tStudent = new TStudent(); |
| | | tStudent.setId(stu.getStuId()); |
| | | tStudent.setBirthday(format.parse(stu.getBirthday())); |
| | |
| | | tStudent.setSex(stu.getSex()); |
| | | tStudent.setName(stu.getName()); |
| | | tStudent.setIdCard(stu.getIdCard()); |
| | | tStudent.setBmi(bim); |
| | | return ResultUtil.success(istuService.updateById(tStudent)); |
| | | |
| | | // return ResultUtil.success(istuService.commitEditStudentInfo(stu,userIdFormRedis)); |
| | |
| | | @ApiImplicitParam(value = "搜索", name = "search", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil<List<StoreDetailList>> getStoreListCon(Integer space,String cityCode,String latitude,String longitude,String search){ |
| | | try { |
| | | return ResultUtil.success(tsService.queryStoreList(space,cityCode,latitude,longitude,search)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | // try { |
| | | return ResultUtil.success(tsService.queryStoreList(space,cityCode,"104.05349525280955","30.588087670753833",search)); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryById") |
| | | public TStudent queryById(@RequestBody Integer id) { |
| | | return studentService.getById(id); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/updateTStudent") |
| | | public void updateTStudent(@RequestBody TStudent student){ |
| | | try { |
| | |
| | | @ApiImplicitParam(value = "记录id", name = "detailsId", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil<PointDetailsVo> redemptionDetails(Long detailsId){ |
| | | try { |
| | | // try { |
| | | PointDetailsVo pointDetailsVo = uicService.queryRedemptionDetails(detailsId); |
| | | pointDetailsVo.getPics().remove(0); |
| | | return ResultUtil.success(pointDetailsVo); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") |
| | | Date insertTime; |
| | | @TableField("appUserId") |
| | | Integer appUserId; |
| | |
| | | * 核销时间 |
| | | */ |
| | | @TableField("verificationTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verificationTime; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | |
| | | List<TCoursePackagePayment> getCoursePackagePaymentOfCode(@RequestBody String code); |
| | | |
| | | @PostMapping("/base/coursePack/sendHours") |
| | | Integer sendHours(String s); |
| | | Integer sendHours(@RequestBody String s); |
| | | |
| | | @PostMapping("/base/coursePack/getClassHour") |
| | | Integer getClassHour(Integer courseConfigId); |
| | |
| | | |
| | | @ApiModelProperty(value = "课时有效期") |
| | | private String periodOfValidity; |
| | | @ApiModelProperty(value = "是否过滤分配课时") |
| | | private Integer isAble; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "课时有效期") |
| | | private String periodOfValidity; |
| | | @ApiModelProperty(value = "课程类型") |
| | | private Integer courseType; |
| | | @ApiModelProperty(value = "是否过滤分配课时 1过滤,0不过滤") |
| | | private Integer isAble; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StuPhysicalVo { |
| | | @ApiModelProperty(value = "身高") |
| | |
| | | private Double bmi; |
| | | @ApiModelProperty(value = "身体状态") |
| | | private String bodyStatus; |
| | | @ApiModelProperty(value = "图片链接") |
| | | private String url; |
| | | // @ApiModelProperty(value = "图片链接") |
| | | // private String url; |
| | | |
| | | @ApiModelProperty(value = "图片") |
| | | private String[] urls; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 17:34 |
| | |
| | | private Integer applicantsNumber; |
| | | |
| | | @ApiModelProperty("包含课时数") |
| | | private Integer classHours; |
| | | private List<Integer> classHours; |
| | | |
| | | @ApiModelProperty("价格") |
| | | private Double originalPrice; |
| | | @ApiModelProperty("玩湃币价格") |
| | | private Integer coin; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "1日卡 2月卡 3季卡 4年卡") |
| | | private Integer cardType; |
| | | |
| | | @ApiModelProperty(value = "使用范围") |
| | | private Integer exchangeAddrType; |
| | | } |
| | |
| | | */ |
| | | public interface TAppUserService extends IService<TAppUser> { |
| | | |
| | | ClassInfoVo queryUserOfStus(Integer id); |
| | | ClassInfoVo queryUserOfStus(Integer id,Integer uid); |
| | | |
| | | |
| | | /** |
| | |
| | | if (rechargeRecords.size() > 0) { |
| | | for (RechargeRecords rechargeRecord : rechargeRecords) { |
| | | RechargesDetail consumeDetail = new RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.getMsg() + ":" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.getMsg() + ":¥" + rechargeRecord.getAmount()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+" + rechargeRecord.getAmount()); |
| | | consumeDetail.setConsumeAmount("+" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setRecordId(1); |
| | | details.add(consumeDetail); |
| | | } |
| | |
| | | return appUserMapper.groupCityInfo(dto); |
| | | } |
| | | @Override |
| | | public ClassInfoVo queryUserOfStus(Integer id) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(id); |
| | | public ClassInfoVo queryUserOfStus(Integer id,Integer uid) { |
| | | TAppUser tAppUser = this.baseMapper.selectById(uid); |
| | | ClassInfoVo classInfoVo = new ClassInfoVo(); |
| | | if (ToolUtil.isNotEmpty(tAppUser)){ |
| | | List<TStudent> tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | | // if (ToolUtil.isNotEmpty(tAppUser)){ |
| | | |
| | | // |
| | | |
| | | List<TStudent> tStudents = new ArrayList<>(); |
| | | if (id!=null) { |
| | | tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("id", id).eq("state", 1)); |
| | | |
| | | if (tStudents.size() == 0) { |
| | | tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("appUserId", tAppUser.getId()) |
| | | .eq("state", 1)); |
| | | } |
| | | }else { |
| | | tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("appUserId",tAppUser.getId()) |
| | | .eq("state",1) |
| | | .eq("isDefault",1)); |
| | | if (tStudents==null){ |
| | | tStudents = tsmapper.selectList(new QueryWrapper<TStudent>() |
| | | .eq("appUserId",tAppUser.getId()) |
| | | .eq("state",1)) |
| | | ; |
| | | } |
| | | } |
| | | if (tStudents.size() > 0 ){ |
| | | TStudent tStudent = tStudents.get(0); |
| | | classInfoVo.setStuId(tStudent.getId()); |
| | |
| | | course.setDeductedNums(ToolUtil.isEmpty(tCoursePackagePayment.getDeductionNums()) ? 0 : tCoursePackagePayment.getDeductionNums()); |
| | | course.setRemainingNums(ToolUtil.isEmpty(tCoursePackagePayment.getResidueNums())? 0 : tCoursePackagePayment.getResidueNums()); |
| | | course.setPeriodOfValidity(tCoursePackagePayment.getPeriodOfValidity()); |
| | | course.setIsAble(tCoursePackagePayment.getIsAble()); |
| | | courseList.add(course); |
| | | } |
| | | } |
| | | classInfoVo.setCourseList(courseList); |
| | | // List<ExerciseVideo> stuCourseOfVideoList = voclClient.getStuCourseOfVideoList(coursePackIds); |
| | | List<ExerciseVideo> query = voclClient.query(id); |
| | | System.out.println("======queryqueryqueryquery=================="+query); |
| | | classInfoVo.setExerciseVideoList(query); |
| | | List<ExerciseVideo> query = voclClient.query(tStudent.getId()); |
| | | classInfoVo.setExerciseVideoList(query); |
| | | |
| | | }else { |
| | | classInfoVo.setIsThere(2); |
| | | List<TImgConfig> tImgConfigs = configClient.getNoneStuImgs(); |
| | |
| | | classInfoVo.setImgs(tImgConfigs.get(0).getContent()); |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | return classInfoVo; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | // 3.课包购买 |
| | | BillingRequestVo amountPayRecord = paymentClient.getAmountPayRecord(requestVo); |
| | | if (ToolUtil.isNotEmpty(amountPayRecord.getRequests())){ |
| | | for (BillingRequest coursePackagePayment : amountPayRecord.getRequests()) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg()); |
| | | consumeDetail.setConsumeTime(coursePackagePayment.getTime()); |
| | | consumeDetail.setConsumeAmount("-" + coursePackagePayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // BillingRequestVo amountPayRecord = paymentClient.getAmountPayRecord(requestVo); |
| | | // if (ToolUtil.isNotEmpty(amountPayRecord.getRequests())){ |
| | | // for (BillingRequest coursePackagePayment : amountPayRecord.getRequests()) { |
| | | // ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | // consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg()); |
| | | // consumeDetail.setConsumeTime(coursePackagePayment.getTime()); |
| | | // consumeDetail.setConsumeAmount("-" + coursePackagePayment.getAmount()); |
| | | // consumeDetail.setType(2); |
| | | // details.add(consumeDetail); |
| | | // } |
| | | // } |
| | | |
| | | //2.0 |
| | | List<CourseCounsum> courseCounsums = paymentClient.getConsumes(requestVo); |
| | |
| | | consumeDetail2.setConsumeName(RechargeRecordEnum.VENUE_RESERVATION.getMsg()); |
| | | consumeDetail2.setConsumeAmount("-" + booking.getAmount()); |
| | | consumeDetail2.setConsumeTime(booking.getTime1()); |
| | | consumeDetail2.setType(1); |
| | | consumeDetail2.setType(2); |
| | | details.add(consumeDetail2); |
| | | |
| | | } |
| | |
| | | } |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(1); |
| | | commodity.setUseScope(vicinityGood.getUseScope()); |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | List<Integer> integers = mcsClient.queryPointMerStoreIds(vicinityGood.getId()); |
| | | commodity.setShopIds(integers); |
| | |
| | | } |
| | | commodity.setBelongsType(vicinityGood.getUserPopulation()); |
| | | commodity.setGoodsType(2); |
| | | commodity.setUseScope(vicinityGood.getUseScope()); |
| | | |
| | | commodity.setNums(mcClient.getRedeemedQuantity(vicinityGood.getId())); |
| | | commodity.setShopIds(mcsClient.queryPointMerStoreIds(vicinityGood.getId())); |
| | | break; |
| | |
| | | commodity.setGoodId(vicinityGood.getId()); |
| | | commodity.setGoodName(vicinityGood.getName()); |
| | | commodity.setGoodImg(vicinityGood.getCover()); |
| | | commodity.setUseScope(vicinityGood.getUseScope()); |
| | | |
| | | commodity.setCondition(vicinityGood.getRedemptionMethod()); |
| | | if (vicinityGood.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(vicinityGood.getIntegral().intValue()); |
| | |
| | | if (allCoupon.getRedemptionMethod() == 1) { |
| | | commodity.setIntegral(allCoupon.getIntegral().intValue()); |
| | | } else { |
| | | commodity.setIntegral(allCoupon.getIntegral().intValue()); |
| | | if (allCoupon.getIntegral()!=null) { |
| | | commodity.setIntegral(allCoupon.getIntegral().intValue()); |
| | | } |
| | | commodity.setAmount(allCoupon.getCash()); |
| | | } |
| | | commodity.setBelongsType(allCoupon.getUserPopulation()); |
| | |
| | | if (request.getShopId()!=null){ |
| | | if (goods.size() > 0 ){ |
| | | goods = goods.stream() |
| | | .filter( merchandise ->(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 2)||(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 1)||merchandise.getShopIds().contains(request.getShopId())) |
| | | .filter( merchandise ->(merchandise.getGoodsType() == 1&&merchandise.getUseScope() == 2)||(merchandise.getGoodsType() == 1&&merchandise.getUseScope() == 1)||(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 2)||(merchandise.getGoodsType() == 4&&merchandise.getUseScope() == 1)||merchandise.getShopIds().contains(request.getShopId())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | TAppUser user = appUserService.getById(userIdFormRedis); |
| | | if (user.getIntegral()<merchandise.getIntegral().intValue()*goodsNums){ |
| | | return new ResultUtil<>(0,"当前用户积分不足"); |
| | | } |
| | | if (merchandise.getIntegral()!=null) { |
| | | if (user.getIntegral() < merchandise.getIntegral().intValue() * goodsNums) { |
| | | return new ResultUtil<>(0, "当前用户积分不足"); |
| | | } |
| | | |
| | | } |
| | | |
| | | AppUserGoodResp goodResp = new AppUserGoodResp(); |
| | | goodResp.setAppUserId(userIdFormRedis); |
| | |
| | | UserPointsMerchandise pointsMerchandise = new UserPointsMerchandise(); |
| | | pointsMerchandise.setPointsMerchandiseId(exchangeType.getGoodId()); |
| | | pointsMerchandise.setUserId(userIdFormRedis); |
| | | pointsMerchandise.setStatus(1); |
| | | if (exchangeType.getGoodsType()==2){ |
| | | pointsMerchandise.setStatus(2); |
| | | pointsMerchandise.setVerificationTime(new Date()); |
| | | }else { |
| | | pointsMerchandise.setStatus(1); |
| | | } |
| | | pointsMerchandise.setState(1); |
| | | if (exchangeType.getExchangeType()==1) { |
| | | pointsMerchandise.setPayStatus(2); |
| | |
| | | } |
| | | |
| | | if (ToolUtil.isNotEmpty(timeType) && timeType != 0) { |
| | | Date lastOfDate = DateUtil.getLastOfDate(); |
| | | // Date lastOfDate = DateUtil.getLastOfDate(); |
| | | Date lastOfDate = DateUtil.getDate(); |
| | | switch (timeType) { |
| | | case 1: |
| | | Date lastWeekStartDate = DateUtil.getLastWeekStartDate(); |
| | |
| | | detailsVo.setVenueList(steClient.getAppUserSiteList(storeId)); |
| | | List<StoreOfCourseVo> storeOfCourseList = culisClient.getStoreOfCourseList(storeId); |
| | | System.out.println(storeOfCourseList); |
| | | for (StoreOfCourseVo storeOfCourseVo : storeOfCourseList) { |
| | | if (storeOfCourseVo.getClassHours().equals("0")){ |
| | | storeOfCourseVo.setClassHours(null); |
| | | } |
| | | if (storeOfCourseVo.getClassStartTime().equals("-")){ |
| | | storeOfCourseVo.setClassStartTime(null); |
| | | } |
| | | } |
| | | detailsVo.setCourseVoList(storeOfCourseList); |
| | | return detailsVo; |
| | | } |
| | |
| | | @ResponseBody |
| | | @PostMapping("/coupon/queryCouponByUser/{userId}") |
| | | public List<Integer> queryCouponByUser(@PathVariable("userId") Integer userId){ |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | List<Coupon> list = couponService.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2) |
| | | .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | .eq("state", 1)); |
| | | |
| | |
| | | cIds.add(pointsMerchandiseCity.getPointsMerchandiseId()); |
| | | } |
| | | |
| | | if (cIds.size()>0) { |
| | | |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state",1) |
| | | .eq("shelves",1).in("id",cIds) |
| | | .gt("endTime",new Date())); |
| | | if (merchandises.size() > 0){ |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | | integralCommodity.setCommodityId(merchandise.getId()); |
| | | integralCommodity.setCommodityImg(merchandise.getCover()); |
| | | integralCommodity.setCommodityName(merchandise.getName()); |
| | | integralCommodity.setCommodityPrice(merchandise.getPrice()); |
| | | integralCommodity.setGoodsType(merchandise.getType()); |
| | | commodity.add(integralCommodity); |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1) |
| | | .eq("shelves", 1).in("id", cIds) |
| | | .gt("endTime", new Date())); |
| | | if (merchandises.size() > 0){ |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | | IntegralCommodity integralCommodity = new IntegralCommodity(); |
| | | integralCommodity.setCommodityId(merchandise.getId()); |
| | | integralCommodity.setCommodityImg(merchandise.getCover()); |
| | | integralCommodity.setCommodityName(merchandise.getName()); |
| | | integralCommodity.setCommodityPrice(merchandise.getPrice()); |
| | | integralCommodity.setGoodsType(merchandise.getType()); |
| | | commodity.add(integralCommodity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | System.out.println(commodity); |
| | | return commodity; |
| | | } |
| | |
| | | ids.add(coupon.getId()); |
| | | } |
| | | } |
| | | List<UserCoupon> userCoupons = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", appUserId).in("couponId",ids)); |
| | | List<UserCoupon> userCoupons = new ArrayList<>(); |
| | | if (ids.size()>0) { |
| | | userCoupons = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", appUserId).in("couponId", ids)); |
| | | } |
| | | if (pointsMerchandises.size() > 0 ){ |
| | | for (UserPointsMerchandise pointsMerchandise : pointsMerchandises) { |
| | | PointsMerchandise merchandise = pmdsService.getById(pointsMerchandise.getPointsMerchandiseId()); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getSpecificsOfGoods") |
| | | public PointDetailsVo getSpecificsOfGoods(@RequestBody Long speMercharsId){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | PointDetailsVo detailsVo = new PointDetailsVo(); |
| | | UserPointsMerchandise byId = upmseService.getById(speMercharsId); |
| | | |
| | |
| | | PointsMerchandise pmdsServiceById = pmdsService.getById(byId.getPointsMerchandiseId()); |
| | | // 2.0 |
| | | detailsVo.setCardType(pmdsServiceById.getCardType()); |
| | | detailsVo.setExchangeAddrType(pmdsServiceById.getUseScope()); |
| | | detailsVo.setExchangeType(pmdsServiceById.getRedemptionMethod()); |
| | | detailsVo.setGoodType(pmdsServiceById.getType()); |
| | | if (pmdsServiceById.getRedemptionMethod() == 1){ |
| | |
| | | detailsVo.setBelongs(pmdsServiceById.getProvince()+pmdsServiceById.getCity()); |
| | | break; |
| | | case 3: |
| | | StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); |
| | | detailsVo.setBelongs(courseOfStore.getStoreName()+" "+courseOfStore.getStoreAddr()); |
| | | // StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); |
| | | // detailsVo.setBelongs(courseOfStore.getStoreName()+" "+courseOfStore.getStoreAddr()); |
| | | // detailsVo.setBelongs("---------------"); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | String couponIds = sendCouponReq.getCouponIds(); |
| | | for (String s : couponIds.split(",")) { |
| | | Coupon coupon = couponService.getById(s); |
| | | if (new Date().before(coupon.getStartTime())&&new Date().after(coupon.getEndTime())){ |
| | | continue; |
| | | } |
| | | //查询该优惠卷的数量够不够 |
| | | List<Integer> queryIds = new ArrayList<>(); |
| | | queryIds.add(coupon.getId()); |
| | |
| | | * 核销时间 |
| | | */ |
| | | @TableField("verificationTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verificationTime; |
| | | /** |
| | | * 状态(1=待核销,2=已核销) |
| | |
| | | |
| | | private Integer cardType; |
| | | |
| | | @ApiModelProperty(value = "使用范围") |
| | | private Integer exchangeAddrType; |
| | | |
| | | } |
| | |
| | | public StoreInfoDto getStoreInfo(@RequestBody Integer id); |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/courseOfSto") |
| | | StoreDetailOfCourse getCourseOfStore(@RequestParam("storeId") Integer storeId); |
| | | StoreDetailOfCourse getCourseOfStore(@RequestBody Integer storeId); |
| | | |
| | | |
| | | @PostMapping("/store/queryStoreByIds") |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.TStudent; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.account.AppUserClient; |
| | | import com.dsh.activity.feignclient.account.StudentClient; |
| | | import com.dsh.activity.feignclient.account.model.AppUser; |
| | |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.request.IntegralGoodsOfSearch; |
| | | import com.dsh.activity.service.ICouponService; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | |
| | | @Autowired |
| | | private ICouponService couponService; |
| | | |
| | | /** |
| | | * 获取购买会员支付成功页面的优惠券 |
| | |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | List<CouponListVo> listVos = new ArrayList<>(); |
| | | if (null != appUser) { |
| | | List<Integer> userPopulation = new ArrayList<>(); |
| | | userPopulation.add(1);//全部用户 |
| | | if (1 == appUser.getIsVip()) { |
| | | userPopulation.add(2);//年度会员 |
| | | } |
| | | List<TStudent> students = studentClient.queryStudentList(uid); |
| | | if (students.size() > 0) { |
| | | userPopulation.add(3);//已有学员用户 |
| | | } |
| | | // List<Integer> userPopulation = new ArrayList<>(); |
| | | // userPopulation.add(1);//全部用户 |
| | | // if (1 == appUser.getIsVip()) { |
| | | // userPopulation.add(2);//年度会员 |
| | | // } |
| | | // List<TStudent> students = studentClient.queryStudentList(uid); |
| | | // if (students.size() > 0) { |
| | | // userPopulation.add(3);//已有学员用户 |
| | | // } |
| | | |
| | | |
| | | // List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", distributionMethod) |
| | | // .in("userPopulation", userPopulation) |
| | | // .eq("auditStatus", 2).eq("status", 2).eq("state", 1) |
| | | // .last(" and now() between startTime and endTime order by insertTime desc")); |
| | | |
| | | |
| | | List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | .eq("state", 1)); |
| | | // List<Coupon> list = this.list(new QueryWrapper<Coupon>().eq("distributionMethod", 2).eq("userPopulation",2) |
| | | // .le("startTime", new Date()).ge("endTime", new Date()).eq("auditStatus", 2) |
| | | // .eq("state", 1)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | for (Coupon coupon : list) { |
| | | |
| | | |
| | | |
| | | LocalDateTime currentTime = LocalDateTime.now(); |
| | | LocalDateTime oneMinuteAgo = currentTime.minusSeconds(30); |
| | | |
| | | List<UserCoupon> list = userCouponService.list(new QueryWrapper<UserCoupon>().eq("userId", uid).ge("insertTime", oneMinuteAgo)); |
| | | List<Integer> ids = new ArrayList<>(); |
| | | for (UserCoupon userCoupon : list) { |
| | | ids.add(userCoupon.getCouponId()); |
| | | } |
| | | |
| | | // if (ids.size()>0){ |
| | | List<Coupon> userId = couponService.list(new QueryWrapper<Coupon>().in("id",ids)); |
| | | // return userId; |
| | | // |
| | | // } |
| | | |
| | | |
| | | for (Coupon coupon : userId) { |
| | | CouponListVo couponListVo = new CouponListVo(); |
| | | couponListVo.setId(coupon.getId().longValue()); |
| | | couponListVo.setName(coupon.getName()); |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.CouponCity; |
| | | import com.dsh.activity.entity.CouponStore; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.account.AppUserClient; |
| | |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.Site; |
| | | import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.activity.mapper.CouponCityMapper; |
| | | import com.dsh.activity.mapper.CouponMapper; |
| | | import com.dsh.activity.mapper.CouponStoreMapper; |
| | | import com.dsh.activity.mapper.UserCouponMapper; |
| | |
| | | |
| | | @Resource |
| | | private CouponMapper couponMapper; |
| | | |
| | | @Resource |
| | | private CouponCityMapper couponCityMapper; |
| | | |
| | | @Resource |
| | | private StoreClient storeClient; |
| | |
| | | break; |
| | | case 2: |
| | | packageResp.setAvailable("指定城市可用"); |
| | | packageResp.setCityOrStore(""); |
| | | List<CouponCity> couponId = couponCityMapper.selectList(new QueryWrapper<CouponCity>().eq("couponId", coupon.getId())); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (CouponCity couponCity : couponId) { |
| | | stringBuilder.append(couponCity.getCity()); |
| | | } |
| | | packageResp.setCityOrStore(String.valueOf(stringBuilder)); |
| | | break; |
| | | case 3: |
| | | packageResp.setAvailable("指定门店可用"); |
| | |
| | | package com.dsh.competition.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | |
| | | import com.dsh.competition.model.SaveParticipant; |
| | | import com.dsh.competition.service.IParticipantService; |
| | | import com.dsh.competition.service.UserCompetitionService; |
| | | import com.dsh.competition.util.JuHeUtil; |
| | | import com.dsh.competition.util.ResultUtil; |
| | | import com.dsh.competition.util.TokenUtil; |
| | | import com.dsh.competition.util.ToolUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | |
| | | if (numDigits==9){ |
| | | return participantService.editParticipant(uid, editParticipant); |
| | | Participant byId = participantService.getById(editParticipant.getId()); |
| | | editParticipant.setName(byId.getName()); |
| | | return participantService.editParticipant(uid, editParticipant); |
| | | } |
| | | else { |
| | | |
| | | |
| | | TStudent student = new TStudent(); |
| | | student.setId(editParticipant.getId()); |
| | | student.setName(editParticipant.getName()); |
| | | |
| | | TStudent student1 = studentClient.queryById(editParticipant.getId()); |
| | | student.setName(student1.getName()); |
| | | student.setIdCard(editParticipant.getIdcard()); |
| | | student.setHeight(Double.valueOf(editParticipant.getHeight())); |
| | | student.setWeight(editParticipant.getWeight()); |
| | | if (editParticipant.getHeight()!=null) { |
| | | student.setHeight(Double.valueOf(editParticipant.getHeight())); |
| | | } |
| | | |
| | | if (editParticipant.getWeight()!=null) { |
| | | student.setWeight(editParticipant.getWeight()); |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(student.getName()) && ToolUtil.isNotEmpty(student.getIdCard())){ |
| | | Boolean aBoolean = JuHeUtil.idcardAuthentication(student.getIdCard(), student.getName()); |
| | | if(!aBoolean){ |
| | | return ResultUtil.error("身份证和姓名不匹配"); |
| | | } |
| | | } |
| | | |
| | | |
| | | student.setPhone(editParticipant.getPhone()); |
| | | studentClient.updateAppUser(student); |
| | | return ResultUtil.success(); |
| | |
| | | |
| | | @PostMapping("/student/queryStudentList") |
| | | List<TStudent> queryStudentList(@RequestBody Integer appUserId); |
| | | @PostMapping("/student/queryById") |
| | | TStudent queryById(Integer id); |
| | | } |
| | |
| | | void taskSetStatusEnd(); |
| | | |
| | | Integer counts(@Param("id")Long id); |
| | | |
| | | void deleteTenMinutes(); |
| | | } |
| | |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import com.dsh.competition.feignclient.other.StoreClient; |
| | | import com.dsh.competition.feignclient.other.model.Store; |
| | | import com.dsh.competition.mapper.CompetitionMapper; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 赛事报名 |
| | | * @param uid |
| | |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | String[] split = paymentCompetitionVo.getIds().split(";"); |
| | | Competition competition = this.getById(paymentCompetitionVo.getId()); |
| | | if ((competition.getBaseNumber()+split.length)>competition.getApplicantsNumber()){ |
| | | int competitionId = userCompetitionService.count(new QueryWrapper<UserCompetition>().eq("competitionId", paymentCompetitionVo.getId())); |
| | | if ((competitionId+split.length)>competition.getApplicantsNumber()){ |
| | | return ResultUtil.error("报名人数超过最大限制"); |
| | | |
| | | } |
| | | BigDecimal money = null; |
| | | if(paymentCompetitionVo.getPayType() == 1 || paymentCompetitionVo.getPayType() == 2){ |
| | |
| | | if(paymentCompetitionVo.getPayType() == 3){//玩湃币 |
| | | money = new BigDecimal(competition.getPlayPaiCoin()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN); |
| | | if(money.compareTo(new BigDecimal(appUser.getPlayPaiCoins())) > 0){ |
| | | return ResultUtil.error("报名失败,玩湃币不足,请充值"); |
| | | |
| | | return new ResultUtil(2,"报名失败,玩湃币不足,请充值"); |
| | | } |
| | | } |
| | | if(paymentCompetitionVo.getPayType() == 4){//课程 |
| | |
| | | // 2.0 |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHourById(paymentCompetitionVo.getCoursePaymentId()); |
| | | if(new BigDecimal(integer).compareTo(new BigDecimal(competition.getClassPrice())) < 0){ |
| | | return ResultUtil.error( "剩余课时不足,无法完成支付。"); |
| | | return new ResultUtil(3,"剩余课时不足,无法完成支付。"); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | public void taskSetStatus() { |
| | | this.baseMapper.taskSetStatusStart(); |
| | | this.baseMapper.taskSetStatusEnd(); |
| | | this.baseMapper.deleteTenMinutes(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public List<ParticipantVo> queryParticipantList(Integer uid) throws Exception { |
| | | //拿到学员列表 |
| | | List<TStudent> tStudents = studentClient.queryStudentList(uid); |
| | | |
| | | List<ParticipantVo> listVo1 = new ArrayList<>(); |
| | | |
| | | //利用HashMap去重身份证 |
| | | LinkedHashMap<String,ParticipantVo> linkedHashMap =new LinkedHashMap<>(); |
| | | SimpleDateFormat sdf_year = new SimpleDateFormat("yyyy"); |
| | |
| | | } |
| | | participantVo.setGender(tStudent.getSex()); |
| | | participantVo.setIsStudent(1); |
| | | if (tStudent.getIdCard()==null|| tStudent.getIdCard().isEmpty()){ |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(tStudent.getIdCard(),participantVo); |
| | | } |
| | | |
| | |
| | | participantVo.setBirthday(format); |
| | | } |
| | | participantVo.setGender(participant.getGender()); |
| | | |
| | | if (participant.getIdcard()==null|| participant.getIdcard().isEmpty()){ |
| | | listVo1.add(participantVo); |
| | | continue; |
| | | } |
| | | linkedHashMap.put(participant.getIdcard(),participantVo); |
| | | listVo.add(participantVo); |
| | | // listVo.add(participantVo); |
| | | |
| | | } |
| | | |
| | | listVo1.addAll(linkedHashMap.values()); |
| | | |
| | | |
| | | |
| | | List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values()); |
| | | // List<ParticipantVo> listVo1 = new ArrayList<>(linkedHashMap.values()); |
| | | |
| | | |
| | | return listVo1; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | competitionInfo.setAge(competition.getStartAge() + "-" + competition.getEndAge()); |
| | | competitionInfo.setProvince(competition.getEntryProvince()); |
| | | competitionInfo.setCity(competition.getEntryCity()); |
| | | competitionInfo.setAddress(competition.getEntryAddress()); |
| | | |
| | | String str = competition.getAddress(); |
| | | str = str.substring(str.indexOf("省") + 1); |
| | | |
| | | // 去掉第一个“市”及之前的字符串 |
| | | str = str.substring(str.indexOf("市") + 1); |
| | | |
| | | // 去掉第一个“区”及之前的字符串 |
| | | str = str.substring(str.indexOf("区") + 1); |
| | | |
| | | |
| | | competitionInfo.setAddress(str); |
| | | competitionInfo.setCashPrice(competition.getCashPrice()); |
| | | competitionInfo.setPlayPaiCoin(competition.getPlayPaiCoin()); |
| | | competitionInfo.setClassPrice(competition.getClassPrice()); |
| | | competitionInfo.setIntroduction(competition.getIntroduction()); |
| | | competitionInfo.setRegistrationNotes(competition.getRegistrationNotes()); |
| | | competitionInfo.setApply(1); |
| | | ArrayList<Map<String,Object>> objects = new ArrayList<>(); |
| | | |
| | | if(null != competition.getStoreId()){ |
| | | String storeId = competition.getStoreId(); |
| | | for (String s : storeId.split(",")) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | Store store1 = storeClient.queryStoreById(Integer.valueOf(s)); |
| | | map.put("name",store1.getName()); |
| | | |
| | | |
| | | String str1 = store1.getAddress(); |
| | | str1 = str1.substring(str1.indexOf("省") + 1); |
| | | |
| | | // 去掉第一个“市”及之前的字符串 |
| | | str1 = str1.substring(str1.indexOf("市") + 1); |
| | | |
| | | // 去掉第一个“区”及之前的字符串 |
| | | str1 = str1.substring(str1.indexOf("区") + 1); |
| | | |
| | | map.put("address",str1); |
| | | map.put("storeLon",store.getLon()); |
| | | map.put("storeLat",store.getLat()); |
| | | map.put("storeCoverDrawing",store.getCoverDrawing()); |
| | | // if(ToolUtil.isNotEmpty(lon) && ToolUtil.isNotEmpty(lat)){ |
| | | // Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, store.getLon() + "," + store.getLat()); |
| | | // double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | // map.put("distance",wgs84); |
| | | // } |
| | | objects.add(map); |
| | | } |
| | | |
| | | } |
| | | competitionInfo.setStoreInfos(objects); |
| | | |
| | | |
| | | |
| | | List<ParticipantVo> participant = new ArrayList<>(); |
| | | List<UserCompetition> list = userCompetitionService.list(new QueryWrapper<UserCompetition>().eq("paymentCompetitionId", paymentCompetition.getId())); |
| | | List<Integer> collect = list.stream().map(UserCompetition::getParticipantId).collect(Collectors.toList()); |
| | |
| | | participantVo.setIdcard(participant1.getIdcard()); |
| | | Integer age = Integer.valueOf(sdf_year.format(new Date())) - Integer.valueOf(sdf_year.format(participant1.getBirthday())); |
| | | participantVo.setAge(age); |
| | | participantVo.setPhone(participant1.getPhone()); |
| | | participant.add(participantVo); |
| | | } |
| | | competitionInfo.setParticipant(participant); |
| | |
| | | <!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"> |
| | | |
| | | <delete id="deleteTenMinutes"> |
| | | delete from t_payment_competition |
| | | WHERE payStatus = 1 |
| | | AND DATE_ADD(insertTime, INTERVAL 10 MINUTE) <= NOW() |
| | | </delete> |
| | | |
| | | |
| | | <select id="queryCompetitionList" resultType="com.dsh.competition.model.CompetitionListVo"> |
| | | select |
| | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(byId.getId()); |
| | | courseCounsum.setChangeType(0); |
| | | courseCounsum.setNum(byId.getClassHours()); |
| | | courseCounsum.setNum(cancelledClasses.getCancelledClassesNumber()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("消课"); |
| | | courseCounsumService.save(courseCounsum); |
| | |
| | | import com.dsh.course.util.PageFactory; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import com.dsh.course.util.TokenUtil; |
| | | import com.dsh.course.util.ToolUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(name = "lon",value = "经度",dataType = "String"), |
| | | @ApiImplicitParam(name = "lat",value = "纬度",dataType = "String"), |
| | | }) |
| | | public ResultUtil<List<Details>> thisWeeksBenefitList(Integer discountType, String lon, String lat){ |
| | | try { |
| | | public ResultUtil<List<Details>> thisWeeksBenefitList(Integer discountType, String lon, String lat) throws Exception { |
| | | // try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tcpdService.getWeeksBenefitCourse(appUserId,discountType,lon,lat)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | String [] strings = {"今日","明日","周一","周二","周三","周四","周五","周六","周日"}; |
| | | List<String> stringList = new ArrayList<>(Arrays.asList(strings)); |
| | | |
| | | List<Details> weeksBenefitCourse = tcpdService.getWeeksBenefitCourse(appUserId, discountType, lon, lat); |
| | | |
| | | weeksBenefitCourse.sort(new Comparator<Details>() { |
| | | @Override |
| | | public int compare(Details o1, Details o2) { |
| | | return stringList.indexOf(o1.getDataTime()) - stringList.indexOf(o2.getDataTime()); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // return ResultUtil.success(tcpdService.getWeeksBenefitCourse(appUserId,discountType,lon,lat)); |
| | | return ResultUtil.success(weeksBenefitCourse); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | List<TCoursePackage> list = coursePackageService.list(new QueryWrapper<TCoursePackage>() |
| | | .eq("storeId", storeId) |
| | | .eq("auditStatus",2) |
| | | .eq("state",1)); |
| | | .eq("state",1).orderByDesc("insertTime")); |
| | | if (list.size() > 0){ |
| | | for (TCoursePackage coursePackage : list) { |
| | | int count = tcppmenService.count(new QueryWrapper<TCoursePackagePayment>() |
| | |
| | | StoreOfCourseVo courseVo = new StoreOfCourseVo(); |
| | | courseVo.setCourseId(coursePackage.getId()); |
| | | courseVo.setName(coursePackage.getName()+"(" + store.getName() + ")"); |
| | | courseVo.setClassStartTime(coursePackage.getClassStartTime() +"-"+ coursePackage.getClassEndTime()); |
| | | |
| | | |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | ArrayList<String> classTime = new ArrayList<>(); |
| | | String[] split4 = classStartTime.split(","); |
| | | String[] split3 = classEndTime.split(","); |
| | | if(ToolUtil.isNotEmpty(classStartTime)){ |
| | | for (int i = 0; i < split4.length; i++) { |
| | | String s = split4[i].substring(0,5) + "-" + split3[i].substring(0,5); |
| | | classTime.add(s); |
| | | } |
| | | } |
| | | |
| | | // coursePackageInfo.setTimes(classTime); |
| | | String classTimeAsString = String.join("|", classTime); |
| | | |
| | | |
| | | |
| | | courseVo.setClassStartTime(classTimeAsString); |
| | | courseVo.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | courseVo.setApplicantsNumber(count); |
| | | List<CoursePackagePaymentConfig> list1 = icppconfigService.list(new QueryWrapper<CoursePackagePaymentConfig>() |
| | |
| | | CoursePackagePaymentConfig minConfig = list1.stream() |
| | | .min(Comparator.comparingDouble(CoursePackagePaymentConfig::getCashPayment)) |
| | | .orElse(null); |
| | | List<Integer> classHours = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list1) { |
| | | classHours.add(coursePackagePaymentConfig.getClassHours()); |
| | | } |
| | | |
| | | if (minConfig != null){ |
| | | courseVo.setClassHours(minConfig.getClassHours()); |
| | | courseVo.setClassHours(classHours); |
| | | courseVo.setOriginalPrice(minConfig.getCashPayment()); |
| | | courseVo.setCoin(minConfig.getPlayPaiCoin()); |
| | | } |
| | | |
| | | courseVoList.add(courseVo); |
| | |
| | | resp.setTotalCourseNums(tCoursePackagePayment.getTotalClassHours()); |
| | | resp.setResidueNums(tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setDeductionNums(tCoursePackagePayment.getTotalClassHours()-tCoursePackagePayment.getLaveClassHours()); |
| | | resp.setCourseType(tCoursePackage.getType()); |
| | | if (tCoursePackage.getType()!=1||tCoursePackage.getState()==2||tCoursePackagePayment.getPayStatus()==1){ |
| | | resp.setIsAble(0); |
| | | }else { |
| | | resp.setIsAble(1); |
| | | } |
| | | if (tCoursePackage.getValidDays()!=null){ |
| | | String afterDayDate = DateUtil.getAfterDayDate2(tCoursePackage.getInsertTime(),tCoursePackage.getValidDays() + ""); |
| | | resp.setPeriodOfValidity(afterDayDate); |
| | |
| | | // } |
| | | |
| | | |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("appUserId", appUserId); |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("studentId", search.getStuId()); |
| | | if (ToolUtil.isNotEmpty(search.getCourseTypeId())){ |
| | | queryWrapper1.eq("coursePackageId",search.getCourseTypeId()); |
| | | } |
| | |
| | | } |
| | | |
| | | System.out.println("======longs========"+longs); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().in("id",longs).isNotNull("courseId")); |
| | | // List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().in("id",longs).isNotNull("courseId")); |
| | | List<AppUserVideoResponse> coursePackageSchedulings1 = coursePackageSchedulingService.queryAll(longs); |
| | | |
| | | if (search.getSearch()!=null) { |
| | |
| | | }) |
| | | public ResultUtil<PayCourseInfoReq> payCourseInfo(Integer courseId){ |
| | | try { |
| | | PayCourseInfoReq payCourseInfoReq = packagePaymentService.payCourseInfo(courseId); |
| | | |
| | | // Arrays.sort(payCourseInfoReq.getDay(), (a, b) -> a.compareTo(b)); |
| | | |
| | | Collections.sort(payCourseInfoReq.getDay(), Comparator.comparing(String::toString)); |
| | | |
| | | |
| | | return ResultUtil.success(packagePaymentService.payCourseInfo(courseId)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | |
| | | |
| | | |
| | | |
| | | // coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().eq("courseId", coursePackagePayment.getCoursePackageId())); |
| | | |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", coursePackagePayment.getStudentId()).eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | |
| | | |
| | | |
| | | |
| | | // Student student = studentClient.queryStudentById(coursePackagePayment.getStudentId()); |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(coursePackagePayment.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | |
| | | |
| | | TCoursePackagePayment pay = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("coursePackageId", coursePackagePayment.getCoursePackageId()).eq("studentId", coursePackagePayment.getStudentId())); |
| | | |
| | | // List<CoursePackageStudent> studentCourse1 = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", pay.getStudentId()).eq("coursePackageId", pay.getCoursePackageId())); |
| | | // List<Long> collect1 = studentCourse1.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | //拿到最后一天的排课记录 |
| | | |
| | | // CoursePackageScheduling cs = null; |
| | | // if (collect1.size()>0) { |
| | | // cs = coursePackageSchedulingService.getOne(new QueryWrapper<CoursePackageScheduling>().in("id", collect1).orderByDesc("classDate").last("limit 1")); |
| | | // |
| | | // } |
| | | Date today = new Date(); |
| | | |
| | | Integer laveClassHours = pay.getLaveClassHours(); |
| | |
| | | } |
| | | } |
| | | |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // // 本周周几 |
| | | // int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date()) - 1; |
| | | // for (Integer integer : week) { |
| | | // if (integer < i) { |
| | | // // 找下一周的时间 |
| | | // Calendar instance = Calendar.getInstance(); |
| | | // instance.add(Calendar.DATE, 7 - (i - integer)); |
| | | // Date time = instance.getTime(); |
| | | // |
| | | // for (int i1 = 0; i1 < split.length; i1++) { |
| | | // |
| | | // CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | // coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | // Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | // Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | // coursePackageScheduling.setClassDate(parse); |
| | | // coursePackageScheduling.setEndDate(parse1); |
| | | // coursePackageScheduling.setStatus(1); |
| | | // coursePackageSchedulingService.save(coursePackageScheduling); |
| | | // CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | // student1.setAppUserId(student.getAppUserId()); |
| | | // student1.setStudentId(student.getId()); |
| | | // student1.setCoursePackageId(tCoursePackage.getId()); |
| | | // student1.setCoursePackagePaymentId(coursePackagePayment.getId()); |
| | | // student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | // student1.setSignInOrNot(1); |
| | | // student1.setReservationStatus(1); |
| | | // student1.setInsertTime(new Date()); |
| | | // studentService.save(student1); |
| | | // |
| | | // } |
| | | // |
| | | // } else if (integer > i) { |
| | | // Calendar instance = Calendar.getInstance(); |
| | | // instance.add(Calendar.DATE, integer - i); |
| | | // Date time1 = instance.getTime(); |
| | | // List<Date> list6 = new ArrayList<>(); |
| | | // list6.add(time1); |
| | | // instance.add(Calendar.DATE, 7); |
| | | // Date time2 = instance.getTime(); |
| | | // list6.add(time2); |
| | | // for (Date time : list6) { |
| | | // for (int i1 = 0; i1 < split.length; i1++) { |
| | | // CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | // coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | // Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | // Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | // coursePackageScheduling.setClassDate(parse); |
| | | // coursePackageScheduling.setEndDate(parse1); |
| | | // coursePackageScheduling.setStatus(1); |
| | | // coursePackageSchedulingService.save(coursePackageScheduling); |
| | | // |
| | | // CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | // student1.setAppUserId(student.getAppUserId()); |
| | | // student1.setStudentId(student.getId()); |
| | | // student1.setCoursePackageId(tCoursePackage.getId()); |
| | | // student1.setCoursePackagePaymentId(coursePackagePayment.getId()); |
| | | // student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | // student1.setSignInOrNot(1); |
| | | // student1.setReservationStatus(1); |
| | | // student1.setInsertTime(new Date()); |
| | | // studentService.save(student1); |
| | | // } |
| | | // } |
| | | // |
| | | // } else { |
| | | // Calendar instance = Calendar.getInstance(); |
| | | // instance.add(Calendar.DATE, 7); |
| | | // Date time = instance.getTime(); |
| | | // |
| | | // for (int i1 = 0; i1 < split.length; i1++) { |
| | | // CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | // coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | // Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | // Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | // coursePackageScheduling.setClassDate(parse); |
| | | // coursePackageScheduling.setEndDate(parse1); |
| | | // coursePackageScheduling.setStatus(1); |
| | | // coursePackageSchedulingService.save(coursePackageScheduling); |
| | | // |
| | | // CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | // student1.setAppUserId(student.getAppUserId()); |
| | | // student1.setStudentId(student.getId()); |
| | | // student1.setCoursePackageId(tCoursePackage.getId()); |
| | | // student1.setCoursePackagePaymentId(coursePackagePayment.getId()); |
| | | // student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | // student1.setSignInOrNot(1); |
| | | // student1.setReservationStatus(1); |
| | | // student1.setInsertTime(new Date()); |
| | | // studentService.save(student1); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // 2.0 少于3课时 推送 |
| | |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); |
| | | TCoursePackage byId = tcpService.getById(coursePackageId); |
| | | if (byId.getType()==3){ |
| | | continue; |
| | | } |
| | | if(storeIds.contains(byId.getStoreId())){ |
| | | PayCourseRes payCourseRes = new PayCourseRes(); |
| | | payCourseRes.setCourseNum(tCoursePackagePayment.getLaveClassHours()); |
| | |
| | | |
| | | // 2.0 送课时 |
| | | @PostMapping("/base/coursePack/sendHours") |
| | | public Integer sendHours(@RequestBody String s){ |
| | | String[] split = s.split("_"); |
| | | TCoursePackagePayment byId = packagePaymentService.getById(Long.valueOf(split[0])); |
| | | byId.setTotalClassHours(byId.getTotalClassHours()+Integer.valueOf(split[2])); |
| | | boolean b = packagePaymentService.updateHoursById(byId,Integer.valueOf(split[2])); |
| | | public Integer sendHours(@RequestBody String s) throws ParseException { |
| | | String[] split2 = s.split("_"); |
| | | TCoursePackagePayment byId = packagePaymentService.getById(Long.valueOf(split2[0])); |
| | | byId.setTotalClassHours(byId.getTotalClassHours()+Integer.valueOf(split2[2])); |
| | | boolean b = packagePaymentService.updateHoursById(byId,Integer.valueOf(split2[2])); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(byId.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(Integer.valueOf(split2[2])); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("介绍有礼"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | List<CoursePackageStudent> studentCourse = coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", byId.getStudentId()).eq("coursePackageId", byId.getCoursePackageId())); |
| | | List<Long> collect = studentCourse.stream().map(CoursePackageStudent::getCoursePackageSchedulingId).collect(Collectors.toList()); |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().in("id",collect)); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("studentId", byId.getStudentId()).eq("coursePackageId", byId.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(byId.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | TCoursePackagePayment pay = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("coursePackageId", byId.getCoursePackageId()).eq("studentId", byId.getStudentId())); |
| | | |
| | | Date today = new Date(); |
| | | |
| | | Integer laveClassHours = pay.getLaveClassHours(); |
| | | Integer codeTime = tCoursePackage.getCodeTime(); |
| | | Integer can = laveClassHours/codeTime; |
| | | |
| | | int count = 0; |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | Date[] dates = generateDateArray(14,today); |
| | | for (Date date : dates) { |
| | | if (count==can){ |
| | | break; |
| | | } |
| | | int wei = cn.hutool.core.date.DateUtil.dayOfWeek(date); |
| | | if (week.contains(wei)){ |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | if (count==can){ |
| | | break; |
| | | } |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | Date parse = format1.parse(format.format(date) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(date) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | | coursePackageScheduling.setEndDate(parse1); |
| | | coursePackageScheduling.setStatus(1); |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(pay.getAppUserId()); |
| | | student1.setStudentId(pay.getStudentId()); |
| | | student1.setCoursePackageId(pay.getCoursePackageId()); |
| | | student1.setCoursePackagePaymentId(pay.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | | student1.setSignInOrNot(1); |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | count++; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(b){ |
| | | return 1; |
| | | }else { |
| | |
| | | List<TCoursePackagePayment> list1 = packagePaymentService.list(new LambdaQueryWrapper<TCoursePackagePayment>().eq(TCoursePackagePayment::getAppUserId, courseDetailReq.getAppUserId()).eq(TCoursePackagePayment::getStudentId, courseDetailReq.getStuId()).in(TCoursePackagePayment::getCoursePackageId, collect)); |
| | | List<Integer> collect1 = list1.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | List<Long> ids = list1.stream().map(TCoursePackagePayment::getId).collect(Collectors.toList()); |
| | | |
| | | |
| | | for (TCoursePackage tCoursePackage : list) { |
| | | DetailsListVo detailsListVo = new DetailsListVo(); |
| | | detailsListVo.setId(tCoursePackage.getId()); |
| | | detailsListVo.setName(tCoursePackage.getName()); |
| | | detailsListVo.setCourseType(tCoursePackage.getType()); |
| | | String classStartTime = tCoursePackage.getClassStartTime(); |
| | | String[] split = classStartTime.split(","); |
| | | String classEndTime = tCoursePackage.getClassEndTime(); |
| | |
| | | strings.add(s); |
| | | } |
| | | } |
| | | if (detailsListVo.getCourseType()==1) { |
| | | detailsListVo.setTime(strings); |
| | | }else { |
| | | Date startTime = tCoursePackage.getStartTime(); |
| | | Date endTime = tCoursePackage.getEndTime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String formattedStartTime = sdf.format(startTime); |
| | | String formattedEndTime = sdf.format(endTime); |
| | | |
| | | detailsListVo.setTime(strings); |
| | | String result = formattedStartTime + "至" + formattedEndTime; |
| | | List<String> stringLists = new ArrayList<>(); |
| | | stringLists.add(result); |
| | | detailsListVo.setTime(stringLists); |
| | | |
| | | } |
| | | //价格 |
| | | List<CoursePackagePaymentConfig> list2 = icppcService.list(new LambdaQueryWrapper<CoursePackagePaymentConfig>().eq(CoursePackagePaymentConfig::getCoursePackageId, tCoursePackage.getId()).orderByAsc(CoursePackagePaymentConfig::getCashPayment)); |
| | | if (list2.size() > 0) { |
| | | Double cashPayment = list2.get(0).getCashPayment(); |
| | |
| | | .like(CoursePackageScheduling::getClassDate, courseDetailReq.getTime()) |
| | | ); |
| | | if(list3.size()==0){ |
| | | break; |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | | continue; |
| | | } |
| | | //排课的ids |
| | | List<Long> collect2 = list3.stream().map(CoursePackageScheduling::getId).collect(Collectors.toList()); |
| | | if(collect2.size()==0){ |
| | | collect2.add(-1l); |
| | | } |
| | | |
| | | |
| | | List<CoursePackageStudent> list4 = cspsService.list(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getAppUserId, courseDetailReq.getAppUserId()) |
| | | .eq(CoursePackageStudent::getCoursePackageId, tCoursePackage.getId()) |
| | |
| | | in(CoursePackageStudent::getCoursePackagePaymentId, ids) |
| | | ); |
| | | |
| | | if(list4.size()>0){ |
| | | List<CoursePackageStudent> list5 = cspsService.list(new QueryWrapper<CoursePackageStudent>().eq("studentId", courseDetailReq.getStuId()).eq("coursePackageId",tCoursePackage.getId())); |
| | | |
| | | if(list5.size()>0){ |
| | | Integer signInOrNot = list4.get(0).getSignInOrNot(); |
| | | detailsListVo.setType(1); |
| | | |
| | |
| | | } |
| | | detailsListVo.setIsType(list4.get(0).getType()); |
| | | |
| | | for (CoursePackageStudent coursePackageStudent : list4) { |
| | | Integer signInOrNot1 = coursePackageStudent.getSignInOrNot(); |
| | | detailsListVo.setType(1); |
| | | |
| | | if(signInOrNot1==2){ |
| | | detailsListVo.setType(3); |
| | | } |
| | | detailsListVo.setIsType(coursePackageStudent.getType()); |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingMapper.selectById(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | Date classDate = coursePackageScheduling.getClassDate(); |
| | | Date endDate = coursePackageScheduling.getEndDate(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); |
| | | String formattedClassDate = sdf.format(classDate); |
| | | String formattedEndDate = sdf.format(endDate); |
| | | |
| | | String result = formattedClassDate + "-" + formattedEndDate; |
| | | List<String> strings1 =new ArrayList<>(); |
| | | strings1.add(result); |
| | | detailsListVo.setTime(strings1); |
| | | DetailsListVo detailsListVo1 = new DetailsListVo(); |
| | | |
| | | // detailsListVo1.setId(coursePackageStudent.getId()); |
| | | BeanUtils.copyProperties(detailsListVo,detailsListVo1); |
| | | objects.add(detailsListVo1); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }else { |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | | |
| | | } |
| | | |
| | | } else { |
| | | detailsListVo.setType(2); |
| | | objects.add(detailsListVo); |
| | | |
| | | } |
| | | objects.add(detailsListVo); |
| | | // objects.add(detailsListVo); |
| | | } |
| | | map.put("data",objects); |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") |
| | | public void editCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){ |
| | | coursePackageScheduling.setCoursePackageId(null); |
| | | coursePackageSchedulingService.updateById(coursePackageScheduling); |
| | | public void editCoursePackageScheduling(@RequestBody List<CoursePackageScheduling> coursePackageScheduling){ |
| | | // coursePackageScheduling.setCoursePackageId(null); |
| | | for (CoursePackageScheduling packageScheduling : coursePackageScheduling) { |
| | | packageScheduling.setCoursePackageId(null); |
| | | } |
| | | coursePackageSchedulingService.updateBatchById(coursePackageScheduling); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageStudent/queryByCoursePackageSchedulingId") |
| | | public List<CoursePackageStudent> queryByCoursePackageSchedulingId(@RequestBody Long coursePackageSchedulingId){ |
| | | return coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().eq("coursePackageSchedulingId", coursePackageSchedulingId)); |
| | | public List<CoursePackageStudent> queryByCoursePackageSchedulingId(@RequestBody List<Long> coursePackageSchedulingId){ |
| | | return coursePackageStudentService.list(new QueryWrapper<CoursePackageStudent>().in("coursePackageSchedulingId", coursePackageSchedulingId)); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.course.entity.CancelledClasses; |
| | | import com.dsh.course.entity.CourseCounsum; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.entity.TCoursePackage; |
| | | import com.dsh.course.feignclient.model.GetStudentCourse; |
| | | import com.dsh.course.service.CancelledClassesService; |
| | | import com.dsh.course.service.CourseCounsumService; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.util.ToolUtil; |
| | |
| | | return sult; |
| | | } |
| | | |
| | | @Autowired |
| | | private CourseCounsumService courseCounsumService; |
| | | |
| | | @PostMapping("/base/courseRecord/save") |
| | | public void save(@RequestBody CourseCounsum courseCounsum) { |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/courseRecord/cancelCourseData") |
| | | public Integer cancelCourseRecordClass(@RequestBody Integer courseRecordId){ |
| | |
| | | |
| | | |
| | | |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("appUserId", id); |
| | | QueryWrapper<CoursePackageStudent> queryWrapper1 = new QueryWrapper<CoursePackageStudent>().eq("studentId", id); |
| | | List<CoursePackageStudent> list = coursePackageStudentService.list(queryWrapper1); |
| | | List<Long> longs = new ArrayList<>(); |
| | | for (CoursePackageStudent coursePackageStudent : list) { |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") |
| | | Date insertTime; |
| | | @TableField("appUserId") |
| | | Integer appUserId; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 17:34 |
| | |
| | | private Integer applicantsNumber; |
| | | |
| | | @ApiModelProperty("包含课时数") |
| | | private Integer classHours; |
| | | private List<Integer> classHours; |
| | | |
| | | @ApiModelProperty("价格") |
| | | private Double originalPrice; |
| | | |
| | | |
| | | @ApiModelProperty("玩湃币价格") |
| | | private Integer coin; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "课时有效期") |
| | | private String periodOfValidity; |
| | | @ApiModelProperty(value = "课程类型") |
| | | private Integer courseType; |
| | | @ApiModelProperty(value = "是否过滤分配课时") |
| | | private Integer isAble; |
| | | } |
| | |
| | | /** |
| | | * 获取排课预约信息 |
| | | * @param page |
| | | * @param coursePackageSchedulingId |
| | | * @param ids |
| | | * @param userId |
| | | * @param studentId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryCoursePackageStudentList(Page<Map<String, Object>> page, @Param("coursePackageSchedulingId") Long coursePackageSchedulingId, |
| | | List<Map<String, Object>> queryCoursePackageStudentList(Page<Map<String, Object>> page, @Param("ids") List<Long> ids, |
| | | @Param("userId") List<Integer> userId, @Param("studentId") List<Integer> studentId); |
| | | |
| | | StudentClassInfo listAll(@Param("tStudentId")Integer tStudentId); |
| | |
| | | private Double money; |
| | | |
| | | private Integer isType=1; |
| | | |
| | | private Integer courseType; |
| | | } |
| | |
| | | @ApiModelProperty(value = "课程名称/门店名称",dataType = "string",required = false) |
| | | private String search; |
| | | |
| | | @ApiModelProperty(value = "学员id",dataType = "int",required = true) |
| | | private Integer stuId; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "需要扣除的课时数",dataType = "int") |
| | | private Integer num; |
| | | @ApiModelProperty(value = "学员stuId") |
| | | private Integer stuId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "门店距离") |
| | | private String storeDistance; |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer coin; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "玩湃币") |
| | | private Integer wanpaiGold; |
| | | @ApiModelProperty("详情图片") |
| | | private String detailDrawing; |
| | | |
| | | @ApiModelProperty("课程类型") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("假期时间") |
| | | private String holiTime; |
| | | |
| | | private Integer payType; |
| | | |
| | | } |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | import com.dsh.course.entity.CoursePackageStudent; |
| | | import com.dsh.course.entity.StudentClassInfo; |
| | | import com.dsh.course.entity.TAppUser; |
| | |
| | | import com.dsh.course.feignclient.account.StudentClient; |
| | | import com.dsh.course.feignclient.account.model.AppUser; |
| | | import com.dsh.course.feignclient.account.model.Student; |
| | | import com.dsh.course.mapper.CoursePackageSchedulingMapper; |
| | | import com.dsh.course.mapper.CoursePackageStudentMapper; |
| | | import com.dsh.course.model.QueryCoursePackageStudentList; |
| | | import com.dsh.course.service.CoursePackageSchedulingService; |
| | | import com.dsh.course.service.CoursePackageStudentService; |
| | | import com.dsh.course.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private CoursePackageSchedulingMapper coursePackageSchedulingService; |
| | | |
| | | /** |
| | | * 获取排课预约数据 |
| | |
| | | studentId = students.stream().map(Student::getId).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = this.baseMapper.queryCoursePackageStudentList(page, queryCoursePackageStudentList.getCoursePackageSchedulingId(), userId, studentId); |
| | | |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingService.selectById(queryCoursePackageStudentList.getCoursePackageSchedulingId()); |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingService.selectList(new QueryWrapper<CoursePackageScheduling>().eq("coursePackageId", coursePackageScheduling.getCoursePackageId()).eq("classDate", coursePackageScheduling.getClassDate())); |
| | | |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | for (CoursePackageScheduling packageScheduling : coursePackageSchedulings) { |
| | | ids.add(packageScheduling.getId()); |
| | | } |
| | | |
| | | List<Map<String, Object>> list = this.baseMapper.queryCoursePackageStudentList(page, ids, userId, studentId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
| | | Integer now = Integer.valueOf(sdf.format(new Date())); |
| | | for (Map<String, Object> map : list) { |
| | |
| | | import com.dsh.course.model.vo.response.Details; |
| | | import com.dsh.course.model.vo.response.ExchangeCoursePackageResponse; |
| | | import com.dsh.course.service.TCoursePackageDiscountService; |
| | | import com.dsh.course.util.DateTimeHelper; |
| | | import com.dsh.course.util.LocalDateTimeUtils; |
| | | import com.dsh.course.util.StrUtils; |
| | | import com.dsh.course.util.*; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | Date parse2 = null; |
| | | String startDate = jsonObject.getString("startDate"); |
| | | String endDate = jsonObject.getString("endDate"); |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | String currentTime = sdf.format(new Date()); |
| | | |
| | | boolean isWithinTimeRange = false; |
| | | try { |
| | | Date currentTimeDate = sdf.parse(currentTime); |
| | | Date startTimeDate = sdf.parse(startTime); |
| | | Date endTimeDate = sdf.parse(endTime); |
| | | |
| | | if (currentTimeDate.after(startTimeDate) && currentTimeDate.before(endTimeDate)) { |
| | | isWithinTimeRange = true; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | parse1 = simpleDateFormat.parse(startDate); |
| | | parse2 = simpleDateFormat.parse(endDate); |
| | |
| | | |
| | | if (isWithinRange) { |
| | | // 判断当前日期是否在开始时间和结束时间范围内 |
| | | if (isDateWithinRange(localTime, parse1, parse2)) { |
| | | if (isDateWithinRange(localTime, parse1, parse2)){ |
| | | Details resde = new Details(); |
| | | |
| | | resde.setCoursePackageDiscountId(tCoursePackageDiscount.getId()); |
| | |
| | | resde.setDate(localTime); |
| | | resde.setOriginalPrice(paymentConfig.getCashPayment()); |
| | | resde.setDiscountPrice(cashPayment); |
| | | resde.setStatus(1); |
| | | if (isWithinTimeRange) { |
| | | resde.setStatus(1); |
| | | }else { |
| | | resde.setStatus(2); |
| | | } |
| | | GetDistanceVo distanceVo = new GetDistanceVo(); |
| | | distanceVo.setLatitude(lat); |
| | | distanceVo.setLongitude(lon); |
| | | distanceVo.setStoreId(coursePackage.getStoreId()); |
| | | String s = sreClient.calculateDistance(distanceVo); |
| | | resde.setStoreDistance(s); |
| | | |
| | | |
| | | |
| | | |
| | | list.add(resde); |
| | | } |
| | | } |
| | |
| | | Date parse2 = null; |
| | | String startDate = jsonObject.getString("startDate"); |
| | | String endDate = jsonObject.getString("endDate"); |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| | | String currentTime = sdf.format(new Date()); |
| | | |
| | | boolean isWithinTimeRange = false; |
| | | try { |
| | | Date currentTimeDate = sdf.parse(currentTime); |
| | | Date startTimeDate = sdf.parse(startTime); |
| | | Date endTimeDate = sdf.parse(endTime); |
| | | |
| | | if (currentTimeDate.after(startTimeDate) && currentTimeDate.before(endTimeDate)) { |
| | | isWithinTimeRange = true; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | try { |
| | | parse1 = simpleDateFormat.parse(startDate); |
| | | parse2 = simpleDateFormat.parse(endDate); |
| | |
| | | CoursePackagePaymentConfig paymentConfig = cppcMapper.selectById(tCoursePackageDiscount.getCoursePackagePaymentConfigId()); |
| | | resde.setCourseHours(paymentConfig.getClassHours()); |
| | | resde.setDonateHours(cashPayment); |
| | | resde.setCoin(paymentConfig.getPlayPaiCoin()); |
| | | resde.setDataTime("今日"); |
| | | resde.setDate(localTime); |
| | | resde.setOriginalPrice(paymentConfig.getCashPayment()); |
| | | resde.setStatus(1); |
| | | if (isWithinTimeRange) { |
| | | resde.setStatus(1); |
| | | }else { |
| | | resde.setStatus(2); |
| | | |
| | | } |
| | | GetDistanceVo distanceVo = new GetDistanceVo(); |
| | | distanceVo.setLatitude(lat); |
| | | distanceVo.setLongitude(lon); |
| | |
| | | resde.setCourseHours(paymentConfig.getClassHours()); |
| | | resde.setDonateHours(cashPayment); |
| | | String weekOfDate = ""; |
| | | resde.setCoin(paymentConfig.getPlayPaiCoin()); |
| | | if (weekStr != 7 && tempDate.equals(tomorrowDate)) { |
| | | weekOfDate = "明日"; |
| | | } else { |
| | |
| | | packageResponse.setCoursePackageDiscountId(coursePackageId); |
| | | |
| | | TCoursePackage coursePackage = tcpMapper.selectById(coursePackageId); |
| | | |
| | | packageResponse.setType(coursePackage.getType()); |
| | | packageResponse.setCoverDrawing(coursePackage.getCoverDrawing()); |
| | | packageResponse.setIntroduceDrawing(coursePackage.getIntroduceDrawing()); |
| | | packageResponse.setCoursePackageName(coursePackage.getName()); |
| | | packageResponse.setDetailDrawing(coursePackage.getDetailDrawing()); |
| | | // packageResponse.setPayType(coursePackage.getPayType()); |
| | | |
| | | |
| | | if (coursePackage.getType()==2) { |
| | | Date startTime = coursePackage.getStartTime(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd"); |
| | | String formattedDate = sdf.format(startTime); |
| | | |
| | | Date endTime = coursePackage.getEndTime(); |
| | | String formattedDate1 = sdf.format(endTime); |
| | | |
| | | packageResponse.setHoliTime(formattedDate +"-"+ formattedDate1); |
| | | |
| | | } |
| | | Store store = sreClient.queryStoreById(coursePackage.getStoreId()); |
| | | packageResponse.setStoreNameAddr(store.getName() +"(" +store.getAddress()+")"); |
| | | GetDistanceVo distanceVo = new GetDistanceVo(); |
| | | |
| | | distanceVo.setLatitude(lat); |
| | | distanceVo.setLongitude(lon); |
| | | distanceVo.setStoreId(coursePackage.getStoreId()); |
| | | String s = sreClient.calculateDistance(distanceVo); |
| | | packageResponse.setDistance(Double.valueOf(s)); |
| | | |
| | | if(ToolUtil.isNotEmpty(lon) && ToolUtil.isNotEmpty(lat)){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(lon + "," + lat, store.getLon() + "," + store.getLat()); |
| | | double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | packageResponse.setDistance(wgs84); |
| | | } |
| | | |
| | | // distanceVo.setLatitude(lat); |
| | | // distanceVo.setLongitude(lon); |
| | | // distanceVo.setStoreId(coursePackage.getStoreId()); |
| | | // String s = sreClient.calculateDistance(distanceVo); |
| | | // |
| | | // |
| | | // packageResponse.setDistance(Double.valueOf(s)); |
| | | if (coursePackageDiscount.getType() == 1 || coursePackageDiscount.getType() == 2){ |
| | | return packageResponse; |
| | | } |
| | |
| | | CoursePackagePaymentConfig paymentConfig = cppcMapper.selectById(coursePackageDiscount.getCoursePackagePaymentConfigId()); |
| | | if (coursePackageDiscount.getType() == 3 ||coursePackageDiscount.getType() == 4){ |
| | | Double cashPayment = jsonObject.getDouble("cashPayment"); |
| | | |
| | | if(ToolUtil.isNotEmpty(paymentConfig.getCashPayment()) && paymentConfig.getCashPayment()>0 && ToolUtil.isNotEmpty(paymentConfig.getPlayPaiCoin()) && paymentConfig.getPlayPaiCoin()>0 ){ |
| | | packageResponse.setPayType(3); |
| | | }else if(ToolUtil.isNotEmpty(paymentConfig.getCashPayment()) && paymentConfig.getCashPayment()>0){ |
| | | packageResponse.setPayType(1); |
| | | }else if( ToolUtil.isNotEmpty(paymentConfig.getPlayPaiCoin()) && paymentConfig.getPlayPaiCoin()>0 ){ |
| | | packageResponse.setPayType(2); |
| | | } |
| | | |
| | | packageResponse.setClassHours(paymentConfig.getClassHours()); |
| | | packageResponse.setCostPrice(paymentConfig.getCashPayment()); |
| | | packageResponse.setDiscountPrice(cashPayment); |
| | | if (paymentConfig.getPlayPaiCoin()!=null) { |
| | | packageResponse.setWanpaiGold(paymentConfig.getPlayPaiCoin()); |
| | | } |
| | | if (cashPayment!=null) { |
| | | packageResponse.setDiscountPrice(cashPayment); |
| | | |
| | | }else { |
| | | packageResponse.setDiscountPrice(paymentConfig.getCashPayment()); |
| | | packageResponse.setCostPrice(null); |
| | | } |
| | | Integer cashPayment1 = jsonObject.getInteger("hour"); |
| | | packageResponse.setFreeClassHours(cashPayment1); |
| | | }else { |
| | | packageResponse.setClassHours(paymentConfig.getClassHours()); |
| | | |
| | |
| | | } |
| | | packageResponse.setWeekTime(courWeeks.toString()); |
| | | } |
| | | packageResponse.setTime(coursePackage.getClassStartTime()+"-"+coursePackage.getClassEndTime()); |
| | | |
| | | String classStartTime = coursePackage.getClassStartTime(); |
| | | String classEndTime = coursePackage.getClassEndTime(); |
| | | ArrayList<String> classTime = new ArrayList<>(); |
| | | String[] split4 = classStartTime.split(","); |
| | | String[] split3 = classEndTime.split(","); |
| | | if(ToolUtil.isNotEmpty(classStartTime)){ |
| | | for (int i = 0; i < split4.length; i++) { |
| | | String s = split4[i].substring(0,5) + "-" + split3[i].substring(0,5); |
| | | classTime.add(s); |
| | | } |
| | | } |
| | | |
| | | String classTimeAsString = String.join(" | ", classTime); |
| | | |
| | | |
| | | |
| | | packageResponse.setTime(classTimeAsString); |
| | | |
| | | return packageResponse; |
| | | } |
| | |
| | | } |
| | | List<CoursePackageStudent> coursePackageStudents = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | | .eq("coursePackageId",coursePackage.getId()) |
| | | .eq("studentId",appUserId )); |
| | | .eq("appUserId",appUserId )); |
| | | |
| | | List<Long> ids = new ArrayList<>(); |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudents) { |
| | | ids.add(coursePackageStudent.getCoursePackageSchedulingId()); |
| | | } |
| | | List<CoursePackageScheduling> cps =new ArrayList<>(); |
| | | |
| | | if (!ids.isEmpty()) { |
| | | cps = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>().in("id", ids)); |
| | | } |
| | | Integer counts = 0; |
| | | |
| | | for (CoursePackageScheduling cp : cps) { |
| | | if (cp.getDeductClassHour()!=null) { |
| | | counts = counts + cp.getDeductClassHour(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Integer counts = cpsMapper.selectCount(new QueryWrapper<CoursePackageStudent>() |
| | | // .eq("coursePackageId",coursePackage.getId()) |
| | | // .eq("appUserId",appUserId )); |
| | | |
| | | if (coursePackageStudents.size() > 0 ){ |
| | | registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | // registerCourseVo.setCourseNums(coursePackageStudents.size() * 2); |
| | | registerCourseVo.setCourseNums(counts); |
| | | } |
| | | registerCourseVo.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | courseVos.add(registerCourseVo); |
| | |
| | | return courseVos; |
| | | } |
| | | |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService coursePackagePaymentConfigService; |
| | | |
| | | @Autowired |
| | | private TCoursePackageDiscountService coursePackageDiscountService; |
| | | |
| | | @Override |
| | | public CourseDetailsResponse queryRegisteredCourseDetails(Long coursePayId, Integer appUserId) { |
| | | AppUser appUser = appuClient.queryAppUser(appUserId); |
| | | CourseDetailsResponse response = new CourseDetailsResponse(); |
| | | TCoursePackagePayment tCoursePackagePayment = this.baseMapper.selectById(coursePayId); |
| | | |
| | | if (null != tCoursePackagePayment){ |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | if (coursePackage.getType()==2) { |
| | | response.setTime(new SimpleDateFormat("yyyy-MM-dd").format(coursePackage.getStartTime()) + "-" + new SimpleDateFormat("yyyy-MM-dd").format(coursePackage.getEndTime())); |
| | | response.setTime(new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getStartTime()) + "-" + new SimpleDateFormat("yyyy.MM.dd").format(coursePackage.getEndTime())); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | switch (payType) { |
| | | case 1: |
| | | case 2: |
| | | response.setAmount(cashPaymentValue); |
| | | response.setVipAmount(discountMember); |
| | | break; |
| | | case 3: |
| | | response.setWpGold(playPaiCoin); |
| | | break; |
| | | } |
| | | // switch (payType) { |
| | | // case 1: |
| | | // case 2: |
| | | // response.setAmount(cashPaymentValue); |
| | | // response.setVipAmount(discountMember); |
| | | // break; |
| | | // case 3: |
| | | // response.setWpGold(playPaiCoin); |
| | | // break; |
| | | // } |
| | | |
| | | // coursePackage.get |
| | | |
| | | |
| | | response.setPayStatus(tCoursePackagePayment.getPayStatus()); |
| | | |
| | | |
| | | List<CoursePackagePaymentConfigVo> list = new ArrayList<>(); |
| | | List<CoursePackagePaymentConfig> list1 = coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackage.getId()).orderByAsc("classHours")); |
| | | list1.forEach(coursePackagePaymentConfig -> { |
| | | CoursePackagePaymentConfigVo coursePackagePaymentConfigVo = new CoursePackagePaymentConfigVo(); |
| | | coursePackagePaymentConfigVo.setId(coursePackagePaymentConfig.getId()); |
| | | coursePackagePaymentConfigVo.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentConfigVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | |
| | | if(ToolUtil.isNotEmpty(coursePackagePaymentConfig.getCashPayment()) && coursePackagePaymentConfig.getCashPayment()>0 && ToolUtil.isNotEmpty(coursePackagePaymentConfig.getPlayPaiCoin()) && coursePackagePaymentConfig.getPlayPaiCoin()>0 ){ |
| | | coursePackagePaymentConfigVo.setPayType(3); |
| | | }else if(ToolUtil.isNotEmpty(coursePackagePaymentConfig.getCashPayment()) && coursePackagePaymentConfig.getCashPayment()>0){ |
| | | coursePackagePaymentConfigVo.setPayType(1); |
| | | }else if( ToolUtil.isNotEmpty(coursePackagePaymentConfig.getPlayPaiCoin()) && coursePackagePaymentConfig.getPlayPaiCoin()>0 ){ |
| | | coursePackagePaymentConfigVo.setPayType(2); |
| | | } |
| | | |
| | | // coursePackagePaymentConfigVo.setPayType(coursePackage.getPayType()); |
| | | //会员显示原价和支付价(会员价)。非会员显示会员价和支付价(最低) |
| | | if(appUser.getIsVip() == 0){//非会员 |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount1 : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount1.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setVipPrice(vipPrice); |
| | | Double paymentPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | List<TCoursePackageDiscount> list3 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 3).eq("auditStatus", 2)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (TCoursePackageDiscount coursePackageDiscount2 : list3) { |
| | | /** |
| | | * [{ |
| | | * "startDate": "2023-01-01 00:00:00", |
| | | * "endDate": "2023-12-31 23:59:59", |
| | | * "startTime": "02:00:00", |
| | | * "endTime": "23:00:00", |
| | | * "weeks": [1, 2, 7], |
| | | * "cashPayment": 100 |
| | | * }] |
| | | */ |
| | | JSONArray jsonArray = JSON.parseArray(coursePackageDiscount2.getContent()); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | try { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String startDate = jsonObject.getString("startDate"); |
| | | String endDate = jsonObject.getString("endDate"); |
| | | String startTime = jsonObject.getString("startTime"); |
| | | String endTime = jsonObject.getString("endTime"); |
| | | List<Integer> weeks = jsonObject.getJSONArray("weeks").toJavaList(Integer.class); |
| | | Double cashPayment2 = jsonObject.getDouble("cashPayment"); |
| | | Date startDate_date = sdf.parse(startDate); |
| | | Date endDate_date = sdf.parse(endDate); |
| | | long timeMillis = System.currentTimeMillis(); |
| | | if(timeMillis >= startDate_date.getTime() && timeMillis < endDate_date.getTime()){ |
| | | Date date = new Date(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int week = calendar.get(Calendar.DAY_OF_WEEK); |
| | | boolean isFirstSunday = (calendar.getFirstDayOfWeek() == Calendar.SUNDAY); |
| | | if(isFirstSunday){ |
| | | week = week - 1; |
| | | if(week == 0){ |
| | | week = 7; |
| | | } |
| | | } |
| | | if(!weeks.contains(week)){ |
| | | continue; |
| | | } |
| | | |
| | | String[] split1 = startTime.split(":"); |
| | | Integer hour1 = Integer.valueOf(split1[0]); |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.HOUR_OF_DAY, hour1); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(split1[1])); |
| | | s.set(Calendar.SECOND, Integer.valueOf(split1[2])); |
| | | |
| | | String[] split2 = endTime.split(":"); |
| | | Integer hour2 = Integer.valueOf(split2[0]); |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.HOUR_OF_DAY, hour2); |
| | | e.set(Calendar.MINUTE, Integer.valueOf(split2[1])); |
| | | e.set(Calendar.SECOND, Integer.valueOf(split2[2])); |
| | | |
| | | if(hour1 > hour2){ |
| | | if(s.getTimeInMillis() > date.getTime()){ |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) - 1); |
| | | }else{ |
| | | e.set(Calendar.DAY_OF_YEAR, e.get(Calendar.DAY_OF_YEAR) + 1); |
| | | } |
| | | } |
| | | if(timeMillis >= s.getTimeInMillis() && timeMillis < e.getTimeInMillis() && paymentPrice.compareTo(cashPayment2) > 0){ |
| | | paymentPrice = cashPayment2; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setPaymentPrice(paymentPrice); |
| | | |
| | | if (coursePackagePaymentConfigVo.getPaymentPrice()<coursePackagePaymentConfigVo.getVipPrice()){ |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | coursePackagePaymentConfigVo.setVipPrice(null); |
| | | } |
| | | |
| | | } |
| | | else{ |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount3 : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount3.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setPaymentPrice(vipPrice); |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | } |
| | | list.add(coursePackagePaymentConfigVo); |
| | | }); |
| | | // coursePackageInfo.setList(list); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | return response; |
| | | } |
| | |
| | | |
| | | // int pageNum = 1; // 页码 |
| | | int pageSize = 100; // 每页记录数 |
| | | Page<CoursePackageStudent> page = new Page<>(1, pageSize); |
| | | Page<CoursePackageStudent> page = new Page<>(pageNum, pageSize); |
| | | |
| | | // for (TCoursePackagePayment tCoursePackagePayment : tCoursePackagePayments) { |
| | | // List<CoursePackageStudent> coursePackageStudent1 = cpsMapper.selectList(new QueryWrapper<CoursePackageStudent>() |
| | |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //已取消 |
| | | if (byId.getStatus()==4){ |
| | | recordVo.setStatus(4); |
| | | } else if(coursePackageStudent.getSignInOrNot()==2){ |
| | | //已请假 |
| | | recordVo.setStatus(5); |
| | | } |
| | | else if (start.after(new Date())){ |
| | | //待上课 |
| | | recordVo.setStatus(1); |
| | | } |
| | | // else if(coursePackageStudent.getSignInOrNot()==2){ |
| | |
| | | } |
| | | |
| | | }else { |
| | | recordVo.setStatus(2); |
| | | Date now = new Date(); |
| | | if (now.after(byId.getClassDate())&&now.before(byId.getEndDate())){ |
| | | recordVo.setStatus(2); |
| | | }else { |
| | | recordVo.setStatus(3); |
| | | |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | |
| | | TCoursePackage tCoursePackage = tcpmapper.selectById(req.getCourseId()); |
| | | // 添加课包 |
| | | TCoursePackagePayment tCoursePackagePayment1 = new TCoursePackagePayment(); |
| | | tCoursePackagePayment1.setAppUserId(userId); |
| | | Student student = studentClient.queryDefaultStudent(userId); |
| | | // student ID |
| | | Integer sId=null; |
| | | if(student!=null){ |
| | | tCoursePackagePayment1.setStudentId(student.getId()); |
| | | sId=student.getId(); |
| | | } |
| | | // tCoursePackagePayment1.setAppUserId(userId); |
| | | // Student student = studentClient.queryDefaultStudent(userId); |
| | | // // student ID |
| | | // |
| | | // Integer sId=null; |
| | | // if(student!=null){ |
| | | // tCoursePackagePayment1.setStudentId(student.getId()); |
| | | // sId=student.getId(); |
| | | // } |
| | | tCoursePackagePayment1.setCoursePackageId(tCoursePackage.getId()); |
| | | tCoursePackagePayment1.setStudentId(req.getStuId()); |
| | | tCoursePackagePayment1.setPayType(7); |
| | | tCoursePackagePayment1.setClassHours(req.getNum()); |
| | | tCoursePackagePayment1.setOriginalPrice(0.0); |
| | |
| | | tCoursePackagePayment1.setPayStatus(2); |
| | | tCoursePackagePayment1.setPayUserId(userId); |
| | | tCoursePackagePayment1.setStatus(1); |
| | | tCoursePackagePayment1.setAppUserId(userId); |
| | | tCoursePackagePayment1.setState(1); |
| | | tCoursePackagePayment1.setInsertTime(new Date()); |
| | | this.baseMapper.insert(tCoursePackagePayment1); |
| | |
| | | |
| | | CoursePackageStudent student1 = new CoursePackageStudent(); |
| | | student1.setAppUserId(userId); |
| | | student1.setStudentId(sId); |
| | | student1.setStudentId(req.getStuId()); |
| | | student1.setCoursePackageId(tCoursePackage.getId()); |
| | | student1.setCoursePackagePaymentId(tCoursePackagePayment1.getId()); |
| | | student1.setCoursePackageSchedulingId(coursePackageScheduling.getId()); |
| | |
| | | coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | } |
| | | //会员显示原价和会员价(最低)。非会员显示会员价和支付价(最低) |
| | | if(appUser.getIsVip() == 0){//非会员 |
| | | // if(appUser.getIsVip() == 0){//非会员 |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2).eq("status",1)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | |
| | | } |
| | | } |
| | | coursePackageListVo.setVipPrice(vipPrice); |
| | | coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | |
| | | Double paymentPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | List<TCoursePackageDiscount> list3 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | List<TCoursePackageDiscount> list3 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 3).eq("auditStatus", 2).eq("status",1)); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list3) { |
| | |
| | | } |
| | | } |
| | | coursePackageListVo.setPaymentPrice(paymentPrice); |
| | | }else{ |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2).eq("status",1)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | | } |
| | | coursePackageListVo.setPaymentPrice(vipPrice); |
| | | coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | } |
| | | |
| | | double vipPrice1 = coursePackageListVo.getVipPrice(); |
| | | double originalPrice1 = coursePackageListVo.getOriginalPrice(); |
| | | double paymentPrice1 = coursePackageListVo.getPaymentPrice(); |
| | | |
| | | double minPrice = Math.min(vipPrice1, Math.min(originalPrice1, paymentPrice1)); |
| | | double maxPrice = Math.max(vipPrice1, Math.max(originalPrice1, paymentPrice1)); |
| | | coursePackageListVo.setPaymentPrice(minPrice); |
| | | coursePackageListVo.setOriginalPrice(maxPrice); |
| | | System.out.println("Minimum price: " + minPrice); |
| | | System.out.println("Maximum price: " + maxPrice); |
| | | // } |
| | | // else{ |
| | | // List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | // .eq("type", 1).eq("auditStatus", 2).eq("status",1)); |
| | | // Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | // for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | // Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | // if(vipPrice.compareTo(num1) > 0){ |
| | | // vipPrice = num1; |
| | | // } |
| | | // } |
| | | // coursePackageListVo.setPaymentPrice(vipPrice); |
| | | // coursePackageListVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | // } |
| | | |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(coursePackageList.getLon() + "," + coursePackageList.getLat(), store.getLon() + "," + store.getLat()); |
| | | coursePackageListVo.setDistance(distance.get("WGS84") / 1000); |
| | |
| | | |
| | | coursePackageInfo.setDetailDrawing(coursePackage.getDetailDrawing()); |
| | | coursePackageInfo.setIntroduceDrawing(coursePackage.getIntroduceDrawing()); |
| | | |
| | | |
| | | List<CoursePackagePaymentConfigVo> list = new ArrayList<>(); |
| | | List<CoursePackagePaymentConfig> list1 = coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", id).orderByAsc("classHours")); |
| | | list1.forEach(coursePackagePaymentConfig -> { |
| | |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setVipPrice(vipPrice); |
| | | |
| | | Double paymentPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | List<TCoursePackageDiscount> list3 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 3).eq("auditStatus", 2)); |
| | |
| | | } |
| | | } |
| | | coursePackagePaymentConfigVo.setPaymentPrice(paymentPrice); |
| | | }else{ |
| | | |
| | | if (coursePackagePaymentConfigVo.getPaymentPrice()<coursePackagePaymentConfigVo.getVipPrice()){ |
| | | coursePackagePaymentConfigVo.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | coursePackagePaymentConfigVo.setVipPrice(null); |
| | | } |
| | | |
| | | } |
| | | else{ |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | |
| | | //校验是否已经报满 |
| | | Integer integer = coursePackagePaymentService.queryCountNumber(paymentCourseVo.getId()); |
| | | TCoursePackage course = coursePackageService.getById(paymentCourseVo.getId()); |
| | | if (integer+paymentCourseVo.getStudentIds().split(";").length>course.getMaxSubscribeNumber()){ |
| | | return ResultUtil.error("报名失败,已达最大报名人数"); |
| | | if (course.getType()!=3) { |
| | | |
| | | if (integer + paymentCourseVo.getStudentIds().split(";").length > course.getMaxSubscribeNumber()) { |
| | | return ResultUtil.error("报名失败,已达最大报名人数"); |
| | | } |
| | | } |
| | | List<CoursePackagePaymentConfigVo> list = coursePackageInfo.getList(); |
| | | String[] students = paymentCourseVo.getStudentIds().split(";"); |
| | |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | }else { |
| | | coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setCode(code); |
| | | |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | coursePackagePaymentServiceOne.setPayStatus(1); |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | |
| | | // coursePackagePaymentService.save(coursePackagePayment); |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | } |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | |
| | | |
| | | // addPackageStudent(paymentCourseVo.getId(), uid, Integer.valueOf(s), coursePackagePaymentServiceOne.getId()); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("续课"); |
| | | courseCounsumService.save(courseCounsum); |
| | | // coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | // coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | // coursePackagePaymentServiceOne.setCode(code); |
| | | // |
| | | // coursePackagePaymentServiceOne.setAppUserId(null); |
| | | // coursePackagePaymentServiceOne.setPayStatus(2); |
| | | // coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | // |
| | | // Integer sId = null; |
| | | // Student student = studentClient.queryDefaultStudent(uid); |
| | | // if (student != null) { |
| | | // sId = student.getId(); |
| | | // } |
| | | // coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | // |
| | | // |
| | | // CourseCounsum courseCounsum = new CourseCounsum(); |
| | | // courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | // courseCounsum.setChangeType(1); |
| | | // courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | // courseCounsum.setInsertTime(new Date()); |
| | | // courseCounsum.setReason("续课"); |
| | | // courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | } |
| | |
| | | coursePackagePayment.setOrderNumber(tradeNo); |
| | | coursePackagePayment.setAppUserId(null); |
| | | } |
| | | |
| | | for (String s1 : split) { |
| | | TCoursePackagePayment coursePackagePaymentServiceOne = coursePackagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", s).eq("coursePackageId", paymentCourseVo.getId())); |
| | | if (coursePackagePaymentServiceOne!=null) { |
| | | coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | coursePackagePaymentServiceOne.setTotalClassHours(coursePackagePaymentServiceOne.getTotalClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setLaveClassHours(coursePackagePaymentServiceOne.getLaveClassHours()+coursePackagePaymentConfig.getClassHours()); |
| | | coursePackagePaymentServiceOne.setCode(code); |
| | | |
| | | coursePackagePaymentServiceOne.setAppUserId(null); |
| | | coursePackagePaymentServiceOne.setPayStatus(2); |
| | | coursePackagePaymentService.updateById(coursePackagePaymentServiceOne); |
| | | |
| | | Integer sId = null; |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | if (student != null) { |
| | | sId = student.getId(); |
| | | } |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(coursePackagePaymentServiceOne.getPlayPaiCoin()+paymentPrice.intValue()); |
| | | |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(coursePackagePaymentServiceOne.getId()); |
| | | courseCounsum.setChangeType(1); |
| | | courseCounsum.setNum(coursePackagePaymentConfig.getClassHours()); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("续课"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | coursePackagePaymentService.updateBatchById(list); |
| | | System.out.println("===========到达支付"); |
| | | // 2.0 |
| | |
| | | courseCounsum.setReason("购买课包"); |
| | | courseCounsumService.save(courseCounsum); |
| | | |
| | | }else { |
| | | }else{ |
| | | coursePackagePaymentServiceOne.setClassHours(coursePackagePaymentServiceOne.getClassHours()+coursePackagePaymentConfig.getClassHours()+hour); |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice()+paymentCourseVo.getPrice()); |
| | | if (coursePackagePaymentServiceOne.getOriginalPrice()!=null) { |
| | | coursePackagePaymentServiceOne.setOriginalPrice(coursePackagePaymentServiceOne.getOriginalPrice() + paymentCourseVo.getPrice()); |
| | | }else { |
| | | coursePackagePaymentServiceOne.setOriginalPrice(paymentCourseVo.getPrice()); |
| | | } |
| | | if (coursePackagePaymentServiceOne.getPlayPaiCoin()==null){ |
| | | coursePackagePaymentServiceOne.setPlayPaiCoin(paymentPrice.intValue()); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | }else if (tCoursePackage.getType()==3){ |
| | | |
| | | if (price!=null) { |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | courseCounsum.setPaymentId(paymentId); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("购买体验课;" + price); |
| | | courseCounsum.setAppUserId(userId); |
| | | courseCounsumService.save(courseCounsum); |
| | | } |
| | | |
| | | |
| | | //生成当天的排课记录 |
| | | |
| | | //生成学员的上课表 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | studentId, |
| | | signInOrNot, |
| | | reservationStatus |
| | | from t_course_package_student where coursePackageSchedulingId = #{coursePackageSchedulingId} |
| | | from t_course_package_student where 1=1 |
| | | <if test="ids != null and ids.size() > 0"> |
| | | and coursePackageSchedulingId in |
| | | <foreach collection="ids" close=")" item="id" open="(" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | and reservationStatus != 3 |
| | | <if test="null != userId"> |
| | | and appUserId in |
| | |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") |
| | | void editCoursePackageScheduling(CoursePackageScheduling coursePackageScheduling); |
| | | void editCoursePackageScheduling(List<CoursePackageScheduling> coursePackageScheduling); |
| | | |
| | | |
| | | @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") |
| | |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageStudentList; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/coursePackageStudent/queryByCoursePackageSchedulingId") |
| | | List<CoursePackageStudent> queryByCoursePackageSchedulingId(Long coursePackageSchedulingId); |
| | | List<CoursePackageStudent> queryByCoursePackageSchedulingId(@RequestBody List<Long> coursePackageSchedulingId); |
| | | |
| | | |
| | | /** |
| | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",store.getId().toString()); |
| | | map.put("area_id",integer1.toString()); |
| | | map.put("space_id",integer1.toString()); |
| | | map.put("area_id",store.getId().toString()); |
| | | String s = HttpRequestUtil.postRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | // 添加门禁 |
| | |
| | | for (String s1 : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id", store.getId().toString() + ""); |
| | | map1.put("space_id", integer1 + ""); |
| | | map1.put("device_id", s1); |
| | | map1.put("region_id", integer1 + ""); |
| | | map1.put("region_id", store.getId().toString() + ""); |
| | | String s2 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println("添加闸机:" + s2); |
| | | } |
| | |
| | | for (String s : site.getIds().split(",")) { |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign", "0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map1.put("space_id", site.getId() + ""); |
| | | map1.put("space_id", store.getId() + ""); |
| | | map1.put("device_id", s); |
| | | map1.put("region_id", store.getId() + ""); |
| | | map1.put("region_id", site.getId() + ""); |
| | | // 添加门禁 |
| | | String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map1); |
| | | System.out.println(s1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil cancelClassSchedule(Long id) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | if(coursePackageScheduling.getStatus() != 1){ |
| | | return ResultUtil.error("不能取消本次"); |
| | | |
| | | // List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | // List<Long> integers = new ArrayList<>(); |
| | | // for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | // integers.add(coursePackageScheduling.getId()); |
| | | // } |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | List<Long> integers = new ArrayList<>(); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | integers.add(coursePackageScheduling.getId()); |
| | | coursePackageScheduling.setStatus(4); |
| | | } |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(id); |
| | | if(coursePackageStudents.size() > 0){ |
| | | |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageSchedulings); |
| | | |
| | | |
| | | |
| | | // CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | // if(coursePackageScheduling.getStatus() != 1){ |
| | | // return ResultUtil.error("不能取消本次"); |
| | | } |
| | | coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setId(id); |
| | | coursePackageScheduling.setStatus(4); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(id); |
| | | // if(coursePackageStudents.size() > 0){ |
| | | //// return ResultUtil.error("不能取消本次"); |
| | | // } |
| | | // coursePackageScheduling = new CoursePackageScheduling(); |
| | | // coursePackageScheduling.setId(id); |
| | | // coursePackageScheduling.setStatus(4); |
| | | // coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil afterClassExercises(Long id, Integer courseId, Integer integral) { |
| | | CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | if(coursePackageScheduling.getStatus() != 3){ |
| | | return ResultUtil.error("不能发布课后练习"); |
| | | // CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | |
| | | // List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | |
| | | |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | List<Long> integers = new ArrayList<>(); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | integers.add(coursePackageScheduling.getId()); |
| | | coursePackageScheduling.setCourseId(courseId); |
| | | } |
| | | coursePackageScheduling.setCourseId(courseId); |
| | | coursePackageScheduling.setIntegral(integral); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageSchedulings); |
| | | |
| | | // for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | // integers.add(coursePackageScheduling.getId()); |
| | | // if(coursePackageScheduling.getStatus() != 3){ |
| | | // return ResultUtil.error("不能发布课后练习"); |
| | | // } |
| | | // coursePackageScheduling.setCourseId(courseId); |
| | | // coursePackageScheduling.setIntegral(integral); |
| | | // coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | // } |
| | | |
| | | // if(coursePackageScheduling.getStatus() != 3){ |
| | | // return ResultUtil.error("不能发布课后练习"); |
| | | // } |
| | | // coursePackageScheduling.setCourseId(courseId); |
| | | // coursePackageScheduling.setIntegral(integral); |
| | | // coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | // CoursePackageScheduling coursePackageScheduling = coursePackageSchedulingClient.queryCoursePackageSchedulingById(id); |
| | | |
| | | List<CoursePackageScheduling> coursePackageSchedulings = coursePackageSchedulingClient.queryCoursePackageSchedulingsById(id); |
| | | |
| | | List<Long> integers = new ArrayList<>(); |
| | | for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | |
| | | if(coursePackageScheduling.getStatus() == 1 || coursePackageScheduling.getStatus() == 4){ |
| | | return ResultUtil.error("不能添加消课凭证"); |
| | | integers.add(coursePackageScheduling.getId()); |
| | | coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | } |
| | | coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageScheduling); |
| | | |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(id); |
| | | |
| | | // for (CoursePackageScheduling coursePackageScheduling : coursePackageSchedulings) { |
| | | |
| | | // if(coursePackageScheduling.getStatus() == 1 || coursePackageScheduling.getStatus() == 4){ |
| | | // return ResultUtil.error("不能添加消课凭证"); |
| | | // } |
| | | // coursePackageScheduling.setCancelClasses(cancelClasses); |
| | | // coursePackageScheduling.setDeductClassHour(deductClassHour); |
| | | coursePackageSchedulingClient.editCoursePackageScheduling(coursePackageSchedulings); |
| | | |
| | | List<CoursePackageStudent> coursePackageStudents = coursePackageStudentClient.queryByCoursePackageSchedulingId(integers); |
| | | for (CoursePackageStudent coursePackageStudent : coursePackageStudents) { |
| | | if(coursePackageStudent.getReservationStatus() == 0){ |
| | | continue; |
| | |
| | | |
| | | |
| | | } |
| | | } |
| | | // } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.SiteLock; |
| | | import com.dsh.other.entity.TGame; |
| | | import com.dsh.other.entity.TGameConfig; |
| | | import com.dsh.other.entity.TGameRecord; |
| | | import com.dsh.other.entity.*; |
| | | import com.dsh.other.feignclient.CourseRecordClient; |
| | | import com.dsh.other.feignclient.account.AppUserClient; |
| | | import com.dsh.other.feignclient.account.model.AppUser; |
| | | import com.dsh.other.model.QueryMySiteVo; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Resource |
| | | private CourseRecordClient courseRecordClient; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("code", code).eq("payType", 3)); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("number", code).eq("payType", 2)); |
| | | TGameRecord one = list.get(0); |
| | | if(one.getStatus() == 1){ |
| | | break; |
| | |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setMoney(config.getCash()); |
| | | coursePackagePayment.setOrderNo(tradeNo); |
| | | |
| | | CourseCounsum courseCounsum = new CourseCounsum(); |
| | | // courseCounsum.setPaymentId(paymentId); |
| | | courseCounsum.setChangeType(3); |
| | | courseCounsum.setInsertTime(new Date()); |
| | | courseCounsum.setReason("智慧球场;" + config.getCash()); |
| | | courseCounsum.setAppUserId(uid); |
| | | courseRecordClient.save(courseCounsum); |
| | | |
| | | } |
| | | gameRecordService.updateBatchById(list); |
| | | Integer integer = startGame(uid, gameId, spaceId, sutuId); |
| | |
| | | return one1; |
| | | } |
| | | |
| | | if (one.getLevel().equals("10")){ |
| | | if (one.getLevel()==10){ |
| | | return one; |
| | | } |
| | | HonorRules one2 = honorRulesService.getOne(new QueryWrapper<HonorRules>().eq("type", integers.get(0)).eq("level", Integer.valueOf(one.getLevel()) + 1)); |
| | |
| | | @PostMapping("/queryProtocol") |
| | | @ApiOperation(value = "获取各种协议", tags = {"用户—登录注册"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=运动安全公告书)", name = "type", dataType = "int", required = true) |
| | | @ApiImplicitParam(value = "类型(1=用户协议,2=隐私协议,3=运动安全公告书,4=注销协议)", name = "type", dataType = "int", required = true) |
| | | }) |
| | | public ResultUtil<String> queryProtocol(Integer type){ |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.other.model.dto.siteDto.StoreInfoDto; |
| | | import com.dsh.other.service.*; |
| | | import com.dsh.other.util.GDMapGeocodingUtil; |
| | | import com.dsh.other.util.GeodesyUtil; |
| | | 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.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | String current = distanceVo.getLongitude()+","+distanceVo.getLatitude(); |
| | | Store store = storeService.getById(distanceVo.getStoreId()); |
| | | String result = store.getLon()+","+store.getLat(); |
| | | return gdMapGeocodingUtil.getDistanceTOKilometer(current, result); |
| | | |
| | | |
| | | if(ToolUtil.isNotEmpty(distanceVo.getLongitude()) && ToolUtil.isNotEmpty(distanceVo.getLatitude())){ |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(distanceVo.getLongitude() + "," + distanceVo.getLatitude(), store.getLon() + "," + store.getLat()); |
| | | double wgs84 = new BigDecimal(distance.get("WGS84")).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | // packageResponse.setDistance(wgs84); |
| | | return wgs84+""; |
| | | } |
| | | return ""; |
| | | |
| | | // return gdMapGeocodingUtil.getDistanceTOKilometer(current, result); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/protocol/storeDetail/citycodeLoLa") |
| | | public List<StoreDetailList> getQueryStoreList(@RequestBody StoreOfCitycodeResp citycodeResp){ |
| | | public List<StoreDetailList> getQueryStoreList(@RequestBody StoreOfCitycodeResp citycodeResp) throws Exception { |
| | | List<StoreDetailList> detailLists = new ArrayList<>(); |
| | | |
| | | if (citycodeResp.getCityCode()==null){ |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(citycodeResp.getLongitude(), citycodeResp.getLatitude()); |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | citycodeResp.setCityCode(cityCode); |
| | | } |
| | | |
| | | List<Store> list = storeService.list(new QueryWrapper<Store>() |
| | | .eq("state",1 ) |
| | | .eq("cityCode",citycodeResp.getCityCode())); |
| | | if (list.size() > 0 ){ |
| | | if (ToolUtil.isEmpty(citycodeResp.getLongitude()) && ToolUtil.isEmpty(citycodeResp.getLatitude())){ |
| | | return detailLists; |
| | | } |
| | | // if (ToolUtil.isEmpty(citycodeResp.getLongitude()) && ToolUtil.isEmpty(citycodeResp.getLatitude())){ |
| | | // return detailLists; |
| | | // } |
| | | for (Store store : list) { |
| | | String current = citycodeResp.getLongitude() +","+citycodeResp.getLatitude(); |
| | | String result = store.getLon()+","+store.getLat(); |
| | | String distanceTOKilometer = gdMapGeocodingUtil.getDistanceTOKilometer(current, result); |
| | | long l = Long.parseLong(distanceTOKilometer); |
| | | // 取5公里范围内的门店 |
| | | if ( l > 5){ |
| | | continue; |
| | | } |
| | | // long l = Long.parseLong(distanceTOKilometer); |
| | | //// 取5公里范围内的门店 |
| | | // if ( l > 5){ |
| | | // continue; |
| | | // } |
| | | StoreDetailList detailList = new StoreDetailList(); |
| | | detailList.setStoreId(store.getId()); |
| | | detailList.setStoreImg(store.getCoverDrawing()); |
| | | detailList.setStoreName(store.getName()); |
| | | detailList.setStoreAddress(store.getAddress()); |
| | | detailList.setStorePhone(store.getPhone()); |
| | | detailList.setStoreDistance(l); |
| | | // detailList.setStoreDistance(l); |
| | | detailList.setStoreTime(store.getStartTime() + "-" + store.getEndTime()); |
| | | detailList.setStoreInfo(store.getIntroduce()); |
| | | detailLists.add(detailList); |
| | |
| | | if(list.size()>0){ |
| | | tStoreOtherConfigTrues= tStoreOtherConfigTrueService.list(new LambdaQueryWrapper<TStoreOtherConfigTrue>().in(TStoreOtherConfigTrue::getPid, list.stream().map(TStoreOther::getId).collect(Collectors.toList())).eq(TStoreOtherConfigTrue::getState,1)); |
| | | } |
| | | for (TStoreOtherConfigTrue tStoreOtherConfigTrue : tStoreOtherConfigTrues) { |
| | | for (TStoreOther tStoreOther : list) { |
| | | if (tStoreOtherConfigTrue.getPid()==tStoreOther.getId()){ |
| | | tStoreOtherConfigTrue.setSort(tStoreOther.getSort()); |
| | | } |
| | | } |
| | | } |
| | | return ResultUtil.success(tStoreOtherConfigTrues); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Data |
| | | @TableName("t_course_consum") |
| | | public class CourseCounsum { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | Integer id; |
| | | @TableField("changeType") |
| | | Integer changeType; |
| | | @TableField("num") |
| | | Integer num; |
| | | @TableField("reason") |
| | | String reason; |
| | | @TableField("paymentId") |
| | | Long paymentId; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") |
| | | @TableField("insertTime") |
| | | Date insertTime; |
| | | @TableField("appUserId") |
| | | Integer appUserId; |
| | | } |
New file |
| | |
| | | package com.dsh.other.feignclient; |
| | | |
| | | import com.dsh.other.entity.CourseCounsum; |
| | | 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("/base/courseRecord/cancelCourseData") |
| | | Integer cancelCourseRecordClass(@RequestBody Integer courseRecordId); |
| | | |
| | | @PostMapping("/base/courseRecord/save") |
| | | void save(@RequestBody CourseCounsum courseCounsum); |
| | | } |
| | |
| | | private Integer status; |
| | | @ApiModelProperty("创建时间") |
| | | private Long insertTime; |
| | | @ApiModelProperty("支付方式2玩湃币,其他rmb") |
| | | private Integer payType; |
| | | } |
| | |
| | | public List<QuerySiteTimes> querySiteTimes(Integer id, String day,String halfName,String siteName) throws Exception { |
| | | |
| | | System.out.println("=======date======"+day); |
| | | |
| | | List<String> strings = new ArrayList<>(); |
| | | |
| | | // List<SiteBooking> siteBookings = siteClient.listBooks(id); |
| | |
| | | |
| | | |
| | | if (siteName==null|| siteName.equals("")){ |
| | | siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).like("times",day)); |
| | | siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).ne("status",5).like("times",day)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.dsh.other.util.httpClinet.HttpClientUtil; |
| | | import com.dsh.other.util.httpClinet.HttpResult; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | |
| | | |
| | | if(jsonObject.getString("status").equals("1")){ |
| | | JSONObject regeocode = jsonObject.getJSONObject("regeocode"); |
| | | JSONObject addressComponent = regeocode.getJSONObject("addressComponent"); |
| | |
| | | } |
| | | return map; |
| | | } |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | public Map<String, String> geocode1(String lon, String lan) throws Exception{ |
| | | String url = "https://restapi.amap.com/v3/geocode/regeo?key=" + key + "&location=" + lon + "," + lan; |
| | | HttpResult httpResult = HttpClientUtil.pushHttpRequset("GET", url, null, null, "json"); |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | Map<String, String> map = new HashMap<>(); |
| | | |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(lon, lan); |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | map.put("cityCode", cityCode); |
| | | |
| | | // if(jsonObject.getString("status").equals("1")){ |
| | | // JSONObject regeocode = jsonObject.getJSONObject("regeocode"); |
| | | // JSONObject addressComponent = regeocode.getJSONObject("addressComponent"); |
| | | // String address = regeocode.getString("formatted_address"); |
| | | // map.put("address", address); |
| | | // String code = addressComponent.getString("adcode"); |
| | | // String province = addressComponent.getString("province"); |
| | | // String city = addressComponent.getString("city"); |
| | | // String district = addressComponent.getString("district"); |
| | | // map.put("province", province); |
| | | // map.put("provinceCode", code.substring(0, 2) + "0000"); |
| | | // map.put("city", city); |
| | | // map.put("cityCode", code.substring(0, 4) + "00"); |
| | | // map.put("district", district); |
| | | // map.put("districtCode", code); |
| | | // } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | c.lon as storeLon, |
| | | c.lat as storeLat, |
| | | a.payMoney as payMoney, |
| | | a.payType as payType, |
| | | CONCAT(DATE_FORMAT(a.startTime, '%Y-%m-%d %H:%i'), '-', DATE_FORMAT(a.endTime, '%H:%i')) as appointment, |
| | | a.`status`, |
| | | UNIX_TIMESTAMP(a.insertTime) * 1000 as insertTime |