Commit fa208304 by YG8429

绑定关系查询,权益金日志查询修改查询方法,增加vo对象

parent b54414a1
...@@ -17,6 +17,7 @@ import share.common.core.controller.BaseController; ...@@ -17,6 +17,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.system.domain.EquityFundLog; import share.system.domain.EquityFundLog;
import share.system.domain.vo.EquityFundLogVo;
import share.system.service.EquityFundLogService; import share.system.service.EquityFundLogService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
...@@ -42,7 +43,7 @@ public class EquityFundLogController extends BaseController ...@@ -42,7 +43,7 @@ public class EquityFundLogController extends BaseController
public TableDataInfo list(EquityFundLog equityFundLog) public TableDataInfo list(EquityFundLog equityFundLog)
{ {
startPage(); startPage();
List<EquityFundLog> list = equityFundLogService.selectEquityFundLogList(equityFundLog); List<EquityFundLogVo> list = equityFundLogService.selectEquityFundLogList(equityFundLog);
return getDataTable(list); return getDataTable(list);
} }
...@@ -54,8 +55,8 @@ public class EquityFundLogController extends BaseController ...@@ -54,8 +55,8 @@ public class EquityFundLogController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, EquityFundLog equityFundLog) public void export(HttpServletResponse response, EquityFundLog equityFundLog)
{ {
List<EquityFundLog> list = equityFundLogService.selectEquityFundLogList(equityFundLog); List<EquityFundLogVo> list = equityFundLogService.selectEquityFundLogList(equityFundLog);
ExcelUtil<EquityFundLog> util = new ExcelUtil<EquityFundLog>(EquityFundLog.class); ExcelUtil<EquityFundLogVo> util = new ExcelUtil<EquityFundLogVo>(EquityFundLogVo.class);
util.exportExcel(response, list, "权益金记录数据"); util.exportExcel(response, list, "权益金记录数据");
} }
......
...@@ -18,6 +18,7 @@ import share.common.core.controller.BaseController; ...@@ -18,6 +18,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.system.domain.SharingActivities; import share.system.domain.SharingActivities;
import share.system.domain.vo.SharingActivitiesVo;
import share.system.service.SharingActivitiesService; import share.system.service.SharingActivitiesService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
...@@ -41,7 +42,7 @@ public class SharingActivitiesController extends BaseController { ...@@ -41,7 +42,7 @@ public class SharingActivitiesController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SharingActivities sharingActivities) { public TableDataInfo list(SharingActivities sharingActivities) {
startPage(); startPage();
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities); List<SharingActivitiesVo> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return getDataTable(list); return getDataTable(list);
} }
...@@ -52,8 +53,8 @@ public class SharingActivitiesController extends BaseController { ...@@ -52,8 +53,8 @@ public class SharingActivitiesController extends BaseController {
@Log(title = "分享活动绑定关系", businessType = BusinessType.EXPORT) @Log(title = "分享活动绑定关系", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SharingActivities sharingActivities) { public void export(HttpServletResponse response, SharingActivities sharingActivities) {
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities); List<SharingActivitiesVo> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
ExcelUtil<SharingActivities> util = new ExcelUtil<SharingActivities>(SharingActivities.class); ExcelUtil<SharingActivitiesVo> util = new ExcelUtil<SharingActivitiesVo>(SharingActivitiesVo.class);
util.exportExcel(response, list, "分享活动绑定关系数据"); util.exportExcel(response, list, "分享活动绑定关系数据");
} }
......
...@@ -12,6 +12,7 @@ import share.common.utils.poi.ExcelUtil; ...@@ -12,6 +12,7 @@ import share.common.utils.poi.ExcelUtil;
import share.system.domain.EquityFundLog; import share.system.domain.EquityFundLog;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.vo.DurationLogVo; import share.system.domain.vo.DurationLogVo;
import share.system.domain.vo.EquityFundLogVo;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.service.EquityFundLogService; import share.system.service.EquityFundLogService;
...@@ -38,7 +39,7 @@ public class EquityFundLogController extends BaseController { ...@@ -38,7 +39,7 @@ public class EquityFundLogController extends BaseController {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
equityFundLog.setUid(user.getId()); equityFundLog.setUid(user.getId());
List<EquityFundLog> list = equityFundLogService.selectEquityFundLogList(equityFundLog); List<EquityFundLogVo> list = equityFundLogService.selectEquityFundLogList(equityFundLog);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -13,6 +13,7 @@ import share.system.domain.EquityFundLog; ...@@ -13,6 +13,7 @@ import share.system.domain.EquityFundLog;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.SharingActivities; import share.system.domain.SharingActivities;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SharingActivitiesVo;
import share.system.service.SharingActivitiesService; import share.system.service.SharingActivitiesService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -34,11 +35,11 @@ public class SharingActivitiesController extends BaseController { ...@@ -34,11 +35,11 @@ public class SharingActivitiesController extends BaseController {
* 查询分享活动绑定关系列表 * 查询分享活动绑定关系列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SharingActivities sharingActivities) { public TableDataInfo list(SharingActivitiesVo sharingActivities) {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sharingActivities.setUid(user.getId()); sharingActivities.setUid(user.getId());
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities); List<SharingActivitiesVo> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return getDataTable(list); return getDataTable(list);
} }
...@@ -46,7 +47,7 @@ public class SharingActivitiesController extends BaseController { ...@@ -46,7 +47,7 @@ public class SharingActivitiesController extends BaseController {
public AjaxResult query(SharingActivities sharingActivities) { public AjaxResult query(SharingActivities sharingActivities) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sharingActivities.setNewUid(user.getId()); sharingActivities.setNewUid(user.getId());
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities); List<SharingActivitiesVo> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return success(list); return success(list);
} }
......
...@@ -428,10 +428,6 @@ public class RedisTask { ...@@ -428,10 +428,6 @@ public class RedisTask {
consumerWallet.setUpdateTime(DateUtils.getNowDate()); consumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(consumerWallet); consumerWalletService.updateConsumerWallet(consumerWallet);
//添加权益金日志记录 //添加权益金日志记录
//下级用户
SConsumer newConsumer = consumerService.getById(sOrder.getConsumerId());
//上级用户
SConsumer consumer = consumerService.getById(sharingActivities.getUid());
EquityFundLog equityFundLog = new EquityFundLog(); EquityFundLog equityFundLog = new EquityFundLog();
equityFundLog.setEquityFund(addEquityFund); equityFundLog.setEquityFund(addEquityFund);
equityFundLog.setEquityFundType(EquityFundTypeEnum.ORDER.getCode()); equityFundLog.setEquityFundType(EquityFundTypeEnum.ORDER.getCode());
...@@ -439,14 +435,6 @@ public class RedisTask { ...@@ -439,14 +435,6 @@ public class RedisTask {
equityFundLog.setTerminalTrace(sOrder.getOutTradeNo()); equityFundLog.setTerminalTrace(sOrder.getOutTradeNo());
equityFundLog.setUid(sharingActivities.getUid()); equityFundLog.setUid(sharingActivities.getUid());
equityFundLog.setNewUid(sharingActivities.getNewUid()); equityFundLog.setNewUid(sharingActivities.getNewUid());
equityFundLog.setPhone(consumer.getPhone());
equityFundLog.setAccount(consumer.getAccount());
equityFundLog.setNickName(consumer.getNickName());
equityFundLog.setAvatar(consumer.getAvatar());
equityFundLog.setNewAvatar(newConsumer.getAvatar());
equityFundLog.setNewPhone(newConsumer.getPhone());
equityFundLog.setNewAccount(newConsumer.getAccount());
equityFundLog.setNewNickName(newConsumer.getNickName());
equityFundLogService.insertEquityFundLog(equityFundLog); equityFundLogService.insertEquityFundLog(equityFundLog);
} }
} }
......
...@@ -54,37 +54,7 @@ public class EquityFundLog extends BaseEntity ...@@ -54,37 +54,7 @@ public class EquityFundLog extends BaseEntity
@TableField(select = false) @TableField(select = false)
private Long isDelete; private Long isDelete;
/** 上级电话 */
@Excel(name = "上级电话")
private String phone;
/** 上级账号 */
@Excel(name = "上级账号")
private String account;
/** 上级用户昵称 */
@Excel(name = "上级用户昵称")
private String nickName;
/** 下级电话 */
@Excel(name = "下级电话")
private String newPhone;
/** 下级账号 */
@Excel(name = "下级账号")
private String newAccount;
/** 下级用户昵称 */
@Excel(name = "下级用户昵称")
private String newNickName;
/** 上级用户头像 */
@Excel(name = "上级用户头像")
private String avatar;
/** 下级用户头像 */
@Excel(name = "下级用户头像")
private String newAvatar;
@Override @Override
...@@ -103,14 +73,6 @@ public class EquityFundLog extends BaseEntity ...@@ -103,14 +73,6 @@ public class EquityFundLog extends BaseEntity
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.append("phone", getPhone())
.append("account", getAccount())
.append("nickName", getNickName())
.append("newPhone", getNewPhone())
.append("newAccount", getNewAccount())
.append("newNickName", getNewNickName())
.append("avatar", getAvatar())
.append("newAvatar", getNewAvatar())
.toString(); .toString();
} }
} }
...@@ -40,29 +40,7 @@ public class SharingActivities extends BaseEntity ...@@ -40,29 +40,7 @@ public class SharingActivities extends BaseEntity
@TableField(select = false) @TableField(select = false)
private Long isDelete; private Long isDelete;
/** 上级用户头像 */
@Excel(name = "上级用户头像")
private String avatar;
/** 下级用户头像 */
@Excel(name = "下级用户头像")
private String newAvatar;
/** 上级用户昵称 */
@Excel(name = "上级用户昵称")
private String nickName;
/** 下级用户昵称 */
@Excel(name = "下级用户昵称")
private String newNickName;
/** 上级电话 */
@Excel(name = "上级电话")
private String phone;
/** 下级电话 */
@Excel(name = "下级电话")
private String newPhone;
@Override @Override
...@@ -78,12 +56,6 @@ public class SharingActivities extends BaseEntity ...@@ -78,12 +56,6 @@ public class SharingActivities extends BaseEntity
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.append("avatar", getAvatar())
.append("newAvatar", getNewAvatar())
.append("nickName", getNickName())
.append("newNickName", getNewNickName())
.append("phone", getPhone())
.append("newPhone", getNewPhone())
.toString(); .toString();
} }
} }
package share.system.domain.vo;
import lombok.Data;
import share.common.annotation.Excel;
import share.system.domain.EquityFundLog;
@Data
public class EquityFundLogVo extends EquityFundLog {
/** 上级电话 */
private String phone;
/** 上级账号 */
private String account;
/** 上级用户昵称 */
private String nickName;
/** 下级电话 */
private String newPhone;
/** 下级账号 */
private String newAccount;
/** 下级用户昵称 */
private String newNickName;
/** 上级用户头像 */
private String avatar;
/** 下级用户头像 */
private String newAvatar;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.SharingActivities;
@Data
public class SharingActivitiesVo extends SharingActivities {
/** 上级用户头像 */
private String avatar;
/** 下级用户头像 */
private String newAvatar;
/** 上级用户昵称 */
private String nickName;
/** 下级用户昵称 */
private String newNickName;
/** 上级电话 */
private String phone;
/** 下级电话 */
private String newPhone;
}
...@@ -3,6 +3,7 @@ package share.system.service; ...@@ -3,6 +3,7 @@ package share.system.service;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.EquityFundLog; import share.system.domain.EquityFundLog;
import share.system.domain.vo.EquityFundLogVo;
/** /**
* 权益金记录Service接口 * 权益金记录Service接口
...@@ -26,7 +27,7 @@ public interface EquityFundLogService extends IService<EquityFundLog> ...@@ -26,7 +27,7 @@ public interface EquityFundLogService extends IService<EquityFundLog>
* @param equityFundLog 权益金记录 * @param equityFundLog 权益金记录
* @return 权益金记录集合 * @return 权益金记录集合
*/ */
public List<EquityFundLog> selectEquityFundLogList(EquityFundLog equityFundLog); public List<EquityFundLogVo> selectEquityFundLogList(EquityFundLog equityFundLog);
/** /**
* 新增权益金记录 * 新增权益金记录
......
...@@ -4,6 +4,7 @@ import java.util.List; ...@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.system.domain.SharingActivities; import share.system.domain.SharingActivities;
import share.system.domain.vo.SharingActivitiesVo;
/** /**
* 分享活动绑定关系Service接口 * 分享活动绑定关系Service接口
...@@ -27,7 +28,7 @@ public interface SharingActivitiesService extends IService<SharingActivities> ...@@ -27,7 +28,7 @@ public interface SharingActivitiesService extends IService<SharingActivities>
* @param sharingActivities 分享活动绑定关系 * @param sharingActivities 分享活动绑定关系
* @return 分享活动绑定关系集合 * @return 分享活动绑定关系集合
*/ */
public List<SharingActivities> selectSharingActivitiesList(SharingActivities sharingActivities); public List<SharingActivitiesVo> selectSharingActivitiesList(SharingActivities sharingActivities);
/** /**
* 新增分享活动绑定关系 * 新增分享活动绑定关系
......
...@@ -809,10 +809,6 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -809,10 +809,6 @@ public class CallbackServiceImpl implements CallbackService {
consumerWalletService.insertConsumerWallet(newConsumerWallet); consumerWalletService.insertConsumerWallet(newConsumerWallet);
} }
//添加权益金日志记录 //添加权益金日志记录
//下级用户
SConsumer newConsumer = consumerService.getById(consumerId);
//上级用户
SConsumer consumer = consumerService.getById(sharingActivities.getUid());
EquityFundLog equityFundLog = new EquityFundLog(); EquityFundLog equityFundLog = new EquityFundLog();
equityFundLog.setEquityFund(addEquityFund); equityFundLog.setEquityFund(addEquityFund);
equityFundLog.setEquityFundType(type); equityFundLog.setEquityFundType(type);
...@@ -820,92 +816,11 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -820,92 +816,11 @@ public class CallbackServiceImpl implements CallbackService {
equityFundLog.setTerminalTrace(terminalTrace); equityFundLog.setTerminalTrace(terminalTrace);
equityFundLog.setUid(sharingActivities.getUid()); equityFundLog.setUid(sharingActivities.getUid());
equityFundLog.setNewUid(sharingActivities.getNewUid()); equityFundLog.setNewUid(sharingActivities.getNewUid());
equityFundLog.setPhone(consumer.getPhone());
equityFundLog.setAccount(consumer.getAccount());
equityFundLog.setNickName(consumer.getNickName());
equityFundLog.setAvatar(consumer.getAvatar());
equityFundLog.setNewAvatar(newConsumer.getAvatar());
equityFundLog.setNewPhone(newConsumer.getPhone());
equityFundLog.setNewAccount(newConsumer.getAccount());
equityFundLog.setNewNickName(newConsumer.getNickName());
equityFundLogService.insertEquityFundLog(equityFundLog); equityFundLogService.insertEquityFundLog(equityFundLog);
} }
} }
} }
} }
// /**
// * 新增权益金日志
// * @param consumerId 用户ID
// * @param payPrice 消费金额
// * @param equityOrderNo 订单编号
// * @param terminalTrace 终端流水号
// * @param type 权益类型
// */
// private void addEquityFundLogRights(Long consumerId, BigDecimal payPrice, String equityOrderNo, String terminalTrace, String type) {
// //查询是否有上级
// SharingActivities sharingActivities = sharingActivitiesService.getOne(new LambdaQueryWrapper<SharingActivities>()
// .eq(SharingActivities::getNewUid, consumerId)
// .eq(SharingActivities::getIsDelete, YesNoEnum.no.getIndex()));
// if (ObjectUtil.isNotEmpty(sharingActivities)) {
// //查询会员用户类型
// LambdaQueryWrapper<ConsumerMember> consumerMemberWrapper = new LambdaQueryWrapper<>();
// consumerMemberWrapper.eq(ConsumerMember::getConsumerId, sharingActivities.getUid());
// ConsumerMember consumerMember = consumerMemberService.getOne(consumerMemberWrapper);
// LambdaQueryWrapper<ConsumerMember> newConsumerMemberWrapper = new LambdaQueryWrapper<>();
// newConsumerMemberWrapper.eq(ConsumerMember::getConsumerId, sharingActivities.getUid());
// ConsumerMember newConsumerMember = consumerMemberService.getOne(newConsumerMemberWrapper);
// //判断是否为权益会员和会员是否有效
// if ("2".equals(consumerMember.getMemberType()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()
// && "2".equals(newConsumerMember.getMemberType()) && new Date().getTime() < newConsumerMember.getExpirationDate().getTime()) {
// Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString());
// Boolean newAboolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getNewUid().toString());
// if (aBoolean && newAboolean) {
// String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund");
// //查询上级用户是否有钱包
// ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>()
// .eq(ConsumerWallet::getConsumerId, sharingActivities.getUid()));
// if (ObjectUtil.isNotEmpty(consumerWallet)) {
// consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund))));
// consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund().
// add(payPrice.multiply(new BigDecimal(equityFund))));
// consumerWallet.setUpdateTime(DateUtils.getNowDate());
// consumerWalletService.updateConsumerWallet(consumerWallet);
// } else {
// //新增钱包
// ConsumerWallet newConsumerWallet = new ConsumerWallet();
// BigDecimal defaultVlue = new BigDecimal(0.0);
// newConsumerWallet.setConsumerId(sharingActivities.getUid());
// newConsumerWallet.setBalance(defaultVlue);
// newConsumerWallet.setRemainingIntegral(defaultVlue);
// newConsumerWallet.setRemainingDuration(defaultVlue);
// newConsumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))));
// newConsumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund()
// .add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))));
// consumerWalletService.insertConsumerWallet(newConsumerWallet);
// }
// //添加权益金日志记录
// //下级用户
// SConsumer newConsumer = consumerService.getById(consumerId);
// //上级用户
// SConsumer consumer = consumerService.getById(sharingActivities.getUid());
// EquityFundLog equityFundLog = new EquityFundLog();
// equityFundLog.setEquityFund(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)));
// equityFundLog.setEquityFundType(type);
// equityFundLog.setOutTradeNo(equityOrderNo);
// equityFundLog.setTerminalTrace(terminalTrace);
// equityFundLog.setUid(sharingActivities.getUid());
// equityFundLog.setNewUid(sharingActivities.getNewUid());
// equityFundLog.setPhone(consumer.getPhone());
// equityFundLog.setAccount(consumer.getAccount());
// equityFundLog.setNickName(consumer.getNickName());
// equityFundLog.setNewPhone(newConsumer.getPhone());
// equityFundLog.setNewAccount(newConsumer.getAccount());
// equityFundLog.setNewNickName(newConsumer.getNickName());
// equityFundLogService.insertEquityFundLog(equityFundLog);
// }
// }
// }
// }
......
package share.system.service.impl; package share.system.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.utils.StringUtils;
import share.system.domain.SConsumer;
import share.system.domain.SharingActivities;
import share.system.domain.vo.EquityFundLogVo;
import share.system.domain.vo.SharingActivitiesVo;
import share.system.mapper.EquityFundLogMapper; import share.system.mapper.EquityFundLogMapper;
import share.system.domain.EquityFundLog; import share.system.domain.EquityFundLog;
import share.system.service.EquityFundLogService; import share.system.service.EquityFundLogService;
import share.system.service.SConsumerService;
/** /**
* 权益金记录Service业务层处理 * 权益金记录Service业务层处理
...@@ -23,6 +35,9 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E ...@@ -23,6 +35,9 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
@Autowired @Autowired
private EquityFundLogMapper equityFundLogMapper; private EquityFundLogMapper equityFundLogMapper;
@Autowired
private SConsumerService sConsumerService;
/** /**
* 查询权益金记录 * 查询权益金记录
* *
...@@ -42,9 +57,37 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E ...@@ -42,9 +57,37 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
* @return 权益金记录 * @return 权益金记录
*/ */
@Override @Override
public List<EquityFundLog> selectEquityFundLogList(EquityFundLog equityFundLog) public List<EquityFundLogVo> selectEquityFundLogList(EquityFundLog equityFundLog)
{ {
return equityFundLogMapper.selectEquityFundLogList(equityFundLog); List<EquityFundLog> activities = equityFundLogMapper.selectEquityFundLogList(equityFundLog);
List<EquityFundLogVo> voList = new ArrayList<>();
List<Long> collect = activities.stream().map(EquityFundLog::getNewUid).collect(Collectors.toList());
List<Long> uids = activities.stream().map(EquityFundLog::getUid).collect(Collectors.toList());
Map<Long, SConsumer> newUserMap = sConsumerService.list(new LambdaQueryWrapper<SConsumer>().in(SConsumer::getId, collect))
.stream().collect(Collectors.toMap(SConsumer::getId, Function.identity()));
Map<Long,SConsumer> userMap = sConsumerService.list(new LambdaQueryWrapper<SConsumer>().in(SConsumer::getId, uids))
.stream().collect(Collectors.toMap(SConsumer::getId, Function.identity()));
activities.stream().forEach(item ->{
EquityFundLogVo vo = new EquityFundLogVo();
BeanUtils.copyProperties(item, vo);
SConsumer newConsumer = newUserMap.get(item.getNewUid());
SConsumer uConsumer = userMap.get(item.getUid());
if(ObjectUtil.isNotEmpty(newConsumer)){
vo.setNewAvatar(StringUtils.isNotEmpty(newConsumer.getAvatar()) ? newConsumer.getAvatar():"");
vo.setNewNickName(StringUtils.isNotEmpty(newConsumer.getNickName()) ? newConsumer.getNickName():"");
vo.setNewPhone(StringUtils.isNotEmpty(newConsumer.getPhone()) ? newConsumer.getPhone():"");
}
if(ObjectUtil.isNotEmpty(uConsumer)){
vo.setAvatar(StringUtils.isNotEmpty(uConsumer.getAvatar()) ? uConsumer.getAvatar():"");
vo.setNickName(StringUtils.isNotEmpty(uConsumer.getNickName()) ? uConsumer.getNickName():"");
vo.setPhone(StringUtils.isNotEmpty(uConsumer.getPhone()) ? uConsumer.getPhone():"");
}
voList.add(vo);
});
return voList;
} }
/** /**
......
...@@ -316,12 +316,12 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo ...@@ -316,12 +316,12 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo
SConsumer newConsumer = sConsumerService.selectSConsumerById(id); SConsumer newConsumer = sConsumerService.selectSConsumerById(id);
SharingActivities sharingActivities = new SharingActivities(); SharingActivities sharingActivities = new SharingActivities();
sharingActivities.setUid(uid); sharingActivities.setUid(uid);
sharingActivities.setPhone(consumer.getPhone()); // sharingActivities.setPhone(consumer.getPhone());
sharingActivities.setAvatar(consumer.getAvatar()); // sharingActivities.setAvatar(consumer.getAvatar());
sharingActivities.setNickName(consumer.getNickName()); // sharingActivities.setNickName(consumer.getNickName());
sharingActivities.setNewPhone(newConsumer.getPhone()); // sharingActivities.setNewPhone(newConsumer.getPhone());
sharingActivities.setNewAvatar(newConsumer.getAvatar()); // sharingActivities.setNewAvatar(newConsumer.getAvatar());
sharingActivities.setNewNickName(newConsumer.getNickName()); // sharingActivities.setNewNickName(newConsumer.getNickName());
sharingActivities.setNewUid(id); sharingActivities.setNewUid(id);
sharingActivities.setCreateTime(DateUtils.getNowDate()); sharingActivities.setCreateTime(DateUtils.getNowDate());
sharingActivitiesService.insertSharingActivities(sharingActivities); sharingActivitiesService.insertSharingActivities(sharingActivities);
......
package share.system.service.impl; package share.system.service.impl;
import java.time.YearMonth; import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.poi.hssf.record.DVALRecord;
import org.springframework.beans.BeanUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import share.common.core.domain.AjaxResult; import share.common.core.domain.AjaxResult;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
...@@ -15,7 +21,9 @@ import share.common.enums.YesNoEnum; ...@@ -15,7 +21,9 @@ import share.common.enums.YesNoEnum;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import share.common.utils.StringUtils;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.vo.SharingActivitiesVo;
import share.system.mapper.SharingActivitiesMapper; import share.system.mapper.SharingActivitiesMapper;
import share.system.domain.SharingActivities; import share.system.domain.SharingActivities;
import share.system.service.SConsumerService; import share.system.service.SConsumerService;
...@@ -39,6 +47,10 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -39,6 +47,10 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
@Autowired @Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
@Autowired
private SConsumerService sConsumerService;
/** /**
* 查询分享活动绑定关系 * 查询分享活动绑定关系
* *
...@@ -58,10 +70,35 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -58,10 +70,35 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
* @return 分享活动绑定关系 * @return 分享活动绑定关系
*/ */
@Override @Override
public List<SharingActivities> selectSharingActivitiesList(SharingActivities sharingActivities) public List<SharingActivitiesVo> selectSharingActivitiesList(SharingActivities sharingActivities)
{ {
List<SharingActivities> activities = sharingActivitiesMapper.selectSharingActivitiesList(sharingActivities);
List<SharingActivitiesVo> voList = new ArrayList<>();
List<Long> collect = activities.stream().map(SharingActivities::getNewUid).collect(Collectors.toList());
List<Long> uids = activities.stream().map(SharingActivities::getUid).collect(Collectors.toList());
Map<Long,SConsumer> newUserMap = sConsumerService.list(new LambdaQueryWrapper<SConsumer>().in(SConsumer::getId, collect))
.stream().collect(Collectors.toMap(SConsumer::getId, Function.identity()));
Map<Long,SConsumer> userMap = sConsumerService.list(new LambdaQueryWrapper<SConsumer>().in(SConsumer::getId, uids))
.stream().collect(Collectors.toMap(SConsumer::getId, Function.identity()));
activities.stream().forEach(item ->{
SharingActivitiesVo vo = new SharingActivitiesVo();
BeanUtils.copyProperties(item, vo);
SConsumer newConsumer = newUserMap.get(item.getNewUid());
SConsumer uConsumer = userMap.get(item.getUid());
if(ObjectUtil.isNotEmpty(newConsumer)){
vo.setNewAvatar(StringUtils.isNotEmpty(newConsumer.getAvatar()) ? newConsumer.getAvatar():"");
vo.setNewNickName(StringUtils.isNotEmpty(newConsumer.getNickName()) ? newConsumer.getNickName():"");
vo.setNewPhone(StringUtils.isNotEmpty(newConsumer.getPhone()) ? newConsumer.getPhone():"");
}
if(ObjectUtil.isNotEmpty(uConsumer)){
vo.setAvatar(StringUtils.isNotEmpty(uConsumer.getAvatar()) ? uConsumer.getAvatar():"");
vo.setNickName(StringUtils.isNotEmpty(uConsumer.getNickName()) ? uConsumer.getNickName():"");
vo.setPhone(StringUtils.isNotEmpty(uConsumer.getPhone()) ? uConsumer.getPhone():"");
}
voList.add(vo);
});
return sharingActivitiesMapper.selectSharingActivitiesList(sharingActivities); return voList;
} }
/** /**
...@@ -89,9 +126,9 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -89,9 +126,9 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
{ {
SConsumer consumer = consumerService.selectSConsumerById(sharingActivities.getUid()); SConsumer consumer = consumerService.selectSConsumerById(sharingActivities.getUid());
sharingActivities.setUpdateTime(DateUtils.getNowDate()); sharingActivities.setUpdateTime(DateUtils.getNowDate());
sharingActivities.setAvatar(consumer.getAvatar()); // sharingActivities.setAvatar(consumer.getAvatar());
sharingActivities.setPhone(consumer.getPhone()); // sharingActivities.setPhone(consumer.getPhone());
sharingActivities.setNickName(consumer.getNickName()); // sharingActivities.setNickName(consumer.getNickName());
return sharingActivitiesMapper.updateSharingActivities(sharingActivities); return sharingActivitiesMapper.updateSharingActivities(sharingActivities);
} }
......
...@@ -18,18 +18,12 @@ ...@@ -18,18 +18,12 @@
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="phone" column="phone" />
<result property="account" column="account" />
<result property="nickName" column="nick_name" />
<result property="newPhone" column="new_phone" />
<result property="newAccount" column="new_account" />
<result property="newNickName" column="new_nick_name" />
<result property="avatar" column="avatar" />
<result property="newAvatar" column="new_avatar" />
</resultMap> </resultMap>
<sql id="selectEquityFundLogVo"> <sql id="selectEquityFundLogVo">
select id, equity_fund_type, equity_fund, uid, new_uid, terminal_trace, out_trade_no, is_delete, create_by, create_time, update_by, update_time, remark, phone, account, nick_name, new_phone, new_account, new_nick_name, avatar, new_avatar from s_equity_fund_log -- select id, equity_fund_type, equity_fund, uid, new_uid, terminal_trace, out_trade_no, is_delete, create_by, create_time, update_by, update_time, remark, phone, account, nick_name, new_phone, new_account, new_nick_name, avatar, new_avatar from s_equity_fund_log
select id, equity_fund_type, equity_fund, uid, new_uid, terminal_trace, out_trade_no, is_delete, create_by, create_time, update_by, update_time, remark from s_equity_fund_log
</sql> </sql>
<select id="selectEquityFundLogList" parameterType="EquityFundLog" resultMap="EquityFundLogResult"> <select id="selectEquityFundLogList" parameterType="EquityFundLog" resultMap="EquityFundLogResult">
...@@ -42,14 +36,6 @@ ...@@ -42,14 +36,6 @@
<if test="terminalTrace != null and terminalTrace != ''"> and terminal_trace = #{terminalTrace}</if> <if test="terminalTrace != null and terminalTrace != ''"> and terminal_trace = #{terminalTrace}</if>
<if test="outTradeNo != null and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if> <if test="outTradeNo != null and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if> <if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="account != null and account != ''"> and account = #{account}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="newPhone != null and newPhone != ''"> and new_phone = #{newPhone}</if>
<if test="newAccount != null and newAccount != ''"> and new_account = #{newAccount}</if>
<if test="newNickName != null and newNickName != ''"> and new_nick_name like concat('%', #{newNickName}, '%')</if>
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
<if test="newAvatar != null and newAvatar != ''"> and new_avatar = #{newAvatar}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
...@@ -74,14 +60,6 @@ ...@@ -74,14 +60,6 @@
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="phone != null">phone,</if>
<if test="account != null">account,</if>
<if test="nickName != null">nick_name,</if>
<if test="newPhone != null">new_phone,</if>
<if test="newAccount != null">new_account,</if>
<if test="newNickName != null">new_nick_name,</if>
<if test="avatar != null">avatar,</if>
<if test="newAvatar != null">new_avatar,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="equityFundType != null and equityFundType != ''">#{equityFundType},</if> <if test="equityFundType != null and equityFundType != ''">#{equityFundType},</if>
...@@ -96,14 +74,6 @@ ...@@ -96,14 +74,6 @@
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="phone != null">#{phone},</if>
<if test="account != null">#{account},</if>
<if test="nickName != null">#{nickName},</if>
<if test="newPhone != null">#{newPhone},</if>
<if test="newAccount != null">#{newAccount},</if>
<if test="newNickName != null">#{newNickName},</if>
<if test="avatar != null">#{avatar},</if>
<if test="newAvatar != null">#{newAvatar},</if>
</trim> </trim>
</insert> </insert>
...@@ -122,14 +92,6 @@ ...@@ -122,14 +92,6 @@
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="account != null">account = #{account},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="newPhone != null">new_phone = #{newPhone},</if>
<if test="newAccount != null">new_account = #{newAccount},</if>
<if test="newNickName != null">new_nick_name = #{newNickName},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="newAvatar != null">new_avatar = #{newAvatar},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -15,16 +15,11 @@ ...@@ -15,16 +15,11 @@
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="avatar" column="avatar" />
<result property="newAvatar" column="new_avatar" />
<result property="nickName" column="nick_name" />
<result property="newNickName" column="new_nick_name" />
<result property="phone" column="phone" />
<result property="newPhone" column="new_phone" />
</resultMap> </resultMap>
<sql id="selectSharingActivitiesVo"> <sql id="selectSharingActivitiesVo">
select id, activity_type, uid, new_uid, is_delete, create_by, create_time, update_by, update_time, remark, avatar, new_avatar, nick_name, new_nick_name, phone, new_phone from s_sharing_activities select id, activity_type, uid, new_uid, is_delete, create_by, create_time, update_by, update_time, remark
from s_sharing_activities
</sql> </sql>
<select id="selectSharingActivitiesList" parameterType="SharingActivities" resultMap="SharingActivitiesResult"> <select id="selectSharingActivitiesList" parameterType="SharingActivities" resultMap="SharingActivitiesResult">
...@@ -34,12 +29,6 @@ ...@@ -34,12 +29,6 @@
<if test="uid != null "> and uid = #{uid}</if> <if test="uid != null "> and uid = #{uid}</if>
<if test="newUid != null "> and new_uid = #{newUid}</if> <if test="newUid != null "> and new_uid = #{newUid}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if> <if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
<if test="newAvatar != null and newAvatar != ''"> and new_avatar = #{newAvatar}</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
<if test="newNickName != null and newNickName != ''"> and new_nick_name like concat('%', #{newNickName}, '%')</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="newPhone != null and newPhone != ''"> and new_phone = #{newPhone}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
...@@ -61,12 +50,6 @@ ...@@ -61,12 +50,6 @@
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="avatar != null">avatar,</if>
<if test="newAvatar != null">new_avatar,</if>
<if test="nickName != null">nick_name,</if>
<if test="newNickName != null">new_nick_name,</if>
<if test="phone != null">phone,</if>
<if test="newPhone != null">new_phone,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="activityType != null and activityType != ''">#{activityType},</if> <if test="activityType != null and activityType != ''">#{activityType},</if>
...@@ -78,12 +61,6 @@ ...@@ -78,12 +61,6 @@
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="avatar != null">#{avatar},</if>
<if test="newAvatar != null">#{newAvatar},</if>
<if test="nickName != null">#{nickName},</if>
<if test="newNickName != null">#{newNickName},</if>
<if test="phone != null">#{phone},</if>
<if test="newPhone != null">#{newPhone},</if>
</trim> </trim>
</insert> </insert>
...@@ -98,13 +75,6 @@ ...@@ -98,13 +75,6 @@
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="newAvatar != null">new_avatar = #{newAvatar},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="newNickName != null">new_nick_name = #{newNickName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="newPhone != null">new_phone = #{newPhone},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment