Commit 811b37e3 by 吕明尚

Merge branch 'dev' into test

parents cbd6cbd6 1c69cb22
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.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import share.system.service.GiftAmountLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 赠送金额日志Controller
*
* @author wuwenlong
* @date 2024-10-08
*/
@RestController
@RequestMapping("/system/giftAmountLog")
public class GiftAmountLogController extends BaseController {
@Autowired
private GiftAmountLogService giftAmountLogService;
/**
* 查询赠送金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:list')")
@GetMapping("/list")
public TableDataInfo list(GiftAmountLogVo giftAmountLog) {
startPage();
List<GiftAmountLogVo> list = giftAmountLogService.selectGiftAmountLogList(giftAmountLog);
return getDataTable(list);
}
/**
* 导出赠送金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:export')")
@Log(title = "赠送金额日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, GiftAmountLogVo giftAmountLog) {
List<GiftAmountLogVo> list = giftAmountLogService.selectGiftAmountLogList(giftAmountLog);
ExcelUtil<GiftAmountLogVo> util = new ExcelUtil<GiftAmountLogVo>(GiftAmountLogVo.class);
util.exportExcel(response, list, "赠送金额日志数据");
}
/**
* 获取赠送金额日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(giftAmountLogService.selectGiftAmountLogById(id));
}
/**
* 新增赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:add')")
@Log(title = "赠送金额日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody GiftAmountLog giftAmountLog) {
return toAjax(giftAmountLogService.insertGiftAmountLog(giftAmountLog));
}
/**
* 修改赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:edit')")
@Log(title = "赠送金额日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody GiftAmountLog giftAmountLog) {
return toAjax(giftAmountLogService.updateGiftAmountLog(giftAmountLog));
}
/**
* 删除赠送金额日志
*/
@PreAuthorize("@ss.hasPermi('system:giftAmountLog:remove')")
@Log(title = "赠送金额日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(giftAmountLogService.deleteGiftAmountLogByIds(ids));
}
}
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.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import share.system.service.RechargeAmountLogService;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 充值金额日志Controller
*
* @author wuwenlong
* @date 2024-10-08
*/
@RestController
@RequestMapping("/system/rechargeAmountLog")
public class RechargeAmountLogController extends BaseController {
@Autowired
private RechargeAmountLogService rechargeAmountLogService;
/**
* 查询充值金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:list')")
@GetMapping("/list")
public TableDataInfo list(RechargeAmountLogVo rechargeAmountLog) {
startPage();
List<RechargeAmountLogVo> list = rechargeAmountLogService.selectRechargeAmountLogList(rechargeAmountLog);
return getDataTable(list);
}
/**
* 导出充值金额日志列表
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:export')")
@Log(title = "充值金额日志", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RechargeAmountLogVo rechargeAmountLog) {
List<RechargeAmountLogVo> list = rechargeAmountLogService.selectRechargeAmountLogList(rechargeAmountLog);
ExcelUtil<RechargeAmountLogVo> util = new ExcelUtil<RechargeAmountLogVo>(RechargeAmountLogVo.class);
util.exportExcel(response, list, "充值金额日志数据");
}
/**
* 获取充值金额日志详细信息
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return success(rechargeAmountLogService.selectRechargeAmountLogById(id));
}
/**
* 新增充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:add')")
@Log(title = "充值金额日志", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RechargeAmountLog rechargeAmountLog) {
return toAjax(rechargeAmountLogService.insertRechargeAmountLog(rechargeAmountLog));
}
/**
* 修改充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:edit')")
@Log(title = "充值金额日志", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RechargeAmountLog rechargeAmountLog) {
return toAjax(rechargeAmountLogService.updateRechargeAmountLog(rechargeAmountLog));
}
/**
* 删除充值金额日志
*/
@PreAuthorize("@ss.hasPermi('system:rechargeAmountLog:remove')")
@Log(title = "充值金额日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(rechargeAmountLogService.deleteRechargeAmountLogByIds(ids));
}
}
......@@ -13,7 +13,9 @@ public enum ReceiptRdeisEnum {
//房间15分钟过期
ROOM_EXPIRE_TIME(9, "ROOM_EXPIRE_TIME."),
ORDER_CANCEL_PAY(10, "ORDER_CANCEL_PAY."),
EQUITY_MEMBERS_TIME(11, "EQUITY_MEMBERS_TIME.")
EQUITY_MEMBERS_TIME(11, "EQUITY_MEMBERS_TIME."),
MONTHLY_CARD(12, "MONTHLY_CARD."),
SECONDARY_CARD(13, "SECONDARY_CARD.")
;
......
......@@ -35,8 +35,8 @@ public class ConsumerSecondaryCardController extends BaseController {
}
@GetMapping("/query")
public AjaxResult selectByConsumerId() {
return success(consumerSecondaryCardService.selectByConsumerId());
public AjaxResult selectByConsumerId(Long packId) {
return success(consumerSecondaryCardService.selectByPaclId(packId));
}
}
......@@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse;
import com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -33,7 +32,6 @@ import share.system.domain.vo.MqttxVo;
import share.system.service.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
......@@ -116,6 +114,12 @@ public class RedisTask {
@Autowired
private EquityFundExcessService equityFundExcessService;
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
@Autowired
private ConsumerSecondaryCardService consumerSecondaryCardService;
//15分钟的常量
final long FIFTEEN_MINUTES = 60 * 15;
......@@ -780,4 +784,42 @@ public class RedisTask {
});
logger.debug("AutoUpdateOpenid:自动更新用户unionid结束");
}
@XxlJob("AutomaticallyMonthlyCard")
public void AutomaticallyMonthlyCard() {
logger.debug("AutomaticallyMonthlyCard:自动结束月卡开始");
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.MONTHLY_CARD.getValue() + "*");
if (keys.size() == 0) return;
keys.stream().forEach(key -> {
String value = redisUtil.get(String.valueOf(key));
JSONObject jsonObject = new JSONObject(value);
Date expirationTime = jsonObject.getDate("expirationTime");
Long consumerMonthlyCardId = jsonObject.getLong("consumerMonthlyCardId");
if (expirationTime.getTime() < new Date().getTime()) {
consumerMonthlyCardService.removeById(consumerMonthlyCardId);
redisUtil.delete(key);
}
});
logger.debug("AutomaticallyMonthlyCard:自动结束月卡结束");
}
@XxlJob("AutomaticallySecondaryCard")
public void AutomaticallySecondaryCard() {
logger.debug("AutomaticallySecondaryCard:自动结束次卡开始");
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.SECONDARY_CARD.getValue() + "*");
if (keys.size() == 0) return;
keys.stream().forEach(key -> {
String value = redisUtil.get(String.valueOf(key));
JSONObject jsonObject = new JSONObject(value);
Date expirationTime = jsonObject.getDate("expirationTime");
Long consumerSecondaryCardId = jsonObject.getLong("consumerSecondaryCardId");
if (expirationTime.getTime() < new Date().getTime()) {
consumerSecondaryCardService.removeById(consumerSecondaryCardId);
redisUtil.delete(key);
}
});
logger.debug("AutomaticallySecondaryCard:自动结束次卡结束");
}
}
package share.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -10,6 +8,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.Date;
/**
......@@ -51,7 +50,7 @@ public class ConsumerMonthlyCard extends BaseEntity {
* 免费时长
*/
@Excel(name = "免费时长")
private Long freeDuration;
private BigDecimal freeDuration;
/**
* 月卡天数
......@@ -69,7 +68,10 @@ public class ConsumerMonthlyCard extends BaseEntity {
/**
* 删除标记:1-删除,0-正常
*/
private Long isDelete;
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Integer isDelete;
@Override
......
......@@ -39,6 +39,18 @@ public class ConsumerWallet extends BaseEntity {
private BigDecimal balance;
/**
* 充值金额
*/
@Excel(name = "充值金额")
private BigDecimal rechargeAmount;
/**
* 赠送金额
*/
@Excel(name = "赠送金额")
private BigDecimal giftAmount;
/**
* 时长
*/
@Excel(name = "时长")
......
package share.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
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 java.math.BigDecimal;
import java.util.Date;
/**
* 赠送金额日志对象 s_gift_amount_log
*
* @author wuwenlong
* @date 2024-10-08
*/
@Data
public class GiftAmountLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 用户id
*/
private Long consumerId;
/**
* 当前金额
*/
@Excel(name = "当前金额")
private BigDecimal currentAmount;
/**
* 变动金额
*/
@Excel(name = "变动金额")
private BigDecimal variableAmount;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Integer operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 是否删除
*/
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerId", getConsumerId())
.append("currentAmount", getCurrentAmount())
.append("variableAmount", getVariableAmount())
.append("operationType", getOperationType())
.append("operationTime", getOperationTime())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
......@@ -43,7 +43,7 @@ public class MonthlyCardConf extends BaseEntity {
* 免费时长
*/
@Excel(name = "免费时长")
private Long freeDuration;
private BigDecimal freeDuration;
/**
* 月卡天数
......
......@@ -3,12 +3,16 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
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 java.math.BigDecimal;
import java.util.Date;
/**
* 月卡使用记录对象 s_monthly_card_log
*
......@@ -47,13 +51,27 @@ public class MonthlyCardLog extends BaseEntity {
* 使用时长
*/
@Excel(name = "使用时长")
private Long useDuration;
private BigDecimal useDuration;
/**
* 剩余时长
*/
@Excel(name = "剩余时长")
private Long residueDuration;
private BigDecimal residueDuration;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Integer operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 删除标记:1-删除,0-正常
......
package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
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 java.math.BigDecimal;
import java.util.Date;
/**
* 充值金额日志对象 s_recharge_amount_log
*
* @author wuwenlong
* @date 2024-10-08
*/
@Data
public class RechargeAmountLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 用户id
*/
@Excel(name = "用户id")
private Long consumerId;
/**
* 当前金额
*/
@Excel(name = "当前金额")
private BigDecimal currentAmount;
/**
* 变动金额
*/
@Excel(name = "变动金额")
private BigDecimal variableAmount;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Integer operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 是否删除
*/
//逻辑删除注解(0 未删除 1 已删除)
@TableLogic
@TableField(select = false)
private Long isDelete;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("consumerId", getConsumerId())
.append("currentAmount", getCurrentAmount())
.append("variableAmount", getVariableAmount())
.append("operationType", getOperationType())
.append("operationTime", getOperationTime())
.append("isDelete", getIsDelete())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
......@@ -81,6 +81,12 @@ public class SOrder extends BaseEntity
@Excel(name = "优惠券金额")
private BigDecimal couponPrice;
@Excel(name = "次卡ID")
private Long secondaryCardId;
@Excel(name = "月卡ID")
private Long monthlyCardId;
@Excel(name = "订单总价")
private BigDecimal totalPrice;
......@@ -99,6 +105,12 @@ public class SOrder extends BaseEntity
@Excel(name = "使用余额")
private BigDecimal balance;
@Excel(name = "充值金额")
private BigDecimal rechargeAmount;
@Excel(name = "赠送金额")
private BigDecimal giftAmount;
@Excel(name = "优惠比例")
private BigDecimal discountRatio;
......
......@@ -3,12 +3,15 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
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 java.util.Date;
/**
* 次卡使用记录对象 s_secondary_card_log
*
......@@ -62,6 +65,20 @@ public class SecondaryCardLog extends BaseEntity {
private Long residueCount;
/**
* 操作类型
*/
@Excel(name = "操作类型")
private Integer operationType;
/**
* 操作时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date operationTime;
/**
* 删除标记:1-删除,0-正常
*/
//逻辑删除注解(0 未删除 1 已删除)
......
......@@ -19,4 +19,8 @@ public class ConsumerSecondaryCardVo extends ConsumerSecondaryCard {
private String confName;
//次卡金额
private BigDecimal confAmount;
//是否适用当前套餐
private Integer isUse;
//原因
private String reason;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.GiftAmountLog;
@Data
public class GiftAmountLogVo extends GiftAmountLog {
private String nickName;
private String avatar;
private String phone;
}
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.RechargeAmountLog;
@Data
public class RechargeAmountLogVo extends RechargeAmountLog {
private String nickName;
private String avatar;
private String phone;
}
......@@ -2,9 +2,10 @@ package share.system.domain.vo;
import lombok.Data;
import share.system.domain.ConsumerMember;
import share.system.domain.ConsumerWallet;
import share.system.domain.SConsumer;
import java.util.List;
/**
* @className: share.system.domain.vo.SConsumerVo
* @description: 会员
......@@ -46,7 +47,8 @@ public class SConsumerVo extends SConsumer {
private Long newId;
private List<ConsumerMonthlyCardVo> monthlyCardList;
private List<ConsumerSecondaryCardVo> secondaryCardList;
}
......@@ -61,5 +61,5 @@ public interface ConsumerMonthlyCardMapper extends BaseMapper<ConsumerMonthlyCar
*/
public int deleteConsumerMonthlyCardByIds(Long[] ids);
ConsumerMonthlyCardVo selectByConsumerId(ConsumerMonthlyCardVo consumerMemberVo);
List<ConsumerMonthlyCardVo> selectByConsumerId(ConsumerMonthlyCardVo consumerMemberVo);
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import java.util.List;
/**
* 赠送金额日志Mapper接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface GiftAmountLogMapper extends BaseMapper<GiftAmountLog> {
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
public GiftAmountLog selectGiftAmountLogById(Long id);
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志集合
*/
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog);
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int insertGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int updateGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 删除赠送金额日志
*
* @param id 赠送金额日志主键
* @return 结果
*/
public int deleteGiftAmountLogById(Long id);
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteGiftAmountLogByIds(Long[] ids);
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import java.util.List;
/**
* 充值金额日志Mapper接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface RechargeAmountLogMapper extends BaseMapper<RechargeAmountLog> {
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
public RechargeAmountLog selectRechargeAmountLogById(Long id);
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志集合
*/
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog);
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 删除充值金额日志
*
* @param id 充值金额日志主键
* @return 结果
*/
public int deleteRechargeAmountLogById(Long id);
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRechargeAmountLogByIds(Long[] ids);
}
......@@ -89,4 +89,12 @@ public class CreateOrderRequest {
@ApiModelProperty(value = "使用时长")
private BigDecimal duration;
//次卡ID
@ApiModelProperty(value = "次卡ID")
private Long secondaryCardId;
//月卡ID
@ApiModelProperty(value = "月卡ID")
private Long monthlyCardId;
}
......@@ -54,4 +54,12 @@ public class OrderComputedPriceRequest {
@ApiModelProperty(value = "标签id")
private Long roomLabelId;
//次卡ID
@ApiModelProperty(value = "次卡ID")
private Long secondaryCardId;
//月卡ID
@ApiModelProperty(value = "月卡ID")
private Long monthlyCardId;
}
......@@ -68,5 +68,12 @@ public class ComputedOrderPriceResponse implements Serializable {
@ApiModelProperty(value = "剩余余额")
private BigDecimal remainingBalance;
//次卡ID
@ApiModelProperty(value = "次卡ID")
private Long secondaryCardId;
//月卡ID
@ApiModelProperty(value = "月卡ID")
private Long monthlyCardId;
}
......@@ -61,5 +61,5 @@ public interface ConsumerMonthlyCardService extends IService<ConsumerMonthlyCard
*/
public int deleteConsumerMonthlyCardById(Long id);
ConsumerMonthlyCardVo selectByConsumerId();
List<ConsumerMonthlyCardVo> selectByConsumerId();
}
......@@ -62,4 +62,6 @@ public interface ConsumerSecondaryCardService extends IService<ConsumerSecondary
public int deleteConsumerSecondaryCardById(Long id);
List<ConsumerSecondaryCardVo> selectByConsumerId();
List<ConsumerSecondaryCardVo> selectByPaclId(Long packId);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import java.util.List;
/**
* 赠送金额日志Service接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface GiftAmountLogService extends IService<GiftAmountLog> {
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
public GiftAmountLog selectGiftAmountLogById(Long id);
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志集合
*/
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog);
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int insertGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
public int updateGiftAmountLog(GiftAmountLog giftAmountLog);
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的赠送金额日志主键集合
* @return 结果
*/
public int deleteGiftAmountLogByIds(Long[] ids);
/**
* 删除赠送金额日志信息
*
* @param id 赠送金额日志主键
* @return 结果
*/
public int deleteGiftAmountLogById(Long id);
}
package share.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import java.util.List;
/**
* 充值金额日志Service接口
*
* @author wuwenlong
* @date 2024-10-08
*/
public interface RechargeAmountLogService extends IService<RechargeAmountLog> {
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
public RechargeAmountLog selectRechargeAmountLogById(Long id);
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志集合
*/
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog);
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog);
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的充值金额日志主键集合
* @return 结果
*/
public int deleteRechargeAmountLogByIds(Long[] ids);
/**
* 删除充值金额日志信息
*
* @param id 充值金额日志主键
* @return 结果
*/
public int deleteRechargeAmountLogById(Long id);
}
......@@ -95,7 +95,7 @@ public class ConsumerMonthlyCardServiceImpl extends ServiceImpl<ConsumerMonthlyC
}
@Override
public ConsumerMonthlyCardVo selectByConsumerId() {
public List<ConsumerMonthlyCardVo> selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
ConsumerMonthlyCardVo vo = new ConsumerMonthlyCardVo();
vo.setConsumerId(info.getId());
......
package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.enums.YesNoEnum;
import share.common.exception.base.BaseException;
import share.common.utils.DateUtils;
import share.system.domain.ConsumerSecondaryCard;
import share.system.domain.SConsumer;
import share.system.domain.SPack;
import share.system.domain.vo.ConsumerSecondaryCardVo;
import share.system.mapper.ConsumerSecondaryCardMapper;
import share.system.service.ConsumerSecondaryCardService;
import share.system.service.IPackService;
import share.system.service.SConsumerService;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 用户次卡Service业务层处理
......@@ -25,6 +33,8 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
private ConsumerSecondaryCardMapper consumerSecondaryCardMapper;
@Autowired
private SConsumerService sConsumerService;
@Autowired
private IPackService packService;
/**
* 查询用户次卡
......@@ -97,8 +107,32 @@ public class ConsumerSecondaryCardServiceImpl extends ServiceImpl<ConsumerSecond
@Override
public List<ConsumerSecondaryCardVo> selectByConsumerId() {
SConsumer info = sConsumerService.getInfo();
if (ObjectUtil.isNull(info)) {
throw new BaseException("您的登录已过期,请先登录");
}
ConsumerSecondaryCardVo vo = new ConsumerSecondaryCardVo();
vo.setConsumerId(info.getId());
return consumerSecondaryCardMapper.selectByConsumerId(vo);
}
@Override
public List<ConsumerSecondaryCardVo> selectByPaclId(Long packId) {
SConsumer info = sConsumerService.getInfo();
if (ObjectUtil.isNull(info)) {
throw new BaseException("您的登录已过期,请先登录");
}
Map<Long, SPack> packMap = packService.list().stream().collect(Collectors.toMap(SPack::getId, Function.identity()));
ConsumerSecondaryCardVo vo = new ConsumerSecondaryCardVo();
vo.setConsumerId(info.getId());
List<ConsumerSecondaryCardVo> consumerSecondaryCardVos = consumerSecondaryCardMapper.selectByConsumerId(vo);
consumerSecondaryCardVos.stream().forEach(item -> {
if (item.getPackId().equals(packId)) {
item.setIsUse(YesNoEnum.yes.getIndex());
} else {
item.setIsUse(YesNoEnum.no.getIndex());
item.setReason("当前次卡适用于" + packMap.get(item.getPackId()).getName() + "套餐" + ",不适用于" + packMap.get(packId).getName() + "套餐");
}
});
return consumerSecondaryCardVos;
}
}
......@@ -59,6 +59,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
private ISConsumerCouponService consumerCouponService;
@Autowired
private ISysConfigService sysConfigService;
@Autowired
private RechargeAmountLogService rechargeAmountLogService;
@Autowired
private GiftAmountLogService giftAmountLogService;
/**
* 查询会员钱包
......@@ -153,6 +157,26 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
balanceLog.setCreateTime(new Date());
balanceLogService.save(balanceLog);
}
if (consumerWallet.getRechargeAmount().compareTo(new BigDecimal(0)) > 0) {
RechargeAmountLog rechargeAmountLog = new RechargeAmountLog();
rechargeAmountLog.setConsumerId(consumerWallet.getConsumerId());
rechargeAmountLog.setCurrentAmount(new BigDecimal(0));
rechargeAmountLog.setVariableAmount(consumerWallet.getRechargeAmount());
rechargeAmountLog.setOperationType(YesNoEnum.yes.getIndex());
rechargeAmountLog.setOperationTime(new Date());
rechargeAmountLog.setCreateTime(new Date());
rechargeAmountLogService.save(rechargeAmountLog);
}
if (consumerWallet.getGiftAmount().compareTo(new BigDecimal(0)) > 0) {
GiftAmountLog giftAmountLog = new GiftAmountLog();
giftAmountLog.setConsumerId(consumerWallet.getConsumerId());
giftAmountLog.setCurrentAmount(new BigDecimal(0));
giftAmountLog.setVariableAmount(consumerWallet.getGiftAmount());
giftAmountLog.setOperationType(YesNoEnum.yes.getIndex());
giftAmountLog.setOperationTime(new Date());
giftAmountLog.setCreateTime(new Date());
giftAmountLogService.save(giftAmountLog);
}
if (consumerWallet.getRemainingDuration().compareTo(new BigDecimal(0)) > 0) {
DurationLog durationLog = new DurationLog();
durationLog.setConsumerId(consumerWallet.getConsumerId());
......@@ -206,6 +230,8 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
public boolean editConsumerWallet(ConsumerWallet consumerWallet, Recharge recharge, ConsumerMember one) {
BigDecimal divide = new BigDecimal(0);
BigDecimal oldBalance = consumerWallet.getBalance();
BigDecimal oldRechargeAmount = consumerWallet.getRechargeAmount();
BigDecimal oldGiftAmount = consumerWallet.getGiftAmount();
BigDecimal oldDuration = consumerWallet.getRemainingDuration();
BigDecimal oldIntegral = consumerWallet.getRemainingIntegral();
String rechargeMembershipExpirationTime = sysConfigService.selectConfigByKey("rechargeMembershipExpirationTime");
......@@ -222,8 +248,10 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
logger.debug("修改会员用户");
consumerWallet.setBalance(consumerWallet.getBalance().add(recharge.getRechargeAmount()));
consumerWallet.setRechargeAmount(consumerWallet.getRechargeAmount().add(recharge.getRechargeAmount()));
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
consumerWallet.setBalance(consumerWallet.getBalance().add(recharge.getGiveAmount()));
consumerWallet.setGiftAmount(consumerWallet.getGiftAmount().add(recharge.getGiveAmount()));
}
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
BigDecimal duration = consumerWallet.getRemainingDuration().add(rechargeConf.getGiveDuration());
......@@ -247,6 +275,28 @@ public class ConsumerWalletServiceImpl extends ServiceImpl<ConsumerWalletMapper,
balanceLogService.save(balanceLog);
logger.debug("新增余额日志");
}
if (consumerWallet.getRechargeAmount().compareTo(new BigDecimal(0)) > 0) {
RechargeAmountLog rechargeAmountLog = new RechargeAmountLog();
rechargeAmountLog.setConsumerId(consumerWallet.getConsumerId());
rechargeAmountLog.setCurrentAmount(oldRechargeAmount);
rechargeAmountLog.setVariableAmount(consumerWallet.getRechargeAmount().subtract(oldRechargeAmount));
rechargeAmountLog.setOperationType(YesNoEnum.yes.getIndex());
rechargeAmountLog.setOperationTime(new Date());
rechargeAmountLog.setCreateTime(new Date());
rechargeAmountLogService.save(rechargeAmountLog);
logger.debug("新增充值金额日志");
}
if (consumerWallet.getGiftAmount().compareTo(new BigDecimal(0)) > 0) {
GiftAmountLog giftAmountLog = new GiftAmountLog();
giftAmountLog.setConsumerId(consumerWallet.getConsumerId());
giftAmountLog.setCurrentAmount(oldGiftAmount);
giftAmountLog.setVariableAmount(consumerWallet.getGiftAmount().subtract(oldGiftAmount));
giftAmountLog.setOperationType(YesNoEnum.yes.getIndex());
giftAmountLog.setOperationTime(new Date());
giftAmountLog.setCreateTime(new Date());
giftAmountLogService.save(giftAmountLog);
logger.debug("新增赠送金额日志");
}
if (consumerWallet.getRemainingDuration().compareTo(new BigDecimal(0)) > 0) {
DurationLog durationLog = new DurationLog();
durationLog.setConsumerId(consumerWallet.getConsumerId());
......
package share.system.service.impl;
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.GiftAmountLog;
import share.system.domain.vo.GiftAmountLogVo;
import share.system.mapper.GiftAmountLogMapper;
import share.system.service.GiftAmountLogService;
import java.util.List;
/**
* 赠送金额日志Service业务层处理
*
* @author wuwenlong
* @date 2024-10-08
*/
@Service
public class GiftAmountLogServiceImpl extends ServiceImpl<GiftAmountLogMapper, GiftAmountLog> implements GiftAmountLogService {
@Autowired
private GiftAmountLogMapper giftAmountLogMapper;
/**
* 查询赠送金额日志
*
* @param id 赠送金额日志主键
* @return 赠送金额日志
*/
@Override
public GiftAmountLog selectGiftAmountLogById(Long id) {
return giftAmountLogMapper.selectGiftAmountLogById(id);
}
/**
* 查询赠送金额日志列表
*
* @param giftAmountLog 赠送金额日志
* @return 赠送金额日志
*/
@Override
public List<GiftAmountLogVo> selectGiftAmountLogList(GiftAmountLogVo giftAmountLog) {
return giftAmountLogMapper.selectGiftAmountLogList(giftAmountLog);
}
/**
* 新增赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
@Override
public int insertGiftAmountLog(GiftAmountLog giftAmountLog) {
giftAmountLog.setCreateTime(DateUtils.getNowDate());
return giftAmountLogMapper.insertGiftAmountLog(giftAmountLog);
}
/**
* 修改赠送金额日志
*
* @param giftAmountLog 赠送金额日志
* @return 结果
*/
@Override
public int updateGiftAmountLog(GiftAmountLog giftAmountLog) {
giftAmountLog.setUpdateTime(DateUtils.getNowDate());
return giftAmountLogMapper.updateGiftAmountLog(giftAmountLog);
}
/**
* 批量删除赠送金额日志
*
* @param ids 需要删除的赠送金额日志主键
* @return 结果
*/
@Override
public int deleteGiftAmountLogByIds(Long[] ids) {
return giftAmountLogMapper.deleteGiftAmountLogByIds(ids);
}
/**
* 删除赠送金额日志信息
*
* @param id 赠送金额日志主键
* @return 结果
*/
@Override
public int deleteGiftAmountLogById(Long id) {
return giftAmountLogMapper.deleteGiftAmountLogById(id);
}
}
package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.core.redis.RedisUtil;
import share.common.enums.ReceiptRdeisEnum;
import share.common.enums.YesNoEnum;
import share.common.exception.base.BaseException;
import share.common.utils.BaseUtil;
......@@ -24,7 +27,9 @@ import share.system.response.MonthlyyCardPayResultResponse;
import share.system.service.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 月卡订单Service业务层处理
......@@ -44,6 +49,8 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
private MonthlyCardConfService monthlyCardConfService;
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
@Autowired
private RedisUtil redisUtil;
/**
* 查询月卡订单
......@@ -170,6 +177,18 @@ public class MonthlyCardOrderServiceImpl extends ServiceImpl<MonthlyCardOrderMap
consumerMonthlyCard.setMonthlyCardDays(byId.getMonthlyCardDays());
consumerMonthlyCard.setCreateTime(new Date());
consumerMonthlyCardService.save(consumerMonthlyCard);
Map<String, String> map = new HashMap<>();
map.put("consumerMonthlyCardId", String.valueOf(consumerMonthlyCard.getId()));
map.put("expirationTime", consumerMonthlyCard.getExpirationDate().toString());
JSONObject jsonObject = new JSONObject(map);
new Thread(() -> {
try {
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.MONTHLY_CARD.getValue() + consumerMonthlyCard.getId(), jsonObject.toString());
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
}
@Override
......
package share.system.service.impl;
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.RechargeAmountLog;
import share.system.domain.vo.RechargeAmountLogVo;
import share.system.mapper.RechargeAmountLogMapper;
import share.system.service.RechargeAmountLogService;
import java.util.List;
/**
* 充值金额日志Service业务层处理
*
* @author wuwenlong
* @date 2024-10-08
*/
@Service
public class RechargeAmountLogServiceImpl extends ServiceImpl<RechargeAmountLogMapper, RechargeAmountLog> implements RechargeAmountLogService {
@Autowired
private RechargeAmountLogMapper rechargeAmountLogMapper;
/**
* 查询充值金额日志
*
* @param id 充值金额日志主键
* @return 充值金额日志
*/
@Override
public RechargeAmountLog selectRechargeAmountLogById(Long id) {
return rechargeAmountLogMapper.selectRechargeAmountLogById(id);
}
/**
* 查询充值金额日志列表
*
* @param rechargeAmountLog 充值金额日志
* @return 充值金额日志
*/
@Override
public List<RechargeAmountLogVo> selectRechargeAmountLogList(RechargeAmountLogVo rechargeAmountLog) {
return rechargeAmountLogMapper.selectRechargeAmountLogList(rechargeAmountLog);
}
/**
* 新增充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
@Override
public int insertRechargeAmountLog(RechargeAmountLog rechargeAmountLog) {
rechargeAmountLog.setCreateTime(DateUtils.getNowDate());
return rechargeAmountLogMapper.insertRechargeAmountLog(rechargeAmountLog);
}
/**
* 修改充值金额日志
*
* @param rechargeAmountLog 充值金额日志
* @return 结果
*/
@Override
public int updateRechargeAmountLog(RechargeAmountLog rechargeAmountLog) {
rechargeAmountLog.setUpdateTime(DateUtils.getNowDate());
return rechargeAmountLogMapper.updateRechargeAmountLog(rechargeAmountLog);
}
/**
* 批量删除充值金额日志
*
* @param ids 需要删除的充值金额日志主键
* @return 结果
*/
@Override
public int deleteRechargeAmountLogByIds(Long[] ids) {
return rechargeAmountLogMapper.deleteRechargeAmountLogByIds(ids);
}
/**
* 删除充值金额日志信息
*
* @param id 充值金额日志主键
* @return 结果
*/
@Override
public int deleteRechargeAmountLogById(Long id) {
return rechargeAmountLogMapper.deleteRechargeAmountLogById(id);
}
}
......@@ -223,9 +223,11 @@ public class RechargeServiceImpl extends ServiceImpl<RechargeMapper, Recharge> i
ConsumerWallet consumerWallet = new ConsumerWallet();
consumerWallet.setConsumerId(recharge.getConsumerId());
consumerWallet.setBalance(recharge.getRechargeAmount());
consumerWallet.setRechargeAmount(recharge.getRechargeAmount());
if (rechargeConf.getGiveType().contains(GiveTypeEnum.AMOUNT.getIndex())) {
BigDecimal balance = recharge.getRechargeAmount().add(rechargeConf.getGiveAmount());
consumerWallet.setBalance(balance);
consumerWallet.setGiftAmount(rechargeConf.getGiveAmount());
}
if (rechargeConf.getGiveType().contains(GiveTypeEnum.DURATION.getIndex())) {
consumerWallet.setRemainingDuration(rechargeConf.getGiveDuration());
......
......@@ -25,7 +25,6 @@ import share.common.utils.DateUtils;
import share.common.utils.StringUtils;
import share.system.domain.*;
import share.system.domain.vo.*;
import share.system.mapper.ConsumerMemberMapper;
import share.system.mapper.SConsumerMapper;
import share.system.mapper.SStoreConsumerMapper;
import share.system.request.RegisterThirdSConsumerRequest;
......@@ -63,6 +62,10 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
private MemberConfigService memberConfigService;
@Autowired
private MemberProgressLogService memberProgressLogService;
@Autowired
private ConsumerSecondaryCardService consumerSecondaryCardService;
@Autowired
private ConsumerMonthlyCardService consumerMonthlyCardService;
@Autowired
......@@ -214,6 +217,8 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
BeanUtils.copyProperties(currentUser, vo);
ConsumerMember consumerMember = consumerMemberService.getOne(new LambdaQueryWrapper<ConsumerMember>().eq(ConsumerMember::getConsumerId, currentUser.getId()));
ConsumerWallet consumerWallet = consumerWalletService.getOne(new LambdaQueryWrapper<ConsumerWallet>().eq(ConsumerWallet::getConsumerId, currentUser.getId()));
List<ConsumerSecondaryCardVo> consumerSecondaryCardVos = consumerSecondaryCardService.selectByConsumerId();
List<ConsumerMonthlyCardVo> consumerMonthlyCardVo = consumerMonthlyCardService.selectByConsumerId();
if (ObjectUtil.isNotEmpty(consumerMember)) {
vo.setConsumerMember(consumerMember);
MemberConfig memberConfig = memberConfigService.getOne(new LambdaQueryWrapper<MemberConfig>().eq(MemberConfig::getMembershipLevel, consumerMember.getMembershipLevel()));
......@@ -277,9 +282,12 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
} else {
vo.setIsManage(true);
}
if (!CollectionUtils.isEmpty(consumerSecondaryCardVos)) {
vo.setSecondaryCardList(consumerSecondaryCardVos);
}
if (!CollectionUtils.isEmpty(consumerMonthlyCardVo)) {
vo.setMonthlyCardList(consumerMonthlyCardVo);
}
return vo;
}
......@@ -352,8 +360,8 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
public TableDataInfo selectConsumernotById(SConsumerVo sConsumer) {
List<ConsumerMember> consumerMembers = consumerMemberService
.list(new LambdaQueryWrapper<ConsumerMember>()
.eq(ConsumerMember::getIsRights,YesNoEnum.yes.getIndex())
.ne(ConsumerMember::getConsumerId,sConsumer.getNewId()));
.eq(ConsumerMember::getIsRights, YesNoEnum.yes.getIndex())
.ne(ConsumerMember::getConsumerId, sConsumer.getNewId()));
List<Long> collect = consumerMembers.stream().map(ConsumerMember::getConsumerId).collect(Collectors.toList());
LambdaQueryWrapper<SConsumer> uSConsumer = new LambdaQueryWrapper<SConsumer>();
if (StringUtils.isNotEmpty(sConsumer.getPhone())){
......
package share.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import share.common.core.redis.RedisUtil;
import share.common.enums.ReceiptRdeisEnum;
import share.common.enums.YesNoEnum;
import share.common.exception.base.BaseException;
import share.common.utils.BaseUtil;
......@@ -23,7 +26,9 @@ import share.system.response.SecondaryCardOrderPayResultResponse;
import share.system.service.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 次卡购买记录Service业务层处理
......@@ -43,6 +48,8 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
private SecondaryCardConfService secondaryCardConfService;
@Autowired
private ConsumerSecondaryCardService consumerSecondaryCardService;
@Autowired
private RedisUtil redisUtil;
/**
* 查询次卡购买记录
......@@ -160,6 +167,18 @@ public class SecondaryCardOrderServiceImpl extends ServiceImpl<SecondaryCardOrde
consumerSecondaryCard.setNumber(secondaryCardConf.getNumber());
consumerSecondaryCard.setCreateTime(new Date());
consumerSecondaryCardService.save(consumerSecondaryCard);
Map<String, String> map = new HashMap<>();
map.put("consumerSecondaryCardId", String.valueOf(consumerSecondaryCard.getId()));
map.put("expirationTime", consumerSecondaryCard.getExpirationDate().toString());
JSONObject jsonObject = new JSONObject(map);
new Thread(() -> {
try {
Thread.sleep(1000);
redisUtil.set(ReceiptRdeisEnum.SECONDARY_CARD.getValue() + consumerSecondaryCard.getId(), jsonObject.toString());
} catch (InterruptedException e) {
e.printStackTrace();
}
}).start();
}
@Override
......
......@@ -11,6 +11,8 @@
<result property="avatar" column="avatar"/>
<result property="phone" column="phone"/>
<result property="balance" column="balance"/>
<result property="rechargeAmount" column="recharge_amount"/>
<result property="giftAmount" column="gift_amount"/>
<result property="remainingDuration" column="remaining_duration"/>
<result property="remainingIntegral" column="remaining_integral"/>
<result property="isDelete" column="is_delete"/>
......@@ -27,6 +29,8 @@
select id,
consumer_id,
balance,
recharge_amount,
gift_amount,
remaining_duration,
remaining_integral,
is_delete,
......@@ -47,6 +51,8 @@
c.phone,
c.avatar,
w.balance,
w.recharge_amount,
w.gift_amount,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
......@@ -80,6 +86,8 @@
c.phone,
c.avatar,
w.balance,
w.recharge_amount,
w.gift_amount,
w.remaining_duration,
w.remaining_integral,
w.is_delete,
......@@ -109,6 +117,8 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="balance != null">balance,</if>
<if test="rechargeAmount != null">recharge_amount,</if>
<if test="giftAmount != null">gift_amount,</if>
<if test="remainingDuration != null">remaining_duration,</if>
<if test="remainingIntegral != null">remaining_integral,</if>
<if test="isDelete != null">is_delete,</if>
......@@ -123,6 +133,8 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="balance != null">#{balance},</if>
<if test="rechargeAmount != null">#{rechargeAmount},</if>
<if test="giftAmount != null">#{giftAmount},</if>
<if test="remainingDuration != null">#{remainingDuration},</if>
<if test="remainingIntegral != null">#{remainingIntegral},</if>
<if test="isDelete != null">#{isDelete},</if>
......@@ -141,6 +153,8 @@
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="balance != null">balance = #{balance},</if>
<if test="rechargeAmount != null">recharge_amount = #{rechargeAmount},</if>
<if test="giftAmount != null">gift_amount = #{giftAmount},</if>
<if test="remainingDuration != null">remaining_duration = #{remainingDuration},</if>
<if test="remainingIntegral != null">remaining_integral = #{remainingIntegral},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="share.system.mapper.GiftAmountLogMapper">
<resultMap type="GiftAmountLogVo" id="GiftAmountLogResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="currentAmount" column="current_amount"/>
<result property="variableAmount" column="variable_amount"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectGiftAmountLogVo">
select id,
consumer_id,
current_amount,
variable_amount,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_gift_amount_log
</sql>
<select id="selectGiftAmountLogList" parameterType="GiftAmountLogVo" resultMap="GiftAmountLogResult">
select b.id,
b.consumer_id,
c.nick_name,
c.phone,
c.avatar,
b.variable_amount,
b.current_amount,
b.operation_type,
b.operation_time,
b. is_delete,
b. create_by,
b. create_time,
b. update_by,
b.update_time,
b. remark
from s_gift_amount_log b join s_consumer c on b.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')</if>
</where>
ORDER BY b.operation_time DESC
</select>
<select id="selectGiftAmountLogById" parameterType="Long" resultMap="GiftAmountLogResult">
<include refid="selectGiftAmountLogVo"/>
where id = #{id}
</select>
<insert id="insertGiftAmountLog" parameterType="GiftAmountLog" useGeneratedKeys="true" keyProperty="id">
insert into s_gift_amount_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="currentAmount != null">current_amount,</if>
<if test="variableAmount != null">variable_amount,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="currentAmount != null">#{currentAmount},</if>
<if test="variableAmount != null">#{variableAmount},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateGiftAmountLog" parameterType="GiftAmountLog">
update s_gift_amount_log
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="currentAmount != null">current_amount = #{currentAmount},</if>
<if test="variableAmount != null">variable_amount = #{variableAmount},</if>
<if test="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGiftAmountLogById" parameterType="Long">
delete
from s_gift_amount_log
where id = #{id}
</delete>
<delete id="deleteGiftAmountLogByIds" parameterType="String">
delete from s_gift_amount_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -15,6 +15,8 @@
<result property="phone" column="phone"/>
<result property="useDuration" column="use_duration"/>
<result property="residueDuration" column="residue_duration"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
......@@ -30,6 +32,8 @@
phone,
use_duration,
residue_duration,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
......@@ -50,6 +54,8 @@
l.phone,
l.use_duration,
l.residue_duration,
l.operation_type,
l.operation_time,
l.is_delete,
l.create_by,
l.create_time,
......@@ -65,6 +71,7 @@
<if test="phone != null and phone != ''">and l.phone = #{phone}</if>
<if test="useDuration != null ">and l.use_duration = #{useDuration}</if>
<if test="residueDuration != null ">and l.residue_duration = #{residueDuration}</if>
order by l.create_time
</select>
<select id="selectMonthlyCardLogById" parameterType="Long" resultMap="MonthlyCardLogResult">
......@@ -86,6 +93,8 @@
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerMonthlyCardId != null">#{consumerMonthlyCardId},</if>
......@@ -99,6 +108,8 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
</trim>
</insert>
......@@ -116,6 +127,8 @@
<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="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</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">
<mapper namespace="share.system.mapper.RechargeAmountLogMapper">
<resultMap type="RechargeAmountLogVo" id="RechargeAmountLogResult">
<result property="id" column="id"/>
<result property="consumerId" column="consumer_id"/>
<result property="nickName" column="nick_name"/>
<result property="phone" column="phone"/>
<result property="avatar" column="avatar"/>
<result property="currentAmount" column="current_amount"/>
<result property="variableAmount" column="variable_amount"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
</resultMap>
<sql id="selectRechargeAmountLogVo">
select id,
consumer_id,
current_amount,
variable_amount,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
update_by,
update_time,
remark
from s_recharge_amount_log
</sql>
<select id="selectRechargeAmountLogList" parameterType="RechargeAmountLogVo" resultMap="RechargeAmountLogResult">
select b.id,
b.consumer_id,
c.nick_name,
c.phone,
c.avatar,
b.variable_amount,
b.current_amount,
b.operation_type,
b.operation_time,
b. is_delete,
b. create_by,
b. create_time,
b. update_by,
b.update_time,
b. remark
from s_recharge_amount_log b join s_consumer c on b.consumer_id = c.id
<where>
<if test="nickName != null and nickName != ''">and c.nick_name like concat('%', #{nickName},'%')</if>
<if test="phone != null and phone != ''">and c.phone like concat('%', #{phone},'%')</if>
<if test="currentAmount != null ">and b.current_amount = #{currentAmount}</if>
<if test="variableAmount != null ">and b.variable_amount = #{variableAmount}</if>
</where>
ORDER BY b.operation_time DESC
</select>
<select id="selectRechargeAmountLogById" parameterType="Long" resultMap="RechargeAmountLogResult">
<include refid="selectRechargeAmountLogVo"/>
where id = #{id}
</select>
<insert id="insertRechargeAmountLog" parameterType="RechargeAmountLog" useGeneratedKeys="true" keyProperty="id">
insert into s_recharge_amount_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="consumerId != null">consumer_id,</if>
<if test="currentAmount != null">current_amount,</if>
<if test="variableAmount != null">variable_amount,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
<if test="isDelete != null">is_delete,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerId != null">#{consumerId},</if>
<if test="currentAmount != null">#{currentAmount},</if>
<if test="variableAmount != null">#{variableAmount},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
<if test="isDelete != null">#{isDelete},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateRechargeAmountLog" parameterType="RechargeAmountLog">
update s_recharge_amount_log
<trim prefix="SET" suffixOverrides=",">
<if test="consumerId != null">consumer_id = #{consumerId},</if>
<if test="currentAmount != null">current_amount = #{currentAmount},</if>
<if test="variableAmount != null">variable_amount = #{variableAmount},</if>
<if test="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRechargeAmountLogById" parameterType="Long">
delete
from s_recharge_amount_log
where id = #{id}
</delete>
<delete id="deleteRechargeAmountLogByIds" parameterType="String">
delete from s_recharge_amount_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -21,9 +21,13 @@
<result property="packPrice" column="pack_price"/>
<result property="couponId" column="coupon_id"/>
<result property="couponPrice" column="coupon_price"/>
<result property="secondaryCardId" column="secondary_card_id"/>
<result property="monthlyCardId" column="monthly_card_id"/>
<result property="totalPrice" column="total_price"/>
<result property="duration" column="duration"/>
<result property="balance" column="balance"/>
<result property="rechargeAmount" column="recharge_amount"/>
<result property="giftAmount" column="gift_amount"/>
<result property="discountRatio" column="discount_ratio"/>
<result property="payPrice" column="pay_price"/>
<result property="payTime" column="pay_time"/>
......@@ -63,10 +67,14 @@
pack_price,
coupon_id,
coupon_price,
secondary_card_id,
monthly_card_id,
total_price,
pay_price,
duration,
balance,
recharge_amount,
gift_amount,
discount_ratio,
pay_time,
time_long,
......@@ -106,10 +114,14 @@
pack_price,
coupon_id,
coupon_price,
secondary_card_id,
monthly_card_id,
total_price,
pay_price,
duration,
balance,
recharge_amount,
gift_amount,
discount_ratio,
pay_time,
time_long,
......@@ -149,10 +161,14 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
<if test="balance != null and balance != ''">and balance = #{balance}</if>
<if test="rechargeAmount != null and rechargeAmount != ''">and recharge_amount = #{rechargeAmount}</if>
<if test="giftAmount != null and giftAmount !=''">and gift_amount = #{giftAmount}</if>
<if test="discountRatio != null and discountRatio != ''">and discount_ratio = #{discountRatio}</if>
<if test="startPayTime != null">
and DATE_FORMAT(pay_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startPayTime}, '%Y-%m-%d')
......@@ -225,11 +241,15 @@
s.consumer_phone,
s.duration,
s.balance,
s.recharge_amount,
s.gift_amount,
s.discount_ratio,
s.pack_id,
s.pack_price,
s.coupon_id,
s.coupon_price,
s.secondary_card_id,
s.monthly_card_id,
s.total_price,
s.pay_price,
s.discount_ratio,
......@@ -273,11 +293,15 @@
s.consumer_phone,
s.duration,
s.balance,
s.recharge_amount,
s.gift_amount,
s.discount_ratio,
s.pack_id,
s.pack_price,
s.coupon_id,
s.coupon_price,
s.secondary_card_id,
s.monthly_card_id,
s.total_price,
s.pay_price,
s.discount_ratio,
......@@ -339,6 +363,8 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
......@@ -401,6 +427,8 @@
<if test="packPrice != null and packPrice != ''">and pack_price = #{packPrice}</if>
<if test="couponId != null and couponId != ''">and coupon_id = #{couponId}</if>
<if test="couponPrice != null and couponPrice != ''">and coupon_price = #{couponPrice}</if>
<if test="secondaryCardId != null and secondaryCardId != ''">and secondary_card_id = #{secondaryCardId}</if>
<if test="monthlyCardId != null and monthlyCardId != ''">and monthly_card_id = #{monthlyCardId}</if>
<if test="totalPrice != null and totalPrice != ''">and total_price = #{totalPrice}</if>
<if test="payPrice != null and payPrice != ''">and pay_price = #{payPrice}</if>
<if test="duration != null and duration != ''">and duration = #{duration}</if>
......@@ -480,6 +508,10 @@
<if test="discountRatio != null and discountRatio != ''">discount_ratio,</if>
<if test="duration != null and duration != ''">duration,</if>
<if test="balance != null and balance != '' ">balance,</if>
<if test="rechargeAmount != null and rechargeAmount != ''">recharge_amount,</if>
<if test="giftAmount != null and giftAmount != ''">gift_amount,</if>
<if test="secondaryCardId != null and secondaryCardId != ''">secondary_card_id,</if>
<if test="monthlyCardId != null and monthlyCardId != ''">monthly_card_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if>
......@@ -517,6 +549,10 @@
<if test="discountRatio != null">#{discountRatio},</if>
<if test="duration != null">#{duration},</if>
<if test="balance != null">#{balance},</if>
<if test="rechargeAmount != null">#{rechargeAmount},</if>
<if test="giftAmount != null">#{giftAmount},</if>
<if test="secondaryCardId != null">#{secondary_card_id},</if>
<if test="monthlyCardId != null">#{monthly_card_id},</if>
</trim>
</insert>
......@@ -559,6 +595,10 @@
<if test="discountRatio != null">discount_ratio = #{discountRatio},</if>
<if test="duration != null">duration = #{duration},</if>
<if test="balance != null">balance = #{balance},</if>
<if test="rechargeAmount != null">recharge_amount = #{rechargeAmount},</if>
<if test="giftAmount != null">gift_amount = #{giftAmount},</if>
<if test="monthlyCardId != null">monthly_card_id = #{monthlyCardId},</if>
<if test="secondaryCardId != null">secondary_card_id = #{secondaryCardId},</if>
</trim>
where id = #{id}
</update>
......
......@@ -18,6 +18,8 @@
<result property="packPrice" column="pack_price"/>
<result property="usageCount" column="usage_count"/>
<result property="residueCount" column="residue_count"/>
<result property="operationType" column="operation_type"/>
<result property="operationTime" column="operation_time"/>
<result property="isDelete" column="is_delete"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
......@@ -34,6 +36,8 @@
pack_id,
usage_count,
residue_count,
operation_type,
operation_time,
is_delete,
create_by,
create_time,
......@@ -57,6 +61,8 @@
p.price as 'pack_price',
l.usage_count,
l.residue_count,
l.operation_type,
l.operation_time,
l.is_delete,
l.create_by,
l.create_time,
......@@ -74,6 +80,7 @@
<if test="packId != null ">and l.pack_id = #{packId}</if>
<if test="usageCount != null ">and l.usage_count = #{usageCount}</if>
<if test="residueCount != null ">and l.residue_count = #{residueCount}</if>
order by l.create_time
</select>
<select id="selectSecondaryCardLogById" parameterType="Long" resultMap="SecondaryCardLogResult">
......@@ -96,6 +103,8 @@
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="operationType != null">operation_type,</if>
<if test="operationTime != null">operation_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="consumerSecondaryCardId != null">#{consumerSecondaryCardId},</if>
......@@ -110,6 +119,8 @@
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="operationType != null">#{operationType},</if>
<if test="operationTime != null">#{operationTime},</if>
</trim>
</insert>
......@@ -128,6 +139,8 @@
<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="operationType != null">operation_type = #{operationType},</if>
<if test="operationTime != null">operation_time = #{operationTime},</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