From 08f1b1f1804a8bd833d42f257908d80e88387b55 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期五, 14 三月 2025 11:27:47 +0800
Subject: [PATCH] 3.5增加登录验证、修改密码、人员列表调整
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java | 79 +++++++++++++++++++++++++++++++++++++++
1 files changed, 78 insertions(+), 1 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java
index d746d19..eaeebd9 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java
@@ -1,13 +1,22 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.panzhihua.common.model.vos.community.VolunteerActivitiesPeopleVO;
+import com.panzhihua.common.model.vos.LoginUserInfoVO;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.community.*;
+import com.panzhihua.common.service.user.UserService;
+import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.VolunteerActivitiesPeopleDao;
+import com.panzhihua.service_community.entity.SysUser;
import com.panzhihua.service_community.entity.VolunteerActivitiesPeople;
+import com.panzhihua.service_community.service.ComMngVolunteerMngService;
import com.panzhihua.service_community.service.VolunteerActivitiesPeopleService;
+import com.panzhihua.service_community.service.VolunteerActivityService;
+import com.panzhihua.service_community.service.VolunteerIntegralRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
import java.util.List;
@Slf4j
@@ -15,6 +24,15 @@
public class VolunteerActivitiesPeopleServiceImpl extends ServiceImpl<VolunteerActivitiesPeopleDao,
VolunteerActivitiesPeople> implements VolunteerActivitiesPeopleService
{
+ @Resource
+ private VolunteerActivityService volunteerActivityService;
+
+ @Resource
+ private VolunteerIntegralRecordService volunteerIntegralRecordService;
+
+ @Resource
+ private UserService userService;
+
@Override
public VolunteerActivitiesPeople vapGetById(String id)
@@ -42,5 +60,64 @@
return baseMapper.vapDelete(id);
}
+ @Override
+ public R grantIntegral(GrantIntegral grantIntegral)
+ {
+ for (GrantIntegral item: grantIntegral.getPeopleAndGranList() )
+ {
+ if(StringUtils.isEmpty(item.getId()))
+ {
+ return R.fail("奖励发放id不能为空!");
+ }
+
+ if(StringUtils.isEmpty(item.getGrantIntegral()))
+ {
+ return R.fail("奖励发放积分不能为空!");
+ }
+
+
+ //用户新增积分
+ LoginUserInfoVO sysUser=userService.getUserInfoByUserId(item.getUserId()).getData();
+
+ VolunteerActivitiesPeopleVO vla=new VolunteerActivitiesPeopleVO();
+ vla.setId(item.getId());
+ vla.setUserId(item.getUserId());
+ vla.setIssuePoints(item.getGrantIntegral());
+ vla.setCommunityId(sysUser.getCommunityId()+"");
+ vla.setIssueStatus("1");
+ baseMapper.vapUpdate(vla);
+
+
+ int grant=0;
+ if(!StringUtils.isEmpty(sysUser.getLoveIntegral()))
+ {
+ grant=Integer.valueOf(sysUser.getLoveIntegral());
+ }
+ grant+=Integer.valueOf(item.getGrantIntegral());
+ sysUser.setLoveIntegral(grant+"");
+ userService.putUser(sysUser);
+
+ //新增积分记录
+ VolunteerIntegralRecordVO volunteerIntegralRecordVO=new VolunteerIntegralRecordVO();
+ volunteerIntegralRecordVO.setIntegral(item.getGrantIntegral());
+ volunteerIntegralRecordVO.setVolunteerId(item.getVolunteerId());
+ volunteerIntegralRecordVO.setUserId(item.getUserId());
+ volunteerIntegralRecordVO.setIType("1");
+ volunteerIntegralRecordVO.setCommunityId(sysUser.getCommunityId()+"");
+ volunteerIntegralRecordService.insertVolunteer(volunteerIntegralRecordVO);
+
+ }
+ //判断活动奖励是否发放完
+ int num=baseMapper.vapGetUnissuedQuantity(grantIntegral.getActivityId());
+ if(num==0)
+ {
+ VolunteerActivityVO activityVO=new VolunteerActivityVO();
+ activityVO.setId(grantIntegral.getActivityId());
+ activityVO.setAwardState("1");
+ volunteerActivityService.updateById(activityVO);
+ }
+ return R.ok();
+ }
+
}
--
Gitblit v1.7.1