| | |
| | | @ApiModelProperty("钱包结算金额") |
| | | private BigDecimal settlementAmount; |
| | | |
| | | @ApiModelProperty("积分总余额") |
| | | private Integer integralSum; |
| | | |
| | | @ApiModelProperty("积分可用余额") |
| | | private Integer integralAvailableSum; |
| | | |
| | | @ApiModelProperty("积分冻结金额") |
| | | private Integer integralFrozenSum; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 用户手机号 |
| | | */ |
| | | @ExcelProperty(value = "用户手机号" ,index = 2) |
| | | @ExcelProperty(value = "账号" ,index = 2) |
| | | private String phone; |
| | | |
| | | /** |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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 ComActUserWalletTradeRewardExcelVO 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) |
| | | private String type; |
| | | |
| | | @ExcelProperty(value = "奖励内容" ,index = 4) |
| | | private String remark; |
| | | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | @ExcelProperty(value = "时间" ,index = 5) |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 操作人 |
| | | */ |
| | | @ExcelProperty(value = "操作人" ,index = 6) |
| | | private String createBy; |
| | | |
| | | } |
| | | |
| | |
| | | R getTradeUserTotalWalletTradeExportAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 导出奖励台账数据 |
| | | * @param pageTradeAdminDTO 请求参数 |
| | | * @return 奖励台账数据 |
| | | */ |
| | | @PostMapping("/user/wallet/trade/reward/export") |
| | | R getTradeUserTotalJLWalletTradeExportAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | /** |
| | | * 查询社区统计数据 |
| | | * @param pageTradeAdminDTO 查询社区统计数据 |
| | | * @return 社区统计数据 |
| | |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeRewardExcelVO; |
| | | 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; |
| | |
| | | |
| | | String fileNames = ""; |
| | | if(pageTradeAdminDTO.getChangeType().equals(1)){ |
| | | fileNames = "收益明细"; |
| | | fileNames = "奖励台账"; |
| | | }else{ |
| | | fileNames = "结算记录"; |
| | | } |
| | |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = communityService.getTradeUserTotalWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | if (R.isOk(r)) { |
| | | List<ComActUserWalletTradeExcelVO> userWalletTradeList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActUserWalletTradeExcelVO.class); |
| | | List<ComActUserWalletTradeExcelVO> jsTradeList = null; |
| | | List<ComActUserWalletTradeRewardExcelVO> jlTradeList = null; |
| | | if(pageTradeAdminDTO.getChangeType().equals(1)){ |
| | | r = communityService.getTradeUserTotalJLWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | jlTradeList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActUserWalletTradeRewardExcelVO.class); |
| | | }else{ |
| | | jsTradeList = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActUserWalletTradeExcelVO.class); |
| | | } |
| | | |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | if(pageTradeAdminDTO.getChangeType().equals(1)){ |
| | | excelWriter = EasyExcel.write(fileName, ComActUserWalletTradeRewardExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(fileNames + "导出").build(); |
| | | excelWriter.write(jlTradeList, writeSheet); |
| | | }else{ |
| | | excelWriter = EasyExcel.write(fileName, ComActUserWalletTradeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(fileNames + "导出").build(); |
| | | excelWriter.write(userWalletTradeList, writeSheet); |
| | | excelWriter.write(jsTradeList, writeSheet); |
| | | } |
| | | |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | |
| | | return comActUserWalletTradeService.getTradeUserTotalWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | @PostMapping("/trade/reward/export") |
| | | public R getTradeUserTotalJLWalletTradeExportAdmin(@RequestBody PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return comActUserWalletTradeService.getTradeUserTotalJLWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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.ComActUserWalletTradeRewardExcelVO; |
| | | 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; |
| | |
| | | |
| | | List<ComActUserWalletTradeExcelVO> getTradeUserTotalWalletTradeExportAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | List<ComActUserWalletTradeRewardExcelVO> getTradeUserTotalJLWalletTradeExportAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | ComActWalletTradeStatisticsAdminVO getTradeUserStatisticsAdmin(@Param("walletTradeDTO") PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | } |
| | |
| | | |
| | | R getTradeUserTotalWalletTradeExportAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | R getTradeUserTotalJLWalletTradeExportAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | |
| | | R getTradeUserStatisticsAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO); |
| | | } |
| | |
| | | if(cmActEasyPhotoDO.getStatus().equals(ComActEasyPhotoDO.status.dsh)){ |
| | | cmActEasyPhotoDO.setExamineAt(nowDate); |
| | | cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId()); |
| | | cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); |
| | | //审核通过判断随手拍是否有活动并计算用户收益 |
| | | comActUserWalletService.examineAddMoney(comActEasyPhotoVO.getActivityType(),comActEasyPhotoVO.getId(),comActEasyPhotoVO.getUserId(),BigDecimal.ZERO); |
| | | } |
| | | cmActEasyPhotoDO.setFeedbackAt(nowDate); |
| | | cmActEasyPhotoDO.setStatus(ComActEasyPhotoDO.status.ywc); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | |
| | | String openid = map.get("openid"); |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | WxUtil.sendSubscribeJLDZ(openid,util.getAppAccessToken(),"随手拍有奖活动",amount,activityTypeName); |
| | | WxUtil.sendSubscribeJLDZ(openid,util.getAppAccessToken(),"随手拍有奖活动",amount.setScale(2, RoundingMode.HALF_UP),activityTypeName); |
| | | }catch (Exception e){ |
| | | log.error("消息推送失败,失败原因:" + e.getMessage()); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO; |
| | | import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActUserWalletTradeRewardExcelVO; |
| | | import com.panzhihua.service_community.dao.ComActUserWalletTradeMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActUserWalletTradeDO; |
| | | import com.panzhihua.service_community.service.ComActUserWalletTradeService; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R getTradeUserTotalJLWalletTradeExportAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | List<ComActUserWalletTradeRewardExcelVO> tradeList = this.baseMapper.getTradeUserTotalJLWalletTradeExportAdmin(pageTradeAdminDTO); |
| | | tradeList.forEach(trade -> { |
| | | if(trade.getType().equals("1")){ |
| | | trade.setType("发布随手拍"); |
| | | } |
| | | }); |
| | | return R.ok(tradeList); |
| | | } |
| | | |
| | | @Override |
| | | public R getTradeUserStatisticsAdmin(PageComActWalletTradeAdminDTO pageTradeAdminDTO){ |
| | | return R.ok(this.baseMapper.getTradeUserStatisticsAdmin(pageTradeAdminDTO)); |
| | | } |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getTradeUserTotalJLWalletTradeExportAdmin" parameterType="com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeAdminDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActUserWalletTradeRewardExcelVO"> |
| | | SELECT |
| | | cauwt.amount,su1.`name` as userName,su1.phone,cauwt.create_at,su.`name` as createBy,cauwt.type,cauwt.remark |
| | | 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 |
| | |
| | | IFNULL(cauw.income_amount,0) as income_amount, |
| | | IFNULL(cauw.available_amount,0) as available_amount, |
| | | IFNULL(cauw.settlement_amount,0) as settlement_amount, |
| | | IFNULL(caiu.integral_sum,0) as integral_sum, |
| | | IFNULL(caiu.integral_available_sum,0) as integral_available_sum, |
| | | IFNULL(caiu.integral_frozen_sum,0) as integral_frozen_sum, |
| | | IF(u.id_card,1,2) as isRealNamed, |
| | | u.create_at |
| | | FROM |
| | |
| | | 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 |
| | | LEFT JOIN com_act_integral_user as caiu on u.user_id = caiu.user_id and u.community_id = caiu.community_id |
| | | WHERE |
| | | u.community_id = #{loginUserInfoVO.communityId} |
| | | AND u.type = 1 |