| | |
| | | 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; |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-01 09:16 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | public class ComBpActivityServiceImpl implements ComBpActivityService { |
| | | @Resource |
| | |
| | | List<Long> longs=comPbActivityMemberDAO.selectAllPartyBuildingActivityMembers(id); |
| | | return R.ok(longs); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务取消党建活动 |
| | | * |
| | | * @return 取消党建活动数量 |
| | | */ |
| | | @Override |
| | | public R timedTaskPartyBuildingActivity() { |
| | | 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()); |
| | | partyBuildingActivityVO.setUserIds(userIdS); |
| | | partyBuildingActivityVOS.add(partyBuildingActivityVO); |
| | | }); |
| | | int i = comBpActivityDAO.updateBatchIds(ids); |
| | | log.info("定时任务取消党建活动数量【{}】",i); |
| | | } |
| | | return R.ok(partyBuildingActivityVOS); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新党建活动的各个状态 除取消外 |
| | | * |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R timedTaskPartyBuildingActivityAll() { |
| | | // 修改发布状态为未开始 |
| | | int num=comBpActivityDAO.updateStatusToNotBegin(); |
| | | log.info("定时任务修改党建活动--修改发布状态为未开始数量【{}】",num); |
| | | // 修改报名状态为报名中 |
| | | int num1=comBpActivityDAO.updateStatusToSign(); |
| | | log.info("定时任务修改党建活动--修改报名状态为报名中始数量【{}】",num1); |
| | | // 修改进行状态为进行中 或者已结束 |
| | | int num2=comBpActivityDAO.updateStatusToActiveOrEnd(); |
| | | log.info("定时任务修改党建活动--修改进行状态为进行中 或者已结束数量【{}】",num2); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |