8 Commits

Author SHA1 Message Date
e7777e24d0 超管bannerbug 2025-10-16 16:08:48 +08:00
0c635ba89d 超管公会信息优化 2025-10-16 16:08:48 +08:00
f90fcf7550 超管第二banner 2025-10-16 16:08:47 +08:00
9a8c2a0928 超管用户管理 2025-10-16 16:08:47 +08:00
84e0053e04 超管座驾管理 2025-10-16 16:08:47 +08:00
c3d3f4df57 公聊房-改造sendSysMsgService里发送全服房间消息的公共方法 2025-10-16 16:08:47 +08:00
fdcc046547 公聊房-后台-myApi-创建公聊房 2025-10-16 16:08:47 +08:00
3ca97d9336 eparty-测试环境 2025-10-16 16:08:47 +08:00
24 changed files with 538 additions and 87 deletions

View File

@@ -0,0 +1,28 @@
package com.accompany.admin.model.guild;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 后台超管【赠送座驾】权限表实体类
*
* @author
* @since 2025-10-14
*/
@Data
public class GuildAdminCarRef implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id" , type = IdType.AUTO)
private Long id;
private Integer roleId;
private Integer carId;
private Date createTime;
}

View File

@@ -65,5 +65,8 @@ public class FamilyAdminVo {
private String inviteCheck;
@ExcelIgnore
private Boolean enableEditInvite;
@ApiModelProperty("操作人")
@ExcelProperty("操作人")
private String operator;
}

View File

@@ -0,0 +1,14 @@
package com.accompany.admin.mapper.guild;
import com.accompany.admin.model.guild.GuildAdminCarRef;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 后台超管【赠送座驾】权限表 Mapper 接口
*
* @author
* @since 2025-10-14
*/
public interface GuildAdminCarRefMapper extends BaseMapper<GuildAdminCarRef> {
}

View File

@@ -5,7 +5,6 @@ import com.accompany.admin.vo.UsersAdminVo;
import com.accompany.business.constant.SymbolConstants;
import com.accompany.business.event.UsersChangePartitionEvent;
import com.accompany.business.model.PrivatePhoto;
import com.accompany.business.model.UserInviteCode;
import com.accompany.business.model.UserPurse;
import com.accompany.business.mybatismapper.PrivatePhotoMapper;
import com.accompany.business.mybatismapper.UserInviteCodeMapper;
@@ -134,7 +133,7 @@ public class UserCheckAdminService {
return list;
}
private List<UsersAdminVo> getUserListByErbanNoList(List<String> erbanNoList){
public List<UsersAdminVo> getUserListByErbanNoList(List<String> erbanNoList){
List<Long> newList = new ArrayList<>(erbanNoList.size());
for(String myErbanNo: erbanNoList){
Long erbanNo = Long.valueOf(myErbanNo);

View File

@@ -11,7 +11,10 @@ import com.accompany.business.constant.family.FamilyConstant;
import com.accompany.business.event.FamilyMemberStatusChangeEvent;
import com.accompany.business.event.NewGuildEvent;
import com.accompany.business.message.NewGuildMessage;
import com.accompany.business.model.family.*;
import com.accompany.business.model.family.Family;
import com.accompany.business.model.family.FamilyMember;
import com.accompany.business.model.family.FamilyOperateRecord;
import com.accompany.business.model.family.FamilyPayAccount;
import com.accompany.business.mybatismapper.family.FamilyMemberDiamondSettlementRecordMapper;
import com.accompany.business.service.UploadAvatarService;
import com.accompany.business.service.family.*;
@@ -87,7 +90,7 @@ public class FamilyManageAdminService {
private FamilyMemberDiamondSettlementRecordMapper familyMemberDiamondSettlementRecordMapper;
@Transactional(rollbackFor = Exception.class)
public Family createFamily(Long erbanNo, String referrer, Long inviteErbanNo) {
public Family createFamily(Long erbanNo, String referrer, Long inviteErbanNo, Integer adminId) {
Users u = usersService.getUserByErbanNo(erbanNo);
if (null == u){
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
@@ -126,6 +129,7 @@ public class FamilyManageAdminService {
Date now = new Date();
Family family = new Family();
family.setAdminId(adminId);
family.setPartitionId(u.getPartitionId());
family.setOwnerUid(u.getUid());
family.setName(u.getNick() + I18NMessageSourceUtil.getMessage(FamilyConstant.DefaultInfo.DEFAULT_NAME_SUFFIX_I18N_ID,
@@ -300,6 +304,7 @@ public class FamilyManageAdminService {
.list().stream().collect(Collectors.toMap(FamilyPayAccount::getFamilyId, a->a));
Date now = new Date();
Map<Integer, String> adminUserMap = adminUserService.adminUserMap();
for (Family family: poList){
FamilyAdminVo vo = new FamilyAdminVo();
vo.setId(family.getId());
@@ -314,6 +319,9 @@ public class FamilyManageAdminService {
vo.setCreateTime(DateTimeUtil.convertDate(family.getCreateTime()));
vo.setEnable(family.getEnable());
vo.setIdCard(family.getIdCard());
if (family.getAdminId() != null) {
vo.setOperator(adminUserMap.get(family.getAdminId()));
}
vo.setInviteCheck(family.getInviteCheck());
if (family.getInviteUid() != null) {
Users users = usersMap.get(family.getInviteUid());

View File

@@ -0,0 +1,44 @@
package com.accompany.admin.service.guild;
import com.accompany.admin.mapper.guild.GuildAdminCarRefMapper;
import com.accompany.admin.model.guild.GuildAdminCarRef;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.vo.AdminUserVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 后台超管【赠送座驾】权限表 服务实现类
*
* @author
* @since 2025-10-14
*/
@Service
public class GuildAdminCarRefService extends ServiceImpl<GuildAdminCarRefMapper, GuildAdminCarRef> {
@Autowired
private AdminUserService adminUserService;
public List<Integer> carIds(Integer adminId) {
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
if (adminUserVo == null || CollectionUtils.isEmpty(adminUserVo.getRoleIds())) {
return new ArrayList<>();
}
LambdaQueryWrapper<GuildAdminCarRef> wrapper = Wrappers.lambdaQuery();
wrapper.in(GuildAdminCarRef::getRoleId, adminUserVo.getRoleIds());
List<GuildAdminCarRef> guildAdminHeadwearRefs = baseMapper.selectList(wrapper);
if (CollectionUtils.isEmpty(guildAdminHeadwearRefs)) {
return new ArrayList<>();
}
return guildAdminHeadwearRefs.stream().map(GuildAdminCarRef::getCarId).collect(Collectors.toList());
}
}

View File

@@ -1,5 +1,6 @@
package com.accompany.admin.service.guild;
import com.accompany.admin.base.Pagination;
import com.accompany.admin.dto.NameplateDto;
import com.accompany.admin.service.family.FamilyIncomeAdminService;
import com.accompany.admin.service.family.FamilyManageAdminService;
@@ -11,8 +12,11 @@ import com.accompany.admin.vo.AdminUserVo;
import com.accompany.admin.vo.family.FamilyAdminVo;
import com.accompany.admin.vo.guild.GuildApplyAuditVo;
import com.accompany.admin.vo.vip.VipSendRecordVo;
import com.accompany.business.model.CarGoods;
import com.accompany.business.model.family.Family;
import com.accompany.business.model.guild.GuildSuperAdminInfo;
import com.accompany.business.service.car.CarGoodsService;
import com.accompany.business.service.car.CarPayService;
import com.accompany.business.service.guild.GuildSuperAdminInfoService;
import com.accompany.business.service.headwear.HeadwearService;
import com.accompany.business.service.user.UsersService;
@@ -21,7 +25,7 @@ import com.accompany.business.vo.guild.GuildDiamondStatisticsDayVo;
import com.accompany.common.result.BusiResult;
import com.accompany.common.result.PageResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.enumeration.PartitionEnum;
import com.accompany.common.utils.BlankUtil;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -31,10 +35,10 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static java.util.Collections.EMPTY_LIST;
@@ -70,6 +74,12 @@ public class GuildSuperAdminService {
private GuildSuperAdminInfoService guildSuperAdminInfoService;
@Autowired
private GuildDiamondStatisticsDayAdminService guildDiamondStatisticsDayAdminService;
@Autowired
private GuildAdminCarRefService guildAdminCarRefService;
@Autowired
private CarGoodsService carGoodsService;
@Autowired
private CarPayService carPayService;
public void createFamily(Long erbanNo, Long inviteErbanNo, Integer adminId) {
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
@@ -95,11 +105,13 @@ public class GuildSuperAdminService {
}
}
Family family = familyManageAdminService.createFamily(erbanNo, adminUserVo.getUsername(), inviteErbanNo);
Family family = familyManageAdminService.createFamily(erbanNo, adminUserVo.getUsername(), inviteErbanNo, adminUserVo.getAdminId());
guildAdminRefService.bindAdminGuild(adminId, family.getId(), user.getPartitionId());
}
public Page<FamilyAdminVo> pageFamily(Integer partitionId, Integer familyId, Long erbanNo,long pageNum, long pageSize, Integer adminId) {
public Page<FamilyAdminVo> pageFamily(Integer familyId, Long erbanNo,long pageNum, long pageSize, Integer adminId) {
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
Integer partitionId = adminUserVo.getPartitionIds().get(0);
List<Integer> guildIdsByAdminId = guildAdminRefService.getGuildIdsByAdminId(adminId, partitionId);
if (CollectionUtils.isEmpty(guildIdsByAdminId)) {
return new Page<>(pageNum, pageSize);
@@ -117,12 +129,12 @@ public class GuildSuperAdminService {
if (null == u){
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
}
if (vipLevel > 3) {
if (vipLevel > 4) {
throw new AdminServiceException("vipLevel error");
}
boolean partitionCheck = adminUserVo.getPartitionIds().contains(u.getPartitionId());
if (!partitionCheck) {
throw new AdminServiceException("会长ID Part Error");
throw new AdminServiceException("ID Part Error");
}
vipSendAdminService.send(uid, vipLevel, adminId, days, Boolean.FALSE);
}
@@ -229,6 +241,90 @@ public class GuildSuperAdminService {
return retMap;
}
public Pagination<CarGoods> getCarGoodsList(Integer page, Integer pageSize, Integer adminId) {
List<Integer> carGoodsIds = guildAdminCarRefService.carIds(adminId);
if (CollectionUtils.isEmpty(carGoodsIds)) {
throw new AdminServiceException("CONFIG ERROR:");
}
Pagination<CarGoods> pagination = new Pagination<>();
pagination.setTotal(carGoodsService.countCarGoods((byte)2, null, null, null, null, carGoodsIds));
pagination.setRows(carGoodsService.getCarGoodsList(page, pageSize, (byte)2, null, null, null, null, null, carGoodsIds));
return pagination;
}
public Map carSend(String erbanNo, Integer carId, Integer days, String desc, Integer otherDay, Integer adminId) {
List<Integer> carGoodsIds = guildAdminCarRefService.carIds(adminId);
if (carGoodsIds == null || carGoodsIds.isEmpty() || !carGoodsIds.contains(carId)) {
throw new AdminServiceException("config ERROR:");
}
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
//赠送失败的平台号
List<String> failErban = new ArrayList<String>();
//赠送失败原因
List<String> failReason = new ArrayList<String>();
Map retMap = new HashMap();
//前台js换行符为'\n'
String[] erbanList = erbanNo.split("\n");
try {
if (erbanList == null || carId == null || days == null || BlankUtil.isBlank(desc)) {
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
}
if (days <= 0 || carId <= 0 || erbanList.length <= 0) {
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
}
if(otherDay != null && (otherDay <= 0 || otherDay >= 365)){
throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL);
}
if(otherDay != null ){
log.info("超管赠送座驾 erbanNo:{},carId:{}, days:{} 更换为 otherDay:{}",erbanNo,carId,days,otherDay);
days = otherDay;
}
final CountDownLatch latch = new CountDownLatch(erbanList.length);
ExecutorService executors = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 4 - 1);
for (String erban : erbanList) {
Integer sendDays = days;
executors.execute(()->{
try {
Users users = usersService.getUserByErbanNo(Long.valueOf(erban));
if (users == null) {
throw new AdminServiceException(BusiStatus.USERNOTEXISTS);
}
Long uid = users.getUid();
CarGoods carGoods = carGoodsService.getCarGoods(carId);
if (carGoods == null) {
throw new AdminServiceException(BusiStatus.CARPORTNOTEXIST);
}
if (!adminUserVo.getPartitionIds().contains(users.getPartitionId())) {
throw new AdminServiceException("ID:"+ erban +" Part Error");
}
carPayService.experCarByOfficial(uid, carId, sendDays, desc, true);
} catch (AdminServiceException e) {
log.error("exper error:{}", e);
failErban.add(erban);
failReason.add(e.getMessage());
}finally {
latch.countDown();
}
});
}
latch.await();
if (failErban.size() > 0) {
retMap.put("code", "200");
retMap.put("erban", failErban.toString());
retMap.put("message", failReason.toString());
} else {
retMap.put("code", "100");
}
} catch (Exception e) {
log.error("exper function error:{}", e);
retMap.put("code", "300");
retMap.put("message", e.getMessage());
}
return retMap;
}
public Page<FamilyIncomeAdminVo> pageFamilyIncome(Long erbanNo, Integer regionId, String familyName, String startDate, String endDate,
long pageNum, long pageSize, Integer partitionId, Integer adminId) {
@@ -266,7 +362,8 @@ public class GuildSuperAdminService {
if (inviteUid == null) {
return new Page<>();
}
return guildDiamondStatisticsDayAdminService.list(startDate, endDate, null, null, guildId, ownerErbanNo, pageNo, pageSize, inviteUid);
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
return guildDiamondStatisticsDayAdminService.list(startDate, endDate, adminUserVo.getPartitionIds().get(0), null, guildId, ownerErbanNo, pageNo, pageSize, inviteUid);
}
}

View File

@@ -334,6 +334,15 @@ public class MyApiController {
return BusiResult.success();
}
@RequestMapping("/createPublicRoom")
@ResponseBody
public BusiResult<Void> createPublicRoom(Long roomId, Integer partitionId) {
if (null == roomId || !roomId.equals(603L) || null == partitionId) {
throw new AdminServiceException(BusiStatus.PARAMERROR);
}
myApiService.createPublicRoom(partitionId);
return BusiResult.success();
}
@Autowired
private GoogleTokenVerifier googleTokenVerifier;

View File

@@ -51,8 +51,8 @@ public class CarGoodsAdminController extends BaseController {
enable = null;
}
Pagination<CarGoods> pagination = new Pagination<>();
pagination.setTotal(carGoodsService.countCarGoods(enable, carGoodsId, carGoodsName, carGoodsType, partitionId));
pagination.setRows(carGoodsService.getCarGoodsList(page, pageSize, enable, null, carGoodsId, carGoodsName, carGoodsType, partitionId));
pagination.setTotal(carGoodsService.countCarGoods(enable, carGoodsId, carGoodsName, carGoodsType, partitionId, null));
pagination.setRows(carGoodsService.getCarGoodsList(page, pageSize, enable, null, carGoodsId, carGoodsName, carGoodsType, partitionId, null));
return pagination;
}

View File

@@ -4,8 +4,8 @@ import com.accompany.admin.controller.BaseController;
import com.accompany.admin.service.family.FamilyManageAdminService;
import com.accompany.admin.service.system.AdminLogService;
import com.accompany.admin.vo.family.FamilyAdminVo;
import com.accompany.business.vo.family.FamilyMemberAdminVo;
import com.accompany.admin.vo.family.FamilyOperateRecordAdminVo;
import com.accompany.business.vo.family.FamilyMemberAdminVo;
import com.accompany.common.result.BusiResult;
import com.accompany.common.result.PageResult;
import com.accompany.common.status.BusiStatus;
@@ -51,7 +51,7 @@ public class FamilyManageAdminController extends BaseController {
throw new AdminServiceException(BusiStatus.PARAMERROR);
}
Integer adminId = getAdminId();
service.createFamily(erbanNo, referrer, inviteErbanNo);
service.createFamily(erbanNo, referrer, inviteErbanNo, adminId);
adminLogService.insertLog(adminId,getClass().getCanonicalName(),
"create family","params===>>erbanNo:"+erbanNo + ",referrer:" + referrer + ",inviteErbanNo:"+ inviteErbanNo);
return BusiResult.success();

View File

@@ -1,13 +1,22 @@
package com.accompany.admin.controller.guild;
package com.accompany.admin.controller.guildsuper;
import cn.hutool.core.util.StrUtil;
import com.accompany.admin.base.Pagination;
import com.accompany.admin.controller.BaseController;
import com.accompany.admin.dto.NameplateDto;
import com.accompany.admin.service.UserCheckAdminService;
import com.accompany.admin.service.firstpage.SecondPageBannerAdminService;
import com.accompany.admin.service.guild.GuildSuperAdminService;
import com.accompany.admin.service.system.AdminLogService;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.vo.AdminUserVo;
import com.accompany.admin.vo.UsersAdminVo;
import com.accompany.admin.vo.family.FamilyAdminVo;
import com.accompany.admin.vo.guild.GuildApplyAuditVo;
import com.accompany.admin.vo.vip.VipSendRecordVo;
import com.accompany.business.model.CarGoods;
import com.accompany.business.param.BasePageParams;
import com.accompany.business.service.room.RoomService;
import com.accompany.business.vo.family.FamilyIncomeAdminVo;
import com.accompany.business.vo.guild.GuildDiamondStatisticsDayVo;
import com.accompany.common.result.BusiResult;
@@ -15,18 +24,24 @@ import com.accompany.common.result.PageResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.enumeration.PartitionEnum;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.service.region.RegionInfoService;
import com.accompany.core.vo.BaseResponseVO;
import com.accompany.core.vo.UserVo;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Api(tags = "超管中心")
@RestController
@@ -36,6 +51,16 @@ public class GuildSuperAdminController extends BaseController {
private AdminLogService adminLogService;
@Autowired
private GuildSuperAdminService guildSuperAdminService;
@Autowired
private UserCheckAdminService userCheckAdminService;
@Autowired
private RegionInfoService regionInfoService;
@Autowired
private AdminUserService adminUserService;
@Autowired
private SecondPageBannerAdminService secondPageBannerAdminService;
@Autowired
private RoomService roomService;
@ApiOperation(value = "创建公会,对应前端页面GuildInfo修改家族用已有接口/admin/family/manage/update", httpMethod = "POST")
@ApiImplicitParams({
@@ -56,16 +81,16 @@ public class GuildSuperAdminController extends BaseController {
@ApiOperation(value = "查询公会信息",httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "partitionId", value = "分区id"),
// @ApiImplicitParam(name = "partitionId", value = "分区id"),
@ApiImplicitParam(name = "familyId", value = "家族id"),
@ApiImplicitParam(name = "erbanNo", value = "家族长erbanNo"),
@ApiImplicitParam(name = "pageNum", value = "页码", required = true),
@ApiImplicitParam(name = "pageSize", value = "页长", required = true)
})
@GetMapping("/pageFamily")
public BusiResult<PageResult<FamilyAdminVo>> pageFamily(Integer partitionId, Integer familyId, Long erbanNo,
public BusiResult<PageResult<FamilyAdminVo>> pageFamily(Integer familyId, Long erbanNo,
long pageNum, long pageSize){
Page<FamilyAdminVo> page = guildSuperAdminService.pageFamily(partitionId, familyId, erbanNo, pageNum, pageSize, getAdminId());
Page<FamilyAdminVo> page = guildSuperAdminService.pageFamily(familyId, erbanNo, pageNum, pageSize, getAdminId());
return BusiResult.success(new PageResult<>(page));
}
@@ -136,6 +161,19 @@ public class GuildSuperAdminController extends BaseController {
writeJson(JSON.toJSONString(objectMap));
}
@ApiOperation(value = "座驾列表(同原有接口页面", httpMethod = "GET")
@GetMapping(value = "/cars")
public Pagination<CarGoods> getCarGoodsList(Integer page, Integer pageSize) {
return guildSuperAdminService.getCarGoodsList(page, pageSize, getAdminId());
}
@ApiOperation(value = "赠送座驾列表(同原有接口页面", httpMethod = "POST")
@RequestMapping(value = "/carSend", method = RequestMethod.POST)
public void experByOfficial(String erbanNo, Integer carId, Integer days, String desc, Integer otherDay) {
Map map = guildSuperAdminService.carSend(erbanNo, carId, days, desc, otherDay, getAdminId());
writeJson(JSON.toJSONString(map));
}
@ApiOperation("查询家族流水")
@ApiImplicitParams({
@ApiImplicitParam(name = "erbanNo", value = "家族长erbanNo"),
@@ -184,4 +222,25 @@ public class GuildSuperAdminController extends BaseController {
getAdminId(), guildId, ownerErbanNo, basePageParams.getPageNo(), basePageParams.getPageSize()));
}
@GetMapping("/userList")
public BusiResult<List<UsersAdminVo>> getList(String erbanNoList) {
if (StrUtil.isEmpty(erbanNoList)) {
return BusiResult.success();
}
List<String> oldList = Arrays.asList(erbanNoList.split(","));
List<UsersAdminVo> list = userCheckAdminService.getUserListByErbanNoList(oldList);
AdminUserVo adminUserVo = adminUserService.getByAdminId(getAdminId());
list = list.stream().filter(usersAdminVo -> adminUserVo.getPartitionIds().contains(usersAdminVo.getUsers().getPartitionId())).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(list)) {
Map<Integer, String> regionName = regionInfoService.getRegionName();
for (UsersAdminVo usersAdminVo : list) {
UserVo users = usersAdminVo.getUsers();
if (users != null && users.getRegionId() != null) {
usersAdminVo.setRegionName(regionName.get(users.getRegionId()));
}
}
}
return BusiResult.success(list);
}
}

View File

@@ -0,0 +1,63 @@
package com.accompany.admin.controller.guildsuper;
import com.accompany.admin.controller.BaseController;
import com.accompany.admin.dto.community.DynamicVerifyDto;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.service.world.community.DynamicVerifyAdminService;
import com.accompany.admin.vo.AdminUserVo;
import com.accompany.admin.vo.community.DynamicVerifyVo;
import com.accompany.community.constant.DynamicStatusEnum;
import com.accompany.core.util.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "超管中心")
@RestController
@RequestMapping("/admin/superCenter")
public class GuildSuperDynamicAdminController extends BaseController {
@Autowired
private AdminUserService adminUserService;
@Autowired
private DynamicVerifyAdminService dynamicVerifyAdminService;
@RequestMapping("/dynamicList")
public void list(DynamicVerifyDto dto){
AdminUserVo adminUserVo = adminUserService.getByAdminId(getAdminId());
dto.setPartitionId(adminUserVo.getPartitionIds().get(0));
dto.setStatus(0);
PageInfo<DynamicVerifyVo> voPageInfo = dynamicVerifyAdminService.getPageList(dto);
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", voPageInfo.getTotal());
jsonObject.put("rows", voPageInfo.getList());
writeJson(jsonObject.toJSONString());
}
@RequestMapping("/dynamicChangeStatus")
public void changeStatus(Long dynamicId, Integer status, String reason){
if(dynamicId == null || dynamicId == 0 || status == null) {
writeJson(false, "参数有误");
return;
}
if (status.equals(DynamicStatusEnum.NOT_PASS.getValue()) || status.equals(DynamicStatusEnum.UNSHELVE.getValue())){
if (StringUtils.isEmpty(reason)){
writeJson(false, "参数有误");
return;
}
}
try {
int result = dynamicVerifyAdminService.changeStatus(dynamicId, status, reason, getAdminId());
if(result>0) {
writeJson(true,String.valueOf(result));
return;
}
} catch (Exception e) {
logger.error("Failed to change dynamic status, Cause by {}", e.getCause().getMessage());
writeJson(false, e.getMessage());
}
writeJson(false, "操作失败");
}
}

View File

@@ -0,0 +1,78 @@
package com.accompany.admin.controller.guildsuper;
import com.accompany.admin.base.Pagination;
import com.accompany.admin.controller.BaseController;
import com.accompany.admin.service.firstpage.SecondPageBannerAdminService;
import com.accompany.admin.service.system.AdminLogService;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.admin.vo.AdminUserVo;
import com.accompany.admin.vo.SecondPageBannerAdminVo;
import com.accompany.business.model.firstpage.SecondPageBanner;
import com.accompany.business.service.fillstrategy.strategy.FillConstant;
import com.accompany.business.service.user.UsersService;
import com.accompany.common.result.BusiResult;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "超管中心-banner")
@RestController
@RequestMapping("/admin/superCenter")
public class GuildSuperSecondBannerAdminController extends BaseController {
@Autowired
private AdminLogService adminLogService;
@Autowired
private AdminUserService adminUserService;
@Autowired
private SecondPageBannerAdminService secondPageBannerAdminService;
@Autowired
private UsersService usersService;
@ApiOperation(value = "新增/修改banner", httpMethod = "POST")
@PostMapping(value = "/secondBannerSave")
public BusiResult<Void> saveOrUpdateSecondPageBanner(SecondPageBanner firstPageBanner) {
int adminId = getAdminId();
AdminUserVo adminUserVo = adminUserService.getByAdminId(adminId);
firstPageBanner.setOperator(adminUserVo.getUsername());
firstPageBanner.setPartitionIds(adminUserVo.getPartitionIds());
firstPageBanner.setPlatform("all");
firstPageBanner.setBannerType(1);
firstPageBanner.setBannerStatus(1);
if (firstPageBanner.getSkipType() == FillConstant.SkipType.room) {
if (com.accompany.common.utils.StringUtils.isEmpty(firstPageBanner.getSkipUri())) {
throw new AdminServiceException("请输入RoomID");
}
firstPageBanner.setSkipUri(firstPageBanner.getSkipUri().trim());
Users users = usersService.getUserByErbanNo(Long.valueOf(firstPageBanner.getSkipUri()));
if (users == null || !adminUserVo.getPartitionIds().contains(users.getPartitionId())) {
throw new AdminServiceException("请输入正确的RoomID");
}
} else if (firstPageBanner.getSkipType() != 100) {
throw new AdminServiceException("config error");
}
Boolean result = secondPageBannerAdminService.saveOrUpdateSecondPageBanner(firstPageBanner);
if(result) {
adminLogService.insertLog(adminId, getClass().getCanonicalName(), "superGuild.saveOrUpdateSecondPageBanner", "params===>>" + firstPageBanner.toString());
}
return new BusiResult<>(BusiStatus.SUCCESS);
}
@ApiOperation("获取banner列表")
@GetMapping(value = "/bannelList")
public Pagination<SecondPageBannerAdminVo> getSecondPageBannerList(@RequestParam(defaultValue = "0") Byte bannerStatus,
@RequestParam(defaultValue = "0") Integer timeStatus,
@RequestParam(defaultValue = "1") Integer pageNo,
@RequestParam(defaultValue = "20") Integer pageSize) {
AdminUserVo adminUserById = adminUserService.getByAdminId(getAdminId());
IPage<SecondPageBannerAdminVo> pageInfo = secondPageBannerAdminService.getSecondPageBannerList(pageNo, pageSize,
(byte)0, bannerStatus, (byte)1, timeStatus,null, adminUserById.getPartitionIds().get(0), null, null);
return new Pagination<>(pageInfo);
}
}

View File

@@ -3,9 +3,9 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -15,9 +15,9 @@ spring:
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -26,20 +26,20 @@ spring:
connection-test-query: select 1
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 8
@@ -47,17 +47,9 @@ spring:
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"
##activemq 配置
activemq:
brokerUrl: tcp://124.156.164.187:61619
user: system
password: manager
maxConnections: 50
idleTimeout: 30000
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -15,9 +15,20 @@ public class Attach {
private String message;
private Object data;
//用于携带给客户端用于区分同一组first和second的消息是单房间消息还是轮询全服房间遍历发送的单房间消息
//已使用公聊房机制解决轮询全服房间发送消息的云信im限频问题
private Integer allRoomMsg;
public Attach(int first, int second, Object data) {
this.first = first;
this.second = second;
this.data = data;
}
public Attach(int first, int second, Object data, int allRoomMsg) {
this.first = first;
this.second = second;
this.data = data;
this.allRoomMsg = allRoomMsg;
}
}

View File

@@ -39,4 +39,6 @@ public class Family {
* 邀请人证明
*/
private String inviteCheck;
private Integer adminId;
}

View File

@@ -18,10 +18,12 @@ import com.accompany.common.utils.ReplaceAppDomainUtils;
import com.accompany.common.utils.UUIDUtil;
import com.accompany.core.base.SpringContextHolder;
import com.accompany.core.enumeration.I18nAlertEnum;
import com.accompany.core.model.PartitionInfo;
import com.accompany.core.model.Room;
import com.accompany.core.model.Users;
import com.accompany.core.mybatismapper.RoomMapperExpand;
import com.accompany.core.service.base.BaseService;
import com.accompany.core.service.partition.PartitionInfoService;
import com.accompany.core.util.I18NMessageSourceUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@@ -61,6 +63,8 @@ public class SendSysMsgService extends BaseService {
@Autowired
private RoomMapperExpand roomMapperExpand;
@Autowired
private PartitionInfoService partitionInfoService;
/**
* 发送系统通知,捕获异常不抛出。
@@ -546,13 +550,33 @@ public class SendSysMsgService extends BaseService {
});
}
public void sendMessageToPartition(Integer partitionId, int first, int second, Object data) {
public void sendSingleRoomMessage(long roomId, String fromAccId, BaseChatRoomMsg msg) {
try {
String msgId = UUIDUtil.get();
this.erBanNetEaseService.sendChatRoomMsg(roomId, msgId, fromAccId,
msg.getMsgType(), msg.getAttach(), msg.getExt());
} catch (Exception e) {
log.error("发送房间消息失败[roomId : {}, fromAccId : {}, message : {}]",
roomId, fromAccId, msg, e);
}
}
public void sendMessageToPartition(int partitionId, int first, int second, Object data) {
Attach attach = new Attach(first, second, data);
sendMessageToPartition(partitionId, attach);
}
public void sendMessageToPartition(Integer partitionId, Attach attach) {
public void sendMessageToPartition(int partitionId, Attach attach) {
attach.setAllRoomMsg(Constant.Yes1No0.YES);
BaseChatRoomMsg msg = BaseChatRoomMsg.buildBaseChatRoomMsg(attach);
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
if (partitionInfo == null){
return;
}
sendSingleRoomMessage(partitionInfo.getPublicChatRoomId(), SystemConfig.secretaryUid, attach);
sendMessageToPartition(partitionId, msg);
}
@@ -562,7 +586,16 @@ public class SendSysMsgService extends BaseService {
}
public void sendMessageToPartition(Room curRoom, Attach attach) {
attach.setAllRoomMsg(Constant.Yes1No0.YES);
BaseChatRoomMsg msg = BaseChatRoomMsg.buildBaseChatRoomMsg(attach);
PartitionInfo partitionInfo = partitionInfoService.getById(curRoom.getPartitionId());
if (partitionInfo == null){
return;
}
sendSingleRoomMessage(partitionInfo.getPublicChatRoomId(), SystemConfig.secretaryUid, attach);
sendMessageToPartition(curRoom, msg);
}
@@ -608,6 +641,15 @@ public class SendSysMsgService extends BaseService {
}
public void sendFloatingMessageForRoom(FloatingMessageTemplate message) {
int partitionId = message.getPartitionId();
PartitionInfo partitionInfo = partitionInfoService.getById(partitionId);
if (partitionInfo == null){
return;
}
sendFloatingMessageForRoom(partitionInfo.getPublicChatRoomId(), Long.parseLong(SystemConfig.secretaryUid), message);
List<Room> validRooms = this.roomMapperExpand.listValidRoomsByPartitionId(null, message.getPartitionId());
if (CollectionUtils.isEmpty(validRooms)){
return;

View File

@@ -56,7 +56,7 @@ public class CarGoodsService extends BaseService {
* @return
*/
public List<CarGoods> getCarGoodsList(Integer page, Integer pageSize, Byte status, Boolean goldSale,
Integer carGoodsId, String carGoodsName, Byte carGoodsType, Integer partitionId) {
Integer carGoodsId, String carGoodsName, Byte carGoodsType, Integer partitionId, List<Integer> carGoodsIds) {
page = (page == null || page <= 0) ? DEFAULT_PAGE : page;
pageSize = (pageSize == null || pageSize <= 0) ? DEFAULT_PAGE_SIZE : pageSize;
int offSet = (page - 1) * pageSize;
@@ -65,6 +65,9 @@ public class CarGoodsService extends BaseService {
if (null != carGoodsId){
criteria.andIdEqualTo(carGoodsId);
}
if (!CollectionUtils.isEmpty(carGoodsIds)) {
criteria.andIdIn(carGoodsIds);
}
if (status != null) {
criteria.andEnableEqualTo(status);
}
@@ -89,7 +92,7 @@ public class CarGoodsService extends BaseService {
public List<UserCarGoodsVo> getUserCarGoodsList(Integer page, Integer pageSize, Long uid, Boolean goldSale) {
List<UserCarGoodsVo> userCarGoodsVoList = Lists.newArrayList();
List<CarGoods> carGoodsList = this.getCarGoodsList(page, pageSize, Constant.CarGoodsEnable.ENABLE, goldSale,
null, null, null, null);
null, null, null, null, null);
if (carGoodsList == null || carGoodsList.isEmpty()) {
return userCarGoodsVoList;
}
@@ -150,12 +153,15 @@ public class CarGoodsService extends BaseService {
* @param carGoodsType
* @return
*/
public Integer countCarGoods(Byte status, Integer carGoodsId, String carGoodsName, Byte carGoodsType, Integer partitionId) {
public Integer countCarGoods(Byte status, Integer carGoodsId, String carGoodsName, Byte carGoodsType, Integer partitionId, List<Integer> carGoodsIds) {
CarGoodsExample example = new CarGoodsExample();
CarGoodsExample.Criteria criteria = example.createCriteria();
if (null != carGoodsId){
criteria.andIdEqualTo(carGoodsId);
}
if (!CollectionUtils.isEmpty(carGoodsIds)) {
criteria.andIdIn(carGoodsIds);
}
if (status != null) {
criteria.andEnableEqualTo(status);
}

View File

@@ -3,59 +3,55 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
minimum-idle: 4
maximum-pool-size: 16
minimum-idle: 10
maximum-pool-size: 20
connection-test-query: select 1
max-lifetime: 1800000 # 30分钟
validation-timeout: 6000 # 验证连接的最大等待时间
idle-timeout: 600000 # 空闲连接超时时间10分钟
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
minimum-idle: 4
maximum-pool-size: 32
minimum-idle: 10
maximum-pool-size: 20
connection-test-query: select 1
max-lifetime: 1800000 # 30分钟
validation-timeout: 6000 # 验证连接的最大等待时间
idle-timeout: 600000 # 空闲连接超时时间10分钟
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 24
maxIdle: 12
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 2
nettyThreads: 4
threads: 8
nettyThreads: 16
codec: !<org.redisson.codec.JsonJacksonCodec> {}
transportMode: "NIO"
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000
server:

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -3,9 +3,9 @@ spring:
dynamic-datasource:
master:
poolName: master
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -15,9 +15,9 @@ spring:
max-lifetime: 7000
slave:
poolName: slave
jdbcUrl: jdbc:mysql://124.156.164.187:3306/peko?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
jdbcUrl: jdbc:mysql://129.226.62.202:3306/eparty?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false&useSSL=false&useCursorFetch=true
username: root
password: anan@dev##
password: eparty@dev##
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.zaxxer.hikari.HikariDataSource
hikari:
@@ -26,20 +26,20 @@ spring:
connection-test-query: select 1
max-lifetime: 7000
redis:
host: 124.156.164.187
host: 129.226.62.202
port: 6200
maxTotal: 100
maxIdle: 50
maxWait: 2500
testOnBorrow: true
testOnReturn: true
password: anan@dev@redis@#!
password: pc8DphhaXwTe2jyv
redisson:
# file: classpath:redisson.yaml
config: |
singleServerConfig:
address: redis://124.156.164.187:6200
password: anan@dev@redis@#!
address: redis://129.226.62.202:6200
password: pc8DphhaXwTe2jyv
connectionMinimumIdleSize: 4
timeout: 10000
threads: 8
@@ -49,9 +49,9 @@ spring:
## rocketmq 配置
rocketmq:
name-server: 124.156.164.187:9876
name-server: 129.226.62.202:9876
producer:
group: peko-group
group: eparty-group
sendMessageTimeout: 300000
server:

View File

@@ -19,7 +19,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -42,7 +42,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml

View File

@@ -16,7 +16,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml
@@ -39,7 +39,7 @@ spring:
nacos:
config:
server-addr: 124.156.164.187:8848
namespace: 8c62facb-be55-4bd3-9120-0c0c2ff564e9
namespace: a08ed001-51c0-4dbf-a1df-6e13e0edf1a8
file-extension: yml
shared-configs:
- data-id: application.yml