From ce4a770744d7a0b4e4ea3b5101556b94e72bdf1c Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期二, 14 十一月 2023 17:49:20 +0800
Subject: [PATCH] 修改打卡

---
 springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java |  302 +++++++++++++++++++++++++++++---------------------
 1 files changed, 174 insertions(+), 128 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java
index 67dffb0..185499d 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComBpActivityServiceImpl.java
@@ -1,5 +1,18 @@
 package com.panzhihua.service_dangjian.service.impl;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.apache.http.client.utils.DateUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -20,18 +33,10 @@
 import com.panzhihua.service_dangjian.model.dos.ComPbActivityMemberDO;
 import com.panzhihua.service_dangjian.model.dos.ComPbMemberDO;
 import com.panzhihua.service_dangjian.service.ComBpActivityService;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.http.client.utils.DateUtils;
-import org.springframework.beans.BeanUtils;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.ObjectUtils;
 
-import javax.annotation.Resource;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
+import lombok.extern.slf4j.Slf4j;
+
+import static java.util.Objects.nonNull;
 
 /**
  * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -49,23 +54,31 @@
     @Resource
     private ComPbMemberDAO comPbMemberDAO;
 
+    public static void main(String[] args) {
+        DateFormat formatTo = new SimpleDateFormat("M月d ahh:mm");
+        String format = formatTo.format(new Date());
+        System.out.println(format);
+    }
 
     /**
      * 查询某个党员加入的所有党员活动
      *
-     * @param partyBuildingActivityVO 查询参数
+     * @param partyBuildingActivityVO
+     *            查询参数
      * @return 活动集合
      */
     @Override
     public R listPartyMemberActivities(PartyBuildingActivityVO partyBuildingActivityVO) {
-        List<PartyBuildingActivityVO> partyBuildingActivityVOS = comBpActivityDAO.listPartyMemberActivities(partyBuildingActivityVO);
+        List<PartyBuildingActivityVO> partyBuildingActivityVOS =
+            comBpActivityDAO.listPartyMemberActivities(partyBuildingActivityVO);
         return R.ok(partyBuildingActivityVOS);
     }
 
     /**
      * 活动报名名单分页查询
      *
-     * @param pageActivityMembersVO 查询参数 手机号 名字
+     * @param pageActivityMembersVO
+     *            查询参数 手机号 名字
      * @return 分页数据
      */
     @Override
@@ -83,57 +96,62 @@
         page.setSize(pageSize);
         page.setCurrent(pageNum);
         IPage<PageActivityMembersVO> iPage = comPbActivityMemberDAO.pageActivityMembers(page, pageActivityMembersVO);
-        iPage.getRecords().forEach(record->{
+        iPage.getRecords().forEach(record -> {
             record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone()));
         });
-        Map<String,Object> map=new HashMap<>(3);
+        Map<String, Object> map = new HashMap<>(3);
         ComPbActivityDO comPbActivityDO = comBpActivityDAO.selectById(activityId);
-        map.put("page",iPage);
-        map.put("name",comPbActivityDO.getName());
-        map.put("createAt",DateUtils.formatDate(comPbActivityDO.getCreateAt(),"yyyy-MM-dd HH:mm:ss"));
+        map.put("page", iPage);
+        map.put("name", comPbActivityDO.getName());
+        map.put("createAt", DateUtils.formatDate(comPbActivityDO.getCreateAt(), "yyyy-MM-dd HH:mm:ss"));
         return R.ok(map);
     }
 
     /**
      * 党员活动详情
      *
-     * @param id 活动id
+     * @param id
+     *            活动id
      * @return 活动详情内容
      */
     @Override
-    public R activityinfo(Long id,Long userId) {
+    public R activityinfo(Long id, Long userId) {
         ComPbActivityDO comPbActivityDO = comBpActivityDAO.selectById(id);
         if (ObjectUtils.isEmpty(comPbActivityDO)) {
             return R.fail("活动不存在");
         }
-        LoginUserInfoVO loginUserInfoVO=comBpActivityDAO.selectUserInfoByUserId(comPbActivityDO.getCreateBy());
+        LoginUserInfoVO loginUserInfoVO = comBpActivityDAO.selectUserInfoByUserId(comPbActivityDO.getCreateBy());
         Integer type = loginUserInfoVO.getType();
-        int isPerson=0;
-        if (type.intValue()==1) {
-            isPerson=1;
+        int isPerson = 0;
+        if (type.intValue() == 1) {
+            isPerson = 1;
         }
         PartyBuildingActivityVO partyBuildingActivityVO = new PartyBuildingActivityVO();
         BeanUtils.copyProperties(comPbActivityDO, partyBuildingActivityVO);
 
         List<PartyBuildingMemberVO> partyBuildingMemberVOS = new ArrayList<>();
-        List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getActivityId, id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
+        List<ComPbActivityMemberDO> comPbActivityMemberDOS =
+            comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda()
+                .eq(ComPbActivityMemberDO::getActivityId, id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
         if (!ObjectUtils.isEmpty(comPbActivityMemberDOS)) {
             int size = comPbActivityMemberDOS.size();
-            if (size>=6) {
-                comPbActivityMemberDOS = comPbActivityMemberDOS.subList(0,6);
+            if (size >= 6) {
+                comPbActivityMemberDOS = comPbActivityMemberDOS.subList(0, 6);
             }
-            comPbActivityMemberDOS.forEach(member->{
+            comPbActivityMemberDOS.forEach(member -> {
                 PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO();
                 BeanUtils.copyProperties(member, partyBuildingMemberVO);
                 partyBuildingMemberVO.setCreateAt(member.getCreateAt());
                 partyBuildingMemberVOS.add(partyBuildingMemberVO);
             });
             partyBuildingActivityVO.setParticipationActualNum(comPbActivityMemberDOS.size());
-        }else{
+        } else {
             partyBuildingActivityVO.setParticipationActualNum(0);
         }
-        //List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getActivityId, id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
-       /* List<PartyBuildingMemberVO> partyBuildingMemberVOS = new ArrayList<>();
+        // List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(new
+        // QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getActivityId,
+        // id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
+        /* List<PartyBuildingMemberVO> partyBuildingMemberVOS = new ArrayList<>();
         if (!ObjectUtils.isEmpty(comPbActivityMemberDOS)) {
             List<Long> collect = comPbActivityMemberDOS.stream().map(ComPbActivityMemberDO::getMemberId).collect(Collectors.toList());
             int size = collect.size();
@@ -150,7 +168,7 @@
         } else {
             partyBuildingActivityVO.setParticipationActualNum(0);
         }*/
-        ComPbActivityMemberDO comPbActivityMemberDO=comPbActivityMemberDAO.selectByUserIdActivityId(id,userId);
+        ComPbActivityMemberDO comPbActivityMemberDO = comPbActivityMemberDAO.selectByUserIdActivityId(id, userId);
         if (ObjectUtils.isEmpty(comPbActivityMemberDO)) {
             partyBuildingActivityVO.setIsSign(0);
         } else {
@@ -160,18 +178,21 @@
         partyBuildingActivityVO.setIsPerson(isPerson);
         partyBuildingActivityVO.setCreateByName(loginUserInfoVO.getName());
 
-        //查询社区名称
-        if(partyBuildingActivityVO.getCommunityId() != null){
-            partyBuildingActivityVO.setCommunityName(comBpActivityDAO.selectCommunityNameByCommunityId(partyBuildingActivityVO.getCommunityId()));
+        // 查询社区名称
+        if (partyBuildingActivityVO.getCommunityId() != null) {
+            partyBuildingActivityVO.setCommunityName(
+                comBpActivityDAO.selectCommunityNameByCommunityId(partyBuildingActivityVO.getCommunityId()));
         }
 
+        partyBuildingActivityVO.setCodeType(2);
         return R.ok(partyBuildingActivityVO);
     }
 
     /**
      * 新增党员活动
      *
-     * @param partyBuildingActivityVO 参数
+     * @param partyBuildingActivityVO
+     *            参数
      * @return 新增结果
      */
     @Override
@@ -183,8 +204,8 @@
         comPbActivityDO.setCreateAt(now);
 
         Integer status = partyBuildingActivityVO.getStatus();
-        if(status!=null && status.intValue()==2) {//点击'保存并发布' 按钮
-            //默认设置为“进行中”
+        if (status != null && status.intValue() == 2) {// 点击'保存并发布' 按钮
+            // 默认设置为“进行中”
             comPbActivityDO.setStatus(4);
         }
 
@@ -198,7 +219,8 @@
     /**
      * 编辑党员活动
      *
-     * @param partyBuildingActivityVO 编辑内容
+     * @param partyBuildingActivityVO
+     *            编辑内容
      * @return 编辑结果
      */
     @Override
@@ -215,7 +237,8 @@
     /**
      * 发布党员活动
      *
-     * @param id 主键id
+     * @param id
+     *            主键id
      * @return 发布结果
      */
     @Override
@@ -234,7 +257,8 @@
     /**
      * 删除党员活动
      *
-     * @param id 主键id
+     * @param id
+     *            主键id
      * @return 删除结果
      */
     @Override
@@ -249,7 +273,8 @@
     /**
      * 分页查询党员活动
      *
-     * @param partyBuildingActivityVO 查询条件
+     * @param partyBuildingActivityVO
+     *            查询条件
      * @return 查询结果
      */
     @Override
@@ -276,12 +301,12 @@
                 if (!ObjectUtils.isEmpty(activityTimeBegin)) {
                     partyBuildingActivityVO1.setActivityTimeBeginFormat(formatTo.format(activityTimeBegin));
                 }
-                if(status.intValue()==3){
+                if (status.intValue() == 3) {
                     partyBuildingActivityVO1.setStatus(4);
                 }
-                if(!ObjectUtils.isEmpty(createByName)&&createByName.equals("管理员")){
+                if (!ObjectUtils.isEmpty(createByName) && createByName.equals("管理员")) {
                     partyBuildingActivityVO1.setIsPerson(0);
-                }else{
+                } else {
                     partyBuildingActivityVO1.setIsPerson(1);
                 }
             });
@@ -292,7 +317,8 @@
     /**
      * 取消活动
      *
-     * @param partyBuildingActivityVO 取消原因
+     * @param partyBuildingActivityVO
+     *            取消原因
      * @return 操作结果
      */
     @Override
@@ -311,62 +337,77 @@
     /**
      * 用户的所有党建活动
      *
-     * @param userId 用户id
-     * @param communityId 社区id
+     * @param userId
+     *            用户id
+     * @param communityId
+     *            社区id
+     * @param status
      * @return 党建活动列表
      */
     @Override
-    public R listActivity(Long userId, Long communityId) {
+    public R listActivity(Long userId, Long communityId, Integer status) {
         List<ComActActivityVO> comActActivityVOS = new ArrayList<>();
         /*Long memberId=comPbActivityMemberDAO.selectMemberIdByUserId(userId,communityId);
         if (ObjectUtils.isEmpty(memberId)) {
             return R.fail();
         }*/
-        List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getUserId, userId));
+        List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(
+            new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getUserId, userId));
         if (ObjectUtils.isEmpty(comPbActivityMemberDOS)) {
             return R.fail();
         }
-        List<Long> collect = comPbActivityMemberDOS.stream().map(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId()).collect(Collectors.toList());
+        List<Long> collect = comPbActivityMemberDOS.stream()
+            .map(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId()).collect(Collectors.toList());
         List<ComPbActivityDO> comPbActivityDOS = comBpActivityDAO.selectBatchIds(collect);
-
-        comPbActivityDOS.forEach(comPbActivityDO -> {
-            ComActActivityVO comActActivityVO = new ComActActivityVO();
-            Long createBy = comPbActivityDO.getCreateBy();
-            LoginUserInfoVO loginUserInfoVO=comPbActivityMemberDAO.selectUserInfo(createBy);
-            Integer type = loginUserInfoVO.getType();
-            if (type==1) {
-                comActActivityVO.setIsPerson(1);
-            }else{
-                comActActivityVO.setIsPerson(0);
-            }
-            Integer status = comPbActivityDO.getStatus();
-            if (status.intValue()==3) {
-                status=4;
-            }
-            comActActivityVO.setType(3);
-            comActActivityVO.setId(comPbActivityDO.getId());
-            comActActivityVO.setStatus(status);
-            comActActivityVO.setActivityName(comPbActivityDO.getName());
-            comActActivityVO.setCover(comPbActivityDO.getCover());
-            comActActivityVO.setBeginAt(comPbActivityDO.getActivityTimeBegin());
-            comActActivityVO.setSingDate(comPbActivityMemberDOS.stream().filter(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId().equals(comActActivityVO.getId())).collect(Collectors.toList()).get(0).getCreateAt());
-            comActActivityVOS.add(comActActivityVO);
-        });
+        if (nonNull(status)) {
+            comPbActivityDOS = comPbActivityDOS.stream()
+                    .filter(activityDO -> activityDO.getStatus().equals(status)).collect(Collectors.toList());
+        }
+        if (!comPbActivityDOS.isEmpty()) {
+            comPbActivityDOS.forEach(comPbActivityDO -> {
+                ComActActivityVO comActActivityVO = new ComActActivityVO();
+                Long createBy = comPbActivityDO.getCreateBy();
+                LoginUserInfoVO loginUserInfoVO = comPbActivityMemberDAO.selectUserInfo(createBy);
+                Integer type = loginUserInfoVO.getType();
+                if (type == 1) {
+                    comActActivityVO.setIsPerson(1);
+                } else {
+                    comActActivityVO.setIsPerson(0);
+                }
+                Integer activityStatus = comPbActivityDO.getStatus();
+                if (activityStatus.intValue() == 3) {
+                    activityStatus = 4;
+                }
+                comActActivityVO.setType(3);
+                comActActivityVO.setId(comPbActivityDO.getId());
+                comActActivityVO.setStatus(activityStatus);
+                comActActivityVO.setActivityName(comPbActivityDO.getName());
+                comActActivityVO.setCover(comPbActivityDO.getCover());
+                comActActivityVO.setBeginAt(comPbActivityDO.getActivityTimeBegin());
+                comActActivityVO.setSingDate(comPbActivityMemberDOS.stream()
+                        .filter(comPbActivityMemberDO -> comPbActivityMemberDO.getActivityId().equals(comActActivityVO.getId()))
+                        .collect(Collectors.toList()).get(0).getCreateAt());
+                comActActivityVOS.add(comActActivityVO);
+            });
+        }
         return R.ok(comActActivityVOS);
     }
 
     /**
      * 党员活动人员参入列表
      *
-     * @param id 活动id
+     * @param id
+     *            活动id
      * @return 党员集合
      */
     @Override
     public R listPartyBuildingMember(Long id) {
         List<PartyBuildingMemberVO> partyBuildingMemberVOS = new ArrayList<>();
-        List<ComPbActivityMemberDO> comPbActivityMemberDOS = comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getActivityId, id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
+        List<ComPbActivityMemberDO> comPbActivityMemberDOS =
+            comPbActivityMemberDAO.selectList(new QueryWrapper<ComPbActivityMemberDO>().lambda()
+                .eq(ComPbActivityMemberDO::getActivityId, id).orderByDesc(ComPbActivityMemberDO::getCreateAt));
         if (!ObjectUtils.isEmpty(comPbActivityMemberDOS)) {
-            comPbActivityMemberDOS.forEach(member->{
+            comPbActivityMemberDOS.forEach(member -> {
                 PartyBuildingMemberVO partyBuildingMemberVO = new PartyBuildingMemberVO();
                 BeanUtils.copyProperties(member, partyBuildingMemberVO);
                 partyBuildingMemberVO.setCreateAt(member.getCreateAt());
@@ -390,51 +431,55 @@
     /**
      * 报名、取消报名党员活动
      *
-     * @param activitySignUpDTO 操作参数
+     * @param activitySignUpDTO
+     *            操作参数
      * @return 操作结果
      */
     @Override
     public R putActivitySignUp(ActivitySignUpDTO activitySignUpDTO) {
-        Long id=activitySignUpDTO.getId();
-        Long userId=activitySignUpDTO.getUserId();
+        Long id = activitySignUpDTO.getId();
+        Long userId = activitySignUpDTO.getUserId();
         ComPbActivityDO comPbActivityDO = comBpActivityDAO.selectById(id);
         if (ObjectUtils.isEmpty(comPbActivityDO)) {
             return R.fail("活动不存在");
         }
-        ComPbMemberDO comPbMemberDO=comPbMemberDAO.selectByUserId(userId);
+        ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectByUserId(userId);
         if (ObjectUtils.isEmpty(comPbMemberDO)) {
             return R.fail("您不是党员");
         }
-        Integer type=activitySignUpDTO.getType();
-        ComPbActivityMemberDO comPbActivityMemberDO = comPbActivityMemberDAO.selectOne(new QueryWrapper<ComPbActivityMemberDO>().lambda().eq(ComPbActivityMemberDO::getMemberId, comPbMemberDO.getId()).eq(ComPbActivityMemberDO::getActivityId, id));
+        Integer type = activitySignUpDTO.getType();
+        ComPbActivityMemberDO comPbActivityMemberDO =
+            comPbActivityMemberDAO.selectOne(new QueryWrapper<ComPbActivityMemberDO>().lambda()
+                .eq(ComPbActivityMemberDO::getMemberId, comPbMemberDO.getId())
+                .eq(ComPbActivityMemberDO::getActivityId, id));
         boolean empty = ObjectUtils.isEmpty(comPbActivityMemberDO);
-        int mum=0;
-        if (type.intValue()==1) {
+        int mum = 0;
+        if (type.intValue() == 1) {
             if (empty) {
-                ComPbActivityMemberDO comPbActivityMemberDO1=new ComPbActivityMemberDO();
+                ComPbActivityMemberDO comPbActivityMemberDO1 = new ComPbActivityMemberDO();
                 comPbActivityMemberDO1.setActivityId(id);
                 comPbActivityMemberDO1.setMemberId(comPbMemberDO.getId());
                 comPbActivityMemberDO1.setUserId(userId);
-                //添加参加活动的党员快照信息,防止党员信息删除后无法显示
+                // 添加参加活动的党员快照信息,防止党员信息删除后无法显示
                 comPbActivityMemberDO1.setName(comPbMemberDO.getName());
                 comPbActivityMemberDO1.setPhotoPath(comPbMemberDO.getPhotoPath());
                 comPbActivityMemberDO1.setCreateAt(new Date());
-                mum=comPbActivityMemberDAO.insert(comPbActivityMemberDO1);
+                mum = comPbActivityMemberDAO.insert(comPbActivityMemberDO1);
             } else {
-                return R.ok(null,"已经加入了");
+                return R.ok(null, "已经加入了");
             }
-        }else{
+        } else {
             if (empty) {
-                return R.ok(null,"已经取消");
-            }else{
+                return R.ok(null, "已经取消");
+            } else {
                 Long createBy = comPbActivityDO.getCreateBy();
                 if (createBy.equals(userId)) {
                     return R.fail("发起者不能取消报名");
                 }
-                mum=comPbActivityMemberDAO.deleteById(comPbActivityMemberDO.getId());
+                mum = comPbActivityMemberDAO.deleteById(comPbActivityMemberDO.getId());
             }
         }
-        if (mum>0) {
+        if (mum > 0) {
             return R.ok();
         }
         return R.fail();
@@ -443,12 +488,13 @@
     /**
      * 获取党建活动所有参入人员的id集合
      *
-     * @param id 党建活动id
+     * @param id
+     *            党建活动id
      * @return 人员id集合
      */
     @Override
     public R selectAllPartyBuildingActivityMembers(Long id) {
-        List<Long> longs=comPbActivityMemberDAO.selectAllPartyBuildingActivityMembers(id);
+        List<Long> longs = comPbActivityMemberDAO.selectAllPartyBuildingActivityMembers(id);
         return R.ok(longs);
     }
 
@@ -459,19 +505,20 @@
      */
     @Override
     public R timedTaskPartyBuildingActivity() {
-        List<Long> ids=comBpActivityDAO.selectTimedTaskPartyBuildingActivity();
+        List<Long> ids = comBpActivityDAO.selectTimedTaskPartyBuildingActivity();
         List<PartyBuildingActivityVO> partyBuildingActivityVOS = new ArrayList<>();
         if (!ObjectUtils.isEmpty(ids)) {
             List<ComPbActivityDO> comPbActivityDOS = comBpActivityDAO.selectBatchIds(ids);
             comPbActivityDOS.forEach(comPbActivityDO -> {
                 PartyBuildingActivityVO partyBuildingActivityVO = new PartyBuildingActivityVO();
-                BeanUtils.copyProperties(comPbActivityDO,partyBuildingActivityVO);
-                List<Long> userIdS=comBpActivityDAO.selectTimedTaskPartyBuildingActivityUserids(comPbActivityDO.getId());
+                BeanUtils.copyProperties(comPbActivityDO, partyBuildingActivityVO);
+                List<Long> userIdS =
+                    comBpActivityDAO.selectTimedTaskPartyBuildingActivityUserids(comPbActivityDO.getId());
                 partyBuildingActivityVO.setUserIds(userIdS);
                 partyBuildingActivityVOS.add(partyBuildingActivityVO);
             });
             int i = comBpActivityDAO.updateBatchIds(ids);
-            log.info("定时任务取消党建活动数量【{}】",i);
+            log.info("定时任务取消党建活动数量【{}】", i);
         }
         return R.ok(partyBuildingActivityVOS);
     }
@@ -483,43 +530,46 @@
      */
     @Override
     public R timedTaskPartyBuildingActivityAll() {
-//        修改发布状态为未开始
-        int num=comBpActivityDAO.updateStatusToNotBegin();
-        log.info("定时任务修改党建活动--修改发布状态为未开始数量【{}】",num);
-//        修改报名状态为报名中
-        int num1=comBpActivityDAO.updateStatusToSign();
-        log.info("定时任务修改党建活动--修改报名状态为报名中始数量【{}】",num1);
-        //查询已结束的活动id,便于计算用户积分
+        // 修改发布状态为未开始
+        int num = comBpActivityDAO.updateStatusToNotBegin();
+        log.info("定时任务修改党建活动--修改发布状态为未开始数量【{}】", num);
+        // 修改报名状态为报名中
+        int num1 = comBpActivityDAO.updateStatusToSign();
+        log.info("定时任务修改党建活动--修改报名状态为报名中始数量【{}】", num1);
+        // 查询已结束的活动id,便于计算用户积分
         List<Long> pbActivityEndIds = comBpActivityDAO.getTaskPbActivityEndIds();
-//        修改进行状态为进行中 或者已结束
-        int num2=comBpActivityDAO.updateStatusToActiveOrEnd();
-        log.info("定时任务修改党建活动--修改进行状态为进行中 或者已结束数量【{}】",num2);
+        // 修改进行状态为进行中 或者已结束
+        int num2 = comBpActivityDAO.updateStatusToActiveOrEnd();
+        log.info("定时任务修改党建活动--修改进行状态为进行中 或者已结束数量【{}】", num2);
         return R.ok(pbActivityEndIds);
     }
 
     /**
      * 创建党员活动 小程序创建党员活动
      *
-     * @param comPbActivityDTO 创建内容
+     * @param comPbActivityDTO
+     *            创建内容
      * @return 创建结果
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R addActivityApplets(ComPbActivityDTO comPbActivityDTO) {
-        ComPbActivityDO comPbActivityDO=new ComPbActivityDO();
+        ComPbActivityDO comPbActivityDO = new ComPbActivityDO();
         Long createBy = comPbActivityDTO.getCreateBy();
-        BeanUtils.copyProperties(comPbActivityDTO,comPbActivityDO);
+        BeanUtils.copyProperties(comPbActivityDTO, comPbActivityDO);
         int insert = comBpActivityDAO.insert(comPbActivityDO);
-        if (insert>0) {
-            ComPbActivityDO comPbActivityDO1 = comBpActivityDAO.selectOne(new QueryWrapper<ComPbActivityDO>().lambda().eq(ComPbActivityDO::getName, comPbActivityDTO.getName()).eq(ComPbActivityDO::getCover, comPbActivityDTO.getCover()).last(" order by create_at desc limit 1 "));
+        if (insert > 0) {
+            ComPbActivityDO comPbActivityDO1 = comBpActivityDAO.selectOne(new QueryWrapper<ComPbActivityDO>().lambda()
+                .eq(ComPbActivityDO::getName, comPbActivityDTO.getName())
+                .eq(ComPbActivityDO::getCover, comPbActivityDTO.getCover()).last(" order by create_at desc limit 1 "));
             Long comPbActivityDO1Id = comPbActivityDO1.getId();
             ComPbMemberDO comPbMemberDO = comPbMemberDAO.selectByUserId(createBy);
             if (ObjectUtils.isEmpty(comPbMemberDO)) {
-                log.error("【{}】不是党员",createBy);
+                log.error("【{}】不是党员", createBy);
                 throw new PartyBuildingMemberException("用户不是党员");
             }
             Long comPbMemberDOId = comPbMemberDO.getId();
-            ComPbActivityMemberDO comPbActivityMemberDO=new ComPbActivityMemberDO();
+            ComPbActivityMemberDO comPbActivityMemberDO = new ComPbActivityMemberDO();
             comPbActivityMemberDO.setMemberId(comPbMemberDOId);
             comPbActivityMemberDO.setActivityId(comPbActivityDO1Id);
             comPbActivityMemberDO.setCreateAt(new Date());
@@ -534,18 +584,14 @@
 
     /**
      * 根据党员活动id查询活动下报名人员
-     * @param activityId    党员活动id
-     * @return  活动下报名人员
+     *
+     * @param activityId
+     *            党员活动id
+     * @return 活动下报名人员
      */
     @Override
-    public R getTaskPbActivityPeopleList(Long activityId){
+    public R getTaskPbActivityPeopleList(Long activityId) {
         return R.ok(this.comBpActivityDAO.getTaskPbActivityPeopleList(activityId));
-    }
-
-    public static void main(String[] args) {
-        DateFormat formatTo = new SimpleDateFormat("M月d ahh:mm");
-        String format = formatTo.format(new Date());
-        System.out.println(format);
     }
 
 }

--
Gitblit v1.7.1