From 8c0b5b30e5200e7bd45aa34507c3623e17fcce91 Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期四, 24 八月 2023 13:47:24 +0800 Subject: [PATCH] 新增小程序积分列表 修改积分发放流程 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivitiesPeopleInvolvedMapper.xml | 20 + springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerActivitiesPeopleVO.java | 6 springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java | 12 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralRecordVO.java | 44 ++++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralRecordApi.java | 83 +++++++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralRecordServiceImpl.java | 63 +++++ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralRecordDao.java | 48 ++++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralRecordMapper.xml | 112 ++++++++++ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java | 49 ++++ springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerActivityApi.java | 8 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivitiesPeople.java | 6 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerActivitiesPeopleApi.java | 6 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralRecordService.java | 40 +++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivitiesPeopleServiceImpl.java | 38 ++- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralRecord.java | 46 ++++ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java | 3 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/GrantIntegral.java | 3 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml | 11 19 files changed, 573 insertions(+), 28 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java index fc46e28..970ce5e 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/VolunteerActivitiesPeopleApi.java @@ -48,7 +48,7 @@ { return R.fail("活动id不能为空"); } - +getLoginUserInfo() if(StringUtils.isEmpty(communityId)) { communityId=getLoginUserInfo().getCommunityId()+""; @@ -70,14 +70,14 @@ return R.fail("参数不能为空"); } + if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getUserId())) + { + return R.fail("用户id不能为空"); + } + if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getActivityId())) { return R.fail("活动id不能为空"); - } - - if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getVolunteerId())) - { - return R.fail("志愿者id不能为空"); } if(StringUtils.isEmpty(volunteerActivitiesPeopleVO.getCommunityId())) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java index 8fd3db6..4686c7b 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java @@ -236,6 +236,9 @@ @ApiModelProperty("区域划分") private String areaName; + @ApiModelProperty("爱心积分") + private String loveIntegral; + @ApiModelProperty("是否单位管理员 1是 0否") private Integer isCheckUnitAdmin; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/GrantIntegral.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/GrantIntegral.java index a550995..7253533 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/GrantIntegral.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/GrantIntegral.java @@ -23,6 +23,9 @@ @ApiModelProperty("志愿者id") private String volunteerId; + @ApiModelProperty("用户id") + private String userId; + @ApiModelProperty("发放积分") private String grantIntegral="0"; diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerActivitiesPeopleVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerActivitiesPeopleVO.java index 9d57de7..bf9bdd5 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerActivitiesPeopleVO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerActivitiesPeopleVO.java @@ -29,6 +29,12 @@ private String volunteerId; /** + * 活动名称 + */ + @ApiModelProperty(value = "用户id") + private String userId; + + /** * 联系人姓名 */ @ApiModelProperty(value = "联系人姓名") diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralRecordVO.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralRecordVO.java new file mode 100644 index 0000000..ebc144e --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerIntegralRecordVO.java @@ -0,0 +1,44 @@ +package com.panzhihua.common.model.vos.community; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("路北社区积分记录明细") +public class VolunteerIntegralRecordVO implements Serializable { + private static final long serialVersionUID = -70884515430727555L; + + @ApiModelProperty(value = "主键") + private String id; + + @ApiModelProperty(value = "1志愿者活动 2 社区兑换 3商家抵扣") + private String iType; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String creationTime; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String updateTime; + + @ApiModelProperty(value = "积分数量") + private String integral; + + @ApiModelProperty(value = "志愿者id") + private String volunteerId; + + @ApiModelProperty(value = "用户id") + private String userId; + +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java index df4f435..be0f5c3 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java @@ -11420,6 +11420,55 @@ @PostMapping("/grantIntegral") public R grantIntegral(@RequestBody GrantIntegral grantIntegral); + /************************************************************************************************************** + * + * + * 积分明细记录 + * + *****************************************************************************************************************/ + /** + * 获取单个详情 + * + * @param id + * @return + */ + @GetMapping("/VolunteerIntegralRecord/getId") + public R VolunteerIntegralRecordGetId(@RequestParam("id") String id); + + /** + * 分页查询 + * + * @param + * @return + */ + @GetMapping("/VolunteerIntegralRecord/getId") + public R VolunteerIntegralRecordGetList(int pageNum, int pageSize, + @RequestParam("userId") String userId); + + /** + * 新增 + * + * @param + * @return + */ + @PostMapping("/VolunteerIntegralRecord/insertVolunteer") + public R VolunteerIntegralRecordInsertVolunteer(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + /** + * 便捷 + * @param + * @return + */ + @PostMapping("/VolunteerIntegralRecord/updateId") + public R VolunteerIntegralRecordUpdateId(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + /** + * 删除 + * @param id + * @return + */ + @DeleteMapping("/VolunteerIntegralRecord/deleteId") + public R VolunteerIntegralRecordDeleteId(@RequestParam("id") String id); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerActivityApi.java b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerActivityApi.java index f57e8d8..782a344 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerActivityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/VolunteerActivityApi.java @@ -1,8 +1,10 @@ package com.panzhihua.community_backstage.api; +import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.VolunteerActivityVO; import com.panzhihua.common.service.community.CommunityService; +import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -16,7 +18,7 @@ @Slf4j @RestController @RequestMapping("/Volunteer") -public class VolunteerActivityApi +public class VolunteerActivityApi extends BaseController { @Resource private CommunityService communityService; @@ -57,6 +59,10 @@ @PostMapping("/insertVolunteer") R insertVolunteer(@RequestBody VolunteerActivityVO volunteerActivityVO) { + if(StringUtils.isNotEmpty(volunteerActivityVO.getCommunityId())) + { + volunteerActivityVO.setCommunityId(getLoginUserInfo().getCommunityId()+""); + } return communityService.insertVolunteer(volunteerActivityVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerActivitiesPeopleApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerActivitiesPeopleApi.java index 3d85b49..f8e0ad2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerActivitiesPeopleApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerActivitiesPeopleApi.java @@ -4,6 +4,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.GrantIntegral; import com.panzhihua.common.model.vos.community.VolunteerActivitiesPeopleVO; +import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.service.VolunteerActivitiesPeopleService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; @@ -104,6 +105,11 @@ return R.fail("参数不能为空"); } + if(StringUtils.isEmpty(grantIntegral.getUserId())) + { + return R.fail("用户id不能为空"); + } + if(grantIntegral.getPeopleAndGranList()==null || grantIntegral.getPeopleAndGranList().size()<=0 ) { return R.fail("奖励积分人员不能为空"); diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralRecordApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralRecordApi.java new file mode 100644 index 0000000..d2e6903 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralRecordApi.java @@ -0,0 +1,83 @@ +package com.panzhihua.service_community.api; + + +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; +import com.panzhihua.service_community.service.VolunteerIntegralRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +@Slf4j +@RestController +@RequestMapping("/VolunteerIntegralRecord") +public class VolunteerIntegralRecordApi +{ + + @Resource + private VolunteerIntegralRecordService volunteerIntegralRecordService; + + + /** + * 获取单个详情 + * + * @param id + * @return + */ + @GetMapping("/getId") + public R VolunteerIntegralRecordGetId(@RequestParam("id") String id) + { + return volunteerIntegralRecordService.getId(id); + } + + /** + * 分页查询 + * + * @param + * @return + */ + @GetMapping("/getId") + public R VolunteerIntegralRecordGetList(int pageNum, int pageSize, + @RequestParam("userId") String userId) + { + return volunteerIntegralRecordService.getList(pageNum,pageSize,userId); + } + + /** + * 新增 + * + * @param + * @return + */ + @PostMapping("/insertVolunteer") + public R VolunteerIntegralRecordInsertVolunteer(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO) + { + return volunteerIntegralRecordService.insertVolunteer(volunteerIntegralRecordVO); + } + + /** + * 便捷 + * @param + * @return + */ + @PostMapping("/updateId") + public R VolunteerIntegralRecordUpdateId(@RequestBody() VolunteerIntegralRecordVO volunteerIntegralRecordVO) + { + return volunteerIntegralRecordService.updateId(volunteerIntegralRecordVO); + } + + /** + * 删除 + * @param id + * @return + */ + @DeleteMapping("/deleteId") + public R VolunteerIntegralRecordDeleteId(@RequestParam("id") String id) + { + return volunteerIntegralRecordService.deleteId(id); + } + + +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralRecordDao.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralRecordDao.java new file mode 100644 index 0000000..4b40277 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerIntegralRecordDao.java @@ -0,0 +1,48 @@ +package com.panzhihua.service_community.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.panzhihua.common.model.vos.community.VolunteerActivityVO; +import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; +import com.panzhihua.service_community.entity.VolunteerActivity; +import com.panzhihua.service_community.entity.VolunteerIntegralRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface VolunteerIntegralRecordDao extends BaseMapper<VolunteerIntegralRecord> +{ + + /** + * 获取单个详情 + * @param id + * @return + */ + VolunteerIntegralRecord getId(@Param("id") String id); + + /** + * 分页查询 + * @param + * @return + */ + IPage<VolunteerIntegralRecord> getList(Page page, + @Param("userId") String userId); + + /** + * 新增 + * @param + * @return + */ + int insertVolunteer(@Param("volunteerIntegralRecordVO") VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + + int updateId(@Param("volunteerIntegralRecordVO") VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + + int deleteId(@Param("id") String id); + +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java index 710909e..0fbf6b2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/SysUser.java @@ -266,6 +266,9 @@ @ApiModelProperty(value = "绑定单位") private String relationName; + @ApiModelProperty(value = "爱心积分") + private String loveIntegral; + private String appId; /** * 启用状态(1.启用 2.禁用) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivitiesPeople.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivitiesPeople.java index f4b8aa4..abe4a10 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivitiesPeople.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerActivitiesPeople.java @@ -38,6 +38,12 @@ private String volunteerId; /** + * 活动名称 + */ + @ApiModelProperty(value = "用户id") + private String userId; + + /** * 联系人姓名 */ @TableField(exist = false) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralRecord.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralRecord.java new file mode 100644 index 0000000..0118bff --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerIntegralRecord.java @@ -0,0 +1,46 @@ +package com.panzhihua.service_community.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ApiModel("路北社区积分记录明细") +public class VolunteerIntegralRecord implements Serializable { + private static final long serialVersionUID = -70884515430727555L; + + @ApiModelProperty(value = "主键") + private String id; + + @ApiModelProperty(value = "1志愿者活动 2 社区兑换 3商家抵扣") + private String iType; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String creationTime; + + @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private String updateTime; + + @ApiModelProperty(value = "积分数量") + private String integral; + + @ApiModelProperty(value = "志愿者id") + private String volunteerId; + + @ApiModelProperty(value = "用户id") + private String userId; + + + +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralRecordService.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralRecordService.java new file mode 100644 index 0000000..32ca8ed --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerIntegralRecordService.java @@ -0,0 +1,40 @@ +package com.panzhihua.service_community.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; +import com.panzhihua.service_community.entity.VolunteerIntegralRecord; + +public interface VolunteerIntegralRecordService extends IService<VolunteerIntegralRecord> { + + /** + * 获取单个详情 + * + * @param id + * @return + */ + R getId(String id); + + /** + * 分页查询 + * + * @param + * @return + */ + R getList(int pageNum, int pageSize,String userId); + + /** + * 新增 + * + * @param + * @return + */ + R insertVolunteer(VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + + R updateId(VolunteerIntegralRecordVO volunteerIntegralRecordVO); + + + R deleteId(String id); + +} 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 f797b3c..66dc53b 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,17 +1,18 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; -import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; -import com.panzhihua.common.model.vos.community.GrantIntegral; -import com.panzhihua.common.model.vos.community.VolunteerActivitiesPeopleVO; -import com.panzhihua.common.model.vos.community.VolunteerActivityVO; +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; @@ -23,12 +24,14 @@ public class VolunteerActivitiesPeopleServiceImpl extends ServiceImpl<VolunteerActivitiesPeopleDao, VolunteerActivitiesPeople> implements VolunteerActivitiesPeopleService { - - @Resource - private ComMngVolunteerMngService comMngVolunteerMngService; - @Resource private VolunteerActivityService volunteerActivityService; + + @Resource + private VolunteerIntegralRecordService volunteerIntegralRecordService; + + @Resource + private UserService userService; @Override @@ -72,18 +75,25 @@ vla.setIssueStatus("1"); baseMapper.vapUpdate(vla); - ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); - comMngVolunteerMngVO.setId(Long.valueOf(item.getVolunteerId())); + + LoginUserInfoVO sysUser=userService.getUserInfoByUserId(item.getUserId()).getData(); int grant=0; - if(!StringUtils.isNotEmpty(comMngVolunteerMngVO.getLoveIntegral())) + if(!StringUtils.isNotEmpty(sysUser.getLoveIntegral())) { - grant=Integer.valueOf(comMngVolunteerMngVO.getLoveIntegral()); + grant=Integer.valueOf(sysUser.getLoveIntegral()); } grant+=Integer.valueOf(item.getGrantIntegral()); + sysUser.setLoveIntegral(grant+""); + userService.putUser(sysUser); - comMngVolunteerMngVO.setLoveIntegral(grant+""); + //新增积分记录 + VolunteerIntegralRecordVO volunteerIntegralRecordVO=new VolunteerIntegralRecordVO(); + volunteerIntegralRecordVO.setIntegral(item.getGrantIntegral()); + volunteerIntegralRecordVO.setVolunteerId(item.getVolunteerId()); + volunteerIntegralRecordVO.setUserId(item.getUserId()); + volunteerIntegralRecordVO.setIType("1"); + volunteerIntegralRecordService.insertVolunteer(volunteerIntegralRecordVO); - comMngVolunteerMngService.putVolunteer(comMngVolunteerMngVO); } diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralRecordServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralRecordServiceImpl.java new file mode 100644 index 0000000..c1b959b --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerIntegralRecordServiceImpl.java @@ -0,0 +1,63 @@ +package com.panzhihua.service_community.service.impl; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.VolunteerIntegralRecordVO; +import com.panzhihua.service_community.dao.VolunteerIntegralRecordDao; +import com.panzhihua.service_community.entity.VolunteerActivity; +import com.panzhihua.service_community.entity.VolunteerIntegralRecord; +import com.panzhihua.service_community.service.VolunteerIntegralRecordService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service +public class VolunteerIntegralRecordServiceImpl extends ServiceImpl<VolunteerIntegralRecordDao, + VolunteerIntegralRecord> implements VolunteerIntegralRecordService +{ + + + @Override + public R getId(String id) { + return R.ok(baseMapper.getId(id)); + } + + @Override + public R getList(int pageNum, int pageSize, String userId) + { + Page page = new Page<VolunteerActivity>(pageNum,pageSize); + return R.ok(baseMapper.getList(page,userId)); + } + + @Override + public R insertVolunteer(VolunteerIntegralRecordVO volunteerIntegralRecordVO) + { + int num= baseMapper.insertVolunteer(volunteerIntegralRecordVO); + if(num>0) + { + return R.ok(); + } + return R.fail("操作失败"); + } + + @Override + public R updateId(VolunteerIntegralRecordVO volunteerIntegralRecordVO) { + int num= baseMapper.updateId(volunteerIntegralRecordVO); + if(num>0) + { + return R.ok(); + } + return R.fail("操作失败"); + } + + @Override + public R deleteId(String id) { + int num= baseMapper.deleteId(id); + if(num>0) + { + return R.ok(); + } + return R.fail("操作失败"); + } +} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml index dca0139..06bab7e 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/SysUserMapper.xml @@ -42,12 +42,17 @@ <result property="plaintextPassword" column="plaintext_password"/> <result property="streetId" column="street_id"/> <result property="relationName" column="relation_name"/> + <result property="loveIntegral" column="love_integral"/> </resultMap> <!--查询单个--> <select id="queryById" resultMap="SysUserMap"> select - user_id, account, password, openid, session_key, unionid, phone, nick_name, name, community_id, sex, id_card, birthday, image_url, type, job, is_volunteer, is_partymember, status, create_at, last_login_time, tags, family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book, continuous_landing_days, is_tips, work_status, work_start_time, work_end_time, big_age_tips, plaintext_password + user_id, account, password, openid, session_key, unionid, phone, nick_name, name, + community_id, sex, id_card, birthday, image_url, type, job, is_volunteer, is_partymember, + status, create_at, last_login_time, tags, family_id, face_url, face_state, reject_reson, + area_id, card_photo_front, card_photo_back, family_book, continuous_landing_days, is_tips, + work_status, work_start_time, work_end_time, big_age_tips, plaintext_password,love_integral from sys_user where user_id = #{userId} </select> @@ -57,7 +62,7 @@ select user_id, account, password, openid, session_key, unionid, phone, nick_name, name, community_id, sex, id_card, birthday, image_url, type, job, is_volunteer, is_partymember, status, create_at, last_login_time, tags, - family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book, + family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book,love_integral, continuous_landing_days, is_tips, work_status, work_start_time, work_end_time, big_age_tips, plaintext_password from sys_user <where> @@ -181,7 +186,7 @@ select user_id, account, password, openid, session_key, unionid, phone, nick_name, name, community_id, sex, id_card, birthday, image_url, type, job, is_volunteer, is_partymember, status, create_at, last_login_time, tags, - family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book, + family_id, face_url, face_state, reject_reson, area_id, card_photo_front, card_photo_back, family_book,love_integral, continuous_landing_days, is_tips, work_status, work_start_time, work_end_time, big_age_tips, plaintext_password from sys_user <where> diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivitiesPeopleInvolvedMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivitiesPeopleInvolvedMapper.xml index c2e72a7..e504036 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivitiesPeopleInvolvedMapper.xml +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerActivitiesPeopleInvolvedMapper.xml @@ -11,6 +11,7 @@ <result property="updateTime" column="update_time" /> <result property="communityId" column="community_id" /> <result property="activityId" column="activity_id" /> + <result property="userId" column="user_id" /> </resultMap> @@ -22,10 +23,11 @@ volunteer_id, issue_status, issue_points, - (select cmvm.name from com_mng_volunteer_mng cmvm where cmvm.id=volunteer_id) as contactName, - (select cmvm.phone from com_mng_volunteer_mng cmvm where cmvm.id=volunteer_id) as contactPhone, + (select cmvm.name from sys_user cmvm where cmvm.user_id=user_id) as contactName, + (select cmvm.phone from sys_user cmvm where cmvm.user_id=user_id) as contactPhone, creation_time, activity_id, + user_id, update_time from volunteer_activities_people_involved where id= #{id} @@ -39,10 +41,11 @@ volunteer_id, issue_status, issue_points, - (select cmvm.name from com_mng_volunteer_mng cmvm where cmvm.id=volunteer_id) as contactName, - (select cmvm.phone from com_mng_volunteer_mng cmvm where cmvm.id=volunteer_id) as contactPhone, + (select cmvm.name from sys_user cmvm where cmvm.user_id=user_id) as contactName, + (select cmvm.phone from sys_user cmvm where cmvm.user_id=user_id) as contactPhone, creation_time, activity_id, + user_id, update_time from volunteer_activities_people_involved <where> @@ -79,6 +82,9 @@ <if test="volunteerActivitiesPeopleVO.activityId != null"> activity_id, </if> + <if test="volunteerActivitiesPeopleVO.userId != null"> + user_id, + </if> creation_time </trim> values @@ -100,6 +106,9 @@ </if> <if test="volunteerActivitiesPeopleVO.activityId != null"> #{volunteerActivitiesPeopleVO.activityId}, + </if> + <if test="volunteerActivitiesPeopleVO.userId != null"> + #{volunteerActivitiesPeopleVO.userId}, </if> sysdate() </trim> @@ -126,6 +135,9 @@ <if test="volunteerActivitiesPeopleVO.activityId != null"> activity_id=#{volunteerActivitiesPeopleVO.activityId}, </if> + <if test="volunteerActivitiesPeopleVO.userId != null"> + user_id=#{volunteerActivitiesPeopleVO.userId}, + </if> update_time=sysdate() </set> where id = #{volunteerActivitiesPeopleVO.id} diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralRecordMapper.xml b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralRecordMapper.xml new file mode 100644 index 0000000..e4cc921 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerIntegralRecordMapper.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.panzhihua.service_community.dao.VolunteerIntegralRecordDao"> + + <resultMap type="com.panzhihua.service_community.entity.VolunteerIntegralRecord" id="VolunteerIntegralRecordMap"> + <result property="id" column="id" /> + <result property="iType" column="i_type" /> + <result property="creationTime" column="creation_time" /> + <result property="integral" column="integral" /> + <result property="volunteerId" column="volunteer_id" /> + <result property="updateTime" column="update_time" /> + <result property="userId" column="user_id" /> + + </resultMap> + + <!--查询单个--> + <select id="getId" resultMap="VolunteerIntegralRecordMap"> + select + id, + i_type, + creation_time, + integral, + update_time, + user_id, + volunteer_id + from volunteer_integral_record + where id= #{id} + </select> + + <!-- 分页查询 --> + <select id="getList" resultMap="VolunteerIntegralRecordMap"> + select + id, + i_type, + creation_time, + update_time, + integral, + user_id, + volunteer_id + from volunteer_integral_record + <where> + <if test="userId!=null"> + user_id=#{userId} + </if> + </where> + order by creation_time desc + </select> + + <insert id="insertVolunteer"> + insert into volunteer_integral_record + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="volunteerIntegralRecordVO.id != null"> + id, + </if> + <if test="volunteerIntegralRecordVO.id != null"> + i_type, + </if> + <if test="volunteerIntegralRecordVO.id != null"> + integral, + </if> + <if test="volunteerIntegralRecordVO.id != null"> + volunteer_id, + </if> + creation_time + </trim> + values + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="volunteerIntegralRecordVO.id != null"> + #{volunteerIntegralRecordVO.id}, + </if> + <if test="volunteerIntegralRecordVO.iType != null"> + #{volunteerIntegralRecordVO.iType}, + </if> + <if test="volunteerIntegralRecordVO.integral != null"> + #{volunteerIntegralRecordVO.integral}, + </if> + <if test="volunteerIntegralRecordVO.volunteerId != null"> + #{volunteerIntegralRecordVO.volunteerId}, + </if> + sysdate() + </trim> + </insert> + + <update id="updateId"> + update volunteer_integral_record + <set> + <if test="volunteerIntegralRecordVO.id != null"> + id=#{volunteerIntegralRecordVO.id}, + </if> + <if test="volunteerIntegralRecordVO.iType != null"> + i_type=#{volunteerIntegralRecordVO.iType}, + </if> + <if test="volunteerIntegralRecordVO.integral != null"> + integral=#{volunteerIntegralRecordVO.integral}, + </if> + <if test="volunteerIntegralRecordVO.volunteerId != null"> + volunteer_id=#{volunteerIntegralRecordVO.volunteerId}, + </if> + update_time=sysdate() + </set> + where id = #{volunteerIntegralRecordVO.id} + + </update> + + + <delete id="deleteId" parameterType="String"> + delete from volunteer_integral_record where id=#{id} + </delete> + + + +</mapper> -- Gitblit v1.7.1