| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("收益结算列表请求参数") |
| | | public class PageComActWalletTradeAdminDTO { |
| | |
| | | |
| | | @ApiModelProperty("排序(1.升序 2.降序)") |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty("变动类型(1.增加 2.减少)") |
| | | private Integer changeType; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String expenditureKeyWord; |
| | | |
| | | @ApiModelProperty("奖励内容") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("导出id集合") |
| | | private List<Long> tradeIds; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * 小程序用户信息 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "小程序用户信息") |
| | | public class AppletUserInfoVO { |
| | | |
| | | @ApiModelProperty("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("真实名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("社区名字") |
| | | private String communityName; |
| | | |
| | | @ApiModelProperty("性别 1 男 2 女") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("生日") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date birthday; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("是否志愿者 0否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("是否党员 0 否 1 是") |
| | | private Integer isPartymember; |
| | | |
| | | @ApiModelProperty("1 启用 2 禁用") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("最后登录时间") |
| | | private Date lastLoginTime; |
| | | |
| | | @ApiModelProperty("角色集合") |
| | | private Set<String> roles; |
| | | |
| | | @ApiModelProperty("权限集合") |
| | | private Set<String> permissions; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty("标签 多个用,隔开") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty(value = "分页每页数量",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty("人脸采集审核状态 0 待审核 1 审核通过 2驳回") |
| | | private Integer faceState; |
| | | |
| | | @ApiModelProperty("操作类型 1通过 2驳回 3删除") |
| | | private Integer operationType; |
| | | |
| | | @ApiModelProperty("用户小区id") |
| | | private Long areaId; |
| | | |
| | | @ApiModelProperty("用户所在社区信息") |
| | | private ComActVO comActVO; |
| | | |
| | | @ApiModelProperty("0 未申请 1 申请中 2 通过 3 驳回") |
| | | private Integer volunteerStatus; |
| | | |
| | | @ApiModelProperty("是否注册 0 否 1 是") |
| | | private Integer isRegister; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty("是否已实名(1.是 2.否)") |
| | | private Integer isRealNamed; |
| | | |
| | | @ApiModelProperty("关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty("钱包id") |
| | | private Long walletId; |
| | | |
| | | @ApiModelProperty("钱包收益总金额") |
| | | private BigDecimal incomeAmount; |
| | | |
| | | @ApiModelProperty("钱包可用金额") |
| | | private BigDecimal availableAmount; |
| | | |
| | | @ApiModelProperty("钱包结算金额") |
| | | private BigDecimal settlementAmount; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 随手拍反馈信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("随手拍反馈信息") |
| | | public class ComActEasyPhotoFeedbackVO { |
| | | |
| | | @ApiModelProperty("自增id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("随手拍id") |
| | | private Long easyId; |
| | | |
| | | @ApiModelProperty("反馈内容") |
| | | private String feedbackContent; |
| | | |
| | | @ApiModelProperty("反馈图片列表") |
| | | private String feedbackImg; |
| | | |
| | | @ApiModelProperty("反馈时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("反馈人名字") |
| | | private String createByName; |
| | | |
| | | @ApiModelProperty("反馈人头像") |
| | | private String createByImage; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "是否需要反馈 1 是 0 不是",example = "0") |
| | | private Integer isNeedFeedBack; |
| | | |
| | | @ApiModelProperty("操作类型 1审核通过 2驳回 3反馈") |
| | | @ApiModelProperty("操作类型 1审核通过 2驳回 3反馈 4.完成随手拍") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "登录用户id",hidden = true) |
| | |
| | | |
| | | @ApiModelProperty(value = "随手拍活动") |
| | | private ComActEasyPhotoActivityVO easyPhotoActivityVO; |
| | | |
| | | @ApiModelProperty(value = "关键词") |
| | | private String keyWord; |
| | | |
| | | @ApiModelProperty(value = "反馈信息列表") |
| | | private List<ComActEasyPhotoFeedbackVO> photoFeedbackList; |
| | | |
| | | @ApiModelProperty(value = "完成人名称") |
| | | private String completeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 批量导出钱包交易记录 |
| | | * @author: Null |
| | | * @date: 2021/3/11 17:11 |
| | | */ |
| | | @Data |
| | | public class ComActUserWalletTradeExcelVO implements Serializable { |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @ExcelProperty(value = "金额" ,index = 0) |
| | | private BigDecimal amount; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @ExcelProperty(value = "姓名" ,index = 1) |
| | | private String userName; |
| | | |
| | | /** |
| | | * 用户手机号 |
| | | */ |
| | | @ExcelProperty(value = "用户手机号" ,index = 2) |
| | | private String phone; |
| | | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | @ExcelProperty(value = "时间" ,index = 3) |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 操作人 |
| | | */ |
| | | @ExcelProperty(value = "操作人" ,index = 4) |
| | | private String createBy; |
| | | |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("随手拍列表统计返回参数") |
| | | public class ComActEasyPhotoStatisticsVO { |
| | |
| | | |
| | | @ApiModelProperty("已完成数量") |
| | | private Integer completeNum; |
| | | |
| | | @ApiModelProperty("优质数量") |
| | | private Integer yzAllTotal; |
| | | |
| | | @ApiModelProperty("今日优质数量") |
| | | private Integer yzDayTotal; |
| | | |
| | | @ApiModelProperty("精良数量") |
| | | private Integer jlAllTotal; |
| | | |
| | | @ApiModelProperty("今日精良数量") |
| | | private Integer jlDayTotal; |
| | | |
| | | @ApiModelProperty("普通数量") |
| | | private Integer ptAllTotal; |
| | | |
| | | @ApiModelProperty("今日普通数量") |
| | | private Integer ptDayTotal; |
| | | |
| | | @ApiModelProperty("一般数量") |
| | | private Integer ybAllTotal; |
| | | |
| | | @ApiModelProperty("今日一般数量") |
| | | private Integer ybDayTotal; |
| | | |
| | | @ApiModelProperty("奖励总数量") |
| | | private BigDecimal allRewardAmount; |
| | | |
| | | @ApiModelProperty("今日奖励数量") |
| | | private BigDecimal dayRewardAmount; |
| | | } |
| | |
| | | @ApiModelProperty("操作人") |
| | | private String operationUserName; |
| | | |
| | | @ApiModelProperty("交易备注") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | 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 ComActWalletTradeStatisticsAdminVO { |
| | | |
| | | @ApiModelProperty("今日交易金额") |
| | | private BigDecimal dayTotal; |
| | | |
| | | @ApiModelProperty("本月交易金额") |
| | | private BigDecimal monthTotal; |
| | | |
| | | @ApiModelProperty("累计交易金额") |
| | | private BigDecimal total; |
| | | } |
| | |
| | | R pageUserWalletTradeAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询用户交易记录总额 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录总额 |
| | | */ |
| | | @PostMapping("/user/wallet/trade/total") |
| | | R getTradeUserTotalWalletTradeAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询用户导出数据 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 用户导出数据 |
| | | */ |
| | | @PostMapping("/user/wallet/trade/export") |
| | | R getTradeUserTotalWalletTradeExportAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询社区统计数据 |
| | | * @param pageTradeAdminDTO 查询社区统计数据 |
| | | * @return 社区统计数据 |
| | | */ |
| | | @PostMapping("/user/wallet/trade/statistics") |
| | | R getTradeUserStatisticsAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 社区随手拍列表统计 |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | |
| | | |
| | | /** |
| | | *分页查询人口管理 |
| | | * @param loginUserInfoVO 查询参数 |
| | | * @param userInfoVO 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("pageuser") |
| | | R pageUser(@RequestBody LoginUserInfoVO loginUserInfoVO); |
| | | R pageUser(@RequestBody AppletUserInfoVO userInfoVO); |
| | | |
| | | /** |
| | | * 查询所有人员标签 |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.AddEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.EditEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityDTO; |
| | | import com.panzhihua.common.model.dtos.community.easyPhoto.PageEasyPhotoActivityUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.ComActWalletSettlementAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoActivityVO; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoActivityUserVO; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngCarExcelVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletAdminVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeAdminVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeStatisticsAdminVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Api(tags = {"财务管理模块"}) |
| | |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | |
| | | @ApiOperation(value = "分页查询收益结算列表",response = ComActWalletAdminVO.class) |
| | | @PostMapping("/page") |
| | |
| | | return communityService.pageUserWalletTradeAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户交易总额") |
| | | @PostMapping("/trade/user/total") |
| | | public R tradeUserTotal(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | pageTradeAdminDTO.setCommunityId(communityId); |
| | | return communityService.getTradeUserTotalWalletTradeAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出交易记录") |
| | | @PostMapping("/trade/export") |
| | | public R tradeExport(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | pageTradeAdminDTO.setCommunityId(communityId); |
| | | |
| | | String fileNames = ""; |
| | | if(pageTradeAdminDTO.getChangeType().equals(1)){ |
| | | fileNames = "收益明细"; |
| | | }else{ |
| | | fileNames = "结算记录"; |
| | | } |
| | | String name = fileNames + "导出数据.xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = communityService.getTradeUserTotalWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActUserWalletTradeExcelVO> userWalletTradeList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActUserWalletTradeExcelVO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ComActUserWalletTradeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(fileNames + "导出").build(); |
| | | excelWriter.write(userWalletTradeList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "交易记录统计",response = ComActWalletTradeStatisticsAdminVO.class) |
| | | @PostMapping("/trade/user/statistics") |
| | | public R tradeUserStatistics(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | pageTradeAdminDTO.setCommunityId(communityId); |
| | | return communityService.getTradeUserStatisticsAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoStatisticsVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | |
| | | public R putEasypHotoStatus(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | Long userId = this.getUserId(); |
| | | Integer type = comActEasyPhotoVO.getType(); |
| | | if (null == type || type > 3 || type < 1) { |
| | | if (null == type || type > 4 || type < 1) { |
| | | return R.fail("操作类型错误"); |
| | | } |
| | | Long id = comActEasyPhotoVO.getId(); |
| | |
| | | return communityService.deletemicrowish(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "随手拍统计") |
| | | @ApiOperation(value = "随手拍统计",response = ComActEasyPhotoStatisticsVO.class) |
| | | @GetMapping("pageeasyphoto/statistics") |
| | | public R easyPhotoStatistics() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | |
| | | import com.panzhihua.common.model.dtos.community.ExcelHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.vos.AppletUserInfoVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询人口管理",response = LoginUserInfoVO.class) |
| | | @ApiOperation(value = "分页查询人口管理",response = AppletUserInfoVO.class) |
| | | @PutMapping("pageuser") |
| | | public R pageUser(@RequestBody LoginUserInfoVO loginUserInfoVO){ |
| | | loginUserInfoVO.setCommunityId(this.getCommunityId()); |
| | | return userService.pageUser(loginUserInfoVO); |
| | | public R pageUser(@RequestBody AppletUserInfoVO userInfoVO){ |
| | | userInfoVO.setCommunityId(this.getCommunityId()); |
| | | return userService.pageUser(userInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询所有人员标签") |
| | |
| | | return comActUserWalletService.userWalletSettlementAdmin(settlementAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询交易记录 |
| | | * |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录列表 |
| | | */ |
| | | @PostMapping("/trade/page") |
| | | public R tradePage(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return comActUserWalletTradeService.pageUserWalletTradeAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户交易记录总额 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录总额 |
| | | */ |
| | | @PostMapping("/trade/total") |
| | | public R getTradeUserTotalWalletTradeAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return comActUserWalletTradeService.getTradeUserTotalWalletTradeAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | @PostMapping("/trade/statistics") |
| | | public R getTradeUserStatisticsAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return comActUserWalletTradeService.getTradeUserStatisticsAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | @PostMapping("/trade/export") |
| | | public R getTradeUserTotalWalletTradeExportAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return comActUserWalletTradeService.getTradeUserTotalWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | ")t order by t.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActEasyPhotoVO> pageEasyPhoto(Page page, @Param("comActEasyPhotoVO") ComActEasyPhotoVO comActEasyPhotoVO); |
| | | |
| | | IPage<ComActEasyPhotoVO> pageEasyPhotoAdmin(Page page, @Param("comActEasyPhotoVO") ComActEasyPhotoVO comActEasyPhotoVO); |
| | | @Select("SELECT " + |
| | | "p.id, " + |
| | | "p.sponsor_id, " + |
| | |
| | | "u.`name` sponsorName, " + |
| | | "u.nick_name userNickName, " + |
| | | "su.`name` handlerName, " + |
| | | "su1.`name` completeName, " + |
| | | "u.`image_url`, " + |
| | | "u.phone, " + |
| | | "p.detail, " + |
| | |
| | | "com_act_easy_photo p " + |
| | | "JOIN sys_user u on p.sponsor_id=u.user_id " + |
| | | "LEFT JOIN sys_user su on p.handler_id=su.user_id " + |
| | | "LEFT JOIN sys_user su1 on p.complete_id=su1.user_id " + |
| | | "LEFT JOIN com_act_easy_photo_user pu on p.id=pu.easy_photo_id " + |
| | | "WHERE p.del_tag = 0 and p.id=#{id}") |
| | | ComActEasyPhotoVO detailEasyPhoto(Long id); |
| | |
| | | "FROM com_act_easy_photo WHERE community_id = #{communityId} AND #{start} < create_at and create_at < #{end} ") |
| | | EastPhotoVO countByTime(@Param("start")String start, @Param("end")String end, @Param("nowDate")String nowDate, @Param("communityId")Long communityId); |
| | | |
| | | @Select("SELECT " + |
| | | " count( id ) AS examineNum, " + |
| | | " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 2 AND community_id = #{communityId} and del_tag = 0 ) AS verificationNum, " + |
| | | " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 3 AND community_id = #{communityId} and del_tag = 0 ) AS rejectNum, " + |
| | | " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 4 AND community_id = #{communityId} and del_tag = 0 ) AS completeNum " + |
| | | "FROM " + |
| | | " com_act_easy_photo " + |
| | | "WHERE " + |
| | | " `status` = 1 " + |
| | | " AND community_id = #{communityId} and del_tag = 0") |
| | | // @Select("SELECT " + |
| | | // " count( id ) AS examineNum, " + |
| | | // " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 2 AND community_id = #{communityId} and del_tag = 0 ) AS verificationNum, " + |
| | | // " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 3 AND community_id = #{communityId} and del_tag = 0 ) AS rejectNum, " + |
| | | // " ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 4 AND community_id = #{communityId} and del_tag = 0 ) AS completeNum " + |
| | | // "FROM " + |
| | | // " com_act_easy_photo " + |
| | | // "WHERE " + |
| | | // " `status` = 1 " + |
| | | // " AND community_id = #{communityId} and del_tag = 0") |
| | | ComActEasyPhotoStatisticsVO getEasyPhotoStatistics(@Param("communityId")Long communityId); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoFeedbackVO; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoFeedbackDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-13 14:40:06 |
| | | * @describe mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComActEasyPhotoFeedbackMapper extends BaseMapper<ComActEasyPhotoFeedbackDO> { |
| | | |
| | | List<ComActEasyPhotoFeedbackVO> getPhotoFeedbackList(@Param("easyId") Long easyId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeAdminVO; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeStatisticsAdminVO; |
| | | 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; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | */ |
| | | IPage<ComActWalletTradeVO> getUserWalletTradeList(Page page, @Param("walletTradeDTO") PageComActWalletTradeDTO walletTradeDTO); |
| | | |
| | | /** |
| | | * 分页查询交易记录 |
| | | * |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录列表 |
| | | */ |
| | | IPage<ComActWalletTradeAdminVO> getUserWalletTradeAdmin(Page page, @Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询用户交易记录总额 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录总额 |
| | | */ |
| | | BigDecimal getTradeUserTotalWalletTradeAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | List<ComActUserWalletTradeExcelVO> getTradeUserTotalWalletTradeExportAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | ComActWalletTradeStatisticsAdminVO getTradeUserStatisticsAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | } |
| | |
| | | * 活动奖励金额 |
| | | */ |
| | | private BigDecimal activityAmount; |
| | | /** |
| | | * 完成人id |
| | | */ |
| | | private Long completeId; |
| | | |
| | | /** |
| | | * 参加活动标签(1.优质 2.精良 3.普通 4.一般) |
New file |
| | |
| | | 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.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-13 14:40:06 |
| | | * @describe 实体类 |
| | | */ |
| | | |
| | | @Data |
| | | @TableName("com_act_easy_photo_feedback") |
| | | public class ComActEasyPhotoFeedbackDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 随手拍id |
| | | */ |
| | | private Long easyId; |
| | | |
| | | /** |
| | | * 反馈内容 |
| | | */ |
| | | private String feedbackContent; |
| | | |
| | | /** |
| | | * 反馈图片地址,多个以,隔开 |
| | | */ |
| | | private String feedbackImg; |
| | | |
| | | /** |
| | | * 反馈时间 |
| | | */ |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 反馈人 |
| | | */ |
| | | private Long createBy; |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComActEasyPhotoFeedbackDO{" + |
| | | "id=" + id + |
| | | ", easyId=" + easyId + |
| | | ", feedbackContent=" + feedbackContent + |
| | | ", feedbackImg=" + feedbackImg + |
| | | ", createAt=" + createAt + |
| | | ", createBy=" + createBy + |
| | | "}"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoFeedbackDO; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-13 14:40:06 |
| | | * @describe 服务类 |
| | | */ |
| | | public interface ComActEasyPhotoFeedbackService extends IService<ComActEasyPhotoFeedbackDO> { |
| | | |
| | | } |
| | |
| | | */ |
| | | Long addWalletTrade(Long userId, Long communityId, Long serviceId, BigDecimal amount,Integer type,String remark,Long createBy,Long walletId,Integer changeType); |
| | | |
| | | /** |
| | | * 分页查询交易记录 |
| | | * |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录列表 |
| | | */ |
| | | R pageUserWalletTradeAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询用户交易记录总额 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录总额 |
| | | */ |
| | | R getTradeUserTotalWalletTradeAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | R getTradeUserTotalWalletTradeExportAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | R getTradeUserStatisticsAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoFeedbackMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActEasyPhotoFeedbackDO; |
| | | import com.panzhihua.service_community.service.ComActEasyPhotoFeedbackService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-08-13 14:40:06 |
| | | * @describe 服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActEasyPhotoFeedbackServiceImpl extends ServiceImpl<ComActEasyPhotoFeedbackMapper, ComActEasyPhotoFeedbackDO> implements ComActEasyPhotoFeedbackService { |
| | | |
| | | } |
| | |
| | | private ComActUserWalletService comActUserWalletService; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | @Resource |
| | | private ComActEasyPhotoFeedbackMapper comActEasyPhotoFeedbackMapper; |
| | | /** |
| | | * 分页查询随手拍 |
| | | * |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComActEasyPhotoVO> iPage = comActEasyPhotoDAO.pageEasyPhoto(page, comActEasyPhotoVO); |
| | | IPage<ComActEasyPhotoVO> iPage = comActEasyPhotoDAO.pageEasyPhotoAdmin(page, comActEasyPhotoVO); |
| | | List<ComActEasyPhotoVO> records = iPage.getRecords(); |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActEasyPhotoVO1 -> { |
| | |
| | | } |
| | | } |
| | | |
| | | if (status.intValue()==4) { |
| | | Date feedbackAt = comActEasyPhotoVO.getFeedbackAt(); |
| | | if (null==feedbackAt) { |
| | | comActEasyPhotoVO.setFeedbackAt(comActEasyPhotoVO.getExamineAt()); |
| | | } |
| | | // if (status.equals(4)) { |
| | | // Date feedbackAt = comActEasyPhotoVO.getFeedbackAt(); |
| | | // if (null==feedbackAt) { |
| | | // comActEasyPhotoVO.setFeedbackAt(comActEasyPhotoVO.getExamineAt()); |
| | | // } |
| | | // } |
| | | |
| | | //查询反馈信息 |
| | | List<ComActEasyPhotoFeedbackVO> photoFeedbackList = comActEasyPhotoFeedbackMapper.getPhotoFeedbackList(id); |
| | | if(!photoFeedbackList.isEmpty()){ |
| | | comActEasyPhotoVO.setPhotoFeedbackList(photoFeedbackList); |
| | | } |
| | | |
| | | comActEasyPhotoVO.setPhone(SensitiveUtil.desensitizedPhoneNumber(comActEasyPhotoVO.getPhone())); |
| | | if(comActEasyPhotoVO.getAddrRemark()==null){ |
| | | comActEasyPhotoVO.setAddrRemark(""); |
| | |
| | | @Override |
| | | public R putEasypHotoStatus(ComActEasyPhotoVO comActEasyPhotoVO) { |
| | | Integer type = comActEasyPhotoVO.getType(); |
| | | // 操作类型 1审核通过 2驳回 3反馈 |
| | | ComActEasyPhotoDO cmActEasyPhotoDO=new ComActEasyPhotoDO(); |
| | | cmActEasyPhotoDO.setId(comActEasyPhotoVO.getId()); |
| | | // cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | Date date = new Date(); |
| | | comActEasyPhotoVO.setIsNeedFeedBack(1); |
| | | Date nowDate = new Date(); |
| | | // 操作类型 1审核通过 2驳回 3反馈 4完成随手拍 |
| | | ComActEasyPhotoDO cmActEasyPhotoDO = this.comActEasyPhotoDAO.selectById(comActEasyPhotoVO.getId()); |
| | | if(cmActEasyPhotoDO == null){ |
| | | return R.fail("未查询到随手拍记录"); |
| | | } |
| | | switch (type){ |
| | | case 1: |
| | | cmActEasyPhotoDO = this.comActEasyPhotoDAO.selectById(comActEasyPhotoVO.getId()); |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | return R.fail("该随手拍已审核,不可重复操作"); |
| | | } |
| | | Integer isNeedFeedBack = comActEasyPhotoVO.getIsNeedFeedBack(); |
| | | if (isNeedFeedBack==1) { |
| | | cmActEasyPhotoDO.setStatus(2);//进行中 |
| | | cmActEasyPhotoDO.setIsNeedFeedBack(1); |
| | | }else{ |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | | } |
| | | cmActEasyPhotoDO.setStatus(2);//进行中 |
| | | cmActEasyPhotoDO.setIsNeedFeedBack(1); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | if(StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) || StringUtils.isNotEmpty(comActEasyPhotoVO.getHandlePhotoList())){ |
| | | //说明此处有反馈,需要给随手拍新增反馈信息 |
| | | ComActEasyPhotoFeedbackDO photoFeedbackDO = new ComActEasyPhotoFeedbackDO(); |
| | | photoFeedbackDO.setEasyId(comActEasyPhotoVO.getId()); |
| | | photoFeedbackDO.setFeedbackContent(comActEasyPhotoVO.getHandleResult()); |
| | | photoFeedbackDO.setFeedbackImg(comActEasyPhotoVO.getHandlePhotoList()); |
| | | photoFeedbackDO.setCreateAt(nowDate); |
| | | photoFeedbackDO.setCreateBy(comActEasyPhotoVO.getUserId()); |
| | | comActEasyPhotoFeedbackMapper.insert(photoFeedbackDO); |
| | | } |
| | | //审核通过判断随手拍是否有活动并计算用户收益 |
| | | comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO); |
| | | break; |
| | | case 2: |
| | | cmActEasyPhotoDO = this.comActEasyPhotoDAO.selectById(comActEasyPhotoVO.getId()); |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | return R.fail("该随手拍已审核,不可重复操作"); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setStatus(3);//已驳回 |
| | | cmActEasyPhotoDO.setExamineAt(date); |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason()); |
| | | break; |
| | | case 3: |
| | | cmActEasyPhotoDO = this.comActEasyPhotoDAO.selectById(comActEasyPhotoVO.getId()); |
| | | if(!cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dfk)){ |
| | | return R.fail("该随手拍不是待反馈状态,不可进行反馈"); |
| | | } |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setHandleResult(comActEasyPhotoVO.getHandleResult()); |
| | | cmActEasyPhotoDO.setHandlePhotoList(comActEasyPhotoVO.getHandlePhotoList()); |
| | | cmActEasyPhotoDO.setStatus(4);//已完成 |
| | | cmActEasyPhotoDO.setFeedbackAt(date); |
| | | //给随手拍新增反馈信息 |
| | | ComActEasyPhotoFeedbackDO photoFeedbackDO = new ComActEasyPhotoFeedbackDO(); |
| | | photoFeedbackDO.setEasyId(comActEasyPhotoVO.getId()); |
| | | photoFeedbackDO.setFeedbackContent(comActEasyPhotoVO.getHandleResult()); |
| | | photoFeedbackDO.setFeedbackImg(comActEasyPhotoVO.getHandlePhotoList()); |
| | | photoFeedbackDO.setCreateAt(nowDate); |
| | | photoFeedbackDO.setCreateBy(comActEasyPhotoVO.getUserId()); |
| | | comActEasyPhotoFeedbackMapper.insert(photoFeedbackDO); |
| | | break; |
| | | case 4: |
| | | if(cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.ywc)){ |
| | | return R.fail("该随手拍已完成,不可重复操作"); |
| | | } |
| | | if(StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) || StringUtils.isNotEmpty(comActEasyPhotoVO.getHandlePhotoList())){ |
| | | //说明此处有反馈,需要给随手拍新增反馈信息 |
| | | ComActEasyPhotoFeedbackDO photoFeedback = new ComActEasyPhotoFeedbackDO(); |
| | | photoFeedback.setEasyId(comActEasyPhotoVO.getId()); |
| | | photoFeedback.setFeedbackContent(comActEasyPhotoVO.getHandleResult()); |
| | | photoFeedback.setFeedbackImg(comActEasyPhotoVO.getHandlePhotoList()); |
| | | photoFeedback.setCreateAt(nowDate); |
| | | photoFeedback.setCreateBy(comActEasyPhotoVO.getUserId()); |
| | | comActEasyPhotoFeedbackMapper.insert(photoFeedback); |
| | | } |
| | | if(cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | } |
| | | cmActEasyPhotoDO.setFeedbackAt(nowDate); |
| | | cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.ywc); |
| | | cmActEasyPhotoDO.setCompleteId(comActEasyPhotoVO.getUserId()); |
| | | break; |
| | | default:break; |
| | | } |
| | | int update = comActEasyPhotoDAO.updateById(cmActEasyPhotoDO); |
| | | if (update>0) { |
| | | if(!type.equals(3)){ |
| | | int update = comActEasyPhotoDAO.updateById(cmActEasyPhotoDO); |
| | | if (update>0) { |
| | | return R.ok(); |
| | | } |
| | | }else{ |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.wallet.ComActWalletVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoActivityMapper; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoDAO; |
| | | import com.panzhihua.service_community.dao.ComActEasyPhotoRewardMapper; |
| | | import com.panzhihua.service_community.dao.ComActUserWalletMapper; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComActUserWalletChangeService; |
| | | import com.panzhihua.service_community.service.ComActUserWalletService; |
| | |
| | | private ComActUserWalletChangeService comActUserWalletChangeService; |
| | | @Resource |
| | | private ComActEasyPhotoRewardMapper comActEasyPhotoRewardMapper; |
| | | @Resource |
| | | private ComActActSignDAO comActActSignDAO; |
| | | |
| | | /** |
| | | * 查询用户钱包信息 |
| | |
| | | } |
| | | |
| | | //查询随手拍活动 |
| | | // ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(easyPhotoDO.getActivityId()); |
| | | // if(photoActivityDO == null){ |
| | | // log.error("给用户添加收益失败,原因:未查到活动记录,活动id:" + easyPhotoDO.getActivityId()); |
| | | // return; |
| | | // } |
| | | ComActEasyPhotoActivityDO photoActivityDO = comActEasyPhotoActivityMapper.selectById(easyPhotoDO.getActivityId()); |
| | | if(photoActivityDO == null){ |
| | | log.error("给用户添加收益失败,原因:未查到活动记录,活动id:" + easyPhotoDO.getActivityId()); |
| | | return; |
| | | } |
| | | |
| | | // if(photoActivityDO.getStatus() != ComActEasyPhotoActivityDO.status.jxz){ |
| | | // log.error("给用户添加收益失败,原因:活动未在进行中,活动id:" + easyPhotoDO.getActivityId()); |
| | | // return; |
| | | // } |
| | | |
| | | //计算收益 |
| | | if(activityType.equals(ComActEasyPhotoDO.activityType.yz)){ |
| | | amount = photoActivityDO.getGoodReward(); |
| | | }else if(activityType.equals(ComActEasyPhotoDO.activityType.jl)){ |
| | | amount = photoActivityDO.getExcellentReward(); |
| | | }else if(activityType.equals(ComActEasyPhotoDO.activityType.pt)){ |
| | | amount = photoActivityDO.getOrdinaryReward(); |
| | | } |
| | | |
| | | // Date nowDate = new Date(); |
| | | //查询用户钱包 |
| | |
| | | |
| | | //新增钱包资金交易记录 |
| | | Long tradeId = comActUserWalletTradeService.addWalletTrade(easyPhotoDO.getSponsorId(),easyPhotoDO.getCommunityId() |
| | | ,easyPhotoDO.getId(),amount, ComActUserWalletTradeDO.type.fb,"发布随手拍" |
| | | ,easyPhotoDO.getId(),amount, ComActUserWalletTradeDO.type.fb,easyPhotoDO.getDetail() |
| | | ,userId,userWalletDO.getId(),ComActUserWalletTradeDO.changeType.add); |
| | | |
| | | //新增钱包资金变动记录 |
| | |
| | | easyPhotoDO.setActivityType(activityType); |
| | | easyPhotoDO.setActivityAmount(amount); |
| | | comActEasyPhotoDAO.updateById(easyPhotoDO); |
| | | |
| | | String activityTypeName = ""; |
| | | if(easyPhotoDO.getActivityType().equals(ComActEasyPhotoDO.activityType.yz)){ |
| | | activityTypeName = "优质"; |
| | | }else if(easyPhotoDO.getActivityType().equals(ComActEasyPhotoDO.activityType.jl)){ |
| | | activityTypeName = "精良"; |
| | | }else if(easyPhotoDO.getActivityType().equals(ComActEasyPhotoDO.activityType.pt)){ |
| | | activityTypeName = "普通"; |
| | | }else if(easyPhotoDO.getActivityType().equals(ComActEasyPhotoDO.activityType.yb)){ |
| | | activityTypeName = "一般"; |
| | | } |
| | | //发放奖励以后给用户推送消息 |
| | | Map<String,String> map = comActActSignDAO.getUserOpenId(easyPhotoDO.getSponsorId()); |
| | | if(map != null){ |
| | | String openid = map.get("openid"); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeJLDZ(openid,util.getAppAccessToken(),"随手拍有奖活动",amount,activityTypeName); |
| | | }catch (Exception e){ |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | return walletTradeDO.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询交易记录 |
| | | * |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录列表 |
| | | */ |
| | | @Override |
| | | public R pageUserWalletTradeAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return R.ok(this.baseMapper.getUserWalletTradeAdmin(new Page(pageTradeAdminDTO.getPageNum(),pageTradeAdminDTO.getPageSize()),pageTradeAdminDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户交易记录总额 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 交易记录总额 |
| | | */ |
| | | @Override |
| | | public R getTradeUserTotalWalletTradeAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | BigDecimal total = this.baseMapper.getTradeUserTotalWalletTradeAdmin(pageTradeAdminDTO); |
| | | if(total == null){ |
| | | total = BigDecimal.ZERO; |
| | | } |
| | | return R.ok(total); |
| | | } |
| | | |
| | | @Override |
| | | public R getTradeUserTotalWalletTradeExportAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return R.ok(this.baseMapper.getTradeUserTotalWalletTradeExportAdmin(pageTradeAdminDTO)); |
| | | } |
| | | |
| | | @Override |
| | | public R getTradeUserStatisticsAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return R.ok(this.baseMapper.getTradeUserStatisticsAdmin(pageTradeAdminDTO)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?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.ComActEasyPhotoDAO"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="sponsor_id" property="sponsorId" /> |
| | | <result column="happen_addr" property="happenAddr" /> |
| | | <result column="addr_remark" property="addrRemark" /> |
| | | <result column="status" property="status" /> |
| | | <result column="handler_id" property="handlerId" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="examine_at" property="examineAt" /> |
| | | <result column="detail" property="detail" /> |
| | | <result column="photo_path_list" property="photoPathList" /> |
| | | <result column="handle_result" property="handleResult" /> |
| | | <result column="handle_photo_list" property="handlePhotoList" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="is_hide" property="isHide" /> |
| | | <result column="is_need_feed_back" property="isNeedFeedBack" /> |
| | | <result column="feedback_at" property="feedbackAt" /> |
| | | <result column="reject_reason" property="rejectReason" /> |
| | | <result column="del_tag" property="delTag" /> |
| | | <result column="is_report" property="isReport" /> |
| | | <result column="is_publicity" property="isPublicity" /> |
| | | <result column="handle_status" property="handleStatus" /> |
| | | <result column="lng_lat" property="lngLat" /> |
| | | <result column="activity_type" property="activityType" /> |
| | | <result column="activity_amount" property="activityAmount" /> |
| | | <result column="activity_id" property="activityId" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, sponsor_id, happen_addr, addr_remark, status, handler_id, create_at, examine_at, detail, photo_path_list, handle_result, handle_photo_list, community_id, is_hide, is_need_feed_back, feedback_at, reject_reason, del_tag, is_report, is_publicity, handle_status, lng_lat, activity_type, activity_amount, activity_id |
| | | </sql> |
| | | |
| | | <select id="pageEasyPhotoAdmin" parameterType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO"> |
| | | SELECT |
| | | p.id, |
| | | u.`name` sponsor_name, |
| | | u.phone phone, |
| | | count( pu.id ) giveThumbsUpNum, |
| | | u.image_url, |
| | | p.happen_addr, |
| | | su.`name` handler_name, |
| | | p.`status`, |
| | | p.`detail`, |
| | | p.`is_need_feed_back`, |
| | | p.`photo_path_list`, |
| | | p.create_at, |
| | | p.feedback_at, |
| | | p.is_report, |
| | | p.is_publicity, |
| | | p.activity_type, |
| | | p.activity_amount, |
| | | p.activity_id, |
| | | p.examine_at |
| | | FROM |
| | | com_act_easy_photo p |
| | | LEFT JOIN sys_user u ON p.sponsor_id = u.user_id |
| | | LEFT JOIN com_act_easy_photo_user pu ON p.id = pu.easy_photo_id |
| | | LEFT JOIN sys_user su ON p.handler_id = su.user_id |
| | | WHERE |
| | | p.del_tag = 0 |
| | | <if test='comActEasyPhotoVO.communityId != null and comActEasyPhotoVO.communityId != 0'> |
| | | and p.community_id=#{comActEasyPhotoVO.communityId} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.status != null and comActEasyPhotoVO.status!=0' > |
| | | AND p.`status` = #{comActEasyPhotoVO.status} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.createBegin != null '> |
| | | AND p.create_at BETWEEN #{comActEasyPhotoVO.createBegin} |
| | | AND #{comActEasyPhotoVO.createEnd} |
| | | </if> |
| | | <if test='comActEasyPhotoVO.activityType != null'> |
| | | AND p.activity_type =#{comActEasyPhotoVO.activityType} |
| | | </if> |
| | | |
| | | <if test='comActEasyPhotoVO.keyWord != null and comActEasyPhotoVO.keyWord != ""'> |
| | | AND (u.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') or |
| | | p.happen_addr like concat(#{comActEasyPhotoVO.keyWord},'%') or |
| | | su.`name` like concat(#{comActEasyPhotoVO.keyWord},'%') |
| | | ) |
| | | </if> |
| | | GROUP BY |
| | | p.id |
| | | ORDER BY |
| | | p.create_at DESC |
| | | |
| | | </select> |
| | | |
| | | <select id="getEasyPhotoStatistics" resultType="com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoStatisticsVO"> |
| | | SELECT |
| | | count( id ) AS examineNum, |
| | | ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 2 AND community_id = #{communityId} AND del_tag = 0 ) AS verificationNum, |
| | | ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 3 AND community_id = #{communityId} AND del_tag = 0 ) AS rejectNum, |
| | | ( SELECT count( id ) FROM com_act_easy_photo WHERE `status` = 4 AND community_id = #{communityId} AND del_tag = 0 ) AS completeNum, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 1) as yzAllTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 1 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as yzDayTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 2) as jlAllTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 2 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as jlDayTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 3) as ptAllTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 3 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as ptDayTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 4) as ybAllTotal, |
| | | (select count(id) from com_act_easy_photo where `status` in (2,4) AND community_id = #{communityId} and del_tag = 0 and activity_type = 4 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as ybDayTotal, |
| | | (select sum(activity_amount) from com_act_easy_photo where `status` in (2,4) AND community_id = 2 and del_tag = 0) as allRewardAmount, |
| | | (select sum(activity_amount) from com_act_easy_photo where `status` in (2,4) AND community_id = 2 and del_tag = 0 and examine_at between timestamp(date_add(curdate(), interval - 0 day)) and now()) as dayRewardAmount |
| | | FROM |
| | | com_act_easy_photo |
| | | WHERE |
| | | `status` = 1 |
| | | AND community_id = #{communityId} |
| | | AND del_tag = 0 |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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.ComActEasyPhotoFeedbackMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActEasyPhotoFeedbackDO"> |
| | | <id column="id" property="id" /> |
| | | <result column="easy_id" property="easyId" /> |
| | | <result column="feedback_content" property="feedbackContent" /> |
| | | <result column="feedback_img" property="feedbackImg" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="create_by" property="createBy" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, easy_id, feedback_content, feedback_img, create_at, create_by |
| | | </sql> |
| | | |
| | | <select id="getPhotoFeedbackList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoFeedbackVO"> |
| | | SELECT |
| | | caepf.id, |
| | | caepf.easy_id, |
| | | caepf.feedback_content, |
| | | caepf.feedback_img, |
| | | caepf.create_at, |
| | | caepf.create_by, |
| | | su.`name` as createByName, |
| | | su.image_url as createByImage |
| | | FROM |
| | | com_act_easy_photo_feedback AS caepf |
| | | LEFT JOIN sys_user AS su ON su.user_id = caepf.create_by |
| | | WHERE |
| | | caepf.easy_id = #{easyId} |
| | | ORDER BY caepf.create_at desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | cauwt.id, |
| | | su.user_id, |
| | | cauwt.amount, |
| | | cauwt.remark, |
| | | cauwt.type, |
| | | su.`name` AS userName, |
| | | su.nick_name, |
| | |
| | | <if test="walletTradeDTO.communityId != null"> |
| | | and cauwt.community_id = #{walletTradeDTO.communityId} |
| | | </if> |
| | | <if test="walletTradeDTO.userId != null"> |
| | | and cauwt.user_id = #{walletTradeDTO.userId} |
| | | </if> |
| | | <if test="walletTradeDTO.type != null"> |
| | | and cauwt.type = #{walletTradeDTO.type} |
| | | </if> |
| | | <if test="walletTradeDTO.changeType != null"> |
| | | and cauwt.change_type = #{walletTradeDTO.changeType} |
| | | </if> |
| | | <if test="walletTradeDTO.name != null and walletTradeDTO.name != """> |
| | | AND (su.nick_name like concat (#{walletTradeDTO.name},'%') or su.name like concat (#{walletTradeDTO.name},'%')) |
| | |
| | | </if> |
| | | <if test="walletTradeDTO.endTime != null and walletTradeDTO.endTime != """> |
| | | AND cauwt.create_at <![CDATA[<=]]> #{walletTradeDTO.endTime} |
| | | </if> |
| | | <if test="walletTradeDTO.keyWord != null and walletTradeDTO.keyWord != """> |
| | | AND (su.phone like concat (#{walletTradeDTO.keyWord},'%') or su.name like concat (#{walletTradeDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="walletTradeDTO.expenditureKeyWord != null and walletTradeDTO.expenditureKeyWord != """> |
| | | AND (cauwt.remark like concat (#{walletTradeDTO.expenditureKeyWord},'%') or su1.name like concat (#{walletTradeDTO.expenditureKeyWord},'%')) |
| | | </if> |
| | | <if test="walletTradeDTO.remark != null and walletTradeDTO.remark != """> |
| | | AND cauwt.remark like concat (#{walletTradeDTO.remark},'%') |
| | | </if> |
| | | </where> |
| | | <if test="walletTradeDTO.sort == null"> |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getTradeUserTotalWalletTradeAdmin" resultType="java.math.BigDecimal" |
| | | parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO"> |
| | | SELECT |
| | | sum(cauwt.amount) |
| | | FROM |
| | | com_act_user_wallet_trade AS cauwt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cauwt.user_id |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cauwt.create_by |
| | | <where> |
| | | <if test="walletTradeDTO.communityId != null"> |
| | | and cauwt.community_id = #{walletTradeDTO.communityId} |
| | | </if> |
| | | <if test="walletTradeDTO.userId != null"> |
| | | and cauwt.user_id = #{walletTradeDTO.userId} |
| | | </if> |
| | | <if test="walletTradeDTO.type != null"> |
| | | and cauwt.type = #{walletTradeDTO.type} |
| | | </if> |
| | | <if test="walletTradeDTO.changeType != null"> |
| | | and cauwt.change_type = #{walletTradeDTO.changeType} |
| | | </if> |
| | | <if test="walletTradeDTO.keyWord != null and walletTradeDTO.keyWord != """> |
| | | AND (su.phone like concat (#{walletTradeDTO.keyWord},'%') or su.name like concat (#{walletTradeDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="walletTradeDTO.expenditureKeyWord != null and walletTradeDTO.expenditureKeyWord != """> |
| | | AND (cauwt.remark like concat (#{walletTradeDTO.expenditureKeyWord},'%') or su1.name like concat (#{walletTradeDTO.expenditureKeyWord},'%')) |
| | | </if> |
| | | <if test="walletTradeDTO.phone != null and walletTradeDTO.phone != """> |
| | | AND su.phone like concat (#{walletTradeDTO.phone},'%') |
| | | </if> |
| | | <if test="walletTradeDTO.remark != null and walletTradeDTO.remark != """> |
| | | AND cauwt.remark like concat (#{walletTradeDTO.remark},'%') |
| | | </if> |
| | | <if test="walletTradeDTO.startTime != null and walletTradeDTO.startTime != """> |
| | | AND cauwt.create_at <![CDATA[>=]]> #{walletTradeDTO.startTime} |
| | | </if> |
| | | <if test="walletTradeDTO.endTime != null and walletTradeDTO.endTime != """> |
| | | AND cauwt.create_at <![CDATA[<=]]> #{walletTradeDTO.endTime} |
| | | </if> |
| | | </where> |
| | | |
| | | <if test="walletTradeDTO.sort == null"> |
| | | order by cauwt.create_at desc |
| | | </if> |
| | | <if test="walletTradeDTO.sort != null and walletTradeDTO.sort == 1"> |
| | | order by cauwt.amount asc |
| | | </if> |
| | | <if test="walletTradeDTO.sort != null and walletTradeDTO.sort == 2"> |
| | | order by cauwt.amount desc |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getTradeUserTotalWalletTradeExportAdmin" parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActUserWalletTradeExcelVO"> |
| | | SELECT |
| | | cauwt.amount,su1.`name` as userName,su1.phone,cauwt.create_at,su.`name` as createBy |
| | | FROM |
| | | com_act_user_wallet_trade AS cauwt |
| | | LEFT JOIN sys_user AS su ON su.user_id = cauwt.create_by |
| | | LEFT JOIN sys_user AS su1 ON su1.user_id = cauwt.user_id |
| | | <where> |
| | | <if test="walletTradeDTO.communityId != null"> |
| | | and cauwt.community_id = #{walletTradeDTO.communityId} |
| | | </if> |
| | | <if test="walletTradeDTO.userId != null"> |
| | | and cauwt.user_id = #{walletTradeDTO.userId} |
| | | </if> |
| | | <if test="walletTradeDTO.type != null"> |
| | | and cauwt.type = #{walletTradeDTO.type} |
| | | </if> |
| | | <if test="walletTradeDTO.changeType != null"> |
| | | and cauwt.change_type = #{walletTradeDTO.changeType} |
| | | </if> |
| | | <if test="walletTradeDTO.keyWord != null and walletTradeDTO.keyWord != """> |
| | | AND (su.phone like concat (#{walletTradeDTO.keyWord},'%') or su.name like concat (#{walletTradeDTO.keyWord},'%')) |
| | | </if> |
| | | <if test="walletTradeDTO.startTime != null and walletTradeDTO.startTime != """> |
| | | AND cauwt.create_at <![CDATA[>=]]> #{walletTradeDTO.startTime} |
| | | </if> |
| | | <if test="walletTradeDTO.endTime != null and walletTradeDTO.endTime != """> |
| | | AND cauwt.create_at <![CDATA[<=]]> #{walletTradeDTO.endTime} |
| | | </if> |
| | | <if test="walletTradeDTO.tradeIds != null and walletTradeDTO.tradeIds.size > 0"> |
| | | AND cauwt.id in |
| | | <foreach collection='walletTradeDTO.tradeIds' item='id' index='index' open='(' close=')' separator=',' > |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | |
| | | <if test="walletTradeDTO.sort == null"> |
| | | order by cauwt.create_at desc |
| | | </if> |
| | | <if test="walletTradeDTO.sort != null and walletTradeDTO.sort == 1"> |
| | | order by cauwt.amount asc |
| | | </if> |
| | | <if test="walletTradeDTO.sort != null and walletTradeDTO.sort == 2"> |
| | | order by cauwt.amount desc |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <select id="getTradeUserStatisticsAdmin" parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeStatisticsAdminVO"> |
| | | SELECT |
| | | sum( amount ) as dayTotal, |
| | | (select sum(amount) from com_act_user_wallet_trade where community_id = #{walletTradeDTO.communityId} and change_type = #{walletTradeDTO.changeType} and create_at between timestamp(DATE_ADD(curdate(),interval -day(curdate())+1 day)) and now()) as monthTotal, |
| | | (select sum(amount) from com_act_user_wallet_trade where community_id = #{walletTradeDTO.communityId} and change_type = #{walletTradeDTO.changeType}) as total |
| | | FROM |
| | | com_act_user_wallet_trade |
| | | where community_id = #{walletTradeDTO.communityId} and change_type = #{walletTradeDTO.changeType} |
| | | and create_at between timestamp(date_add(curdate(), interval - 0 day)) and now() |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.grid.*; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.EditUserInfoPassAppDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | |
| | | /** |
| | | * 分页查询人口管理 |
| | | * |
| | | * @param loginUserInfoVO 查询参数 |
| | | * @param userInfoVO 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @PostMapping("pageuser") |
| | | public R pageUser(@RequestBody LoginUserInfoVO loginUserInfoVO) { |
| | | return userService.pageUser(loginUserInfoVO); |
| | | public R pageUser(@RequestBody AppletUserInfoVO userInfoVO) { |
| | | return userService.pageUser(userInfoVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.panzhihua.common.model.dtos.grid.PageEventGridMemberRelationDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.vos.AppletUserInfoVO; |
| | | import com.panzhihua.common.model.vos.IndexDataKanbanVO; |
| | | import com.panzhihua.common.model.vos.IndexDataVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | |
| | | "</script>") |
| | | IPage<LoginUserInfoVO> pageUserFace(Page page, @Param("loginUserInfoVO") LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "u.user_id,\n" + |
| | | "u.`name`,\n" + |
| | | "u.`sex`,\n" + |
| | | "u.nick_name,\n" + |
| | | "u.phone,\n" + |
| | | "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n"+ |
| | | "1 isRegister,\n"+ |
| | | "v.political_face political_outlook,\n"+ |
| | | "u.id_card,\n" + |
| | | "u.job,\n" + |
| | | "c.area_name communityName,\n" + |
| | | "u.tags,\n" + |
| | | "u.create_at \n" + |
| | | "FROM\n" + |
| | | "sys_user u\n" + |
| | | "left join com_mng_volunteer_mng v on u.phone=v.phone \n"+ |
| | | "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | " </if> " + |
| | | "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == ""'>" + |
| | | "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | " </if> " + |
| | | "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + |
| | | " </if> " + |
| | | " where u.community_id=#{loginUserInfoVO.communityId} and u.type=1 " + |
| | | "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" + |
| | | " and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + |
| | | " </if> " + |
| | | "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" + |
| | | "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + |
| | | " </if> " + |
| | | " order by u.user_id desc " + |
| | | "</script>") |
| | | IPage<LoginUserInfoVO> pageUser(Page page, @Param("loginUserInfoVO") LoginUserInfoVO loginUserInfoVO); |
| | | // @Select("<script> " + |
| | | // "SELECT\n" + |
| | | // "u.user_id,\n" + |
| | | // "u.`name`,\n" + |
| | | // "u.`sex`,\n" + |
| | | // "u.nick_name,\n" + |
| | | // "u.phone,\n" + |
| | | // "YEAR (now()) - YEAR (substring(u.id_card, 7, 8)) age,\n"+ |
| | | // "1 isRegister,\n"+ |
| | | // "v.political_face political_outlook,\n"+ |
| | | // "u.id_card,\n" + |
| | | // "u.job,\n" + |
| | | // "c.area_name communityName,\n" + |
| | | // "u.tags,\n" + |
| | | // "u.create_at \n" + |
| | | // "FROM\n" + |
| | | // "sys_user u\n" + |
| | | // "left join com_mng_volunteer_mng v on u.phone=v.phone \n"+ |
| | | // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | // " JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.communityName == null or loginUserInfoVO.communityName.trim() == ""'>" + |
| | | // "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != ""'>" + |
| | | // "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%') \n" + |
| | | // " </if> " + |
| | | // " where u.community_id=#{loginUserInfoVO.communityId} and u.type=1 " + |
| | | // "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != ""'>" + |
| | | // " and u.`name` like concat(#{loginUserInfoVO.name},'%') \n" + |
| | | // " </if> " + |
| | | // "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != ""'>" + |
| | | // "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " + |
| | | // " </if> " + |
| | | // " order by u.user_id desc " + |
| | | // "</script>") |
| | | IPage<AppletUserInfoVO> pageUser(Page page, @Param("loginUserInfoVO") AppletUserInfoVO userInfoVO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.EditUserInfoPassAppDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | R putUserFace(LoginUserInfoVO loginUserInfoVO); |
| | | /** |
| | | *分页查询人口管理 |
| | | * @param loginUserInfoVO 查询参数 |
| | | * @param userInfoVO 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | R pageUser(LoginUserInfoVO loginUserInfoVO); |
| | | R pageUser(AppletUserInfoVO userInfoVO); |
| | | /** |
| | | * 查询所有人员标签 |
| | | * @return 标签集合 |
| | |
| | | /** |
| | | * 分页查询人口管理 |
| | | * |
| | | * @param loginUserInfoVO 查询参数 |
| | | * @param userInfoVO 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | @Override |
| | | public R pageUser(LoginUserInfoVO loginUserInfoVO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = loginUserInfoVO.getPageNum(); |
| | | Long pageSize = loginUserInfoVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<LoginUserInfoVO> iPage = userDao.pageUser(page, loginUserInfoVO); |
| | | public R pageUser(AppletUserInfoVO userInfoVO) { |
| | | IPage<AppletUserInfoVO> iPage = userDao.pageUser(new Page<>(userInfoVO.getPageNum(),userInfoVO.getPageSize()), userInfoVO); |
| | | iPage.getRecords().forEach(record -> { |
| | | record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone())); |
| | | record.setIdCard(SensitiveUtil.desensitizedIdNumber(record.getIdCard())); |
| | |
| | | */ |
| | | @Override |
| | | public R putUserCommunityArea(LoginUserInfoVO loginUserInfoVO) { |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | // sysUserDO.setAreaId(loginUserInfoVO.getAreaId()); |
| | | sysUserDO.setUserId(loginUserInfoVO.getUserId()); |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (update > 0) { |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + loginUserInfoVO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // SysUserDO sysUserDO = new SysUserDO(); |
| | | // sysUserDO.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | //// sysUserDO.setAreaId(loginUserInfoVO.getAreaId()); |
| | | // sysUserDO.setUserId(loginUserInfoVO.getUserId()); |
| | | // int update = userDao.updateById(sysUserDO); |
| | | // if (update > 0) { |
| | | // //删除用户信息缓存 |
| | | // String userKey = UserConstants.LOGIN_USER_INFO + loginUserInfoVO.getUserId(); |
| | | // stringRedisTemplate.delete(userKey); |
| | | // return R.fail(); |
| | | // } |
| | | return R.fail(); |
| | | } |
| | | |
New file |
| | |
| | | <?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_user.dao.UserDao"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.panzhihua.service_user.model.dos.SysUserDO"> |
| | | <id column="user_id" property="userId" /> |
| | | <result column="account" property="account" /> |
| | | <result column="password" property="password" /> |
| | | <result column="openid" property="openid" /> |
| | | <result column="session_key" property="sessionKey" /> |
| | | <result column="unionid" property="unionid" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="nick_name" property="nickName" /> |
| | | <result column="name" property="name" /> |
| | | <result column="community_id" property="communityId" /> |
| | | <result column="sex" property="sex" /> |
| | | <result column="id_card" property="idCard" /> |
| | | <result column="birthday" property="birthday" /> |
| | | <result column="image_url" property="imageUrl" /> |
| | | <result column="type" property="type" /> |
| | | <result column="job" property="job" /> |
| | | <result column="is_volunteer" property="isVolunteer" /> |
| | | <result column="is_partymember" property="isPartymember" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="last_login_time" property="lastLoginTime" /> |
| | | <result column="tags" property="tags" /> |
| | | <result column="family_id" property="familyId" /> |
| | | <result column="face_url" property="faceUrl" /> |
| | | <result column="face_state" property="faceState" /> |
| | | <result column="reject_reson" property="rejectReson" /> |
| | | <result column="area_id" property="areaId" /> |
| | | <result column="card_photo_front" property="cardPhotoFront" /> |
| | | <result column="card_photo_back" property="cardPhotoBack" /> |
| | | <result column="family_book" property="familyBook" /> |
| | | <result column="continuous_landing_days" property="continuousLandingDays" /> |
| | | <result column="is_tips" property="isTips" /> |
| | | <result column="work_status" property="workStatus" /> |
| | | <result column="work_start_time" property="workStartTime" /> |
| | | <result column="work_end_time" property="workEndTime" /> |
| | | <result column="big_age_tips" property="bigAgeTips" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | 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 |
| | | </sql> |
| | | |
| | | <select id="pageUser" parameterType="com.panzhihua.common.model.vos.AppletUserInfoVO" |
| | | resultType="com.panzhihua.common.model.vos.AppletUserInfoVO"> |
| | | SELECT |
| | | u.user_id, |
| | | u.`name`, |
| | | u.`sex`, |
| | | u.nick_name, |
| | | u.phone, |
| | | u.birthday, |
| | | YEAR ( |
| | | now()) - YEAR ( |
| | | substring( u.id_card, 7, 8 )) age, |
| | | 1 isRegister, |
| | | v.political_face political_outlook, |
| | | u.id_card, |
| | | u.job, |
| | | c.`name` communityName, |
| | | u.tags, |
| | | cauw.id as walletId, |
| | | IFNULL(cauw.income_amount,0) as income_amount, |
| | | IFNULL(cauw.available_amount,0) as available_amount, |
| | | IFNULL(cauw.settlement_amount,0) as settlement_amount, |
| | | IF(u.id_card,1,2) as isRealNamed, |
| | | u.create_at |
| | | FROM |
| | | sys_user u |
| | | LEFT JOIN com_mng_volunteer_mng v ON u.phone = v.phone |
| | | LEFT JOIN com_act AS c ON c.community_id = u.community_id |
| | | LEFT JOIN com_act_user_wallet as cauw on u.user_id = cauw.user_id and u.community_id = cauw.community_id |
| | | WHERE |
| | | u.community_id = #{loginUserInfoVO.communityId} |
| | | AND u.type = 1 |
| | | <if test='loginUserInfoVO.keyWord != null and loginUserInfoVO.keyWord.trim() != ""'> |
| | | AND (u.phone like concat(#{loginUserInfoVO.keyWord},'%') or |
| | | u.`name` like concat(#{loginUserInfoVO.keyWord},'%') or c.`name` like concat(#{loginUserInfoVO.keyWord},'%')) |
| | | </if> |
| | | <if test='loginUserInfoVO.isRealNamed != null and loginUserInfoVO.isRealNamed == 1'> |
| | | AND u.id_card is not null |
| | | </if> |
| | | <if test='loginUserInfoVO.isRealNamed != null and loginUserInfoVO.isRealNamed == 2'> |
| | | AND u.id_card is null |
| | | </if> |
| | | ORDER BY |
| | | u.user_id DESC |
| | | </select> |
| | | |
| | | </mapper> |