101captain
2022-02-25 531c234af5b9972738ffb0fb6aa2799740865144
三社功能,抽奖功能修改
8个文件已修改
1个文件已添加
125 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActSocialWorkerApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/civil/ComActSocialWorkerEditDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/PartyActivityStatics.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActSocialProjectApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActRaffleServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialProjectMemberServiceImpl.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialProjectServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActSocialWorkerMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComActSocialWorkerApi.java
@@ -4,6 +4,7 @@
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.listen.ComActSocialWorkerExcelListen;
import com.panzhihua.common.model.dtos.civil.*;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerDetailsVO;
import com.panzhihua.common.model.vos.civil.ComActSocialWorkerVO;
@@ -128,5 +129,10 @@
//    public R getTemplate(){
//        return R.ok(comactsocialworkerUrl);
//    }
    @ApiOperation("根据社工获取活动")
    @PostMapping("/activityList")
    R activityList(@RequestBody CommonPage commonPage){
        return communityService.activityList(commonPage);
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/civil/ComActSocialWorkerEditDTO.java
@@ -109,4 +109,6 @@
    @ApiModelProperty(value = "是否证件 0否 1是")
    private Integer credential;
    private Integer age;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/PartyActivityStatics.java
New file
@@ -0,0 +1,12 @@
package com.panzhihua.common.model.vos.community;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
 * @author zzj
 */
@Data
@ApiModel("")
public class PartyActivityStatics {
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActSocialProjectApi.java
@@ -42,6 +42,12 @@
    @ApiOperation(value = "分页查询接口",response =SocialProjectVO.class )
    @PostMapping("queryAll")
    public R selectAll(@RequestBody CommonPage commonPage) {
        if(this.getLoginUserInfo().getStreetId()!=null){
            commonPage.setStreetId(this.getLoginUserInfo().getStreetId());
        }
        else {
            commonPage.setCommunityId(this.getCommunityId());
        }
        return communityService.selectAllComActSocialProject(commonPage);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngVolunteerMngDAO.java
@@ -35,7 +35,7 @@
        + "create_at \n" + "FROM\n" + "com_mng_volunteer_mng \n"
        + " where state=2 and community_id=#{comMngVolunteerMngVO.communityId}"
        + "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != &quot;&quot;'>"
        + " and name like concat(#{comMngVolunteerMngVO.name},'%')  \n" + " </if> "
        + " and (name like concat(#{comMngVolunteerMngVO.name},'%') or phone like concat(#{comMngVolunteerMngVO.name},'%') )  \n" + " </if> "
        + "<if test='comMngVolunteerMngVO.phone != null and comMngVolunteerMngVO.phone.trim() != &quot;&quot;'>"
        + "AND phone like concat(#{comMngVolunteerMngVO.phone},'%') " + " </if> "
        + " order by integral desc,create_at desc" + "</script>")
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActRaffleServiceImpl.java
@@ -1,5 +1,7 @@
package com.panzhihua.service_community.service.impl;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,7 +17,9 @@
import com.panzhihua.service_community.entity.ComActRaffleRecord;
import com.panzhihua.service_community.service.ComActRaffleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -39,6 +43,8 @@
    private ComActRafflePrizeDao comActRafflePrizeDao;
    @Resource
    private ComActRaffleRecordDao comActRaffleRecordDao;
    @Resource
    private RabbitTemplate rabbitTemplate;
    @Override
    public R pageList(CommonPage commonPage) {
        return R.ok(this.baseMapper.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage));
@@ -53,6 +59,10 @@
        comActRaffle.setStatus(0);
        int count= this.baseMapper.insert(comActRaffle);
        if(count>0){
            rabbitTemplate.convertAndSend("raffle.exchange", "raffle.key", comActRaffleVO, message -> {
                message.getMessageProperties().setHeader("x-delay", dateToSecond(comActRaffle.getStartTime()));
                return message;
            });
            if(!CollectionUtils.isEmpty(comActRaffleVO.getComActRafflePrizeVOList())){
                comActRaffleVO.getComActRafflePrizeVOList().forEach(comActRafflePrizeVO -> {
                    ComActRafflePrize comActRafflePrize=new ComActRafflePrize();
@@ -125,4 +135,7 @@
        }
        return R.ok(comActRaffleVO);
    }
    private Long dateToSecond(Date expireTime){
        return DateUtil.between(new Date(),expireTime, DateUnit.MS);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialProjectMemberServiceImpl.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -20,6 +21,7 @@
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
 * 项目人员(ComActSocialProjectMember)表服务实现类
@@ -47,15 +49,18 @@
        if(comActSocialProjectMemberVO.getType()==1){
            ComActSocialWorker comActSocialWorker=comActSocialWorkerDao.selectById(comActSocialProjectMemberVO.getParamId());
            if(comActSocialWorker!=null){
                ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard()));
                comActSocialProjectMember.setImage(comActSocialWorker.getImage());
                comActSocialProjectMember.setName(comActSocialWorker.getName());
                comActSocialProjectMember.setPhone(comActSocialWorker.getTelephone());
                comActSocialProjectMember.setCreateTime(new Date());
                comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                return R.ok();
                List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comActSocialWorker.getTelephone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId()));
                if(CollectionUtils.isEmpty(list)){
                    ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                    BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                    comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard()));
                    comActSocialProjectMember.setImage(comActSocialWorker.getImage());
                    comActSocialProjectMember.setName(comActSocialWorker.getName());
                    comActSocialProjectMember.setPhone(comActSocialWorker.getTelephone());
                    comActSocialProjectMember.setCreateTime(new Date());
                    comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                    return R.ok();
                }
            }
        }
        else {
@@ -82,33 +87,39 @@
                if(comActSocialProjectMemberVO.getType()==1){
                    ComActSocialWorker comActSocialWorker=comActSocialWorkerDao.selectById(id);
                    if(comActSocialWorker!=null){
                        ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                        BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                        comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard()));
                        comActSocialProjectMember.setImage(comActSocialWorker.getImage());
                        comActSocialProjectMember.setName(comActSocialWorker.getName());
                        comActSocialProjectMember.setPhone(comActSocialWorker.getTelephone());
                        comActSocialProjectMember.setCreateTime(new Date());
                        comActSocialProjectMember.setType(1);
                        comActSocialProjectMember.setCommunityId(comActSocialProjectMemberVO.getCommunityId());
                        comActSocialProjectMember.setProjectId(comActSocialProjectMemberVO.getParamId());
                        comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                        List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comActSocialWorker.getTelephone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId()));
                        if(CollectionUtils.isEmpty(list)){
                            ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                            BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                            comActSocialProjectMember.setAge(getAge(comActSocialWorker.getIdCard()));
                            comActSocialProjectMember.setImage(comActSocialWorker.getImage());
                            comActSocialProjectMember.setName(comActSocialWorker.getName());
                            comActSocialProjectMember.setPhone(comActSocialWorker.getTelephone());
                            comActSocialProjectMember.setCreateTime(new Date());
                            comActSocialProjectMember.setType(1);
                            comActSocialProjectMember.setCommunityId(comActSocialProjectMemberVO.getCommunityId());
                            comActSocialProjectMember.setProjectId(comActSocialProjectMemberVO.getParamId());
                            comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                        }
                    }
                }
                else {
                    ComMngVolunteerMngDO comMngVolunteerMngDO=comMngVolunteerMngDAO.selectById(id);
                    if(comMngVolunteerMngDO!=null){
                        ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                        BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                        comActSocialProjectMember.setAge(comMngVolunteerMngDO.getAge());
                        comActSocialProjectMember.setImage(comMngVolunteerMngDO.getPhotoPath());
                        comActSocialProjectMember.setName(comMngVolunteerMngDO.getName());
                        comActSocialProjectMember.setPhone(comMngVolunteerMngDO.getPhone());
                        comActSocialProjectMember.setCreateTime(new Date());
                        comActSocialProjectMember.setType(2);
                        comActSocialProjectMember.setCommunityId(comActSocialProjectMemberVO.getCommunityId());
                        comActSocialProjectMember.setProjectId(comActSocialProjectMemberVO.getParamId());
                        comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                        List<ComActSocialProjectMember> list= comActSocialProjectMemberDao.selectList(new QueryWrapper<ComActSocialProjectMember>().lambda().eq(ComActSocialProjectMember::getPhone,comMngVolunteerMngDO.getPhone()).eq(ComActSocialProjectMember::getType,comActSocialProjectMemberVO.getType()).eq(ComActSocialProjectMember::getProjectId,comActSocialProjectMemberVO.getProjectId()));
                        if(CollectionUtils.isEmpty(list)){
                            ComActSocialProjectMember comActSocialProjectMember=new ComActSocialProjectMember();
                            BeanUtils.copyProperties(comActSocialProjectMemberVO,comActSocialProjectMember);
                            comActSocialProjectMember.setAge(comMngVolunteerMngDO.getAge());
                            comActSocialProjectMember.setImage(comMngVolunteerMngDO.getPhotoPath());
                            comActSocialProjectMember.setName(comMngVolunteerMngDO.getName());
                            comActSocialProjectMember.setPhone(comMngVolunteerMngDO.getPhone());
                            comActSocialProjectMember.setCreateTime(new Date());
                            comActSocialProjectMember.setType(2);
                            comActSocialProjectMember.setCommunityId(comActSocialProjectMemberVO.getCommunityId());
                            comActSocialProjectMember.setProjectId(comActSocialProjectMemberVO.getParamId());
                            comActSocialProjectMemberDao.insert(comActSocialProjectMember);
                        }
                    }
                }
            });
@@ -117,7 +128,7 @@
    }
    public Integer getAge(String idCard){
        Integer year=Integer.parseInt(idCard.substring(5,9));
        Integer year=Integer.parseInt(idCard.substring(6,10));
        Integer nowYear= DateUtils.getYear(new Date());
        return nowYear-year;
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialProjectServiceImpl.java
@@ -54,13 +54,13 @@
        }
        ProjectRelationVO projectRelationVO=new ProjectRelationVO();
        SocialProjectVO comActSocialProject=this.comActSocialProjectDao.selectByLevel(commonPage.getParamId());
        if(comActSocialProject.getLevel()==1){
        if(comActSocialProject.getLevel()==2){
            SocialProjectVO comActSocialProject1=this.comActSocialProjectDao.selectByLevel(comActSocialProject.getParentId());
            if(comActSocialProject1!=null){
                projectRelationVO.setFatherProjectLevelOne(comActSocialProject1);
            }
        }
        if(comActSocialProject.getLevel()==2){
        if(comActSocialProject.getLevel()==3){
            SocialProjectVO comActSocialProject1=this.comActSocialProjectDao.selectByLevel(comActSocialProject.getParentId());
            if(comActSocialProject1!=null){
                projectRelationVO.setFatherProjectLevelTwo(comActSocialProject1);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActSocialWorkerMapper.xml
@@ -35,8 +35,8 @@
            <if test="pageComActSocialWorkerDTO.socialOrgId!=null">
                AND a.social_org_id = #{pageComActSocialWorkerDTO.socialOrgId}
            </if>
            <if test="pageComActSocialWorkerDTO.name!=null">
                AND a.name = #{pageComActSocialWorkerDTO.name}
            <if test="pageComActSocialWorkerDTO.name!=null and pageComActSocialWorkerDTO.name!=''">
                AND a.name like concat('%',#{pageComActSocialWorkerDTO.name},'%')
            </if>
            <if test="pageComActSocialWorkerDTO.keyword!=null and pageComActSocialWorkerDTO.keyword!=''">
                AND (a.name like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') or  a.telephone like concat('%',#{pageComActSocialWorkerDTO.keyword},'%') )
@@ -66,6 +66,7 @@
                AND a.update_by = #{pageComActSocialWorkerDTO.updateBy}
            </if>
        </where>
        order by create_at desc
    </select>
    <select id="queryAll" resultType="com.panzhihua.common.model.dtos.civil.ComActSocialWorkerExcelVO">