Commit 81cbfd14 by 吕明尚

Merge branch 'refs/heads/test' into test-lms

# Conflicts:
#	share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
parents ea1ee91f 7af58467
...@@ -12,8 +12,6 @@ import share.system.domain.vo.SaobeiNotifyResponseVo; ...@@ -12,8 +12,6 @@ import share.system.domain.vo.SaobeiNotifyResponseVo;
import share.system.domain.vo.SaobeiNotifyVo; import share.system.domain.vo.SaobeiNotifyVo;
import share.system.service.CallbackService; import share.system.service.CallbackService;
import javax.servlet.http.HttpServletRequest;
/** /**
* 支付回调 * 支付回调
......
...@@ -10,6 +10,9 @@ import share.common.core.page.TableDataInfo; ...@@ -10,6 +10,9 @@ import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType; import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil; 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.vo.DurationLogVo;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.EquityFundLogService; import share.system.service.EquityFundLogService;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -28,22 +31,18 @@ public class EquityFundLogController extends BaseController { ...@@ -28,22 +31,18 @@ public class EquityFundLogController extends BaseController {
private EquityFundLogService equityFundLogService; private EquityFundLogService equityFundLogService;
/** /**
* 查询权益金记录列表 * 查询本人权益金记录列表
*/ */
@PreAuthorize("@ss.hasPermi('system:equityFundLog:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(EquityFundLog equityFundLog) { public TableDataInfo list(EquityFundLog equityFundLog) {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
equityFundLog.setUid(user.getId());
List<EquityFundLog> list = equityFundLogService.selectEquityFundLogList(equityFundLog); List<EquityFundLog> list = equityFundLogService.selectEquityFundLogList(equityFundLog);
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取权益金记录详细信息
*/
@PreAuthorize("@ss.hasPermi('system:equityFundLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(equityFundLogService.selectEquityFundLogById(id));
}
} }
...@@ -10,6 +10,7 @@ import share.common.core.domain.AjaxResult; ...@@ -10,6 +10,7 @@ import share.common.core.domain.AjaxResult;
import share.common.core.domain.R; import share.common.core.domain.R;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.YesNoEnum;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
...@@ -43,6 +44,7 @@ public class MonthlyCardOrderController extends BaseController { ...@@ -43,6 +44,7 @@ public class MonthlyCardOrderController extends BaseController {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardOrder.setConsumerId(user.getId()); monthlyCardOrder.setConsumerId(user.getId());
monthlyCardOrder.setPayStatus(YesNoEnum.yes.getIndex());
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder); List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
return getDataTable(list); return getDataTable(list);
} }
...@@ -51,6 +53,7 @@ public class MonthlyCardOrderController extends BaseController { ...@@ -51,6 +53,7 @@ public class MonthlyCardOrderController extends BaseController {
public AjaxResult query(MonthlyCardOrderVo monthlyCardOrder) { public AjaxResult query(MonthlyCardOrderVo monthlyCardOrder) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry(); SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
monthlyCardOrder.setConsumerId(user.getId()); monthlyCardOrder.setConsumerId(user.getId());
monthlyCardOrder.setPayStatus(YesNoEnum.yes.getIndex());
List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder); List<MonthlyCardOrderVo> list = monthlyCardOrderService.selectMonthlyCardOrderList(monthlyCardOrder);
return success(list); return success(list);
} }
......
...@@ -5,7 +5,10 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -5,7 +5,10 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import share.common.core.controller.BaseController; import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SecondaryCardLogVo; import share.system.domain.vo.SecondaryCardLogVo;
import share.system.service.SecondaryCardLogService; import share.system.service.SecondaryCardLogService;
...@@ -29,8 +32,17 @@ public class SecondaryCardLogController extends BaseController { ...@@ -29,8 +32,17 @@ public class SecondaryCardLogController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardLogVo secondaryCardLog) { public TableDataInfo list(SecondaryCardLogVo secondaryCardLog) {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
secondaryCardLog.setConsumerId(user.getId());
List<SecondaryCardLogVo> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog); List<SecondaryCardLogVo> list = secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog);
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/query")
public AjaxResult query(SecondaryCardLogVo secondaryCardLog) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
secondaryCardLog.setConsumerId(user.getId());
return success(secondaryCardLogService.selectSecondaryCardLogList(secondaryCardLog));
}
} }
...@@ -9,7 +9,10 @@ import share.common.core.controller.BaseController; ...@@ -9,7 +9,10 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.R; import share.common.core.domain.R;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
import share.common.core.redis.RedisUtil; import share.common.core.redis.RedisUtil;
import share.common.enums.YesNoEnum;
import share.common.utils.JsonConvertUtil; import share.common.utils.JsonConvertUtil;
import share.system.domain.SConsumer;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SecondaryCardOrderVo; import share.system.domain.vo.SecondaryCardOrderVo;
import share.system.request.SecondaryCardOrderRequest; import share.system.request.SecondaryCardOrderRequest;
import share.system.response.SecondaryCardOrderPayResultResponse; import share.system.response.SecondaryCardOrderPayResultResponse;
...@@ -38,6 +41,9 @@ public class SecondaryCardOrderController extends BaseController { ...@@ -38,6 +41,9 @@ public class SecondaryCardOrderController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SecondaryCardOrderVo secondaryCardOrder) { public TableDataInfo list(SecondaryCardOrderVo secondaryCardOrder) {
startPage(); startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
secondaryCardOrder.setConsumerId(user.getId());
secondaryCardOrder.setPayStatus(YesNoEnum.yes.getIndex());
List<SecondaryCardOrderVo> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder); List<SecondaryCardOrderVo> list = secondaryCardOrderService.selectSecondaryCardOrderList(secondaryCardOrder);
return getDataTable(list); return getDataTable(list);
} }
......
package share.web.controller.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import share.common.annotation.Log;
import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.EquityFundLog;
import share.system.domain.SConsumer;
import share.system.domain.SharingActivities;
import share.system.domain.vo.FrontTokenComponent;
import share.system.service.SharingActivitiesService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 分享活动绑定关系Controller
*
* @author wuwenlong
* @date 2024-09-02
*/
@RestController
@RequestMapping("/activities")
public class SharingActivitiesController extends BaseController {
@Autowired
private SharingActivitiesService sharingActivitiesService;
/**
* 查询分享活动绑定关系列表
*/
@GetMapping("/list")
public TableDataInfo list(SharingActivities sharingActivities) {
startPage();
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sharingActivities.setUid(user.getId());
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return getDataTable(list);
}
@GetMapping("/query")
public AjaxResult query(SharingActivities sharingActivities) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
sharingActivities.setNewUid(user.getId());
List<SharingActivities> list = sharingActivitiesService.selectSharingActivitiesList(sharingActivities);
return success(list);
}
}
...@@ -12,7 +12,7 @@ import lombok.Data; ...@@ -12,7 +12,7 @@ import lombok.Data;
* 权益金记录对象 s_equity_fund_log * 权益金记录对象 s_equity_fund_log
* *
* @author wuwenlong * @author wuwenlong
* @date 2024-09-10 * @date 2024-09-13
*/ */
@Data @Data
@TableName(value = "s_equity_fund_log") @TableName(value = "s_equity_fund_log")
...@@ -54,8 +54,8 @@ public class EquityFundLog extends BaseEntity ...@@ -54,8 +54,8 @@ public class EquityFundLog extends BaseEntity
@TableField(select = false) @TableField(select = false)
private Long isDelete; private Long isDelete;
/** 上级手机号 */ /** 上级电话 */
@Excel(name = "上级手机号") @Excel(name = "上级电话")
private String phone; private String phone;
/** 上级账号 */ /** 上级账号 */
...@@ -66,18 +66,27 @@ public class EquityFundLog extends BaseEntity ...@@ -66,18 +66,27 @@ public class EquityFundLog extends BaseEntity
@Excel(name = "上级用户昵称") @Excel(name = "上级用户昵称")
private String nickName; private String nickName;
/** 下级手机号 */ /** 下级电话 */
@Excel(name = "下级手机号") @Excel(name = "下级电话")
private String newPhone; private String newPhone;
/** 下级账号 */ /** 下级账号 */
@Excel(name = "级账号") @Excel(name = "级账号")
private String newAccount; private String newAccount;
/** 下级用户昵称 */ /** 下级用户昵称 */
@Excel(name = "下级用户昵称") @Excel(name = "下级用户昵称")
private String newNickName; private String newNickName;
/** 上级用户头像 */
@Excel(name = "上级用户头像")
private String avatar;
/** 下级用户头像 */
@Excel(name = "下级用户头像")
private String newAvatar;
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
...@@ -94,6 +103,14 @@ public class EquityFundLog extends BaseEntity ...@@ -94,6 +103,14 @@ 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();
} }
} }
package share.system.domain; package share.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel; import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity; import share.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data; import lombok.Data;
/** /**
* 分享活动绑定关系对象 s_sharing_activities * 分享活动绑定关系对象 s_sharing_activities
* *
* @author wuwenlong * @author wuwenlong
* @date 2024-09-02 * @date 2024-09-14
*/ */
@Data @Data
@TableName("s_sharing_activities")
public class SharingActivities extends BaseEntity public class SharingActivities extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键 */ /** 主键 */
@TableId(type = IdType.AUTO)
private Long id; private Long id;
/** 活动类型(0-新用户注册,1-权益金会员分享) */ /** 活动类型(0-新用户注册,1-权益金会员分享) */
...@@ -40,6 +39,30 @@ public class SharingActivities extends BaseEntity ...@@ -40,6 +39,30 @@ 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
public String toString() { public String toString() {
...@@ -54,6 +77,12 @@ public class SharingActivities extends BaseEntity ...@@ -54,6 +77,12 @@ 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();
} }
} }
...@@ -59,4 +59,6 @@ public interface SharingActivitiesMapper extends BaseMapper<SharingActivities> ...@@ -59,4 +59,6 @@ public interface SharingActivitiesMapper extends BaseMapper<SharingActivities>
* @return 结果 * @return 结果
*/ */
public int deleteSharingActivitiesByIds(Long[] ids); public int deleteSharingActivitiesByIds(Long[] ids);
} }
...@@ -59,4 +59,8 @@ public interface EquityFundLogService extends IService<EquityFundLog> ...@@ -59,4 +59,8 @@ public interface EquityFundLogService extends IService<EquityFundLog>
* @return 结果 * @return 结果
*/ */
public int deleteEquityFundLogById(Long id); public int deleteEquityFundLogById(Long id);
List<EquityFundLog> selectEquityFundLogByUid(Long uid);
List<EquityFundLog> selectEquityFundLogByNewUid(Long newUid);
} }
...@@ -14,7 +14,6 @@ import share.common.enums.MemberTypeEnum; ...@@ -14,7 +14,6 @@ import share.common.enums.MemberTypeEnum;
import share.common.enums.YesNoEnum; import share.common.enums.YesNoEnum;
import share.common.utils.DateUtils; import share.common.utils.DateUtils;
import share.common.utils.StringUtils; import share.common.utils.StringUtils;
import share.common.utils.bean.BeanUtils;
import share.system.domain.Activity; import share.system.domain.Activity;
import share.system.domain.ConsumerMember; import share.system.domain.ConsumerMember;
import share.system.domain.SConsumer; import share.system.domain.SConsumer;
...@@ -136,17 +135,24 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i ...@@ -136,17 +135,24 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
for (int i = 0; i <= 4; i++) { for (int i = 0; i <= 4; i++) {
days.add(DateUtils.addDays(new Date(), i)); days.add(DateUtils.addDays(new Date(), i));
} }
Activity activity = new Activity(); LambdaQueryWrapper<Activity> queryWrapper = new LambdaQueryWrapper<>();
BeanUtils.copyProperties(dto, activity); // Activity activity = new Activity();
activity.setMemberType(MemberTypeEnum.NORMAL.getIndex()); // BeanUtils.copyProperties(dto, activity);
if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { // activity.setMemberType(MemberTypeEnum.NORMAL.getIndex());
activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex()); if (consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
} queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { } else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); queryWrapper.in(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex(), MemberTypeEnum.RIGHTS.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
} else if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
} }
List<Activity> activities = selectActivityList(activity); // List<Activity> activities = selectActivityList(activity);
List<Activity> activities = list(queryWrapper);
CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ)); CronParser cronParser = new CronParser(CronDefinitionBuilder.instanceDefinitionFor(CronType.QUARTZ));
Map<Date, List<Activity>> map = new HashMap<>(); Map<Date, List<Activity>> map = new HashMap<>();
days.stream().forEach(day -> { days.stream().forEach(day -> {
......
...@@ -777,29 +777,35 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -777,29 +777,35 @@ public class CallbackServiceImpl implements CallbackService {
ConsumerMember consumerMember = consumerMemberService.getOne(consumerMemberLambdaQueryWrapper); ConsumerMember consumerMember = consumerMemberService.getOne(consumerMemberLambdaQueryWrapper);
//判断是否为权益会员和会员是否有效 //判断是否为权益会员和会员是否有效
if (YesNoEnum.yes.getIndex().equals(consumerMember.getIsRights()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()) { if (YesNoEnum.yes.getIndex().equals(consumerMember.getIsRights()) && new Date().getTime() < consumerMember.getExpirationDate().getTime()) {
Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + sharingActivities.getUid().toString()); Boolean aBoolean = redisTemplate.hasKey(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME.getValue() + sharingActivities.getUid().toString());
if (aBoolean) { if (aBoolean) {
String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund"); String equityFund = sysConfigService.selectConfigByKey("sys.equityFundLog.equityFund");
//计算返佣额度 写死 99 测试
// BigDecimal addEquityFund = new BigDecimal(99).multiply(new BigDecimal(equityFund)).setScale(2,RoundingMode.HALF_UP);
BigDecimal addEquityFund = payPrice.multiply(new BigDecimal(equityFund)).setScale(2,RoundingMode.HALF_UP);
//查询上级用户是否有钱包 //查询上级用户是否有钱包
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>() ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>()
.eq(ConsumerWallet::getConsumerId, sharingActivities.getUid())); .eq(ConsumerWallet::getConsumerId, sharingActivities.getUid()));
if (ObjectUtil.isNotEmpty(consumerWallet)) { if (ObjectUtil.isNotEmpty(consumerWallet)) {
consumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund)))); BigDecimal aEquityFund = consumerWallet.getEquityFund() != null ? consumerWallet.getEquityFund() : BigDecimal.ZERO;
consumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund(). consumerWallet.setEquityFund(aEquityFund.add(addEquityFund));
add(payPrice.multiply(new BigDecimal(equityFund)))); BigDecimal accumulateEquityFund = consumerWallet.getAccumulateEquityFund() != null ? consumerWallet.getAccumulateEquityFund() : BigDecimal.ZERO;
consumerWallet.setAccumulateEquityFund(accumulateEquityFund.
add(addEquityFund));
consumerWallet.setUpdateTime(DateUtils.getNowDate()); consumerWallet.setUpdateTime(DateUtils.getNowDate());
consumerWalletService.updateConsumerWallet(consumerWallet); consumerWalletService.updateConsumerWallet(consumerWallet);
} else { } else {
//新增钱包 //新增钱包
ConsumerWallet newConsumerWallet = new ConsumerWallet(); ConsumerWallet newConsumerWallet = new ConsumerWallet();
BigDecimal defaultVlue = new BigDecimal(0.0); BigDecimal defaultVlue = new BigDecimal(0);
newConsumerWallet.setConsumerId(sharingActivities.getUid()); newConsumerWallet.setConsumerId(sharingActivities.getUid());
newConsumerWallet.setBalance(defaultVlue); newConsumerWallet.setBalance(defaultVlue);
newConsumerWallet.setRemainingIntegral(defaultVlue); newConsumerWallet.setRemainingIntegral(defaultVlue);
newConsumerWallet.setRemainingDuration(defaultVlue); newConsumerWallet.setRemainingDuration(defaultVlue);
newConsumerWallet.setEquityFund(consumerWallet.getEquityFund().add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); newConsumerWallet.setEquityFund(defaultVlue
newConsumerWallet.setAccumulateEquityFund(consumerWallet.getAccumulateEquityFund() .add(addEquityFund));
.add(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP)))); newConsumerWallet.setAccumulateEquityFund(defaultVlue.add(addEquityFund));
consumerWalletService.insertConsumerWallet(newConsumerWallet); consumerWalletService.insertConsumerWallet(newConsumerWallet);
} }
//添加权益金日志记录 //添加权益金日志记录
...@@ -808,7 +814,7 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -808,7 +814,7 @@ public class CallbackServiceImpl implements CallbackService {
//上级用户 //上级用户
SConsumer consumer = consumerService.getById(sharingActivities.getUid()); SConsumer consumer = consumerService.getById(sharingActivities.getUid());
EquityFundLog equityFundLog = new EquityFundLog(); EquityFundLog equityFundLog = new EquityFundLog();
equityFundLog.setEquityFund(payPrice.multiply(new BigDecimal(equityFund).setScale(2, RoundingMode.HALF_UP))); equityFundLog.setEquityFund(addEquityFund);
equityFundLog.setEquityFundType(type); equityFundLog.setEquityFundType(type);
equityFundLog.setOutTradeNo(equityOrderNo); equityFundLog.setOutTradeNo(equityOrderNo);
equityFundLog.setTerminalTrace(terminalTrace); equityFundLog.setTerminalTrace(terminalTrace);
...@@ -817,6 +823,8 @@ public class CallbackServiceImpl implements CallbackService { ...@@ -817,6 +823,8 @@ public class CallbackServiceImpl implements CallbackService {
equityFundLog.setPhone(consumer.getPhone()); equityFundLog.setPhone(consumer.getPhone());
equityFundLog.setAccount(consumer.getAccount()); equityFundLog.setAccount(consumer.getAccount());
equityFundLog.setNickName(consumer.getNickName()); equityFundLog.setNickName(consumer.getNickName());
equityFundLog.setAvatar(consumer.getAvatar());
equityFundLog.setNewAvatar(newConsumer.getAvatar());
equityFundLog.setNewPhone(newConsumer.getPhone()); equityFundLog.setNewPhone(newConsumer.getPhone());
equityFundLog.setNewAccount(newConsumer.getAccount()); equityFundLog.setNewAccount(newConsumer.getAccount());
equityFundLog.setNewNickName(newConsumer.getNickName()); equityFundLog.setNewNickName(newConsumer.getNickName());
......
...@@ -57,6 +57,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -57,6 +57,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
private ISCouponService sCouponService; private ISCouponService sCouponService;
@Autowired @Autowired
private ISConsumerCouponService consumerCouponService; private ISConsumerCouponService consumerCouponService;
@Autowired
private ISysConfigService sysConfigService;
/** /**
* 查询会员钱包 * 查询会员钱包
...@@ -136,6 +138,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -136,6 +138,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
@Override @Override
public boolean addConsumerWallet(ConsumerWallet consumerWallet) { public boolean addConsumerWallet(ConsumerWallet consumerWallet) {
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
int i = consumerWalletMapper.insertConsumerWallet(consumerWallet); int i = consumerWalletMapper.insertConsumerWallet(consumerWallet);
ConsumerMember one = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, consumerWallet.getConsumerId())); ConsumerMember one = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, consumerWallet.getConsumerId()));
MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>().eq(MemberConfig::getMembershipLevel, one.getMembershipLevel())); MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>().eq(MemberConfig::getMembershipLevel, one.getMembershipLevel()));
...@@ -176,10 +180,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -176,10 +180,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 100)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
} }
if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
} }
memberProgressLogService.save(memberProgressLog); memberProgressLogService.save(memberProgressLog);
...@@ -203,14 +207,16 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -203,14 +207,16 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
BigDecimal oldBalance = consumerWallet.getBalance(); BigDecimal oldBalance = consumerWallet.getBalance();
BigDecimal oldDuration = consumerWallet.getRemainingDuration(); BigDecimal oldDuration = consumerWallet.getRemainingDuration();
BigDecimal oldIntegral = consumerWallet.getRemainingIntegral(); BigDecimal oldIntegral = consumerWallet.getRemainingIntegral();
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId()); RechargeConf rechargeConf = rechargeConfService.selectRechargeConfById(recharge.getRechargeConfId());
if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && one.getIsRights().equals(YesNoEnum.no.getIndex())) {
// MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>() // MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>()
// .eq(MemberConfig::getMembershipLevel, one.getMembershipLevel()) // .eq(MemberConfig::getMembershipLevel, one.getMembershipLevel())
// .eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex()) // .eq(MemberConfig::getMemberType, MemberTypeEnum.RECHARGE.getIndex())
// ); // );
one.setExpirationDate(DateUtils.addYears(new Date(), 1)); one.setExpirationDate(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
} }
logger.debug("修改会员用户"); logger.debug("修改会员用户");
...@@ -268,11 +274,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -268,11 +274,9 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
memberProgressLog.setOperationTime(new Date()); memberProgressLog.setOperationTime(new Date());
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 100));
}
if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
} }
memberProgressLogService.save(memberProgressLog); memberProgressLogService.save(memberProgressLog);
...@@ -297,6 +301,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -297,6 +301,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
private void accumulatedConsumptionStatistics(ConsumerWallet consumerWallet, ConsumerMember one, MemberConfig memberConfig) { private void accumulatedConsumptionStatistics(ConsumerWallet consumerWallet, ConsumerMember one, MemberConfig memberConfig) {
logger.debug("统计累计积分开始"); logger.debug("统计累计积分开始");
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
final BigDecimal[] consumption = {BigDecimal.ZERO}; final BigDecimal[] consumption = {BigDecimal.ZERO};
//查询含当天23:59:59以及往前90天的00:00:00整天的订单 //查询含当天23:59:59以及往前90天的00:00:00整天的订单
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
...@@ -367,10 +373,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper, ...@@ -367,10 +373,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 100)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
} }
if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (one.getIsRights().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
} }
if (memberProgressLogService.save(memberProgressLog) && integralLogService.save(integralLog)) { if (memberProgressLogService.save(memberProgressLog) && integralLogService.save(integralLog)) {
......
package share.system.service.impl; package share.system.service.impl;
import java.util.List; import java.util.List;
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 share.common.utils.DateUtils; import share.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -94,4 +96,16 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E ...@@ -94,4 +96,16 @@ public class EquityFundLogServiceImpl extends ServiceImpl<EquityFundLogMapper, E
{ {
return equityFundLogMapper.deleteEquityFundLogById(id); return equityFundLogMapper.deleteEquityFundLogById(id);
} }
@Override
public List<EquityFundLog> selectEquityFundLogByUid(Long id) {
return equityFundLogMapper.selectList(new LambdaQueryWrapper<EquityFundLog>().eq(EquityFundLog::getUid,id));
}
@Override
public List<EquityFundLog> selectEquityFundLogByNewUid(Long newUid) {
return equityFundLogMapper.selectList(new LambdaQueryWrapper<EquityFundLog>().eq(EquityFundLog::getNewUid,newUid));
}
} }
...@@ -57,6 +57,8 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -57,6 +57,8 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
private IntegralLogService integralLogService; private IntegralLogService integralLogService;
@Autowired @Autowired
private MemberProgressLogService memberProgressLogService; private MemberProgressLogService memberProgressLogService;
@Autowired
private ISysConfigService sysConfigService;
/** /**
* 查询权益会员订单 * 查询权益会员订单
...@@ -146,7 +148,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -146,7 +148,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
Date expirationDate = consumerMember.getExpirationDate(); Date expirationDate = consumerMember.getExpirationDate();
//减去当前时间 //减去当前时间
int i = DateUtils.differentDaysByMillisecond(new Date(), expirationDate); int i = DateUtils.differentDaysByMillisecond(new Date(), expirationDate);
if (i > 365) { if (i > 365 && consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
throw new BaseException("目前只能购买两年权益会员"); throw new BaseException("目前只能购买两年权益会员");
} }
} }
...@@ -168,6 +170,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -168,6 +170,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, equityMembersOrder.getConsumerId())); ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, equityMembersOrder.getConsumerId()));
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, equityMembersOrder.getConsumerId())); ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, equityMembersOrder.getConsumerId()));
EquityMembersOrderConfig equityMembersOrderConfig = equityMembersOrderConfigService.selectEquityMembersOrderConfigById(equityMembersOrder.getEquityMembersConfigId()); EquityMembersOrderConfig equityMembersOrderConfig = equityMembersOrderConfigService.selectEquityMembersOrderConfigById(equityMembersOrder.getEquityMembersConfigId());
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
if (ObjectUtil.isEmpty(consumerMember)) { if (ObjectUtil.isEmpty(consumerMember)) {
ConsumerMember newConsumerMember = new ConsumerMember(); ConsumerMember newConsumerMember = new ConsumerMember();
newConsumerMember.setConsumerId(equityMembersOrder.getConsumerId()); newConsumerMember.setConsumerId(equityMembersOrder.getConsumerId());
...@@ -188,7 +191,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -188,7 +191,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setOperationTime(new Date()); memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
memberProgressLogService.save(memberProgressLog); memberProgressLogService.save(memberProgressLog);
} }
newConsumerMember.setCreateTime(new Date()); newConsumerMember.setCreateTime(new Date());
...@@ -207,10 +210,12 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -207,10 +210,12 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
.eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel()) .eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel())
// .eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex()) // .eq(MemberConfig::getMemberType, MemberTypeEnum.RIGHTS.getIndex())
); );
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
//在原来的基础上增加有效期 //在原来的基础上增加有效期
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, consumerMember.getExpirationDate())),
1)); Integer.parseInt(expirationDateEquityMembership)));
extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne); extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne);
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("权益会员原来的基础上增加有效期"); logger.debug("权益会员原来的基础上增加有效期");
...@@ -220,7 +225,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -220,7 +225,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
// consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex()); // consumerMember.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
// consumerMember.setMemberConfigId(memberConfigServiceOne.getId()); // consumerMember.setMemberConfigId(memberConfigServiceOne.getId());
consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())), consumerMember.setExpirationDate(DateUtils.addYears(DateUtils.parseDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, new Date())),
1)); Integer.parseInt(expirationDateEquityMembership)));
extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne); extracted(equityMembersOrder, equityMembersOrderConfig, consumerMember, consumerWallet, memberConfigServiceOne);
consumerMemberService.updateConsumerMember(consumerMember); consumerMemberService.updateConsumerMember(consumerMember);
logger.debug("修改会员类型为权益会员"); logger.debug("修改会员类型为权益会员");
...@@ -258,6 +263,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -258,6 +263,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
private void extracted(EquityMembersOrder equityMembersOrder, EquityMembersOrderConfig equityMembersOrderConfig, private void extracted(EquityMembersOrder equityMembersOrder, EquityMembersOrderConfig equityMembersOrderConfig,
ConsumerMember consumerMember, ConsumerWallet consumerWallet, MemberConfig memberConfigServiceOne) { ConsumerMember consumerMember, ConsumerWallet consumerWallet, MemberConfig memberConfigServiceOne) {
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
if (equityMembersOrderConfig.getGiftPoints().compareTo(BigDecimal.ZERO) > 0) { if (equityMembersOrderConfig.getGiftPoints().compareTo(BigDecimal.ZERO) > 0) {
MemberProgressLog memberProgressLog = new MemberProgressLog(); MemberProgressLog memberProgressLog = new MemberProgressLog();
memberProgressLog.setConsumerId(equityMembersOrder.getConsumerId()); memberProgressLog.setConsumerId(equityMembersOrder.getConsumerId());
...@@ -267,7 +273,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde ...@@ -267,7 +273,7 @@ public class EquityMembersOrderServiceImpl extends ServiceImpl<EquityMembersOrde
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setOperationTime(new Date()); memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
IntegralLog integralLog = new IntegralLog(); IntegralLog integralLog = new IntegralLog();
integralLog.setConsumerId(equityMembersOrder.getConsumerId()); integralLog.setConsumerId(equityMembersOrder.getConsumerId());
......
...@@ -54,6 +54,8 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i ...@@ -54,6 +54,8 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
private ConsumerWalletService consumerWalletService; private ConsumerWalletService consumerWalletService;
@Autowired @Autowired
private MemberConfigService memberConfigService; private MemberConfigService memberConfigService;
@Autowired
private ISysConfigService sysConfigService;
/** /**
* 查询充值记录 * 查询充值记录
...@@ -164,7 +166,8 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i ...@@ -164,7 +166,8 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
); );
// consumerMember.setMemberConfigId(memberConfig.getId()); // consumerMember.setMemberConfigId(memberConfig.getId());
consumerMember.setMembershipProgress(BigDecimal.ZERO); consumerMember.setMembershipProgress(BigDecimal.ZERO);
consumerMember.setExpirationDate(DateUtils.addYears(new Date(), 100)); String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
consumerMember.setExpirationDate(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
consumerMember.setCreateTime(new Date()); consumerMember.setCreateTime(new Date());
consumerMember.setIsRecharge(YesNoEnum.yes.getIndex()); consumerMember.setIsRecharge(YesNoEnum.yes.getIndex());
consumerMemberService.save(consumerMember); consumerMemberService.save(consumerMember);
......
...@@ -312,8 +312,16 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo ...@@ -312,8 +312,16 @@ public class SConsumerCenterServiceImpl extends ServiceImpl<SConsumerMapper, SCo
//判断是否为分享新用户 //判断是否为分享新用户
if (uid != null){ if (uid != null){
//添加绑定关系 //添加绑定关系
SConsumer consumer = sConsumerService.selectSConsumerById(uid);
SConsumer newConsumer = sConsumerService.selectSConsumerById(id);
SharingActivities sharingActivities = new SharingActivities(); SharingActivities sharingActivities = new SharingActivities();
sharingActivities.setUid(uid); sharingActivities.setUid(uid);
sharingActivities.setPhone(consumer.getPhone());
sharingActivities.setAvatar(consumer.getAvatar());
sharingActivities.setNickName(consumer.getNickName());
sharingActivities.setNewPhone(newConsumer.getPhone());
sharingActivities.setNewAvatar(newConsumer.getAvatar());
sharingActivities.setNewNickName(newConsumer.getNickName());
sharingActivities.setNewUid(id); sharingActivities.setNewUid(id);
sharingActivities.setCreateTime(DateUtils.getNowDate()); sharingActivities.setCreateTime(DateUtils.getNowDate());
sharingActivitiesService.insertSharingActivities(sharingActivities); sharingActivitiesService.insertSharingActivities(sharingActivities);
......
...@@ -167,6 +167,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -167,6 +167,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
@Autowired @Autowired
private MemberProgressLogService memberProgressLogService; private MemberProgressLogService memberProgressLogService;
@Autowired
private ISysConfigService sysConfigService;
@Autowired @Autowired
private RechargeService rechargeService; private RechargeService rechargeService;
...@@ -1235,11 +1237,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1235,11 +1237,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
memberProgressLog.setOperationType(YesNoEnum.yes.getIndex()); memberProgressLog.setOperationType(YesNoEnum.yes.getIndex());
memberProgressLog.setOperationTime(new Date()); memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 100)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
} }
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
} }
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
memberProgressLogService.save(memberProgressLog); memberProgressLogService.save(memberProgressLog);
...@@ -1422,11 +1426,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -1422,11 +1426,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
memberProgressLog.setOperationType(YesNoEnum.no.getIndex()); memberProgressLog.setOperationType(YesNoEnum.no.getIndex());
memberProgressLog.setOperationTime(new Date()); memberProgressLog.setOperationTime(new Date());
memberProgressLog.setCreateTime(new Date()); memberProgressLog.setCreateTime(new Date());
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
String expirationDateEquityMembership = sysConfigService.selectConfigByKey("expirationDateEquityMembership");
if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 100)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(rechargeMembershipExpirationTime)));
} }
if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) { if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), 1)); memberProgressLog.setExpirationTime(DateUtils.addYears(new Date(), Integer.parseInt(expirationDateEquityMembership)));
} }
if ((consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) if ((consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) || consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()))
...@@ -2504,6 +2510,33 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme ...@@ -2504,6 +2510,33 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// priceResponse.setAvailableBalance(consumerWallet.getBalance()); // priceResponse.setAvailableBalance(consumerWallet.getBalance());
// priceResponse.setAvailableDuration(consumerWallet.getRemainingDuration()); // priceResponse.setAvailableDuration(consumerWallet.getRemainingDuration());
// } // }
consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, user.getId()));
consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, user.getId()));
if (ObjectUtil.isNotEmpty(consumerMember)) {
queryWrapper.eq(Activity::getIsOpen, YesNoEnum.yes.getIndex());
// if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
// queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
// } else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
// } else {
// queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
// }
if (consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.NORMAL.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex())) {
queryWrapper.in(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex(), MemberTypeEnum.RIGHTS.getIndex());
} else if (consumerMember.getIsRecharge().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRights().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RECHARGE.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RECHARGE.getIndex());
} else if (consumerMember.getIsRights().equals(YesNoEnum.yes.getIndex()) && consumerMember.getIsRecharge().equals(YesNoEnum.no.getIndex())) {
// activity.setMemberType(MemberTypeEnum.RIGHTS.getIndex());
queryWrapper.eq(Activity::getMemberType, MemberTypeEnum.RIGHTS.getIndex());
}
}
if (ObjectUtil.isNotEmpty(consumerWallet)) {
priceResponse.setAvailableBalance(consumerWallet.getBalance());
priceResponse.setAvailableDuration(consumerWallet.getRemainingDuration());
}
} }
SRoom room = roomService.getById(request.getRoomId()); SRoom room = roomService.getById(request.getRoomId());
BigDecimal totalPrice = computeTotalPrice(room.getPrice(), request.getPreStartDate(), request.getPreEndDate()); BigDecimal totalPrice = computeTotalPrice(room.getPrice(), request.getPreStartDate(), request.getPreEndDate());
......
...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.DateUtils; import share.common.utils.DateUtils;
import share.system.domain.SConsumer;
import share.system.domain.SecondaryCardLog; import share.system.domain.SecondaryCardLog;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SecondaryCardLogVo; import share.system.domain.vo.SecondaryCardLogVo;
import share.system.mapper.SecondaryCardLogMapper; import share.system.mapper.SecondaryCardLogMapper;
import share.system.service.SecondaryCardLogService; import share.system.service.SecondaryCardLogService;
...@@ -41,6 +43,8 @@ public class SecondaryCardLogServiceImpl extends ServiceImpl<SecondaryCardLogMap ...@@ -41,6 +43,8 @@ public class SecondaryCardLogServiceImpl extends ServiceImpl<SecondaryCardLogMap
*/ */
@Override @Override
public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog) { public List<SecondaryCardLogVo> selectSecondaryCardLogList(SecondaryCardLogVo secondaryCardLog) {
SConsumer user = FrontTokenComponent.getWxSConsumerEntry();
secondaryCardLog.setConsumerId(user.getId());
return secondaryCardLogMapper.selectSecondaryCardLogList(secondaryCardLog); return secondaryCardLogMapper.selectSecondaryCardLogList(secondaryCardLog);
} }
......
...@@ -15,8 +15,10 @@ import share.common.enums.YesNoEnum; ...@@ -15,8 +15,10 @@ 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.system.domain.SConsumer;
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.SharingActivitiesService; import share.system.service.SharingActivitiesService;
/** /**
...@@ -32,6 +34,9 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -32,6 +34,9 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
private SharingActivitiesMapper sharingActivitiesMapper; private SharingActivitiesMapper sharingActivitiesMapper;
@Autowired @Autowired
private SConsumerService consumerService;
@Autowired
private RedisTemplate redisTemplate; private RedisTemplate redisTemplate;
/** /**
...@@ -81,7 +86,11 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -81,7 +86,11 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
@Override @Override
public int updateSharingActivities(SharingActivities sharingActivities) public int updateSharingActivities(SharingActivities sharingActivities)
{ {
SConsumer consumer = consumerService.selectSConsumerById(sharingActivities.getUid());
sharingActivities.setUpdateTime(DateUtils.getNowDate()); sharingActivities.setUpdateTime(DateUtils.getNowDate());
sharingActivities.setAvatar(consumer.getAvatar());
sharingActivities.setPhone(consumer.getPhone());
sharingActivities.setNickName(consumer.getNickName());
return sharingActivitiesMapper.updateSharingActivities(sharingActivities); return sharingActivitiesMapper.updateSharingActivities(sharingActivities);
} }
...@@ -109,4 +118,6 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM ...@@ -109,4 +118,6 @@ public class SharingActivitiesServiceImpl extends ServiceImpl<SharingActivitiesM
return sharingActivitiesMapper.deleteSharingActivitiesById(id); return sharingActivitiesMapper.deleteSharingActivitiesById(id);
} }
} }
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.EquityFundLogMapper"> <mapper namespace="share.system.mapper.EquityFundLogMapper">
<resultMap type="EquityFundLog" id="EquityFundLogResult"> <resultMap type="EquityFundLog" id="EquityFundLogResult">
...@@ -18,20 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,20 +18,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="account" column="account" />
<result property="nickName" column="nick_name" /> <result property="nickName" column="nick_name" />
<result property="phone" column="phone" /> <result property="newPhone" column="new_phone" />
<result property="newAccount" column="new_account" /> <result property="newAccount" column="new_account" />
<result property="newNickName" column="new_nick_name" /> <result property="newNickName" column="new_nick_name" />
<result property="newPhone" column="new_phone" /> <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, 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
, new_uid, terminal_trace, out_trade_no, is_delete,
create_by, create_time, update_by, update_time, remark,
account,nick_name,phone,new_account,new_nick_name,new_phone
from s_equity_fund_log
</sql> </sql>
<select id="selectEquityFundLogList" parameterType="EquityFundLog" resultMap="EquityFundLogResult"> <select id="selectEquityFundLogList" parameterType="EquityFundLog" resultMap="EquityFundLogResult">
...@@ -44,6 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -44,6 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
</select> </select>
...@@ -67,12 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -67,12 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="account != null">account,</if>
<if test="nickName != null">nickName,</if>
<if test="phone != null">phone,</if> <if test="phone != null">phone,</if>
<if test="newAccount != null">new_account,</if> <if test="account != null">account,</if>
<if test="newNickName != null">new_nickName,</if> <if test="nickName != null">nick_name,</if>
<if test="newPhone != null">new_phone,</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>
...@@ -87,12 +95,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -87,12 +95,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="account != null">#{account},</if>
<if test="nickName != null">#{nickName},</if> <if test="nickName != null">#{nickName},</if>
<if test="phone != null">#{phone},</if> <if test="newPhone != null">#{newPhone},</if>
<if test="newAccount != null">#{new_account},</if> <if test="newAccount != null">#{newAccount},</if>
<if test="newNickName != null">#{new_nickName},</if> <if test="newNickName != null">#{newNickName},</if>
<if test="newPhone != null">#{new_phone},</if> <if test="avatar != null">#{avatar},</if>
<if test="newAvatar != null">#{newAvatar},</if>
</trim> </trim>
</insert> </insert>
...@@ -111,6 +121,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -111,6 +121,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
......
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.SharingActivitiesMapper"> <mapper namespace="share.system.mapper.SharingActivitiesMapper">
<resultMap type="SharingActivities" id="SharingActivitiesResult"> <resultMap type="SharingActivities" id="SharingActivitiesResult">
...@@ -15,10 +15,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -15,10 +15,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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 from s_sharing_activities 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
</sql> </sql>
<select id="selectSharingActivitiesList" parameterType="SharingActivities" resultMap="SharingActivitiesResult"> <select id="selectSharingActivitiesList" parameterType="SharingActivities" resultMap="SharingActivitiesResult">
...@@ -28,6 +34,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,6 +34,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
</select> </select>
...@@ -48,6 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,6 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
...@@ -59,6 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
...@@ -74,6 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -74,6 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="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