Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryListByIds") |
| | | public List<TStudent> queryListByIds(@RequestBody List<Integer> collect){ |
| | | try { |
| | | List<TStudent> list = studentService.list(new QueryWrapper<TStudent>().in("id",collect).eq("state", 1)); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/student/queryStudentCom") |
| | | public List<Map<String, Object>> queryStudentCom(@RequestBody Integer id){ |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<Goods>> pointsMallList(MallRequest request){ |
| | | try { |
| | | // try { |
| | | System.out.println("======request========"+request); |
| | | return ResultUtil.success(tauService.queryAppUserIntegral(request)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | | List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList getStuSourseList); |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails1") |
| | | List<PurchaseRecordVo> getStuSourseList1(@RequestBody GetStuSourseList getStuSourseList); |
| | | |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo); |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "类型:1增加 2扣减 ", dataType = "int") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "课包id", dataType = "int") |
| | | private Integer lessionId; |
| | | } |
| | |
| | | @Transactional |
| | | public ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeType) { |
| | | System.out.println("exchangeType:--->"); |
| | | System.out.println(exchangeType); |
| | | |
| | | System.out.println(exchangeType); |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | |
| | | return ResultUtil.error("商品不存在"); |
| | | } |
| | | |
| | | |
| | | TAppUser tAppUser = this.baseMapper.selectById(userIdFormRedis); |
| | | |
| | | |
| | | if(merchandise.getUserPopulation()==2){ |
| | | if(tAppUser.getIsVip()==0){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if(merchandise.getUserPopulation()==3){ |
| | | List<TStudent> students = tsmapper.selectList(new LambdaQueryWrapper<TStudent>().eq(TStudent::getAppUserId, userIdFormRedis)); |
| | | if(students.size()==0){ |
| | | return ResultUtil.error("该商品只能已有学员用户购买"); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (ToolUtil.isEmpty(tAppUser)){ |
| | | return ResultUtil.error("用户不存在"); |
| | |
| | | return ResultUtil.error("超过发放数量"); |
| | | } |
| | | |
| | | |
| | | for (int i = 0; i < goodsNums; i++) { |
| | | // 新增积分商品兑换记录 |
| | | UserPointsMerchandise pointsMerchandise = new UserPointsMerchandise(); |
| | | pointsMerchandise.setPointsMerchandiseId(exchangeType.getGoodId()); |
| | | pointsMerchandise.setUserId(userIdFormRedis); |
| | | pointsMerchandise.setStatus(1); |
| | | pointsMerchandise.setState(1); |
| | | pointsMerchandise.setPayStatus(1); |
| | | if (merchandise.getUseScope() == 3){ |
| | | if (exchangeType.getGoodsType() == 2){ |
| | | CoursePackage coursePackage = cpageClient.queryCoursePackageById(merchandise.getCoursePackageId()); |
| | | pointsMerchandise.setStoreId(coursePackage.getStoreId()); |
| | | }else { |
| | | pointsMerchandise.setStoreId(exchangeType.getStoreId()); |
| | | } |
| | | } |
| | | pointsMerchandise.setCode(code); |
| | | mcClient.saveDetailsUserPointMercase(pointsMerchandise); |
| | | } |
| | | |
| | | switch (exchangeType.getExchangeType()){ |
| | | // 积分 |
| | |
| | | break; |
| | | } |
| | | |
| | | for (int i = 0; i < goodsNums; i++) { |
| | | // 新增积分商品兑换记录 |
| | | UserPointsMerchandise pointsMerchandise = new UserPointsMerchandise(); |
| | | pointsMerchandise.setPointsMerchandiseId(exchangeType.getGoodId()); |
| | | pointsMerchandise.setUserId(userIdFormRedis); |
| | | pointsMerchandise.setStatus(1); |
| | | pointsMerchandise.setState(1); |
| | | if (merchandise.getUseScope() == 3){ |
| | | if (exchangeType.getGoodsType() == 2){ |
| | | CoursePackage coursePackage = cpageClient.queryCoursePackageById(merchandise.getCoursePackageId()); |
| | | pointsMerchandise.setStoreId(coursePackage.getStoreId()); |
| | | }else { |
| | | pointsMerchandise.setStoreId(exchangeType.getStoreId()); |
| | | } |
| | | } |
| | | pointsMerchandise.setCode(code); |
| | | mcClient.saveDetailsUserPointMercase(pointsMerchandise); |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | public boolean dealAppUserIntegral(Integer appUserId,TAppUser appUser,Integer points){ |
| | |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code) { |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包续费", "", "", code, cash.toString(), |
| | | System.out.println("金额:"+cash); |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包续费", "课包续费", "", code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentAliCallback"); |
| | | if(alipay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | System.out.println("code:"+code); |
| | | List<UserPointsMerchandise> userPointsMerchandises = mcClient.queryUserPointMerchaseByCode(code); |
| | | System.out.println("list-----"+userPointsMerchandises); |
| | | if(userPointsMerchandises.get(0).getPayStatus() == 2){ |
| | | break; |
| | | } |
| | |
| | | if(timeRequest.getType()!=null){ |
| | | eq.eq(TCourseInfoRecord::getType,timeRequest.getType()); |
| | | } |
| | | if (timeRequest.getLessionId()!=null){ |
| | | eq.eq(TCourseInfoRecord::getCourseId,timeRequest.getLessionId()); |
| | | |
| | | } |
| | | // 2.0其他记录 |
| | | List<TCourseInfoRecord> list = courseInfoRecordService.list(eq); |
| | | List<PurchaseRecordVo> list1=new ArrayList<>(); |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Autowired |
| | | private VipPaymentMapper vipPaymentMapper; |
| | | |
| | | |
| | | |
| | |
| | | * 门票上下架 state=1 上架 state=2 下架 |
| | | */ |
| | | @RequestMapping("/base/pointMerchars/changeState") |
| | | public Object changeState(@RequestBody CoachChangeStateVO dto){ |
| | | return pmdsService.changeState(dto); |
| | | public void changeState(@RequestBody CoachChangeStateVO dto){ |
| | | |
| | | |
| | | pmdsService.changeState(dto); |
| | | } |
| | | /** |
| | | * 门票核销 |
| | | */ |
| | | |
| | | @RequestMapping("/base/course/changeState") |
| | | @ResponseBody |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | return userPointsMerchandiseService.changeState(dto); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/base/pointMerchars/writeOff") |
| | | public Object writeOff(@RequestBody WriteOffDTO dto){ |
| | | UserPointsMerchandise byId = userPointsMerchandiseService.getById(dto.getId()); |
| | |
| | | ProductDetailsVo detailsVo = new ProductDetailsVo(); |
| | | PointsMerchandise merchandise = pmdsService.getById(detailRequest.getGoodId()); |
| | | |
| | | |
| | | |
| | | if (merchandise!=null) { |
| | | detailsVo.setCardType(merchandise.getCardType()); |
| | | } |
| | | switch (detailRequest.getGoodsType()){ |
| | | case 2: |
| | | // 课包 |
| | | CoursePackage coursePackage = cpClient.queryCoursePackageById(merchandise.getCoursePackageId()); |
| | | |
| | | detailsVo.setGoodId(coursePackage.getId()); |
| | | // detailsVo.setGoodId(coursePackage.getId()); |
| | | detailsVo.setGoodId(merchandise.getId()); |
| | | List<String> list1 = new ArrayList<>(); |
| | | list1.add(coursePackage.getCoverDrawing()); |
| | | list1.addAll(Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ","))); |
| | |
| | | }); |
| | | detailsVo.setGoodName(coupon.getName()); |
| | | detailsVo.setBelongsScope(coupon.getUserPopulation()); |
| | | int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | detailsVo.setRedeemedNum(couponNums); |
| | | detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0)); |
| | | // int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | // .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | detailsVo.setRedeemedNum(coupon.getPickUpQuantity()); |
| | | detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - coupon.getPickUpQuantity(), 0)); |
| | | detailsVo.setPerLimit(coupon.getPickUpQuantity()); |
| | | detailsVo.setExchangeType(coupon.getRedemptionMethod()); |
| | | if (coupon.getRedemptionMethod() == 1){ |
| | |
| | | upmseService.updateById(merchandise); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryUserPointMerchaseByCode") |
| | | public List<UserPointsMerchandise> queryUserPointMerchaseByCode(@RequestBody String code){ |
| | | return upmseService.list(new QueryWrapper<UserPointsMerchandise>() |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CourseChangeStateDTO { |
| | | private List<Integer> ids; |
| | | private Integer state; |
| | | } |
| | |
| | | |
| | | List<Map<String, Object>> ticketList(@Param("query") IntegralGoodsOfSearch ofSearch); |
| | | |
| | | int changeState(@Param("query") CoachChangeStateVO dto); |
| | | void changeState(@Param("ids") List<Integer> ids ,@Param("state") Integer state); |
| | | |
| | | void saveCity(@Param("id") Integer id, @Param("province") String province, @Param("provinceCode") String provinceCode, @Param("city") String city, @Param("cityCode") String cityCode); |
| | | |
| | |
| | | List<PointMerchandiseIncomeVo> getAmount(); |
| | | |
| | | |
| | | Object changeState(List<Integer> ids, Integer state); |
| | | } |
| | |
| | | |
| | | List<Map<String, Object>> ticketList(IntegralGoodsOfSearch ofSearch); |
| | | |
| | | Object changeState(CoachChangeStateVO dto); |
| | | void changeState(CoachChangeStateVO dto); |
| | | |
| | | } |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.CourseChangeStateDTO; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.model.PointMerchandiseIncomeVo; |
| | | import com.dsh.activity.model.request.PointMercharsPayedVo; |
| | |
| | | |
| | | List<PointMerchandiseIncomeVo> getAmount(); |
| | | |
| | | Object changeState(CourseChangeStateDTO dto); |
| | | } |
| | |
| | | |
| | | List<BenefitsVideoClassificationListVo> listVos = new ArrayList<>(); |
| | | for (BenefitsVideoClassification benefitsVideoClassification : list) { |
| | | if (benefitsVideoClassification.getState() == 1) { |
| | | BenefitsVideoClassificationListVo benefitsVideoClassificationListVo = new BenefitsVideoClassificationListVo(); |
| | | benefitsVideoClassificationListVo.setId(benefitsVideoClassification.getId()); |
| | | benefitsVideoClassificationListVo.setName(benefitsVideoClassification.getName()); |
| | |
| | | List<BenefitsVideos> list1 = this.list(benefitsVideosQueryWrapper.orderByDesc("insertTime").last(" limit 0, 4")); |
| | | List<BenefitsVideosListVo> lists = new ArrayList<>(); |
| | | for (BenefitsVideos benefitsVideos : list1) { |
| | | if (benefitsVideos.getState()==1) { |
| | | Integer courseId = benefitsVideos.getCourseId(); |
| | | Course course = courseClient.queryCourseById(courseId); |
| | | BenefitsVideosListVo benefitsVideosListVo = new BenefitsVideosListVo(); |
| | |
| | | benefitsVideosListVo.setIntroduce(course.getIntroduce()); |
| | | lists.add(benefitsVideosListVo); |
| | | } |
| | | } |
| | | benefitsVideoClassificationListVo.setList(lists); |
| | | listVos.add(benefitsVideoClassificationListVo); |
| | | } |
| | | } |
| | | return listVos; |
| | | } |
| | |
| | | public List<BenefitsVideosListVo> queryBenefitsVideosList(Integer uid, Integer classificationId, String search, Integer pageSize, Integer pageNo) throws Exception { |
| | | pageSize = (pageSize - 1) * pageNo; |
| | | List<Integer> ids = null; |
| | | |
| | | if(ToolUtil.isNotEmpty(search)){ |
| | | List<Course> courses = courseClient.queryCourseByName(search); |
| | | ids = courses.stream().map(Course::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | List<Map<String, Object>> benefitsVideos = this.baseMapper.queryBenefitsVideosList(uid, classificationId, ids, pageSize, pageNo); |
| | | List<BenefitsVideosListVo> lists = new ArrayList<>(); |
| | | for (Map<String, Object> benefitsVideo : benefitsVideos) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Object changeState(CoachChangeStateVO dto) { |
| | | return this.baseMapper.changeState(dto); |
| | | public void changeState(CoachChangeStateVO dto) { |
| | | List<Integer> ids = dto.getIds(); |
| | | this.baseMapper.changeState(ids,dto.getState()); |
| | | } |
| | | } |
| | |
| | | package com.dsh.activity.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.CourseChangeStateDTO; |
| | | import com.dsh.activity.entity.UserPointsMerchandise; |
| | | import com.dsh.activity.mapper.UserPointsMerchandiseMapper; |
| | | import com.dsh.activity.model.PointMerchandiseIncomeVo; |
| | |
| | | public List<PointMerchandiseIncomeVo> getAmount() { |
| | | return userPointsMerchandiseMapper.getAmount(); |
| | | } |
| | | |
| | | @Override |
| | | public Object changeState(CourseChangeStateDTO dto) { |
| | | List<Integer> ids = dto.getIds(); |
| | | return this.baseMapper.changeState(ids,dto.getState()); |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.dsh.activity.mapper.BenefitsVideosMapper"> |
| | | |
| | | |
| | | <select id="queryBenefitsVideosList" resultType="map"> |
| | | select * from ( |
| | | <select id="queryBenefitsVideosList" resultType="java.util.Map"> |
| | | (select |
| | | id, |
| | | courseId, |
| | | integral, |
| | | 0 as study |
| | | "0" as study |
| | | from t_benefits_videos where state = 1 and id not in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) |
| | | <if test="null != classificationId"> |
| | | and benefitsVideoClassificationId = #{classificationId} |
| | |
| | | id, |
| | | courseId, |
| | | integral, |
| | | 1 as study |
| | | "1" as study |
| | | from t_benefits_videos where state = 1 and id in (select benefitsVideosId from t_user_benefits_videos where appUserId = #{uid}) |
| | | <if test="null != classificationId"> |
| | | and benefitsVideoClassificationId = #{classificationId} |
| | |
| | | </foreach> |
| | | </if> |
| | | order by insertTime desc) |
| | | ) as a limit #{pageSize}, #{pageNo} |
| | | </select> |
| | | <select id="getBenefitVideoById" resultType="com.dsh.activity.entity.BenefitsVideos"> |
| | | select * from t_benefits_videos where |
| | |
| | | and `type` = 3 |
| | | order by sort desc |
| | | </select> |
| | | <select id="changeState" resultType="java.lang.Integer"> |
| | | update t_points_merchandise set |
| | | shelves = #{query.state} |
| | | <select id="changeState" > |
| | | update t_benefits_videos set |
| | | state = #{state} |
| | | <where> |
| | | <if test="query.ids != null and query.ids.size()>0"> |
| | | AND t_points_merchandise.id IN |
| | | <foreach collection="query.ids" separator="," item="id" open="(" close=")"> |
| | | <if test="ids != null and ids.size()>0"> |
| | | AND t_benefits_videos.id IN |
| | | <foreach collection="ids" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.activity.mapper.UserPointsMerchandiseMapper"> |
| | | <update id="changeState"> |
| | | update t_benefits_videos set |
| | | state = #{state} |
| | | <where> |
| | | <if test="ids != null and ids.size()>0"> |
| | | AND t_benefits_videos.id IN |
| | | <foreach collection="ids" separator="," item="id" open="(" close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | |
| | | |
| | | |
| | | |
| | | </update> |
| | | |
| | | |
| | | <select id="getAmount" resultType="com.dsh.activity.model.PointMerchandiseIncomeVo"> |
| | |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.model.*; |
| | | import com.dsh.competition.model.*; |
| | | import com.dsh.competition.service.CompetitionService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/competition/getCompetitionsDetails1") |
| | | public List<PurchaseRecordVo> getStuSourseList1(@RequestBody GetStuSourseList sourseList){ |
| | | |
| | | List<PurchaseRecordVo> recordVos = new ArrayList<>(); |
| | | |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | integers.add(4); |
| | | List<PaymentCompetition> list = paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("payType",integers ) |
| | | .eq("appUserId", sourseList.getAppUserId()) |
| | | .eq("state",1)); |
| | | if (list.size() > 0){ |
| | | List<Long> comIds = list.stream().map(PaymentCompetition::getId).collect(Collectors.toList()); |
| | | List<UserCompetition> userCompetitions = ucttService.list(new QueryWrapper<UserCompetition>() |
| | | .between("insertTime", sourseList.getStartTime(),sourseList.getEndTime() ) |
| | | .eq("appUserId", sourseList.getAppUserId()) |
| | | .in("paymentCompetitionId",comIds )); |
| | | if (userCompetitions.size() > 0){ |
| | | userCompetitions.forEach(coms ->{ |
| | | PurchaseRecordVo recordVo = new PurchaseRecordVo(); |
| | | recordVo.setPurchaseType("报名赛事"); |
| | | recordVo.setPurchaseTime(dateFormat.format(coms.getInsertTime())); |
| | | PaymentCompetition paymentCompetition = paymentCompetitionService.getById(coms.getPaymentCompetitionId()); |
| | | recordVo.setPurchaseAmount("-"+paymentCompetition.getAmount()); |
| | | recordVos.add(recordVo); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return recordVos; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private CompetitionService competitionService; |
| | | @Resource |
| | | private CoursePackagePaymentClient coursePackagePaymentClient; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/competition/paymentCompetition") |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | |
| | | }) |
| | | public ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ |
| | | |
| | | public synchronized ResultUtil paymentCompetition(PaymentCompetitionVo paymentCompetitionVo){ |
| | | try { |
| | | |
| | | |
| | | Competition byId = competitionService.getById(paymentCompetitionVo.getId()); |
| | | Date date = byId.getEndTime(); // Assuming you have a Date object |
| | | |
| | | Date date = byId.getEndTime(); |
| | | // Assuming you have a Date object |
| | | // Check if the date is past the current time |
| | | boolean isPast = date.after(new Date()); |
| | | |
| | | if (!isPast) { |
| | | return new ResultUtil(0,"已超过截至报名时间"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | |
| | | |
| | | |
| | | if (byId.getRegisterCondition()==3){ |
| | | Integer counts = coursePackagePaymentClient.isHave(uid); |
| | | if (counts==0){ |
| | | return new ResultUtil(0,"当前赛事仅限已购课学员报名"); |
| | | } |
| | | } |
| | | if (byId.getRegisterCondition()==2){ |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | if (appUser.getIsVip()==0){ |
| | | return new ResultUtil(0,"当前赛事仅限年度会员报名"); |
| | | }else { |
| | | Date vipEndTime = appUser.getVipEndTime(); |
| | | Date currentTime = new Date(); // Current time |
| | | if (vipEndTime.before(currentTime)) { |
| | | return new ResultUtil(0,"您的年度会员已过期,请续费"); |
| | | } |
| | | } |
| | | } |
| | | return cttService.paymentCompetition(uid, paymentCompetitionVo); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableId(value = "id") |
| | | private Integer id; |
| | | /** |
| | | * 用户id |
| | |
| | | @PostMapping("/coursePackagePayment/paymentCompetitionCourseList") |
| | | List<PayCourseRes> paymentCompetitionCourseList(String s); |
| | | |
| | | @PostMapping("/coursePackagePayment/isHave") |
| | | |
| | | Integer isHave(Integer uid); |
| | | } |
| | |
| | | if(paymentCompetitionVo.getPayType() == 4){//课程 |
| | | money = new BigDecimal(competition.getClassPrice()).multiply(new BigDecimal(split.length)).setScale(2, RoundingMode.HALF_EVEN); |
| | | for (String s : split) { |
| | | Participant participant = participantService.getById(s); |
| | | Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | if(null == student){ |
| | | return ResultUtil.error(participant.getName() + "不是学员,无法使用课时支付。"); |
| | | } |
| | | // Participant participant = participantService.getById(s); |
| | | // Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | // if(null == student){ |
| | | // return ResultUtil.error(participant.getName() + "不是学员,无法使用课时支付。"); |
| | | // } |
| | | // 2.0 |
| | | Integer integer = coursePackagePaymentClient.queryResidueClassHourById(paymentCompetitionVo.getCoursePaymentId()); |
| | | if(new BigDecimal(integer).compareTo(new BigDecimal(competition.getClassPrice())) < 0){ |
| | | return ResultUtil.error(participant.getName() + "剩余课时不足,无法完成支付。"); |
| | | return ResultUtil.error( "剩余课时不足,无法完成支付。"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | if(paymentCompetitionVo.getPayType() == 4){//课程 |
| | | for (String s : split) { |
| | | Participant participant = participantService.getById(s); |
| | | Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | // Participant participant = participantService.getById(s); |
| | | // Student student = studentClient.queryStudentByPhone(participant.getPhone()); |
| | | PaymentDeductionClassHour paymentDeductionClassHour = new PaymentDeductionClassHour(); |
| | | paymentDeductionClassHour.setId(student.getId()); |
| | | paymentDeductionClassHour.setId(Integer.valueOf(s)); |
| | | paymentDeductionClassHour.setClassHour(competition.getClassPrice()); |
| | | paymentDeductionClassHour.setCode(code); |
| | | paymentDeductionClassHour.setCourseId(paymentCompetitionVo.getCoursePaymentId()); |
| | |
| | | @RequestMapping("/base/course/changeState") |
| | | @ResponseBody |
| | | public Object changeState(@RequestBody CourseChangeStateDTO dto){ |
| | | |
| | | return courseService.changeState(dto); |
| | | } |
| | | |
| | |
| | | String[] end = value1.split(","); |
| | | for (int i = 0; i < star.length; i++) { |
| | | // int index = star[i].indexOf(","); |
| | | // |
| | | // |
| | | // String result = value.substring(0, index).trim(); |
| | | String classStartTime = star[i]; |
| | | String[] split = classStartTime.split(":"); |
| | |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | | while (true){ |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TCoursePackageService packageService; |
| | | @Autowired |
| | | CoursePackageStudentService studentService ; |
| | | /** |
| | | * 课程用于支付进行扣减 |
| | | * @param paymentDeductionClassHour |
| | |
| | | for (TCoursePackagePayment coursePackagePayment : list) { |
| | | if(coursePackagePayment.getLaveClassHours().compareTo(classHour) >= 0){ |
| | | coursePackagePayment.setLaveClassHours(coursePackagePayment.getLaveClassHours() - classHour); |
| | | coursePackagePayment.setAppUserId(null); |
| | | packagePaymentService.updateById(coursePackagePayment); |
| | | |
| | | |
| | | coursePackageSchedulingService.remove(new QueryWrapper<CoursePackageScheduling>().eq("courseId", coursePackagePayment.getCoursePackageId())); |
| | | coursePackageStudentService.remove(new QueryWrapper<CoursePackageStudent>().eq("coursePackageId", coursePackagePayment.getCoursePackageId())); |
| | | |
| | | |
| | | |
| | | |
| | | Student student = studentClient.queryStudentById(coursePackagePayment.getStudentId()); |
| | | |
| | | TCoursePackage tCoursePackage = packageService.getById(coursePackagePayment.getCoursePackageId()); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | | String[] split1 = tCoursePackage.getClassEndTime().split(","); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | // 本周周几 |
| | | 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课时 推送 |
| | | if(coursePackagePayment.getLaveClassHours()<=3){ |
| | |
| | | classHour -= cancelledClasses.getCancelledClassesNumber(); |
| | | } |
| | | } |
| | | |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | private List<Integer> week(String week){ |
| | | String[] split = week.split(";"); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | for (String s : split) { |
| | | switch (s){ |
| | | case "周一": |
| | | integers.add(1); |
| | | break; |
| | | case "周二": |
| | | integers.add(2); |
| | | break; |
| | | case "周三": |
| | | integers.add(3); |
| | | break; |
| | | case "周四": |
| | | integers.add(4); |
| | | break; |
| | | case "周五": |
| | | integers.add(5); |
| | | break; |
| | | case "周六": |
| | | integers.add(6); |
| | | break; |
| | | case "周日": |
| | | integers.add(7); |
| | | break; |
| | | } |
| | | } |
| | | return integers; |
| | | } |
| | | /** |
| | | * 取消赛事回退支付课时 |
| | | * @param paymentDeductionClassHour |
| | |
| | | coursePackageScheduling.setCoursePackageId(null); |
| | | coursePackageSchedulingService.updateById(coursePackageScheduling); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * @param coursePackageScheduling |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") |
| | | public void addCoursePackageScheduling(@RequestBody CoursePackageScheduling coursePackageScheduling){ |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | } |
| | | } |
| | |
| | | private StudentClient studentClient; |
| | | @RequestMapping(value = "/toHoli",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") |
| | | @ResponseBody |
| | | public String toHoli(@RequestBody ToHoliDto toHoliDto){ |
| | | public String toHoli(@RequestBody ToHoliDto toHoliDto) throws ParseException { |
| | | |
| | | String [] ids = toHoliDto.getIds(); |
| | | List<String> strings = new ArrayList<>(); |
| | |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/toTrans",produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = "application/json;charset=UTF-8") |
| | | @ResponseBody |
| | | public String toTrans(@RequestBody ToHoliDto toHoliDto){ |
| | | public String toTrans(@RequestBody ToHoliDto toHoliDto) throws ParseException { |
| | | |
| | | String [] ids = toHoliDto.getIds(); |
| | | List<String> strings = new ArrayList<>(); |
| | |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | studentService.save(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // String classStartTime = coursePackage.getClassStartTime(); |
| | | // String classEndTime = coursePackage.getClassEndTime(); |
| | | |
| | | if (byId == null){ |
| | | continue; |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String dateString1 = sdf.format(byId.getClassDate()); |
| | | String dateString2 = sdf.format(byId.getEndDate()); |
| | |
| | | |
| | | |
| | | coursePackageListVo.setApplicantsNumber(integer); |
| | | |
| | | Double cashPayment1 = coursePackagePaymentConfig.getCashPayment(); |
| | | Integer playPaiCoin = coursePackagePaymentConfig.getPlayPaiCoin(); |
| | | if(ToolUtil.isNotEmpty(cashPayment1) && cashPayment1>0 && ToolUtil.isNotEmpty(playPaiCoin) && playPaiCoin>0){ |
| | |
| | | } |
| | | |
| | | |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId){ |
| | | private void addPackageStudent(Integer courseId, Integer userId, Integer sId,Long paymentId) throws ParseException { |
| | | // 课包 |
| | | TCoursePackage tCoursePackage = this.baseMapper.selectById(courseId); |
| | | |
| | | |
| | | |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | |
| | | List<Integer> week = week(classWeeks); |
| | | |
| | | String[] split = tCoursePackage.getClassStartTime().split(","); |
| | |
| | | |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | for (int i1 = 0; i1 < split.length; i1++) { |
| | | CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); |
| | | coursePackageScheduling.setCoursePackageId(tCoursePackage.getId()); |
| | | try { |
| | | Date parse = format1.parse(format.format(time) + " " + split[i1]); |
| | | Date parse1 = format1.parse(format.format(time) + " " + split1[i1]); |
| | | coursePackageScheduling.setClassDate(parse); |
| | |
| | | student1.setReservationStatus(1); |
| | | student1.setInsertTime(new Date()); |
| | | cpsMapper.insert(student1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | | while (true) { |
| | |
| | | coursePackageSchedulingService.save(coursePackageScheduling); |
| | | } |
| | | s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); |
| | | if (s.getTimeInMillis() > timeInMillis) { |
| | | if (s.getTimeInMillis() >= timeInMillis) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | coursePackageSchedulingService.remove(coursePackageSchedulingQueryWrapper); |
| | | |
| | | this.baseMapper.updateById(coursePackage); |
| | | |
| | | //生成排课数据 |
| | | Date date = null; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | |
| | | int d = Long.valueOf(14L - ((s.getTimeInMillis() - time) / 86400000L)).intValue(); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + d); |
| | | }else{ |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); |
| | | e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 14); |
| | | } |
| | | long timeInMillis = e.getTimeInMillis(); |
| | | |
| | |
| | | /** |
| | | * 零时任务 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * *") |
| | | // @Scheduled(cron = "0 0 0 * * *") |
| | | public void zeroTask(){ |
| | | //定时添加排课数据 |
| | | coursePackageSchedulingService.taskAddData(); |
| | |
| | | import com.dsh.course.feignClient.activity.model.IntegralGoodsOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsPayedVo; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsVo; |
| | | import com.dsh.course.feignClient.course.model.CourseChangeStateDTO; |
| | | import com.dsh.guns.modular.system.model.CoachChangeStateVO; |
| | | import com.dsh.guns.modular.system.model.PointMerchandiseIncomeVo; |
| | | import com.dsh.guns.modular.system.model.GoodsInfoOneVo; |
| | |
| | | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface PointMercharsClient { |
| | | |
| | | @RequestMapping("/base/pointMerchars/changeState") |
| | | Object changeState(@RequestBody CourseChangeStateDTO dto); |
| | | |
| | | @RequestMapping("/base/pointMerchars/writeOff") |
| | | Object writeOff(@RequestBody WriteOffDTO dto); |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/coursePackageScheduling/editCoursePackageScheduling") |
| | | void editCoursePackageScheduling(CoursePackageScheduling coursePackageScheduling); |
| | | |
| | | |
| | | @PostMapping("/coursePackageScheduling/saveCoursePackageScheduling") |
| | | void save(CoursePackageScheduling coursePackageScheduling); |
| | | } |
| | |
| | | /** |
| | | * 系统默认的管理员密码 |
| | | */ |
| | | String DEFAULT_PWD = "111111"; |
| | | String DEFAULT_PWD = "a123456"; |
| | | |
| | | /** |
| | | * 管理员角色的名字 |
| | |
| | | |
| | | |
| | | import com.dsh.course.feignClient.activity.BenefitsVideoClient; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVedioChangeStateVO; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVideoClassification; |
| | | import com.dsh.course.feignClient.activity.model.BenefitsVideos; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | if (benefitsVideos.getCourseId().equals(courseByCourseId.getId())){ |
| | | courseByCourseId.setIntegral(benefitsVideos.getIntegral()); |
| | | courseByCourseId.setBenefitsVideosId(benefitsVideos.getId()); |
| | | courseByCourseId.setState(benefitsVideos.getState()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return courseByCourseIds; |
| | | } |
| | | /** |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | |
| | | @Resource |
| | | private PointMercharsClient mercharsClient; |
| | | @RequestMapping("/changeCourseState") |
| | | @ResponseBody |
| | | public Object changeCourseState(@RequestBody CourseChangeStateDTO dto){ |
| | | |
| | | courseClient.changeState(dto); |
| | | mercharsClient.changeState(dto); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | package com.dsh.guns.modular.system.controller.system; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | |
| | | @RequestMapping("/user_add") |
| | | public String addView(Model model) { |
| | | model.addAttribute("language",UserExt.getLanguage()); |
| | | LambdaQueryWrapper<Role> roleLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(UserExt.getUser().getObjectType()!=1){ |
| | | roleLambdaQueryWrapper.eq(Role::getObjId,UserExt.getUser().getObjectId()); |
| | | } |
| | | roleLambdaQueryWrapper.eq(Role::getObjType,UserExt.getUser().getObjectType()); |
| | | List<Role> list = roleService.list(roleLambdaQueryWrapper); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "user_add.html"; |
| | | } |
| | | |
| | |
| | | model.addAttribute("roleName", ConstantFactory.me().getRoleName(user.getRoleid())); |
| | | model.addAttribute("deptName", ConstantFactory.me().getDeptName(user.getDeptid())); |
| | | LogObjectHolder.me().set(user); |
| | | LambdaQueryWrapper<Role> roleLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(UserExt.getUser().getObjectType()!=1){ |
| | | roleLambdaQueryWrapper.eq(Role::getObjId,UserExt.getUser().getObjectId()); |
| | | } |
| | | roleLambdaQueryWrapper.eq(Role::getObjType,UserExt.getUser().getObjectType()); |
| | | List<Role> list = roleService.list(roleLambdaQueryWrapper); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("language",UserExt.getLanguage()); |
| | | return PREFIX + "user_edit.html"; |
| | | } |
| | |
| | | User objectUser = UserFactory.createUser(user); |
| | | objectUser.setObjectType(UserExt.getUser().getObjectType()); |
| | | objectUser.setObjectId(UserExt.getUser().getObjectId()); |
| | | objectUser.setRoleid(user.getRoleid()); |
| | | objectUser.setAccount(user.getPhone()); |
| | | objectUser.setPassword(SecureUtil.md5("a123456")); |
| | | //查找平台所属公司 |
| | | //Search for the company that owns the platform. |
| | | this.userService.save(objectUser); |
| | |
| | | if (!StringUtils.isEmpty(newUser.getBirthday())) { |
| | | oldUser.setBirthday(newUser.getBirthday()); |
| | | } |
| | | if (!StringUtils.isEmpty(newUser.getDeptid())) { |
| | | oldUser.setDeptid(newUser.getDeptid()); |
| | | if (!StringUtils.isEmpty(newUser.getRoleid())) { |
| | | oldUser.setRoleid(newUser.getRoleid()); |
| | | } |
| | | if (!StringUtils.isEmpty(newUser.getSex())) { |
| | | oldUser.setSex(newUser.getSex()); |
| | |
| | | } |
| | | if (!StringUtils.isEmpty(newUser.getPhone())) { |
| | | oldUser.setPhone(newUser.getPhone()); |
| | | oldUser.setAccount(newUser.getPhone()); |
| | | } |
| | | if (!StringUtils.isEmpty(newUser.getIdCard())) { |
| | | oldUser.setIdCard(newUser.getIdCard()); |
| | | } |
| | | return oldUser; |
| | | } |
| | |
| | | */ |
| | | @TableField("objectId") |
| | | private Integer objectId; |
| | | @TableField("idCard") |
| | | private String idCard; |
| | | |
| | | public String getIdCard() { |
| | | return idCard; |
| | | } |
| | | |
| | | public void setIdCard(String idCard) { |
| | | this.idCard = idCard; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | private Date createtime; |
| | | private Integer version; |
| | | private String avatar; |
| | | private String idCard; |
| | | |
| | | public String getIdCard() { |
| | | return idCard; |
| | | } |
| | | |
| | | public void setIdCard(String idCard) { |
| | | this.idCard = idCard; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | <if test="objectType == 3"> |
| | | and objectType = 3 and objectId =#{objectId} |
| | | </if> |
| | | <if test="objectType == 1"> |
| | | and objectType = 1 |
| | | </if> |
| | | order by num ASC |
| | | </select> |
| | | |
| | |
| | | <if test="objectType == 3"> |
| | | and rr.objType =3 and rr.objId =#{objectId} |
| | | </if> |
| | | <if test="objectType == 1"> |
| | | and rr.objType =1 |
| | | </if> |
| | | </select> |
| | | |
| | | <delete id="deleteRolesById"> |
| | |
| | | <if test="objectType ==3"> |
| | | and (o.objectType =3 and o.objectId =#{objectId}) |
| | | </if> |
| | | <if test="objectType ==1"> |
| | | and o.objectType =1 |
| | | </if> |
| | | </where> |
| | | order by o.id desc |
| | | </select> |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | var pageElement = document.getElementById('page'); |
| | | var event = new Event('change'); |
| | | pageElement.dispatchEvent(event); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | function updateType(e) { |
| | | let name = $("#name").val() |
| | | console.log(name |
| | | ) |
| | | console.log(name) |
| | | if(name =='不跳转'){ |
| | | $("#t1").hide() |
| | | $("#t2").hide() |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | var pageElement = document.getElementById('page'); |
| | | var event = new Event('change'); |
| | | pageElement.dispatchEvent(event); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | var pageElement = document.getElementById('page'); |
| | | var event = new Event('change'); |
| | | pageElement.dispatchEvent(event); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | ajax.start(); |
| | | } |
| | | |
| | | var pageElement = document.getElementById('page'); |
| | | var event = new Event('change'); |
| | | pageElement.dispatchEvent(event); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | @if(shiro.hasPermission("/mgr/unfreeze")){ |
| | | <#button name="解冻" icon="fa-check-circle" clickFun="MgrUser.unfreeze()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/mgr/setRoles")){ |
| | | <#button name="角色分配" icon="fa-user-secret" clickFun="MgrUser.roleAssign()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/mgr/kanbanPermissions")){ |
| | | <#button name="看板权限设置" icon="fa-user-secret" clickFun="MgrUser.kanbanPermissions()" space="true"/> |
| | | @} |
| | |
| | | <#avatar id="avatar" name="照片" underline="true"/> |
| | | <#input id="birthday" name="生日" underline="true" type="text"/> |
| | | <#select id="sex" name="性别" underline="true" > |
| | | <option value="1">男</option> |
| | | <option value="1" selected>男</option> |
| | | <option value="2">女</option> |
| | | </#select> |
| | | <#input id="idCard" name="身份证号" type="text" underline="true"/> |
| | | <#select id="roleid" name="角色" underline="true" > |
| | | @for(l in list){ |
| | | <option value="${l.id}">${l.name}</option> |
| | | @} |
| | | |
| | | </#select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | style="display: none; position: absolute; z-index: 200;"> |
| | | <ul id="treeDemo" class="ztree tree-box" style="width: 249px !important;"></ul> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="UserInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="UserInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="userInfoForm"> |
| | | |
| | | <input type="hidden" id="id" value="${user.id}"> |
| | | <input type="hidden" id="sexValue" value="${user.sex}"> |
| | | |
| | | <input type="hidden" id="roleid_" value="${user.roleid}"> |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="account" name="账户" underline="true" value="${user.account}"/> |
| | | <#select id="sex" name="性别" underline="true"> |
| | | <option value="1">男</option> |
| | | <option value="2">女</option> |
| | | </#select> |
| | | <#input id="roleid" name="角色" underline="true" value="${roleName}" disabled="disabled"/> |
| | | <#input id="email" name="邮箱" type="email" underline="true" value="${user.email}"/> |
| | | <div class="form-group" ${userCompanyId! !=1? "hidden" :" "} > |
| | | <label class="col-sm-3 control-label">所属公司</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="companyId" name="companyId"> |
| | | @if(companyIds! !=null && companyId! !=null){ |
| | | @for(item in companyIds!){ |
| | | @if(item.id! == companyId!){ |
| | | <option value="${item.id}">${item.name!}</option> |
| | | @} |
| | | @} |
| | | @for(item in companyIds!){ |
| | | @if(item.id! !=companyId!){ |
| | | <option value="${item.id}">${item.name!}</option> |
| | | @} |
| | | @} |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed" ${companyId! !=1? "hidden" :" "} ></div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div id="driverInfoContent"> |
| | | <#input id="name" name="姓名" underline="true" value="${user.name!}"/> |
| | | <#input id="birthday" name="出生日期" underline="true" type="text" |
| | | value="${user.birthday!}"/> |
| | | <#input id="citySel" name="部门" underline="true" readonly="readonly" hidden="deptid" hiddenValue="${user.deptid!}" value="${deptName!}" |
| | | clickFun="UserInfoDlg.showDeptSelectTree(); return false;" |
| | | style="background-color: #ffffff !important;"/> |
| | | <#input id="phone" name="电话" underline="true" value="${user.phone}"/> |
| | | <#input id="name" name="员工姓名" underline="true" value="${user.name}" /> |
| | | <#input id="phone" name="联系电话" underline="true" value="${user.phone}" /> |
| | | <#avatar id="avatar" name="照片" underline="true" avatarImg="${user.avatar}" /> |
| | | <#input id="birthday" name="生日" underline="true" type="text" value="${user.birthday}" /> |
| | | <#select id="sex" name="性别" underline="true" > |
| | | <option value="1" selected>男</option> |
| | | <option value="2">女</option> |
| | | </#select> |
| | | <#input id="idCard" name="身份证号" type="text" underline="true" value="${user.idCard}"/> |
| | | <#select id="roleid" name="角色" underline="true" > |
| | | @for(l in list){ |
| | | <option value="${l.id}" ${l.id == user.roleid ? 'selected=selected' : ''}>${l.name}</option> |
| | | @} |
| | | </#select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 这是部门选择的下拉框 --> |
| | | <div id="menuContent" class="menuContent" |
| | | style="display: none; position: absolute; z-index: 200;"> |
| | |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="UserInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="userInfoForm"> |
| | | |
| | | <input type="hidden" id="id" value="${user.id}"> |
| | | <input type="hidden" id="sexValue" value="${user.sex}"> |
| | | <input type="hidden" id="roleid_" value="${user.roleid}"> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div id="driverInfoContent"> |
| | | <#input id="name" name="员工姓名" underline="true" value="${user.name}"/> |
| | | <#input id="phone" name="联系电话" underline="true" value="${user.phone}"/> |
| | | <#avatar id="avatar" name="照片" underline="true" avatarImg="${user.avatar}"/> |
| | | <#input id="birthday" name="生日" underline="true" type="text" value="${user.birthday}"/> |
| | | <#select id="sex" name="性别" underline="true" > |
| | | <option value="1" >男</option> |
| | | <option value="2">女</option> |
| | | </#select> |
| | | <#input id="idCard" name="身份证号" type="text" underline="true" value="${user.idCard}"/> |
| | | <#select id="roleid" name="角色" underline="true" > |
| | | @for(l in list){ |
| | | <option value="${l.id}" ${l.id == user.roleid ? 'selected=selected' : ''}>${l.name}</option> |
| | | @} |
| | | |
| | | </#select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 这是部门选择的下拉框 --> |
| | | <div id="menuContent" class="menuContent" |
| | | style="display: none; position: absolute; z-index: 200;"> |
| | | <ul id="treeDemo" class="ztree tree-box" style="width: 249px !important;"></ul> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="UserInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="UserInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <script src="${ctxPath}/modular/system/user/user_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#birthday' |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | data1.ids.push(id); |
| | | data1.ids.push(obj.benefitsVideosId); |
| | | }); |
| | | data1.state = 1; |
| | | $.ajax({ |
| | |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | data1.ids.push(id); |
| | | data1.ids.push(obj.benefitsVideosId); |
| | | }); |
| | | data1.state = 2; |
| | | $.ajax({ |
| | |
| | | if (this.check()) { |
| | | var userId = this.seItem.id; |
| | | if(language==1){ |
| | | parent.layer.confirm('是否重置密码为111111?', { |
| | | parent.layer.confirm('是否重置密码为a123456?', { |
| | | btn: ['确定', '取消'], |
| | | shade: false //不显示遮罩 |
| | | }, function () { |
| | |
| | | /** |
| | | * 用户详情对话框(可用于添加和修改对话框) |
| | | */ |
| | | var language =$("#language").val() |
| | | var language =1 |
| | | var UserInfoDlg = { |
| | | userInfoData: {}, |
| | | validateFields: { |
| | | account: { |
| | | phone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'账户不能为空':(language==2?"The account cannot be empty":"Akaun tidak dapat kosong") |
| | | message: language==1?'联系电话不能为空':(language==2?"The account cannot be empty":"Akaun tidak dapat kosong") |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | },*/ |
| | | password: { |
| | | birthday: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '密码不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}/, |
| | | message: '密码中必须包含大小字母、数字、特称字符,至少8个字符,最多30个字符' |
| | | message: '生日不能为空' |
| | | }, |
| | | } |
| | | }, |
| | | rePassword: { |
| | | idCard: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '密码不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}/, |
| | | message: '密码中必须包含大小字母、数字、特称字符,至少8个字符,最多30个字符' |
| | | message: '身份证号不能为空' |
| | | }, |
| | | } |
| | | } |
| | |
| | | */ |
| | | UserInfoDlg.collectData = function () { |
| | | this.set('id').set('account').set('sex').set('password').set('avatar') |
| | | .set('email').set('name').set('birthday').set('rePassword').set('deptid').set('phone'); |
| | | .set('email').set('name').set('birthday').set('rePassword').set('roleid').set('phone').set('idCard'); |
| | | }; |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | |
| | | var birthday = $("#birthday").val(); |
| | | if ("" == birthday){ |
| | | if(language==1){ |
| | | Feng.info("出生日期不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The date of birth cannot be empty!"); |
| | | }else { |
| | | Feng.info("Tanggal lahir tidak bisa kosong!"); |
| | | } |
| | | |
| | | var avatar = $("#avatar").val(); |
| | | if(avatar==''){ |
| | | Feng.info("请上传照片") |
| | | return; |
| | | } |
| | | |
| | | var citySel = $("#citySel").val(); |
| | | if ("" == citySel){ |
| | | if(language==1){ |
| | | Feng.info("部门不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The department cannot be empty!"); |
| | | }else { |
| | | Feng.info("Departemen tidak bisa kosong!"); |
| | | } |
| | | |
| | | var sex = $("#sex").val(); |
| | | if(sex==''){ |
| | | Feng.info("请选择性别") |
| | | return; |
| | | } |
| | | |
| | | var roleid = $("#roleid").val(); |
| | | if(roleid==''){ |
| | | Feng.info("请选择角色") |
| | | return; |
| | | } |
| | | console.log(this.userInfoData) |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/add", function (data) { |
| | | Feng.success("添加成功!"); |
| | |
| | | if (!this.validate()) { |
| | | return; |
| | | } |
| | | console.log(this.userInfoData) |
| | | |
| | | var birthday = $("#birthday").val(); |
| | | if ("" == birthday){ |
| | | if(language==1){ |
| | | Feng.info("出生日期不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The date of birth cannot be empty!"); |
| | | }else { |
| | | Feng.info("Tanggal lahir tidak bisa kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | var citySel = $("#citySel").val(); |
| | | if ("" == citySel){ |
| | | if(language==1){ |
| | | Feng.info("部门不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The department cannot be empty!"); |
| | | }else { |
| | | Feng.info("Departemen tidak bisa kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/mgr/edit", function (data) { |
| | |
| | | avatarUp.setUploadBarId("progressBar"); |
| | | avatarUp.init(); |
| | | |
| | | document.getElementById('roleid').value = $("#roleid_").val(); |
| | | }); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/site/queryMySite") |
| | | @ApiOperation(value = "获取我的预约场地列表", tags = {"用户—预约场地"}) |
| | |
| | | info.setLongitude(storeLon); |
| | | storeInfos.add(info); |
| | | } |
| | | Comparator<StoreInfo> distanceComparator = new Comparator<StoreInfo>() { |
| | | @Override |
| | | public int compare(StoreInfo store1, StoreInfo store2) { |
| | | return Long.compare(store1.getDistance(), store2.getDistance()); |
| | | } |
| | | }; |
| | | Collections.sort(storeInfos, distanceComparator); |
| | | // Comparator<StoreInfo> distanceComparator = new Comparator<StoreInfo>() { |
| | | // @Override |
| | | // public int compare(StoreInfo store1, StoreInfo store2) { |
| | | // return Long.compare(store1.getDistance(), store2.getDistance()); |
| | | // } |
| | | // }; |
| | | // Collections.sort(storeInfos, distanceComparator); |
| | | storeInfos = storeInfos.stream().sorted(Comparator.comparing(StoreInfo::getDistance)).collect(Collectors.toList()); |
| | | } |
| | | return storeInfos; |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "城市code", name = "cityCode", dataType = "string", required = true), |
| | | }) |
| | | public ResultUtil<List<BaseVo>> queryStoreByCityCode(String cityCode){ |
| | | public ResultUtil<List<BaseVo>> queryStoreByCityCode(String provinceCode,String cityCode){ |
| | | try { |
| | | List<BaseVo> list = storeService.queryStoreByCityCode(cityCode); |
| | | List<BaseVo> list = storeService.queryStoreByCityCode(provinceCode,cityCode); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | * @param cityCode |
| | | * @return |
| | | */ |
| | | List<BaseVo> queryStoreByCityCode(@Param("cityCode") String cityCode); |
| | | List<BaseVo> queryStoreByCityCode(@Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode); |
| | | |
| | | /** |
| | | * 根据城市管理员id获取门店集合 |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseVo> queryStoreByCityCode(String cityCode) throws Exception; |
| | | List<BaseVo> queryStoreByCityCode(String provinceCode,String cityCode) throws Exception; |
| | | |
| | | List<Store> getStoreByCityManagerId(Integer id); |
| | | |
| | |
| | | Site site = this.getById(siteBooking.getSiteId()); |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | if(site!=null){ |
| | | |
| | | queryMySiteVo.setPlayPaiCoin(site.getPlayPaiCoin() * split.length); |
| | | } |
| | | } |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<BaseVo> queryStoreByCityCode(String cityCode) throws Exception { |
| | | return this.baseMapper.queryStoreByCityCode(cityCode); |
| | | public List<BaseVo> queryStoreByCityCode(String provinceCode,String cityCode) throws Exception { |
| | | return this.baseMapper.queryStoreByCityCode(provinceCode,cityCode); |
| | | } |
| | | |
| | | |
| | |
| | | from t_usetime_history hs |
| | | LEFT JOIN sys_user us on hs.createBy = us.id |
| | | where hs.studentId = #{studentId} |
| | | |
| | | </select> |
| | | <select id="getFirst" resultType="java.lang.String"> |
| | | select content |
| | |
| | | <if test="query.opId!=null "> |
| | | and t1.operatorId =#{query.opId} |
| | | </if> |
| | | and t1.state != 3 |
| | | and t1.state != 3 and t1.sign=0 |
| | | </where> |
| | | |
| | | ORDER BY insertTime desc |
| | |
| | | </select> |
| | | |
| | | <select id="queryStoreByCityCode" resultType="com.dsh.other.model.BaseVo"> |
| | | select id, name from t_store where state = 1 and cityCode = #{cityCode} |
| | | select id, name from t_store where state = 1 |
| | | and provinceCode = #{provinceCode} |
| | | <if test="cityCode !=null and cityCode !='' "> |
| | | and cityCode = #{cityCode} |
| | | </if> |
| | | |
| | | </select> |
| | | <select id="getStoreByCityManagerId" resultType="com.dsh.other.entity.Store"> |
| | | select * from t_store where operatorId = #{id} |