├── docs ├── 基建材料.jpeg ├── 部分材料价值计算方式修改.jpg ├── 运行项目.md ├── 终端.md ├── 部分计算过程.md ├── 材料推荐关的计算流程.md └── 材料推荐关相关代码.md ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── src ├── main │ ├── java │ │ └── com │ │ │ └── lhs │ │ │ ├── common │ │ │ ├── util │ │ │ │ ├── ItemBaseData.java │ │ │ │ ├── ExcelUtil.java │ │ │ │ ├── LogUtils.java │ │ │ │ ├── TextUtil.java │ │ │ │ ├── UserStatusCode.java │ │ │ │ ├── UserStatus.java │ │ │ │ ├── DesensitizedUtil.java │ │ │ │ ├── TimeUtil.java │ │ │ │ ├── IpUtil.java │ │ │ │ ├── IdGenerator.java │ │ │ │ ├── RateLimiter.java │ │ │ │ ├── HTMLUtil.java │ │ │ │ └── Result.java │ │ │ ├── enums │ │ │ │ ├── TimeRange.java │ │ │ │ ├── StageType.java │ │ │ │ ├── UnitTime.java │ │ │ │ ├── UserAction.java │ │ │ │ ├── RecordType.java │ │ │ │ ├── QuestionnaireType.java │ │ │ │ └── TimeGranularity.java │ │ │ ├── annotation │ │ │ │ ├── TakeCount.java │ │ │ │ ├── RateLimiter.java │ │ │ │ ├── RedisCacheable.java │ │ │ │ └── Sensitive.java │ │ │ ├── exception │ │ │ │ ├── InterfaceException.java │ │ │ │ ├── ServiceException.java │ │ │ │ └── GlobalExceptionHandler.java │ │ │ └── config │ │ │ │ ├── OpenAPIConfig.java │ │ │ │ ├── RedisConfig.java │ │ │ │ ├── ConfigUtil.java │ │ │ │ └── SensitiveSerialize.java │ │ │ ├── service │ │ │ ├── util │ │ │ │ ├── DataCacheService.java │ │ │ │ ├── ArknightsGameDataV2Service.java │ │ │ │ ├── Email163Service.java │ │ │ │ ├── TencentCloudService.java │ │ │ │ ├── ArknightsGameDataService.java │ │ │ │ └── impl │ │ │ │ │ └── DataCacheServiceImpl.java │ │ │ ├── admin │ │ │ │ ├── LogService.java │ │ │ │ ├── DevelopService.java │ │ │ │ ├── ImageInfoService.java │ │ │ │ ├── AdminService.java │ │ │ │ └── impl │ │ │ │ │ ├── LogServiceImp.java │ │ │ │ │ └── DevelopServiceImpl.java │ │ │ ├── user │ │ │ │ └── VisitsService.java │ │ │ ├── material │ │ │ │ ├── CustomItemService.java │ │ │ │ ├── StoreService.java │ │ │ │ └── ItemService.java │ │ │ ├── survey │ │ │ │ ├── HypergryphService.java │ │ │ │ └── OperatorDataService.java │ │ │ └── maa │ │ │ │ └── ScheduleService.java │ │ │ ├── entity │ │ │ ├── dto │ │ │ │ ├── user │ │ │ │ │ ├── SklandDataDTO.java │ │ │ │ │ ├── EmailDTO.java │ │ │ │ │ ├── SklandDTO.java │ │ │ │ │ ├── EmailRequestDTO.java │ │ │ │ │ ├── UserConfigDTO.java │ │ │ │ │ ├── LoginDataDTO.java │ │ │ │ │ ├── UpdateUserDataDTO.java │ │ │ │ │ └── AkPlayerBindInfoDTO.java │ │ │ │ ├── material │ │ │ │ │ ├── StageDropDetailDTO.java │ │ │ │ │ ├── StageDropDTO.java │ │ │ │ │ ├── PenguinMatrixDTO.java │ │ │ │ │ ├── ActTagAreaDTO.java │ │ │ │ │ ├── StageBlacklistDTO.java │ │ │ │ │ ├── StageCalculationParametersDTO.java │ │ │ │ │ ├── ItemCostDTO.java │ │ │ │ │ ├── QueryStageDropDTO.java │ │ │ │ │ ├── CompositeTableDTO.java │ │ │ │ │ ├── StageDropTimesStatistics.java │ │ │ │ │ └── StageResultTmpDTO.java │ │ │ │ ├── util │ │ │ │ │ ├── EmailFormDTO.java │ │ │ │ │ └── SpriteInfo.java │ │ │ │ ├── rogue │ │ │ │ │ ├── RogueSeedPageRequest.java │ │ │ │ │ ├── RollRogueSeedDTO.java │ │ │ │ │ ├── RogueSeedIdAndTypeDTO.java │ │ │ │ │ ├── UserActionOnSeedDTO.java │ │ │ │ │ ├── RogueSeedRatingDTO.java │ │ │ │ │ └── RogueSeedPageDTO.java │ │ │ │ ├── hypergryph │ │ │ │ │ ├── PlayerBinding.java │ │ │ │ │ └── GameDataFormatFilePath.java │ │ │ │ ├── survey │ │ │ │ │ ├── WarehouseInventoryAPIParams.java │ │ │ │ │ ├── PlayerInfoDTO.java │ │ │ │ │ ├── OperatorCarryQuestionnaireDTO.java │ │ │ │ │ └── OperatorCarryRateDailyDataRequestParamsDTO.java │ │ │ │ ├── maa │ │ │ │ │ └── BuildingData.java │ │ │ │ ├── drop │ │ │ │ │ └── StageDropDetailDTO.java │ │ │ │ └── item │ │ │ │ │ ├── ItemSeriesInfoDTO.java │ │ │ │ │ ├── ExpectedValueOfWorkshopByproducts.java │ │ │ │ │ ├── PathwayDTO.java │ │ │ │ │ ├── custom │ │ │ │ │ ├── CustomItemDTO.java │ │ │ │ │ ├── WorkshopItemDTO.java │ │ │ │ │ ├── ChipPreferenceDTO.java │ │ │ │ │ └── PenguinMatrixDTO.java │ │ │ │ │ ├── CustomItemDTO.java │ │ │ │ │ ├── ItemValueCorrectionTerm.java │ │ │ │ │ ├── CompositeTableDTO.java │ │ │ │ │ └── StageInfoAndDrop.java │ │ │ ├── vo │ │ │ │ ├── dev │ │ │ │ │ ├── LoginVo.java │ │ │ │ │ ├── DevelopLogVO.java │ │ │ │ │ ├── EmailRequest.java │ │ │ │ │ ├── VisitsTimeVo.java │ │ │ │ │ └── PageViewStatisticsVo.java │ │ │ │ ├── material │ │ │ │ │ ├── ActNameAndDateVO.java │ │ │ │ │ ├── PackContentVO.java │ │ │ │ │ ├── StageDropDetailVO.java │ │ │ │ │ ├── ActStageVO.java │ │ │ │ │ ├── ActStageResultVO.java │ │ │ │ │ ├── ZoneTableVO.java │ │ │ │ │ ├── StoreItemVO.java │ │ │ │ │ ├── RecommendedStageVO.java │ │ │ │ │ ├── StageDropVO.java │ │ │ │ │ ├── ItemVO.java │ │ │ │ │ ├── ActivityStoreDataVO.java │ │ │ │ │ ├── OrundumPerApResultVO.java │ │ │ │ │ ├── DropDetailVO.java │ │ │ │ │ ├── StageDropStatisticsVO.java │ │ │ │ │ ├── StageResultDetailVO.java │ │ │ │ │ ├── StageResultVOV2.java │ │ │ │ │ └── PackInfoVO.java │ │ │ │ ├── rogue │ │ │ │ │ └── RogueSeedRatingVO.java │ │ │ │ ├── survey │ │ │ │ │ ├── AkPlayerBindingListVO.java │ │ │ │ │ ├── CarryRateDailyDataVO.java │ │ │ │ │ ├── OperatorCarryRateStatisticsVO.java │ │ │ │ │ ├── OperatorCarryRateDailyDataVO.java │ │ │ │ │ ├── UserInfoVO.java │ │ │ │ │ ├── OperatorCarryRateVO.java │ │ │ │ │ └── OperatorProgressionStatisticalResultVOV2.java │ │ │ │ └── maa │ │ │ │ │ ├── OperBox.java │ │ │ │ │ └── MaaRecruitVo.java │ │ │ ├── po │ │ │ │ ├── admin │ │ │ │ │ ├── LogInfo.java │ │ │ │ │ ├── ImageInfo.java │ │ │ │ │ ├── Admin.java │ │ │ │ │ ├── DevelopLog.java │ │ │ │ │ ├── PageViewStatistics.java │ │ │ │ │ └── Visits.java │ │ │ │ ├── common │ │ │ │ │ └── DataCache.java │ │ │ │ ├── maa │ │ │ │ │ ├── RecruitStatistics.java │ │ │ │ │ ├── RecruitData.java │ │ │ │ │ └── Schedule.java │ │ │ │ ├── material │ │ │ │ │ ├── UserConfig.java │ │ │ │ │ ├── ItemCustom.java │ │ │ │ │ ├── ActivityStoreData.java │ │ │ │ │ ├── WorkShopProducts.java │ │ │ │ │ ├── ItemIterationValue.java │ │ │ │ │ ├── StageResultDetail.java │ │ │ │ │ ├── Item.java │ │ │ │ │ ├── QuantileTable.java │ │ │ │ │ ├── StageResult.java │ │ │ │ │ ├── ItemInfo.java │ │ │ │ │ └── StageDropStatisticalTaskLog.java │ │ │ │ ├── user │ │ │ │ │ ├── UserConfig.java │ │ │ │ │ ├── UserExternalAccountBinding.java │ │ │ │ │ ├── UserInfo.java │ │ │ │ │ └── AkPlayerBindInfo.java │ │ │ │ ├── survey │ │ │ │ │ ├── WarehouseInfo.java │ │ │ │ │ ├── SurveyOperatorData.java │ │ │ │ │ ├── OperatorUpdateTime.java │ │ │ │ │ ├── OperatorProgressionData.java │ │ │ │ │ ├── OperatorProgressionStatisticalResult.java │ │ │ │ │ ├── QuestionnaireResult.java │ │ │ │ │ └── OperatorCarryRateStatistics.java │ │ │ │ └── rogue │ │ │ │ │ ├── UserActionOnSeed.java │ │ │ │ │ ├── RogueSeedBak.java │ │ │ │ │ └── RogueSeedRating.java │ │ │ └── tmp │ │ │ │ └── QuestionnaireResultDTO.java │ │ │ ├── mapper │ │ │ ├── DataCacheMapper.java │ │ │ ├── material │ │ │ │ ├── ItemInfoMapper.java │ │ │ │ ├── ItemMapper.java │ │ │ │ ├── QuantileMapper.java │ │ │ │ ├── ItemCustomMapper.java │ │ │ │ ├── StageMapper.java │ │ │ │ ├── PackInfoMapper.java │ │ │ │ ├── StoreActMapper.java │ │ │ │ ├── WorkShopProductsMapper.java │ │ │ │ ├── ItemIterationValueMapper.java │ │ │ │ ├── service │ │ │ │ │ └── ItemMapperService.java │ │ │ │ ├── StageResultMapper.java │ │ │ │ ├── StageResultDetailMapper.java │ │ │ │ ├── StageDropMapper.java │ │ │ │ └── StageDropStatisticsMapper.java │ │ │ ├── rogue │ │ │ │ ├── UserActionOnSeedMapper.java │ │ │ │ ├── RogueSeedBakMapper.java │ │ │ │ ├── RogueSeedMapper.java │ │ │ │ ├── RogueSeedRatingMapper.java │ │ │ │ └── RogueSeedRatingStatisticsMapper.java │ │ │ ├── survey │ │ │ │ ├── OperatorUpdateTimeMapper.java │ │ │ │ ├── OperatorProgressionStatisticalResultMapper.java │ │ │ │ ├── QuestionnaireResultMapper.java │ │ │ │ ├── service │ │ │ │ │ └── WarehouseInfoMapperService.java │ │ │ │ ├── OperatorCarryRateMapper.java │ │ │ │ ├── WarehouseInfoMapper.java │ │ │ │ ├── OperatorCarryRateStatisticsMapper.java │ │ │ │ ├── OperatorProgressionDataMapper.java │ │ │ │ └── RecruitDataMapper.java │ │ │ ├── ScheduleMapper.java │ │ │ ├── admin │ │ │ │ ├── AdminMapper.java │ │ │ │ ├── LogInfoMapper.java │ │ │ │ ├── ImageInfoMapper.java │ │ │ │ ├── DevelopLogMapper.java │ │ │ │ ├── VisitsMapper.java │ │ │ │ └── PageVisitsMapper.java │ │ │ └── user │ │ │ │ ├── UserConfigMapper.java │ │ │ │ ├── AkPlayerBindInfoMapper.java │ │ │ │ ├── UserInfoMapper.java │ │ │ │ └── UserExternalAccountBindingMapper.java │ │ │ ├── BackEndApplication.java │ │ │ ├── controller │ │ │ └── ResourceController.java │ │ │ └── interceptor │ │ │ ├── WebConfig.java │ │ │ ├── CorsConfig.java │ │ │ └── SurveyInterceptor.java │ └── resources │ │ ├── application.yml │ │ ├── mapper │ │ ├── OperatorCarryRateStatisticsMapper.xml │ │ ├── RogueSeedMapper.xml │ │ ├── RougeSeedRatingMapper.xml │ │ ├── OperatorProgressionDataMapper.xml │ │ ├── RogueSeedRatingStatisticsMapper.xml │ │ ├── WarehouseInfoMapper.xml │ │ ├── StageResultDetailMapper.xml │ │ ├── StageResultMapper.xml │ │ ├── OperatorCarryRateMapper.xml │ │ ├── RecruitDataMapper.xml │ │ └── StageDropMapper.xml │ │ ├── data │ │ ├── expected_value_of_workshop_byproducts.json │ │ ├── recruitment_table.json │ │ └── item_value_correction_term.json │ │ ├── config │ │ ├── stage_task_config_v2.json │ │ ├── stage_task_config_v3.json │ │ └── drop_table.json │ │ └── application-test.yml └── test │ └── java │ └── com │ └── lhs │ ├── utils │ ├── UtilTest.java │ └── CosTest.java │ ├── material │ ├── CustomItemDTOValueTest.java │ └── ItemInfoDTOTest.java │ ├── service │ └── GameDataServiceTest.java │ └── item │ └── CustomItemDTOTest.java ├── .gitignore └── README.md /docs/基建材料.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arknights-yituliu/BackEndV3/HEAD/docs/基建材料.jpeg -------------------------------------------------------------------------------- /docs/部分材料价值计算方式修改.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arknights-yituliu/BackEndV3/HEAD/docs/部分材料价值计算方式修改.jpg -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Arknights-yituliu/BackEndV3/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/ItemBaseData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | public class ItemBaseData { 4 | 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # 用于切换生产和开发环境的配置文件,如开发环境配置文件为application-dev.yml 下面的active属性改成dev 2 | spring: 3 | profiles: 4 | active: dev 5 | 6 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/TimeRange.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | import java.util.Date; 4 | 5 | public enum TimeRange { 6 | 7 | 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/DataCacheService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util; 2 | 3 | public interface DataCacheService { 4 | 5 | Object getCacheData(String key); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/LogService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin; 2 | 3 | 4 | import com.lhs.entity.po.admin.LogInfo; 5 | 6 | public interface LogService { 7 | 8 | void saveLog(LogInfo loginfo); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/SklandDataDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class SklandDataDTO { 7 | private String token; 8 | private String data; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/dev/LoginVo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.dev; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginVo { 7 | private String developer; 8 | private String verificationCode; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/DataCacheMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.common.DataCache; 5 | 6 | public interface DataCacheMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/EmailDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EmailDTO { 7 | private String emailToAddress; 8 | private String subject; 9 | private String context; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ActNameAndDateVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ActNameAndDateVO { 8 | private String activityName; 9 | 10 | private Long timeStamp; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/ItemInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.ItemInfo; 5 | 6 | public interface ItemInfoMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/SklandDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class SklandDTO { 7 | private String uid; 8 | private String nickName; 9 | private String token; 10 | private String cred; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/rogue/UserActionOnSeedMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.rogue; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.rogue.UserActionOnSeed; 5 | 6 | public interface UserActionOnSeedMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/EmailRequestDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | 6 | @Data 7 | public class EmailRequestDTO { 8 | private String mailUsage; //邮件用途 9 | private String token; //用户凭证 10 | private String email; //邮箱 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/UserConfigDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import com.lhs.entity.dto.item.StageConfigDTO; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class UserConfigDTO { 8 | private Long configId; 9 | private StageConfigDTO stageConfig; 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/dev/DevelopLogVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.dev; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class DevelopLogVO { 7 | private String tag; 8 | private String author; 9 | private String text; 10 | private Long commitTime; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/ExcelUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import jakarta.servlet.http.HttpServletResponse; 4 | 5 | import java.io.IOException; 6 | import java.net.URLEncoder; 7 | import java.util.List; 8 | 9 | public class ExcelUtil { 10 | 11 | 12 | 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageDropDetailDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | public class StageDropDetailDTO { 8 | private String itemId; 9 | private Integer quantity; 10 | private String dropType; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/rogue/RogueSeedRatingVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.rogue; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class RogueSeedRatingVO { 9 | private Long seedId; 10 | private Integer rating; 11 | private Date createTime; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/OperatorUpdateTimeMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.OperatorUpdateTime; 5 | 6 | public interface OperatorUpdateTimeMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/ArknightsGameDataV2Service.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util; 2 | 3 | import com.lhs.entity.dto.hypergryph.GameDataFormatFilePath; 4 | 5 | 6 | public interface ArknightsGameDataV2Service { 7 | void getOperatorInfoSimpleTableV2(GameDataFormatFilePath gameDataFormatFilePath); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/dev/EmailRequest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.dev; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EmailRequest { 7 | private String From;//发送者 8 | private String To;//收件人 9 | private String Subject;//邮件主题 10 | private String Text;//邮件内容 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/PackContentVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PackContentVO { 7 | 8 | private String itemName; //物品名称 9 | private String itemId; //物品id 10 | private Integer quantity; //物品数量 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/util/EmailFormDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.util; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class EmailFormDTO { 7 | private String from; 8 | private String to; 9 | private String cc; 10 | private String subject; 11 | private String text; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StageDropDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | import lombok.Data; 3 | 4 | @Data 5 | public class StageDropDetailVO { 6 | private Long childId; 7 | private String itemId; 8 | private Integer quantity; 9 | private String dropType; 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/OperatorCarryRateStatisticsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/dev/VisitsTimeVo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.dev; 2 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; 4 | import lombok.Data; 5 | 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | public class VisitsTimeVo { 11 | 12 | private Long startTime; 13 | 14 | private Long endTime; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/ScheduleMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.maa.Schedule; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | 8 | @Mapper 9 | public interface ScheduleMapper extends BaseMapper { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.admin.Admin; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface AdminMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/LogInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.admin.LogInfo; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface LogInfoMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/ImageInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.admin.ImageInfo; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface ImageInfoMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/ItemMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lhs.entity.po.material.Item; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface ItemMapper extends BaseMapper { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/QuantileMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.QuantileTable; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface QuantileMapper extends BaseMapper { 9 | } -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/user/UserConfigMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.user.UserConfig; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserConfigMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/DevelopLogMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.admin.DevelopLog; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface DevelopLogMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/VisitsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lhs.entity.po.admin.Visits; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface VisitsMapper extends BaseMapper { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ActStageVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.Data; 4 | import java.util.List; 5 | 6 | @Data 7 | public class ActStageVO { 8 | private String zoneName; 9 | private String stageType; 10 | private List actStageList; 11 | private Long endTime; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/ItemCustomMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.ItemCustom; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface ItemCustomMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StageMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lhs.entity.po.material.Stage; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface StageMapper extends BaseMapper { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/RogueSeedPageRequest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class RogueSeedPageRequest { 9 | private Integer pageSize; 10 | private Integer pageNum; 11 | private String orderBy; 12 | private List keyWords; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/LogInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.Date; 6 | 7 | @Data 8 | public class LogInfo { 9 | 10 | private Long id; 11 | private String message; 12 | private String logType; 13 | private String apiPath; 14 | private Date createTime; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/PackInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.PackInfo; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface PackInfoMapper extends BaseMapper { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/rogue/RogueSeedBakMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.rogue; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.rogue.RogueSeedBak; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface RogueSeedBakMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/hypergryph/PlayerBinding.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.hypergryph; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class PlayerBinding { 7 | 8 | private String uid; 9 | private String channelMasterId; 10 | private String channelName; 11 | private String nickName; 12 | private Boolean defaultFlag; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/RollRogueSeedDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | public class RollRogueSeedDTO { 4 | private Integer seedType; 5 | 6 | public Integer getSeedType() { 7 | return seedType; 8 | } 9 | 10 | public void setSeedType(Integer seedType) { 11 | this.seedType = seedType; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StoreActMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.ActivityStoreData; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface StoreActMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/DevelopService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin; 2 | 3 | 4 | import com.lhs.entity.po.admin.DevelopLog; 5 | import com.lhs.entity.vo.dev.DevelopLogVO; 6 | 7 | public interface DevelopService { 8 | 9 | void saveDevelopLog(DevelopLogVO developLogVO); 10 | 11 | void updateDevelopLog(DevelopLog developLog); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/user/AkPlayerBindInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.user.AkPlayerBindInfo; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface AkPlayerBindInfoMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/LogUtils.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | @Slf4j 6 | public class LogUtils { 7 | 8 | 9 | 10 | public static void info(String message){ 11 | log.info(message); 12 | } 13 | 14 | public static void error(String message){ 15 | log.error(message); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/admin/PageVisitsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.admin; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.admin.PageViewStatistics; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface PageVisitsMapper extends BaseMapper { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/OperatorProgressionStatisticalResultMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.OperatorProgressionStatisticalResult; 5 | 6 | public interface OperatorProgressionStatisticalResultMapper extends BaseMapper { 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/common/DataCache.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.common; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | @TableName 8 | @Data 9 | public class DataCache { 10 | @TableId 11 | private String dataKey; 12 | private String dataValue; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/AkPlayerBindingListVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | import com.lhs.entity.dto.hypergryph.PlayerBinding; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class AkPlayerBindingListVO { 10 | private PlayerBinding playerBinding; 11 | private List playerBindingList; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/QuestionnaireResultMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.QuestionnaireResult; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | @Mapper 8 | public interface QuestionnaireResultMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/resources/data/expected_value_of_workshop_byproducts.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "rarity": 1, 4 | "expectValue": 1.962201 5 | }, 6 | { 7 | "rarity": 2, 8 | "expectValue": 5.853670784766422 9 | }, 10 | { 11 | "rarity": 3, 12 | "expectValue": 24.578868967312253 13 | }, 14 | { 15 | "rarity": 4, 16 | "expectValue": 79.8592285162492 17 | } 18 | ] -------------------------------------------------------------------------------- /src/test/java/com/lhs/utils/UtilTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.utils; 2 | 3 | import com.lhs.common.util.TimeUtil; 4 | import org.junit.jupiter.api.Test; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @SpringBootTest 8 | public class UtilTest { 9 | 10 | @Test 11 | void timeUtil(){ 12 | String dayText = TimeUtil.getDayText(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/StageType.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public class StageType { 4 | public final static String MAIN = "MAIN"; 5 | public final static String ACT = "ACT"; 6 | public final static String ACT_REP = "ACT_REP"; 7 | public final static String ACT_MINI = "ACT_MINI"; 8 | public final static String ACT_PERM = "ACT_PERM"; 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/WorkShopProductsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.WorkShopProducts; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface WorkShopProductsMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/survey/WarehouseInventoryAPIParams.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.survey; 2 | 3 | import com.lhs.entity.po.survey.WarehouseInfo; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class WarehouseInventoryAPIParams { 10 | private String token; 11 | private String akUid; 12 | private List list; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/ItemIterationValueMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.ItemIterationValue; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface ItemIterationValueMapper extends BaseMapper { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/user/UserInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.user.UserInfo; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | @Repository 9 | public interface UserInfoMapper extends BaseMapper { 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/TextUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | 7 | public class TextUtil { 8 | 9 | public static List textToArray(String text){ 10 | 11 | return Arrays.stream(text.split(",")) 12 | .collect(Collectors.toList()); 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/maa/OperBox.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.maa; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class OperBox { 7 | 8 | private String id; 9 | private String name; 10 | private Integer elite; 11 | private Integer level; 12 | private Integer potential; 13 | private Integer rarity; 14 | private Boolean own; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/user/UserExternalAccountBindingMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.user; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.user.UserExternalAccountBinding; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface UserExternalAccountBindingMapper extends BaseMapper { 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageDropDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class StageDropDTO { 9 | private String stageId; 10 | private Integer times; 11 | private List drops; 12 | private String server; 13 | private String source; 14 | private String version; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/annotation/TakeCount.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface TakeCount { 11 | String name() default "未知"; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/maa/RecruitStatistics.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.maa; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @Builder 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class RecruitStatistics { 13 | private String statisticalItem ; 14 | private Integer statisticalResult; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ActStageResultVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ActStageResultVO { 7 | private String stageId; 8 | private String stageCode; 9 | private String itemId; 10 | private String itemName; 11 | private Double apExpect; 12 | private Double knockRating; 13 | private Double stageEfficiency; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/service/ItemMapperService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.lhs.entity.po.material.Item; 5 | import com.lhs.mapper.material.ItemMapper; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class ItemMapperService extends ServiceImpl { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/resources/config/stage_task_config_v2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 202412050001, 4 | "expCoefficient": 0.633, 5 | "sampleSize": 300 6 | }, 7 | { 8 | "id": 202412050002, 9 | "expCoefficient": 0.633, 10 | "sampleSize": 300, 11 | "customItemValue": { 12 | "30073": 1.8 13 | } 14 | }, 15 | { 16 | "id": 202412050003, 17 | "expCoefficient": 0, 18 | "sampleSize": 300 19 | } 20 | ] -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/user/VisitsService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.user; 2 | 3 | import com.lhs.entity.vo.dev.PageViewStatisticsVo; 4 | import com.lhs.entity.vo.dev.VisitsTimeVo; 5 | 6 | import java.util.List; 7 | 8 | public interface VisitsService { 9 | 10 | void updatePageVisits(String path); 11 | 12 | 13 | void savePageVisits(); 14 | 15 | List getVisits(VisitsTimeVo visitsTimeVo); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/UserConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | @TableName 8 | @Data 9 | public class UserConfig { 10 | 11 | @TableId 12 | private Long uid; 13 | private String config; 14 | private Long createTime; 15 | private Long updateTime; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ZoneTableVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import com.lhs.entity.po.material.Stage; 4 | import lombok.Data; 5 | 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | @Data 10 | public class ZoneTableVO { 11 | private String zoneName; 12 | private String zoneId; 13 | private String stageType; 14 | private Date endTime; 15 | private List stageList; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/PenguinMatrixDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | 4 | import lombok.Data; 5 | 6 | //用于转换企鹅物流的api的实体类 7 | @Data 8 | public class PenguinMatrixDTO { 9 | 10 | // 企鹅物流数据 11 | private String stageId; //关卡id 12 | private String itemId; //物品id 13 | private Integer quantity; //物品掉落次数 14 | private Integer times; //关卡刷取次数 15 | private Long start; 16 | private Long end; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/ImageInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @TableName 11 | public class ImageInfo { 12 | 13 | @TableId 14 | private String imageName; 15 | private String imageLink; 16 | 17 | private Date createTime; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StoreItemVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | 4 | import lombok.Data; 5 | 6 | @Data 7 | 8 | public class StoreItemVO { 9 | private Integer itemArea; 10 | 11 | private String itemId; 12 | 13 | private String itemName; 14 | 15 | private Double itemPPR; 16 | 17 | private Integer itemPrice; 18 | 19 | private Integer itemQuantity; 20 | 21 | private Integer itemStock; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/material/CustomItemService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.material; 2 | 3 | 4 | import com.lhs.entity.dto.item.custom.ItemInfoDTO; 5 | import com.lhs.entity.dto.item.custom.ItemValueConfigDTO; 6 | 7 | import java.util.List; 8 | 9 | public interface CustomItemService { 10 | 11 | 12 | void customItemValueCalculation(); 13 | 14 | 15 | 16 | List getCustomItemList(ItemValueConfigDTO itemValueConfigDTO); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/config/stage_task_config_v3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 202412050001, 4 | "expCoefficient": 0.633, 5 | "sampleSize": 300 6 | }, 7 | { 8 | "id": 202412050002, 9 | "expCoefficient": 0.633, 10 | "sampleSize": 300, 11 | "customItem": [{ 12 | "itemId": "30073", 13 | "itemValue": 1.8 14 | }] 15 | }, 16 | { 17 | "id": 202412050003, 18 | "expCoefficient": 0, 19 | "sampleSize": 300 20 | } 21 | ] -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/UnitTime.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public enum UnitTime { 4 | 5 | ONE_HOUR(60 * 60 * 1000), // 一小时的毫秒数 6 | ONE_DAY(24 * 60 * 60 * 1000); // 一天的毫秒数 7 | 8 | private final long milliseconds; 9 | 10 | UnitTime(long milliseconds) { 11 | this.milliseconds = milliseconds; 12 | } 13 | 14 | // 获取对应的毫秒数 15 | public long milliseconds() { 16 | return milliseconds; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/service/WarehouseInfoMapperService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey.service; 2 | 3 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 4 | import com.lhs.entity.po.survey.WarehouseInfo; 5 | import com.lhs.mapper.survey.WarehouseInfoMapper; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | public class WarehouseInfoMapperService extends ServiceImpl { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/maa/MaaRecruitVo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.maa; 2 | 3 | 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | //用于接收maa的公招数据 9 | @Data 10 | public class MaaRecruitVo { 11 | 12 | private String uuid; 13 | private List tags; 14 | private Integer level; 15 | private String server; 16 | private String source; 17 | private String version; 18 | 19 | public MaaRecruitVo() { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/RecommendedStageVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class RecommendedStageVO { 9 | private String itemType; 10 | private String itemTypeId; 11 | private String itemSeries; 12 | private String itemSeriesId; 13 | private String version; 14 | 15 | 16 | private List stageResultList; 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/ItemCustom.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | @Data 8 | 9 | @TableName 10 | public class ItemCustom { 11 | 12 | @TableId 13 | private String itemId; 14 | private Integer zoneIndex; 15 | private String itemName; 16 | private Double itemValue; 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/resources/mapper/RogueSeedMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StageDropVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.Data; 4 | 5 | import java.util.List; 6 | 7 | @Data 8 | public class StageDropVO { 9 | private Long id; 10 | private Long createTime; 11 | private String stageId; 12 | private String server; 13 | private String version; 14 | private String uid; 15 | private Integer times; 16 | private List dropList; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/OperatorCarryRateMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.OperatorCarryRate; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | public interface OperatorCarryRateMapper extends BaseMapper { 10 | 11 | Integer insertBatch(@Param("list")List operatorCarryRateList); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/UserAction.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public enum UserAction { COPY(1,"复制"), 4 | RATING(2,"点赞"); 5 | 6 | private Integer actionCode; 7 | private String action; 8 | 9 | UserAction(Integer actionCode, String action) { 10 | 11 | } 12 | 13 | public Integer getActionCode() { 14 | return actionCode; 15 | } 16 | 17 | public String getAction() { 18 | return action; 19 | } 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/ActivityStoreData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @TableName("activity_store_data") 11 | public class ActivityStoreData { 12 | @TableId 13 | private String actName; 14 | private Date endTime; 15 | private String storeData; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/user/UserConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @TableName 11 | public class UserConfig { 12 | @TableId 13 | private Long uid; 14 | private String config; 15 | private Date createTime; //创建时间 16 | private Date updateTime; //最后一次上传数据时间 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/maa/BuildingData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.maa; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class BuildingData { 7 | private String charId; 8 | private String name; 9 | private String buffName; 10 | private String roomType; 11 | private String description; 12 | private String buffColor; 13 | private String textColor; 14 | private Integer phase; 15 | private Integer level; 16 | private Long timestamp; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/mapper/RougeSeedRatingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/LoginDataDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoginDataDTO { 7 | 8 | private String userName;//用户名 9 | private String email; //邮箱 10 | private String accountType; 11 | private String password;//密码 12 | private String emailCode; //邮箱验证码 13 | private String verificationCode; //邮箱验证码 14 | private String token; 15 | private String hgToken; 16 | private String sklandCred; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StageResultMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.StageResult; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface StageResultMapper extends BaseMapper { 12 | 13 | void insertBatch(@Param("list") List list); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/rogue/RogueSeedMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.rogue; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.dto.rogue.RogueSeedIdAndTypeDTO; 5 | import com.lhs.entity.po.rogue.RogueSeed; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface RogueSeedMapper extends BaseMapper { 12 | 13 | 14 | List listRogueSeedIdAndType(); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/drop/StageDropDetailDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.drop; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.Data; 7 | 8 | @Data 9 | @TableName 10 | public class StageDropDetailDTO { 11 | @TableId 12 | private Long id; 13 | private String uid; 14 | private Long childId; 15 | private String itemId; 16 | private String dropType; 17 | private Integer quantity; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/WarehouseInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.WarehouseInfo; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface WarehouseInfoMapper extends BaseMapper { 12 | Integer insertBatch( @Param("list") List list); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/exception/InterfaceException.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.exception; 2 | 3 | public class InterfaceException extends RuntimeException{ 4 | 5 | private String message; 6 | private Integer code; 7 | 8 | public InterfaceException(String message,Integer code) { 9 | this(message); 10 | this.message = message; 11 | this.code = code; 12 | } 13 | 14 | 15 | 16 | private InterfaceException(String message) { 17 | super(message); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/user/UserExternalAccountBinding.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName 9 | public class UserExternalAccountBinding { 10 | 11 | @TableId 12 | private Long id; 13 | private Long uid; 14 | private String akUid; 15 | private Long createTime; 16 | private Long updateTime; 17 | private Boolean deleteFlag; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/WarehouseInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | @Data 8 | @TableName 9 | public class WarehouseInfo { 10 | @TableId 11 | private Long id; 12 | private Long uid; 13 | private String akUid; 14 | private String itemId; 15 | private Integer quantity; 16 | private Long lastDataId; 17 | private Long updateTime; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ItemVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class ItemVO { 11 | 12 | private String itemId; //物品id 13 | 14 | private String itemName; //物品名称 15 | 16 | private Double itemValue; //物品价值 单位:绿票 17 | 18 | private Double itemValueAp; //物品价值 单位:理智 19 | 20 | private Integer rarity; //物品稀有度 21 | 22 | } 23 | -------------------------------------------------------------------------------- /docs/运行项目.md: -------------------------------------------------------------------------------- 1 | ## 项目准备 2 | 参考《环境安装》文档安装项目所需软件后完毕后 3 | 4 | ### 1.数据库表导入 5 | 将 docs/sql 目录下的两个sql文件导入到你的MySQL中,表结构.sql仅有表的结构, 6 | 初始数据.sql包含一部分运行时的初始数据。 7 | 8 | ### 修改配置文件 9 | src/main/resources/application.yml 用来选中用某个配置文件启动 10 | ```yml 11 | # 用于切换生产和开发环境的配置文件,将active的值改成test,将用application-test.yml内的配置进行启动 12 | spring: 13 | profiles: 14 | active: test 15 | ``` 16 | src/main/resources/application-test.yml 真正被调用的配置文件,修改里面的配置为你自己的配置 17 | 18 | (可以改别的名字,比如src/main/resources/application-dev.yml,将active值改为dev即可) 19 | 20 | ### 之后正常启动项目就行了 21 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/UpdateUserDataDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class UpdateUserDataDTO { 7 | private String property; 8 | private String action; 9 | private String token; 10 | private String userName; 11 | private String oldEmail; 12 | private String email; 13 | private String verificationCode; 14 | private String newPassWord; 15 | private String oldPassWord; 16 | private String avatar; 17 | private String cred; 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/Admin.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import lombok.Data; 7 | 8 | import java.util.Date; 9 | 10 | @TableName 11 | @Data 12 | 13 | public class Admin { 14 | 15 | @TableId 16 | private Long id; 17 | private String developer; 18 | private String email; 19 | private Integer level; 20 | private String token; 21 | private Date expire; 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/UserStatusCode.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | 4 | 5 | public class UserStatusCode { 6 | 7 | public static final Integer USER_INITIAL = 1; 8 | 9 | public static final Integer HAS_PASSWORD = 1<<1; 10 | 11 | public static final Integer HAS_EMAIL = 1<<2; 12 | 13 | public static final Integer HAS_16 = 1<<3; 14 | 15 | public static final Integer HAS_32 = 1<<4; 16 | 17 | public static final Integer HAS_64 = 1<<5; 18 | 19 | public static final Integer HAS_128 = 1<<6; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /docs/终端.md: -------------------------------------------------------------------------------- 1 | 2 | ``` 3 | ps -ef|grep BackEnd.jar 4 | ``` 5 | ``` 6 | nohup /usr/java/jdk-17.0.8/bin/java -Xms128m -Xmx256m -jar BackEnd.V3.6.9.jar > log.txt 2>&1 & 7 | ``` 8 | ``` 9 | nohup java -Xms128m -Xmx256m -jar BackEnd.jar > /backend/log/log.txt 2>&1 & 10 | ``` 11 | ``` 12 | mysql -uroot -p databak /backup/stage_drop_detail_20240524.sql 19 | ``` -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/survey/PlayerInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.survey; 2 | 3 | 4 | import com.lhs.entity.po.survey.WarehouseInfo; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class PlayerInfoDTO { 11 | private String token; 12 | private String uid; 13 | private String nickName; 14 | private String channelName; 15 | private Integer channelMasterId; 16 | private List operatorDataList; 17 | private List itemList; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/user/AkPlayerBindInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | 8 | @Data 9 | public class AkPlayerBindInfoDTO { 10 | 11 | //方舟uid 12 | private String akUid; 13 | //方舟昵称 14 | private String akNickName; 15 | //频道名称 16 | private String channelName; 17 | //频道id 18 | private Integer channelMasterId; 19 | private Long warehouseInfoId; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StageResultDetailMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.StageResultDetail; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface StageResultDetailMapper extends BaseMapper { 12 | 13 | void insertBatch(@Param("list") List list); 14 | 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/DevelopLog.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @TableName 11 | public class DevelopLog { 12 | 13 | @TableId 14 | private Long id; 15 | private String tag; 16 | private String author; 17 | private String text; 18 | private Date commitTime; 19 | private Date createTime; 20 | private Date updateTime; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/survey/HypergryphService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.survey; 2 | 3 | import com.lhs.entity.vo.survey.AkPlayerBindingListVO; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | 9 | public interface HypergryphService { 10 | 11 | 12 | AkPlayerBindingListVO getPlayerBindingsByHGToken(String token); 13 | 14 | Map getCredAndTokenAndPlayerBindingsByHgToken(String hgToken); 15 | 16 | AkPlayerBindingListVO getPlayerBindingsBySkland(HashMap sklandCredAndToken); 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/ActTagAreaDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | 4 | public class ActTagAreaDTO { 5 | private String tagText; 6 | private String tagRank; 7 | 8 | public String getTagText() { 9 | return tagText; 10 | } 11 | 12 | public void setTagText(String tagText) { 13 | this.tagText = tagText; 14 | } 15 | 16 | public String getTagRank() { 17 | return tagRank; 18 | } 19 | 20 | public void setTagRank(String tagRank) { 21 | this.tagRank = tagRank; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/ImageInfoService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin; 2 | 3 | import com.lhs.entity.po.admin.ImageInfo; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.util.List; 7 | 8 | public interface ImageInfoService { 9 | 10 | void saveImage(MultipartFile multipartFile, String path, String imageName); 11 | 12 | 13 | List listImageInfo(String imageType); 14 | 15 | ImageInfo getImageInfo(String imageName); 16 | 17 | String saveImageFiles(List files, String path); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/mapper/OperatorProgressionDataMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/RogueSeedIdAndTypeDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | public class RogueSeedIdAndTypeDTO { 4 | private Long seedId; 5 | private Integer seedType; 6 | 7 | public Long getSeedId() { 8 | return seedId; 9 | } 10 | 11 | public void setSeedId(Long seedId) { 12 | this.seedId = seedId; 13 | } 14 | 15 | public Integer getSeedType() { 16 | return seedType; 17 | } 18 | 19 | public void setSeedType(Integer seedType) { 20 | this.seedType = seedType; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/BackEndApplication.java: -------------------------------------------------------------------------------- 1 | package com.lhs; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.scheduling.annotation.EnableScheduling; 7 | 8 | @EnableScheduling 9 | @SpringBootApplication 10 | @MapperScan("com.lhs.mapper") 11 | public class BackEndApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(BackEndApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/UserActionOnSeedDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | import java.util.Date; 4 | 5 | public class UserActionOnSeedDTO { 6 | private Long seedId; 7 | private String action; 8 | 9 | public Long getSeedId() { 10 | return seedId; 11 | } 12 | 13 | public void setSeedId(Long seedId) { 14 | this.seedId = seedId; 15 | } 16 | 17 | public String getAction() { 18 | return action; 19 | } 20 | 21 | public void setAction(String action) { 22 | this.action = action; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/ActivityStoreDataVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | 4 | import com.lhs.entity.dto.material.ActTagAreaDTO; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class ActivityStoreDataVO { 11 | 12 | private Long endTime; 13 | 14 | private List actTagArea; 15 | 16 | private String imageLink; 17 | 18 | private Double actPPRBase; 19 | 20 | private Double actPPRStair; 21 | 22 | private String actName; 23 | 24 | private List actStore; 25 | 26 | 27 | } -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageBlacklistDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | public class StageBlacklistDTO { 4 | private String stageId; 5 | private String stageCode; 6 | 7 | public String getStageId() { 8 | return stageId; 9 | } 10 | 11 | public void setStageId(String stageId) { 12 | this.stageId = stageId; 13 | } 14 | 15 | public String getStageCode() { 16 | return stageCode; 17 | } 18 | 19 | public void setStageCode(String stageCode) { 20 | this.stageCode = stageCode; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/RecordType.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public enum RecordType { 4 | DISPLAY(1,"展示数据"), 5 | EXPIRE(-1,"过期数据"), 6 | 7 | ARCHIVED(2,"归档数据"); 8 | private Integer code; 9 | private String recordType; 10 | 11 | 12 | 13 | RecordType(Integer code, String recordType) { 14 | this.code = code; 15 | this.recordType = recordType; 16 | } 17 | 18 | public Integer code() { 19 | return code; 20 | } 21 | 22 | public String recordType() { 23 | return recordType; 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/ItemSeriesInfoDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | public class ItemSeriesInfoDTO { 4 | private String seriesId; 5 | private String seriesName; 6 | 7 | public String getSeriesId() { 8 | return seriesId; 9 | } 10 | 11 | public void setSeriesId(String seriesId) { 12 | this.seriesId = seriesId; 13 | } 14 | 15 | public String getSeriesName() { 16 | return seriesName; 17 | } 18 | 19 | public void setSeriesName(String seriesName) { 20 | this.seriesName = seriesName; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/annotation/RateLimiter.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target({ElementType.METHOD}) 10 | public @interface RateLimiter { 11 | 12 | String key() default "MaximumLimit"; //限流的key 13 | int time() default 10; //限流的窗口时间 14 | int MaximumTimes() default 10; //窗口时间内的最大次数 15 | 16 | String keyField() default ""; //方法的参数 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/WorkShopProducts.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @TableName("work_shop_products") 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class WorkShopProducts { 14 | @TableId 15 | private Long id; 16 | private String itemRank; 17 | private Double expectValue; 18 | private String version; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/exception/ServiceException.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.exception; 2 | 3 | import com.lhs.common.enums.ResultCode; 4 | 5 | /** 6 | * 自定义service层异常类 7 | */ 8 | public class ServiceException extends RuntimeException{ 9 | 10 | 11 | private ResultCode resultCode; 12 | 13 | 14 | public ServiceException(ResultCode resultCode) { 15 | this.resultCode = resultCode; 16 | } 17 | 18 | 19 | public ResultCode getResultCode() { 20 | return resultCode; 21 | } 22 | 23 | public void setResultCode(ResultCode resultCode) { 24 | this.resultCode = resultCode; 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/dev/PageViewStatisticsVo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.dev; 2 | 3 | import com.lhs.entity.po.admin.PageViewStatistics; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class PageViewStatisticsVo { 8 | private String pagePath; 9 | 10 | private Integer pageView; 11 | private Long viewTime; 12 | 13 | public void copy(PageViewStatistics pageViewStatistics){ 14 | this.pagePath = pageViewStatistics.getPagePath(); 15 | this.pageView = pageViewStatistics.getPageView(); 16 | this.viewTime = pageViewStatistics.getCreateTime().getTime(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/rogue/RogueSeedRatingMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.rogue; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.rogue.RogueSeedRating; 5 | import com.lhs.entity.vo.rogue.RogueSeedRatingVO; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface RogueSeedRatingMapper extends BaseMapper { 13 | List listRogueSeedRating(@Param("pageNum")Integer pageNum,@Param("pageSize")Integer pageSize); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/ItemIterationValue.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @TableName("item_iteration_value") 10 | @Data 11 | public class ItemIterationValue { 12 | @TableId 13 | private Long id; 14 | private String itemName; 15 | private String itemId; 16 | private Double iterationValue; 17 | private String version; 18 | private String stageCode; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/rogue/RogueSeedRatingStatisticsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.rogue; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.rogue.RogueSeedRatingStatistics; 5 | import org.apache.ibatis.annotations.Param; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import java.util.List; 9 | 10 | @Repository 11 | public interface RogueSeedRatingStatisticsMapper extends BaseMapper { 12 | 13 | List pageRogueSeedRatingStatistics(@Param("pageNum")Integer pageNum,@Param("pageSize")Integer pageSize); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/ExpectedValueOfWorkshopByproducts.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | public class ExpectedValueOfWorkshopByproducts { 4 | private Integer rarity; 5 | private Double expectValue; 6 | 7 | public Integer getRarity() { 8 | return rarity; 9 | } 10 | 11 | public void setRarity(Integer rarity) { 12 | this.rarity = rarity; 13 | } 14 | 15 | public Double getExpectValue() { 16 | return expectValue; 17 | } 18 | 19 | public void setExpectValue(Double expectValue) { 20 | this.expectValue = expectValue; 21 | } 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/CarryRateDailyDataVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | public class CarryRateDailyDataVO { 4 | 5 | private Integer carryCount = 0; 6 | private Integer sampleSize = 0; 7 | 8 | 9 | public Integer getCarryCount() { 10 | return carryCount; 11 | } 12 | 13 | public void setCarryCount(Integer carryCount) { 14 | this.carryCount = carryCount; 15 | } 16 | 17 | public Integer getSampleSize() { 18 | return sampleSize; 19 | } 20 | 21 | public void setSampleSize(Integer sampleSize) { 22 | this.sampleSize = sampleSize; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/resources/mapper/RogueSeedRatingStatisticsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin; 2 | 3 | 4 | import com.lhs.entity.vo.dev.LoginVo; 5 | import jakarta.servlet.http.HttpServletRequest; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | import java.util.Set; 10 | 11 | public interface AdminService { 12 | 13 | Boolean developerLevel(HttpServletRequest request); 14 | 15 | void emailSendCode(LoginVo loginVo); 16 | 17 | Map login(LoginVo loginVo); 18 | 19 | HashMap getDeveloperInfo(String token); 20 | 21 | Map getCacheKeys(); 22 | 23 | String deleteCacheKey(String key); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/Email163Service.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util; 2 | 3 | 4 | import com.lhs.entity.dto.util.EmailFormDTO; 5 | 6 | public interface Email163Service { 7 | 8 | 9 | void sendSimpleEmail(EmailFormDTO email); 10 | 11 | /** 12 | * 生成一个验证码并发送至邮箱 13 | * @param emailAddress 邮箱地址 14 | * @param maxCodeNum 最大验证码数量 15 | * @return 验证码 16 | */ 17 | Integer createVerificationCode(String emailAddress, Integer maxCodeNum); 18 | 19 | /** 20 | * 校验验证码 21 | * @param inputCode 输入的验证码 22 | * @param key 邮箱地址 23 | */ 24 | void compareVerificationCode(String inputCode, String key); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/OrundumPerApResultVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @Data 10 | @Builder 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | 14 | public class OrundumPerApResultVO { 15 | 16 | private String stageCode; 17 | 18 | private String zoneName; 19 | 20 | private Double orundumPerAp; 21 | 22 | private Double stageEfficiency; 23 | 24 | private Double lMDCost; 25 | 26 | private Double orundumPerApEfficiency; 27 | 28 | private String stageType; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/lhs/material/CustomItemDTOValueTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.material; 2 | 3 | import com.lhs.entity.dto.item.custom.ItemValueConfigDTO; 4 | import com.lhs.service.material.CustomItemService; 5 | import jakarta.annotation.Resource; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | 9 | @SpringBootTest 10 | public class CustomItemDTOValueTest { 11 | 12 | @Resource 13 | private CustomItemService customItemService; 14 | 15 | @Test 16 | void itemValueConfigTest(){ 17 | new ItemValueConfigDTO(); 18 | } 19 | 20 | @Test 21 | void customItemValueCalculation(){ 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | public class UserStatus { 4 | 5 | 6 | public static int addPermission(int status,int permission){ 7 | status = status|permission; 8 | return status; 9 | } 10 | 11 | public static int disablePermission(int status,int permission){ 12 | status = status&~permission; 13 | return status; 14 | } 15 | 16 | public static boolean hasPermission(int status,int permission) { 17 | return (status & permission) == permission; 18 | } 19 | 20 | public boolean NotHasPermission(int status,int permission){ 21 | return (status&permission)==0; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/PageViewStatistics.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.util.Date; 11 | 12 | 13 | @Data 14 | @AllArgsConstructor 15 | @NoArgsConstructor 16 | @TableName("page_view_statistics") 17 | public class PageViewStatistics { 18 | @TableId 19 | private String redisKey; 20 | private String pagePath; 21 | private String viewTime; 22 | private Integer pageView; 23 | private Date createTime; 24 | 25 | 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/main/resources/mapper/WarehouseInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | INSERT INTO warehouse_info 9 | (`id`,`uid`,`ak_uid`,`item_id`,`quantity`,`last_data_id`,`update_time`) 10 | VALUES 11 | 12 | (#{item.id},#{item.uid},#{item.akUid},#{item.itemId},#{item.quantity},#{item.lastDataId},#{item.updateTime}) 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageCalculationParametersDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | import lombok.Data; 4 | 5 | 6 | @Data 7 | public class StageCalculationParametersDTO { 8 | //关卡掉落期望产出综合 9 | private Double countStageDropApValue; 10 | //关卡系列 11 | private String itemSeries; 12 | //关卡系列id 13 | private String itemSeriesId; 14 | //副产物id 15 | private String secondaryItemId; 16 | //关卡效率 17 | private Double stageEfficiency; 18 | 19 | { 20 | countStageDropApValue = 0.0; 21 | itemSeries = "empty"; 22 | itemSeriesId = "empty"; 23 | secondaryItemId = "empty"; 24 | stageEfficiency = 0.0; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/lhs/material/ItemInfoDTOTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.material; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 4 | import com.lhs.entity.po.material.ItemInfo; 5 | import com.lhs.mapper.material.ItemInfoMapper; 6 | import com.lhs.mapper.material.ItemMapper; 7 | import jakarta.annotation.Resource; 8 | import org.junit.jupiter.api.Test; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | 11 | @SpringBootTest 12 | public class ItemInfoDTOTest { 13 | 14 | @Resource 15 | private ItemInfoMapper itemInfoMapper; 16 | @Resource 17 | private ItemMapper itemMapper; 18 | 19 | @Test 20 | void importItemInfo(){ 21 | 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/ItemCostDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | 4 | public class ItemCostDTO { 5 | private String id; 6 | private String name; 7 | private Integer count; 8 | 9 | public String getId() { 10 | return id; 11 | } 12 | 13 | public void setId(String id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getCount() { 26 | return count; 27 | } 28 | 29 | public void setCount(Integer count) { 30 | this.count = count; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/OperatorCarryRateStatisticsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.OperatorCarryRate; 5 | import com.lhs.entity.po.survey.OperatorCarryRateStatistics; 6 | 7 | import com.lhs.entity.tmp.QuestionnaireResultDTO; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | import java.util.List; 11 | 12 | public interface OperatorCarryRateStatisticsMapper extends BaseMapper { 13 | 14 | List getOldData(); 15 | 16 | Integer insertBatchOperatorCarryRate(@Param("list")List operatorCarryRateList); 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/OperatorProgressionDataMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.survey.OperatorProgressionData; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | public interface OperatorProgressionDataMapper extends BaseMapper { 11 | 12 | List getOperatorProgressionDataByDate(@Param("createTime") Date createTime, @Param("offset") Integer offset); 13 | 14 | List getOperatorProgressionData(@Param("offset") Integer offset,@Param("rowNum")Integer rowNum); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/material/StoreService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.material; 2 | 3 | 4 | import com.lhs.entity.vo.material.ActivityStoreDataVO; 5 | 6 | import java.util.*; 7 | 8 | public interface StoreService { 9 | 10 | 11 | 12 | 13 | /** 14 | * 获取活动商店性价比历史数据 15 | * 16 | * @return 活动商店性价比历史数据 17 | */ 18 | List getActivityStoreHistoryData(); 19 | 20 | /** 21 | * 根据活动名称更新活动商店 22 | * 23 | * @param activityStoreDataVo 新的活动商店数据 24 | * @return 更新状态消息 25 | */ 26 | String updateActivityStoreDataByActivityName(ActivityStoreDataVO activityStoreDataVo); 27 | 28 | 29 | List listActivityStoreData(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/maa/RecruitData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.maa; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | @Data 10 | @Builder 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class RecruitData { 14 | 15 | @TableId 16 | private Long id; 17 | private String uid; //企鹅物流id 18 | private String tag; //tag组合,是个集合 19 | private Integer level; //本次招募的最高星级 20 | private Long createTime; //创建时间 21 | private String server; //地区 一般为CN 22 | private String source; //来源 23 | private String version; //maa版本号 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/OperatorCarryRateStatisticsVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | 4 | import java.util.List; 5 | 6 | public class OperatorCarryRateStatisticsVO { 7 | private List list; 8 | 9 | private Integer sampleSize; 10 | 11 | 12 | 13 | 14 | 15 | public List getList() { 16 | return list; 17 | } 18 | 19 | public void setList(List list) { 20 | this.list = list; 21 | } 22 | 23 | 24 | public Integer getSampleSize() { 25 | return sampleSize; 26 | } 27 | 28 | public void setSampleSize(Integer sampleSize) { 29 | this.sampleSize = sampleSize; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/RogueSeedRatingDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | public class RogueSeedRatingDTO { 4 | private Long seedId; 5 | private Integer rating; 6 | private Long uid; 7 | 8 | public Long getSeedId() { 9 | return seedId; 10 | } 11 | 12 | public void setSeedId(Long seedId) { 13 | this.seedId = seedId; 14 | } 15 | 16 | public Integer getRating() { 17 | return rating; 18 | } 19 | 20 | public void setRating(Integer rating) { 21 | this.rating = rating; 22 | } 23 | 24 | public Long getUid() { 25 | return uid; 26 | } 27 | 28 | public void setUid(Long uid) { 29 | this.uid = uid; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/survey/OperatorCarryQuestionnaireDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.survey; 2 | 3 | import java.util.List; 4 | 5 | public class OperatorCarryQuestionnaireDTO { 6 | private Integer questionnaireCode; 7 | private List operatorList; 8 | 9 | 10 | 11 | public Integer getQuestionnaireCode() { 12 | return questionnaireCode; 13 | } 14 | 15 | public void setQuestionnaireCode(Integer code) { 16 | this.questionnaireCode = code; 17 | } 18 | 19 | public List getOperatorList() { 20 | return operatorList; 21 | } 22 | 23 | public void setOperatorList(List operatorList) { 24 | this.operatorList = operatorList; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/PathwayDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | 4 | public class PathwayDTO { 5 | private String itemId; 6 | private String itemName; 7 | private Integer count; 8 | 9 | public String getItemId() { 10 | return itemId; 11 | } 12 | 13 | public void setItemId(String itemId) { 14 | this.itemId = itemId; 15 | } 16 | 17 | public String getItemName() { 18 | return itemName; 19 | } 20 | 21 | public void setItemName(String itemName) { 22 | this.itemName = itemName; 23 | } 24 | 25 | public Integer getCount() { 26 | return count; 27 | } 28 | 29 | public void setCount(Integer count) { 30 | this.count = count; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/maa/Schedule.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.maa; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.fasterxml.jackson.annotation.JsonFormat; 6 | import lombok.Data; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import java.util.Date; 10 | 11 | @Data 12 | @TableName("schedule")//基建表 13 | public class Schedule { 14 | 15 | @TableId 16 | private Long uid; 17 | private String nickName; 18 | private String schedule; 19 | private Long scheduleId; 20 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 21 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 22 | private Date createTime; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/TencentCloudService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util; 2 | 3 | import com.qcloud.cos.COSClient; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.io.File; 7 | 8 | public interface TencentCloudService { 9 | 10 | void uploadCOS(File file, String bucketPath); 11 | 12 | void uploadCOS(String text, String bucketPath); 13 | 14 | void uploadCOS(MultipartFile multipartFile, String bucketPath); 15 | 16 | void backupCOS(String text, String bucketPath); 17 | 18 | void backupCOS(File file, String bucketPath); 19 | 20 | COSClient createCOSClient(); 21 | 22 | void frontEndDeployment(String projectPath,String regionStr,String bucketName); 23 | 24 | void CDNRefreshDirectory(String domain); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/custom/CustomItemDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item.custom; 2 | 3 | public class CustomItemDTO { 4 | private String itemId; 5 | private Double itemValue; 6 | 7 | public CustomItemDTO() { 8 | } 9 | 10 | public CustomItemDTO(String itemId, Double itemValue) { 11 | this.itemId = itemId; 12 | this.itemValue = itemValue; 13 | } 14 | 15 | public String getItemId() { 16 | return itemId; 17 | } 18 | 19 | public void setItemId(String itemId) { 20 | this.itemId = itemId; 21 | } 22 | 23 | public Double getItemValue() { 24 | return itemValue; 25 | } 26 | 27 | public void setItemValue(Double itemValue) { 28 | this.itemValue = itemValue; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/QuestionnaireType.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public enum QuestionnaireType { 4 | 5 | SELECTED_OPERATOR_FOR_NEW_GAME(1,"开荒队伍"), 6 | 7 | MAIN_AND_SIDE_STORY_FOR_NEW_GAME(101,"主线orSS编队"), 8 | INTEGRATED_STRATEGIES_FOR_NEW_GAME(102,"集成战略编队"), 9 | CONTINGENCY_CONTRACT_Mode_FOR_NEW_GAME(103,"危机合约编队"), 10 | RECLAMATION_ALGORITHM_FOR_NEW_GAME(104,"生息盐酸编队"); 11 | 12 | 13 | QuestionnaireType(Integer code, String type) { 14 | this.code = code; 15 | this.type = type; 16 | } 17 | 18 | private Integer code; 19 | private String type; 20 | 21 | public Integer code() { 22 | return code; 23 | } 24 | 25 | 26 | 27 | public String type() { 28 | return type; 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/annotation/RedisCacheable.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 自定义缓存注解 10 | *

11 | *

12 | * key:缓存key 13 | *

14 | * timeout:缓存时间,单位s 15 | *

16 | * paramOrMethod:此属性需要方法上有一个参数对象(且仅会调用第一个参数),同时有两种调用方式
17 | * ①填入param,会将第一个参数转为字符串拼接到key后,作为唯一标识
18 | * ②填入参数对象内部的方法名,调用参数内部对应方法,将返回的内容拼接到key后,作为唯一标识 19 | */ 20 | @Retention(RetentionPolicy.RUNTIME) 21 | @Target({ElementType.METHOD}) 22 | public @interface RedisCacheable { 23 | 24 | String key() default "test"; 25 | 26 | int timeout() default 3600; 27 | 28 | String paramOrMethod() default ""; 29 | } -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/enums/TimeGranularity.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.enums; 2 | 3 | public enum TimeGranularity { 4 | 5 | FROM_INCEPTION_TO_PRESENT(0, "自收集数据开始—至今"), 6 | YEAR(1, "年"), 7 | MONTH(2, "月"), 8 | WEEK(3, "周"), 9 | DAY(4, "天"), 10 | HOUR(5, "时"), 11 | MINUTE(6, "分"), 12 | SECOND(7, "秒"), 13 | 14 | THE_PAST_WEEK(31, "最近一周"), 15 | THE_PAST_TWO_WEEK(32, "最近两周"); 16 | 17 | private final int code; 18 | private final String description; 19 | 20 | TimeGranularity(int code, String description) { 21 | this.code = code; 22 | this.description = description; 23 | } 24 | 25 | public int code() { 26 | return code; 27 | } 28 | 29 | public String description() { 30 | return description; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/CustomItemDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | public class CustomItemDTO { 4 | 5 | private String itemId; 6 | 7 | private Double itemValue; 8 | 9 | public String getItemId() { 10 | return itemId; 11 | } 12 | 13 | public void setItemId(String itemId) { 14 | this.itemId = itemId; 15 | } 16 | 17 | public Double getItemValue() { 18 | return itemValue; 19 | } 20 | 21 | public void setItemValue(Double itemValue) { 22 | this.itemValue = itemValue; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "ItemCustomValue{" + 28 | "itemName='" + itemId + '\'' + 29 | ", itemValue='" + itemValue + '\'' + 30 | '}'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/StageResultDetail.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import lombok.Data; 7 | 8 | import java.util.Date; 9 | 10 | @Data 11 | @TableName("stage_result_detail") 12 | public class StageResultDetail { 13 | 14 | @TableId 15 | private Long id; 16 | private String stageId; 17 | private String itemName; 18 | private String itemId; 19 | private Double knockRating; 20 | private Double apExpect; 21 | private Double result; 22 | private Double ratio; 23 | private Integer ratioRank; 24 | private Integer sampleSize; 25 | private Double sampleConfidence; 26 | private Date endTime; 27 | private String version; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | /src/main/resources/application-dev.yml 35 | /src/main/resources/application-pro.yml 36 | /src/main/resources/penguin/ 37 | /src/main/resources/schedule/ 38 | /src/main/resources/backups/ 39 | /src/main/java/com/lhs/dev/ 40 | /src/test/java/com/test/ 41 | /src/test/java/com/lhs/local/ 42 | /src/test/java/com/lhs/home/ 43 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/OperatorCarryRateDailyDataVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | import java.util.List; 4 | 5 | public class OperatorCarryRateDailyDataVO { 6 | private String charId; 7 | 8 | private List list; 9 | 10 | private List date; 11 | 12 | public String getCharId() { 13 | return charId; 14 | } 15 | 16 | public void setCharId(String charId) { 17 | this.charId = charId; 18 | } 19 | 20 | public List getList() { 21 | return list; 22 | } 23 | 24 | public void setList(List list) { 25 | this.list = list; 26 | } 27 | 28 | public List getDate() { 29 | return date; 30 | } 31 | 32 | public void setDate(List date) { 33 | this.date = date; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # yituliuBackEnd 2 | 项目框架: 3 | ![](https://img.shields.io/badge/jdk-17-red) 4 | ![](https://img.shields.io/badge/SpringBoot-3.0.11-brightgreen) 5 | ![](https://img.shields.io/badge/Mysql-5.7.3-blue) 6 | ![](https://img.shields.io/badge/Redis-7.0.5-red) 7 | ![](https://img.shields.io/badge/MybatisPlus-3.5.3.1-blue) 8 | ![](https://img.shields.io/badge/Maven-3.6.3-red) 9 | 10 | 联系我们: 11 | [![](https://img.shields.io/badge/dynamic/json?color=FE7398&label=罗德岛基建Beta&prefix=%E7%B2%89%E4%B8%9D%E6%95%B0%3A&query=%24.data.totalSubs&url=https%3A%2F%2Fapi.spencerwoo.com%2Fsubstats%2F%3Fsource%3Dbilibili%26queryKey%3D688411531)](https://space.bilibili.com/688411531) 12 | 13 | ### 运行前准备:
14 | 15 | 数据库全部的表结构和保证项目运行的初始数据在docs/sql/下 (先导入仅表结构的sql,后导入有初始值的sql) 16 | 17 | 邮件和备用使用了阿里云的邮件推送和存储服务,需要自己在配置文件内填入阿里云子账号凭证 18 | 19 | MAA相关接口如需了解请进群938710832 20 | 21 | 因升级jdk17更换文档依赖,暂时先去掉了实体类注释 22 | -------------------------------------------------------------------------------- /docs/部分计算过程.md: -------------------------------------------------------------------------------- 1 | 假设技能书3为A,技能书2为B,技能书1为C,关卡扣除理智后AP为 30-30*0.0036*12 = 28.704 2 | 3 | 5级本掉落为 2A、1.5B、1.5C 4 | 2A+1.5B+1.5C = AP 5 | 6 | 加工站中 7 | 8 | 技能书2合成为技能书3 9 | 3*B = A+A*0.18 10 | 3*B = A*(1+0.18) 11 | B = A*(1+0.18)/3 12 | 13 | 技能书1合成为技能书2 14 | 3C = B+B*0.18 15 | 3C = B(1+0.18) 16 | C = B(1+0.18)/3 17 | C = A*(1+0.18)(1+0.18)/9 18 | 19 | AP = 2*A + 1.5*A*(1+0.18)/3 + 1.5*A*(1+0.18)(1+0.18)/9 20 | AP = A*(2+1.5*(1+0.18)/3+1.5*(1+0.18)(1+0.18)/9) 21 | A = AP/(2+1.5*(1+0.18)/3+1.5*(1+0.18)(1+0.18)/9) 22 | 23 | num1 = 1.18/3 24 | num2 = 1.18*1.18/9 25 | 26 | A+A*0.18=3B 27 | 28 | 29 | 30 | C = 1.18*1.18A/9 31 | C = num2A 32 | 33 | B = num1A 34 | 35 | 2A+1.5A*(num1+num2) = AP 36 | 2A+1.5A*(0.548) = AP 37 | 2A+0.822A = AP 38 | A = AP/2.822 39 | A = 10.171 40 | 41 | B = AP*1.18/2.822/3 42 | B = 4.000 43 | 44 | C = 1.18B/3 45 | 46 | C = AP*1.18*1.18/2.822/3/3 47 | C = 1.5736 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/UserInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | import com.lhs.common.annotation.Sensitive; 4 | import lombok.Data; 5 | 6 | import java.io.Serial; 7 | import java.io.Serializable; 8 | import java.util.Map; 9 | 10 | @Data 11 | public class UserInfoVO implements Serializable { 12 | 13 | @Serial 14 | private static final long serialVersionUID = 1L; 15 | 16 | private Long uid; 17 | private String userName; 18 | private String nickName; 19 | @Sensitive(prefixNoMaskLen = 4,suffixNoMaskLen = 6) 20 | private String email; 21 | private Integer status; 22 | private String token; 23 | private String avatar; 24 | private String akNickName; 25 | private String akUid; 26 | private Map config; 27 | private Boolean hasEmail = false; 28 | private Boolean hasPassword = false; 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/survey/OperatorDataService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.survey; 2 | 3 | import com.lhs.common.util.Result; 4 | import com.lhs.entity.dto.survey.OperatorProgressionDataDTO; 5 | import com.lhs.entity.dto.survey.PlayerInfoDTO; 6 | import jakarta.servlet.http.HttpServletRequest; 7 | 8 | import java.util.*; 9 | 10 | 11 | public interface OperatorDataService { 12 | 13 | 14 | /** 15 | * 重置个人上传的干员数据 16 | * @param token 一图流凭证 17 | * @return 成功消息 18 | */ 19 | Result operatorDataReset(String token); 20 | 21 | /** 22 | * 找回用户填写的数据 23 | * @return 成功消息 24 | */ 25 | List listOperatorProgressionData(String token); 26 | 27 | 28 | Object importSKLandPlayerInfoV3(HttpServletRequest httpServletRequest,PlayerInfoDTO playerInfoDTO); 29 | 30 | 31 | void backupOperatorProgressionData(); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/annotation/Sensitive.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.annotation; 2 | 3 | import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; 4 | import com.fasterxml.jackson.databind.annotation.JsonSerialize; 5 | import com.lhs.common.config.SensitiveSerialize; 6 | 7 | import java.lang.annotation.ElementType; 8 | import java.lang.annotation.Retention; 9 | import java.lang.annotation.RetentionPolicy; 10 | import java.lang.annotation.Target; 11 | 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.FIELD) 14 | @JacksonAnnotationsInside 15 | @JsonSerialize(using = SensitiveSerialize.class) 16 | public @interface Sensitive { 17 | 18 | /** 19 | * 前置不需要打码的长度 20 | */ 21 | int prefixNoMaskLen() default 2; 22 | /** 23 | * 后置不需要打码的长度 24 | */ 25 | int suffixNoMaskLen() default 2; 26 | /** 27 | * 用什么打码 28 | */ 29 | String symbol() default "*"; 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StageResultDetailMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | INSERT INTO stage_result_detail 8 | (`id`,`stage_id`,`item_name`,`item_id`,`knock_rating`,`ap_expect`,`result`,`ratio`,`ratio_rank`,`sample_size`,`sample_confidence`,`end_time`,`version`) 9 | VALUES 10 | 11 | (#{item.id},#{item.stageId},#{item.itemName},#{item.itemId},#{item.knockRating},#{item.apExpect},#{item.result},#{item.ratio},#{item.ratioRank},#{item.sampleSize},#{item.sampleConfidence},#{item.endTime},#{item.version}) 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/Item.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | 4 | 5 | import com.baomidou.mybatisplus.annotation.TableId; 6 | import com.baomidou.mybatisplus.annotation.TableName; 7 | 8 | import lombok.AllArgsConstructor; 9 | import lombok.Builder; 10 | import lombok.Data; 11 | import lombok.NoArgsConstructor; 12 | 13 | @Data 14 | @TableName("item") //用于存储最终的等效理智/绿票价值 15 | @NoArgsConstructor 16 | @AllArgsConstructor 17 | @Builder 18 | public class Item { 19 | 20 | @TableId 21 | private Long id; 22 | 23 | private String itemId; //物品id 24 | 25 | private String itemName; //物品名称 26 | 27 | private Double itemValueAp; //物品价值 单位:理智 28 | 29 | 30 | private Integer rarity; //物品稀有度 31 | 32 | 33 | private Integer cardNum; //前端排序的用索引 34 | 35 | 36 | private String version; //版本 37 | 38 | 39 | private Double weight; //加工站爆率 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/custom/WorkshopItemDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item.custom; 2 | 3 | public class WorkshopItemDTO { 4 | 5 | private String strategy; 6 | private Double byproductRateIncrease; 7 | 8 | public WorkshopItemDTO() { 9 | } 10 | 11 | public WorkshopItemDTO(String strategy, Double byproductRateIncrease) { 12 | this.strategy = strategy; 13 | this.byproductRateIncrease = byproductRateIncrease; 14 | } 15 | 16 | public String getStrategy() { 17 | return strategy; 18 | } 19 | 20 | public void setStrategy(String strategy) { 21 | this.strategy = strategy; 22 | } 23 | 24 | public Double getByproductRateIncrease() { 25 | return byproductRateIncrease; 26 | } 27 | 28 | public void setByproductRateIncrease(Double byproductRateIncrease) { 29 | this.byproductRateIncrease = byproductRateIncrease; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/lhs/utils/CosTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.utils; 2 | 3 | import com.lhs.service.survey.OperatorDataService; 4 | import com.lhs.service.survey.QuestionnaireService; 5 | import com.lhs.service.user.UserService; 6 | import jakarta.annotation.Resource; 7 | import org.junit.jupiter.api.Test; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | 10 | @SpringBootTest 11 | public class CosTest { 12 | 13 | @Resource 14 | private OperatorDataService operatorDataService; 15 | 16 | @Resource 17 | private QuestionnaireService questionnaireService; 18 | 19 | @Resource 20 | private UserService userService; 21 | 22 | @Test 23 | void backupTest() { 24 | // operatorDataService.backupOperatorProgressionData(); 25 | // questionnaireService.backup(); 26 | userService.backupUserInfo(); 27 | userService.backupUserExternalAccountBinding(); 28 | } 29 | 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StageResultMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | INSERT INTO stage_result 8 | (`id`,`stage_id`,`stage_code`,`item_series`,`item_series_id`,`secondary_item_id`,`stage_efficiency`,`le_t4_efficiency`,`le_t3_efficiency`,`le_t2_efficiency`,`end_time`,`spm`,`version`) 9 | VALUES 10 | 11 | (#{item.id},#{item.stageId},#{item.stageCode},#{item.itemSeries},#{item.itemSeriesId},#{item.secondaryItemId},#{item.stageEfficiency},#{item.leT4Efficiency},#{item.leT3Efficiency},#{item.leT2Efficiency},#{item.endTime},#{item.spm},#{item.version}) 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/QuantileTable.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | @TableName("quantile_table") //样本置信度参照表 7 | public class QuantileTable { 8 | @TableId 9 | 10 | private Double section; 11 | 12 | private Double value; 13 | 14 | public Double getSection() { 15 | return section; 16 | } 17 | 18 | public void setSection(Double section) { 19 | this.section = section; 20 | } 21 | 22 | public Double getValue() { 23 | return value; 24 | } 25 | 26 | public void setValue(Double value) { 27 | this.value = value; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "QuantileTable{" + 33 | "section=" + section + 34 | ", value=" + value + 35 | '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/SurveyOperatorData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import lombok.*; 6 | 7 | @Data 8 | @TableName("survey_operator_1") 9 | public class SurveyOperatorData { 10 | 11 | @TableId 12 | private Long id; 13 | 14 | private Long uid; 15 | 16 | private String akUid; 17 | 18 | private String charId; 19 | 20 | private Boolean own; 21 | 22 | private Integer level; 23 | 24 | private Integer elite; 25 | 26 | private Integer potential; 27 | 28 | private Integer rarity; 29 | 30 | private Integer mainSkill; 31 | 32 | private Integer skill1; 33 | 34 | private Integer skill2; 35 | 36 | private Integer skill3; 37 | 38 | private Integer modX; 39 | 40 | private Integer modY; 41 | 42 | private Integer modD; 43 | 44 | private Integer modA; 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/impl/LogServiceImp.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin.impl; 2 | 3 | import com.lhs.common.util.IdGenerator; 4 | import com.lhs.entity.po.admin.LogInfo; 5 | import com.lhs.mapper.admin.LogInfoMapper; 6 | import com.lhs.service.admin.LogService; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.Date; 10 | 11 | @Service 12 | public class LogServiceImp implements LogService { 13 | 14 | private final LogInfoMapper logInfoMapper; 15 | private final IdGenerator idGenerator; 16 | public LogServiceImp(LogInfoMapper logInfoMapper) { 17 | this.logInfoMapper = logInfoMapper; 18 | this.idGenerator = new IdGenerator(1L); 19 | } 20 | 21 | 22 | @Override 23 | public void saveLog(LogInfo loginfo) { 24 | idGenerator.nextId(); 25 | loginfo.setId(idGenerator.nextId()); 26 | loginfo.setCreateTime(new Date()); 27 | logInfoMapper.insert(loginfo); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/user/UserInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import lombok.AllArgsConstructor; 7 | import lombok.Builder; 8 | import lombok.Data; 9 | import lombok.NoArgsConstructor; 10 | 11 | import java.util.Date; 12 | 13 | @Data 14 | @Builder 15 | @AllArgsConstructor 16 | @NoArgsConstructor 17 | @TableName 18 | public class UserInfo { 19 | @TableId 20 | private Long id; 21 | private String userName; //用户名称 22 | @TableField(value = "pass_word") 23 | private String password; //密码 24 | private String email; //邮箱 25 | private Date createTime; //创建时间 26 | private Date updateTime; //最后一次上传数据时间 27 | private String ip; //ip地址 28 | private Integer status; //用户状态,1正常,0封禁 29 | private String avatar; //用户头像 30 | private Boolean deleteFlag; //删除标记 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/QueryStageDropDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | public class QueryStageDropDTO { 4 | private Integer timeGranularity; 5 | private String stageId; 6 | private Long start; 7 | private Long end; 8 | 9 | public Integer getTimeGranularity() { 10 | return timeGranularity; 11 | } 12 | 13 | public void setTimeGranularity(Integer timeGranularity) { 14 | this.timeGranularity = timeGranularity; 15 | } 16 | 17 | public String getStageId() { 18 | return stageId; 19 | } 20 | 21 | public void setStageId(String stageId) { 22 | this.stageId = stageId; 23 | } 24 | 25 | public Long getStart() { 26 | return start; 27 | } 28 | 29 | public void setStart(Long start) { 30 | this.start = start; 31 | } 32 | 33 | public Long getEnd() { 34 | return end; 35 | } 36 | 37 | public void setEnd(Long end) { 38 | this.end = end; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/OperatorUpdateTime.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class OperatorUpdateTime { 10 | 11 | @TableId 12 | private String name; 13 | private String obtainApproach; 14 | private Date updateTime; 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getObtainApproach() { 25 | return obtainApproach; 26 | } 27 | 28 | public void setObtainApproach(String obtainApproach) { 29 | this.obtainApproach = obtainApproach; 30 | } 31 | 32 | public Date getUpdateTime() { 33 | return updateTime; 34 | } 35 | 36 | public void setUpdateTime(Date updateTime) { 37 | this.updateTime = updateTime; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/mapper/OperatorCarryRateMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | INSERT INTO operator_carry_rate 10 | (id, char_id, carry_count,sample_size, create_time, questionnaire_code, start_time, end_time,record_type) 11 | VALUES 12 | 13 | (#{item.id},#{item.charId}, #{item.carryCount}, #{item.sampleSize}, #{item.createTime}, 14 | #{item.questionnaireCode},#{item.startTime}, #{item.endTime}, #{item.recordType}) 15 | 16 | 17 | 18 | 19 | DELETE FROM operator_carry_rate WHERE start_time >= #{startTime} AND end_time < #{endTime} 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/CompositeTableDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | import java.util.List; 4 | 5 | 6 | public class CompositeTableDTO { 7 | private String id; 8 | private String name; 9 | private Boolean resolve; 10 | private List pathway; 11 | 12 | public String getId() { 13 | return id; 14 | } 15 | 16 | public void setId(String id) { 17 | this.id = id; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public Boolean getResolve() { 29 | return resolve; 30 | } 31 | 32 | public void setResolve(Boolean resolve) { 33 | this.resolve = resolve; 34 | } 35 | 36 | public List getPathway() { 37 | return pathway; 38 | } 39 | 40 | public void setPathway(List pathway) { 41 | this.pathway = pathway; 42 | } 43 | } 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/survey/RecruitDataMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.survey; 2 | 3 | 4 | import com.lhs.entity.po.maa.RecruitData; 5 | import com.lhs.entity.po.maa.RecruitStatistics; 6 | 7 | import org.apache.ibatis.annotations.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface RecruitDataMapper { 14 | 15 | void insertRecruitData(@Param("tableName") String table, @Param("item") RecruitData recruitData); 16 | 17 | List selectRecruitDataByCreateTime(@Param("tableName") String table, @Param("startTime") Long startTime, @Param("endTime") Long endTime); 18 | 19 | void insertRecruitStatistics(@Param("statistics") RecruitStatistics statistics); 20 | 21 | void updateRecruitStatistics(@Param("statistics") RecruitStatistics statistics); 22 | 23 | RecruitStatistics selectRecruitStatisticsByItem(@Param("statisticalItem") String statisticalItem); 24 | 25 | List selectRecruitStatistics(); 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/DesensitizedUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | public class DesensitizedUtil { 4 | 5 | /** 6 | * 对字符串进行脱敏操作 7 | * @param origin 原始字符串 8 | * @param prefixNoMaskLen 左侧需要保留几位明文字段 9 | * @param suffixNoMaskLen 右侧需要保留几位明文字段 10 | * @param symbol 用于遮罩的字符串, 如'*' 11 | * @return 脱敏后结果 12 | */ 13 | public static String desValue(String origin, int prefixNoMaskLen, int suffixNoMaskLen, String symbol) { 14 | if (origin == null) { 15 | return null; 16 | } 17 | 18 | StringBuilder sb = new StringBuilder(); 19 | for (int i = 0, n = origin.length(); i < n; i++) { 20 | if (i < prefixNoMaskLen) { 21 | sb.append(origin.charAt(i)); 22 | continue; 23 | } 24 | if (i > (n - suffixNoMaskLen - 1)) { 25 | sb.append(origin.charAt(i)); 26 | continue; 27 | } 28 | sb.append(symbol); 29 | } 30 | return sb.toString(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/survey/OperatorCarryRateDailyDataRequestParamsDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.survey; 2 | 3 | public class OperatorCarryRateDailyDataRequestParamsDTO { 4 | private Integer questionnaireCode; 5 | 6 | private String charId; 7 | private Long start; 8 | private Long end; 9 | 10 | public Integer getQuestionnaireCode() { 11 | return questionnaireCode; 12 | } 13 | 14 | public void setQuestionnaireCode(Integer questionnaireCode) { 15 | this.questionnaireCode = questionnaireCode; 16 | } 17 | 18 | public String getCharId() { 19 | return charId; 20 | } 21 | 22 | public void setCharId(String charId) { 23 | this.charId = charId; 24 | } 25 | 26 | public Long getStart() { 27 | return start; 28 | } 29 | 30 | public void setStart(Long start) { 31 | this.start = start; 32 | } 33 | 34 | public Long getEnd() { 35 | return end; 36 | } 37 | 38 | public void setEnd(Long end) { 39 | this.end = end; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/OperatorProgressionData.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class OperatorProgressionData { 10 | 11 | @TableId 12 | private String akUid; 13 | private String operatorProgression; 14 | 15 | private Date createTime; 16 | 17 | public String getAkUid() { 18 | return akUid; 19 | } 20 | 21 | public void setAkUid(String akUid) { 22 | this.akUid = akUid; 23 | } 24 | 25 | public String getOperatorProgression() { 26 | return operatorProgression; 27 | } 28 | 29 | public void setOperatorProgression(String operatorProgression) { 30 | this.operatorProgression = operatorProgression; 31 | } 32 | 33 | public Date getCreateTime() { 34 | return createTime; 35 | } 36 | 37 | public void setCreateTime(Date createTime) { 38 | this.createTime = createTime; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/OperatorCarryRateVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | 4 | public class OperatorCarryRateVO { 5 | private String charId; 6 | private Integer carryCount = 0; 7 | private Integer sampleSize = 0; 8 | 9 | public String getCharId() { 10 | return charId; 11 | } 12 | 13 | public void setCharId(String charId) { 14 | this.charId = charId; 15 | } 16 | 17 | public Integer getSampleSize() { 18 | return sampleSize; 19 | } 20 | 21 | public void setSampleSize(Integer sampleSize) { 22 | this.sampleSize = sampleSize; 23 | } 24 | 25 | public Integer getCarryCount() { 26 | return carryCount; 27 | } 28 | 29 | public void setCarryCount(Integer carryCount) { 30 | this.carryCount = carryCount; 31 | } 32 | 33 | public void incrementSampleSize(Integer sampleSize){ 34 | this.sampleSize+=sampleSize; 35 | } 36 | 37 | public void incrementCarryCount(Integer carryCount){ 38 | this.carryCount+=carryCount; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /docs/材料推荐关的计算流程.md: -------------------------------------------------------------------------------- 1 | # 材料一图流关卡效率计算过程 2 | 3 | # 1.蓝材料的价值初始值为绿票商店的售价 4 | 注:初始值可随意写入,用绿票商店只是迭代次数较少,写入其他值最后也能迭代到最终结果 5 | # 2.获取企鹅物流的原始数据 6 | 7 | # 3.用加工站的合成表进行其他稀有度材料的价值推算 8 | 9 | 举例:
10 | 蓝土为5个绿土合成
11 | 绿土价值 = 蓝土价值 ÷ 5 - 龙门币消耗 + 加工站副产物期望价值
12 | 13 | 紫土为4个蓝土合成
14 | 紫土价值 = 蓝土价值 * 4 - 龙门币消耗 - 加工站副产物期望价值 15 | 16 | # 4.用步骤1、3得到的所有稀有度的材料价值和企鹅物流的原始数据进行关卡效率计算 17 | 18 | 计算过程: 19 | 20 | 记关卡 $j$ 掉落(不含首通奖励)的物品为集合 $M_j$,物品 $i \in M_j$,价值为 $V_i$;关卡 $j$ 消耗体力 $\text{AP}_ j$,掉落物品 $i$ 的概率为 $K_{i, j}$;龙门币的价值为 $L$。则关卡效率 $E_j$ 为 21 | 22 | $$ 23 | E_j = \frac{1}{\text{AP}_j} \sum_{i \in M_j} V_i K_{i, j} + 1.2 \times L 24 | $$ 25 | 26 | # 5.用步骤4得到的各个蓝材料的关卡最优效率对蓝材料的价值进行迭代 27 | 条件:定价本的关卡效率不能超过100%(1),即关卡的产出不能超出关卡的体力投入
28 | 举例:
29 | 从4步骤中计算的结果筛选出主产物为全新装置的所有主线关卡进行倒序排列
30 | 得到最高的主线关卡效率为1.27,全新装置此时价值为45。
31 | 关卡效率不能超过1。
32 | 修正后全新装置的新价值为 45 * (1 / 1.27) = 35.43 理智。
33 | 修正后的新价值作为下一次迭代计算的材料价值使用。 34 | 35 | # 6.再次用加工站的合成表进行其他稀有度材料的新价值推算 36 | 37 | # 7.迭代后的新材料价值根据加工站爆率进行合成时产出的副产品期望价值计算,保存后为下一轮计算中步骤2使用 38 | 39 | # 8.将迭代后的蓝材料价值重复步骤2、3、4、5、6、7,直到所有的蓝材料最优关卡的效率无限逼近1 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StageDropMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.lhs.entity.po.material.StageDrop; 6 | import com.lhs.entity.po.material.StageDropStatistics; 7 | import org.apache.ibatis.annotations.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.Date; 11 | import java.util.List; 12 | 13 | 14 | @Repository 15 | public interface StageDropMapper extends BaseMapper { 16 | 17 | Integer countByDate(@Param("start") Date start, @Param("end") Date end); 18 | 19 | List listStageDropByDate(@Param("start") Date start, @Param("end") Date end); 20 | 21 | Integer insertBatch(@Param("list") List stageDropList); 22 | 23 | Integer insertBatchByTable(@Param("table") String table,@Param("list") List stageDropList); 24 | 25 | List listOldStageDropByDate(@Param("tableName") String tableName, @Param("start") Date start, @Param("end") Date end); 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageDropTimesStatistics.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class StageDropTimesStatistics { 7 | private Integer times = 0; 8 | 9 | private Map timesMap = new HashMap<>(); 10 | private Map dropMap = new HashMap<>(); 11 | 12 | public Integer getTimes() { 13 | return times; 14 | } 15 | 16 | public void setTimes(Integer times) { 17 | this.times = times; 18 | } 19 | 20 | public Map getTimesMap() { 21 | return timesMap; 22 | } 23 | 24 | public void setTimesMap(Map timesMap) { 25 | this.timesMap = timesMap; 26 | } 27 | 28 | public Map getDropMap() { 29 | return dropMap; 30 | } 31 | 32 | public void setDropMap(Map dropMap) { 33 | this.dropMap = dropMap; 34 | } 35 | 36 | 37 | public void addTimes(Integer times){ 38 | this.times += times; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/ItemValueCorrectionTerm.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | public class ItemValueCorrectionTerm { 4 | private Double correctionTerm; 5 | private String stageCode; 6 | private String seriesId; 7 | private String seriesName; 8 | 9 | public Double getCorrectionTerm() { 10 | return correctionTerm; 11 | } 12 | 13 | public void setCorrectionTerm(Double correctionTerm) { 14 | this.correctionTerm = correctionTerm; 15 | } 16 | 17 | public String getStageCode() { 18 | return stageCode; 19 | } 20 | 21 | public void setStageCode(String stageCode) { 22 | this.stageCode = stageCode; 23 | } 24 | 25 | public String getSeriesId() { 26 | return seriesId; 27 | } 28 | 29 | public void setSeriesId(String seriesId) { 30 | this.seriesId = seriesId; 31 | } 32 | 33 | public String getSeriesName() { 34 | return seriesName; 35 | } 36 | 37 | public void setSeriesName(String seriesName) { 38 | this.seriesName = seriesName; 39 | } 40 | 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/ArknightsGameDataService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util; 2 | 3 | 4 | 5 | 6 | import com.lhs.entity.dto.hypergryph.GameDataFormatFilePath; 7 | 8 | public interface ArknightsGameDataService { 9 | 10 | 11 | void saveOperatorDataTag(String tag); 12 | String getOperatorDataTag(); 13 | 14 | void getOperatorInfoSimpleTable(GameDataFormatFilePath gameDataFormatFilePath); 15 | 16 | void getOperatorInfoSimpleTableByGameResource(GameDataFormatFilePath gameDataFormatFilePath); 17 | 18 | /** 19 | * 生成基建技能一览json 20 | */ 21 | void getBuildingTable(GameDataFormatFilePath gameDataFormatFilePath); 22 | 23 | void getBuildingTableByGameResource(GameDataFormatFilePath gameDataFormatFilePath); 24 | 25 | /** 26 | * 生成术语对应表json 27 | */ 28 | void getTermDescriptionTable(GameDataFormatFilePath gameDataFormatFilePath); 29 | 30 | /** 31 | * 生成生息演算食物/食材一览表json 32 | */ 33 | void getSandboxFoodsTable(GameDataFormatFilePath gameDataFormatFilePath); 34 | 35 | void getAvatar(GameDataFormatFilePath gameDataFormatFilePath); 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/config/OpenAPIConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.config; 2 | 3 | import io.swagger.v3.oas.models.ExternalDocumentation; 4 | import io.swagger.v3.oas.models.OpenAPI; 5 | import io.swagger.v3.oas.models.info.Info; 6 | import io.swagger.v3.oas.models.info.License; 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | @ConditionalOnProperty(prefix = "swagger2", value = {"enable"}, havingValue = "dev") 12 | @Configuration 13 | public class OpenAPIConfig { 14 | 15 | @Bean 16 | public OpenAPI springShopOpenAPI() { 17 | return new OpenAPI() 18 | .info(new Info().title("一图流API文档") 19 | .description("一图流开发用API文档") 20 | .version("v1") 21 | .license(new License() 22 | .name("Apache 2.0") 23 | .url("http://springdoc.org"))) 24 | .externalDocs(new ExternalDocumentation()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/material/ItemService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.material; 2 | 3 | import com.lhs.entity.po.material.ItemIterationValue; 4 | import com.lhs.entity.dto.item.StageConfigDTO; 5 | import com.lhs.entity.po.material.Item; 6 | import org.springframework.transaction.annotation.Transactional; 7 | import java.util.*; 8 | 9 | 10 | 11 | public interface ItemService { 12 | 13 | 14 | @Transactional 15 | List calculatedItemValue( StageConfigDTO stageConfigDTO); 16 | 17 | void saveItemIterationValue(List iterationValueList); 18 | 19 | void deleteItemIterationValue(String version); 20 | 21 | List getItemListCache(StageConfigDTO stageConfigDTO); 22 | 23 | List getCustomItemList(StageConfigDTO stageConfigDTO); 24 | 25 | Map getItemMapCache(StageConfigDTO stageConfigDTO); 26 | 27 | List getItemList(StageConfigDTO stageConfigDTO); 28 | 29 | List updateFixedItemValue(StageConfigDTO stageConfigDTO); 30 | 31 | 32 | List calculatedCustomItemValue(StageConfigDTO stageConfigDTO); 33 | 34 | Long checkItemValue(StageConfigDTO stageConfigDTO); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/DropDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import com.lhs.entity.po.material.StageResultDetail; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class DropDetailVO { 8 | private String itemName; 9 | private String itemId; 10 | private Double knockRating; 11 | private Double apExpect; 12 | private Double result; 13 | private Double ratio; 14 | private Integer ratioRank; 15 | private Integer sampleSize; 16 | private Double sampleConfidence; 17 | 18 | public void copyByStageResultDetail(StageResultDetail stageResultDetail){ 19 | this.itemName = stageResultDetail.getItemName(); 20 | this.itemId = stageResultDetail.getItemId(); 21 | this.knockRating = stageResultDetail.getKnockRating(); 22 | this.apExpect = stageResultDetail.getApExpect(); 23 | this.result = stageResultDetail.getResult(); 24 | this.ratio = stageResultDetail.getRatio(); 25 | this.ratioRank = stageResultDetail.getRatioRank(); 26 | this.sampleSize = stageResultDetail.getSampleSize(); 27 | this.sampleConfidence = stageResultDetail.getSampleConfidence(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/util/impl/DataCacheServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.util.impl; 2 | 3 | import com.fasterxml.jackson.core.type.TypeReference; 4 | import com.lhs.common.util.JsonMapper; 5 | import com.lhs.service.util.DataCacheService; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | 12 | @Service 13 | public class DataCacheServiceImpl implements DataCacheService { 14 | 15 | private final RedisTemplate redisTemplate; 16 | 17 | public DataCacheServiceImpl(RedisTemplate redisTemplate) { 18 | this.redisTemplate = redisTemplate; 19 | } 20 | 21 | public static final Map KeyPrefixMap = new HashMap<>(); 22 | 23 | static { 24 | KeyPrefixMap.put("RecommendedStage","RecommendedStage"); 25 | } 26 | 27 | 28 | 29 | 30 | @Override 31 | public Map getCacheData(String key) { 32 | Object o = redisTemplate.opsForValue().get(key); 33 | return JsonMapper.parseObject(String.valueOf(o), new TypeReference<>() { 34 | }); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/user/AkPlayerBindInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.user; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.lhs.entity.dto.user.AkPlayerBindInfoDTO; 6 | import lombok.Data; 7 | 8 | @TableName 9 | @Data 10 | public class AkPlayerBindInfo { 11 | @TableId 12 | private Long id; 13 | //方舟uid 14 | private String akUid; 15 | //方舟昵称 16 | private String akNickName; 17 | //频道名称 18 | private String channelName; 19 | //频道id 20 | private Integer channelMasterId; 21 | 22 | private Long warehouseInfoId; 23 | //删除标记 24 | private Boolean deleteFlag; 25 | // 26 | private Long updateTime; 27 | 28 | public void copyByAkPlayerBindInfoDTO(AkPlayerBindInfoDTO akPlayerBindInfoDTO){ 29 | this.akUid = akPlayerBindInfoDTO.getAkUid(); 30 | this.akNickName = akPlayerBindInfoDTO.getAkNickName(); 31 | this.channelName = akPlayerBindInfoDTO.getChannelName(); 32 | this.channelMasterId = akPlayerBindInfoDTO.getChannelMasterId(); 33 | this.warehouseInfoId = akPlayerBindInfoDTO.getWarehouseInfoId(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/exception/GlobalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.exception; 2 | 3 | 4 | import com.lhs.common.util.LogUtils; 5 | import com.lhs.common.util.Result; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | import org.springframework.web.bind.annotation.ResponseBody; 8 | import org.springframework.web.bind.annotation.RestControllerAdvice; 9 | 10 | 11 | /** 12 | * 全局异常处理 13 | */ 14 | 15 | @RestControllerAdvice 16 | public class GlobalExceptionHandler { 17 | 18 | 19 | 20 | @ResponseBody 21 | @ExceptionHandler(Exception.class) 22 | public Object handleException(Exception e) { 23 | Result result = null; 24 | if(e instanceof ServiceException) { 25 | result = Result.failure(((ServiceException) e).getResultCode()); 26 | } 27 | else { 28 | String message = e.getMessage(); 29 | e.printStackTrace(); 30 | if(message.contains("database")){ 31 | int index = message.indexOf("###"); 32 | if(index>-1){ 33 | int endIndex = message.indexOf("###", index + 3); 34 | if(endIndex>-1){ 35 | message = message.substring(0,endIndex); 36 | } 37 | } 38 | 39 | } 40 | result = Result.failure(500, message); 41 | } 42 | return result; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/TimeUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.ZonedDateTime; 5 | import java.time.format.DateTimeFormatter; 6 | import java.util.Date; 7 | 8 | public class TimeUtil { 9 | 10 | /** 11 | * 获取当前小时的整点,例如当前时间为16时多一点,获取16:00:00 12 | */ 13 | public static Date getCurrentHourTime() { 14 | ZonedDateTime startOfHour = ZonedDateTime.now() 15 | .withMinute(0) 16 | .withSecond(0) 17 | .withNano(0); 18 | return Date.from(startOfHour.toInstant()); 19 | } 20 | 21 | /** 22 | * 获取当天的整点 23 | * 例如当前为2024-04-15 09:13:20 返回2024-04-15 00:00:00 24 | */ 25 | public static Date getCurrentDayTime() { 26 | ZonedDateTime startOfHour = ZonedDateTime.now() 27 | .withHour(0) 28 | .withMinute(0) 29 | .withSecond(0) 30 | .withNano(0); 31 | return Date.from(startOfHour.toInstant()); 32 | } 33 | 34 | 35 | public static String getDayText(){ 36 | LocalDate date = LocalDate.now(); 37 | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); 38 | return date.format(formatter); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/StageResult.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.Data; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.util.Date; 11 | 12 | @Data 13 | @TableName("stage_result") 14 | public class StageResult { 15 | @TableId 16 | private Long id; 17 | private String stageId; 18 | private String stageCode; 19 | private String itemSeries; 20 | private String itemSeriesId; 21 | private String secondaryItemId; 22 | private Double stageEfficiency; 23 | @TableField(value = "le_t4_efficiency") 24 | private Double leT4Efficiency; 25 | @TableField(value = "le_t3_efficiency") 26 | private Double leT3Efficiency; 27 | @TableField(value = "le_t2_efficiency") 28 | private Double leT2Efficiency; 29 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 30 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 31 | private Date endTime; 32 | private Double spm; 33 | private String version; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/CompositeTableDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | 4 | 5 | import java.util.List; 6 | 7 | 8 | public class CompositeTableDTO { 9 | private String itemId; 10 | private String itemName; 11 | private Integer rarity; 12 | private Boolean resolve; 13 | private List pathway; 14 | 15 | public String getItemId() { 16 | return itemId; 17 | } 18 | 19 | public void setItemId(String itemId) { 20 | this.itemId = itemId; 21 | } 22 | 23 | public String getItemName() { 24 | return itemName; 25 | } 26 | 27 | public void setItemName(String itemName) { 28 | this.itemName = itemName; 29 | } 30 | 31 | public Integer getRarity() { 32 | return rarity; 33 | } 34 | 35 | public void setRarity(Integer rarity) { 36 | this.rarity = rarity; 37 | } 38 | 39 | public Boolean getResolve() { 40 | return resolve; 41 | } 42 | 43 | public void setResolve(Boolean resolve) { 44 | this.resolve = resolve; 45 | } 46 | 47 | public List getPathway() { 48 | return pathway; 49 | } 50 | 51 | public void setPathway(List pathway) { 52 | this.pathway = pathway; 53 | } 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/main/resources/data/recruitment_table.json: -------------------------------------------------------------------------------- 1 | { 2 | "operatorRecruitmentRates": { 3 | "3": 0.7882, 4 | "4": 0.2027, 5 | "5": 0.0069, 6 | "6": 0.0022 7 | }, 8 | "recruitmentPermitPricing": { 9 | "recruitmentPermitPricing_3_4": { 10 | "3": { 11 | "4005": 10, 12 | "4004": 0 13 | }, 14 | "4": { 15 | "4005": 30, 16 | "4004": 1 17 | }, 18 | "5": { 19 | "4005": 0, 20 | "4004": 5 21 | }, 22 | "6": { 23 | "4005": 0, 24 | "4004": 10 25 | } 26 | }, 27 | "recruitmentPermitPricing_3_4_5": { 28 | "3": { 29 | "4005": 10, 30 | "4004": 0 31 | }, 32 | "4": { 33 | "4005": 30, 34 | "4004": 1 35 | }, 36 | "5": { 37 | "4005": 0, 38 | "4004": 13 39 | }, 40 | "6": { 41 | "4005": 0, 42 | "4004": 10 43 | } 44 | }, 45 | "recruitmentPermitPricing_3_4_5_6": { 46 | "3": { 47 | "4005": 10, 48 | "4004": 0 49 | }, 50 | "4": { 51 | "4005": 30, 52 | "4004": 1 53 | }, 54 | "5": { 55 | "4005": 0, 56 | "4004": 13 57 | }, 58 | "6": { 59 | "4005": 0, 60 | "4004": 25 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/test/java/com/lhs/service/GameDataServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service; 2 | 3 | import com.lhs.service.util.impl.ArknightsGameDataServiceImpl; 4 | import org.junit.jupiter.api.Test; 5 | import org.junit.jupiter.api.extension.ExtendWith; 6 | import org.mockito.InjectMocks; 7 | import org.mockito.junit.jupiter.MockitoExtension; 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | /** 12 | * 一般用于术语生成 13 | * 使用Mock避免启动整个Spring容器 14 | */ 15 | @ExtendWith(MockitoExtension.class) 16 | public class GameDataServiceTest { 17 | 18 | private static final Logger logger = LoggerFactory.getLogger(GameDataServiceTest.class); 19 | 20 | @InjectMocks 21 | private ArknightsGameDataServiceImpl arknightsGameDataService; 22 | 23 | /** 24 | * 术语生成 25 | */ 26 | @Test 27 | void testGetTermDescriptionTable() { 28 | try { 29 | // 使用测试路径,无需传入任何路径 30 | arknightsGameDataService.getTermDescriptionTable(null); 31 | logger.info("Term description table generated successfully"); 32 | } catch (Exception e) { 33 | System.err.println("Test failed with error: " + e.getMessage()); 34 | logger.error("Test failed while generating term description table", e); 35 | throw e; 36 | } 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/survey/OperatorProgressionStatisticalResultVOV2.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.survey; 2 | 3 | import com.lhs.entity.dto.survey.OperatorProgressionStatisticalResultDTO; 4 | 5 | import java.util.List; 6 | 7 | public class OperatorProgressionStatisticalResultVOV2 { 8 | 9 | private Integer sampleSize; 10 | private List result; 11 | private Integer recordType; 12 | private Long createTime; 13 | 14 | public Integer getSampleSize() { 15 | return sampleSize; 16 | } 17 | 18 | public void setSampleSize(Integer sampleSize) { 19 | this.sampleSize = sampleSize; 20 | } 21 | 22 | public List getResult() { 23 | return result; 24 | } 25 | 26 | public void setResult(List result) { 27 | this.result = result; 28 | } 29 | 30 | public Integer getRecordType() { 31 | return recordType; 32 | } 33 | 34 | public void setRecordType(Integer recordType) { 35 | this.recordType = recordType; 36 | } 37 | 38 | public Long getCreateTime() { 39 | return createTime; 40 | } 41 | 42 | public void setCreateTime(Long createTime) { 43 | this.createTime = createTime; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/util/SpriteInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.util; 2 | 3 | public class SpriteInfo { 4 | private String inputDir; 5 | private String outputDir; 6 | private String spriteFilename; 7 | private String cssFilename; 8 | private String cosFileType; 9 | 10 | 11 | public String getInputDir() { 12 | return inputDir; 13 | } 14 | 15 | public void setInputDir(String inputDir) { 16 | this.inputDir = inputDir; 17 | } 18 | 19 | public String getOutputDir() { 20 | return outputDir; 21 | } 22 | 23 | public void setOutputDir(String outputDir) { 24 | this.outputDir = outputDir; 25 | } 26 | 27 | public String getSpriteFilename() { 28 | return spriteFilename; 29 | } 30 | 31 | public void setSpriteFilename(String spriteFilename) { 32 | this.spriteFilename = spriteFilename; 33 | } 34 | 35 | public String getCssFilename() { 36 | return cssFilename; 37 | } 38 | 39 | public void setCssFilename(String cssFilename) { 40 | this.cssFilename = cssFilename; 41 | } 42 | 43 | public String getCosFileType() { 44 | return cosFileType; 45 | } 46 | 47 | public void setCosFileType(String cosFileType) { 48 | this.cosFileType = cosFileType; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.config; 2 | 3 | import org.springframework.cache.annotation.EnableCaching; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; 7 | import org.springframework.data.redis.core.RedisTemplate; 8 | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; 9 | import org.springframework.data.redis.serializer.StringRedisSerializer; 10 | 11 | @Configuration 12 | @EnableCaching 13 | public class RedisConfig { 14 | 15 | @Bean 16 | public RedisTemplate redisTemplate(LettuceConnectionFactory lettuceConnectionFactory){ 17 | RedisTemplate redisTemplate = new RedisTemplate<>(); 18 | redisTemplate.setConnectionFactory(lettuceConnectionFactory); 19 | 20 | redisTemplate.setKeySerializer(new StringRedisSerializer()); 21 | redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer()); 22 | 23 | redisTemplate.setHashKeySerializer(new StringRedisSerializer()); 24 | redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer()); 25 | 26 | redisTemplate.afterPropertiesSet(); 27 | 28 | return redisTemplate; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /docs/材料推荐关相关代码.md: -------------------------------------------------------------------------------- 1 | ### 计算流程 2 | src/main/java/com/lhs/service/item/ItemService.java 3 | src/main/java/com/lhs/service/item/StageCalService.java 4 | src/main/java/com/lhs/service/item/StageResultService.java 5 | 6 | 计算会调用以上三个服务类中的方法 7 | 8 | 首先StageResultService类的 **_updateStageResultByTaskConfig()_** 会读取一些计算参数 9 | 根据计算参数计算不同的关卡效率结果 10 | 11 | 参考下面的 **_设置计算参数_** 12 | 13 | 此外在src/main/java/com/lhs/task/ItemTask.java有一个定时任务 **_updateStageResult()_** 用来定时调用 **_updateStageResultByTaskConfig()_** 14 | 15 | 然后根据每套参数调用updateStageResult方法,此方法会调用ItemService类和StageCalService类中的计算方法进行计算 16 | 具体计算过程参考《材料推荐关的计算流程》 17 | 18 | 具体内容看对应类文件 19 | 20 | ### 设置计算参数: 21 | 参数包括经验书系数,样本量,类型等,每次运行计算方法的参数对应一种版本号,版本号为 版本-经验书系数-关卡样本量 22 | 每套不同参数计算后的关卡效率结果和材料价值表根据版本号区分 23 | ```java 24 | public class StageParamDTO { 25 | private String version = "v2"; //API版本 26 | private Double expCoefficient = 0.625; //经验书的系数,经验书价值=龙门币(0.0036)*系数 27 | private Integer sampleSize = 300; //样本量 28 | private Double lmdCoefficient = 1.0; //龙门币系数 龙门币价值 = 根据钱本计算的龙门币价值(0.0036) * 龙门币系数 未实现 29 | private Boolean calculateActivityStage = false; //是否计算活动关卡 未实现 30 | private List itemBlacklist; //材料黑名单,计算中不使用这些材料 未实现 31 | private List stageBlacklist; //关卡黑名单,计算中不使用这些关卡 未实现 32 | 33 | // 返回本次计算的版本号 34 | public String getVersion(){ 35 | return version+"-"+ expCoefficient+"-"+sampleSize; 36 | } 37 | } 38 | ``` 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/mapper/material/StageDropStatisticsMapper.java: -------------------------------------------------------------------------------- 1 | package com.lhs.mapper.material; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.lhs.entity.po.material.StageDropStatisticalTaskLog; 5 | import com.lhs.entity.po.material.StageDropStatistics; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.Date; 9 | import java.util.List; 10 | 11 | public interface StageDropStatisticsMapper extends BaseMapper { 12 | 13 | Integer insertTaskLog(@Param("log")StageDropStatisticalTaskLog stageDropStatisticalTaskLog); 14 | 15 | Integer updateTaskLog(@Param("log")StageDropStatisticalTaskLog stageDropStatisticalTaskLog); 16 | 17 | StageDropStatisticalTaskLog getTaskLog(@Param("timeGranularity") Integer timeGranularity, 18 | @Param("start") Date start, @Param("end") Date end); 19 | 20 | Integer insertBatch(@Param("list") List stageDropList); 21 | 22 | List listByDate(@Param("timeGranularity") Integer timeGranularity, 23 | @Param("start") Date start, @Param("end") Date end); 24 | 25 | 26 | List listByStageId(@Param("stageId") String stageId, @Param("timeGranularity") Integer timeGranularity, 27 | @Param("start") Date start, @Param("end") Date end); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/controller/ResourceController.java: -------------------------------------------------------------------------------- 1 | package com.lhs.controller; 2 | 3 | import com.lhs.common.util.Result; 4 | import com.lhs.entity.po.material.Stage; 5 | import com.lhs.service.util.ArknightsGameDataService; 6 | import io.swagger.v3.oas.annotations.Operation; 7 | import io.swagger.v3.oas.annotations.tags.Tag; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | @RestController 16 | @Tag(name = "资源API") 17 | public class ResourceController { 18 | 19 | private final ArknightsGameDataService arknightsGameDataService; 20 | 21 | public ResourceController(ArknightsGameDataService arknightsGameDataService) { 22 | this.arknightsGameDataService = arknightsGameDataService; 23 | } 24 | 25 | @Operation(summary = "检查干员数据tag,让前端判断是否需要更新") 26 | @GetMapping("/check/operator-data") 27 | public Result checkOperatorData() { 28 | String operatorDataTag = arknightsGameDataService.getOperatorDataTag(); 29 | return Result.success(operatorDataTag); 30 | } 31 | 32 | @Operation(summary = "保存干员数据的tag") 33 | @GetMapping("/upload/operator-data") 34 | public Result updateStageResult(@RequestParam("tag") String tag) { 35 | arknightsGameDataService.saveOperatorDataTag(tag); 36 | return Result.success(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StageDropStatisticsVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | 5 | import java.util.Date; 6 | 7 | @TableName 8 | public class StageDropStatisticsVO { 9 | 10 | 11 | private String stageId; 12 | private String itemId; 13 | private Integer times; 14 | private Integer quantity; 15 | private Long start; 16 | private Long end; 17 | 18 | 19 | 20 | public String getStageId() { 21 | return stageId; 22 | } 23 | 24 | public void setStageId(String stageId) { 25 | this.stageId = stageId; 26 | } 27 | 28 | public String getItemId() { 29 | return itemId; 30 | } 31 | 32 | public void setItemId(String itemId) { 33 | this.itemId = itemId; 34 | } 35 | 36 | public Integer getTimes() { 37 | return times; 38 | } 39 | 40 | public void setTimes(Integer times) { 41 | this.times = times; 42 | } 43 | 44 | public Integer getQuantity() { 45 | return quantity; 46 | } 47 | 48 | public void setQuantity(Integer quantity) { 49 | this.quantity = quantity; 50 | } 51 | 52 | public Long getStart() { 53 | return start; 54 | } 55 | 56 | public void setStart(Long start) { 57 | this.start = start; 58 | } 59 | 60 | public Long getEnd() { 61 | return end; 62 | } 63 | 64 | public void setEnd(Long end) { 65 | this.end = end; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/OperatorProgressionStatisticalResult.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class OperatorProgressionStatisticalResult { 10 | 11 | 12 | @TableId 13 | private Long id; 14 | private Integer sampleSize; 15 | private String statisticalResult; 16 | private Integer recordType; 17 | private Date createTime; 18 | 19 | public Long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(Long id) { 24 | this.id = id; 25 | } 26 | 27 | public Integer getSampleSize() { 28 | return sampleSize; 29 | } 30 | 31 | public void setSampleSize(Integer sampleSize) { 32 | this.sampleSize = sampleSize; 33 | } 34 | 35 | public String getStatisticalResult() { 36 | return statisticalResult; 37 | } 38 | 39 | public void setStatisticalResult(String statisticalResult) { 40 | this.statisticalResult = statisticalResult; 41 | } 42 | 43 | public Integer getRecordType() { 44 | return recordType; 45 | } 46 | 47 | public void setRecordType(Integer recordType) { 48 | this.recordType = recordType; 49 | } 50 | 51 | public Date getCreateTime() { 52 | return createTime; 53 | } 54 | 55 | public void setCreateTime(Date createTime) { 56 | this.createTime = createTime; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/rogue/UserActionOnSeed.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.rogue; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class UserActionOnSeed { 10 | @TableId 11 | private Long id; 12 | private Long seedId; 13 | private Long uid; 14 | private String action; 15 | private Date createTime; 16 | private Boolean deleteFlag; 17 | 18 | public Long getId() { 19 | return id; 20 | } 21 | 22 | public void setId(Long id) { 23 | this.id = id; 24 | } 25 | 26 | public Long getSeedId() { 27 | return seedId; 28 | } 29 | 30 | public void setSeedId(Long seedId) { 31 | this.seedId = seedId; 32 | } 33 | 34 | public Long getUid() { 35 | return uid; 36 | } 37 | 38 | public void setUid(Long uid) { 39 | this.uid = uid; 40 | } 41 | 42 | public String getAction() { 43 | return action; 44 | } 45 | 46 | public void setAction(String action) { 47 | this.action = action; 48 | } 49 | 50 | public Date getCreateTime() { 51 | return createTime; 52 | } 53 | 54 | public void setCreateTime(Date createTime) { 55 | this.createTime = createTime; 56 | } 57 | 58 | public Boolean getDeleteFlag() { 59 | return deleteFlag; 60 | } 61 | 62 | public void setDeleteFlag(Boolean deleteFlag) { 63 | this.deleteFlag = deleteFlag; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/IpUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | 4 | 5 | import com.baomidou.mybatisplus.core.toolkit.ArrayUtils; 6 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; 7 | 8 | import jakarta.servlet.http.HttpServletRequest; 9 | 10 | import java.util.Random; 11 | 12 | public class IpUtil { 13 | public static String getIpAddress(HttpServletRequest request) { 14 | String ip = request.getHeader("x-forwarded-for"); 15 | if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) { 16 | ip = request.getHeader("Proxy-Client-IP"); 17 | } 18 | if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) { 19 | ip = request.getHeader("WL-Proxy-Client-IP"); 20 | } 21 | if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) { 22 | ip = request.getHeader("HTTP_CLIENT_IP"); 23 | } 24 | if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) { 25 | ip = request.getHeader("HTTP_X_FORWARDED_FOR"); 26 | } 27 | if (ip == null || ip.isEmpty() || "unknown".equalsIgnoreCase(ip)) { 28 | ip = request.getRemoteAddr(); 29 | } 30 | 31 | // 获取到多个ip时取第一个作为客户端真实ip 32 | if (StringUtils.isNotEmpty(ip) && ip.contains(",")) { 33 | String[] ipArray = ip.split(","); 34 | if (ArrayUtils.isNotEmpty(ipArray)) { 35 | ip = ipArray[0]; 36 | } 37 | } 38 | 39 | 40 | 41 | return ip; 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/custom/ChipPreferenceDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item.custom; 2 | 3 | public class ChipPreferenceDTO { 4 | private String TANK_MEDIC; 5 | private String SNIPER_CASTER; 6 | private String PIONEER_SUPPORT; 7 | private String WARRIOR_SPECIAL; 8 | 9 | public ChipPreferenceDTO() { 10 | } 11 | 12 | public ChipPreferenceDTO(String TANK_MEDIC, String SNIPER_CASTER, String PIONEER_SUPPORT, String WARRIOR_SPECIAL) { 13 | this.TANK_MEDIC = TANK_MEDIC; 14 | this.SNIPER_CASTER = SNIPER_CASTER; 15 | this.PIONEER_SUPPORT = PIONEER_SUPPORT; 16 | this.WARRIOR_SPECIAL = WARRIOR_SPECIAL; 17 | } 18 | 19 | public String getTANK_MEDIC() { 20 | return TANK_MEDIC; 21 | } 22 | 23 | public void setTANK_MEDIC(String TANK_MEDIC) { 24 | this.TANK_MEDIC = TANK_MEDIC; 25 | } 26 | 27 | public String getSNIPER_CASTER() { 28 | return SNIPER_CASTER; 29 | } 30 | 31 | public void setSNIPER_CASTER(String SNIPER_CASTER) { 32 | this.SNIPER_CASTER = SNIPER_CASTER; 33 | } 34 | 35 | public String getPIONEER_SUPPORT() { 36 | return PIONEER_SUPPORT; 37 | } 38 | 39 | public void setPIONEER_SUPPORT(String PIONEER_SUPPORT) { 40 | this.PIONEER_SUPPORT = PIONEER_SUPPORT; 41 | } 42 | 43 | public String getWARRIOR_SPECIAL() { 44 | return WARRIOR_SPECIAL; 45 | } 46 | 47 | public void setWARRIOR_SPECIAL(String WARRIOR_SPECIAL) { 48 | this.WARRIOR_SPECIAL = WARRIOR_SPECIAL; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/IdGenerator.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import com.lhs.common.enums.ResultCode; 4 | import com.lhs.common.exception.ServiceException; 5 | 6 | public class IdGenerator { 7 | 8 | private Long workerId; 9 | private static final Long START_TIMESTAMP = 1556676000000L; 10 | private long lastTimestamp = -1L; 11 | 12 | private long sequence = 0L; 13 | 14 | public IdGenerator(Long workerId) { 15 | this.workerId = workerId; 16 | } 17 | 18 | public synchronized Long nextId(){ 19 | 20 | // System.out.println("上次的时间戳是:"+lastTimestamp); 21 | 22 | long timestamp = timeGen(); 23 | if(timestamp < lastTimestamp){ 24 | throw new ServiceException(ResultCode.SYSTEM_TIME_ERROR); 25 | } 26 | 27 | if(timestamp == lastTimestamp){ 28 | sequence++; 29 | if(sequence>999){ 30 | timestamp = tilNextMillis(lastTimestamp); 31 | sequence = 0L; 32 | } 33 | }else { 34 | sequence = 0L; 35 | } 36 | 37 | lastTimestamp = timestamp; 38 | 39 | return ((timestamp-START_TIMESTAMP)*10+workerId)*1000+sequence; 40 | } 41 | 42 | 43 | 44 | protected long tilNextMillis(long lastTimestamp) { 45 | long timestamp = timeGen(); 46 | while (timestamp <= lastTimestamp) { 47 | timestamp = timeGen(); 48 | } 49 | return timestamp; 50 | } 51 | 52 | protected long timeGen() { 53 | return System.currentTimeMillis(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StageResultDetailVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import com.lhs.entity.po.material.StageResult; 4 | import lombok.Data; 5 | 6 | import java.util.List; 7 | 8 | @Data 9 | public class StageResultDetailVO { 10 | private String stageId; 11 | private String stageCode; 12 | private String stageType; 13 | private Double spm; 14 | private String mainItemId; 15 | private String itemSeries; 16 | private String itemSeriesId; 17 | private String secondaryItemId; 18 | private Double leT4Efficiency; 19 | private Double leT3Efficiency; 20 | private Double leT2Efficiency; 21 | private Double stageEfficiency; 22 | private Long endTime; 23 | private Integer zoneName; 24 | private List dropDetailList; 25 | 26 | public void copyByStageResultCommon(StageResult stageResult){ 27 | this.stageId = stageResult.getStageId(); 28 | this.stageCode = stageResult.getStageCode(); 29 | this.spm = stageResult.getSpm(); 30 | this.itemSeriesId = stageResult.getItemSeriesId(); 31 | this.secondaryItemId = stageResult.getSecondaryItemId(); 32 | this.leT4Efficiency = stageResult.getLeT4Efficiency(); 33 | this.leT3Efficiency = stageResult.getLeT3Efficiency(); 34 | this.leT2Efficiency = stageResult.getLeT2Efficiency(); 35 | this.stageEfficiency = stageResult.getStageEfficiency(); 36 | this.itemSeries = stageResult.getItemSeries(); 37 | this.endTime = stageResult.getEndTime().getTime(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/tmp/QuestionnaireResultDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.tmp; 2 | 3 | 4 | import java.util.Date; 5 | 6 | public class QuestionnaireResultDTO { 7 | private Long id; 8 | private Long uid; 9 | private Integer type; 10 | private String content; 11 | private Date createTime; 12 | private Date updateTime; 13 | private String ip; 14 | 15 | public Long getId() { 16 | return id; 17 | } 18 | 19 | public void setId(Long id) { 20 | this.id = id; 21 | } 22 | 23 | public Long getUid() { 24 | return uid; 25 | } 26 | 27 | public void setUid(Long uid) { 28 | this.uid = uid; 29 | } 30 | 31 | public Integer getType() { 32 | return type; 33 | } 34 | 35 | public void setType(Integer type) { 36 | this.type = type; 37 | } 38 | 39 | public String getContent() { 40 | return content; 41 | } 42 | 43 | public void setContent(String content) { 44 | this.content = content; 45 | } 46 | 47 | public Date getCreateTime() { 48 | return createTime; 49 | } 50 | 51 | public void setCreateTime(Date createTime) { 52 | this.createTime = createTime; 53 | } 54 | 55 | public Date getUpdateTime() { 56 | return updateTime; 57 | } 58 | 59 | public void setUpdateTime(Date updateTime) { 60 | this.updateTime = updateTime; 61 | } 62 | 63 | public String getIp() { 64 | return ip; 65 | } 66 | 67 | public void setIp(String ip) { 68 | this.ip = ip; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/admin/impl/DevelopServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.admin.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.lhs.entity.po.admin.DevelopLog; 5 | import com.lhs.entity.vo.dev.DevelopLogVO; 6 | import com.lhs.mapper.admin.DevelopLogMapper; 7 | import com.lhs.service.admin.DevelopService; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.Date; 11 | 12 | @Service 13 | public class DevelopServiceImpl implements DevelopService { 14 | 15 | private final DevelopLogMapper developLogMapper; 16 | 17 | 18 | public DevelopServiceImpl(DevelopLogMapper developLogMapper) { 19 | this.developLogMapper = developLogMapper; 20 | } 21 | 22 | @Override 23 | public void saveDevelopLog(DevelopLogVO developLogVO) { 24 | Date date = new Date(); 25 | DevelopLog developLog = new DevelopLog(); 26 | developLog.setTag(developLogVO.getTag()); 27 | developLog.setText(developLogVO.getText()); 28 | developLog.setAuthor(developLogVO.getAuthor()); 29 | developLog.setCommitTime(new Date(developLogVO.getCommitTime())); 30 | developLog.setId(date.getTime()); 31 | developLog.setCreateTime(date); 32 | developLog.setUpdateTime(date); 33 | developLogMapper.insert(developLog); 34 | } 35 | 36 | 37 | @Override 38 | public void updateDevelopLog(DevelopLog developLog) { 39 | developLog.setUpdateTime(new Date()); 40 | developLogMapper.update(developLog,new QueryWrapper().eq("id",developLog.getId())); 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/RateLimiter.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import com.lhs.common.enums.ResultCode; 4 | import com.lhs.common.exception.ServiceException; 5 | import org.springframework.data.redis.core.StringRedisTemplate; 6 | import org.springframework.stereotype.Component; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | @Component 11 | public class RateLimiter { 12 | 13 | private static final String KEY_PREFIX = "Limit:"; 14 | 15 | 16 | private final StringRedisTemplate redisTemplate; 17 | 18 | public RateLimiter(StringRedisTemplate redisTemplate) { 19 | this.redisTemplate = redisTemplate; 20 | } 21 | 22 | /** 23 | * 限制特定时间窗口内可请求的最大次数 24 | * @param key 请求方法的key 25 | * @param maxRequests 最大请求数 26 | * @param timeWindowInSeconds 时间窗口(单位秒) 27 | * @param resultCode 报错信息 28 | */ 29 | public void tryAcquire(String key, int maxRequests, int timeWindowInSeconds, ResultCode resultCode) { 30 | key = KEY_PREFIX + key; 31 | Long currentTime = System.currentTimeMillis(); 32 | 33 | // 使用原子操作递增计数器,并获取递增后的值 34 | Long countObj = redisTemplate.opsForValue().increment(key); 35 | long count = (countObj == null) ? 0 : countObj; // 避免潜在的 NullPointerException 36 | 37 | // 如果是新创建的key(即count=1),则设置过期时间 38 | if (count == 1) { 39 | redisTemplate.expire(key, timeWindowInSeconds, TimeUnit.SECONDS); 40 | } 41 | 42 | // 检查是否超过最大请求数 43 | if (count > maxRequests) { 44 | // 如果超过最大请求数,则不允许新的请求 45 | throw new ServiceException(resultCode); 46 | } 47 | 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/com/lhs/interceptor/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.interceptor; 2 | 3 | import com.lhs.service.admin.AdminService; 4 | import com.lhs.service.user.UserService; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | 10 | @Configuration 11 | public class WebConfig implements WebMvcConfigurer { 12 | 13 | 14 | private final RedisTemplate redisTemplate; 15 | 16 | 17 | 18 | private final UserService userService; 19 | 20 | 21 | 22 | public WebConfig(RedisTemplate redisTemplate,UserService userService) { 23 | this.redisTemplate = redisTemplate; 24 | 25 | this.userService = userService; 26 | } 27 | 28 | /** 29 | * 配置拦截器 30 | * @param registry 拦截器的注册中心 31 | */ 32 | @Override 33 | public void addInterceptors(InterceptorRegistry registry) { 34 | 35 | registry.addInterceptor(new AdminInterceptor(redisTemplate,userService)) 36 | .addPathPatterns("/admin/**"); //拦截 37 | // .excludePathPatterns(); //放行 38 | 39 | registry.addInterceptor(new SurveyInterceptor(redisTemplate)) 40 | .addPathPatterns("/survey/register/**"); //拦截 41 | // .excludePathPatterns(); //放行 42 | 43 | 44 | registry.addInterceptor(new UserInterceptor(redisTemplate,userService)) 45 | .addPathPatterns("/auth/**"); //拦截 46 | // .excludePathPatterns(); //放行 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/rogue/RogueSeedBak.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.rogue; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | 9 | @TableName 10 | public class RogueSeedBak { 11 | @TableId 12 | private Long seedId; 13 | private Long uid; 14 | private String seed; 15 | private String description; 16 | 17 | private Date createTime; 18 | 19 | 20 | public Long getSeedId() { 21 | return seedId; 22 | } 23 | 24 | public void setSeedId(Long seedId) { 25 | this.seedId = seedId; 26 | } 27 | 28 | public Long getUid() { 29 | return uid; 30 | } 31 | 32 | public void setUid(Long uid) { 33 | this.uid = uid; 34 | } 35 | 36 | public String getSeed() { 37 | return seed; 38 | } 39 | 40 | public void setSeed(String seed) { 41 | this.seed = seed; 42 | } 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | 48 | public void setDescription(String description) { 49 | this.description = description; 50 | } 51 | 52 | public Date getCreateTime() { 53 | return createTime; 54 | } 55 | 56 | public void setCreateTime(Date createTime) { 57 | this.createTime = createTime; 58 | } 59 | 60 | @Override 61 | public String toString() { 62 | return "RogueSeedBak{" + 63 | "seedId=" + seedId + 64 | ", seed='" + seed + '\'' + 65 | ", description='" + description + '\'' + 66 | ", createTime=" + createTime + 67 | '}'; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/interceptor/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.lhs.interceptor; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.cors.CorsConfiguration; 6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 7 | import org.springframework.web.cors.reactive.CorsWebFilter; 8 | //import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; 9 | import org.springframework.web.filter.CorsFilter; 10 | 11 | @Configuration 12 | public class CorsConfig { 13 | 14 | // @Bean 15 | // public CorsWebFilter corsWebFilter(){ 16 | // CorsConfiguration corsConfiguration = new CorsConfiguration(); 17 | // corsConfiguration.addAllowedMethod("*"); 18 | // corsConfiguration.addAllowedOrigin("*"); 19 | // corsConfiguration.addAllowedHeader("*"); 20 | // 21 | // UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 22 | // source.registerCorsConfiguration("/**",corsConfiguration); 23 | // 24 | // return new CorsWebFilter(source); 25 | // } 26 | 27 | 28 | @Bean 29 | public CorsFilter corsWebFilter(){ 30 | CorsConfiguration corsConfiguration = new CorsConfiguration(); 31 | corsConfiguration.addAllowedMethod("*"); 32 | corsConfiguration.addAllowedOrigin("*"); 33 | corsConfiguration.addAllowedHeader("*"); 34 | corsConfiguration.addExposedHeader("*"); 35 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); 36 | source.registerCorsConfiguration("/**",corsConfiguration); 37 | 38 | return new CorsFilter(source); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/HTMLUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | import java.util.Stack; 4 | 5 | public class HTMLUtil { 6 | /** 7 | * 校验描述字符串,删除所有多余的、匹配不上的“<”或“>”。 8 | * 每一个“<”都会与最近的一个“>”进行匹配,且每个“<”或“>”都只能互相匹配一次。 9 | * 10 | * @param htmlStr 待清洗的HTML字符串 11 | * @return 清洗后的HTML字符串 12 | */ 13 | public static String removeExcessParentheses(String htmlStr) { 14 | char[] chars = htmlStr.toCharArray(); 15 | int length = chars.length; 16 | boolean[] matched = new boolean[length]; // 标记每个字符是否已匹配 17 | StringBuilder sb = new StringBuilder(); 18 | Stack stack = new Stack<>(); // 栈用于存储“<”的索引 19 | 20 | // 遍历字符数组,使用栈匹配“<”与“>” 21 | for (int i = 0; i < length; i++) { 22 | if (chars[i] == '<') { 23 | // 将“<”的索引压入栈中 24 | stack.push(i); 25 | } else if (chars[i] == '>') { 26 | if (!stack.isEmpty()) { 27 | // 弹出栈顶的“<”索引,标记这对“<”和“>”为匹配 28 | int start = stack.pop(); 29 | matched[start] = true; 30 | matched[i] = true; 31 | } 32 | // 如果栈为空,说明当前“>”没有对应的“<”,忽略它 33 | } 34 | } 35 | 36 | // 构建最终的HTML,保留匹配的“<”和“>”,删除未匹配的 37 | for (int i = 0; i < length; i++) { 38 | if (chars[i] == '<' || chars[i] == '>') { 39 | if (matched[i]) { 40 | sb.append(chars[i]); 41 | } 42 | // 未匹配的“<”或“>”不添加到结果中 43 | } else { 44 | sb.append(chars[i]); 45 | } 46 | } 47 | 48 | return sb.toString(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/hypergryph/GameDataFormatFilePath.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.hypergryph; 2 | 3 | public class GameDataFormatFilePath { 4 | private String arknightsGameResourcePath; 5 | private String arknightsGameDataPath; 6 | private String arknightsGameResourceAvatarPath; 7 | private String JsonOutputPath; 8 | 9 | private String ImageOutputPath; 10 | 11 | 12 | public String getArknightsGameResourcePath() { 13 | return arknightsGameResourcePath; 14 | } 15 | 16 | public void setArknightsGameResourcePath(String arknightsGameResourcePath) { 17 | this.arknightsGameResourcePath = arknightsGameResourcePath; 18 | } 19 | 20 | public String getArknightsGameDataPath() { 21 | return arknightsGameDataPath; 22 | } 23 | 24 | public void setArknightsGameDataPath(String arknightsGameDataPath) { 25 | this.arknightsGameDataPath = arknightsGameDataPath; 26 | } 27 | 28 | public String getArknightsGameResourceAvatarPath() { 29 | return arknightsGameResourceAvatarPath; 30 | } 31 | 32 | public void setArknightsGameResourceAvatarPath(String arknightsGameResourceAvatarPath) { 33 | this.arknightsGameResourceAvatarPath = arknightsGameResourceAvatarPath; 34 | } 35 | 36 | public String getJsonOutputPath() { 37 | return JsonOutputPath; 38 | } 39 | 40 | public void setJsonOutputPath(String jsonOutputPath) { 41 | JsonOutputPath = jsonOutputPath; 42 | } 43 | 44 | public String getImageOutputPath() { 45 | return ImageOutputPath; 46 | } 47 | 48 | public void setImageOutputPath(String imageOutputPath) { 49 | ImageOutputPath = imageOutputPath; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/rogue/RogueSeedPageDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.rogue; 2 | 3 | 4 | import java.util.List; 5 | 6 | public class RogueSeedPageDTO { 7 | 8 | private String sortCondition; 9 | private Integer pageSize; 10 | private Integer pageNum; 11 | private Integer seedType; 12 | private List keywords; 13 | 14 | public String getSortCondition() { 15 | return sortCondition; 16 | } 17 | 18 | public void setSortCondition(String sortCondition) { 19 | this.sortCondition = sortCondition; 20 | } 21 | 22 | public Integer getPageSize() { 23 | return pageSize; 24 | } 25 | 26 | public void setPageSize(Integer pageSize) { 27 | this.pageSize = pageSize; 28 | } 29 | 30 | public Integer getPageNum() { 31 | return pageNum; 32 | } 33 | 34 | public void setPageNum(Integer pageNum) { 35 | this.pageNum = pageNum; 36 | } 37 | 38 | public Integer getSeedType() { 39 | return seedType; 40 | } 41 | 42 | public void setSeedType(Integer seedType) { 43 | this.seedType = seedType; 44 | } 45 | 46 | public List getKeywords() { 47 | return keywords; 48 | } 49 | 50 | public void setKeywords(List keywords) { 51 | this.keywords = keywords; 52 | } 53 | 54 | 55 | @Override 56 | public String toString() { 57 | return "RogueSeedPageDTO{" + 58 | "sortCondition='" + sortCondition + '\'' + 59 | ", pageSize=" + pageSize + 60 | ", pageNum=" + pageNum + 61 | ", seedType=" + seedType + 62 | ", keywords=" + keywords + 63 | '}'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/StageInfoAndDrop.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item; 2 | 3 | import com.lhs.entity.dto.material.PenguinMatrixDTO; 4 | 5 | import java.util.List; 6 | 7 | public class StageInfoAndDrop { 8 | 9 | private String stageId; 10 | private String stageCode; 11 | private String zoneId; 12 | private String zoneName; 13 | private Integer apCost; 14 | private String stageType; 15 | 16 | private List dropList; 17 | 18 | 19 | public String getStageId() { 20 | return stageId; 21 | } 22 | 23 | public void setStageId(String stageId) { 24 | this.stageId = stageId; 25 | } 26 | 27 | public String getStageCode() { 28 | return stageCode; 29 | } 30 | 31 | public void setStageCode(String stageCode) { 32 | this.stageCode = stageCode; 33 | } 34 | 35 | public String getZoneId() { 36 | return zoneId; 37 | } 38 | 39 | public void setZoneId(String zoneId) { 40 | this.zoneId = zoneId; 41 | } 42 | 43 | public String getZoneName() { 44 | return zoneName; 45 | } 46 | 47 | public void setZoneName(String zoneName) { 48 | this.zoneName = zoneName; 49 | } 50 | 51 | public Integer getApCost() { 52 | return apCost; 53 | } 54 | 55 | public void setApCost(Integer apCost) { 56 | this.apCost = apCost; 57 | } 58 | 59 | public String getStageType() { 60 | return stageType; 61 | } 62 | 63 | public void setStageType(String stageType) { 64 | this.stageType = stageType; 65 | } 66 | 67 | public List getDropList() { 68 | return dropList; 69 | } 70 | 71 | public void setDropList(List dropList) { 72 | this.dropList = dropList; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/ItemInfo.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | @TableName("item") 7 | public class ItemInfo { 8 | @TableId 9 | private Long id; 10 | private String itemId; //物品id 11 | private String itemName; //物品名称 12 | private Double itemValueAp; //物品价值 兼容字段 13 | private Double itemValue; //物品价值 单位:理智 14 | private Integer rarity; //物品稀有度 15 | private Double weight; //加工站爆率 16 | 17 | public Long getId() { 18 | return id; 19 | } 20 | 21 | public void setId(Long id) { 22 | this.id = id; 23 | } 24 | 25 | public String getItemId() { 26 | return itemId; 27 | } 28 | 29 | public void setItemId(String itemId) { 30 | this.itemId = itemId; 31 | } 32 | 33 | public String getItemName() { 34 | return itemName; 35 | } 36 | 37 | public void setItemName(String itemName) { 38 | this.itemName = itemName; 39 | } 40 | 41 | public Double getItemValueAp() { 42 | return itemValueAp; 43 | } 44 | 45 | public void setItemValueAp(Double itemValueAp) { 46 | this.itemValueAp = itemValueAp; 47 | } 48 | 49 | public Double getItemValue() { 50 | return itemValue; 51 | } 52 | 53 | public void setItemValue(Double itemValue) { 54 | this.itemValue = itemValue; 55 | } 56 | 57 | public Integer getRarity() { 58 | return rarity; 59 | } 60 | 61 | public void setRarity(Integer rarity) { 62 | this.rarity = rarity; 63 | } 64 | 65 | public Double getWeight() { 66 | return weight; 67 | } 68 | 69 | public void setWeight(Double weight) { 70 | this.weight = weight; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/rogue/RogueSeedRating.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.rogue; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | 7 | import java.util.Date; 8 | 9 | 10 | @TableName 11 | public class RogueSeedRating { 12 | @TableId 13 | private Long ratingId; 14 | private Long seedId; 15 | private Long uid; 16 | private Integer rating; 17 | private Date createTime; 18 | private Date updateTime; 19 | private Boolean deleteFlag; 20 | 21 | public Long getRatingId() { 22 | return ratingId; 23 | } 24 | 25 | public void setRatingId(Long ratingId) { 26 | this.ratingId = ratingId; 27 | } 28 | 29 | public Long getSeedId() { 30 | return seedId; 31 | } 32 | 33 | public void setSeedId(Long seedId) { 34 | this.seedId = seedId; 35 | } 36 | 37 | public Long getUid() { 38 | return uid; 39 | } 40 | 41 | public void setUid(Long uid) { 42 | this.uid = uid; 43 | } 44 | 45 | public Integer getRating() { 46 | return rating; 47 | } 48 | 49 | public void setRating(Integer rating) { 50 | this.rating = rating; 51 | } 52 | 53 | public Date getCreateTime() { 54 | return createTime; 55 | } 56 | 57 | public void setCreateTime(Date createTime) { 58 | this.createTime = createTime; 59 | } 60 | 61 | public Date getUpdateTime() { 62 | return updateTime; 63 | } 64 | 65 | public void setUpdateTime(Date updateTime) { 66 | this.updateTime = updateTime; 67 | } 68 | 69 | public Boolean getDeleteFlag() { 70 | return deleteFlag; 71 | } 72 | 73 | public void setDeleteFlag(Boolean deleteFlag) { 74 | this.deleteFlag = deleteFlag; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/QuestionnaireResult.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class QuestionnaireResult { 10 | @TableId 11 | private Long id; 12 | private Long uid; 13 | private String content; 14 | private Integer questionnaireCode; 15 | 16 | private Date createTime; 17 | private Date updateTime; 18 | private String ip; 19 | 20 | public Long getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Long id) { 25 | this.id = id; 26 | } 27 | 28 | public Long getUid() { 29 | return uid; 30 | } 31 | 32 | public void setUid(Long uid) { 33 | this.uid = uid; 34 | } 35 | 36 | public String getContent() { 37 | return content; 38 | } 39 | 40 | public Integer getQuestionnaireCode() { 41 | return questionnaireCode; 42 | } 43 | 44 | public void setQuestionnaireCode(Integer questionnaireCode) { 45 | this.questionnaireCode = questionnaireCode; 46 | } 47 | 48 | 49 | public void setContent(String content) { 50 | this.content = content; 51 | } 52 | 53 | public Date getCreateTime() { 54 | return createTime; 55 | } 56 | 57 | public void setCreateTime(Date createTime) { 58 | this.createTime = createTime; 59 | } 60 | 61 | public Date getUpdateTime() { 62 | return updateTime; 63 | } 64 | 65 | public void setUpdateTime(Date updateTime) { 66 | this.updateTime = updateTime; 67 | } 68 | 69 | public String getIp() { 70 | return ip; 71 | } 72 | 73 | public void setIp(String ip) { 74 | this.ip = ip; 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /src/main/resources/mapper/RecruitDataMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | INSERT INTO ${tableName} 8 | (`id`, `create_time`, `level`, `server`, `source`, `tag`, `uid`, `version`) 9 | VALUES (#{item.id}, #{item.createTime}, #{item.level}, #{item.server}, 10 | #{item.source}, #{item.tag}, #{item.uid}, #{item.version}) 11 | 12 | 13 | 20 | 21 | 22 | INSERT INTO `recruit_statistics` 23 | ( `statistical_item`, `statistical_result`) 24 | VALUES (#{statistics.statisticalItem}, #{statistics.statisticalResult}); 25 | 26 | 27 | 30 | 31 | 34 | 35 | 36 | UPDATE `recruit_statistics` 37 | SET `statistical_result` = #{statistics.statisticalResult} 38 | WHERE `statistical_item` = #{statistics.statisticalItem} 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StageDropMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 19 | 20 | 26 | 27 | 28 | INSERT INTO stage_drop 29 | (id, stage_id, drops, times, server, source, create_time, uid, version) 30 | VALUES 31 | 32 | (#{item.id},#{item.stageId},#{item.drops},#{item.times}, 33 | #{item.server},#{item.source},#{item.createTime},#{item.uid},#{item.version}) 34 | 35 | 36 | 37 | 38 | INSERT INTO ${table} 39 | (id, stage_id, drops, times, server, source, create_time, uid, version) 40 | VALUES 41 | 42 | (#{item.id},#{item.stageId},#{item.drops},#{item.times}, 43 | #{item.server},#{item.source},#{item.createTime},#{item.uid},#{item.version}) 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | #启动端口 2 | server: 3 | port: 10012 4 | 5 | spring: 6 | # 数据库配置 7 | datasource: 8 | type: com.zaxxer.hikari.HikariDataSource 9 | driver-class-name: com.mysql.cj.jdbc.Driver 10 | # 数据库链接 11 | url: jdbc:mysql://localhost:3306/数据库名?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true 12 | # 账号 13 | username: 数据库账号 14 | # 密码 15 | password: 数据库密码 16 | 17 | data: 18 | #reids配置 19 | redis: 20 | # redis所在服务器ip 21 | host: 127.0.0.1 22 | # redis默认端口 23 | port: 6379 24 | # password: 有redis密码就放开这个属性填入密码 25 | database: 0 26 | connect-timeout: 1800000 27 | lettuce: 28 | pool: 29 | max-active: 20 30 | max-wait: -1 31 | max-idle: 5 32 | min-idle: 0 33 | mail: 34 | host: smtp.163.com 35 | port: 465 36 | username: 邮箱名 37 | password: 密钥 38 | default-encoding: utf-8 39 | properties: 40 | mail: 41 | smtp: 42 | socketFactory: 43 | port: 465 44 | socketFactoryClass: javax.net.ssl.SSLSocketFactory 45 | ssl: 46 | enable: true 47 | protocol: smtp 48 | 49 | #资源路径 50 | resourcesPath: 51 | penguin: src/main/resources/penguin/ 52 | config: src/main/resources/config/ 53 | backup: src/main/resources/backup/ 54 | 55 | #AES密匙和签名值 56 | encryption: 57 | secret: 密匙 58 | signKey: 签名 59 | 60 | #企鹅物流API 61 | penguin: 62 | auto: 企鹅物流API 63 | global: https://penguin-stats.io/PenguinStats/api/v2/result/matrix?show_closed_zones=true 64 | 65 | tencent: 66 | secretId: 密匙 67 | secretKey: 签名 68 | 69 | # 森空岛API 70 | skland: 71 | playerInfoAPI: skdAPI 72 | playerBindingAPI: skdAPI 73 | 74 | #mybatis-plus: 75 | # configuration: 76 | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 77 | 78 | # 是否开启swagger文档 79 | swagger2: 80 | enable: true 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/main/resources/config/drop_table.json: -------------------------------------------------------------------------------- 1 | { 2 | "3243": "狙击双芯片", 3 | "31074": "固化纤维板", 4 | "3242": "狙击芯片组", 5 | "31073": "褐素纤维", 6 | "3241": "狙击芯片", 7 | "30145": "晶体电子单元", 8 | "30024": "糖聚块", 9 | "30023": "糖组", 10 | "30022": "糖", 11 | "30021": "代糖", 12 | "randomMaterial_8": "罗德岛物资补给Ⅳ", 13 | "30093": "研磨石", 14 | "31063": "转质盐组", 15 | "30094": "五水研磨石", 16 | "3252": "术师芯片组", 17 | "3251": "术师芯片", 18 | "30013": "固源岩组", 19 | "30012": "固源岩", 20 | "30135": "D32钢", 21 | "30014": "提纯源岩", 22 | "31064": "转质盐聚块", 23 | "30011": "源岩", 24 | "3003": "赤金", 25 | "ap_supply_lt_010": "应急理智小样", 26 | "30084": "三水锰矿", 27 | "30083": "轻锰矿", 28 | "3262": "医疗芯片组", 29 | "3261": "医疗芯片", 30 | "30125": "双极纳米片", 31 | "31054": "切削原液", 32 | "31053": "化合切削液", 33 | "30073": "扭转醇", 34 | "3272": "辅助芯片组", 35 | "3271": "辅助芯片", 36 | "31043": "半自然溶剂", 37 | "3303": "技巧概要·卷3", 38 | "30074": "白马醇", 39 | "3302": "技巧概要·卷2", 40 | "3301": "技巧概要·卷1", 41 | "31044": "精炼溶剂", 42 | "30115": "聚合剂", 43 | "30062": "装置", 44 | "30061": "破损装置", 45 | "3282": "特种芯片组", 46 | "3281": "特种芯片", 47 | "30103": "RMA70-12", 48 | "32001": "芯片助剂", 49 | "30064": "改量装置", 50 | "30063": "全新装置", 51 | "31034": "晶体电路", 52 | "31033": "晶体元件", 53 | "4006": "采购凭证", 54 | "30104": "RMA70-24", 55 | "3211": "先锋芯片", 56 | "2001": "基础作战记录", 57 | "30051": "双酮", 58 | "31024": "炽合金块", 59 | "30053": "酮凝集组", 60 | "30052": "酮凝集", 61 | "31023": "炽合金", 62 | "30054": "酮阵列", 63 | "3222": "近卫芯片组", 64 | "3221": "近卫芯片", 65 | "31014": "聚合凝胶", 66 | "31013": "凝胶", 67 | "30042": "异铁", 68 | "2004": "高级作战记录", 69 | "30041": "异铁碎片", 70 | "3213": "先锋双芯片", 71 | "30044": "异铁块", 72 | "2003": "中级作战记录", 73 | "3212": "先锋芯片组", 74 | "30043": "异铁组", 75 | "2002": "初级作战记录", 76 | "31083": "环烃聚质", 77 | "3232": "重装芯片组", 78 | "3231": "重装芯片", 79 | "31084": "环烃预制体", 80 | "30155": "烧结核凝晶", 81 | "30034": "聚酸酯块", 82 | "30031": "酯原料", 83 | "30033": "聚酸酯组", 84 | "30032": "聚酸酯" 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/service/maa/ScheduleService.java: -------------------------------------------------------------------------------- 1 | package com.lhs.service.maa; 2 | 3 | 4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 5 | import com.fasterxml.jackson.core.type.TypeReference; 6 | import com.fasterxml.jackson.databind.JsonNode; 7 | import com.lhs.common.config.ConfigUtil; 8 | import com.lhs.common.exception.ServiceException; 9 | import com.lhs.common.util.FileUtil; 10 | 11 | import com.lhs.common.enums.ResultCode; 12 | import com.lhs.common.util.JsonMapper; 13 | import com.lhs.entity.po.maa.Schedule; 14 | import com.lhs.mapper.ScheduleMapper; 15 | import org.springframework.stereotype.Service; 16 | 17 | 18 | import java.io.File; 19 | import java.util.Date; 20 | import java.util.Map; 21 | 22 | @Service 23 | public class ScheduleService { 24 | 25 | 26 | private final ScheduleMapper scheduleMapper; 27 | 28 | 29 | public ScheduleService(ScheduleMapper scheduleMapper) { 30 | this.scheduleMapper = scheduleMapper; 31 | } 32 | 33 | 34 | public void saveScheduleJson(String scheduleJson, Long scheduleId) { 35 | // ossService.upload(scheduleJson,"schedule/"+scheduleId+".json"); 36 | Schedule schedule = new Schedule(); 37 | schedule.setUid(scheduleId); 38 | schedule.setScheduleId(scheduleId); 39 | Map map = JsonMapper.parseObject(scheduleJson, new TypeReference<>() { 40 | 41 | }); 42 | map.put("id", scheduleId); 43 | schedule.setSchedule(JsonMapper.toJSONString(map)); 44 | schedule.setCreateTime(new Date()); 45 | scheduleMapper.insert(schedule); 46 | } 47 | 48 | 49 | public String retrieveScheduleJson(Long scheduleId) { 50 | Schedule schedule = scheduleMapper 51 | .selectOne(new QueryWrapper().eq("schedule_id", scheduleId)); 52 | 53 | if (schedule == null) { 54 | throw new ServiceException(ResultCode.DATA_NONE); 55 | } 56 | 57 | return schedule.getSchedule(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/config/ConfigUtil.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.config; 2 | 3 | 4 | import org.springframework.beans.factory.InitializingBean; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.stereotype.Component; 7 | 8 | @Component 9 | public class ConfigUtil implements InitializingBean { 10 | 11 | @Value("${resourcesPath.penguin}") 12 | private String penguin; // 13 | @Value("${resourcesPath.config}") 14 | private String configFilePath; // 15 | @Value("${resourcesPath.data}") 16 | private String dataFilePath; // 17 | @Value("${resourcesPath.backup}") 18 | private String backupFilePath; 19 | 20 | @Value("${encryption.secret}") 21 | private String secret; 22 | @Value("${encryption.signKey}") 23 | private String signKey; 24 | 25 | 26 | 27 | @Value("${penguin.auto}") 28 | private String penguinAuto; 29 | 30 | 31 | @Value("${skland.playerInfoAPI}") 32 | private String sklandPlayerInfoAPI; 33 | @Value("${skland.playerBindingAPI}") 34 | private String sklandPlayerBindingAPI; 35 | 36 | 37 | public static String Penguin; 38 | public static String ConfigFilePath; 39 | 40 | public static String DataFilePath; 41 | 42 | public static String BackupFilePath; 43 | 44 | public static String Secret; 45 | public static String SignKey; 46 | 47 | public static String PenguinAuto; 48 | 49 | 50 | public static String SKLandPlayerBindingAPI; 51 | public static String SKLandPlayerInfoAPI; 52 | 53 | 54 | 55 | @Override 56 | public void afterPropertiesSet() { 57 | Penguin = penguin; 58 | ConfigFilePath = configFilePath; 59 | DataFilePath = dataFilePath; 60 | BackupFilePath = backupFilePath; 61 | 62 | Secret = secret; 63 | SignKey = signKey; 64 | 65 | PenguinAuto = penguinAuto; 66 | 67 | 68 | SKLandPlayerBindingAPI = sklandPlayerBindingAPI; 69 | SKLandPlayerInfoAPI = sklandPlayerInfoAPI; 70 | 71 | 72 | 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/admin/Visits.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.admin; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableId; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import lombok.Data; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | 11 | import java.text.SimpleDateFormat; 12 | import java.util.Date; 13 | 14 | @Data 15 | @TableName("visits") 16 | @Slf4j 17 | public class Visits { 18 | @TableId 19 | private String date; 20 | private Integer visits; 21 | private Integer visitsBot; 22 | private Integer visitsIndex; 23 | private Integer visitsSchedule; 24 | private Integer visitsGacha; 25 | private Integer visitsPack; 26 | 27 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 28 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") 29 | private Date createTime; 30 | 31 | public void init() { 32 | Date date = new Date(); 33 | this.date = new SimpleDateFormat("yyyy-MM-dd").format(date); 34 | this.createTime = date; 35 | this.visits = 1; 36 | this.visitsBot = 0; 37 | this.visitsIndex = 0; 38 | this.visitsSchedule = 0; 39 | this.visitsGacha = 0; 40 | this.visitsPack = 0; 41 | } 42 | 43 | public void update(String path) { 44 | this.visits += 1; 45 | switch (path) { 46 | case "index": 47 | this.visitsIndex += 1; 48 | break; 49 | case "bot": 50 | this.visitsBot += 1; 51 | break; 52 | case "building": 53 | this.visitsSchedule += 1; 54 | break; 55 | case "gacha": 56 | this.visitsGacha += 1; 57 | break; 58 | case "pack": 59 | this.visitsPack += 1; 60 | break; 61 | default: 62 | log.error("非法路径"); 63 | break; 64 | } 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/material/StageDropStatisticalTaskLog.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.material; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class StageDropStatisticalTaskLog { 10 | 11 | @TableId 12 | private Long id; 13 | private Integer timeGranularity; 14 | private Integer dataCount; 15 | private Date createTime; 16 | private Date startTime; 17 | private Date endTime; 18 | 19 | public Long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(Long id) { 24 | this.id = id; 25 | } 26 | 27 | public Integer getTimeGranularity() { 28 | return timeGranularity; 29 | } 30 | 31 | public void setTimeGranularity(Integer timeGranularity) { 32 | this.timeGranularity = timeGranularity; 33 | } 34 | 35 | public Integer getDataCount() { 36 | return dataCount; 37 | } 38 | 39 | public void setDataCount(Integer dataCount) { 40 | this.dataCount = dataCount; 41 | } 42 | 43 | public Date getCreateTime() { 44 | return createTime; 45 | } 46 | 47 | public void setCreateTime(Date createTime) { 48 | this.createTime = createTime; 49 | } 50 | 51 | public Date getStartTime() { 52 | return startTime; 53 | } 54 | 55 | public void setStartTime(Date startTime) { 56 | this.startTime = startTime; 57 | } 58 | 59 | public Date getEndTime() { 60 | return endTime; 61 | } 62 | 63 | public void setEndTime(Date endTime) { 64 | this.endTime = endTime; 65 | } 66 | 67 | @Override 68 | public String toString() { 69 | return "StageDropStatisticalTaskLog{" + 70 | "id=" + id + 71 | ", timeGranularity=" + timeGranularity + 72 | ", dataCount=" + dataCount + 73 | ", createTime=" + createTime + 74 | ", startTime=" + startTime + 75 | ", endTime=" + endTime + 76 | '}'; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/StageResultVOV2.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | import com.lhs.entity.po.material.StageResult; 4 | import com.lhs.entity.po.material.StageResultDetail; 5 | import lombok.Data; 6 | 7 | 8 | @Data 9 | public class StageResultVOV2 { 10 | private String stageId; 11 | private String stageCode; 12 | private String stageType; 13 | private Double spm; 14 | private String itemName; 15 | private String itemId; 16 | private String secondaryItemId; 17 | private Double apExpect; 18 | private Double knockRating; 19 | private Double leT4Efficiency; 20 | private Double leT3Efficiency; 21 | private Double leT2Efficiency; 22 | private Double stageEfficiency; 23 | private Integer sampleSize; 24 | private Double sampleConfidence; 25 | private String zoneName; 26 | private Integer stageColor; 27 | 28 | //从通用掉落信息中复制 29 | public void copyByStageResultCommon(StageResult stageResult){ 30 | if(stageResult ==null){ 31 | return; 32 | } 33 | this.stageId = stageResult.getStageId(); 34 | this.stageCode = stageResult.getStageCode(); 35 | this.secondaryItemId = stageResult.getSecondaryItemId(); 36 | this.stageEfficiency = stageResult.getStageEfficiency(); 37 | this.leT4Efficiency = stageResult.getLeT4Efficiency(); 38 | this.leT3Efficiency = stageResult.getLeT3Efficiency(); 39 | this.leT2Efficiency = stageResult.getLeT2Efficiency(); 40 | 41 | this.spm = stageResult.getSpm(); 42 | } 43 | 44 | //从详细掉落信息中复制 45 | public void copyByStageResultDetail(StageResultDetail stageResultDetail){ 46 | if(stageResultDetail ==null){ 47 | return; 48 | } 49 | this.itemName = stageResultDetail.getItemName(); 50 | this.itemId = stageResultDetail.getItemId(); 51 | this.apExpect = stageResultDetail.getApExpect(); 52 | this.knockRating = stageResultDetail.getKnockRating(); 53 | this.sampleSize = stageResultDetail.getSampleSize(); 54 | this.sampleConfidence = stageResultDetail.getSampleConfidence(); 55 | } 56 | 57 | 58 | 59 | 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/com/lhs/item/CustomItemDTOTest.java: -------------------------------------------------------------------------------- 1 | package com.lhs.item; 2 | 3 | import com.fasterxml.jackson.core.type.TypeReference; 4 | import com.lhs.common.config.ConfigUtil; 5 | import com.lhs.common.util.FileUtil; 6 | import com.lhs.common.util.JsonMapper; 7 | import com.lhs.entity.dto.item.custom.ItemInfoDTO; 8 | import com.lhs.entity.dto.item.custom.ItemValueConfigDTO; 9 | import com.lhs.service.material.CustomItemService; 10 | import jakarta.annotation.Resource; 11 | import org.junit.jupiter.api.Test; 12 | import org.springframework.boot.test.context.SpringBootTest; 13 | 14 | import java.util.List; 15 | import java.util.Map; 16 | import java.util.stream.Collectors; 17 | 18 | @SpringBootTest 19 | public class CustomItemDTOTest { 20 | 21 | @Resource 22 | private CustomItemService customItemService; 23 | 24 | @Test 25 | void customItemValueTest(){ 26 | ItemValueConfigDTO itemValueConfigDTO = new ItemValueConfigDTO(); 27 | customItemService.getCustomItemList(itemValueConfigDTO); 28 | } 29 | 30 | @Test 31 | void formatItemInfoTest(){ 32 | String itemInfoText = FileUtil.read(ConfigUtil.DataFilePath + "item_info.json"); 33 | 34 | List itemInfoDTOList = JsonMapper.parseJSONArray(itemInfoText, new TypeReference<>() { 35 | }); 36 | 37 | Map collect = itemInfoDTOList.stream() 38 | .collect(Collectors.toMap( 39 | ItemInfoDTO::getItemId, 40 | itemInfoDTO -> itemInfoDTO, 41 | (existing, replacement) -> existing // 保留已存在的值 42 | )); 43 | 44 | String itemInfoText1 = FileUtil.read(ConfigUtil.DataFilePath + "item_info.v2.json"); 45 | 46 | List backList = JsonMapper.parseJSONArray(itemInfoText1, new TypeReference<>() { 47 | }); 48 | 49 | for(ItemInfoDTO itemInfoDTO : backList){ 50 | if(collect.containsKey(itemInfoDTO.getItemId())){ 51 | itemInfoDTO.setGroupId(collect.get(itemInfoDTO.getItemId()).getGroupId()); 52 | } 53 | } 54 | 55 | 56 | 57 | System.out.println(JsonMapper.toJSONString(collect)); 58 | 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/interceptor/SurveyInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.lhs.interceptor; 2 | 3 | import com.baomidou.mybatisplus.core.toolkit.AES; 4 | import com.lhs.common.exception.ServiceException; 5 | import com.lhs.common.config.ConfigUtil; 6 | import com.lhs.common.util.IpUtil; 7 | import com.lhs.common.enums.ResultCode; 8 | import org.springframework.data.redis.core.RedisTemplate; 9 | import org.springframework.web.servlet.HandlerInterceptor; 10 | import org.springframework.web.servlet.ModelAndView; 11 | 12 | import jakarta.servlet.http.HttpServletRequest; 13 | import jakarta.servlet.http.HttpServletResponse; 14 | import java.util.concurrent.TimeUnit; 15 | 16 | public class SurveyInterceptor implements HandlerInterceptor { 17 | 18 | 19 | private final RedisTemplate redisTemplate; 20 | 21 | 22 | public SurveyInterceptor(RedisTemplate redisTemplate) { 23 | this.redisTemplate = redisTemplate; 24 | } 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 28 | 29 | String ipAddress = AES.encrypt(IpUtil.getIpAddress(request), ConfigUtil.Secret); 30 | Object cache = redisTemplate.opsForValue().get("IP:"+ipAddress); 31 | if(cache==null) { 32 | redisTemplate.opsForValue().set("IP:"+ipAddress, 1, 60, TimeUnit.SECONDS); 33 | return true; 34 | } 35 | int times = Integer.parseInt(String.valueOf(cache)); 36 | if(times>5) throw new ServiceException(ResultCode.EXCESSIVE_IP_ACCESS_TIMES); 37 | redisTemplate.opsForValue().increment("IP:"+ipAddress); 38 | return true; 39 | } 40 | 41 | @Override 42 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 43 | HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); 44 | } 45 | 46 | @Override 47 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 48 | HandlerInterceptor.super.afterCompletion(request, response, handler, ex); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/po/survey/OperatorCarryRateStatistics.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.po.survey; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableId; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | 6 | import java.util.Date; 7 | 8 | @TableName 9 | public class OperatorCarryRateStatistics { 10 | @TableId 11 | private Long id; 12 | private Integer questionnaireCode; 13 | private String questionnaireType; 14 | private Date startTime; 15 | private Date endTime; 16 | private String result; 17 | private Integer timeGranularity; 18 | private Date createTime; 19 | 20 | public Long getId() { 21 | return id; 22 | } 23 | 24 | public void setId(Long id) { 25 | this.id = id; 26 | } 27 | 28 | public Integer getQuestionnaireCode() { 29 | return questionnaireCode; 30 | } 31 | 32 | public void setQuestionnaireCode(Integer questionnaireCode) { 33 | this.questionnaireCode = questionnaireCode; 34 | } 35 | 36 | public String getQuestionnaireType() { 37 | return questionnaireType; 38 | } 39 | 40 | public void setQuestionnaireType(String questionnaireType) { 41 | this.questionnaireType = questionnaireType; 42 | } 43 | 44 | public String getResult() { 45 | return result; 46 | } 47 | 48 | public void setResult(String result) { 49 | this.result = result; 50 | } 51 | 52 | public Integer getTimeGranularity() { 53 | return timeGranularity; 54 | } 55 | 56 | public void setTimeGranularity(Integer timeGranularity) { 57 | this.timeGranularity = timeGranularity; 58 | } 59 | 60 | public Date getStartTime() { 61 | return startTime; 62 | } 63 | 64 | public void setStartTime(Date startTime) { 65 | this.startTime = startTime; 66 | } 67 | 68 | public Date getEndTime() { 69 | return endTime; 70 | } 71 | 72 | public void setEndTime(Date endTime) { 73 | this.endTime = endTime; 74 | } 75 | 76 | public Date getCreateTime() { 77 | return createTime; 78 | } 79 | 80 | public void setCreateTime(Date createTime) { 81 | this.createTime = createTime; 82 | } 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/config/SensitiveSerialize.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.config; 2 | 3 | import com.fasterxml.jackson.core.JsonGenerator; 4 | import com.fasterxml.jackson.databind.BeanProperty; 5 | import com.fasterxml.jackson.databind.JsonMappingException; 6 | import com.fasterxml.jackson.databind.JsonSerializer; 7 | import com.fasterxml.jackson.databind.SerializerProvider; 8 | import com.fasterxml.jackson.databind.ser.ContextualSerializer; 9 | import com.lhs.common.annotation.Sensitive; 10 | import com.lhs.common.util.DesensitizedUtil; 11 | import lombok.AllArgsConstructor; 12 | import lombok.NoArgsConstructor; 13 | 14 | import java.io.IOException; 15 | import java.util.Objects; 16 | 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class SensitiveSerialize extends JsonSerializer implements ContextualSerializer { 20 | 21 | private Integer prefixNoMaskLen; 22 | 23 | private Integer suffixNoMaskLen; 24 | 25 | private String symbol; 26 | 27 | @Override 28 | public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { 29 | jsonGenerator.writeString(DesensitizedUtil.desValue(s,prefixNoMaskLen,suffixNoMaskLen,symbol)); 30 | } 31 | 32 | 33 | @Override 34 | public JsonSerializer createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) throws JsonMappingException { 35 | if (beanProperty != null) { 36 | if (Objects.equals(beanProperty.getType().getRawClass(), String.class)) { 37 | Sensitive sensitive = beanProperty.getAnnotation(Sensitive.class); 38 | if (sensitive == null) { 39 | sensitive = beanProperty.getContextAnnotation(Sensitive.class); 40 | } 41 | if (sensitive != null) { 42 | return new SensitiveSerialize(sensitive.prefixNoMaskLen(), 43 | sensitive.suffixNoMaskLen(), sensitive.symbol()); 44 | } 45 | } 46 | return serializerProvider.findValueSerializer(beanProperty.getType(), beanProperty); 47 | } 48 | return serializerProvider.findNullValueSerializer(null); 49 | 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/vo/material/PackInfoVO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.vo.material; 2 | 3 | 4 | import com.lhs.entity.po.material.PackInfo; 5 | import lombok.Data; 6 | 7 | import java.util.List; 8 | 9 | @Data 10 | public class PackInfoVO { 11 | private Long id; //数据库索引,类雪花算法生成 12 | private String officialName; //礼包官方名称 13 | private String displayName; //前端展示名称 14 | private double price; //价格 15 | private String saleType; //礼包类型 16 | private String tags; 17 | private String imageLink; //礼包图片名称 18 | private Integer gachaTicket; //单抽券数量 19 | private Integer tenGachaTicket; //十连券数量 20 | private Integer originium; //源石数量 21 | private Integer orundum; //合成玉数量 22 | private Double draws; //总抽数 23 | private Double drawPrice; //每一抽价格 24 | private Double packedOriginium; //礼包内物品折算为源石的价值 25 | private Double packedOriginiumPrice; //每源石(折算物资后)价格 26 | private Double drawEfficiency; //氪金性价比 27 | private Double packEfficiency; //综合性价比 28 | private Double drawsKernel; //总抽数(含蓝票) 29 | private Double drawPriceKernel; //每一抽价格(含蓝票) 30 | private Double packedOriginiumKernel; //礼包内物品折算为源石的价值(含蓝票) 31 | private Double packedOriginiumPriceKernel; //每源石(折算物资后)价格(含蓝票) 32 | private Double drawEfficiencyKernel; //氪金性价比(含蓝票) 33 | private Double packEfficiencyKernel; //综合性价比(含蓝票) 34 | private List packContent; //礼包非抽卡道具内容 35 | private Long start; 36 | private Long end; 37 | private String note; 38 | 39 | 40 | public void copy(PackInfo packInfo) { 41 | this.id = packInfo.getId(); 42 | this.officialName = packInfo.getOfficialName(); 43 | this.displayName = packInfo.getDisplayName(); 44 | this.price = packInfo.getPrice(); 45 | this.saleType = packInfo.getSaleType(); 46 | this.gachaTicket = packInfo.getGachaTicket(); 47 | this.tenGachaTicket = packInfo.getTenGachaTicket(); 48 | this.originium = packInfo.getOriginium(); 49 | this.orundum = packInfo.getOrundum(); 50 | this.start = packInfo.getStart().getTime(); 51 | this.end = packInfo.getEnd().getTime(); 52 | this.note = packInfo.getNote(); 53 | this.tags = packInfo.getTags(); 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/item/custom/PenguinMatrixDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.item.custom; 2 | 3 | 4 | import lombok.Data; 5 | 6 | //用于转换企鹅物流的api的实体类 7 | 8 | public class PenguinMatrixDTO { 9 | 10 | // 企鹅物流数据 11 | private String stageId; //关卡id 12 | private String itemId; //物品id 13 | private Integer quantity; //物品掉落次数 14 | private Integer times; //关卡刷取次数 15 | private Long start; 16 | private Long end; 17 | 18 | 19 | public PenguinMatrixDTO() { 20 | } 21 | 22 | public PenguinMatrixDTO(String stageId, String itemId, Integer quantity, Integer times, Long start, Long end) { 23 | this.stageId = stageId; 24 | this.itemId = itemId; 25 | this.quantity = quantity; 26 | this.times = times; 27 | this.start = start; 28 | this.end = end; 29 | } 30 | 31 | public String getStageId() { 32 | return stageId; 33 | } 34 | 35 | public void setStageId(String stageId) { 36 | this.stageId = stageId; 37 | } 38 | 39 | public String getItemId() { 40 | return itemId; 41 | } 42 | 43 | public void setItemId(String itemId) { 44 | this.itemId = itemId; 45 | } 46 | 47 | public Integer getQuantity() { 48 | return quantity; 49 | } 50 | 51 | public void setQuantity(Integer quantity) { 52 | this.quantity = quantity; 53 | } 54 | 55 | public Integer getTimes() { 56 | return times; 57 | } 58 | 59 | public void setTimes(Integer times) { 60 | this.times = times; 61 | } 62 | 63 | public Long getStart() { 64 | return start; 65 | } 66 | 67 | public void setStart(Long start) { 68 | this.start = start; 69 | } 70 | 71 | public Long getEnd() { 72 | return end; 73 | } 74 | 75 | public void setEnd(Long end) { 76 | this.end = end; 77 | } 78 | 79 | @Override 80 | public String toString() { 81 | return "PenguinMatrixDTO{" + 82 | "stageId='" + stageId + '\'' + 83 | ", itemId='" + itemId + '\'' + 84 | ", quantity=" + quantity + 85 | ", times=" + times + 86 | ", start=" + start + 87 | ", end=" + end + 88 | '}'; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/resources/data/item_value_correction_term.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "itemId": "30013", 4 | "itemName": "固源岩组", 5 | "correctionTerm": 1.00000137324044 6 | }, 7 | { 8 | "itemId": "30023", 9 | "itemName": "糖组", 10 | "correctionTerm": 1.0000040009822255 11 | }, 12 | { 13 | "itemId": "30033", 14 | "itemName": "聚酸酯组", 15 | "correctionTerm": 1.0000019925398336 16 | }, 17 | { 18 | "itemId": "30043", 19 | "itemName": "异铁组", 20 | "correctionTerm": 0.9999483750088554 21 | }, 22 | { 23 | "itemId": "30053", 24 | "itemName": "酮凝集组", 25 | "correctionTerm": 1.0000022954075312 26 | }, 27 | { 28 | "itemId": "30063", 29 | "itemName": "全新装置", 30 | "correctionTerm": 1.0000013169421755 31 | }, 32 | { 33 | "itemId": "30073", 34 | "itemName": "扭转醇", 35 | "correctionTerm": 0.9999649132885954 36 | }, 37 | { 38 | "itemId": "30083", 39 | "itemName": "轻锰矿", 40 | "correctionTerm": 1.000002240727396 41 | }, 42 | { 43 | "itemId": "30093", 44 | "itemName": "研磨石", 45 | "correctionTerm": 1.0000022806201772 46 | }, 47 | { 48 | "itemId": "30103", 49 | "itemName": "RMA70-12", 50 | "correctionTerm": 1.0000130948559616 51 | }, 52 | { 53 | "itemId": "31013", 54 | "itemName": "凝胶", 55 | "correctionTerm": 0.9999904276257087 56 | }, 57 | { 58 | "itemId": "31023", 59 | "itemName": "炽合金", 60 | "correctionTerm": 1.0000248495124442 61 | }, 62 | { 63 | "itemId": "31033", 64 | "itemName": "晶体元件", 65 | "correctionTerm": 1.00000158366126 66 | }, 67 | { 68 | "itemId": "31043", 69 | "itemName": "半自然溶剂", 70 | "correctionTerm": 0.999997836003829 71 | }, 72 | { 73 | "itemId": "31053", 74 | "itemName": "化合切削液", 75 | "correctionTerm": 1.000006210539448 76 | }, 77 | { 78 | "itemId": "31063", 79 | "itemName": "转质盐组", 80 | "correctionTerm": 0.9999981294168673 81 | }, 82 | { 83 | "itemId": "31073", 84 | "itemName": "褐素纤维", 85 | "correctionTerm": 1.0001889176671603 86 | }, 87 | { 88 | "itemId": "31083", 89 | "itemName": "环烃聚质", 90 | "correctionTerm": 0.9996130718228801 91 | }, 92 | { 93 | "itemId": "31093", 94 | "itemName": "类凝结核", 95 | "correctionTerm": 0.9996130718228801 96 | } 97 | ] -------------------------------------------------------------------------------- /src/main/java/com/lhs/entity/dto/material/StageResultTmpDTO.java: -------------------------------------------------------------------------------- 1 | package com.lhs.entity.dto.material; 2 | 3 | import com.lhs.entity.po.material.Item; 4 | import com.lhs.entity.po.material.ItemIterationValue; 5 | import com.lhs.entity.po.material.StageResult; 6 | import com.lhs.entity.po.material.StageResultDetail; 7 | import lombok.Data; 8 | 9 | import java.util.*; 10 | 11 | @Data 12 | public class StageResultTmpDTO { 13 | 14 | //关卡详情集合 15 | private List stageResultDetailList; 16 | 17 | //关卡效率集合 18 | private List stageResultList; 19 | 20 | //材料系列迭代值字典 21 | private Map itemIterationValueMap; 22 | 23 | private List itemIterationValueList; 24 | 25 | private List itemList; 26 | 27 | 28 | 29 | /** 30 | * 向关卡详情集合中添加一个或多个元素 31 | * 32 | * @param stageResultDetails 要添加的一个或多个关卡详情 33 | */ 34 | public void addStageResultDetail(StageResultDetail stageResultDetails) { 35 | if (this.stageResultDetailList == null) { 36 | this.stageResultDetailList = new ArrayList<>(); 37 | } 38 | this.stageResultDetailList.add(stageResultDetails); 39 | } 40 | 41 | 42 | 43 | /** 44 | * 向关卡效率集合中添加一个或多个元素 45 | * 46 | * @param stageResults 要添加的一个或多个关卡效率 47 | */ 48 | public void addStageResult(StageResult stageResults) { 49 | if (this.stageResultList == null) { 50 | this.stageResultList = new ArrayList<>(); 51 | } 52 | this.stageResultList.add(stageResults); 53 | } 54 | 55 | 56 | 57 | /** 58 | * 向材料系列迭代值字典中添加或更新键值对 59 | * 60 | * @param key 材料系列的键 61 | * @param value 迭代值 62 | */ 63 | public void putItemIterationValue(String key, Double value) { 64 | if (this.itemIterationValueMap == null) { 65 | this.itemIterationValueMap = new HashMap<>(); 66 | } 67 | this.itemIterationValueMap.put(key, value); 68 | } 69 | 70 | /** 71 | * 从材料系列迭代值字典中根据系列id取出值 72 | * 73 | * @param key 材料系列的键 74 | */ 75 | public Double getItemIterationValueByItemSeriesId(String key) { 76 | if (this.itemIterationValueMap == null) { 77 | return 0.0; 78 | } 79 | return this.itemIterationValueMap.get(key); 80 | } 81 | 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/lhs/common/util/Result.java: -------------------------------------------------------------------------------- 1 | package com.lhs.common.util; 2 | 3 | 4 | 5 | 6 | import com.lhs.common.enums.ResultCode; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * 统一Controller中RESTFul风格接口返回的结果 12 | */ 13 | 14 | public class Result implements Serializable { 15 | 16 | private static final long serialVersionUID = 1L; 17 | private Integer code; 18 | private String msg; 19 | private T data; 20 | 21 | private Result() {} 22 | 23 | private Result(Integer code, String msg) { 24 | this.code = code; 25 | this.msg = msg; 26 | } 27 | 28 | private void setResultCode(ResultCode code) { 29 | this.code = code.code(); 30 | this.msg = code.message(); 31 | } 32 | 33 | 34 | /** 35 | * 操作失败,自定义code和msg 36 | */ 37 | public static Result failure(Integer code, String msg) { 38 | Result result = new Result(code,msg); 39 | return result; 40 | } 41 | 42 | /** 43 | * 操作成功,没有返回的数据 44 | */ 45 | public static Result success() { 46 | Result result = new Result(); 47 | result.setResultCode(ResultCode.SUCCESS); 48 | return result; 49 | } 50 | 51 | /** 52 | * 操作成功,有返回的数据 53 | */ 54 | public static Result success(T data) { 55 | Result result = new Result(); 56 | result.setResultCode(ResultCode.SUCCESS); 57 | result.setData(data); 58 | return result; 59 | } 60 | 61 | /** 62 | * 操作失败,没有返回的数据 63 | */ 64 | public static Result failure(ResultCode resultCode) { 65 | Result result = new Result(); 66 | result.setResultCode(resultCode); 67 | return result; 68 | } 69 | 70 | /** 71 | * 操作失败,有返回的数据 72 | */ 73 | public static Result failure(ResultCode resultCode, T data) { 74 | Result result = new Result(); 75 | result.setResultCode(resultCode); 76 | result.setData(data); 77 | return result; 78 | } 79 | 80 | public Integer getCode() { 81 | return code; 82 | } 83 | 84 | public void setCode(Integer code) { 85 | this.code = code; 86 | } 87 | 88 | public String getMsg() { 89 | return msg; 90 | } 91 | 92 | public void setMsg(String msg) { 93 | this.msg = msg; 94 | } 95 | 96 | public T getData() { 97 | return data; 98 | } 99 | 100 | public void setData(T data) { 101 | this.data = data; 102 | } 103 | 104 | } 105 | --------------------------------------------------------------------------------