diff --git a/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusActivityRegisterApiController.java b/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusActivityRegisterApiController.java index d19e6c1..7bc59a1 100644 --- a/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusActivityRegisterApiController.java +++ b/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusActivityRegisterApiController.java @@ -3,6 +3,8 @@ package com.mls.web.controller.bmb.activity.api; import com.alibaba.fastjson.JSONArray; import com.mls.bmb.activity.service.IBusActivityRegisterService; import com.mls.bmb.activity.vomain.*; +import com.mls.bmb.user.domain.BusUserInfo; +import com.mls.bmb.user.service.IBusUserInfoService; import com.mls.common.annotation.Log; import com.mls.common.core.controller.BaseMobileController; import com.mls.common.core.domain.MobileResult; @@ -33,6 +35,9 @@ public class BusActivityRegisterApiController extends BaseMobileController { private static final Logger logger = LoggerFactory.getLogger(BusActivityRegisterApiController.class); + @Autowired + private IBusUserInfoService busUserInfoService; + @Autowired private IBusActivityRegisterService busActivityRegisterService; @@ -94,6 +99,15 @@ public class BusActivityRegisterApiController extends BaseMobileController { return MobileResult.success(data); } + @ApiOperation("查看活动报名所有用户信息") + @ApiImplicitParam(name = "activityId", value = "活动ID", readOnly = true) + @PostMapping("/getRegisterAll") + public MobileResult> getRegisterList(String activityId) + { + List data = busActivityRegisterService.selectBusActivityRegisterByActivityId(activityId, null, null); + return MobileResult.success(data); + } + @ApiOperation("查找需要审核的报名信息【查找需要审核的报名信息用】") @ApiImplicitParam(name = "clubId", value = "俱乐部id", required = true) @PostMapping("/getUnchecked") diff --git a/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusClubActivityApiController.java b/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusClubActivityApiController.java index 090e751..9a9c705 100644 --- a/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusClubActivityApiController.java +++ b/mls-admin/src/main/java/com/mls/web/controller/bmb/activity/api/BusClubActivityApiController.java @@ -47,10 +47,20 @@ public class BusClubActivityApiController extends BaseMobileController { public MobileResult detail(String activityId) { System.out.println("11-------------我是活动详情 -------"); - ActivityDetailVO data = busClubActivityService.selectBusClubActivityByActivityId(activityId); + ActivityDetailVO data = busClubActivityService.selectBusClubActivityByActivityId(activityId, getUserId()); return MobileResult.success(data); } + /** + * 活动发布判断(会长,副会长,管理员可发布活动且俱乐部审核通过) + */ + @ApiOperation("活动发布判断(会长,副会长,管理员可发布活动且俱乐部审核通过)") + @PostMapping("/checkUserClubActivity") + public MobileResult checkUserClubActivity() + { + return MobileResult.success(busClubActivityService.checkUserClubActivity(getUserId())); + } + /** * 根据id查询俱乐部活动 */ diff --git a/mls-admin/src/main/java/com/mls/web/controller/bmb/club/api/BusClubInfoApiController.java b/mls-admin/src/main/java/com/mls/web/controller/bmb/club/api/BusClubInfoApiController.java index b3d72e8..6e3bac2 100644 --- a/mls-admin/src/main/java/com/mls/web/controller/bmb/club/api/BusClubInfoApiController.java +++ b/mls-admin/src/main/java/com/mls/web/controller/bmb/club/api/BusClubInfoApiController.java @@ -210,6 +210,13 @@ public class BusClubInfoApiController extends BaseMobileController { return toAjax(busClubInfoService.insertBusClubInfo(req, getUserId())); } + @ApiOperation("新增俱乐部时的判断") + @PostMapping("/checkUserClubRole") + public MobileResult checkUserClubRole() + { + return success(busClubInfoService.checkUserClubRole(getUserId())); + } + /** * 修改保存俱乐部信息 * 【修改俱乐部名称 俱乐部简介】等 diff --git a/mls-admin/src/main/resources/application-dev.yml b/mls-admin/src/main/resources/application-dev.yml index 7dd5449..00dfe6e 100644 --- a/mls-admin/src/main/resources/application-dev.yml +++ b/mls-admin/src/main/resources/application-dev.yml @@ -2,10 +2,11 @@ spring: # redis 缓存配置 redis: - database: 0 # Redis服务器数据库 - host: 127.0.0.1 # Redis服务器地址 - port: 6379 # Redis服务器连接端口 - password: # Redis服务器连接密码(默认为空) + database: 0 # Redis服务器数据库 + host: 127.0.0.1 # Redis服务器地址 + port: 6379 # Redis服务器连接端口 + password: +# password: Bml123 # Redis服务器连接密码(默认为空) # password: Admin@1234 # Redis服务器连接密码(默认为空) timeout: 6000ms # 连接超时时间(毫秒) jedis: @@ -18,20 +19,20 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.cj.jdbc.Driver -# driverClassName: com.mysql.jdbc.Driver + # driverClassName: com.mysql.jdbc.Driver druid: # 主库数据源 master: - url: jdbc:mysql://182.92.73.21:3380/xhm_tb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 - username: root - password: guolong09aa@1345225844@.@. + url: jdbc:mysql://47.108.88.80:3306/bml?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 + username: bml + password: 2Ax75WmhbJWx2AhH # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false url: username: - password: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -51,7 +52,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -59,8 +60,8 @@ spring: allow: url-pattern: /druid/* # 控制台管理用户名和密码 - login-username: - login-password: + login-username: + login-password: filter: stat: enabled: true @@ -74,14 +75,12 @@ spring: # rabbitMQ配置 rabbitmq: - host: 182.92.73.21 - port: 5972 - username: long - password: sichuanyipangkeji@666. + host: 127.0.0.1 + port: 5672 + username: admin + password: admin virtual-host: / -#登录地址 http://182.92.73.21:25672 -#用户名: long -#密码: sichuanyipangkeji@666. + # 阿里云短信 aliyun: @@ -110,22 +109,25 @@ pay: #微信支付 wxpay: mchid: 1574018111 #1603122848 - appid: wxe20096a48806d438 #wxfb70aad151695421 + # appid: xhPSkLpbRbWinHoQvxhELvEReHCypX27 #wxfb70aad151695421 + appid: wxe20096a48806d438 # wx71bd24c04c26d8f7 # app客户端的微信APPID keypublic: - secretkey: 85079c24f7c10bf264376a83416bc37d #xhPSkLpbRbWinHoQvxhELvEReHCypXGS # 这是API密钥 - notifyurl: #http://cloud.dett.cn/pub/index/payWxBack + #secretkey: 85079c24f7c10bf264376a83416bc37d #xhPSkLpbRbWinHoQvxhELvEReHCypXGS # 这是API密钥 + secretkey: xhPSkLpbRbWinHoQvxhELvEReHCypX27 + notifyurl: http://admin.tuleduo.cn/open/wxpay/pay/payBack signtype: MD5 + # 压缩文件 -zip: - worktemp: /Users/pref/Documents/xmy/idea_works/temp/ # 文件压缩工作地址 +#zip: +# worktemp: /Users/pref/Documents/xmy/idea_works/temp/ # 文件压缩工作地址 minio: - url: http://47.108.105.48:9000 # 服务器地址 + url: http://47.108.88.80:9000 # 服务器地址 accessKey: minio #账号 secretKey: 123123123 #密码 - bucketName: images #存储桶 + bucketName: files #存储桶 prefix: bmb_minio #生成的新名称的前缀 diff --git a/mls-admin/src/main/resources/application.yml b/mls-admin/src/main/resources/application.yml index 7fb9846..961e3ae 100644 --- a/mls-admin/src/main/resources/application.yml +++ b/mls-admin/src/main/resources/application.yml @@ -58,7 +58,7 @@ spring: date-format: yyyy-MM-dd HH:mm:ss profiles: #系统环境 #dev - active: prod + active: dev # 文件上传 servlet: multipart: diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusActivityRegisterService.java b/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusActivityRegisterService.java index 9ae17d7..cd9a09b 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusActivityRegisterService.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusActivityRegisterService.java @@ -44,7 +44,7 @@ public interface IBusActivityRegisterService * @param activityId 活动id * @return 报名信息列表 */ - public List selectBusActivityRegisterByActivityId(String activityId); + public List selectBusActivityRegisterByActivityId(String activityId, Integer pageSize, Integer pageNum); /** * 根据用户id查报名信息 (查自己及帮报信息) diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusClubActivityService.java b/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusClubActivityService.java index 7e47051..63c1811 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusClubActivityService.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/service/IBusClubActivityService.java @@ -64,7 +64,7 @@ public interface IBusClubActivityService * @param activityId 活动ID * @return 俱乐部活动详情 */ - public ActivityDetailVO selectBusClubActivityByActivityId(String activityId); + public ActivityDetailVO selectBusClubActivityByActivityId(String activityId, String userId); /** *【根据id查询俱乐部活动】 @@ -73,6 +73,8 @@ public interface IBusClubActivityService */ public ActivityVO selectBusClubActivityById(String activityId); + public String checkUserClubActivity(String userId); + /** * 查询俱乐部活动 * diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusActivityRegisterServiceImpl.java b/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusActivityRegisterServiceImpl.java index 3ca6a6a..ff3dfb1 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusActivityRegisterServiceImpl.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusActivityRegisterServiceImpl.java @@ -1,5 +1,6 @@ package com.mls.bmb.activity.service.impl; +import com.github.pagehelper.PageHelper; import com.mls.bmb.activity.domain.BusActivityRegister; import com.mls.bmb.activity.domain.BusAnswerSelect; import com.mls.bmb.activity.domain.BusRegisterAnswer; @@ -12,6 +13,8 @@ import com.mls.bmb.activity.service.IBusActivityRegisterService; import com.mls.bmb.activity.vomain.*; import com.mls.bmb.order.service.IBusOrderDetailService; import com.mls.bmb.order.service.IBusOrderInfoService; +import com.mls.bmb.user.domain.BusUserInfo; +import com.mls.bmb.user.service.IBusUserInfoService; import com.mls.common.exception.BusinessException; import com.mls.common.utils.CollectionCopyUtils; import com.mls.common.utils.DateUtils; @@ -52,6 +55,9 @@ public class BusActivityRegisterServiceImpl implements IBusActivityRegisterServi @Autowired private IBusOrderDetailService busOrderDetailService; + @Autowired + private IBusUserInfoService busUserInfoService; + /** * 查询活动报名详情 * @param registerIndex 主键 @@ -123,11 +129,21 @@ public class BusActivityRegisterServiceImpl implements IBusActivityRegisterServi * @return 报名信息列表 */ @Override - public List selectBusActivityRegisterByActivityId(String activityId) { + public List selectBusActivityRegisterByActivityId(String activityId, Integer pageSize, Integer pageNum) { + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + // String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + // PageHelper.startPage(pageNum, pageSize, true); + PageHelper.startPage(pageNum, pageSize, " CREATED_TIME DESC"); + } // todoo暂未调用 关联信息 List data = busActivityRegisterMapper.selectBusActivityRegisterByActivityId(activityId); - - return CollectionCopyUtils.copyList(data, ActivityRegisterBaseVO.class); + List vos = CollectionCopyUtils.copyList(data, ActivityRegisterBaseVO.class); + vos.stream().forEach(item->{ + BusUserInfo userInfo = busUserInfoService.selectBusUserInfoById(item.getUserId()); + item.setUserPhoto(userInfo.getUserPhoto()); + }); + return vos; } /** @@ -308,6 +324,7 @@ public class BusActivityRegisterServiceImpl implements IBusActivityRegisterServi register.setCreatedTime(nowTime); register.setRecordStatus("1"); register.setRealCost(register.getCost()); + register.setRegisterTime(nowTime); logger.info(register.toString()); busActivityRegisterList.add(register); if(StringUtils.isNotNull(addVO.getAnswerList())){ diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusClubActivityServiceImpl.java b/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusClubActivityServiceImpl.java index cb48ec5..6e379a8 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusClubActivityServiceImpl.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/service/impl/BusClubActivityServiceImpl.java @@ -3,14 +3,18 @@ package com.mls.bmb.activity.service.impl; import com.mls.bmb.activity.domain.BusClubActivity; import com.mls.bmb.activity.mapper.BusClubActivityMapper; import com.mls.bmb.activity.service.IBusActivityCostService; +import com.mls.bmb.activity.service.IBusActivityRegisterService; import com.mls.bmb.activity.service.IBusClubActivityService; import com.mls.bmb.activity.service.IBusRegisterQuestionService; import com.mls.bmb.activity.vomain.*; import com.mls.bmb.club.domain.BusClubInfo; +import com.mls.bmb.club.domain.BusClubMember; import com.mls.bmb.club.mapper.BusClubInfoMapper; import com.mls.bmb.club.mapper.BusClubMemberMapper; import com.mls.bmb.club.service.IBusClubWalletService; +import com.mls.bmb.user.service.IBusUserInfoService; import com.mls.common.utils.CollectionCopyUtils; +import com.mls.common.utils.StringUtils; import com.mls.common.utils.bean.BeanUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; /** * 俱乐部活动Service业务层处理 @@ -49,6 +54,12 @@ public class BusClubActivityServiceImpl implements IBusClubActivityService @Autowired private IBusClubWalletService busClubWalletService; + @Autowired + private IBusActivityRegisterService busActivityRegisterService; + + @Autowired + private IBusUserInfoService busUserInfoService; + /** * 【精品活动推荐用】 @@ -130,12 +141,23 @@ public class BusClubActivityServiceImpl implements IBusClubActivityService * @return 俱乐部活动详情 */ @Override - public ActivityDetailVO selectBusClubActivityByActivityId(String activityId) { + public ActivityDetailVO selectBusClubActivityByActivityId(String activityId, String userId) { // 要关联查询俱乐部信息 --> 不关联了 单独去查询俱乐部消息 // 要关联查询费用信息(单价范围) // 要关联查询报名人数 BusClubActivity activity = busClubActivityMapper.selectBusClubActivityByActivityId(activityId); ActivityDetailVO result = new ActivityDetailVO(); + + // 查询当前登录用户是否已加入 + List countList = busActivityRegisterService.selectBusActivityRegisterByUserId(activityId, userId); + result.setIsJoin(countList.size() == 0? 0 : 1); + + // 查询活动报名信息 5个 + List registerBaseVOS = busActivityRegisterService.selectBusActivityRegisterByActivityId(activityId, 5, 1); + result.setRegisterList(registerBaseVOS); + + // 查询报名数量 + BeanUtils.copyProperties(activity, result); return result; } @@ -154,6 +176,30 @@ public class BusClubActivityServiceImpl implements IBusClubActivityService return result; } + @Override + public String checkUserClubActivity(String userId) { + List busClubMembers = busClubMemberMapper.selectBusClubMemberByUserId(userId); + AtomicReference clubId = new AtomicReference<>(""); + AtomicReference returnStr = new AtomicReference<>("OK"); + busClubMembers.stream().forEach(item ->{ + if("1".equals(item.getMemberType()) + || "2".equals(item.getMemberType()) + || "3".equals(item.getMemberType())){ + clubId.set(item.getClubId()); + } + }); + if("OK".equals(returnStr.get()) && StringUtils.isNotEmpty(clubId.get())){ + // 判断俱乐部是否审核通过 + BusClubInfo clubInfo = busClubInfoMapper.selectBusClubInfoById(clubId.get()); + if("0".equals(clubInfo.getIsVerify())){ + returnStr.set("俱乐部未审核通过,不能发布活动"); + } + }else{ + returnStr.set("不是会长,副会长,管理员不能发布活动"); + } + return returnStr.get(); + } + /** * 查询俱乐部活动 * diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityDetailVO.java b/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityDetailVO.java index a8f1208..6f3adc8 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityDetailVO.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityDetailVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.Date; +import java.util.List; /** * 使用模块: @@ -101,6 +102,28 @@ public class ActivityDetailVO extends BaseVO { @ApiModelProperty(value = "活动限制人数 -1表示不限") private Integer isLimit; + @ApiModelProperty(value = "是否已加入活动 0未加入 1已加入") + private Integer isJoin; + + @ApiModelProperty(value = "报名用户信息列表") + private List registerList; + + public List getRegisterList() { + return registerList; + } + + public void setRegisterList(List registerList) { + this.registerList = registerList; + } + + public Integer getIsJoin() { + return isJoin; + } + + public void setIsJoin(Integer isJoin) { + this.isJoin = isJoin; + } + public String getClubId() { return clubId; } diff --git a/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityRegisterBaseVO.java b/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityRegisterBaseVO.java index 849f589..c00a82b 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityRegisterBaseVO.java +++ b/mls-bmb/src/main/java/com/mls/bmb/activity/vomain/ActivityRegisterBaseVO.java @@ -47,6 +47,9 @@ public class ActivityRegisterBaseVO extends BaseVO { @ApiModelProperty(value = "真实姓名") private String realname; + @ApiModelProperty(value = "用户头像") + private String userPhoto; + /** 手机 */ @ApiModelProperty(value = "手机") private String phone; @@ -91,6 +94,14 @@ public class ActivityRegisterBaseVO extends BaseVO { @ApiModelProperty(value = "报名状态 0-未报名 1-已报名 2-已取消 3-报名中") private String registerStatus; + public String getUserPhoto() { + return userPhoto; + } + + public void setUserPhoto(String userPhoto) { + this.userPhoto = userPhoto; + } + public String getRegisterId() { return registerId; } diff --git a/mls-bmb/src/main/java/com/mls/bmb/club/mapper/BusClubMemberMapper.java b/mls-bmb/src/main/java/com/mls/bmb/club/mapper/BusClubMemberMapper.java index a312a54..6afca16 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/club/mapper/BusClubMemberMapper.java +++ b/mls-bmb/src/main/java/com/mls/bmb/club/mapper/BusClubMemberMapper.java @@ -185,6 +185,13 @@ public interface BusClubMemberMapper */ public int deleteBusClubMemberById(String memberId); + /** + * 查询用户所有的成员信息 + * @param userId + * @return + */ + public List selectBusClubMemberByUserId(String userId); + /** * 批量删除俱乐部成员 * diff --git a/mls-bmb/src/main/java/com/mls/bmb/club/service/IBusClubInfoService.java b/mls-bmb/src/main/java/com/mls/bmb/club/service/IBusClubInfoService.java index 9fcb602..d035596 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/club/service/IBusClubInfoService.java +++ b/mls-bmb/src/main/java/com/mls/bmb/club/service/IBusClubInfoService.java @@ -112,6 +112,13 @@ public interface IBusClubInfoService */ public int insertBusClubInfo(ClubAddVO addVO, String userId); + /** + * 判断用户是否可以创建俱乐部(已是会长,副会长,管理员不能创建多个俱乐部) + * @param userId + * @return + */ + public String checkUserClubRole(String userId); + /** * 修改俱乐部信息 * diff --git a/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubInfoServiceImpl.java b/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubInfoServiceImpl.java index ce7d78a..466a81c 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubInfoServiceImpl.java +++ b/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubInfoServiceImpl.java @@ -2,21 +2,20 @@ package com.mls.bmb.club.service.impl; import com.mls.bmb.activity.service.IBusClassIconService; import com.mls.bmb.activity.vomain.ClubIconVO; +import com.mls.bmb.club.domain.BusClubAlbum; import com.mls.bmb.club.domain.BusClubInfo; import com.mls.bmb.club.domain.BusClubMember; import com.mls.bmb.club.domain.BusClubTag; import com.mls.bmb.club.mapper.BusClubInfoMapper; import com.mls.bmb.club.mapper.BusClubMemberMapper; import com.mls.bmb.club.mapper.BusClubTagMapper; -import com.mls.bmb.club.service.IBusClubInfoService; -import com.mls.bmb.club.service.IBusClubMemberService; -import com.mls.bmb.club.service.IBusClubTagService; -import com.mls.bmb.club.service.IBusClubWalletService; +import com.mls.bmb.club.service.*; import com.mls.bmb.club.vomain.*; import com.mls.bmb.massage.service.IBusMassageClubService; import com.mls.bmb.massage.service.IBusMassageSystemService; import com.mls.common.core.domain.MobileResult; import com.mls.common.core.text.Convert; +import com.mls.common.exception.BusinessException; import com.mls.common.utils.CollectionCopyUtils; import com.mls.common.utils.StringUtils; import com.mls.system.service.ISysDictDataService; @@ -28,6 +27,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; /** * 俱乐部信息Service业务层处理 @@ -61,6 +61,12 @@ public class BusClubInfoServiceImpl implements IBusClubInfoService @Autowired private IBusClubWalletService busClubWalletService; + @Autowired + private IBusClubPhotoService busClubPhotoService; + + @Autowired + private IBusClubAlbumService busClubAlbumService; + /** * 查询俱乐部信息 * @@ -378,6 +384,7 @@ public class BusClubInfoServiceImpl implements IBusClubInfoService busClubInfo.setClubAdmin(userId); busClubInfo.setCreatedBy(userId); busClubInfo.setCreatedTime(new Date()); + busClubInfo.setIsVerify("0"); busClubInfo.setRecordStatus("1"); // 默认会长收款 busClubInfo.setPayType("1"); @@ -385,6 +392,22 @@ public class BusClubInfoServiceImpl implements IBusClubInfoService busClubInfo.setPayUserId(userId); busClubInfoMapper.insertBusClubInfo(busClubInfo); + // [3.1] 创建俱乐部相册 + BusClubAlbum busClubAlbum = new BusClubAlbum(); + busClubAlbum.setClubId(busClubInfo.getClubId()); + busClubAlbum.setAlbumId(UUID.randomUUID().toString().replace("-","")); + busClubAlbum.setUserId(userId); + busClubAlbum.setAlbumLogo(busClubInfo.getClubLogo()); + busClubAlbum.setAlbumName("默认相册"); + busClubAlbum.setRecordStatus("1"); + busClubInfo.setCreatedBy(userId); + busClubInfo.setCreatedTime(new Date()); + busClubAlbumService.insertBusClubAlbum(busClubAlbum); + PhotoAddVO photoAddVO = new PhotoAddVO(); + photoAddVO.setPhotos(Arrays.asList(busClubInfo.getClubLogo())); + photoAddVO.setAlbumId(busClubAlbum.getAlbumId()); + busClubPhotoService.insertBusClubPhoto(photoAddVO, userId); + // [4] 创建俱乐部会长钱包 busClubWalletService.insertBusClubBlankWallet(clubId, userId); @@ -394,6 +417,32 @@ public class BusClubInfoServiceImpl implements IBusClubInfoService return busMassageSystemService.insertBusMassageSystem(userId, "俱乐部申请审核中", ""); } + @Override + public String checkUserClubRole(String userId) { + List busClubMembers = busClubMemberMapper.selectBusClubMemberByUserId(userId); + AtomicReference returnStr = new AtomicReference<>("OK"); + busClubMembers.stream().forEach(item ->{ + if("1".equals(item.getMemberType()) + || "2".equals(item.getMemberType()) + || "3".equals(item.getMemberType())){ + switch (Integer.valueOf(item.getMemberType())){ + case 1: + returnStr.set("已经是某俱乐部的会长,不能创建俱乐部"); + break; + case 2: + returnStr.set("已经是某俱乐部的副会长,不能创建俱乐部"); + break; + case 3: + returnStr.set("已经是某俱乐部的管理员,不能创建俱乐部"); + break; + default: + returnStr.set("未知错误"); + } + } + }); + return returnStr.get(); + } + /** * 修改俱乐部信息 *
【修改俱乐部用】 diff --git a/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubMemberServiceImpl.java b/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubMemberServiceImpl.java index 34c7a6a..5ca2ecc 100644 --- a/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubMemberServiceImpl.java +++ b/mls-bmb/src/main/java/com/mls/bmb/club/service/impl/BusClubMemberServiceImpl.java @@ -627,6 +627,9 @@ public class BusClubMemberServiceImpl implements IBusClubMemberService } //查询俱乐部成员信息 BusClubMember busClubMember = this.selectBusClubMemberByClubAndUserId(clubId, userId); + if("1".equals(busClubMember.getMemberType())){ + throw new RuntimeException("会长不能退出出俱乐部,"); + } //退出俱乐部 return this.updateBusClubMemberByIds(busClubMember.getMemberId(),userId); diff --git a/mls-bmb/src/main/resources/mapper/activity/BusClubActivityMapper.xml b/mls-bmb/src/main/resources/mapper/activity/BusClubActivityMapper.xml index e946f44..1413b04 100644 --- a/mls-bmb/src/main/resources/mapper/activity/BusClubActivityMapper.xml +++ b/mls-bmb/src/main/resources/mapper/activity/BusClubActivityMapper.xml @@ -152,7 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + +