diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/NameplateDto.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/NameplateDto.java index 3be80865b..0ac1568ea 100644 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/NameplateDto.java +++ b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/dto/NameplateDto.java @@ -11,7 +11,6 @@ import lombok.NoArgsConstructor; * Created By LeeNana on 2020/3/17. */ @Data -@Builder @NoArgsConstructor @AllArgsConstructor public class NameplateDto extends Nameplate { diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRecordAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRecordAdminVo.java deleted file mode 100644 index 876f6c7c0..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRecordAdminVo.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.accompany.admin.vo; - -import com.accompany.business.model.RecommendRecord; - -public class RecommendRecordAdminVo extends RecommendRecord { - private Long erbanNo; - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRoomVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRoomVo.java deleted file mode 100644 index 7152261f0..000000000 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/RecommendRoomVo.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.accompany.admin.vo; - -import com.alibaba.fastjson.JSON; - -import java.util.Date; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 14:45 - */ -public class RecommendRoomVo { - - private Integer id; - - private Long roomUid; - - private String roomName; - - private Byte roomType; - - private Integer seq; - - private Integer weight; - - private Byte recommendStatus; - - private Date createTime; - - private Date updateTime; - - private Long erbanNo; - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public Long getRoomUid() { - return roomUid; - } - - public void setRoomUid(Long roomUid) { - this.roomUid = roomUid; - } - - public String getRoomName() { - return roomName; - } - - public void setRoomName(String roomName) { - this.roomName = roomName; - } - - public Byte getRoomType() { - return roomType; - } - - public void setRoomType(Byte roomType) { - this.roomType = roomType; - } - - public Integer getSeq() { - return seq; - } - - public void setSeq(Integer seq) { - this.seq = seq; - } - - public Integer getWeight() { - return weight; - } - - public void setWeight(Integer weight) { - this.weight = weight; - } - - public Byte getRecommendStatus() { - return recommendStatus; - } - - public void setRecommendStatus(Byte recommendStatus) { - this.recommendStatus = recommendStatus; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - @Override - public String toString() { - return JSON.toJSONString(this); - } -} diff --git a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/dress/NameplateAdminVo.java b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/dress/NameplateAdminVo.java index f6b5bf6b7..4fd99c617 100644 --- a/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/dress/NameplateAdminVo.java +++ b/accompany-admin/accompany-admin-sdk/src/main/java/com/accompany/admin/vo/dress/NameplateAdminVo.java @@ -13,7 +13,6 @@ import java.util.Date; * Created By LeeNana on 2020/3/17. */ @Data -@Builder @NoArgsConstructor @AllArgsConstructor public class NameplateAdminVo extends Nameplate { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/common/BusinessException.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/common/BusinessException.java deleted file mode 100644 index b6c5fd4d5..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/common/BusinessException.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.admin.common; - -/** - * Created by PaperCut on 2018/1/26. - */ -public class BusinessException extends RuntimeException{ - public BusinessException() { - } - - public BusinessException(String message) { - super(message); - } - - public BusinessException(String message, Throwable cause) { - super(message, cause); - } - - public BusinessException(Throwable cause) { - super(cause); - } - - public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendModuleExpand.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendModuleExpand.java deleted file mode 100644 index c932b5450..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendModuleExpand.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.accompany.admin.mapper; - -import com.accompany.business.model.RecommendModule; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * @author chuangBiao - * @description - * @date 2019/2/15 - */ -public interface RecommendModuleExpand { - List listRecommendModules(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("title") String title, @Param("status") Integer status); - - int delRecommendModuleByids(@Param("ids") List ids); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendRoomAdminExpand.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendRoomAdminExpand.java deleted file mode 100644 index 9be14fbd2..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/RecommendRoomAdminExpand.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.admin.mapper; - -import com.accompany.admin.vo.RecommendRoomVo; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 14:56 - */ -public interface RecommendRoomAdminExpand { - - /** - * @param beginTime - * @param endTime - * @param roomUid - * @param roomType - * @return - */ - List listRecommendRooms(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("roomUid") Long roomUid, - @Param("roomType") Byte roomType); - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/TopicRoomExpand.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/TopicRoomExpand.java deleted file mode 100644 index e813b9a37..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/mapper/TopicRoomExpand.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.admin.mapper; - -import com.accompany.business.model.TopicRoom; -import com.accompany.business.vo.TopicRoomVo; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * @author chuangBiao - * @description - * @date 2019/2/15 - */ -public interface TopicRoomExpand { - List getTopicRoomList(@Param("title") String title, @Param("erbanNo") Long erbanNo); - - List getTopicRoomListByModuleId(@Param("moduleId") Long moduleId); - - int delTopicRoomByids(@Param("ids") List ids); - - int delTopicRoomByModuleIds(@Param("ids") List ids); - - int delTopicRoomByModuleId(@Param("moduleId") Long moduleId); - - int insertBatch(List records); - - int updateTopicRoomNameByModuleId(@Param("title") String title, @Param("moduleId") Long moduleId); -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/MsgPushAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/MsgPushAdminService.java index 09bbdfa05..5df6c8370 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/MsgPushAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/MsgPushAdminService.java @@ -1,7 +1,6 @@ package com.accompany.admin.service; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.service.base.BaseService; import com.accompany.admin.vo.message.RecallQO; import com.accompany.business.model.MsgPushRecord; @@ -13,6 +12,7 @@ import com.accompany.business.service.user.UsersService; import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Constant; import com.accompany.core.enumeration.BusinessStatusCodeEnum; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Users; import com.accompany.core.model.UsersExample; import com.accompany.core.mybatismapper.UsersMapper; @@ -43,9 +43,6 @@ public class MsgPushAdminService extends BaseService { @Autowired private MsgPushRecordMapper msgPushRecordMapper; - @Autowired - private UsersMapperExpend usersMapperExpend; - @Autowired private UsersMapper usersMapper; @@ -82,12 +79,12 @@ public class MsgPushAdminService extends BaseService { if (Constant.SecretarySkipType.ROOM.equals(skipType)) { if (StringUtils.isEmpty(skipContent)) { logger.error("参数错误"); - throw new BusinessException("参数错误"); + throw new AdminServiceException("参数错误"); } Users users = usersService.getUserByErbanNo(Long.parseLong(skipContent)); if (users == null) { logger.error("查询不到该用户房间"); - throw new BusinessException("查询不到该用户房间"); + throw new AdminServiceException("查询不到该用户房间"); } msgPushRecord.setSkipUri(users.getUid().toString()); } else { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/PrettyNumberAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/PrettyNumberAdminService.java index b4bf10fb4..320248272 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/PrettyNumberAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/PrettyNumberAdminService.java @@ -1,9 +1,9 @@ package com.accompany.admin.service; import com.accompany.admin.base.AbstractCoreService; -import com.accompany.admin.common.BusinessException; import com.accompany.core.base.BaseMapper; import com.accompany.business.constant.PrettyNumberStatusEnum; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.accompany.core.mybatismapper.PrettyNumberMapper; import com.accompany.core.mybatismapper.PrettyNumberRecordMapper; @@ -54,7 +54,7 @@ public class PrettyNumberAdminService extends AbstractCoreService 0){ - throw new BusinessException("该奖品已在礼包中"); + throw new AdminServiceException("该奖品已在礼包中"); } ActivityPackItem packItem = new ActivityPackItem(); packItem.setPackId(packId); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/activity/ChargeActivityService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/activity/ChargeActivityService.java index 27b9dbaa2..5f717f61c 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/activity/ChargeActivityService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/activity/ChargeActivityService.java @@ -1,12 +1,12 @@ package com.accompany.admin.service.activity; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.dto.ChargeActivitySearchDto; import com.accompany.admin.service.base.BaseService; import com.accompany.business.model.*; import com.accompany.business.mybatismapper.ChargeActivityMapper; import com.accompany.business.service.room.RoomService; import com.accompany.business.service.user.UsersService; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Room; import com.accompany.core.model.Users; import com.github.pagehelper.PageHelper; @@ -65,7 +65,7 @@ public class ChargeActivityService extends BaseService { if(record.getSkipType() == Constant.ActivitySkipType.ROOM) { Users user = usersService.getUserByErbanNo(NumberUtils.toLong(record.getSkipUrl())); if(user == null) { - throw new BusinessException("平台号为" + record.getSkipUrl() + "的用户不存在!"); + throw new AdminServiceException("平台号为" + record.getSkipUrl() + "的用户不存在!"); } record.setSkipUrl(user.getErbanNo() + ":" + user.getUid()); } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java index c3f5bb366..3c96f6190 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/anchor/AnchorAdminService.java @@ -1,11 +1,11 @@ package com.accompany.admin.service.anchor; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.base.BaseService; import com.accompany.admin.service.system.AdminUserService; import com.accompany.business.model.AnchorWhitelist; import com.accompany.business.model.AnchorWhitelistExample; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Users; import com.accompany.business.mybatismapper.AnchorWhitelistMapper; import com.accompany.core.service.common.JedisService; @@ -81,7 +81,7 @@ public class AnchorAdminService extends BaseService { //用户信息 Users users = usersBaseService.getUsersByErBanNo(Long.valueOf(erbanNoStr)); if(null == users) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); + throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); } AnchorWhitelistExample anchorWhitelistExample = new AnchorWhitelistExample(); AnchorWhitelistExample.Criteria criteria = anchorWhitelistExample.createCriteria(); @@ -92,7 +92,7 @@ public class AnchorAdminService extends BaseService { if(!CollectionUtils.isEmpty(anchorWhitelists)){ AnchorWhitelist anchor = anchorWhitelists.get(0); if(anchor.getStatus() == 1){ - throw new BusinessException("平台号为"+ erbanNo + "已存在列表中!"); + throw new AdminServiceException("平台号为"+ erbanNo + "已存在列表中!"); }else { anchor.setStatus(1); anchor.setOperateReason(reason); @@ -132,14 +132,14 @@ public class AnchorAdminService extends BaseService { //用户信息 Users users = usersBaseService.getUsersByErBanNo(erbanNo); if(null == users) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); + throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); } AnchorWhitelistExample anchorWhitelistExample = new AnchorWhitelistExample(); anchorWhitelistExample.createCriteria().andErbanNoEqualTo(erbanNo); List anchorWhitelists = anchorWhitelistMapper.selectByExample(anchorWhitelistExample); if(CollectionUtils.isEmpty(anchorWhitelists)){ - throw new BusinessException("平台号为"+ erbanNo + "的主播不存在!"); + throw new AdminServiceException("平台号为"+ erbanNo + "的主播不存在!"); } AdminUser adminUser = adminUserService.getAdminUserById(adminId); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java index bd6eb8344..9846df36b 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/clan/impl/ClanAdminServiceImpl.java @@ -25,7 +25,6 @@ import com.accompany.business.model.clan.ClanAccountAssociate; import com.accompany.business.model.clan.ClanHall; import com.accompany.business.model.clan.ClanLevelSetting; import com.accompany.business.model.hall.HallSuperManage; -import com.accompany.business.model.user.UserCouple; import com.accompany.business.mybatismapper.HallAuthMapper; import com.accompany.business.mybatismapper.HallMapper; import com.accompany.business.mybatismapper.HallMemberAuthMapper; @@ -38,7 +37,6 @@ import com.accompany.business.service.hall.HallService; import com.accompany.business.service.hall.HallSuperManagerBizService; import com.accompany.business.service.purse.UserPurseService; import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UserCoupleService; import com.accompany.business.service.user.UsersService; import com.accompany.business.vo.clan.*; import com.accompany.common.constant.Constant; @@ -109,13 +107,9 @@ public class ClanAdminServiceImpl implements ClanAdminService { @Autowired private RoomService roomService; @Autowired - private UserCoupleService userCoupleService; - @Autowired private HallService hallService; @Autowired private HallManageService hallManageService; - @Autowired - private UserPurseService userPurseService; @Override public void addClan(Long clanElderErbanNo, String clanName, String hallOwnerErbanNo, Integer level, String avatar, String associateAccount) { @@ -890,8 +884,6 @@ public class ClanAdminServiceImpl implements ClanAdminService { for (String erbanNo : erbanNoList) { Users users = usersService.getUserByErbanNo(Long.valueOf(erbanNo)); if (users != null) uidList.add(users.getUid()); - - UserCouple userCouple = userCoupleService.queryCpByUid(users.getUid(), true); } return uidList; @@ -926,13 +918,6 @@ public class ClanAdminServiceImpl implements ClanAdminService { if (!CollectionUtils.isEmpty(clanList)) { throw new ServiceException("关联号中不允许有族长号!"); } - - - for (Long uid : uidList) { - UserCouple userCouple = userCoupleService.queryCpByUid(uid, true); - if (ObjectUtil.isNotNull(userCouple)) throw new ServiceException("关联号中不允许出现cp用户!"); - } - } if (CollectionUtils.isEmpty(errErbanNoList)) return null; diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftAdminService.java index 067d1be97..d625e7ef5 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftAdminService.java @@ -1,7 +1,6 @@ package com.accompany.admin.service.gift; import com.accompany.admin.base.AbstractCoreService; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.params.RoomFreeGiftConfigParams; import com.accompany.admin.service.system.AdminUserService; import com.accompany.admin.service.system.SysConfAdminService; @@ -30,6 +29,7 @@ import com.accompany.common.utils.DateTimeUtil; import com.accompany.common.utils.GsonUtil; import com.accompany.core.base.BaseMapper; import com.accompany.core.enumeration.BillObjTypeEnum; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Room; import com.accompany.core.model.SysConf; @@ -312,12 +312,12 @@ public class GiftAdminService extends AbstractCoreService { // 如果 下线时间 不为空,下线时间应大于当前时间 if (endValidTime != null) { if (endValidTime.before(leftNow)) { - throw new BusinessException("下线时间应大于当前时间"); + throw new AdminServiceException("下线时间应大于当前时间"); } } if (null != config && null != config.getGiftId() && Constant.GiftConsumeType.ROOM_FREE_GIFT == entity.getConsumeType() && !config.getGiftId().equals(entity.getGiftId())) { - throw new BusinessException(String.format("房间免费礼物只能有一个,已经有 %d", config.getGiftId())); + throw new AdminServiceException(String.format("房间免费礼物只能有一个,已经有 %d", config.getGiftId())); } } else { // 状态为下线时 // 设置上线时间 @@ -325,10 +325,10 @@ public class GiftAdminService extends AbstractCoreService { // 下线时间 不为空 if (endValidTime != null) { if (endValidTime.before(leftNow)) { - throw new BusinessException("下线时间应大于当前时间"); + throw new AdminServiceException("下线时间应大于当前时间"); } if (endValidTime.compareTo(startValidTime) <= 0) { - throw new BusinessException("下线时间应大于上线时间"); + throw new AdminServiceException("下线时间应大于上线时间"); } } } @@ -345,7 +345,7 @@ public class GiftAdminService extends AbstractCoreService { int result = countByExample(example); if (result > 0) { - throw new BusinessException("该礼物名称已重复"); + throw new AdminServiceException("该礼物名称已重复"); } } else { // 如果是无效礼物则去除Redis记录 diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftNotifyConfigAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftNotifyConfigAdminService.java index de83385a1..cec08affa 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftNotifyConfigAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/GiftNotifyConfigAdminService.java @@ -1,7 +1,6 @@ package com.accompany.admin.service.gift; import com.accompany.admin.base.AbstractCoreService; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.vo.GiftNotifyConfigAdminVo; import com.accompany.core.base.BaseMapper; import com.accompany.core.base.BeanMapper; @@ -10,6 +9,7 @@ import com.accompany.business.model.GiftNotifyConfig; import com.accompany.business.model.GiftNotifyConfigExample; import com.accompany.business.model.GiftNotifyLevel; import com.accompany.business.mybatismapper.GiftNotifyConfigMapper; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.service.common.JedisService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -90,7 +90,7 @@ public class GiftNotifyConfigAdminService extends AbstractCoreService 0) { - throw new BusinessException("已经为该礼物配置过全服通知了"); + throw new AdminServiceException("已经为该礼物配置过全服通知了"); } } int result = super.save(entity, isEdit, isSelective); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/MagicAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/MagicAdminService.java index 5b317a221..85315e1d6 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/MagicAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/gift/MagicAdminService.java @@ -1,16 +1,12 @@ package com.accompany.admin.service.gift; import com.accompany.admin.base.RedisSupportService; -import com.accompany.admin.common.BusinessException; import com.accompany.core.base.BaseMapper; import com.accompany.business.model.GiftMagic; import com.accompany.business.model.GiftMagicExample; import com.accompany.business.mybatismapper.GiftMagicMapper; -import com.accompany.business.mybatismapper.UserPurseMapperExpand; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.service.common.JedisService; -import com.accompany.business.service.gift.GiftSendRecordService; -import com.accompany.business.service.record.BillRecordService; -import com.accompany.business.service.purse.UserPurseService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.gson.Gson; @@ -32,15 +28,7 @@ public class MagicAdminService extends RedisSupportService 0) { - throw new BusinessException("该礼物名称已重复"); + throw new AdminServiceException("该礼物名称已重复"); } } else { // 如果是无效礼物则去除Redis记录 diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAuditRecordAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAuditRecordAdminService.java index 65b79abdd..c15857b37 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAuditRecordAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/nameplate/NameplateAuditRecordAdminService.java @@ -48,8 +48,6 @@ public class NameplateAuditRecordAdminService { @Autowired private SendSysMsgService sendSysMsgService; @Autowired - private NameplateMapper nameplateMapper; - @Autowired private NameplateAdminService nameplateAdminService; @Autowired private JedisService jedisService; @@ -90,35 +88,19 @@ public class NameplateAuditRecordAdminService { if (status == 1) { long applyDay = day / NAME_PLATE_APPLY_DAY; userNameplateService.updateNameplateRdsByType(uid, type, applyDay); - userNameplateApplyRecordService.updateCpMpAuditType(uid, pid, Constant.UserRelationType.cp, status, null); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(UserNameplateApplyRecord::getAuditId, pid); - UserNameplateApplyRecord applyRecord = userNameplateApplyRecordService.queryMpApplyRecordByAduitId(pid); - if (ObjectUtil.isNotNull(applyRecord)) { - sendUserNameplateMsg(uid, String.format(Constant.UserRelationDefaultVal.cp_mp_no_pass_msg, message)); - } else { - sendUserNameplateMsg(uid, "你申請的銘牌審核不通過" + message); - } + sendUserNameplateMsg(uid, "你申請的銘牌審核不通過" + message); } else { - UserNameplateApplyRecord applyRecord = userNameplateApplyRecordService.queryMpApplyRecordByAduitId(pid); - if (ObjectUtil.isNull(applyRecord)) { - if (NameplateStyleTypeEnum.VIP_MP_SEND.getValue().equals(record.getType())) { - userNameplateService.sendVipCustomNameplate(nameplateId, uid, day, "申請審核發放", adminName, type, nameplateAuditId); - // 设置审核通过后重新申请新文案的3天限制期 - setVipNameplateApplyLimit(uid, nameplateId); - sendUserNameplateMsg(uid, "你申請的貴族銘牌已通過審核併發放,快去裝扮起來吧!"); - } else { - //不是CP铭牌&&贵族自定义铭牌 照常处理 - userNameplateService.officialSendNameplateSingle(nameplateId, uid, day, "申請審核發放", adminName, type, nameplateAuditId); - sendUserNameplateMsg(uid, "你申請的銘牌已通過審核併發放,快去裝扮起來吧!"); - } + if (NameplateStyleTypeEnum.VIP_MP_SEND.getValue().equals(record.getType())) { + userNameplateService.sendVipCustomNameplate(nameplateId, uid, day, "申請審核發放", adminName, type, nameplateAuditId); + // 设置审核通过后重新申请新文案的3天限制期 + setVipNameplateApplyLimit(uid, nameplateId); + sendUserNameplateMsg(uid, "你申請的貴族銘牌已通過審核併發放,快去裝扮起來吧!"); } else { - //CP铭牌状态有效则发放 - if (Constant.GlobalStatus.valid.equals(applyRecord.getStatus())) { - userNameplateService.officialSendNameplateSingle(nameplateId, uid, day, "申請審核發放", adminName, type, nameplateAuditId); - sendUserNameplateMsg(uid, Constant.UserRelationDefaultVal.cp_mp_pass_msg); - } - userNameplateApplyRecordService.updateCpMpAuditType(uid, pid, Constant.UserRelationType.cp, status, nameplateId); + //不是CP铭牌&&贵族自定义铭牌 照常处理 + userNameplateService.officialSendNameplateSingle(nameplateId, uid, day, "申請審核發放", adminName, type, nameplateAuditId); + sendUserNameplateMsg(uid, "你申請的銘牌已通過審核併發放,快去裝扮起來吧!"); } } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/newLuckyBag/NewLuckyBagPoolAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/newLuckyBag/NewLuckyBagPoolAdminService.java index e5fe85b54..1235d2f4c 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/newLuckyBag/NewLuckyBagPoolAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/newLuckyBag/NewLuckyBagPoolAdminService.java @@ -1,15 +1,14 @@ package com.accompany.admin.service.newLuckyBag; -import com.accompany.admin.common.BusinessException; import com.accompany.business.constant.LuckyBagGiftPoolItemTypeEnum; import com.accompany.business.model.Gift; import com.accompany.business.model.luckybag.LuckyBagPool; import com.accompany.business.service.gift.GiftService; -import com.accompany.business.service.luckybag.LuckyBagGiftDeviateRangeService; import com.accompany.business.service.luckybag.LuckyBagPoolService; import com.accompany.business.vo.newLuckyBag.NewLuckyBagPoolItemAdminVo; import com.accompany.common.constant.Constant; import com.accompany.common.utils.BeanUtil; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -99,7 +98,7 @@ public class NewLuckyBagPoolAdminService { .set(LuckyBagPool::getOccupationRatio, defaultOccupationRatio + occupationRatio); Boolean updateStatus = luckyBagPoolService.update(updateWrapper); if (! updateStatus) { - throw new BusinessException("Renew default suitItem failed"); + throw new AdminServiceException("Renew default suitItem failed"); } // 删除相关默认礼物 @@ -152,7 +151,7 @@ public class NewLuckyBagPoolAdminService { LuckyBagPool defaultGift = null; if (! CollectionUtils.isEmpty(luckyBagPoolList)) { if(giftTypeStatus){ - throw new BusinessException("默认礼物已存在"); + throw new AdminServiceException("默认礼物已存在"); } defaultGift = getLuckyBagDefaultGift(luckyBagGiftId, LuckyBagGiftPoolItemTypeEnum.deviate_pool.getValue(), deviateRangeId); Integer defaultGiftId = defaultGift.getGiftId(); @@ -165,16 +164,16 @@ public class NewLuckyBagPoolAdminService { Gift refGift = giftService.getGiftById(giftId); if (refGift == null) { - throw new BusinessException("礼物不存在"); + throw new AdminServiceException("礼物不存在"); } if(! refGift.getGiftType().equals(Constant.GiftType.LUCKY_BAG_POOL)){ - throw new BusinessException("只允许添加福袋奖池礼物"); + throw new AdminServiceException("只允许添加福袋奖池礼物"); } if (defualtDeviateRang < 0 || defaultShowRate < 0) { log.warn("设置奖品概率过大,dis:{},giftId:{}", dis, giftId); - throw new BusinessException("设置奖品概率或展示概率过大"); + throw new AdminServiceException("设置奖品概率或展示概率过大"); } QueryWrapper wrapper = new QueryWrapper<>(); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/PrizePoolItemAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/PrizePoolItemAdminService.java index b35309ccf..7f8e42c47 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/PrizePoolItemAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/PrizePoolItemAdminService.java @@ -1,6 +1,5 @@ package com.accompany.admin.service.prize; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.service.base.BaseService; import com.accompany.business.constant.DeviateRangeTypeEnum; import com.accompany.business.constant.PrizePoolItemTypeEnum; @@ -10,6 +9,7 @@ import com.accompany.business.mybatismapper.PrizePoolItemMapper; import com.accompany.business.service.box.DeviateRangeService; import com.accompany.common.constant.Constant; import com.accompany.common.utils.BlankUtil; +import com.accompany.core.exception.AdminServiceException; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -57,13 +57,13 @@ public class PrizePoolItemAdminService extends BaseService { List defaultPrizePoolItems = list.stream().filter(prizePoolItem -> prizePoolItem.getItemType() == (byte)1).collect(Collectors.toList()); if(defaultPrizePoolItems.size() > 1){ - throw new BusinessException("奖池中存在多个默认奖品"); + throw new AdminServiceException("奖池中存在多个默认奖品"); } if(defaultPrizePoolItems.size() == 1 && itemType == (byte) 1){ - throw new BusinessException("奖池中已经存在默认奖品,请不要重复设置"); + throw new AdminServiceException("奖池中已经存在默认奖品,请不要重复设置"); } if (defaultPrizePoolItems.size() < 1 && itemType != 1) { - throw new BusinessException("请先设置默认奖品"); + throw new AdminServiceException("请先设置默认奖品"); } Map map = Maps.newHashMap(); if(list.size() > 0) { @@ -72,7 +72,7 @@ public class PrizePoolItemAdminService extends BaseService { // 前端页面关于prizePoolItemId会传-1,所以需要加多一个判断作处理 if (prizePoolItemId.equals(-1) && map.get(prizeId) != null) { logger.warn("creator:{} 插入奖品:{},但是发现奖品已经在该奖池,奖池类型:{}", creator, prizeId, poolType); - throw new BusinessException("同一个奖池,不能重复插入奖品"); + throw new AdminServiceException("同一个奖池,不能重复插入奖品"); } } @@ -85,13 +85,13 @@ public class PrizePoolItemAdminService extends BaseService { if (dis < 0) { //设置的奖品概率过大,默认奖品占比为负数 logger.warn("设置奖品真实概率过大,dis:{},prizeId:{}", dis, prizeId); - throw new BusinessException("PrizePoolItem occupationRatio is too large,prizeId=" + prizeId); + throw new AdminServiceException("PrizePoolItem occupationRatio is too large,prizeId=" + prizeId); } if(showDis < 0){ //设置的奖品概率过大,默认奖品占比为负数 logger.warn("设置奖品展示概率过大,showDis:{},prizeId:{}", showDis, prizeId); - throw new BusinessException("PrizePoolItem showRatio is too large,prizeId=" + prizeId); + throw new AdminServiceException("PrizePoolItem showRatio is too large,prizeId=" + prizeId); } if (prizePoolItemId == null || prizePoolItemId <= 0) { @@ -121,7 +121,7 @@ public class PrizePoolItemAdminService extends BaseService { public void delPrizePoolItem(Integer id, Byte poolType){ PrizePoolItem prizePoolItem = prizePoolItemMapper.selectById(id); if (prizePoolItem == null) { - throw new BusinessException("PrizePoolItem is not exist"); + throw new AdminServiceException("PrizePoolItem is not exist"); } QueryWrapper wrapper = new QueryWrapper<>(); wrapper.lambda().eq(PrizePoolItem::getPrizePoolType,poolType) @@ -129,7 +129,7 @@ public class PrizePoolItemAdminService extends BaseService { List list = prizePoolItemMapper.selectList(wrapper); if (CollectionUtils.isEmpty(list)) { - throw new BusinessException("默认奖品不存在"); + throw new AdminServiceException("默认奖品不存在"); } PrizePoolItem defaultPrizePoolItem = list.get(0); Integer occupationRatio = prizePoolItem.getOccupationRatio(); @@ -142,7 +142,7 @@ public class PrizePoolItemAdminService extends BaseService { defaultPrizePoolItem.setPrizeNumVersion(defaultVersion + 1); int result = prizePoolItemMapper.updateById(defaultPrizePoolItem); if (result < 0) { - throw new BusinessException("更新默认奖品概率失败"); + throw new AdminServiceException("更新默认奖品概率失败"); } prizePoolItemMapper.deleteById(id); } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java index 155a89559..b15bf8f97 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/prize/UserCardsAdminService.java @@ -1,6 +1,5 @@ package com.accompany.admin.service.prize; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.mapper.CardEliminateRecordMapper; import com.accompany.admin.mapper.CardExchangeRecordMapper; import com.accompany.admin.mapper.UserBackpackAdminExpand; @@ -206,7 +205,7 @@ public class UserCardsAdminService extends BaseService { Users users = usersService.getUsersByUid(uid); if (users == null){ - throw new BusinessException("用户不存在"); + throw new AdminServiceException("用户不存在"); } //只有赠送礼物时,才能选数量 PS 开箱子的钥匙也可以加数量(被迫的需求) @@ -216,7 +215,7 @@ public class UserCardsAdminService extends BaseService { try{ res = lock.tryLock(5, TimeUnit.SECONDS); if (!res) { - throw new BusinessException("当前有其他人在操作,请稍后"); + throw new AdminServiceException("当前有其他人在操作,请稍后"); } reduceCardStock(uid, eliminateCardMap); @@ -241,7 +240,7 @@ public class UserCardsAdminService extends BaseService { try { res = lock.tryLock(5, TimeUnit.SECONDS); if (!res) { - throw new BusinessException("当前有其他人在操作,请稍后"); + throw new AdminServiceException("当前有其他人在操作,请稍后"); } reduceCardStock(uid, eliminateCardMap); @@ -264,17 +263,17 @@ public class UserCardsAdminService extends BaseService { for (Integer eliminateCardId : eliminateCardIds){ Integer eliminateCount = eliminateCardMap.get(eliminateCardId); if (eliminateCount == null || eliminateCount <= 0){ - throw new BusinessException("要扣除的卡片数量不能小于0"); + throw new AdminServiceException("要扣除的卡片数量不能小于0"); } if (!userCardsMap.containsKey(eliminateCardId)){ - throw new BusinessException("卡片不存在"); + throw new AdminServiceException("卡片不存在"); } UserBackpack userBackpack = userCardsMap.get(eliminateCardId); if (userBackpack.getGiftType().byteValue() != Constant.GiftType.CARDS){ - throw new BusinessException("只有卡片才允许消除"); + throw new AdminServiceException("只有卡片才允许消除"); } if (eliminateCount > userBackpack.getCount()){ - throw new BusinessException("卡片数量不够"); + throw new AdminServiceException("卡片数量不够"); } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/recommend/RecommendAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/recommend/RecommendAdminService.java deleted file mode 100644 index 03695a87a..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/recommend/RecommendAdminService.java +++ /dev/null @@ -1,449 +0,0 @@ -package com.accompany.admin.service.recommend; - -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.util.PropertyUtil; -import com.accompany.admin.vo.RecommendRecordAdminVo; -import com.accompany.core.base.BeanMapper; -import com.accompany.core.exception.ServiceException; -import com.accompany.business.model.*; -import com.accompany.business.mybatismapper.RecommendCardMapper; -import com.accompany.business.mybatismapper.RecommendOccupyMapper; -import com.accompany.business.mybatismapper.RecommendRecordMapper; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.recommend.RecommendService; -import com.accompany.business.service.room.RoomService; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.business.service.user.UsersService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.RecommendConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.commons.lang3.time.FastDateFormat; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.*; -import java.util.concurrent.TimeUnit; - -@Service -public class RecommendAdminService { - - @Autowired - private RecommendRecordMapper recommendRecordMapper; - @Autowired - private RecommendOccupyMapper recommendOccupyMapper; - @Autowired - private RecommendCardMapper recommendCardMapper; - @Autowired - private RecommendService recommendService; - @Autowired - private RoomService roomService; - @Autowired - private SendSysMsgService sendMessageService; - @Autowired - private UsersService usersService; - @Autowired - private UsersBaseService usersBaseService; - - /** - * 新增推荐卡 - * - * @param cardName - * @param uid - * @param validStartTime - * @param validEndTime - * @param createdBy - * @param period - */ - public int insertRecommend(String cardName, Long uid, Date validStartTime, Date validEndTime, String createdBy, Integer period) { - RecommendCard card = new RecommendCard(); - card.setUid(uid); - card.setCardName(cardName); - card.setCreatedBy(createdBy); - card.setCreateTime(new Date()); - card.setStatus(RecommendConstant.CardStatus.NOT_USED); - card.setUpdateTime(new Date()); - card.setValidStartTime(validStartTime); - card.setValidEndTime(validEndTime); - card.setPeriod((int) TimeUnit.HOURS.toSeconds(period)); - return recommendCardMapper.insert(card); - } - - public void official(String cardName, Long uid, Date validStartTime, Date validEndTime, Integer cardNum, String createdBy, Integer period, String notifyMsg) { - final Date validStart = validStartTime; - final Date validEnd = DateUtils.addSeconds(validEndTime, -1); - int ret = 0; - for (int i = 0; i < cardNum; i++) { - ret += insertRecommend(cardName, uid, validStart, validEnd, createdBy, period); - } - if (ret > 0) { - sendOfficialRecommendMsg(uid, notifyMsg); - } - } - - /** - * 批量赠送推荐卡 - * - * @param erbanNos - * @param cardName - * @param validStartTime - * @param validEndTime - * @param cardNum - * @param createdBy - * @param period - * @param notifyMsg - */ - public Map batchOfficial(List erbanNos, String cardName, Date validStartTime, Date validEndTime, Integer cardNum, String createdBy, Integer period, String notifyMsg) { - Map retMap = new HashMap(); - Integer failCount = 0;//增送失败个数 - List failErbanNo = new ArrayList(); - List failReason = new ArrayList(); - for (String erbanNo : erbanNos) { - try { - Users user = usersBaseService.getUsersByErBanNo(Long.parseLong(erbanNo)); - if (user == null) { - throw new BusinessException("未找到该用户"); - } - official(cardName, user.getUid(), validStartTime, validEndTime, cardNum, createdBy, period, notifyMsg); - } catch (Exception e) { - failCount++; - failErbanNo.add(erbanNo); - failReason.add(e.getMessage()); - continue; - } - } - retMap.put("failCount", failCount); - retMap.put("failErbanNo", failErbanNo); - retMap.put("failReason", failReason); - return retMap; - } - - /** - * 发送赠送推荐卡的消息 - * - * @param receiverUid - * @param message - */ - public void sendOfficialRecommendMsg(Long receiverUid, String message) { - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.CUSTOM_MESS_HEAD_SECRETARY); - attach.setSecond(Constant.DefineProtocol.CUSTOM_MESS_SUB_SECRETARY_INTRACTION); - - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title", "[推荐卡消息]"); - jsonObject.put("msg", message); - jsonObject.put("routerType", Constant.SecretarySkipType.RECOMMEND_CARD); - // 0跳转我的推荐卡(routerValue是对应的推荐卡选项卡的状态) - jsonObject.put("routerValue", RecommendConstant.CardStatus.NOT_USED); - attach.setData(jsonObject); - - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE); - neteaseSendMsgParam.setFrom(PropertyUtil.getProperty("SECRETARY_UID")); - neteaseSendMsgParam.setOpe(0); - neteaseSendMsgParam.setTo(receiverUid.toString()); - neteaseSendMsgParam.setAttach(attach); - this.sendMessageService.sendMsg(neteaseSendMsgParam); - } - - /** - * 发送推荐位的消息 - * - * @param receiverUid - * @param message - */ - private void sendApplyRecommendMsg(Long receiverUid, String message) { - NeteaseSendMsgParam msg = new NeteaseSendMsgParam(); - msg.setOpe(0); - msg.setType(0); - msg.setFrom(PropertyUtil.getProperty("SECRETARY_UID")); - msg.setTo(receiverUid.toString()); - msg.setBody(message); - this.sendMessageService.sendMsg(msg); - } - - public void applyByAdmin(Long roomUid, Date useStartTime, Date useEndTime, Integer seqNo, String createdBy, String notifyMsg) { - FastDateFormat format = FastDateFormat.getInstance(DateTimeUtil.DEFAULT_DATETIME_PATTERN); - Integer maxStock = recommendService.getMaxStock(); - - Map occupyStockMap = recommendService.getStockBetween(RedisKey.recommend_occupy, useStartTime, useEndTime); - Map usedStockMap = recommendService.getStockBetween(RedisKey.recommend_stock, useStartTime, useEndTime); - Set> occupyEntries = occupyStockMap.entrySet(); - for (Map.Entry entry : occupyEntries) { - int usedStock = usedStockMap.get(entry.getKey()); - int occupyStock = occupyStockMap.get(entry.getKey()); - // 库存判断(如果占用库存和可使用库存都没有了) - if (maxStock - usedStock <= 0 && occupyStock <= 0) { - String startTime = format.format(entry.getKey()); - String endTime = format.format(DateUtils.addHours(entry.getKey(), 1)); - throw new BusinessException(String.format("日期 '%s - %s' 的库存不足", startTime, endTime)); - } - } - - // 房间校验 - Room room = roomService.getRoomByDB(roomUid); - if (room == null) { - throw new ServiceException(BusiStatus.ROOMNOTEXIST); - } - - // 判断是否已经申请了推荐位 - int count = recommendService.countRecordBetweenTime(roomUid, RecommendConstant.RecordStatus.ALREADY_BOOK, useStartTime, useEndTime); - if (count > 0) { - throw new BusinessException(BusiStatus.RECOMMEND_ALREADY_APPLY.getReasonPhrase()); - } - - // 执行申请推荐位逻辑 - int ret = recommendService.doRecommend(roomUid, null, useStartTime, useEndTime, seqNo, createdBy); - if (ret > 0) { - //扣除库存 - recommendService.doBetweenForHour(useStartTime, useEndTime, (start) -> { - int canUseStock = maxStock - (usedStockMap.get(start) + occupyStockMap.get(start)); - if (canUseStock > 0) { - // 新增已使用库存 - recommendService.doStock(RedisKey.recommend_stock, start, 1); - } else if (occupyStockMap.get(start) > 0) { - // 扣除占用库存 - recommendService.doStock(RedisKey.recommend_occupy, start, -1); - - // 新增已使用库存 - recommendService.doStock(RedisKey.recommend_stock, start, 1); - } else { - // 库存 - throw new BusinessException(BusiStatus.RECOMMEND_STOCK_NOT_ENOUGH.getReasonPhrase()); - } - }); - } - //如果是当前整点时间段内,则重新加载推荐房 - Date startDate = DateUtils.truncate(new Date(), Calendar.HOUR); - Date endDate = DateUtils.addHours(startDate, 1); - if (useStartTime.getTime() >= startDate.getTime() && useStartTime.getTime() < endDate.getTime()) { - recommendService.reloadRecomRoom(); - } - // 发送申请推荐位通知 - if (StringUtils.isNotEmpty(notifyMsg)) { - sendApplyRecommendMsg(roomUid, notifyMsg); - } - } - - /** - * 推荐位占用房间 - * - * @param occupyNum - * @param useStartTime - * @param useEndTime - * @return - */ - public int occupy(Integer occupyNum, Date useStartTime, Date useEndTime, String createdBy) { - Integer maxStock = recommendService.getMaxStock(); - FastDateFormat format = FastDateFormat.getInstance(DateTimeUtil.DEFAULT_DATETIME_PATTERN); - Map occupyStockMap = recommendService.getStockBetween(RedisKey.recommend_occupy, useStartTime, useEndTime); - Map usedStockMap = recommendService.getStockBetween(RedisKey.recommend_stock, useStartTime, useEndTime); - Set> usedEntries = usedStockMap.entrySet(); - for (Map.Entry entry : usedEntries) { - int usedStock = usedStockMap.get(entry.getKey()); - int occupyStock = occupyStockMap.get(entry.getKey()); - if ((maxStock - (usedStock + occupyStock + occupyNum)) < 0) { - String startTime = format.format(entry.getKey()); - String endTime = format.format(DateUtils.addHours(entry.getKey(), 1)); - throw new BusinessException(String.format("日期 '%s - %s' 的库存不足", startTime, endTime)); - } - } - - Date now = new Date(); - RecommendOccupy occupy = new RecommendOccupy(); - occupy.setStartTime(useStartTime); - occupy.setEndTime(useEndTime); - occupy.setOccupyNum(occupyNum); - occupy.setStatus(RecommendConstant.OccupyStatus.ALREADY_OCCUPY); - occupy.setCreatedBy(createdBy); - occupy.setCreateTime(now); - occupy.setUpdateTime(now); - if (useStartTime.compareTo(now) < 0 && useEndTime.compareTo(now) > 0) { - throw new BusinessException("占用时间有误"); - } - - int ret = recommendOccupyMapper.insert(occupy); - if (ret > 0) { - // 对指定时间范围内进行新增占用库存 - recommendService.doStockBetweenHour(RedisKey.recommend_occupy, occupy.getStartTime(), occupy.getEndTime(), occupy.getOccupyNum()); - } - - return ret; - } - - /** - * 下架指定推荐位 - * - * @param recordId - * @return - */ - public int obtained(Long recordId) { - RecommendRecord record = recommendRecordMapper.selectByPrimaryKey(recordId); - // 判断是否未上架状态 - Boolean isAreadyBook = record.getStatus() == RecommendConstant.RecordStatus.ALREADY_BOOK; - - record.setStatus(RecommendConstant.RecordStatus.ALREADY_OBTAINED); - int ret = recommendRecordMapper.updateByPrimaryKey(record); - if (ret > 0) { - if (isAreadyBook) { - recommendService.doStockBetweenHour(RedisKey.recommend_stock, record.getStartTime(), record.getEndTime(), -1); - } - - // 重新加载推荐房 - recommendService.reloadRecomRoom(); - } - return ret; - } - - /** - * 自增指定推荐位排序 - * - * @param recordId - * @return - */ - public int topping(Long recordId) { - RecommendRecord record = recommendRecordMapper.selectByPrimaryKey(recordId); - record.setSeqNo(record.getSeqNo() + 1); - int ret = recommendRecordMapper.updateByPrimaryKey(record); - if (ret > 0) { - // 重新加载推荐房 - recommendService.reloadRecomRoom(); - } - return ret; - } - - /** - * 推荐位取消占用 - * - * @param occupyId - * @return - */ - public int cancelOccupy(Long occupyId) { - RecommendOccupy occupy = recommendOccupyMapper.selectByPrimaryKey(occupyId); - if (occupy == null) { - throw new BusinessException("未找到该占位记录"); - } - if (new Date().compareTo(occupy.getStartTime()) > 0) { - throw new BusinessException("该占位已使用中.释放失败"); - } - // 判断占用库存是否足够被释放 - FastDateFormat format = FastDateFormat.getInstance(DateTimeUtil.DEFAULT_DATETIME_PATTERN); - Map occupyStockMap = recommendService.getStockBetween(RedisKey.recommend_occupy, occupy.getStartTime(), occupy.getEndTime()); - Set> occupyEntries = occupyStockMap.entrySet(); - for (Map.Entry entry : occupyEntries) { - int occupyStock = occupyStockMap.get(entry.getKey()); - // 库存判断(如果占用库存和可使用库存都没有了) - if ((occupyStock - occupy.getOccupyNum()) < 0) { - String startTime = format.format(entry.getKey()); - String endTime = format.format(DateUtils.addHours(entry.getKey(), 1)); - throw new BusinessException(String.format("占用库存释放失败.日期 '%s - %s' 的占用库存已被使用", startTime, endTime)); - } - } - - occupy.setStatus(RecommendConstant.OccupyStatus.CANCEL_OCCUPY); - int ret = recommendOccupyMapper.updateByPrimaryKey(occupy); - if (ret > 0) { - // 对指定时间范围内进行扣减占用库存 - recommendService.doStockBetweenHour(RedisKey.recommend_occupy, occupy.getStartTime(), occupy.getEndTime(), occupy.getOccupyNum() * -1); - } - - return ret; - } - - /** - * 查询推荐位记录 - * - * @param roomUid - * @param status - * @param startTime - * @param endTime - * @param page - * @param pageSize - * @return - */ - public PageInfo recordList(Long roomUid, Byte status, Date startTime, Date endTime, int page, int pageSize) { - RecommendRecordExample example = new RecommendRecordExample(); - RecommendRecordExample.Criteria criteria = example.createCriteria(); - if (roomUid != null) { - criteria.andUidEqualTo(roomUid); - } - if (status != null && status != 0) { - criteria.andStatusEqualTo(status); - } - if (startTime != null) { - criteria.andStartTimeLessThanOrEqualTo(startTime); - } - if (endTime != null) { - criteria.andEndTimeGreaterThanOrEqualTo(endTime); - } - example.setOrderByClause("seq_no,create_time desc"); - PageHelper.startPage(page, pageSize); - - return new PageInfo<>(recommendRecordMapper.selectByExample(example)); - } - - /** - * 获取指定推荐位记录 - * - * @param id - * @return - */ - public RecommendRecordAdminVo get(Long id) { - RecommendRecord record = recommendRecordMapper.selectByPrimaryKey(id); - if (record != null) { - RecommendRecordAdminVo recommendRecordAdminVo = BeanMapper.map(record, RecommendRecordAdminVo.class); - Users user = usersService.getUsersByUid(recommendRecordAdminVo.getUid()); - if (user != null) { - recommendRecordAdminVo.setErbanNo(user.getErbanNo()); - } - return recommendRecordAdminVo; - } - return null; - } - - public List convertToVo(final List recordList) { - List voList = BeanMapper.mapList(recordList, RecommendRecord.class, RecommendRecordAdminVo.class); - String[] uids = voList.stream().map(vo -> vo.getUid().toString()).toArray(String[]::new); - Map usersMap = usersService.getUsersMapBatch(uids); - for (RecommendRecordAdminVo vo : voList) { - Users user = usersMap.get(vo.getUid()); - if (user != null) { - vo.setErbanNo(user.getErbanNo()); - } - } - return voList; - } - - /** - * 查看推荐位占用记录 - * - * @param startTime - * @param endTime - * @param page - * @param pageSize - * @return - */ - public PageInfo occupyList(Date startTime, Date endTime, int page, int pageSize) { - RecommendOccupyExample example = new RecommendOccupyExample(); - RecommendOccupyExample.Criteria criteria = example.createCriteria(); - if (startTime != null) { - criteria.andStartTimeLessThanOrEqualTo(startTime); - } - if (endTime != null) { - criteria.andEndTimeGreaterThanOrEqualTo(endTime); - } - example.setOrderByClause("create_time"); - PageHelper.startPage(page, pageSize); - return new PageInfo<>(recommendOccupyMapper.selectByExample(example)); - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendModuleAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendModuleAdminService.java deleted file mode 100644 index 2a3c49ea0..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendModuleAdminService.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.accompany.admin.service.room; - -import com.accompany.admin.mapper.RecommendModuleExpand; -import com.accompany.admin.mapper.TopicRoomExpand; -import com.accompany.admin.model.RecommendModuleQuestParam; -import com.accompany.admin.service.base.BaseService; -import com.accompany.business.model.RecommendModule; -import com.accompany.business.model.RecommendModuleExample; -import com.accompany.business.mybatismapper.RecommendModuleMapper; -import com.accompany.business.mybatismapper.TopicRoomMapper; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.util.StringUtils; -import com.accompany.business.vo.recommend.ModuleRoomMapVo; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.gson.reflect.TypeToken; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -@Service -public class RecommendModuleAdminService extends BaseService { - - @Autowired - private RecommendModuleExpand recommendModuleExpand; - @Autowired - private RecommendModuleMapper recommendModuleMapper; - @Autowired - private TopicRoomMapper topicRoomMapper; - @Autowired - private TopicRoomExpand topicRoomExpand; - @Autowired - private JedisService jedisService; - - public PageInfo getRecommendModuleList(Integer pageNumber, Integer pageSize, String title, Integer status, Date startTime, Date endTime) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(getRecommendModuleList(title, status, startTime, endTime)); - } - - public List getRecommendModuleList(String title, Integer status, Date startTime, Date endTime) { - List list = this.recommendModuleExpand.listRecommendModules(startTime, endTime, title, status); - return list; - } - - public List getRecommendModuleTopics() { - RecommendModuleExample example = new RecommendModuleExample(); - example.createCriteria().andTypeEqualTo((byte) Constant.HomeOption.RECOMMEND_MODULE_TOPIC).andDeleteFlagEqualTo(false); - List list = this.recommendModuleMapper.selectByExample(example); - return list; - } - - @Transactional(rollbackFor = Exception.class) - public BusiResult editRecommendModule(RecommendModuleQuestParam param) { - if (param.getId() != null) { - RecommendModule module = recommendModuleMapper.selectByPrimaryKey(param.getId()); - String oldModuleName = module.getName(); - - updateModuleFiledValue(module,param); - - module.setUpdateTime(new Date()); - recommendModuleMapper.updateByPrimaryKeySelective(module); - saveRecommendModuleCache(module); - - if(StringUtils.isNotEmpty(param.getTitle()) && !oldModuleName.equals(param.getTitle())){ - topicRoomExpand.updateTopicRoomNameByModuleId(param.getTitle(),param.getId()); - } - return new BusiResult(BusiStatus.SUCCESS, module); - } else { - RecommendModule module = new RecommendModule(); - updateModuleFiledValue(module,param); - module.setType((byte) Constant.HomeOption.RECOMMEND_MODULE_TOPIC); - module.setCreateTime(new Date()); - module.setDeleteFlag(false); - recommendModuleMapper.insertSelective(module); - saveRecommendModuleCache(module); - return new BusiResult(BusiStatus.SUCCESS, module); - } - } - - private RecommendModule updateModuleFiledValue(final RecommendModule module,final RecommendModuleQuestParam param){ - if (param.getStatus() != null) { - module.setStatus(param.getStatus().intValue() == 0 ? false : true); - } - if (StringUtils.isNotEmpty(param.getTitle())) { - module.setName(param.getTitle()); - } - if (param.getSeqNo() != null) { - module.setSeqNo(param.getSeqNo().intValue()); - } - if (param.getBigNum() != null) { - module.setBigPictureNum(param.getBigNum()); - } - if (param.getListNum() != null) { - module.setListNum(param.getListNum()); - } - if (param.getModuleUse() != null) { - module.setModuleUse(param.getModuleUse().byteValue()); - } - if (param.getShowType() != null) { - module.setShowType(param.getShowType()); - } - return module; - } - - private void saveRecommendModuleCache(RecommendModule module) { - if (module == null) { - return; - } - if(!module.getType().equals(Constant.RecommendModuleType.TYPE_TOPIC)){ - jedisService.hwrite(RedisKey.recommend_star_popular.getKey(), module.getType().toString(),gson.toJson(module)); - }else { - String mapVoJson = jedisService.hget(RedisKey.recommend_topic_room_map.getKey(), module.getId().toString()); - ModuleRoomMapVo mapVo = null; - if (StringUtils.isEmpty(mapVoJson)) { - mapVo = new ModuleRoomMapVo(); - mapVo.setRooms(null); - } else { - mapVo = gson.fromJson(mapVoJson, new TypeToken() {}.getType()); - } - if (module.getShowType() == 2){ - module.setType((byte)Constant.HomeOption.RECOMMEND_MODULE_TOPIC_DOUBLE); - } - mapVo.setModule(module); - mapVoJson = gson.toJson(mapVo); - jedisService.hwrite(RedisKey.recommend_topic_room_map.getKey(), module.getId().toString(), mapVoJson); - } - } - - @Transactional(rollbackFor = Exception.class) - public void delModule(List ids) { - if (ids.size() == 1) { - RecommendModule module = recommendModuleMapper.selectByPrimaryKey(ids.get(0).longValue()); - if(module.getType().equals(Constant.RecommendModuleType.TYPE_TOPIC)) { - module.setDeleteFlag(true); - jedisService.hdel(RedisKey.recommend_topic_room_map.getKey(), module.getId().toString()); - recommendModuleMapper.updateByPrimaryKeySelective(module); - topicRoomExpand.delTopicRoomByModuleId(module.getId()); - } - } else { - List moduleIds = ids.stream().map(s -> s.longValue()).collect(Collectors.toList()); - jedisService.hdel(RedisKey.recommend_topic_room_map.getKey(),ids.stream().map(id->id.toString()).collect(Collectors.joining(","))); - recommendModuleExpand.delRecommendModuleByids(moduleIds); - topicRoomExpand.delTopicRoomByModuleIds(moduleIds); - } - - } - - /** - * 根据记录构建excel数据 - * - * @param modules - * @return - */ - public List buildExcelData(List modules) { - List excelRows = new ArrayList<>(modules.size()); - SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - modules.forEach((module) -> { - List excelData = new ArrayList<>(); - String typeStr = null; - switch (module.getType()) { - case Constant.HomeOption.RECOMMEND_MODULE_STAR: - typeStr = "墙裂推荐"; - break; - case Constant.HomeOption.RECOMMEND_MODULE_POPULAR: - typeStr = "热门推荐"; - break; - case Constant.HomeOption.RECOMMEND_MODULE_TOPIC: - typeStr = "话题"; - break; - } - excelData.add(module.getId()); - excelData.add(typeStr); - excelData.add(module.getName()); - excelData.add(module.getBigPictureNum() == null ? "-":module.getBigPictureNum()); - excelData.add(module.getListNum() == null ? "-":module.getListNum()); - excelData.add(module.getStatus() == true ? "展示":"隐藏"); - excelData.add(module.getSeqNo()); - excelData.add(dateFormat.format(module.getCreateTime())); - excelRows.add(excelData); - }); - return excelRows; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendRoomAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendRoomAdminService.java deleted file mode 100644 index 554272e2e..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RecommendRoomAdminService.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.accompany.admin.service.room; - -import com.accompany.admin.mapper.RecommendRoomAdminExpand; -import com.accompany.admin.vo.RecommendRoomVo; -import com.accompany.business.model.*; -import com.accompany.business.mybatismapper.GiftSendRecordMapperExpand; -import com.accompany.business.mybatismapper.RecommendRoomMapper; -import com.accompany.business.mybatismapper.RecommendRoomRecordMapper; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.base.BaseService; -import com.accompany.business.service.room.RoomService; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.business.service.user.UsersService; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Lists; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.*; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 11:47 - */ -@Service -public class RecommendRoomAdminService extends BaseService { - - public static final Logger logger = LoggerFactory.getLogger(RecommendRoomAdminService.class); - - public static final Byte RECOMMEND_STATUS_ON = 1; - public static final Byte RECOMMEND_STATUS_OFF = 0; - - @Autowired - private RecommendRoomMapper recommendRoomMapper; - - @Autowired - private RecommendRoomAdminExpand recommendRoomAdminExpand; - - @Autowired - private RecommendRoomRecordMapper recommendRoomRecordMapper; - - @Autowired - private UsersService usersService; - - - @Autowired - private UsersBaseService usersBaseService; - - @Autowired - private RoomService roomService; - - @Autowired - private GiftSendRecordMapperExpand giftSendRecordMapperExpand; - - - public PageInfo listRecommendRooms(Date beginTime, Date endTime, Long roomErbanNo, Byte roomType, Integer pageNumber, Integer pageSize) { - Long roomUid = null; - Users roomUsers = usersBaseService.getUsersByErBanNo(roomErbanNo); - if (roomUsers != null) { - roomUid = roomUsers.getUid(); - } - - endTime = endTime == null ? Calendar.getInstance().getTime() : endTime; -// Integer index = (page - 1) * pageSize; - PageHelper.startPage(pageNumber, pageSize); - List list = this.recommendRoomAdminExpand.listRecommendRooms(beginTime, endTime, roomUid, roomType); - - for (RecommendRoomVo recommendRoomVo : list) { - Users users = usersService.getUsersByUid(recommendRoomVo.getRoomUid()); - Long erbanNo = users.getErbanNo(); - recommendRoomVo.setErbanNo(erbanNo); - } - - return new PageInfo<>(list); - } - - public void saveRecommendRoom(Long id, Long roomErbanNo, Byte roomType, Integer seq, Integer weight, Byte recommendStatus) { - Users users = usersBaseService.getUsersByErBanNo(roomErbanNo); - Long roomUid = users.getUid(); - RecommendRoom room = this.buildRecommendRoom(id, roomUid, roomType, seq, weight, recommendStatus); - if (id == null || id <= 0) { - room.setCreateTime(Calendar.getInstance().getTime()); - this.recommendRoomMapper.insertSelective(room); - } else { - this.recommendRoomMapper.updateByPrimaryKeySelective(room); - } - - this.refreshAllRecommendRoomCache(roomType); - } - - private RecommendRoom buildRecommendRoom(Long id, Long roomUid, Byte roomType, Integer seq, Integer weight, Byte recommendStatus) { - RecommendRoom room = new RecommendRoom(); - room.setId(id); - room.setRoomUid(roomUid); - room.setRoomType(roomType); - room.setSeq(seq); - room.setWeight(weight); - room.setRecommendStatus(recommendStatus); - room.setUpdateTime(Calendar.getInstance().getTime()); - - return room; - } - - private void refreshAllRecommendRoomCache(Byte roomType) { - String gender = roomType.toString(); - this.jedisService.del(RedisKey.newcomer_recommend_room.getKey(gender)); - this.jedisService.del(RedisKey.newcomer_recommend_room_index.getKey(gender)); - - List rooms = this.listAllRecommendRoomsBySeq(RECOMMEND_STATUS_ON, roomType); - for (RecommendRoom room : rooms) { - for (int i = 0; i < room.getWeight(); i++) { - this.jedisService.rpush(RedisKey.newcomer_recommend_room.getKey(gender), room.getRoomUid().toString()); - } - } - } - - private List listAllRecommendRoomsBySeq(Byte recommendStatus, Byte gender) { - RecommendRoomExample example = new RecommendRoomExample(); - example.createCriteria().andRecommendStatusEqualTo(RECOMMEND_STATUS_ON).andRoomTypeEqualTo(gender); - example.setOrderByClause("seq desc"); - return this.recommendRoomMapper.selectByExample(example); - } - - /** - * 获取房间导流统计列表 - * @param startDate - * @param endDate - * @param checkType 搜索类型,1为根据房主平台号,2为根据房间类型 - * @param erbanNo - * @param roomType - * @return - */ - public Map queryStatisList(Date startDate,Date endDate,Integer checkType,Long erbanNo,Byte roomType,Integer pageNum,Integer pageSize){ - Map map = new HashMap<>(); - if(checkType == 1){ - // 根据房主平台号寻找 - map = this.queryStatisListByErbanNo(erbanNo,startDate,endDate,pageNum,pageSize); - }else{ - map = this.queryStatisListByRoomType(roomType,startDate,endDate,pageNum,pageSize); - } - return map; - } - - private Map queryStatisListByErbanNo(Long erbanNo,Date startDate,Date endDate,Integer pageNum,Integer pageSize){ - Map map = new HashMap<>(); - Users users = usersBaseService.getUsersByErBanNo(erbanNo); - Long roomUid = users.getUid(); - Room room = roomService.getRoomByUid(roomUid); - RecommendRoom recommendRoom = this.getRecommendRoomByUid(roomUid); - List list = Lists.newArrayList(); - if(startDate == null){ - // 为空时根据创建时间 - startDate = recommendRoom.getCreateTime(); - } - if(endDate == null){ - // 为空时根据当前时间 - endDate = new Date(); - } - List dateList = DateTimeUtil.getBetweenDates(startDate,endDate,false); - // 通过截取的日期区间进行分页功能 - int startIndex = (pageNum - 1) * pageSize; - int endIndex = (startIndex + pageSize > dateList.size())? (dateList.size()):(startIndex + pageSize); - for(int i = startIndex; i < endIndex;i++){ - // 获取每一天的流水 - Date date = dateList.get(i); - Date startTime = DateTimeUtil.getBeginTimeOfDay(date); - Date endTime = DateTimeUtil.getEndTimeOfDay(date); - RoomOptmizeStatistic roomOptmizeStatistic = this.querySingleStatis(roomUid,startTime,endTime); - // 区别对待,此处填的是开始日期 - roomOptmizeStatistic.setCreateDate(startDate); - roomOptmizeStatistic.setErbanNo(erbanNo); - roomOptmizeStatistic.setRoomName(room.getTitle()); - roomOptmizeStatistic.setRoomType(recommendRoom.getRoomType()); - list.add(roomOptmizeStatistic); - } - map.put("total",dateList.size()); - map.put("list",list); - return map; - } - - private Map queryStatisListByRoomType(Byte roomType,Date startDate,Date endDate,Integer pageNum,Integer pageSize){ - Map map = new HashMap<>(); - List list = Lists.newArrayList(); - // 根据房间类型 - RecommendRoomExample example = new RecommendRoomExample(); - RecommendRoomExample.Criteria criteria = example.createCriteria(); - if(!roomType.equals((byte)0)){ - criteria.andRoomTypeEqualTo(roomType); - } - // 批量获取房间列表 - PageHelper.startPage(pageNum,pageSize); - List roomList = recommendRoomMapper.selectByExample(example); - PageInfo pageInfo = new PageInfo(roomList); - map.put("total",pageInfo.getTotal()); - if(endDate == null){ - endDate = new Date(); - } - for(RecommendRoom recommendRoom:roomList){ - RoomOptmizeStatistic roomOptmizeStatistic = querySingleStatis(recommendRoom.getRoomUid(),startDate,endDate); - Room room = roomService.getRoomByUid(recommendRoom.getRoomUid()); - Users users = usersService.getUsersByUid(recommendRoom.getRoomUid()); - roomOptmizeStatistic.setRoomName(room.getTitle()); - roomOptmizeStatistic.setCreateDate(startDate); - roomOptmizeStatistic.setErbanNo(users.getErbanNo()); - roomOptmizeStatistic.setRoomType(recommendRoom.getRoomType()); - list.add(roomOptmizeStatistic); - } - map.put("list",list); - return map; - } - - /** - * @param roomUid - * @param startDate - * @param endDate - * @return - */ - private RoomOptmizeStatistic querySingleStatis(Long roomUid,Date startDate,Date endDate){ - List uidList = this.queryOptmizeUserUidList(startDate,endDate,roomUid); - Map params = new HashMap<>(); - RoomOptmizeStatistic optmizeStatistic = new RoomOptmizeStatistic(); - params.put("uids",uidList); - params.put("startTime",startDate); - params.put("endTime",endDate); - params.put("roomUid",roomUid); - if(uidList.size() > 0){ - optmizeStatistic = giftSendRecordMapperExpand.queryRoomConsumeStatistic(params); - if(optmizeStatistic.getPayAmount() == null){ - optmizeStatistic.setPayAmount(0L); - } - }else{ - optmizeStatistic.setPayUserNum(0); - optmizeStatistic.setPayAmount(0L); - optmizeStatistic.setPayCountTime(0); - } - optmizeStatistic.setAddUserNum(uidList.size()); - return optmizeStatistic; - } - - - /** - * 获取某天一天内的房间导流记录 - * @param startDate - * @param endDate - * @param roomUid - * @return - */ - private List queryOptimizeUserList(Date startDate,Date endDate,Long roomUid){ - RecommendRoomRecordExample example = new RecommendRoomRecordExample(); - example.setOrderByClause("create_time desc"); - RecommendRoomRecordExample.Criteria criteria = example.createCriteria(); - criteria.andRoomUidEqualTo(roomUid).andCreateTimeBetween(startDate,endDate); - List list = recommendRoomRecordMapper.selectByExample(example); - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - return list; - } - - private RecommendRoom getRecommendRoomByUid(Long uid){ - RecommendRoomExample example = new RecommendRoomExample(); - RecommendRoomExample.Criteria criteria = example.createCriteria(); - criteria.andRoomUidEqualTo(uid); - List list = recommendRoomMapper.selectByExample(example); - if(CollectionUtils.isEmpty(list)){ - return null; - } - return list.get(0); - } - - private List queryOptmizeUserUidList(Date startDate,Date endDate,Long roomUid){ - List recordList = this.queryOptimizeUserList(startDate,endDate,roomUid); - List uids = Lists.newArrayList(); - for(RecommendRoomRecord recommendRoomRecord:recordList){ - uids.add(recommendRoomRecord.getUid()); - } - return uids; - } - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomAdminService.java index a197ff3dc..e73d3b3d7 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomAdminService.java @@ -2,7 +2,6 @@ package com.accompany.admin.service.room; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.StrUtil; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.service.base.BaseService; import com.accompany.admin.vo.RoomHomeHideListVo; import com.accompany.admin.vo.RoomUnchangeVo; @@ -12,6 +11,7 @@ import com.accompany.business.service.user.UsersService; import com.accompany.business.vo.RoomVo; import com.accompany.common.constant.AppEnum; import com.accompany.common.constant.Constant; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Room; import com.accompany.core.model.Users; @@ -42,11 +42,11 @@ public class RoomAdminService extends BaseService { public void saveRoomToHide(Long erbanNo, Byte hideLocation,String app) throws Exception { Users users = usersBaseService.getUsersByErBanNo(erbanNo); if(users == null) { - throw new BusinessException("未找到该用户"); + throw new AdminServiceException("未找到该用户"); } Room room = roomService.getRoomByDB(users.getUid()); if(room == null) { - throw new BusinessException("未找到该房间"); + throw new AdminServiceException("未找到该房间"); } roomService.saveHideHomeRoom(users.getUid(), hideLocation,app); } @@ -132,11 +132,11 @@ public class RoomAdminService extends BaseService { public void unchangeRoomSave(Long erbanNo) { Users users = usersBaseService.getUsersByErBanNo(erbanNo); if(users == null) { - throw new BusinessException("未找到该用户"); + throw new AdminServiceException("未找到该用户"); } Room room = roomService.getRoomByDB(users.getUid()); if(room == null) { - throw new BusinessException("未找到该房间"); + throw new AdminServiceException("未找到该房间"); } roomService.saveUnchangeRoom(users.getUid()); } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomInsideRecommendAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomInsideRecommendAdminService.java index ef4fdb8f7..e9f645718 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomInsideRecommendAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomInsideRecommendAdminService.java @@ -1,6 +1,5 @@ package com.accompany.admin.service.room; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.mapper.RoomInsideRecommendAdminMapper; import com.accompany.admin.vo.room.RoomInsideRecommendAdminVo; import com.accompany.business.model.room.RoomInsideRecommend; @@ -9,6 +8,7 @@ import com.accompany.business.service.room.RoomService; import com.accompany.business.service.user.UsersService; import com.accompany.common.constant.Constant; import com.accompany.common.status.BusiStatus; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Room; import com.accompany.core.model.Users; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -41,7 +41,7 @@ public class RoomInsideRecommendAdminService { if(erbanNo != null){ Users user = usersService.getUserByErbanNo(erbanNo); if(user == null){ - throw new BusinessException("未找到该用户信息"); + throw new AdminServiceException("未找到该用户信息"); } uid = user.getUid(); } @@ -71,18 +71,18 @@ public class RoomInsideRecommendAdminService { for(String erbanNo : erbanNoList) { Users user = usersService.getUserByErbanNo(Long.parseLong(erbanNo)); if(user == null){ - throw new BusinessException(BusiStatus.USERNOTEXISTS.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.USERNOTEXISTS.getReasonPhrase()); } Long uid = user.getUid(); UpdateWrapper wrapper = new UpdateWrapper<>(); wrapper.eq("uid",uid); RoomInsideRecommend roomRecommend = roomInsideRecommendService.getOne(wrapper); if(roomRecommend != null){ - throw new BusinessException("66号已存在"); + throw new AdminServiceException("66号已存在"); } Room roomByUid = roomService.getRoomByUid(uid); if(roomByUid == null){ - throw new BusinessException("查询不到用户房间信息"); + throw new AdminServiceException("查询不到用户房间信息"); } RoomInsideRecommend roomInsideRecommend = new RoomInsideRecommend(); roomInsideRecommend.setUid(uid); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java index f3feb2e3c..2b9f6d072 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/RoomSearchAdminService.java @@ -2,7 +2,6 @@ package com.accompany.admin.service.room; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.dto.RoomResetDto; import com.accompany.admin.event.ResetRoomEvent; import com.accompany.admin.model.SingleBroadcastPopularityAdmin; @@ -17,7 +16,6 @@ import com.accompany.business.model.HallMember; import com.accompany.business.model.RoomTag; import com.accompany.business.model.clan.ClanAccountAssociate; import com.accompany.business.model.room.RoomPlayType; -import com.accompany.business.model.user.UserCouple; import com.accompany.business.mybatismapper.HallMapper; import com.accompany.business.sensitvienew.SensitiveFilterUtil; import com.accompany.business.service.clan.ClanAccountAssociateService; @@ -27,12 +25,12 @@ import com.accompany.business.service.room.BlindDateService; import com.accompany.business.service.room.RoomPlayTypeService; import com.accompany.business.service.room.RoomService; import com.accompany.business.service.room.SingleBroadcastSortService; -import com.accompany.business.service.user.UserCoupleService; import com.accompany.business.vo.RoomNotifyVo; import com.accompany.common.constant.Constant; import com.accompany.common.redis.RedisKey; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.accompany.core.model.*; import com.accompany.core.mybatismapper.RoomMapper; @@ -90,8 +88,6 @@ public class RoomSearchAdminService extends BaseService { @Autowired private SingleBroadcastSortService singleBroadcastSortService; @Autowired - private UserCoupleService userCoupleService; - @Autowired private PartitionInfoService partitionInfoService; private Gson gson = new Gson(); @@ -231,14 +227,14 @@ public class RoomSearchAdminService extends BaseService { public int resetNewRoom(Long uid) { Room room = roomService.getRoomByDB(uid); if (room == null) { - throw new BusinessException("未找到該房間"); + throw new AdminServiceException("未找到該房間"); } if (room.getIsPermitRoom() == Constant.PermitType.NO_PERMIT_ROOM) { room.setIsPermitRoom(Constant.PermitType.NEW_SHOW_ROOM); } else if (room.getIsPermitRoom() == Constant.PermitType.NEW_SHOW_ROOM) { room.setIsPermitRoom(Constant.PermitType.NO_PERMIT_ROOM); } else { - throw new BusinessException("設置失敗.請查看該房間是否是牌照房"); + throw new AdminServiceException("設置失敗.請查看該房間是否是牌照房"); } int result = update(room); @@ -264,7 +260,7 @@ public class RoomSearchAdminService extends BaseService { public int resetRoom(Long uid, byte permitType) throws Exception { Room room = roomService.getRoomByDB(uid); if (room == null) { - throw new BusinessException("未找到該房間"); + throw new AdminServiceException("未找到該房間"); } Byte beforePermitType = room.getIsPermitRoom();//修改之前的类型 room.setIsPermitRoom(permitType); @@ -291,46 +287,46 @@ public class RoomSearchAdminService extends BaseService { public int resetRoomTitleAndIntro(Long uid, String title, String roomDesc, String introduction) throws Exception { Room room = roomService.getRoomByDB(uid); if (room == null) { - throw new BusinessException("未找到該房間"); + throw new AdminServiceException("未找到該房間"); } if (StringUtils.isBlank(title)) { - throw new BusinessException("房間標題不能為空"); + throw new AdminServiceException("房間標題不能為空"); } //不能超过15个字 if (title.trim().length() > 15) { - throw new BusinessException(BusiStatus.ROOM_TITLE_TOO_LONG.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.ROOM_TITLE_TOO_LONG.getReasonPhrase()); } // 敏感词检验 boolean isSensitive = SensitiveFilterUtil.getBooleanSensitiveFilter(title.trim()); String stringSensitiveFilter = SensitiveFilterUtil.getStringSensitiveFilter(title.trim()); logger.info("stringSensitiveFilter:{}", stringSensitiveFilter); if (isSensitive) { - throw new BusinessException(BusiStatus.ROOM_TITLE_IS_SENSITIVE.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.ROOM_TITLE_IS_SENSITIVE.getReasonPhrase()); } room.setTitle(title); if (StringUtils.isNotBlank(roomDesc)) { if (roomDesc.trim().length() > 15) { - throw new BusinessException("房間公告標題不能超過15個字"); + throw new AdminServiceException("房間公告標題不能超過15個字"); } boolean roomDescSensitive = SensitiveFilterUtil.getBooleanSensitiveFilter(roomDesc.trim()); String roomDescStringSensitiveFilter = SensitiveFilterUtil.getStringSensitiveFilter(roomDesc.trim()); logger.info("roomDesc stringSensitiveFilter:{}", roomDescStringSensitiveFilter); if (roomDescSensitive) { - throw new BusinessException("房間公告標題包含敏感字"); + throw new AdminServiceException("房間公告標題包含敏感字"); } } room.setRoomDesc(roomDesc); if (StringUtils.isNotBlank(roomDesc)) { if (roomDesc.trim().length() > 300) { - throw new BusinessException("房間公告不能超過300個字"); + throw new AdminServiceException("房間公告不能超過300個字"); } boolean introSensitive = SensitiveFilterUtil.getBooleanSensitiveFilter(roomDesc.trim()); String introStringSensitiveFilter = SensitiveFilterUtil.getStringSensitiveFilter(roomDesc.trim()); logger.info("introStringSensitiveFilter:{}", introStringSensitiveFilter); if (introSensitive) { - throw new BusinessException("房間公告包含敏感字"); + throw new AdminServiceException("房間公告包含敏感字"); } } room.setIntroduction(introduction); @@ -361,7 +357,7 @@ public class RoomSearchAdminService extends BaseService { try { Room room = roomService.getRoomByDB(uid); if (room == null) { - throw new BusinessException("未找到该房间"); + throw new AdminServiceException("未找到该房间"); } Byte originType = room.getType();//修改之前的类型 Byte beforePermitType = room.getIsPermitRoom();//修改之前的类型 @@ -391,13 +387,7 @@ public class RoomSearchAdminService extends BaseService { ClanAccountAssociate clanAccountAssociate = clanAccountAssociateService.checkIsAssociateAccount(uid); - if (ObjectUtil.isNotNull(clanAccountAssociate)) throw new BusinessException("族長關聯號禁止切個播房"); - } - - if (beforePermitType.byteValue() != Constant.PermitType.PERMIT_ROOM && permitType == Constant.PermitType.PERMIT_ROOM) { - //切换前不是牌照房,切换后是牌照房 - UserCouple userCouple = userCoupleService.queryCpByUid(uid, true); - if (ObjectUtil.isNotNull(userCouple)) throw new BusinessException("cp用戶禁止切牌照房哦~"); + if (ObjectUtil.isNotNull(clanAccountAssociate)) throw new AdminServiceException("族長關聯號禁止切個播房"); } if (beforePermitType.byteValue() == Constant.PermitType.SINGLE_BROADCAST && permitType != Constant.PermitType.SINGLE_BROADCAST) { diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/TopicRoomService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/TopicRoomService.java deleted file mode 100644 index 8e1cad146..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/TopicRoomService.java +++ /dev/null @@ -1,333 +0,0 @@ -package com.accompany.admin.service.room; - -import com.accompany.admin.mapper.TopicRoomExpand; -import com.accompany.admin.service.base.BaseService; -import com.accompany.core.base.BeanMapper; -import com.accompany.core.model.Room; -import com.accompany.business.model.TopicRoom; -import com.accompany.core.model.Users; -import com.accompany.business.mybatismapper.RecommendModuleMapper; -import com.accompany.business.mybatismapper.TopicRoomMapper; -import com.accompany.core.service.common.JedisLockService; -import com.accompany.core.service.common.JedisService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.user.UsersService; -import com.accompany.core.util.StringUtils; -import com.accompany.business.vo.RoomVo; -import com.accompany.business.vo.TopicRoomVo; -import com.accompany.business.vo.recommend.ModuleRoomMapVo; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.gson.reflect.TypeToken; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class TopicRoomService extends BaseService { - - @Autowired - private TopicRoomExpand topicRoomExpand; - @Autowired - private TopicRoomMapper topicRoomMapper; - @Autowired - private JedisService jedisService; - @Autowired - private UsersService usersService; - @Autowired - private RoomService roomService; - @Autowired - private RecommendModuleMapper recommendModuleMapper; - @Autowired - protected JedisLockService jedisLockService; - - public PageInfo getTopicRoomList(Integer pageNumber, Integer pageSize, String title, Long erbanNo) { - PageHelper.startPage(pageNumber, pageSize); - return new PageInfo<>(getTopicRoomList(title, erbanNo)); - } - - public List getTopicRoomList(String title, Long erbanNo) { - List list = this.topicRoomExpand.getTopicRoomList(title, erbanNo); - return list; - } - - @Transactional(rollbackFor = Exception.class) - public BusiResult editTopicRoom(Integer status, Long id, Integer seqNo) { - if (id != null) { - TopicRoom topic = topicRoomMapper.selectByPrimaryKey(id); - if (status != null) { - topic.setStatus(status.intValue() == 0 ? false : true); - } - if (seqNo != null) { - topic.setSeqNo(seqNo.intValue()); - } - topicRoomMapper.updateByPrimaryKeySelective(topic); - - if(status.intValue() == 1) { - List rooms = new ArrayList(1); - List topicRooms = new ArrayList(1); - Room room = roomService.getRoomCacheByUid(topic.getUid()); - rooms.add(room); - topicRooms.add(topic); - saveTopicRoomCache(rooms, false, topicRooms); - }else if(status.intValue() == 0){ - HashMap moduleUidMap = new HashMap(); - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append(topic.getUid()); - moduleUidMap.put(topic.getModuleId().toString(),stringBuffer); - - delTopicRoomCache(moduleUidMap); - } - return new BusiResult(BusiStatus.SUCCESS, topic); - } else { - return new BusiResult(BusiStatus.USERNOTEXISTS); - } - } - - @Transactional(rollbackFor = Exception.class) - public BusiResult saveTopicRoom(String moduleName,Integer status, Long moduleId, String uids) { - - if(StringUtils.isEmpty(uids)){ - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - - StringBuffer notExists = new StringBuffer(); - - List userIds = getTopicRoomCacheUserIds(moduleId); - - insertTopicRoom(notExists,moduleName,status,moduleId,userIds,uids); - - - if(notExists.length()>0){ - return new BusiResult(BusiStatus.SUCCESS,notExists.substring(0,notExists.length()-1)+"等房间添加失败,因为用户不存在或房间已存在",null); - } - - return new BusiResult(BusiStatus.SUCCESS,"添加成功",null); - } - - - @Transactional(rollbackFor = Exception.class) - public void delRoom(List ids,String moduleIds,List uids) { - if (ids.size() == 1) { - topicRoomMapper.deleteByPrimaryKey(ids.get(0)); - - } else { - topicRoomExpand.delTopicRoomByids(ids.stream().map(s -> s).collect(Collectors.toList())); - } - - //moduleIds格式为 moduleId#uid,moduleId#uid - String[] moduleUidStrs = moduleIds.split(","); - String[] moduleUid = null; - StringBuffer stringBuffer = null; - //key是moduleId values是uids - HashMap moduleUidMap = new HashMap(); - for(String moduleUidStr : moduleUidStrs){ - moduleUid = moduleUidStr.split("#"); - if(moduleUidMap.get(moduleUid[0]) != null){ - moduleUidMap.get(moduleUid[0]).append(",").append(moduleUid[1]); - }else{ - stringBuffer = new StringBuffer(); - stringBuffer.append(moduleUid[1]); - moduleUidMap.put(moduleUid[0],stringBuffer); - } - } - delTopicRoomCache(moduleUidMap); - } - - /** - * key是moduleId values是存储uids的StringBuffer,uid之间用,分隔 - * @param moduleUidMap - */ - private void delTopicRoomCache(HashMap moduleUidMap) { - if (moduleUidMap == null) { - return; - } - List modules = jedisService.hvals(RedisKey.recommend_topic_room_map.getKey()); - ModuleRoomMapVo mapVo = null; - if (!CollectionUtils.isEmpty(modules)) { - Map moduleRooms = new HashMap<>(); - for (String module : modules) { - mapVo = gson.fromJson(module, new TypeToken() {}.getType()); - if (!CollectionUtils.isEmpty(mapVo.getRooms()) && moduleUidMap.get(mapVo.getModule().getId().toString()) != null) { - List uids = Arrays.asList(moduleUidMap.get(mapVo.getModule().getId().toString()).toString().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); - - for (Long id : uids) { - mapVo.getRooms().removeIf(room -> room.getUid().equals(id)); - - } - } - moduleRooms.put(mapVo.getModule().getId().toString(), gson.toJson(mapVo)); - } - jedisService.hwrite(RedisKey.recommend_topic_room_map.getKey(), moduleRooms); - } - - } - - public void insertTopicRoom(StringBuffer notExists,String moduleName,Integer status, Long moduleId,List userIds,String uidStrs) { - String[] uidArray = uidStrs.split(","); - - List list = new ArrayList<>(); - - Map userMap = new HashMap(); - List uids = new ArrayList(); - - Users user = null; - for (int i = 0; i < uidArray.length; i++) { - user = usersService.getUserByErbanNo(Long.parseLong(uidArray[i].trim())); - if (user != null) { - userMap.put(uidArray[i].trim(), user.getUid()); - uids.add(user.getUid().toString()); - } - } - if (CollectionUtils.isEmpty(uids)) { - notExists.append(uidStrs).append(","); - return; - } - - //不显示就不存进缓存 - List rooms = null; - - Map roomMap = null; - if (status.intValue() == 1) { - rooms = roomService.queryRoomBeanListByUids(uids.stream().toArray(String[]::new)); - roomMap = rooms.stream().collect(Collectors.toMap(Room::getUid, Room::getTitle)); - } - - Date nowDate = new Date(); - for(int i=0;i getTopicRoomCacheUserIds(Long moduleId){ - String mapVoJson = jedisService.hget(RedisKey.recommend_topic_room_map.getKey(),moduleId.toString()); - List userIds = null; - if(!StringUtils.isEmpty(mapVoJson)){ - ModuleRoomMapVo mapVo = gson.fromJson(mapVoJson, new TypeToken(){}.getType()); - List rooms = mapVo.getRooms(); - if(rooms != null) { - userIds = rooms.stream().map(RoomVo::getUid).collect(Collectors.toList()); - } - } - return userIds; - } - - private void saveTopicRoomCache(List rooms, boolean isSave,List topic) { - ModuleRoomMapVo mapVo = optTopicRoomCache(rooms,isSave,topic); - if(mapVo != null){ - String mapVoJson = gson.toJson(mapVo); - jedisService.hwrite(RedisKey.recommend_topic_room_map.getKey(),topic.get(0).getModuleId().toString(), mapVoJson); - } - } - /** - * - * @param rooms - * @param isSave 是否添加话题房间,false表明是编辑,topics只会有一个元素 - * @param topic - */ - private ModuleRoomMapVo optTopicRoomCache(List rooms, boolean isSave,List topic) { - if (CollectionUtils.isEmpty(rooms) || CollectionUtils.isEmpty(topic)) { - return null; - } - List roomVos = roomService.getRoomVos(rooms,topic); - - String mapVoJson = jedisService.hget(RedisKey.recommend_topic_room_map.getKey(), topic.get(0).getModuleId().toString()); - ModuleRoomMapVo mapVo = null; - if (StringUtils.isEmpty(mapVoJson)) { - mapVo = new ModuleRoomMapVo(); - mapVo.setModule(recommendModuleMapper.selectByPrimaryKey(topic.get(0).getModuleId())); - mapVo.setRooms(roomVos); - return mapVo; - } - - mapVo = gson.fromJson(mapVoJson, new TypeToken() {}.getType()); - boolean roomsIsNull = CollectionUtils.isEmpty(mapVo.getRooms()) ? true : false; - if (isSave) { - if(roomsIsNull){ - mapVo.setRooms(roomVos); - }else{ - mapVo.getRooms().addAll(roomVos); - } - return mapVo; - } - - if(roomsIsNull){ - mapVo.setRooms(roomVos); - }else{ - List oldRoomsUids = mapVo.getRooms().stream().map(RoomVo::getUid).collect(Collectors.toList()); - if(!oldRoomsUids.contains(roomVos.get(0).getUid())){ - mapVo.getRooms().add(roomVos.get(0)); - }else{ - for (int i = 0; i < mapVo.getRooms().size(); i++) { - if (mapVo.getRooms().get(i).getUid().equals(topic.get(0).getUid())) { - mapVo.getRooms().set(i,roomVos.get(0)); - break; - } - } - } - } - return mapVo; - } - /** - * 根据记录构建excel数据 - * @return - */ - public List buildExcelData(List vos) { - List excelRows = new ArrayList<>(vos.size()); - int i=1; - SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - for(TopicRoomVo vo : vos) { - List excelData = new ArrayList<>(); - excelData.add(i++); - excelData.add(vo.getErbanNo()); - excelData.add(vo.getName()); - excelData.add(vo.getRoomTitle()); - excelData.add(dateFormat.format(vo.getCreateTime())); - excelData.add(vo.getSeqNo()); - excelRows.add(excelData); - } - return excelRows; - } - - public TopicRoomVo convertTopicRoom(TopicRoom topicRoom,String roomName){ - if(topicRoom == null){ - return null; - } - TopicRoomVo topicRoomVo = BeanMapper.map(topicRoom, TopicRoomVo.class); - if(StringUtils.isNotEmpty(roomName)) { - topicRoomVo.setRoomTitle(roomName); - } - return topicRoomVo; - } -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/template/ResetRoomDealDb.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/template/ResetRoomDealDb.java index ad4e962a0..a83e099de 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/template/ResetRoomDealDb.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/room/template/ResetRoomDealDb.java @@ -1,7 +1,6 @@ package com.accompany.admin.service.room.template; import cn.hutool.core.collection.CollectionUtil; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.dto.RoomResetDto; import com.accompany.admin.dto.room.ImmutableHallMemberWrapper; import com.accompany.admin.model.SingleBroadcastExample; @@ -286,7 +285,7 @@ public class ResetRoomDealDb extends ResetRoomTemplateAbstract { if (roomRet.getCode() != 200) { logger.error("updateNeteaseRoomInfo error code:{}, roomId:{}, roomUid:{}", roomRet.getCode(), room.getRoomId(), room.getUid()); - throw new BusinessException("云信聊天室信息更新失败..."); + throw new ServiceException(BusiStatus.UPDATE_NETEASE_ROOM_FAIL); } } diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java index a42badc67..6c6af602a 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/system/AppVersionAdminService.java @@ -1,7 +1,6 @@ package com.accompany.admin.service.system; import com.accompany.admin.base.AbstractCoreService; -import com.accompany.admin.common.BusinessException; import com.accompany.business.service.SendSysMsgService; import com.accompany.business.vo.AppVersionVo; import com.accompany.common.config.SystemConfig; @@ -10,6 +9,7 @@ import com.accompany.common.utils.GsonUtil; import com.accompany.core.base.BaseMapper; import com.accompany.business.model.AppVersion; import com.accompany.business.model.AppVersionExample; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.exception.ServiceException; import com.accompany.core.model.SysConf; import com.accompany.business.mybatismapper.AppVersionMapper; @@ -104,10 +104,10 @@ public class AppVersionAdminService extends AbstractCoreService getList(Long erbanNo,Integer pageNum,Integer pageSize){ @@ -99,7 +96,7 @@ public class UserBankAccountAdminService extends BaseService { public List getUserBankAccountByErbanNo(Long erbanNo){ Users users = this.usersBaseService.getUsersByErBanNo(erbanNo); if(users == null){ - throw new BusinessException(BusiStatus.USERNOTEXISTS.getReasonPhrase()); + throw new AdminServiceException(BusiStatus.USERNOTEXISTS.getReasonPhrase()); } Long uid = users.getUid(); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserCoupleAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserCoupleAdminService.java deleted file mode 100644 index eb635179d..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserCoupleAdminService.java +++ /dev/null @@ -1,204 +0,0 @@ -package com.accompany.admin.service.user; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.admin.dto.UserCoupleStatisticalDto; -import com.accompany.admin.dto.UserCoupleStatisticalParamDto; -import com.accompany.business.dto.UserCoupleStatisticalTotalDto; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.mybatismapper.GiftSendRecordMapper; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.service.user.UserCoupleLevelService; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserRelationPrivilegeService; -import com.accompany.common.constant.Constant; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.service.user.UsersBaseService; -import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.Maps; -import org.apache.commons.lang3.tuple.ImmutablePair; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 11:47 - */ -@Service -public class UserCoupleAdminService extends BaseService { - - public static final Logger logger = LoggerFactory.getLogger(UserCoupleAdminService.class); - - @Autowired - private UserRelationPrivilegeService userRelationPrivilegeService; - @Autowired - private UserCoupleLevelService userCoupleLevelService; - @Autowired - private UserCoupleMapper userCoupleMapper; - @Autowired - private UsersBaseService usersBaseService; - @Autowired - private GiftSendRecordMapper giftSendRecordMapper; - @Autowired - private UserCoupleService userCoupleService; - - - - public JSONObject statisticsList(UserCoupleStatisticalParamDto paramDto) { - JSONObject jsonObject = new JSONObject(); - Integer pageNum = paramDto.getPageNum(); - Integer pageSize = paramDto.getPageSize(); - - if (ObjectUtil.isNull(pageNum)) pageNum = 1; - if (ObjectUtil.isNull(pageSize)) pageSize = 10; - - Long uidParam = null; - if (ObjectUtil.isNotNull(paramDto.getErbanNo())) { - Users users = usersBaseService.getUsersByErBanNo(paramDto.getErbanNo()); - if (ObjectUtil.isNotNull(users)) uidParam = users.getUid(); - else uidParam = -9999l; - } - - PageHelper.startPage(pageNum, pageSize); - PageInfo pageInfo = new PageInfo(userCoupleMapper.queryUserCoupleListByStatistical(uidParam, paramDto.getAcceptTimeStart(), paramDto.getAcceptTimeEnd(), paramDto.getState())); - List userCoupleList = pageInfo.getList(); - - UserCoupleStatisticalTotalDto totalDto = new UserCoupleStatisticalTotalDto(); - if (CollectionUtils.isEmpty(userCoupleList)) { - jsonObject.put("total",0); - jsonObject.put("totalDto",totalDto); - jsonObject.put("rows", new ArrayList<>()); - return jsonObject; - } - - List inviteUidList = userCoupleList.stream().map(userCouple -> String.valueOf(userCouple.getInviteUid())).distinct().collect(Collectors.toList()); - List acceptUidList = userCoupleList.stream().map(userCouple -> String.valueOf(userCouple.getAcceptUid())).distinct().collect(Collectors.toList()); - inviteUidList.addAll(acceptUidList); - - List uidList = inviteUidList.stream().distinct().collect(Collectors.toList()); - List usersList = usersBaseService.queryUsersBeanListByUids(uidList.stream().toArray(String[]::new)); - - Map usersMap = Maps.uniqueIndex(usersList, Users::getUid); - - - List statisList = new ArrayList<>(); - for (UserCouple userCouple : userCoupleList) { - ImmutablePair datePair = correctionQueryTime(paramDto, userCouple); - Date startTime = datePair.getLeft(); - Date endTime = datePair.getRight(); - Long sumGold = giftSendRecordMapper.statisCpGoldNum(userCouple.getInviteUid(), userCouple.getAcceptUid(), startTime, endTime); - - Users inviteUser = Optional.ofNullable(usersMap.get(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUser = Optional.ofNullable(usersMap.get(userCouple.getAcceptUid())).orElse(new Users()); - UserCoupleStatisticalDto statisticalDto = new UserCoupleStatisticalDto(); - statisticalDto.setId(userCouple.getId()); - statisticalDto.setInviteUid(userCouple.getInviteUid()); - statisticalDto.setInviteErbanNo(inviteUser.getErbanNo()); - statisticalDto.setInviteNick(inviteUser.getNick()); - - statisticalDto.setAcceptUid(acceptUser.getUid()); - statisticalDto.setAcceptErbanNo(acceptUser.getErbanNo()); - statisticalDto.setAcceptNick(acceptUser.getNick()); - - statisticalDto.setLevelSeq("CP Lv." + userCouple.getLevelSeq()); - statisticalDto.setAcceptTime(userCouple.getAcceptTime()); - if (Constant.UserCoupleState.unbound.equals(userCouple.getState())) { - statisticalDto.setUnboundTime(userCouple.getUpdateTime()); - } - - if (Constant.UserCoupleState.cp.equals(userCouple.getState())) { - statisticalDto.setState("CP中"); - }else if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - statisticalDto.setState("解绑中"); - }else if (Constant.UserCoupleState.unbound.equals(userCouple.getState())) { - statisticalDto.setState("已解除"); - }else { - statisticalDto.setState(String.valueOf(userCouple.getState())); - } - - statisticalDto.setSendGoldNum(sumGold); - statisList.add(statisticalDto); - } - - totalDto = userCoupleMapper.userCoupleTotalStatistical(uidParam, paramDto.getAcceptTimeStart(), paramDto.getAcceptTimeEnd(), paramDto.getState()); - Long sendTotalGoldNum = userCoupleMapper.userCoupleTotalSendGoldNum(uidParam, paramDto.getAcceptTimeStart(), paramDto.getAcceptTimeEnd(), paramDto.getState()); - totalDto.setSendTotalGoldNum(sendTotalGoldNum); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows", statisList); - jsonObject.put("totalDto",totalDto); - return jsonObject; - } - - - public JSONObject cpSendDetailList(UserCoupleStatisticalParamDto paramDto) { - if (ObjectUtil.isNull(paramDto.getId())) throw new ServiceException("参数有误"); - JSONObject jsonObject = new JSONObject(); - - Integer pageNum = paramDto.getPageNum(); - Integer pageSize = paramDto.getPageSize(); - - if (ObjectUtil.isNull(pageNum)) pageNum = 1; - if (ObjectUtil.isNull(pageSize)) pageSize = 10; - - UserCouple userCouple = userCoupleMapper.selectById(paramDto.getId()); - - if (ObjectUtil.isNull(userCouple)) throw new ServiceException("获取不到cp记录信息!"); - - ImmutablePair datePair = correctionQueryTime(paramDto, userCouple); - Date startTime = datePair.getLeft(); - Date endTime = datePair.getRight(); - - PageHelper.startPage(pageNum, pageSize); - PageInfo pageInfo = new PageInfo(giftSendRecordMapper.cpUserSendDetailList(userCouple.getInviteUid(), userCouple.getAcceptUid(), startTime, endTime)); - - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - return jsonObject; - } - - - public void immediateUnbound(Long id) { - userCoupleService.unboundDeal(id); - } - - - public ImmutablePair correctionQueryTime(UserCoupleStatisticalParamDto paramDto, UserCouple userCouple) { - Date startTime = userCouple.getAcceptTime(); - if (!StringUtils.isEmpty(paramDto.getAcceptTimeStart())) { - Date acceptTimeStart = DateTimeUtil.convertStrToDate(paramDto.getAcceptTimeStart()); - if (acceptTimeStart.after(startTime)) startTime = acceptTimeStart; - } - - Date endTime = userCouple.getUpdateTime(); - - if (Constant.UserCoupleState.unbound.equals(userCouple.getState())) { - if (!StringUtils.isEmpty(paramDto.getAcceptTimeEnd())) { - Date acceptTimeEnd = DateTimeUtil.convertStrToDate(paramDto.getAcceptTimeEnd()); - if (acceptTimeEnd.before(endTime)) endTime = acceptTimeEnd; - } - }else { - if (!StringUtils.isEmpty(paramDto.getAcceptTimeEnd())) { - Date acceptTimeEnd = DateTimeUtil.convertStrToDate(paramDto.getAcceptTimeEnd()); - endTime = acceptTimeEnd; - }else { - endTime = new Date(); - } - } - - return ImmutablePair.of(startTime, endTime); - } - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserFrozenAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserFrozenAdminService.java index e3b574ea3..7ef0f5a51 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserFrozenAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserFrozenAdminService.java @@ -1,6 +1,5 @@ package com.accompany.admin.service.user; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.base.BaseService; import com.accompany.admin.service.system.AdminUserService; @@ -8,6 +7,7 @@ import com.accompany.business.model.UserFrozenRecord; import com.accompany.business.model.UserFrozenRecordExample; import com.accompany.business.service.user.UsersService; import com.accompany.common.redis.RedisKey; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Users; import com.accompany.business.mybatismapper.UserFrozenRecordMapper; import com.accompany.core.service.user.UsersBaseService; @@ -78,10 +78,10 @@ public class UserFrozenAdminService extends BaseService { //用户信息 Users users = usersBaseService.getUsersByErBanNo(Long.valueOf(erbanNoStr)); if(null == users) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); + throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); } if(users.getUseStatus() == Constant.UserStatus.FROZEN){ - throw new BusinessException("平台号为"+ erbanNo + "已被冻结!"); + throw new AdminServiceException("平台号为"+ erbanNo + "已被冻结!"); } users.setUseStatus(Constant.UserStatus.FROZEN); @@ -108,10 +108,10 @@ public class UserFrozenAdminService extends BaseService { //用户信息 Users users = usersBaseService.getUsersByErBanNo(Long.valueOf(erbanNoStr)); if(null == users) { - throw new BusinessException("平台号为"+ erbanNo + "的用户不存在!"); + throw new AdminServiceException("平台号为"+ erbanNo + "的用户不存在!"); } if(users.getUseStatus() == Constant.UserStatus.NORMAL){ - throw new BusinessException("平台号为"+ erbanNo + "已是正常状态!"); + throw new AdminServiceException("平台号为"+ erbanNo + "已是正常状态!"); } users.setUseStatus(Constant.UserStatus.NORMAL); usersBaseService.updateUser(users); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserImpeachAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserImpeachAdminService.java index 4f3d99e7f..d195a9ca8 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserImpeachAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserImpeachAdminService.java @@ -1,6 +1,5 @@ package com.accompany.admin.service.user; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.mapper.UserImpeachAdminExpand; import com.accompany.admin.service.base.BaseService; import com.accompany.admin.vo.UserImpeachRecordAdminVo; @@ -20,6 +19,7 @@ import com.accompany.common.utils.StringUtils; import com.accompany.core.base.BeanMapper; import com.accompany.core.constant.BlockSourceEnum; import com.accompany.core.constant.BlockTypeEnum; +import com.accompany.core.exception.AdminServiceException; import com.accompany.core.model.Users; import com.accompany.core.service.user.UsersBaseService; import com.github.pagehelper.Page; @@ -281,7 +281,6 @@ public class UserImpeachAdminService extends BaseService { /** * 封禁账号24小时 * @param recordId - * @param adminId */ @Transactional(rollbackFor = Exception.class) public void block24Hours(int recordId, String adminName) throws Exception { @@ -300,7 +299,6 @@ public class UserImpeachAdminService extends BaseService { /** * 永久封禁账号(10年) * @param recordId - * @param adminId */ @Transactional(rollbackFor = Exception.class) public void blockPermanent(int recordId, String adminName) throws Exception { @@ -324,7 +322,7 @@ public class UserImpeachAdminService extends BaseService { Long targetUid = record.getTargetUid(); Users users = usersService.getUsersByUid(targetUid); if (users == null){ - throw new BusinessException("用戶不存在"); + throw new AdminServiceException("用戶不存在"); } accountBlockService.saveBlockedAccount(users.getErbanNo(), BlockTypeEnum.BLOCK_ACCOUNT.getValue(), startBlockTime, endBlockTime, record.getReason(), BlockSourceEnum.IMPEACH.getValue(), adminName,true); diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPrivilegeAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPrivilegeAdminService.java deleted file mode 100644 index de14edd24..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPrivilegeAdminService.java +++ /dev/null @@ -1,270 +0,0 @@ -package com.accompany.admin.service.user; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.admin.dto.UserRelationPrivilegeAdminDto; -import com.accompany.business.model.UserHeadwear; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserCoupleLevel; -import com.accompany.business.model.user.UserNameplateApplyRecord; -import com.accompany.business.model.user.UserRelationPrivilege; -import com.accompany.business.mybatismapper.UserNameplateMapper; -import com.accompany.business.service.headwear.HeadwearService; -import com.accompany.business.service.user.UserCoupleLevelService; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserNameplateApplyRecordService; -import com.accompany.business.service.user.UserRelationPrivilegeService; -import com.accompany.core.base.SpringContextHolder; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.HeadwearConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Users; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.service.user.UsersBaseService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 11:47 - */ -@Service -public class UserRelationPrivilegeAdminService extends BaseService { - - public static final Logger logger = LoggerFactory.getLogger(UserRelationPrivilegeAdminService.class); - - @Autowired - private UserRelationPrivilegeService userRelationPrivilegeService; - @Autowired - private UserCoupleLevelService userCoupleLevelService; - @Autowired - private UserCoupleService userCoupleService; - @Autowired - private UserNameplateApplyRecordService userNameplateApplyRecordService; - @Autowired - private UserNameplateMapper userNameplateMapper; - @Autowired - private UsersBaseService usersBaseService; - @Autowired - private HeadwearService headwearService; - - - - - public IPage privilegeList(Integer pageNum, Integer pageSize) { - List resultList = new ArrayList<>(); - - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserRelationPrivilege::getStatus, Constant.GlobalStatus.valid).orderByAsc(UserRelationPrivilege::getLevelSeq); - - Page page = new Page<>(pageNum, pageSize); - IPage privilegePage = userRelationPrivilegeService.page(page, queryWrapper); - List privilegeList = privilegePage.getRecords(); - - for (UserRelationPrivilege privilege : privilegeList) { - UserRelationPrivilegeAdminDto privilegeAdminDto = new UserRelationPrivilegeAdminDto(); - BeanUtils.copyProperties(privilege, privilegeAdminDto); - - UserCoupleLevel userCoupleLevel = userCoupleLevelService.getUserCpLevelBySeq(privilege.getLevelSeq()); - privilegeAdminDto.setSecretVal(userCoupleLevel.getAmount()); - resultList.add(privilegeAdminDto); - } - - privilegePage.setRecords(resultList); - - return privilegePage; - } - - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void savePrivilege(UserRelationPrivilege userRelationPrivilege) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserRelationPrivilege::getLevelSeq, userRelationPrivilege.getLevelSeq()) - .eq(UserRelationPrivilege::getRelationType, userRelationPrivilege.getRelationType()) - .eq(UserRelationPrivilege::getType, userRelationPrivilege.getType()) - .eq(UserRelationPrivilege::getGender, userRelationPrivilege); - - List privilegeList = userRelationPrivilegeService.list(queryWrapper); - if (ObjectUtil.isNull(userRelationPrivilege.getId())) { - if (!CollectionUtils.isEmpty(privilegeList)) throw new ServiceException("该等级已有此类型特权,不能重复添加!"); - //新增 - userRelationPrivilege.setStatus(Constant.GlobalStatus.valid); - userRelationPrivilegeService.save(userRelationPrivilege); - }else { - if (!CollectionUtils.isEmpty(privilegeList)) { - List idList = privilegeList.stream().map(UserRelationPrivilege::getId).collect(Collectors.toList()); - if (idList.size() > 0 && !idList.contains(userRelationPrivilege.getId())) throw new ServiceException("该等级已有此类型特权,不能重复添加!"); - } - - UserRelationPrivilege privilege = userRelationPrivilegeService.getById(userRelationPrivilege.getId()); - //编辑 - userRelationPrivilegeService.updateById(userRelationPrivilege); - SpringContextHolder.getBean(UserRelationPrivilegeAdminService.class).delCpUserPrivilege(privilege); - } - - - if (!Constant.UserCouplePrivilegeType.head_wear.equals(userRelationPrivilege.getType())) return; - //如果是头饰,按照性别发放头饰 - List stateList = Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - QueryWrapper userCoupleQueryWrapper = new QueryWrapper<>(); - userCoupleQueryWrapper.lambda().ge(UserCouple::getLevelSeq, userRelationPrivilege.getLevelSeq()).in(UserCouple::getState, stateList); - - List userCoupleList = userCoupleService.list(userCoupleQueryWrapper); - if (CollectionUtils.isEmpty(userCoupleList)) return; - - List headwearList = Arrays.asList(userRelationPrivilege); - - for (UserCouple userCouple : userCoupleList) { - Users inviteUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - - if (ObjectUtil.equal(userRelationPrivilege.getGender(), inviteUser.getGender())) { - headwearService.officialSendHeadWearSingle(Integer.valueOf(userRelationPrivilege.getPrivilegeProp()), inviteUser.getUid(), Constant.UserRelationDefaultVal.effective_day,false);//检查是否自动佩戴头饰 - userCoupleService.executeWearCpHeadwear(headwearList, inviteUser.getUid()); - } - - if (ObjectUtil.equal(userRelationPrivilege.getGender(), acceptUser.getGender())) { - headwearService.officialSendHeadWearSingle(Integer.valueOf(userRelationPrivilege.getPrivilegeProp()), acceptUser.getUid(), Constant.UserRelationDefaultVal.effective_day,false); - userCoupleService.executeWearCpHeadwear(headwearList, acceptUser.getUid()); - } - } - } - - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void delPrivilege(Long id) { - UserRelationPrivilege userRelationPrivilege = new UserRelationPrivilege(); - userRelationPrivilege.setId(id); - userRelationPrivilege.setStatus(Constant.GlobalStatus.in_valid); - userRelationPrivilegeService.updateById(userRelationPrivilege); - - - UserRelationPrivilege privilege = userRelationPrivilegeService.getById(id); - SpringContextHolder.getBean(UserRelationPrivilegeAdminService.class).delCpUserPrivilege(privilege); - } - - - public UserRelationPrivilegeAdminDto getPrivilegeInfo(Long id) { - UserRelationPrivilege privilege = userRelationPrivilegeService.getById(id); - UserRelationPrivilegeAdminDto privilegeAdminDto = new UserRelationPrivilegeAdminDto(); - BeanUtils.copyProperties(privilege, privilegeAdminDto); - - UserCoupleLevel userCoupleLevel = userCoupleLevelService.getUserCpLevelBySeq(privilege.getLevelSeq()); - privilegeAdminDto.setSecretVal(userCoupleLevel.getAmount()); - return privilegeAdminDto; - } - - public Long getSecretValByLevelSeq(Integer levelSeq) { - UserCoupleLevel userCoupleLevel = userCoupleLevelService.getUserCpLevelBySeq(levelSeq); - - return userCoupleLevel.getAmount(); - } - - - /** - * 清除cp用户对应的此特权 - * @param privilege - */ - public void delCpUserPrivilege(UserRelationPrivilege privilege) { - if (ObjectUtil.isNull(privilege)) return; - if (!Constant.UserRelationType.cp.equals(privilege.getRelationType())) return; - if (Constant.UserCouplePrivilegeType.cp_theme.equals(privilege.getType())) return; - - List stateList = Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().ge(UserCouple::getLevelSeq, privilege.getLevelSeq()).in(UserCouple::getState, stateList); - - List userCoupleList = userCoupleService.list(queryWrapper); - - if (CollectionUtils.isEmpty(userCoupleList)) return; - - - for (UserCouple userCouple : userCoupleList) { - if (Constant.UserCouplePrivilegeType.mp.equals(privilege.getType())) SpringContextHolder.getBean(UserRelationPrivilegeAdminService.class).delCpUserMpPrivilege(privilege, userCouple); - else if (Constant.UserCouplePrivilegeType.head_wear.equals(privilege.getType())) SpringContextHolder.getBean(UserRelationPrivilegeAdminService.class).delCpUserHeadwearPrivilege(privilege, userCouple); - else continue; - } - - } - - - public void delCpUserMpPrivilege(UserRelationPrivilege privilege, UserCouple userCouple) { - Users inviteUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - - if (ObjectUtil.equal(privilege.getGender(), inviteUser.getGender())) { - List inviteUserApplyRecordList = userNameplateApplyRecordService.queryCpUserPointMpApply(userCouple.getInviteUid(), String.valueOf(userCouple.getId()), Long.valueOf(privilege.getPrivilegeProp())); - userCoupleService.clearCpUserMp(inviteUserApplyRecordList, userCouple.getInviteUid()); - } - - if (ObjectUtil.equal(privilege.getGender(), acceptUser.getGender())) { - List acceptUserApplyRecordList = userNameplateApplyRecordService.queryCpUserPointMpApply(userCouple.getAcceptUid(), String.valueOf(userCouple.getId()), Long.valueOf(privilege.getPrivilegeProp())); - userCoupleService.clearCpUserMp(acceptUserApplyRecordList, userCouple.getAcceptUid()); - } - - - - } - - public void delCpUserHeadwearPrivilege(UserRelationPrivilege privilege, UserCouple userCouple) { - Users inviteUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - - if (ObjectUtil.equal(privilege.getGender(), inviteUser.getGender())) { - UserHeadwear userHeadwear = headwearService.getUserHeardwear(inviteUser.getUid(), Integer.valueOf(privilege.getPrivilegeProp())); - if (!ObjectUtil.isNull(userHeadwear)) { - userHeadwear.setExpireTime(new Date()); - userHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - headwearService.updateUserHeadwear(userHeadwear); - } - - //检查在使用中的头饰是否为此CP头饰 - UserHeadwear inviteUsingHeadwear = headwearService.getUserUsingHeadwear(userCouple.getInviteUid()); - if (ObjectUtil.isNotNull(inviteUsingHeadwear) && ObjectUtil.equal(inviteUsingHeadwear.getHeadwearId(), Integer.valueOf(privilege.getPrivilegeProp()))) { - inviteUsingHeadwear.setUsed(Boolean.FALSE); - inviteUsingHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - inviteUsingHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(inviteUsingHeadwear); - - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getInviteUid().toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getInviteUid().toString()); - } - } - - if (ObjectUtil.equal(privilege.getGender(), acceptUser.getGender())) { - UserHeadwear userHeadwear = headwearService.getUserHeardwear(acceptUser.getUid(), Integer.valueOf(privilege.getPrivilegeProp())); - if (!ObjectUtil.isNull(userHeadwear)) { - userHeadwear.setExpireTime(new Date()); - userHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - headwearService.updateUserHeadwear(userHeadwear); - } - - //检查在使用中的头饰是否为此CP头饰 - UserHeadwear acceptUsingHeadwear = headwearService.getUserUsingHeadwear(userCouple.getAcceptUid()); - if (ObjectUtil.isNotNull(acceptUsingHeadwear) && ObjectUtil.equal(acceptUsingHeadwear.getHeadwearId(), Integer.valueOf(privilege.getPrivilegeProp()))) { - acceptUsingHeadwear.setUsed(Boolean.FALSE); - acceptUsingHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - acceptUsingHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(acceptUsingHeadwear); - - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getAcceptUid().toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getAcceptUid().toString()); - } - } - } - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPropsAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPropsAdminService.java deleted file mode 100644 index 41aaea386..000000000 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/user/UserRelationPropsAdminService.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.accompany.admin.service.user; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.model.user.UserRelationProps; -import com.accompany.business.service.user.UserRelationPropsService; -import com.accompany.common.constant.Constant; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.service.base.BaseService; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; -import java.util.List; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 11:47 - */ -@Service -public class UserRelationPropsAdminService extends BaseService { - - public static final Logger logger = LoggerFactory.getLogger(UserRelationPropsAdminService.class); - - @Autowired - private UserRelationPropsService userRelationPropsService; - - - - public List propsList() { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().ne(UserRelationProps::getStatus, Constant.UserRelationPropsStatus.del); - - return userRelationPropsService.list(queryWrapper); - } - - - public void saveProps(UserRelationProps userRelationProps) { - if (ObjectUtil.isNull(userRelationProps.getId())) { - //新增 - userRelationProps.setStatus(Constant.UserRelationPropsStatus.invalid); - userRelationPropsService.save(userRelationProps); - }else { - //编辑 - userRelationPropsService.updateById(userRelationProps); - } - - } - - - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void statusSwitch(Integer id, Byte status) { - UserRelationProps userRelationProps = userRelationPropsService.getById(id); - - if (ObjectUtil.isNull(userRelationProps)) throw new ServiceException("获取不到相关信息"); - - if (Constant.UserRelationPropsStatus.valid.equals(status)) { - //如果是启用,停用同类型其他在启用的道具 - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda().eq(UserRelationProps::getStatus, Constant.UserRelationPropsStatus.valid).ne(UserRelationProps::getId, id); - - UserRelationProps updateEntity = new UserRelationProps(); - updateEntity.setStatus(Constant.UserRelationPropsStatus.invalid); - updateEntity.setUpdateTime(new Date()); - - userRelationPropsService.update(updateEntity, updateWrapper); - } - - - userRelationProps.setStatus(status); - userRelationProps.setUpdateTime(new Date()); - userRelationPropsService.updateById(userRelationProps); - } - - - public UserRelationProps getPropsInfo(Integer id) { - return userRelationPropsService.getById(id); - } - - -} diff --git a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawBlockAdminService.java b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawBlockAdminService.java index 9e0379546..934a43c36 100644 --- a/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawBlockAdminService.java +++ b/accompany-admin/accompany-admin-service/src/main/java/com/accompany/admin/service/withdraw/WithdrawBlockAdminService.java @@ -1,8 +1,8 @@ package com.accompany.admin.service.withdraw; +import com.accompany.core.exception.AdminServiceException; import com.alipay.api.internal.util.StringUtils; import com.accompany.admin.common.AdminConstants; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.mapper.WithdrawBlockMapper; import com.accompany.admin.mapper.WithdrawBlockMapperExpand; import com.accompany.admin.model.WithdrawBlock; @@ -11,7 +11,6 @@ import com.accompany.admin.service.base.BaseService; import com.accompany.admin.vo.withdraw.WithdrawBlockVo; import com.accompany.core.model.Users; import com.accompany.business.service.user.UserQueryService; -import com.accompany.business.service.user.UsersService; import com.github.pagehelper.PageHelper; import org.apache.cxf.common.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -30,8 +29,6 @@ public class WithdrawBlockAdminService extends BaseService { @Autowired private WithdrawBlockMapperExpand withdrawBlockMapperExpand; @Autowired - private UsersService usersService; - @Autowired private UserQueryService userQueryService; @@ -87,7 +84,7 @@ public class WithdrawBlockAdminService extends BaseService { public void insertBlock(String erbanNoList,String remark){ List strList = Arrays.asList(erbanNoList.split(",")); if(strList.size() > 500){ - throw new BusinessException("输入用户已超500个"); + throw new AdminServiceException("输入用户已超500个"); } List erbanNos = new ArrayList<>(); for(String erbanNoStr:strList){ @@ -96,7 +93,7 @@ public class WithdrawBlockAdminService extends BaseService { } List usersList = this.userQueryService.getBatchUsersByErbanNoFromDB(erbanNos); if(CollectionUtils.isEmpty(usersList)){ - throw new BusinessException("不存在这批用户"); + throw new AdminServiceException("不存在这批用户"); } Map usersMap = usersList.stream().collect(Collectors.toMap(Users::getErbanNo, users -> users)); diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendModuleExpand.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendModuleExpand.xml deleted file mode 100644 index c6384e9b2..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendModuleExpand.xml +++ /dev/null @@ -1 +0,0 @@ - id, name, type, seq_no, status, big_picture_num,show_type, list_num, delete_flag, create_time, update_time update recommend_module set delete_flag=1 where type=3 and id in #{item} \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendRoomExpand.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendRoomExpand.xml deleted file mode 100644 index ca4388b82..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/RecommendRoomExpand.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-service/src/main/resources/mapper/TopicRoomExpand.xml b/accompany-admin/accompany-admin-service/src/main/resources/mapper/TopicRoomExpand.xml deleted file mode 100644 index a467d9f89..000000000 --- a/accompany-admin/accompany-admin-service/src/main/resources/mapper/TopicRoomExpand.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - delete from topic_room where id in - - #{item} - - - - - delete from topic_room where module_id in - - #{item} - - - - - delete from topic_room where module_id = #{moduleId} - - - - - SELECT LAST_INSERT_ID() - - insert into topic_room (module_id, uid, name, - seq_no, status, create_time) - values - - (#{topic.moduleId,jdbcType=BIGINT}, #{topic.uid,jdbcType=BIGINT}, #{topic.name,jdbcType=VARCHAR}, - #{topic.seqNo,jdbcType=INTEGER}, #{topic.status,jdbcType=TINYINT},#{topic.createTime,jdbcType=TIMESTAMP}) - - - - - update topic_room set name=#{title} where module_id = #{moduleId} - - \ No newline at end of file diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ChannelDistributeAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ChannelDistributeAdminController.java index ae117df3f..39ebe3ff8 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ChannelDistributeAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/ChannelDistributeAdminController.java @@ -1,8 +1,6 @@ package com.accompany.admin.controller; -import com.accompany.core.exception.ServiceException; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.dto.ChannelDistributeSearchDto; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.ChannelDistributeAdminService; @@ -67,8 +65,6 @@ public class ChannelDistributeAdminController extends BaseController { try { ChannelDistribute record = channelDistributeAdminService.getById(id); return new BusiResult(BusiStatus.SUCCESS, record); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ActivityPackAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ActivityPackAdminController.java index 002e37cd8..5b524844a 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ActivityPackAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ActivityPackAdminController.java @@ -2,7 +2,6 @@ package com.accompany.admin.controller.activity; import com.accompany.core.exception.ServiceException; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.activity.ActivityPackAdminService; import com.accompany.admin.service.system.AdminLogService; @@ -48,8 +47,6 @@ public class ActivityPackAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(), "saveOrUpdate pack","params===>>name:"+name+",sellingPrice="+sellingPrice+",stock="+stock+",allowBuyNum="+allowBuyNum); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -62,8 +59,6 @@ public class ActivityPackAdminController extends BaseController { activityPackAdminService.close(packId); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"close pack","params===>>id:"+packId); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -86,8 +81,6 @@ public class ActivityPackAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"savePackItems", "params===>>packId:"+packId+",awardId:"+awardId+",num:"+num); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -100,8 +93,6 @@ public class ActivityPackAdminController extends BaseController { activityPackAdminService.delPackItem(itemId); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"delPackItem","params===>>itemId:"+itemId); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityAdminController.java index 5a19be347..4237951b0 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityAdminController.java @@ -1,7 +1,6 @@ package com.accompany.admin.controller.activity; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.dto.ChargeActivitySearchDto; import com.accompany.admin.model.AdminUser; @@ -64,8 +63,6 @@ public class ChargeActivityAdminController extends BaseController { String.format("params===>>name:%s, id:%s, roomRule:%s, userRule:%s", record.getActName(), record.getActId(), record.getRoomRule(), record.getUserRule())); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -80,8 +77,6 @@ public class ChargeActivityAdminController extends BaseController { try { chargeActivityService2.deleteById(id); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -93,8 +88,6 @@ public class ChargeActivityAdminController extends BaseController { try { ChargeActivityWithBLOBs record = chargeActivityService2.getById(id); return new BusiResult(BusiStatus.SUCCESS, record); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityPackRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityPackRecordAdminController.java index 55ec0f58b..508c15c98 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityPackRecordAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/activity/ChargeActivityPackRecordAdminController.java @@ -1,6 +1,5 @@ package com.accompany.admin.controller.activity; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.business.service.activity.ChargeActivityPackRecordService; import com.accompany.common.result.BusiResult; @@ -38,8 +37,6 @@ public class ChargeActivityPackRecordAdminController extends BaseController { } else { return new BusiResult(BusiStatus.NOTEXISTS, result); } - } catch (BusinessException e) { - return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(),null); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -61,8 +58,6 @@ public class ChargeActivityPackRecordAdminController extends BaseController { } else { return new BusiResult(BusiStatus.NOTEXISTS, result); } - } catch (BusinessException e) { - return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(),null); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java index ae93161c7..af836a970 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/anchor/AnchorAdminController.java @@ -2,7 +2,6 @@ package com.accompany.admin.controller.anchor; import com.accompany.core.exception.ServiceException; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.anchor.AnchorAdminService; import com.accompany.business.model.AnchorWhitelist; @@ -62,8 +61,6 @@ public class AnchorAdminController extends BaseController { } else { return new BusiResult(BusiStatus.UNKNOWN, "操作失败!",null); } - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/firstpage/FirstPageBannerAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/firstpage/FirstPageBannerAdminController.java index d7dcf2cc9..61df9c92a 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/firstpage/FirstPageBannerAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/firstpage/FirstPageBannerAdminController.java @@ -57,7 +57,7 @@ public class FirstPageBannerAdminController extends BaseController { firstPageBanner.setOperator(adminName); List partitionIds = firstPageBanner.getPartitionIds(); if (CollectionUtils.isEmpty(partitionIds)) { - return new BusiResult(BusiStatus.ALERT_SIGN_FAIL,"展示分区不能为空"); + return new BusiResult(BusiStatus.PARAMERROR,"展示分区不能为空"); } Boolean result = firstPageBannerAdminService.saveOrUpdateFirstPageBanner(firstPageBanner,startTimeString,endTimeString); if(result) { diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftAdminController.java index d44618eeb..c4cbb2df2 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftAdminController.java @@ -12,14 +12,12 @@ import com.accompany.common.utils.StringUtils; import com.accompany.core.model.Users; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.common.Combobox; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.gift.GiftAdminService; import com.accompany.admin.service.system.AdminLogService; import com.accompany.core.exception.ServiceException; import com.accompany.business.model.*; -import com.accompany.core.service.SysConfService; import com.accompany.business.service.gift.GiftSendRecordService; import com.accompany.business.service.user.UsersService; import com.accompany.business.vo.room.RoomExclusiveGiftVo; @@ -35,7 +33,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; @@ -202,10 +199,6 @@ public class GiftAdminController extends BaseController { writeJson(true, "保存成功"); return; } - } catch (BusinessException e) { - logger.debug("Failed to save gift. Cause by BusinessException"); - writeJson(false, e.getMessage()); - return; } catch (Exception e) { logger.error("Failed to save gift. Cause by {}", e.getCause().getMessage()); } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftNotifyConfigAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftNotifyConfigAdminController.java index 7f7713637..5f755b098 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftNotifyConfigAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/GiftNotifyConfigAdminController.java @@ -1,7 +1,6 @@ package com.accompany.admin.controller.gift; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.gift.GiftNotifyConfigAdminService; import com.accompany.admin.vo.GiftNotifyConfigAdminVo; @@ -50,9 +49,6 @@ public class GiftNotifyConfigAdminController extends BaseController { writeJson(true, "保存成功"); return; } - } catch(BusinessException be) { - writeJson(false, be.getMessage()); - return; } catch(Exception e) { logger.error("Failed to save giftNotifyConfig. Cause by {}", e.getCause().getMessage()); } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/MagicAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/MagicAdminController.java index 2e921fbf6..678484d70 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/MagicAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/gift/MagicAdminController.java @@ -4,7 +4,6 @@ import cn.hutool.core.util.StrUtil; import com.accompany.common.tencent.cos.TencentCosUploadService; import com.accompany.common.utils.PinYin4JUtil; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.gift.MagicAdminService; import com.accompany.business.model.GiftMagic; @@ -67,10 +66,6 @@ public class MagicAdminController extends BaseController { writeJson(true, "保存成功"); return; } - } catch(BusinessException e) { - logger.debug("Failed to save magic. Cause by BusinessException"); - writeJson(false, e.getMessage()); - return; } catch(Exception e) { logger.error("Failed to save magic. Cause by {}", e.getCause().getMessage()); } diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/newLuckyBag/NewLuckyBagAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/newLuckyBag/NewLuckyBagAdminController.java index c392f8d04..f5ee31903 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/newLuckyBag/NewLuckyBagAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/newLuckyBag/NewLuckyBagAdminController.java @@ -1,6 +1,5 @@ package com.accompany.admin.controller.newLuckyBag; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.gift.GiftAdminService; import com.accompany.admin.service.newLuckyBag.NewLuckyBagDeviateAdminService; @@ -79,8 +78,6 @@ public class NewLuckyBagAdminController extends BaseController { adminLogService.insertLog(getAdminId(), adminName, "delLuckyBagPoolItem", "params===>>id:" + id + ", luckyBagId:" + luckyBagId + ", giftId:" + giftId); return new BaseResponseVO(BusinessStatusCodeEnum.SUCCESS); - } catch (BusinessException e) { - return new BaseResponseVO(500, e.getMessage(), null); } catch (Exception e) { logger.error("save SuitItem failed", e); return new BaseResponseVO(BusinessStatusCodeEnum.BUSIERROR); @@ -106,8 +103,6 @@ public class NewLuckyBagAdminController extends BaseController { "params===>>id:" + id + ", luckyBagId:" + luckyBagId + ", giftId:" + giftId + ", occupationRatio:" + occupationRatio + ", prizeLevel:" + prizeLevel); return new BaseResponseVO(BusinessStatusCodeEnum.SUCCESS); - } catch (BusinessException e) { - return new BaseResponseVO(500, e.getMessage(), null); } catch (Exception e) { logger.error("save SuitItem failed", e); return new BaseResponseVO(BusinessStatusCodeEnum.BUSIERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/pretty/PrettyNumberAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/pretty/PrettyNumberAdminController.java index d1bfc40ec..68c0028ba 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/pretty/PrettyNumberAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/pretty/PrettyNumberAdminController.java @@ -1,7 +1,6 @@ package com.accompany.admin.controller.pretty; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.PrettyNumberAdminService; @@ -10,7 +9,6 @@ import com.accompany.admin.service.system.AdminUserService; import com.accompany.core.model.PrettyNumber; import com.accompany.core.model.PrettyNumberRecord; import com.github.pagehelper.PageInfo; -import com.accompany.common.result.BusiResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -74,10 +72,6 @@ public class PrettyNumberAdminController extends BaseController { writeJson(true, "保存成功"); return; } - } catch (BusinessException e) { - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; } catch (Exception e) { logger.error("Failed to save prettyNumber. Cause by {}", e.getCause().getMessage()); } @@ -140,10 +134,6 @@ public class PrettyNumberAdminController extends BaseController { AdminUser adminUser = this.adminUserService.getAdminUserById(adminId); prettyNumberAdminService.bind(prettyId, erbanNo, desc, startTime, endTime, adminUser.getUsername()); adminLogService.insertLog(getAdminId(), getClass().getCanonicalName(), "bindPrettyNumber", "params===>>prettyId:" + prettyId + ", msNo:" + erbanNo + ", startTime:" + startTime + ", endTime:" + endTime); - } catch (BusinessException e) { - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; } catch (Exception e) { logger.error("Failed to bind prettyId: {} to erbanNo: {}.", prettyId, erbanNo, e); } @@ -163,10 +153,6 @@ public class PrettyNumberAdminController extends BaseController { AdminUser adminUser = this.adminUserService.getAdminUserById(adminId); prettyNumberAdminService.unBind(prettyId, desc, adminUser.getUsername(), false); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"unbind","params===>>prettyId:" + prettyId); - } catch(BusinessException e){ - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; } catch(Exception e) { logger.error("Failed to unBind prettyId: {}.", prettyId, e); writeJson(false, e.getMessage()); @@ -189,10 +175,6 @@ public class PrettyNumberAdminController extends BaseController { AdminUser adminUser = this.adminUserService.getAdminUserById(adminId); prettyNumberAdminService.unBind(prettyId, desc, adminUser.getUsername(), true); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"unbindForAll","params===>>prettyId:" + prettyId); - } catch(BusinessException e){ - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; } catch(Exception e) { logger.error("Failed to unBind prettyId: {}.", prettyId, e); writeJson(false, e.getMessage()); @@ -214,11 +196,7 @@ public class PrettyNumberAdminController extends BaseController { AdminUser adminUser = this.adminUserService.getAdminUserById(adminId); prettyNumberAdminService.occupy(prettyId, erbanNo, adminUser.getUsername()); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"occupyPrettyNumber","params===>>prettyId:" + prettyId + ", msNo:" + erbanNo); - } catch(BusinessException e){ - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; - } catch(Exception e) { + } catch(Exception e) { logger.error("Failed to bind prettyId: {} to erbanNo: {}.", prettyId, erbanNo, e); writeJson(false, e.getMessage()); return; @@ -237,10 +215,6 @@ public class PrettyNumberAdminController extends BaseController { AdminUser adminUser = this.adminUserService.getAdminUserById(adminId); prettyNumberAdminService.cancelOccupy(prettyId, adminUser.getUsername()); adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"cancelOccupy","params===>>prettyId:" + prettyId); - } catch(BusinessException e){ - logger.error(e.getMessage()); - writeJson(false, e.getMessage()); - return; } catch(Exception e) { logger.error("Failed to unBind prettyId: {}.", prettyId, e); writeJson(false, e.getMessage()); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/PrizePoolItemAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/PrizePoolItemAdminController.java index 1b0885aec..afaed91b4 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/PrizePoolItemAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/PrizePoolItemAdminController.java @@ -1,6 +1,5 @@ package com.accompany.admin.controller.prize; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.prize.PrizePoolItemAdminService; import com.accompany.admin.service.system.AdminLogService; @@ -42,8 +41,6 @@ public class PrizePoolItemAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"savePoolItem", "params===>>poolType:" + poolType + ", id:" + id + ", prizeId:" + prizeId); return new BusiResult(BusiStatus.SUCCESS); - }catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error("save prizepoolitem failed",e); return new BusiResult(BusiStatus.BUSIERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java index e57c63395..cdc1d0ccc 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/prize/UserCardsAdminController.java @@ -1,7 +1,6 @@ package com.accompany.admin.controller.prize; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.prize.UserCardsAdminService; import com.accompany.admin.service.system.AdminLogService; @@ -13,7 +12,6 @@ import com.accompany.business.model.UserBackpack; import com.accompany.core.model.Users; import com.accompany.business.service.gift.GiftService; import com.accompany.core.service.user.UsersBaseService; -import com.accompany.business.service.user.UsersService; import com.accompany.core.util.StringUtils; import com.github.pagehelper.PageInfo; import com.google.common.collect.Maps; @@ -38,8 +36,6 @@ public class UserCardsAdminController extends BaseController { @Autowired private UserCardsAdminService userCardsAdminService; - @Autowired - private UsersService usersService; @Autowired private UsersBaseService usersBaseService; @@ -86,11 +82,9 @@ public class UserCardsAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"exchangeCard", "params===>>uid:"+uid+",exchangeType:"+exchangeType+",exchangeRefId:"+exchangeRefId+",exchangeNum:"+exchangeNum+",eliminateCards:"+eliminateCards); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException | AdminServiceException e){ + } catch (AdminServiceException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); - } catch (ServiceException s){ - return new BusiResult(s.getBusiStatus()); - }catch (Exception e){ + } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.BUSIERROR); } @@ -105,8 +99,6 @@ public class UserCardsAdminController extends BaseController { adminLogService.insertLog(getAdminId(),getClass().getCanonicalName(),"eliminateCard", "params===>>uid"+uid+",eliminateCards:"+eliminateCards); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (AdminServiceException e){ throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ @@ -172,8 +164,6 @@ public class UserCardsAdminController extends BaseController { OpenBoxKeyTypeEnum.DIAMOND.getValue() + ",exchangeNum:" + userBackpack.getCount() + ",eliminateCards:"+eliminateCards); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException | AdminServiceException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (ServiceException s){ return new BusiResult(s.getBusiStatus()); }catch (Exception e){ diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/recommend/RecommendAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/recommend/RecommendAdminController.java deleted file mode 100644 index ea318d53a..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/recommend/RecommendAdminController.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.accompany.admin.controller.recommend; - -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.recommend.RecommendAdminService; -import com.accompany.admin.vo.RecommendRecordAdminVo; -import com.accompany.business.model.RecommendOccupy; -import com.accompany.business.model.RecommendRecord; -import com.accompany.core.model.Users; -import com.accompany.core.service.user.UsersBaseService; -import com.github.pagehelper.PageInfo; -import com.accompany.common.status.BusiStatus; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * 推荐位后台管理 - */ -@RestController -@RequestMapping("/admin/recommend/") -public class RecommendAdminController extends BaseController { - - @Autowired - private RecommendAdminService recommendAdminService; - @Autowired - private UsersBaseService usersBaseService; - - /** - * 推荐记录列表 - * @param msNo - * @param status - * @param startTime - * @param endTime - */ - @RequestMapping(value = "record/list", method = RequestMethod.GET) - public void recordList(Long msNo, Byte status, Date startTime, Date endTime) { - Long uid = null; - if(msNo != null) { - Users user = usersBaseService.getUsersByErBanNo(msNo); - if (user == null) { - throw new BusinessException("未找到该用户"); - } - uid = user.getUid(); - } - PageInfo pageInfo = recommendAdminService.recordList(uid, status, startTime, endTime, getPageNumber(),getPageSize()); - List voList = recommendAdminService.convertToVo(pageInfo.getList()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows",voList); - writeJson(jsonObject.toJSONString()); - } - - /** - * 获取推荐记录详情 - * @param id - */ - @RequestMapping(value = "record/get", method = RequestMethod.GET) - public void get(Long id) { - JSONObject jsonObject = new JSONObject(); - RecommendRecordAdminVo adminVo = recommendAdminService.get(id); - if(adminVo != null) { - jsonObject.put("entity", adminVo); - } - writeJson(jsonObject.toJSONString()); - } - - /** - * 占用记录列表 - * @param startTime - * @param endTime - */ - @RequestMapping(value = "occupy/list", method = RequestMethod.GET) - public void occupyList(@RequestParam("startTime")Date startTime, - @RequestParam("endTime") Date endTime) { - PageInfo pageInfo = recommendAdminService.occupyList(startTime, endTime, getPageNumber(),getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows",pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - /** - * 推荐 - * @param erbanNo - * @param startTime - * @param endTime - * @param seqNo - * @param createdBy - * @param notifyMsg - */ - @RequestMapping(value = "apply", method = RequestMethod.POST) - public void apply(@RequestParam("erbanNo")Long erbanNo, - @RequestParam("startTime") Date startTime, - @RequestParam("endTime") Date endTime, - @RequestParam(value = "seqNo", required = false, defaultValue = "0") Integer seqNo, - String createdBy, - String notifyMsg) { - try { - Users user = usersBaseService.getUsersByErBanNo(erbanNo); - if(user == null) { - throw new BusinessException(BusiStatus.USERNOTEXISTS.getReasonPhrase()); - } - recommendAdminService.applyByAdmin(user.getUid(), startTime, endTime, seqNo, createdBy, notifyMsg); - writeJson(true, "申请成功"); - } catch (BusinessException be) { - logger.error(be.getMessage()); - writeJson(false, be.getMessage()); - return; - } - } - - /** - * 下架 - * @param id - */ - @RequestMapping(value = "obtained", method = RequestMethod.POST) - public void obtained(@RequestParam("id") Long id) { - try { - int ret = recommendAdminService.obtained(id); - if(ret > 0) { - writeJson(true, "下架成功"); - return; - } - } catch(BusinessException be) { - logger.error(be.getMessage()); - writeJson(false, be.getMessage()); - return; - } - writeJson(true, "下架失败"); - } - - /** - * 顶推荐位 - * @param id - */ - @RequestMapping(value = "topping", method = RequestMethod.POST) - public void topping(@RequestParam("id")Long id) { - try { - int ret = recommendAdminService.topping(id); - if(ret > 0) { - writeJson(true, "顶位成功"); - return; - } - - } catch(BusinessException be) { - logger.error(be.getMessage()); - writeJson(false, be.getMessage()); - return; - } - writeJson(true, "顶位失败"); - } - - /** - * 后台赠送推荐卡功能 - * @param cardName - * @param erbanNos - * @param validStartTime - * @param validEndTime - * @param createdBy - * @param period - */ - @RequestMapping(value = "official") - public void official(String cardName,@RequestParam("erbanNos")String erbanNos, - @RequestParam("validStartTime")Date validStartTime, - @RequestParam("validEndTime")Date validEndTime, - @RequestParam("cardNum") Integer cardNum, - String createdBy, - Integer period, - String notifyMsg) { - String[] erbanNoList = erbanNos.split("\r\n"); - Map retMap = null; - try { - retMap = recommendAdminService.batchOfficial(Arrays.asList(erbanNoList), cardName, validStartTime, validEndTime, cardNum, createdBy, period, notifyMsg); - Integer failCount = Integer.parseInt(retMap.get("failCount").toString()); - if(failCount>0){ - retMap.put("code","200");//部分成功 - retMap.put("erban",retMap.get("failErbanNo").toString()); - retMap.put("message",retMap.get("failReason").toString()); - }else{ - retMap.put("code","100");//全部成功 - } - } catch(BusinessException be) { - logger.error("send error:{}",be); - retMap.put("code","300");//全部失败 - retMap.put("message",be.getMessage()); - } - writeJson(JSONObject.toJSONString(retMap)); - } - - /** - * 取消占用 - * @param id - */ - @RequestMapping(value = "occupy/del", method = RequestMethod.POST) - public void del(Long id) { - try { - int ret = recommendAdminService.cancelOccupy(id); - if (ret > 0) { - writeJson(true, "取消占用成功"); - return; - } - } catch(BusinessException be) { - logger.error(be.getMessage()); - writeJson(false, be.getMessage()); - return; - } - writeJson(true, "取消占用失败"); - } - - /** - * 新增占用 - * @param startTime - * @param endTime - * @param occupyNum - * @param createdBy - */ - @RequestMapping(value = "occupy/add", method = RequestMethod.POST) - public void occupy(Date startTime, Date endTime, Integer occupyNum, String createdBy) { - try { - Date curDate = new Date(); - if(startTime.compareTo(curDate) <= 0) { - throw new BusinessException("选择的时间整点不能小于当前时间"); - } - int ret = recommendAdminService.occupy(occupyNum, startTime, endTime, createdBy); - if (ret > 0) { - writeJson(true, "占用成功"); - return; - } - } catch(BusinessException be) { - logger.error(be.getMessage()); - writeJson(false, be.getMessage()); - return; - } - writeJson(true, "占用失败"); - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RecommendRoomAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RecommendRoomAdminController.java deleted file mode 100644 index 039f459c1..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RecommendRoomAdminController.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.accompany.admin.controller.room; - -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.room.RecommendRoomAdminService; -import com.accompany.admin.vo.RecommendRoomVo; -import com.accompany.business.model.RoomOptmizeStatistic; -import com.github.pagehelper.PageInfo; -import com.accompany.common.constant.Constant; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import org.apache.poi.hssf.usermodel.HSSFRow; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.OutputStream; -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * @author yangziwen - * @description - * @date 2018/7/11 11:34 - */ -@RestController -@RequestMapping("/admin/recommend/room") -public class RecommendRoomAdminController extends BaseController{ - - public static final Logger logger = LoggerFactory.getLogger(RecommendRoomAdminController.class); - - @Autowired - private RecommendRoomAdminService recommendRoomAdminService; - - @RequestMapping("list") - public void listRecommendRooms(Date beginTime, Date endTime, Long roomErbanNo, Byte roomType) { -// return new BusiResult(BusiStatus.SUCCESS, this.recommendRoomAdminService.listRecommendRooms(beginTime, endTime, roomErbanNo, roomType,getPageNumber(),getPageSize())); - PageInfo pageInfo = this.recommendRoomAdminService.listRecommendRooms(beginTime, endTime, roomErbanNo, roomType,getPageNumber(),getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows",pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "save", method = RequestMethod.POST) - public BusiResult saveRoom(Long id, Long roomErbanNo, Byte roomType, Integer seq, Integer weight, Byte recommendStatus) { - try{ - this.recommendRoomAdminService.saveRecommendRoom(id, roomErbanNo, roomType, seq, weight, recommendStatus); - return new BusiResult(BusiStatus.SUCCESS); - }catch (Exception e){ - logger.error("save roomrecomm error",e); - return new BusiResult(BusiStatus.BUSIERROR); - } - - } - - @RequestMapping(value = "statis/list", method = RequestMethod.GET) - public void queryOptmizeList(String startDateStr,String endDateStr,Integer checkType,Long erbanNo,Byte roomType){ - Date startDate = DateTimeUtil.convertStrToDate(startDateStr + " 00:00:00"); - Date endDate = DateTimeUtil.convertStrToDate(endDateStr + " 23:59:59"); - Map map = this.recommendRoomAdminService.queryStatisList(startDate,endDate,checkType,erbanNo,roomType,getPageNumber(),getPageSize()); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total",map.get("total")); - jsonObject.put("rows",map.get("list")); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "/export",method = RequestMethod.GET) - public void export(HttpServletRequest request, HttpServletResponse response, String startDateStr, String endDateStr, Integer checkType, Long erbanNo, Byte roomType) throws Exception{ - Date startDate = DateTimeUtil.convertStrToDate(startDateStr + " 00:00:00"); - Date endDate = DateTimeUtil.convertStrToDate(endDateStr + " 23:59:59"); - Map map = this.recommendRoomAdminService.queryStatisList(startDate,endDate,checkType,erbanNo,roomType,1,5000); - List list = (List)map.get("list"); - HSSFWorkbook workbook = this.buildExcel(list,roomType); - - // 设置下载时客户端Excel的名称 - String filename = "room_optmize_statistic.xls"; - response.setContentType("application/vnd.ms-excel"); - response.setHeader("Content-disposition", "attachment;filename=" + filename); - response.setCharacterEncoding("UTF-8"); - OutputStream ouputStream = response.getOutputStream(); - workbook.write(ouputStream); - ouputStream.flush(); - ouputStream.close(); - } - - private HSSFWorkbook buildExcel(List list, Byte roomType){ - HSSFWorkbook workbook = new HSSFWorkbook(); - HSSFSheet sheet = workbook.createSheet("房间导流统计名单"); - String[] headers = {"编号","日期","导流房间","房间类型","导流用户数(人)","付款用户数(人)","付款次数(次)","付款金额(元)"}; - HSSFRow header = sheet.createRow(0); - for(int i = 0;i < headers.length;i++){ - header.createCell(i).setCellValue(headers[i]); - } - - int rowNum = 1; - - for(RoomOptmizeStatistic roomOptmizeStatistic:list){ - HSSFRow row = sheet.createRow(rowNum++); - row.createCell(0).setCellValue(rowNum); - row.createCell(1).setCellValue(DateTimeUtil.convertDate(roomOptmizeStatistic.getCreateDate(),"yyyy-MM-dd")); - - String roomMsg = roomOptmizeStatistic.getRoomName() + "\r\n" + "ID:" + roomOptmizeStatistic.getErbanNo(); - row.createCell(2).setCellValue(roomMsg); - - String type = ""; - if(Constant.UserGender.MALE.equals(roomOptmizeStatistic.getRoomType())){ - type = "男模"; - }else if(Constant.UserGender.FEMALE.equals(roomOptmizeStatistic.getRoomType())){ - type = "女模"; - }else { - type = "全部"; - } - row.createCell(3).setCellValue(type); - - row.createCell(4).setCellValue(roomOptmizeStatistic.getAddUserNum()); - row.createCell(5).setCellValue(roomOptmizeStatistic.getPayUserNum()); - row.createCell(6).setCellValue(roomOptmizeStatistic.getPayCountTime()); - row.createCell(7).setCellValue(((double)roomOptmizeStatistic.getPayAmount())/10); - } - - return workbook; - } - - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java index 2e014a704..df68c1240 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/RoomAdminController.java @@ -1,9 +1,7 @@ package com.accompany.admin.controller.room; - import cn.hutool.core.util.StrUtil; import com.accompany.admin.base.Pagination; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.RobotAdminService; import com.accompany.admin.service.room.RoomAdminService; @@ -173,9 +171,6 @@ public class RoomAdminController extends BaseController { if (result > 0) { return BusiResult.success(); } - } catch (BusinessException e) { - logger.error(e.getMessage(), e); - return BusiResult.fail(e.getMessage()); } catch (Exception e) { logger.error("Failed to resetNewRoom.Cause by {}", e.getMessage(), e); return BusiResult.fail(e.getMessage()); @@ -197,9 +192,6 @@ public class RoomAdminController extends BaseController { if (result > 0) { return new BusiResult<>(BusiStatus.SUCCESS); } - } catch (ServiceException | BusinessException e) { - logger.error(e.getMessage(), e); - return BusiResult.fail(e.getMessage()); } catch (Exception e) { logger.error("Failed to resetNewRoom.Cause by {}", e.getMessage(), e); return BusiResult.fail(e.getMessage()); @@ -284,8 +276,6 @@ public class RoomAdminController extends BaseController { } return new BusiResult<>(BusiStatus.SUCCESS); } - } catch (BusinessException e) { - return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(), null); } catch (Exception e) { logger.error("Failed to resetNewRoom.Cause by {}", e.getMessage()); } @@ -297,8 +287,6 @@ public class RoomAdminController extends BaseController { try { roomAdminService.saveRoomToHide(erbanNo, hideLocation, app); writeJson(true, "保存成功"); - } catch (BusinessException be) { - writeJson(false, be.getMessage()); } catch (Exception e) { logger.error("Failed to save room to hide. Cause by {}", e.getMessage()); writeJson(false, "程序出错"); @@ -310,8 +298,6 @@ public class RoomAdminController extends BaseController { try { roomAdminService.removeRoomToHide(uid, hideLocation, app); writeJson(true, "保存成功"); - } catch (BusinessException be) { - writeJson(false, be.getMessage()); } catch (Exception e) { logger.error("Failed to save room to hide. Cause by {}", e.getMessage()); writeJson(false, "程序出错"); @@ -332,8 +318,6 @@ public class RoomAdminController extends BaseController { try { roomAdminService.unchangeRoomSave(erbanNo); writeJson(true, "保存成功"); - } catch (BusinessException be) { - writeJson(false, be.getMessage()); } catch (Exception e) { logger.error("Failed to save room to hide. Cause by {}", e.getMessage()); writeJson(false, "程序出错"); @@ -345,8 +329,6 @@ public class RoomAdminController extends BaseController { try { roomAdminService.removeUnchangeRoom(uid); writeJson(true, "保存成功"); - } catch (BusinessException be) { - writeJson(false, be.getMessage()); } catch (Exception e) { logger.error("Failed to save room to hide. Cause by {}", e.getMessage()); writeJson(false, "程序出错"); @@ -367,8 +349,6 @@ public class RoomAdminController extends BaseController { try { roomAdminService.updateRoomOnlineNum(uid); writeJson(true, "同步房间人数成功"); - } catch (BusinessException be) { - writeJson(false, be.getMessage()); } catch (Exception e) { logger.error("Failed to update room to onlineNum. Cause by {}", e.getMessage()); writeJson(false, "程序出错"); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/TopicRoomController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/TopicRoomController.java deleted file mode 100644 index 50cb4f72b..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/room/TopicRoomController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.accompany.admin.controller.room; - -import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.controller.BaseController; -import com.accompany.admin.service.room.RecommendModuleAdminService; -import com.accompany.admin.service.room.TopicRoomService; -import com.accompany.admin.util.ExcelUtils; -import com.accompany.core.util.StringUtils; -import com.accompany.business.vo.TopicRoomVo; -import com.github.pagehelper.PageInfo; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import org.apache.poi.ss.usermodel.Workbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by chuangBiao on 2019/2/13 - */ -@Controller -@RequestMapping("/admin/topic/room") -public class TopicRoomController extends BaseController { - @Autowired - TopicRoomService topicRoomService; - @Autowired - RecommendModuleAdminService recommendModuleAdminService; - - @RequestMapping(value = "/getAll", method = RequestMethod.GET) - @ResponseBody - public void getAllRoom(String title, Long erbanNo) { - PageInfo pageInfo = topicRoomService.getTopicRoomList(getPageNumber(), getPageSize(), title, erbanNo); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("total", pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getList()); - writeJson(jsonObject.toJSONString()); - } - - @RequestMapping(value = "/changeRoomStatus", method = RequestMethod.POST) - @ResponseBody - public BusiResult changeRoomStatus(int status, Long id) { - BusiResult busiResult = topicRoomService.editTopicRoom(status, id, null); - return busiResult; - } - - @RequestMapping(value = "/editRecommendRoom") - @ResponseBody - public BusiResult editRecommendModule(int status, Long id, Integer seqNo) { - BusiResult busiResult = topicRoomService.editTopicRoom(status, id, seqNo); - return busiResult; - } - - @RequestMapping(value = "/saveTopicRoom", method = RequestMethod.POST) - @ResponseBody - public BusiResult saveTopicRoom(String moduleName,Long moduleId, String uids, Integer status) { - if (StringUtils.isEmpty(uids) || moduleId == null) { - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - BusiResult busiResult = topicRoomService.saveTopicRoom(moduleName,status,moduleId, uids); - return busiResult; - } - - @RequestMapping(value = "/delRoom", method = RequestMethod.POST) - @ResponseBody - public BusiResult delRoom(HttpServletRequest request, String moduleIds){ - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - List ids = getRequestArray(request, "ids", Long.class); - if(CollectionUtils.isEmpty(ids)) { - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - - if(StringUtils.isEmpty(moduleIds)) { - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - List uids = getRequestArray(request, "uids", Long.class); - if(CollectionUtils.isEmpty(uids)) { - return new BusiResult(BusiStatus.PARAMETERILLEGAL); - } - topicRoomService.delRoom(ids,moduleIds,uids); - return busiResult; - } - - @RequestMapping(value = "/getTitles", method = RequestMethod.GET) - @ResponseBody - public void getCarGoodsList() { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("rows", this.recommendModuleAdminService.getRecommendModuleTopics()); - writeJson(jsonObject.toJSONString()); - } - - /** - * 导出推荐页记录 - * - * @param request - * @param response - * @param title - */ - @RequestMapping(value = "export", method = RequestMethod.GET) - public void export(HttpServletRequest request, HttpServletResponse response, String title, Long erbanNo) { - try { - List headerList = new ArrayList<>(); - headerList.add("排序"); - headerList.add("平台号"); - headerList.add("话题标题"); - headerList.add("房间标题"); - headerList.add("房间创建时间"); - headerList.add("权重"); - String fileName = "话题房间配置.xls"; - List result = topicRoomService.getTopicRoomList(title, erbanNo); - List excelRows = topicRoomService.buildExcelData(result); - Workbook workbook = ExcelUtils.createExcelSheet(headerList, excelRows); - ExcelUtils.setExcelResponseHeader(request, response, fileName); - java.io.OutputStream out = response.getOutputStream(); - workbook.write(out); - out.flush(); - } catch (Exception e) { - logger.error("Failed to export room_gift_serial. Cause by {}", e.getMessage()); - writeJson(false, "导出失败"); - } - } -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java index e06cb3474..ba488bed3 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/AppVersionAdminController.java @@ -2,8 +2,8 @@ package com.accompany.admin.controller.system; import com.accompany.common.tencent.cos.TencentCosUploadService; import com.accompany.common.utils.GsonUtil; +import com.accompany.core.exception.AdminServiceException; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.system.AdminLogService; @@ -72,7 +72,7 @@ public class AppVersionAdminController extends BaseController { try { // 保存版本记录 if (StringUtils.isBlank(versionVo.getPlatform())) { - throw new BusinessException("未选择平台"); + throw new AdminServiceException("未选择平台"); } int adminId = getAdminId(); //AdminUser adminUser = adminUserService.getAdminUserById(adminId); @@ -83,7 +83,7 @@ public class AppVersionAdminController extends BaseController { writeJson(true, "保存成功"); return; } - } catch (BusinessException e) { + } catch (AdminServiceException e) { writeJson(false, e.getMessage()); return; } catch (Exception e) { @@ -165,7 +165,7 @@ public class AppVersionAdminController extends BaseController { writeJson(true, "设置成功"); return; } - } catch (BusinessException e) { + } catch (AdminServiceException e) { writeJson(false, e.getMessage()); return; } catch (Exception e) { diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/SysConfAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/SysConfAdminController.java index 6e153ab54..de67131f4 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/SysConfAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/system/SysConfAdminController.java @@ -9,7 +9,6 @@ import com.accompany.core.mybatismapper.SysConfMapper; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/AccountAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/AccountAdminController.java index ea34e6e46..7636e699c 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/AccountAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/AccountAdminController.java @@ -1,6 +1,5 @@ package com.accompany.admin.controller.user; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.user.AccountAdminService; import com.accompany.core.util.StringUtils; @@ -35,8 +34,6 @@ public class AccountAdminController extends BaseController { try { accountAdminService.resetPassword(uid, password); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - return new BusiResult(BusiStatus.SERVERERROR, e.getMessage(),null); } catch (Exception e) { logger.error("重置密码失败!", e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/FrozenAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/FrozenAdminController.java index cb5f686e4..a82fc31b6 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/FrozenAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/FrozenAdminController.java @@ -1,8 +1,6 @@ package com.accompany.admin.controller.user; -import com.accompany.core.exception.ServiceException; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.user.UserFrozenAdminService; import com.accompany.business.model.UserFrozenRecord; @@ -47,8 +45,6 @@ public class FrozenAdminController extends BaseController { } else { return new BusiResult(BusiStatus.UNKNOWN, "添加失败!",null); } - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -64,8 +60,6 @@ public class FrozenAdminController extends BaseController { } else { return new BusiResult(BusiStatus.UNKNOWN, "解除失败!",null); } - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/TopicBoxItemAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/TopicBoxItemAdminController.java index 0dbf4244e..01e1f472d 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/TopicBoxItemAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/TopicBoxItemAdminController.java @@ -1,7 +1,6 @@ package com.accompany.admin.controller.user; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.model.AdminUser; import com.accompany.admin.service.system.AdminUserService; @@ -56,8 +55,6 @@ public class TopicBoxItemAdminController extends BaseController { record.setOperator(adminUser.getUsername()); topicBoxItemAdminService.save(record); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -73,8 +70,6 @@ public class TopicBoxItemAdminController extends BaseController { try { topicBoxItemAdminService.deleteById(id); return new BusiResult(BusiStatus.SUCCESS); - } catch (BusinessException e){ - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e){ logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -87,8 +82,6 @@ public class TopicBoxItemAdminController extends BaseController { try { TopicBoxItem record = topicBoxItemAdminService.getById(id); return new BusiResult(BusiStatus.SUCCESS, record); - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCertifyRecordAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCertifyRecordAdminController.java index 0326595a8..2dcb0735b 100644 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCertifyRecordAdminController.java +++ b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCertifyRecordAdminController.java @@ -2,11 +2,8 @@ package com.accompany.admin.controller.user; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; -import com.accompany.business.service.user.UsersService; -import com.accompany.core.exception.ServiceException; import com.accompany.core.service.user.UsersBaseService; import com.alibaba.fastjson.JSONObject; -import com.accompany.admin.common.BusinessException; import com.accompany.admin.controller.BaseController; import com.accompany.admin.service.user.UserCertifyRecordAdminService; import com.accompany.admin.vo.UserCertifyRecordVo; @@ -21,7 +18,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; @@ -75,8 +71,6 @@ public class UserCertifyRecordAdminController extends BaseController { } else { return new BusiResult(BusiStatus.UNKNOWN, "删除失败!", null); } - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); @@ -97,8 +91,6 @@ public class UserCertifyRecordAdminController extends BaseController { } else { return new BusiResult(BusiStatus.UNKNOWN, "删除失败!", null); } - } catch (BusinessException e) { - throw new ServiceException(BusiStatus.SERVERERROR, e.getMessage()); } catch (Exception e) { logger.error(e.getMessage(), e); return new BusiResult(BusiStatus.SERVERERROR); diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCoupleAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCoupleAdminController.java deleted file mode 100644 index 0b67dd371..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserCoupleAdminController.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.admin.dto.UserCoupleStatisticalDto; -import com.accompany.admin.dto.UserCoupleStatisticalParamDto; -import com.accompany.admin.service.user.UserCoupleAdminService; -import com.accompany.business.dto.UserCoupleSendDetailDto; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.core.util.ExcelUtils; -import com.alibaba.fastjson.JSONObject; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; -import java.util.List; - - -/** - * - * @author - * @email xxx@gtland.cn - * @date 2021-12-06 18:32:36 - */ -@Api(tags = "用户关系道具管理", value = "用户关系道具管理") -@Controller -@RequestMapping("/admin/couple/statistical") -public class UserCoupleAdminController { - @Autowired - private UserCoupleAdminService userCoupleAdminService; - - - @ApiOperation("用户关系统计列表") - @RequestMapping("/statisticsList") - @ResponseBody - public BusiResult statisticsList(UserCoupleStatisticalParamDto paramDto) { - return new BusiResult(userCoupleAdminService.statisticsList(paramDto)); - } - - @ApiOperation("用户关系送礼详情") - @RequestMapping("/cpSendDetailList") - @ResponseBody - public BusiResult cpSendDetailList(UserCoupleStatisticalParamDto paramDto) { - return new BusiResult(userCoupleAdminService.cpSendDetailList(paramDto)); - } - - - @ApiOperation("立即解绑") - @RequestMapping("/immediateUnbound") - @ResponseBody - public BusiResult immediateUnbound(Long id) { - userCoupleAdminService.immediateUnbound(id); - return new BusiResult(BusiStatus.SUCCESS); - } - - - @ApiOperation("关系统计导出") - @RequestMapping("/exportStatisticsCpList") - @ResponseBody - public void exportStatisticsCpList(UserCoupleStatisticalParamDto paramDto, HttpServletResponse response) throws Exception { - paramDto.setPageNum(1); - paramDto.setPageSize(100000); - String filename = "cpStatisExport"; - List fields = Arrays.asList("id", "inviteErbanNo", "inviteNick", "acceptErbanNo", "acceptNick", "levelSeq", "acceptTime", "unboundTime", "state", "sendGoldNum"); - JSONObject jsonObject = userCoupleAdminService.statisticsList(paramDto); - List list = (List) jsonObject.get("rows"); - ExcelUtils.exportExcel("CP关系统计", filename, fields, list, response); - } - - - @ApiOperation("关系统计送礼明细导出") - @RequestMapping("/exportCpSendDetai") - @ResponseBody - public void exportCpSendDetai(UserCoupleStatisticalParamDto paramDto, HttpServletResponse response) throws Exception { - paramDto.setPageNum(1); - paramDto.setPageSize(100000); - String filename = "cpSendDetailExport"; - List fields = Arrays.asList("createTime", "totalGoldNum"); - JSONObject jsonObject = userCoupleAdminService.cpSendDetailList(paramDto); - List list = (List) jsonObject.get("rows"); - ExcelUtils.exportExcel("cp用户送礼明细", filename, fields, list, response); - } - - - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPrivilegeAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPrivilegeAdminController.java deleted file mode 100644 index ebe38a5fe..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPrivilegeAdminController.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.admin.service.user.UserRelationPrivilegeAdminService; -import com.accompany.business.model.user.UserRelationPrivilege; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.alibaba.fastjson.JSONObject; -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.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - - -/** - * - * @author - * @email xxx@gtland.cn - * @date 2021-12-06 18:32:36 - */ -@Api(tags = "用户关系道具管理", value = "用户关系道具管理") -@Controller -@RequestMapping("/admin/relation/privilege") -public class UserRelationPrivilegeAdminController { - @Autowired - private UserRelationPrivilegeAdminService userRelationPrivilegeAdminService; - - - @ApiOperation("特权列表") - @RequestMapping("/privilegeList") - @ResponseBody - public BusiResult privilegeList(Integer pageNum, Integer pageSize) { - JSONObject jsonObject = new JSONObject(); - IPage pageInfo = userRelationPrivilegeAdminService.privilegeList(pageNum, pageSize); - jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows", pageInfo.getRecords()); - return new BusiResult(jsonObject); - } - - @ApiOperation("新增/编辑") - @RequestMapping("/savePrivilege") - @ResponseBody - public BusiResult savePrivilege(UserRelationPrivilege userRelationProps) { - userRelationPrivilegeAdminService.savePrivilege(userRelationProps); - return new BusiResult(BusiStatus.SUCCESS); - } - - @ApiOperation("删除") - @RequestMapping("/delPrivilege") - @ResponseBody - public BusiResult delPrivilege(Long id) { - userRelationPrivilegeAdminService.delPrivilege(id); - return new BusiResult(BusiStatus.SUCCESS); - } - - - @ApiOperation("查询特权信息") - @RequestMapping("/getPrivilegeInfo") - @ResponseBody - public BusiResult getPrivilegeInfo(Long id) { - return new BusiResult(userRelationPrivilegeAdminService.getPrivilegeInfo(id)); - } - - @ApiOperation("查询特权信息") - @RequestMapping("/getSecretValByLevelSeq") - @ResponseBody - public BusiResult getSecretValByLevelSeq(Integer levelSeq) { - return new BusiResult(userRelationPrivilegeAdminService.getSecretValByLevelSeq(levelSeq)); - } - - -} diff --git a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPropsAdminController.java b/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPropsAdminController.java deleted file mode 100644 index 3d2e2b62f..000000000 --- a/accompany-admin/accompany-admin-web/src/main/java/com/accompany/admin/controller/user/UserRelationPropsAdminController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.accompany.admin.controller.user; - -import com.accompany.admin.service.user.UserRelationPropsAdminService; -import com.accompany.business.model.user.UserRelationProps; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.alibaba.fastjson.JSONObject; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - - -/** - * - * @author - * @email xxx@gtland.cn - * @date 2021-12-06 18:32:36 - */ -@Api(tags = "用户关系道具管理", value = "用户关系道具管理") -@Controller -@RequestMapping("/admin/relation/props") -public class UserRelationPropsAdminController { - @Autowired - private UserRelationPropsAdminService userRelationPropsAdminService; - - - @ApiOperation("道具列表") - @RequestMapping("/propsList") - @ResponseBody - public BusiResult relationPropsList() { - JSONObject jsonObject = new JSONObject(); - //jsonObject.put("total",pageInfo.getTotal()); - jsonObject.put("rows", userRelationPropsAdminService.propsList()); - return new BusiResult(jsonObject); - } - - @ApiOperation("新增/编辑") - @RequestMapping("/saveProps") - @ResponseBody - public BusiResult saveProps(UserRelationProps userRelationProps) { - userRelationPropsAdminService.saveProps(userRelationProps); - return new BusiResult(BusiStatus.SUCCESS); - } - - @ApiOperation("状态切换") - @RequestMapping("/statusSwitch") - @ResponseBody - public BusiResult statusSwitch(Integer id, Byte status) { - userRelationPropsAdminService.statusSwitch(id, status); - return new BusiResult(BusiStatus.SUCCESS); - } - - - @ApiOperation("查询道具信息") - @RequestMapping("/getPropsInfo") - @ResponseBody - public BusiResult getPropsInfo(Integer id) { - return new BusiResult(userRelationPropsAdminService.getPropsInfo(id)); - } - - -} diff --git a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/user/UsersBaseService.java b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/user/UsersBaseService.java index 6a69a6798..09fc3c23c 100644 --- a/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/user/UsersBaseService.java +++ b/accompany-base/accompany-basic/accompany-basic-service/src/main/java/com/accompany/core/service/user/UsersBaseService.java @@ -464,7 +464,6 @@ public class UsersBaseService extends BaseService { } if (null != erbanNo){ - jedisService.del(RedisKey.search.getKey(erbanNo.toString())); jedisService.hdel(RedisKey.user_erban_no.getKey(), String.valueOf(erbanNo)); jedisService.del(RedisKey.cancel_user_recover_credentials.getKey(String.valueOf(erbanNo))); } diff --git a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java b/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java index 19586af6c..d5015829a 100644 --- a/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java +++ b/accompany-base/accompany-common/src/main/java/com/accompany/common/status/BusiStatus.java @@ -83,7 +83,6 @@ public enum BusiStatus { PHONE_BIND_ERROR(3012, "绑定手机号错误,请重新输入"), ACCOUNT_NOT_BIND_PHONE(3013, "未绑定手机号"), - NOTEXISTS(404, " Not present "), IP_REGION_HAD_LIMIT(401, " The area is currently not open for use "), NOAUTHORITY(401, " No permission "), @@ -91,6 +90,7 @@ public enum BusiStatus { SERVERERROR(500, " Being distracted~Please try again later "), SERVERBUSY(503, " Being distracted~Please try again later "), + CONFIG_NOT_FOUND(503, "config not found"), ROOM_UNCHANGE(505, " Please contact the official for modification "), REQUEST_FAST(1000, " Please do not make frequent requests "), REQUEST_PARAM_ERROR(1000, " Parameter error, please try again "), @@ -102,7 +102,6 @@ public enum BusiStatus { PARAMETERILLEGAL(1444, " invalid parameter "), ILLEGAL_OPERATE(408, " Illegal operation or lack of permission "), ALERT_PARAMETER_ILLEGAL(-1, " The required parameter is empty "), - ALERT_SIGN_FAIL(-3, " Verification failed "), USERNOTEXISTS(1404, " user does not exist "), USERINFONOTEXISTS(1405, " You can only open a room after completing your personal information! "), NICK_TOO_LONG(1406, " Nickname too long "), @@ -156,13 +155,6 @@ public enum BusiStatus { FAMILY_QUIT_LIMIT_TIME(7008, " Joining the family for 7 days before exiting the family "), MODIFY_FAILD(7023, " Modification failed "), HAS_JOINED_FAMILY(7042, " You have joined the family and need to leave the current family in order to apply to join another family "), - USER_DOLL_NOT_EXISTS(6600, " The doll does not exist "), - USER_DOLL_EXISTS(6601, " The doll already exists "), - USER_DOLL_SEX_ERROR(6602, " Baby gender setting error "), - CATCH_DOLL_NOT_EXIST(6404, " The claw doll does not exist "), - CATCH_DOLL_FAILD(6605, " Failed to grab the doll "), - CATCH_DOLL_TIMES_NOT_ENOUGH(6607, " Insufficient number of times to grab the doll "), - CATCH_DOLL_DEAL_TYPE_ERROR(6609, " Wrong handling type for grabbing dolls "), QUERY_FAILD(6613, " Query failed "), NICK_ILLEGAL(6621, " Illegal nickname "), NO_PERMIT_OPERATOR(7071675, " No operation permission "), @@ -254,11 +246,6 @@ public enum BusiStatus { ROOM_IN_INVITE_LIMIT(1604, " Dear, this room is only open for invitation "), H5_EXCHANGE_OUT_OF_LIMIT(6619, " The redemption function is not yet open "), EXCHANGE_NOT_EXIST(6620, " No Easter eggs, cannot be exchanged! "), - RECOMMEND_STOCK_NOT_ENOUGH(7567001, " Insufficient inventory of recommended positions "), - NOT_FOUND_AVAILABLE_RECOMMEND_CARD(7567002, " No available recommendation cards "), - RECOMMEND_ALREADY_APPLY(7567004, " Recommended slots for this time period have been applied for "), - RECOMMEND_APPLY_TIME_ERROR(7567003, " Please apply before the current time "), - RECOMMEND_CRAD_STOCK_NOT_ENOUGH(7567001, " Insufficient inventory of recommended slots for recommendation cards "), EMOJI_CODE_NULL(90130, " Emoji expression does not exist "), EMOJI_CODE_NOTEXIST(90131, " The password has expired or does not exist "), USER_ALREADY_IN_HALL(90132, " You are already a member of the hall! "), @@ -363,11 +350,6 @@ public enum BusiStatus { USER_CANCEL(11002, " User logged out "), CANCEL_USER_INFO_NOT_EXIST(8702, " Unable to obtain user information for logging out! "), CANCEL_USER_CREDENTIALS_NOT_EXIST(8702, " Cancelling user credentials does not exist! "), - CP_RECORD_NOT_EXISTS(8703, " No corresponding CP relationship found! "), - CP_INVITE_DECLARATION_NOT_ALLOW_EXISTS(8704, " The relationship oath cannot be empty! "), - CP_INVITE_DECLARATION_LEN_ERR(8705, " The oath of relationship is 5-20 words! "), - USER_SELF_MAKE_INVITE_ERR(8706, " You can only form a CP with others~ "), - CP_MP_REPEAT_APPLY_ERR(8708, " Cannot apply for CP nameplate again! "), VIP_LEVEL_NOT_ENOUGH(8710, " The noble level did not meet the requirements "), SEEK_ELFIN_LIMIT(8801, " You can only choose up to 9 cards "), HAS_SENSITIVE(8709, " The current content does not meet the specifications. Please make the necessary modifications and try again~ "), @@ -420,24 +402,24 @@ public enum BusiStatus { PASSWORD_ERROR_COUNT(500, "密碼錯誤,還剩%d次機會"), - H5_REGISTER_ERROR(500, "注册失败"), - REGION_NOT_OPEN_UP(403, "暂未在你所在的地区开放"), REGISTER_FREQUENT(500, "注册过于频繁"), - CODE_ILLEGAL(500, "code is illegal"), - USER_ID_NO_SAME(500, "用户ID不一致"), - GIFT_SEND_ERROR(500, "贈送失敗,請退出房間後重試"), - ROOM_IN_VERSION_CHECK(500, "進房失敗,請升級版本後重試"), GIFT_SEND_MY_SELF_ERROR(500, "不允許給自己送禮"), DEVICE_ERROR(500, "设备为空"), + UPDATE_NETEASE_ROOM_FAIL(500, "云信聊天室信息更新失败"), + + CERTIFY_NEED_BOUND_MAINLAND_ACCOUNT(500, "请绑定大陆银联提现账户"), + CERTIFY_ACCOUNT_NOT_MATCH_REAL_NAME(500, "认证身份信息与绑定的提现账户身份信息不同"), + CERTIFY_OVER_TODAY_CERTIFY_MAX_TIMES(500, "认证身份信息与绑定的提现账户身份信息不同"), + ; diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/annotation/AppVersion.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/annotation/AppVersion.java deleted file mode 100644 index 032853697..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/annotation/AppVersion.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.accompany.common.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @author: liaozetao - * @date: 2023/10/18 15:15 - * @description: - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -public @interface AppVersion { - - /** - * 统一版本 - * - * @return - */ - String value() default ""; - - /** - * iOS版本 - * - * @return - */ - String ios() default ""; - - /** - * android版本 - * - * @return - */ - String android() default ""; - - /** - * 版本提示语 - * - * @return - */ - String message() default ""; -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java deleted file mode 100644 index 618f139ae..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/AppVersionAspect.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.accompany.common.aop; - -import cn.hutool.core.util.StrUtil; -import com.accompany.common.annotation.AppVersion; -import com.accompany.common.constant.Constant; -import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; -import com.accompany.common.utils.AppVersionUtil; -import com.accompany.core.base.DeviceInfoContextHolder; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.stereotype.Component; - -import java.lang.reflect.Method; - -/** - * @author: liaozetao - * @date: 2023/10/18 15:18 - * @description: - */ -@Slf4j -@Aspect -@Component -public class AppVersionAspect { - - @Pointcut("@annotation(com.accompany.common.annotation.AppVersion)") - public void pointcut() { - } - - @Before("pointcut()") - public void before(JoinPoint joinPoint) { - DeviceInfo deviceInfo = DeviceInfoContextHolder.get(); - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - AppVersion version = method.getAnnotation(AppVersion.class); - if (version == null) { - return; - } - String appVersion = deviceInfo.getAppVersion(); - String os = deviceInfo.getOs(); - String defaultVersion = version.value(); - String iosVersion = version.ios(); - String androidVersion = version.android(); - String message = version.message(); - if (StrUtil.isEmpty(message)) { - message = "APP版本過低,請升級至最新版!"; - } - if (StrUtil.isEmpty(iosVersion)) { - iosVersion = defaultVersion; - } - if (StrUtil.isEmpty(androidVersion)) { - androidVersion = defaultVersion; - } - if (StrUtil.isEmpty(os)) { - return; - } - if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, iosVersion) < 0) { - throw new AdminServiceException(message); - } - if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, androidVersion) < 0) { - throw new AdminServiceException(message); - } - } - -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/IosYouMiImgDomainReplaceAspect.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/IosYouMiImgDomainReplaceAspect.java deleted file mode 100644 index c08c7ee79..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/aop/IosYouMiImgDomainReplaceAspect.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.accompany.common.aop; - -import com.alibaba.fastjson.JSON; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Pointcut; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -/** - * 用来处理魔力 ios 马甲包,将返回的数据中 image.lecheng163.com 替换成 image.hfighting.com - * - * @author: Harry Zhang - * @since: 2023/3/7 19:33 - */ -//@Component -//@Aspect -@Slf4j -//@Order(0) -public class IosYouMiImgDomainReplaceAspect { - - @Pointcut("(@annotation(org.springframework.web.bind.annotation.RequestMapping) " + - "|| @annotation(org.springframework.web.bind.annotation.PostMapping) " + - "|| @annotation(org.springframework.web.bind.annotation.GetMapping) " + - "|| @annotation(org.springframework.web.bind.annotation.PutMapping) " + - "|| @annotation(org.springframework.web.bind.annotation.DeleteMapping) " + - "|| @annotation(org.springframework.web.bind.annotation.PatchMapping))") - public void logPointcut() { - - } - - @Around("logPointcut()") - public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable { - - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - if (null == attributes) { - return joinPoint.proceed(); - } - HttpServletRequest request = attributes.getRequest(); - - String app = request.getParameter("app"); - String channel = request.getParameter("channel"); - - if ("youmi_appstore".equals(channel) || "youmi".equals(app)) { - log.info("是悠米包,替换图片域名..."); - - Object result = joinPoint.proceed(); - if (null == result) return null; - - String json = JSON.toJSONString(result); - log.info("json: {}", json); - String firstChars = json.substring(0, 1); - - String sourceUrl = "img.pekolive.com"; - String targetUrl = "image.hfighting.com"; - if (json.contains(sourceUrl)) { - json = json.replaceAll(sourceUrl, targetUrl); - log.info("after replace json: {}", json); - } - - String h5SourceUrl = "api.pekolive.com/peko"; - String h5TargetUrl = "api.hfighting.com/peko"; - if (json.contains(h5SourceUrl)) { - json = json.replaceAll(h5SourceUrl, h5TargetUrl); - log.info("after replace json: {}", json); - } - - // 对象 - if ("{".equals(firstChars)) { - Object object = JSON.parseObject(json, Object.class); - return object; - } - // 数组 - if ("[".equals(firstChars)) { - List maps = JSON.parseArray(json, Map.class); - return maps; - } - } - - return joinPoint.proceed(); - } - -} \ No newline at end of file diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java index e6126d125..a210d1643 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/Constant.java @@ -743,28 +743,6 @@ public class Constant { */ public static final String DYNAMIC_UPDATE_DAY = "dynamic_update_day"; - /** - * 银行卡提现额度下限:大于xxx才启用"提现到银行卡" - */ - public static final String BANK_CARD_WITHDRAWAL_MIN_AMOUNT = "bank_card_withdrawal_min_amount"; - - /** - * 银行卡提现文案:*为了保障你的资金安全,单次提现大于10000人民币时,请先绑定银行卡。 - */ - public static final String BANK_CARD_WITHDRAWAL_TIPS = "bank_card_withdrawal_tips"; - - /** - * 提现:默认提现账号类型,取值参考 - * - * @see WithdrawAccountType - */ - public static final String DEFAULT_WITHDRAW_ACCOUNT_TYPE = "default_withdraw_account_type"; - - /** - * 首页推荐位限制使用数量 - */ - public static final String RECOMMEND_CARD_LIMIT = "recommend_card_limit"; - /** * 注销用户的短信模板code */ @@ -1248,44 +1226,10 @@ public class Constant { * 回复第一条客服消息后多少分钟内不再回复:默认20分钟 */ public static final String REPLY_CUSTOMER_MSG_MIN_DURATION = "reply_customer_msg_min_duration"; - - /** - * 组CP邀请发出多久未回复后自动拒绝时间配置:单位小时 - */ - public static final String INVITE_CP_AUTO_DENY_TIME = "invite_cp_auto_deny_time"; - /** - * 购买cp道具各方分成配置 - */ - public static final String BUY_CP_PROPS_PER_RATE = "buy_cp_props_per_rate"; - /** - * 每日邀请限制次数配置 - */ - public static final String CP_INVITE_DAY_LIMIT = "cp_invite_day_limit"; - - /** - * cp解绑多久后彻底解绑:单位小时 - */ - public static final String UNBOUND_CP_WAIT_TIME = "unbound_cp_wait_time"; - /** - * 成为cp后多少天内不能解绑:单位天 - */ - public static final String MAKE_CP_UNBOUND_LIMIT = "make_cp_unbound_limit"; - /** - * 解绑频率限制:单位天 - */ - public static final String CP_UNBOUND_FREQ_LIMIT = "cp_unbound_freq_limit"; /** * 钻石兑换亲密值比率:默认10钻石可以换1亲密值 */ public static final String GLOD_SWITCH_TO_SECRET_VAL_RATE = "glod_switch_to_secret_val_rate"; - /** - * cp每日扣经验配置 - */ - public static final String CP_DEDU_SECRET_VAL_DAILY = "cp_dedu_secret_val_daily"; - /** - * 多少天没增加经验值扣经验,默认3天 - */ - public static final String DEDU_SECRET_VAL_DAY_NEED = "dedu_secret_val_day_need"; /** * 默认cp关系誓言文案 */ @@ -4376,92 +4320,6 @@ public class Constant { } - /** - * 组CP状态 - */ - public static class UserCoupleState { - //邀请中 - public static final Byte invite = 1; - //CP中 - public static final Byte cp = 2; - //拒绝 - public static final Byte deny = 3; - //解绑中 - public static final Byte wait_unbound = 4; - //解绑完成 - public static final Byte unbound = 5; - //邀请已过期 - public static final Byte expire = 6; - } - - /** - * 用户关系道具状态 - */ - public static class UserRelationPropsStatus { - //删除 - public static final Byte del = 0; - //启用 - public static final Byte valid = 1; - //停用 - public static final Byte invalid = 2; - } - - /** - * 用户关系道具类型 - */ - public static class UserRelationType { - //cp - public static final Byte cp = 1; - } - - /** - * cp列表类型 - */ - public static class CpListType { - //别人给我发的邀请 - public static final Byte accept = 1; - //我给别人发的邀请 - public static final Byte invite = 2; - } - - - /** - * cp任务周期类型 - */ - public static class UserCoupleTaskCycleType { - //每日任务 - public static final Byte daily = 1; - //累计任务 - public static final Byte total = 2; - } - - /** - * cp任务类型 - */ - public static class UserCoupleTaskType { - //私聊 - public static final Byte chat = 1; - //同一房间时长 - public static final Byte same_room = 2; - // 送礼 - public static final Byte send_gift = 3; - //陪伴 - public static final Byte companion = 4; - } - - /** - * CP特权类型 - */ - public static class UserCouplePrivilegeType { - //铭牌 - public static final Byte mp = 1; - //头饰 - public static final Byte head_wear = 2; - //CP位 - public static final Byte cp_theme = 3; - } - - /** * 铭牌审核状态 */ diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/RecommendConstant.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/RecommendConstant.java deleted file mode 100644 index 9a8c5c4f8..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/RecommendConstant.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.accompany.common.constant; - -/** - * Created by PaperCut on 2018/12/27. - * 房间推荐常量类 - */ -public class RecommendConstant { - /** - * 房间推荐记录状态 - * 1、已预定 - * 2、已使用 - * 3、已过期 - * 4、已下架 - */ - public static class RecordStatus { - public static final Byte ALREADY_BOOK = 1; - public static final Byte ALREADY_USING = 2; - public static final Byte ALREADY_EXPIRED = 3; - public static final Byte ALREADY_OBTAINED = 4; - } - - /** - * 房间推荐占用状态 - * 1、已占用 - * 2、取消占用 - */ - public static class OccupyStatus { - public static final Byte ALREADY_OCCUPY = 1; - public static final Byte CANCEL_OCCUPY = 2; - } - - /** - * 房间推荐卡状态 - * 1、未使用 - * 2、使用中 - * 3、已使用 - * 4、已过期(未使用) - */ - public static class CardStatus { - public static final Byte NOT_USED = 1; - public static final Byte ALREADY_USING = 2; - public static final Byte ALREADY_USED = 3; - public static final Byte ALREADY_EXPIRED = 4; - } -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/UserCpLevelArr.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/UserCpLevelArr.java deleted file mode 100644 index 6d0c29304..000000000 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/constant/UserCpLevelArr.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.accompany.common.constant; - - -public class UserCpLevelArr { - public static Long secretVal[]; -} diff --git a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java index 28eaab043..f0c28adb8 100644 --- a/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java +++ b/accompany-base/accompany-core/src/main/java/com/accompany/common/redis/RedisKey.java @@ -15,14 +15,8 @@ public enum RedisKey { room_vip, room_permit_hide,// 需要在展示时隐藏的牌照房(在线人数为0或者只有机器人) room_tag_room, // 房间设置标签列表 - room_tag_top, // APP顶部标签列表 new_room_tag_top,//66星球改版首页标签列表 room_tag_list, // 单个标签数据 - room_tag_new, // 萌新标签页的第一页 - new_show_list, - person_show_list, - room_tag_radio, // 电台标签页的第一页 - room_tag_index, // 每个标签页的第一页 room_mic_list, // 房间麦序列表 room_mic_uid_set,//房间麦序uid列表 room_pos_lock, // 房间麦序占位临时的KEY,防多人并发抢 @@ -39,62 +33,35 @@ public enum RedisKey { send_gift_weeklist, send_gift_sumlist, //麦序模块 - micro_app, micro_seq, microv2_list, user, // 以UID为KEY存储的用户信息 user_erban_no, // 以平台号为KEY存储的用户信息 user_summary, // 以UID为KEY存储的用户概要信息 - lock_user_summary, // 用户概要信息锁 private_photo, - auct_cur, sms, charge_prod, user_purse, - user_purse_gold, - user_purse_diamond, - user_purse_deposit, - wx_token, - wx_ticket, auditing_iosversion, forceupdate_iosversion, gift, // 礼物 gift_magic_list, // 魔法礼物 gift_magic_item, // 魔法礼物 - packet_withdraw_cash_list, - withdraw_cash_list, sys_conf, - sys_conf_splash, // 闪屏 - sys_conf_redpacket_tax,//红包提现税率信息 banner, - banner_type, - game_banner,//游戏首页banner - game_welfare,//声控福利房 panel, audit_panel, new_panel, - wx_muscle_t_token, - wx_muscle_t_ticket, - wx_muscle_f_token, - wx_muscle_f_ticket, - wx_muscle_video_home, face, face_json, act, - room_ctrb_sum, - home_hot, - home_game, - home_radio, user_in_room, app_version, rank, - rank_home, // 首页排行榜 - activity_rank, // 活动排行榜 activity_conf, // 活动配置 - activity_win_list, // 活动结果 charge_activity_rotate_interval,//充值活动轮播时间间隔 redeem_code_input, // 兑换码输入错误次数 redeem_code_uid, // 兑换码接口请求UID @@ -103,15 +70,11 @@ public enum RedisKey { lock_user_gold, // 金币分布式锁 lock_user_diamond, // 钻石分布式锁 lock_user_crystal, // 水晶分布式锁 - lock_user_withdraw, // 提现分布式锁 lock_gift_message, // 消费送礼物消息锁 - app_version_update, mq_gift_status, // 礼物消息的状态 mq_prize_status, // 中奖消息的状态 mq_magic_gift_status, // 魔法表情的状态 mq_pay_finish_status, // 支付完成消息的状态 - config_home_random,// 首页列表用随机列表 - act_rank, block_ip, //被封禁ip block_account,//被封禁账户 block_deivce,//被封禁设备 @@ -120,24 +83,14 @@ public enum RedisKey { level_exper, // 等级经验资源列表 level_charm, // 等级魅力资源列表 erban_no, //平台号 - pretty_number,//靓号 auti_banner, //审核中的Banner auti_user, //审核中的测试账号 - feedback_activity, car_goods, // 座驾 user_carport, //用户座驾 user_using_carport, //用户使用中的座驾 - lock_magic_message, // 魔法消息锁 - lock_monster_blood, // 怪兽血量锁 - monster_blood, // 怪兽血量 - monster_kind, // 怪兽种类 monster, // 怪兽 - monster_hurt_rank, // 怪兽伤害排行 - monster_attack_sequence, // 攻击怪兽序列号 - monster_draw_strategy, // 怪兽促销活动策略 - user_sharing_days, // 记录用户每天的分享次数 room_day_rankings, // 房间日榜 room_week_rankings, // 房间周榜 room_month_rankings,// 房间月榜 @@ -165,14 +118,6 @@ public enum RedisKey { lock_account_generate, // 锁定生成账号 - ios_charge_device_count,//IOS内购设备限制 - ios_charge_ip_count,//IOS内购IP限制 - - redpacket_index, - redpacket_map, - redpacket_recevie, - - pk_act_first_rank, // 网红pk第一轮 pk_act_second_rank, // 网红pk第二轮 @@ -182,16 +127,7 @@ public enum RedisKey { xss_include_uri, // 作xss拦截的uri exclude_users, // 不参与排行榜排名用户 sign_enable, // 是否开启签名 - sign_version_ios, // ios开始参与签名版本 - sign_version_android, // android开始参与签名版本 - lock_redpack_withdraw, // 红包提现锁 - - search, // 搜索 - lock_search, // 搜索锁, - home_cache, // 首页缓存数据 - new_home_cache,//66星球改版首页缓存数据 - v4_home_cache,//66星球首页房间改版缓存数据 search_text_cache, // 搜索字段缓存 search_text_lock, // 搜索字段缓存 @@ -206,17 +142,7 @@ public enum RedisKey { ticket_num_rank, gift_price_rank, - find_banner, //发现banner - - // 新用户推荐房间 - newcomer_recommend_room, - // 新用户推荐房间索引 - newcomer_recommend_room_index, - - family_pk_config, // 家族pk配置 - family_pk_rank, // 家族pk排行榜 activity_award, // 活动奖励 - dragon_ball, // 龙珠点数缓存 open_box_prize_pool, //开箱子,奖品池中去重后所有奖品 open_box_lock_draw, //促销活动分布式锁 @@ -245,27 +171,10 @@ public enum RedisKey { //房间魅力周榜 room_recive_week_rankings, - //首页过滤房间 - home_filter_room, //新添加的敏感词 sensitive_add_word, - //重新初始化开关 - sensitive_reload_switch, //敏感词过期时间 sensitive_expire_time, - //国庆周年赠送座驾 - national_give_car, - //国庆周年赠送头饰 - national_give_headwear, - //国庆周年庆登录方式赠送钥匙 - national_give_key_by_login, - //国庆周年庆分享方式赠送钥匙 - national_give_key_by_share, - //所有心愿 - national_all_wish, - //心愿点赞总数 - national_wis_like_count, - // act_national_config, //国庆活动锁 act_national_lock, //送审核账号(过滤所有小秘书消息) @@ -273,12 +182,9 @@ public enum RedisKey { //系统消息是否过滤审核账号 filter_audit_account_segment, - user_draw_lock, // 大转盘促销活动锁 oper_act, // 运营活动内容 //admin_session存储 httpsession_store, - //达到相应等级的礼物则发送消息 - prize_message_send_level, /** * 配置特殊房间标签锁 @@ -291,18 +197,8 @@ public enum RedisKey { lock_room_choose_music, //房间清歌的消息id room_clean_music_messId, - //公聊大厅房间ID - sys_conf_public_chatroom, - //公聊大厅反垃圾次数 - chatroom_antispam_count, //充值分布式锁 lock_apply_charge, - //微信回调分布式锁 - lock_wx_notify, - //支付宝回调分布式锁 - lock_alipay_notify, - //快捷支付回调分布式锁 - lock_fastpay_notify, //苹果支付交易分布式锁 lock_iospay_verify, // 支付回调分布式锁(用这一个就够了,上面的都定义重复了,会拼上订单号) @@ -310,9 +206,6 @@ public enum RedisKey { // 普通许愿池次数奖池锁 lock_normal_big_prize, - // vkiss暗号领取奖励活动 - vkiss_prize_activity, - vkiss_prize_activity_wechat, //表情列表 face_json_list, face_json_bak, @@ -351,20 +244,10 @@ public enum RedisKey { add_match_pool_room,//添加进游戏房间匹配池分布式锁 - add_match_pool,//添加进游戏匹配池分布式锁 - - add_isomerism_match_pool,//添加异性匹配池分布式锁 - add_isomerism_match_pool_room,//添加异性匹配池分布式锁(房间内用户) - add_player_match_pool,//添加找玩友匹配池分布式锁 - - lazy_close_room,//延迟关房 - game_play_info,//游戏玩家信息 - game_invite_lock,//游戏邀请分布式锁 - //房间PK room_pk_ing, room_pk, @@ -374,11 +257,6 @@ public enum RedisKey { room_pk_team_protector, lock_finish_pk, - act_user_track_used_gold_info,//春节轨迹用户花费金币 - act_user_track_family_info,//不受限于状态 - act_user_track_family_member,//家族成员,按加入时间排序 - act_user_track_family_gold_num,//为家族贡献的金币 - hall,//模厅 user_hall,//用户模厅信息 hall_member_count,//模厅成员总人数 @@ -398,12 +276,6 @@ public enum RedisKey { hall_member_menus, //模厅会员菜单权限列表(如收入统计菜单) hall_member_auths,//模厅会员权限 - hall_income_list,//模厅收入统计列表 - hall_income_member,//模厅收入统计中成员的记录 - hall_income_gift_list,//模厅收入统计中成员的收入明细列表 - hall_income_gift_detail,//模厅收入统计中成员的收入明细记录 - lock_hall_income,//模厅收入统计锁 - hall_manage_auth,//存储模厅的高管的所有权限 hall_auths,//模厅权限列表 act_signing_up_msg, // 报名活动用户信息 @@ -414,26 +286,13 @@ public enum RedisKey { h5_exchange_cumulative, // h5当天累计兑换额 web_config, // 网页配置 - - gold_increase_finance_type, // 账单金币增加类别 - gold_decrease_finance_type, // 账单金币减少类别 - diamond_increase_finance_type, // 账单钻石增加类别 - diamond_decrease_finance_type, // 账单钻石减少类别 - gold_increase_finance_type_name, // 账单金币增加类别名称 - gold_decrease_finance_type_name, // 账单金币减少类别名称 - diamond_increase_finance_type_name, // 账单钻石增加类别名称 - diamond_decrease_finance_type_name, // 账单钻石减少类别名称 finance_date_update_time, // 财务数据更新时间记录 user_prize_key, // 用户促销活动钥匙 user_backpacket, // 用户背包礼物 - //在线状态 - user_online, user_online_status, - room_half_hour_flow, //房间半小时流水 - recommend_stock, // 推荐位库存 recommend_occupy, // 推荐位预占用库存 @@ -441,39 +300,24 @@ public enum RedisKey { room_home_hide, // 需要隐藏的房间 room_unchange, // 不可修改头像和标题的房间 title,//标题 - title_room_index,//房间分类标题页 title_banner,//房间分类标题下的banner recommend_topic_room_map,//话题-房间映射列表(不存储星推荐跟热门推荐数据) - title_topic_room_map,//游戏页的话题-房间映射列表 recommend_star_popular,//星推荐与热门推荐配置缓存 - topic_room_lock,//话题房间操作锁 - star_rooms,//星推荐房间列表 - v4_poplar_rooms,//首页热门推荐 emoji_code,//emoji表情码 hall_invite_code,//模厅邀请码 - baidu_observe, // 百度信息流 - plantingtrees, // 植树节相关缓存 - fans_count,//粉丝数量 user_live_skill,//用户个人资料页101数据 - // 全局封禁 IP - global_block_ip, - // 全局封禁 设备 - global_block_device, system_block_phone, system_block_device, system_block_ip, - send_gold_list,//主播赠送金币列表 anchor_white_list,//主播白名单 - lock_buy_headwear, //购买头饰分布式锁 lock_buy_car, //购买座驾分布式锁 - user_wallet, lock_official_radish_send,//官方赠送萝卜分布式锁 /** @@ -487,14 +331,8 @@ public enum RedisKey { error_pay_password_times, room_gift_value,//房间用户礼物值 room_gift_value_rank,//房间用户礼物值详情 - sign_device_limit, //签到设备号限制 room_revenue_excel,//房间流水excel - /** - * 每天登录失败重试次数 - */ - daily_login_fail_retry, - /** * 每日注册用户数量 */ @@ -583,57 +421,6 @@ public enum RedisKey { voice_like_lock,// 喜欢/不喜欢声音消息锁 temp_voice_like_record,// 喜欢/不喜欢记录临时缓存 - first_page_tab_switch,//新版首页男神女神位置可配置 - - first_page_tab_room,//新版首页tab配置房间 - first_page_recommend_room,//新版首页房间推荐 - first_page_user_game_wincount,//新版首页用户本周游戏胜利数 - - first_page_tab_room_id,//首页tab房间id - first_page_tab_room_detail,//首页tab房间详情 - /** - * 推荐房间的tabId - */ - first_page_recommend_room_tab_id, - /** - * 热门房间的tabId - */ - first_page_hot_room_tab_id, - - /** - * 年中 夏日大作战活动 - */ - activity_rank_midyear_task_num, //任务达人 - mid_year_task_status,// 任务状态 - mid_year_task_draw_receive_num, //累计领取奖励数 - lock_mid_year_task_draw, // 任务达人分布式锁 - mid_year_task_draw_receive_device_limit, // 任务达人领取设备限制 - lock_mid_year_play_team_entry, // 嗨玩联盟创建分布式锁 - activity_rank_midyear_team_honor, // 嗨玩联盟战队荣耀值 - activity_rank_midyear_member_honor, // 嗨玩联盟个人荣耀值 - activity_rank_midyear_shining, //闪耀主播热度 - lock_mid_year_fans, //吸粉狂人分布式锁 - activity_rank_midyear_fans, //吸粉狂人 粉丝榜 - - sms_code,//手机验证码 - - register_code,//图形注册验证码答案 - - register_time_switch,//注册时间戳验证开关 - - close_signup_switch,//关闭旧的注册接口 - - /** - * 声音卡片活动 - */ - voice_bottle_draw_device_limit,// 奖励领取设备限制 - voice_bottle_draw_uid_limit, //奖励领取用户限制 - voice_bottle_publish_num,// 用户发布卡片数量 - activity_rank_voice_bottle_like,// 声音卡片点赞数量 - voice_bottle_like_num_bak, // 声音卡片点赞数量删除备份 - voice_bottle_task_status, // 声音卡片任务状态 - voice_bottle_task_status_bak, //声音卡片任务状态删除备份 - lock_voice_bottle_receive_draw, //奖励领取锁 world_group_chat_update_lock,// 话题群聊更新锁 world_group_chat_topic_lock,// 话题群聊话题锁 world_group_chat_push_lock,// 话题群聊推送锁 @@ -677,17 +464,6 @@ public enum RedisKey { */ world_hot_cache, - - limit_moeny,//系统设置家长模式充值限额 - - /** - * 银行卡签约支付 - */ - lock_bank_card_sign_pay, - /** - * 银行卡解绑 - */ - lock_bank_card_release, /** * 超管关闭房间限制 **/ @@ -696,50 +472,14 @@ public enum RedisKey { * 超管关闭房间 **/ super_close_room_wait, - lock_mid_autumn_receive_draw, // 领取奖励分布式锁 - mid_autumn_draw_task_status, // 奖励领取状态 - lock_mid_autumn_add_cake_gift, //送礼物分布式锁 open_box_energy, // 用户宝箱能量值 official_give_key, //官方赠送钥匙分布式锁 - block_account_lock,//封禁账户锁 - reject_audio_count,//违规音频次数 - room_monitor_type,//房间监控类型 - audit_audio_room,//音频审核房间 - given_audit_audio_room,//指定的音频审核房间 - - /** - * 国庆活动 - */ - lock_national_day_deal_task, // 国庆活动做任务分布式锁 - national_day_task_limit, // 国庆活动限制 - national_day_task_progress, // 国庆活动任务进度 - national_day_task_status, //国庆活动任务状态 - lock_national_day_send_firework, //国庆活动喷花分布式锁 - national_day_fire_work_sum, //国庆活动用户喷花累计 - national_day_send_all_firework, //国庆活动用户点亮所有喷花 - lock_national_day_buy_firework, //国庆活动购买烟花分布式锁 - lock_national_day_receive_prize, //国庆活动领取奖品分布式锁 - national_day_receive_prize_limit, //国庆活动领取奖励用户限制 - - home_nick_illegal_word,// 首页昵称违法的敏感词 lock_draw_update_ticket, //更新转盘消耗对象分布式锁 draw_user_num_rule,// 使用次数规则 draw_ticket_rule, //门票规则 - lock_double_eleven_buy_gift, //双十一购买礼物分布式锁 - lock_double_eleven_buy_all_gift, //双十一购买所有礼物分布式锁 - /** - * 获取首页列表 - */ - lock_home_page_user_list, - - /** - * 记录首页列表的分页信息 - */ - home_page_user_list_page_info, - lock_community_dynamic_like, //社区动态点赞分布式锁 community_dynamic, //社区动态 lock_community_dynamic_delete, //社区动态删除分布式锁 @@ -802,27 +542,11 @@ public enum RedisKey { */ dynamic_wait_to_like_in_one_day, - /** - * 年终盛典 - */ - annual_ceremony_special_gift_used,// 特殊礼物使用数量 - lock_annual_receive_special_gift,// 领取特殊礼物分布式锁 - annual_ceremony_task_status, //双旦任务 - lock_receive_new_year_gift, //领取双旦分布式锁 - annual_ceremony_task, // 双旦分任务状态 - /** * 用户银行卡信息 */ user_bank_account, - half_hour_ranks_room,//半小时房间 - half_hour_ranks_room_list,//半小时房间list - first_page_tab_online_limit, //推荐列表在线人数限制 - recommend_card_used_limit, //推荐列表推荐卡使用数量 - home_hot_ranks_room_list, //热门推荐房间 - - lock_new_year_buy_gift, // 新年活动购买礼物 admin_account_not_exist, //管理员账号不存在:10秒内已检查过 admin_sent_sms, //管理员获取短信:3分钟内已发送过 admin_sms_code, //管理员获取短信:验证码 @@ -837,26 +561,6 @@ public enum RedisKey { user_gift_achievement_record_lock, //更新用户礼物成就收集记录的分布式锁 - /** - * 幸运灯泡活动 - **/ - bulb_activity_battery_used, // 消耗的电池 - bulb_activity_battery_bought, // 可用的电池 - bulb_activity_lock_key, // 分布式锁 - /** 幸运灯泡活动 **/ - - /** - * 三日情侣活动 - */ - couple_user_link, //情侣组合 - lock_couple_match, //匹配情侣分布式锁 - couple_match_pool, //情侣匹配池子 - couple_status, //任务,奖励状态 - couple_in_room, //进房记录 - lock_couple_sign, //签到分布式锁 - lock_couple_answer, //答题分布式锁 - couple_answer, // 答题答案 - lock_couple_receive, //奖励领取分布式锁 user_erban_no_uid, /** * openId注册分布式锁 @@ -878,10 +582,6 @@ public enum RedisKey { * 用户最新的动态 **/ user_latest_dynamic, - /** - * 首页聊天交友房间 - **/ - home_play_room, /** * 首页动态 **/ @@ -1015,10 +715,6 @@ public enum RedisKey { * 新用户统计查询结果缓存 **/ new_user_stats_cache, - /** - * 工会统计查询结果缓存 - **/ - labor_stats_cache, /** * 牌照房统计查询结果缓存 **/ @@ -1113,146 +809,21 @@ public enum RedisKey { * 深海奇缘用户当天累计收取门票 **/ lucky_sea_today_total_ticket, - /** - * 许愿集福气 - **/ - activity_fortune, - /** - * 许愿集福气保存数据锁 - **/ - activity_fortune_lock, - /** - * 许愿集福气红包队列 - **/ - activity_fortune_red_packet, - /** - * 许愿集福气瓜分红包锁 - **/ - activity_fortune_red_packet_lock, - /** - * 许愿集福气 - **/ - activity_fortune_cave_up_lock, /** * 塔罗每日充值金额 **/ daily_tarot_cost, - /** - * 新春个人榜单 - */ - activity_user_new_year_rankings, - /** - * 和平精英比赛id序号 - */ - hpjy_match_id_seq, - /** - * 修改比赛状态锁 - */ - change_game_match_status_lock, - /** - * 比赛已报名人数 - */ - match_has_quota_count, - /** - * 报名比赛锁 - */ - user_join_game_match_lock, /** * 相亲开启新一轮下麦锁 */ blind_date_down_mic_lock, - /** - * 用户当前使用中的支付宝商户 - */ - alipay_user_using_agent, - /** - * 用户使用原生支付宝的支付成功次数 - */ - alipay_native_user_pay_count, - /** - * 试音卡活动榜单排名 - */ - activity_audio_card_rankings, - /** - * 试音卡设备号限制 - **/ - activity_audio_card_device_id_record, - /** - * 试音卡新过滤榜单 - **/ - activity_new_audio_card_rankings, - - /** - * 比赛管理比赛id序号 - **/ - game_manage_match_id_seq, - /** - * 比赛门票库存信息 - **/ - game_ticket_stock_info, - /** - * 保存比赛门票库存信息锁 - **/ - save_game_ticket_stock_info_lock, - /** - * 购买门票锁 - **/ - game_manage_buy_ticket_lock, - /** - * 更新数据库门票库存锁 - **/ - game_update_ticket_stock_lock, - /** - * 更新数据库门票累计消耗锁 - **/ - game_update_ticket_saled_count_lock, - /** - * 门票购买记录锁 - **/ - game_ticket_buy_record_lock, - /** - * 用户卡包锁 - **/ - game_manage_user_ticket_wallet_lock, - /** - * 比赛已报名人数 - */ - game_manage_match_has_quota_count, - /** - * 报名比赛锁 - */ - game_manage_user_join_match_lock, - /** - * 修改比赛状态锁 - */ - game_manage_change_match_status_lock, - /** - * 更新用户钱包奖励币锁 - **/ - game_manage_user_reward_money_lock, - /** - * 用户钱包锁 - **/ - game_manage_user_purse_lock, - /** - * 用户提现锁 - **/ - game_manage_user_withdraw_lock, - /** - * 赛事管理banner - **/ - game_manage_banner, /** * 管理后台公会数据统计缓存key **/ admin_labor_stats, - /** - * 无界用户麦标识id - */ - wujie_user_media_token, /** * 用户是否已经收到密码登录新版本小秘书消息标识 **/ @@ -1294,7 +865,6 @@ public enum RedisKey { /** * 引流小组后台 start **/ - flow_team_admin_httpsession_store, flow_team_admin_account_not_exist, //管理员账号不存在:10秒内已检查过 flow_team_admin_sent_sms, //管理员获取短信:3分钟内已发送过 flow_team_admin_sms_code_count, //30分钟内发验证码次数 @@ -1320,57 +890,6 @@ public enum RedisKey { **/ limit_first_charge_reward_send_reward_lock, - /** - * 送赠门票 - **/ - // 邀请好友报名送赠门票锁 - invite_user_quota_lock, - user_access_ticket_info, - // 用户完成每日首登任务次数 - user_done_day_login_task_time, - // 用户完成每周首登任务次数, - user_done_week_login_task_time, - /** 送赠门票 **/ - /** - * 渠道门票包 - */ - // 已领取门票手机号 - game_channel_ticket_package_receive_phone, - // 已领取门票用户uid - game_channel_ticket_package_receive_user, - /** - * 比赛门票库存信息 - **/ - game_channel_ticket_package_stock_info, - /** - * 更新数据库门票库存锁 - **/ - game_channel_ticket_package_stock_lock, - /** - * 更新数据库门票累计消耗锁 - **/ - game_channel_ticket_package_saled_count_lock, - /** - * 保存比赛门票库存信息锁 - **/ - game_channel_ticket_package_save_game_ticket_stock_info_lock, - /** - * 领取门票锁 - **/ - game_channel_ticket_package_receive_ticket_lock, - /** - * 赛事已报名人数 - */ - game_manage_has_quota_count, - /** - * 赛事已发送企业微信通知 - */ - game_manage_has_send_quota_wx_notify, - /** - * 快速赛达到开赛要求时间 - */ - quick_game_enough_quota_time, - room_visitor_user_dict_lock, room_visitor_user_exit_flag,//用户是否为引流直播用户标示:有效期,1天,String @@ -1383,20 +902,6 @@ public enum RedisKey { blind_room_max_gift_val_trigger_lock,//相亲模式下礼物统计锁 blind_room_next_lock,//相亲模式下礼物统计锁 - /** - * 英雄联盟拉新活动 start - **/ - act_lol_user_device_id,// 英雄联盟活动期间登录用户设备号 - act_lol_new_user, // 英雄联盟活动注册的新用户 - act_lol_user_bean_num,// 英雄联盟活动用户紫豆数量 - act_lol_in_room_time, // 英雄联盟活动进房记录时间 - act_lol_room_record, // 英雄联盟活动每日进房记录 - act_lol_task_status, // 英雄联盟活动每日任务状态 - act_lol_user, // 英雄联盟活动送礼总值 和 送礼任务完成次数 - act_lol_send_bean_lock, // 英雄联盟活动赠送紫豆锁 - act_lol_exchange_award_lock, // 英雄联盟活动兑换奖励锁 - /** 英雄联盟拉新活动 end **/ - /** * */ @@ -1407,12 +912,7 @@ public enum RedisKey { */ clan_rank, - /*牌照房缓存*/ - room_visitor_user_dict_init_lock, - /*跨房PK*/ - initiate_cross_room_pk_lock,//发起pk锁 - accept_cross_room_pk_lock,//接受pk锁 permit_room_cache,//牌照房缓存zset:按在线人数排序 single_room_cache,//个播房缓存zset:按在线人数排序 cross_room_pk_initiate_lock,//发起pk锁 @@ -1445,33 +945,11 @@ public enum RedisKey { flow_team_curr_gen_invite_code,// 当前已经用到的邀请码 flow_team_gen_invite_code_lock, // 重置邀请码生成起点锁 - /** - * uv、pv流量统计缓存 - **/ - flow_statis, - /** * 活动礼包 **/ update_user_piece_lock, //活动礼包碎片更新锁 - /** - * 许愿星杯 - **/ - wish_star_cup_user_day_get_key,// 许愿星杯用户每日获取魔法棒 - wish_star_cup_user_total_get_key,// 许愿星杯用户活动期间内总获取魔法棒 - wish_star_cup_day_get_key,// 许愿星杯没日获取魔法棒标识 - wish_star_cup_user_total_gift_value,// 许愿星杯用户活动期间总送礼价值 - wish_star_cup_add_key_lock,// 许愿星杯发放魔法棒锁 - wish_star_cup_send_gift_day_has_send_msg_key,// 许愿星杯当日是否通过送礼发放消息 - wish_star_cup_server_stage_day_stat,// 许愿星每日全民狂欢值信息 - wish_star_cup_receive_key_lock,// 许愿星领取魔法棒锁 - wish_star_cup_draw_lock,// 许愿星杯抽奖锁 - wish_star_cup_draw_prize_stock,// 许愿星杯奖品库存 - wish_star_cup_draw_special_gift_flag,// 许愿星杯限时礼物是否已经出现标识 - wish_star_cup_draw_special_gift_time,// 许愿星杯限时礼物出现时间 - wish_star_cup_draw_special_prize_lock,// 许愿星杯特殊礼物锁 - home_resource_strategy_seq,//资源策略序号 home_resource_lock,//首页资源位编辑 @@ -1587,28 +1065,6 @@ public enum RedisKey { **/ single_room_stats_cache, - - invite_make_cp_lock,//组CP邀请锁 - invite_cp_deny_lock,//拒绝cp锁 - accept_cp_verify_lock,//同意组cp时的校验 - cp_invite_limit,//每日邀请次数限制 - cp_unbound_freq_limit,//解绑频次限制 - user_cp_secret_val,//cp用户亲密值:hash - cp_user_gold_sum,//cp用户送礼钻石总数:hash - user_couple_level_config,//用户cp等级缓存,Hash - cp_secret_val_lock,//加减cp亲密值锁 - cp_gift_secret_day_limit,//每日送礼亲密值记录 - cp_send_gift_lock,//每日送礼亲密值记录 - cp_user_chat_num,//CP用户每日私聊次数 - cp_user_chat_sum,//cp用户送礼钻石总数:hash - cp_chat_lock,//每日送礼亲密值记录 - cp_user_keep_duration,//写入cp陪伴时长 - cp_in_same_room_start_ms,//cp用户在同一房间的起始时间戳:hash - cp_in_same_room_ms_daily,//cp用户当天在同一房间当天累计时长 - cp_in_same_room_ms_total,//cp用户当天在同一房间累计时长 - cp_same_room_lock,//cp同一房间处理锁 - cp_mp_apply_lock,//cp同一房间处理锁 - user_login_pwd_wrong_day_count, // 用户每日累计输错登录密码次数 /** @@ -1658,16 +1114,8 @@ public enum RedisKey { anchor_fans_send_daliy_design_gift_lock, // 粉丝团每日赠送专属礼物锁 anchor_fans_send_join_gift_sign, // 粉丝加入粉丝团标识 - single_room_rank, - - lucky_bag_send_rank, // 2022福袋榜单活动神豪榜 - lucky_bag_send_total_rank, // 2022福袋榜单活动神豪榜总榜 - lucky_bag_receive_rank, // 2022福袋榜单活动魅力榜 - lucky_bag_receive_total_rank, // 2022福袋榜单活动魅力榜总榜 - - user_invisible_in_room,// 用户隐身进房转状态 @@ -1695,10 +1143,6 @@ public enum RedisKey { * 礼物合成记录 key */ gift_compound_record, - /** - * 礼物合成礼物列表 - */ - gift_compound_list, /******************************************************* 福袋偏差start ****************************************************/ /** @@ -1713,10 +1157,6 @@ public enum RedisKey { * 福袋用户获得礼物价值 **/ lucky_bag_gift_user_gift_value, - /** - * 用户福袋单日消费金币数 - **/ - lucky_bag_gift_user_spend_gold_value, /******************************************************* 福袋偏差end ****************************************************/ new_find_newbie_list_cache, //新版 发现萌新列表缓存 @@ -1730,11 +1170,6 @@ public enum RedisKey { */ gift_compound_reward, - - /** - * 房间在线人数缓存 - */ - room_online_num_cache, user_room_car_num, //用户房间卡片弹出次数 buy_headwear_lock,// 购买头饰锁 @@ -1781,14 +1216,12 @@ public enum RedisKey { clan_apply_join, //模厅申请加入家族 lock_clan_apply, - lock_clan_quit, phone_auth_apply_lock,// 申请手机授权码锁 area_code_cash,// 区号缓存 clan_gold_exchange_record_lock, //公会金币兑换锁 - user_in_out_room, //计算用户在房间内时长 user_in_out_room_record, //计算用户在房间内时长 user_in_out_room_lock, //计算用户在房间内时长 @@ -1803,9 +1236,6 @@ public enum RedisKey { label, room_first_charge_window, - // 夺宝精灵 - seize_treasure, - single_room_day_rankings,// 个播房贡献日榜 single_room_week_rankings,// 个播房贡献周榜 single_room_month_rankings,// 个播房贡献月榜 diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java index e3c3ac470..e20b4384a 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/mycard/MyCardService.java @@ -1,9 +1,10 @@ package com.accompany.payment.mycard; import cn.hutool.core.util.StrUtil; -import com.accompany.core.exception.AdminServiceException; +import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.EnvComponent; import com.accompany.core.dto.HttpForm; +import com.accompany.core.exception.ServiceException; import com.accompany.core.util.OkHttpUtils; import com.accompany.payment.constant.PayConstant; import com.accompany.payment.mycard.config.MyCardConfig; @@ -14,6 +15,7 @@ import com.accompany.payment.mycard.resp.AuthGlobalResp; import com.accompany.payment.mycard.resp.PayItemQueryResp; import com.accompany.payment.mycard.resp.TradeQueryResp; import com.alibaba.fastjson.JSONObject; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; import org.jetbrains.annotations.NotNull; @@ -61,81 +63,66 @@ public class MyCardService { @Autowired private EnvComponent envComponent; + @SneakyThrows public AuthGlobalResp authGlobal(String facTradeSeq, String serverId, String customerId, String paymentType, String itemCode, String productName, String amount, String currency) { - try { - AuthGlobalParam param = new AuthGlobalParam(); - param.setFacServiceId(myCardConfig.getFacServiceId()); - param.setFacGameId(myCardConfig.getFacGameId()); - param.setFacGameName(myCardConfig.getFacGameName()); - param.setFacTradeSeq(facTradeSeq); - param.setServerId(serverId); - param.setCustomerId(customerId); - param.setPaymentType(paymentType); - param.setItemCode(itemCode); - param.setProductName(productName); - param.setAmount(amount); - param.setCurrency(currency); - param.setSandBoxMode(envComponent.getDevEnv().toString()); - //生成Hash - String preHashValue = param.getFacServiceId() + param.getFacTradeSeq() + param.getFacGameId() + param.getFacGameName() + param.getTradeType() + param.getServerId() + param.getCustomerId() + param.getPaymentType() + param.getItemCode() + param.getProductName() + param.getAmount() + param.getCurrency() + param.getSandBoxMode() + param.getFacReturnURL() + myCardConfig.getSecretKey(); - String encodeHashValue = URLEncoder.encode(preHashValue, StandardCharsets.UTF_8.name()).toLowerCase(); - String hash = DigestUtils.sha256Hex(encodeHashValue).replaceAll(StrUtil.DASHED, StrUtil.EMPTY).toLowerCase(); - param.setHash(hash); - List params = buildParams(param); - String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + AUTH_GLOBAL, params); - log.info("serverId : {}, customerId : {}, result : {}", serverId, customerId, result); - AuthGlobalResp response = JSONObject.parseObject(result, AuthGlobalResp.class); - //检查响应体 - checkResponseBody(response); - return response; - } catch (Exception e) { - throw new AdminServiceException(e.getMessage()); - } + AuthGlobalParam param = new AuthGlobalParam(); + param.setFacServiceId(myCardConfig.getFacServiceId()); + param.setFacGameId(myCardConfig.getFacGameId()); + param.setFacGameName(myCardConfig.getFacGameName()); + param.setFacTradeSeq(facTradeSeq); + param.setServerId(serverId); + param.setCustomerId(customerId); + param.setPaymentType(paymentType); + param.setItemCode(itemCode); + param.setProductName(productName); + param.setAmount(amount); + param.setCurrency(currency); + param.setSandBoxMode(envComponent.getDevEnv().toString()); + //生成Hash + String preHashValue = param.getFacServiceId() + param.getFacTradeSeq() + param.getFacGameId() + param.getFacGameName() + param.getTradeType() + param.getServerId() + param.getCustomerId() + param.getPaymentType() + param.getItemCode() + param.getProductName() + param.getAmount() + param.getCurrency() + param.getSandBoxMode() + param.getFacReturnURL() + myCardConfig.getSecretKey(); + String encodeHashValue = URLEncoder.encode(preHashValue, StandardCharsets.UTF_8.name()).toLowerCase(); + String hash = DigestUtils.sha256Hex(encodeHashValue).replaceAll(StrUtil.DASHED, StrUtil.EMPTY).toLowerCase(); + param.setHash(hash); + List params = buildParams(param); + String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + AUTH_GLOBAL, params); + log.info("serverId : {}, customerId : {}, result : {}", serverId, customerId, result); + AuthGlobalResp response = JSONObject.parseObject(result, AuthGlobalResp.class); + //检查响应体 + checkResponseBody(response); + return response; } public TradeQueryResp tradeQuery(String authCode) { - try { - AuthCodeParam param = new AuthCodeParam(); - param.setAuthCode(authCode); - List params = buildParams(param); - String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + TRADE_QUERY, params); - log.info("tradeQuery authCode : {}, result : {}", authCode, result); - TradeQueryResp response = JSONObject.parseObject(result, TradeQueryResp.class); - checkResponseBody(response); - return response; - } catch (Exception e) { - throw new AdminServiceException(e.getMessage()); - } + AuthCodeParam param = new AuthCodeParam(); + param.setAuthCode(authCode); + List params = buildParams(param); + String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + TRADE_QUERY, params); + log.info("tradeQuery authCode : {}, result : {}", authCode, result); + TradeQueryResp response = JSONObject.parseObject(result, TradeQueryResp.class); + checkResponseBody(response); + return response; } public PayItemQueryResp payItemQuery(String facServiceId) { - try { - FacServiceIdParam param = new FacServiceIdParam(); - param.setFacServiceId(facServiceId); - List params = buildParams(param); - String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + PAY_ITEM_QUERY, params); - log.info("payItemQuery facServiceId : {}, result : {}", facServiceId, result); - PayItemQueryResp response = JSONObject.parseObject(result, PayItemQueryResp.class); - checkResponseBody(response); - return response; - } catch (Exception e) { - throw new AdminServiceException(e.getMessage()); - } + FacServiceIdParam param = new FacServiceIdParam(); + param.setFacServiceId(facServiceId); + List params = buildParams(param); + String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + PAY_ITEM_QUERY, params); + log.info("payItemQuery facServiceId : {}, result : {}", facServiceId, result); + PayItemQueryResp response = JSONObject.parseObject(result, PayItemQueryResp.class); + checkResponseBody(response); + return response; } public TradeQueryResp paymentConfirm(String authCode) { - try { - AuthCodeParam param = new AuthCodeParam(); - param.setAuthCode(authCode); - List params = buildParams(param); - String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + PAYMENT_CONFIRM, params); - log.info("paymentConfirm authCode : {}, result : {}", authCode, result); - TradeQueryResp response = JSONObject.parseObject(result, TradeQueryResp.class); - checkResponseBody(response); - return response; - } catch (Exception e) { - throw new AdminServiceException(e.getMessage()); - } + AuthCodeParam param = new AuthCodeParam(); + param.setAuthCode(authCode); + List params = buildParams(param); + String result = OkHttpUtils.postWithForm(myCardConfig.getDomain() + PAYMENT_CONFIRM, params); + log.info("paymentConfirm authCode : {}, result : {}", authCode, result); + TradeQueryResp response = JSONObject.parseObject(result, TradeQueryResp.class); + checkResponseBody(response); + return response; } /** @@ -176,19 +163,19 @@ public class MyCardService { //參數有誤 break; case "MBP001": - throw new AdminServiceException("參數有誤"); + throw new ServiceException(BusiStatus.PARAMERROR); case "MBP002": - throw new AdminServiceException("查詢資料失敗"); + throw new ServiceException(BusiStatus.SERVERBUSY); case "MBP003": - throw new AdminServiceException("Hash 值不正確"); + throw new ServiceException(BusiStatus.PARAMETERILLEGAL); case "MBP004": - throw new AdminServiceException(returnMsg); + throw new ServiceException(returnMsg); case "MBP005": - throw new AdminServiceException("查詢失敗"); + throw new ServiceException(BusiStatus.SERVERERROR); case "MBP098": - throw new AdminServiceException("授權碼有誤"); + throw new ServiceException(BusiStatus.INVALID_REQUEST); case "MBP099": - throw new AdminServiceException("授權失敗"); + throw new ServiceException(BusiStatus.INVALID_REQUEST); } } diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java index 951f5260a..94402b232 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/PayCenterService.java @@ -2,7 +2,6 @@ package com.accompany.payment.service; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.EnvComponent; @@ -205,7 +204,7 @@ public class PayCenterService { PayContext payContext = buildPayContext(null, null, successUrlSb.toString(), chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { - throw new AdminServiceException("支付失败.未找到正确的支付渠道"); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } TarotChargeRetVo retVo = new TarotChargeRetVo(); Object ret = strategy.pay(payContext); @@ -220,6 +219,7 @@ public class PayCenterService { saveOrderToCache(chargeRecord); } catch (Exception e) { log.error("缓存增加订单数出现异常", e); + throw e; } retVo.setChargeRecordId(chargeRecord.getChargeRecordId()); BaseResponseVO.setData(retVo); @@ -252,7 +252,7 @@ public class PayCenterService { PayContext payContext = buildPayContext(null, null, successUrl, facReturnUrl, chargeProd, chargeRecord, realName, idCardNum, deviceInfo); PayStrategy strategy = payStrategyFactory.getStrategy(channel); if (strategy == null) { - throw new AdminServiceException(500, "支付失败.未找到正确的支付渠道"); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } Object ret = null; try { diff --git a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java index d265cd6ca..75853f8cb 100644 --- a/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java +++ b/accompany-base/accompany-payment/accompany-payment-service/src/main/java/com/accompany/payment/service/impl/ChargeUserLimitServiceImpl.java @@ -3,8 +3,8 @@ package com.accompany.payment.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; +import com.accompany.core.exception.ServiceException; import com.accompany.core.service.SysConfService; import com.accompany.payment.dto.ChargeGuideConfig; import com.accompany.payment.mapper.ChargeUserLimitMapper; @@ -46,7 +46,7 @@ public class ChargeUserLimitServiceImpl extends ServiceImpl actUserTasks = actUserTaskService.list(Wrappers.lambdaQuery() @@ -104,47 +100,47 @@ public class ActUserTaskServiceImpl extends ServiceImpl actTasks = actTaskService.list(Wrappers.lambdaQuery() .eq(ActTask::getActivityCode, activityCode) .eq(ActTask::getTaskCode, taskCode)); if (CollectionUtil.isEmpty(actTasks)) { - throw new AdminServiceException("任务不存在"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } ActTask actTask = actTasks.get(0); Integer taskValue = actTask.getTaskValue(); if (!Objects.equals(diamondNum, taskValue)) { - throw new AdminServiceException("金额不匹配"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } List actTaskConditions = actTaskConditionService.list(Wrappers.lambdaQuery() .eq(ActTaskCondition::getActivityCode, activityCode) .eq(ActTaskCondition::getTaskCode, taskCode) .eq(ActTaskCondition::getConditionKind, ActConditionKindEnum.GE.name())); if (CollectionUtil.isEmpty(actTaskConditions)) { - throw new AdminServiceException("任务条件不存在"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } ActTaskCondition actTaskCondition = actTaskConditions.get(0); Long conditionValue = actTaskCondition.getConditionValue(); long activityValue = actUserTasks.stream().mapToLong(ActUserTask::getActivityValue).sum(); if (conditionValue == 0) { - throw new AdminServiceException("任务值不能为0"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } long validNum = activityValue / conditionValue; if (num > validNum) { - throw new AdminServiceException("超过可用数量"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } List actTaskRewards = actTaskRewardService.list(Wrappers.lambdaQuery() .eq(ActTaskReward::getActivityCode, activityCode) .eq(ActTaskReward::getTaskCode, taskCode)); if (CollectionUtil.isEmpty(actTaskRewards)) { - throw new AdminServiceException("缺少奖励配置"); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } //余额校验 UserPurse userPurse = userPurseService.queryUserPurse(uid); Double currentDiamonds = userPurse.getDiamonds(); if (diamondNum > currentDiamonds) { - throw new AdminServiceException(BusiStatus.PURSE_MONEY_NOT_ENOUGH); + throw new ServiceException(BusiStatus.PURSE_MONEY_NOT_ENOUGH); } //扣减钱包 if (!userPurseService.subDiamond(uid, diamondNum.doubleValue(), BillObjTypeEnum.ACTIVITY_PACKET.getDesc())) { diff --git a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java index b695e074f..77ab23e73 100644 --- a/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java +++ b/accompany-business/accompany-business-festival-activity/festival-activity-service/src/main/java/com/accompany/business/activity/strategy/ActRewardFactory.java @@ -1,9 +1,9 @@ package com.accompany.business.activity.strategy; import cn.hutool.core.collection.CollectionUtil; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; +import com.accompany.core.exception.ServiceException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -21,7 +21,7 @@ public final class ActRewardFactory { if (ACT_REWARD_MAP.isEmpty()) { Map map = SpringContextHolder.getApplicationContext().getBeansOfType(IActRewardStrategy.class); if (CollectionUtil.isEmpty(map)) { - throw new AdminServiceException(BusiStatus.SERVERERROR); + throw new ServiceException(BusiStatus.SERVERERROR); } for (Map.Entry entry : map.entrySet()) { ACT_REWARD_MAP.put(entry.getValue().getRewardType(), entry.getValue()); diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpAcceptLetterDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpAcceptLetterDto.java deleted file mode 100644 index 9a46a6092..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpAcceptLetterDto.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel("cp记录信息") -public class CpAcceptLetterDto extends CpInviteLetterDto { - /** - * 被邀请人昵称 - */ - @ApiModelProperty(value = "到期时间:多久不回复自动到期") - private Long replyExpireTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteBillRecordDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteBillRecordDto.java deleted file mode 100644 index 6a60c3d78..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteBillRecordDto.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.accompany.business.dto; - -import com.accompany.business.model.clan.ClanAccountAssociate; -import com.accompany.core.enumeration.BillObjTypeEnum; -import lombok.Data; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION:发起CP邀请记录 - */ -@Data -public class CpInviteBillRecordDto { - - private Long uid; - - private Long targetUid; - - private Long roomUid; - - private String objId; - - private BillObjTypeEnum eventEnum; - - private Double amount; - - private Integer giftId; - - private Integer giftNum; - - private Double hallPerRate; - - private ClanAccountAssociate clanAccountAssociate; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteLetterDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteLetterDto.java deleted file mode 100644 index e5b3f6e90..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpInviteLetterDto.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.accompany.business.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel("cp记录信息") -public class CpInviteLetterDto { - /** - * 组cp邀请id - */ - @ApiModelProperty(value = "组cp邀请id") - private Long cpId; - /** - * 邀请人uid - */ - @ApiModelProperty(value = "邀请人uid") - private Long inviteUid; - /** - * 邀请人头像 - */ - @ApiModelProperty(value = "邀请人头像") - private String inviteAvatar; - /** - * 被邀请方uid - */ - @ApiModelProperty(value = "邀请人昵称") - private String inviteNick; - /** - * 邀请人性别 - */ - @ApiModelProperty(value = "邀请人性别") - private Byte inviteGender; - /** - * 被邀请人uid - */ - @ApiModelProperty(value = "被邀请人uid") - private Long acceptUid; - /** - * 被邀请人头像 - */ - @ApiModelProperty(value = "被邀请人头像") - private String acceptAvatar; - /** - * 被邀请人昵称 - */ - @ApiModelProperty(value = "被邀请人昵称") - private String acceptNick; - /** - * 被邀请人性别 - */ - @ApiModelProperty(value = "被邀请人性别") - private Byte acceptGender; - /** - *道具id - */ - @ApiModelProperty(value = "道具id") - private Integer propsId; - @ApiModelProperty(value = "道具名称") - private String propsName; - @ApiModelProperty(value = "道具图片") - private String propsImg; - @ApiModelProperty(value = "道具价格") - private BigDecimal propsPrice; - - /** - * 默认推荐誓言文案 - */ - @ApiModelProperty(value = "默认推荐誓言文案") - private List recommenTxtList; - @ApiModelProperty(value = "当前cp关系誓言") - private String declaration; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpMpApplyDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpMpApplyDto.java deleted file mode 100644 index 75bb523ec..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpMpApplyDto.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.accompany.business.dto; - -import com.accompany.common.annotation.ReplaceAppDomain; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION:CP铭牌申请记录 - */ -@Data -@ApiModel -public class CpMpApplyDto { - @ApiModelProperty(value = "铭牌id") - private Long mpId; - @ApiModelProperty(value = "铭牌名称") - private String mpName; - @ApiModelProperty(value = "铭牌地址") - @ReplaceAppDomain - private String iconPic; - @ApiModelProperty(value = "申请时填写的铭牌文字") - private String mpTxt; - @ApiModelProperty(value = "审核情况:0、待审核,1、审核不通过,2、审核通过'") - private Integer auditType; - @ApiModelProperty(value = "不通过原因") - private String noPassReason; - @ApiModelProperty(value = "申请时间") - private Date applyTime; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpRelationDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpRelationDto.java deleted file mode 100644 index 356bb3750..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpRelationDto.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.accompany.business.dto; - -import com.fasterxml.jackson.annotation.JsonInclude; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel("亲密关系信息") -@JsonInclude -public class CpRelationDto { - /** - * cp记录id - */ - @ApiModelProperty(value = "cp记录id") - private Long cpId; - /** - * 邀请人uid - */ - @ApiModelProperty(value = "用户uid") - private Long uid; - /** - * 被邀请方uid - */ - @ApiModelProperty(value = "用户昵称") - private String nick; - /** - * 邀请人性别 - */ - @ApiModelProperty(value = "用户性别") - private Byte gender; - /** - * 邀请人头像 - */ - @ApiModelProperty(value = "用户头像") - private String avatar; - /** - * 被邀请人uid - */ - @ApiModelProperty(value = "cp对象uid") - private Long cpUid; - /** - * 被邀请人昵称 - */ - @ApiModelProperty(value = "cp对象昵称") - private String cpNick; - /** - * 被邀请人性别 - */ - @ApiModelProperty(value = "cp对象性别") - private Byte cpGender; - /** - * 被邀请人头像 - */ - @ApiModelProperty(value = "cp对象头像") - private String cpAvatar; - /** - * 被邀请人头像 - */ - @ApiModelProperty(value = "cp等级") - private Integer cpLevel; - /** - * cp关系誓言 - */ - @ApiModelProperty(value = "cp关系誓言") - private String declaration; - /** - * cp陪伴时长:单位小时 - */ - @ApiModelProperty(value = "cp陪伴时长:单位小时") - private String cpKeepDuration; - /** - * cp位背景图片 - */ - @ApiModelProperty(value = "cp位背景图片") - private String cpBackImg; - /** - * cp状态:true-等待解绑中,false-cp中 - */ - @ApiModelProperty(value = "cp状态:true-等待解绑中,false-cp中") - private Boolean waitUnbound = false; - /** - * 解绑人 - */ - @ApiModelProperty(value = "解绑人uid") - private Long unboundUid; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpTaskProcessDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpTaskProcessDto.java deleted file mode 100644 index 823987aae..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/CpTaskProcessDto.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.accompany.business.dto; - -import com.accompany.business.dto.yidun.CpTaskDetailDto; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.List; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel("亲密关系信息") -public class CpTaskProcessDto { - /** - * 邀请人uid - */ - @ApiModelProperty(value = "用户uid") - private Long uid; - /** - * 被邀请方uid - */ - @ApiModelProperty(value = "用户昵称") - private String nick; - /** - * 邀请人性别 - */ - @ApiModelProperty(value = "用户性别") - private Byte gender; - /** - * 邀请人头像 - */ - @ApiModelProperty(value = "用户头像") - private String avatar; - /** - * 被邀请人uid - */ - @ApiModelProperty(value = "cp对象uid") - private Long cpUid; - /** - * 被邀请人昵称 - */ - @ApiModelProperty(value = "cp对象昵称") - private String cpNick; - /** - * 被邀请人性别 - */ - @ApiModelProperty(value = "cp对象性别") - private Byte cpGender; - /** - * 被邀请人头像 - */ - @ApiModelProperty(value = "cp对象头像") - private String cpAvatar; - /** - * cp关系誓言 - */ - @ApiModelProperty(value = "cp关系誓言") - private String declaration; - /** - * cp陪伴时长:单位小时 - */ - @ApiModelProperty(value = "cp陪伴时长:单位小时") - private String cpKeepDuration; - /** - * cp位背景图片 - */ - @ApiModelProperty(value = "cp位背景图片") - private String cpBackImg; - /** - * cp等级 - */ - @ApiModelProperty(value = "cp等级") - private Integer cpLevel; - /** - * cp亲密值 - */ - @ApiModelProperty(value = "cp亲密值") - private Long cpSecretVal; - /** - * cp下一等级所需亲密值 - */ - @ApiModelProperty(value = "cp下一等级所需亲密值") - private Long cpNextLevelSecretVal; - /** - * cp当前等级到下一等级亲密值百分比(0~1间的小数) - */ - @ApiModelProperty(value = "cp当前等级到下一等级亲密值百分比(0~1间的小数)") - private float levelPercent; - /** - * 是否衰减标志:true-是,false-否 - */ - @ApiModelProperty(value = "是否衰减标志:true-是,false-否") - private Boolean isDamp; - /** - * 日任务列表 - */ - @ApiModelProperty(value = "日任务列表") - private List dailyTask; - /** - * 累计任务列表 - */ - @ApiModelProperty(value = "累计任务列表") - private List totalTask; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleSendDetailDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleSendDetailDto.java deleted file mode 100644 index f2b53fd3c..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleSendDetailDto.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.dto; - -import com.accompany.common.annotation.FieldComment; -import com.accompany.core.vo.BaseVo; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -public class UserCoupleSendDetailDto extends BaseVo { - /** - * CP关系总数量 - */ - @FieldComment("时间") - public Date createTime; - /** - * CP关系维持中数量 - */ - @FieldComment("送礼金额") - public Long totalGoldNum; - - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleStatisticalTotalDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleStatisticalTotalDto.java deleted file mode 100644 index 2d036dc6b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCoupleStatisticalTotalDto.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.accompany.business.dto; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -public class UserCoupleStatisticalTotalDto implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * CP关系总数量 - */ - private Long cpTotalNum = 0l; - /** - * CP关系维持中数量 - */ - private Long cpStateTotalNum = 0l; - /** - * 关系解除中数量 - */ - private Long waitUnboundTotalNum = 0l; - /** - * 关系已解除数量 - */ - private Long unboundTotalNum = 0l; - /** - * 送礼总额 - */ - private Long sendTotalGoldNum = 0l; - - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpLevelMpDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpLevelMpDto.java deleted file mode 100644 index 3ebba2ac6..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpLevelMpDto.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel -public class UserCpLevelMpDto { - @ApiModelProperty(value = "铭牌id") - private Long mpId; - @ApiModelProperty(value = "铭牌名称") - private String mpName; - @ApiModelProperty(value = "铭牌地址") - private String iconPic; - @ApiModelProperty(value = "等级达到或者已经申请过不允许申请:true-不允许申请,false-允许申请") - private Boolean isHave; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpMpDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpMpDto.java deleted file mode 100644 index 5503b791d..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpMpDto.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.accompany.business.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel -public class UserCpMpDto { - @ApiModelProperty(value = "是否拥有CP:true-是,false-否") - private Boolean haveCp; - @ApiModelProperty(value = "用户可申请的铭牌列表") - private List mpDtoList; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpPerRateConfigDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpPerRateConfigDto.java deleted file mode 100644 index 2d0157f87..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpPerRateConfigDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.dto; - -import lombok.Data; - -/** - * @USER: chenli - * @DATE: 2021/10/9 15:30 - * @DESCRIPTION:组CP购买道具分成配置 - */ -@Data -public class UserCpPerRateConfigDto { - /** - * 工会所得比例 - */ - private Double hallPerRate; - /** - * cp对象所得比例 - */ - private Double cpUserPerRate; - /** - * 官方所得比例 - */ - private Double officalPerRate; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpRecordDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpRecordDto.java deleted file mode 100644 index c6f9e0045..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpRecordDto.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.accompany.business.dto; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.math.BigDecimal; -import java.util.Date; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -@ApiModel -public class UserCpRecordDto { - /** - * id - */ - @ApiModelProperty(value = "邀请记录id") - private Long cpId; - /** - * 邀请方uid - */ - @ApiModelProperty(value = "邀请人uid") - private Long inviteUid; - /** - * 被邀请方uid - */ - @ApiModelProperty(value = "被邀请人uid") - private Long acceptUid; - /** - * 关系状态:1-邀请中,2-CP中,3-拒绝,4-解绑中,5-解绑完成 - */ - @ApiModelProperty(value = "状态:1-邀请中,2-CP中,3-拒绝,4-解绑中,5-解绑完成") - private Byte state; - /** - * 关系誓言 - */ - @ApiModelProperty(value = "关系誓言") - private String declaration; - /** - * CP等级 - */ - @ApiModelProperty(value = "CP等级") - private Integer levelSeq; - /** - * 解绑发起人uid:解绑过程中标识 - */ - @ApiModelProperty(value = "解绑人") - private Long unboundUid; - /** - * 解绑发起人uid:解绑过程中标识 - */ - @ApiModelProperty(value = "解绑发起时间") - private Date unboundTime; - /** - *接受邀请时间 - */ - @ApiModelProperty(value = "接受邀请时间") - private Date acceptTime; - /** - *邀请时间 - */ - @ApiModelProperty(value = "邀请时间") - private Date createTime; - /** - * - */ - @ApiModelProperty(value = "更新时间") - private Date updateTime; - - /** - * 邀请方昵称 - */ - @ApiModelProperty(value = "邀请方昵称") - private String inviteUserNick; - /** - * 邀请方性别 - */ - @ApiModelProperty(value = "邀请方性别") - private Byte inviteUserSex; - /** - *邀请方头像 - */ - @ApiModelProperty(value = "邀请方头像") - private String inviteUserAvatar; - /** - * 被邀请方昵称 - */ - @ApiModelProperty(value = "被邀请方昵称") - private String acceptUserNick; - /** - * 被邀请方性别 - */ - @ApiModelProperty(value = "被邀请方性别") - private Byte acceptUserSex; - /** - *被邀请方头像 - */ - @ApiModelProperty(value = "被邀请方头像") - private String acceptUserAvatar; - /** - *到期时间:到期时间点未回复自动拒绝(邀请状态中cp记录才有此值) - */ - @ApiModelProperty(value = "到期时间:到期时间点未回复自动拒绝(邀请状态中cp记录才有此值)") - private Long replyExpireTime; - - /** - *道具id - */ - @ApiModelProperty(value = "道具id") - private Integer propsId; - @ApiModelProperty(value = "道具名称") - private String propsName; - @ApiModelProperty(value = "道具图片") - private String propsImg; - @ApiModelProperty(value = "道具价格") - private BigDecimal propsPrice; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpSecretValCacheDto.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpSecretValCacheDto.java deleted file mode 100644 index 5716ca907..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/dto/UserCpSecretValCacheDto.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.dto; - -import lombok.Data; - -/** - * @USER: chenli - * @DATE: 2022/2/10 15:16 - * @DESCRIPTION: - */ -@Data -public class UserCpSecretValCacheDto { - /** - * 等级序号 - */ - private Integer level; - /** - * 亲密值 - */ - private Long secretVal; - /** - * 最后一次加亲密值时间戳 - */ - private Long ms; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/RedisKeyOverdueEnum.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/RedisKeyOverdueEnum.java index a78d59e76..dfc033e03 100644 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/RedisKeyOverdueEnum.java +++ b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/enums/RedisKeyOverdueEnum.java @@ -15,7 +15,6 @@ public enum RedisKeyOverdueEnum { CROSS_ROOM_PK_AUTO_DENY(RedisKey.cross_room_ttl_auto_deny.getKey(), "CrossRoomPkAutoDenyHandler"), CROSS_ROOM_PK_AUTO_END(RedisKey.cross_room_pk_auto_end.getKey(), "CrossRoomPkAutoEndHandler"), SINGLE_BROADCAST_UP(RedisKey.single_broadcast_up.getKey(), "SingleBroadcastUpHandler"), - CP_USER_KEEP_DURATION(RedisKey.cp_user_keep_duration.getKey(), "CpUserKeepTaskHandler"), ; diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/WriteCpInviteBillEvent.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/WriteCpInviteBillEvent.java deleted file mode 100644 index f0a33a798..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/event/WriteCpInviteBillEvent.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.accompany.business.event; - -import com.accompany.business.dto.CpInviteBillRecordDto; -import lombok.AllArgsConstructor; -import lombok.Data; - -import java.util.List; - -/** - * @USER: chenli - * @DATE: 2021/12/29 18:28 - * @DESCRIPTION: - */ -@Data -@AllArgsConstructor -public class WriteCpInviteBillEvent { - /** - * 代写账单 - */ - private List billRecordDtoList; -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConf.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConf.java deleted file mode 100644 index 878a20083..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConf.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class AppVersionUpdateConf { - private String version; - - private String os; - - private Byte type; - - private Date createTime; - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version == null ? null : version.trim(); - } - - public String getOs() { - return os; - } - - public void setOs(String os) { - this.os = os == null ? null : os.trim(); - } - - public Byte getType() { - return type; - } - - public void setType(Byte type) { - this.type = type; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConfExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConfExample.java deleted file mode 100644 index b4ebf41a4..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/AppVersionUpdateConfExample.java +++ /dev/null @@ -1,461 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class AppVersionUpdateConfExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - public AppVersionUpdateConfExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andVersionIsNull() { - addCriterion("version is null"); - return (Criteria) this; - } - - public Criteria andVersionIsNotNull() { - addCriterion("version is not null"); - return (Criteria) this; - } - - public Criteria andVersionEqualTo(String value) { - addCriterion("version =", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotEqualTo(String value) { - addCriterion("version <>", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThan(String value) { - addCriterion("version >", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionGreaterThanOrEqualTo(String value) { - addCriterion("version >=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThan(String value) { - addCriterion("version <", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLessThanOrEqualTo(String value) { - addCriterion("version <=", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionLike(String value) { - addCriterion("version like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotLike(String value) { - addCriterion("version not like", value, "version"); - return (Criteria) this; - } - - public Criteria andVersionIn(List values) { - addCriterion("version in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotIn(List values) { - addCriterion("version not in", values, "version"); - return (Criteria) this; - } - - public Criteria andVersionBetween(String value1, String value2) { - addCriterion("version between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andVersionNotBetween(String value1, String value2) { - addCriterion("version not between", value1, value2, "version"); - return (Criteria) this; - } - - public Criteria andOsIsNull() { - addCriterion("os is null"); - return (Criteria) this; - } - - public Criteria andOsIsNotNull() { - addCriterion("os is not null"); - return (Criteria) this; - } - - public Criteria andOsEqualTo(String value) { - addCriterion("os =", value, "os"); - return (Criteria) this; - } - - public Criteria andOsNotEqualTo(String value) { - addCriterion("os <>", value, "os"); - return (Criteria) this; - } - - public Criteria andOsGreaterThan(String value) { - addCriterion("os >", value, "os"); - return (Criteria) this; - } - - public Criteria andOsGreaterThanOrEqualTo(String value) { - addCriterion("os >=", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLessThan(String value) { - addCriterion("os <", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLessThanOrEqualTo(String value) { - addCriterion("os <=", value, "os"); - return (Criteria) this; - } - - public Criteria andOsLike(String value) { - addCriterion("os like", value, "os"); - return (Criteria) this; - } - - public Criteria andOsNotLike(String value) { - addCriterion("os not like", value, "os"); - return (Criteria) this; - } - - public Criteria andOsIn(List values) { - addCriterion("os in", values, "os"); - return (Criteria) this; - } - - public Criteria andOsNotIn(List values) { - addCriterion("os not in", values, "os"); - return (Criteria) this; - } - - public Criteria andOsBetween(String value1, String value2) { - addCriterion("os between", value1, value2, "os"); - return (Criteria) this; - } - - public Criteria andOsNotBetween(String value1, String value2) { - addCriterion("os not between", value1, value2, "os"); - return (Criteria) this; - } - - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - public Criteria andTypeEqualTo(Byte value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotEqualTo(Byte value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThan(Byte value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThan(Byte value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeLessThanOrEqualTo(Byte value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - public Criteria andTypeBetween(Byte value1, Byte value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andTypeNotBetween(Byte value1, Byte value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCard.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCard.java deleted file mode 100644 index 803a7fd14..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCard.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendCard { - private Long id; - - private Long uid; - - private String cardName; - - private Date validStartTime; - - private Date validEndTime; - - private Date usedStartTime; - - private Date usedEndTime; - - private Date createTime; - - private String createdBy; - - private Byte status; - - private Date updateTime; - - private Integer period; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public String getCardName() { - return cardName; - } - - public void setCardName(String cardName) { - this.cardName = cardName == null ? null : cardName.trim(); - } - - public Date getValidStartTime() { - return validStartTime; - } - - public void setValidStartTime(Date validStartTime) { - this.validStartTime = validStartTime; - } - - public Date getValidEndTime() { - return validEndTime; - } - - public void setValidEndTime(Date validEndTime) { - this.validEndTime = validEndTime; - } - - public Date getUsedStartTime() { - return usedStartTime; - } - - public void setUsedStartTime(Date usedStartTime) { - this.usedStartTime = usedStartTime; - } - - public Date getUsedEndTime() { - return usedEndTime; - } - - public void setUsedEndTime(Date usedEndTime) { - this.usedEndTime = usedEndTime; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy == null ? null : createdBy.trim(); - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public Integer getPeriod() { - return period; - } - - public void setPeriod(Integer period) { - this.period = period; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCardExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCardExample.java deleted file mode 100644 index 615e2c496..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendCardExample.java +++ /dev/null @@ -1,961 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendCardExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendCardExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andCardNameIsNull() { - addCriterion("card_name is null"); - return (Criteria) this; - } - - public Criteria andCardNameIsNotNull() { - addCriterion("card_name is not null"); - return (Criteria) this; - } - - public Criteria andCardNameEqualTo(String value) { - addCriterion("card_name =", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameNotEqualTo(String value) { - addCriterion("card_name <>", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameGreaterThan(String value) { - addCriterion("card_name >", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameGreaterThanOrEqualTo(String value) { - addCriterion("card_name >=", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameLessThan(String value) { - addCriterion("card_name <", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameLessThanOrEqualTo(String value) { - addCriterion("card_name <=", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameLike(String value) { - addCriterion("card_name like", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameNotLike(String value) { - addCriterion("card_name not like", value, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameIn(List values) { - addCriterion("card_name in", values, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameNotIn(List values) { - addCriterion("card_name not in", values, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameBetween(String value1, String value2) { - addCriterion("card_name between", value1, value2, "cardName"); - return (Criteria) this; - } - - public Criteria andCardNameNotBetween(String value1, String value2) { - addCriterion("card_name not between", value1, value2, "cardName"); - return (Criteria) this; - } - - public Criteria andValidStartTimeIsNull() { - addCriterion("valid_start_time is null"); - return (Criteria) this; - } - - public Criteria andValidStartTimeIsNotNull() { - addCriterion("valid_start_time is not null"); - return (Criteria) this; - } - - public Criteria andValidStartTimeEqualTo(Date value) { - addCriterion("valid_start_time =", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeNotEqualTo(Date value) { - addCriterion("valid_start_time <>", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeGreaterThan(Date value) { - addCriterion("valid_start_time >", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeGreaterThanOrEqualTo(Date value) { - addCriterion("valid_start_time >=", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeLessThan(Date value) { - addCriterion("valid_start_time <", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeLessThanOrEqualTo(Date value) { - addCriterion("valid_start_time <=", value, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeIn(List values) { - addCriterion("valid_start_time in", values, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeNotIn(List values) { - addCriterion("valid_start_time not in", values, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeBetween(Date value1, Date value2) { - addCriterion("valid_start_time between", value1, value2, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidStartTimeNotBetween(Date value1, Date value2) { - addCriterion("valid_start_time not between", value1, value2, "validStartTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeIsNull() { - addCriterion("valid_end_time is null"); - return (Criteria) this; - } - - public Criteria andValidEndTimeIsNotNull() { - addCriterion("valid_end_time is not null"); - return (Criteria) this; - } - - public Criteria andValidEndTimeEqualTo(Date value) { - addCriterion("valid_end_time =", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeNotEqualTo(Date value) { - addCriterion("valid_end_time <>", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeGreaterThan(Date value) { - addCriterion("valid_end_time >", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("valid_end_time >=", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeLessThan(Date value) { - addCriterion("valid_end_time <", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeLessThanOrEqualTo(Date value) { - addCriterion("valid_end_time <=", value, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeIn(List values) { - addCriterion("valid_end_time in", values, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeNotIn(List values) { - addCriterion("valid_end_time not in", values, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeBetween(Date value1, Date value2) { - addCriterion("valid_end_time between", value1, value2, "validEndTime"); - return (Criteria) this; - } - - public Criteria andValidEndTimeNotBetween(Date value1, Date value2) { - addCriterion("valid_end_time not between", value1, value2, "validEndTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeIsNull() { - addCriterion("used_start_time is null"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeIsNotNull() { - addCriterion("used_start_time is not null"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeEqualTo(Date value) { - addCriterion("used_start_time =", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeNotEqualTo(Date value) { - addCriterion("used_start_time <>", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeGreaterThan(Date value) { - addCriterion("used_start_time >", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeGreaterThanOrEqualTo(Date value) { - addCriterion("used_start_time >=", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeLessThan(Date value) { - addCriterion("used_start_time <", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeLessThanOrEqualTo(Date value) { - addCriterion("used_start_time <=", value, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeIn(List values) { - addCriterion("used_start_time in", values, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeNotIn(List values) { - addCriterion("used_start_time not in", values, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeBetween(Date value1, Date value2) { - addCriterion("used_start_time between", value1, value2, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedStartTimeNotBetween(Date value1, Date value2) { - addCriterion("used_start_time not between", value1, value2, "usedStartTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeIsNull() { - addCriterion("used_end_time is null"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeIsNotNull() { - addCriterion("used_end_time is not null"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeEqualTo(Date value) { - addCriterion("used_end_time =", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeNotEqualTo(Date value) { - addCriterion("used_end_time <>", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeGreaterThan(Date value) { - addCriterion("used_end_time >", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("used_end_time >=", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeLessThan(Date value) { - addCriterion("used_end_time <", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeLessThanOrEqualTo(Date value) { - addCriterion("used_end_time <=", value, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeIn(List values) { - addCriterion("used_end_time in", values, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeNotIn(List values) { - addCriterion("used_end_time not in", values, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeBetween(Date value1, Date value2) { - addCriterion("used_end_time between", value1, value2, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andUsedEndTimeNotBetween(Date value1, Date value2) { - addCriterion("used_end_time not between", value1, value2, "usedEndTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNull() { - addCriterion("created_by is null"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNotNull() { - addCriterion("created_by is not null"); - return (Criteria) this; - } - - public Criteria andCreatedByEqualTo(String value) { - addCriterion("created_by =", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotEqualTo(String value) { - addCriterion("created_by <>", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThan(String value) { - addCriterion("created_by >", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThanOrEqualTo(String value) { - addCriterion("created_by >=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThan(String value) { - addCriterion("created_by <", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThanOrEqualTo(String value) { - addCriterion("created_by <=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLike(String value) { - addCriterion("created_by like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotLike(String value) { - addCriterion("created_by not like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByIn(List values) { - addCriterion("created_by in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotIn(List values) { - addCriterion("created_by not in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByBetween(String value1, String value2) { - addCriterion("created_by between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotBetween(String value1, String value2) { - addCriterion("created_by not between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andPeriodIsNull() { - addCriterion("period is null"); - return (Criteria) this; - } - - public Criteria andPeriodIsNotNull() { - addCriterion("period is not null"); - return (Criteria) this; - } - - public Criteria andPeriodEqualTo(Integer value) { - addCriterion("period =", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodNotEqualTo(Integer value) { - addCriterion("period <>", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodGreaterThan(Integer value) { - addCriterion("period >", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodGreaterThanOrEqualTo(Integer value) { - addCriterion("period >=", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodLessThan(Integer value) { - addCriterion("period <", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodLessThanOrEqualTo(Integer value) { - addCriterion("period <=", value, "period"); - return (Criteria) this; - } - - public Criteria andPeriodIn(List values) { - addCriterion("period in", values, "period"); - return (Criteria) this; - } - - public Criteria andPeriodNotIn(List values) { - addCriterion("period not in", values, "period"); - return (Criteria) this; - } - - public Criteria andPeriodBetween(Integer value1, Integer value2) { - addCriterion("period between", value1, value2, "period"); - return (Criteria) this; - } - - public Criteria andPeriodNotBetween(Integer value1, Integer value2) { - addCriterion("period not between", value1, value2, "period"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModule.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModule.java deleted file mode 100644 index 5d12f8cc8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModule.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendModule { - private Long id; - - private String name; - - private Byte type; - - private Integer seqNo; - - private Boolean status; - - private Integer bigPictureNum; - - private Integer listNum; - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - private Integer showType; - - private Boolean deleteFlag; - - private Date createTime; - - private Date updateTime; - - private Byte moduleUse; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Byte getType() { - return type; - } - - public void setType(Byte type) { - this.type = type; - } - - public Integer getSeqNo() { - return seqNo; - } - - public void setSeqNo(Integer seqNo) { - this.seqNo = seqNo; - } - - public Boolean getStatus() { - return status; - } - - public void setStatus(Boolean status) { - this.status = status; - } - - public Integer getBigPictureNum() { - return bigPictureNum; - } - - public void setBigPictureNum(Integer bigPictureNum) { - this.bigPictureNum = bigPictureNum; - } - - public Integer getListNum() { - return listNum; - } - - public void setListNum(Integer listNum) { - this.listNum = listNum; - } - - public Integer getShowType() { - return showType; - } - - public void setShowType(Integer showType) { - this.showType = showType; - } - - public Boolean getDeleteFlag() { - return deleteFlag; - } - - public void setDeleteFlag(Boolean deleteFlag) { - this.deleteFlag = deleteFlag; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public Byte getModuleUse() { - return moduleUse; - } - - public void setModuleUse(Byte moduleUse) { - this.moduleUse = moduleUse; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModuleExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModuleExample.java deleted file mode 100644 index dd507c396..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendModuleExample.java +++ /dev/null @@ -1,1353 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendModuleExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendModuleExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameIsNull() { - addCriterion("name is null"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameIsNotNull() { - addCriterion("name is not null"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameEqualTo(String value) { - addCriterion("name =", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameNotEqualTo(String value) { - addCriterion("name <>", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameGreaterThan(String value) { - addCriterion("name >", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("name >=", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameLessThan(String value) { - addCriterion("name <", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("name <=", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameLike(String value) { - addCriterion("name like", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameNotLike(String value) { - addCriterion("name not like", value, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameIn(List values) { - addCriterion("name in", values, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameNotIn(List values) { - addCriterion("name not in", values, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameBetween(String value1, String value2) { - addCriterion("name between", value1, value2, "name"); - return (Criteria) this; - } - - /** - * 模块标题 - */ - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("name not between", value1, value2, "name"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeIsNull() { - addCriterion("type is null"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeIsNotNull() { - addCriterion("type is not null"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeEqualTo(Byte value) { - addCriterion("type =", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeNotEqualTo(Byte value) { - addCriterion("type <>", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeGreaterThan(Byte value) { - addCriterion("type >", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("type >=", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeLessThan(Byte value) { - addCriterion("type <", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeLessThanOrEqualTo(Byte value) { - addCriterion("type <=", value, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeIn(List values) { - addCriterion("type in", values, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeNotIn(List values) { - addCriterion("type not in", values, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeBetween(Byte value1, Byte value2) { - addCriterion("type between", value1, value2, "type"); - return (Criteria) this; - } - - /** - * 模块类型:1:星推荐,2:热门推荐,3:话题 - */ - public Criteria andTypeNotBetween(Byte value1, Byte value2) { - addCriterion("type not between", value1, value2, "type"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoIsNull() { - addCriterion("seq_no is null"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoIsNotNull() { - addCriterion("seq_no is not null"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoEqualTo(Integer value) { - addCriterion("seq_no =", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoNotEqualTo(Integer value) { - addCriterion("seq_no <>", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoGreaterThan(Integer value) { - addCriterion("seq_no >", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoGreaterThanOrEqualTo(Integer value) { - addCriterion("seq_no >=", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoLessThan(Integer value) { - addCriterion("seq_no <", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoLessThanOrEqualTo(Integer value) { - addCriterion("seq_no <=", value, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoIn(List values) { - addCriterion("seq_no in", values, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoNotIn(List values) { - addCriterion("seq_no not in", values, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoBetween(Integer value1, Integer value2) { - addCriterion("seq_no between", value1, value2, "seqNo"); - return (Criteria) this; - } - - /** - * 排序 - */ - public Criteria andSeqNoNotBetween(Integer value1, Integer value2) { - addCriterion("seq_no not between", value1, value2, "seqNo"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusEqualTo(Boolean value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusNotEqualTo(Boolean value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusGreaterThan(Boolean value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusGreaterThanOrEqualTo(Boolean value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusLessThan(Boolean value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusLessThanOrEqualTo(Boolean value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusBetween(Boolean value1, Boolean value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - /** - * 状态(0:隐藏,1:展示) - */ - public Criteria andStatusNotBetween(Boolean value1, Boolean value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumIsNull() { - addCriterion("big_picture_num is null"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumIsNotNull() { - addCriterion("big_picture_num is not null"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumEqualTo(Integer value) { - addCriterion("big_picture_num =", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumNotEqualTo(Integer value) { - addCriterion("big_picture_num <>", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumGreaterThan(Integer value) { - addCriterion("big_picture_num >", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumGreaterThanOrEqualTo(Integer value) { - addCriterion("big_picture_num >=", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumLessThan(Integer value) { - addCriterion("big_picture_num <", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumLessThanOrEqualTo(Integer value) { - addCriterion("big_picture_num <=", value, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumIn(List values) { - addCriterion("big_picture_num in", values, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumNotIn(List values) { - addCriterion("big_picture_num not in", values, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumBetween(Integer value1, Integer value2) { - addCriterion("big_picture_num between", value1, value2, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 大图数量 - */ - public Criteria andBigPictureNumNotBetween(Integer value1, Integer value2) { - addCriterion("big_picture_num not between", value1, value2, "bigPictureNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumIsNull() { - addCriterion("list_num is null"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumIsNotNull() { - addCriterion("list_num is not null"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumEqualTo(Integer value) { - addCriterion("list_num =", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumNotEqualTo(Integer value) { - addCriterion("list_num <>", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumGreaterThan(Integer value) { - addCriterion("list_num >", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumGreaterThanOrEqualTo(Integer value) { - addCriterion("list_num >=", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumLessThan(Integer value) { - addCriterion("list_num <", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumLessThanOrEqualTo(Integer value) { - addCriterion("list_num <=", value, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumIn(List values) { - addCriterion("list_num in", values, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumNotIn(List values) { - addCriterion("list_num not in", values, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumBetween(Integer value1, Integer value2) { - addCriterion("list_num between", value1, value2, "listNum"); - return (Criteria) this; - } - - /** - * 列表数量 - */ - public Criteria andListNumNotBetween(Integer value1, Integer value2) { - addCriterion("list_num not between", value1, value2, "listNum"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeIsNull() { - addCriterion("show_type is null"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeIsNotNull() { - addCriterion("show_type is not null"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeEqualTo(Integer value) { - addCriterion("show_type =", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeNotEqualTo(Integer value) { - addCriterion("show_type <>", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeGreaterThan(Integer value) { - addCriterion("show_type >", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeGreaterThanOrEqualTo(Integer value) { - addCriterion("show_type >=", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeLessThan(Integer value) { - addCriterion("show_type <", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeLessThanOrEqualTo(Integer value) { - addCriterion("show_type <=", value, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeIn(List values) { - addCriterion("show_type in", values, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeNotIn(List values) { - addCriterion("show_type not in", values, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeBetween(Integer value1, Integer value2) { - addCriterion("show_type between", value1, value2, "showType"); - return (Criteria) this; - } - - /** - * 展示类型: 1-- 3+n | 2-- 2*n - */ - public Criteria andShowTypeNotBetween(Integer value1, Integer value2) { - addCriterion("show_type not between", value1, value2, "showType"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagIsNull() { - addCriterion("delete_flag is null"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagIsNotNull() { - addCriterion("delete_flag is not null"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagEqualTo(Boolean value) { - addCriterion("delete_flag =", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagNotEqualTo(Boolean value) { - addCriterion("delete_flag <>", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagGreaterThan(Boolean value) { - addCriterion("delete_flag >", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagGreaterThanOrEqualTo(Boolean value) { - addCriterion("delete_flag >=", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagLessThan(Boolean value) { - addCriterion("delete_flag <", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagLessThanOrEqualTo(Boolean value) { - addCriterion("delete_flag <=", value, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagIn(List values) { - addCriterion("delete_flag in", values, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagNotIn(List values) { - addCriterion("delete_flag not in", values, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagBetween(Boolean value1, Boolean value2) { - addCriterion("delete_flag between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - - /** - * 0:未删除,1:删除 - */ - public Criteria andDeleteFlagNotBetween(Boolean value1, Boolean value2) { - addCriterion("delete_flag not between", value1, value2, "deleteFlag"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - /** - * 创建时间 - */ - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - /** - * 更新时间 - */ - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseIsNull() { - addCriterion("module_use is null"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseIsNotNull() { - addCriterion("module_use is not null"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseEqualTo(Byte value) { - addCriterion("module_use =", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseNotEqualTo(Byte value) { - addCriterion("module_use <>", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseGreaterThan(Byte value) { - addCriterion("module_use >", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseGreaterThanOrEqualTo(Byte value) { - addCriterion("module_use >=", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseLessThan(Byte value) { - addCriterion("module_use <", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseLessThanOrEqualTo(Byte value) { - addCriterion("module_use <=", value, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseIn(List values) { - addCriterion("module_use in", values, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseNotIn(List values) { - addCriterion("module_use not in", values, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseBetween(Byte value1, Byte value2) { - addCriterion("module_use between", value1, value2, "moduleUse"); - return (Criteria) this; - } - - /** - * 模块用途(1用于推荐页,2用于游戏首页) - */ - public Criteria andModuleUseNotBetween(Byte value1, Byte value2) { - addCriterion("module_use not between", value1, value2, "moduleUse"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupy.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupy.java deleted file mode 100644 index 87115d8f5..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupy.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendOccupy { - private Long id; - - private Integer occupyNum; - - private Date startTime; - - private Date endTime; - - private String createdBy; - - private Date createTime; - - private Byte status; - - private Date updateTime; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Integer getOccupyNum() { - return occupyNum; - } - - public void setOccupyNum(Integer occupyNum) { - this.occupyNum = occupyNum; - } - - public Date getStartTime() { - return startTime; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy == null ? null : createdBy.trim(); - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupyExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupyExample.java deleted file mode 100644 index 8698312c8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendOccupyExample.java +++ /dev/null @@ -1,711 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendOccupyExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendOccupyExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andOccupyNumIsNull() { - addCriterion("occupy_num is null"); - return (Criteria) this; - } - - public Criteria andOccupyNumIsNotNull() { - addCriterion("occupy_num is not null"); - return (Criteria) this; - } - - public Criteria andOccupyNumEqualTo(Integer value) { - addCriterion("occupy_num =", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumNotEqualTo(Integer value) { - addCriterion("occupy_num <>", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumGreaterThan(Integer value) { - addCriterion("occupy_num >", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumGreaterThanOrEqualTo(Integer value) { - addCriterion("occupy_num >=", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumLessThan(Integer value) { - addCriterion("occupy_num <", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumLessThanOrEqualTo(Integer value) { - addCriterion("occupy_num <=", value, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumIn(List values) { - addCriterion("occupy_num in", values, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumNotIn(List values) { - addCriterion("occupy_num not in", values, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumBetween(Integer value1, Integer value2) { - addCriterion("occupy_num between", value1, value2, "occupyNum"); - return (Criteria) this; - } - - public Criteria andOccupyNumNotBetween(Integer value1, Integer value2) { - addCriterion("occupy_num not between", value1, value2, "occupyNum"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNull() { - addCriterion("start_time is null"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNotNull() { - addCriterion("start_time is not null"); - return (Criteria) this; - } - - public Criteria andStartTimeEqualTo(Date value) { - addCriterion("start_time =", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotEqualTo(Date value) { - addCriterion("start_time <>", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThan(Date value) { - addCriterion("start_time >", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { - addCriterion("start_time >=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThan(Date value) { - addCriterion("start_time <", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThanOrEqualTo(Date value) { - addCriterion("start_time <=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeIn(List values) { - addCriterion("start_time in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotIn(List values) { - addCriterion("start_time not in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeBetween(Date value1, Date value2) { - addCriterion("start_time between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotBetween(Date value1, Date value2) { - addCriterion("start_time not between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNull() { - addCriterion("end_time is null"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNotNull() { - addCriterion("end_time is not null"); - return (Criteria) this; - } - - public Criteria andEndTimeEqualTo(Date value) { - addCriterion("end_time =", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotEqualTo(Date value) { - addCriterion("end_time <>", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThan(Date value) { - addCriterion("end_time >", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("end_time >=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThan(Date value) { - addCriterion("end_time <", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThanOrEqualTo(Date value) { - addCriterion("end_time <=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIn(List values) { - addCriterion("end_time in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotIn(List values) { - addCriterion("end_time not in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeBetween(Date value1, Date value2) { - addCriterion("end_time between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotBetween(Date value1, Date value2) { - addCriterion("end_time not between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNull() { - addCriterion("created_by is null"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNotNull() { - addCriterion("created_by is not null"); - return (Criteria) this; - } - - public Criteria andCreatedByEqualTo(String value) { - addCriterion("created_by =", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotEqualTo(String value) { - addCriterion("created_by <>", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThan(String value) { - addCriterion("created_by >", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThanOrEqualTo(String value) { - addCriterion("created_by >=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThan(String value) { - addCriterion("created_by <", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThanOrEqualTo(String value) { - addCriterion("created_by <=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLike(String value) { - addCriterion("created_by like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotLike(String value) { - addCriterion("created_by not like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByIn(List values) { - addCriterion("created_by in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotIn(List values) { - addCriterion("created_by not in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByBetween(String value1, String value2) { - addCriterion("created_by between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotBetween(String value1, String value2) { - addCriterion("created_by not between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecord.java deleted file mode 100644 index a64dae895..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecord.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendRecord { - private Long id; - - private Long uid; - - private Integer seqNo; - - private String createdBy; - - private Date createTime; - - private Date startTime; - - private Date endTime; - - private Byte status; - - private Long cardId; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Integer getSeqNo() { - return seqNo; - } - - public void setSeqNo(Integer seqNo) { - this.seqNo = seqNo; - } - - public String getCreatedBy() { - return createdBy; - } - - public void setCreatedBy(String createdBy) { - this.createdBy = createdBy == null ? null : createdBy.trim(); - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getStartTime() { - return startTime; - } - - public void setStartTime(Date startTime) { - this.startTime = startTime; - } - - public Date getEndTime() { - return endTime; - } - - public void setEndTime(Date endTime) { - this.endTime = endTime; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public Long getCardId() { - return cardId; - } - - public void setCardId(Long cardId) { - this.cardId = cardId; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecordExample.java deleted file mode 100644 index 79fe88880..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRecordExample.java +++ /dev/null @@ -1,771 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andSeqNoIsNull() { - addCriterion("seq_no is null"); - return (Criteria) this; - } - - public Criteria andSeqNoIsNotNull() { - addCriterion("seq_no is not null"); - return (Criteria) this; - } - - public Criteria andSeqNoEqualTo(Integer value) { - addCriterion("seq_no =", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoNotEqualTo(Integer value) { - addCriterion("seq_no <>", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoGreaterThan(Integer value) { - addCriterion("seq_no >", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoGreaterThanOrEqualTo(Integer value) { - addCriterion("seq_no >=", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoLessThan(Integer value) { - addCriterion("seq_no <", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoLessThanOrEqualTo(Integer value) { - addCriterion("seq_no <=", value, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoIn(List values) { - addCriterion("seq_no in", values, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoNotIn(List values) { - addCriterion("seq_no not in", values, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoBetween(Integer value1, Integer value2) { - addCriterion("seq_no between", value1, value2, "seqNo"); - return (Criteria) this; - } - - public Criteria andSeqNoNotBetween(Integer value1, Integer value2) { - addCriterion("seq_no not between", value1, value2, "seqNo"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNull() { - addCriterion("created_by is null"); - return (Criteria) this; - } - - public Criteria andCreatedByIsNotNull() { - addCriterion("created_by is not null"); - return (Criteria) this; - } - - public Criteria andCreatedByEqualTo(String value) { - addCriterion("created_by =", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotEqualTo(String value) { - addCriterion("created_by <>", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThan(String value) { - addCriterion("created_by >", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByGreaterThanOrEqualTo(String value) { - addCriterion("created_by >=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThan(String value) { - addCriterion("created_by <", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLessThanOrEqualTo(String value) { - addCriterion("created_by <=", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByLike(String value) { - addCriterion("created_by like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotLike(String value) { - addCriterion("created_by not like", value, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByIn(List values) { - addCriterion("created_by in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotIn(List values) { - addCriterion("created_by not in", values, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByBetween(String value1, String value2) { - addCriterion("created_by between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreatedByNotBetween(String value1, String value2) { - addCriterion("created_by not between", value1, value2, "createdBy"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNull() { - addCriterion("start_time is null"); - return (Criteria) this; - } - - public Criteria andStartTimeIsNotNull() { - addCriterion("start_time is not null"); - return (Criteria) this; - } - - public Criteria andStartTimeEqualTo(Date value) { - addCriterion("start_time =", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotEqualTo(Date value) { - addCriterion("start_time <>", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThan(Date value) { - addCriterion("start_time >", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { - addCriterion("start_time >=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThan(Date value) { - addCriterion("start_time <", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeLessThanOrEqualTo(Date value) { - addCriterion("start_time <=", value, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeIn(List values) { - addCriterion("start_time in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotIn(List values) { - addCriterion("start_time not in", values, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeBetween(Date value1, Date value2) { - addCriterion("start_time between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andStartTimeNotBetween(Date value1, Date value2) { - addCriterion("start_time not between", value1, value2, "startTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNull() { - addCriterion("end_time is null"); - return (Criteria) this; - } - - public Criteria andEndTimeIsNotNull() { - addCriterion("end_time is not null"); - return (Criteria) this; - } - - public Criteria andEndTimeEqualTo(Date value) { - addCriterion("end_time =", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotEqualTo(Date value) { - addCriterion("end_time <>", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThan(Date value) { - addCriterion("end_time >", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { - addCriterion("end_time >=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThan(Date value) { - addCriterion("end_time <", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeLessThanOrEqualTo(Date value) { - addCriterion("end_time <=", value, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeIn(List values) { - addCriterion("end_time in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotIn(List values) { - addCriterion("end_time not in", values, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeBetween(Date value1, Date value2) { - addCriterion("end_time between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andEndTimeNotBetween(Date value1, Date value2) { - addCriterion("end_time not between", value1, value2, "endTime"); - return (Criteria) this; - } - - public Criteria andStatusIsNull() { - addCriterion("status is null"); - return (Criteria) this; - } - - public Criteria andStatusIsNotNull() { - addCriterion("status is not null"); - return (Criteria) this; - } - - public Criteria andStatusEqualTo(Byte value) { - addCriterion("status =", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotEqualTo(Byte value) { - addCriterion("status <>", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThan(Byte value) { - addCriterion("status >", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("status >=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThan(Byte value) { - addCriterion("status <", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusLessThanOrEqualTo(Byte value) { - addCriterion("status <=", value, "status"); - return (Criteria) this; - } - - public Criteria andStatusIn(List values) { - addCriterion("status in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotIn(List values) { - addCriterion("status not in", values, "status"); - return (Criteria) this; - } - - public Criteria andStatusBetween(Byte value1, Byte value2) { - addCriterion("status between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andStatusNotBetween(Byte value1, Byte value2) { - addCriterion("status not between", value1, value2, "status"); - return (Criteria) this; - } - - public Criteria andCardIdIsNull() { - addCriterion("card_id is null"); - return (Criteria) this; - } - - public Criteria andCardIdIsNotNull() { - addCriterion("card_id is not null"); - return (Criteria) this; - } - - public Criteria andCardIdEqualTo(Long value) { - addCriterion("card_id =", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdNotEqualTo(Long value) { - addCriterion("card_id <>", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdGreaterThan(Long value) { - addCriterion("card_id >", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdGreaterThanOrEqualTo(Long value) { - addCriterion("card_id >=", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdLessThan(Long value) { - addCriterion("card_id <", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdLessThanOrEqualTo(Long value) { - addCriterion("card_id <=", value, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdIn(List values) { - addCriterion("card_id in", values, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdNotIn(List values) { - addCriterion("card_id not in", values, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdBetween(Long value1, Long value2) { - addCriterion("card_id between", value1, value2, "cardId"); - return (Criteria) this; - } - - public Criteria andCardIdNotBetween(Long value1, Long value2) { - addCriterion("card_id not between", value1, value2, "cardId"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoom.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoom.java deleted file mode 100644 index 9f1efc5be..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoom.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendRoom { - private Long id; - - private Long roomUid; - - private Byte roomType; - - private Integer seq; - - private Integer weight; - - private Byte recommendStatus; - - private Date createTime; - - private Date updateTime; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getRoomUid() { - return roomUid; - } - - public void setRoomUid(Long roomUid) { - this.roomUid = roomUid; - } - - public Byte getRoomType() { - return roomType; - } - - public void setRoomType(Byte roomType) { - this.roomType = roomType; - } - - public Integer getSeq() { - return seq; - } - - public void setSeq(Integer seq) { - this.seq = seq; - } - - public Integer getWeight() { - return weight; - } - - public void setWeight(Integer weight) { - this.weight = weight; - } - - public Byte getRecommendStatus() { - return recommendStatus; - } - - public void setRecommendStatus(Byte recommendStatus) { - this.recommendStatus = recommendStatus; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomExample.java deleted file mode 100644 index 5ffde5625..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomExample.java +++ /dev/null @@ -1,701 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendRoomExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendRoomExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNull() { - addCriterion("room_uid is null"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNotNull() { - addCriterion("room_uid is not null"); - return (Criteria) this; - } - - public Criteria andRoomUidEqualTo(Long value) { - addCriterion("room_uid =", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotEqualTo(Long value) { - addCriterion("room_uid <>", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThan(Long value) { - addCriterion("room_uid >", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThanOrEqualTo(Long value) { - addCriterion("room_uid >=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThan(Long value) { - addCriterion("room_uid <", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThanOrEqualTo(Long value) { - addCriterion("room_uid <=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidIn(List values) { - addCriterion("room_uid in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotIn(List values) { - addCriterion("room_uid not in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidBetween(Long value1, Long value2) { - addCriterion("room_uid between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotBetween(Long value1, Long value2) { - addCriterion("room_uid not between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomTypeIsNull() { - addCriterion("room_type is null"); - return (Criteria) this; - } - - public Criteria andRoomTypeIsNotNull() { - addCriterion("room_type is not null"); - return (Criteria) this; - } - - public Criteria andRoomTypeEqualTo(Byte value) { - addCriterion("room_type =", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeNotEqualTo(Byte value) { - addCriterion("room_type <>", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeGreaterThan(Byte value) { - addCriterion("room_type >", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("room_type >=", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeLessThan(Byte value) { - addCriterion("room_type <", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeLessThanOrEqualTo(Byte value) { - addCriterion("room_type <=", value, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeIn(List values) { - addCriterion("room_type in", values, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeNotIn(List values) { - addCriterion("room_type not in", values, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeBetween(Byte value1, Byte value2) { - addCriterion("room_type between", value1, value2, "roomType"); - return (Criteria) this; - } - - public Criteria andRoomTypeNotBetween(Byte value1, Byte value2) { - addCriterion("room_type not between", value1, value2, "roomType"); - return (Criteria) this; - } - - public Criteria andSeqIsNull() { - addCriterion("seq is null"); - return (Criteria) this; - } - - public Criteria andSeqIsNotNull() { - addCriterion("seq is not null"); - return (Criteria) this; - } - - public Criteria andSeqEqualTo(Integer value) { - addCriterion("seq =", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqNotEqualTo(Integer value) { - addCriterion("seq <>", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqGreaterThan(Integer value) { - addCriterion("seq >", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqGreaterThanOrEqualTo(Integer value) { - addCriterion("seq >=", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqLessThan(Integer value) { - addCriterion("seq <", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqLessThanOrEqualTo(Integer value) { - addCriterion("seq <=", value, "seq"); - return (Criteria) this; - } - - public Criteria andSeqIn(List values) { - addCriterion("seq in", values, "seq"); - return (Criteria) this; - } - - public Criteria andSeqNotIn(List values) { - addCriterion("seq not in", values, "seq"); - return (Criteria) this; - } - - public Criteria andSeqBetween(Integer value1, Integer value2) { - addCriterion("seq between", value1, value2, "seq"); - return (Criteria) this; - } - - public Criteria andSeqNotBetween(Integer value1, Integer value2) { - addCriterion("seq not between", value1, value2, "seq"); - return (Criteria) this; - } - - public Criteria andWeightIsNull() { - addCriterion("weight is null"); - return (Criteria) this; - } - - public Criteria andWeightIsNotNull() { - addCriterion("weight is not null"); - return (Criteria) this; - } - - public Criteria andWeightEqualTo(Integer value) { - addCriterion("weight =", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightNotEqualTo(Integer value) { - addCriterion("weight <>", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightGreaterThan(Integer value) { - addCriterion("weight >", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightGreaterThanOrEqualTo(Integer value) { - addCriterion("weight >=", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightLessThan(Integer value) { - addCriterion("weight <", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightLessThanOrEqualTo(Integer value) { - addCriterion("weight <=", value, "weight"); - return (Criteria) this; - } - - public Criteria andWeightIn(List values) { - addCriterion("weight in", values, "weight"); - return (Criteria) this; - } - - public Criteria andWeightNotIn(List values) { - addCriterion("weight not in", values, "weight"); - return (Criteria) this; - } - - public Criteria andWeightBetween(Integer value1, Integer value2) { - addCriterion("weight between", value1, value2, "weight"); - return (Criteria) this; - } - - public Criteria andWeightNotBetween(Integer value1, Integer value2) { - addCriterion("weight not between", value1, value2, "weight"); - return (Criteria) this; - } - - public Criteria andRecommendStatusIsNull() { - addCriterion("recommend_status is null"); - return (Criteria) this; - } - - public Criteria andRecommendStatusIsNotNull() { - addCriterion("recommend_status is not null"); - return (Criteria) this; - } - - public Criteria andRecommendStatusEqualTo(Byte value) { - addCriterion("recommend_status =", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusNotEqualTo(Byte value) { - addCriterion("recommend_status <>", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusGreaterThan(Byte value) { - addCriterion("recommend_status >", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusGreaterThanOrEqualTo(Byte value) { - addCriterion("recommend_status >=", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusLessThan(Byte value) { - addCriterion("recommend_status <", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusLessThanOrEqualTo(Byte value) { - addCriterion("recommend_status <=", value, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusIn(List values) { - addCriterion("recommend_status in", values, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusNotIn(List values) { - addCriterion("recommend_status not in", values, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusBetween(Byte value1, Byte value2) { - addCriterion("recommend_status between", value1, value2, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andRecommendStatusNotBetween(Byte value1, Byte value2) { - addCriterion("recommend_status not between", value1, value2, "recommendStatus"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecord.java deleted file mode 100644 index c599bd028..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecord.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class RecommendRoomRecord { - private Long id; - - private Long uid; - - private Long roomUid; - - private Date createTime; - - private Date updateTime; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getRoomUid() { - return roomUid; - } - - public void setRoomUid(Long roomUid) { - this.roomUid = roomUid; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecordExample.java deleted file mode 100644 index 1aeb4d357..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/RecommendRoomRecordExample.java +++ /dev/null @@ -1,521 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RecommendRoomRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public RecommendRoomRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNull() { - addCriterion("room_uid is null"); - return (Criteria) this; - } - - public Criteria andRoomUidIsNotNull() { - addCriterion("room_uid is not null"); - return (Criteria) this; - } - - public Criteria andRoomUidEqualTo(Long value) { - addCriterion("room_uid =", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotEqualTo(Long value) { - addCriterion("room_uid <>", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThan(Long value) { - addCriterion("room_uid >", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidGreaterThanOrEqualTo(Long value) { - addCriterion("room_uid >=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThan(Long value) { - addCriterion("room_uid <", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidLessThanOrEqualTo(Long value) { - addCriterion("room_uid <=", value, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidIn(List values) { - addCriterion("room_uid in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotIn(List values) { - addCriterion("room_uid not in", values, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidBetween(Long value1, Long value2) { - addCriterion("room_uid between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andRoomUidNotBetween(Long value1, Long value2) { - addCriterion("room_uid not between", value1, value2, "roomUid"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDoll.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDoll.java deleted file mode 100644 index cfc405fb8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDoll.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.accompany.business.model; - -import com.accompany.common.annotation.ReplaceAppDomain; - -import java.util.Date; - -public class UserDoll { - private Long uid; - - private Byte sex; - - @ReplaceAppDomain - private String avatar; - - private String nick; - - @ReplaceAppDomain - private String voice; - - private Integer bed; - - private Integer likeCount; - - private Long inviteUid; - - private Date createTime; - - private Date updateTime; - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Byte getSex() { - return sex; - } - - public void setSex(Byte sex) { - this.sex = sex; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar == null ? null : avatar.trim(); - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick == null ? null : nick.trim(); - } - - public String getVoice() { - return voice; - } - - public void setVoice(String voice) { - this.voice = voice == null ? null : voice.trim(); - } - - public Integer getBed() { - return bed; - } - - public void setBed(Integer bed) { - this.bed = bed; - } - - public Integer getLikeCount() { - return likeCount; - } - - public void setLikeCount(Integer likeCount) { - this.likeCount = likeCount; - } - - public Long getInviteUid() { - return inviteUid; - } - - public void setInviteUid(Long inviteUid) { - this.inviteUid = inviteUid; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollExample.java deleted file mode 100644 index ea6a55f33..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollExample.java +++ /dev/null @@ -1,851 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class UserDollExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public UserDollExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andSexIsNull() { - addCriterion("sex is null"); - return (Criteria) this; - } - - public Criteria andSexIsNotNull() { - addCriterion("sex is not null"); - return (Criteria) this; - } - - public Criteria andSexEqualTo(Byte value) { - addCriterion("sex =", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexNotEqualTo(Byte value) { - addCriterion("sex <>", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexGreaterThan(Byte value) { - addCriterion("sex >", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexGreaterThanOrEqualTo(Byte value) { - addCriterion("sex >=", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexLessThan(Byte value) { - addCriterion("sex <", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexLessThanOrEqualTo(Byte value) { - addCriterion("sex <=", value, "sex"); - return (Criteria) this; - } - - public Criteria andSexIn(List values) { - addCriterion("sex in", values, "sex"); - return (Criteria) this; - } - - public Criteria andSexNotIn(List values) { - addCriterion("sex not in", values, "sex"); - return (Criteria) this; - } - - public Criteria andSexBetween(Byte value1, Byte value2) { - addCriterion("sex between", value1, value2, "sex"); - return (Criteria) this; - } - - public Criteria andSexNotBetween(Byte value1, Byte value2) { - addCriterion("sex not between", value1, value2, "sex"); - return (Criteria) this; - } - - public Criteria andAvatarIsNull() { - addCriterion("avatar is null"); - return (Criteria) this; - } - - public Criteria andAvatarIsNotNull() { - addCriterion("avatar is not null"); - return (Criteria) this; - } - - public Criteria andAvatarEqualTo(String value) { - addCriterion("avatar =", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotEqualTo(String value) { - addCriterion("avatar <>", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarGreaterThan(String value) { - addCriterion("avatar >", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarGreaterThanOrEqualTo(String value) { - addCriterion("avatar >=", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLessThan(String value) { - addCriterion("avatar <", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLessThanOrEqualTo(String value) { - addCriterion("avatar <=", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarLike(String value) { - addCriterion("avatar like", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotLike(String value) { - addCriterion("avatar not like", value, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarIn(List values) { - addCriterion("avatar in", values, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotIn(List values) { - addCriterion("avatar not in", values, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarBetween(String value1, String value2) { - addCriterion("avatar between", value1, value2, "avatar"); - return (Criteria) this; - } - - public Criteria andAvatarNotBetween(String value1, String value2) { - addCriterion("avatar not between", value1, value2, "avatar"); - return (Criteria) this; - } - - public Criteria andNickIsNull() { - addCriterion("nick is null"); - return (Criteria) this; - } - - public Criteria andNickIsNotNull() { - addCriterion("nick is not null"); - return (Criteria) this; - } - - public Criteria andNickEqualTo(String value) { - addCriterion("nick =", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotEqualTo(String value) { - addCriterion("nick <>", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThan(String value) { - addCriterion("nick >", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickGreaterThanOrEqualTo(String value) { - addCriterion("nick >=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThan(String value) { - addCriterion("nick <", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLessThanOrEqualTo(String value) { - addCriterion("nick <=", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickLike(String value) { - addCriterion("nick like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotLike(String value) { - addCriterion("nick not like", value, "nick"); - return (Criteria) this; - } - - public Criteria andNickIn(List values) { - addCriterion("nick in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotIn(List values) { - addCriterion("nick not in", values, "nick"); - return (Criteria) this; - } - - public Criteria andNickBetween(String value1, String value2) { - addCriterion("nick between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andNickNotBetween(String value1, String value2) { - addCriterion("nick not between", value1, value2, "nick"); - return (Criteria) this; - } - - public Criteria andVoiceIsNull() { - addCriterion("voice is null"); - return (Criteria) this; - } - - public Criteria andVoiceIsNotNull() { - addCriterion("voice is not null"); - return (Criteria) this; - } - - public Criteria andVoiceEqualTo(String value) { - addCriterion("voice =", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceNotEqualTo(String value) { - addCriterion("voice <>", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceGreaterThan(String value) { - addCriterion("voice >", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceGreaterThanOrEqualTo(String value) { - addCriterion("voice >=", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceLessThan(String value) { - addCriterion("voice <", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceLessThanOrEqualTo(String value) { - addCriterion("voice <=", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceLike(String value) { - addCriterion("voice like", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceNotLike(String value) { - addCriterion("voice not like", value, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceIn(List values) { - addCriterion("voice in", values, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceNotIn(List values) { - addCriterion("voice not in", values, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceBetween(String value1, String value2) { - addCriterion("voice between", value1, value2, "voice"); - return (Criteria) this; - } - - public Criteria andVoiceNotBetween(String value1, String value2) { - addCriterion("voice not between", value1, value2, "voice"); - return (Criteria) this; - } - - public Criteria andBedIsNull() { - addCriterion("bed is null"); - return (Criteria) this; - } - - public Criteria andBedIsNotNull() { - addCriterion("bed is not null"); - return (Criteria) this; - } - - public Criteria andBedEqualTo(Integer value) { - addCriterion("bed =", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedNotEqualTo(Integer value) { - addCriterion("bed <>", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedGreaterThan(Integer value) { - addCriterion("bed >", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedGreaterThanOrEqualTo(Integer value) { - addCriterion("bed >=", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedLessThan(Integer value) { - addCriterion("bed <", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedLessThanOrEqualTo(Integer value) { - addCriterion("bed <=", value, "bed"); - return (Criteria) this; - } - - public Criteria andBedIn(List values) { - addCriterion("bed in", values, "bed"); - return (Criteria) this; - } - - public Criteria andBedNotIn(List values) { - addCriterion("bed not in", values, "bed"); - return (Criteria) this; - } - - public Criteria andBedBetween(Integer value1, Integer value2) { - addCriterion("bed between", value1, value2, "bed"); - return (Criteria) this; - } - - public Criteria andBedNotBetween(Integer value1, Integer value2) { - addCriterion("bed not between", value1, value2, "bed"); - return (Criteria) this; - } - - public Criteria andLikeCountIsNull() { - addCriterion("like_count is null"); - return (Criteria) this; - } - - public Criteria andLikeCountIsNotNull() { - addCriterion("like_count is not null"); - return (Criteria) this; - } - - public Criteria andLikeCountEqualTo(Integer value) { - addCriterion("like_count =", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountNotEqualTo(Integer value) { - addCriterion("like_count <>", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountGreaterThan(Integer value) { - addCriterion("like_count >", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountGreaterThanOrEqualTo(Integer value) { - addCriterion("like_count >=", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountLessThan(Integer value) { - addCriterion("like_count <", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountLessThanOrEqualTo(Integer value) { - addCriterion("like_count <=", value, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountIn(List values) { - addCriterion("like_count in", values, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountNotIn(List values) { - addCriterion("like_count not in", values, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountBetween(Integer value1, Integer value2) { - addCriterion("like_count between", value1, value2, "likeCount"); - return (Criteria) this; - } - - public Criteria andLikeCountNotBetween(Integer value1, Integer value2) { - addCriterion("like_count not between", value1, value2, "likeCount"); - return (Criteria) this; - } - - public Criteria andInviteUidIsNull() { - addCriterion("invite_uid is null"); - return (Criteria) this; - } - - public Criteria andInviteUidIsNotNull() { - addCriterion("invite_uid is not null"); - return (Criteria) this; - } - - public Criteria andInviteUidEqualTo(Long value) { - addCriterion("invite_uid =", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidNotEqualTo(Long value) { - addCriterion("invite_uid <>", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidGreaterThan(Long value) { - addCriterion("invite_uid >", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidGreaterThanOrEqualTo(Long value) { - addCriterion("invite_uid >=", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidLessThan(Long value) { - addCriterion("invite_uid <", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidLessThanOrEqualTo(Long value) { - addCriterion("invite_uid <=", value, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidIn(List values) { - addCriterion("invite_uid in", values, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidNotIn(List values) { - addCriterion("invite_uid not in", values, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidBetween(Long value1, Long value2) { - addCriterion("invite_uid between", value1, value2, "inviteUid"); - return (Criteria) this; - } - - public Criteria andInviteUidNotBetween(Long value1, Long value2) { - addCriterion("invite_uid not between", value1, value2, "inviteUid"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Date value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Date value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Date value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Date value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Date value1, Date value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecord.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecord.java deleted file mode 100644 index 468d84f1b..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecord.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.accompany.business.model; - -import java.util.Date; - -public class UserDollRecord { - private Long recordId; - - private Long uid; - - private Long targetUid; - - private Byte optType; - - private Byte dealType; - - private Byte linkType; - - private Byte sexType; - - private Date createTime; - - public Long getRecordId() { - return recordId; - } - - public void setRecordId(Long recordId) { - this.recordId = recordId; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Long getTargetUid() { - return targetUid; - } - - public void setTargetUid(Long targetUid) { - this.targetUid = targetUid; - } - - public Byte getOptType() { - return optType; - } - - public void setOptType(Byte optType) { - this.optType = optType; - } - - public Byte getDealType() { - return dealType; - } - - public void setDealType(Byte dealType) { - this.dealType = dealType; - } - - public Byte getLinkType() { - return linkType; - } - - public void setLinkType(Byte linkType) { - this.linkType = linkType; - } - - public Byte getSexType() { - return sexType; - } - - public void setSexType(Byte sexType) { - this.sexType = sexType; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecordExample.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecordExample.java deleted file mode 100644 index 806a1431e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/UserDollRecordExample.java +++ /dev/null @@ -1,701 +0,0 @@ -package com.accompany.business.model; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class UserDollRecordExample { - protected String orderByClause; - - protected boolean distinct; - - protected List oredCriteria; - - private Integer limit; - - private Integer offset; - - public UserDollRecordExample() { - oredCriteria = new ArrayList(); - } - - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - public String getOrderByClause() { - return orderByClause; - } - - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - public boolean isDistinct() { - return distinct; - } - - public List getOredCriteria() { - return oredCriteria; - } - - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public Integer getLimit() { - return limit; - } - - public void setOffset(Integer offset) { - this.offset = offset; - } - - public Integer getOffset() { - return offset; - } - - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andRecordIdIsNull() { - addCriterion("record_id is null"); - return (Criteria) this; - } - - public Criteria andRecordIdIsNotNull() { - addCriterion("record_id is not null"); - return (Criteria) this; - } - - public Criteria andRecordIdEqualTo(Long value) { - addCriterion("record_id =", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotEqualTo(Long value) { - addCriterion("record_id <>", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThan(Long value) { - addCriterion("record_id >", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdGreaterThanOrEqualTo(Long value) { - addCriterion("record_id >=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThan(Long value) { - addCriterion("record_id <", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdLessThanOrEqualTo(Long value) { - addCriterion("record_id <=", value, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdIn(List values) { - addCriterion("record_id in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotIn(List values) { - addCriterion("record_id not in", values, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdBetween(Long value1, Long value2) { - addCriterion("record_id between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andRecordIdNotBetween(Long value1, Long value2) { - addCriterion("record_id not between", value1, value2, "recordId"); - return (Criteria) this; - } - - public Criteria andUidIsNull() { - addCriterion("uid is null"); - return (Criteria) this; - } - - public Criteria andUidIsNotNull() { - addCriterion("uid is not null"); - return (Criteria) this; - } - - public Criteria andUidEqualTo(Long value) { - addCriterion("uid =", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotEqualTo(Long value) { - addCriterion("uid <>", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThan(Long value) { - addCriterion("uid >", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidGreaterThanOrEqualTo(Long value) { - addCriterion("uid >=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThan(Long value) { - addCriterion("uid <", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidLessThanOrEqualTo(Long value) { - addCriterion("uid <=", value, "uid"); - return (Criteria) this; - } - - public Criteria andUidIn(List values) { - addCriterion("uid in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotIn(List values) { - addCriterion("uid not in", values, "uid"); - return (Criteria) this; - } - - public Criteria andUidBetween(Long value1, Long value2) { - addCriterion("uid between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andUidNotBetween(Long value1, Long value2) { - addCriterion("uid not between", value1, value2, "uid"); - return (Criteria) this; - } - - public Criteria andTargetUidIsNull() { - addCriterion("target_uid is null"); - return (Criteria) this; - } - - public Criteria andTargetUidIsNotNull() { - addCriterion("target_uid is not null"); - return (Criteria) this; - } - - public Criteria andTargetUidEqualTo(Long value) { - addCriterion("target_uid =", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidNotEqualTo(Long value) { - addCriterion("target_uid <>", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidGreaterThan(Long value) { - addCriterion("target_uid >", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidGreaterThanOrEqualTo(Long value) { - addCriterion("target_uid >=", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidLessThan(Long value) { - addCriterion("target_uid <", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidLessThanOrEqualTo(Long value) { - addCriterion("target_uid <=", value, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidIn(List values) { - addCriterion("target_uid in", values, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidNotIn(List values) { - addCriterion("target_uid not in", values, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidBetween(Long value1, Long value2) { - addCriterion("target_uid between", value1, value2, "targetUid"); - return (Criteria) this; - } - - public Criteria andTargetUidNotBetween(Long value1, Long value2) { - addCriterion("target_uid not between", value1, value2, "targetUid"); - return (Criteria) this; - } - - public Criteria andOptTypeIsNull() { - addCriterion("opt_type is null"); - return (Criteria) this; - } - - public Criteria andOptTypeIsNotNull() { - addCriterion("opt_type is not null"); - return (Criteria) this; - } - - public Criteria andOptTypeEqualTo(Byte value) { - addCriterion("opt_type =", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeNotEqualTo(Byte value) { - addCriterion("opt_type <>", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeGreaterThan(Byte value) { - addCriterion("opt_type >", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("opt_type >=", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeLessThan(Byte value) { - addCriterion("opt_type <", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeLessThanOrEqualTo(Byte value) { - addCriterion("opt_type <=", value, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeIn(List values) { - addCriterion("opt_type in", values, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeNotIn(List values) { - addCriterion("opt_type not in", values, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeBetween(Byte value1, Byte value2) { - addCriterion("opt_type between", value1, value2, "optType"); - return (Criteria) this; - } - - public Criteria andOptTypeNotBetween(Byte value1, Byte value2) { - addCriterion("opt_type not between", value1, value2, "optType"); - return (Criteria) this; - } - - public Criteria andDealTypeIsNull() { - addCriterion("deal_type is null"); - return (Criteria) this; - } - - public Criteria andDealTypeIsNotNull() { - addCriterion("deal_type is not null"); - return (Criteria) this; - } - - public Criteria andDealTypeEqualTo(Byte value) { - addCriterion("deal_type =", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeNotEqualTo(Byte value) { - addCriterion("deal_type <>", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeGreaterThan(Byte value) { - addCriterion("deal_type >", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("deal_type >=", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeLessThan(Byte value) { - addCriterion("deal_type <", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeLessThanOrEqualTo(Byte value) { - addCriterion("deal_type <=", value, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeIn(List values) { - addCriterion("deal_type in", values, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeNotIn(List values) { - addCriterion("deal_type not in", values, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeBetween(Byte value1, Byte value2) { - addCriterion("deal_type between", value1, value2, "dealType"); - return (Criteria) this; - } - - public Criteria andDealTypeNotBetween(Byte value1, Byte value2) { - addCriterion("deal_type not between", value1, value2, "dealType"); - return (Criteria) this; - } - - public Criteria andLinkTypeIsNull() { - addCriterion("link_type is null"); - return (Criteria) this; - } - - public Criteria andLinkTypeIsNotNull() { - addCriterion("link_type is not null"); - return (Criteria) this; - } - - public Criteria andLinkTypeEqualTo(Byte value) { - addCriterion("link_type =", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeNotEqualTo(Byte value) { - addCriterion("link_type <>", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeGreaterThan(Byte value) { - addCriterion("link_type >", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("link_type >=", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeLessThan(Byte value) { - addCriterion("link_type <", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeLessThanOrEqualTo(Byte value) { - addCriterion("link_type <=", value, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeIn(List values) { - addCriterion("link_type in", values, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeNotIn(List values) { - addCriterion("link_type not in", values, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeBetween(Byte value1, Byte value2) { - addCriterion("link_type between", value1, value2, "linkType"); - return (Criteria) this; - } - - public Criteria andLinkTypeNotBetween(Byte value1, Byte value2) { - addCriterion("link_type not between", value1, value2, "linkType"); - return (Criteria) this; - } - - public Criteria andSexTypeIsNull() { - addCriterion("sex_type is null"); - return (Criteria) this; - } - - public Criteria andSexTypeIsNotNull() { - addCriterion("sex_type is not null"); - return (Criteria) this; - } - - public Criteria andSexTypeEqualTo(Byte value) { - addCriterion("sex_type =", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeNotEqualTo(Byte value) { - addCriterion("sex_type <>", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeGreaterThan(Byte value) { - addCriterion("sex_type >", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeGreaterThanOrEqualTo(Byte value) { - addCriterion("sex_type >=", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeLessThan(Byte value) { - addCriterion("sex_type <", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeLessThanOrEqualTo(Byte value) { - addCriterion("sex_type <=", value, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeIn(List values) { - addCriterion("sex_type in", values, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeNotIn(List values) { - addCriterion("sex_type not in", values, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeBetween(Byte value1, Byte value2) { - addCriterion("sex_type between", value1, value2, "sexType"); - return (Criteria) this; - } - - public Criteria andSexTypeNotBetween(Byte value1, Byte value2) { - addCriterion("sex_type not between", value1, value2, "sexType"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNull() { - addCriterion("create_time is null"); - return (Criteria) this; - } - - public Criteria andCreateTimeIsNotNull() { - addCriterion("create_time is not null"); - return (Criteria) this; - } - - public Criteria andCreateTimeEqualTo(Date value) { - addCriterion("create_time =", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotEqualTo(Date value) { - addCriterion("create_time <>", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThan(Date value) { - addCriterion("create_time >", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { - addCriterion("create_time >=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThan(Date value) { - addCriterion("create_time <", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeLessThanOrEqualTo(Date value) { - addCriterion("create_time <=", value, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeIn(List values) { - addCriterion("create_time in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotIn(List values) { - addCriterion("create_time not in", values, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeBetween(Date value1, Date value2) { - addCriterion("create_time between", value1, value2, "createTime"); - return (Criteria) this; - } - - public Criteria andCreateTimeNotBetween(Date value1, Date value2) { - addCriterion("create_time not between", value1, value2, "createTime"); - return (Criteria) this; - } - } - - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCouple.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCouple.java deleted file mode 100644 index 402ab22f7..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCouple.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.accompany.business.model.user; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * 用户CP表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -@TableName("user_couple") -public class UserCouple implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - /** - * 邀请方uid - */ - private Long inviteUid; - /** - * 被邀请方uid - */ - private Long acceptUid; - /** - * cp道具id - */ - private Integer propsId; - /** - * 关系状态:1-邀请中,2-CP中,3-拒绝,4-解绑中,5-解绑完成, 6-过期 - */ - private Byte state; - /** - * 关系誓言 - */ - private String declaration; - /** - * CP等级 - */ - private Integer levelSeq; - /** - * 解绑发起人uid:解绑过程中标识 - */ - private Long unboundUid; - /** - * 组CP时间 - */ - private Date acceptTime; - /** - * 解绑发起时间 - */ - private Date unboundTime; - /** - * - */ - private Date createTime; - /** - * - */ - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleLevel.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleLevel.java deleted file mode 100644 index 30fed1edc..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleLevel.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.accompany.business.model.user; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * 用户CP等级经验表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -@TableName("user_couple_level") -public class UserCoupleLevel implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - /** - * 等级序号 - */ - private Integer levelSeq; - /** - * 等级名称 - */ - private String levelName; - /** - * 最小经验值 - */ - private Long amount; - /** - * 升到此等级时对应的cp消息文案 - */ - private String upLevelMsg; - /** - * 0-不跳转;1-app内跳转;2-h5跳转 - */ - private Byte upLevelSkipType; - /** - * 对应跳转地址 - */ - private String upLevelSkipUrl; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleTask.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleTask.java deleted file mode 100644 index 76221bf2e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserCoupleTask.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.accompany.business.model.user; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * CP用户任务表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-11 18:25:06 - */ -@Data -@TableName("user_couple_task") -public class UserCoupleTask implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * - */ - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - /** - * 任务周期类型:1-日任务,2-累计任务 - */ - private Byte cycleType; - /** - * 任务类型:1-私聊,2-同一房间时长,3-送礼,4-陪伴 - */ - private Byte taskType; - /** - * 任务要求 - */ - private Integer need; - /** - * 任务奖励 - */ - private Integer awardVal; - /** - * 任务描述 - */ - private String taskDesc; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationPrivilege.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationPrivilege.java deleted file mode 100644 index f518c6d94..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationPrivilege.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.accompany.business.model.user; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -@TableName("user_relation_privilege") -public class UserRelationPrivilege implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * - */ - @TableId(value = "id", type = IdType.AUTO) - private Long id; - /** - * 等级序号 - */ - private Integer levelSeq; - /** - * 适用关系:1-CP - */ - private Byte relationType; - /** - * 特权类型:1-铭牌,2-头饰,3-CP位 - */ - private Byte type; - /** - * 性别:1-男-2-女0-不作区分 - */ - private Byte gender; - /** - * 特权物品:对应铭牌头饰id或CP为图片URL - */ - private String privilegeProp; - /** - * 特权物品描述 - */ - private String privilegeDesc; - /** - * 1-有效,0-无效 - */ - private Byte status; - /** - * - */ - private Date createTime; - /** - * - */ - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationProps.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationProps.java deleted file mode 100644 index 88bb7a6c3..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/model/user/UserRelationProps.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.accompany.business.model.user; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; - -import java.math.BigDecimal; -import java.io.Serializable; -import java.util.Date; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -/** - * 用户关系道具表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Data -@ApiModel -@TableName("user_relation_props") -public class UserRelationProps implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * - */ - @ApiModelProperty(value = "道具id") - @TableId(value = "id", type = IdType.AUTO) - private Integer id; - /** - * 道具名称 - */ - @ApiModelProperty(value = "道具名称") - private String name; - /** - * 价格 - */ - @ApiModelProperty(value = "道具价格") - private BigDecimal price; - /** - * 图片 - */ - @ApiModelProperty(value = "道具图片") - private String img; - /** - * 适用关系:1-cp - */ - private Byte type; - /** - * 状态:0-删除,1-启用,2-停用 - */ - private Byte status; - /** - * - */ - private Date createTime; - /** - * - */ - private Date updateTime; - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollCatchedVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollCatchedVo.java deleted file mode 100644 index c3872aad8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollCatchedVo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.business.model.UserDoll; - -public class DollCatchedVo { - private Long recordId; - - private UserDoll catchUserDoll; - - private Integer catchTimes; - - public Long getRecordId() { - return recordId; - } - - public void setRecordId(Long recordId) { - this.recordId = recordId; - } - - public UserDoll getCatchUserDoll() { - return catchUserDoll; - } - - public void setCatchUserDoll(UserDoll catchUserDoll) { - this.catchUserDoll = catchUserDoll; - } - - public Integer getCatchTimes() { - return catchTimes; - } - - public void setCatchTimes(Integer catchTimes) { - this.catchTimes = catchTimes; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILIkedDataVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILIkedDataVo.java deleted file mode 100644 index ef5412949..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILIkedDataVo.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.business.vo; - -import java.util.List; - -public class DollILIkedDataVo { - - private long count; - - private List dataList; - - private long needBed; - - public long getNeedBed() { - return needBed; - } - - public void setNeedBed(long needBed) { - this.needBed = needBed; - } - - public long getCount() { - return count; - } - - public void setCount(long count) { - this.count = count; - } - - public List getDataList() { - return dataList; - } - - public void setDataList(List dataList) { - this.dataList = dataList; - } - - - -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILikedVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILikedVo.java deleted file mode 100644 index 0516971f8..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollILikedVo.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; - -/** - * 抓娃娃 我喜欢娃娃 - */ -public class DollILikedVo { - - private Long uid; - - private int count; - - private String nick; - - @ReplaceAppDomain - private String avatar; - - private Integer rankNum; - - @ReplaceAppDomain - private String voice; - - private Byte sex; - - public String getVoice() { - return voice; - } - - public void setVoice(String voice) { - this.voice = voice; - } - - public Integer getRankNum() { - return rankNum; - } - - public void setRankNum(Integer rankNum) { - this.rankNum = rankNum; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } - - public Byte getSex() { - return sex; - } - - public void setSex(Byte sex) { - this.sex = sex; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollLikeRankVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollLikeRankVo.java deleted file mode 100644 index 72f6991f0..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/DollLikeRankVo.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.accompany.business.vo; - -import java.util.List; - -public class DollLikeRankVo { - - private List list; - - private DollILikedVo mine; - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public DollILikedVo getMine() { - return mine; - } - - public void setMine(DollILikedVo mine) { - this.mine = mine; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/TopicRoomVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/TopicRoomVo.java deleted file mode 100644 index 1a7b29564..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/TopicRoomVo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.business.model.TopicRoom; - -public class TopicRoomVo extends TopicRoom { - private Long erbanNo; - private String roomTitle; - - public TopicRoomVo() { - } - - public Long getErbanNo() { - return erbanNo; - } - - public void setErbanNo(Long erbanNo) { - this.erbanNo = erbanNo; - } - - public String getRoomTitle() { - return roomTitle; - } - - public void setRoomTitle(String roomTitle) { - this.roomTitle = roomTitle; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollRecordVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollRecordVo.java deleted file mode 100644 index b537b12eb..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollRecordVo.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; - -import java.util.Date; - -public class UserDollRecordVo { - - private Long uid; - - private String nick; - - @ReplaceAppDomain - private String avatar; - - private Byte userGender; - - private Byte dollGender; - - private Byte OptType; - - private Byte DealType; - - private Date createTime; - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public Byte getUserGender() { - return userGender; - } - - public void setUserGender(Byte userGender) { - this.userGender = userGender; - } - - public Byte getDollGender() { - return dollGender; - } - - public void setDollGender(Byte dollGender) { - this.dollGender = dollGender; - } - - public Byte getOptType() { - return OptType; - } - - public void setOptType(Byte optType) { - OptType = optType; - } - - public Byte getDealType() { - return DealType; - } - - public void setDealType(Byte dealType) { - DealType = dealType; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollVo.java deleted file mode 100644 index b4110e592..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/UserDollVo.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.accompany.business.vo; - -import com.accompany.common.annotation.ReplaceAppDomain; - -import java.util.Date; -import java.util.Map; - -public class UserDollVo { - private Long uid; - - private Byte sex; - - @ReplaceAppDomain - private String voice; - - private Date createTime; - - private Date updateTime; - - private Integer bed; - - @ReplaceAppDomain - private String avatar; - - private String nick; - - private Integer likeCount; - - private Integer ownerTime; - - private Long inviteUid; - - private Map userCanCatchMap; - - public Map getUserCanCatchMap() { - return userCanCatchMap; - } - - public void setUserCanCatchMap(Map userCanCatchMap) { - this.userCanCatchMap = userCanCatchMap; - } - - public Long getInviteUid() { - return inviteUid; - } - - public void setInviteUid(Long inviteUid) { - this.inviteUid = inviteUid; - } - - public Long getUid() { - return uid; - } - - public void setUid(Long uid) { - this.uid = uid; - } - - public Byte getSex() { - return sex; - } - - public void setSex(Byte sex) { - this.sex = sex; - } - - public String getVoice() { - return voice; - } - - public void setVoice(String voice) { - this.voice = voice; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - public Integer getBed() { - return bed; - } - - public void setBed(Integer bed) { - this.bed = bed; - } - - public Integer getLikeCount() { - return likeCount; - } - - public void setLikeCount(Integer likeCount) { - this.likeCount = likeCount; - } - - public Integer getOwnerTime() { - return ownerTime; - } - - public void setOwnerTime(Integer ownerTime) { - this.ownerTime = ownerTime; - } - - public String getAvatar() { - return avatar; - } - - public void setAvatar(String avatar) { - this.avatar = avatar; - } - - public String getNick() { - return nick; - } - - public void setNick(String nick) { - this.nick = nick; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/ModuleRoomMapVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/ModuleRoomMapVo.java deleted file mode 100644 index e28b8df90..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/ModuleRoomMapVo.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.accompany.business.vo.recommend; - -import com.accompany.business.model.RecommendModule; -import com.accompany.business.vo.RoomVo; -import com.accompany.business.vo.TopicRoomVo; - -import java.util.List; - - -public class ModuleRoomMapVo { - private RecommendModule module; - private List rooms; - - public RecommendModule getModule() { - return module; - } - - public void setModule(RecommendModule module) { - this.module = module; - } - - public List getRooms() { return rooms;} - - public void setRooms(List rooms) {this.rooms = rooms;} -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardItemVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardItemVo.java deleted file mode 100644 index 7b6e56f2e..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardItemVo.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.accompany.business.vo.recommend; - -import java.util.Date; - -/** - * Created by PaperCut on 2018/12/28. - * 推荐卡记录项 - */ -public class RecommendCardItemVo { - private String cardName; - private Integer count; - private Date validStartTime; - private Date validEndTime; - private Date useStartTime; - private Date useEndTime; - private Byte status; - private Integer days; - - public Integer getCount() { - return count; - } - - public void setCount(Integer count) { - this.count = count; - } - - public Date getValidStartTime() { - return validStartTime; - } - - public void setValidStartTime(Date validStartTime) { - this.validStartTime = validStartTime; - } - - public Date getValidEndTime() { - return validEndTime; - } - - public void setValidEndTime(Date validEndTime) { - this.validEndTime = validEndTime; - } - - public Date getUseStartTime() { - return useStartTime; - } - - public void setUseStartTime(Date useStartTime) { - this.useStartTime = useStartTime; - } - - public Date getUseEndTime() { - return useEndTime; - } - - public void setUseEndTime(Date useEndTime) { - this.useEndTime = useEndTime; - } - - public Byte getStatus() { - return status; - } - - public void setStatus(Byte status) { - this.status = status; - } - - public String getCardName() { - return cardName; - } - - public void setCardName(String cardName) { - this.cardName = cardName; - } - - public Integer getDays() { - return days; - } - - public void setDays(Integer days) { - this.days = days; - } -} diff --git a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardListVo.java b/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardListVo.java deleted file mode 100644 index f03a53d5f..000000000 --- a/accompany-business/accompany-business-sdk/src/main/java/com/accompany/business/vo/recommend/RecommendCardListVo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.accompany.business.vo.recommend; - - -import com.accompany.business.model.RecommendCard; - -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * Created by PaperCut on 2018/12/28. - * 我的推荐卡数据Vo - */ -public class RecommendCardListVo { - private List cardList; - - public RecommendCardListVo(List cardList) { - this.cardList = cardList; - } - - /** - * 对结果集进行分组统计 - * @param func - * @return - */ - public List groupBy(Function func, Comparator sortComp) { - Map> cardMap = cardList.stream() - .collect(Collectors.groupingBy(func)); - - List items = new ArrayList<>(cardMap.size()); - Set>> entrySet = cardMap.entrySet(); - for(Map.Entry> entry : entrySet) { - RecommendCard card = entry.getValue().get(0); - RecommendCardItemVo itemVo = new RecommendCardItemVo(); - itemVo.setCardName(card.getCardName()); - itemVo.setCount(entry.getValue().size()); - itemVo.setStatus(card.getStatus()); - itemVo.setValidStartTime(card.getValidStartTime()); - itemVo.setValidEndTime(card.getValidEndTime()); - itemVo.setUseStartTime(card.getUsedStartTime()); - itemVo.setUseEndTime(card.getUsedEndTime()); - itemVo.setDays((int)TimeUnit.MILLISECONDS.toDays(card.getValidEndTime().getTime() - (new Date()).getTime())); - items.add(itemVo); - } - - // 按结束日期进行排序 - Collections.sort(items, sortComp); - return items; - } - - public List getCardList() { - return cardList; - } - - public void setCardList(List cardList) { - this.cardList = cardList; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CancelUserListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CancelUserListener.java index 28b240d2b..b4d04801a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CancelUserListener.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CancelUserListener.java @@ -23,7 +23,6 @@ public class CancelUserListener { Long uid = event.getUid(); Long erbanNo = event.getErbanNo(); log.info("handle event after cancel user: {},erbanNo{}", uid, erbanNo); - jedisService.del(RedisKey.search.getKey(String.valueOf(erbanNo))); jedisService.hdel(RedisKey.user.getKey(), String.valueOf(uid)); jedisService.hdel(RedisKey.user_erban_no.getKey(), String.valueOf(erbanNo)); jedisService.del(RedisKey.cancel_user_recover_credentials.getKey(String.valueOf(erbanNo))); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserChatListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserChatListener.java deleted file mode 100644 index 7f09f27b3..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserChatListener.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.accompany.business.event.listener; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.dto.netease.IMChatMsgDTO; -import com.accompany.business.event.CustomerConversationEvent; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserCoupleTask; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserCoupleTaskService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.common.JedisLockService; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.List; - -/** - * Created By chenli on 2021/09/08 - * 私聊次数统计监听:目前周期只支持周 - */ -@Component -@Slf4j -public class CpUserChatListener implements ApplicationListener { - - @Autowired - private UserCoupleMapper userCoupleMapper; - @Autowired - private JedisService jedisService; - @Autowired - private JedisLockService jedisLockService; - @Autowired - private UserCoupleTaskService userCoupleTaskService; - @Autowired - private UserCoupleService userCoupleService; - - private Gson gson = new Gson(); - - - - @Override - @Async - public void onApplicationEvent(CustomerConversationEvent customerConversationEvent) { - IMChatMsgDTO chatMsg = (IMChatMsgDTO) customerConversationEvent.getSource(); - - String fromUidStr = chatMsg.getFromAccount(); - if (StringUtils.isEmpty(fromUidStr)) return; - Long fromUid = Long.parseLong(fromUidStr); - //接收人为空,直接返回 - if (StringUtils.isEmpty(chatMsg.getTo())) return; - Long toUid = Long.parseLong(chatMsg.getTo()); - - UserCouple userCouple = userCoupleMapper.getUserCoupleByCpUser(fromUid, toUid); - if (ObjectUtil.isNull(userCouple)) { - log.info("私聊双方{}-{}不是CP关系", fromUid, toUid); - return; - } - String lockKey = RedisKey.cp_send_gift_lock.getKey(String.valueOf(userCouple.getId())); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) { - log.info("cp记录{}用户{}-{}私聊获取锁失败", userCouple.getId(), fromUid, toUid); - return; - } - try { - UserCoupleTask userCoupleTask = userCoupleTaskService.queryCoupleDailyTaskByType(Constant.UserCoupleTaskType.chat); - //检查当天私聊次数是否达到10条 - String chatNumStr = jedisService.get(RedisKey.cp_user_chat_num.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(chatNumStr)) { - chatNumStr = "0"; - jedisService.setex(RedisKey.cp_user_chat_num.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_)), 24 * 60 * 60, String.valueOf(0)); - } - - Integer chatNum = Integer.valueOf(chatNumStr); - if (ObjectUtil.isNotNull(userCoupleTask) && chatNum < userCoupleTask.getNeed() && (chatNum + 1) >= userCoupleTask.getNeed()) { - userCoupleService.addSecretVal(userCouple.getId(), Long.valueOf(userCoupleTask.getAwardVal())); - } - jedisService.incr(RedisKey.cp_user_chat_num.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - - - //累计私聊加经验 - String chatTotalNumStr = jedisService.hget(RedisKey.cp_user_chat_sum.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(chatTotalNumStr)) chatTotalNumStr = "0"; - Long chatTotalNum = Long.valueOf(chatTotalNumStr); - - List userCoupleTaskList = userCoupleTaskService.queryCoupleTotalTaskByType(Constant.UserCoupleTaskType.chat); - jedisService.hincr(RedisKey.cp_user_chat_sum.getKey(), String.valueOf(userCouple.getId())); - if (CollectionUtils.isEmpty(userCoupleTaskList)) return; - Long newTotalVal = chatTotalNum + 1; - for (UserCoupleTask coupleTask : userCoupleTaskList) { - if (chatTotalNum < Long.valueOf(coupleTask.getNeed()) && newTotalVal >= Long.valueOf(coupleTask.getNeed())) { - userCoupleService.addSecretVal(userCouple.getId(), Long.valueOf(coupleTask.getAwardVal())); - } - } - - } catch (Exception e) { - log.error("cp记录{}用户{}-{}私聊处理失败{}", userCouple.getId(), fromUid, toUid, e); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - - } - - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserSendGiftListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserSendGiftListener.java deleted file mode 100644 index 3a0a098f6..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/CpUserSendGiftListener.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.accompany.business.event.listener; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.event.GiftMessageEvent; -import com.accompany.business.message.GiftMessage; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserCoupleTask; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserCoupleTaskService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisLockService; -import com.accompany.core.service.common.JedisService; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.List; - -/** - * 66大排行 - * - * @author xiaoyuyou - * @date 2018/12/19 17:24 - */ -@Component -@Slf4j -public class CpUserSendGiftListener implements ApplicationListener { - - @Autowired - private SysConfService sysConfService; - - @Autowired - private JedisService jedisService; - - @Autowired - private UserCoupleService userCoupleService; - - @Autowired - private UserCoupleMapper userCoupleMapper; - - @Autowired - private UserCoupleTaskService userCoupleTaskService; - - @Autowired - private JedisLockService jedisLockService; - - - - //@Async - @Override - @SneakyThrows - public void onApplicationEvent(GiftMessageEvent giftMessageEvent) { - GiftMessage giftMessage = (GiftMessage) giftMessageEvent.getSource(); - log.info("送礼双方是否。event time: {}。", giftMessage.getMessTime()); - Long sendUid = giftMessage.getSendUid(); - Long recvUid = giftMessage.getRecvUid(); - Long goldNum = giftMessage.getGoldNum(); - - if (goldNum <= 0L){ - return; - } - - UserCouple userCouple = userCoupleMapper.getUserCoupleByCpUser(sendUid, recvUid); - if (ObjectUtil.isNull(userCouple)) { - log.info("送礼人{}收礼人{}双方不是CP关系", sendUid, recvUid); - return; - } - log.info("cp{}送礼任务用户{}收到用户{}赠送的礼物{}金币价值{}", userCouple.getId(), recvUid, sendUid, giftMessage.getGiftId(), goldNum); - - - String lockKey = RedisKey.cp_send_gift_lock.getKey(String.valueOf(userCouple.getId())); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) { - log.info("cp记录{}用户{}给用户送礼价值{}获取锁失败", userCouple.getId(), sendUid, recvUid, goldNum); - return; - } - - try { - - Integer rate = Integer.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.GLOD_SWITCH_TO_SECRET_VAL_RATE, String.valueOf(Constant.UserRelationDefaultVal.glod_switch_to_secret_val_rate))); - Long originSecretVal = goldNum / rate;; - Long secretVal = originSecretVal; - - UserCoupleTask userCoupleTask = userCoupleTaskService.queryCoupleDailyTaskByType(Constant.UserCoupleTaskType.send_gift); - - //检查当天送礼亲密值 - String currentDaySecretVal = jedisService.get(RedisKey.cp_gift_secret_day_limit.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(currentDaySecretVal)) { - jedisService.setex(RedisKey.cp_gift_secret_day_limit.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_)), 24 * 60 * 60, String.valueOf(0)); - currentDaySecretVal = "0"; - } - Long daySecretVal = Long.valueOf(currentDaySecretVal); - if (ObjectUtil.isNotNull(userCoupleTask)) { - //当天剩余允许加的最大亲密值 - Long remainSecretValDay = Long.valueOf(userCoupleTask.getNeed()) - daySecretVal; - //计算剩余允许增加的亲密值 - if (secretVal > remainSecretValDay) { - log.info("cp记录{}日送礼任务亲密值{}实际加{}", userCouple.getId(), secretVal, remainSecretValDay); - secretVal = remainSecretValDay; - - } - } - jedisService.incrBy(RedisKey.cp_gift_secret_day_limit.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_)), secretVal); - userCoupleService.addSecretVal(userCouple.getId(), secretVal); - - - List userCoupleTaskList = userCoupleTaskService.queryCoupleTotalTaskByType(Constant.UserCoupleTaskType.send_gift); - if (CollectionUtils.isEmpty(userCoupleTaskList)) return; - - - String sengGoldTotalNumStr = jedisService.hget(RedisKey.cp_user_gold_sum.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(sengGoldTotalNumStr)) sengGoldTotalNumStr = "0"; - - jedisService.hincrbyfloat(RedisKey.cp_user_gold_sum.getKey(), String.valueOf(userCouple.getId()), Double.valueOf(goldNum)); - - Double sengGoldTotalNum = Double.valueOf(sengGoldTotalNumStr); - Double newTotalVal = sengGoldTotalNum + goldNum; - for (UserCoupleTask coupleTask : userCoupleTaskList) { - if (sengGoldTotalNum < Double.valueOf(coupleTask.getNeed()) && newTotalVal >= Double.valueOf(coupleTask.getNeed())) { - userCoupleService.addSecretVal(userCouple.getId(), Long.valueOf(coupleTask.getAwardVal())); - } - } - } catch (Exception e) { - log.error("cp记录{}用户{}给用户送礼{}处理失败{}", userCouple.getId(), sendUid, recvUid, goldNum, e); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/WriteCpInviteBillListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/WriteCpInviteBillListener.java deleted file mode 100644 index f9daa2d5b..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/WriteCpInviteBillListener.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.accompany.business.event.listener; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.dto.CpInviteBillRecordDto; -import com.accompany.business.event.WriteCpInviteBillEvent; -import com.accompany.business.model.clan.ClanAccountAssociate; -import com.accompany.business.model.clan.ClanAssociateTransferRecord; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.service.clan.ClanAssociateTransferRecordService; -import com.accompany.business.service.record.BillRecordService; -import com.accompany.core.enumeration.BillObjTypeEnum; -import com.google.gson.Gson; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; -import org.springframework.transaction.event.TransactionPhase; -import org.springframework.transaction.event.TransactionalEventListener; - -import java.util.List; - -@Component -@Slf4j -public class WriteCpInviteBillListener { - - @Autowired - private BillRecordService billRecordService; - - @Autowired - private UserCoupleMapper userCoupleMapper; - - @Autowired - private ClanAssociateTransferRecordService clanAssociateTransferRecordService; - - private Gson gson = new Gson(); - - @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) - @Async - public void handleAfterCpInviteDealFinished(WriteCpInviteBillEvent event) { - List billRecordDtoList = event.getBillRecordDtoList(); - if (CollectionUtil.isEmpty(billRecordDtoList)) return; - - log.info("组cp写账单:{}", gson.toJson(billRecordDtoList)); - try { - for (CpInviteBillRecordDto billRecordDto : billRecordDtoList) { - ClanAccountAssociate associate = billRecordDto.getClanAccountAssociate(); - - String billId = billRecordService.insertGiftSendBillRecord(billRecordDto.getUid(), billRecordDto.getTargetUid(), - billRecordDto.getRoomUid(),billRecordDto.getObjId(), billRecordDto.getEventEnum(), billRecordDto.getAmount(), billRecordDto.getGiftId(),billRecordDto.getGiftNum(),billRecordDto.getAmount().longValue()); - - if (ObjectUtil.isNotNull(associate)) { - log.info("同意CP邀请{}会长{}为关联号分成比例{}所得钻石{}流转到族长{}", billRecordDto.getObjId(), billRecordDto.getUid(), billRecordDto.getHallPerRate(), billRecordDto.getAmount(), associate.getClanElderUid()); - UserCouple userCouple = userCoupleMapper.selectById(Long.valueOf(billRecordDto.getObjId())); - - ClanAssociateTransferRecord associateTransferRecord = new ClanAssociateTransferRecord(); - associateTransferRecord.setUid(associate.getClanElderUid()); - associateTransferRecord.setAssociateUid(billRecordDto.getUid()); - associateTransferRecord.setTargetUid(userCouple.getAcceptUid()); - associateTransferRecord.setAmount(billRecordDto.getAmount()); - associateTransferRecord.setType(BillObjTypeEnum.HALL_OWNER_CP_INVITE_EARN.getValue()); - associateTransferRecord.setBillId(billId); - clanAssociateTransferRecordService.save(associateTransferRecord); - } - - } - }catch (Exception e) { - log.error("组cp写账单:{}异常", gson.toJson(billRecordDtoList), e); - throw new RuntimeException(e); - } - - - - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserIntoRoomListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserIntoRoomListener.java deleted file mode 100644 index 372ec3cb7..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserIntoRoomListener.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.accompany.business.event.listener.room; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.event.room.UserInRoomEvent; -import com.accompany.business.message.room.UserInRoomMessage; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.service.room.UserInOutRoomRecordService; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.vo.RoomVo; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.Date; - -/** - * @Author: chenli - * @Date: 2021/07/26 18:17 - * @Description: 用户进房守护团相关处理: - **/ -@Slf4j -@Component -public class CpUserIntoRoomListener implements ApplicationListener { - - @Autowired - private UserCoupleService userCoupleService; - @Autowired - private UserInOutRoomRecordService userInOutRoomRecordService; - @Autowired - private JedisService jedisService; - - private Gson gson = new Gson(); - - - /** - * cp用户进房处理 - * @param userInRoomEvent - */ - @Async - @Override - @SneakyThrows - public void onApplicationEvent(UserInRoomEvent userInRoomEvent) { - UserInRoomMessage userInRoomMessage = (UserInRoomMessage) userInRoomEvent.getSource(); - if (userInRoomMessage == null) return; - - RoomVo roomVo = userInRoomMessage.getRoomVo(); - Long roomUid = roomVo.getUid(); - - //当前进房用户uid - Long uid = userInRoomMessage.getUid(); - //1、检查进房用户是否拥有CP - UserCouple userCouple = userCoupleService.queryCpByUid(uid, false); - - if (ObjectUtil.isNull(userCouple)) return; - - Long cpUid = userCouple.getInviteUid(); - if (uid.equals(cpUid)) cpUid = userCouple.getAcceptUid(); - - //获取cp用户当前所在房间 - Long cpRoomUid = userInOutRoomRecordService.getUserInRoomCurrent(cpUid); - - if (!ObjectUtil.equal(roomUid, cpRoomUid)) return; - - log.info("进房用户{}与其cp用户{}在同一房间{}", uid, cpUid, cpRoomUid); - - //写入当前时间戳 - Long currentMs = new Date().getTime(); - jedisService.hset(RedisKey.cp_in_same_room_start_ms.getKey(), String.valueOf(userCouple.getId()), String.valueOf(currentMs)); - } - - - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserOutRoomListener.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserOutRoomListener.java deleted file mode 100644 index 6520211af..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/event/listener/room/CpUserOutRoomListener.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.accompany.business.event.listener.room; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.event.room.UserOutRoomEvent; -import com.accompany.business.message.room.UserOutRoomMessage; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserCoupleTask; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserCoupleTaskService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.service.common.JedisLockService; -import com.accompany.core.service.common.JedisService; -import com.google.gson.Gson; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import java.util.Date; -import java.util.List; - -/** - * @Author: chenli - * @Date: 2021/07/26 18:17 - * @Description: 用户离开房间守护团相关处理: - **/ -@Slf4j -@Component -public class CpUserOutRoomListener implements ApplicationListener { - - @Autowired - private UserCoupleService userCoupleService; - @Autowired - private JedisService jedisService; - @Autowired - private JedisLockService jedisLockService; - @Autowired - private UserCoupleTaskService userCoupleTaskService; - private Gson gson = new Gson(); - - - @Async - @Override - @SneakyThrows - public void onApplicationEvent(UserOutRoomEvent userOutRoomEvent) { - UserOutRoomMessage userOutRoomMessage = (UserOutRoomMessage) userOutRoomEvent.getSource(); - if (userOutRoomMessage == null) return; - - Long roomUid = userOutRoomMessage.getRoomUid(); - //当前离开房间用户uid - Long uid = userOutRoomMessage.getUid(); - //1、检查进房用户是否拥有CP - UserCouple userCouple = userCoupleService.queryCpByUid(uid, false); - - if (ObjectUtil.isNull(userCouple)) return; - - String sameRoomMsStr = jedisService.hget(RedisKey.cp_in_same_room_start_ms.getKey(), String.valueOf(userCouple.getId())); - - if (StringUtils.isEmpty(sameRoomMsStr)) return; - jedisService.hdel(RedisKey.cp_in_same_room_start_ms.getKey(), String.valueOf(userCouple.getId())); - - Long sameRoomMs = Long.valueOf(sameRoomMsStr); - - //计算在房间一起待了多少秒 - Long sameSecond = (new Date().getTime() - sameRoomMs) / 1000; - - String lockKey = RedisKey.cp_same_room_lock.getKey(String.valueOf(userCouple.getId())); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) { - log.info("cp记录{}用户{}离开房间计算时长处理获取锁失败", userCouple.getId(), uid); - return; - } - - - try { - String dailySecondStr = jedisService.get(RedisKey.cp_in_same_room_ms_daily.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(dailySecondStr)) { - dailySecondStr = "0"; - jedisService.setex(RedisKey.cp_in_same_room_ms_daily.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_)), 24 * 60 * 60, String.valueOf(0)); - } - - Long dailySecond = Long.valueOf(dailySecondStr); - - Long newDailySecond = dailySecond + sameSecond; - - - //检查处理每日任务 - UserCoupleTask dailyCoupleTask = userCoupleTaskService.queryCoupleDailyTaskByType(Constant.UserCoupleTaskType.same_room); - if (ObjectUtil.isNotNull(dailyCoupleTask) && (dailySecond < dailyCoupleTask.getNeed() * 60) && (newDailySecond >= dailyCoupleTask.getNeed() * 60)) { - userCoupleService.addSecretVal(userCouple.getId(), Long.valueOf(dailyCoupleTask.getAwardVal())); - } - jedisService.set(RedisKey.cp_in_same_room_ms_daily.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_)), String.valueOf(newDailySecond)); - - - String totalSameSecondStr = jedisService.hget(RedisKey.cp_in_same_room_ms_total.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(totalSameSecondStr)) totalSameSecondStr = "0"; - Long totalSameSecond = Long.valueOf(totalSameSecondStr); - Long newTotalSameSecond = totalSameSecond + sameSecond; - jedisService.hset(RedisKey.cp_in_same_room_ms_total.getKey(), String.valueOf(userCouple.getId()), String.valueOf(newTotalSameSecond)); - - - //检查处理累计任务 - List userCoupleTaskList = userCoupleTaskService.queryCoupleTotalTaskByType(Constant.UserCoupleTaskType.same_room); - if (CollectionUtils.isEmpty(userCoupleTaskList)) return; - - for (UserCoupleTask coupleTask : userCoupleTaskList) { - if (totalSameSecond < (coupleTask.getNeed() * 60 * 60) && newTotalSameSecond >= (coupleTask.getNeed() * 60 * 60)) { - userCoupleService.addSecretVal(userCouple.getId(), Long.valueOf(coupleTask.getAwardVal())); - } - } - } catch (Exception e) { - log.error("cp记录{}用户{}离开房间计算时长处理异常{}", userCouple.getId(), uid, e); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - - - } - - - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionUpdateConfMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionUpdateConfMapper.java deleted file mode 100644 index ec8d40c8a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/AppVersionUpdateConfMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.AppVersionUpdateConf; -import com.accompany.business.model.AppVersionUpdateConfExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface AppVersionUpdateConfMapper { - int deleteByExample(AppVersionUpdateConfExample example); - - int deleteByPrimaryKey(String version); - - int insert(AppVersionUpdateConf record); - - int insertSelective(AppVersionUpdateConf record); - - List selectByExample(AppVersionUpdateConfExample example); - - AppVersionUpdateConf selectByPrimaryKey(String version); - - int updateByExampleSelective(@Param("record") AppVersionUpdateConf record, @Param("example") AppVersionUpdateConfExample example); - - int updateByExample(@Param("record") AppVersionUpdateConf record, @Param("example") AppVersionUpdateConfExample example); - - int updateByPrimaryKeySelective(AppVersionUpdateConf record); - - int updateByPrimaryKey(AppVersionUpdateConf record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftSendRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftSendRecordMapper.java index 23f7a927f..963e88fd3 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftSendRecordMapper.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/GiftSendRecordMapper.java @@ -1,6 +1,5 @@ package com.accompany.business.mybatismapper; -import com.accompany.business.dto.UserCoupleSendDetailDto; import com.accompany.business.model.GiftSendRecord; import com.accompany.business.model.GiftSendRecordExample; @@ -44,5 +43,4 @@ public interface GiftSendRecordMapper { Long statisCpGoldNum(@Param("uid") Long uid, @Param("cpUid") Long cpUid, @Param("startTime") Date startTime, @Param("endTime") Date endTime); - List cpUserSendDetailList(@Param("uid") Long uid, @Param("cpUid") Long cpUid, @Param("startTime") Date startTime, @Param("endTime") Date endTime); } \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendCardMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendCardMapper.java deleted file mode 100644 index 770985753..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendCardMapper.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RecommendCard; -import com.accompany.business.model.RecommendCardExample; -import org.apache.ibatis.annotations.Param; -import java.util.List; - -public interface RecommendCardMapper { - int countByExample(RecommendCardExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendCard record); - - int insertSelective(RecommendCard record); - - List selectByExample(RecommendCardExample example); - - RecommendCard selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendCard record, @Param("example") RecommendCardExample example); - - int updateByExample(@Param("record") RecommendCard record, @Param("example") RecommendCardExample example); - - int updateByPrimaryKeySelective(RecommendCard record); - - int updateByPrimaryKey(RecommendCard record); - - - List queryByPage(@Param("uid") Long uid, @Param("status") Byte status); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendModuleMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendModuleMapper.java deleted file mode 100644 index a44522e82..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendModuleMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RecommendModule; -import com.accompany.business.model.RecommendModuleExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface RecommendModuleMapper { - int countByExample(RecommendModuleExample example); - - int deleteByExample(RecommendModuleExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendModule record); - - int insertSelective(RecommendModule record); - - List selectByExample(RecommendModuleExample example); - - RecommendModule selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendModule record, @Param("example") RecommendModuleExample example); - - int updateByExample(@Param("record") RecommendModule record, @Param("example") RecommendModuleExample example); - - int updateByPrimaryKeySelective(RecommendModule record); - - int updateByPrimaryKey(RecommendModule record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendOccupyMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendOccupyMapper.java deleted file mode 100644 index 38b98924b..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendOccupyMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.accompany.business.mybatismapper; - - -import com.accompany.business.model.RecommendOccupy; -import com.accompany.business.model.RecommendOccupyExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface RecommendOccupyMapper { - int countByExample(RecommendOccupyExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendOccupy record); - - int insertSelective(RecommendOccupy record); - - List selectByExample(RecommendOccupyExample example); - - RecommendOccupy selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendOccupy record, @Param("example") RecommendOccupyExample example); - - int updateByExample(@Param("record") RecommendOccupy record, @Param("example") RecommendOccupyExample example); - - int updateByPrimaryKeySelective(RecommendOccupy record); - - int updateByPrimaryKey(RecommendOccupy record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRecordMapper.java deleted file mode 100644 index 7dd7c1a70..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRecordMapper.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RecommendRecord; -import com.accompany.business.model.RecommendRecordExample; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface RecommendRecordMapper { - int countByExample(RecommendRecordExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendRecord record); - - int insertSelective(RecommendRecord record); - - List selectByExample(RecommendRecordExample example); - - RecommendRecord selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendRecord record, @Param("example") RecommendRecordExample example); - - int updateByExample(@Param("record") RecommendRecord record, @Param("example") RecommendRecordExample example); - - int updateByPrimaryKeySelective(RecommendRecord record); - - int updateByPrimaryKey(RecommendRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomMapper.java deleted file mode 100644 index dd1cb2c6b..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RecommendRoom; -import com.accompany.business.model.RecommendRoomExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface RecommendRoomMapper { - int countByExample(RecommendRoomExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendRoom record); - - int insertSelective(RecommendRoom record); - - List selectByExample(RecommendRoomExample example); - - RecommendRoom selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendRoom record, @Param("example") RecommendRoomExample example); - - int updateByExample(@Param("record") RecommendRoom record, @Param("example") RecommendRoomExample example); - - int updateByPrimaryKeySelective(RecommendRoom record); - - int updateByPrimaryKey(RecommendRoom record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomRecordMapper.java deleted file mode 100644 index 7076ecde1..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/RecommendRoomRecordMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.RecommendRoomRecord; -import com.accompany.business.model.RecommendRoomRecordExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface RecommendRoomRecordMapper { - int countByExample(RecommendRoomRecordExample example); - - int deleteByPrimaryKey(Long id); - - int insert(RecommendRoomRecord record); - - int insertSelective(RecommendRoomRecord record); - - List selectByExample(RecommendRoomRecordExample example); - - RecommendRoomRecord selectByPrimaryKey(Long id); - - int updateByExampleSelective(@Param("record") RecommendRoomRecord record, @Param("example") RecommendRoomRecordExample example); - - int updateByExample(@Param("record") RecommendRoomRecord record, @Param("example") RecommendRoomRecordExample example); - - int updateByPrimaryKeySelective(RecommendRoomRecord record); - - int updateByPrimaryKey(RecommendRoomRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollMapper.java deleted file mode 100644 index 84378210c..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.UserDoll; -import com.accompany.business.model.UserDollExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface UserDollMapper { - int countByExample(UserDollExample example); - - int deleteByPrimaryKey(Long uid); - - int insert(UserDoll record); - - int insertSelective(UserDoll record); - - List selectByExample(UserDollExample example); - - UserDoll selectByPrimaryKey(Long uid); - - int updateByExampleSelective(@Param("record") UserDoll record, @Param("example") UserDollExample example); - - int updateByExample(@Param("record") UserDoll record, @Param("example") UserDollExample example); - - int updateByPrimaryKeySelective(UserDoll record); - - int updateByPrimaryKey(UserDoll record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollRecordMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollRecordMapper.java deleted file mode 100644 index 3af35639a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UserDollRecordMapper.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.accompany.business.mybatismapper; - -import com.accompany.business.model.UserDollRecord; -import com.accompany.business.model.UserDollRecordExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface UserDollRecordMapper { - int countByExample(UserDollRecordExample example); - - int deleteByExample(UserDollRecordExample example); - - int deleteByPrimaryKey(Long recordId); - - int insert(UserDollRecord record); - - int insertSelective(UserDollRecord record); - - List selectByExample(UserDollRecordExample example); - - UserDollRecord selectByPrimaryKey(Long recordId); - - int updateByExampleSelective(@Param("record") UserDollRecord record, @Param("example") UserDollRecordExample example); - - int updateByExample(@Param("record") UserDollRecord record, @Param("example") UserDollRecordExample example); - - int updateByPrimaryKeySelective(UserDollRecord record); - - int updateByPrimaryKey(UserDollRecord record); -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UsersMapperExpend.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UsersMapperExpend.java index 1f58c0859..ab057f42c 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UsersMapperExpend.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/UsersMapperExpend.java @@ -19,22 +19,6 @@ public interface UsersMapperExpend { List findNormalUidsByPage(@Param("start") Integer start, @Param("count") Integer count); - /** - * 查询一周内登录的用户 - * @param startTime - * @param start - * @param count - * @return - */ - List findLoginUidByPage(@Param("startTime") String startTime, @Param("start") Integer start, @Param("count") Integer count); - - /** - * 查询一周内登录的用户数量 - * @param startTime - * @return - */ - long selectLoginCount(@Param("startTime") String startTime); - /** * 根据查询一批有金币且在某个时间段都没登录的用户 * @param startTime diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleLevelMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleLevelMapper.java deleted file mode 100644 index d3518bd4a..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleLevelMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.mybatismapper.user; - -import com.accompany.business.model.user.UserCoupleLevel; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - * 用户CP等级经验表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Mapper -public interface UserCoupleLevelMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleMapper.java deleted file mode 100644 index fe78e7b39..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleMapper.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.accompany.business.mybatismapper.user; - -import com.accompany.business.dto.UserCoupleStatisticalTotalDto; -import com.accompany.business.model.user.UserCouple; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -import java.util.Date; -import java.util.List; - -/** - * 用户CP表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Mapper -public interface UserCoupleMapper extends BaseMapper { - //查询最近2天内1分钟前到期但是没有自动拒绝的 - List getOverdueInviteList(@Param("start") Integer start, @Param("len") Integer len); - //查询最近3天内2分钟前到期但是没有执行解绑的 - List getOverdueWaitUnboundList(@Param("start") Integer start, @Param("len") Integer len); - - //根据双方uid获取CP状态中的用户记录 - UserCouple getUserCoupleByCpUser(@Param("uid") Long uid, @Param("anotherUid") Long anotherUid); - - //扫描并处理陪伴时长 - List scanAndDealKeepCpDuration(@Param("needList") List needList, @Param("start") Integer start, @Param("len") Integer len); - - List queryUserCoupleInCp(@Param("start") Integer start, @Param("len") Integer len); - - List queryUserCoupleListByStatistical(@Param("uid") Long uid, @Param("acceptTimeStart") String acceptTimeStart, @Param("acceptTimeEnd") String acceptTimeEnd, @Param("state") Byte state); - - UserCoupleStatisticalTotalDto userCoupleTotalStatistical(@Param("uid") Long uid, @Param("acceptTimeStart") String acceptTimeStart, @Param("acceptTimeEnd") String acceptTimeEnd, @Param("state") Byte state); - - Long userCoupleTotalSendGoldNum(@Param("uid") Long uid, @Param("acceptTimeStart") String acceptTimeStart, @Param("acceptTimeEnd") String acceptTimeEnd, @Param("state") Byte state); -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleTaskMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleTaskMapper.java deleted file mode 100644 index 35262f1b8..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserCoupleTaskMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.mybatismapper.user; - -import com.accompany.business.model.user.UserCoupleTask; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - * CP用户任务表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-11 18:57:39 - */ -@Mapper -public interface UserCoupleTaskMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPrivilegeMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPrivilegeMapper.java deleted file mode 100644 index 0bc6b2f96..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPrivilegeMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.mybatismapper.user; - -import com.accompany.business.model.user.UserRelationPrivilege; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Mapper -public interface UserRelationPrivilegeMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPropsMapper.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPropsMapper.java deleted file mode 100644 index 15b6323f2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/mybatismapper/user/UserRelationPropsMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.accompany.business.mybatismapper.user; - -import com.accompany.business.model.user.UserRelationProps; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Mapper; - -/** - * 用户关系道具表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 15:38:18 - */ -@Mapper -public interface UserRelationPropsMapper extends BaseMapper { - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java index aa3591bb7..942cd72fb 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionService.java @@ -35,8 +35,6 @@ public class AppVersionService extends BaseService { @Autowired private AppVersionMapper appVersionMapper; @Autowired - private AppVersionUpdateConfService appVersionUpdateConfService; - @Autowired private SysConfService sysConfService; /** @@ -271,8 +269,6 @@ public class AppVersionService extends BaseService { public void cleanCache() { jedisService.hdeleteKey(RedisKey.app_version.getKey()); refreshAppVersion(); - jedisService.hdeleteKey(RedisKey.app_version_update.getKey()); - appVersionUpdateConfService.refreshAppVersionUpdateConf(); } public BusiResult updateVersion(String version, Byte status) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionUpdateConfService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionUpdateConfService.java deleted file mode 100644 index fe70a4191..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/AppVersionUpdateConfService.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.accompany.business.service; - -import com.accompany.business.model.AppVersionUpdateConf; -import com.accompany.business.model.AppVersionUpdateConfExample; -import com.accompany.business.mybatismapper.AppVersionUpdateConfMapper; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.util.StringUtils; -import com.google.common.collect.Lists; -import com.google.gson.Gson; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; - -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * Created by liuguofu on 2017/7/10. - */ -@Service -public class AppVersionUpdateConfService { - @Autowired - private JedisService jedisService; - @Autowired - private AppVersionUpdateConfMapper appVersionUpdateConfMapper; - - - - private Gson gson=new Gson(); - - public List getAppUpdateVersionConfList(){ - List appVersionUpdateList= getAllAppVersionUpdateConfList(); - return appVersionUpdateList; - } - - private List queryAllAppVersionUpdateConfList(){ - AppVersionUpdateConfExample appVersionUpdateConfExample=new AppVersionUpdateConfExample(); - List appVersionUpdateConfList=appVersionUpdateConfMapper.selectByExample(appVersionUpdateConfExample); - return appVersionUpdateConfList; - } - private List getAllAppVersionUpdateConfList() { - List appVersionUpdateConfList = Lists.newArrayList(); - Map appVersionUpdateConfMap = jedisService.hgetAllBykey(RedisKey.app_version_update.getKey()); - if (appVersionUpdateConfMap == null || appVersionUpdateConfMap.size() == 0) { - return appVersionUpdateConfList; - } - Iterator> it = appVersionUpdateConfMap.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry entry = it.next(); - String value = entry.getValue(); - if (StringUtils.isNotEmpty(value)) { - AppVersionUpdateConf appVersionUpdateConf = gson.fromJson(value, AppVersionUpdateConf.class); - appVersionUpdateConfList.add(appVersionUpdateConf); - } - } - - return appVersionUpdateConfList; - } - - public void refreshAppVersionUpdateConf(){ - List appVersionUpdateConfList =queryAllAppVersionUpdateConfList(); - if(CollectionUtils.isEmpty(appVersionUpdateConfList)){ - return; - } - batchSaveAppVersionUpdateConfCache(appVersionUpdateConfList); - } - - private void batchSaveAppVersionUpdateConfCache(List appVersionUpdateConfList) { - if (CollectionUtils.isEmpty(appVersionUpdateConfList)) { - return; - } - for (AppVersionUpdateConf appVersionUpdateConf : appVersionUpdateConfList) { - saveAppVersionUpdateCache(appVersionUpdateConf); - } - } - private void saveAppVersionUpdateCache(AppVersionUpdateConf appVersionUpdateConf) { - if(appVersionUpdateConf==null){ - return; - } - String version = appVersionUpdateConf.getVersion(); - String replace = version.replace(".", ""); - int versionInt = Integer.parseInt(replace); - if(versionInt<230){ - return; - } - String key=appVersionUpdateConf.getVersion()+appVersionUpdateConf.getOs(); - jedisService.hwrite(RedisKey.app_version_update.getKey(), key, gson.toJson(appVersionUpdateConf)); - } - - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java index f2668e35c..e24b773f2 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/ChargeService.java @@ -16,7 +16,6 @@ import com.accompany.business.service.vip.VipMessageService; import com.accompany.business.util.VipUtil; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.UUIDUtil; @@ -34,6 +33,7 @@ import com.accompany.payment.vo.VipOpenParams; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.gson.reflect.TypeToken; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -143,6 +143,7 @@ public class ChargeService extends BaseService { * @param countryCode * @return */ + @SneakyThrows private Object doChargeBuss(Long uid, String chargeProdId, String channel, String clientIp, String successUrl, String failureUrl, String openId, DeviceInfo deviceInfo, ChargeProd chargeProd, String paymentType, String countryCode) { String lockKey = RedisKey.lock_apply_charge.getKey(uid.toString()); @@ -159,12 +160,7 @@ public class ChargeService extends BaseService { } catch (Exception e) { log.error("applyCharge3() error,uid={},chargeProdId={},channel={},clientIp={},successUrl={},openId={}", uid, chargeProdId, channel, clientIp, successUrl, openId); log.error("applyCharge3() errorMsg={}", e.getMessage()); - int status = BusiStatus.SERVERBUSY.value(); - if (e instanceof AdminServiceException) { - AdminServiceException exception = (AdminServiceException) e; - status = exception.getResponseCode(); - } - throw new AdminServiceException(status, e.getMessage()); + throw e; } finally { jedisLockService.unlock(RedisKey.lock_apply_charge.getKey(uid.toString()), lockVal); } @@ -293,7 +289,7 @@ public class ChargeService extends BaseService { int result = completedOrder(chargeRecord); if (result <= 0) { log.info("重複請求:chargeRecordId: " + chargeRecord.getChargeRecordId()); - throw new AdminServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); + throw new ServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); } // 更新用戶vip記錄 userVipRecord.setLastVipLevel(lastVipLevel); @@ -512,7 +508,7 @@ public class ChargeService extends BaseService { int result = completedOrder(chargeRecord); if (result <= 0) { log.info("重复请求:chargeRecordId: " + chargeRecord.getChargeRecordId()); - throw new AdminServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); + throw new ServiceException(BusiStatus.DUPLICATE_TRANSFER_REQUEST); } // 更新塔羅充值記錄 luckyTarotRecord.setDrawStatus(drawStatus); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/ActivitiesDrawService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/ActivitiesDrawService.java index 0fdf801b4..57e402157 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/ActivitiesDrawService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/activities/ActivitiesDrawService.java @@ -16,7 +16,7 @@ import com.accompany.business.vo.activity.ActivitiesDrawPrizeInfoVo; import com.accompany.business.vo.activity.ActivityPackVo; import com.accompany.business.vo.openbox.DrawPrizeItemVo; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; +import com.accompany.core.exception.ServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.result.BusiResult; import com.accompany.common.status.BusiStatus; @@ -85,7 +85,7 @@ public class ActivitiesDrawService { try { lock = jedisLockService.lock(RedisKey.lock_draw_update_ticket.getKey(uid.toString()), 10 * 1000); if (BlankUtil.isBlank(lock)){ - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } ActivityPack pack = activityPackService.getPackById(packId); userPrizeKeyService.updateTicket(uid, pack.getTicketNum() * packNum); @@ -106,7 +106,7 @@ public class ActivitiesDrawService { log.info("queryTicketNum, uid = {}", uid); Users users = usersService.getUsersByUid(uid); if (users == null){ - throw new AdminServiceException(BusiStatus.USERNOTEXISTS); + throw new ServiceException(BusiStatus.USERNOTEXISTS); } Map map = new HashMap(); BusiResult result = new BusiResult(BusiStatus.SUCCESS); @@ -129,7 +129,7 @@ public class ActivitiesDrawService { BusiResult result = new BusiResult(BusiStatus.SUCCESS); String str = jedisService.hget(RedisKey.draw_ticket_rule.getKey(), drawType.name().toLowerCase()); if (StringUtils.isEmpty(str)){ - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } result.setData(gson.fromJson(str,new TypeToken>(){}.getType())); return result; @@ -157,7 +157,7 @@ public class ActivitiesDrawService { public Integer getTicketNum(ActivitiesTicketRuleEnum ruleType, ActivitiesDrawTypeEnum drawType){ String numStr = getRedisMapValue(drawType.name().toLowerCase(), ruleType.name().toLowerCase(), RedisKey.draw_ticket_rule.getKey()); if (StringUtils.isEmpty(numStr)){ - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return Integer.valueOf(numStr); } @@ -171,7 +171,7 @@ public class ActivitiesDrawService { public Integer getUserNum(ActivitiesTicketRuleEnum ruleType, ActivitiesDrawTypeEnum drawType){ String numStr = getRedisMapValue(drawType.name().toLowerCase(), ruleType.name().toLowerCase(), RedisKey.draw_user_num_rule.getKey()); if (StringUtils.isEmpty(numStr)){ - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return Integer.valueOf(numStr); } @@ -247,7 +247,7 @@ public class ActivitiesDrawService { }else if (typeEnum.equals(ActivitiesDrawTypeEnum.turntable2)){ poolType = PrizePoolItemTypeEnum.diamond_prize_pool.getValue(); }else{ - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } List items = prizePgetListByPool(poolType); if (CollectionUtils.isEmpty(items)){ diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/callbattle/impl/ActCallBattleBizServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/callbattle/impl/ActCallBattleBizServiceImpl.java index 1d2607c95..1a629134e 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/callbattle/impl/ActCallBattleBizServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/callbattle/impl/ActCallBattleBizServiceImpl.java @@ -31,7 +31,6 @@ import com.accompany.business.service.user.UserActPropertyInfoV2Service; import com.accompany.business.service.user.UsersService; import com.accompany.business.vo.callbattle.*; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.BlankUtil; @@ -153,7 +152,7 @@ public class ActCallBattleBizServiceImpl implements ActCallBattleBizService { try { lock = jedisLockService.lock(RedisKey.CALL_BATTLE_UPDATE_PIECE_LOCK.getKey(uid.toString()), 10 * 1000); if (BlankUtil.isBlank(lock)){ - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } ActivityPack pack = activityPackService.getPackById(packId); if (null == pack) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/AbstractCertifyService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/AbstractCertifyService.java index 72926aa3a..a7725f4b7 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/AbstractCertifyService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/AbstractCertifyService.java @@ -13,7 +13,6 @@ import com.accompany.business.service.user.UsersService; import com.accompany.common.constant.Constant; import com.accompany.common.constant.SmsTypeEnum; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; @@ -125,16 +124,16 @@ public abstract class AbstractCertifyService { .eq(WithdrawUserAccount::getUid, uid) .eq(WithdrawUserAccount::getAccountType, WithdrawAccountTypeConstant.CHINA_UNION_PAY)); if (CollectionUtil.isEmpty(withdrawUserAccounts)) { - throw new AdminServiceException("请绑定大陆银联提现账户"); + throw new ServiceException(BusiStatus.CERTIFY_NEED_BOUND_MAINLAND_ACCOUNT); } WithdrawUserAccount withdrawUserAccount = withdrawUserAccounts.get(0); String name = withdrawUserAccount.getName(); String idCardNo = withdrawUserAccount.getIdCardNo(); if (StrUtil.isEmpty(name) || StrUtil.isEmpty(idCardNo)) { - throw new AdminServiceException("认证身份信息与绑定的提现账户身份信息不同"); + throw new ServiceException(BusiStatus.CERTIFY_ACCOUNT_NOT_MATCH_REAL_NAME); } if (!name.equals(username) || !idCardNo.equals(identityNumber)) { - throw new AdminServiceException("认证身份信息与绑定的提现账户身份信息不同"); + throw new ServiceException(BusiStatus.CERTIFY_ACCOUNT_NOT_MATCH_REAL_NAME); } String userCountStr = jedisService.hget(RedisKey.certify_user_count.getKey(DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN)), String.valueOf(uid)); int certificationCount = sysConfService.getIntValueById(Constant.SysConfId.CERTIFICATION_COUNT); @@ -142,7 +141,7 @@ public abstract class AbstractCertifyService { certificationCount = 5; } if (StrUtil.isNotEmpty(userCountStr) && Integer.parseInt(userCountStr) >= certificationCount) { - throw new AdminServiceException("超过当日最大认证次数,请明天再试"); + throw new ServiceException(BusiStatus.CERTIFY_OVER_TODAY_CERTIFY_MAX_TIMES); } verify(usersService.getUsersByUid(uid), phone, code, identityNumber); } @@ -158,21 +157,21 @@ public abstract class AbstractCertifyService { */ protected void verify(Users users, String phone, String code, String identityNumber) { if (users == null) { - throw new AdminServiceException(BusiStatus.USERNOTEXISTS); + throw new ServiceException(BusiStatus.USERNOTEXISTS); } //验证码验证 boolean verify = smsService.verifySmsCode(phone, code); if (!verify) { - throw new AdminServiceException(BusiStatus.SMSCODEERROR); + throw new ServiceException(BusiStatus.SMSCODEERROR); } //身份证绑定账号验证 String bindAccount = jedisService.hget(RedisKey.id_card_bind_user_count.getKey(), identityNumber); if (StrUtil.isNotEmpty(bindAccount) && Integer.parseInt(bindAccount) >= Constant.usersCertification.ID_CARD_BIND_USER_LIMIT) { - throw new AdminServiceException(BusiStatus.ID_CARD_BIND_LIMIT); + throw new ServiceException(BusiStatus.ID_CARD_BIND_LIMIT); } // 2020-03-04 实名认证修改次数超过限制,实名认证后,用户有一次修改认证信息的机会 if (users.getCertifyModifyTimes() != null && users.getCertifyModifyTimes() >= 1) { - throw new AdminServiceException(BusiStatus.MODIFY_BIND_TIMES_LIMITS); + throw new ServiceException(BusiStatus.MODIFY_BIND_TIMES_LIMITS); } } @@ -228,7 +227,7 @@ public abstract class AbstractCertifyService { example.createCriteria().andUidEqualTo(uid).andTokenEqualTo(token); List records = userCertifyRecordMapper.selectByExample(example); if (CollectionUtil.isEmpty(records)) { - throw new AdminServiceException(BusiStatus.NOTEXISTS); + throw new ServiceException(BusiStatus.NOTEXISTS); } return records.get(0); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java index 7dd13ab5b..a059fd52d 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/FinancialFaceVerifyService.java @@ -10,11 +10,12 @@ import com.accompany.business.mybatismapper.withdraw.WithdrawUserAccountMapper; import com.accompany.business.service.certification.aliyun.FinancialFaceVerify; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; +import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DESUtils; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.DeviceInfoContextHolder; +import com.accompany.core.exception.ServiceException; import com.accompany.core.util.KeyStore; import com.aliyun.cloudauth20190307.models.DescribeFaceVerifyResponse; import com.aliyun.cloudauth20190307.models.InitFaceVerifyResponse; @@ -57,7 +58,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { log.info("username : {}, identityNumber : {}, phone : {}", username, identityNumber, phone); } catch (Exception e) { log.error("解密信息时出现异常", e); - throw new AdminServiceException("解密異常"); + throw new ServiceException(BusiStatus.CERTIFY_FAIL); } DeviceInfo deviceInfo = DeviceInfoContextHolder.get(); String deviceId = deviceInfo.getDeviceId(); @@ -68,7 +69,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { String ticket = record.getTicket(); InitFaceVerifyResponse.InitFaceVerifyResponseResultObject result = financialFaceVerify.initFaceVerify(ticket, username, identityNumber, returnUrl, metaInfo, phone, ipAddress, uid, certType, deviceId); if (result == null) { - throw new AdminServiceException("认证失败"); + throw new ServiceException(BusiStatus.CERTIFY_FAIL); } String certifyId = result.getCertifyId(); record.setToken(certifyId); @@ -84,7 +85,7 @@ public class FinancialFaceVerifyService extends AbstractCertifyService { DescribeFaceVerifyResponse.DescribeFaceVerifyResponseResultObject responseResultObject = financialFaceVerify.describeFaceVerify(certifyId); if (responseResultObject == null) { log.error("callback responseResultObject is null, uid : {}, certifyId : {}, certType : {}, deviceId : {}", uid, certifyId, certType, deviceId); - throw new AdminServiceException("认证失败"); + throw new ServiceException(BusiStatus.CERTIFY_FAIL); } String passed = responseResultObject.getPassed(); updateCertifyResult(uid, certifyId, certType, passed.getBytes()[0], CERTIFY_RESULT_FOR_SUCCESS.equals(passed)); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java index 2490e9297..7b2539d09 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/certification/aliyun/FinancialFaceVerify.java @@ -1,7 +1,7 @@ package com.accompany.business.service.certification.aliyun; import com.accompany.common.config.AliYunFinancialFaceConfig; -import com.accompany.core.exception.AdminServiceException; +import com.accompany.core.exception.ServiceException; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.aliyun.cloudauth20190307.models.DescribeFaceVerifyRequest; @@ -49,7 +49,7 @@ public class FinancialFaceVerify { if (String.valueOf(HttpStatus.OK.value()).equals(response.getCode())) { return response.getResultObject(); } else { - throw new AdminServiceException(Integer.parseInt(response.getCode()), response.getMessage()); + throw new ServiceException(response.getMessage()); } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java index 07e0a2764..9f6efeb10 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/charge/FirstChargeRewardService.java @@ -30,7 +30,6 @@ import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; @@ -187,7 +186,7 @@ public class FirstChargeRewardService extends BaseService { private LimitFirstChargeConfig getLimitFirstChargeRewardConfig() { String result = sysConfService.getSysConfValueById(Constant.SysConfId.LIMIT_FIRST_CHARGE_REWARD); if (StringUtils.isBlank(result)) { - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } LimitFirstChargeConfig config = JSONObject.parseObject(result, LimitFirstChargeConfig.class); return config; @@ -196,7 +195,7 @@ public class FirstChargeRewardService extends BaseService { public FirstChargeRewardConfigVo getFirstChargeRewardConfig() { String result = sysConfService.getSysConfValueById(Constant.SysConfId.FIRST_CHARGE_REWARD); if (StringUtils.isBlank(result)) { - throw new AdminServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); + throw new ServiceException(BusiStatus.ALREADY_NOTEXISTS_CONFIG); } return JSONObject.parseObject(result, FirstChargeRewardConfigVo.class); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java index 1a3c7582e..1b2e3b87e 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/chat/impl/PrivateChatServiceImpl.java @@ -3,10 +3,11 @@ package com.accompany.business.service.chat.impl; import com.accompany.business.dto.chat.PrivateChatNumberLimitConfig; import com.accompany.business.service.chat.PrivateChatService; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; +import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.UidContextHolder; +import com.accompany.core.exception.ServiceException; import com.accompany.core.service.SysConfService; import com.accompany.core.service.common.JedisService; import com.accompany.sharding.mapper.UserChatMsgRecordMapper; @@ -46,10 +47,10 @@ public class PrivateChatServiceImpl implements PrivateChatService { Date now = new Date(); Long fromUid = UidContextHolder.get(); if (fromUid == null) { - throw new AdminServiceException("缺少用户ID"); + throw new ServiceException(BusiStatus.USER_NOT_EXISTED); } if (jedisService.exits(RedisKey.user_private_chat.getKey(fromUid.toString()))) { - throw new AdminServiceException("消息发送过于频繁,请稍后再试"); + throw new ServiceException(BusiStatus.SERVERBUSY); } String yearMonth = DateTimeUtil.convertDate(new Date(), DateTimeUtil.DATE_FORMAT_YEAR_MONTH); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java index 6a3ae94b9..be434c3a3 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/DynamicService.java @@ -19,7 +19,6 @@ import com.accompany.business.service.world.WorldService; import com.accompany.business.util.VipUtil; import com.accompany.business.vo.RoomVo; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.*; @@ -196,7 +195,7 @@ public class DynamicService extends CommunityBaseService { Dynamic dynamic = getDynamic(shareVo.getDynamicId()); validDynamic(dynamic); if (!shareVo.getWorldId().equals(dynamic.getWorldId()) || !shareVo.getUid().equals(dynamic.getUid())){ - throw new AdminServiceException(BusiStatus.PARAMERROR); + throw new ServiceException(BusiStatus.PARAMERROR); } DynamicShare share = BeanMapper.map(shareVo, DynamicShare.class); share.setCreateTime(new Date()); @@ -240,7 +239,7 @@ public class DynamicService extends CommunityBaseService { String lockVal = null; LikeStatusEnum statusEnum = LikeStatusEnum.getEnumByValue(likeVo.getStatus()); if (statusEnum == null){ - throw new AdminServiceException(BusiStatus.PARAMERROR); + throw new ServiceException(BusiStatus.PARAMERROR); } //动态状态校验 Dynamic dynamic = getDynamic(likeVo.getDynamicId()); @@ -250,7 +249,7 @@ public class DynamicService extends CommunityBaseService { lockVal = jedisLockService.lock(lockKey, 10 * 1000); if (BlankUtil.isBlank(lockVal)){ logger.error("request too fast, uid = {}", likeVo.getUid()); - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } DynamicLike likeOld = iDynamicLikeService.getUniqueRecord(likeVo.getDynamicId(), likeVo.getUid()); //如果没有点赞记录,第一条必须是点赞 @@ -268,12 +267,12 @@ public class DynamicService extends CommunityBaseService { like.setUpdateTime(new Date()); return iDynamicLikeService.insertLike(like); } else { - throw new AdminServiceException(BusiStatus.ACT_WISH_NOEXIST); + throw new ServiceException(BusiStatus.ACT_WISH_NOEXIST); } } //判断是否重复点赞/取消 if (likeVo.getStatus().equals(likeOld.getStatus())) { - throw new AdminServiceException(BusiStatus.ACTION_REPEAT); + throw new ServiceException(BusiStatus.ACTION_REPEAT); } likeOld.setStatus(likeVo.getStatus()); likeOld.setUpdateTime(new Date()); @@ -311,11 +310,11 @@ public class DynamicService extends CommunityBaseService { public int deleteDynamic(DynamicQuery dynamicVo){ Dynamic dynamic = getDynamic(dynamicVo.getDynamicId()); if (dynamic == null || dynamic.getStatus().equals(DynamicStatusEnum.DELETE.getValue()) || dynamic.getStatus().equals(DynamicStatusEnum.UNSHELVE)){ - throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_EXIST); + throw new ServiceException(BusiStatus.DYNAMIC_NOT_EXIST); } World world = worldService.getByIdFromCache(dynamic.getWorldId()); if ((world == null || !dynamicVo.getUid().equals(world.getOwnerUid())) && !dynamic.getUid().equals(dynamicVo.getUid())){ - throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_SELF_ACTION); + throw new ServiceException(BusiStatus.DYNAMIC_NOT_SELF_ACTION); } String lockKey = RedisKey.lock_community_dynamic_delete.getKey(dynamicVo.getUid().toString()); String lock = null; @@ -368,7 +367,7 @@ public class DynamicService extends CommunityBaseService { */ public List getMyDynamic(GetMyDynamicReq request){ if (request.getUid() == null || request.getUid() == 0){ - throw new AdminServiceException(BusiStatus.PARAMERROR); + throw new ServiceException(BusiStatus.PARAMERROR); } Users users = usersService.getUsersByUid(request.getUid()); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java index 4a605319f..28a636064 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/community/InteractiveService.java @@ -4,7 +4,6 @@ import com.accompany.business.model.UserExpand; import com.accompany.business.service.dfa.DfaService; import com.accompany.business.service.user.UserExpandService; import com.accompany.business.service.user.UsersService; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; import com.accompany.community.condition.InteractiveMsgCondition; @@ -16,6 +15,7 @@ import com.accompany.community.service.IInteractiveMsgService; import com.accompany.community.vo.DynamicResVo; import com.accompany.community.vo.InteractiveMsgCount; import com.accompany.community.vo.InteractiveMsgInfoVo; +import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Users; import com.accompany.sharding.model.DynamicComment; import com.accompany.world.entity.World; @@ -61,7 +61,7 @@ public class InteractiveService extends CommunityBaseService { InteractiveMsg interactiveMsg = new InteractiveMsg(); Dynamic dynamic = getDynamic(dynamicId); if (dynamic == null){ - throw new AdminServiceException(BusiStatus.DYNAMIC_NOT_EXIST); + throw new ServiceException(BusiStatus.DYNAMIC_NOT_EXIST); } interactiveMsg.setDynamicId(dynamicId); interactiveMsg.setActionType(actionType); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/DragonBallService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/DragonBallService.java deleted file mode 100644 index e487e0499..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/DragonBallService.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.accompany.business.service.game; - -import com.accompany.core.service.common.JedisService; -import com.accompany.common.redis.RedisKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * Created by PaperCut on 2018/7/12. - * 龙珠接口 - */ -@Service -public class DragonBallService { - private static final Logger logger = LoggerFactory.getLogger(DragonBallService.class); - - @Autowired - JedisService jedisService; - - /** - * 写入龙珠点数缓存 - * @param roomUid - * @param uid - * @param value - */ - public void put(Long roomUid, Long uid, String value) { - jedisService.hset(RedisKey.dragon_ball.getKey(roomUid.toString()), uid.toString(), value); - logger.info("Successful put dragon ball cache. RoomUid:{} uid:{} value:{}", roomUid, uid, value); - } - - /** - * 移除龙珠点数缓存 - * @param roomUid - * @param uid - */ - public void remove(Long roomUid, Long uid) { - jedisService.hdel(RedisKey.dragon_ball.getKey(roomUid.toString()), uid.toString()); - logger.info("Successful remove dragon ball cache. RoomUid:{} uid:{}", roomUid, uid); - } - - /** - * 获取龙珠点数缓存 - * @param roomUid - * @param uid - * @return - */ - public String get(Long roomUid, Long uid) { - return jedisService.hget(RedisKey.dragon_ball.getKey(roomUid.toString()), uid.toString()); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/doll/SingleDollService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/doll/SingleDollService.java deleted file mode 100644 index 6e47a5d22..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/game/doll/SingleDollService.java +++ /dev/null @@ -1,942 +0,0 @@ -package com.accompany.business.service.game.doll; - -import com.accompany.business.model.UserDoll; -import com.accompany.business.model.UserDollExample; -import com.accompany.business.model.UserDollRecord; -import com.accompany.business.model.UserDollRecordExample; -import com.accompany.business.mybatismapper.UserDollMapper; -import com.accompany.business.mybatismapper.UserDollRecordMapper; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.user.UsersService; -import com.accompany.business.vo.*; -import com.accompany.common.constant.ApplicationConstant; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.GameConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.model.Account; -import com.accompany.core.model.Users; -import com.accompany.core.service.account.AccountService; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.service.common.JedisService; -import com.accompany.business.vo.user.UserInfo; -import com.accompany.core.vo.UserVo; -import com.google.common.collect.Lists; -import com.google.common.reflect.TypeToken; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.lang.reflect.Type; -import java.util.*; -import java.util.concurrent.ThreadLocalRandom; - -/** - *单身娃娃相关业务逻辑 - */ -@Service -public class SingleDollService extends BaseService{ - - private static final Logger logger = LoggerFactory.getLogger(SingleDollService.class); - - private static double INCREASE = 1.0; - @Autowired - private UserDollMapper userDollMapper; - - @Autowired - private AccountService accountService; - - @Autowired - private UsersService usersService; - - @Autowired - private UserDollRecordMapper userDollRecordMapper; - - @Autowired - private JedisService jedisService; - - @Autowired - private SendSysMsgService sendSysMsgService; - - /** - * 获取用户信息 - */ - public BusiResult getUserInfo(Long uid, UserInfo userInfo, Byte platform, String ipAddress) throws Exception { - if(GameConstant.PlatformType.WEIXIN.equals(platform)) { - String weixin_unionid = userInfo.getUnionid(); - Account account = accountService.getAcountByWeixinUnionId(weixin_unionid); - if(account == null) { - // 如果用户微信在轻寻没有账户信息,则重新生成新的账户信息,头像和昵称以用户为主 - account = accountService.initAccount(weixin_unionid, ipAddress); - } - uid = account.getUid(); - } - Users user = usersService.getUsersByUid(uid); - UserVo response = new UserVo(); - if(user == null) { - // 通过上述方式或没补全资料的用户在users表不存在数据,此时返回的userVo以用户的微信头像和昵称为主 - response.setUid(uid); - response.setAvatar(userInfo.getHeadimgurl()); - response.setNick(userInfo.getNickname()); - }else { - response.setUid(user.getUid()); - response.setAvatar(user.getAvatar()); - response.setNick(user.getNick()); - } - BusiResult busiResult = new BusiResult<>(BusiStatus.SUCCESS); - busiResult.setData(response); - return busiResult; - } - - - /** - *查询用户单身娃娃相关的信息 - * @throws Exception - */ - public BusiResult queryUserDoll(Long uid){ - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - UserDoll userDoll = this.getUserDollByUid(uid); - if(userDoll == null) { - //不存在娃娃信息 提示娃娃不存在 - return new BusiResult(BusiStatus.USER_DOLL_NOT_EXISTS); - } - UserDollVo userDollVo = this.convertToVo(userDoll); - - Integer ownerTime = this.getCatchTimes(uid); - // 获取该用户可抓取的娃娃列表 - Map map = this.getUserCanCatchDollListMap(uid); - userDollVo.setUserCanCatchMap(map); - userDollVo.setOwnerTime(ownerTime); - busiResult.setData(userDollVo); - return busiResult; - } - - - - /** - * 成为娃娃 - * @param uid - * @param sex - * @param voiceUrl - * @param inviterUid - * @return - * @throws Exception - */ - @Transactional(rollbackFor=Exception.class) - public BusiResult addUserDoll(Long uid,Byte sex,String voiceUrl,Long inviterUid,String nick,String avatar) throws Exception{ - UserDoll userDoll = this.getUserDollByUid(uid); - BusiResult busiResult = null; - if(userDoll != null) { - //娃娃存在 提示娃娃存在 - busiResult = new BusiResult(BusiStatus.USER_DOLL_EXISTS); - }else {//添加娃娃 - busiResult = new BusiResult(BusiStatus.SUCCESS); - //性别检查 - if((!Constant.SexType.male.equals(sex) && !Constant.SexType.female.equals(sex)) || sex == null){ - busiResult = new BusiResult(BusiStatus.USER_DOLL_SEX_ERROR); - return busiResult; - } - - userDoll = new UserDoll(); - userDoll.setUid(uid); - userDoll.setSex(sex); - userDoll.setCreateTime(new Date()); - userDoll.setUpdateTime(new Date()); - userDoll.setVoice(voiceUrl); - userDoll.setNick(nick); - userDoll.setAvatar(avatar); - userDoll.setLikeCount(0); - userDoll.setBed(Constant.BED_INIT); //初始床位 - userDoll.setInviteUid(inviterUid); - if(inviterUid != null && inviterUid != 0) { - Users inviteUser = usersService.getUsersByUid(inviterUid); - UserDoll inviteUserDoll = this.getUserDollByUid(inviterUid); - if(inviteUser != null && inviteUserDoll != null){ - // 如果存在邀请人就填写 邀请人信息 - userDoll.setInviteUid(inviterUid); - // 添加对应的邀请者次数 - this.updateSpecialTime(inviterUid,10); - - } - } - UserDollVo userDollVo = this.convertToVo(userDoll); - Map map = this.getUserCanCatchDollListMap(uid); - userDollVo.setUserCanCatchMap(map); - Integer ownerTime = this.getCatchTimes(uid); - userDollVo.setOwnerTime(ownerTime); - - // 添加记录 - this.insertCustomDollRecord(uid,inviterUid,sex); - userDollMapper.insert(userDoll); - this.saveUserDollCache(userDoll); - busiResult.setData(userDollVo); - } - - return busiResult; - } - - - /** - *抓娃娃 - */ - @Transactional(rollbackFor=Exception.class) - public BusiResult cacthUserDoll(Long uid,Byte goalStatus,Byte sex) throws Exception{ - - UserDoll userDoll = this.getUserDollByUid(uid); - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - Integer userCatchTime = this.getCatchTimes(uid); - - if(userDoll == null){ - return new BusiResult(BusiStatus.USER_DOLL_NOT_EXISTS); - } - - if(userCatchTime <= 0){ - return new BusiResult(BusiStatus.CATCH_DOLL_TIMES_NOT_ENOUGH); - } - logger.info("catch userDoll params:uid={},goalStatus={},sex={}",uid,goalStatus,sex); - if(GameConstant.CatchResult.GOAL.equals(goalStatus)){ - // 夹中娃娃 - // 获取抓取的娃娃列表 - String catchListStr = jedisService.hget(RedisKey.user_doll_catch_list.getKey(sex+""),uid.toString()); - UserDollExample userDollExample = new UserDollExample(); - UserDollExample.Criteria criteria = userDollExample.createCriteria(); - criteria.andSexEqualTo(sex); - if(!BlankUtil.isBlank(catchListStr) && !ApplicationConstant.NULL_JSON_OBJECT.equals(catchListStr)){ - Type type = new TypeToken>() {}.getType(); - List catchUidList = gson.fromJson(catchListStr,type); - if(userDoll.getSex().equals(sex)){ - catchUidList.add(uid); - } - criteria.andUidNotIn(catchUidList); - } - userDollExample.setOrderByClause("create_time desc"); - // 获取没被抓到的娃娃列表 - List dollList = userDollMapper.selectByExample(userDollExample); - if(CollectionUtils.isEmpty(dollList)){ - // 没有抓到的娃娃,这里应该是打印error还是info呢? - logger.error("catch doll failed caused by cannot find doll suitable for catching,uid={},sex={}",uid,sex); - return new BusiResult(BusiStatus.CATCH_DOLL_FAILD); - } - - // 减少娃娃机抓取次数 - Integer catchTime = this.reduceCatchTimes(uid); - // 获取随机数的索引用作获取娃娃 - int randomId = ThreadLocalRandom.current().nextInt(dollList.size()); - // 获取抓到的娃娃 - UserDoll catchUserDoll = dollList.get(randomId); - logger.info("success get the catched doll,catchedDollUid={},leftTimes={}",catchUserDoll.getUid(),catchTime); - // 插入抓到的初始记录 - UserDollRecord userDollRecord = new UserDollRecord(); - userDollRecord.setCreateTime(new Date()); - userDollRecord.setOptType(GameConstant.UserDollOptType.CATCH); - userDollRecord.setTargetUid(catchUserDoll.getUid()); - userDollRecord.setUid(uid); - userDollRecordMapper.insertSelective(userDollRecord); - Long recordId = userDollRecord.getRecordId(); - // 组装返回的数据 - DollCatchedVo dollCatchedVo = new DollCatchedVo(); - dollCatchedVo.setRecordId(recordId); - dollCatchedVo.setCatchUserDoll(catchUserDoll); - dollCatchedVo.setCatchTimes(catchTime); - - busiResult.setData(dollCatchedVo); - - return busiResult; - }else { - // 没夹中 - // 减少娃娃机抓取次数 - Integer catchTime = this.reduceCatchTimes(uid); - logger.info("failed catch the doll,just reduce times,times={}",catchTime); - UserDollRecord userDollRecord = new UserDollRecord(); - userDollRecord.setCreateTime(new Date()); - userDollRecord.setOptType(GameConstant.UserDollOptType.CATCH); - userDollRecord.setUid(uid); - DollCatchedVo dollCatchedVo = new DollCatchedVo(); - dollCatchedVo.setCatchTimes(catchTime); - busiResult.setData(dollCatchedVo); - return busiResult; - } - } - - - /** - *抓娃娃处理 1是放弃 2是喜欢 - */ - - public BusiResult dealDoll(Long uid,Long recordId,Byte dealType,Long targetUid) { - - UserDoll targetUserDoll = this.getUserDollByUid(targetUid); - UserDoll userDoll = this.getUserDollByUid(uid); - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - if(targetUserDoll == null){ - return new BusiResult(BusiStatus.CATCH_DOLL_NOT_EXIST); - } - - if(userDoll == null){ - return new BusiResult(BusiStatus.USER_DOLL_NOT_EXISTS); - } - - // 根据recordId找到记录并修改 - UserDollRecord userDollRecord = userDollRecordMapper.selectByPrimaryKey(recordId); - if(userDollRecord == null || userDollRecord.getDealType() != null){ - return new BusiResult(BusiStatus.CATCH_DOLL_DEAL_TYPE_ERROR); - } - userDollRecord.setDealType(dealType); - userDollRecordMapper.updateByPrimaryKeySelective(userDollRecord); - - // 添加喜欢次数和修改娃娃排行榜缓存 - if(GameConstant.UserDollDealType.LIKE.equals(dealType)){ - this.addUserDollLikeCount(targetUserDoll); - //发送私聊的方法 - this.sendUserDollMsg(uid,targetUid,"在娃娃機中一眼看中你,你的聲音很好聽,我想認識你"); - - Byte targetUserDollSex = targetUserDoll.getSex(); - List catchDollList = null; - // 添加被抓用户至用户抓到的列表中 - String catchDollListStr = jedisService.hget(RedisKey.user_doll_catch_list.getKey(targetUserDollSex.toString()),uid.toString()); - if(!BlankUtil.isBlank(catchDollListStr) && !ApplicationConstant.NULL_JSON_OBJECT.equals(catchDollListStr)){ - Type type = new TypeToken>() {}.getType(); - catchDollList = gson.fromJson(catchDollListStr,type); - catchDollList.add(targetUserDoll.getUid()); - }else{ - catchDollList = Lists.newArrayList(); - catchDollList.add(targetUserDoll.getUid()); - } - jedisService.hset(RedisKey.user_doll_catch_list.getKey(targetUserDollSex.toString()),uid.toString(),gson.toJson(catchDollList)); - } - - - - // 返回次数 - UserDollVo userDollVo = this.convertToVo(userDoll); - Integer ownerTime = this.getCatchTimes(uid); - userDollVo.setOwnerTime(ownerTime); - Map canCatchDollMap = getUserCanCatchDollListMap(uid); - userDollVo.setUserCanCatchMap(canCatchDollMap); - - busiResult.setData(userDollVo); - return busiResult; - } - - - /** - * 被邀请人点击爱心或者普通链接,邀请者添加床位或者抓取次数 - * @param inviterUid 邀请者 - * @param uid 被邀请者 - * @param linkType 1为普通,2为爱心链接 - * @return - * @throws Exception - */ - public BusiResult clickDollLink(Long uid,Long inviterUid,Byte linkType) throws Exception { - - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - // 判断被邀请人是否存在 - Users users = this.usersService.getUsersByUid(uid); - if(users == null){ - return new BusiResult(BusiStatus.USERNOTEXISTS); - } - // 添加判断是否存在记录 - Boolean repeatBol = false; - UserDollRecordExample example = new UserDollRecordExample(); - UserDollRecordExample.Criteria criteria = example.createCriteria(); - criteria.andOptTypeEqualTo(GameConstant.UserDollOptType.CLICK).andLinkTypeEqualTo(linkType).andUidEqualTo(uid).andTargetUidEqualTo(inviterUid); - List list = userDollRecordMapper.selectByExample(example); - if(list.size() > 0){ - repeatBol = true; - } - - - // 判断邀请人娃娃是否存在 - if(inviterUid != null){ - UserDoll shareUserDoll = this.getUserDollByUid(uid); - if(shareUserDoll == null){ - return new BusiResult(BusiStatus.USER_DOLL_NOT_EXISTS); - } - // 插入点击记录 - int result = this.insertShareClickRecord(uid,inviterUid,linkType); - - // 根据点击链接的类型给邀请者添加床位或者抓娃娃次数 - if(result > 0 && !repeatBol){ - if(GameConstant.UserDollLinkType.SINGLE_LINK.equals(linkType)) { - this.updateSpecialTime(inviterUid,10); - }else if(GameConstant.UserDollLinkType.LOVE_LINK.equals(linkType)){ - Integer times = shareUserDoll.getBed() + 5; - shareUserDoll.setBed(times); - updateUserDollFromDBAndCache(shareUserDoll); - } - }else{ - logger.error("insert userdoll click record failed,uid={},inviterUid={},linkType={}",uid,inviterUid,linkType); - } - } - return busiResult; - } - - /** - *喜欢我的 - */ - public BusiResult queryLikedMeData(Long uid,int page,int pageSize) { - UserDoll userDoll = this.getUserDollByUid(uid); - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - if(userDoll != null) { - DollILIkedDataVo dataVo = new DollILIkedDataVo(); - dataVo.setCount(userDoll.getLikeCount()); - dataVo.setNeedBed(userDoll.getBed()); - -// double totalPage = Math.ceil(userDoll.getBed()/pageSize); -// if(page > totalPage){ -// // 如果大于总页数 -// return new BusiResult(BusiStatus.BED_NOT_ENOUGH); -// } - - int start = (page-1)*pageSize; - - UserDollRecordExample example = new UserDollRecordExample(); - UserDollRecordExample.Criteria criteria = example.createCriteria(); - example.setLimit(pageSize); - example.setOffset(start); - example.setOrderByClause("create_time desc"); - criteria.andTargetUidEqualTo(uid).andOptTypeEqualTo(GameConstant.UserDollOptType.CATCH).andDealTypeEqualTo(GameConstant.UserDollDealType.LIKE); - List list = userDollRecordMapper.selectByExample(example); - if(CollectionUtils.isEmpty(list)){ - list = Lists.newArrayList(); - busiResult.setData(list); - return busiResult; - } - List dataList = convertLikedMeList(list); - busiResult.setData(dataList); - }else { - //不存在娃娃信息 提示娃娃不存在 - busiResult.setCode(BusiStatus.USER_DOLL_NOT_EXISTS.value()); - } - - return busiResult; - } - - /** - * 获取关于娃娃的记录列表(我抓到的和我喜欢的和爱心记录) - * @param uid - * @param page - * @param pageSize - * @param type 1为我喜欢的,2为我抓到的,3为爱心记录表 - * @return - */ - public BusiResult queryRecordList(Long uid,int page,int pageSize,Integer type){ - UserDoll userDoll = this.getUserDollByUid(uid); - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - if(userDoll == null){ - return new BusiResult(BusiStatus.USER_DOLL_NOT_EXISTS); - } - - int start = (page-1)*pageSize; - UserDollRecordExample example = new UserDollRecordExample(); - UserDollRecordExample.Criteria criteria = example.createCriteria(); - example.setOrderByClause("create_time desc"); - example.setLimit(pageSize); - example.setOffset(start); - if(type == 1){ - criteria.andOptTypeEqualTo(GameConstant.UserDollOptType.CATCH).andUidEqualTo(uid).andDealTypeEqualTo(GameConstant.UserDollDealType.LIKE); - }else if(type == 2){ - criteria.andUidEqualTo(uid).andOptTypeEqualTo(GameConstant.UserDollOptType.CATCH); - }else{ - criteria.andTargetUidEqualTo(uid).andOptTypeNotEqualTo(GameConstant.UserDollOptType.CATCH); - } - - List list = userDollRecordMapper.selectByExample(example); - if(CollectionUtils.isEmpty(list)){ - list = Lists.newArrayList(); - busiResult.setData(list); - return busiResult; - } - - if(type == 3){ - List dataList = this.getRecordList(list); - busiResult.setData(dataList); - }else{ - List dataList = this.getCommonList(list); - busiResult.setData(dataList); - } - - return busiResult; - } - - /** - * 用户分享后回调判断是否符合条件并添加特殊抓娃娃数 - * @param uid - */ - public void updateSpecialTimeByShare(Long uid) throws Exception{ - String todayStr = DateTimeUtil.getTodayStr(); - Date expireDate = DateTimeUtil.getNextDay(new Date(),2); - Long expireTime = expireDate.getTime(); - Double result = jedisService.zincrby(RedisKey.user_doll_special_time.getKey(todayStr), 1.0, uid.toString()); - jedisService.pexpireAt(RedisKey.user_doll_special_time.getKey(todayStr),expireTime); - if(result == 1.0){ - logger.info("user has share url and update special time,uid={}",uid); - this.updateSpecialTime(uid,5); - } - } -// /** -// * 我邀请的排行榜 -// */ -// public BusiResult queryInviteRank(Long uid) { -//// Long uid = getUidByPlatform(platform,weixin_unionid); -// if(uid == null){ -// return new BusiResult<>(BusiStatus.PARAMERROR); -// } -// -// UserDoll userDoll = userDollMapper.selectByPrimaryKey(uid); -// BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); -// if(userDoll != null) { -// List dataList = userDollExpand.queryInviteRank(2,30); -// -// DollILIkedDataVo dataVo = new DollILIkedDataVo(); -// dataVo.setDataList(dataList); -// busiResult.setData(dataVo); -// -// }else { -// //不存在娃娃信息 提示娃娃不存在 -// busiResult.setCode(BusiStatus.USER_DOLL_NOT_EXISTS.value()); -// } -// -// return busiResult; -// } - - /** - * 娃娃喜欢次数的排行榜 - */ - public BusiResult queryLikeRank(Long uid) throws Exception{ - BusiResult busiResult = new BusiResult(BusiStatus.SUCCESS); - DollILikedVo mineRankVo = new DollILikedVo(); - - Set> rankings = jedisService.zrevrange(RedisKey.user_doll_liked_rank.getKey(),0L,29L); - List list = this.buildRankList(rankings,RedisKey.user_doll_liked_rank.getKey()); - - DollLikeRankVo dollLikeRankVo = new DollLikeRankVo(); - if(uid != null && uid != 0){ - mineRankVo = selectMine(uid,list); - } - if(CollectionUtils.isEmpty(list)){ - list = Lists.newArrayList(); - } - dollLikeRankVo.setList(list); - dollLikeRankVo.setMine(mineRankVo); - busiResult.setData(dollLikeRankVo); - return busiResult; - } - - - - /** - *获得今日整点 也就是更新时间 - */ - private Calendar getTodayZero() { - Calendar c = Calendar.getInstance(); - c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DATE), 0, 0, 0); - return c; - } - - private void saveUserDollCache(UserDoll userDoll){ - jedisService.hset(RedisKey.user_doll.getKey(),userDoll.getUid().toString(),gson.toJson(userDoll)); - } - - private UserDoll updateUserDollFromDBAndCache(UserDoll userDoll){ - userDollMapper.updateByPrimaryKey(userDoll); - this.saveUserDollCache(userDoll); - return userDoll; - } - - private UserDoll getUserDollByUid(Long uid){ - String userDollStr = jedisService.hget(RedisKey.user_doll.getKey(),uid.toString()); - if(BlankUtil.isBlank(userDollStr)){ - UserDoll userDoll = userDollMapper.selectByPrimaryKey(uid); - if(userDoll == null){ - return null; - }else{ - saveUserDollCache(userDoll); - return userDoll; - } - } - return gson.fromJson(userDollStr,UserDoll.class); - } - - private Long getUidByPlatform(Integer platform,String uidStr){ - Long uid = null; - if(platform == 2) { //微信接口 - Account account = accountService.getAcountByWeixinUnionId(uidStr); - if(account != null) { - uid = account.getUid(); - } - }else { - uid = Long.valueOf(uidStr); - Users users = usersService.getUsersByUid(uid); - if(users == null){ - uid = null; - } - } - return uid; - } - - // 转换喜欢我的的列表 - private List convertLikedMeList(List list){ - List dataList = Lists.newArrayList(); - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - for(UserDollRecord userDollRecord:list){ - DollILikedVo dollILikedVo = new DollILikedVo(); -// Users users = usersService.getUsersByUid(userDollRecord.getUid()); - UserDoll userDoll = this.getUserDollByUid(userDollRecord.getUid()); - dollILikedVo.setAvatar(userDoll.getAvatar()); - dollILikedVo.setNick(userDoll.getNick()); - dollILikedVo.setUid(userDoll.getUid()); - dollILikedVo.setSex(userDoll.getSex()); - dataList.add(dollILikedVo); - } - return dataList; - } - - // 获取对应的列表后重新整合得到对应的用户信息列表 - private List getCommonList(List list){ - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - List dataList = Lists.newArrayList(); - for(UserDollRecord userDollRecord:list){ - DollILikedVo dollILikedVo = new DollILikedVo(); -// Users users = usersService.getUsersByUid(userDollRecord.getTargetUid()); - UserDoll userDoll = this.getUserDollByUid(userDollRecord.getTargetUid()); - dollILikedVo.setAvatar(userDoll.getAvatar()); - dollILikedVo.setNick(userDoll.getNick()); - dollILikedVo.setUid(userDoll.getUid()); - dollILikedVo.setCount(userDoll.getLikeCount()); - dollILikedVo.setVoice(userDoll.getVoice()); - dollILikedVo.setSex(userDoll.getSex()); - dataList.add(dollILikedVo); - } - return dataList; - } - - private List getRecordList(List list){ - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - List dataList = Lists.newArrayList(); - for(UserDollRecord userDollRecord:list){ - UserDollRecordVo userDollRecordVo = new UserDollRecordVo(); - -// Users users = usersService.getUsersByUid(userDollRecord.getUid()); - - - UserDoll userDoll = this.getUserDollByUid(userDollRecord.getUid()); - userDollRecordVo.setDollGender(userDoll.getSex()); - userDollRecordVo.setAvatar(userDoll.getAvatar()); - userDollRecordVo.setNick(userDoll.getNick()); - userDollRecordVo.setUserGender(userDoll.getSex()); - - userDollRecordVo.setDealType(userDollRecord.getDealType()); - userDollRecordVo.setOptType(userDollRecord.getOptType()); - userDollRecordVo.setCreateTime(userDollRecord.getCreateTime()); - - dataList.add(userDollRecordVo); - } - return dataList; - } - - - - // 获取点击喜欢的记录列表 - private List getLoveRecordList(List list){ - if(CollectionUtils.isEmpty(list)){ - return Lists.newArrayList(); - } - for(UserDollRecordVo userDollRecordVo :list){ - Users users = usersService.getUsersByUid(userDollRecordVo.getUid()); - userDollRecordVo.setAvatar(users.getAvatar()); - userDollRecordVo.setNick(users.getNick()); - } - return list; - } - - // 添加娃娃的喜欢次数 - private UserDoll addUserDollLikeCount(UserDoll userDoll){ - Integer likeCount = userDoll.getLikeCount() + 1; - userDoll.setLikeCount(likeCount); - updateUserDollFromDBAndCache(userDoll); -// userDollMapper.updateByPrimaryKey(userDoll); - jedisService.zincrby(RedisKey.user_doll_liked_rank.getKey(),INCREASE,userDoll.getUid().toString()); - return userDoll; - } - - private List buildRankList(Set> rankings,String key){ - List uids = Lists.newArrayList(); - for(Map ranking:rankings){ - String uid = (String)ranking.get("member"); - uids.add(uid); - } - String[] uidArray = new String[uids.size()]; - uids.toArray(uidArray); - -// Map usersMap = usersService.getUsersMapBatch(uidArray); - List list = Lists.newArrayList(); - for(Map ranking:rankings){ - Long uid = Long.parseLong((String)ranking.get("member")); - Integer score = ((Double) ranking.get("score")).intValue(); - Integer rankNum = getRankNum(uid,key) + 1; - DollILikedVo dollILikedVo = new DollILikedVo(); - dollILikedVo.setUid(uid); - dollILikedVo.setCount(score); - dollILikedVo.setRankNum(rankNum); - - -// Users users = usersMap.get(uid); - UserDoll userDoll = this.getUserDollByUid(uid); - - if(userDoll != null){ - dollILikedVo.setNick(userDoll.getNick()); - dollILikedVo.setAvatar(userDoll.getAvatar()); - dollILikedVo.setSex(userDoll.getSex()); - } - list.add(dollILikedVo); - } - return list; - } - - private Integer getRankNum(Long uid,String key){ - return jedisService.zrevrank(key,uid.toString()).intValue(); - } - - private DollILikedVo selectMine(Long uid,List list){ - DollILikedVo dollILikedVo = new DollILikedVo(); -// Users users = usersService.getUsersByUid(uid); -// dollILikedVo.setAvatar(users.getAvatar()); -// dollILikedVo.setNick(users.getNick()); - for(DollILikedVo single:list){ - if(uid.equals(single.getUid())){ -// dollILikedVo.setRankNum(single.getRankNum()); -// dollILikedVo.setCount(single.getCount()); - dollILikedVo = single; - break; - } - } - return dollILikedVo; - } - - public void reloadRank(){ - String key = RedisKey.user_doll_liked_rank.getKey(); - UserDollExample example = new UserDollExample(); - UserDollExample.Criteria criteria = example.createCriteria(); - example.setOrderByClause("like_count desc"); - List list = userDollMapper.selectByExample(example); - if(!CollectionUtils.isEmpty(list)){ - jedisService.del(key); - for(UserDoll userDoll:list){ - Long uid = userDoll.getUid(); - Integer likeCount = userDoll.getLikeCount(); - jedisService.zincrby(key,Double.valueOf(likeCount),uid.toString()); - } - } - - } - - /** - * 获取当天的夹娃娃次数 - * @param uid - * @return - */ - private Integer getCatchTimes(Long uid){ - Integer totalTime = 0; - Integer singleTime = this.getSingleTime(uid); - Integer specialTime = this.getSpecialTime(uid); - totalTime = specialTime + singleTime; - return totalTime; - } - - private Integer getSingleTime(Long uid){ - Integer singleTime = 0; - // 获取普通次数 - String todayStr = DateTimeUtil.getTodayStr(); - String singleTimeStr = jedisService.hget(RedisKey.user_doll_single_time.getKey(todayStr),uid.toString()); - if(BlankUtil.isBlank(singleTimeStr) || singleTimeStr.equalsIgnoreCase(ApplicationConstant.NULL_JSON_OBJECT)){ - // 如果不存在今天的次数,则重新生成 - singleTime = updateSingleTime(uid); - }else{ - singleTime = Integer.valueOf(singleTimeStr); - } - return singleTime; - } - - private Integer getSpecialTime(Long uid){ - Integer specialTime = 0; - // 获取特殊次数 - String specialTimeStr = jedisService.hget(RedisKey.user_doll_special_time.getKey(),uid.toString()); - if(BlankUtil.isBlank(specialTimeStr) || specialTimeStr.equalsIgnoreCase(ApplicationConstant.NULL_JSON_OBJECT)){ - specialTime = 0; - }else{ - specialTime = Integer.valueOf(specialTimeStr); - } - return specialTime; - } - - /** - * 减少抓娃娃次数,优先减少特殊次数,其次减少正常次数 - * @param uid - * @return - */ - private Integer reduceCatchTimes(Long uid){ - Integer specialTime = this.getSpecialTime(uid); - if(specialTime > 0){ - specialTime--; - jedisService.hset(RedisKey.user_doll_special_time.getKey(),uid.toString(),specialTime.toString()); - return this.getCatchTimes(uid); - } - - Integer singleTime = this.getSingleTime(uid); - if(singleTime > 0){ - singleTime--; - String todayStr = DateTimeUtil.getTodayStr(); - jedisService.hset(RedisKey.user_doll_single_time.getKey(todayStr),uid.toString(),singleTime + ""); - return this.getCatchTimes(uid); - } - return -1; - } - - /** - * 更新用户当天的普通次数 - * @param uid - * @return - */ - private Integer updateSingleTime(Long uid){ - String todayStr = DateTimeUtil.getTodayStr(); - Integer singleTime = 20; - jedisService.hset(RedisKey.user_doll_single_time.getKey(todayStr),uid.toString(),singleTime + ""); - // 获取当天下一天的时间 - Date expireDate = DateTimeUtil.getNextDay(new Date(),1); - Long expireTime = expireDate.getTime(); - jedisService.pexpireAt(RedisKey.user_doll_single_time.getKey(todayStr),expireTime); - return singleTime; - } - - /** - * 添加抓娃娃的特殊次数 - * @param uid - * @return - */ - private Integer updateSpecialTime(Long uid,Integer times){ - Integer specialTime = 0; - String specialTimeStr = jedisService.hget(RedisKey.user_doll_special_time.getKey(),uid.toString()); - if(!BlankUtil.isBlank(specialTimeStr) && !ApplicationConstant.NULL_JSON_OBJECT.equalsIgnoreCase(specialTimeStr)){ - specialTime = Integer.valueOf(specialTimeStr); - } - specialTime += times; - jedisService.hset(RedisKey.user_doll_special_time.getKey(),uid.toString(),specialTime.toString()); - return specialTime; - } - - - private UserDollVo convertToVo(UserDoll userDoll){ - UserDollVo userDollVo = new UserDollVo(); - userDollVo.setUid(userDoll.getUid()); - userDollVo.setAvatar(userDoll.getAvatar()); - userDollVo.setNick(userDoll.getNick()); - userDollVo.setBed(userDoll.getBed()); - userDollVo.setLikeCount(userDoll.getLikeCount()); - userDollVo.setSex(userDoll.getSex()); - userDollVo.setInviteUid(userDoll.getInviteUid()); - userDollVo.setVoice(userDoll.getVoice()); - return userDollVo; - } - - /** - * 插入成为娃娃记录 - * @param uid - * @param inviterUid - * @param sex - * @return - */ - private int insertCustomDollRecord(Long uid,Long inviterUid,Byte sex){ - UserDollRecord userDollRecord = new UserDollRecord(); - userDollRecord.setUid(uid); - userDollRecord.setTargetUid(inviterUid); - userDollRecord.setOptType(GameConstant.UserDollOptType.BECOME_DOLL); - userDollRecord.setSexType(sex); - userDollRecord.setCreateTime(new Date()); - return userDollRecordMapper.insertSelective(userDollRecord); - } - - private int insertShareClickRecord(Long uid,Long inviterUid,Byte linkType){ - UserDollRecord userDollRecord = new UserDollRecord(); - userDollRecord.setUid(uid); - userDollRecord.setTargetUid(inviterUid); - userDollRecord.setOptType(GameConstant.UserDollOptType.CLICK); - userDollRecord.setLinkType(linkType); - userDollRecord.setCreateTime(new Date()); - return userDollRecordMapper.insertSelective(userDollRecord); - } - - /** - * 判断用户是否还有娃娃可抓的集合,以性别区分 - * @param uid - * @return - */ - public Map getUserCanCatchDollListMap(Long uid){ - Map totalDollMap = jedisService.hgetAll(RedisKey.user_doll.getKey()); - Map map = new HashMap<>(); - List maleList = Lists.newArrayList(); - List femaleList = Lists.newArrayList(); - if (totalDollMap != null) { - Set keySet = totalDollMap.keySet(); - for (String key : keySet) { - if (!BlankUtil.isBlank(key) && !BlankUtil.isBlank(totalDollMap.get(key))) { - UserDoll userDoll = gson.fromJson(totalDollMap.get(key),UserDoll.class); - if(userDoll.getUid().equals(uid)){ - // 过滤自己掉自己的娃娃 - continue; - } - if(Constant.SexType.male.equals(userDoll.getSex())){ - maleList.add(userDoll); - }else{ - femaleList.add(userDoll); - } - } - } - } - Integer catchFemaleDollLength = 0; - String catchFemaleDollListStr = jedisService.hget(RedisKey.user_doll_catch_list.getKey(Constant.SexType.female.toString()),uid.toString()); - if(!BlankUtil.isBlank(catchFemaleDollListStr) && !ApplicationConstant.NULL_JSON_OBJECT.equals(catchFemaleDollListStr)){ - Type type = new TypeToken>() {}.getType(); - List catchFemaleUidList = gson.fromJson(catchFemaleDollListStr,type); - catchFemaleDollLength = catchFemaleUidList.size(); - } - map.put("femaleSurplus",femaleList.size() - catchFemaleDollLength); - - Integer catchMaleDollLength = 0; - String catchMaleDollListStr = jedisService.hget(RedisKey.user_doll_catch_list.getKey(Constant.SexType.male.toString()),uid.toString()); - if(!BlankUtil.isBlank(catchMaleDollListStr) && !ApplicationConstant.NULL_JSON_OBJECT.equals(catchMaleDollListStr)){ - Type type = new TypeToken>() {}.getType(); - List catchMaleUidList = gson.fromJson(catchMaleDollListStr,type); - catchMaleDollLength = catchMaleUidList.size(); - } - map.put("maleSurplus",maleList.size() - catchMaleDollLength); - - Integer catchTotalDollNum = catchFemaleDollLength + catchMaleDollLength; - map.put("totalSurplus",catchTotalDollNum); - return map; - } - - public void sendUserDollMsg(Long fromUid,Long toUid,String message){ - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setFrom(fromUid.toString()); - neteaseSendMsgParam.setOpe(0); - neteaseSendMsgParam.setType(0); - neteaseSendMsgParam.setTo(toUid.toString()); - neteaseSendMsgParam.setBody(message); - sendSysMsgService.sendMsg(neteaseSendMsgParam); - } - -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java index e9c004ad9..c4a607ca6 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/gift/GiftSendService.java @@ -30,7 +30,6 @@ import com.accompany.business.vo.luckybag.LuckyBagGiftVo; import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; @@ -526,10 +525,10 @@ public class GiftSendService extends BaseService { Map usersMap = usersService.getUsersMapBatch(uidsArray); // 校验用户是否都存在或者收礼用户是否重复 if (!flag && usersMap.size() != recvUids.length + 1) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new ServiceException(BusiStatus.PARAMETERILLEGAL); } if (flag && usersMap.size() != recvUids.length) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new ServiceException(BusiStatus.PARAMETERILLEGAL); } Room room = null; @@ -548,7 +547,7 @@ public class GiftSendService extends BaseService { if ((gift.getGiftType() != null && gift.getGiftType() == Constant.GiftType.CARDS) || gift.getConsumeType() == Constant.GiftConsumeType.RADISH_GIFT) { - throw new AdminServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); + throw new ServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); } // 校验贵族礼物(只有面板送礼才需要校验) @@ -612,10 +611,10 @@ public class GiftSendService extends BaseService { Map usersMap = usersService.getUsersMapBatch(uidsArray); // 校验用户是否都存在或者收礼用户是否重复 if (!flag && usersMap.size() != recvUids.length + 1) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new ServiceException(BusiStatus.PARAMETERILLEGAL); } if (flag && usersMap.size() != recvUids.length) { - throw new AdminServiceException(BusiStatus.PARAMETERILLEGAL.getCode(), BusiStatus.GIFT_SEND_ERROR.getReasonPhrase()); + throw new ServiceException(BusiStatus.PARAMETERILLEGAL); } Room room = null; @@ -634,7 +633,7 @@ public class GiftSendService extends BaseService { if ((gift.getGiftType() != null && gift.getGiftType() == Constant.GiftType.CARDS) || gift.getConsumeType() == Constant.GiftConsumeType.RADISH_GIFT) { - throw new AdminServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); + throw new ServiceException(BusiStatus.GIFT_IS_NOT_ALLOWED_TO_BE_SENT); } // 校验贵族礼物(只有面板送礼才需要校验) diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mycard/impl/MyCardBizServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mycard/impl/MyCardBizServiceImpl.java index 0f58ae3f3..ff921f6fa 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mycard/impl/MyCardBizServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/mycard/impl/MyCardBizServiceImpl.java @@ -5,10 +5,10 @@ import cn.hutool.core.util.StrUtil; import com.accompany.business.service.ChargeService; import com.accompany.business.service.mycard.MyCardBizService; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.redis.RedisKey; import com.accompany.common.status.BusiStatus; import com.accompany.common.utils.DateTimeUtil; +import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Account; import com.accompany.core.service.account.AccountService; import com.accompany.payment.constant.PayChannelConstant; @@ -172,7 +172,7 @@ public class MyCardBizServiceImpl implements MyCardBizService { String hash = DigestUtils.sha256Hex(encodeHashValue).replaceAll(StrUtil.DASHED, StrUtil.EMPTY).toLowerCase(); log.info("request hash : {}, preHashValue : {}, encodeHashValue : {}, server hash : {}", callback.getHash(), preHashValue, encodeHashValue, hash); if (!hash.equals(callback.getHash())) { - throw new AdminServiceException("Hash校验失败"); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } String returnCode = callback.getReturnCode(); String chargeRecordId = callback.getFacTradeSeq(); @@ -188,12 +188,12 @@ public class MyCardBizServiceImpl implements MyCardBizService { } ChargeRecord chargeRecord = chargeRecordMapper.selectByPrimaryKey(chargeRecordId); if (chargeRecord == null) { - throw new AdminServiceException("儲值失敗"); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } String authCode = chargeRecord.getExtra(); String metadata = chargeRecord.getMetadata(); if (StrUtil.isEmpty(metadata)) { - throw new AdminServiceException("儲值失敗"); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } AuthGlobalResp authGlobalResp = JSONObject.parseObject(metadata, AuthGlobalResp.class); authGlobalResp.setReturnCode(returnCode); @@ -215,7 +215,7 @@ public class MyCardBizServiceImpl implements MyCardBizService { //厂商查询交易结果 TradeQueryResp tradeQuery = myCardService.tradeQuery(authCode); if (!tradeQuery.isSuccess()) { - throw new AdminServiceException(tradeQuery.getReturnMsg()); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } //更新订单 boolean isSuccess = updateOrder(chargeRecordId, currency, amount, myCardTradeNo); @@ -223,7 +223,7 @@ public class MyCardBizServiceImpl implements MyCardBizService { //执行请款 TradeQueryResp confirm = myCardService.paymentConfirm(authCode); if (!confirm.isSuccess()) { - throw new AdminServiceException(confirm.getReturnMsg()); + throw new ServiceException(BusiStatus.PAYMENT_FAIL); } } return isSuccess ? successUrl : failureUrl; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendModuleService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendModuleService.java deleted file mode 100644 index 0ed7bc8af..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendModuleService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.accompany.business.service.recommend; - - -import com.accompany.business.model.RecommendModule; -import com.accompany.business.model.RecommendModuleExample; -import com.accompany.business.mybatismapper.RecommendModuleMapper; -import com.accompany.core.service.base.BaseService; - -import com.accompany.core.service.common.JedisService; -import com.accompany.core.util.StringUtils; -import com.google.gson.reflect.TypeToken; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Service -public class RecommendModuleService extends BaseService { - - @Autowired - private RecommendModuleMapper recommendModuleMapper; - - @Autowired - private JedisService jedisService; - - /** - * 获取星推荐和热门推荐的模块配置 - * @return - */ - public Map getStarAndPopularModule() { - final Map modules = new HashMap<>(); - Map vos = jedisService.hgetAll(RedisKey.recommend_star_popular.getKey()); - if (vos != null && vos.size() > 0) { - vos.keySet().forEach(key -> modules.put(Byte.parseByte(key), gson.fromJson(vos.get(key), new TypeToken() {}.getType()))); - } else { - RecommendModuleExample example = new RecommendModuleExample(); - example.createCriteria().andTypeBetween(Constant.RecommendModuleType.TYPE_STAR, Constant.RecommendModuleType.TYPE_POPULAR).andDeleteFlagEqualTo(false); - List moduleList = recommendModuleMapper.selectByExample(example); - if (!CollectionUtils.isEmpty(moduleList)) { - Map values = new HashMap<>(); - moduleList.forEach(module -> { - values.put(module.getType().toString(), gson.toJson(module)); - modules.put(module.getType(),module); - }); - jedisService.hwrite(RedisKey.recommend_star_popular.getKey(), values); - } - } - return modules; - } - - /** - * 获取星推荐或热门推荐的模块配置 - * @param type 模块类型 - * @return - */ - public RecommendModule getStarOrPopularModule(Byte type){ - RecommendModule module = null; - if(type.equals(Constant.RecommendModuleType.TYPE_STAR) || type.equals(Constant.RecommendModuleType.TYPE_POPULAR)){ - String mapVoJson = jedisService.hget(RedisKey.recommend_star_popular.getKey(),type.toString()); - if(StringUtils.isNotEmpty(mapVoJson)) { - module = gson.fromJson(mapVoJson, new TypeToken() {}.getType()); - } - } - return module; - } - - public Integer getModuleTotalNum(Byte type){ - RecommendModule module = this.getStarOrPopularModule(type); - if(module == null ){ - return null; - } - int bigPictureNum = module.getBigPictureNum() == null ? Constant.DEFAULT_BIG_PICTURE_NUM : module.getBigPictureNum(); - int listNum = module.getListNum() == null ? Constant.DEFAULT_LIST_NUM : module.getListNum(); - - return bigPictureNum+listNum; - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendService.java deleted file mode 100644 index 11deafa67..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/recommend/RecommendService.java +++ /dev/null @@ -1,514 +0,0 @@ -package com.accompany.business.service.recommend; - -import com.accompany.business.model.RecommendCard; -import com.accompany.business.model.RecommendCardExample; -import com.accompany.business.model.RecommendRecord; -import com.accompany.business.model.RecommendRecordExample; -import com.accompany.business.mybatismapper.RecommendCardMapper; -import com.accompany.business.mybatismapper.RecommendRecordMapper; -import com.accompany.business.service.room.RoomService; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.RecommendConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.result.BusiResult; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.BlankUtil; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.SysConf; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.base.BaseService; -import com.accompany.core.service.common.JedisService; -import com.alibaba.fastjson.JSON; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.commons.lang3.time.FastDateFormat; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.function.Consumer; - -/** - * Created by PaperCut on 2018/12/26. - * 房间推荐业务代码 - */ -@Service -public class RecommendService extends BaseService { - @Autowired - private RecommendRecordMapper recommendRecordMapper; - @Autowired - private RecommendCardMapper recommendCardMapper; - @Autowired - private JedisService jedisService; - @Autowired - private RoomService roomService; - @Autowired - private RecommendModuleService recommendModuleService; - @Autowired - private SysConfService sysConfService; - - public static final String TIME_FORMAT_HOUR_PATTERN = "HH:00:00"; - - private Gson gson = new Gson(); - - /** - * 申请推荐位 - * - * @param roomUid - * @param validStartTime 推荐卡的开始有效时间 - * @param validEndTime 推荐卡的有效结束时间 - * @param useStartTime 推荐卡的使用时间 - */ - @Transactional(rollbackFor = Exception.class) - public BusiResult apply(Long roomUid, Long validStartTime, Long validEndTime, Date useStartTime) { - Integer stock = getAvailableStock(useStartTime); - if (stock <= 0) { - return new BusiResult(BusiStatus.RECOMMEND_STOCK_NOT_ENOUGH); - } - //限制推荐卡的使用数量 - Integer cardAvailableStock = getCardStock(stock, useStartTime); - if (cardAvailableStock <= 0){ - return new BusiResult(BusiStatus.RECOMMEND_CRAD_STOCK_NOT_ENOUGH); - } - // 房间校验 - Room room = roomService.getRoomByDB(roomUid); - if (room == null) { - return new BusiResult(BusiStatus.ROOMNOTEXIST); - } - RecommendCard card = null; - if (validStartTime != null && validEndTime != null) { - // 判断该用户是否有效推荐卡 - card = getCardByDate(roomUid, new Date(validStartTime), new Date(validEndTime)); - } else {//推荐卡的开始时间和有效时间若为空则默认使用第一张 - card = getCardByUid(roomUid); - } - if (card == null) { - return new BusiResult(BusiStatus.NOT_FOUND_AVAILABLE_RECOMMEND_CARD); - } - - int ret = doUseCard(card, useStartTime); - if (ret > 0) { - doRecommendAndReduceStock(roomUid, card.getId(), card.getUsedStartTime(), card.getUsedEndTime(), 0, "system"); - } - //保存推荐卡的使用数量 - setCardUsedStock(useStartTime, 1L); - return new BusiResult(BusiStatus.SUCCESS); - } - - /** - * 统计指定用户指定时间段的推荐记录 - * - * @param uid - * @param status - * @param startTime - * @param endTime - * @return - */ - public Integer countRecordBetweenTime(Long uid, Byte status, Date startTime, Date endTime) { - RecommendRecordExample example = new RecommendRecordExample(); - example.createCriteria() - .andStatusEqualTo(status) - .andStartTimeLessThanOrEqualTo(startTime) - .andEndTimeGreaterThanOrEqualTo(endTime) - .andUidEqualTo(uid); - return recommendRecordMapper.countByExample(example); - } - - /** - * 新增推荐位 - * - * @param roomUid - * @param cardId - * @param startTime - * @param endTime - * @param seqNo - * @param createdBy - */ - public int doRecommend(Long roomUid, Long cardId, Date startTime, Date endTime, Integer seqNo, String createdBy) { - // 新增推荐记录 - RecommendRecord record = new RecommendRecord(); - record.setCardId(cardId); - record.setUid(roomUid); - record.setStartTime(startTime); - record.setEndTime(endTime); - record.setCreatedBy(createdBy); - record.setSeqNo(seqNo); - record.setStatus(RecommendConstant.RecordStatus.ALREADY_BOOK); - record.setCreateTime(new Date()); - return recommendRecordMapper.insert(record); - } - - /** - * 申请推荐 - * - * @param roomUid - * @param cardId - * @param startTime - * @param endTime - * @param seqNo - * @param createdBy - * @return - */ - public int doRecommendAndReduceStock(Long roomUid, Long cardId, Date startTime, Date endTime, Integer seqNo, String createdBy) { - int ret = doRecommend(roomUid, cardId, startTime, endTime, seqNo, createdBy); - if (ret > 0) { - // 扣减库存 - doStockBetweenHour(RedisKey.recommend_stock, startTime, endTime, 1); - } - return ret; - } - - /** - * 使用推荐卡 - * - * @param card - * @param useStartTime - * @return - */ - public int doUseCard(RecommendCard card, Date useStartTime) { - Date startDate = DateUtils.truncate(useStartTime, Calendar.HOUR); - Date endDate = DateUtils.addSeconds(startDate, card.getPeriod()); - - // 判断是否已经申请该推荐位 - Integer count = countRecordBetweenTime(card.getUid(), RecommendConstant.RecordStatus.ALREADY_BOOK, startDate, endDate); - if (count > 0) { - throw new ServiceException(BusiStatus.RECOMMEND_ALREADY_APPLY); - } - - card.setUsedStartTime(useStartTime); - card.setUsedEndTime(endDate); - card.setStatus(RecommendConstant.CardStatus.ALREADY_USING); - - return recommendCardMapper.updateByPrimaryKey(card); - } - - /** - * 根据日期获取匹配到的卡片 - * - * @param uid - * @param validStartDate - * @param validEndDate - * @return - */ - public RecommendCard getCardByDate(Long uid, Date validStartDate, Date validEndDate) { - RecommendCardExample example = new RecommendCardExample(); - example.createCriteria() - .andUidEqualTo(uid) - .andStatusEqualTo(RecommendConstant.CardStatus.NOT_USED) - .andValidStartTimeEqualTo(validStartDate) - .andValidEndTimeEqualTo(validEndDate); - - List cardList = recommendCardMapper.selectByExample(example); - if (!CollectionUtils.isEmpty(cardList)) { - return cardList.get(0); - } - return null; - } - - private RecommendCard getCardByUid(Long uid) { - RecommendCardExample example = new RecommendCardExample(); - example.createCriteria() - .andUidEqualTo(uid) - .andStatusEqualTo(RecommendConstant.CardStatus.NOT_USED) - .andValidEndTimeGreaterThanOrEqualTo(new Date()); - example.setOrderByClause("valid_end_time asc"); - List cardList = recommendCardMapper.selectByExample(example); - return CollectionUtils.isEmpty(cardList) ? null : cardList.get(0); - } - - /** - * 获取指定时间可用的推荐库存(从redis获取) - * - * @param key - * @param field - * @return - */ - public Integer getStock(String key, String field) { - String stock = jedisService.hget(key, field); - if (StringUtils.isNotEmpty(stock)) { - return Integer.parseInt(stock); - } else { - return 0; - } - } - - /** - * 获取指定时间可用的推荐位库存 - * - * @param startTime - * @return - */ - public Integer getAvailableStock(Date startTime) { - String date = DateFormatUtils.ISO_DATE_FORMAT.format(startTime); - FastDateFormat timeFormat = FastDateFormat.getInstance(TIME_FORMAT_HOUR_PATTERN); - // 获取已使用的库存 - Integer usedStock = getStock(RedisKey.recommend_stock.getKey(date), timeFormat.format(startTime)); - // 获取已占用的库存 - Integer occupyStock = getStock(RedisKey.recommend_occupy.getKey(date), timeFormat.format(startTime)); - return calculteStock(usedStock, occupyStock); - } - - /** - * 推荐位的库存操作 - * - * @param key - * @param dateTime - * @param value - */ - public void doStock(RedisKey key, Date dateTime, Integer value) { - String d = DateFormatUtils.ISO_DATE_FORMAT.format(dateTime); - FastDateFormat timeFormat = FastDateFormat.getInstance(TIME_FORMAT_HOUR_PATTERN); - String t = timeFormat.format(dateTime); - jedisService.hincrBy(key.getKey(d), t, (long) value); - } - - - /** - * 对指定时间区间的库存进行操作(小时制) - * - * @param key - * @param startTime - * @param endTime - * @param count - */ - public void doStockBetweenHour(RedisKey key, Date startTime, Date endTime, Integer count) { - doBetweenForHour(startTime, endTime, (time) -> doStock(key, time, count)); - } - - public void doBetweenForHour(Date startTime, Date endTime, Consumer consumer) { - Long hours = TimeUnit.MILLISECONDS.toHours((endTime.getTime() - startTime.getTime())); - do { - consumer.accept(startTime); - startTime = DateUtils.addHours(startTime, 1); - } while ((--hours) > 0); - } - - /** - * 获取指定时间段内的库存 - * - * @param redisKey - * @param startTime - * @param endTime - * @return - */ - public Map getStockBetween(RedisKey redisKey, Date startTime, Date endTime) { - FastDateFormat dateFommat = DateFormatUtils.ISO_DATE_FORMAT; - FastDateFormat timeFormat = FastDateFormat.getInstance(TIME_FORMAT_HOUR_PATTERN); - - Map stockMap = new HashMap<>(); - doBetweenForHour(startTime, endTime, (start) -> { - Integer stock = getStock(redisKey.getKey(dateFommat.format(start)), timeFormat.format(start)); - stockMap.put(start, stock); - }); - return stockMap; - } - - /** - * 将推荐卡进行过期处理 - */ - public void scanExpired() { - RecommendCardExample example = new RecommendCardExample(); - example.createCriteria() - .andValidEndTimeLessThanOrEqualTo(new Date()) - .andStatusEqualTo(RecommendConstant.CardStatus.NOT_USED); - RecommendCard card = new RecommendCard(); - card.setStatus(RecommendConstant.CardStatus.ALREADY_EXPIRED); - recommendCardMapper.updateByExampleSelective(card, example); - - } - - /** - * 重新加载推荐位 - * - * @param curDate - */ - public void refreshRecommend(Date curDate) { - // 将已使用的推荐记录进行过期 - RecommendRecordExample example = new RecommendRecordExample(); - example.createCriteria() - .andStatusEqualTo(RecommendConstant.RecordStatus.ALREADY_USING) - .andEndTimeLessThanOrEqualTo(curDate); - RecommendRecord record = new RecommendRecord(); - record.setStatus(RecommendConstant.RecordStatus.ALREADY_EXPIRED); - recommendRecordMapper.updateByExampleSelective(record, example); - - // 将使用中卡片重置为已使用 - RecommendCardExample cardExample = new RecommendCardExample(); - cardExample.createCriteria() - .andUsedEndTimeLessThanOrEqualTo(curDate) - .andStatusEqualTo(RecommendConstant.CardStatus.ALREADY_USING); - RecommendCard card = new RecommendCard(); - card.setStatus(RecommendConstant.CardStatus.ALREADY_USED); - recommendCardMapper.updateByExampleSelective(card, cardExample); - - // 将已预定的推荐位重置为使用中 - example = new RecommendRecordExample(); - example.createCriteria() - .andStartTimeLessThanOrEqualTo(curDate) - .andEndTimeGreaterThan(curDate) - .andStatusEqualTo(RecommendConstant.RecordStatus.ALREADY_BOOK); - record = new RecommendRecord(); - record.setStatus(RecommendConstant.RecordStatus.ALREADY_USING); - recommendRecordMapper.updateByExampleSelective(record, example); - } - - /** - * 查询指定用户指定时间的可用卡片数量 - * - * @param uid - * @param validStartTime - * @param validEndTime - * @return - */ - public Integer queryNotUsedCardCount(Long uid, Date validStartTime, Date validEndTime) { - RecommendCardExample example = new RecommendCardExample(); - example.createCriteria().andUidEqualTo(uid) - .andStatusEqualTo(RecommendConstant.CardStatus.NOT_USED) - .andValidStartTimeEqualTo(validStartTime) - .andValidEndTimeEqualTo(validEndTime); - return recommendCardMapper.countByExample(example); - } - - /** - * 查询指定时间段的推荐房 - * - * @param startTime - * @param endTime - * @return - */ - public List queryRecommRoomFromDB(Date startTime, Date endTime) { - RecommendRecordExample example = new RecommendRecordExample(); - example.createCriteria() - .andStatusEqualTo(RecommendConstant.RecordStatus.ALREADY_USING) - .andStartTimeLessThanOrEqualTo(startTime) - .andEndTimeGreaterThanOrEqualTo(endTime); - return recommendRecordMapper.selectByExample(example); - } - - /** - * 重新加载指定时间段的推荐房到缓存 - * - * @param startTime - * @param endTime - * @return - */ - public void reloadRecomRoom(Date startTime, Date endTime) { - List list = queryRecommRoomFromDB(startTime, endTime); - jedisService.set(RedisKey.recommend_room_list.getKey(), gson.toJson(list)); - logger.info("Successful reload recom room. Rooms: {}", JSON.toJSONString(list)); - } - - /** - * 重新刷新加载推荐房 - */ - public void reloadRecomRoom() { - Date curDate = new Date(); - Date startDate = DateUtils.truncate(curDate, Calendar.HOUR); - Date endDate = DateUtils.addHours(startDate, 1); - refreshRecommend(startDate); - reloadRecomRoom(startDate, endDate); - } - - /** - * 从缓存获取推荐记录 - * - * @return - */ - public List queryRecommFromCache() { - String json = jedisService.get(RedisKey.recommend_room_list.getKey()); - if (!BlankUtil.isBlank(json) && !"[]".equals(json)) { - List list = gson.fromJson(json, new TypeToken>() { - }.getType()); - return list; - } - return Collections.emptyList(); - } - - /** - * 获取最大推荐库存 - * - * @return - */ - public Integer getMaxStock() { - return recommendModuleService.getModuleTotalNum(Constant.RecommendModuleType.TYPE_STAR); - } - - /** - * 计算剩余库存 - * - * @param useStock - * @param occupyStock - * @return - */ - public Integer calculteStock(Integer useStock, Integer occupyStock) { - return getMaxStock() - (useStock + occupyStock); - } - - /** - * 查询指定状态的推荐卡 - * - * @param uid - * @param status - * @return - */ - public List queryCard(Long uid, Byte status) { - return recommendCardMapper.queryByPage(uid, status); - } - - /** - * 查询指定用户指定状态的卡数 - * - * @param uid - * @return - */ - public int getCardCount(Long uid, Byte cardStatus) { - RecommendCardExample example = new RecommendCardExample(); - example.createCriteria().andUidEqualTo(uid).andStatusEqualTo(cardStatus); - return recommendCardMapper.countByExample(example); - } - - public Integer getCardStock(int stock, Date startTime){ - String date = DateFormatUtils.ISO_DATE_FORMAT.format(startTime); - FastDateFormat timeFormat = FastDateFormat.getInstance(TIME_FORMAT_HOUR_PATTERN); - //推荐位剩余库存 - int usedCard = 0; - String used = jedisService.hget(RedisKey.recommend_card_used_limit.getKey(date), timeFormat.format(startTime));// 已使用推荐卡数量 - if (StringUtils.isNotEmpty(used)){ - usedCard = Integer.valueOf(used); - } - SysConf sysConf = sysConfService.getSysConfById(Constant.SysConfId.RECOMMEND_CARD_LIMIT); // 规定可使用推荐卡数量 - if (sysConf == null){ - return stock; - } - int configStock = Integer.valueOf(sysConf.getConfigValue()); - int availableStock = 0; // 剩余可用推荐卡数量 - if (stock > configStock){ - availableStock = configStock - usedCard; - }else{ - availableStock = stock - usedCard; - } - return availableStock; - } - - /** - * 保存推荐卡的使用数量 - * @param startTime - * @param cardNum - * @return - */ - public int setCardUsedStock(Date startTime, Long cardNum){ - String date = DateFormatUtils.ISO_DATE_FORMAT.format(startTime); - FastDateFormat timeFormat = FastDateFormat.getInstance(TIME_FORMAT_HOUR_PATTERN); - jedisService.hincrBy(RedisKey.recommend_card_used_limit.getKey(date), timeFormat.format(startTime), cardNum); - jedisService.pexpireAt(RedisKey.recommend_card_used_limit.getKey(date), DateTimeUtil.getNextDay(new Date(), 3).getTime()); - return 1; - } -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java index 5a5ea91a4..289fb6947 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/RedEnvelopeService.java @@ -21,9 +21,9 @@ import com.accompany.business.vo.redenvelope.RedEnvelopeResponseVo; import com.accompany.business.vo.redenvelope.RedEnvelopeVo; import com.accompany.business.vo.redenvelope.SendRedEnvelopeRequest; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.UidContextHolder; +import com.accompany.core.exception.ServiceException; import com.accompany.core.model.Room; import com.accompany.core.model.Users; import com.accompany.core.service.SysConfService; @@ -258,7 +258,7 @@ public class RedEnvelopeService extends ServiceImpl validRedEnvelopes = getValidRedEnvelopes(roomUid); if (CollectionUtil.isNotEmpty(validRedEnvelopes)) { - throw new AdminServiceException(BusiStatus.RED_ENVELOPE_ROOM_EXIST); + throw new ServiceException(BusiStatus.RED_ENVELOPE_ROOM_EXIST); } //生效类型 int validityType = request.getValidityType(); @@ -308,10 +308,10 @@ public class RedEnvelopeService extends ServiceImpl 10) { - throw new AdminServiceException("紅包標題長度不能超過10"); + throw new ServiceException("紅包標題長度不能超過10"); } if (YidunCheckUtil.checkHasSensitiveWord(message)) { - throw new AdminServiceException("當前內容不符合規範,請修改后重試哦~"); + throw new ServiceException("當前內容不符合規範,請修改后重試哦~"); } Users users = usersService.getUsersByUid(uid); String payPassWord = users.getPaymentPwd(); if (payPassWord == null) { - throw new AdminServiceException("請設置支付密碼"); + throw new ServiceException("請設置支付密碼"); } if (!usersService.checkPaymentPwd(password, payPassWord)) { - throw new AdminServiceException(BusiStatus.USER_INCORRECT_PAYMENT_PASS.getReasonPhrase()); + throw new ServiceException(BusiStatus.USER_INCORRECT_PAYMENT_PASS.getReasonPhrase()); } int minAmount = type.equals(RedEnvelopeTypeConstant.IN_ROOM) ? 10 : 100; if (amount % minAmount > 0) { - throw new AdminServiceException("紅包鉆石數量必須為" + minAmount + "的倍數"); + throw new ServiceException("紅包鉆石數量必須為" + minAmount + "的倍數"); } if (!roomRedEnvelopeService.hasRedEnvelope(roomUid, uid, type)) { - throw new AdminServiceException("對應權限不足,請更新版本"); + throw new ServiceException("對應權限不足,請更新版本"); } Double redEnvelopeAmount = redEnvelopeAmount(amount); if (DoubleUtil.sub(num * 1.0, redEnvelopeAmount) > 0) { - throw new AdminServiceException("單個紅包金額過小"); + throw new ServiceException("單個紅包金額過小"); } UserPurse userPurse = userPurseService.queryUserPurse(uid); Double currentDiamonds = userPurse.getDiamonds(); if (currentDiamonds < amount) { - throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new ServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } } doSend(context); @@ -169,23 +169,23 @@ public abstract class IRedEnvelopeStrategy { try { RedEnvelopStateEnum state = redEnvelopeService.stateById(redEnvelopeId); if (state == RedEnvelopStateEnum.TIME_OUT) { - throw new AdminServiceException("紅包已超時"); + throw new ServiceException("紅包已超時"); } if (state == RedEnvelopStateEnum.REMAIN_ZERO) { - throw new AdminServiceException("紅包已經搶完了"); + throw new ServiceException("紅包已經搶完了"); } if (state == RedEnvelopStateEnum.WILL) { - throw new AdminServiceException("紅包還沒開始"); + throw new ServiceException("紅包還沒開始"); } if (state != RedEnvelopStateEnum.ING) { - throw new AdminServiceException("此紅包不在進行時"); + throw new ServiceException("此紅包不在進行時"); } beforeOpen(context); doOpen(context); SpringContextHolder.getApplicationContext().publishEvent(new RedEnvelopeEvent(redEnvelopeId)); } catch (Exception e) { log.error(e.getMessage(), e); - throw new AdminServiceException(e.getMessage()); + throw new ServiceException(e.getMessage()); } finally { jedisLockService.unlock(lockKey, lockVal); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java index 14d6e7354..db60efd68 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/InRoomRedEnvelopeStrategy.java @@ -13,7 +13,6 @@ import com.accompany.business.model.redenvelope.RedEnvelope; import com.accompany.business.service.follow.FansService; import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; import com.accompany.core.enumeration.BillObjTypeEnum; @@ -64,10 +63,10 @@ public abstract class InRoomRedEnvelopeStrategy extends IRedEnvelopeStrategy { double currentDiamonds = userPurse.getDiamonds(); if (currentDiamonds < amount) { log.error("[发放红包] " + uid + " 钱包钻石数 " + currentDiamonds + " 少于发放需要扣钻石数 " + amount); - throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new ServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } log.error("[发放红包] " + uid + " 当前钱包钻石数 " + currentDiamonds + " ,扣钻石数 " + amount + " 不成功"); - throw new AdminServiceException(BusiStatus.SERVERBUSY); + throw new ServiceException(BusiStatus.SERVERBUSY); } } RedEnvelopeDTO redEnvelope = buildRedEnvelope(context); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java index 795669a43..42a18ef2b 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/redenvelope/strategy/ShareRedEnvelopeStrategy.java @@ -3,8 +3,9 @@ package com.accompany.business.service.redenvelope.strategy; import com.accompany.business.model.UserShareRecordExample; import com.accompany.business.model.redenvelope.RedEnvelope; import com.accompany.business.mybatismapper.UserShareRecordMapper; -import com.accompany.core.exception.AdminServiceException; +import com.accompany.common.status.BusiStatus; import com.accompany.core.base.SpringContextHolder; +import com.accompany.core.exception.ServiceException; public class ShareRedEnvelopeStrategy extends InRoomRedEnvelopeStrategy { private UserShareRecordMapper userShareRecordMapper; @@ -31,7 +32,7 @@ public class ShareRedEnvelopeStrategy extends InRoomRedEnvelopeStrategy { @Override public void beforeOpen(RedEnvelopeContext context) { if (!isFinish(context)) { - throw new AdminServiceException("未參與活動,無法搶該紅包"); + throw new ServiceException(BusiStatus.RED_ENVELOPE_INVALID); } } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java index bb9d8ceb1..184735d7a 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomSearchService.java @@ -9,8 +9,6 @@ import com.accompany.business.elasticsearch.ElasticsearchRestClient; import com.accompany.business.elasticsearch.EsPage; import com.accompany.business.model.HallMember; import com.accompany.business.model.HallOperateRecord; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; import com.accompany.business.service.account.AccountBlockService; import com.accompany.business.service.hall.HallManageService; import com.accompany.business.service.hall.HallService; @@ -39,7 +37,6 @@ import com.accompany.core.service.base.BaseService; import com.accompany.core.service.channel.ChannelContentPartitionService; import com.accompany.core.vo.user.SearchVo; import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.reflect.TypeToken; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -97,9 +94,6 @@ public class RoomSearchService extends BaseService { @Autowired private RoomService roomService; - @Autowired - private UserCoupleMapper userCoupleMapper; - @Autowired private ElasticsearchConfig elasticsearchConfig; @Autowired @@ -484,50 +478,6 @@ public class RoomSearchService extends BaseService { return pickUidList; } - - public void addUserCpState(Long uid, List searchVoList) { - if (CollectionUtils.isEmpty(searchVoList)) return; - - List uidList = searchVoList.stream().map(SearchVo::getUid).collect(Collectors.toList()); - - List stateList = Arrays.asList(Constant.UserCoupleState.invite, Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.in(UserCouple::getInviteUid, uidList).or().in(UserCouple::getAcceptUid, uidList)).in(UserCouple::getState, stateList); - - List userCoupleList = userCoupleMapper.selectList(queryWrapper); - - - Map inviteUserCoupleMap = new HashMap<>(); - Map acceptUserCoupleMap = new HashMap<>(); - if (!CollectionUtils.isEmpty(userCoupleList)) { - for (UserCouple userCouple : userCoupleList) { - inviteUserCoupleMap.put(userCouple.getInviteUid(), userCouple); - acceptUserCoupleMap.put(userCouple.getAcceptUid(), userCouple); - } - } - - for (SearchVo searchVo : searchVoList) { - UserCouple userCouple = inviteUserCoupleMap.get(searchVo.getUid()); - - if (ObjectUtil.isNull(userCouple)) userCouple = acceptUserCoupleMap.get(searchVo.getUid()); - - if (ObjectUtil.isNull(userCouple)) { - searchVo.setCpState((byte) 3); - continue; - } - - - if (Constant.UserCoupleState.invite.equals(userCouple.getState())) { - if (userCouple.getInviteUid().equals(uid) || userCouple.getAcceptUid().equals(uid)) - searchVo.setCpState((byte) 1); - else searchVo.setCpState((byte) 3); - continue; - } - if (Constant.UserCoupleState.cp.equals(userCouple.getState()) || Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) - searchVo.setCpState((byte) 2); - } - } - public void searchWrapper(Long uid, List searchVoList) { if (CollectionUtils.isEmpty(searchVoList)) { return; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java index 6f96fb4f9..6ef9e0214 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomService.java @@ -58,7 +58,6 @@ import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.constant.UserRoomIdentityEnum; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.model.GamePlayer; import com.accompany.common.netease.neteaseacc.NetEaseBaseClient; import com.accompany.common.netease.util.NetEaseConstant; @@ -419,10 +418,10 @@ public class RoomService extends BaseService { if (Constant.RoomModeType.OPEN_BLIND_DATE_MODE.equals(room.getRoomModeType())) { String os = deviceInfo.getOs(); if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, "20.20.7") < 0) { - throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new ServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, "2.5.0") < 0) { - throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new ServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } } //个播版本检查 @@ -2229,7 +2228,7 @@ public class RoomService extends BaseService { public BusiResult invite(Long roomUid, String uids) { String lockval = this.jedisLockService.lock(RedisKey.room_invite_lock.getKey(roomUid.toString()), 1000); if (StringUtils.isEmpty(lockval)) { - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } try { BusiResult result = new BusiResult(BusiStatus.SUCCESS); @@ -2301,7 +2300,7 @@ public class RoomService extends BaseService { public boolean addMatchPool(Long uid, Long roomId, String gameId) { String lockval = this.jedisLockService.lock(RedisKey.add_match_pool_room.getKey(uid.toString() + gameId), 1000); if (StringUtils.isEmpty(lockval)) { - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } try { /* GamePlayer player = getPlayerByUid(uid); @@ -2331,7 +2330,7 @@ public class RoomService extends BaseService { public boolean addIsomerismMatchPool(Long uid, Long roomId) { String lockval = this.jedisLockService.lock(RedisKey.add_isomerism_match_pool_room.getKey(uid.toString()), 1000); if (StringUtils.isEmpty(lockval)) { - throw new AdminServiceException(BusiStatus.REQUEST_FAST); + throw new ServiceException(BusiStatus.REQUEST_FAST); } try { GamePlayer player = getPlayerByUid(uid); @@ -3367,10 +3366,10 @@ public class RoomService extends BaseService { String os = deviceInfo.getOs(); if (jedisService.hexists(RedisKey.corss_room_round_pking.getKey(), String.valueOf(room.getUid()))) { if (os.equalsIgnoreCase(Constant.OsType.IOS) && AppVersionUtil.compareVersion(appVersion, "20.20.7") < 0) { - throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new ServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } if (os.equalsIgnoreCase(Constant.OsType.ANDROID) && AppVersionUtil.compareVersion(appVersion, "2.5.0") < 0) { - throw new AdminServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); + throw new ServiceException(BusiStatus.ROOM_IN_VERSION_CHECK); } } } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomTagService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomTagService.java index 789dce3b3..5467811c2 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomTagService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/RoomTagService.java @@ -45,24 +45,6 @@ public class RoomTagService extends BaseService { @Autowired private RoomTagSpecialConfigService roomTagSpecialConfigService; - /** - * 获取顶部标签,cache -> db -> cache - * - * @return - */ - public List getTopTagList() { - String liststr = jedisService.get(RedisKey.room_tag_top.getKey()); - List list; - if (BlankUtil.isBlank(liststr)) { - list = getAppTopTagsFromDB(); - jedisService.set(RedisKey.room_tag_top.getKey(), gson.toJson(list)); - } else { - list = gson.fromJson(liststr, new TypeToken>() { - }.getType()); - } - return list; - } - /** * 获取全部标签的列表,cache -> db -> cache * @@ -132,78 +114,6 @@ public class RoomTagService extends BaseService { return roomTagList; } - /** - * 获取30天内新开的房间数据 - * - * @return - */ - public List getNewRoomList(Integer day,List hideUids, Integer pageNum, Integer pageSize) { - Map param = Maps.newHashMap(); - param.put("day", day); - param.put("skip", (pageNum - 1) * pageSize); - param.put("size", pageSize); - if(!BlankUtil.isBlank(hideUids)) { - param.put("hideUids", hideUids); - } - List list = roomMapperExpand.selectNewRooms(param); - return converToRoomVo(list); - } - - /** - * 获取轻聊房数据(电台标签) - * - * @return - */ - public List getRadioRoomList(List hideUids, Integer pageNum, Integer pageSize) { - Map param = Maps.newHashMap(); - param.put("skip", (pageNum - 1) * pageSize); - param.put("size", pageSize); - if(!BlankUtil.isBlank(hideUids)) { - param.put("hideUids", hideUids); - } - List list = roomMapperExpand.selectRadioRooms(param); - return converToRoomVo(list); - } - - private List converToRoomVo(List list) { - List rooms = Lists.newArrayList(); - for (Room period : list) { - RoomVo roomVo = new RoomVo(); - try { - Users users = usersService.getUsersByUid(period.getUid()); - if (users != null) { - roomVo.setNick(users.getNick()==null?null: SensitiveFilterUtil.getStringSensitiveFilter(users.getNick())); - roomVo.setAvatar(users.getAvatar()); - roomVo.setGender(users.getGender()); - } - roomVo.setRoomPwd(period.getRoomPwd()); - roomVo.setOnlineNum(period.getOnlineNum()); - roomVo.setUid(period.getUid()); - roomVo.setBackPic(period.getBackPic()); - roomVo.setRoomId(period.getRoomId()); - roomVo.setRoomDesc(period.getRoomDesc()==null?null:SensitiveFilterUtil.getStringSensitiveFilter(period.getRoomDesc())); - roomVo.setRoomTag(period.getRoomTag()); - roomVo.setTagId(period.getTagId()); - roomVo.setTagPict(period.getTagPict()); - roomVo.setTitle(period.getTitle()==null?null:SensitiveFilterUtil.getStringSensitiveFilter(period.getTitle())); - roomVo.setType(period.getType()); - roomVo.setOfficeUser((byte) 1); - roomVo.setOperatorStatus(period.getOperatorStatus()); - roomVo.setIsPermitRoom(period.getIsPermitRoom()); - roomVo.setOfficeUser(period.getOfficialRoom()); - roomVo.setBadge(period.getBadge()); - roomVo.setHasAnimationEffect(period.getHasAnimationEffect()); - roomVo.setAudioQuality(period.getAudioQuality()); - roomVo.setIsCloseScreen(period.getIsCloseScreen()); - }catch (Exception e){ - logger.error("converToRoomVo failed,error={}",e); - }finally { - rooms.add(roomVo); - } - } - return rooms; - } - /** * 获取房间标签信息,cache -> db -> cache * @@ -236,16 +146,6 @@ public class RoomTagService extends BaseService { return null; } - public List queryAllByVo() { - List roomTagList = getAllTagList(); - return BeanMapper.mapList(roomTagList, RoomTag.class, RoomTagVo.class); - } - - public List queryTopByVo() { - List roomTagList = getTopTagList(); - return BeanMapper.mapList(roomTagList, RoomTag.class, RoomTagVo.class); - } - /** * 从DB获取所有的标签数据,除去萌新 * @@ -272,11 +172,6 @@ public class RoomTagService extends BaseService { return roomTagMapper.selectByExample(example); } - public void clearCache() { - jedisService.del(RedisKey.room_tag_room.getKey()); - jedisService.del(RedisKey.room_tag_top.getKey()); - } - /** * 获取改版后的首页标签 */ @@ -297,21 +192,6 @@ public class RoomTagService extends BaseService { return list; } - /** - * 获取所有的小标签 - * @return - */ - public List getAllTagFromDB() { - RoomTagExample example = new RoomTagExample(); - example.createCriteria().andStatusEqualTo(true) - .andChildrenIsNotNull() - .andChildrenNotEqualTo("") - .andIstopEqualTo(false) - .andTmpintIsNull(); - example.setOrderByClause("seq desc"); - return roomTagMapper.selectByExample(example); - } - /** * 计算时间T(取整数) * 当T<1分钟时,计算单位为秒; diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java index c16620666..43d03b862 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/room/impl/CrossRoomPkRoundServiceImpl.java @@ -28,7 +28,6 @@ import com.accompany.common.config.SystemConfig; import com.accompany.common.constant.Attach; import com.accompany.common.constant.Constant; import com.accompany.common.device.DeviceInfo; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.netease.neteaseacc.result.RoomRet; import com.accompany.common.netease.neteaseacc.result.RubbishRet; import com.accompany.common.redis.RedisKey; @@ -504,10 +503,10 @@ public class CrossRoomPkRoundServiceImpl extends ServiceImpl params) { - log.info("begin inviteCpDenyJob ============================================================="); - Long id = null; - try { - if (!params.containsKey(INVITE_CP_DENY_JOB)) { - return; - } - id = Long.valueOf(params.get(INVITE_CP_DENY_JOB).toString()); - log.info("执行cp邀请{}自动拒绝", id); - if (ObjectUtil.isNull(id)) return; - userCoupleService.replyCpInvite(id, Constant.UserCoupleState.expire); - } catch (Exception e) { - log.error("cp邀请{}自动拒绝任务异常{}", id, e.getMessage(), e); - } - log.info("end inviteCpDenyJob ============================================================="); - - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/task/UnboundUserCpTaskService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/task/UnboundUserCpTaskService.java deleted file mode 100644 index 4fad31ee2..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/task/UnboundUserCpTaskService.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.accompany.business.service.task; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.core.service.task.AbstractTaskService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Map; - -/** - * @author: liaozetao - * @date: 2023/11/24 14:17 - * @description: - */ -@Slf4j -@Service -public class UnboundUserCpTaskService extends AbstractTaskService { - - public static final String UNBOUND_USER_CP_JOB = "unboundUserCpJob"; - - @Autowired - private UserCoupleService userCoupleService; - - @Override - protected void execute(String taskKey, Map params) { - log.info("begin unboundUserCpJob ============================================================="); - Long id = null; - try { - if (!params.containsKey(UNBOUND_USER_CP_JOB)) { - return; - } - id = Long.valueOf(params.get(UNBOUND_USER_CP_JOB).toString()); - log.info("执行cp{}解绑", id); - if (ObjectUtil.isNull(id)) return; - userCoupleService.unboundDeal(id); - } catch (Exception e) { - log.error("cp{}解绑任务异常{}", id, e.getMessage(), e); - } - log.info("end unboundUserCpJob ============================================================="); - } -} diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java index 25e3d4d4c..fa9560d3f 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureRewardService.java @@ -3,7 +3,7 @@ package com.accompany.business.service.treasure; import cn.hutool.core.collection.CollectionUtil; import com.accompany.business.model.treasure.SeizeTreasureReward; import com.accompany.business.mybatismapper.treasure.SeizeTreasureRewardMapper; -import com.accompany.core.exception.AdminServiceException; +import com.accompany.core.exception.ServiceException; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -16,7 +16,7 @@ public class SeizeTreasureRewardService extends ServiceImpl getByRewardIds(List rewardIdList) { if (CollectionUtil.isEmpty(rewardIdList)) { - throw new AdminServiceException("奖池为空"); + throw new ServiceException("奖池为空"); } return lambdaQuery().in(SeizeTreasureReward::getId, rewardIdList).list(); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java index 1b4eeaa08..ee95294dd 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/SeizeTreasureService.java @@ -26,7 +26,6 @@ import com.accompany.business.service.user.UserActPropertyInfoRecordService; import com.accompany.business.vo.treasure.SeizeTreasureSalvageConfig; import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageRecordVo; import com.accompany.business.vo.treasure.salvage.SeizeTreasureElfSalvageReq; -import com.accompany.core.exception.AdminServiceException; import com.accompany.core.service.message.MessageRobotPushService; import com.accompany.business.service.room.RoomService; import com.accompany.business.service.user.UserActPropertyInfoV2Service; @@ -1393,7 +1392,7 @@ public class SeizeTreasureService { @Transactional(rollbackFor = Exception.class) public List elfSalvage(Long uid, SeizeTreasureElfSalvageReq salvageReq) { if (!checkAuthority()) { - throw new AdminServiceException(BusiStatus.NOT_ENOUGH_LEVEL); + throw new ServiceException(BusiStatus.NOT_ENOUGH_LEVEL); } log.info("SeizeTreasureService elfSalvage uid : {}, salvageReq : {}", uid, salvageReq); List expendList = salvageReq.getExpendList(); @@ -1410,14 +1409,14 @@ public class SeizeTreasureService { .in(SeizeTreasureProp::getId, elfIdMap.keySet()).list(); //参数中的道具信息有不存在的相关道具信息 if (propList.size() != elfIdMap.keySet().size()) { - throw new AdminServiceException(BusiStatus.PARAMERROR); + throw new ServiceException(BusiStatus.PARAMERROR); } //扣除道具 propList.forEach(prop -> { Long propId = prop.getId(); Boolean reduceSuccess = seizeTreasureUserPropService.reduceUserProp(uid, propId, elfIdMap.get(propId).getElfNum()); if (!reduceSuccess) { - throw new AdminServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH.value(), prop.getName() + "數量不足"); + throw new ServiceException(BusiStatus.SEIZE_TREASURE_USER_PROP_NOT_ENOUGH); } }); log.info("SeizeTreasureService elfSalvage reduceUserProp uid : {}, propList : {} success", uid, propList); @@ -1432,7 +1431,7 @@ public class SeizeTreasureService { rateMap.put(PropLevel.L3, Arrays.asList(400, 500)); } if (CollectionUtil.isEmpty(rateMap)) { - throw new AdminServiceException("缺少分解率"); + throw new ServiceException("缺少分解率"); } List records = new ArrayList<>(); //分解 diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java index f82ab180a..819a0a4e0 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/treasure/impl/SeizeTreasureShardServiceImpl.java @@ -12,7 +12,6 @@ import com.accompany.business.service.treasure.SeizeTreasureShardService; import com.accompany.business.service.user.UserActPropertyInfoV2Service; import com.accompany.business.vo.treasure.SeizeTreasureSwitchConfig; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.status.BusiStatus; import com.accompany.core.enumeration.BillObjTypeEnum; import com.accompany.core.exception.ServiceException; @@ -61,7 +60,7 @@ public class SeizeTreasureShardServiceImpl implements SeizeTreasureShardService UserPurse userPurse = userPurseService.queryUserPurse(uid); double currentDiamonds = userPurse.getDiamonds(); if (Double.compare(currentDiamonds, diamondNum) < 0) { - throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new ServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } //扣减钱包 if (!userPurseService.subDiamond(uid, (double) diamondNum, BillObjTypeEnum.ACTIVITY_SEIZE_TREASURE_PACK.getDesc())) { @@ -69,7 +68,7 @@ public class SeizeTreasureShardServiceImpl implements SeizeTreasureShardService currentDiamonds = userPurse.getDiamonds(); if (Double.compare(currentDiamonds, diamondNum) < 0) { log.error("[购买精灵碎片] {} 钱包钻石数 {} 少于需要扣钻石数 {}", uid, currentDiamonds, diamondNum); - throw new AdminServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); + throw new ServiceException(BusiStatus.NOT_ENOUGH_DIAMOND); } log.error("[购买精灵碎片] {} 当前钱包钻石数 {},扣钻石数 {} 不成功", uid, currentDiamonds, diamondNum); throw new ServiceException(BusiStatus.SERVERBUSY); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleLevelService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleLevelService.java deleted file mode 100644 index 96580d073..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleLevelService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.accompany.business.service.user; - - -import com.accompany.business.model.user.UserCoupleLevel; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * 用户CP等级经验表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -public interface UserCoupleLevelService extends IService { - - void initUserCpLevelCache(); - - UserCoupleLevel getUserCpLevelBySeq(Integer leveSeq); - - Integer cacluCpLevelBySecretVal(Long secretVal); - - -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleService.java deleted file mode 100644 index b6adcb5c8..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.accompany.business.service.user; - - -import com.accompany.business.dto.*; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserNameplateApplyRecord; -import com.accompany.business.model.user.UserRelationPrivilege; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - * 用户CP表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -public interface UserCoupleService extends IService { - - void makeCpInvite(Long inviteUid, Long acceptUid, Integer propsId, String declaration); - - int replyCpInvite(Long id, Byte state); - - void sendActivityFortuneMsg(Long toUid, String msgTxt); - - List userCpList(Long uid, Byte type); - - void unboundCp(Long uid); - - void revertUnboundCp(Long uid); - - void unboundDeal(Long id); - - void addSecretVal(Long id, Long secretVal); - - UserCpMpDto userCpLevelMpList(Long uid); - - void cpMpApply(Long uid, Long mpId, String mpTxt); - - List cpMpApplyList(Long uid, Integer pageNumber, Integer pageSize); - - UserCouple queryCpByUid(Long uid, Boolean isIncludeWaitState); - - CpInviteLetterDto cpInvitePage(Long inviteUid, Long acceptUid, String declaration); - - CpInviteLetterDto cpRecordDetail(Long cpId); - - CpRelationDto cpRelation(Long currentUid, Long uid); - - CpTaskProcessDto cpTaskProcess(Long uid); - - void sendCpUserAppPageSkipMessage(Long uid, String content, byte pageType); - - void sendSecretaryMessage(Long uid, String title, String content, Byte routerType, Boolean needPush); - - void inviteCpTopMsg(UserCouple userCouple, String content); - - void clearCpUserMp(List inviteUserApplyRecordList, Long uid); - - void executeWearCpHeadwear(List cpHeadwearList, Long uid); - - -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleTaskService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleTaskService.java deleted file mode 100644 index d81ec877e..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserCoupleTaskService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.accompany.business.service.user; - - -import com.accompany.business.dto.CpTaskProcessDto; -import com.accompany.business.model.user.UserCoupleTask; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - * CP用户任务表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-11 19:05:41 - */ -public interface UserCoupleTaskService extends IService { - UserCoupleTask queryCoupleDailyTaskByType(Byte taskType); - - List queryCoupleTotalTaskByType(Byte taskType); -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserNameplateApplyRecordService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserNameplateApplyRecordService.java index 01dd61f2f..32dc5cfe3 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserNameplateApplyRecordService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserNameplateApplyRecordService.java @@ -18,10 +18,6 @@ public interface UserNameplateApplyRecordService extends IService queryApplyRecordExcludeNoPassByUid(Long uid, String objId); - void updateCpMpAuditType(Long uid, Long auditId, Byte type, Integer auditType, Long userNameplateId); - - UserNameplateApplyRecord queryMpApplyRecordByAduitId(Long auditId); - List queryCpUserPointMpApply(@NonNull Long uid, String objId, Long nameplateId); } diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPrivilegeService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPrivilegeService.java deleted file mode 100644 index 975b16f29..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPrivilegeService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.accompany.business.service.user; - - -import com.accompany.business.model.user.UserRelationPrivilege; -import com.baomidou.mybatisplus.extension.service.IService; - -import java.util.List; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -public interface UserRelationPrivilegeService extends IService { - List queryMpPrivilegeByGenderAndCpLevel(Byte gender, Integer levelSeq, Boolean isEqLevel); - - List queryCpBackImgPrivilegeByCpLevel(Integer levelSeq); - - List queryCpHeadwearPrivilegeByCpLevel(Integer levelSeq, Boolean isEqLevel); - - List queryCpPrivilegeByCpLevel(Integer levelSeq, Boolean isEqLevel); - - List queryMpPrivilegeByGender(Byte gender); -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPropsService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPropsService.java deleted file mode 100644 index 866c9ccde..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UserRelationPropsService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.accompany.business.service.user; - - -import com.accompany.business.model.user.UserRelationProps; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * 用户关系道具表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -public interface UserRelationPropsService extends IService { - UserRelationProps getValidPropsByType(Byte type); - -} - diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UsersService.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UsersService.java index c2f079a44..3b4bc1c19 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UsersService.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/UsersService.java @@ -10,9 +10,7 @@ import com.accompany.business.event.NewUserEvent; import com.accompany.business.event.RoomCacheDealEvent; import com.accompany.business.model.*; import com.accompany.business.model.clan.Clan; -import com.accompany.business.model.user.UserCouple; import com.accompany.business.mybatismapper.*; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; import com.accompany.business.param.UserParam; import com.accompany.business.sensitvienew.SensitiveFilterUtil; import com.accompany.business.service.ErBanNetEaseService; @@ -142,8 +140,6 @@ public class UsersService extends BaseService { @Autowired private SkillCardUserRecordService skillCardUserRecordService; @Autowired - private RecommendRoomRecordMapper recommendRoomRecordMapper; - @Autowired private UsersMapperExpend usersMapperExpend; @Autowired private HallService hallService; @@ -186,8 +182,6 @@ public class UsersService extends BaseService { @Autowired private QueryRoomService queryRoomService; @Autowired - private UserCoupleMapper userCoupleMapper; - @Autowired private UserRoomCardService userRoomCardService; @Autowired private ChannelContentPartitionService channelContentPartitionService; @@ -535,7 +529,6 @@ public class UsersService extends BaseService { if (CollectionUtils.isEmpty(userVoList)) { return busiResult; } - addUserCpState(uid, userVoList); busiResult.setData(userVoList); return busiResult; } @@ -1039,91 +1032,6 @@ public class UsersService extends BaseService { return usersMap; } - - /** - * 查询推荐房间给新用户 - * - * @param uid - * @return - */ - public Long getRecommendRoomAndRecord(Long uid) { - Long defaultValue = 0L; - Users user = this.getUsersByUid(uid); - if (user == null || !this.isNewUser(user)) { - return defaultValue; - } - - // 女性用户推荐男模厅,男性用户推荐女模厅 - String gender = Constant.UserGender.MALE.equals(user.getGender()) ? Constant.UserGender.FEMALE.toString() : Constant.UserGender.MALE.toString(); - Long total = this.jedisService.llen(RedisKey.newcomer_recommend_room.getKey(gender)); - if (total == null || total <= 0) { - return defaultValue; - } - - Long index = this.jedisService.incr(RedisKey.newcomer_recommend_room_index.getKey(gender)); - Long offset = (index <= total) ? (index - 1) : (index % total - 1); - List rooms = this.jedisService.lrange(RedisKey.newcomer_recommend_room.getKey(gender), offset, offset); - Long room = rooms == null || rooms.isEmpty() ? 0L : Long.parseLong(rooms.get(0)); - if (room != 0) { - this.insertRecommendRoomRecord(uid, room); - } - - return room; - } - - private void insertRecommendRoomRecord(Long uid, Long roomUid) { - RecommendRoomRecord record = new RecommendRoomRecord(); - record.setUid(uid); - record.setRoomUid(roomUid); - record.setCreateTime(Calendar.getInstance().getTime()); - record.setUpdateTime(Calendar.getInstance().getTime()); - this.recommendRoomRecordMapper.insertSelective(record); - } - - /** - * 获取一周内登录的用户 - * 分页获取正常用户uid(除开机器人) - * - * @param page - * @param pageSize - * @return - */ - public List getUidsByPage(Integer page, Integer pageSize) { - //return usersMapperExpend.findNormalUidsByPage(((page - 1) * pageSize), pageSize); - Date now = new Date(); - String startTime = DateTimeUtil.convertDate(DateTimeUtil.getLastDay(now, 3), DateTimeUtil.DEFAULT_DATE_PATTERN); - return usersMapperExpend.findLoginUidByPage(startTime, ((page - 1) * pageSize), pageSize); - } - - public List getUidsByPageRes(Integer page, Integer pageSize, Integer days) { - //return usersMapperExpend.findNormalUidsByPage(((page - 1) * pageSize), pageSize); - Date now = new Date(); - String startTime = DateTimeUtil.convertDate(DateTimeUtil.getLastDay(now, days), DateTimeUtil.DEFAULT_DATE_PATTERN); - return usersMapperExpend.findLoginUidByPage(startTime, ((page - 1) * pageSize), pageSize); - } - - /** - * 获取正常用户数量 - * - * @return - */ - public Long getNormalCount() { - Date now = new Date(); - String startTime = DateTimeUtil.convertDate(DateTimeUtil.getLastDay(now, 3), DateTimeUtil.DEFAULT_DATE_PATTERN); - return usersMapperExpend.selectLoginCount(startTime); - } - - /** - * 获取规定时间内 - * - * @return - */ - public long getNormalCountWithDays(Integer days) { - Date now = new Date(); - String startTime = DateTimeUtil.convertDate(DateTimeUtil.getLastDay(now, days), DateTimeUtil.DEFAULT_DATE_PATTERN); - return usersMapperExpend.selectLoginCount(startTime); - } - /** * 校验支付密码 * @@ -1656,51 +1564,6 @@ public class UsersService extends BaseService { } } - - public void addUserCpState(Long uid, List userVoList) { - if (CollectionUtils.isEmpty(userVoList)) return; - - List uidList = userVoList.stream().map(UserVo::getUid).collect(Collectors.toList()); - - List stateList = Arrays.asList(Constant.UserCoupleState.invite, Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.in(UserCouple::getInviteUid, uidList).or().in(UserCouple::getAcceptUid, uidList)).in(UserCouple::getState, stateList); - - List userCoupleList = userCoupleMapper.selectList(queryWrapper); - - - Map inviteUserCoupleMap = new HashMap<>(); - Map acceptUserCoupleMap = new HashMap<>(); - if (!CollectionUtils.isEmpty(userCoupleList)) { - for (UserCouple userCouple : userCoupleList) { - inviteUserCoupleMap.put(userCouple.getInviteUid(), userCouple); - acceptUserCoupleMap.put(userCouple.getAcceptUid(), userCouple); - } - } - - for (UserVo userVo : userVoList) { - UserCouple userCouple = inviteUserCoupleMap.get(userVo.getUid()); - if (ObjectUtil.isNull(userCouple)) userCouple = acceptUserCoupleMap.get(userVo.getUid()); - - if (ObjectUtil.isNull(userCouple)) { - userVo.setCpState((byte) 3); - continue; - } - - - if (Constant.UserCoupleState.invite.equals(userCouple.getState())) { - if (userCouple.getInviteUid().equals(uid) || userCouple.getAcceptUid().equals(uid)) - userVo.setCpState((byte) 1); - else userVo.setCpState((byte) 3); - continue; - } - - - if (Constant.UserCoupleState.cp.equals(userCouple.getState()) || Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) - userVo.setCpState((byte) 2); - } - } - public UserRoomCardVo getUserRoomCard(Long currentUid) { // 当前用户当日弹出次数限定 String dailyNumStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.USER_ROOM_CARD_DAILY_NUM, "5"); diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleLevelServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleLevelServiceImpl.java deleted file mode 100644 index 81ca2f9a4..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleLevelServiceImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.accompany.business.service.user.impl; - -import cn.hutool.core.collection.CollectionUtil; -import com.accompany.business.model.user.UserCoupleLevel; -import com.accompany.business.mybatismapper.user.UserCoupleLevelMapper; -import com.accompany.business.service.user.UserCoupleLevelService; -import com.accompany.common.constant.UserCpLevelArr; -import com.accompany.common.redis.RedisKey; -import com.accompany.core.service.common.JedisService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.gson.Gson; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; - -import javax.annotation.PostConstruct; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 用户CP等级经验表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -@Service -public class UserCoupleLevelServiceImpl extends ServiceImpl implements UserCoupleLevelService { - private Logger logger = LoggerFactory.getLogger(UserCoupleLevelServiceImpl.class); - - @Autowired - private JedisService jedisService; - - private Gson gson = new Gson(); - - @Override - @PostConstruct - public void initUserCpLevelCache() { - initUserCpLevel(); - } - - @Override - public UserCoupleLevel getUserCpLevelBySeq(Integer leveSeq) { - if (leveSeq == null) return null; - if (!jedisService.exits(RedisKey.user_couple_level_config.getKey())) { - this.initUserCpLevel(); - } - - String levelStr = jedisService.hget(RedisKey.user_couple_level_config.getKey(), String.valueOf(leveSeq)); - if (StringUtils.isEmpty(levelStr)) return null; - - return gson.fromJson(levelStr, UserCoupleLevel.class); - } - - private void initUserCpLevel() { - List userCoupleLevelList = this.list(); - //数据库暂未设置守护团任务,作个判断 - if (CollectionUtil.isEmpty(userCoupleLevelList)) { - logger.info("userCoupleLevelConfig init,configList is Null!!!"); - return; - } - - userCoupleLevelList = userCoupleLevelList.stream().sorted(Comparator.comparing(UserCoupleLevel::getLevelSeq)).collect(Collectors.toList()); - - //初始化之前清除原有的数据,防止数据混乱 - jedisService.del(RedisKey.user_couple_level_config.getKey()); - - UserCpLevelArr.secretVal = new Long[userCoupleLevelList.size()]; - for (int i = 0; i < UserCpLevelArr.secretVal.length; i++) { - UserCoupleLevel userCoupleLevel = userCoupleLevelList.get(i); - jedisService.hset(RedisKey.user_couple_level_config.getKey(), String.valueOf(userCoupleLevel.getLevelSeq()), gson.toJson(userCoupleLevel)); - UserCpLevelArr.secretVal[i] = userCoupleLevel.getAmount(); - } - - - logger.info("guardsLevelConfig has init!!!"); - } - - @Override - public Integer cacluCpLevelBySecretVal(Long secretVal) { - Integer levelSeq = 1; - - if (secretVal == null) return levelSeq; - - if (!jedisService.exits(RedisKey.user_couple_level_config.getKey())) { - this.initUserCpLevel(); - } - for (int i = 0; i < UserCpLevelArr.secretVal.length; i++) { - if (secretVal >= UserCpLevelArr.secretVal[i]) levelSeq = i + 1; - else break; - } - - return levelSeq; - } - - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java deleted file mode 100644 index a9d93aab4..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleServiceImpl.java +++ /dev/null @@ -1,2018 +0,0 @@ -package com.accompany.business.service.user.impl; - -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.accompany.business.constant.nameplate.StatusEnum; -import com.accompany.business.dto.*; -import com.accompany.business.dto.yidun.CpTaskDetailDto; -import com.accompany.business.event.WriteCpInviteBillEvent; -import com.accompany.business.model.*; -import com.accompany.business.model.clan.ClanAccountAssociate; -import com.accompany.business.model.user.*; -import com.accompany.business.mybatismapper.NameplateMapper; -import com.accompany.business.mybatismapper.UserNameplateMapper; -import com.accompany.business.mybatismapper.user.UserCoupleMapper; -import com.accompany.business.mybatismapper.user.UserNameplateApplyRecordMapper; -import com.accompany.business.param.neteasepush.Body; -import com.accompany.business.param.neteasepush.NeteaseSendMsgBatchParam; -import com.accompany.business.param.neteasepush.NeteaseSendMsgParam; -import com.accompany.business.param.neteasepush.Payload; -import com.accompany.business.service.SendSysMsgService; -import com.accompany.business.service.clan.ClanAccountAssociateService; -import com.accompany.business.service.hall.HallService; -import com.accompany.business.service.headwear.HeadwearService; -import com.accompany.business.service.nameplate.NameplateAuditRecordService; -import com.accompany.business.service.netease.YidunCheckUtil; -import com.accompany.business.service.purse.UserPurseService; -import com.accompany.business.service.record.BillRecordService; -import com.accompany.business.service.room.RoomService; -import com.accompany.business.service.task.InviteCpDenyTaskService; -import com.accompany.business.service.task.UnboundUserCpTaskService; -import com.accompany.business.service.user.*; -import com.accompany.common.config.SystemConfig; -import com.accompany.common.constant.ApplicationConstant; -import com.accompany.common.constant.Attach; -import com.accompany.common.constant.Constant; -import com.accompany.common.constant.HeadwearConstant; -import com.accompany.common.redis.RedisKey; -import com.accompany.common.status.BusiStatus; -import com.accompany.common.utils.DateTimeUtil; -import com.accompany.common.utils.EnvComponent; -import com.accompany.common.utils.StringUtils; -import com.accompany.core.base.SpringContextHolder; -import com.accompany.core.enumeration.BillObjTypeEnum; -import com.accompany.core.exception.ServiceException; -import com.accompany.core.model.Room; -import com.accompany.core.model.Users; -import com.accompany.core.service.SysConfService; -import com.accompany.core.service.common.JedisLockService; -import com.accompany.core.service.common.JedisService; -import com.accompany.core.service.task.TaskManageService; -import com.accompany.core.service.user.UsersBaseService; -import com.accompany.core.vo.headwear.UserHeadwearVo; -import com.accompany.core.vo.user.UserNameplateVo; -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.google.common.collect.ImmutableMap; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationContext; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -/** - * 用户CP表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -@Slf4j -@Service -public class UserCoupleServiceImpl extends ServiceImpl implements UserCoupleService { - - @Autowired - private UserPurseService userPurseService; - - @Autowired - private UserRelationPropsService userRelationPropsService; - - @Autowired - private SysConfService sysConfService; - - @Autowired - private JedisLockService jedisLockService; - - @Autowired - private UserCoupleMapper userCoupleMapper; - - @Autowired - private HallService hallService; - - @Autowired - private BillRecordService billRecordService; - - @Autowired - private SendSysMsgService sendSysMsgService; - - @Autowired - private UsersBaseService usersBaseService; - - @Autowired - private JedisService jedisService; - - @Autowired - private UserCoupleLevelService userCoupleLevelService; - - @Autowired - private UserCoupleTaskService userCoupleTaskService; - - @Autowired - private UserRelationPrivilegeService userRelationPrivilegeService; - - @Autowired - private NameplateMapper nameplateMapper; - - @Autowired - private NameplateAuditRecordService nameplateAuditRecordService; - - @Autowired - private UserNameplateApplyRecordService userNameplateApplyRecordService; - - @Autowired - private UserNameplateApplyRecordMapper userNameplateApplyRecordMapper; - - @Autowired - private UserNameplateMapper userNameplateMapper; - - @Autowired - private HeadwearService headwearService; - - @Autowired - private ApplicationContext applicationContext; - - @Autowired - private EnvComponent envComponent; - - @Autowired - private RoomService roomService; - - @Autowired - private ClanAccountAssociateService clanAccountAssociateService; - - @Autowired - private TaskManageService taskManageService; - - private Gson gson = new Gson(); - - - /** - * 获取当前生效道具 - * - * @param inviteUid - * @param acceptUid - * @param propsId - * @param declaration - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void makeCpInvite(Long inviteUid, Long acceptUid, Integer propsId, String declaration) { - if (StringUtils.isBlank(declaration)) - throw new ServiceException(BusiStatus.CP_INVITE_DECLARATION_NOT_ALLOW_EXISTS); - if (declaration.length() < 5 || declaration.length() > 20) - throw new ServiceException(BusiStatus.CP_INVITE_DECLARATION_LEN_ERR); - if (inviteUid.equals(acceptUid)) throw new ServiceException(BusiStatus.USER_SELF_MAKE_INVITE_ERR); - - Boolean isSensitive = YidunCheckUtil.checkHasSensitiveWord(declaration); -// Boolean isSensitive = SensitiveFilterUtil.getBooleanSensitiveFilter(declaration); -// String sensitiveStr = SensitiveFilterUtil.getStringSensitiveFilter(declaration.trim()); - if (isSensitive) { - log.info("用户{}邀请用户{}组CP关系誓言{}", inviteUid, acceptUid, declaration); - throw new ServiceException(BusiStatus.HAS_SENSITIVE); - } - - String lockKey = RedisKey.invite_make_cp_lock.getKey(String.valueOf(inviteUid)); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); - - try { - String currentDateStr = DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_); - Integer invitLimitNum = Integer.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.CP_INVITE_DAY_LIMIT, String.valueOf(Constant.UserRelationDefaultVal.cp_invite_day_limit))); - Integer currentNum = 0; - String currentNumStr = jedisService.get(RedisKey.cp_invite_limit.getKey(inviteUid + StrUtil.UNDERLINE + currentDateStr)); - if (!StringUtils.isEmpty(currentNumStr)) currentNum = Integer.valueOf(currentNumStr); - if (currentNum >= invitLimitNum) throw new ServiceException("今日邀請已達次數限制!"); - //检查邀请双方是否已有CP,已有不允许 - this.checkInviteUserOwnCp(inviteUid); - this.checkAcceptUserOwnCp(acceptUid); - - Users inviteUser = usersBaseService.getUsersByUid(inviteUid); - Users acceptUser = usersBaseService.getUsersByUid(acceptUid); - if (inviteUser.getGender().equals(acceptUser.getGender())) throw new ServiceException("只能和異性組CP哦~"); - - //获取CP道具 - UserRelationProps userRelationProps = userRelationPropsService.getById(propsId); - if (ObjectUtil.isNull(userRelationProps) || !ObjectUtil.equal(Constant.UserRelationPropsStatus.valid, userRelationProps.getStatus())) - throw new ServiceException("當前CP道具已失效,請返回重新確認!"); - //钻石余额扣除 - Boolean ret = userPurseService.subDiamond(inviteUid, userRelationProps.getPrice().doubleValue(), BillObjTypeEnum.CP_PROPS_PAY.getDesc()); - if (!ret) throw new ServiceException(BusiStatus.PURSEMONEYNOTENOUGH); - log.info("用户{}邀请用户{}组CP执行钻石余额扣除{}", inviteUid, acceptUid, userRelationProps.getPrice().doubleValue()); - - //写入CP记录表 - UserCouple userCouple = new UserCouple(); - userCouple.setInviteUid(inviteUid); - userCouple.setAcceptUid(acceptUid); - userCouple.setPropsId(propsId); - userCouple.setState(Constant.UserCoupleState.invite); - userCouple.setDeclaration(declaration); - userCouple.setCreateTime(new Date()); - //计算cp等级 - userCouple.setLevelSeq(1); - save(userCouple); - log.info("用户{}邀请用户{}组CP写入邀请记录{}", inviteUid, acceptUid, userCouple.getId()); - - CpInviteBillRecordDto cpInviteBillRecordDto = this.buildCpInviteBillRecordDto(inviteUid, 0l, null, String.valueOf(userCouple.getId()), BillObjTypeEnum.CP_PROPS_PAY, userRelationProps.getPrice().doubleValue(), null, 0); - - SpringContextHolder.getBean(UserCoupleService.class).inviteCpTopMsg(userCouple, String.format(Constant.UserRelationDefaultVal.make_cp_invite_msg, inviteUser.getNick())); - - //开启24小时自动拒绝倒计时 - String ttlStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.INVITE_CP_AUTO_DENY_TIME, String.valueOf(Constant.UserRelationDefaultVal.auto_deny_val)); - Date currentTime = new Date(); - Long denyTimeMs = currentTime.getTime() + Integer.valueOf(ttlStr) * 60 * 60 * 1000; - loadDenyCpInviteTask(userCouple.getId(), DateTimeUtil.convertMsToDate(denyTimeMs)); - - jedisService.incr(RedisKey.cp_invite_limit.getKey(inviteUid + StrUtil.UNDERLINE + currentDateStr)); - - applicationContext.publishEvent(new WriteCpInviteBillEvent(Arrays.asList(cpInviteBillRecordDto))); - } catch (ServiceException e) { - if (ObjectUtil.isNull(e.getBusiStatus())) throw new ServiceException(e.getMessage()); - else throw new ServiceException(e.getBusiStatus()); - } catch (Exception e) { - log.error("发起CP邀请失败<{},{},{}>", inviteUid, acceptUid, e); - e.printStackTrace(); - throw new ServiceException(e.getMessage()); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - } - - - public void loadDenyCpInviteTask(Long id, Date denyTime) { - try { - SpringContextHolder.getBean(InviteCpDenyTaskService.class).addTask(Constant.UserRelationDefaultVal.deny_job_sign + id, denyTime, ImmutableMap.of(InviteCpDenyTaskService.INVITE_CP_DENY_JOB, id)); - } catch (Exception e) { - log.error("failed to load inviteCpDenyJob,error", e); - throw new ServiceException("創建定時任務異常:" + e.getMessage()); - } - } - - - /** - * 回复CP邀请 - * - * @param id - * @param state - * @return - */ - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public int replyCpInvite(@NonNull Long id, @NonNull Byte state) { - UserCouple userCouple = this.getById(id); - if (ObjectUtil.isNull(userCouple)) throw new ServiceException("未獲取到相關邀請記錄!"); - - String lockKey = RedisKey.invite_cp_deny_lock.getKey(String.valueOf(userCouple.getAcceptUid())); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); - - int num = 0; - try { - List stateList = Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.deny, Constant.UserCoupleState.expire); - if (!stateList.contains(state)) { - //此处只处理邀请后拒绝或同意,不处理其他状态 - log.info("处理CP邀请其他状态不处理<{},{}>", id, state); - return num; - } - - if (!ObjectUtil.equal(Constant.UserCoupleState.invite, userCouple.getState())) { - log.info("CP邀请{}状态{}发生变更,放弃处理", id, userCouple.getState()); - throw new ServiceException("cp邀請狀態已變更!"); - } - - UserRelationProps userRelationProps = userRelationPropsService.getById(userCouple.getPropsId()); - if (ObjectUtil.isNull(userRelationProps)) { - log.error("获取不到cp邀请{}道具{}", id, userCouple.getPropsId()); - throw new ServiceException("CP邀請道具獲取失敗"); - } - - this.replyCheckUserOwnCp(userCouple.getInviteUid(), "对方已与其他用户组CP!"); - this.replyCheckUserOwnCp(userCouple.getAcceptUid(), "您已与其他用户组成CP!"); - - //避免出现A邀请B,B邀请C,C同意B的同时B同意A的情况出现 - //recheckUserCp(state, userCouple); - - Users inviteUsers = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUsers = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - - UserCouple entity = new UserCouple(); - entity.setState(state); - if (ObjectUtil.equal(Constant.UserCoupleState.cp, state)) entity.setAcceptTime(new Date()); - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda().eq(UserCouple::getId, id); - this.getBaseMapper().update(entity, updateWrapper); - - - List billRecordDtoList = new ArrayList<>(); - //如果是同意 - if (ObjectUtil.equal(Constant.UserCoupleState.cp, state)) { - log.info("cp邀请{}被邀请方{}同意邀请方{}组CP", id, userCouple.getAcceptUid(), userCouple.getInviteUid()); - - - //再次验证关联号和牌照房 - if (checkIsPermit(userCouple.getInviteUid()) || checkIsAssociateAccount(userCouple.getInviteUid())) - throw new ServiceException("對方已失去組cp權限哦~"); - if (checkIsPermit(userCouple.getAcceptUid()) || checkIsAssociateAccount(userCouple.getAcceptUid())) - throw new ServiceException("您沒有組cp權限哦"); - //查詢被邀請方收到的組CP請求 - List acceptUserCpInviteList = queryCpRecordByAcceptUid(userCouple.getAcceptUid()); - - for (UserCouple updateRecord : acceptUserCpInviteList) { - UserRelationProps cpRelationProps = userRelationPropsService.getById(updateRecord.getPropsId()); - log.info("同意cp邀请{}后被邀请方{}拒绝其他组CP请求{}", id, userCouple.getAcceptUid(), updateRecord.getId()); - //更新为拒绝 - updateRecord.setState(Constant.UserCoupleState.deny); - updateRecord.setUpdateTime(new Date()); - this.updateById(updateRecord); - - //返回钻石 - userPurseService.addDiamond(updateRecord.getInviteUid(), cpRelationProps.getPrice().doubleValue(), null, BillObjTypeEnum.CP_INVITE_DENY_REFUND.getDesc()); - log.info("同意cp邀请{}后被邀请方{}拒绝其他组cp邀请{}并返回钻石{}", id, userCouple.getAcceptUid(), updateRecord.getId(), cpRelationProps.getPrice().doubleValue()); - - //记录流水返还 - CpInviteBillRecordDto denyCpBillRecord = this.buildCpInviteBillRecordDto(updateRecord.getInviteUid(), 0l, null, String.valueOf(updateRecord.getId()), BillObjTypeEnum.CP_INVITE_DENY_REFUND, cpRelationProps.getPrice().doubleValue(), null, 0); - billRecordDtoList.add(denyCpBillRecord); - - } - - //获取分成配置 - String perRateConfigStr = sysConfService.getSysConfValueById(Constant.SysConfId.BUY_CP_PROPS_PER_RATE); - if (StringUtils.isEmpty(perRateConfigStr)) throw new ServiceException("同意CP邀請失敗,未配置分成比率!"); - log.info("同意cp邀请{}所对应的分成比例{}", id, perRateConfigStr); - UserCpPerRateConfigDto userCpPerRateConfigDto = gson.fromJson(perRateConfigStr, UserCpPerRateConfigDto.class); - - Hall hall = hallService.getHallByHallMember(userCouple.getAcceptUid()); - - Double cpUserPerRate = userCpPerRateConfigDto.getCpUserPerRate(); - Double hallPerRate = userCpPerRateConfigDto.getHallPerRate(); - - if (cpUserPerRate > 0) { - Double cpUserDiamond = userRelationProps.getPrice().multiply(BigDecimal.valueOf(cpUserPerRate)).setScale(0, BigDecimal.ROUND_HALF_UP).doubleValue(); - userPurseService.addCrystal(userCouple.getAcceptUid(), cpUserDiamond, BillObjTypeEnum.CP_INVITE_DENY_REFUND.getDesc()); - log.info("同意CP邀请{}被邀请方{}分成比例{}所得钻石{}", id, userCouple.getAcceptUid(), cpUserPerRate, cpUserDiamond); - CpInviteBillRecordDto billRecordDto = this.buildCpInviteBillRecordDto(userCouple.getAcceptUid(), userCouple.getInviteUid(), null, String.valueOf(userCouple.getId()), BillObjTypeEnum.CP_INVITE_ACCEPT_INCOME, cpUserDiamond, null, 0); - billRecordDtoList.add(billRecordDto); - } - - - if (ObjectUtil.isNotNull(hall) && hallPerRate > 0) { - CpInviteBillRecordDto hallOwnerBillRecordDto; - //检测会长是否为关联号 - ClanAccountAssociate clanAccountAssociate = clanAccountAssociateService.checkIsAssociateAccount(hall.getOwnerUid()); - - Double hallOwnerDiamond = userRelationProps.getPrice().multiply(BigDecimal.valueOf(hallPerRate)).setScale(0, BigDecimal.ROUND_HALF_UP).doubleValue(); - if (ObjectUtil.isNull(clanAccountAssociate)) { - - userPurseService.addCrystal(hall.getOwnerUid(), hallOwnerDiamond, BillObjTypeEnum.CP_INVITE_DENY_REFUND.getDesc()); - log.info("同意CP邀请{}会长{}分成比例{}所得钻石{}", id, hall.getOwnerUid(), hallPerRate, hallOwnerDiamond); - - hallOwnerBillRecordDto = this.buildCpInviteBillRecordDto(hall.getOwnerUid(), userCouple.getAcceptUid(), null, String.valueOf(userCouple.getId()), BillObjTypeEnum.HALL_OWNER_CP_INVITE_EARN, hallOwnerDiamond, null, 0); - hallOwnerBillRecordDto.setHallPerRate(hallPerRate); - } else { - log.info("同意CP邀请{}会长{}为关联号分成比例{}所得钻石{}流转到族长{}", id, hall.getOwnerUid(), hallPerRate, hallOwnerDiamond, clanAccountAssociate.getClanElderUid()); - userPurseService.addCrystal(clanAccountAssociate.getClanElderUid(), hallOwnerDiamond, "关联账号流转"); - hallOwnerBillRecordDto = this.buildCpInviteBillRecordDto(hall.getOwnerUid(), userCouple.getAcceptUid(), null, String.valueOf(userCouple.getId()), BillObjTypeEnum.HALL_OWNER_CP_INVITE_EARN, hallOwnerDiamond, null, 0); - - hallOwnerBillRecordDto.setHallPerRate(hallPerRate); - hallOwnerBillRecordDto.setClanAccountAssociate(clanAccountAssociate); - - } - billRecordDtoList.add(hallOwnerBillRecordDto); - - - } else { - log.info("同CP邀请{}用户{}所属工会为空,工会分成比例{}流转到官方", id, userCouple.getAcceptUid(), userCpPerRateConfigDto.getHallPerRate()); - } - - - //检查是否自动佩戴头饰 - List cpHeadwearList = userRelationPrivilegeService.queryCpHeadwearPrivilegeByCpLevel(userCouple.getLevelSeq(), true); - SpringContextHolder.getBean(UserCoupleService.class).executeWearCpHeadwear(cpHeadwearList, userCouple.getInviteUid()); - SpringContextHolder.getBean(UserCoupleService.class).executeWearCpHeadwear(cpHeadwearList, userCouple.getAcceptUid()); - - //给双方发CP组成消息 - UserCoupleLevel userCoupleLevel = userCoupleLevelService.getUserCpLevelBySeq(1); - String cpUpLevelMsgToInvite = String.format(userCoupleLevel.getUpLevelMsg(), acceptUsers.getNick()); - String cpUpLevelMsgToAccept = String.format(userCoupleLevel.getUpLevelMsg(), inviteUsers.getNick()); - cpLevelUpMsg(inviteUsers.getUid(), userCoupleLevel.getUpLevelSkipUrl(), "組成關係", cpUpLevelMsgToInvite); - cpLevelUpMsg(acceptUsers.getUid(), userCoupleLevel.getUpLevelSkipUrl(), "組成關係", cpUpLevelMsgToAccept); - - //接受邀请后给其他用户发拒绝通知 - for (UserCouple updateRecord : acceptUserCpInviteList) { - Users cpAcceptUsers = Optional.ofNullable(usersBaseService.getUsersByUid(updateRecord.getAcceptUid())).orElse(new Users()); - String denyMsg = String.format(Constant.UserRelationDefaultVal.deny_cp_invite_msg, cpAcceptUsers.getNick()); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(userCouple.getInviteUid(), denyMsg); - } - } else { - log.info("cp邀请{}被邀请方{}拒绝邀请方{}组CP", id, userCouple.getAcceptUid(), userCouple.getInviteUid()); - //返回钻石 - userPurseService.addDiamond(userCouple.getInviteUid(), userRelationProps.getPrice().doubleValue(), null, BillObjTypeEnum.CP_INVITE_DENY_REFUND.getDesc()); - log.info("拒绝cp邀请{}返回邀请方{}钻石{}", id, userCouple.getInviteUid(), userRelationProps.getPrice().doubleValue()); - - //记录流水返还 - CpInviteBillRecordDto cpInviteBillRecordDto = this.buildCpInviteBillRecordDto(userCouple.getInviteUid(), 0l, null, String.valueOf(userCouple.getId()), BillObjTypeEnum.CP_INVITE_DENY_REFUND, userRelationProps.getPrice().doubleValue(), null, 0); - billRecordDtoList.add(cpInviteBillRecordDto); - - String denyMsg = String.format(Constant.UserRelationDefaultVal.deny_cp_invite_msg, acceptUsers.getNick()); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(userCouple.getInviteUid(), denyMsg); - } - applicationContext.publishEvent(new WriteCpInviteBillEvent(billRecordDtoList)); - } catch (ServiceException e) { - if (ObjectUtil.isNull(e.getBusiStatus())) throw new ServiceException(e.getMessage()); - else throw new ServiceException(e.getBusiStatus()); - } catch (Exception e) { - log.error("CP邀请状态处理失败<{},{},{}>", id, state, e); - e.printStackTrace(); - throw new ServiceException(e.getMessage()); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - - return num; - } - - - /** - * 重新检查用户CP关系:避免出现A邀请B,B邀请C,C同意B的同时B同意A的情况出现 - * @param state - * @param userCouple - */ - /*private void recheckUserCp(Byte state, UserCouple userCouple) throws IOException { - if (ObjectUtil.equal(Constant.UserCoupleState.cp, state)) { - if (jedisService.exits(RedisKey.accept_cp_verify_lock.getKey(String.valueOf(userCouple.getInviteUid())))) { - throw new ServiceException("对方已与其他用户组CP!"); - }else if(jedisService.exits(RedisKey.accept_cp_verify_lock.getKey(String.valueOf(userCouple.getAcceptUid())))) { - throw new ServiceException("您已与其他用户组成CP!"); - }else { - //设置10s过期 - jedisService.doInPipeline(pipeline -> { - pipeline.setex(RedisKey.accept_cp_verify_lock.getKey(String.valueOf(userCouple.getInviteUid())), 10, String.valueOf(1)); - pipeline.setex(RedisKey.accept_cp_verify_lock.getKey(String.valueOf(userCouple.getAcceptUid())), 10, String.valueOf(1)); - }); - } - } - }*/ - - - /** - * 小秘书消息发送 - * - * @param toUid - * @param msgTxt - */ - @Async - public void sendActivityFortuneMsg(Long toUid, String msgTxt) { - NeteaseSendMsgParam msg = new NeteaseSendMsgParam(); - msg.setOpe(0); - msg.setType(0); - msg.setFrom(SystemConfig.secretaryUid); - msg.setTo(String.valueOf(toUid)); - msg.setBody(msgTxt); - sendSysMsgService.sendMsg(msg); - } - - - /** - * 对邀请方进行校验:在收到回复前,用户只能同时邀请一个用户 - * - * @param uid - * @return - */ - public void checkInviteUserOwnCp(Long uid) { - if (checkIsPermit(uid) || checkIsAssociateAccount(uid)) throw new ServiceException("您沒有組CP權限哦~"); - //检查邀请方是否已有CP,有,不允许发出邀请 - List notCpStateList = Arrays.asList(Constant.UserCoupleState.deny, Constant.UserCoupleState.unbound, Constant.UserCoupleState.expire); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).notIn(UserCouple::getState, notCpStateList); - - List userCoupleList = userCoupleMapper.selectList(queryWrapper); - - if (CollectionUtils.isEmpty(userCoupleList)) return; - - List stateList = userCoupleList.stream().map(UserCouple::getState).distinct().collect(Collectors.toList()); - if (stateList.contains(Constant.UserCoupleState.cp)) { - throw new ServiceException("當前你已有CP,不能與其它用戶再組成CP了哦~"); - } - if (stateList.contains(Constant.UserCoupleState.wait_unbound)) { - throw new ServiceException("當前CP關係正在解綁中,請等待解綁完成后操作哦~"); - } - - //检查邀请方是否有收到cp邀请,有不允许发出邀请 - Map> acceptMap = userCoupleList.stream().collect(Collectors.groupingBy(UserCouple::getAcceptUid)); - if (acceptMap.containsKey(uid)) { - List acceptCpList = acceptMap.get(uid); - if (!CollectionUtils.isEmpty(acceptCpList)) throw new ServiceException("請先處理收到的CP邀請哦~"); - } - - - Map> inviteMap = userCoupleList.stream().collect(Collectors.groupingBy(UserCouple::getInviteUid)); - //检查邀请方是不是有发出其他邀请,有不允许再发 - if (inviteMap.containsKey(uid)) { - List inviteCpList = inviteMap.get(uid); - if (!CollectionUtils.isEmpty(inviteCpList)) throw new ServiceException("已邀請其他用戶,不能發起新邀請哦~"); - } - } - - /** - * 对被邀请方进行校验 - * - * @param uid - * @return - */ - public void checkAcceptUserOwnCp(Long uid) { - if (checkIsPermit(uid) || checkIsAssociateAccount(uid)) throw new ServiceException("該用戶暫無組CP權限哦~"); - //检查被邀请方是否已有CP,有,不允许发出邀请 - List notCpStateList = Arrays.asList(Constant.UserCoupleState.deny, Constant.UserCoupleState.unbound, Constant.UserCoupleState.expire); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).notIn(UserCouple::getState, notCpStateList); - - List userCoupleList = userCoupleMapper.selectList(queryWrapper); - - if (CollectionUtils.isEmpty(userCoupleList)) return; - - List stateList = userCoupleList.stream().map(UserCouple::getState).distinct().collect(Collectors.toList()); - if (stateList.contains(Constant.UserCoupleState.cp)) { - throw new ServiceException("對方已有CP哦~"); - } - if (stateList.contains(Constant.UserCoupleState.wait_unbound)) { - throw new ServiceException("對方CP關係解綁中,請等待對方解綁后再發邀請哦~"); - } - - - Map> inviteMap = userCoupleList.stream().collect(Collectors.groupingBy(UserCouple::getInviteUid)); - //检查被邀请方是不是有发出其他邀请,有不允许再发 - if (inviteMap.containsKey(uid)) { - List inviteCpList = inviteMap.get(uid); - if (!CollectionUtils.isEmpty(inviteCpList)) throw new ServiceException("對方已向其它用戶發起CP邀請~"); - } - } - - - /** - * 回复邀请时再次验证邀用户是否已与其他用户组CP - * - * @param uid - * @return - */ - public void replyCheckUserOwnCp(Long uid, String msg) { - List cpStateList = Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).in(UserCouple::getState, cpStateList); - - UserCouple userCouple = userCoupleMapper.selectOne(queryWrapper); - - if (ObjectUtil.isNotNull(userCouple)) throw new ServiceException(msg); - } - - - /** - * 查询用户作为被邀请方收到的组CP邀请 - * - * @param uid - * @return - */ - public List queryCpRecordByAcceptUid(@NonNull Long uid) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserCouple::getAcceptUid, uid).eq(UserCouple::getState, Constant.UserCoupleState.invite); - - return this.getBaseMapper().selectList(queryWrapper); - } - - - /** - * 邀请列表查询 - * - * @param uid - * @param type - * @return - */ - @Override - public List userCpList(Long uid, Byte type) { - List typeList = Arrays.asList(Constant.CpListType.accept, Constant.CpListType.invite); - if (!typeList.contains(type)) throw new ServiceException(BusiStatus.PARAMERROR); - - List userCoupleList; - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (ObjectUtil.equal(type, Constant.CpListType.accept)) { - //收到的邀请 - queryWrapper.lambda().eq(UserCouple::getAcceptUid, uid).orderByDesc(UserCouple::getId); - userCoupleList = this.getBaseMapper().selectList(queryWrapper); - } else { - //给别人发的邀请 - queryWrapper.lambda().eq(UserCouple::getInviteUid, uid).orderByDesc(UserCouple::getId); - userCoupleList = this.getBaseMapper().selectList(queryWrapper); - } - - List resultList = new ArrayList<>(); - if (CollectionUtils.isEmpty(userCoupleList)) return resultList; - - for (UserCouple userCouple : userCoupleList) { - UserCpRecordDto userCpRecordDto = new UserCpRecordDto(); - BeanUtils.copyProperties(userCouple, userCpRecordDto); - userCpRecordDto.setCpId(userCouple.getId()); - - Users inviteUsers = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUsers = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - - userCpRecordDto.setInviteUserNick(inviteUsers.getNick()); - userCpRecordDto.setInviteUserSex(inviteUsers.getGender()); - userCpRecordDto.setInviteUserAvatar(inviteUsers.getAvatar()); - - userCpRecordDto.setAcceptUserNick(acceptUsers.getNick()); - userCpRecordDto.setAcceptUserSex(acceptUsers.getGender()); - userCpRecordDto.setAcceptUserAvatar(acceptUsers.getAvatar()); - - if (ObjectUtil.equal(userCouple.getState(), Constant.UserCoupleState.invite)) { - String ttlStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.INVITE_CP_AUTO_DENY_TIME, String.valueOf(Constant.UserRelationDefaultVal.auto_deny_val)); - Long denyTimeMs = userCouple.getCreateTime().getTime() + Integer.valueOf(ttlStr) * 60 * 60 * 1000; - Long remainTime = (denyTimeMs - new Date().getTime()) / 1000; - userCpRecordDto.setReplyExpireTime(remainTime < 0 ? 0 : remainTime); - } - - - UserRelationProps userRelationProps = userRelationPropsService.getById(userCouple.getPropsId()); - userCpRecordDto.setPropsId(userRelationProps.getId()); - userCpRecordDto.setPropsName(userRelationProps.getName()); - userCpRecordDto.setPropsImg(userRelationProps.getImg()); - userCpRecordDto.setPropsPrice(userRelationProps.getPrice()); - - resultList.add(userCpRecordDto); - } - return resultList; - } - - - /** - * 解绑 - * - * @param uid - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void unboundCp(@NonNull Long uid) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).eq(UserCouple::getState, Constant.UserCoupleState.cp); - UserCouple userCouple = this.getBaseMapper().selectOne(queryWrapper); - if (ObjectUtil.isNull(userCouple)) throw new ServiceException("獲取不到cp信息!"); - - int diffDay = DateTimeUtil.diffDayByDate(userCouple.getAcceptTime(), new Date()); - Integer unboundLimmitDay = Integer.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.MAKE_CP_UNBOUND_LIMIT, String.valueOf(Constant.UserRelationDefaultVal.make_cp_unbound_limit))); - if (diffDay < unboundLimmitDay) - throw new ServiceException("最少需要陪伴" + (unboundLimmitDay * 24) + "小時候才能解除哦~"); - - if (!envComponent.getDevOrNativeEnv() && jedisService.exits(RedisKey.cp_unbound_freq_limit.getKey(String.valueOf(uid)))) { - throw new ServiceException("解除過於頻繁!"); - } - - userCouple.setUpdateTime(new Date()); - userCouple.setState(Constant.UserCoupleState.wait_unbound); - userCouple.setUnboundUid(uid); - userCouple.setUnboundTime(new Date()); - this.updateById(userCouple); - - - String ttlStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.UNBOUND_CP_WAIT_TIME, String.valueOf(Constant.UserRelationDefaultVal.unbound_cp_wait_time)); - Date currentTime = new Date(); - Long unboundTimeMs = currentTime.getTime() + Integer.valueOf(ttlStr) * 60 * 60 * 1000; - - //小秘书消息 - Users currentUser = Optional.ofNullable(usersBaseService.getUsersByUid(uid)).orElse(new Users()); - String unboundMsg = String.format(Constant.UserRelationDefaultVal.user_cp_wait_unbound_msg, currentUser.getNick()); - - Long anotherUid = userCouple.getInviteUid(); - if (anotherUid.equals(uid)) anotherUid = userCouple.getAcceptUid(); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(anotherUid, unboundMsg); - - - Integer unboundFreqLimmitDay = Integer.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.CP_UNBOUND_FREQ_LIMIT, String.valueOf(Constant.UserRelationDefaultVal.cp_unbound_freq_limit))); - jedisService.setex(RedisKey.cp_unbound_freq_limit.getKey(String.valueOf(uid)), unboundFreqLimmitDay * 24 * 60 * 60, String.valueOf(1)); - - loadUnboundCpTask(userCouple.getId(), DateTimeUtil.convertMsToDate(unboundTimeMs)); - } - - - /** - * 撤销解绑 - * - * @param uid - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void revertUnboundCp(Long uid) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).eq(UserCouple::getState, Constant.UserCoupleState.wait_unbound); - UserCouple userCouple = this.getBaseMapper().selectOne(queryWrapper); - if (ObjectUtil.isNull(userCouple)) throw new ServiceException("獲取不到待解綁記錄!"); - - if (!uid.equals(userCouple.getUnboundUid())) throw new ServiceException("您當前沒有待解綁的記錄!"); - - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda() - .set(UserCouple::getUpdateTime, new Date()) - .set(UserCouple::getState, Constant.UserCoupleState.cp) - .set(UserCouple::getUnboundUid, null).eq(UserCouple::getId, userCouple.getId()).eq(UserCouple::getState, Constant.UserCoupleState.wait_unbound); - Boolean flag = this.update(updateWrapper); - if (!flag) throw new ServiceException("狀態已發生變更!"); - - //小秘书消息 - Users currentUser = Optional.ofNullable(usersBaseService.getUsersByUid(uid)).orElse(new Users()); - String revertUnboundMsg = String.format(Constant.UserRelationDefaultVal.user_cp_revert_unbound_msg, currentUser.getNick()); - Long anotherUid = userCouple.getInviteUid(); - if (anotherUid.equals(uid)) anotherUid = userCouple.getAcceptUid(); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(anotherUid, revertUnboundMsg); - try { - taskManageService.removeTask(Constant.UserRelationDefaultVal.unbound_job_sign + userCouple.getId()); - } catch (Exception e) { - log.error("撤销解除绑定{}取消解绑任务失败", userCouple.getId(), e); - } - } - - public void loadUnboundCpTask(Long id, Date unboundTimeMs) { - try { - SpringContextHolder.getBean(UnboundUserCpTaskService.class).addTask(Constant.UserRelationDefaultVal.unbound_job_sign + id, unboundTimeMs, ImmutableMap.of(UnboundUserCpTaskService.UNBOUND_USER_CP_JOB, id)); - } catch (Exception e) { - log.error("failed to load unboundUserCpJob,error", e); - throw new ServiceException("創建定時任務異常:" + e.getMessage()); - } - } - - /** - * 解绑处理 - * - * @param id:cp关系id - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void unboundDeal(@NonNull Long id) { - UserCouple userCouple = this.getById(id); - if (ObjectUtil.isNull(userCouple)) { - log.info("获取不到解绑中的{}记录信息", id); - throw new ServiceException("獲取不到解綁中的" + id + "記錄信息"); - } - - if (!ObjectUtil.equal(userCouple.getState(), Constant.UserCoupleState.wait_unbound)) { - log.info("记录{}状态{}发生变更,放弃解绑", id, userCouple.getState()); - throw new ServiceException("記錄狀態已發生變更"); - } - - //执行真正的解绑操作... - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda() - .set(UserCouple::getUpdateTime, new Date()) - .set(UserCouple::getState, Constant.UserCoupleState.unbound) - .eq(UserCouple::getId, userCouple.getId()); - this.update(updateWrapper); - - - //清除铭牌 - List inviteUserApplyRecordList = userNameplateApplyRecordService.queryApplyRecordExcludeNoPassByUid(userCouple.getInviteUid(), String.valueOf(userCouple.getId())); - List acceptUserApplyRecordList = userNameplateApplyRecordService.queryApplyRecordExcludeNoPassByUid(userCouple.getAcceptUid(), String.valueOf(userCouple.getId())); - - SpringContextHolder.getBean(UserCoupleService.class).clearCpUserMp(inviteUserApplyRecordList, userCouple.getInviteUid()); - SpringContextHolder.getBean(UserCoupleService.class).clearCpUserMp(acceptUserApplyRecordList, userCouple.getAcceptUid()); - - - List headwearPrivilegeList = userRelationPrivilegeService.queryCpHeadwearPrivilegeByCpLevel(userCouple.getLevelSeq(), false); - if (!CollectionUtils.isEmpty(headwearPrivilegeList)) { - Map> headwearMap = headwearPrivilegeList.stream().collect(Collectors.groupingBy(UserRelationPrivilege::getGender)); - - Users inviteUser = usersBaseService.getUsersByUid(userCouple.getInviteUid()); - Users acceptUser = usersBaseService.getUsersByUid(userCouple.getAcceptUid()); - - List inviteUserPrivilege = headwearMap.get(inviteUser.getGender()); - for (UserRelationPrivilege userRelationPrivilege : inviteUserPrivilege) { - UserHeadwear userHeadwear = headwearService.getUserHeardwear(inviteUser.getUid(), Integer.valueOf(userRelationPrivilege.getPrivilegeProp())); - //清除邀请方获得的CP头饰 - if (ObjectUtil.isNull(userHeadwear)) continue; - userHeadwear.setExpireTime(new Date()); - userHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - headwearService.updateUserHeadwear(userHeadwear); - } - List acceptUserPrivilege = headwearMap.get(acceptUser.getGender()); - for (UserRelationPrivilege userRelationPrivilege : acceptUserPrivilege) { - //清除邀请方获得的 - UserHeadwear userHeadwear = headwearService.getUserHeardwear(acceptUser.getUid(), Integer.valueOf(userRelationPrivilege.getPrivilegeProp())); - if (ObjectUtil.isNull(userHeadwear)) continue; - userHeadwear.setExpireTime(new Date()); - userHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - headwearService.updateUserHeadwear(userHeadwear); - } - - } - - - //检查在使用中的头饰是否为CP头饰,是进行清除 - if (!CollectionUtils.isEmpty(headwearPrivilegeList)) { - List cpHeadwearIdList = headwearPrivilegeList.stream().map(privilege -> Integer.valueOf(privilege.getPrivilegeProp())).collect(Collectors.toList()); - UserHeadwear inviteUsingHeadwear = headwearService.getUserUsingHeadwear(userCouple.getInviteUid()); - if (ObjectUtil.isNotNull(inviteUsingHeadwear) && cpHeadwearIdList.contains(inviteUsingHeadwear.getHeadwearId())) { - inviteUsingHeadwear.setUsed(Boolean.FALSE); - inviteUsingHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - inviteUsingHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(inviteUsingHeadwear); - - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getInviteUid().toString()); - } - - - UserHeadwear acceptUsingHeadwear = headwearService.getUserUsingHeadwear(userCouple.getAcceptUid()); - if (ObjectUtil.isNotNull(acceptUsingHeadwear) && cpHeadwearIdList.contains(acceptUsingHeadwear.getHeadwearId())) { - acceptUsingHeadwear.setUsed(Boolean.FALSE); - acceptUsingHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - acceptUsingHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(acceptUsingHeadwear); - - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getAcceptUid().toString()); - } - } - - - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getInviteUid().toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getAcceptUid().toString()); - //清除缓存等级经验信息 - jedisService.hdel(RedisKey.user_cp_secret_val.getKey(), String.valueOf(id)); - - //给双方发正式解除CP关系的小秘书消息 - Users inviteUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getInviteUid())).orElse(new Users()); - Users acceptUser = Optional.ofNullable(usersBaseService.getUsersByUid(userCouple.getAcceptUid())).orElse(new Users()); - String toInviteUnboundMsg = String.format(Constant.UserRelationDefaultVal.user_cp_unbound_msg, acceptUser.getNick()); - String toAcceptUnboundMsg = String.format(Constant.UserRelationDefaultVal.user_cp_unbound_msg, inviteUser.getNick()); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(userCouple.getInviteUid(), toInviteUnboundMsg); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(userCouple.getAcceptUid(), toAcceptUnboundMsg); - - - } - - - @Override - public void clearCpUserMp(List inviteUserApplyRecordList, Long uid) { - for (UserNameplateApplyRecord inviteRecord : inviteUserApplyRecordList) { - //还有申请中待审核的铭牌置位无效 - if (Constant.NameplateAuditType.wait.equals(inviteRecord.getAuditType())) { - inviteRecord.setStatus(Constant.GlobalStatus.in_valid); - inviteRecord.setUpdateTime(new Date()); - userNameplateApplyRecordService.updateById(inviteRecord); - continue; - } - - if (ObjectUtil.isNull(inviteRecord.getUserNameplateId())) continue; - - UserNameplate userNameplate = new UserNameplate(); - userNameplate.setExpireTime(new Date()); - - UpdateWrapper nameplateUpdateWrapper = new UpdateWrapper<>(); - nameplateUpdateWrapper.lambda().eq(UserNameplate::getUid, uid).eq(UserNameplate::getNameplateId, inviteRecord.getUserNameplateId()); - userNameplateMapper.update(userNameplate, nameplateUpdateWrapper); - } - - //检查在使用中的铭牌是否为CP铭牌,是进行清除 - List inviteApplyNameplateIdList = inviteUserApplyRecordList.stream().map(UserNameplateApplyRecord::getUserNameplateId).collect(Collectors.toList()); - String inviteUseNameplateStr = this.jedisService.hget(RedisKey.user_using_nameplate.getKey(), uid.toString()); - if (!StringUtils.isEmpty(inviteUseNameplateStr)) { - UserNameplateVo vo = gson.fromJson(inviteUseNameplateStr, UserNameplateVo.class); - if (inviteApplyNameplateIdList.contains(vo.getNameplateId())) - jedisService.hdel(RedisKey.user_using_nameplate.getKey(), uid.toString()); - } - - jedisService.hdel(RedisKey.user_summary.getKey(), uid.toString()); - } - - - /** - * 加亲密值 - * - * @param id:cp记录id - * @param secretVal:亲密值,可以为负数 - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void addSecretVal(Long id, Long secretVal) { - String lockKey = RedisKey.cp_secret_val_lock.getKey(String.valueOf(id)); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) { - log.info("cp记录{}亲密值{}增加获取锁失败", id, secretVal); - throw new ServiceException(BusiStatus.SERVERBUSY); - } - - try { - String cpExperStr = jedisService.hget(RedisKey.user_cp_secret_val.getKey(), String.valueOf(id)); - - if (StringUtils.isEmpty(cpExperStr)) { - if (secretVal < 0) return; - UserCpSecretValCacheDto userCpSecretValCacheDto = new UserCpSecretValCacheDto(); - userCpSecretValCacheDto.setSecretVal(secretVal); - userCpSecretValCacheDto.setMs(new Date().getTime()); - //计算等级 - userCpSecretValCacheDto.setLevel(userCoupleLevelService.cacluCpLevelBySecretVal(secretVal)); - - UserCouple userCouple = new UserCouple(); - userCouple.setId(id); - userCouple.setUpdateTime(new Date()); - userCouple.setLevelSeq(userCpSecretValCacheDto.getLevel()); - this.updateById(userCouple); - jedisService.hset(RedisKey.user_cp_secret_val.getKey(), String.valueOf(id), gson.toJson(userCpSecretValCacheDto)); - } else { - UserCpSecretValCacheDto userCpSecretValCacheDto = gson.fromJson(cpExperStr, UserCpSecretValCacheDto.class); - userCpSecretValCacheDto.setSecretVal(userCpSecretValCacheDto.getSecretVal() + secretVal); - if (userCpSecretValCacheDto.getSecretVal() <= 0l) { - jedisService.hdel(RedisKey.user_cp_secret_val.getKey(), String.valueOf(id)); - return; - } - - Integer oldLevel = userCpSecretValCacheDto.getLevel(); - Integer newLevel = userCoupleLevelService.cacluCpLevelBySecretVal(userCpSecretValCacheDto.getSecretVal()); - - userCpSecretValCacheDto.setLevel(newLevel); - - //扣减经验不更新时间戳 - if (secretVal > 0) userCpSecretValCacheDto.setMs(new Date().getTime()); - - if (!oldLevel.equals(newLevel)) { - UserCouple userCouple = new UserCouple(); - userCouple.setId(id); - userCouple.setUpdateTime(new Date()); - userCouple.setLevelSeq(newLevel); - this.updateById(userCouple); - - UserCouple currentCp = this.getById(id); - Users inviteUser = usersBaseService.getUsersByUid(currentCp.getInviteUid()); - Users acceptUser = usersBaseService.getUsersByUid(currentCp.getAcceptUid()); - - if (newLevel > oldLevel) { - Integer diffLevel = newLevel - oldLevel; - for (int i = 1; i <= diffLevel; i++) { - UserCoupleLevel userCoupleLevel = userCoupleLevelService.getUserCpLevelBySeq(oldLevel + i); - List cpPrivilegeList = userRelationPrivilegeService.queryCpPrivilegeByCpLevel(oldLevel + i, true); - if (CollectionUtils.isEmpty(cpPrivilegeList)) { - String inviteMsg = String.format(userCoupleLevel.getUpLevelMsg(), acceptUser.getNick()); - String acceptMsg = String.format(userCoupleLevel.getUpLevelMsg(), inviteUser.getNick()); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(currentCp.getInviteUid(), inviteMsg); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(currentCp.getAcceptUid(), acceptMsg); - } else { - List headwearPrivilegeList = cpPrivilegeList.stream().filter(privilege -> Constant.UserCouplePrivilegeType.head_wear.equals(privilege.getType())).collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(headwearPrivilegeList)) { - Map> headwearMap = headwearPrivilegeList.stream().collect(Collectors.groupingBy(UserRelationPrivilege::getGender)); - - List inviteUserPrivilege = headwearMap.get(inviteUser.getGender()); - for (UserRelationPrivilege userRelationPrivilege : inviteUserPrivilege) { - //给邀请方用户发放头饰 - headwearService.officialSendHeadWearSingle(Integer.valueOf(userRelationPrivilege.getPrivilegeProp()), inviteUser.getUid(), Constant.UserRelationDefaultVal.effective_day, false); - } - List acceptUserPrivilege = headwearMap.get(acceptUser.getGender()); - for (UserRelationPrivilege userRelationPrivilege : acceptUserPrivilege) { - //给邀请方用户发放头饰 - headwearService.officialSendHeadWearSingle(Integer.valueOf(userRelationPrivilege.getPrivilegeProp()), acceptUser.getUid(), Constant.UserRelationDefaultVal.effective_day, false); - } - - - SpringContextHolder.getBean(UserCoupleService.class).executeWearCpHeadwear(inviteUserPrivilege, inviteUser.getUid()); - SpringContextHolder.getBean(UserCoupleService.class).executeWearCpHeadwear(acceptUserPrivilege, acceptUser.getUid()); - - } - - if (Constant.UserCoupleUpLevelSkipType.app.equals(userCoupleLevel.getUpLevelSkipType())) { - String downLevelMsgToInvite = String.format(userCoupleLevel.getUpLevelMsg(), acceptUser.getNick(), oldLevel + i); - String downLevelMsgToAccept = String.format(userCoupleLevel.getUpLevelMsg(), inviteUser.getNick(), oldLevel + i); - this.sendCpUserAppPageSkipMessage(inviteUser.getUid(), downLevelMsgToInvite, Byte.valueOf(userCoupleLevel.getUpLevelSkipUrl())); - this.sendCpUserAppPageSkipMessage(acceptUser.getUid(), downLevelMsgToAccept, Byte.valueOf(userCoupleLevel.getUpLevelSkipUrl())); - } else if (Constant.UserCoupleUpLevelSkipType.h5.equals(userCoupleLevel.getUpLevelSkipType())) { - String cpUpLevelMsgToInvite = String.format(userCoupleLevel.getUpLevelMsg(), acceptUser.getNick()); - String cpUpLevelMsgToAccept = String.format(userCoupleLevel.getUpLevelMsg(), inviteUser.getNick()); - cpLevelUpMsg(inviteUser.getUid(), userCoupleLevel.getUpLevelSkipUrl(), "關係等級提升", cpUpLevelMsgToInvite); - cpLevelUpMsg(acceptUser.getUid(), userCoupleLevel.getUpLevelSkipUrl(), "關係等級提升", cpUpLevelMsgToAccept); - } else if (Constant.UserCoupleUpLevelSkipType.normal.equals(userCoupleLevel.getUpLevelSkipType())) { - String inviteMsg = String.format(userCoupleLevel.getUpLevelMsg(), acceptUser.getNick()); - String acceptMsg = String.format(userCoupleLevel.getUpLevelMsg(), inviteUser.getNick()); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(currentCp.getInviteUid(), inviteMsg); - SpringContextHolder.getBean(UserCoupleService.class).sendActivityFortuneMsg(currentCp.getAcceptUid(), acceptMsg); - } - } - } - } else { - //降级后清除对应的CP铭牌 - clearCpMpByLevelSeq(currentCp.getInviteUid(), oldLevel); - clearCpMpByLevelSeq(currentCp.getAcceptUid(), oldLevel); - - //降级后清除对应的CP头饰 - clearCpHeadWear(currentCp, oldLevel); - - String downLevelMsgToInvite = String.format(Constant.UserRelationDefaultVal.cp_level_down_msg_txt, acceptUser.getNick(), newLevel); - String downLevelMsgToAccept = String.format(Constant.UserRelationDefaultVal.cp_level_down_msg_txt, inviteUser.getNick(), newLevel); - this.sendCpUserAppPageSkipMessage(inviteUser.getUid(), downLevelMsgToInvite, Constant.SecretarySkipType.CP_TASK_PAGE); - this.sendCpUserAppPageSkipMessage(acceptUser.getUid(), downLevelMsgToAccept, Constant.SecretarySkipType.CP_TASK_PAGE); - } - - } - - - jedisService.hset(RedisKey.user_cp_secret_val.getKey(), String.valueOf(id), gson.toJson(userCpSecretValCacheDto)); - } - } catch (Exception e) { - log.error("cp记录{}亲密值{}增加处理失败{}", id, secretVal, e); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - - - } - - - /** - * 用户CP等级可申请铭牌 - * - * @param uid - * @return - */ - @Override - public UserCpMpDto userCpLevelMpList(@NonNull Long uid) { - Users users = usersBaseService.getUsersByUid(uid); - if (ObjectUtil.isNull(users)) throw new ServiceException("查詢不到用戶信息!"); - UserCpMpDto userCpMpDto = new UserCpMpDto(); - //判断用户是否拥有CP - UserCouple userCouple = queryCpByUid(uid, false); - List privilegeList = userRelationPrivilegeService.queryMpPrivilegeByGender(users.getGender()); - - List mpList = new ArrayList<>(); - - if (ObjectUtil.isNull(userCouple)) { - userCpMpDto.setHaveCp(false); - if (CollectionUtils.isEmpty(privilegeList)) { - userCpMpDto.setMpDtoList(Collections.EMPTY_LIST); - return userCpMpDto; - } - - for (UserRelationPrivilege privilege : privilegeList) { - Nameplate nameplate = nameplateMapper.selectById(Long.valueOf(privilege.getPrivilegeProp())); - if (ObjectUtil.isNull(nameplate) || !ObjectUtil.equal(StatusEnum.SHELVE.getValue(), nameplate.getStatus())) - throw new ServiceException("獲取不到CP銘牌對應特權信息!"); - - UserCpLevelMpDto userCpLevelMpDto = new UserCpLevelMpDto(); - userCpLevelMpDto.setMpId(Long.valueOf(privilege.getPrivilegeProp())); - userCpLevelMpDto.setMpName(nameplate.getName()); - userCpLevelMpDto.setIconPic(nameplate.getIconPic()); - userCpLevelMpDto.setIsHave(true); - - mpList.add(userCpLevelMpDto); - } - userCpMpDto.setMpDtoList(mpList); - return userCpMpDto; - } - - - if (CollectionUtils.isEmpty(privilegeList)) { - userCpMpDto.setMpDtoList(Collections.EMPTY_LIST); - return userCpMpDto; - } - userCpMpDto.setHaveCp(true); - - - //检查用户铭牌申请记录 - List applyRecordList = userNameplateApplyRecordService.queryApplyRecordExcludeNoPassByUid(uid, String.valueOf(userCouple.getId())); - List nameplateIdList = applyRecordList.stream().map(UserNameplateApplyRecord::getNameplateId).collect(Collectors.toList()); - - for (UserRelationPrivilege privilege : privilegeList) { - Nameplate nameplate = nameplateMapper.selectById(Long.valueOf(privilege.getPrivilegeProp())); - if (ObjectUtil.isNull(nameplate) || !ObjectUtil.equal(StatusEnum.SHELVE.getValue(), nameplate.getStatus())) - throw new ServiceException("獲取不到CP銘牌對應特權信息!"); - - UserCpLevelMpDto userCpLevelMpDto = new UserCpLevelMpDto(); - userCpLevelMpDto.setMpId(Long.valueOf(privilege.getPrivilegeProp())); - userCpLevelMpDto.setMpName(nameplate.getName()); - userCpLevelMpDto.setIconPic(nameplate.getIconPic()); - userCpLevelMpDto.setIsHave(false); - - if (nameplateIdList.contains(nameplate.getId()) || userCouple.getLevelSeq() < privilege.getLevelSeq()) - userCpLevelMpDto.setIsHave(true); - - mpList.add(userCpLevelMpDto); - } - - userCpMpDto.setMpDtoList(mpList); - return userCpMpDto; - } - - /** - * CP铭牌申请处理 - * - * @param uid - * @param mpId - * @param mpTxt - */ - @Override - @Transactional(rollbackFor = Exception.class, transactionManager = "mybatisplusTransactionManager") - public void cpMpApply(Long uid, Long mpId, String mpTxt) { - if (StringUtils.isBlank(mpTxt)) throw new ServiceException("銘牌文案不能為空"); - if (mpTxt.length() > 4) throw new ServiceException("銘牌文案字數超過限制"); - //校验只允许包含中文英文数字 - String reg = "^[a-zA-Z0-9\\u4E00-\\u9FFF]+$"; - Pattern pattern = Pattern.compile(reg); - Matcher match = pattern.matcher(mpTxt); - if (!match.matches()) throw new ServiceException("名牌文案只能由中文英文数字組成哦~"); - - String lockKey = RedisKey.cp_mp_apply_lock.getKey(String.valueOf(uid)); - String lockVal = jedisLockService.lock(lockKey); - if (StringUtils.isBlank(lockVal)) throw new ServiceException(BusiStatus.SERVERBUSY); - - try { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserNameplateApplyRecord::getUid, uid) - .eq(UserNameplateApplyRecord::getNameplateId, mpId) - .in(UserNameplateApplyRecord::getAuditType, Arrays.asList(Constant.NameplateAuditType.wait, Constant.NameplateAuditType.pass)) - .eq(UserNameplateApplyRecord::getStatus, Constant.GlobalStatus.valid); - List applyRecordList = userNameplateApplyRecordMapper.selectList(queryWrapper); - if (!CollectionUtils.isEmpty(applyRecordList)) - throw new ServiceException(BusiStatus.CP_MP_REPEAT_APPLY_ERR); - - UserCouple userCouple = queryCpByUid(uid, false); - if (ObjectUtil.isNull(userCouple) || !Constant.UserCoupleState.cp.equals(userCouple.getState())) - throw new ServiceException("用戶CP身份已解除"); - - NameplateAuditRecord record = new NameplateAuditRecord(); - record.setNameplateId(mpId); - record.setUid(uid); - record.setText(mpTxt); - record.setApplyDay(Constant.UserRelationDefaultVal.effective_day); - record.setAuditType(Constant.NameplateAuditType.wait); - record.setType(Constant.namePlateType.CP); - record.setApplyType(Constant.ApplyUserNameplate.APPLY_NAME_PLATE); - nameplateAuditRecordService.save(record); - - //保存铭牌申请记录 - UserNameplateApplyRecord userNameplateApplyRecord = new UserNameplateApplyRecord(); - userNameplateApplyRecord.setUid(uid); - userNameplateApplyRecord.setObjId(String.valueOf(userCouple.getId())); - userNameplateApplyRecord.setMpTxt(mpTxt); - userNameplateApplyRecord.setType(Constant.UserRelationType.cp); - - userNameplateApplyRecord.setAuditId(record.getId()); - - userNameplateApplyRecord.setNameplateId(mpId); - userNameplateApplyRecord.setAuditType(Constant.NameplateAuditType.wait); - userNameplateApplyRecordService.save(userNameplateApplyRecord); - } catch (ServiceException e) { - if (ObjectUtil.isNull(e.getBusiStatus())) throw new ServiceException(e.getMessage()); - else throw new ServiceException(e.getBusiStatus()); - } catch (Exception e) { - e.printStackTrace(); - throw new ServiceException(e.getMessage()); - } finally { - jedisLockService.unlock(lockKey, lockVal); - } - - } - - /** - * CP铭牌申请记录 - * - * @param uid - * @return - */ - @Override - public List cpMpApplyList(Long uid, Integer pageNumber, Integer pageSize) { - PageHelper.startPage(pageNumber, pageSize); - PageInfo pageInfo = new PageInfo(userNameplateApplyRecordMapper.queryApplyRecordByUid(uid)); - List recordList = pageInfo.getList(); - if (CollectionUtils.isEmpty(recordList)) return Collections.emptyList(); - - - List resultList = new ArrayList<>(); - for (UserNameplateApplyRecord applyRecord : recordList) { - CpMpApplyDto cpMpApplyDto = new CpMpApplyDto(); - - Nameplate nameplate = nameplateMapper.selectById(applyRecord.getNameplateId()); - - cpMpApplyDto.setMpId(applyRecord.getNameplateId()); - cpMpApplyDto.setMpName(nameplate.getName()); - cpMpApplyDto.setIconPic(nameplate.getIconPic()); - cpMpApplyDto.setMpTxt(applyRecord.getMpTxt()); - cpMpApplyDto.setAuditType(applyRecord.getAuditType()); - cpMpApplyDto.setApplyTime(applyRecord.getCreateTime()); - - if (Constant.NameplateAuditType.no_pass.equals(applyRecord.getAuditType())) { - NameplateAuditRecord auditRecord = nameplateAuditRecordService.getById(applyRecord.getAuditId()); - cpMpApplyDto.setNoPassReason(auditRecord.getRemark()); - } - resultList.add(cpMpApplyDto); - } - - return resultList; - } - - - /** - * 不包含解绑中状态 - * - * @param uid - * @param isIncludeWaitState:是否包含解绑中状态 - * @return - */ - public UserCouple queryCpByUid(@NonNull Long uid, Boolean isIncludeWaitState) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (isIncludeWaitState) { - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).in(UserCouple::getState, Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound)); - } else { - queryWrapper.lambda().and(wq -> wq.eq(UserCouple::getInviteUid, uid).or().eq(UserCouple::getAcceptUid, uid)).eq(UserCouple::getState, Constant.UserCoupleState.cp); - } - - - return this.getBaseMapper().selectOne(queryWrapper); - } - - - @Override - public CpInviteLetterDto cpInvitePage(Long inviteUid, Long acceptUid, String declaration) { - Users inviteUser = usersBaseService.getUsersByUid(inviteUid); - Users acceptUser = usersBaseService.getUsersByUid(acceptUid); - - if (ObjectUtil.isNull(inviteUser)) throw new ServiceException("獲取不到當前用戶信息!"); - if (ObjectUtil.isNull(acceptUser)) throw new ServiceException("獲取不到對應用戶信息!"); - - if (inviteUser.getGender().equals(acceptUser.getGender())) throw new ServiceException("同性別用戶不能組CP哦~"); - - UserRelationProps userRelationProps = userRelationPropsService.getValidPropsByType(Constant.UserRelationType.cp); - if (ObjectUtil.isNull(userRelationProps)) throw new ServiceException("當前未配置組CP相關道具!"); - - CpInviteLetterDto cpInviteLetterDto = new CpInviteLetterDto(); - cpInviteLetterDto.setInviteUid(inviteUid); - cpInviteLetterDto.setInviteNick(inviteUser.getNick()); - cpInviteLetterDto.setInviteAvatar(inviteUser.getAvatar()); - cpInviteLetterDto.setInviteGender(inviteUser.getGender()); - - cpInviteLetterDto.setAcceptUid(acceptUid); - cpInviteLetterDto.setAcceptNick(acceptUser.getNick()); - cpInviteLetterDto.setAcceptAvatar(acceptUser.getAvatar()); - cpInviteLetterDto.setAcceptGender(acceptUser.getGender()); - - cpInviteLetterDto.setPropsId(userRelationProps.getId()); - cpInviteLetterDto.setPropsName(userRelationProps.getName()); - cpInviteLetterDto.setPropsImg(userRelationProps.getImg()); - cpInviteLetterDto.setPropsPrice(userRelationProps.getPrice()); - - String recommenTxt = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.CP_RECOMMEN_TXT, Constant.UserRelationDefaultVal.cp_recommen_txt); - List recommenList = gson.fromJson(recommenTxt, new TypeToken>() { - }.getType()); - cpInviteLetterDto.setRecommenTxtList(recommenList); - cpInviteLetterDto.setDeclaration(declaration); - - - return cpInviteLetterDto; - } - - - @Override - public CpAcceptLetterDto cpRecordDetail(@NonNull Long cpId) { - UserCouple userCouple = this.getById(cpId); - if (ObjectUtil.isNull(userCouple)) throw new ServiceException("獲取不到相關CP記錄!"); - - CpInviteLetterDto cpInviteLetterDto = this.cpInvitePage(userCouple.getInviteUid(), userCouple.getAcceptUid(), userCouple.getDeclaration()); - CpAcceptLetterDto acceptLetterDto = new CpAcceptLetterDto(); - BeanUtils.copyProperties(cpInviteLetterDto, acceptLetterDto); - if (Constant.UserCoupleState.invite.equals(userCouple.getState())) { - String ttlStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.INVITE_CP_AUTO_DENY_TIME, String.valueOf(Constant.UserRelationDefaultVal.auto_deny_val)); - Long denyTimeMs = userCouple.getCreateTime().getTime() + Integer.valueOf(ttlStr) * 60 * 60 * 1000; - Long remainTime = (denyTimeMs - new Date().getTime()) / 1000; - acceptLetterDto.setReplyExpireTime(remainTime < 0 ? 0 : remainTime); - } - acceptLetterDto.setCpId(userCouple.getId()); - return acceptLetterDto; - } - - @Override - public CpRelationDto cpRelation(@NonNull Long currentUid, @NonNull Long uid) { - CpRelationDto cpRelationDto = new CpRelationDto(); - Users users = usersBaseService.getUsersByUid(uid); - if (ObjectUtil.isNull(users)) throw new ServiceException("獲取不到被訪用戶信息"); - cpRelationDto.setUid(uid); - cpRelationDto.setNick(users.getNick()); - cpRelationDto.setGender(users.getGender()); - cpRelationDto.setAvatar(users.getAvatar()); - - - UserCouple userCouple = this.queryCpByUid(uid, true); - if (ObjectUtil.isNull(userCouple)) return cpRelationDto; - cpRelationDto.setCpId(userCouple.getId()); - cpRelationDto.setCpLevel(userCouple.getLevelSeq()); - - //解绑中状态非CP双方用户不可见 - //if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState()) && !currentUid.equals(userCouple.getInviteUid()) && currentUid.equals(userCouple.getAcceptUid())) return cpRelationDto; - - - Long cpUid = userCouple.getInviteUid(); - if (uid.equals(cpUid)) cpUid = userCouple.getAcceptUid(); - - Users cpUser = usersBaseService.getUsersByUid(cpUid); - if (ObjectUtil.isNull(cpUser)) return cpRelationDto; - cpRelationDto.setCpUid(cpUid); - cpRelationDto.setCpNick(cpUser.getNick()); - cpRelationDto.setCpGender(cpUser.getGender()); - cpRelationDto.setCpAvatar(cpUser.getAvatar()); - cpRelationDto.setDeclaration(userCouple.getDeclaration()); - - - if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - cpRelationDto.setWaitUnbound(true); - cpRelationDto.setUnboundUid(userCouple.getUnboundUid()); - } - - //计算陪伴时长 - if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - Long keepMs = userCouple.getUnboundTime().getTime() - userCouple.getAcceptTime().getTime(); - cpRelationDto.setCpKeepDuration(String.valueOf(keepMs / (1000 * 60 * 60))); - } else { - Long keepMs = new Date().getTime() - userCouple.getAcceptTime().getTime(); - cpRelationDto.setCpKeepDuration(String.valueOf(keepMs / (1000 * 60 * 60))); - } - - - //获取cp为图片背景 - List privilegeList = userRelationPrivilegeService.queryCpBackImgPrivilegeByCpLevel(userCouple.getLevelSeq()); - if (!CollectionUtils.isEmpty(privilegeList)) { - cpRelationDto.setCpBackImg(privilegeList.get(privilegeList.size() - 1).getPrivilegeProp()); - } - - return cpRelationDto; - } - - - /** - * @param uid - */ - @Override - public CpTaskProcessDto cpTaskProcess(Long uid) { - CpTaskProcessDto processDto = new CpTaskProcessDto(); - - UserCouple userCouple = this.queryCpByUid(uid, true); - if (ObjectUtil.isNull(userCouple)) throw new ServiceException(BusiStatus.CP_RECORD_NOT_EXISTS); - - Users users = usersBaseService.getUsersByUid(uid); - if (ObjectUtil.isNull(users)) throw new ServiceException("獲取不到當前用戶信息"); - processDto.setUid(uid); - processDto.setNick(users.getNick()); - processDto.setGender(users.getGender()); - processDto.setAvatar(users.getAvatar()); - - Long cpUid = userCouple.getInviteUid(); - if (uid.equals(cpUid)) cpUid = userCouple.getAcceptUid(); - Users cpUser = usersBaseService.getUsersByUid(cpUid); - if (ObjectUtil.isNull(cpUser)) throw new ServiceException("獲取不到CP對象信息"); - processDto.setCpUid(cpUid); - processDto.setCpNick(cpUser.getNick()); - processDto.setCpGender(cpUser.getGender()); - processDto.setCpAvatar(cpUser.getAvatar()); - processDto.setDeclaration(userCouple.getDeclaration()); - //计算陪伴时长 - if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - Long keepMs = userCouple.getUnboundTime().getTime() - userCouple.getAcceptTime().getTime(); - processDto.setCpKeepDuration(String.valueOf(keepMs / (1000 * 60 * 60))); - } else { - Long keepMs = new Date().getTime() - userCouple.getAcceptTime().getTime(); - processDto.setCpKeepDuration(String.valueOf(keepMs / (1000 * 60 * 60))); - } - - //获取cp为图片背景 - List privilegeList = userRelationPrivilegeService.queryCpBackImgPrivilegeByCpLevel(userCouple.getLevelSeq()); - if (!CollectionUtils.isEmpty(privilegeList)) { - processDto.setCpBackImg(privilegeList.get(privilegeList.size() - 1).getPrivilegeProp()); - } - - processDto.setCpLevel(userCouple.getLevelSeq()); - - UserCoupleLevel secondtLevel = userCoupleLevelService.getUserCpLevelBySeq(2); - processDto.setCpSecretVal(0l); - processDto.setCpNextLevelSecretVal(secondtLevel.getAmount()); - processDto.setLevelPercent(0f); - processDto.setIsDamp(false); - - String cpExperStr = jedisService.hget(RedisKey.user_cp_secret_val.getKey(), String.valueOf(userCouple.getId())); - - if (!StringUtils.isEmpty(cpExperStr)) { - UserCpSecretValCacheDto userCpSecretValCacheDto = gson.fromJson(cpExperStr, UserCpSecretValCacheDto.class); - - UserCoupleLevel currentLevel = userCoupleLevelService.getUserCpLevelBySeq(userCpSecretValCacheDto.getLevel()); - //UserCoupleLevel prevLevel = userCoupleLevelService.getUserCpLevelBySeq(userCpSecretValCacheDto.getLevel() - 1); - UserCoupleLevel nextLevel = userCoupleLevelService.getUserCpLevelBySeq(userCpSecretValCacheDto.getLevel() + 1); - - Long secretVal = userCpSecretValCacheDto.getSecretVal(); - Long nextLevelAmount; - Float percent; - if (ObjectUtil.isNull(nextLevel)) { - //没有下一等级表明当前已经是最大等级 - nextLevelAmount = currentLevel.getAmount(); - percent = 1f; - } else { - nextLevelAmount = nextLevel.getAmount(); - //计算当前等级到下一等级间亲密值百分比 - - percent = BigDecimal.valueOf(nextLevelAmount - userCpSecretValCacheDto.getSecretVal()) - .divide(BigDecimal.valueOf(nextLevelAmount - currentLevel.getAmount()), 3, BigDecimal.ROUND_HALF_UP).floatValue(); - - } - processDto.setCpSecretVal(secretVal); - processDto.setCpNextLevelSecretVal(nextLevelAmount); - processDto.setLevelPercent(percent); - processDto.setIsDamp(dealDamp(userCpSecretValCacheDto)); - } - - - List taskList = userCoupleTaskService.list(); - Map> taskMap = taskList.stream().collect(Collectors.groupingBy(UserCoupleTask::getCycleType)); - - //日任务 - List dailyTaskList = taskMap.get(Constant.UserCoupleTaskCycleType.daily); - //累计任务 - List totalTaskList = taskMap.get(Constant.UserCoupleTaskCycleType.total); - - - if (!CollectionUtils.isEmpty(dailyTaskList)) { - Map> dailyTaskMap = dailyTaskList.stream().collect(Collectors.groupingBy(UserCoupleTask::getTaskType)); - - List dailyTask = new ArrayList<>(); - //私聊任务 - List chatTaskList = chatDetailTask(userCouple, dailyTaskMap, Constant.UserCoupleTaskCycleType.daily); - if (!CollectionUtils.isEmpty(chatTaskList)) dailyTask.addAll(chatTaskList); - //待在同一房间任务 - List sameRoomTaskList = sameRoomDetailTask(userCouple, dailyTaskMap, Constant.UserCoupleTaskCycleType.daily); - if (!CollectionUtils.isEmpty(sameRoomTaskList)) dailyTask.addAll(sameRoomTaskList); - - //互相赠送礼物任务 - List sendGiftTaskList = sendGiftDetailTask(userCouple, dailyTaskMap, Constant.UserCoupleTaskCycleType.daily); - if (!CollectionUtils.isEmpty(sendGiftTaskList)) dailyTask.addAll(sendGiftTaskList); - - processDto.setDailyTask(dailyTask); - } - - if (!CollectionUtils.isEmpty(totalTaskList)) { - Map> totalTaskMap = totalTaskList.stream().collect(Collectors.groupingBy(UserCoupleTask::getTaskType)); - - List totalTask = new ArrayList<>(); - //陪伴任务 - List companionTaskList = this.companionDetailTask(userCouple, totalTaskMap); - if (!CollectionUtils.isEmpty(companionTaskList)) totalTask.addAll(companionTaskList); - //待在同一房间任务 - List sameRoomTaskList = sameRoomDetailTask(userCouple, totalTaskMap, Constant.UserCoupleTaskCycleType.total); - if (!CollectionUtils.isEmpty(sameRoomTaskList)) totalTask.addAll(sameRoomTaskList); - //私聊任务 - List chatTaskList = chatDetailTask(userCouple, totalTaskMap, Constant.UserCoupleTaskCycleType.total); - if (!CollectionUtils.isEmpty(chatTaskList)) totalTask.addAll(chatTaskList); - //互相赠送礼物任务 - List sendGiftTaskList = sendGiftDetailTask(userCouple, totalTaskMap, Constant.UserCoupleTaskCycleType.total); - if (!CollectionUtils.isEmpty(sendGiftTaskList)) totalTask.addAll(sendGiftTaskList); - - processDto.setTotalTask(totalTask); - } - - return processDto; - } - - - /** - * 衰减判断 - * - * @param userCpSecretValCacheDto - * @return - */ - public Boolean dealDamp(UserCpSecretValCacheDto userCpSecretValCacheDto) { - //多少天没加亲密值开始衰减 - Integer dayNeed = Integer.valueOf(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.DEDU_SECRET_VAL_DAY_NEED, String.valueOf(Constant.UserRelationDefaultVal.dedu_secret_val_day_need))); - //获取最后一次增加亲密值对应日期第二天的0点时刻 - Date addSecretDate = DateTimeUtil.addDays(DateTimeUtil.getZeroTimeByDate(DateTimeUtil.convertMsToDate(userCpSecretValCacheDto.getMs())), 1); - //当前已有多少天没加亲密值 - Integer dayNum = DateTimeUtil.diffDayByDate(new Date(), addSecretDate); - - return dayNeed <= dayNum; - } - - - /** - * 陪伴任务 - * - * @param userCouple - * @param taskMap - */ - public List companionDetailTask(UserCouple userCouple, Map> taskMap) { - List resultList = new ArrayList<>(); - - Long diffHour = (new Date().getTime() - userCouple.getAcceptTime().getTime()) / (60 * 60 * 1000); - if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - diffHour = (userCouple.getUnboundTime().getTime() - userCouple.getAcceptTime().getTime()) / (60 * 60 * 1000); - } - - - List companionTaskList = taskMap.get(Constant.UserCoupleTaskType.companion); - if (CollectionUtils.isEmpty(companionTaskList)) return resultList; - - companionTaskList = companionTaskList.stream().sorted(Comparator.comparing(UserCoupleTask::getNeed)).collect(Collectors.toList()); - - - for (UserCoupleTask companionTask : companionTaskList) { - CpTaskDetailDto cpTaskDetailDto = new CpTaskDetailDto(); - - if (diffHour >= companionTask.getNeed()) cpTaskDetailDto.setIsComplete(true); - else cpTaskDetailDto.setIsComplete(false); - - cpTaskDetailDto.setTaskDesc(companionTask.getTaskDesc()); - cpTaskDetailDto.setTaskSecretDesc("+" + companionTask.getAwardVal() + "親密值"); - cpTaskDetailDto.setTaskType(Constant.UserCoupleTaskType.companion); - cpTaskDetailDto.setCurrentVal(diffHour > companionTask.getNeed() ? companionTask.getNeed() : diffHour); - cpTaskDetailDto.setTaskNeedVal(companionTask.getNeed()); - resultList.add(cpTaskDetailDto); - } - - return resultList; - - } - - - /** - * 同一房间任务 - * - * @param userCouple - * @param taskMap - * @param cycleType - */ - public List sameRoomDetailTask(UserCouple userCouple, Map> taskMap, Byte cycleType) { - List resultList = new ArrayList<>(); - - List sameRoomTaskList = taskMap.get(Constant.UserCoupleTaskType.same_room); - if (CollectionUtils.isEmpty(sameRoomTaskList)) return resultList; - - sameRoomTaskList = sameRoomTaskList.stream().sorted(Comparator.comparing(UserCoupleTask::getNeed)).collect(Collectors.toList()); - - Long currentVal = 0l; - if (Constant.UserCoupleTaskCycleType.daily.equals(cycleType)) { - //日任务 - String dailySecondStr = jedisService.get(RedisKey.cp_in_same_room_ms_daily.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(dailySecondStr)) dailySecondStr = "0"; - currentVal = Long.valueOf(dailySecondStr) / 60; - } - - if (Constant.UserCoupleTaskCycleType.total.equals(cycleType)) { - //累计任务 - String totalSameSecondStr = jedisService.hget(RedisKey.cp_in_same_room_ms_total.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(totalSameSecondStr)) totalSameSecondStr = "0"; - currentVal = Long.valueOf(totalSameSecondStr) / (60 * 60); - } - - - for (UserCoupleTask sameRoomTask : sameRoomTaskList) { - CpTaskDetailDto cpTaskDetailDto = new CpTaskDetailDto(); - - if (currentVal >= sameRoomTask.getNeed()) cpTaskDetailDto.setIsComplete(true); - else cpTaskDetailDto.setIsComplete(false); - - cpTaskDetailDto.setTaskDesc(sameRoomTask.getTaskDesc()); - cpTaskDetailDto.setTaskSecretDesc("+" + sameRoomTask.getAwardVal() + "親密值"); - cpTaskDetailDto.setTaskType(Constant.UserCoupleTaskType.same_room); - cpTaskDetailDto.setCurrentVal(currentVal > sameRoomTask.getNeed() ? sameRoomTask.getNeed() : currentVal); - cpTaskDetailDto.setTaskNeedVal(sameRoomTask.getNeed()); - resultList.add(cpTaskDetailDto); - } - - return resultList; - - } - - /** - * 私聊任务 - * - * @param userCouple - * @param taskMap - * @param cycleType - */ - public List chatDetailTask(UserCouple userCouple, Map> taskMap, Byte cycleType) { - List resultList = new ArrayList<>(); - - List chatTaskList = taskMap.get(Constant.UserCoupleTaskType.chat); - if (CollectionUtils.isEmpty(chatTaskList)) return resultList; - - chatTaskList = chatTaskList.stream().sorted(Comparator.comparing(UserCoupleTask::getNeed)).collect(Collectors.toList()); - - Long currentVal = 0l; - if (Constant.UserCoupleTaskCycleType.daily.equals(cycleType)) { - String chatNumStr = jedisService.get(RedisKey.cp_user_chat_num.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(chatNumStr)) chatNumStr = "0"; - currentVal = Long.valueOf(chatNumStr); - } - - if (Constant.UserCoupleTaskCycleType.total.equals(cycleType)) { - String chatTotalNumStr = jedisService.hget(RedisKey.cp_user_chat_sum.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(chatTotalNumStr)) chatTotalNumStr = "0"; - currentVal = Long.valueOf(chatTotalNumStr); - } - - - for (UserCoupleTask sameRoomTask : chatTaskList) { - CpTaskDetailDto cpTaskDetailDto = new CpTaskDetailDto(); - - if (currentVal >= sameRoomTask.getNeed()) cpTaskDetailDto.setIsComplete(true); - else cpTaskDetailDto.setIsComplete(false); - - cpTaskDetailDto.setTaskDesc(sameRoomTask.getTaskDesc()); - cpTaskDetailDto.setTaskSecretDesc("+" + sameRoomTask.getAwardVal() + "親密值"); - cpTaskDetailDto.setTaskType(Constant.UserCoupleTaskType.chat); - cpTaskDetailDto.setCurrentVal(currentVal > sameRoomTask.getNeed() ? sameRoomTask.getNeed() : currentVal); - cpTaskDetailDto.setTaskNeedVal(sameRoomTask.getNeed()); - resultList.add(cpTaskDetailDto); - } - - return resultList; - - } - - /** - * 私聊任务 - * - * @param userCouple - * @param taskMap - * @param cycleType - */ - public List sendGiftDetailTask(UserCouple userCouple, Map> taskMap, Byte cycleType) { - List resultList = new ArrayList<>(); - - List taskList = taskMap.get(Constant.UserCoupleTaskType.send_gift); - if (CollectionUtils.isEmpty(taskList)) return resultList; - - taskList = taskList.stream().sorted(Comparator.comparing(UserCoupleTask::getNeed)).collect(Collectors.toList()); - - Long currentVal = 0l; - if (Constant.UserCoupleTaskCycleType.daily.equals(cycleType)) { - String currentDaySecretVal = jedisService.get(RedisKey.cp_gift_secret_day_limit.getKey(userCouple.getId() + StrUtil.UNDERLINE + DateTimeUtil.convertDate(new Date(), DateTimeUtil.DEFAULT_DATE_PATTERN_))); - if (StringUtils.isEmpty(currentDaySecretVal)) currentDaySecretVal = "0"; - currentVal = Long.valueOf(currentDaySecretVal); - } - - if (Constant.UserCoupleTaskCycleType.total.equals(cycleType)) { - String sengGoldTotalNumStr = jedisService.hget(RedisKey.cp_user_gold_sum.getKey(), String.valueOf(userCouple.getId())); - if (StringUtils.isEmpty(sengGoldTotalNumStr)) sengGoldTotalNumStr = "0"; - - currentVal = BigDecimal.valueOf(Double.valueOf(sengGoldTotalNumStr)).longValue(); - } - - - for (UserCoupleTask sameRoomTask : taskList) { - CpTaskDetailDto cpTaskDetailDto = new CpTaskDetailDto(); - - if (currentVal >= sameRoomTask.getNeed()) cpTaskDetailDto.setIsComplete(true); - else cpTaskDetailDto.setIsComplete(false); - - cpTaskDetailDto.setTaskDesc(sameRoomTask.getTaskDesc()); - cpTaskDetailDto.setTaskSecretDesc("+" + sameRoomTask.getAwardVal() + "親密值"); - cpTaskDetailDto.setTaskType(Constant.UserCoupleTaskType.send_gift); - cpTaskDetailDto.setCurrentVal(currentVal > sameRoomTask.getNeed() ? sameRoomTask.getNeed() : currentVal); - cpTaskDetailDto.setTaskNeedVal(sameRoomTask.getNeed()); - resultList.add(cpTaskDetailDto); - } - - return resultList; - - } - - - /** - * 发送app内部页面跳转消息 - * - * @param uid - * @param content - */ - @Override - public void sendCpUserAppPageSkipMessage(Long uid, String content, byte pageType) { - SpringContextHolder.getBean(UserCoupleService.class).sendSecretaryMessage(uid, content, content, pageType, false); - } - - /** - * 小秘书消息 - * - * @param uid - * @param title - * @param content - * @param routerType - * @param needPush - */ - //@Async - @Override - public void sendSecretaryMessage(Long uid, String title, String content, Byte routerType, Boolean needPush) { - log.info("发送CP相关跳转小秘书消息, uid {}", uid); - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.CUSTOM_MESS_HEAD_SECRETARY); - attach.setSecond(Constant.DefineProtocol.CUSTOM_MESS_SUB_SECRETARY_INTRACTION); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title", title); - jsonObject.put("msg", content); - jsonObject.put("routerType", routerType); - attach.setData(jsonObject); - NeteaseSendMsgParam neteaseSendMsgParam = new NeteaseSendMsgParam(); - neteaseSendMsgParam.setType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE); - neteaseSendMsgParam.setFrom(SystemConfig.secretaryUid); - neteaseSendMsgParam.setOpe(0); - neteaseSendMsgParam.setTo(uid.toString()); - neteaseSendMsgParam.setAttach(attach); - if (needPush) { - neteaseSendMsgParam.setPayload(buildPayLoad(title, neteaseSendMsgParam.getFrom())); - } - sendSysMsgService.sendMsg(neteaseSendMsgParam); - } - - /** - * 构建消息参数 - * - * @return - */ - private Payload buildPayLoad(String pushTitle, String fromUid) { - - Payload payload = new Payload(); - payload.setSkiptype(Constant.PayloadSkiptype.prichat); - JSONObject data = new JSONObject(); - data.put("uid", fromUid); - payload.setData(data); - if (org.apache.commons.lang3.StringUtils.isNotBlank(pushTitle)) { - payload.setPushTitle(pushTitle); - } - return payload; - } - - - @Override - public void executeWearCpHeadwear(List cpHeadwearList, Long uid) { - if (CollectionUtils.isEmpty(cpHeadwearList)) return; - UserHeadwear usingHeadwear = headwearService.getUserUsingHeadwear(uid); - if (ObjectUtil.isNull(usingHeadwear)) { - //佩戴 - UserHeadwear userHeadwear = headwearService.getUserHeardwear(uid, Integer.valueOf(cpHeadwearList.get(0).getPrivilegeProp())); - if (ObjectUtil.isNull(userHeadwear)) return; - userHeadwear.setUsed(Boolean.TRUE); - userHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(userHeadwear); - - UserHeadwearVo vo = headwearService.buildUserHeadwearVo(userHeadwear); - this.jedisService.hset(RedisKey.user_using_headwear.getKey(), uid.toString(), this.gson.toJson(vo)); - jedisService.hdel(RedisKey.user_summary.getKey(), uid.toString()); - } - } - - - /** - * 清除对应等级铭牌,针对降级用户 - * - * @param uid - * @param oldLevelSeq - */ - public void clearCpMpByLevelSeq(Long uid, Integer oldLevelSeq) { - Users users = usersBaseService.getUsersByUid(uid); - if (ObjectUtil.isNull(users)) return; - - List privilegeList = userRelationPrivilegeService.queryMpPrivilegeByGenderAndCpLevel(users.getGender(), oldLevelSeq, true); - if (CollectionUtils.isEmpty(privilegeList)) return; - List nameplateIdList = privilegeList.stream().map(privilege -> Long.valueOf(privilege.getPrivilegeProp())).collect(Collectors.toList()); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda() - .eq(UserNameplateApplyRecord::getUid, users.getUid()) - .in(UserNameplateApplyRecord::getNameplateId, nameplateIdList) - .eq(UserNameplateApplyRecord::getStatus, Constant.GlobalStatus.valid).ne(UserNameplateApplyRecord::getAuditType, Constant.NameplateAuditType.no_pass); - List applyRecordList = userNameplateApplyRecordService.getBaseMapper().selectList(queryWrapper); - - if (CollectionUtils.isEmpty(applyRecordList)) return; - - for (UserNameplateApplyRecord applyRecord : applyRecordList) { - applyRecord.setStatus(Constant.GlobalStatus.in_valid); - applyRecord.setUpdateTime(new Date()); - userNameplateApplyRecordService.updateById(applyRecord); - if (Constant.NameplateAuditType.wait.equals(applyRecord.getAuditType())) continue; - - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda().eq(UserNameplate::getUid, uid).eq(UserNameplate::getNameplateId, applyRecord.getUserNameplateId()); - UserNameplate uNameplate = new UserNameplate(); - uNameplate.setExpireTime(new Date()); - userNameplateMapper.update(uNameplate, updateWrapper); - - //对于通过的检查是否有在使用此铭牌 - String acceptUseNameplateStr = this.jedisService.hget(RedisKey.user_using_nameplate.getKey(), uid.toString()); - if (StringUtils.isEmpty(acceptUseNameplateStr)) continue; - - UserNameplateVo vo = gson.fromJson(acceptUseNameplateStr, UserNameplateVo.class); - if (applyRecord.getUserNameplateId().equals(vo.getNameplateId())) { - jedisService.hdel(RedisKey.user_using_nameplate.getKey(), uid.toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), uid.toString()); - } - break; - - } - - } - - - /** - * 清除头饰 - * - * @param userCouple - */ - public void clearCpHeadWear(UserCouple userCouple, Integer oldLevelSeq) { - //查询当前用户等级对应的头饰奖励 - List cpHeadwearList = userRelationPrivilegeService.queryCpHeadwearPrivilegeByCpLevel(oldLevelSeq, true); - if (CollectionUtils.isEmpty(cpHeadwearList)) return; - - - for (UserRelationPrivilege privilege : cpHeadwearList) { - UserHeadwear inviteUserHeadwear = headwearService.getUserHeardwear(userCouple.getInviteUid(), Integer.valueOf(privilege.getPrivilegeProp())); - if (ObjectUtil.isNotNull(inviteUserHeadwear)) { - inviteUserHeadwear.setUsed(Boolean.FALSE); - inviteUserHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - inviteUserHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(inviteUserHeadwear); - - String voStr = jedisService.hget(RedisKey.user_using_headwear.getKey(), String.valueOf(userCouple.getInviteUid())); - if (!StringUtils.isEmpty(voStr) && !ApplicationConstant.NULL_JSON_OBJECT.equalsIgnoreCase(voStr)) { - UserHeadwearVo vo = gson.fromJson(voStr, UserHeadwearVo.class); - if (ObjectUtil.equal(Integer.valueOf(privilege.getPrivilegeProp()), vo.getHeadwearId())) { - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getInviteUid().toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getInviteUid().toString()); - } - } - - } - - UserHeadwear acceptUserHeadwear = headwearService.getUserHeardwear(userCouple.getAcceptUid(), Integer.valueOf(privilege.getPrivilegeProp())); - if (ObjectUtil.isNotNull(acceptUserHeadwear)) { - acceptUserHeadwear.setUsed(Boolean.FALSE); - acceptUserHeadwear.setStatus(HeadwearConstant.Status.EXPIRED); - acceptUserHeadwear.setUpdateTime(Calendar.getInstance().getTime()); - headwearService.updateUserHeadwear(acceptUserHeadwear); - - String voStr = jedisService.hget(RedisKey.user_using_headwear.getKey(), String.valueOf(userCouple.getAcceptUid())); - if (!StringUtils.isEmpty(voStr) && !ApplicationConstant.NULL_JSON_OBJECT.equalsIgnoreCase(voStr)) { - UserHeadwearVo vo = gson.fromJson(voStr, UserHeadwearVo.class); - if (ObjectUtil.equal(Integer.valueOf(privilege.getPrivilegeProp()), vo.getHeadwearId())) { - this.jedisService.hdel(RedisKey.user_using_headwear.getKey(), userCouple.getAcceptUid().toString()); - jedisService.hdel(RedisKey.user_summary.getKey(), userCouple.getAcceptUid().toString()); - } - } - - - } - } - - - } - - - @Async - @Override - public void inviteCpTopMsg(UserCouple userCouple, String content) { - CpInviteLetterDto cpInviteLetterDto = this.cpInvitePage(userCouple.getInviteUid(), userCouple.getAcceptUid(), userCouple.getDeclaration()); - CpAcceptLetterDto acceptLetterDto = new CpAcceptLetterDto(); - BeanUtils.copyProperties(cpInviteLetterDto, acceptLetterDto); - acceptLetterDto.setCpId(userCouple.getId()); - - String ttlStr = sysConfService.getDefaultSysConfValueById(Constant.SysConfId.INVITE_CP_AUTO_DENY_TIME, String.valueOf(Constant.UserRelationDefaultVal.auto_deny_val)); - Long denyTimeMs = userCouple.getCreateTime().getTime() + Integer.valueOf(ttlStr) * 60 * 60 * 1000; - Long remainTime = (denyTimeMs - new Date().getTime()) / 1000; - acceptLetterDto.setReplyExpireTime(remainTime < 0 ? 0 : remainTime); - - - Users inviteUser = usersBaseService.getUsersByUid(userCouple.getInviteUid()); - String pushTitle = inviteUser.getNick(); - String pushContent = Constant.UserRelationDefaultVal.cp_invite_top_notice_msg; - - NeteaseSendMsgBatchParam neteaseSendMsgBatchParam = new NeteaseSendMsgBatchParam(); - // 批量发送文字(带跳转链接)自定义类型 - neteaseSendMsgBatchParam.setType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE); - Body body = new Body(); - body.setData(buildAttach(pushTitle, content, gson.toJson(acceptLetterDto), Constant.SecretarySkipType.CP_APPLY_PAGE)); - neteaseSendMsgBatchParam.setBody(body); - neteaseSendMsgBatchParam.setFromAccid(SystemConfig.secretaryUid); - neteaseSendMsgBatchParam.setToAccids(Arrays.asList(String.valueOf(userCouple.getAcceptUid()))); - neteaseSendMsgBatchParam.setPushcontent(pushContent); - neteaseSendMsgBatchParam.setPayload(buildTopPayLoad(pushTitle, gson.toJson(acceptLetterDto))); - int code = sendSysMsgService.sendBatchMsgMsg(neteaseSendMsgBatchParam); - log.info("组cp发起邀请消息code:{}", code); - } - - /** - * 构建自定义文字带跳转功能的参数体 - * - * @return - */ - private Attach buildAttach(String title, String content, String popInfo, Byte skipType) { - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.CP_MSG_TOP_NOTICE); - attach.setSecond(Constant.DefineProtocol.CP_MSG_TOP_NOTICE_TO_APPLY_LIST); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title", title); - jsonObject.put("msg", content); - jsonObject.put("routerType", skipType); - jsonObject.put("popInfo", popInfo); - attach.setData(jsonObject); - return attach; - } - - /** - * 构建消息参数 - * - * @return - */ - private Payload buildTopPayLoad(String pushTitle, String data) { - - Payload payload = new Payload(); - payload.setSkiptype(Constant.PayloadSkiptype.apppage); - payload.setData(data); - if (StringUtils.isNotBlank(pushTitle)) { - payload.setPushTitle(pushTitle); - } - return payload; - } - - - public CpInviteBillRecordDto buildCpInviteBillRecordDto(Long uid, Long targetUid, Long roomUid, String objId, BillObjTypeEnum eventEnum, Double amount, Integer giftId, Integer giftNum) { - CpInviteBillRecordDto billRecordDto = new CpInviteBillRecordDto(); - billRecordDto.setUid(uid); - billRecordDto.setTargetUid(targetUid); - billRecordDto.setRoomUid(roomUid); - billRecordDto.setObjId(objId); - billRecordDto.setEventEnum(eventEnum); - billRecordDto.setAmount(amount); - billRecordDto.setGiftId(giftId); - billRecordDto.setGiftNum(giftNum); - return billRecordDto; - } - - - @Async - public void cpLevelUpMsg(Long toUid, String skipUrl, String title, String content) { - NeteaseSendMsgBatchParam neteaseSendMsgBatchParam = new NeteaseSendMsgBatchParam(); - neteaseSendMsgBatchParam.setFromAccid(SystemConfig.secretaryUid); - neteaseSendMsgBatchParam.setType(Constant.DefineProtocol.CUSTOM_MESS_DEFINE); - Body body = new Body(); - - skipUrl = SystemConfig.domain + skipUrl; - - body.setData(this.buildAttach(title, content, skipUrl)); - - neteaseSendMsgBatchParam.setBody(body); - neteaseSendMsgBatchParam.setContent(title); - neteaseSendMsgBatchParam.setToAccids(Arrays.asList(String.valueOf(toUid))); - Payload payload = new Payload(); - payload.setSkiptype(Constant.SecretarySkipType.H5); - - - payload.setData(skipUrl); - neteaseSendMsgBatchParam.setPayload(payload); - sendSysMsgService.sendBatchMsgMsg(neteaseSendMsgBatchParam); - } - - - private Attach buildAttach(String title, String content, String skipUrl) { - Attach attach = new Attach(); - attach.setFirst(Constant.DefineProtocol.CUSTOM_MESS_HEAD_SECRETARY); - attach.setSecond(Constant.DefineProtocol.CUSTOM_MESS_SUB_SECRETARY_INTRACTION); - JSONObject jsonObject = new JSONObject(); - jsonObject.put("title", title); - jsonObject.put("msg", content); - jsonObject.put("routerType", Constant.SecretarySkipType.H5); - - jsonObject.put("routerValue", skipUrl); - attach.setData(jsonObject); - return attach; - } - - - /** - * 检查是否为牌照房用户 - * - * @param uid - */ - public Boolean checkIsPermit(Long uid) { - Room room = roomService.getRoomByUid(uid); - if (ObjectUtil.isNull(room)) return false; - - if (Constant.PermitType.PERMIT_ROOM.equals(room.getIsPermitRoom())) return true; - - return false; - } - - /** - * 检查用户是否为关联号 - * - * @param uid - */ - public Boolean checkIsAssociateAccount(Long uid) { - ClanAccountAssociate clanAccountAssociate = clanAccountAssociateService.checkIsAssociateAccount(uid); - return clanAccountAssociate != null; - } - - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleTaskServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleTaskServiceImpl.java deleted file mode 100644 index 95b98a2f7..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserCoupleTaskServiceImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.accompany.business.service.user.impl; - -import com.accompany.business.model.user.UserCoupleTask; -import com.accompany.business.mybatismapper.user.UserCoupleTaskMapper; -import com.accompany.business.service.user.UserCoupleTaskService; -import com.accompany.common.constant.Constant; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.NonNull; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * CP用户任务表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-11 19:05:41 - */ -@Service -public class UserCoupleTaskServiceImpl extends ServiceImpl implements UserCoupleTaskService { - - /** - * 按类型查询日任务 - * @param taskType - * @return - */ - @Override - public UserCoupleTask queryCoupleDailyTaskByType(@NonNull Byte taskType) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserCoupleTask::getCycleType, Constant.UserCoupleTaskCycleType.daily).eq(UserCoupleTask::getTaskType, taskType); - return this.baseMapper.selectOne(queryWrapper); - } - - /** - * 按类型查询累计任务 - * @param taskType - * @return - */ - @Override - public List queryCoupleTotalTaskByType(@NonNull Byte taskType) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserCoupleTask::getCycleType, Constant.UserCoupleTaskCycleType.total).eq(UserCoupleTask::getTaskType, taskType).orderByAsc(UserCoupleTask::getNeed); - return this.baseMapper.selectList(queryWrapper); - } - - - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserNameplateApplyRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserNameplateApplyRecordServiceImpl.java index f0d9c3df7..b433d1c8e 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserNameplateApplyRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserNameplateApplyRecordServiceImpl.java @@ -39,33 +39,6 @@ public class UserNameplateApplyRecordServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); - updateWrapper.lambda().eq(UserNameplateApplyRecord::getAuditId, auditId).eq(UserNameplateApplyRecord::getUid, uid).eq(UserNameplateApplyRecord::getType, type); - - UserNameplateApplyRecord applyRecord = new UserNameplateApplyRecord(); - applyRecord.setAuditType(auditType); - applyRecord.setUserNameplateId(userNameplateId); - this.baseMapper.update(applyRecord, updateWrapper); - } - - @Override - public UserNameplateApplyRecord queryMpApplyRecordByAduitId(@NonNull Long auditId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserNameplateApplyRecord::getAuditId, auditId); - return this.getBaseMapper().selectOne(queryWrapper); - } - - /** * 查询审核中和通过审核的申请记录 * @param uid diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPrivilegeServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPrivilegeServiceImpl.java deleted file mode 100644 index e12af251f..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPrivilegeServiceImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.accompany.business.service.user.impl; - -import com.accompany.business.model.user.UserRelationPrivilege; -import com.accompany.business.mybatismapper.user.UserRelationPrivilegeMapper; -import com.accompany.business.service.user.UserRelationPrivilegeService; -import com.accompany.common.constant.Constant; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 用户CP特权表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -@Service -public class UserRelationPrivilegeServiceImpl extends ServiceImpl implements UserRelationPrivilegeService { - - - /** - * 按照性别查询CP等级对应的铭牌特权 - * @param gender - * @param levelSeq - * @return - */ - @Override - public List queryMpPrivilegeByGenderAndCpLevel(Byte gender, Integer levelSeq, Boolean isEqLevel) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - - if (isEqLevel) { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.mp) - .eq(UserRelationPrivilege::getGender, gender) - .eq(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - }else { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.mp) - .eq(UserRelationPrivilege::getGender, gender) - .le(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - } - - - return this.getBaseMapper().selectList(queryWrapper); - } - - - /** - * 按照等级查询CP位置特权 - * @param levelSeq - * @return - */ - @Override - public List queryCpBackImgPrivilegeByCpLevel(Integer levelSeq) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.cp_theme) - .le(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - - return this.getBaseMapper().selectList(queryWrapper); - } - - /** - * 按照等级查询CP头饰特权 - * @param levelSeq - * @return - */ - @Override - public List queryCpHeadwearPrivilegeByCpLevel(Integer levelSeq, Boolean isEqLevel) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (isEqLevel) { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.head_wear) - .eq(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - }else { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.head_wear) - .le(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - } - - - return this.getBaseMapper().selectList(queryWrapper); - } - - - /** - * 按照等级查询所有cp特权 - * @param levelSeq - * @return - */ - @Override - public List queryCpPrivilegeByCpLevel(Integer levelSeq, Boolean isEqLevel) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - if (isEqLevel) { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - }else { - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .le(UserRelationPrivilege::getLevelSeq, levelSeq) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - } - - - return this.getBaseMapper().selectList(queryWrapper); - } - - - /** - * 按照性别查询CP等级对应的铭牌特权 - * @param gender - * @param levelSeq - * @return - */ - @Override - public List queryMpPrivilegeByGender(Byte gender) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - - queryWrapper.lambda() - .eq(UserRelationPrivilege::getRelationType, Constant.UserRelationType.cp) - .eq(UserRelationPrivilege::getType, Constant.UserCouplePrivilegeType.mp) - .eq(UserRelationPrivilege::getGender, gender) - .eq(UserRelationPrivilege::getStatus,Constant.GlobalStatus.valid) - .orderByAsc(UserRelationPrivilege::getLevelSeq); - - - return this.getBaseMapper().selectList(queryWrapper); - } - - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPropsServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPropsServiceImpl.java deleted file mode 100644 index 309e32596..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/user/impl/UserRelationPropsServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.accompany.business.service.user.impl; - -import com.accompany.business.model.user.UserRelationProps; -import com.accompany.business.mybatismapper.user.UserRelationPropsMapper; -import com.accompany.business.service.user.UserRelationPropsService; -import com.accompany.common.constant.Constant; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.NonNull; -import org.springframework.stereotype.Service; - -/** - * 用户关系道具表 - * - * @author - * @email xxx@gtland.cn - * @date 2022-02-08 16:04:08 - */ -@Service -public class UserRelationPropsServiceImpl extends ServiceImpl implements UserRelationPropsService { - - @Override - public UserRelationProps getValidPropsByType(@NonNull Byte type) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(UserRelationProps::getType, type).eq(UserRelationProps::getStatus, Constant.UserRelationPropsStatus.valid); - - return this.getBaseMapper().selectOne(queryWrapper); - } - - - - -} \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java index f0f8542d2..a3c527fb8 100644 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java +++ b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/service/vip/impl/VipReturnProfitRecordServiceImpl.java @@ -10,10 +10,10 @@ import com.accompany.business.service.vip.VipMessageService; import com.accompany.business.service.vip.VipReturnProfitRecordService; import com.accompany.business.service.vip.VipReturnProfitService; import com.accompany.common.constant.Constant; -import com.accompany.core.exception.AdminServiceException; import com.accompany.common.utils.DateTimeUtil; import com.accompany.core.base.UidContextHolder; import com.accompany.core.enumeration.BillObjTypeEnum; +import com.accompany.core.exception.ServiceException; import com.accompany.payment.model.UserVipRecord; import com.accompany.payment.service.UserVipInfoService; import com.accompany.payment.service.UserVipRecordService; @@ -106,7 +106,7 @@ public class VipReturnProfitRecordServiceImpl extends ServiceImpllambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (count > 0) { - throw new AdminServiceException(BusiStatus.SERVERERROR.value(), "該提現方式已添加"); + throw new ServiceException("該提現方式已添加"); } int updateNum = 1; if ((WithdrawAccountTypeConstant.CHINA_UNION_PAY & accountType) != 0) { @@ -163,7 +162,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpllambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (count == 0) { - throw new AdminServiceException("非法賬戶"); + throw new ServiceException("非法賬戶"); } List accountDtls = withdrawAccountDtlService.list(Wrappers.lambdaQuery().eq(WithdrawAccountDtl::getAccountType, accountType)); if (CollectionUtil.isEmpty(accountDtls)) { @@ -201,7 +200,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl withdrawUserLimits = withdrawUserLimitService.list(Wrappers.lambdaQuery() .eq(WithdrawUserLimit::getUid, uid)); @@ -209,34 +208,34 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl userAccounts = withdrawUserAccountService.list(Wrappers.lambdaQuery().eq(WithdrawUserAccount::getUid, uid).eq(WithdrawUserAccount::getAccountType, accountType)); if (CollectionUtil.isEmpty(userAccounts)) { - throw new AdminServiceException("賬戶不存在"); + throw new ServiceException("賬戶不存在"); } WithdrawUserAccount withdrawUserAccount = userAccounts.get(0); if (withdrawUserAccount.getAccountType() != null && withdrawUserAccount.getAccountType() == WithdrawAccountTypeConstant.CHINA_UNION_PAY) { Integer isRealCertify = withdrawUserAccount.getIsRealCertify(); if (isRealCertify == null || isRealCertify == Constant.Yes1No0.NO) { - throw new AdminServiceException("账号未进行实名认证"); + throw new ServiceException("账号未进行实名认证"); } } List configs = withdrawConfigService.list(Wrappers.lambdaQuery().eq(WithdrawConfig::getIsEnabled, Constant.Yes1No0.YES)); if (CollectionUtil.isEmpty(configs)) { - throw new AdminServiceException("系統缺少配置,請聯繫管理員"); + throw new ServiceException("系統缺少配置,請聯繫管理員"); } WithdrawConfig withdrawConfig = configs.get(0); Long minValue = withdrawConfig.getMinValue(); Long weekMaxValue = withdrawConfig.getWeekMaxValue(); Integer weekLimitCount = withdrawConfig.getWeekLimitCount(); if (goldNum < minValue) { - throw new AdminServiceException("金幣數不能低於限制數:" + minValue); + throw new ServiceException("金幣數不能低於限制數:" + minValue); } //提现账户限制(大陆提现限制) if (accountType != null && (accountType & WithdrawAccountTypeConstant.CHINA_UNION_PAY) != 0) { @@ -246,7 +245,7 @@ public class WithdrawUserAccountServiceImpl extends ServiceImpl= weekLimitCount) { - throw new AdminServiceException("提現已達到周上限"); + throw new ServiceException("提現已達到周上限"); } } if ((totalGoldNum + goldNum) > weekMaxValue) { - throw new AdminServiceException("周總金幣數超過限制數:" + weekMaxValue); + throw new ServiceException("周總金幣數超過限制數:" + weekMaxValue); } //余额校验 UserPurse userPurse = userPurseService.queryUserPurse(uid); double currentGolds = userPurse.getGolds(); if (Double.compare(currentGolds, goldNum) < 0) { - throw new AdminServiceException("金幣不足,無法提現"); + throw new ServiceException("金幣不足,無法提現"); } //扣减钱包 if (!userPurseService.subGold(uid, goldNum.doubleValue(), BillObjTypeEnum.WITHDRAW.getDesc())) { diff --git a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/strategy/CpUserKeepTaskHandler.java b/accompany-business/accompany-business-service/src/main/java/com/accompany/business/strategy/CpUserKeepTaskHandler.java deleted file mode 100644 index aea574887..000000000 --- a/accompany-business/accompany-business-service/src/main/java/com/accompany/business/strategy/CpUserKeepTaskHandler.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.accompany.business.strategy; - -import cn.hutool.core.util.ObjectUtil; -import com.accompany.business.enums.RedisKeyOverdueEnum; -import com.accompany.business.model.user.UserCouple; -import com.accompany.business.model.user.UserCoupleTask; -import com.accompany.business.service.user.UserCoupleService; -import com.accompany.business.service.user.UserCoupleTaskService; -import com.accompany.common.constant.Constant; -import com.accompany.common.redis.RedisKey; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.Arrays; -import java.util.List; - -@Component -public class CpUserKeepTaskHandler implements DealOverdueRedisKeyStrategyI { - private Logger logger = LoggerFactory.getLogger(CpUserKeepTaskHandler.class); - - - @Autowired - private UserCoupleService userCoupleService; - @Autowired - private UserCoupleTaskService userCoupleTaskService; - - @Override - public RedisKeyOverdueEnum getRedisKeyStrategy() { - return RedisKeyOverdueEnum.CP_USER_KEEP_DURATION; - } - - @Override - public void dealOverdueRedisKey(String key) { - if (key.indexOf(RedisKey.cp_user_keep_duration.getKey()) == -1) return; - - logger.info("CP陪伴任务key:{}", key); - String[] arr = key.split("_"); - - Long cpId = Long.valueOf(arr[arr.length -2]); - Integer taskId = Integer.valueOf(arr[arr.length -1]); - - UserCoupleTask userCoupleTask = userCoupleTaskService.getById(taskId); - if (ObjectUtil.isNull(userCoupleTask)) return; - - try { - UserCouple userCouple = userCoupleService.getById(cpId); - if (ObjectUtil.isNull(userCouple)) return; - - List stateList = Arrays.asList(Constant.UserCoupleState.cp, Constant.UserCoupleState.wait_unbound); - if (!stateList.contains(userCouple.getState())) return; - - if (Constant.UserCoupleState.wait_unbound.equals(userCouple.getState())) { - //再次检查解绑时有没有达到对应的陪伴时长奖励 - Long taskMs = userCoupleTask.getNeed() * 60 * 60 * 1000l; - Long keepMs = userCouple.getUnboundTime().getTime() - userCouple.getAcceptTime().getTime(); - if (keepMs < taskMs) return; - } - - userCoupleService.addSecretVal(cpId, Long.valueOf(userCoupleTask.getAwardVal())); - logger.info("cp记录{}陪伴任务{}处理完毕", cpId, taskId); - } catch (Exception e) { - logger.error("cp记录{}陪伴任务{}处理异常{}", cpId, taskId, e); - e.printStackTrace(); - } - } - - -} diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionUpdateConfMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionUpdateConfMapper.xml deleted file mode 100644 index 6001a26e4..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/AppVersionUpdateConfMapper.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - version, os, type, create_time - - - - - delete from app_version_update_conf - where version = #{version,jdbcType=VARCHAR} - - - delete from app_version_update_conf - - - - - - insert into app_version_update_conf (version, os, type, - create_time) - values (#{version,jdbcType=VARCHAR}, #{os,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, - #{createTime,jdbcType=TIMESTAMP}) - - - insert into app_version_update_conf - - - version, - - - os, - - - type, - - - create_time, - - - - - #{version,jdbcType=VARCHAR}, - - - #{os,jdbcType=VARCHAR}, - - - #{type,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - update app_version_update_conf - - - version = #{record.version,jdbcType=VARCHAR}, - - - os = #{record.os,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=TINYINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update app_version_update_conf - set version = #{record.version,jdbcType=VARCHAR}, - os = #{record.os,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=TINYINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update app_version_update_conf - - - os = #{os,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where version = #{version,jdbcType=VARCHAR} - - - update app_version_update_conf - set os = #{os,jdbcType=VARCHAR}, - type = #{type,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where version = #{version,jdbcType=VARCHAR} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftSendRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftSendRecordMapper.xml index 08cf6b8a8..a50ce3848 100644 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftSendRecordMapper.xml +++ b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/GiftSendRecordMapper.xml @@ -403,12 +403,4 @@ AND create_time >= #{startTime} and create_time < #{endTime} - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendCardMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendCardMapper.xml deleted file mode 100644 index 06ba65f5e..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendCardMapper.xml +++ /dev/null @@ -1,331 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, uid, card_name, valid_start_time, valid_end_time, used_start_time, used_end_time, - create_time, created_by, status, update_time, period - - - - - delete from recommend_card - where id = #{id,jdbcType=BIGINT} - - - - SELECT LAST_INSERT_ID() - - insert into recommend_card (uid, card_name, valid_start_time, - valid_end_time, used_start_time, used_end_time, - create_time, created_by, status, - update_time, period) - values (#{uid,jdbcType=BIGINT}, #{cardName,jdbcType=VARCHAR}, #{validStartTime,jdbcType=TIMESTAMP}, - #{validEndTime,jdbcType=TIMESTAMP}, #{usedStartTime,jdbcType=TIMESTAMP}, #{usedEndTime,jdbcType=TIMESTAMP}, - #{createTime,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, - #{updateTime,jdbcType=TIMESTAMP}, #{period,jdbcType=INTEGER}) - - - - SELECT LAST_INSERT_ID() - - insert into recommend_card - - - uid, - - - card_name, - - - valid_start_time, - - - valid_end_time, - - - used_start_time, - - - used_end_time, - - - create_time, - - - created_by, - - - status, - - - update_time, - - - period, - - - - - #{uid,jdbcType=BIGINT}, - - - #{cardName,jdbcType=VARCHAR}, - - - #{validStartTime,jdbcType=TIMESTAMP}, - - - #{validEndTime,jdbcType=TIMESTAMP}, - - - #{usedStartTime,jdbcType=TIMESTAMP}, - - - #{usedEndTime,jdbcType=TIMESTAMP}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{createdBy,jdbcType=VARCHAR}, - - - #{status,jdbcType=TINYINT}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{period,jdbcType=INTEGER}, - - - - - - update recommend_card - - - id = #{record.id,jdbcType=BIGINT}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - card_name = #{record.cardName,jdbcType=VARCHAR}, - - - valid_start_time = #{record.validStartTime,jdbcType=TIMESTAMP}, - - - valid_end_time = #{record.validEndTime,jdbcType=TIMESTAMP}, - - - used_start_time = #{record.usedStartTime,jdbcType=TIMESTAMP}, - - - used_end_time = #{record.usedEndTime,jdbcType=TIMESTAMP}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - created_by = #{record.createdBy,jdbcType=VARCHAR}, - - - status = #{record.status,jdbcType=TINYINT}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - period = #{record.period,jdbcType=INTEGER}, - - - - - - - - update recommend_card - set id = #{record.id,jdbcType=BIGINT}, - uid = #{record.uid,jdbcType=BIGINT}, - card_name = #{record.cardName,jdbcType=VARCHAR}, - valid_start_time = #{record.validStartTime,jdbcType=TIMESTAMP}, - valid_end_time = #{record.validEndTime,jdbcType=TIMESTAMP}, - used_start_time = #{record.usedStartTime,jdbcType=TIMESTAMP}, - used_end_time = #{record.usedEndTime,jdbcType=TIMESTAMP}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - created_by = #{record.createdBy,jdbcType=VARCHAR}, - status = #{record.status,jdbcType=TINYINT}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - period = #{record.period,jdbcType=INTEGER} - - - - - - update recommend_card - - - uid = #{uid,jdbcType=BIGINT}, - - - card_name = #{cardName,jdbcType=VARCHAR}, - - - valid_start_time = #{validStartTime,jdbcType=TIMESTAMP}, - - - valid_end_time = #{validEndTime,jdbcType=TIMESTAMP}, - - - used_start_time = #{usedStartTime,jdbcType=TIMESTAMP}, - - - used_end_time = #{usedEndTime,jdbcType=TIMESTAMP}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - created_by = #{createdBy,jdbcType=VARCHAR}, - - - status = #{status,jdbcType=TINYINT}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - period = #{period,jdbcType=INTEGER}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_card - set uid = #{uid,jdbcType=BIGINT}, - card_name = #{cardName,jdbcType=VARCHAR}, - valid_start_time = #{validStartTime,jdbcType=TIMESTAMP}, - valid_end_time = #{validEndTime,jdbcType=TIMESTAMP}, - used_start_time = #{usedStartTime,jdbcType=TIMESTAMP}, - used_end_time = #{usedEndTime,jdbcType=TIMESTAMP}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - created_by = #{createdBy,jdbcType=VARCHAR}, - status = #{status,jdbcType=TINYINT}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - period = #{period,jdbcType=INTEGER} - where id = #{id,jdbcType=BIGINT} - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendModuleMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendModuleMapper.xml deleted file mode 100644 index 6630611f4..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendModuleMapper.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, name, type, seq_no, status, big_picture_num, list_num, show_type, delete_flag, - create_time, update_time, module_use - - - - - delete from recommend_module - where id = #{id,jdbcType=BIGINT} - - - delete from recommend_module - - - - - - insert into recommend_module (id, name, type, - seq_no, status, big_picture_num, - list_num, show_type, delete_flag, - create_time, update_time, module_use - ) - values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, - #{seqNo,jdbcType=INTEGER}, #{status,jdbcType=BIT}, #{bigPictureNum,jdbcType=INTEGER}, - #{listNum,jdbcType=INTEGER}, #{showType,jdbcType=INTEGER}, #{deleteFlag,jdbcType=BIT}, - #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{moduleUse,jdbcType=TINYINT} - ) - - - insert into recommend_module - - - name, - - - type, - - - seq_no, - - - status, - - - big_picture_num, - - - list_num, - - - show_type, - - - delete_flag, - - - create_time, - - - update_time, - - - module_use, - - - - - #{name,jdbcType=VARCHAR}, - - - #{type,jdbcType=TINYINT}, - - - #{seqNo,jdbcType=INTEGER}, - - - #{status,jdbcType=BIT}, - - - #{bigPictureNum,jdbcType=INTEGER}, - - - #{listNum,jdbcType=INTEGER}, - - - #{showType,jdbcType=INTEGER}, - - - #{deleteFlag,jdbcType=BIT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - #{moduleUse,jdbcType=TINYINT}, - - - - - - update recommend_module - - - id = #{record.id,jdbcType=BIGINT}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - type = #{record.type,jdbcType=TINYINT}, - - - seq_no = #{record.seqNo,jdbcType=INTEGER}, - - - status = #{record.status,jdbcType=BIT}, - - - big_picture_num = #{record.bigPictureNum,jdbcType=INTEGER}, - - - list_num = #{record.listNum,jdbcType=INTEGER}, - - - show_type = #{record.showType,jdbcType=INTEGER}, - - - delete_flag = #{record.deleteFlag,jdbcType=BIT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - module_use = #{record.moduleUse,jdbcType=TINYINT}, - - - - - - - - update recommend_module - set id = #{record.id,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - type = #{record.type,jdbcType=TINYINT}, - seq_no = #{record.seqNo,jdbcType=INTEGER}, - status = #{record.status,jdbcType=BIT}, - big_picture_num = #{record.bigPictureNum,jdbcType=INTEGER}, - list_num = #{record.listNum,jdbcType=INTEGER}, - show_type = #{record.showType,jdbcType=INTEGER}, - delete_flag = #{record.deleteFlag,jdbcType=BIT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - module_use = #{record.moduleUse,jdbcType=TINYINT} - - - - - - update recommend_module - - - name = #{name,jdbcType=VARCHAR}, - - - type = #{type,jdbcType=TINYINT}, - - - seq_no = #{seqNo,jdbcType=INTEGER}, - - - status = #{status,jdbcType=BIT}, - - - big_picture_num = #{bigPictureNum,jdbcType=INTEGER}, - - - list_num = #{listNum,jdbcType=INTEGER}, - - - show_type = #{showType,jdbcType=INTEGER}, - - - delete_flag = #{deleteFlag,jdbcType=BIT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - module_use = #{moduleUse,jdbcType=TINYINT}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_module - set name = #{name,jdbcType=VARCHAR}, - type = #{type,jdbcType=TINYINT}, - seq_no = #{seqNo,jdbcType=INTEGER}, - status = #{status,jdbcType=BIT}, - big_picture_num = #{bigPictureNum,jdbcType=INTEGER}, - list_num = #{listNum,jdbcType=INTEGER}, - show_type = #{showType,jdbcType=INTEGER}, - delete_flag = #{deleteFlag,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP}, - module_use = #{moduleUse,jdbcType=TINYINT} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendOccupyMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendOccupyMapper.xml deleted file mode 100644 index 5a92a2733..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendOccupyMapper.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, occupy_num, start_time, end_time, created_by, create_time, status, update_time - - - - - delete from recommend_occupy - where id = #{id,jdbcType=BIGINT} - - - - SELECT LAST_INSERT_ID() - - insert into recommend_occupy (occupy_num, start_time, end_time, - created_by, create_time, status, - update_time) - values (#{occupyNum,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, - #{createdBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, - #{updateTime,jdbcType=TIMESTAMP}) - - - - SELECT LAST_INSERT_ID() - - insert into recommend_occupy - - - occupy_num, - - - start_time, - - - end_time, - - - created_by, - - - create_time, - - - status, - - - update_time, - - - - - #{occupyNum,jdbcType=INTEGER}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{createdBy,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=TINYINT}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update recommend_occupy - - - id = #{record.id,jdbcType=BIGINT}, - - - occupy_num = #{record.occupyNum,jdbcType=INTEGER}, - - - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - - - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - - - created_by = #{record.createdBy,jdbcType=VARCHAR}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - status = #{record.status,jdbcType=TINYINT}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update recommend_occupy - set id = #{record.id,jdbcType=BIGINT}, - occupy_num = #{record.occupyNum,jdbcType=INTEGER}, - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - created_by = #{record.createdBy,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - status = #{record.status,jdbcType=TINYINT}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update recommend_occupy - - - occupy_num = #{occupyNum,jdbcType=INTEGER}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - created_by = #{createdBy,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=TINYINT}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_occupy - set occupy_num = #{occupyNum,jdbcType=INTEGER}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - created_by = #{createdBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=TINYINT}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRecordMapper.xml deleted file mode 100644 index b9db11619..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRecordMapper.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, uid, seq_no, created_by, create_time, start_time, end_time, status, card_id - - - - - delete from recommend_record - where id = #{id,jdbcType=BIGINT} - - - - SELECT LAST_INSERT_ID() - - insert into recommend_record (uid, seq_no, created_by, - create_time, start_time, end_time, - status, card_id) - values (#{uid,jdbcType=BIGINT}, #{seqNo,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, - #{status,jdbcType=TINYINT}, #{cardId,jdbcType=BIGINT}) - - - - SELECT LAST_INSERT_ID() - - insert into recommend_record - - - uid, - - - seq_no, - - - created_by, - - - create_time, - - - start_time, - - - end_time, - - - status, - - - card_id, - - - - - #{uid,jdbcType=BIGINT}, - - - #{seqNo,jdbcType=INTEGER}, - - - #{createdBy,jdbcType=VARCHAR}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{startTime,jdbcType=TIMESTAMP}, - - - #{endTime,jdbcType=TIMESTAMP}, - - - #{status,jdbcType=TINYINT}, - - - #{cardId,jdbcType=BIGINT}, - - - - - - update recommend_record - - - id = #{record.id,jdbcType=BIGINT}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - seq_no = #{record.seqNo,jdbcType=INTEGER}, - - - created_by = #{record.createdBy,jdbcType=VARCHAR}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - - - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - - - status = #{record.status,jdbcType=TINYINT}, - - - card_id = #{record.cardId,jdbcType=BIGINT}, - - - - - - - - update recommend_record - set id = #{record.id,jdbcType=BIGINT}, - uid = #{record.uid,jdbcType=BIGINT}, - seq_no = #{record.seqNo,jdbcType=INTEGER}, - created_by = #{record.createdBy,jdbcType=VARCHAR}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - start_time = #{record.startTime,jdbcType=TIMESTAMP}, - end_time = #{record.endTime,jdbcType=TIMESTAMP}, - status = #{record.status,jdbcType=TINYINT}, - card_id = #{record.cardId,jdbcType=BIGINT} - - - - - - update recommend_record - - - uid = #{uid,jdbcType=BIGINT}, - - - seq_no = #{seqNo,jdbcType=INTEGER}, - - - created_by = #{createdBy,jdbcType=VARCHAR}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - start_time = #{startTime,jdbcType=TIMESTAMP}, - - - end_time = #{endTime,jdbcType=TIMESTAMP}, - - - status = #{status,jdbcType=TINYINT}, - - - card_id = #{cardId,jdbcType=BIGINT}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_record - set uid = #{uid,jdbcType=BIGINT}, - seq_no = #{seqNo,jdbcType=INTEGER}, - created_by = #{createdBy,jdbcType=VARCHAR}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - start_time = #{startTime,jdbcType=TIMESTAMP}, - end_time = #{endTime,jdbcType=TIMESTAMP}, - status = #{status,jdbcType=TINYINT}, - card_id = #{cardId,jdbcType=BIGINT} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomMapper.xml deleted file mode 100644 index f02987d57..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomMapper.xml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, room_uid, room_type, seq, weight, recommend_status, create_time, update_time - - - - - delete from recommend_room - where id = #{id,jdbcType=BIGINT} - - - insert into recommend_room (room_uid, room_type, seq, - weight, recommend_status, create_time, - update_time) - values (#{roomUid,jdbcType=BIGINT}, #{roomType,jdbcType=TINYINT}, #{seq,jdbcType=INTEGER}, - #{weight,jdbcType=INTEGER}, #{recommendStatus,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) - - - insert into recommend_room - - - room_uid, - - - room_type, - - - seq, - - - weight, - - - recommend_status, - - - create_time, - - - update_time, - - - - - #{roomUid,jdbcType=BIGINT}, - - - #{roomType,jdbcType=TINYINT}, - - - #{seq,jdbcType=INTEGER}, - - - #{weight,jdbcType=INTEGER}, - - - #{recommendStatus,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update recommend_room - - - id = #{record.id,jdbcType=BIGINT}, - - - room_uid = #{record.roomUid,jdbcType=BIGINT}, - - - room_type = #{record.roomType,jdbcType=TINYINT}, - - - seq = #{record.seq,jdbcType=INTEGER}, - - - weight = #{record.weight,jdbcType=INTEGER}, - - - recommend_status = #{record.recommendStatus,jdbcType=TINYINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update recommend_room - set id = #{record.id,jdbcType=BIGINT}, - room_uid = #{record.roomUid,jdbcType=BIGINT}, - room_type = #{record.roomType,jdbcType=TINYINT}, - seq = #{record.seq,jdbcType=INTEGER}, - weight = #{record.weight,jdbcType=INTEGER}, - recommend_status = #{record.recommendStatus,jdbcType=TINYINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update recommend_room - - - room_uid = #{roomUid,jdbcType=BIGINT}, - - - room_type = #{roomType,jdbcType=TINYINT}, - - - seq = #{seq,jdbcType=INTEGER}, - - - weight = #{weight,jdbcType=INTEGER}, - - - recommend_status = #{recommendStatus,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_room - set room_uid = #{roomUid,jdbcType=BIGINT}, - room_type = #{roomType,jdbcType=TINYINT}, - seq = #{seq,jdbcType=INTEGER}, - weight = #{weight,jdbcType=INTEGER}, - recommend_status = #{recommendStatus,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomRecordMapper.xml deleted file mode 100644 index 1a825e193..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/RecommendRoomRecordMapper.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, uid, room_uid, create_time, update_time - - - - - delete from recommend_room_record - where id = #{id,jdbcType=BIGINT} - - - insert into recommend_room_record (uid, room_uid, create_time, - update_time) - values (#{uid,jdbcType=BIGINT}, #{roomUid,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) - - - insert into recommend_room_record - - - uid, - - - room_uid, - - - create_time, - - - update_time, - - - - - #{uid,jdbcType=BIGINT}, - - - #{roomUid,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update recommend_room_record - - - id = #{record.id,jdbcType=BIGINT}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - room_uid = #{record.roomUid,jdbcType=BIGINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update recommend_room_record - set id = #{record.id,jdbcType=BIGINT}, - uid = #{record.uid,jdbcType=BIGINT}, - room_uid = #{record.roomUid,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update recommend_room_record - - - uid = #{uid,jdbcType=BIGINT}, - - - room_uid = #{roomUid,jdbcType=BIGINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - update recommend_room_record - set uid = #{uid,jdbcType=BIGINT}, - room_uid = #{roomUid,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/TopicRoomMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/TopicRoomMapper.xml deleted file mode 100644 index 217060146..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/TopicRoomMapper.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - id, module_id, uid, name, seq_no, status, create_time, update_time - - - - - delete from topic_room - where id = #{id,jdbcType=BIGINT} - - - insert into topic_room (id, module_id, uid, - name, seq_no, status, create_time, - update_time) - values (#{id,jdbcType=BIGINT}, #{moduleId,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, - #{name,jdbcType=VARCHAR}, #{seqNo,jdbcType=INTEGER}, #{status,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP}, - #{updateTime,jdbcType=TIMESTAMP}) - - - insert into topic_room - - - id, - - - module_id, - - - uid, - - - name, - - - seq_no, - - - status, - - - create_time, - - - update_time, - - - - - #{id,jdbcType=BIGINT}, - - - #{moduleId,jdbcType=BIGINT}, - - - #{uid,jdbcType=BIGINT}, - - - #{name,jdbcType=VARCHAR}, - - - #{seqNo,jdbcType=INTEGER}, - - - #{status,jdbcType=BIT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update topic_room - - - id = #{record.id,jdbcType=BIGINT}, - - - module_id = #{record.moduleId,jdbcType=BIGINT}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - name = #{record.name,jdbcType=VARCHAR}, - - - seq_no = #{record.seqNo,jdbcType=INTEGER}, - - - status = #{record.status,jdbcType=BIT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update topic_room - set id = #{record.id,jdbcType=BIGINT}, - module_id = #{record.moduleId,jdbcType=BIGINT}, - uid = #{record.uid,jdbcType=BIGINT}, - name = #{record.name,jdbcType=VARCHAR}, - seq_no = #{record.seqNo,jdbcType=INTEGER}, - status = #{record.status,jdbcType=BIT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update topic_room - - - module_id = #{moduleId,jdbcType=BIGINT}, - - - uid = #{uid,jdbcType=BIGINT}, - - - name = #{name,jdbcType=VARCHAR}, - - - seq_no = #{seqNo,jdbcType=INTEGER}, - - - status = #{status,jdbcType=BIT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where id = #{id,jdbcType=BIGINT} - - - update topic_room - set module_id = #{moduleId,jdbcType=BIGINT}, - uid = #{uid,jdbcType=BIGINT}, - name = #{name,jdbcType=VARCHAR}, - seq_no = #{seqNo,jdbcType=INTEGER}, - status = #{status,jdbcType=BIT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where id = #{id,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleLevelMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleLevelMapper.xml deleted file mode 100644 index 11e61d521..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleLevelMapper.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleMapper.xml deleted file mode 100644 index 83e178e9b..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleMapper.xml +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleTaskMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleTaskMapper.xml deleted file mode 100644 index 07bfbfe97..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserCoupleTaskMapper.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollMapper.xml deleted file mode 100644 index 874f6c03f..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollMapper.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - uid, sex, avatar, nick, voice, bed, like_count, invite_uid, create_time, update_time - - - - - delete from user_doll - where uid = #{uid,jdbcType=BIGINT} - - - insert into user_doll (uid,sex, avatar, nick, - voice, bed, like_count, - invite_uid, create_time, update_time - ) - values (#{uid,jdbcType=BIGINT},#{sex,jdbcType=TINYINT}, #{avatar,jdbcType=VARCHAR}, #{nick,jdbcType=VARCHAR}, - #{voice,jdbcType=VARCHAR}, #{bed,jdbcType=INTEGER}, #{likeCount,jdbcType=INTEGER}, - #{inviteUid,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} - ) - - - insert into user_doll - - - uid, - - - sex, - - - avatar, - - - nick, - - - voice, - - - bed, - - - like_count, - - - invite_uid, - - - create_time, - - - update_time, - - - - - #{uid,jdbcType=BIGINT}, - - - #{sex,jdbcType=TINYINT}, - - - #{avatar,jdbcType=VARCHAR}, - - - #{nick,jdbcType=VARCHAR}, - - - #{voice,jdbcType=VARCHAR}, - - - #{bed,jdbcType=INTEGER}, - - - #{likeCount,jdbcType=INTEGER}, - - - #{inviteUid,jdbcType=BIGINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - #{updateTime,jdbcType=TIMESTAMP}, - - - - - - update user_doll - - - uid = #{record.uid,jdbcType=BIGINT}, - - - sex = #{record.sex,jdbcType=TINYINT}, - - - avatar = #{record.avatar,jdbcType=VARCHAR}, - - - nick = #{record.nick,jdbcType=VARCHAR}, - - - voice = #{record.voice,jdbcType=VARCHAR}, - - - bed = #{record.bed,jdbcType=INTEGER}, - - - like_count = #{record.likeCount,jdbcType=INTEGER}, - - - invite_uid = #{record.inviteUid,jdbcType=BIGINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - update_time = #{record.updateTime,jdbcType=TIMESTAMP}, - - - - - - - - update user_doll - set uid = #{record.uid,jdbcType=BIGINT}, - sex = #{record.sex,jdbcType=TINYINT}, - avatar = #{record.avatar,jdbcType=VARCHAR}, - nick = #{record.nick,jdbcType=VARCHAR}, - voice = #{record.voice,jdbcType=VARCHAR}, - bed = #{record.bed,jdbcType=INTEGER}, - like_count = #{record.likeCount,jdbcType=INTEGER}, - invite_uid = #{record.inviteUid,jdbcType=BIGINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} - - - - - - update user_doll - - - sex = #{sex,jdbcType=TINYINT}, - - - avatar = #{avatar,jdbcType=VARCHAR}, - - - nick = #{nick,jdbcType=VARCHAR}, - - - voice = #{voice,jdbcType=VARCHAR}, - - - bed = #{bed,jdbcType=INTEGER}, - - - like_count = #{likeCount,jdbcType=INTEGER}, - - - invite_uid = #{inviteUid,jdbcType=BIGINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - update_time = #{updateTime,jdbcType=TIMESTAMP}, - - - where uid = #{uid,jdbcType=BIGINT} - - - update user_doll - set sex = #{sex,jdbcType=TINYINT}, - avatar = #{avatar,jdbcType=VARCHAR}, - nick = #{nick,jdbcType=VARCHAR}, - voice = #{voice,jdbcType=VARCHAR}, - bed = #{bed,jdbcType=INTEGER}, - like_count = #{likeCount,jdbcType=INTEGER}, - invite_uid = #{inviteUid,jdbcType=BIGINT}, - create_time = #{createTime,jdbcType=TIMESTAMP}, - update_time = #{updateTime,jdbcType=TIMESTAMP} - where uid = #{uid,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollRecordMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollRecordMapper.xml deleted file mode 100644 index d7fc190e5..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserDollRecordMapper.xml +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - - - - - - - - - record_id, uid, target_uid, opt_type, deal_type, link_type, sex_type, create_time - - - - - delete from user_doll_record - where record_id = #{recordId,jdbcType=BIGINT} - - - delete from user_doll_record - - - - - - insert into user_doll_record (uid, target_uid, opt_type, - deal_type, link_type, sex_type, - create_time) - values (#{uid,jdbcType=BIGINT}, #{targetUid,jdbcType=BIGINT}, #{optType,jdbcType=TINYINT}, - #{dealType,jdbcType=TINYINT}, #{linkType,jdbcType=TINYINT}, #{sexType,jdbcType=TINYINT}, - #{createTime,jdbcType=TIMESTAMP}) - - - insert into user_doll_record - - - uid, - - - target_uid, - - - opt_type, - - - deal_type, - - - link_type, - - - sex_type, - - - create_time, - - - - - #{uid,jdbcType=BIGINT}, - - - #{targetUid,jdbcType=BIGINT}, - - - #{optType,jdbcType=TINYINT}, - - - #{dealType,jdbcType=TINYINT}, - - - #{linkType,jdbcType=TINYINT}, - - - #{sexType,jdbcType=TINYINT}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - - update user_doll_record - - - record_id = #{record.recordId,jdbcType=BIGINT}, - - - uid = #{record.uid,jdbcType=BIGINT}, - - - target_uid = #{record.targetUid,jdbcType=BIGINT}, - - - opt_type = #{record.optType,jdbcType=TINYINT}, - - - deal_type = #{record.dealType,jdbcType=TINYINT}, - - - link_type = #{record.linkType,jdbcType=TINYINT}, - - - sex_type = #{record.sexType,jdbcType=TINYINT}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update user_doll_record - set record_id = #{record.recordId,jdbcType=BIGINT}, - uid = #{record.uid,jdbcType=BIGINT}, - target_uid = #{record.targetUid,jdbcType=BIGINT}, - opt_type = #{record.optType,jdbcType=TINYINT}, - deal_type = #{record.dealType,jdbcType=TINYINT}, - link_type = #{record.linkType,jdbcType=TINYINT}, - sex_type = #{record.sexType,jdbcType=TINYINT}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update user_doll_record - - - uid = #{uid,jdbcType=BIGINT}, - - - target_uid = #{targetUid,jdbcType=BIGINT}, - - - opt_type = #{optType,jdbcType=TINYINT}, - - - deal_type = #{dealType,jdbcType=TINYINT}, - - - link_type = #{linkType,jdbcType=TINYINT}, - - - sex_type = #{sexType,jdbcType=TINYINT}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where record_id = #{recordId,jdbcType=BIGINT} - - - update user_doll_record - set uid = #{uid,jdbcType=BIGINT}, - target_uid = #{targetUid,jdbcType=BIGINT}, - opt_type = #{optType,jdbcType=TINYINT}, - deal_type = #{dealType,jdbcType=TINYINT}, - link_type = #{linkType,jdbcType=TINYINT}, - sex_type = #{sexType,jdbcType=TINYINT}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where record_id = #{recordId,jdbcType=BIGINT} - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPrivilegeMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPrivilegeMapper.xml deleted file mode 100644 index 6dd624c45..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPrivilegeMapper.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPropsMapper.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPropsMapper.xml deleted file mode 100644 index 1a858f1aa..000000000 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UserRelationPropsMapper.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UsersMapperExpand.xml b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UsersMapperExpand.xml index a3da4c4bb..ec22d982e 100644 --- a/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UsersMapperExpand.xml +++ b/accompany-business/accompany-business-service/src/main/resources/accompany/sqlmappers/UsersMapperExpand.xml @@ -94,13 +94,6 @@ select uid from users where def_user in (1,2) limit #{start}, #{count} - - -