| @@ -55,8 +55,8 @@ public class WxActivityJoinController extends BaseController { | |||||
| @ApiOperation("签到") | @ApiOperation("签到") | ||||
| @PostMapping("sign") | @PostMapping("sign") | ||||
| public ResultData sign(@RequestBody WxActivityJoin wxActivityJoin) { | public ResultData sign(@RequestBody WxActivityJoin wxActivityJoin) { | ||||
| if (wxActivityJoin.getId() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "Id不能为空"); | |||||
| if (wxActivityJoin.getActivityId() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "activityId不能为空"); | |||||
| } | } | ||||
| wxActivityJoin.setTenantId(getTenantId()); | wxActivityJoin.setTenantId(getTenantId()); | ||||
| wxActivityJoin.setUserId(getUserId()); | wxActivityJoin.setUserId(getUserId()); | ||||
| @@ -94,27 +94,36 @@ public class WxActivity extends BaseEntity { | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value = "小程序路径", name = "weappPath") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "报名小程序路径", name = "weappPath") | |||||
| protected String weappPath; | protected String weappPath; | ||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value = "报名二维码", name = "weappSceneForJoin") | @io.swagger.annotations.ApiModelProperty(value = "报名二维码", name = "weappSceneForJoin") | ||||
| protected String weappSceneForJoin; | protected String weappSceneForJoin; | ||||
| public String getWeappSceneForSign() { | |||||
| public String getWeappPath() { | |||||
| return "pages/index/index?type=ra&id=" + id; | |||||
| } | |||||
| public String getWeappSceneForJoin() { | |||||
| return "t:ra:" + id; | return "t:ra:" + id; | ||||
| } | } | ||||
| @Transient | |||||
| @io.swagger.annotations.ApiModelProperty(value = "签到小程序路径", name = "weappPath") | |||||
| protected String weappPathForSign; | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value = "签到二维码", name = "weappSceneForSign") | @io.swagger.annotations.ApiModelProperty(value = "签到二维码", name = "weappSceneForSign") | ||||
| protected String weappSceneForSign; | protected String weappSceneForSign; | ||||
| public String getWeappPath() { | |||||
| return "pages/index/index?type=ra&id=" + id; | |||||
| public String getWeappPathForSign() { | |||||
| return "pages/index/index?type=si&id=" + id; | |||||
| } | } | ||||
| public String getWeappSceneForJoin() { | |||||
| return "t:ra:" + id; | |||||
| public String getWeappSceneForSign() { | |||||
| return "t:si:" + id; | |||||
| } | } | ||||
| @@ -164,13 +164,15 @@ public class WxActivityJoinServiceImpl implements WxActivityJoinService { | |||||
| @Override | @Override | ||||
| public ResultData sign(WxActivityJoin wxActivityJoin) { | public ResultData sign(WxActivityJoin wxActivityJoin) { | ||||
| WxActivityJoin activityJoin = wxActivityJoinMapper.selectByPrimaryKey(wxActivityJoin.getId()); | |||||
| if (activityJoin.getStatus().equals(EnumActivityJoinStatus.CONFIRMED.getCode())) { | |||||
| activityJoin.setSignIn(EnumActivityJoinSignStatus.YES.getCode()); | |||||
| wxActivityJoinMapper.updateByPrimaryKeySelective(activityJoin); | |||||
| return new ResultData(Result.SUCCESS); | |||||
| //是否报名记录 | |||||
| wxActivityJoin.setStatus(EnumActivityJoinStatus.CONFIRMED.getCode()); | |||||
| WxActivityJoin activityJoin = wxActivityJoinMapper.selectOne(wxActivityJoin); | |||||
| if (activityJoin == null) { | |||||
| return new ResultData(ErrorCode.ACTIVITY_JOIN_NOT_FOUND); | |||||
| } | } | ||||
| return new ResultData(ErrorCode.ACTIVITY_JOIN_NOT_FOUND); | |||||
| activityJoin.setSignIn(EnumActivityJoinSignStatus.YES.getCode()); | |||||
| wxActivityJoinMapper.updateByPrimaryKeySelective(activityJoin); | |||||
| return new ResultData(Result.SUCCESS); | |||||
| } | } | ||||
| private void sendMessage(WxActivityJoin join, WxActivity activity) { | private void sendMessage(WxActivityJoin join, WxActivity activity) { | ||||