| | |
| | | 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.StringUtil;
|
| | | import com.yeshi.fanli.vo.integral.DailySignVO;
|
| | | import com.yeshi.fanli.vo.integral.IntegralTaskClassVO;
|
| | | import com.yeshi.fanli.vo.integral.SignDateVO;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public IntegralTaskClass selectByPrimaryKey(Long id) {
|
| | | return integralTaskClassMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<IntegralTaskClassVO> getIntegralTaskClassVO(Long uid, long start, int count) {
|
| | | // 用户签到
|
| | | Integer signState = 0;
|
| | | if (start == 0) {
|
| | | try { |
| | | signState = finishedDailySign(uid);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | List<IntegralTaskClassVO> listVo = integralTaskClassMapper.getIntegralTaskClassVO(start, count);
|
| | | if (listVo == null || listVo.size() == 0) {
|
| | | return listVo;
|
| | | }
|
| | |
|
| | | for (IntegralTaskClassVO taskClassVO : listVo) {
|
| | | String progress = taskClassVO.getProgress();
|
| | | if (StringUtil.isNullOrEmpty(progress))
|
| | | continue;
|
| | | |
| | | Integer taskNum = taskClassVO.getTaskNum();
|
| | | if (taskNum == null)
|
| | | continue;
|
| | |
|
| | | UniqueKeyEnum uniqueKey = taskClassVO.getUniqueKey();
|
| | | if (uniqueKey == UniqueKeyEnum.dailySign) {
|
| | | if (signState == 0) {
|
| | | taskClassVO.setLightUp(true); // 签到失败
|
| | | } else if (signState == 1) {
|
| | | taskClassVO.setLightUp(false);
|
| | | } else if (signState == 2) {
|
| | | taskClassVO.setLightUp(false);
|
| | | }
|
| | | } else {
|
| | | taskClassVO.setLightUp(true);
|
| | | }
|
| | | |
| | | Integer dateType = 1; // 查询当日
|
| | | if (uniqueKey == UniqueKeyEnum.orderReward)
|
| | | dateType = null; // 查询历史
|
| | |
|
| | | Long id = taskClassVO.getId();
|
| | | int countFinished = 0;
|
| | | Integer totalGoldCoin = integralTaskRecordService.getTotalGoldCoin(uid, id, dateType);
|
| | | if (totalGoldCoin != null && totalGoldCoin > 0) {
|
| | | taskClassVO.setFinishedCoin("+" + totalGoldCoin);
|
| | | if (uniqueKey != UniqueKeyEnum.dailySign)
|
| | | countFinished = integralTaskRecordService.countFinished(uid, id, dateType);
|
| | | }
|
| | | progress = progress.replace("{已完成}", countFinished + "").replace("{总任务}", taskNum + "");
|
| | | |
| | | if (signState == 0 && uniqueKey == UniqueKeyEnum.dailySign) {
|
| | | progress = "未签到";
|
| | | taskClassVO.setBtnName("签到");
|
| | | } |
| | | taskClassVO.setProgress(progress);
|
| | | }
|
| | | return listVo;
|
| | | return integralTaskClassMapper.getIntegralTaskClassVO(start, count);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | |
|
| | | for (int i = 1; i <= 7- listDays.size(); i ++) {
|
| | | String after = format.format(DateUtil.reduceDay(i, date));
|
| | | String after = format.format(DateUtil.plusDayDate(i, date));
|
| | | if (after.startsWith("0"))
|
| | | after = after.substring(1, after.length());
|
| | |
|