|
@@ -1,8 +1,6 @@
|
|
|
package com.zhongzheng.controller.cmmon;
|
|
package com.zhongzheng.controller.cmmon;
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.lang.Validator;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
|
|
import com.zhongzheng.common.core.controller.BaseController;
|
|
import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
@@ -296,22 +294,14 @@ public class CommonController extends BaseController {
|
|
|
@ApiOperation("领取题库活动记录")
|
|
@ApiOperation("领取题库活动记录")
|
|
|
@GetMapping("/save/activity/record/{crowdType}")
|
|
@GetMapping("/save/activity/record/{crowdType}")
|
|
|
public AjaxResult<Void> saveActivityRecord(@PathVariable("crowdType") Integer crowdType) {
|
|
public AjaxResult<Void> saveActivityRecord(@PathVariable("crowdType") Integer crowdType) {
|
|
|
- DataWxTpClick click = iDataWxTpClickService.getOne(new LambdaQueryWrapper<DataWxTpClick>().eq(DataWxTpClick::getCrowdType, crowdType).last("limit 1"));
|
|
|
|
|
- if (ObjectUtils.isNull(click)){
|
|
|
|
|
- DataWxTpClick dataWxTpClick = new DataWxTpClick();
|
|
|
|
|
- dataWxTpClick.setCrowdType(crowdType);
|
|
|
|
|
- dataWxTpClick.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
- dataWxTpClick.setType(2);
|
|
|
|
|
- dataWxTpClick.setStatus(1);
|
|
|
|
|
- dataWxTpClick.setInformId(0L);
|
|
|
|
|
- dataWxTpClick.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
- dataWxTpClick.setCrowdCount(1L);
|
|
|
|
|
- iDataWxTpClickService.save(dataWxTpClick);
|
|
|
|
|
- }else {
|
|
|
|
|
- click.setCrowdCount(click.getCrowdCount() + 1L);
|
|
|
|
|
- iDataWxTpClickService.updateById(click);
|
|
|
|
|
- }
|
|
|
|
|
- return toAjax(1);
|
|
|
|
|
|
|
+ DataWxTpClick dataWxTpClick = new DataWxTpClick();
|
|
|
|
|
+ dataWxTpClick.setCrowdType(crowdType);
|
|
|
|
|
+ dataWxTpClick.setCreateTime(DateUtils.getNowTime());
|
|
|
|
|
+ dataWxTpClick.setType(2);
|
|
|
|
|
+ dataWxTpClick.setStatus(1);
|
|
|
|
|
+ dataWxTpClick.setInformId(0L);
|
|
|
|
|
+ dataWxTpClick.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ return toAjax(iDataWxTpClickService.save(dataWxTpClick)? 1 : 0);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|