huanghongfa
2021-09-02 177249c76aeea0b4bf8d8816d4994e3b445b45ce
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActIntegralRuleServiceImpl.java
@@ -1,5 +1,12 @@
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;
@@ -10,13 +17,8 @@
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
@@ -25,11 +27,14 @@
 */
@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
@@ -39,22 +44,28 @@
    /**
     * 社区后台-根据社区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
@@ -166,7 +177,9 @@
    /**
     * 社区后台-编辑社区积分规则
     * @param integralRuleDTO   请求参数
     *
     * @param integralRuleDTO
     *            请求参数
     * @return  编辑结果
     */
    @Override