| | |
| | | } |
| | | this.insert(userInfo); |
| | | |
| | | addnewCoupoun(phone,userInfo); |
| | | |
| | | |
| | | this.addCoupon(userInfo);//添加优惠券 |
| | | |
| | | UserInfo finalUserInfo = userInfo; |
| | |
| | | smsrecordService.saveData(1, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | @Autowired |
| | | private ITActivityGeneralizationService activityGeneralizationService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ISysCouponRecordService sysCouponRecordService; |
| | | public void addnewCoupoun(String phone,UserInfo userInfo){ |
| | | Integer acId = Integer.valueOf(redisUtil.getValue("counpon:" + phone)); |
| | | TActivityGeneralization tActivityGeneralization = activityGeneralizationService.selectById(acId); |
| | | SysCouponRecord sysCouponRecord = sysCouponRecordService.selectById(tActivityGeneralization.getCouponId()); |
| | | Date date = new Date(); |
| | | UserCouponRecord userCouponRecord = new UserCouponRecord(); |
| | | userCouponRecord.setActivityType(5); |
| | | userCouponRecord.setCouponActivityId(acId); |
| | | userCouponRecord.setCouponId(tActivityGeneralization.getCouponId()); |
| | | userCouponRecord.setState(1); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH) + sysCouponRecord.getEffective()); |
| | | userCouponRecord.setExpirationTime(calendar.getTime()); |
| | | userCouponRecord.setCouponType(Integer.valueOf(String.valueOf(sysCouponRecord.getCouponType()))); |
| | | userCouponRecord.setCouponUseType(sysCouponRecord.getCouponUseType()); |
| | | userCouponRecord.setInsertTime(date); |
| | | userCouponRecord.setFullMoney(Double.valueOf(String.valueOf(sysCouponRecord.getFullMoney()))); |
| | | userCouponRecord.setMoney(Double.valueOf(String.valueOf(sysCouponRecord.getMoney()))); |
| | | userCouponRecord.setCompanyId(userInfo.getCompanyId()); |
| | | userCouponRecord.setUserId(userInfo.getId()); |
| | | |
| | | Integer userGrantCount = tActivityGeneralization.getUserGrantCount(); |
| | | // userCouponRecordService.insert(userCouponRecord); |
| | | if (userGrantCount != null && userGrantCount > 0) { |
| | | for (int i = 0; i < userGrantCount; i++) {// ... |
| | | userCouponRecordService.insert(userCouponRecord); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 手机验证码登录 |
| | | * @param accessToken |