报名增加联系方式
This commit is contained in:
@@ -833,6 +833,7 @@ public class ActivityApplyController {
|
||||
asa.username,
|
||||
asa.loginname,
|
||||
asa.sex,
|
||||
asa.mobile,
|
||||
asa.identity,
|
||||
asa.`status`,
|
||||
asa.applyUserSign,
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.v.nutz.zhgh.activity.models;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -17,6 +18,14 @@ public class ActivityMobileSignUpParam {
|
||||
|
||||
private List<String> userIds;
|
||||
|
||||
private List<teamUserInfo> teamUserInfos;
|
||||
|
||||
private String applyUserSign;
|
||||
|
||||
|
||||
@Data
|
||||
public static class teamUserInfo implements Serializable {
|
||||
private String userId;
|
||||
private String mobile;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -66,6 +66,7 @@ public class mobileActivityListController {
|
||||
@Param(value = "eventId", required = false) String eventId,
|
||||
@Param(value = "applyUserSign", required = false) String applyUserSign,
|
||||
@Param(value = "teamId", required = false) String teamId,
|
||||
@Param(value = "mobile", required = false) String mobile,
|
||||
@Param(value = "teamName", required = false) String teamName) {
|
||||
|
||||
User user = baseService.dao().fetch(User.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
|
||||
@@ -84,7 +85,7 @@ public class mobileActivityListController {
|
||||
schoolApply.setTeam(teamName);
|
||||
schoolApply.setApplyUser(user.getId());
|
||||
schoolApply.setUserId(user.getId());
|
||||
schoolApply.setMobile(user.getMobile());
|
||||
schoolApply.setMobile(mobile);
|
||||
schoolApply.setSex(user.getSex());
|
||||
schoolApply.setUnitId(user.getUnitid());
|
||||
schoolApply.setUnionId(user.getUnionid());
|
||||
@@ -268,7 +269,7 @@ public class mobileActivityListController {
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object doTeamSignUp(ActivityMobileSignUpParam param) {
|
||||
mobileActivityApplyService.doTeamSignUp(param.getActivityId(), param.getUserIds(), param.getEventId(), param.getTeamId(), param.getTeamName(),param.getApplyUserSign());
|
||||
mobileActivityApplyService.doTeamSignUp(param.getActivityId(), param.getUserIds(), param.getEventId(), param.getTeamId(), param.getTeamName(),param.getApplyUserSign(), param.getTeamUserInfos());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+14
-1
@@ -1,11 +1,24 @@
|
||||
package io.v.nutz.zhgh.mobile.activity.Sports.service;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityMobileSignUpParam;
|
||||
import io.v.nutz.zhgh.activity.models.ActivitySchoolApply;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MobileActivityApplyService extends BaseService<ActivitySchoolApply> {
|
||||
void doDeleteApply(String activityId, String eventId);
|
||||
void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName,String applyUserSign);
|
||||
|
||||
/**
|
||||
* 组队报名
|
||||
* @param activityId
|
||||
* @param userIds
|
||||
* @param eventId
|
||||
* @param teamId
|
||||
* @param teamName
|
||||
* @param applyUserSign
|
||||
* @param teamUserInfos
|
||||
*/
|
||||
void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName,
|
||||
String applyUserSign, List<ActivityMobileSignUpParam.teamUserInfo> teamUserInfos);
|
||||
}
|
||||
|
||||
+13
-10
@@ -7,19 +7,14 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.*;
|
||||
import io.v.nutz.zhgh.mobile.activity.Sports.service.MobileActivityApplyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.web.filter.mgt.DefaultFilter;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.shiro.web.filter.mgt.DefaultFilter.user;
|
||||
|
||||
/**
|
||||
* @ClassName ActivitySchoolApplyServiceImpl
|
||||
* @Description TODO
|
||||
@@ -39,16 +34,24 @@ public class MobileActivityApplyServiceImpl extends BaseServiceImpl<ActivityScho
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName, String applyUserSign) {
|
||||
public void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId,
|
||||
String teamName, String applyUserSign, List<ActivityMobileSignUpParam.teamUserInfo> teamUserInfos) {
|
||||
List<ActivitySchoolApply> schoolApplyArrayList = new ArrayList<>();
|
||||
userIds.forEach(i -> {
|
||||
ActivitySchoolApply schoolApply = getApply(activityId, eventId, i, teamId, teamName, applyUserSign);
|
||||
|
||||
// userIds.forEach(i -> {
|
||||
// ActivitySchoolApply schoolApply = getApply(activityId, eventId, i, teamId, teamName, applyUserSign);
|
||||
// schoolApplyArrayList.add(schoolApply);
|
||||
// });
|
||||
|
||||
teamUserInfos.forEach( v -> {
|
||||
ActivitySchoolApply schoolApply = getApply(activityId, eventId, v.getUserId(), teamId, teamName, applyUserSign, v.getMobile());
|
||||
schoolApplyArrayList.add(schoolApply);
|
||||
});
|
||||
|
||||
insert(schoolApplyArrayList);
|
||||
}
|
||||
|
||||
public ActivitySchoolApply getApply(String activityId, String eventId, String userId, String teamId, String teamName, String applyUserSign) {
|
||||
public ActivitySchoolApply getApply(String activityId, String eventId, String userId, String teamId, String teamName, String applyUserSign, String mobile) {
|
||||
ActivitySchool activitySchool = dao().fetch(ActivitySchool.class, activityId);
|
||||
User user = dao().fetch(User.class, Cnd.where("id", "=", userId));
|
||||
ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", user.getUnitid()));
|
||||
@@ -70,7 +73,7 @@ public class MobileActivityApplyServiceImpl extends BaseServiceImpl<ActivityScho
|
||||
schoolApply.setTeam(teamName);
|
||||
schoolApply.setApplyUser(ShiroUtil.getUserId());
|
||||
schoolApply.setUserId(userId);
|
||||
schoolApply.setMobile(user.getMobile());
|
||||
schoolApply.setMobile(mobile);
|
||||
schoolApply.setSex(user.getSex());
|
||||
schoolApply.setUnitId(user.getUnitid());
|
||||
schoolApply.setUnionId(user.getUnionid());
|
||||
|
||||
Reference in New Issue
Block a user