| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil productRedemptionOperation(GoodsExchangeVo exchangeType){ |
| | | public synchronized ResultUtil productRedemptionOperation(GoodsExchangeVo exchangeType){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | TAppUser tAppUser = this.baseMapper.selectOne(new QueryWrapper<TAppUser>().eq("phone", phone).ne("state", 3)); |
| | | if(tAppUser==null){ |
| | | return ResultUtil.error("该账号未注册", ""); |
| | | } |
| | | if(tAppUser.getState() == 2){ |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | } |
| | |
| | | if (ToolUtil.isEmpty(merchandise)){ |
| | | return ResultUtil.error("商品不存在"); |
| | | } |
| | | |
| | | |
| | | TAppUser tAppUser = this.baseMapper.selectById(userIdFormRedis); |
| | | |
| | | |
| | | if(merchandise.getUserPopulation()==2){ |
| | | if(tAppUser.getIsVip()==0){ |
| | | return ResultUtil.error("该商品只能年度会员购买"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | 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("用户不存在"); |
| | | } |
| | |
| | | detail.setDetailsType(2); |
| | | break; |
| | | case 2: |
| | | detail.setConsumeAmount("-"+(userIntegralChange.getNewIntegral() - userIntegralChange.getOldIntegral())); |
| | | detail.setConsumeAmount(""+(userIntegralChange.getNewIntegral() - userIntegralChange.getOldIntegral())); |
| | | detail.setConsumeName("兑换商品"); |
| | | detail.setDetailsType(1); |
| | | break; |
| | |
| | | userIntegralChanges.setOldIntegral(appUser.getIntegral()); |
| | | userIntegralChanges.setType(vo.getType()); |
| | | appUser.setIntegral(appUser.getIntegral() + vo.getIntegral()); |
| | | tauMapper.updateById(appUser); |
| | | userIntegralChanges.setNewIntegral(appUser.getIntegral()); |
| | | userIntegralChanges.setInsertTime(new Date()); |
| | | userIntegralChanges.setCategory(1); |
| | |
| | | detailsResponse.setEndTime(simpleDateFormat.format(merchandise.getEndTime())); |
| | | detailsResponse.setUseStatus(pointsMerchandise.getStatus() == 1 ? 2 : 1); |
| | | detailsResponse.setGoodType(merchandise.getType()); |
| | | if(merchandise.getType()==3){ |
| | | detailsResponse.setUserId(appUserId); |
| | | if(merchandise.getUseScope()==1){ |
| | | detailsResponse.setSid(0); |
| | | }else if(merchandise.getUseScope()==2){ |
| | | |
| | | }else if(merchandise.getUseScope()==3){ |
| | | |
| | | } |
| | | } |
| | | responses.add(detailsResponse); |
| | | } |
| | | detailsVo.setDetailsResponses(responses); |
| | |
| | | vo.setSort(byId.getSort()); |
| | | vo.setContent(byId.getRedemptionInstructions()); |
| | | } |
| | | int count = userPointsMerchandiseService.count(new LambdaQueryWrapper<UserPointsMerchandise>().eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsId)); |
| | | vo.setNum(count); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value = "商品类型 1实物 2课包 3门票 4优惠券") |
| | | private Integer goodType; |
| | | |
| | | |
| | | private Integer userId; |
| | | |
| | | private Integer sid; |
| | | |
| | | } |
| | |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | |
| | | private Integer num; |
| | | } |
| | |
| | | return integers; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<Integer> week = week("周一,周二"); |
| | | // 今天周几 |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("MM.dd"); |
| | | |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | for (Integer integer : week) { |
| | | if(integer<i){ |
| | | // 找下一周的时间 |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7-(i-integer)); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | |
| | | }else if(integer>i) { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,integer-i); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | }else { |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.add(Calendar.DATE,7); |
| | | Date time = instance.getTime(); |
| | | strings.add(format.format(time)); |
| | | } |
| | | } |
| | | System.out.println(strings); |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payCourse(PayCourseReq req,Integer userId){ |
| | |
| | | |
| | | |
| | | public class NettyMsg { |
| | | public static void main(String[] args) { |
| | | Map<String,Object> map = new HashMap<String, Object>(); |
| | | //用户信息 |
| | | map.put("imgUrl","1"); |
| | | map.put("nickName","1"); |
| | | map.put("licensePlate","1"); |
| | | map.put("phone",1); |
| | | map.put("driverId",1); |
| | | map.put("carColor","1"); |
| | | map.put("modelName","1"); |
| | | map.put("brandName","1"); |
| | | map.put("driverOrderNums",1); |
| | | map.put("score",1); |
| | | |
| | | |
| | | map.put("id",1); |
| | | map.put("orderNum", "123456"); |
| | | map.put("startAddress", "测试"); |
| | | map.put("endAddress", "测试1"); |
| | | map.put("departureTime", 1533608196000L); |
| | | map.put("type",1); |
| | | map.put("mileage",1); |
| | | map.put("mileageMoney",10); |
| | | map.put("duration",10); |
| | | map.put("durationMoney",10); |
| | | map.put("nightMoney",1); |
| | | map.put("serverMoney",1); |
| | | map.put("nightMileage",10); |
| | | map.put("longMileage",10); |
| | | map.put("longDurationMoney",10); |
| | | map.put("orderMoney",10); |
| | | map.put("payMoney",10); |
| | | map.put("couponsMoney",10); |
| | | System.out.println(setMsg(Method.ping, new HashMap<String, Object>())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 返回一个正确数据 |
| | | * |
| | |
| | | * 排序 |
| | | */ |
| | | Integer sort; |
| | | /** |
| | | * 已换数量 |
| | | */ |
| | | private Integer num; |
| | | } |
| | |
| | | */ |
| | | final static private String[] CHINESE_MONEY_UNIT = { "圆", "角", "分" }; |
| | | |
| | | public static void main(String[] args) { |
| | | String chineseMoney = toChineseMoney(new BigDecimal("320")); |
| | | System.out.println("chineseMoney = " + chineseMoney); |
| | | } |
| | | |
| | | /** |
| | | * @param sourceMoney 要转换的数值,最多支持到亿 |
| | |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | System.out.println("id:"+id); |
| | | PointMercharsVo pointMercharsVo = pointMercharsClient.queryPointMerchaseDetailOfId(id); |
| | | |
| | | System.out.println("pointMercharsVo:"+pointMercharsVo); |
| | | String[] split = pointMercharsVo.getPics().split(","); |
| | | StringBuilder concatenatedString = new StringBuilder(); |
| | |
| | | return builder.toString(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | BigDecimal number = new BigDecimal("12345.67"); |
| | | String chineseAmount = convertToChineseAmount(number); |
| | | System.out.println(chineseAmount); // Output: 壹万贰仟叁佰肆拾伍元陆角柒分 |
| | | } |
| | | } |
| | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | <input id="goodsId" value="${id}" hidden="hidden"> |
| | | <input id="nums" value="${item.num}" hidden="hidden"> |
| | | <#input id="name" name="商品名称" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#avatar id="cover" name="商品封面:" avatarImg="${item.cover}" /> |
| | |
| | | if (quantityIssued <= quantityHas){ |
| | | return Feng.error('发放数量小于已领数量!'); |
| | | } |
| | | let nums = $("#nums").val(); |
| | | if (quantityIssued <= nums){ |
| | | return Feng.error('发放数量小于已领数量!'); |
| | | } |
| | | |
| | | |
| | | |
| | | if (editor === undefined || editor === null || editor === ''){ |
| | |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Integer integer = startGame(1, 13, 1001, 1001); |
| | | System.out.println(integer); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/space_list?page=1&page_num=100"); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | System.out.println(body); |
| | | } |
| | | } |