| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.ThreeSaleMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.FrequencyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask.TaskUniqueKeyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | |
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetFrequencyLimit;
|
| | | import com.yeshi.fanli.util.annotation.integral.IntegralGetVersionLimit;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private IntegralTaskRankService integralTaskRankService;
|
| | |
|
| | | // TODO 有bug
|
| | | private UserInfo getBossByUid(Long uid) {
|
| | |
| | | if (count > 0)
|
| | | throw new IntegralGetException(2, "事件触发达到上限");
|
| | | }
|
| | | |
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra == null)
|
| | | throw new IntegralGetException(2, "额外信息不存在");
|
| | | |
| | | UserRank userRank = userInfoExtra.getUserRank();
|
| | | if (userRank == null)
|
| | | throw new IntegralGetException(2,"等级信息不存在");
|
| | |
|
| | | int goldCoin = task.getGoldCoin();
|
| | | if (task.getDoubleNum() != null && task.getDoubleNum() > 0)
|
| | | goldCoin = task.getDoubleNum() * goldCoin;
|
| | | |
| | | Long taskId = task.getId();
|
| | | IntegralTaskRank traskRank = integralTaskRankService.getByTsakIdAndRankId(taskId, userRank.getId());
|
| | | if (traskRank != null) {
|
| | | Integer addCoin = traskRank.getAddCoin();
|
| | | if (addCoin != null && addCoin > 0)
|
| | | goldCoin += addCoin;
|
| | |
|
| | | Integer doubleNum = traskRank.getDoubleNum();
|
| | | if (doubleNum != null && doubleNum > 0) {
|
| | | goldCoin = goldCoin * doubleNum;
|
| | | }
|
| | | }
|
| | |
|
| | | IntegralTaskRecord record = new IntegralTaskRecord();
|
| | | record.setCid(task.getTaskClass().getId());
|