| | |
| | | |
| | | @ApiModelProperty(value = "价格") |
| | | private double price; |
| | | |
| | | @ApiModelProperty(value = "是否可以预约(0=否,1=是)") |
| | | private Integer isCanBeBooked; |
| | | } |
| | |
| | | CommodityRequest commodityRequest = new CommodityRequest(); |
| | | commodityRequest.setLon(request.getLon()); |
| | | commodityRequest.setLat(request.getLat()); |
| | | commodityRequest.setShopId(request.getShopId()); |
| | | PointMerchandiseVo vicinityGoods = mcClient.getVicinityGoods(commodityRequest); |
| | | if (ToolUtil.isNotEmpty(vicinityGoods.getMerchandises())) { |
| | | for (PointsMerchandise vicinityGood : vicinityGoods.getMerchandises()) { |
| | |
| | | if (goods.size() > 0) { |
| | | goods = goods.stream() |
| | | .filter(merchandise -> merchandise.getGoodName().contains(request.getSearch())) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 2.0 门店筛选 |
| | | if (request.getShopId() != null) { |
| | | if (goods.size() > 0) { |
| | | goods = goods.stream() |
| | | .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()); |
| | | } |
| | | } |
| | |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuListVo; |
| | | import com.dsh.account.model.vo.exploreDetail.LonLatRequest; |
| | | import com.dsh.account.model.vo.exploreDetail.QuestionIns; |
| | | import com.dsh.account.model.vo.exploreDetail.StoreDetailsVo; |
| | | import com.dsh.account.model.vo.exploreDetail.StoreOfCourseVo; |
| | | import com.dsh.account.model.vo.exploreDetail.*; |
| | | import com.dsh.account.model.vo.sourceDetail.CouponStuAvailableVo; |
| | | import com.dsh.account.model.vo.sourceDetail.CourseDetailsOfContinuationResp; |
| | | import com.dsh.account.model.vo.sourceDetail.RecordTimeRequest; |
| | |
| | | detailsVo.setLon(store.getLon()); |
| | | detailsVo.setLat(store.getLat()); |
| | | detailsVo.setPhone(store.getPhone()); |
| | | detailsVo.setVenueList(steClient.getAppUserSiteList(storeId)); |
| | | List<SiteVo> appUserSiteList = steClient.getAppUserSiteList(storeId); |
| | | List<SiteVo> siteList = appUserSiteList.stream().filter(e -> e.getIsCanBeBooked() == 1).collect(Collectors.toList()); |
| | | detailsVo.setVenueList(siteList); |
| | | List<StoreOfCourseVo> storeOfCourseList = culisClient.getStoreOfCourseList(storeId); |
| | | System.out.println(storeOfCourseList); |
| | | for (StoreOfCourseVo storeOfCourseVo : storeOfCourseList) { |
| | |
| | | // 设置鉴权参数,初始化客户端 |
| | | private DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou",// 地域ID |
| | | "LTAI5tE3ownRhJ7eXsuW7Vn7",// 您的AccessKey ID |
| | | "Crgi0OhtDRuJafIeyT3JQL9v0P4EgH");// 您的AccessKey Secret |
| | | "LTAI5tKLeAE1B5n2mvTZ5yy6",// 您的AccessKey ID |
| | | "zradDLTBGdzq26tYz9RUCUh0sPmfhh");// 您的AccessKey Secret |
| | | private IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | private static void log_print(String functionName, Object result) { |
| | |
| | | Integer pickUpQuantity = dataVo.getPickUpQuantity(); |
| | | // 赠送用户数量 |
| | | int count = quantityIssued / pickUpQuantity; |
| | | |
| | | // 自动发券 |
| | | if (dataVo.getDistributionMethod() == 3) { |
| | | // 判断用户人群 再判断限领数量 |
| | |
| | | // 全部用户ids |
| | | List<Integer> collect = tAppUsers.stream() |
| | | .map(TAppUser::getId).collect(Collectors.toList()); |
| | | if (collect.size()<count){ |
| | | count = collect.size(); |
| | | } |
| | | for (int i = 0; i < count; i++) { |
| | | for (int j = 0; j < pickUpQuantity; j++) { |
| | | UserCoupon u1 = new UserCoupon(); |
| | |
| | | List<Integer> collect1 = tAppUsers.stream().filter(t -> t.getVipEndTime().after(new Date())) |
| | | .map(TAppUser::getId) |
| | | .collect(Collectors.toList()); |
| | | if (collect1.size()<count){ |
| | | count = collect1.size(); |
| | | } |
| | | for (int i = 0; i < count; i++) { |
| | | for (int j = 0; j < pickUpQuantity; j++) { |
| | | UserCoupon u1 = new UserCoupon(); |
| | |
| | | case 3: |
| | | // 给已有学员用户发券 获取已有学员的用户ids |
| | | List<Integer> collect2 = studentClient.getHasStudentUser(); |
| | | if (collect2.size()<count){ |
| | | count = collect2.size(); |
| | | } |
| | | for (int i = 0; i < count; i++) { |
| | | for (int j = 0; j < pickUpQuantity; j++) { |
| | | UserCoupon u1 = new UserCoupon(); |
| | |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request) { |
| | | |
| | | |
| | | System.err.println("积分商城请求参数"+request); |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | List<PointsMerchandise> list = new ArrayList<>(); |
| | | String provinceCode = ""; |
| | |
| | | pointMerchandiseVo.setMerchandises(list); |
| | | return pointMerchandiseVo; |
| | | }else{ |
| | | List<PointsMerchandise> pointsMerchandiseList = pmdsService.lambdaQuery().in(PointsMerchandise::getId, pointsMerchandiseIds).list(); |
| | | list.addAll(pointsMerchandiseList); |
| | | List<PointsMerchandise> listAll = list.stream().distinct().collect(Collectors.toList()); |
| | | list = listAll; |
| | | List<PointsMerchandise> pointsMerchandiseList = pmdsService.lambdaQuery() |
| | | .eq(PointsMerchandise::getState, 1) |
| | | .eq(PointsMerchandise::getShelves,1) |
| | | .in(PointsMerchandise::getId, pointsMerchandiseIds).list(); |
| | | |
| | | list = pointsMerchandiseList; |
| | | } |
| | | } |
| | | |
| | | list = list.stream().distinct().collect(Collectors.toList()); |
| | | if (list.size() > 0) { |
| | | Iterator<PointsMerchandise> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id修改门票使用状态 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/userCoupon/changeTicketStatus") |
| | | @ResponseBody |
| | | public void changeTicketStatus(String id){ |
| | | @GetMapping("/userCoupon/changeTicketStatus/{id}") |
| | | public void changeTicketStatus(@PathVariable("id") String id){ |
| | | System.err.println("数据id"+id); |
| | | if (id.length()<=11){ |
| | | // 购买会员赠送的门票 |
| | | System.err.println("会员赠送门票"); |
| | | VipDetail vipDetail = vipDetailService.getById(Integer.valueOf(id)); |
| | | System.err.println("会员权益门票数据"+ vipDetail); |
| | | if (vipDetail!=null){ |
| | | System.err.println("修改使用状态"); |
| | | vipDetail.setStatus(2); |
| | | vipDetailService.updateById(vipDetail); |
| | | }else{ |
| | |
| | | } |
| | | }else{ |
| | | // 积分商城门票 |
| | | UserPointsMerchandise userPointsMerchandise = userPointsMerchandiseService.getById(Long.valueOf(id)); |
| | | System.err.println("积分商城门票id"); |
| | | UserPointsMerchandise userPointsMerchandise = userPointsMerchandiseService.getById(id); |
| | | System.err.println("积分商城门票数据"+ userPointsMerchandise); |
| | | if (userPointsMerchandise!=null){ |
| | | System.err.println("修改使用状态"); |
| | | userPointsMerchandise.setUserId(null); |
| | | userPointsMerchandise.setVerificationTime(new Date()); |
| | | userPointsMerchandise.setStatus(2); |
| | | userPointsMerchandiseService.updateById(userPointsMerchandise); |
| | | }else{ |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | if (!aBoolean) { |
| | | return ResultUtil.error("身份证和姓名不匹配"); |
| | | } |
| | | // 根据身份证号获取生日 |
| | | String birthday18 = extractBirthdayFromIdCard(student.getIdCard()); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | student.setBirthday(simpleDateFormat.parse(birthday18)); |
| | | } |
| | | student.setPhone(editParticipant.getPhone()); |
| | | studentClient.updateAppUser(student); |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 根据身份证号码提取生日 |
| | | * @param idCard 身份证号码 |
| | | * @return 生日字符串 YYYY-MM-DD格式 |
| | | */ |
| | | public static String extractBirthdayFromIdCard(String idCard) { |
| | | if (idCard == null || idCard.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | String birthday; |
| | | if (idCard.length() == 18) { |
| | | // 18位身份证:截取第7-14位 |
| | | birthday = idCard.substring(6, 14); |
| | | } else if (idCard.length() == 15) { |
| | | // 15位身份证:截取第7-12位,并补上前缀"19" |
| | | birthday = "19" + idCard.substring(6, 12); |
| | | } else { |
| | | return null; |
| | | } |
| | | |
| | | // 格式化为YYYY-MM-DD格式 |
| | | return birthday.substring(0, 4) + "-" + |
| | | birthday.substring(4, 6) + "-" + |
| | | birthday.substring(6, 8); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/participant/delParticipant") |
| | |
| | | |
| | | private String phone; |
| | | private String idCard; |
| | | private String registerPhone; |
| | | private Integer appUserId; |
| | | private Integer state; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.account.model.TStudent; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private UserCompetitionService userCompetitionService; |
| | |
| | | public Page<CompetitionUser> getPeopleFromId1(long offset, long limit, Integer id, Integer state) { |
| | | List<UserCompetition> peopleFromId1 = this.baseMapper.getPeopleFromId1(id, state, offset, limit); |
| | | int count = this.baseMapper.getPeopleFromIdCount(id, state); |
| | | Map<Integer, AppUser> userMap = appUserClient.getAllUser().stream().collect(Collectors.toMap(AppUser::getId, e -> e)); |
| | | List<CompetitionUser> list = new ArrayList<>(); |
| | | for (UserCompetition userCompetition : peopleFromId1) { |
| | | Long paymentCompetitionId = userCompetition.getPaymentCompetitionId(); |
| | |
| | | Participant participant = this.getById(userCompetition.getParticipantId()); |
| | | CompetitionUser competitionUser = new CompetitionUser(); |
| | | if(null != participant){ |
| | | AppUser appUser = userMap.get(participant.getAppUserId()); |
| | | if (appUser!=null){ |
| | | competitionUser.setAppUserId(appUser.getId()); |
| | | competitionUser.setRegisterPhone(appUser.getPhone()); |
| | | } |
| | | competitionUser.setName(participant.getName()); |
| | | competitionUser.setSex(participant.getGender()); |
| | | competitionUser.setPhone(participant.getPhone()); |
| | | competitionUser.setIdCard(participant.getIdcard()); |
| | | }else{ |
| | | TStudent tStudent = studentClient.queryById(userCompetition.getParticipantId()); |
| | | AppUser appUser = userMap.get(tStudent.getAppUserId()); |
| | | if (appUser!=null){ |
| | | competitionUser.setAppUserId(appUser.getId()); |
| | | competitionUser.setRegisterPhone(appUser.getPhone()); |
| | | } |
| | | competitionUser.setName(tStudent.getName()); |
| | | competitionUser.setSex(tStudent.getSex()); |
| | | competitionUser.setPhone(tStudent.getPhone()); |
| | |
| | | // 设置鉴权参数,初始化客户端 |
| | | private DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou",// 地域ID |
| | | "LTAI5tE3ownRhJ7eXsuW7Vn7",// 您的AccessKey ID |
| | | "Crgi0OhtDRuJafIeyT3JQL9v0P4EgH");// 您的AccessKey Secret |
| | | "LTAI5tKLeAE1B5n2mvTZ5yy6",// 您的AccessKey ID |
| | | "zradDLTBGdzq26tYz9RUCUh0sPmfhh");// 您的AccessKey Secret |
| | | private IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | private static void log_print(String functionName, Object result) { |
| | |
| | | private Integer sex; |
| | | |
| | | private String phone; |
| | | private String registerPhone; |
| | | private Integer appUserId; |
| | | private String idCard; |
| | | private Integer state; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | |
| | | private Integer targetAudience; |
| | | private Integer fieldType; |
| | | private Double cashPrice; |
| | | private Double coinPrice; |
| | | private Integer coinPrice; |
| | | } |
| | | } |
| | |
| | | DateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | String time1 = format.format(date); |
| | | String fileName =name+"报名信息.xls"; |
| | | String[] title = new String[] {"姓名","性别","联系电话","身份证号","状态"}; |
| | | String[] title = new String[] {"姓名","性别","注册电话","联系电话","身份证号","状态"}; |
| | | GetPeopleQuery query = new GetPeopleQuery(); |
| | | query.setId(id); |
| | | query.setState(state); |
| | | List<CompetitionUser> list = competitionClient.getPeoples(query); |
| | | // todo 临时处理 因为只能更新后台 |
| | | Page<CompetitionUser> page = competitionClient.getPeopleFromId1(new GetPeopleQuery(999, 0, id, state)); |
| | | List<CompetitionUser> list = page.getRecords(); |
| | | // List<CompetitionUser> list = competitionClient.getPeoples(query); |
| | | System.err.println("导出查询人员列表"+ list); |
| | | String[][] values = new String[list.size()][]; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | CompetitionUser d = list.get(i); |
| | |
| | | }else { |
| | | values[i][1] = "未知"; |
| | | } |
| | | values[i][2] = d.getPhone(); |
| | | values[i][3] = d.getIdCard(); |
| | | values[i][2] = d.getRegisterPhone(); |
| | | |
| | | values[i][3] = d.getPhone(); |
| | | values[i][4] = d.getIdCard(); |
| | | Integer state1 = d.getState(); |
| | | if(1 == state1){ |
| | | values[i][4] = "正常"; |
| | | values[i][5] = "正常"; |
| | | }else if(2 == state1){ |
| | | values[i][4] = "冻结"; |
| | | values[i][5] = "正常"; |
| | | }else { |
| | | values[i][4] = "删除"; |
| | | values[i][5] = "已取消"; |
| | | } |
| | | } |
| | | HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook("Variance"+time1, title, values, null); |
| | |
| | | } |
| | | //玩湃惠民卡 |
| | | StoreConfig c10 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,10)); |
| | | model.addAttribute("c10",c10); |
| | | model.addAttribute("c10",c10!=null?c10:new StoreConfig()); |
| | | //会员卡板块 |
| | | StoreConfig c11 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,11)); |
| | | model.addAttribute("c11",c11); |
| | | model.addAttribute("c11",c11!=null?c11:new StoreConfig()); |
| | | //散客入场 |
| | | StoreConfig c12 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,12)); |
| | | model.addAttribute("c12",c12!=null?c12:new StoreConfig()); |
| | | return PREFIX + "TShop_imgAll.html"; |
| | | } |
| | | |
| | |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | // String result = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | // String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | String result = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px10,Integer px11, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c10,String c111, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r10,Integer r11,String str) { |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px10,Integer px11,Integer px12, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c10,String c111,String c12, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r10,Integer r11,Integer r12,String str) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | StoreConfig collect10 = collect(id, px10, r10, c10, 10); |
| | | StoreConfig collect11 = collect(id, px11, r11, c111, 11); |
| | | StoreConfig collect12 = collect(id, px12, r12, c12, 12); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | |
| | | storeConfigs.add(collect8); |
| | | storeConfigs.add(collect10); |
| | | storeConfigs.add(collect11); |
| | | storeConfigs.add(collect12); |
| | | storeConfigService.saveOrUpdateBatch(storeConfigs); |
| | | |
| | | // 修改世界杯 |
| | |
| | | map.put("name",site.getName()); |
| | | map.put("space_id",store.getId().toString()); |
| | | String s = HttpRequestUtil.postRequest |
| | | // ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | ("https://port.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | // ("https://try.daowepark.com/v7/user_api/general/addSpaceArea", map); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | String area_id = data.getString("area_id"); |
| | |
| | | // 保存价格数据 |
| | | if (site.getPriceDTOS() != null && !site.getPriceDTOS().isEmpty()) { |
| | | saveSitePriceDetails(site.getId(), site.getPriceDTOS()); |
| | | List<Site.PriceDTO> priceDTOS = site.getPriceDTOS(); |
| | | site.setAppointmentStartTime(priceDTOS.get(0).getStartTime()); |
| | | site.setAppointmentEndTime(priceDTOS.get(priceDTOS.size()-1).getEndTime()); |
| | | siteClient.addSite(site); |
| | | |
| | | } |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | |
| | | sitePrice.setTargetAudience(detail.getTargetAudience()); |
| | | sitePrice.setFieldType(detail.getFieldType()); |
| | | sitePrice.setCashPrice(detail.getCashPrice() != null ? BigDecimal.valueOf(detail.getCashPrice()) : BigDecimal.ZERO); |
| | | sitePrice.setCoinPrice(detail.getCoinPrice() != null ? BigDecimal.valueOf(detail.getCoinPrice()) : BigDecimal.ZERO); |
| | | sitePrice.setCoinPrice(detail.getCoinPrice() != null ? detail.getCoinPrice() : 0); |
| | | sitePrice.setInsertTime(now); |
| | | sitePrice.setUpdateTime(now); |
| | | |
| | |
| | | // 先删除原有价格数据 |
| | | sitePriceService.remove(new QueryWrapper<TSitePrice>().eq("siteId", site.getId())); |
| | | saveSitePriceDetails(site.getId(), site.getPriceDTOS()); |
| | | List<Site.PriceDTO> priceDTOS = site.getPriceDTOS(); |
| | | site.setAppointmentStartTime(priceDTOS.get(0).getStartTime()); |
| | | site.setAppointmentEndTime(priceDTOS.get(priceDTOS.size()-1).getEndTime()); |
| | | siteClient.addSite(site); |
| | | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | siteBooking.setCityCode(byId.getCityCode()); |
| | | } |
| | | |
| | | if (siteBooking.getIsHalf()==2){ |
| | | siteBooking.setHalfName(null); |
| | | } |
| | | siteClient.addSiteBooking(siteBooking); |
| | | System.out.println("=================" + siteBooking); |
| | | return new ResultUtil<>(null, 200, null, null, null); |
| | |
| | | // 设置鉴权参数,初始化客户端 |
| | | private DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou",// 地域ID |
| | | "LTAI5tE3ownRhJ7eXsuW7Vn7",// 您的AccessKey ID |
| | | "Crgi0OhtDRuJafIeyT3JQL9v0P4EgH");// 您的AccessKey Secret |
| | | "LTAI5tKLeAE1B5n2mvTZ5yy6",// 您的AccessKey ID |
| | | "zradDLTBGdzq26tYz9RUCUh0sPmfhh");// 您的AccessKey Secret |
| | | private IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | private static void log_print(String functionName, Object result) { |
| | |
| | | @ApiModelProperty(value = "现金价格(元)") |
| | | private BigDecimal cashPrice; |
| | | @ApiModelProperty(value = "玩湃币价格(币)") |
| | | private BigDecimal coinPrice; |
| | | private Integer coinPrice; |
| | | } |
| | |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | /** |
| | | * 数据类型(1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=世界杯,10=玩湃惠民卡) |
| | | 1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=世界杯,10=玩湃惠民卡 11 会员 12=散客入场) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | |
| | | @TableField("coinPrice") |
| | | @ApiModelProperty(value = "玩湃币价格(币)") |
| | | private BigDecimal coinPrice; |
| | | private Integer coinPrice; |
| | | |
| | | @TableField("insertTime") |
| | | @ApiModelProperty(value = "创建时间") |
| | |
| | | |
| | | if (StringUtils.isBlank(siteName)) { |
| | | siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).ne("status", 5).like("times", day)); |
| | | }else{ |
| | | siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).ne("status", 5).eq("nextName", siteName).like("times", day)); |
| | | } |
| | | |
| | | |
| | |
| | | // zradDLTBGdzq26tYz9RUCUh0sPmfhh |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://we-park-life.oss-cn-beijing.aliyuncs.com/"; |
| | | // public static String accessKeyId = "LTAI5tE3ownRhJ7eXsuW7Vn7"; |
| | | // public static String accessKeySecret = "Crgi0OhtDRuJafIeyT3JQL9v0P4EgH"; |
| | | // public static String accessKeyId = "LTAI5tKLeAE1B5n2mvTZ5yy6"; |
| | | // public static String accessKeySecret = "zradDLTBGdzq26tYz9RUCUh0sPmfhh"; |
| | | public static String accessKeyId = "LTAI5tKLeAE1B5n2mvTZ5yy6"; |
| | | public static String accessKeySecret = "zradDLTBGdzq26tYz9RUCUh0sPmfhh"; |
| | | public static String bucketName="we-park-life"; |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | |
| | | |
| | | <#avatar id="url" name="*图片(推荐像素宽度316px)"/> |
| | | <#avatar id="url" name="*图片(推荐像素宽度316px)" avatarImg="" /> |
| | | |
| | | <div class="input-group" style="margin-left: 342px;"> |
| | | <div class="input-group-btn"> |
| | |
| | | @if(c11!=null){ |
| | | <input hidden id="s11" value="${c11.isOpen}"> |
| | | @} |
| | | @if(c12!=null){ |
| | | <input hidden id="s12" value="${c12.isOpen}"> |
| | | @} |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 散客入场:<input type="radio" name="r12" value="1">开启 <input type="radio" name="r12" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | @if(c12==null){ |
| | | <input class="form-control" style="width: 200px;" type="text" id="px12" value=""> |
| | | @} |
| | | @if(c12!=null){ |
| | | <input class="form-control" style="width: 200px;" type="text" id="px12" value="${c12.sort}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | @if(c12==null){ |
| | | <#avatar id="c12" name="背景图" avatarImg="" /> |
| | | @} |
| | | @if(c2!=null){ |
| | | <#avatar id="c12" name="背景图" avatarImg="${c12.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div style="font-size: x-large; display: none" >赛事比赛板块</div> |
| | | @for(obj in worldCupStores){ |
| | | <div class="row " style="display: none" > |
| | |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r12") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s12").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | // for (let i = 0; i < $('input[name="isOpen"]').length; i++) { |
| | | // var OBJradio=document.getElementsByName("r9") |
| | | // for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | |
| | | {title: '所在省', field: 'province', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '预约门店', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | { |
| | | title: '入场方式', |
| | | field: 'targetAudience', |
| | | visible: true, |
| | | align: 'center', |
| | | valign: 'middle', |
| | | formatter: function(value, row) { |
| | | switch (value) { |
| | | |
| | | case 1: |
| | | return '订场'; |
| | | case 2: |
| | | return '散客'; |
| | | default: |
| | | return ''; |
| | | } |
| | | } |
| | | }, |
| | | { title: '预约场地', field: 'siteName', visible: true, align: 'center', valign: 'middle'}, |
| | | { title: '姓名', field: 'booker', visible: true, align: 'center', valign: 'middle'}, |
| | | { title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | |
| | | console.log("================"+data) |
| | | if(data!=null){ |
| | | let htmlStr = ''; |
| | | if (data.length>0){ |
| | | |
| | | if (data.length>1){ |
| | | console.log(8888) |
| | | console.log(data.length) |
| | | for (let i = 0; i < data.length; i++) { |
| | | htmlStr += '<option value="' + data[i] + '">' + data[i] + '</option>' |
| | | } |
| | |
| | | |
| | | |
| | | }else { |
| | | console.log("9999") |
| | | $("#nextSite1").hide() |
| | | $("#nextSite").empty() |
| | | } |
| | |
| | | let cityCode = $('#cityCode').val(); |
| | | let storeId = $('#storeId').val(); |
| | | let siteId = $('#siteId').val(); |
| | | let site = $('#siteId option:checked').text(); |
| | | let site = $('#nextSite').val(); |
| | | |
| | | console.log("===========") |
| | | console.log(site) |
| | | |
| | | var radios = document.getElementsByName("type"); |
| | | var selectedValue; |
| | |
| | | return {1:"男",2:"女"}[data] |
| | | } |
| | | }, |
| | | {title: '注册电话', field: 'registerPhone', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '身份证号', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | |
| | | var px8 = $("#px8").val() |
| | | var px10 = $("#px10").val() |
| | | var px11 = $("#px11").val() |
| | | var px12 = $("#px12").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | |
| | | var c8 = $("#c8").val() |
| | | var c10 = $("#c10").val() |
| | | var c111 = $("#c111").val() |
| | | var c12 = $("#c12").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | var r10 = document.querySelector('input[name="r10"]').checked; |
| | | var r11 = document.querySelector('input[name="r11"]').checked; |
| | | var r12 = document.querySelector('input[name="r12"]').checked; |
| | | |
| | | var json1=[]; |
| | | for (let i = 0; i < $('input[name="px9"]').length; i++) { |
| | |
| | | }else{ |
| | | r11=0 |
| | | } |
| | | if(r12){ |
| | | r12 =1 |
| | | }else{ |
| | | r12=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | |
| | | ajax.set("px8",px8); |
| | | ajax.set("px10",px10); |
| | | ajax.set("px11",px11); |
| | | ajax.set("px12",px12); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | |
| | | ajax.set("c8",c8); |
| | | ajax.set("c10",c10); |
| | | ajax.set("c111",c111); |
| | | ajax.set("c12",c12); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | |
| | | ajax.set("r8",r8); |
| | | ajax.set("r10",r10); |
| | | ajax.set("r11",r11); |
| | | ajax.set("r12",r12); |
| | | ajax.set("str",JSON.stringify(json1)); |
| | | ajax.start(); |
| | | } |
| | |
| | | var carPhoto = new $WebUpload("c111"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c12"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | |
| | | |
| | | for (let i = 0; i < $('input[name="px9"]').length; i++) { |
| | |
| | | TSiteInfo.bookingRowIndex = 0; |
| | | TSiteInfo.walkinRowIndex = 0; |
| | | |
| | | // 如果是编辑模式,初始化 priceConfig(从步骤2的单选按钮获取 isHalf) |
| | | var siteId = $("#id").val(); |
| | | if (siteId) { |
| | | // 确保 priceConfig 对象存在 |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = {}; |
| | | } |
| | | // 从步骤2的单选按钮获取 isHalf 值 |
| | | var isHalfStep2 = $("input[name='ishalf_step2']:checked").val(); |
| | | if (isHalfStep2) { |
| | | TSiteInfo.priceConfig.isHalf = parseInt(isHalfStep2); |
| | | } else { |
| | | // 如果没有选中,从隐藏字段获取(兼容旧数据) |
| | | var hiddenIsHalf = $("#type_").val(); |
| | | TSiteInfo.priceConfig.isHalf = hiddenIsHalf ? parseInt(hiddenIsHalf) : 2; |
| | | } |
| | | } else { |
| | | // 新增模式:确保 priceConfig 已初始化(应该由 nextStep 初始化) |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = { |
| | | isHalf: 2 // 默认不可预订半场 |
| | | }; |
| | | } |
| | | } |
| | | |
| | | // 监听人群选择变化 |
| | | $("#audience_booking, #audience_walkin").off('change').on('change', function() { |
| | | TSiteInfo.updateAudienceUI(); |
| | |
| | | TSiteInfo.updateAudienceUI(); |
| | | |
| | | // 加载已有的价格数据(如果是编辑模式) |
| | | var siteId = $("#id").val(); |
| | | if (siteId) { |
| | | TSiteInfo.loadSitePrices(siteId); |
| | | } |
| | |
| | | * 构建表头 |
| | | */ |
| | | TSiteInfo.buildTableHeaders = function() { |
| | | var isHalf = TSiteInfo.priceConfig.isHalf; |
| | | // 获取 isHalf 值,优先从 priceConfig 获取,如果没有则从步骤2的单选按钮获取 |
| | | var isHalf = 2; // 默认值 |
| | | if (TSiteInfo.priceConfig && TSiteInfo.priceConfig.isHalf !== undefined) { |
| | | isHalf = TSiteInfo.priceConfig.isHalf; |
| | | } else { |
| | | // 从步骤2的单选按钮获取 |
| | | var isHalfStep2 = $("input[name='ishalf_step2']:checked").val(); |
| | | if (isHalfStep2) { |
| | | isHalf = parseInt(isHalfStep2); |
| | | } else { |
| | | // 最后从隐藏字段获取(兼容旧数据) |
| | | var hiddenIsHalf = $("#type_").val(); |
| | | isHalf = hiddenIsHalf ? parseInt(hiddenIsHalf) : 2; |
| | | } |
| | | // 更新 priceConfig 以便后续使用 |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = {}; |
| | | } |
| | | TSiteInfo.priceConfig.isHalf = isHalf; |
| | | } |
| | | |
| | | var headerHtml = '<tr>' + |
| | | '<th rowspan="3" width="120">时段开始</th>' + |
| | |
| | | * 添加订场时段 |
| | | */ |
| | | TSiteInfo.addBookingTimeSlot = function() { |
| | | var isHalf = TSiteInfo.priceConfig.isHalf; |
| | | // 获取 isHalf 值,优先从 priceConfig 获取,如果没有则从步骤2的单选按钮获取 |
| | | var isHalf = 2; // 默认值 |
| | | if (TSiteInfo.priceConfig && TSiteInfo.priceConfig.isHalf !== undefined) { |
| | | isHalf = TSiteInfo.priceConfig.isHalf; |
| | | } else { |
| | | // 从步骤2的单选按钮获取 |
| | | var isHalfStep2 = $("input[name='ishalf_step2']:checked").val(); |
| | | if (isHalfStep2) { |
| | | isHalf = parseInt(isHalfStep2); |
| | | } else { |
| | | // 最后从隐藏字段获取(兼容旧数据) |
| | | var hiddenIsHalf = $("#type_").val(); |
| | | isHalf = hiddenIsHalf ? parseInt(hiddenIsHalf) : 2; |
| | | } |
| | | // 更新 priceConfig 以便后续使用 |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = {}; |
| | | } |
| | | TSiteInfo.priceConfig.isHalf = isHalf; |
| | | } |
| | | var index = TSiteInfo.bookingRowIndex++; |
| | | |
| | | var html = '<tr data-index="' + index + '">' + |
| | |
| | | * 添加散客时段 |
| | | */ |
| | | TSiteInfo.addWalkinTimeSlot = function() { |
| | | var isHalf = TSiteInfo.priceConfig.isHalf; |
| | | // 获取 isHalf 值,优先从 priceConfig 获取,如果没有则从步骤2的单选按钮获取 |
| | | var isHalf = 2; // 默认值 |
| | | if (TSiteInfo.priceConfig && TSiteInfo.priceConfig.isHalf !== undefined) { |
| | | isHalf = TSiteInfo.priceConfig.isHalf; |
| | | } else { |
| | | // 从步骤2的单选按钮获取 |
| | | var isHalfStep2 = $("input[name='ishalf_step2']:checked").val(); |
| | | if (isHalfStep2) { |
| | | isHalf = parseInt(isHalfStep2); |
| | | } else { |
| | | // 最后从隐藏字段获取(兼容旧数据) |
| | | var hiddenIsHalf = $("#type_").val(); |
| | | isHalf = hiddenIsHalf ? parseInt(hiddenIsHalf) : 2; |
| | | } |
| | | // 更新 priceConfig 以便后续使用 |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = {}; |
| | | } |
| | | TSiteInfo.priceConfig.isHalf = isHalf; |
| | | } |
| | | var index = TSiteInfo.walkinRowIndex++; |
| | | |
| | | var html = '<tr data-index="' + index + '">' + |
| | |
| | | */ |
| | | TSiteInfo.collectPriceData = function() { |
| | | var priceDTOS = []; |
| | | var isHalf = TSiteInfo.priceConfig.isHalf; |
| | | // 获取 isHalf 值,优先从 priceConfig 获取,如果没有则从步骤2的单选按钮获取 |
| | | var isHalf = 2; // 默认值 |
| | | if (TSiteInfo.priceConfig && TSiteInfo.priceConfig.isHalf !== undefined) { |
| | | isHalf = TSiteInfo.priceConfig.isHalf; |
| | | } else { |
| | | // 从步骤2的单选按钮获取 |
| | | var isHalfStep2 = $("input[name='ishalf_step2']:checked").val(); |
| | | if (isHalfStep2) { |
| | | isHalf = parseInt(isHalfStep2); |
| | | } else { |
| | | // 最后从隐藏字段获取(兼容旧数据) |
| | | var hiddenIsHalf = $("#type_").val(); |
| | | isHalf = hiddenIsHalf ? parseInt(hiddenIsHalf) : 2; |
| | | } |
| | | // 更新 priceConfig 以便后续使用 |
| | | if (!TSiteInfo.priceConfig) { |
| | | TSiteInfo.priceConfig = {}; |
| | | } |
| | | TSiteInfo.priceConfig.isHalf = isHalf; |
| | | } |
| | | var bookingChecked = $("#audience_booking").is(':checked'); |
| | | var walkinChecked = $("#audience_walkin").is(':checked'); |
| | | var validationFailed = false; // 验证失败标志 |
| | |
| | | import com.dsh.other.service.ISiteService; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @Api(tags = "硬件方调用 存储玩湃惠民卡使用记录") |
| | | @RequestMapping("/base/code") |
| | | @Slf4j |
| | | public class CodeCallBackController { |
| | | @Autowired |
| | | private ISiteBookingService siteBookingService; |
| | |
| | | */ |
| | | @GetMapping("/verify") |
| | | public ResultUtil verify(Integer codeType,String dataId, Integer rid, Integer sid) throws Exception { |
| | | log.info("硬件开门后回调 校验是否可入场"); |
| | | System.err.println("硬件开门后回调 校验是否可入场"); |
| | | System.err.println("codeType:"+codeType); |
| | | System.err.println("dataId:"+dataId); |
| | |
| | | |
| | | // codeType二维码类型1=订场 2=散客,3=门票,玩湃惠民卡codeType=4 234需要校验能否进场 |
| | | if (codeType==1 || codeType==2){ |
| | | // 将订单设置为已核销 |
| | | // 将订单设置为已使用 |
| | | SiteBooking siteBooking = siteBookingService.getById(Integer.valueOf(dataId)); |
| | | if (siteBooking==null){ |
| | | System.err.println("未查询到订场记录"+dataId); |
| | |
| | | } |
| | | if (codeType==3){ |
| | | // 判断是否能入场 远程调用将门票设置为已使用 |
| | | LocalDate now = LocalDate.now(); |
| | | Date date1 = new Date(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String day = simpleDateFormat.format(now); |
| | | String day = simpleDateFormat.format(date1); |
| | | |
| | | List<QuerySiteTimes> querySiteTimes = siteService.querySiteTimes(rid, day, null, null, 2); |
| | | Integer flag =0; |
| | |
| | | } |
| | | } |
| | | if (flag==0){ |
| | | log.info("该时间段已无空位"); |
| | | return ResultUtil.error("该时间段已无空位"); |
| | | }else{ |
| | | return ResultUtil.success(); |
| | |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.*; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ITSitePriceService sitePriceService; |
| | | @ResponseBody |
| | | @PostMapping("/base/site/querySiteList") |
| | | @ApiOperation(value = "获取场地列表", tags = {"用户—预约场地"}) |
| | |
| | | }) |
| | | public ResultUtil<List<QuerySiteListVo>> querySiteList(QuerySiteList querySiteList) { |
| | | try { |
| | | |
| | | |
| | | List<QuerySiteListVo> querySiteListVos = siteService.querySiteList(querySiteList); |
| | | return ResultUtil.success(querySiteListVos); |
| | | } catch (Exception e) { |
| | |
| | | System.err.println("订场类型:"+targetAudience); |
| | | |
| | | map.put("name", site.getName()); |
| | | map.put("targetAudience", targetAudience); |
| | | |
| | | |
| | | List<Integer> ids = getIds(siteBooking.getSiteId()); |
| | |
| | | @PostMapping("/base/site/getNewAddSiteList") |
| | | public List<SiteVo> getAppUserSiteList(@RequestBody Integer storeId) { |
| | | List<SiteVo> siteVos = new ArrayList<>(); |
| | | |
| | | DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek(); |
| | | Map<Integer, List<TSitePrice>> priceMap = sitePriceService.lambdaQuery().eq(TSitePrice::getDayOfWeek, dayOfWeek.getValue()) |
| | | .list() |
| | | .stream().collect(Collectors.groupingBy(TSitePrice::getSiteId)); |
| | | List<Site> list = siteService.list(new QueryWrapper<Site>().eq("state", 1).eq("storeId", storeId) |
| | | .orderByDesc("insertTime")); |
| | | if (list.size() > 0) { |
| | | for (Site site : list) { |
| | | List<TSitePrice> tSitePrices = priceMap.get(site.getId()); |
| | | |
| | | SiteVo vo = new SiteVo(); |
| | | vo.setIsCanBeBooked(site.getIsCanBeBooked()); |
| | | vo.setSiteId(site.getId()); |
| | | vo.setSiteName(site.getName()); |
| | | vo.setSiteTime(site.getAppointmentStartTime() + "-" + site.getAppointmentEndTime()); |
| | | vo.setSiteTime(""); |
| | | vo.setPrice(0.0); |
| | | if (tSitePrices!=null&& !tSitePrices.isEmpty()){ |
| | | BigDecimal bigDecimal = tSitePrices.get(0).getCashPrice(); |
| | | // 遍历 查询最小的价格 |
| | | for (TSitePrice tSitePrice : tSitePrices) { |
| | | if (bigDecimal.compareTo(tSitePrice.getCashPrice()) > 0) { |
| | | bigDecimal = tSitePrice.getCashPrice(); |
| | | } |
| | | } |
| | | vo.setPrice(bigDecimal.doubleValue()); |
| | | vo.setSiteTime(tSitePrices.get(0).getStartTime() + "-" + tSitePrices.get(tSitePrices.size()-1).getEndTime()); |
| | | } |
| | | SiteType byId = siteTypeService.getById(site.getSiteTypeId()); |
| | | vo.setSiteType(byId.getName()); |
| | | vo.setPrice(site.getCashPrice()); |
| | | |
| | | siteVos.add(vo); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | /** |
| | | * 数据类型(1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场) |
| | | 1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=世界杯,10=玩湃惠民卡 11 会员 12=散客入场) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | import com.dsh.other.feignclient.activity.model.QueryUserCouponByIdAndUserId; |
| | | import com.dsh.other.feignclient.activity.model.UserCoupon; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | /** |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/userCoupon/changeTicketStatus") |
| | | void changeTicketStatus(String id); |
| | | @GetMapping("/userCoupon/changeTicketStatus/{id}") |
| | | void changeTicketStatus(@PathVariable("id") String id); |
| | | /** |
| | | * 根据id获取用户优惠券数据 |
| | | * |
| | |
| | | |
| | | @ApiModelProperty(value = "价格") |
| | | private Double price; |
| | | @ApiModelProperty(value = "是否可以预约(0=否,1=是)") |
| | | private Integer isCanBeBooked; |
| | | |
| | | } |
| | |
| | | public class QueryMySiteVo { |
| | | @ApiModelProperty("场地id") |
| | | private Integer id; |
| | | @ApiModelProperty("面向人群 1订场 2散客") |
| | | private Integer targetAudience; |
| | | @ApiModelProperty("场地名称") |
| | | private String name; |
| | | @ApiModelProperty("场地类型名称") |
| | |
| | | private String lon; |
| | | @ApiModelProperty(value = "当前纬度", required = true, dataType = "String") |
| | | private String lat; |
| | | @ApiModelProperty(value = "入场方式 1订场 2散客", required = true, dataType = "Integer") |
| | | private Integer targetAudience; |
| | | } |
| | |
| | | private String time; |
| | | @ApiModelProperty("是否可选(0=否,1=是)") |
| | | private Integer selectable; |
| | | @ApiModelProperty("是否过期(0=否,1=是)") |
| | | private Integer timeAfter; |
| | | |
| | | @ApiModelProperty("已预约人数") |
| | | private Integer selectCount; |
| | | @ApiModelProperty("最大预约人数") |
| | |
| | | @ApiModelProperty(value = "现金价格(元)") |
| | | private BigDecimal cashPrice; |
| | | @ApiModelProperty(value = "玩湃币价格(币)") |
| | | private BigDecimal coinPrice; |
| | | private Integer coinPrice; |
| | | } |
| | |
| | | |
| | | @TableField("coinPrice") |
| | | @ApiModelProperty(value = "玩湃币价格(币)") |
| | | private BigDecimal coinPrice; |
| | | private Integer coinPrice; |
| | | |
| | | @TableField("insertTime") |
| | | @ApiModelProperty(value = "创建时间") |
| | |
| | | querySiteList.setPageNum((querySiteList.getPageNum() - 1) * querySiteList.getPageSize()); |
| | | DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek(); |
| | | Map<Integer, List<TSitePrice>> priceMap = sitePriceService.lambdaQuery().eq(TSitePrice::getDayOfWeek, dayOfWeek.getValue()) |
| | | .eq(TSitePrice::getTargetAudience,1).list() |
| | | .list() |
| | | .stream().collect(Collectors.groupingBy(TSitePrice::getSiteId)); |
| | | List<QuerySiteListVo> querySiteListVos = this.baseMapper.querySiteList(querySiteList); |
| | | for (QuerySiteListVo querySiteListVo : querySiteListVos) { |
| | | querySiteListVo.setPrice(0.0); |
| | | querySiteListVo.setTimes(""); |
| | | if (ToolUtil.isEmpty(querySiteList.getLon())) { |
| | | querySiteListVo.setDistance(0D); |
| | | continue; |
| | |
| | | querySiteTimes.setSelectCount(0); |
| | | querySiteTimes.setSelectMaxCount(site.getWalkinCapacity()); |
| | | querySiteTimes.setIsReserve(0); |
| | | querySiteTimes.setTimeAfter(0); |
| | | querySiteTimes.setCashPrice(tSitePrice.getCashPrice()); |
| | | querySiteTimes.setCoinPrice(tSitePrice.getCoinPrice()); |
| | | String temp = tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3) + "-" + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3); |
| | |
| | | } |
| | | if (querySiteTimes.getSelectable() == 1&&end.before(now)){ |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setTimeAfter(1); |
| | | } |
| | | if (end.before(now)){ |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setTimeAfter(1); |
| | | } |
| | | querySiteTimes.setSelectCount(count); |
| | | if (flag == 0 && querySiteTimes.getSelectable() == 1) { |
| | | // 当前时间段还没有预约 |
| | | Integer walkinCapacity = site.getWalkinCapacity(); |
| | | // 计算散客预约人数和最大散客容纳数 |
| | | System.err.println("预约人数" + count); |
| | | System.err.println("最大散客容纳数" + walkinCapacity); |
| | | if (walkinCapacity <= count) { |
| | | if (targetAudience==1 && walkinCapacity!=0){ |
| | | // 不可预约 |
| | | System.err.println("不可预约 也不能散客"); |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setIsReserve(0); |
| | | }else if (targetAudience==2){ |
| | | // 不能散客 |
| | | System.err.println("不可预约 也不能散客"); |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setIsReserve(0); |
| | | }else{ |
| | | querySiteTimes.setSelectable(1); |
| | | } |
| | | }else{ |
| | | if (targetAudience==2){ |
| | | // 散客只能预约当前时间段 |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | String nowStr = simpleDateFormat.format(now); |
| | | // 判断当前时间有没有在timePriceStart和timePriceEnd之间 |
| | | if (DateComparisonExample.isStringWithinTimeRange(nowStr, simpleDateFormat.parse(timePriceStart), simpleDateFormat.parse(timePriceEnd))) { |
| | | querySiteTimes.setSelectable(1); |
| | | }else{ |
| | | querySiteTimes.setSelectable(0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 查出lock |
| | | List<SiteLock> list = siteLockService.list(new LambdaQueryWrapper<SiteLock>().eq(SiteLock::getSiteId, id)); |
| | | for (SiteLock siteLock : list) { |
| | | String stime = day + " " + tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3); |
| | | String etime = day + " " + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3); |
| | | boolean stringDateBetween = DateComparisonExample.isStringDateBetween(stime + " - " + etime, siteLock.getStartTime(), siteLock.getEndTime()); |
| | | if (stringDateBetween) { |
| | | System.err.println("11111预约开始" + stime + "预约结束" + etime); |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setIsReserve(1); |
| | | } |
| | | if (DateComparisonExample.isStringWithinTimeRange(stime, siteLock.getStartTime(), siteLock.getEndTime())) { |
| | | System.err.println("22222预约开始" + stime + "预约结束" + etime); |
| | | |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setIsReserve(1); |
| | | } |
| | | if (DateComparisonExample.isStringWithinTimeRange(etime, siteLock.getStartTime(), siteLock.getEndTime())) { |
| | | System.err.println("33333预约开始" + stime + "预约结束" + etime); |
| | | |
| | | querySiteTimes.setSelectable(0); |
| | | querySiteTimes.setIsReserve(1); |
| | | } |
| | | } |
| | | timeRanges.add(querySiteTimes); |
| | | } |
| | | System.out.println("封装后的基础时间段和价格" + site); |
| | | |
| | | // System.out.println("================" + site); |
| | | // String appointmentStartTime = site.getAppointmentStartTime(); |
| | | // String appointmentEndTime = site.getAppointmentEndTime(); |
| | | // |
| | | // String currentTime = appointmentStartTime; |
| | | // while (currentTime.compareTo(appointmentEndTime) < 0) { |
| | | // String nextTime = null; |
| | | // if ("智慧场地".equals(site.getTypeName())) { |
| | | // nextTime = getNextTimeOne(currentTime); |
| | | // } else { |
| | | // nextTime = getNextTime(currentTime); |
| | | // } |
| | | // |
| | | // |
| | | // String timeRange = currentTime + "-" + nextTime; |
| | | // QuerySiteTimes orderDto = new QuerySiteTimes(); |
| | | // orderDto.setTime(timeRange); |
| | | // |
| | | // LocalTime currentTime1 = LocalTime.now(); |
| | | // LocalTime targetTime = LocalTime.parse(currentTime); |
| | | // |
| | | // boolean hasExceeded = currentTime1.isAfter(targetTime); |
| | | //// if (hasExceeded){ |
| | | //// orderDto.setSelectable(0); |
| | | //// } |
| | | // if (strings.contains(timeRange)) { |
| | | // |
| | | // orderDto.setSelectable(0); |
| | | // } else { |
| | | // |
| | | // String stime = day + " " + currentTime; |
| | | // String etime = day + " " + nextTime; |
| | | // orderDto.setSelectable(1); |
| | | // // 查出lock |
| | | // List<SiteLock> list = siteLockService.list(new LambdaQueryWrapper<SiteLock>().eq(SiteLock::getSiteId, id)); |
| | | // for (SiteLock siteLock : list) { |
| | | // boolean stringDateBetween = DateComparisonExample.isStringDateBetween(stime + " - " + etime, siteLock.getStartTime(), siteLock.getEndTime()); |
| | | // if (stringDateBetween) { |
| | | // orderDto.setSelectable(0); |
| | | // } |
| | | // if (DateComparisonExample.isStringWithinTimeRange(stime, siteLock.getStartTime(), siteLock.getEndTime())) { |
| | | // orderDto.setSelectable(0); |
| | | // } |
| | | // if (DateComparisonExample.isStringWithinTimeRange(etime, siteLock.getStartTime(), siteLock.getEndTime())) { |
| | | // orderDto.setSelectable(0); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // |
| | | // } |
| | | // |
| | | // |
| | | // timeRanges.add(orderDto); |
| | | // currentTime = nextTime; |
| | | // } |
| | | System.out.println("----最后封装的时间段数据------" + timeRanges); |
| | | |
| | | return timeRanges; |
| | | |
| | | |
| | | } |
| | | |
| | | // 用于继续支付 |
| | | public List<QuerySiteTimes> querySiteTimes1(Integer siteBookingId, String day, String halfName, String siteName, Integer targetAudience) throws Exception { |
| | | |
| | | SiteBooking siteBookingServiceById = iSiteBookingService.getById(siteBookingId); |
| | | Integer id = siteBookingServiceById.getSiteId(); |
| | | System.out.println("=======date======" + day); |
| | | List<String> strings = new ArrayList<>(); |
| | | |
| | | List<SiteBooking> siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>() |
| | | .ne("id", siteBookingId).eq("siteId", id).ne("status", 5).eq("nextName", siteName).like("times", day)); |
| | | |
| | | if (siteName == null || siteName.equals("")) { |
| | | siteBookings = iSiteBookingService.list(new QueryWrapper<SiteBooking>().eq("siteId", id).ne("status", 5).like("times", day)); |
| | | } |
| | | |
| | | |
| | | System.out.println("=======已预约列表======" + siteBookings); |
| | | for (SiteBooking siteBooking : siteBookings) { |
| | | |
| | | |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | |
| | | if (siteBooking.getIsHalf() == 2) { |
| | | for (String s : split) { |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue + (siteBooking.getTargetAudience() != null ? "," + siteBooking.getTargetAudience() : ",1")); |
| | | } |
| | | } else { |
| | | if (halfName == null) { |
| | | for (String s : split) { |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue + (siteBooking.getTargetAudience() != null ? "," + siteBooking.getTargetAudience() : ",1")); |
| | | } |
| | | } |
| | | |
| | | if (siteBooking.getHalfName().equals(halfName)) { |
| | | for (String s : split) { |
| | | String convertedValue = s.substring(11); |
| | | strings.add(convertedValue + (siteBooking.getTargetAudience() != null ? "," + siteBooking.getTargetAudience() : ",1")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | System.out.println("======已经预约时间段=======" + strings); |
| | | |
| | | |
| | | Site site = siteService.getById(id); |
| | | List<QuerySiteTimes> timeRanges = new ArrayList<>(); |
| | | day = day.split(";")[0].split(" ")[0]; |
| | | LocalDate date = LocalDate.parse(day); |
| | | DayOfWeek dayOfWeek = date.getDayOfWeek(); |
| | | // 通过日期 确定周X 查询设置的可以约时间段和金额 封装基础时间段数据 |
| | | LambdaQueryWrapper<TSitePrice> tSitePriceLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getSiteId, id); |
| | | tSitePriceLambdaQueryWrapper.orderByAsc(TSitePrice::getStartTime); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getTargetAudience, targetAudience); |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getDayOfWeek, dayOfWeek.getValue()); |
| | | if (StringUtils.hasLength(halfName)) { |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getFieldType, 2); |
| | | } else { |
| | | tSitePriceLambdaQueryWrapper.eq(TSitePrice::getFieldType, 1); |
| | | } |
| | | List<TSitePrice> sitePrice = sitePriceService.list(tSitePriceLambdaQueryWrapper); |
| | | |
| | | SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | |
| | | for (TSitePrice tSitePrice : sitePrice) { |
| | | QuerySiteTimes querySiteTimes = new QuerySiteTimes(); |
| | | querySiteTimes.setTime(tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3) + "-" + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3)); |
| | | querySiteTimes.setSelectable(1); |
| | | querySiteTimes.setSelectCount(0); |
| | | querySiteTimes.setSelectMaxCount(site.getWalkinCapacity()); |
| | | querySiteTimes.setIsReserve(0); |
| | | querySiteTimes.setCashPrice(tSitePrice.getCashPrice()); |
| | | querySiteTimes.setCoinPrice(tSitePrice.getCoinPrice()); |
| | | String temp = tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3) + "-" + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3); |
| | | String timePriceStart = day + " " + tSitePrice.getStartTime().substring(0, tSitePrice.getStartTime().length() - 3); |
| | | String timePriceEnd = day + " " + tSitePrice.getEndTime().substring(0, tSitePrice.getEndTime().length() - 3); |
| | | Date now = new Date(); |
| | | Date start = simpleDateFormat1.parse(timePriceStart); |
| | | Date end = simpleDateFormat1.parse(timePriceEnd); |
| | | // 已经预约了 判断是散客模式还是订场模式 |
| | | Integer flag = 0; |
| | | // 散客预约人数 |
| | | Integer count = 0; |
| | | for (String time : strings) { |
| | | // 先判断时间是否和预约时间有交集 |
| | | String s = time.split(",")[1]; |
| | | String timeRange = time.split(",")[0]; |
| | | String[] split = timeRange.split("-"); |
| | | String bookingStart = day + " " + split[0]; |
| | | String bookingEnd = day + " " + split[1]; |
| | | if (!isTimePeriodsIntersect(timePriceStart, timePriceEnd, bookingStart, bookingEnd)) { |
| | | // 不相交 |
| | | } else { |
| | | if (s.equals("1")) { |
| | | // 订场 不可再预约了 |
| | | querySiteTimes.setIsReserve(1); |
| | | querySiteTimes.setSelectable(0); |
| | | flag = 1; |
| | | break; |
| | | } |
| | | count++; |
| | | } |
| | | } |
| | | if (querySiteTimes.getSelectable() == 1&&end.before(now)){ |
| | | querySiteTimes.setSelectable(0); |
| | | } |
| | | if (end.before(now)){ |
| | | querySiteTimes.setSelectable(0); |
| | | } |
| | | querySiteTimes.setSelectCount(count); |
| | | if (flag == 0 && querySiteTimes.getSelectable() == 1) { |
| | |
| | | String[] split = reservationSite.getTimes().split(";"); |
| | | // 所选时间段 所需总计金额 |
| | | BigDecimal money = BigDecimal.ZERO; |
| | | BigDecimal playCoin = BigDecimal.ZERO; |
| | | Integer playCoin = 0; |
| | | for (String s : split) { |
| | | String day = s.split(" ")[0]; |
| | | String time = s.split(" ")[1]; |
| | |
| | | } |
| | | if (querySiteTime.getTime().equals(time)) { |
| | | money = money.add(querySiteTime.getCashPrice()); |
| | | playCoin = playCoin.add(querySiteTime.getCoinPrice()); |
| | | playCoin = playCoin+querySiteTime.getCoinPrice(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | return aliPaymentSite(money.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), siteBooking); |
| | | } |
| | | if (reservationSite.getPayType() == 3) {//玩湃币支付 |
| | | return playPaiCoinPaymentSite(appUser, playCoin.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), siteBooking); |
| | | return playPaiCoinPaymentSite(appUser, playCoin.doubleValue(), siteBooking); |
| | | |
| | | } |
| | | return ResultUtil.success(); |
| | |
| | | pageNo = (pageNo - 1) * pageSize; |
| | | List<QueryMySiteVo> queryMySiteVos = this.baseMapper.queryMySite(uid, status, pageNo, pageSize); |
| | | for (QueryMySiteVo queryMySiteVo : queryMySiteVos) { |
| | | if (queryMySiteVo.getTargetAudience()==null){ |
| | | queryMySiteVo.setTargetAudience(1); |
| | | } |
| | | SiteBooking siteBooking = siteBookingService.getById(queryMySiteVo.getId()); |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | // 所选时间段 所需总计金额 |
| | | BigDecimal money = BigDecimal.ZERO; |
| | | BigDecimal playCoin = BigDecimal.ZERO; |
| | | Integer playCoin = 0; |
| | | for (String s : split) { |
| | | |
| | | String day = s.split(" ")[0]; |
| | |
| | | // } |
| | | if (querySiteTime.getTime().equals(time)) { |
| | | money = money.add(querySiteTime.getCashPrice()); |
| | | playCoin = playCoin.add(querySiteTime.getCoinPrice()); |
| | | playCoin = playCoin+querySiteTime.getCoinPrice(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | queryMySiteVo.setPlayPaiCoin(playCoin.setScale(0, RoundingMode.DOWN).intValue()); |
| | | queryMySiteVo.setPlayPaiCoin(playCoin); |
| | | } |
| | | return queryMySiteVos; |
| | | } |
| | |
| | | Site byId = siteService.getById(siteBooking.getSiteId()); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | Date startTime = siteBooking.getStartTime(); |
| | | if (format.format(new Date()).equals(format.format(startTime)) && siteBooking.getStatus() != 0) { |
| | | if (siteBooking.getTargetAudience() == 1 && format.format(new Date()).equals(format.format(startTime)) && siteBooking.getStatus() != 0) { |
| | | return ResultUtil.error("预约当天,不能取消"); |
| | | } |
| | | |
| | | if (siteBooking.getTargetAudience() == 2){ |
| | | Date date = new Date(); |
| | | if (siteBooking.getEndTime().before( date)){ |
| | | return ResultUtil.error("已过期,不能取消"); |
| | | } |
| | | } |
| | | if (siteBooking.getStatus() == 0) { |
| | | siteBooking.setStatus(5); |
| | | siteBookingService.updateById(siteBooking); |
| | |
| | | String[] split = siteBooking.getTimes().split(";"); |
| | | // 所选时间段 所需总计金额 |
| | | BigDecimal money = BigDecimal.ZERO; |
| | | BigDecimal playCoin = BigDecimal.ZERO; |
| | | Integer playCoin = 0; |
| | | for (String s : split) { |
| | | String day = s.split(" ")[0]; |
| | | String time = s.split(" ")[1]; |
| | | String bookingStart = day + " " + time.split("-")[0]; |
| | | String bookingEnd = day + " " + time.split("-")[1]; |
| | | List<QuerySiteTimes> querySiteTimes = querySiteTimes(siteBooking.getId(), day, siteBooking.getHalfName(), siteBooking.getNextName(), siteBooking.getTargetAudience()); |
| | | List<QuerySiteTimes> querySiteTimes = querySiteTimes1(siteBooking.getId(), day, siteBooking.getHalfName(), siteBooking.getNextName(), siteBooking.getTargetAudience()); |
| | | for (QuerySiteTimes querySiteTime : querySiteTimes) { |
| | | String timePriceStart = day + " " + querySiteTime.getTime().split("-")[0]; |
| | | String timePriceEnd = day + " " + querySiteTime.getTime().split("-")[1]; |
| | | if (!isTimePeriodsIntersect(timePriceStart, timePriceEnd, bookingStart, bookingEnd)) { |
| | | // 时间不相交 |
| | | } else if (querySiteTime.getSelectable() == 0) { |
| | | if (querySiteTime.getIsReserve() == 1) { |
| | | return ResultUtil.error("【" + s + "】" + |
| | | "时间段已被使用"); |
| | | } else { |
| | | return ResultUtil.error("【" + s + "】" + |
| | | "时间段散客人数已满"); |
| | | } |
| | | } |
| | | if (querySiteTime.getTime().equals(time)) { |
| | | money = money.add(querySiteTime.getCashPrice()); |
| | | playCoin = playCoin.add(querySiteTime.getCoinPrice()); |
| | | playCoin = playCoin+querySiteTime.getCoinPrice(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | siteBooking.setOrderNo(sdf.format(new Date()) + UUIDUtil.getNumberRandom(3)); |
| | | |
| | | siteBooking.setPayType(payType); |
| | | siteBooking.setPayMoney(money.doubleValue()); |
| | | if (payType==3){ |
| | | siteBooking.setPayMoney(playCoin.doubleValue()); |
| | | }else{ |
| | | siteBooking.setPayMoney(money.doubleValue()); |
| | | } |
| | | if (payType == 3) { |
| | | siteBooking.setUserCouponId(null); |
| | | } |
| | |
| | | Map<String, Double> map = new HashMap<>(); |
| | | // 所选时间段 所需总计金额 |
| | | BigDecimal money = BigDecimal.ZERO; |
| | | BigDecimal playCoin = BigDecimal.ZERO; |
| | | Integer playCoin = 0; |
| | | for (String s : split) { |
| | | String day = s.split(" ")[0]; |
| | | String time = s.split(" ")[1]; |
| | | String bookingStart = day + " " + time.split("-")[0]; |
| | | String bookingEnd = day + " " + time.split("-")[1]; |
| | | List<QuerySiteTimes> querySiteTimes = querySiteTimes(siteBooking.getId(), day, siteBooking.getHalfName(), siteBooking.getNextName(), siteBooking.getTargetAudience()); |
| | | List<QuerySiteTimes> querySiteTimes = querySiteTimes1(siteBooking.getId(), day, siteBooking.getHalfName(), siteBooking.getNextName(), siteBooking.getTargetAudience()); |
| | | for (QuerySiteTimes querySiteTime : querySiteTimes) { |
| | | String timePriceStart = day + " " + querySiteTime.getTime().split("-")[0]; |
| | | String timePriceEnd = day + " " + querySiteTime.getTime().split("-")[1]; |
| | | if (!isTimePeriodsIntersect(timePriceStart, timePriceEnd, bookingStart, bookingEnd)) { |
| | | // 时间不相交 |
| | | } else if (querySiteTime.getSelectable() == 0) { |
| | | if (querySiteTime.getIsReserve() == 1) { |
| | | return ResultUtil.error("【" + s + "】" + |
| | | "时间段已被使用"); |
| | | } else { |
| | | return ResultUtil.error("【" + s + "】" + |
| | | "时间段散客人数已满"); |
| | | } |
| | | } |
| | | if (querySiteTime.getTime().equals(time)) { |
| | | money = money.add(querySiteTime.getCashPrice()); |
| | | playCoin = playCoin.add(querySiteTime.getCoinPrice()); |
| | | playCoin = playCoin+querySiteTime.getCoinPrice(); |
| | | break; |
| | | } |
| | | } |
| | |
| | | |
| | | private String alipay_root_cert_path = "C:/cert/alipay/user/alipay_root_cert_path.crt";//支付宝CA根证书文件路径 |
| | | |
| | | private String certPath = "/usr/playpai/cert/weixin/apiclient_cert.p12";//微信证书 |
| | | // private String certPath = "/usr/playpai/cert/weixin/apiclient_cert.p12";//微信证书 |
| | | private String certPath = "E:\\apiclient_cert.p12";//微信证书 |
| | | |
| | | |
| | | public ResultUtil confirm(String smid1,String code, String outTradeNo, String amount) throws AlipayApiException { |
| | |
| | | </select> |
| | | <select id="orderlist" resultType="map"> |
| | | SELECT *,st.`name` as storeName,si.`name` as siteName,CONCAT(DATE_FORMAT(bk.startTime, '%Y-%m-%d %H:%i:%s'), ' - |
| | | ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange |
| | | ', TIME_FORMAT(bk.endTime, '%H:%i:%s')) AS timeRange,bk.targetAudience |
| | | FROM t_site_booking bk |
| | | LEFT JOIN t_store st on bk.storeId = st.id |
| | | LEFT JOIN t_site si on bk.siteId = si.id |
| | |
| | | <if test="null != item.search and '' != item.search"> |
| | | and (a.name like CONCAT('%', #{item.search}, '%') or b.name like CONCAT('%', #{item.search}, '%')) |
| | | </if> |
| | | <if test="null != item.targetAudience and '' != item.targetAudience"> |
| | | and (a.targetAudience like CONCAT('%', #{item.targetAudience}, '%')) |
| | | </if> |
| | | order by a.insertTime desc limit #{item.pageNum}, #{item.pageSize} |
| | | </select> |
| | | |
| | |
| | | a.payMoney as payMoney, |
| | | a.payType as payType, |
| | | a.isHalf as isHalf, |
| | | a.targetAudience as targetAudience, |
| | | 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 |