| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.panzhihua.service_community.dao.ComActIntegralRuleMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActIntegralRuleDO; |
| | | import com.panzhihua.service_community.service.ComActIntegralRuleService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActIntegralRuleServiceImpl extends ServiceImpl<ComActIntegralRuleMapper, ComActIntegralRuleDO> implements ComActIntegralRuleService { |
| | | public class ComActIntegralRuleServiceImpl extends ServiceImpl<ComActIntegralRuleMapper, ComActIntegralRuleDO> |
| | | implements ComActIntegralRuleService { |
| | | |
| | | /** |
| | | * 查询社区下积分任务列表 |
| | | * @param communityId 社区id |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 查询社区下积分任务列表 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 社区后台-根据社区id查询社区下积分规则列表 |
| | | * @param integralRuleDTO 请求参数 |
| | | * |
| | | * @param integralRuleDTO |
| | | * 请求参数 |
| | | * @return 社区下积分规则列表 |
| | | */ |
| | | @Override |
| | | public R getIntegralRuleAdminList(PageComActIntegralRuleDTO integralRuleDTO){ |
| | | Integer count = this.baseMapper.selectCount(new QueryWrapper<ComActIntegralRuleDO>().lambda().eq(ComActIntegralRuleDO::getCommunityId,integralRuleDTO.getCommunityId())); |
| | | Integer count = this.baseMapper.selectCount(new QueryWrapper<ComActIntegralRuleDO>().lambda() |
| | | .eq(ComActIntegralRuleDO::getCommunityId, integralRuleDTO.getCommunityId())); |
| | | if(count == null || count <= 0){ |
| | | List<ComActIntegralRuleDO> integralRuleList = getIntegralRuleList(integralRuleDTO.getCommunityId()); |
| | | this.saveBatch(integralRuleList); |
| | | } |
| | | return R.ok(this.baseMapper.getIntegralRuleAdminList(new Page(integralRuleDTO.getPageNum(),integralRuleDTO.getPageSize()),integralRuleDTO)); |
| | | return R.ok(this.baseMapper.getIntegralRuleAdminList( |
| | | new Page(integralRuleDTO.getPageNum(), integralRuleDTO.getPageSize()), integralRuleDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 加载默认社区积分规则列表 |
| | | * @param communityId 社区id |
| | | * |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 默认积分规则列表 |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 社区后台-编辑社区积分规则 |
| | | * @param integralRuleDTO 请求参数 |
| | | * |
| | | * @param integralRuleDTO |
| | | * 请求参数 |
| | | * @return 编辑结果 |
| | | */ |
| | | @Override |