去掉活动配置
This commit is contained in:
parent
3fc5d4a4ff
commit
6642ead223
@ -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<Map<Long, ActivityPropsRuleDTO>> mapRuleConfigByIds(
|
||||
@RequestBody Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 分页-查询活动道具规则配置.
|
||||
*/
|
||||
@PostMapping("/pagePropsActivityRuleConfig")
|
||||
ResultResponse<PageResult<PropsActivityRuleConfigDTO>> pagePropsActivityRuleConfig(
|
||||
@RequestBody @Validated PropsActivityRuleConfigQryCmd query);
|
||||
|
||||
|
||||
/**
|
||||
* 删除-查询活动道具规则配置.
|
||||
*/
|
||||
@PostMapping("/propsActivityRuleConfigDeleteById")
|
||||
ResultResponse<Void> propsActivityRuleConfigDeleteById(@RequestParam("id") Long id);
|
||||
|
||||
/**
|
||||
* 查询活动道具规则配置.
|
||||
*/
|
||||
@PostMapping("/getPropsActivityRuleConfig")
|
||||
ResultResponse<PropsActivityRuleConfigDTO> getPropsActivityRuleConfig(
|
||||
@RequestBody @Validated PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
/**
|
||||
* 修改-查询活动道具规则配置.
|
||||
*/
|
||||
@PostMapping("/updatePropsActivityRuleConfigById")
|
||||
ResultResponse<Void> updatePropsActivityRuleConfigById(
|
||||
@RequestBody @Validated PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
/**
|
||||
* 保存-查询活动道具规则配置.
|
||||
*/
|
||||
@PostMapping("/savePropsActivityRuleConfig")
|
||||
ResultResponse<Void> savePropsActivityRuleConfig(
|
||||
@RequestBody @Validated PropsActivityRuleConfigParamCmd param);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动道具规则配置.
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动道具规则配置.
|
||||
* </p>
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -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;
|
||||
|
||||
}
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
package com.red.circle.other.inner.model.dto.material;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动 LuckyBox.
|
||||
* </p>
|
||||
*
|
||||
* @author pengshigang
|
||||
* @since 2021-07-13
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ActivityLuckyBoxDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 标识.
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 消耗糖果.
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 抽奖次数.
|
||||
*/
|
||||
private Integer opportunityNumber;
|
||||
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动道具规则配置.
|
||||
* </p>
|
||||
*
|
||||
* @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<PropsActivityRewardConfigInfoDTO> activityRewards;
|
||||
|
||||
/**
|
||||
* 创建时间.
|
||||
*/
|
||||
private Timestamp createTime;
|
||||
|
||||
/**
|
||||
* 修改时间.
|
||||
*/
|
||||
private Timestamp updateTime;
|
||||
|
||||
}
|
||||
@ -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<PropsActivityRuleConfigDTO> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -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<PropsActivityRuleConfigDTO> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query) {
|
||||
PageResult<PropsActivityRuleConfigDTO> pageResult = ResponseAssert.requiredSuccess(
|
||||
propsActivityClient.pagePropsActivityRuleConfig(query));
|
||||
|
||||
if (CollectionUtils.isEmpty(pageResult.getRecords())) {
|
||||
return pageResult;
|
||||
}
|
||||
Map<Long, List<PropsActivityRewardConfigInfoDTO>> 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<ActivityLuckyBoxDTO> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动道具规则配置.
|
||||
* </p>
|
||||
*
|
||||
* @author pengshigang
|
||||
* @since 2021-06-18
|
||||
*/
|
||||
public interface PropsActivityRuleConfigService {
|
||||
|
||||
|
||||
PageResult<PropsActivityRuleConfigDTO> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query);
|
||||
|
||||
void saveOrUpdate(PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
void deleteById(Long id);
|
||||
}
|
||||
@ -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<PropsActivit
|
||||
* 查询活动道具规则配置
|
||||
*/
|
||||
Map<Long, PropsActivityRuleConfig> mapByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 删除活动道具规则配置
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活动道具规则配置
|
||||
*/
|
||||
PropsActivityRuleConfig getPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
/**
|
||||
* 分页-查询活动道具规则配置
|
||||
*/
|
||||
PageResult<PropsActivityRuleConfig> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query);
|
||||
}
|
||||
|
||||
@ -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<PropsActivityRuleConfig> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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<Long, ActivityPropsRuleDTO> toActivityPropsRuleDTO(
|
||||
Map<Long, PropsActivityRuleConfig> ruleConfig);
|
||||
|
||||
PropsActivityRuleConfigDTO toPropsActivityRuleConfigDTO(
|
||||
PropsActivityRuleConfig propsActivityRuleConfig);
|
||||
|
||||
PropsActivityRuleConfig toPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param);
|
||||
}
|
||||
|
||||
@ -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<Map<Long, ActivityPropsRuleDTO>> mapRuleConfigByIds(Collection<Long> ids) {
|
||||
return ResultResponse.success(propsActivityClientService.mapRuleConfigByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<PageResult<PropsActivityRuleConfigDTO>> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query) {
|
||||
return ResultResponse.success(propsActivityClientService.pagePropsActivityRuleConfig(query));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> propsActivityRuleConfigDeleteById(Long id) {
|
||||
propsActivityClientService.propsActivityRuleConfigDeleteById(id);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<PropsActivityRuleConfigDTO> getPropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigParamCmd param) {
|
||||
return ResultResponse.success(propsActivityClientService.getPropsActivityRuleConfig(param));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> updatePropsActivityRuleConfigById(
|
||||
PropsActivityRuleConfigParamCmd param) {
|
||||
propsActivityClientService.updatePropsActivityRuleConfigById(param);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultResponse<Void> savePropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param) {
|
||||
propsActivityClientService.savePropsActivityRuleConfig(param);
|
||||
return ResultResponse.success();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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<Long, ActivityPropsRuleDTO> mapRuleConfigByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 分页-查询活动道具规则配置.
|
||||
*/
|
||||
PageResult<PropsActivityRuleConfigDTO> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query);
|
||||
|
||||
|
||||
/**
|
||||
* 删除-查询活动道具规则配置.
|
||||
*/
|
||||
void propsActivityRuleConfigDeleteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询活动道具规则配置.
|
||||
*/
|
||||
PropsActivityRuleConfigDTO getPropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
/**
|
||||
* 修改-活动道具规则配置.
|
||||
*/
|
||||
void updatePropsActivityRuleConfigById(PropsActivityRuleConfigParamCmd param);
|
||||
|
||||
/**
|
||||
* 保存-活动道具规则配置.
|
||||
*/
|
||||
void savePropsActivityRuleConfig(PropsActivityRuleConfigParamCmd param);
|
||||
}
|
||||
|
||||
@ -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<PropsActivityRuleConfigDTO> pagePropsActivityRuleConfig(
|
||||
PropsActivityRuleConfigQryCmd query) {
|
||||
|
||||
PageResult<PropsActivityRuleConfig> 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));
|
||||
}
|
||||
}
|
||||
|
||||
@ -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())
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user