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