diff --git a/rc-service/rc-inner-api/external-inner/external-inner-model/src/main/java/com/red/circle/external/inner/model/enums/message/OfficialNoticeTypeEnum.java b/rc-service/rc-inner-api/external-inner/external-inner-model/src/main/java/com/red/circle/external/inner/model/enums/message/OfficialNoticeTypeEnum.java index ff750eb8..fe23cb84 100644 --- a/rc-service/rc-inner-api/external-inner/external-inner-model/src/main/java/com/red/circle/external/inner/model/enums/message/OfficialNoticeTypeEnum.java +++ b/rc-service/rc-inner-api/external-inner/external-inner-model/src/main/java/com/red/circle/external/inner/model/enums/message/OfficialNoticeTypeEnum.java @@ -242,6 +242,11 @@ public enum OfficialNoticeTypeEnum { */ REFUSE_ADMIN_INVITE_RECHARGE_AGENT, + /** + * 用户靓号审核结果 + */ + USER_SPECIAL_AUDIT_RESULTS, + ; diff --git a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/UserBeautifulNumberApplyClientApi.java b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/UserBeautifulNumberApplyClientApi.java index cfa55888..f291202c 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/UserBeautifulNumberApplyClientApi.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/user/user/api/UserBeautifulNumberApplyClientApi.java @@ -28,7 +28,8 @@ public interface UserBeautifulNumberApplyClientApi { @GetMapping("/handleApply") ResultResponse handleApply(@RequestParam("id") Long id, - @RequestParam("state") Integer state); + @RequestParam("state") Integer state, + @RequestParam(value = "remark", required = false) String remark); /** * 修改靓号池信息 diff --git a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/user/UserBeautifulNumberApplyRestController.java b/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/user/UserBeautifulNumberApplyRestController.java index f9e18dae..e0ef35fc 100644 --- a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/user/UserBeautifulNumberApplyRestController.java +++ b/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/user/UserBeautifulNumberApplyRestController.java @@ -7,10 +7,7 @@ import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.web.controller.BaseController; import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberApplyQryCmd; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** *

@@ -41,9 +38,10 @@ public class UserBeautifulNumberApplyRestController extends BaseController { */ @GetMapping("/handle/{id}/{state}") public void handleApply( - @PathVariable("id") Long id, - @PathVariable("state") Integer state) { - userBeautifulNumberApplyService.handleApply(id, state); + @PathVariable("id") Long id, + @PathVariable("state") Integer state, + @RequestParam(value = "remark", required = false) String remark) { + userBeautifulNumberApplyService.handleApply(id, state, remark); } diff --git a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyServiceImpl.java b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyServiceImpl.java index 0d4055b3..0cf07a0b 100644 --- a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyServiceImpl.java +++ b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyServiceImpl.java @@ -55,8 +55,8 @@ public class UserBeautifulNumberApplyServiceImpl implements } @Override - public void handleApply(Long id, Integer state) { - ResponseAssert.requiredSuccess(beautifulNumberApplyClient.handleApply(id, state)); + public void handleApply(Long id, Integer state, String remark) { + ResponseAssert.requiredSuccess(beautifulNumberApplyClient.handleApply(id, state, remark)); } private Map getMapUser(PageResult resultPage) { diff --git a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyService.java b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyService.java index 9b221f88..c0ba75e4 100644 --- a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyService.java +++ b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/user/UserBeautifulNumberApplyService.java @@ -16,7 +16,7 @@ public interface UserBeautifulNumberApplyService { PageResult pageData(UserBeautifulNumberApplyQryCmd query); - void handleApply(Long id, Integer state); + void handleApply(Long id, Integer state, String remark); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java index bb09b7ba..0ce9751d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/UserBeautifulNumberApplyCmdExe.java @@ -28,7 +28,7 @@ public class UserBeautifulNumberApplyCmdExe { public void execute(UserSpecialIdApplyCmd cmd) { String account = cmd.getAccount(); - Long userId = cmd.getUserId(); + Long userId = cmd.getReqUserId(); UserConsumptionLevel consumptionLevel = userProfileGateway.getUserConsumptionLevel(SysOriginPlatformEnum.LIKEI, userId); Integer wealthLevel = consumptionLevel.getWealthLevel(); @@ -39,10 +39,10 @@ public class UserBeautifulNumberApplyCmdExe { wealthLevel != null && wealthLevel >= 10 ); - // (2) ID格式校验:8位数字或2位数字 + // (2) ID格式校验:2-8位数字 ResponseAssert.isTrue( UserSpecialErrorCode.ID_FORMAT_INVALID, - account != null && (account.matches("^\\d{8}$") || account.matches("^\\d{2}$")) + account != null && account.matches("^\\d{2,8}$") ); // (3) 用户在当前财富等级已申请过ID(待审核) diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/user/UserBeautifulNumberClientEndpoint.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/user/UserBeautifulNumberClientEndpoint.java index f09af821..ca610773 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/user/UserBeautifulNumberClientEndpoint.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/user/user/UserBeautifulNumberClientEndpoint.java @@ -37,8 +37,8 @@ public class UserBeautifulNumberClientEndpoint implements UserBeautifulNumberApp } @Override - public ResultResponse handleApply(Long id, Integer state) { - userBeautifulNumberApplyClientService.handleApply(id, state); + public ResultResponse handleApply(Long id, Integer state, String remark) { + userBeautifulNumberApplyClientService.handleApply(id, state, remark); return ResultResponse.success(); } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserBeautifulNumberClientService.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserBeautifulNumberClientService.java index dda21bfa..c70e166c 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserBeautifulNumberClientService.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/UserBeautifulNumberClientService.java @@ -20,7 +20,7 @@ public interface UserBeautifulNumberClientService { PageResult pageBeautifulNumberApply( UserBeautifulNumberApplyQryCmd query); - void handleApply(Long id, Integer state); + void handleApply(Long id, Integer state, String remark); void updateBeautifulNumber(UserBeautifulNumberCmd cmd); diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java index 16a6a05b..0cea175d 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java @@ -1,5 +1,8 @@ package com.red.circle.other.app.inner.service.user.user.impl; +import com.red.circle.external.inner.endpoint.message.OfficialNoticeClient; +import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExtTemplateCustomizeCmd; +import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum; import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.framework.core.response.CommonErrorCode; import com.red.circle.framework.dto.PageResult; @@ -38,6 +41,7 @@ public class UserBeautifulNumberClientServiceImpl implements private final UserBeautifulNumberService userBeautifulNumberService; private final UserBeautifulNumberApplyService userBeautifulNumberApplyService; private final UserSpecialIdService userSpecialIdService; + private final OfficialNoticeClient officialNoticeClient; @Override public PageResult pageBeautifulNumberApply( @@ -47,13 +51,13 @@ public class UserBeautifulNumberClientServiceImpl implements } @Override - public void handleApply(Long id, Integer state) { + public void handleApply(Long id, Integer state, String remark) { ResponseAssert.isTrue(CommonErrorCode.TYPE_IS_NOT_IN_SCOPE, checkState(state)); userBeautifulNumberApplyService.handleApply(id, state); + UserBeautifulNumberApply beautifulNumberApply = userBeautifulNumberApplyService.getById(id); + String content; if (state == 1) { - UserBeautifulNumberApply beautifulNumberApply = userBeautifulNumberApplyService.getById(id); - UserSpecialId userSpecialId = userSpecialIdService.getByUserId(beautifulNumberApply.getApplyUser()); if (Objects.nonNull(userSpecialId)) { userSpecialIdService.remove(userSpecialId.getId()); @@ -67,8 +71,24 @@ public class UserBeautifulNumberClientServiceImpl implements // 设置365 * 3天后过期 specialIdCmd.setExpiredTime(TimestampUtils.dateTimePlusDays(TimestampUtils.now(),365 * 3)); userSpecialIdService.add(specialIdCmd); + + + content = String.format("Your application for exclusive lD 【%s】has been approved and has been applied to both you user lD and room lD.", + beautifulNumberApply.getApplyAccount()); + } else { + content = String.format("Your application for exclusive lD 【%s】wasn't approved for reason 【%s】", + beautifulNumberApply.getApplyAccount(), + remark); } + officialNoticeClient.send( + NoticeExtTemplateCustomizeCmd.builder() + .toAccount(beautifulNumberApply.getApplyUser()) + .noticeType(OfficialNoticeTypeEnum.USER_SPECIAL_AUDIT_RESULTS) + .content(content) + .build() + ); + } private boolean checkState(Integer state) { diff --git a/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java b/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java index 237514c8..01997348 100644 --- a/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java +++ b/rc-service/rc-service-other/other-start/src/test/java/ApiTest.java @@ -1,4 +1,6 @@ +import com.red.circle.framework.core.asserts.ResponseAssert; import com.red.circle.other.infra.database.mongo.service.team.TeamBillCycleUtils; +import com.red.circle.other.inner.asserts.user.UserSpecialErrorCode; import com.red.circle.tool.core.date.ZonedDateTimeAsiaRiyadhUtils; import com.red.circle.tool.crypto.SecurityUtils; import org.junit.Test; @@ -14,7 +16,10 @@ public class ApiTest { @Test public void testPassword() { - System.out.println(new BCryptPasswordEncoder().encode("123456")); + String account = "445566"; + System.out.println(account.matches("^\\d{8}$")); + System.out.println(account.matches("^\\d{2}$")); + } @Test