| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<Goods>> pointsMallList(MallRequest request) { |
| | | // try { |
| | | System.out.println("======request========" + request); |
| | | return ResultUtil.success(tauService.queryAppUserIntegral(request)); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | goods.add(commodity); |
| | | } |
| | | } |
| | | |
| | | List<Coupon> allCoupons = ucponClient.getAllCoupons(commodityRequest); |
| | | if (allCoupons.size() > 0) { |
| | | for (Coupon allCoupon : allCoupons) { |
| | |
| | | userCouponPayment.setCode(code); |
| | | userCouponPayment.setPayType(coupon.getRedemptionMethod()); |
| | | userCouponPayment.setIntegral(coupon.getIntegral().intValue()); |
| | | userCouponPayment.setCash(coupon.getCash().doubleValue()); |
| | | userCouponPayment.setCash(null == coupon.getCash() ? 0D : coupon.getCash().doubleValue()); |
| | | userCouponPayment.setCashPayType(exchangeType.getPayType()); |
| | | userCouponPayment.setInsertTime(new Date()); |
| | | |
| | |
| | | try { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | PointsMerchandise merchandise = new PointsMerchandise(); |
| | | if(exchangeType.getGoodsType() != 4){ |
| | | merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | }else{ |
| | | Coupon coupon = ucponClient.queryCouponById(exchangeType.getGoodId()); |
| | | merchandise.setId(coupon.getId()); |
| | | merchandise.setUserPopulation(coupon.getUserPopulation()); |
| | | merchandise.setIntegral(coupon.getIntegral().intValue()); |
| | | merchandise.setQuantityIssued(coupon.getQuantityIssued()); |
| | | merchandise.setPickUpQuantity(coupon.getPickUpQuantity()); |
| | | merchandise.setUseScope(coupon.getUseScope()); |
| | | merchandise.setCash(coupon.getCash()); |
| | | merchandise.setType(4); |
| | | } |
| | | |
| | | |
| | | if (ToolUtil.isEmpty(merchandise)) { |
| | |
| | | String province = addressComponent.getString("province"); |
| | | String city = addressComponent.getString("city"); |
| | | String district = addressComponent.getString("district"); |
| | | if("[]".equals(code)){ |
| | | throw new Exception("经纬度转行政区划代码失败[" + lon + "," + lan + "]"); |
| | | } |
| | | map.put("province", province); |
| | | map.put("provinceCode", code.substring(0, 2) + "0000"); |
| | | map.put("city", city); |
| | |
| | | return commodity; |
| | | } |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | @Autowired |
| | | private PointsMerchandiseService pointsMerchandiseService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request) { |
| | | // if (request.getShopId()!=null){ |
| | | // List<CoursePackage> coursePackages = coursePackageClient.queryByStoreId(request.getShopId()); |
| | | // List<Integer> coursIds = new ArrayList<>(); |
| | | // for (CoursePackage coursePackage : coursePackages) { |
| | | // coursIds.add(coursePackage.getId()); |
| | | // } |
| | | // List<PointsMerchandise> points = pointsMerchandiseService.list(new QueryWrapper<PointsMerchandise>().eq("state",1).eq("shelves",1).in("coursePackageId", coursIds)); |
| | | // PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | // pointMerchandiseVo.setMerchandises(points); |
| | | // return pointMerchandiseVo; |
| | | // |
| | | // } |
| | | |
| | | |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | List<PointsMerchandise> list = new ArrayList<>(); |
| | |
| | | String province = addressComponent.getString("province"); |
| | | String city = addressComponent.getString("city"); |
| | | String district = addressComponent.getString("district"); |
| | | if("[]".equals(code)){ |
| | | throw new Exception("经纬度转行政区划代码失败[" + lon + "," + lan + "]"); |
| | | } |
| | | map.put("province", province); |
| | | map.put("provinceCode", code.substring(0, 2) + "0000"); |
| | | map.put("city", city); |
| | |
| | | @ApiImplicitParam(value = "课包id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "经度", name = "lon", dataType = "string", required = false), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", dataType = "string", required = false), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", dataType = "int", required = false), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<CoursePackageInfo> queryCourseInfo(Integer id, String lon, String lat, Long payId) { |
| | | public ResultUtil<CoursePackageInfo> queryCourseInfo(Integer id, String lon, String lat, Integer stuId) { |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | CoursePackageInfo coursePackageInfo = coursePackageService.queryCourseInfo(uid, id, lon, lat); |
| | | CoursePackageInfo coursePackageInfo = coursePackageService.queryCourseInfo(uid, id, lon, lat, stuId); |
| | | return ResultUtil.success(coursePackageInfo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | CoursePackageInfo queryCourseInfo(Integer uid, Integer id, String lon, String lat) throws Exception; |
| | | CoursePackageInfo queryCourseInfo(Integer uid, Integer id, String lon, String lat, Integer stuId) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | response.setIntroduceDrawing(coursePackage.getIntroduceDrawing()); |
| | | |
| | | Integer payType = coursePackageOrder.getPayType(); |
| | | if(null == payType){ |
| | | CoursePackagePaymentConfig config = coursePackagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId", coursePackage.getId()).orderByAsc("classHours")).get(0); |
| | | if (ToolUtil.isNotEmpty(config.getCashPayment()) && config.getCashPayment() > 0 && ToolUtil.isNotEmpty(config.getPlayPaiCoin()) && config.getPlayPaiCoin() > 0) { |
| | | payType = 3; |
| | | } else if (ToolUtil.isNotEmpty(config.getCashPayment()) && config.getCashPayment() > 0) { |
| | | payType = 1; |
| | | } else if (ToolUtil.isNotEmpty(config.getPlayPaiCoin()) && config.getPlayPaiCoin() > 0) { |
| | | payType = 2; |
| | | } |
| | | } |
| | | BigDecimal cashPayment = coursePackageOrder.getCashPayment(); |
| | | double cashPaymentValue = 0.0; |
| | | if (cashPayment != null) { |
| | |
| | | |
| | | switch (payType) { |
| | | case 1: |
| | | case 2: |
| | | case 3: |
| | | response.setAmount(cashPaymentValue); |
| | | response.setVipAmount(discountMember); |
| | | break; |
| | | case 3: |
| | | case 2: |
| | | if (playPaiCoin!=null) { |
| | | response.setWpGold(playPaiCoin); |
| | | } |
| | |
| | | @Override |
| | | public List<CoursePackageListVo> queryCourseList(Integer uid, CoursePackageList coursePackageList) throws Exception { |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(coursePackageList.getLon(), coursePackageList.getLat()); |
| | | String provinceCode = geocode.get("provinceCode"); |
| | | String cityCode = geocode.get("cityCode"); |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(coursePackageList.getLon(), coursePackageList.getLat()); |
| | | // String provinceCode = geocode.get("provinceCode"); |
| | | // String cityCode = geocode.get("cityCode"); |
| | | // QueryWrapper<TCoursePackage> wrapper = new QueryWrapper<TCoursePackage>().in("status", Arrays.asList(1, 2)) |
| | | // .eq("auditStatus", 2).eq("state", 1).eq("provinceCode", provinceCode).eq("cityCode", cityCode); |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public CoursePackageInfo queryCourseInfo(Integer uid, Integer id, String lon, String lat) throws Exception { |
| | | public CoursePackageInfo queryCourseInfo(Integer uid, Integer id, String lon, String lat, Integer stuId) throws Exception { |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | TCoursePackage coursePackage = this.getById(id); |
| | | CoursePackageInfo coursePackageInfo = new CoursePackageInfo(); |
| | |
| | | }); |
| | | coursePackageInfo.setList(list); |
| | | |
| | | Student student = studentClient.queryDefaultStudent(uid); |
| | | StudentVo studentVo = new StudentVo(); |
| | | Student student = null; |
| | | if(null != stuId){ |
| | | student = studentClient.queryStudentById(stuId); |
| | | }else{ |
| | | student = studentClient.queryDefaultStudent(uid); |
| | | } |
| | | if (null != student) { |
| | | studentVo.setId(student.getId()); |
| | | studentVo.setPhone(student.getPhone()); |
| | |
| | | @Override |
| | | public ResultUtil paymentCourse(Integer uid, PaymentCourseVo paymentCourseVo) throws Exception { |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | CoursePackageInfo coursePackageInfo = queryCourseInfo(uid, paymentCourseVo.getId(), null, null); |
| | | CoursePackageInfo coursePackageInfo = queryCourseInfo(uid, paymentCourseVo.getId(), null, null, null); |
| | | //校验是否已经报满 |
| | | Integer integer = coursePackagePaymentService.queryCountNumber(paymentCourseVo.getId()); |
| | | TCoursePackage course = coursePackageService.getById(paymentCourseVo.getId()); |