| | |
| | | import com.yeshi.fanli.entity.integral.CodePublishRecord;
|
| | | import com.yeshi.fanli.entity.integral.IntegralExchange;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTask;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRank;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskClass.UniqueKeyEnum;
|
| | | import com.yeshi.fanli.entity.integral.IntegralTaskRecord;
|
| | | import com.yeshi.fanli.exception.integral.IntegralExchangeException;
|
| | | import com.yeshi.fanli.exception.integral.IntegralGetException;
|
| | | import com.yeshi.fanli.exception.integral.IntegralTaskRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.service.inter.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskClassService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRankService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralTaskRecordService;
|
| | |
| | |
|
| | | @Resource
|
| | | private IntegralTaskService integralTaskService;
|
| | |
|
| | | @Resource
|
| | | private IntegralGetService integralGetService;
|
| | |
|
| | | /**
|
| | | * 获取任务列表
|
| | |
| | | data.put("dailySign", dailySignVO);
|
| | | }
|
| | |
|
| | | |
| | | for (IntegralTaskClassVO taskClassVO : list) {
|
| | | String progress = taskClassVO.getProgress();
|
| | | if (StringUtil.isNullOrEmpty(progress))
|
| | |
| | | Integer num = integralTaskRecordService.getNowdaySignNum(uid, taskClassVO.getId());
|
| | |
|
| | | String uniqueKeyTask = UniqueKeyEnum.dailySign.name() + num;
|
| | | IntegralTask integralTask = integralTaskService.getByCidAndUniqueKey(taskClassVO.getId(), uniqueKeyTask);
|
| | | IntegralTask integralTask = integralTaskService.getByCidAndUniqueKey(taskClassVO.getId(),
|
| | | uniqueKeyTask);
|
| | | Integer goldCoin = 0;
|
| | | if (integralTask != null) {
|
| | | goldCoin = integralTask.getGoldCoin();
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param ids // 领取id
|
| | | * @param gids // 未领取id
|
| | | * @param ids
|
| | | * // 领取id
|
| | | * @param gids
|
| | | * // 未领取id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "receiveGoldCoin", method = RequestMethod.POST)
|
| | | public void receiveGoldCoin(AcceptData acceptData, Long uid, Integer type, String ids, String gids, PrintWriter out) {
|
| | | public void receiveGoldCoin(AcceptData acceptData, Long uid, Integer type, String ids, String gids,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | | Integer goldCoin = integralTaskRecordService.receiveGoldCoin(uid, idList);
|
| | | Set<Long> gidList = gson.fromJson(gids, new TypeToken<HashSet<Long>>() {}.getType());
|
| | | Set<Long> gidList = gson.fromJson(gids, new TypeToken<HashSet<Long>>() {
|
| | | }.getType());
|
| | | List<IntegralTaskRecord> list = null;
|
| | | if (gidList != null && gidList.size() > 0) {
|
| | | list = integralTaskRecordService.listNotReceivedExcludeId(5 - gidList.size(), uid, gidList);
|
| | |
| | | out.print(JsonUtil.loadFalseResult("事件为空"));
|
| | | return;
|
| | | }
|
| | | IntegralTaskRecord record = null;
|
| | | try {
|
| | | record = integralGetService.addEventStatistic(uid, event, null);
|
| | | } catch (IntegralGetException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (record == null) {
|
| | | out.print(JsonUtil.loadFalseResult("添加失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if ("recommendSearch".equalsIgnoreCase(event) || "scanGoods".equalsIgnoreCase(event)
|
| | | || "scanTBCart".equalsIgnoreCase(event)) {
|
| | | JSONObject notify = new JSONObject();
|
| | | switch (event) {
|
| | | |
| | | case "recommendSearch":
|
| | | notify.put("name", "完成一次智能搜索");
|
| | | notify.put("score", "+20金币");
|
| | | break;
|
| | | case "scanGoods":
|
| | | notify.put("name", "完成一次商品浏览");
|
| | | notify.put("score", "+100金币");
|
| | | break;
|
| | | case "scanTBCart":
|
| | | notify.put("name", "完成一次购物车浏览");
|
| | | notify.put("score", "+300金币");
|
| | | break;
|
| | | }
|
| | |
|
| | | notify.put("score", String.format("+%s金币", record.getGoldCoin()));
|
| | | data.put("notify", notify);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | return gson;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 明细详情
|
| | | *
|
| | |
| | | * 年份
|
| | | * @param month
|
| | | * 月份
|
| | | * @param type 统计类型 0全部 1
|
| | | * @param type
|
| | | * 统计类型 0全部 1
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getDetails")
|