From 6642ead22339679940b22ea86764ac9531d31e72 Mon Sep 17 00:00:00 2001 From: hy001 Date: Sun, 17 May 2026 13:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B4=BB=E5=8A=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/api/PropsActivityClientApi.java | 39 ------- .../PropsActivityRuleConfigParamCmd.java | 42 -------- .../PropsActivityRuleConfigQryCmd.java | 37 ------- .../cmd/material/PropsSourceRecordQryCmd.java | 59 ++++++---- .../dto/material/ActivityLuckyBoxDTO.java | 34 ------ .../material/PropsActivityRuleConfigDTO.java | 80 -------------- ...PropsActivityRuleConfigRestController.java | 56 ---------- .../PropsActivityRuleConfigServiceImpl.java | 102 ------------------ .../props/PropsActivityRuleConfigService.java | 26 ----- .../PropsActivityRuleConfigService.java | 19 ---- .../PropsActivityRuleConfigServiceImpl.java | 45 -------- .../activity/PropsActivityInnerConvertor.java | 7 -- .../activity/PropsActivityClientEndpoint.java | 36 ------- .../props/PropsActivityClientService.java | 31 ------ .../impl/PropsActivityClientServiceImpl.java | 47 -------- .../impl/PropsSourceClientServiceImpl.java | 24 +++-- 16 files changed, 56 insertions(+), 628 deletions(-) delete mode 100644 rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigParamCmd.java delete mode 100644 rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigQryCmd.java delete mode 100644 rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/ActivityLuckyBoxDTO.java delete mode 100644 rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/PropsActivityRuleConfigDTO.java delete mode 100644 rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/props/PropsActivityRuleConfigRestController.java delete mode 100644 rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigServiceImpl.java delete mode 100644 rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigService.java diff --git a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/activity/api/PropsActivityClientApi.java b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/activity/api/PropsActivityClientApi.java index ef244edb..2961ae9c 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/activity/api/PropsActivityClientApi.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-api/src/main/java/com/red/circle/other/inner/endpoint/activity/api/PropsActivityClientApi.java @@ -1,17 +1,13 @@ package com.red.circle.other.inner.endpoint.activity.api; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.dto.ResultResponse; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRuleDTO; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; import java.util.Collection; import java.util.List; import java.util.Map; @@ -178,39 +174,4 @@ public interface PropsActivityClientApi { @PostMapping("/mapRuleConfigByIds") ResultResponse> mapRuleConfigByIds( @RequestBody Collection ids); - - /** - * 分页-查询活动道具规则配置. - */ - @PostMapping("/pagePropsActivityRuleConfig") - ResultResponse> pagePropsActivityRuleConfig( - @RequestBody @Validated PropsActivityRuleConfigQryCmd query); - - - /** - * 删除-查询活动道具规则配置. - */ - @PostMapping("/propsActivityRuleConfigDeleteById") - ResultResponse propsActivityRuleConfigDeleteById(@RequestParam("id") Long id); - - /** - * 查询活动道具规则配置. - */ - @PostMapping("/getPropsActivityRuleConfig") - ResultResponse getPropsActivityRuleConfig( - @RequestBody @Validated PropsActivityRuleConfigParamCmd param); - - /** - * 修改-查询活动道具规则配置. - */ - @PostMapping("/updatePropsActivityRuleConfigById") - ResultResponse updatePropsActivityRuleConfigById( - @RequestBody @Validated PropsActivityRuleConfigParamCmd param); - - /** - * 保存-查询活动道具规则配置. - */ - @PostMapping("/savePropsActivityRuleConfig") - ResultResponse savePropsActivityRuleConfig( - @RequestBody @Validated PropsActivityRuleConfigParamCmd param); } diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigParamCmd.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigParamCmd.java deleted file mode 100644 index 8bbe2d00..00000000 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigParamCmd.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.red.circle.other.inner.model.cmd.material; - -import com.red.circle.framework.dto.Command; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - *

- * 活动道具规则配置. - *

- * - * @author pengshigang - * @since 2021-06-18 - */ -@Data -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class PropsActivityRuleConfigParamCmd extends Command { - - private static final long serialVersionUID = 1L; - - private Long id; - - @NotNull(message = "请选择平台") - private String sysOrigin; - - @NotBlank(message = "请选择活动类型") - private String activityType; - - private Long resourceGroupId; - - @NotBlank(message = "规则不能为空") - private String jsonData; - - private Integer sort; - - private String ruleDescription; - -} diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigQryCmd.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigQryCmd.java deleted file mode 100644 index 1028221f..00000000 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsActivityRuleConfigQryCmd.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.red.circle.other.inner.model.cmd.material; - -import com.red.circle.framework.core.dto.PageCommand; -import jakarta.validation.constraints.NotNull; -import java.io.Serial; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; - -/** - *

- * 活动道具规则配置. - *

- * - * @author pengshigang - * @since 2021-06-18 - */ -@Data -@NoArgsConstructor -@EqualsAndHashCode(callSuper = false) -public class PropsActivityRuleConfigQryCmd extends PageCommand { - - @Serial - private static final long serialVersionUID = 1L; - - private Long id; - - @NotNull(message = "请选择平台") - private String sysOrigin; - - private String activityType; - - private Long resourceGroupId; - - private String ruleDescription; - -} diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsSourceRecordQryCmd.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsSourceRecordQryCmd.java index 342732c0..d70751fc 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsSourceRecordQryCmd.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/material/PropsSourceRecordQryCmd.java @@ -1,9 +1,10 @@ package com.red.circle.other.inner.model.cmd.material; -import com.red.circle.framework.core.dto.PageCommand; -import java.io.Serial; -import lombok.Data; -import lombok.EqualsAndHashCode; +import com.red.circle.framework.core.dto.PageCommand; +import java.io.Serial; +import java.math.BigDecimal; +import lombok.Data; +import lombok.EqualsAndHashCode; /** *

@@ -30,19 +31,39 @@ public class PropsSourceRecordQryCmd extends PageCommand { */ private String sysOrigin; + /** + * 类型. + */ + private String type; + + /** + * 编号. + */ + private String code; + + /** + * 名称. + */ + private String name; + /** - * 类型. - */ - private String type; - - /** - * 名称. - */ - private String name; - - /** - * 0.未删除 1.已删除. - */ - private Boolean del; - -} + * 0.未删除 1.已删除. + */ + private Boolean del; + + /** + * 经理赠送权限. + */ + private Boolean adminFree; + + /** + * 最小底价. + */ + private BigDecimal amountMin; + + /** + * 最大底价. + */ + private BigDecimal amountMax; + +} diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/ActivityLuckyBoxDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/ActivityLuckyBoxDTO.java deleted file mode 100644 index 6c4fc723..00000000 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/ActivityLuckyBoxDTO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.red.circle.other.inner.model.dto.material; - -import java.io.Serializable; -import lombok.Data; -import lombok.experimental.Accessors; - -/** - *

- * 活动 LuckyBox. - *

- * - * @author pengshigang - * @since 2021-07-13 - */ -@Data -@Accessors(chain = true) -public class ActivityLuckyBoxDTO implements Serializable { - - /** - * 标识. - */ - private Integer id; - - /** - * 消耗糖果. - */ - private Integer quantity; - - /** - * 抽奖次数. - */ - private Integer opportunityNumber; - -} diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/PropsActivityRuleConfigDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/PropsActivityRuleConfigDTO.java deleted file mode 100644 index 2b051918..00000000 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/material/PropsActivityRuleConfigDTO.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.red.circle.other.inner.model.dto.material; - -import java.io.Serializable; -import java.sql.Timestamp; -import java.util.List; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - *

- * 活动道具规则配置. - *

- * - * @author pengshigang - * @since 2021-06-18 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -public class PropsActivityRuleConfigDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 主键标识. - */ - private Long id; - - /** - * 系统平台. - */ - private String sysOrigin; - - /** - * 活动类型. - */ - private String activityType; - - /** - * 活动类型. - */ - private String activityTypeName; - - /** - * 资源组ID. - */ - private Long resourceGroupId; - - /** - * 数据. - */ - private String jsonData; - - /** - * 排序. - */ - private Integer sort; - - /** - * 规则描述. - */ - private String ruleDescription; - - /** - * 奖励道具. - */ - private List activityRewards; - - /** - * 创建时间. - */ - private Timestamp createTime; - - /** - * 修改时间. - */ - private Timestamp updateTime; - -} diff --git a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/props/PropsActivityRuleConfigRestController.java b/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/props/PropsActivityRuleConfigRestController.java deleted file mode 100644 index d43e2c39..00000000 --- a/rc-service/rc-service-console/console-adapter/src/main/java/com/red/circle/console/adapter/app/props/PropsActivityRuleConfigRestController.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.red.circle.console.adapter.app.props; - -import com.red.circle.console.app.service.app.props.PropsActivityRuleConfigService; -import com.red.circle.console.infra.annotations.OpsOperationReqLog; -import com.red.circle.framework.dto.PageResult; -import com.red.circle.framework.web.controller.BaseController; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; -import lombok.RequiredArgsConstructor; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 活动道具规则配置. - * - * @author pengshigang - * @since 2021-06-18 - */ -@RequiredArgsConstructor -@RestController -@RequestMapping("/props/activity/rule/config") -public class PropsActivityRuleConfigRestController extends BaseController { - - private final PropsActivityRuleConfigService propsActivityRuleConfigService; - - /** - * 分页. - */ - @GetMapping("/page") - public PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd propsActivityRuleConfigQuery) { - return propsActivityRuleConfigService - .pagePropsActivityRuleConfig(propsActivityRuleConfigQuery); - } - - @OpsOperationReqLog(value = "保存-活动道具规则配置") - @PostMapping("/save-or-update") - public void saveOrUpdate( - @RequestBody @Validated PropsActivityRuleConfigParamCmd param) { - propsActivityRuleConfigService.saveOrUpdate(param); - } - - @OpsOperationReqLog(value = "删除活动道具规则配置") - @GetMapping("/del/{id}") - public void deleteById(@PathVariable("id") Long id) { - propsActivityRuleConfigService.deleteById(id); - } - - -} diff --git a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigServiceImpl.java b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigServiceImpl.java deleted file mode 100644 index 6498e12a..00000000 --- a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigServiceImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.red.circle.console.app.service.app.props; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.red.circle.console.app.common.sys.ActivitySourceGroupCommon; -import com.red.circle.console.inner.error.ConsoleErrorCode; -import com.red.circle.framework.core.asserts.ResponseAssert; -import com.red.circle.framework.dto.PageResult; -import com.red.circle.other.inner.endpoint.activity.PropsActivityClient; -import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; -import com.red.circle.other.inner.model.dto.material.ActivityLuckyBoxDTO; -import com.red.circle.other.inner.model.dto.material.PropsActivityRewardConfigInfoDTO; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; -import com.red.circle.tool.core.collection.CollectionUtils; -import com.red.circle.tool.core.json.JacksonUtils; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; - -/** - * 活动道具规则配置 - * - * @author zongpubin on 2023/10/24 - */ -@Service -@RequiredArgsConstructor -public class PropsActivityRuleConfigServiceImpl implements PropsActivityRuleConfigService { - - private final PropsActivityClient propsActivityClient; - - private final ActivitySourceGroupCommon activitySourceGroupCommon; - - @Override - public PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query) { - PageResult pageResult = ResponseAssert.requiredSuccess( - propsActivityClient.pagePropsActivityRuleConfig(query)); - - if (CollectionUtils.isEmpty(pageResult.getRecords())) { - return pageResult; - } - Map> propsActivityRewardMap = - activitySourceGroupCommon.mapSourceGroup(query.getSysOrigin(), - pageResult.getRecords().stream() - .map(PropsActivityRuleConfigDTO::getResourceGroupId).collect(Collectors.toSet())); - - return pageResult.convert(pageItem -> { - pageItem.setActivityRewards(propsActivityRewardMap.get(pageItem.getResourceGroupId())); - return pageItem; - }); - } - - @Override - public void saveOrUpdate(PropsActivityRuleConfigParamCmd param) { - - checkActivityLuckyBox(param); - - if (Objects.nonNull(param.getId())) { - - PropsActivityRuleConfigDTO ruleConfigDTO = ResponseAssert.requiredSuccess( - propsActivityClient.getPropsActivityRuleConfig(param)); - - ResponseAssert.isTrue(ConsoleErrorCode.BUSINESS_EXISTS, - Objects.isNull(ruleConfigDTO) || Objects.equals(ruleConfigDTO.getId(), param.getId())); - propsActivityClient.updatePropsActivityRuleConfigById(param); - return; - } - propsActivityClient.savePropsActivityRuleConfig(param); - } - - @Override - public void deleteById(Long id) { - propsActivityClient.propsActivityRuleConfigDeleteById(id); - } - - private void checkActivityLuckyBox(PropsActivityRuleConfigParamCmd param) { - if (!Objects.equals(PropsActivityTypeEnum.LUCKY_BOX.name(), param.getActivityType())) { - return; - } - List boxList = JacksonUtils.readValue(param.getJsonData(), - new TypeReference<>() { - }); - - ResponseAssert.isFalse(ConsoleErrorCode.DATE_INCOMPLETE_ERROR, - CollectionUtils.isEmpty(boxList)); - - for (ActivityLuckyBoxDTO boxDTO : boxList) { - if (Objects.isNull(boxDTO.getQuantity()) || Objects.isNull(boxDTO.getOpportunityNumber())) { - ResponseAssert.failure(ConsoleErrorCode.NUMBER_VIOLATION_ERROR); - break; - } - if (boxDTO.getQuantity() <= 0 || boxDTO.getOpportunityNumber() <= 0) { - ResponseAssert.failure(ConsoleErrorCode.NUMBER_VIOLATION_ERROR); - break; - } - } - } -} diff --git a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigService.java b/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigService.java deleted file mode 100644 index dd0155fd..00000000 --- a/rc-service/rc-service-console/console-client/src/main/java/com/red/circle/console/app/service/app/props/PropsActivityRuleConfigService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.red.circle.console.app.service.app.props; - - -import com.red.circle.framework.dto.PageResult; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; - -/** - *

- * 活动道具规则配置. - *

- * - * @author pengshigang - * @since 2021-06-18 - */ -public interface PropsActivityRuleConfigService { - - - PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query); - - void saveOrUpdate(PropsActivityRuleConfigParamCmd param); - - void deleteById(Long id); -} diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/PropsActivityRuleConfigService.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/PropsActivityRuleConfigService.java index b4ecff7a..6064ea7b 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/PropsActivityRuleConfigService.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/PropsActivityRuleConfigService.java @@ -1,12 +1,9 @@ package com.red.circle.other.infra.database.rds.service.activity; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.mybatis.service.BaseService; import com.red.circle.other.infra.database.rds.entity.activity.PropsActivityRuleConfig; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import java.util.Collection; import java.util.List; import java.util.Map; @@ -106,20 +103,4 @@ public interface PropsActivityRuleConfigService extends BaseService mapByIds(Collection ids); - - /** - * 删除活动道具规则配置 - */ - void deleteById(Long id); - - /** - * 查询活动道具规则配置 - */ - PropsActivityRuleConfig getPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param); - - /** - * 分页-查询活动道具规则配置 - */ - PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/PropsActivityRuleConfigServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/PropsActivityRuleConfigServiceImpl.java index 5935f1b4..179c979f 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/PropsActivityRuleConfigServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/activity/impl/PropsActivityRuleConfigServiceImpl.java @@ -2,21 +2,16 @@ package com.red.circle.other.infra.database.rds.service.activity.impl; import com.google.common.collect.Maps; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.mybatis.constant.PageConstant; import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl; import com.red.circle.other.infra.database.rds.dao.activity.PropsActivityRuleConfigDAO; import com.red.circle.other.infra.database.rds.entity.activity.PropsActivityRuleConfig; import com.red.circle.other.infra.database.rds.service.activity.PropsActivityRuleConfigService; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import com.red.circle.tool.core.collection.CollectionUtils; -import com.red.circle.tool.core.text.StringUtils; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; @@ -156,44 +151,4 @@ public class PropsActivityRuleConfigServiceImpl extends .orElse(Maps.newHashMap()); } - @Override - public void deleteById(Long id) { - update() - .set(PropsActivityRuleConfig::getDel, Boolean.TRUE) - .eq(PropsActivityRuleConfig::getId, id) - .execute(); - } - - @Override - public PropsActivityRuleConfig getPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param) { - return Optional.ofNullable(query() - .eq(PropsActivityRuleConfig::getActivityType, param.getActivityType()) - .eq(PropsActivityRuleConfig::getResourceGroupId, param.getResourceGroupId()) - .eq(PropsActivityRuleConfig::getSysOrigin, param.getSysOrigin()) - .eq(PropsActivityRuleConfig::getDel, Boolean.FALSE) - .last(PageConstant.LIMIT_ONE) - .getOne()) - .orElse(null); - } - - @Override - public PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query) { - return query() - .like(StringUtils.isNotBlank(query.getRuleDescription()), - PropsActivityRuleConfig::getRuleDescription, query.getRuleDescription()) - .eq(Objects.nonNull(query.getId()), PropsActivityRuleConfig::getId, query.getId()) - .eq(StringUtils.isNotBlank(query.getActivityType()), - PropsActivityRuleConfig::getActivityType, - query.getActivityType()) - .eq(StringUtils.isNotBlank(query.getSysOrigin()), PropsActivityRuleConfig::getSysOrigin, - query.getSysOrigin()) - .eq(Objects.nonNull(query.getResourceGroupId()), - PropsActivityRuleConfig::getResourceGroupId, - query.getResourceGroupId()) - .eq(PropsActivityRuleConfig::getDel, Boolean.FALSE) - .orderByDesc(PropsActivityRuleConfig::getId) - .page(query.getPageQuery()); - } - } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/activity/PropsActivityInnerConvertor.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/activity/PropsActivityInnerConvertor.java index 4526b5f7..508174cb 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/activity/PropsActivityInnerConvertor.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/convertor/activity/PropsActivityInnerConvertor.java @@ -2,10 +2,8 @@ package com.red.circle.other.app.inner.convertor.activity; import com.red.circle.framework.core.convertor.ConvertorModel; import com.red.circle.other.infra.database.rds.entity.activity.PropsActivityRuleConfig; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRuleDTO; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; import java.util.Map; import org.mapstruct.Mapper; @@ -19,9 +17,4 @@ public interface PropsActivityInnerConvertor { Map toActivityPropsRuleDTO( Map ruleConfig); - - PropsActivityRuleConfigDTO toPropsActivityRuleConfigDTO( - PropsActivityRuleConfig propsActivityRuleConfig); - - PropsActivityRuleConfig toPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param); } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/activity/PropsActivityClientEndpoint.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/activity/PropsActivityClientEndpoint.java index bc74c16f..abbce8b9 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/activity/PropsActivityClientEndpoint.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/endpoint/activity/PropsActivityClientEndpoint.java @@ -1,19 +1,15 @@ package com.red.circle.other.app.inner.endpoint.activity; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.framework.dto.ResultResponse; import com.red.circle.other.app.inner.service.material.props.PropsActivityClientService; import com.red.circle.other.inner.endpoint.activity.api.PropsActivityClientApi; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRuleDTO; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; import java.util.Collection; import java.util.List; import java.util.Map; @@ -126,36 +122,4 @@ public class PropsActivityClientEndpoint implements PropsActivityClientApi { public ResultResponse> mapRuleConfigByIds(Collection ids) { return ResultResponse.success(propsActivityClientService.mapRuleConfigByIds(ids)); } - - @Override - public ResultResponse> pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query) { - return ResultResponse.success(propsActivityClientService.pagePropsActivityRuleConfig(query)); - } - - - @Override - public ResultResponse propsActivityRuleConfigDeleteById(Long id) { - propsActivityClientService.propsActivityRuleConfigDeleteById(id); - return ResultResponse.success(); - } - - @Override - public ResultResponse getPropsActivityRuleConfig( - PropsActivityRuleConfigParamCmd param) { - return ResultResponse.success(propsActivityClientService.getPropsActivityRuleConfig(param)); - } - - @Override - public ResultResponse updatePropsActivityRuleConfigById( - PropsActivityRuleConfigParamCmd param) { - propsActivityClientService.updatePropsActivityRuleConfigById(param); - return ResultResponse.success(); - } - - @Override - public ResultResponse savePropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param) { - propsActivityClientService.savePropsActivityRuleConfig(param); - return ResultResponse.success(); - } } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/PropsActivityClientService.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/PropsActivityClientService.java index 4b1e5b62..91f0a829 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/PropsActivityClientService.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/PropsActivityClientService.java @@ -1,16 +1,12 @@ package com.red.circle.other.app.inner.service.material.props; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRuleDTO; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; import java.util.Collection; import java.util.List; import java.util.Map; @@ -136,31 +132,4 @@ public interface PropsActivityClientService { * 查询活动道具规则配置 */ Map mapRuleConfigByIds(Collection ids); - - /** - * 分页-查询活动道具规则配置. - */ - PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query); - - - /** - * 删除-查询活动道具规则配置. - */ - void propsActivityRuleConfigDeleteById(Long id); - - /** - * 查询活动道具规则配置. - */ - PropsActivityRuleConfigDTO getPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param); - - /** - * 修改-活动道具规则配置. - */ - void updatePropsActivityRuleConfigById(PropsActivityRuleConfigParamCmd param); - - /** - * 保存-活动道具规则配置. - */ - void savePropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param); } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsActivityClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsActivityClientServiceImpl.java index 5ced9695..03a69a49 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsActivityClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsActivityClientServiceImpl.java @@ -1,23 +1,18 @@ package com.red.circle.other.app.inner.service.material.props.impl; import com.red.circle.common.business.core.enums.SysOriginPlatformEnum; -import com.red.circle.framework.dto.PageResult; import com.red.circle.other.app.inner.convertor.activity.PropsActivityInnerConvertor; import com.red.circle.other.app.inner.service.material.props.PropsActivityClientService; import com.red.circle.other.domain.gateway.props.ActivitySourceGroupGateway; import com.red.circle.other.infra.common.activity.PropsActivitySendCommon; import com.red.circle.other.infra.common.activity.send.SendRewardGroup; -import com.red.circle.other.infra.database.rds.entity.activity.PropsActivityRuleConfig; import com.red.circle.other.infra.database.rds.service.activity.PropsActivityRuleConfigService; import com.red.circle.other.inner.enums.activity.PropsActivityTypeEnum; import com.red.circle.other.inner.model.cmd.activity.SendActivityRewardCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigParamCmd; -import com.red.circle.other.inner.model.cmd.material.PropsActivityRuleConfigQryCmd; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsGroup; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRule; import com.red.circle.other.inner.model.dto.activity.props.ActivityPropsRuleDTO; import com.red.circle.other.inner.model.dto.activity.props.ActivityResource; -import com.red.circle.other.inner.model.dto.material.PropsActivityRuleConfigDTO; import com.red.circle.tool.core.collection.CollectionUtils; import java.util.Collection; import java.util.List; @@ -139,46 +134,4 @@ public class PropsActivityClientServiceImpl implements PropsActivityClientServic return propsActivityInnerConvertor.toActivityPropsRuleDTO( propsActivityRuleConfigService.mapByIds(ids)); } - - @Override - public PageResult pagePropsActivityRuleConfig( - PropsActivityRuleConfigQryCmd query) { - - PageResult pageResult = propsActivityRuleConfigService.pagePropsActivityRuleConfig( - query); - - return pageResult.convert( - ruleConfig -> { - PropsActivityRuleConfigDTO ruleConfigDTO = propsActivityInnerConvertor.toPropsActivityRuleConfigDTO( - ruleConfig); - ruleConfigDTO.setActivityTypeName(ruleConfigDTO.getActivityType()); - return ruleConfigDTO; - }); - } - - @Override - public void propsActivityRuleConfigDeleteById(Long id) { - propsActivityRuleConfigService.deleteById(id); - } - - @Override - public PropsActivityRuleConfigDTO getPropsActivityRuleConfig( - PropsActivityRuleConfigParamCmd param) { - - return propsActivityInnerConvertor.toPropsActivityRuleConfigDTO( - propsActivityRuleConfigService.getPropsActivityRuleConfig( - param)); - } - - @Override - public void updatePropsActivityRuleConfigById(PropsActivityRuleConfigParamCmd param) { - propsActivityRuleConfigService.updateSelectiveById( - propsActivityInnerConvertor.toPropsActivityRuleConfig(param)); - } - - @Override - public void savePropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param) { - propsActivityRuleConfigService.save( - propsActivityInnerConvertor.toPropsActivityRuleConfig(param)); - } } diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsSourceClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsSourceClientServiceImpl.java index ac2370d6..77c8ab0f 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsSourceClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/material/props/impl/PropsSourceClientServiceImpl.java @@ -125,14 +125,22 @@ public class PropsSourceClientServiceImpl implements PropsSourceClientService { return propsResourcesInnerConvertor.toPagePropsResourcesDTO( propsSourceRecordService.query() .eq(PropsSourceRecord::getSysOrigin, qryCmd.getSysOrigin()) - .eq(Objects.nonNull(qryCmd.getType()), PropsSourceRecord::getType, - qryCmd.getType()) - .eq(Objects.nonNull(qryCmd.getId()), PropsSourceRecord::getId, - qryCmd.getId()) - .eq(Objects.nonNull(qryCmd.getDel()), PropsSourceRecord::getDel, - qryCmd.getDel()) - .like(StringUtils.isNotBlank(qryCmd.getName()), PropsSourceRecord::getName, - qryCmd.getName()) + .eq(Objects.nonNull(qryCmd.getType()), PropsSourceRecord::getType, + qryCmd.getType()) + .eq(Objects.nonNull(qryCmd.getId()), PropsSourceRecord::getId, + qryCmd.getId()) + .like(StringUtils.isNotBlank(qryCmd.getCode()), PropsSourceRecord::getCode, + qryCmd.getCode()) + .eq(Objects.nonNull(qryCmd.getDel()), PropsSourceRecord::getDel, + qryCmd.getDel()) + .eq(Objects.nonNull(qryCmd.getAdminFree()), PropsSourceRecord::getAdminFree, + qryCmd.getAdminFree()) + .ge(Objects.nonNull(qryCmd.getAmountMin()), PropsSourceRecord::getAmount, + qryCmd.getAmountMin()) + .le(Objects.nonNull(qryCmd.getAmountMax()), PropsSourceRecord::getAmount, + qryCmd.getAmountMax()) + .like(StringUtils.isNotBlank(qryCmd.getName()), PropsSourceRecord::getName, + qryCmd.getName()) .orderByDesc(PropsSourceRecord::getCreateTime) .page(qryCmd.getPageQuery()) );