huanghongfa
2021-06-25 b34621b9348c909d29ee9cc005ca5fa3e6dc0aa0
小程序随手拍模块,我的钱包模块接口开发
14个文件已修改
33个文件已添加
1458 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/SystemManagementApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/wallet/ComActWalletDetailDTO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/wallet/PageComActWalletTradeDTO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActEasyPhotoActivityVO.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActEasyPhotoVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletRankingVO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletTradeVO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletVO.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/SysUserAgreementVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/WalletApi.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoActivityMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoActivityRecordMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletChangeMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletMapper.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletTradeMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoActivityDO.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoActivityRecordDO.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoDO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletChangeDO.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletDO.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletTradeDO.java 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActEasyPhotoActivityRecordService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActEasyPhotoActivityService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletChangeService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletService.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletTradeService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityRecordServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletChangeServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletServiceImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoActivityDOMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoActivityRecordDOMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletChangeDOMapper.xml 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletDOMapper.xml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletTradeDOMapper.xml 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserAgreementDO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/IndexApi.java
@@ -11,12 +11,7 @@
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.advertisement.ComOpsAdvVO;
import com.panzhihua.common.model.vos.community.ComActEasyPhotoCommentVO;
import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
import com.panzhihua.common.model.vos.community.ComActMessageBackVO;
import com.panzhihua.common.model.vos.community.ComActMessageVO;
import com.panzhihua.common.model.vos.community.ComActMicroWishVO;
import com.panzhihua.common.model.vos.community.PageComActMessageVO;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.user.NoticeUnReadVO;
import com.panzhihua.common.model.vos.user.SysUserAgreementVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
@@ -83,6 +78,13 @@
        return communityService.addEasyPhoto(comActEasyPhotoVO);
    }
    @ApiOperation(value = "查询随手拍是否有活动",response = ComActEasyPhotoActivityVO.class)
    @PostMapping("getEasyPhotoActivity")
    public R getEasyPhotoActivity (){
        Long communityId = this.getCommunityId();
        return communityService.getEasyPhotoActivity(communityId);
    }
    @ApiOperation(value = "随手拍详情",response =ComActEasyPhotoVO.class )
    @GetMapping("detaileasyphoto")
    @ApiImplicitParam(name = "id",value = "随手拍主键")
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java
New file
@@ -0,0 +1,72 @@
package com.panzhihua.applets.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletRankingVO;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletVO;
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
@RequestMapping("/wallet/")
@Api(tags = {"钱包模块"})
public class WalletApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @ApiOperation(value = "查询我的钱包", response = ComActWalletVO.class)
    @PostMapping("/get/my")
    public R getWallet() {
        ComActWalletDetailDTO walletDetailDTO = new ComActWalletDetailDTO();
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        if (loginUserInfo == null) {
            return R.fail("请先登录");
        }
        walletDetailDTO.setUserId(loginUserInfo.getUserId());
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        walletDetailDTO.setCommunityId(communityId);
        return communityService.getUserWalletDetail(walletDetailDTO);
    }
    @ApiOperation(value = "查询我的收支记录", response = ComActWalletTradeVO.class)
    @PostMapping("/get/trade")
    public R getWalletTrade(@RequestBody PageComActWalletTradeDTO walletTradeDTO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        if (loginUserInfo == null) {
            return R.fail("请先登录");
        }
        walletTradeDTO.setUserId(loginUserInfo.getUserId());
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        walletTradeDTO.setCommunityId(communityId);
        return communityService.getUserWalletTrade(walletTradeDTO);
    }
    @ApiOperation(value = "查询收益排行榜", response = ComActWalletRankingVO.class)
    @PostMapping("/get/ranking")
    public R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO) {
        Long communityId = this.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        walletTradeDTO.setCommunityId(communityId);
        return communityService.getWalletRanking(walletTradeDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/SystemManagementApi.java
@@ -184,7 +184,7 @@
    @ApiOperation(value = "用户协议",response = SysUserAgreementVO.class)
    @GetMapping("listagreement")
    public R listAgreement(){
        return userService.listAgreement();
        return userService.listAgreement(0L);
    }
    @ApiOperation(value = "编辑用户协议")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/wallet/ComActWalletDetailDTO.java
New file
@@ -0,0 +1,17 @@
package com.panzhihua.common.model.dtos.community.wallet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("钱包详情返回参数")
public class ComActWalletDetailDTO {
    @ApiModelProperty(value = "用户id",hidden = true)
    private Long userId;
    @ApiModelProperty(value = "社区id",hidden = true)
    private Long communityId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/wallet/PageComActWalletTradeDTO.java
New file
@@ -0,0 +1,23 @@
package com.panzhihua.common.model.dtos.community.wallet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("钱包详情返回参数")
public class PageComActWalletTradeDTO {
    @ApiModelProperty(value = "用户id",hidden = true)
    private Long userId;
    @ApiModelProperty(value = "社区id",hidden = true)
    private Long communityId;
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty(value = "分页-每页记录数", example = "10")
    private Long pageSize = 10L;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActEasyPhotoActivityVO.java
New file
@@ -0,0 +1,43 @@
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.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel("随手拍活动返回参数")
public class ComActEasyPhotoActivityVO {
    @ApiModelProperty("活动id")
    private Long id;
    @ApiModelProperty("活动状态(1.待开始 2.进行中 3.已结束  4.已取消)")
    private Integer status;
    @ApiModelProperty("活动简介")
    private String content;
    @ApiModelProperty("活动开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date activityStartAt;
    @ApiModelProperty("活动结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date activityEndAt;
    @ApiModelProperty("优质奖励金额")
    private BigDecimal goodReward;
    @ApiModelProperty("精良奖励金额")
    private BigDecimal excellentReward;
    @ApiModelProperty("普通奖励金额")
    private BigDecimal ordinaryReward;
    @ApiModelProperty("活动图片")
    private String logo;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActEasyPhotoVO.java
@@ -9,6 +9,7 @@
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -141,4 +142,10 @@
    @ApiModelProperty(value = "发生地址经纬度信息,逗号分割(长的在前面,短的在后面)")
    private String lngLat;
    @ApiModelProperty(value = "随手拍标签(1.优质 2.精良 3.普通)")
    private Integer activityType;
    @ApiModelProperty(value = "参加活动奖励金额")
    private BigDecimal activityAmount;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletRankingVO.java
New file
@@ -0,0 +1,25 @@
package com.panzhihua.common.model.vos.community.wallet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel("用户收益排行榜返回参数")
public class ComActWalletRankingVO {
    @ApiModelProperty("钱包id")
    private Long id;
    @ApiModelProperty("姓名")
    private String nickName;
    @ApiModelProperty("收益总金额")
    private BigDecimal incomeAmount;
    @ApiModelProperty("累计随手拍奖励数量")
    private BigDecimal easyCount;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletTradeVO.java
New file
@@ -0,0 +1,36 @@
package com.panzhihua.common.model.vos.community.wallet;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel("用户钱包收支记录返回参数")
public class ComActWalletTradeVO {
    @ApiModelProperty("记录id")
    private Long id;
    @ApiModelProperty("社区名称")
    private String communityName;
    @ApiModelProperty("交易金额")
    private BigDecimal amount;
    @ApiModelProperty("交易类型(1.发布随手拍 2.收益结算)")
    private Integer type;
    @ApiModelProperty("变动类型(1.增加 2.减少)")
    private Integer changeType;
    @ApiModelProperty("交易备注")
    private String remark;
    @ApiModelProperty("交易时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/wallet/ComActWalletVO.java
New file
@@ -0,0 +1,43 @@
package com.panzhihua.common.model.vos.community.wallet;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ApiModel("用户钱包返回参数")
public class ComActWalletVO {
    @ApiModelProperty("钱包id")
    private Long id;
    @ApiModelProperty("社区名称")
    private String communityName;
    @ApiModelProperty("收益金额")
    private BigDecimal incomeAmount;
    @ApiModelProperty("可用金额")
    private BigDecimal availableAmount;
    @ApiModelProperty("结算金额")
    private BigDecimal settlementAmount;
    @ApiModelProperty("累计随手拍奖励数量")
    private Integer easyCount;
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createAt;
    @ApiModelProperty("上次金额变动时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateAt;
    @ApiModelProperty("收益说明")
    private String agreement;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/SysUserAgreementVO.java
@@ -20,7 +20,7 @@
    @ApiModelProperty("id")
    private Long id;
    @ApiModelProperty("所属app 1居民端app 2网格员端app 3商家端app 4隐私政策")
    @ApiModelProperty("所属app 1居民端app 2网格员端app 3商家端app 4隐私政策 5随手拍说明")
    private Integer type;
    @ApiModelProperty("协议内容")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -14,6 +14,8 @@
import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO;
import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenDiscussListDTO;
import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenMicroListDTO;
import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.dtos.elders.ComEldersAuthGetResultDTO;
import com.panzhihua.common.model.dtos.elders.ComEldersAuthPageDTO;
import com.panzhihua.common.model.dtos.elders.ComEldersAuthUserAddAppDTO;
@@ -273,6 +275,13 @@
     */
    @PostMapping("addeasyphoto")
    R addEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO);
    /**
     * 查询随手拍是否有活动
     * @return  活动详情
     */
    @PostMapping("getEasyPhotoActivity")
    R getEasyPhotoActivity(@RequestParam("communityId") Long communityId);
    /**
     * 发布微心愿
@@ -3108,4 +3117,28 @@
     */
    @GetMapping("/screen/work/dynamic")
    R dynamicWork(@RequestParam("communityId")Long communityId);
    /**
     * 查询用户钱包信息
     * @param walletDetailDTO   请求参数
     * @return  用户钱包信息
     */
    @PostMapping("/wallet/get/my")
    R getUserWalletDetail(@RequestBody ComActWalletDetailDTO walletDetailDTO);
    /**
     * 查询用户收支记录列表
     * @param walletTradeDTO    请求参数
     * @return  收支记录
     */
    @PostMapping("/wallet/get/trade")
    R getUserWalletTrade(@RequestBody PageComActWalletTradeDTO walletTradeDTO);
    /**
     * 查询用户绑定的社区收益排行榜
     * @param walletTradeDTO   请求参数
     * @return  社区收益排行榜
     */
    @PostMapping("/wallet/get/ranking")
    R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -325,7 +325,7 @@
     * @return 协议集合
     */
    @PostMapping("listagreement")
    R listAgreement();
    R listAgreement(@RequestParam("communityId")Long communityId);
    /**
     * 编辑用户协议
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -86,6 +86,8 @@
    public ComEldersAuthUserService comEldersAuthUserService;
    @Resource
    private ComEldersAuthHistoryRecordMapper comEldersAuthHistoryRecordMapper;
    @Resource
    private ComActEasyPhotoActivityService comActEasyPhotoActivityService;
    /**
     * 新增社区活动
@@ -556,6 +558,15 @@
    }
    /**
     * 查询随手拍是否有活动
     * @return  活动详情
     */
    @PostMapping("getEasyPhotoActivity")
    public R getEasyPhotoActivity(@RequestParam("communityId") Long communityId) {
        return comActEasyPhotoActivityService.getEasyPhotoActivity(communityId);
    }
    /**
     * 发布微心愿
     *
     * @param comActMicroWishVO 发布内容
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/WalletApi.java
New file
@@ -0,0 +1,52 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.service.ComActUserWalletService;
import com.panzhihua.service_community.service.ComActUserWalletTradeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@Slf4j
@RestController
@RequestMapping("/wallet/")
public class WalletApi {
    @Resource
    private ComActUserWalletService comActUserWalletService;
    @Resource
    private ComActUserWalletTradeService comActUserWalletTradeService;
    /**
     * 查询用户钱包信息
     * @param walletDetailDTO   请求参数
     * @return  用户钱包信息
     */
    @PostMapping("/get/my")
    public R getWallet(@RequestBody ComActWalletDetailDTO walletDetailDTO) {
        return comActUserWalletService.getWallet(walletDetailDTO);
    }
    /**
     * 查询用户收支记录列表
     * @param walletTradeDTO    请求参数
     * @return  收支记录
     */
    @PostMapping("/get/trade")
    public R getWalletTrade(@RequestBody PageComActWalletTradeDTO walletTradeDTO) {
        return comActUserWalletTradeService.getWalletTrade(walletTradeDTO);
    }
    /**
     * 查询用户绑定的社区收益排行榜
     * @param walletTradeDTO   请求参数
     * @return  社区收益排行榜
     */
    @PostMapping("/get/ranking")
    public R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO) {
        return comActUserWalletService.getWalletRanking(walletTradeDTO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoActivityMapper.java
New file
@@ -0,0 +1,15 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityDO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:16
 * @describe 随手拍活动表mapper类
 */
@Mapper
public interface ComActEasyPhotoActivityMapper extends BaseMapper<ComActEasyPhotoActivityDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoActivityRecordMapper.java
New file
@@ -0,0 +1,15 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityRecordDO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:36
 * @describe 用户参加随手拍活动记录表mapper类
 */
@Mapper
public interface ComActEasyPhotoActivityRecordMapper extends BaseMapper<ComActEasyPhotoActivityRecordDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActEasyPhotoDAO.java
@@ -166,6 +166,8 @@
            "su.`name`,\n" +
            "p.handle_result,\n" +
            "p.photo_path_list,\n" +
            "p.activity_type,\n" +
            "p.activity_amount,\n" +
            "count(pu.id)giveThumbsUpNum,\n" +
            "p.handle_photo_list\n" +
            "FROM\n" +
@@ -213,6 +215,8 @@
            "p.`photo_path_list`,\n" +
            "p.create_at,\n" +
            "p.feedback_at,\n" +
            "p.activity_type,\n" +
            "p.activity_amount,\n" +
            "p.examine_at \n" +
            "FROM\n" +
            "com_act_easy_photo p\n" +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletChangeMapper.java
New file
@@ -0,0 +1,15 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.model.dos.ComActUserWalletChangeDO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:34
 * @describe 用户钱包资产变动记录表mapper类
 */
@Mapper
public interface ComActUserWalletChangeMapper extends BaseMapper<ComActUserWalletChangeDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletMapper.java
New file
@@ -0,0 +1,31 @@
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.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletRankingVO;
import com.panzhihua.service_community.model.dos.ComActUserWalletDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:11
 * @describe 用户钱包表mapper类
 */
@Mapper
public interface ComActUserWalletMapper extends BaseMapper<ComActUserWalletDO> {
    Map<String,String> getCommunityName(@Param("communityId") Long communityId);
    /**
     * 查询用户绑定的社区收益排行榜
     * @param walletTradeDTO   请求参数
     * @return  社区收益排行榜
     */
    IPage<ComActWalletRankingVO> getWalletRanking(Page page, @Param("walletTradeDTO") PageComActWalletTradeDTO walletTradeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActUserWalletTradeMapper.java
New file
@@ -0,0 +1,26 @@
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.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO;
import com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:22
 * @describe 用户钱包交易记录表mapper类
 */
@Mapper
public interface ComActUserWalletTradeMapper extends BaseMapper<ComActUserWalletTradeDO> {
    /**
     * 查询用户收支记录列表
     * @param walletTradeDTO    请求参数
     * @return  收支记录
     */
    IPage<ComActWalletTradeVO> getUserWalletTradeList(Page page, @Param("walletTradeDTO") PageComActWalletTradeDTO walletTradeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoActivityDO.java
New file
@@ -0,0 +1,106 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:16
 * @describe 随手拍活动表实体类
 */
@Data
@TableName("com_act_easy_photo_activity")
public class ComActEasyPhotoActivityDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 活动状态(1.待开始 2.进行中 3.已结束  4.已取消)
     */
    private Integer status;
    /**
     * 活动简介
     */
    private String content;
    /**
     * 活动开始时间
     */
    private Date activityStartAt;
    /**
     * 活动结束时间
     */
    private Date activityEndAt;
    /**
     * 发布时间
     */
    private Date releaseAt;
    /**
     * 优质奖励金额
     */
    private BigDecimal goodReward;
    /**
     * 精良奖励金额
     */
    private BigDecimal excellentReward;
    /**
     * 普通奖励金额
     */
    private BigDecimal ordinaryReward;
    /**
     * 随手拍数量
     */
    private Integer count;
    /**
     * 创建时间
     */
    private Date createAt;
    /**
     * 活动图片
     */
    private String logo;
    @Override
    public String toString() {
        return "ComActEasyPhotoActivityDO{" +
                "id=" + id +
                ", status=" + status +
                ", content=" + content +
                ", activityStartAt=" + activityStartAt +
                ", activityEntAt=" + activityEndAt +
                ", releaseAt=" + releaseAt +
                ", goodReward=" + goodReward +
                ", excellentReward=" + excellentReward +
                ", ordinaryReward=" + ordinaryReward +
                ", count=" + count +
                ", createAt=" + createAt +
                "}";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoActivityRecordDO.java
New file
@@ -0,0 +1,85 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:36
 * @describe 用户参加随手拍活动记录表实体类
 */
@Data
@TableName("com_act_easy_photo_activity_record")
public class ComActEasyPhotoActivityRecordDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 参加活动用户id
     */
    private Long userId;
    /**
     * 活动id
     */
    private Long activityId;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 随手拍id
     */
    private Long easyId;
    /**
     * 活动奖励类型(1.优质 2.精良 3.普通)
     */
    private Integer type;
    /**
     * 奖励金额
     */
    private BigDecimal rewardAmount;
    /**
     * 参加活动时间
     */
    private Date joinAt;
    /**
     * 创建时间
     */
    private Date createAt;
    @Override
    public String toString() {
        return "ComActEasyPhotoActivityRecordDO{" +
                "id=" + id +
                ", userId=" + userId +
                ", activityId=" + activityId +
                ", communityId=" + communityId +
                ", easyId=" + easyId +
                ", type=" + type +
                ", rewardAmount=" + rewardAmount +
                ", joinAt=" + joinAt +
                ", createAt=" + createAt +
                "}";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActEasyPhotoDO.java
@@ -5,6 +5,7 @@
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
@@ -125,4 +126,19 @@
     * 发生地址经纬度信息,逗号分割
     */
    private String lngLat;
    /**
     * 活动id
     */
    private Long activityId;
    /**
     * 参加活动标签(1.优质 2.精良 3.普通)
     */
    private Integer activityType;
    /**
     * 活动奖励金额
     */
    private BigDecimal activityAmount;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletChangeDO.java
New file
@@ -0,0 +1,102 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:34
 * @describe 用户钱包资产变动记录表实体类
 */
@Data
@TableName("com_act_user_wallet_change")
public class ComActUserWalletChangeDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 收益金额变动前
     */
    private BigDecimal incomeAmountTop;
    /**
     * 收益金额变动后
     */
    private BigDecimal incomeAmountBack;
    /**
     * 可用金额变动前
     */
    private BigDecimal availableAmountTop;
    /**
     * 可用金额变动后
     */
    private BigDecimal availableAmountBack;
    /**
     * 已结算金额变动前
     */
    private BigDecimal settlementAmountTop;
    /**
     * 已结算金额变动后
     */
    private BigDecimal settlementAmountBack;
    /**
     * 交易记录id
     */
    private Long serviceId;
    /**
     * 变动时间
     */
    private Date createAt;
    /**
     * 钱包id
     */
    private Long walletId;
    @Override
    public String toString() {
        return "ComActUserWalletChangeDO{" +
                "id=" + id +
                ", userId=" + userId +
                ", communityId=" + communityId +
                ", incomeAmountTop=" + incomeAmountTop +
                ", incomeAmountBack=" + incomeAmountBack +
                ", availableAmountTop=" + availableAmountTop +
                ", availableAmountBack=" + availableAmountBack +
                ", settlementAmountTop=" + settlementAmountTop +
                ", settlementAmountBack=" + settlementAmountBack +
                ", serviceId=" + serviceId +
                ", createAt=" + createAt +
                "}";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletDO.java
New file
@@ -0,0 +1,85 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:11
 * @describe 用户钱包表实体类
 */
@Data
@TableName("com_act_user_wallet")
public class ComActUserWalletDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 收益总金额
     */
    private BigDecimal incomeAmount;
    /**
     * 可用金额
     */
    private BigDecimal availableAmount;
    /**
     * 结算金额
     */
    private BigDecimal settlementAmount;
    /**
     * 累计参加随手拍次数
     */
    private Integer easyCount;
    /**
     * 创建时间
     */
    private Date createAt;
    /**
     * 上次金额变动时间
     */
    private Date updateAt;
    @Override
    public String toString() {
        return "ComActUserWalletDO{" +
                "id=" + id +
                ", userId=" + userId +
                ", communityId=" + communityId +
                ", incomeAmount=" + incomeAmount +
                ", availableAmount=" + availableAmount +
                ", settlementAmount=" + settlementAmount +
                ", easyCount=" + easyCount +
                ", createAt=" + createAt +
                ", updateAt=" + updateAt +
                "}";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActUserWalletTradeDO.java
New file
@@ -0,0 +1,90 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:22
 * @describe 用户钱包交易记录表实体类
 */
@Data
@TableName("com_act_user_wallet_trade")
public class ComActUserWalletTradeDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 社区id
     */
    private Long communityId;
    /**
     * 交易业务id
     */
    private Long serviceId;
    /**
     * 交易金额
     */
    private BigDecimal amount;
    /**
     * 交易类型(1.发布随手拍 2.结算)
     */
    private Integer type;
    /**
     * 交易备注
     */
    private String remark;
    /**
     * 交易时间
     */
    private Date createAt;
    /**
     * 操作人id
     */
    private Long createBy;
    /**
     * 钱包id
     */
    private Long walletId;
    @Override
    public String toString() {
        return "ComActUserWalletTradeDO{" +
                "id=" + id +
                ", userId=" + userId +
                ", communityId=" + communityId +
                ", serviceId=" + serviceId +
                ", amount=" + amount +
                ", type=" + type +
                ", remark=" + remark +
                ", createAt=" + createAt +
                ", createBy=" + createBy +
                "}";
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActEasyPhotoActivityRecordService.java
New file
@@ -0,0 +1,13 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityRecordDO;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:36
 * @describe 用户参加随手拍活动记录表服务类
 */
public interface ComActEasyPhotoActivityRecordService extends IService<ComActEasyPhotoActivityRecordDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActEasyPhotoActivityService.java
New file
@@ -0,0 +1,20 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityDO;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:16
 * @describe 随手拍活动表服务类
 */
public interface ComActEasyPhotoActivityService extends IService<ComActEasyPhotoActivityDO> {
    /**
     * 查询随手拍是否有活动
     * @return  活动详情
     */
    R getEasyPhotoActivity(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletChangeService.java
New file
@@ -0,0 +1,13 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.service_community.model.dos.ComActUserWalletChangeDO;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:34
 * @describe 用户钱包资产变动记录表服务类
 */
public interface ComActUserWalletChangeService extends IService<ComActUserWalletChangeDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletService.java
New file
@@ -0,0 +1,30 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.ComActUserWalletDO;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:11
 * @describe 用户钱包表服务类
 */
public interface ComActUserWalletService extends IService<ComActUserWalletDO> {
    /**
     * 查询用户钱包信息
     * @param walletDetailDTO   请求参数
     * @return  用户钱包信息
     */
    R getWallet(ComActWalletDetailDTO walletDetailDTO);
    /**
     * 查询用户绑定的社区收益排行榜
     * @param walletTradeDTO   请求参数
     * @return  社区收益排行榜
     */
    R getWalletRanking(PageComActWalletTradeDTO walletTradeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActUserWalletTradeService.java
New file
@@ -0,0 +1,22 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:22
 * @describe 用户钱包交易记录表服务类
 */
public interface ComActUserWalletTradeService extends IService<ComActUserWalletTradeDO> {
    /**
     * 查询用户收支记录列表
     * @param walletTradeDTO    请求参数
     * @return  收支记录
     */
    R getWalletTrade(PageComActWalletTradeDTO walletTradeDTO);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityRecordServiceImpl.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.service_community.dao.ComActEasyPhotoActivityRecordMapper;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityRecordDO;
import com.panzhihua.service_community.service.ComActEasyPhotoActivityRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:36
 * @describe 用户参加随手拍活动记录表服务实现类
 */
@Slf4j
@Service
public class ComActEasyPhotoActivityRecordServiceImpl extends ServiceImpl<ComActEasyPhotoActivityRecordMapper, ComActEasyPhotoActivityRecordDO> implements ComActEasyPhotoActivityRecordService {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java
New file
@@ -0,0 +1,45 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActEasyPhotoActivityVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.service_community.dao.ComActEasyPhotoActivityMapper;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityDO;
import com.panzhihua.service_community.service.ComActEasyPhotoActivityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
 * @auther lyq
 * @create 2021-06-25 10:34:16
 * @describe 随手拍活动表服务实现类
 */
@Slf4j
@Service
public class ComActEasyPhotoActivityServiceImpl extends ServiceImpl<ComActEasyPhotoActivityMapper, ComActEasyPhotoActivityDO> implements ComActEasyPhotoActivityService {
    /**
     * 查询随手拍是否有活动
     * @return  活动详情
     */
    @Override
    public R getEasyPhotoActivity(Long communityId){
        ComActEasyPhotoActivityVO photoActivityVO = new ComActEasyPhotoActivityVO();
        Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format);
        List<ComActEasyPhotoActivityDO> photoActivityDOS = this.baseMapper.selectList(
                new QueryWrapper<ComActEasyPhotoActivityDO>().lambda().eq(ComActEasyPhotoActivityDO::getCommunityId,communityId)
                        .le(ComActEasyPhotoActivityDO::getActivityStartAt,nowDate).ge(ComActEasyPhotoActivityDO::getActivityEndAt,nowDate));
        if(!photoActivityDOS.isEmpty()){
            ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0);
            BeanUtils.copyProperties(photoActivityDO,photoActivityVO);
            return R.ok(photoActivityVO);
        }
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -11,16 +11,11 @@
import com.panzhihua.common.model.vos.community.ComActEasyPhotoCommentVO;
import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
import com.panzhihua.common.model.vos.community.TodoEventsVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.SensitiveUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActEasyPhotoCommentDAO;
import com.panzhihua.service_community.dao.ComActEasyPhotoCommentUserDAO;
import com.panzhihua.service_community.dao.ComActEasyPhotoDAO;
import com.panzhihua.service_community.dao.ComActEasyPhotoUserDAO;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoCommentDO;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoCommentUserDO;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO;
import com.panzhihua.service_community.model.dos.ComActEasyPhotoUserDO;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComActEasyPhotoService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -47,6 +42,8 @@
    private ComActEasyPhotoCommentDAO comActEasyPhotoCommentDAO ;
    @Resource
    private ComActEasyPhotoCommentUserDAO comActEasyPhotoCommentUserDAO ;
    @Resource
    private ComActEasyPhotoActivityMapper comActEasyPhotoActivityMapper;
    /**
     * 分页查询随手拍
     *
@@ -129,6 +126,15 @@
    public R addEasyPhoto(ComActEasyPhotoVO comActEasyPhotoVO) {
        ComActEasyPhotoDO comActEasyPhotoDO=new ComActEasyPhotoDO();
        BeanUtils.copyProperties(comActEasyPhotoVO,comActEasyPhotoDO);
        //查询是否在活动时间内
        Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format);
        List<ComActEasyPhotoActivityDO> photoActivityDOS = comActEasyPhotoActivityMapper.selectList(
                new QueryWrapper<ComActEasyPhotoActivityDO>().lambda().eq(ComActEasyPhotoActivityDO::getCommunityId,comActEasyPhotoVO.getCommunityId())
                        .le(ComActEasyPhotoActivityDO::getActivityStartAt,nowDate).ge(ComActEasyPhotoActivityDO::getActivityEndAt,nowDate));
        if(!photoActivityDOS.isEmpty()){
            ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0);
            comActEasyPhotoDO.setActivityId(photoActivityDO.getId());
        }
        int insert = comActEasyPhotoDAO.insert(comActEasyPhotoDO);
        if (insert>0) {
            return R.ok();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletChangeServiceImpl.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.service_community.dao.ComActUserWalletChangeMapper;
import com.panzhihua.service_community.model.dos.ComActUserWalletChangeDO;
import com.panzhihua.service_community.service.ComActUserWalletChangeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:34
 * @describe 用户钱包资产变动记录表服务实现类
 */
@Slf4j
@Service
public class ComActUserWalletChangeServiceImpl extends ServiceImpl<ComActUserWalletChangeMapper, ComActUserWalletChangeDO> implements ComActUserWalletChangeService {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletServiceImpl.java
New file
@@ -0,0 +1,72 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO;
import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.wallet.ComActWalletVO;
import com.panzhihua.service_community.dao.ComActUserWalletMapper;
import com.panzhihua.service_community.model.dos.ComActUserWalletDO;
import com.panzhihua.service_community.service.ComActUserWalletService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:11
 * @describe 用户钱包表服务实现类
 */
@Slf4j
@Service
public class ComActUserWalletServiceImpl extends ServiceImpl<ComActUserWalletMapper, ComActUserWalletDO> implements ComActUserWalletService {
    /**
     * 查询用户钱包信息
     * @param walletDetailDTO   请求参数
     * @return  用户钱包信息
     */
    @Override
    public R getWallet(ComActWalletDetailDTO walletDetailDTO){
        ComActWalletVO comActWalletVO = new ComActWalletVO();
        //查询用户钱包
        ComActUserWalletDO userWalletDO = this.baseMapper.selectOne(new QueryWrapper<ComActUserWalletDO>()
                .lambda().eq(ComActUserWalletDO::getUserId,walletDetailDTO.getUserId())
                .eq(ComActUserWalletDO::getCommunityId,walletDetailDTO.getCommunityId()));
        if(userWalletDO == null){//若钱包不存在则新建钱包
            userWalletDO = new ComActUserWalletDO();
            userWalletDO.setIncomeAmount(BigDecimal.ZERO);
            userWalletDO.setAvailableAmount(BigDecimal.ZERO);
            userWalletDO.setSettlementAmount(BigDecimal.ZERO);
            userWalletDO.setUserId(walletDetailDTO.getUserId());
            userWalletDO.setCommunityId(walletDetailDTO.getCommunityId());
            userWalletDO.setEasyCount(0);
            userWalletDO.setCreateAt(new Date());
            this.baseMapper.insert(userWalletDO);
        }
        BeanUtils.copyProperties(userWalletDO,comActWalletVO);
        Map<String,String> resultMap = this.baseMapper.getCommunityName(walletDetailDTO.getCommunityId());
        if(!resultMap.isEmpty()){
            comActWalletVO.setCommunityName(resultMap.get("name"));
            comActWalletVO.setAgreement(resultMap.get("content"));
        }
        return R.ok(comActWalletVO);
    }
    /**
     * 查询用户绑定的社区收益排行榜
     * @param walletTradeDTO   请求参数
     * @return  社区收益排行榜
     */
    @Override
    public R getWalletRanking(PageComActWalletTradeDTO walletTradeDTO){
        return R.ok(this.baseMapper.getWalletRanking(new Page(walletTradeDTO.getPageNum(),walletTradeDTO.getPageSize()),walletTradeDTO));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActUserWalletTradeServiceImpl.java
New file
@@ -0,0 +1,32 @@
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.dtos.community.wallet.PageComActWalletTradeDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.dao.ComActUserWalletTradeMapper;
import com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO;
import com.panzhihua.service_community.service.ComActUserWalletTradeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * @auther lyq
 * @create 2021-06-25 10:35:22
 * @describe 用户钱包交易记录表服务实现类
 */
@Slf4j
@Service
public class ComActUserWalletTradeServiceImpl extends ServiceImpl<ComActUserWalletTradeMapper, ComActUserWalletTradeDO> implements ComActUserWalletTradeService {
    /**
     * 查询用户收支记录列表
     * @param walletTradeDTO    请求参数
     * @return  收支记录
     */
    @Override
    public R getWalletTrade(PageComActWalletTradeDTO walletTradeDTO){
        return R.ok(this.baseMapper.getUserWalletTradeList(new Page(walletTradeDTO.getPageNum(),walletTradeDTO.getPageSize()),walletTradeDTO));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoActivityDOMapper.xml
New file
@@ -0,0 +1,26 @@
<?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.ComActEasyPhotoActivityMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityDO">
        <id column="id" property="id" />
        <result column="status" property="status" />
        <result column="content" property="content" />
        <result column="activity_start_at" property="activityStartAt" />
        <result column="activity_ent_at" property="activityEndAt" />
        <result column="release_at" property="releaseAt" />
        <result column="good_reward" property="goodReward" />
        <result column="excellent_reward" property="excellentReward" />
        <result column="ordinary_reward" property="ordinaryReward" />
        <result column="count" property="count" />
        <result column="logo" property="logo" />
        <result column="create_at" property="createAt" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, status, content, activity_start_at, activity_end_at, release_at, good_reward, excellent_reward, ordinary_reward, count, create_at, logo
    </sql>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoActivityRecordDOMapper.xml
New file
@@ -0,0 +1,23 @@
<?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.ComActEasyPhotoActivityRecordMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoActivityRecordDO">
        <id column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="activity_id" property="activityId" />
        <result column="community_id" property="communityId" />
        <result column="easy_id" property="easyId" />
        <result column="type" property="type" />
        <result column="reward_amount" property="rewardAmount" />
        <result column="join_at" property="joinAt" />
        <result column="create_at" property="createAt" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user_id, activity_id, community_id, easy_id, type, reward_amount, join_at, create_at
    </sql>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletChangeDOMapper.xml
New file
@@ -0,0 +1,26 @@
<?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.ComActUserWalletChangeMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActUserWalletChangeDO">
        <id column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="community_id" property="communityId" />
        <result column="income_amount_top" property="incomeAmountTop" />
        <result column="income_amount_back" property="incomeAmountBack" />
        <result column="available_amount_top" property="availableAmountTop" />
        <result column="available_amount_back" property="availableAmountBack" />
        <result column="settlement_amount_top" property="settlementAmountTop" />
        <result column="settlement_amount_back" property="settlementAmountBack" />
        <result column="service_id" property="serviceId" />
        <result column="create_at" property="createAt" />
        <result column="wallet_id" property="walletId" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user_id, community_id, wallet_id, income_amount_top, income_amount_back, available_amount_top, available_amount_back, settlement_amount_top, settlement_amount_back, service_id, create_at
    </sql>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletDOMapper.xml
New file
@@ -0,0 +1,47 @@
<?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.ComActUserWalletMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActUserWalletDO">
        <id column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="community_id" property="communityId" />
        <result column="income_amount" property="incomeAmount" />
        <result column="available_amount" property="availableAmount" />
        <result column="settlement_amount" property="settlementAmount" />
        <result column="easy_count" property="easyCount" />
        <result column="create_at" property="createAt" />
        <result column="update_at" property="updateAt" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user_id, community_id, income_amount, available_amount, settlement_amount, easy_count, create_at, update_at
    </sql>
    <select id="getCommunityName" resultType="Map">
        SELECT
            ca.`name`,
            sua.content
        FROM
            com_act AS ca
            LEFT JOIN sys_user_agreement AS sua ON sua.community_id = ca.community_id
        WHERE
            ca.community_id = #{communityId}
    </select>
    <select id="getWalletRanking" resultType="com.panzhihua.common.model.vos.community.wallet.ComActWalletRankingVO">
        SELECT
            su.nick_name,
            cauw.income_amount,
            cauw.easy_count
        FROM
            com_act_user_wallet AS cauw
            LEFT JOIN sys_user AS su ON su.user_id = cauw.user_id
            where cauw.community_id = #{walletTradeDTO.communityId}
        ORDER BY
            cauw.income_amount DESC
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActUserWalletTradeDOMapper.xml
New file
@@ -0,0 +1,41 @@
<?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.ComActUserWalletTradeMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO">
        <id column="id" property="id" />
        <result column="user_id" property="userId" />
        <result column="community_id" property="communityId" />
        <result column="service_id" property="serviceId" />
        <result column="amount" property="amount" />
        <result column="type" property="type" />
        <result column="remark" property="remark" />
        <result column="create_at" property="createAt" />
        <result column="create_by" property="createBy" />
        <result column="wallet_id" property="walletId" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, user_id, community_id, service_id, amount, type, remark, create_at, create_by, wallet_id
    </sql>
    <select id="getUserWalletTradeList" resultType="com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO"
            parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO">
        SELECT
            cauwt.id,
            ca.`name` AS communityName,
            cauwt.type,
            cauwt.remark,
            cauwt.change_type,
            cauwt.amount,
            cauwt.create_at
        FROM
            com_act_user_wallet_trade AS cauwt
            LEFT JOIN com_act AS ca ON ca.community_id = cauwt.community_id
            where cauwt.community_id = #{walletTradeDTO.communityId}
            and cauwt.user_id = #{walletTradeDTO.userId}
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -373,8 +373,8 @@
     * @return 协议集合
     */
    @PostMapping("listagreement")
    public R listAgreement() {
        return userService.listAgreement();
    public R listAgreement(@RequestParam("communityId") Long communityId) {
        return userService.listAgreement(communityId);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserAgreementDO.java
@@ -51,4 +51,9 @@
     * 协议名字
     */
    private String name;
    /**
     * 社区id
     */
    private Long communityId;
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -193,7 +193,7 @@
     * 用户协议
     * @return 协议集合
     */
    R listAgreement();
    R listAgreement(Long communityId);
    /**
     * 编辑用户协议
     * @param sysUserAgreementVO 编辑内容
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -1117,8 +1117,9 @@
     * @return 协议集合
     */
    @Override
    public R listAgreement() {
        List<SysUserAgreementDO> sysUserAgreementDOS = sysUserAgreementDAO.selectList(new LambdaQueryWrapper<>());
    public R listAgreement(Long communityId) {
        List<SysUserAgreementDO> sysUserAgreementDOS = sysUserAgreementDAO.selectList(new LambdaQueryWrapper<SysUserAgreementDO>()
                .eq(SysUserAgreementDO::getCommunityId,communityId));
        if (ObjectUtils.isEmpty(sysUserAgreementDOS)) {
            return R.fail();
        }